This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Call get_remote_state after gdbarch_breakpoint_from_pc is called
- From: Daniel Jacobowitz <drow at false dot org>
- To: Jie Zhang <jie dot zhang at analog dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 7 May 2008 07:36:23 -0400
- Subject: Re: [PATCH] Call get_remote_state after gdbarch_breakpoint_from_pc is called
- References: <4821809E.2010904@analog.com>
On Wed, May 07, 2008 at 06:12:46PM +0800, Jie Zhang wrote:
> Hi,
>
> I'm working on Blackfin port of GDB. Since Blackfin requires that 16-bit
> breakpoint for 16-bit instruction and 32-bit breakpoint for 32-bit
> instruction, Blackfin port GDB tries to read memory, decode instruction,
> and find the instruction length in gdbarch_breakpoint_from_pc. Reading
> memory calls putpkt and getpkt when debugging remotely, which might
> change rs->buf. So we have to call get_remote_state after
> gdbarch_breakpoint_from_pc in remote_insert_breakpoint. Same for
> remote_insert_hw_breakpoint.
You don't need to move the call to get_remote_state, just the read
from rs->buf (or replace p with rs->buf). But this is fine too.
>
> * remote.c (remote_insert_breakpoint): Call get_remote_state
> after gdbarch_breakpoint_from_pc is called.
> (remote_insert_hw_breakpoint): Likewise.
OK.
--
Daniel Jacobowitz
CodeSourcery