From patchwork Sun Sep 29 18:39:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 34714 Received: (qmail 43840 invoked by alias); 29 Sep 2019 18:40:00 -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 43821 invoked by uid 89); 29 Sep 2019 18:40:00 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_SOFTFAIL autolearn=ham version=3.3.1 spammy=H*RU:sk:barracu, outdated, HX-HELO:sk:barracu, HX-Spam-Relays-External:sk:barracu X-HELO: barracuda.ebox.ca Received: from barracuda.ebox.ca (HELO barracuda.ebox.ca) (96.127.255.19) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 29 Sep 2019 18:39:58 +0000 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id uIEjVSQbhdiutVcu (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 29 Sep 2019 14:39:56 -0400 (EDT) Received: from simark.lan (unknown [192.222.164.54]) by smtp.ebox.ca (Postfix) with ESMTP id 57C1F441D65; Sun, 29 Sep 2019 14:39:56 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH] gdb: re-write add_psymbol_to_list doc, move it to header file Date: Sun, 29 Sep 2019 14:39:55 -0400 Message-Id: <20190929183955.22270-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 X-IsSubscribed: yes The comment above the add_psymbol_to_list function seems outdated and misleading, here's an attempt at improving it. gdb/ChangeLog: * psymtab.c (add_psymbol_to_list): Move comment to psympriv.h. * psympriv.h (add_psymbol_to_list): Move comment here and update it. --- gdb/psympriv.h | 35 ++++++++++++++++++++++++++--------- gdb/psymtab.c | 6 +----- 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/gdb/psympriv.h b/gdb/psympriv.h index 9d22f5c9acf5..3e89742d8d57 100644 --- a/gdb/psympriv.h +++ b/gdb/psympriv.h @@ -286,15 +286,32 @@ enum class psymbol_placement GLOBAL }; -/* Add any kind of symbol to a partial_symbol vector. */ - -extern void add_psymbol_to_list (const char *, int, - bool, domain_enum, - enum address_class, - short /* section */, - enum psymbol_placement, - CORE_ADDR, - enum language, struct objfile *); +/* Add a symbol to the partial symbol table of OBJFILE. + + If COPY_NAME is true, make a copy of NAME, otherwise use the passed + reference. + + THECLASS is the type of symbol. + + SECTION is the index of the section of OBJFILE in which the symbol is found. + + WHERE determines whether the symbol goes in the list of static or global + partial symbols of OBJFILE. + + COREADDR is the address of the symbol. For partial symbols that don't have + an address, zero is passed. + + LANGUAGE is the language from which the symbol originates. This will + influence, amongst other things, how the symbol name is demangled. */ + +extern void add_psymbol_to_list (const char *name, int namelength, + bool copy_name, domain_enum domain, + enum address_class theclass, + short section, + psymbol_placement where, + CORE_ADDR coreaddr, + enum language language, + struct objfile *objfile); /* Initialize storage for partial symbols. If partial symbol storage has already been initialized, this does nothing. TOTAL_SYMBOLS is diff --git a/gdb/psymtab.c b/gdb/psymtab.c index 031dbd9c1efe..ba4af713ff54 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -1605,11 +1605,7 @@ append_psymbol_to_list (std::vector *list, OBJSTAT (objfile, n_psyms++); } -/* Add a symbol with a long value to a psymtab. - Since one arg is a struct, we pass in a ptr and deref it (sigh). - The only value we need to store for psyms is an address. - For all other psyms pass zero for COREADDR. - Return the partial symbol that has been added. */ +/* See psympriv.h. */ void add_psymbol_to_list (const char *name, int namelength, bool copy_name,