olduğunu gdb için hızlı bir başlangıç öğreticisi:
Co -g ile mpile:
gcc -g -o test test.c
Yük şimdi gdb içine, ayıklama sembollerini içeren çalıştırılabilir:
gdb --annotate=3 test.exe
Şimdi gdb istemine kendinizi bulmak gerekir. Orada gdb'ye komut verebilirsin. yerel değişkenlerin değerlerini baskı, hat 11'de bir breakpoint ve yürütme adım adım ister Say - Aşağıdaki komutlar dizileri bu konuda size yardımcı olacaktır: Kısacası
(gdb) break test.c:11
Breakpoint 1 at 0x401329: file test.c, line 11.
(gdb) set args 10 20
(gdb) run
Starting program: c:\Documents and Settings\VMathew\Desktop/test.exe 10 20
[New thread 3824.0x8e8]
Breakpoint 1, main (argc=3, argv=0x3d5a90) at test.c:11
(gdb) n
(gdb) print a
$1 = 10
(gdb) n
(gdb) print b
$2 = 20
(gdb) n
(gdb) print c
$3 = 30
(gdb) c
Continuing.
30
Program exited normally.
(gdb)
aşağıdaki komutlar hepsi tüm geçerli komutların listesini ve açıklamasını almak için (gdb) de
break file:lineno - sets a breakpoint in the file at lineno.
set args - sets the command line arguments.
run - executes the debugged program with the given command line arguments.
next (n) and step (s) - step program and step program until it
reaches a different source line, respectively.
print - prints a local variable
bt - print backtrace of all stack frames
c - continue execution.
Tip yardım sorma: gdb kullanmaya başlamak gerekir.
http://www.yolinux.com/TUTORIALS/GDB-Commands.html burada iyi bir gdb komut levhasıdır. Gdb hakkında bilmeniz gereken her şeyi bulacaksınız. – Phong