It is possible. However, you need symbols in order to add symbolic breakpoints, and symbols are provided by debugging info; make sure your assembler and linker are providing those. EDIT With GNU as
, use as -g
. Or just use gcc -g
: if you give it a .s
file, it will invoke the assembler and linker as appropriate.
GDB understands debugging info in several formats: stabs, COFF, PE, DWARF, SOM. (Some of these are executable formats with debugging sections, others are debug info formats that can be embedded into executables, such as ELF.) gcc -g
usually chooses whatever the platform's default is, gcc -ggdb
usually chooses the most expressive (depending on your versions, possibly DWARF-3).
If you have debugging info embedded into or linked to by the executable, gdb
will try to load it automatically. If you have it elsewhere, you may need to use file
to tell gdb
where to find it.
You can still debug without symbolic information. For example, you can issue break *0x89abcdef
to insert a breakpoint at that address, if there's any code there.