[review v2] Replace the MSYMBOL_*_NAME macros with member functions

Christian Biesinger (Code Review) gerrit@gnutoolchain-gerrit.osci.io
Fri Nov 22 00:17:00 GMT 2019


Christian Biesinger has posted comments on this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/688
......................................................................


Patch Set 2:

(2 comments)

| --- gdb/symtab.h
| +++ gdb/symtab.h
| @@ -75,15 +75,19 @@ enum class symbol_name_match_type
|    SEARCH_NAME,
|  
|    /* Expression matching.  The same as FULL matching in most
|       languages.  The same as WILD matching in Ada.  */
|    EXPRESSION,
|  };
|  
| +/* Whether to demangle the print name of symbols.  */
| +
| +extern bool demangle;

PS1, Line 84:

Done

| +
|  /* Hash the given symbol search name according to LANGUAGE's
|     rules.  */
|  extern unsigned int search_name_hash (enum language language,
|  				      const char *search_name);
|  
|  /* Ada-specific bits of a lookup_name_info object.  This is lazily
|     constructed on demand.  */
|  

 ...

| @@ -380,2 +384,19 @@ /* This structure is space critical.  See space comments at the top.  */
|  struct general_symbol_info
|  {
| +  /* Short version as to when to use which name accessor:
| +     Use natural_name () to refer to the name of the symbol in the original
| +     source code.  Use linkage_name () if you want to know what the linker
| +     thinks the symbol's name is.  Use print_name () for output.  Use
| +     demangled_name () if you specifically need to know whether natural_name ()
| +     and linkage_name () are different.  */
| +
| +  const char *linkage_name () const {

PS1, Line 393:

Done

| +    return name;
| +  }
| +
| +  /* Return SYMBOL's "natural" name, i.e. the name that it was called in
| +     the original source code.  In languages like C++ where symbols may
| +     be mangled for ease of manipulation by the linker, this is the
| +     demangled name.  */
| +  const char *natural_name () const;
| +

-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: I65aa529843a9903e174ce799037e41f954a9fcee
Gerrit-Change-Number: 688
Gerrit-PatchSet: 2
Gerrit-Owner: Christian Biesinger <cbiesinger@google.com>
Gerrit-Reviewer: Christian Biesinger <cbiesinger@google.com>
Gerrit-CC: Simon Marchi <simon.marchi@polymtl.ca>
Gerrit-Comment-Date: Fri, 22 Nov 2019 00:17:21 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Simon Marchi <simon.marchi@polymtl.ca>
Gerrit-MessageType: comment



More information about the Gdb-patches mailing list