From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6138 invoked by alias); 7 May 2008 11:36:46 -0000 Received: (qmail 6130 invoked by uid 22791); 7 May 2008 11:36:46 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 07 May 2008 11:36:26 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 470799835A; Wed, 7 May 2008 11:36:24 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 1DAA098011; Wed, 7 May 2008 11:36:23 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1Jthwd-0008Ig-5N; Wed, 07 May 2008 07:36:23 -0400 Date: Wed, 07 May 2008 12:56:00 -0000 From: Daniel Jacobowitz To: Jie Zhang Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Call get_remote_state after gdbarch_breakpoint_from_pc is called Message-ID: <20080507113623.GA31787@caradoc.them.org> Mail-Followup-To: Jie Zhang , gdb-patches@sourceware.org References: <4821809E.2010904@analog.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4821809E.2010904@analog.com> User-Agent: Mutt/1.5.17 (2007-12-11) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-05/txt/msg00261.txt.bz2 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