This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] remote.c: adjust Z packet addr using BREAKPOINT_FROM_PC
- To: jtc at redback dot com
- Subject: Re: [RFA] remote.c: adjust Z packet addr using BREAKPOINT_FROM_PC
- From: Nick Duffek <nsd at redhat dot com>
- Date: Tue, 9 Jan 2001 00:17:11 -0500
- CC: gdb-patches at sources dot redhat dot com
- References: <5m1yudxsvf.fsf@jtc.redback.com>
On 8-Jan-2001, J . T . Conklin wrote:
>The GDB internals manual indicates that BREAKPOINT_FROM_PC() may
>adjust the address.
Yes, and that's exactly why I want to move it: so that the target
architecture can adjust the address.
(Specifically, I want to convert the address from a byte address to an
instruction space pointer. This entails (a) removing the IMEM_START bit
added by the harvard architecture mechanism and (b) dividing the address
by 8.)
>I think the reason that BREAKPOINT_FROM_PC() is called is to get the
>size of the breakpoint.
That's all it does prior to my patch. But elsewhere in GDB, namely in
mem-break.c, BREAKPOINT_FROM_PC serves as a generic way for target
architectures to modify the address and other attributes of a breakpoint
before it hits the hardware.
Maybe that's an argument for replacing target_insert_breakpoint() with a
wrapper that calls BREAKPOINT_FROM_PC.
>but it would seem that the debug agent could then install the break in
>the wrong location.
I don't think that's a problem. BREAKPOINT_FROM_PC doesn't modify the
address unless the target architecture author explicitly causes it to do
so, in which case it's presumably the right thing to do.
Nick