Sunday, July 16, 2006

gdb in emacs

M-x compile (update 4/9/2013: need debug info in your complilation, such as "g++ -g2 test.c")

gdb
file example1 (
update 4/9/2013example1 is the execuatable file, such as "a.out")
run
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)
next:
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