Saturday, May 06, 2006

gdb in emacs

my makefile:

ex1: ex1.c
gcc -g -o ex1 ex1.c
q1: q1.c
gcc -g -o q1 q1.c

tmp1: tmp1.c
gcc -g -o tmp1 tmp1.c

M-x compile
file example1
break: M-x space (break 19, break tmp1.c:19, break func1)
tbreak: only stop once then gone (temporary)
disable: disable breakpoints
ignore 2 5: skip next 5 corssing of breakpoint
step: step (into the function)
finish: done the function and return
until: run until spcified line
print : check value
set x=3; modify variables
info breakpoints
delete breakpints (delete N)
watch x: will show new and old x when x changes

No comments:

Post a Comment