Re: Debug code in data section in gdb

Michael Elizabeth Chastain
2004-06-22T22:09:00Z

Hi Tao,

It sounds like, perhaps, you are placing the breakpoint first,
and then copying the code on top of the location of the breakpoint.

The way gdb sets breakpoints (usually) is that gdb writes a BREAKPOINT
instruction into the memory at the address indicated. So if you
set a breakpoint first, then overwrite that memory with your own
contents, then you will overwrite the BREAKPOINT instruction and
lose it.

Can you capture a complete gdb session with the 'script' command
and mail it in?

Michael C
GDB QA Guy