From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6573 invoked by alias); 12 Aug 2002 20:04:25 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 6558 invoked from network); 12 Aug 2002 20:04:24 -0000 Received: from unknown (HELO tomago.toronto.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 12 Aug 2002 20:04:24 -0000 Received: (from graces@localhost) by tomago.toronto.redhat.com (8.11.6/8.11.6) id g7CK4NZ23480 for gdb-patches@sources.redhat.com; Mon, 12 Aug 2002 16:04:23 -0400 Date: Mon, 12 Aug 2002 13:04:00 -0000 From: Grace Sainsbury To: gdb-patches@sources.redhat.com Subject: [rfa] insert_hw_breakpoint Message-ID: <20020812160423.A23001@tomago.toronto.redhat.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="+QahgC5+KEYLbs62" Content-Disposition: inline User-Agent: Mutt/1.2.5.1i X-SW-Source: 2002-08/txt/msg00276.txt.bz2 --+QahgC5+KEYLbs62 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 257 I fixed a little bug in the insert/remove_hw_breakpoint functions. ok to commit? grace 2002-08-12 Grace Sainsbury * remote.c (remote_insert_hw_breakpoint) (remote_remove_hw_breakpoint): Fix calculation of length field Z-packet. --+QahgC5+KEYLbs62 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=patch Content-length: 1190 Index: remote.c =================================================================== RCS file: /cvs/src/src/gdb/remote.c,v retrieving revision 1.91 diff -u -r1.91 remote.c --- remote.c 9 Aug 2002 16:41:24 -0000 1.91 +++ remote.c 12 Aug 2002 20:00:30 -0000 @@ -4985,11 +4985,11 @@ char *buf = alloca (rs->remote_packet_size); char *p = buf; - /* The length field should be set to soething so that the packet is - well formed. */ + /* The length field should be set to the size of a breakpoint + instruction. */ - len = strlen (shadow); - len = len ? len : 1; + BREAKPOINT_FROM_PC (&addr, &len); + if (remote_protocol_Z[Z_PACKET_HARDWARE_BP].support == PACKET_DISABLE) error ("Can't set hardware breakpoint without the '%s' (%s) packet\n", remote_protocol_Z[Z_PACKET_HARDWARE_BP].name, @@ -5027,7 +5027,8 @@ char *buf = alloca (rs->remote_packet_size); char *p = buf; - len = sizeof (shadow); + BREAKPOINT_FROM_PC (&addr, &len); + if (remote_protocol_Z[Z_PACKET_HARDWARE_BP].support == PACKET_DISABLE) error ("Can't clear hardware breakpoint without the '%s' (%s) packet\n", remote_protocol_Z[Z_PACKET_HARDWARE_BP].name, --+QahgC5+KEYLbs62--