Reset breakpoint after load?

Jie Zhang jie.zhang@analog.com
Tue Jan 19 07:36:00 GMT 2010


Hi,

While testing Blackfin GCC on bare metal using gdb-comm.exp, I found a 
problem, which I don't know if it's a bug of gdb or by design.

gdb-comm.exp sets breakpoints on exit and abort before load. The problem 
is that GDB tries to skip prologue according to what it reads from 
memory, which might contain random data since the executable has not 
been loaded into memory. In my case, sometimes skip_prologue might skip 
one or two more instructions, which happens to be an exception 
instruction and will trap the processor into an exception event loop 
after running the executable before hit the breakpoints.

Currently I change gdb-comm.exp to set breakpoints after load. In this 
way GDB can set breakpoints in the correct addresses and our GCC testing 
runs fine. But Is it a good idea to ask GDB to reset breakpoints after 
load just as we do on connecting to a new target?


Thanks,
Jie



More information about the Gdb mailing list