From patchwork Tue Jan 20 06:26:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Evans X-Patchwork-Id: 4735 Received: (qmail 21170 invoked by alias); 20 Jan 2015 06:27:03 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 21158 invoked by uid 89); 20 Jan 2015 06:27: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, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f41.google.com Received: from mail-pa0-f41.google.com (HELO mail-pa0-f41.google.com) (209.85.220.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 20 Jan 2015 06:27:00 +0000 Received: by mail-pa0-f41.google.com with SMTP id rd3so43624748pab.0 for ; Mon, 19 Jan 2015 22:26:58 -0800 (PST) X-Received: by 10.70.102.17 with SMTP id fk17mr51256489pdb.61.1421735218237; Mon, 19 Jan 2015 22:26:58 -0800 (PST) Received: from seba.sebabeach.org.gmail.com (173-13-178-53-sfba.hfc.comcastbusiness.net. [173.13.178.53]) by mx.google.com with ESMTPSA id vz1sm1785638pbc.55.2015.01.19.22.26.56 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Jan 2015 22:26:57 -0800 (PST) From: Doug Evans To: gdb-patches@sourceware.org, brobecker@adacore.com Subject: [PATCH][PR symtab/17855] Fix. Date: Mon, 19 Jan 2015 22:26:09 -0800 Message-ID: MIME-Version: 1.0 X-IsSubscribed: yes 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); /* Clear globals which might have pointed into a removed objfile. FIXME: It's not clear which of these are supposed to persist