This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Reset breakpoint after load?
- From: Jie Zhang <jie dot zhang at analog dot com>
- To: gdb at sourceware dot org
- Date: Tue, 19 Jan 2010 15:36:00 +0800
- Subject: Reset breakpoint after load?
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