09-21-05 07:50 AM
Hi,
ern schrieb:
> I'm using gcc in Linux to compile my program. Is there a way to step
> through the code in some kind of debugger mode? Thanks.
>
compile your code with -g flag,
gcc -g project.c -o project
the -g flag produces debug informations on the binary, which is
especially usable for gdb. You can also use some additional flags to
produce debug information in other formats.
After the compilition open the binary with gdb.
gdb project
you'll get a subshell, for the most important commandos on this subshell
(run, break, step, where etc.) pleas read the help. There're also some
GUI tools, ddd i.E. is a nice frontend for gdb.
Have fun
cheers
Luotao Fu
[ Post a follow-up to this message ]
|