From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13911 invoked by alias); 27 Apr 2007 22:16:07 -0000 Received: (qmail 13887 invoked by uid 22791); 27 Apr 2007 22:16:05 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 27 Apr 2007 23:16:03 +0100 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l3RMG1co026995 for ; Fri, 27 Apr 2007 18:16:01 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l3RMG0sg003212 for ; Fri, 27 Apr 2007 18:16:00 -0400 Received: from ironwood.lan (vpn-14-75.rdu.redhat.com [10.11.14.75]) by pobox.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l3RMG0mA015901 for ; Fri, 27 Apr 2007 18:16:00 -0400 Date: Fri, 27 Apr 2007 22:25:00 -0000 From: Kevin Buettner To: gdb-patches@sources.redhat.com Subject: [rfc] Set a breakpoint's type before adjusting its address Message-ID: <20070427151559.0394bfa0@ironwood.lan> X-Mailer: Sylpheed-Claws 2.6.0 (GTK+ 2.10.4; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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: 2007-04/txt/msg00365.txt.bz2 At the moment, running GDB on an FR-V target will generate lots of "reading through apparently deleted breakpoint" warnings. This is due to the fact that (due to architectural constraints) FR-V needs to adjust breakpoint addresses. When it does so, it reads through read_memory_nobpt(), triggering the warning due to the fact that the breakpoint's type hasn't been set yet. The patch below moves the type assignment prior to the adjustment thus avoiding this situation. Comments? * breakpoint.c (set_raw_breakpoint): Set breakpoint type before attempting to adjust its address. Index: gdb/breakpoint.c =================================================================== RCS file: /cvs/src/src/gdb/breakpoint.c,v retrieving revision 1.244 diff -u -p -r1.244 breakpoint.c --- gdb/breakpoint.c 10 Apr 2007 14:53:46 -0000 1.244 +++ gdb/breakpoint.c 27 Apr 2007 22:06:44 -0000 @@ -4213,6 +4213,14 @@ set_raw_breakpoint (struct symtab_and_li b = (struct breakpoint *) xmalloc (sizeof (struct breakpoint)); memset (b, 0, sizeof (*b)); + + /* Set type before performing breakpoint adjustment. If the breakpoint + needs to be adjusted, it's possible that this raw breakpoint will be + read by read_memory_nobpt(). If the type is unset (zero), the + "reading through apparently deleted breakpoint" warning will be + triggered. */ + b->type = bptype; + b->loc = allocate_bp_location (b, bptype); b->loc->requested_address = sal.pc; b->loc->address = adjust_breakpoint_address (b->loc->requested_address, @@ -4223,7 +4231,6 @@ set_raw_breakpoint (struct symtab_and_li b->source_file = savestring (sal.symtab->filename, strlen (sal.symtab->filename)); b->loc->section = sal.section; - b->type = bptype; b->language = current_language->la_language; b->input_radix = input_radix; b->thread = -1;