GDB: basics
Before Debugging, generating the debugging info using gcc -g3 *.c/cpp;
then gdb ~.out/exe
using commands:
b [n] set breakpoint at line n
r [re]run the program
l look the code around cur-line
n step into
c continue run
x/nfu &i check ram after i. n=int; f=2t8o16x float(f), char(c), string(s),instruction(i), unsigned decimal(u), address(a); u=bhwg, byte/short/int/double
p i print var i value
p/x i print i as hex
create a file named debugscript: r command parameters..
run gdb and input souce debugscript.. start running script with that script...
Anyone is permitted to copy/use the contents and codes from this blog.
Sansna is not going to guarantee anything, Sansna will not take any responsibility of any results after using these codes/contents.
浙公网安备 33010602011771号