This is the mail archive of the
mailing list for the GDB project.
Re: handle hardware breakpoints in overlays
- To: jtc at redback dot com
- Subject: Re: handle hardware breakpoints in overlays
- From: Michael Snyder <msnyder at cygnus dot com>
- Date: Tue, 05 Oct 1999 16:12:39 -0700
- CC: gdb-patches at sourceware dot cygnus dot com
- Organization: Cygnus Solutions
- References: <firstname.lastname@example.org>
J.T. Conklin wrote:
> However, I did not change the code that inserts/removes the break-
> point at the LMA address, since no hardware breakpoint was reserved
> for that. In fact, it is unclear to me why such a breakpoint is ever
> inserted, since the execution should never reach the LMA address.
No, but if you think about the way overlays work
(or can be expected to work in at least some implementations),
the code is going to be copied from the LMA address to the
VMA address by some software agent, without the debugger's
knowledge or participation.
If you put a trap instruction in the code at the LMA address,
that trap instruction will be copied into the VMA location
along with the rest of the code, and then get executed.
The overlay logic in GDB should then figure out that it's
the "same" breakpoint trap.