From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13101 invoked by alias); 7 May 2008 11:58:19 -0000 Received: (qmail 13093 invoked by uid 22791); 7 May 2008 11:58:18 -0000 X-Spam-Check-By: sourceware.org Received: from nwd2mail10.analog.com (HELO nwd2mail10.analog.com) (137.71.25.55) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 07 May 2008 11:57:48 +0000 X-IronPort-AV: E=Sophos;i="4.27,448,1204520400"; d="scan'208";a="67873765" Received: from nwd2mhb2.analog.com ([137.71.6.12]) by nwd2mail10.analog.com with ESMTP; 07 May 2008 07:57:46 -0400 Received: from nwd2exm4.ad.analog.com (nwd2exm4.ad.analog.com [10.64.53.123]) by nwd2mhb2.analog.com (8.9.3 (PHNE_28810+JAGae91741)/8.9.3) with ESMTP id HAA06946; Wed, 7 May 2008 07:57:48 -0400 (EDT) Received: from chinexm1.ad.analog.com ([10.99.27.42]) by nwd2exm4.ad.analog.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 7 May 2008 07:57:45 -0400 Received: from [192.168.1.138] ([10.99.22.89]) by chinexm1.ad.analog.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 7 May 2008 19:57:42 +0800 Message-ID: <48219935.1060802@analog.com> Date: Wed, 07 May 2008 20:56:00 -0000 From: Jie Zhang User-Agent: Mozilla-Thunderbird 2.0.0.12 (X11/20080420) MIME-Version: 1.0 To: Daniel Jacobowitz CC: gdb-patches@sourceware.org Subject: Re: [PATCH] Call get_remote_state after gdbarch_breakpoint_from_pc is called References: <4821809E.2010904@analog.com> <20080507113623.GA31787@caradoc.them.org> In-Reply-To: <20080507113623.GA31787@caradoc.them.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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/msg00264.txt.bz2 Daniel Jacobowitz wrote: > 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. > Committed. Thanks. Jie