r: run program r arg1 arg2: run with arguments k: kill debugging s: step into - stopped after run current line if it is function control entered the function inside. n: same with 's' command but do not enter the function inside.
* s, n command will be followed by number ex) s 5 == s 5 times
** you can use Enter key to use continuouly s or n commnad.
break point has its own unique number starting 1.
ReplyDeleteyou can use 'condition' command to set condition to set break point.
If you want to set break-point only one time you can use 'tb' command instead of 'b' command.
If you want to clear break-point use 'clear' command or 'cl'.
d command will clear all of the break-point.
If you want to enable or disable specific break-point you must know the number of break-point.
ReplyDeletegdb support 'info breakpoints' or short version 'info b'. by using 'info b' you can see all the break-points it also supports break-point number.
you can use 'enable' or 'disable' command now.
syntax:
enable break-point-number
disable break-point-number
break-point number is useful when you are using many source files.
gdb command for program flow control
ReplyDeleter: run program
r arg1 arg2: run with arguments
k: kill debugging
s: step into - stopped after run current line if it is function control entered the function inside.
n: same with 's' command but do not enter the function inside.
* s, n command will be followed by number ex) s 5 == s 5 times
** you can use Enter key to use continuouly s or n commnad.
c: continue to meet the break-point
other important command to exit for statement or function.
ReplyDeleteu: exit from loop such as for statement
finish: go to the end of function.
return: to exit without run remain code of the function.
si, ni command
ReplyDeletesi, ni is same with s, n command but it execute only one instruction not statement.