gdb: Override store_sym_names_in_linkage_form_p for Go language
authorAndrew Burgess <andrew.burgess@embecosm.com>
Wed, 8 Jul 2020 10:09:45 +0000 (11:09 +0100)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Wed, 16 Sep 2020 09:16:49 +0000 (10:16 +0100)
When store_sym_names_in_linkage_form_p was introduced in this commit:

  commit 59cc4834e53565da1de4a7b615ed8890ed55c7da
  Date:   Tue Mar 27 08:57:16 2018 -0500

      problem looking up some symbols when they have a linkage name

A special case was left behind for Go, however, this special case was
not really needed anymore, it could be handled by having
store_sym_names_in_linkage_form_p return the true for go, instead of
false.

This commit overrides store_sym_names_in_linkage_form_p for Go, and
then removes the special case.  As store_sym_names_in_linkage_form_p
is only called once throughout GDB this should be perfectly safe.

There should be no user visible changes after this commit.

gdb/ChangeLog:

* dwarf2/read.c (dwarf2_physname): Remove special case for
language_go.
* go-lang.c (go_language::store_sym_names_in_linkage_form_p): New
member function.

gdb/ChangeLog
gdb/dwarf2/read.c
gdb/go-lang.c

index ac4ec6fde7fe4133420c920c70b1996904886ef1..ce9d3ae778bc70671a35d7df68d11e7bb9dc5109 100644 (file)
@@ -1,3 +1,10 @@
+2020-09-16  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+       * dwarf2/read.c (dwarf2_physname): Remove special case for
+       language_go.
+       * go-lang.c (go_language::store_sym_names_in_linkage_form_p): New
+       member function.
+
 2020-09-16  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * ada-lang.c (ada_language_data): Remove
index 16001aa9e9bcb6f53a8c94da3f7dc1f4b9424cd4..d0398ef914f3a04e88022a9744d00e482f828c32 100644 (file)
@@ -10639,12 +10639,6 @@ dwarf2_physname (const char *name, struct die_info *die, struct dwarf2_cu *cu)
        {
          /* Do nothing (do not demangle the symbol name).  */
        }
-      else if (cu->language == language_go)
-       {
-         /* This is a lie, but we already lie to the caller new_symbol.
-            new_symbol assumes we return the mangled name.
-            This just undoes that lie until things are cleaned up.  */
-       }
       else
        {
          /* Use DMGL_RET_DROP for C++ template functions to suppress
index ed18f01dbdc509b4272b35b3abe91bb711052327..dfc0dddc61659178bf83e42a560faf88838a0cff 100644 (file)
@@ -638,6 +638,10 @@ public:
            && go_classify_struct_type (type) == GO_TYPE_STRING);
   }
 
+  /* See language.h.  */
+
+  bool store_sym_names_in_linkage_form_p () const override
+  { return true; }
 };
 
 /* Single instance of the Go language class.  */