From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1715 invoked by alias); 27 Jun 2008 18:18:00 -0000 Received: (qmail 1641 invoked by uid 22791); 27 Jun 2008 18:17:58 -0000 X-Spam-Check-By: sourceware.org Received: from snape.ecoscentric.com (HELO snape.ecoscentric.com) (212.13.207.199) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 27 Jun 2008 18:17:31 +0000 Received: from localhost (snape.ecoscentric.com [127.0.0.1]) by snape.ecoscentric.com (Postfix) with ESMTP id 8C68CC54117 for ; Fri, 27 Jun 2008 19:17:28 +0100 (BST) Received: from snape.ecoscentric.com ([127.0.0.1]) by localhost (snape.ecoscentric.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id E229O6pw4LFw; Fri, 27 Jun 2008 19:17:26 +0100 (BST) Message-ID: <48652EB5.2010008@eCosCentric.com> Date: Fri, 27 Jun 2008 18:22:00 -0000 From: Jonathan Larmour User-Agent: Thunderbird 1.5.0.12 (X11/20070530) MIME-Version: 1.0 To: gdb-patches@sourceware.org Subject: Re: remote.c Z0 packet detection robustness References: <48650D79.6080502@eCosCentric.com> <20080627163748.GA4724@caradoc.them.org> In-Reply-To: <20080627163748.GA4724@caradoc.them.org> OpenPGP: id=A5FB74E6 Content-Type: multipart/mixed; boundary="------------090805070609030706020204" 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-06/txt/msg00511.txt.bz2 This is a multi-part message in MIME format. --------------090805070609030706020204 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-length: 781 Daniel Jacobowitz wrote: > On Fri, Jun 27, 2008 at 04:55:37PM +0100, Jonathan Larmour wrote: >> 2008-06-27 Jonathan Larmour >> >> * remote.c (remote_insert_breakpoint): Ensure that if Z0 >> unsupported and we fall back to memory_insert_breakpoint, we >> use the unmodified requested address. > > Thanks for the clear explanation. This is almost OK - but you need to > update bp_tgt if Z0 succeeds. Otherwise we may remove the breakpoint > incorrectly. Is this better? Jifl -- eCosCentric Limited http://www.eCosCentric.com/ The eCos experts Barnwell House, Barnwell Drive, Cambridge, UK. Tel: +44 1223 245571 Registered in England and Wales: Reg No 4422071. ------["Si fractum non sit, noli id reficere"]------ Opinions==mine --------------090805070609030706020204 Content-Type: text/x-patch; name="remote.c.v2.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="remote.c.v2.patch" Content-length: 1302 --- gdb-6.8.50.20080620/gdb/remote.c.old 2008-06-11 13:56:36.000000000 +0100 +++ gdb-6.8.50.20080620/gdb/remote.c 2008-06-27 18:26:41.000000000 +0100 @@ -5250,12 +5250,13 @@ remote_insert_breakpoint (struct bp_targ if (remote_protocol_packets[PACKET_Z0].support != PACKET_DISABLE) { - CORE_ADDR addr; + CORE_ADDR addr = bp_tgt->placed_address; struct remote_state *rs; char *p; + int bpsize; gdbarch_breakpoint_from_pc - (current_gdbarch, &bp_tgt->placed_address, &bp_tgt->placed_size); + (current_gdbarch, &addr, &bpsize); rs = get_remote_state (); p = rs->buf; @@ -5263,9 +5264,9 @@ remote_insert_breakpoint (struct bp_targ *(p++) = 'Z'; *(p++) = '0'; *(p++) = ','; - addr = (ULONGEST) remote_address_masked (bp_tgt->placed_address); + addr = (ULONGEST) remote_address_masked (addr); p += hexnumstr (p, addr); - sprintf (p, ",%d", bp_tgt->placed_size); + sprintf (p, ",%d", bpsize); putpkt (rs->buf); getpkt (&rs->buf, &rs->buf_size, 0); @@ -5275,6 +5276,8 @@ remote_insert_breakpoint (struct bp_targ case PACKET_ERROR: return -1; case PACKET_OK: + bp_tgt->placed_address = addr; + bp_tgt->placed_size = bpsize; return 0; case PACKET_UNKNOWN: break; --------------090805070609030706020204--