From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7976 invoked by alias); 22 Jan 2015 11:42:02 -0000 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 Received: (qmail 7959 invoked by uid 89); 22 Jan 2015 11:42:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 22 Jan 2015 11:41:59 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t0MBfrR4006711 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 22 Jan 2015 06:41:54 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t0MBfqFk016802; Thu, 22 Jan 2015 06:41:53 -0500 Message-ID: <54C0E1FF.4050201@redhat.com> Date: Thu, 22 Jan 2015 11:42:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Doug Evans , gdb-patches@sourceware.org, brobecker@adacore.com Subject: Re: [PATCH][PR symtab/17855] Fix. References: In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-01/txt/msg00585.txt.bz2 On 01/20/2015 06:26 AM, Doug Evans wrote: > Hi. > > This patch fixes symtab/17855. > Basically the issue is that breakpoint_re_set is currently being called > before observer_notify_new_objfile (NULL), and thus the ada symbol > cache (and the general symbol cache of a separate patch) aren't being > flushed first, so that when breakpoints are reset symbol lookup is being > done on a stale cache. > > Regression tested on amd64-linux. > > 2015-01-19 Doug Evans > > PR symtab/17855 > * symfile.c (clear_symtab_users): Notify observers of change before > calling breakpoint_re_set. > > diff --git a/gdb/symfile.c b/gdb/symfile.c > index d55e361..ad481de 100644 > --- a/gdb/symfile.c > +++ b/gdb/symfile.c > @@ -3023,6 +3023,12 @@ clear_symtab_users (int add_flags) > /* Someday, we should do better than this, by only blowing away > the things that really need to be blown. */ > > + /* Notify anyone listening that the previous loaded symtab(s) are invalid. > + It is important to do this before calling breakpoint_re_set as the latter > + will try to look up symbols, and for example the symbol cache needs to > + be flushed first. */ > + observer_notify_new_objfile (NULL); > + > /* Clear the "current" symtab first, because it is no longer valid. > breakpoint_re_set may try to access the current symtab. */ > clear_current_source_symtab_and_line (); > @@ -3032,7 +3038,6 @@ clear_symtab_users (int add_flags) > breakpoint_re_set (); > clear_last_displayed_sal (); > clear_pc_function_cache (); > - observer_notify_new_objfile (NULL); Looking at the whole function, ISTM that the breakpoint_re_set call should move further down. I can imagine that breakpoint_re_set could well hit a stale pc function cache, cleared only after by clear_pc_function_cache. breakpoint.c:parse_breakpoint_sals also references the last displayed sal. One would hope that breakpoint re-set is independent of that, though the existing comment about breakpoint_re_set accessing the current symtab leaves me wondering. WDYT? Thanks, Pedro Alves