From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1945 invoked by alias); 25 Oct 2004 16:10:47 -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 1795 invoked from network); 25 Oct 2004 16:10:41 -0000 Received: from unknown (HELO webmail.streamline-computing.com) (82.133.39.164) by sourceware.org with SMTP; 25 Oct 2004 16:10:41 -0000 Received: from amavis by webmail.streamline-computing.com with scanned-ok (Exim 3.35 #1 (Debian)) id 1CM7RP-000162-00 for ; Mon, 25 Oct 2004 17:11:27 +0100 Received: from webmail.streamline-computing.com ([127.0.0.1]) by localhost (webmail [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 04126-02 for ; Mon, 25 Oct 2004 17:11:26 +0100 (BST) Received: from [82.133.39.162] (helo=[192.168.1.74]) by webmail.streamline-computing.com with esmtp (Exim 3.35 #1 (Debian)) id 1CM7RO-00015t-00 for ; Mon, 25 Oct 2004 17:11:26 +0100 Subject: Re: [PATCH] Seg fault whilst stepping when watch set [ping!] From: David Lecomber To: patches In-Reply-To: <1097972182.22738.7.camel@localhost.localdomain> References: <1097972182.22738.7.camel@localhost.localdomain> Content-Type: multipart/mixed; boundary="=-hUKGzAv/Qkh2KZoieOwz" Message-Id: <1098720391.1935.0.camel@delmo.priv.wark.uk.streamline-computing.com> Mime-Version: 1.0 Date: Mon, 25 Oct 2004 16:10:00 -0000 X-Virus-Scanned: Scanned by Amavis on Capitan at streamline-computing.com X-SW-Source: 2004-10/txt/msg00404.txt.bz2 --=-hUKGzAv/Qkh2KZoieOwz Content-Type: text/plain Content-Transfer-Encoding: 7bit Content-length: 1124 One week ping.. Ping!! d. On Sun, 2004-10-17 at 01:16, David Lecomber wrote: > Unfortunately I can't reproduce this without the intel compiler/f90. > However, the relevant GDB output was: > (gdb) r > Starting program: /home/david/f90demo > [Thread debugging using libthread_db enabled] > [New Thread -151084928 (LWP 24298)] > [Switching to Thread -151084928 (LWP 24298)] > > Breakpoint 1, 0x08089e8a in main () > (gdb) step > Single stepping until exit from function main, > which has no line number information. > > sample () at f90demo.f90:72 > 72 CALL MPI_INIT(ierr) > Current language: auto; currently fortran > (gdb) watch i > Hardware watchpoint 2: i > (gdb) step > Error in re-setting breakpoint 2: > No symbol "i" in current context. > > > This being line when breakpoint.c:949 calls evaluate_expression where > exp is 0. > > I propose the attached, which has fixed this seg fault on my system. > Permission to commit? > > 2004-10-17 > > * breakpoint.c (insert_bp_location): Regenerate expression in > breakpoint owner for watchpoints if null. > > --=-hUKGzAv/Qkh2KZoieOwz Content-Disposition: attachment; filename=watch.patch Content-Type: text/x-patch; name=watch.patch; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Content-length: 767 Index: gdb/breakpoint.c =================================================================== RCS file: /cvs/src/src/gdb/breakpoint.c,v retrieving revision 1.183 diff -c -p -r1.183 breakpoint.c *** gdb/breakpoint.c 8 Oct 2004 17:30:46 -0000 1.183 --- gdb/breakpoint.c 17 Oct 2004 00:01:44 -0000 *************** insert_bp_location (struct bp_location * *** 946,951 **** --- 946,953 ---- Make sure the value returned isn't lazy; we use laziness to determine what memory GDB actually needed in order to compute the value of the expression. */ + if (!bpt->owner->exp) + bpt->owner->exp = parse_expression (bpt->owner->exp_string); v = evaluate_expression (bpt->owner->exp); VALUE_CONTENTS (v); value_release_to_mark (mark); --=-hUKGzAv/Qkh2KZoieOwz--