Move declaration of vtbl_ptr_name to the header.
authorChristian Biesinger <cbiesinger@google.com>
Mon, 7 Oct 2019 18:23:34 +0000 (13:23 -0500)
committerChristian Biesinger <cbiesinger@google.com>
Mon, 7 Oct 2019 22:30:22 +0000 (17:30 -0500)
There are conflicting comments about whether this was
introduced in GCC 2.4.5 or GCC 2.6 and I don't know
which one is correct...

gdb/ChangeLog:

2019-10-07  Christian Biesinger  <cbiesinger@google.com>

* c-lang.h (vtbl_ptr_name): Declare.
* cp-valprint.c (vtbl_ptr_name): Remove "extern" now that we get
it from the header.
* stabsread.c (define_symbol): Remove declaration of vtbl_ptr_name.

gdb/ChangeLog
gdb/c-lang.h
gdb/cp-valprint.c
gdb/stabsread.c

index 0f79f2d62bd2f03304e636829e1e346e1a545e7d..3912429dcf39b452e275c775102b978cd5c3a8ca 100644 (file)
@@ -1,3 +1,10 @@
+2019-10-07  Christian Biesinger  <cbiesinger@google.com>
+
+       * c-lang.h (vtbl_ptr_name): Declare.
+       * cp-valprint.c (vtbl_ptr_name): Remove "extern" now that we get
+       it from the header.
+       * stabsread.c (define_symbol): Remove declaration of vtbl_ptr_name.
+
 2019-10-07  Christian Biesinger  <cbiesinger@google.com>
 
        * charset.c (your_gdb_wchar_t_is_bogus): Replace with a
index d95df54c83e3e1bec46af20a9d938ea661578295..de291fa8f135c8a062cbd01f6114f9c57ae8fe30 100644 (file)
@@ -144,6 +144,12 @@ extern void cp_print_value_fields_rtti (struct type *,
                                        const struct value_print_options *,
                                        struct type **, int);
 
+/* gcc-2.6 or later (when using -fvtable-thunks)
+   emits a unique named type for a vtable entry.
+   Some gdb code depends on that specific name.  */
+
+extern const char vtbl_ptr_name[];
+
 extern int cp_is_vtbl_ptr_type (struct type *);
 
 extern int cp_is_vtbl_member (struct type *);
index e73b0e27faf45df222551eb4a443e9a61b6dd30e..04be4dc83b7fdbc845a85274269f4c5f037a73d4 100644 (file)
@@ -56,7 +56,7 @@ static void cp_print_value (struct type *, struct type *,
 
 
 /* GCC versions after 2.4.5 use this.  */
-extern const char vtbl_ptr_name[] = "__vtbl_ptr_type";
+const char vtbl_ptr_name[] = "__vtbl_ptr_type";
 
 /* Return truth value for assertion that TYPE is of the type
    "pointer to virtual function".  */
index da455da36587f2978876dacded5fba1d2fc96c6d..fa2521f1ca3950c6615e38ba18af5f3c9b989c74 100644 (file)
@@ -42,6 +42,7 @@
 #include "gdb-demangle.h"
 #include "language.h"
 #include "target-float.h"
+#include "c-lang.h"
 #include "cp-abi.h"
 #include "cp-support.h"
 #include <ctype.h>
@@ -1259,11 +1260,6 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
 
       if (TYPE_NAME (SYMBOL_TYPE (sym)) == NULL)
        {
-         /* gcc-2.6 or later (when using -fvtable-thunks)
-            emits a unique named type for a vtable entry.
-            Some gdb code depends on that specific name.  */
-         extern const char vtbl_ptr_name[];
-
          if ((TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_PTR
               && strcmp (SYMBOL_LINKAGE_NAME (sym), vtbl_ptr_name))
              || TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_FUNC)
This page took 0.0378 seconds and 4 git commands to generate.