This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: handle hardware breakpoints in overlays


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]