From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30025 invoked by alias); 5 Dec 2014 07:56:11 -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 30014 invoked by uid 89); 5 Dec 2014 07:56:10 -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-pd0-f179.google.com Received: from mail-pd0-f179.google.com (HELO mail-pd0-f179.google.com) (209.85.192.179) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 05 Dec 2014 07:56:08 +0000 Received: by mail-pd0-f179.google.com with SMTP id w10so225997pde.10 for ; Thu, 04 Dec 2014 23:56:07 -0800 (PST) X-Received: by 10.68.215.67 with SMTP id og3mr32372300pbc.117.1417766167174; Thu, 04 Dec 2014 23:56:07 -0800 (PST) Received: from seba.sebabeach.org.gmail.com (173-13-178-50-sfba.hfc.comcastbusiness.net. [173.13.178.50]) by mx.google.com with ESMTPSA id d14sm15676068pdj.46.2014.12.04.23.56.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Dec 2014 23:56:06 -0800 (PST) From: Doug Evans To: Gary Benson Cc: gdb-patches@sourceware.org, Eli Zaretskii Subject: Re: [PATCH 1/3 v2] Add expansion_notify callback to expand_symtabs_matching References: <1417094168-25868-1-git-send-email-gbenson@redhat.com> <1417094168-25868-2-git-send-email-gbenson@redhat.com> Date: Fri, 05 Dec 2014 07:56:00 -0000 In-Reply-To: <1417094168-25868-2-git-send-email-gbenson@redhat.com> (Gary Benson's message of "Thu, 27 Nov 2014 13:16:06 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2014-12/txt/msg00120.txt.bz2 Gary Benson writes: > This commit adds a new callback parameter, "expansion_notify", to the > top-level expand_symtabs_matching function and to all the vectorized > functions it defers to. If expansion_notify is non-NULL, it will be > called every time a symbol table is expanded. > > gdb/ChangeLog: > > * symfile.h (expand_symtabs_exp_notify_ftype): New typedef. > (struct quick_symbol_functions) : > New argument expansion_notify. All uses updated. > (expand_symtabs_matching): New argument expansion_notify. > All uses updated. > * symfile-debug.c (debug_qf_expand_symtabs_matching): > Also print expansion notify. > * symtab.c (expand_symtabs_matching_via_partial): Call > expansion_notify whenever a partial symbol table is expanded. > * dwarf2read.c (dw2_expand_symtabs_matching): Call > expansion_notify whenever a symbol table is instantiated. Hi. Just a few comments. > [...] > diff --git a/gdb/psymtab.c b/gdb/psymtab.c > index 2fc882f..17f5b11 100644 > --- a/gdb/psymtab.c > +++ b/gdb/psymtab.c > @@ -1373,6 +1373,7 @@ expand_symtabs_matching_via_partial > (struct objfile *objfile, > expand_symtabs_file_matcher_ftype *file_matcher, > expand_symtabs_symbol_matcher_ftype *symbol_matcher, > + expand_symtabs_exp_notify_ftype *expansion_notify, > enum search_domain kind, > void *data) > { > @@ -1415,7 +1416,13 @@ expand_symtabs_matching_via_partial > } > > if (recursively_search_psymtabs (ps, objfile, kind, symbol_matcher, data)) > - psymtab_to_symtab (objfile, ps); > + { > + struct compunit_symtab *symtab = > + psymtab_to_symtab (objfile, ps); > + > + if (expansion_notify != NULL) > + expansion_notify (symtab, data); Check for symtab == NULL. Also, dwarf2read.c does a symtab_was_null dance. Seems like we should do that here too (or, if unnecessary, add a comment explaining why it is unnecessary). > + } > } > } > Still reading through the other patches.