From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14439 invoked by alias); 12 Aug 2002 20:27:56 -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 14424 invoked from network); 12 Aug 2002 20:27:52 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 12 Aug 2002 20:27:52 -0000 Received: from int-mx2.corp.redhat.com (nat-pool-rdu.redhat.com [172.16.52.200] (may be forged)) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id g7CKEIl08368 for ; Mon, 12 Aug 2002 16:14:18 -0400 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx2.corp.redhat.com (8.11.6/8.11.6) with ESMTP id g7CKRnu02827; Mon, 12 Aug 2002 16:27:49 -0400 Received: from romulus.sfbay.redhat.com (remus.sfbay.redhat.com [172.16.27.252]) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id g7CKRle19574; Mon, 12 Aug 2002 13:27:48 -0700 Received: (from kev@localhost) by romulus.sfbay.redhat.com (8.11.6/8.11.6) id g7CKRki00919; Mon, 12 Aug 2002 13:27:46 -0700 Date: Mon, 12 Aug 2002 13:27:00 -0000 From: Kevin Buettner Message-Id: <1020812202745.ZM918@localhost.localdomain> In-Reply-To: Grace Sainsbury "[rfa] insert_hw_breakpoint" (Aug 12, 4:04pm) References: <20020812160423.A23001@tomago.toronto.redhat.com> To: Grace Sainsbury , gdb-patches@sources.redhat.com Subject: Re: [rfa] insert_hw_breakpoint MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-08/txt/msg00278.txt.bz2 On Aug 12, 4:04pm, Grace Sainsbury wrote: > - 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, Do stubs actually care about this length field for the packets under consideration? I agree that the use of strlen() and sizeof() seem dubious if not outright wrong, but, unfortunately, not all architectures can define a sensible BREAKPOINT_FROM_PC. (*) I would like to see gdb relying less on BREAKPOINT_FROM_PC, not more. (*) E.g, IA-64. For IA-64, I did define a BREAKPOINT_FROM_PC, but I would have preferred not to. The values returned by ia64_breakpoint_from_pc() are fairly arbitrary and are of absolutely no use for saving/restoring actual breakpoints. Kevin