]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Rename demangle.c to gdb-demangle.c, and some cleanup
authorChristian Biesinger <cbiesinger@google.com>
Thu, 21 Nov 2019 19:02:07 +0000 (13:02 -0600)
committerChristian Biesinger <cbiesinger@google.com>
Thu, 21 Nov 2019 22:36:00 +0000 (16:36 -0600)
In addition to renaming demangle.c to match the header file naming,
this also makes is_cplus_marker return a bool and removes a duplicate
declaration of "bool demangle" from symtab.h.

gdb/ChangeLog:

2019-11-21  Christian Biesinger  <cbiesinger@google.com>

* Makefile.in: Update.
* demangle.c: Rename to...
* gdb-demangle.c: ..this.
(is_cplus_marker): Change return type to bool.
(_initialize_demangler): Rename to...
(_initialize_gdb_demangle): ...this.
* gdb-demangle.h (is_cplus_marker): Change return type to bool.
* symtab.h (demangle): Remove declaration; instead include
gdb-demangle.h.

Change-Id: I83c3b3f7ee71b2bf6f5b5d0f9eb1d4b5208f2a97

gdb/ChangeLog
gdb/Makefile.in
gdb/gdb-demangle.c [moved from gdb/demangle.c with 99% similarity]
gdb/gdb-demangle.h
gdb/symtab.h

index 0c81de4a6bc3c6b5f4d23bc403f05638ebaa2ead..81c6690602f12619bf7377c2f5b1990dc7c1fcfa 100644 (file)
@@ -1,3 +1,15 @@
+2019-11-21  Christian Biesinger  <cbiesinger@google.com>
+
+       * Makefile.in: Update.
+       * demangle.c: Rename to...
+       * gdb-demangle.c: ..this.
+       (is_cplus_marker): Change return type to bool.
+       (_initialize_demangler): Rename to...
+       (_initialize_gdb_demangle): ...this.
+       * gdb-demangle.h (is_cplus_marker): Change return type to bool.
+       * symtab.h (demangle): Remove declaration; instead include
+       gdb-demangle.h.
+
 2019-11-21  Tom Tromey  <tromey@adacore.com>
 
        * gdbsupport/format.c (format_pieces): Parse %I64d.
index 5a4ffd5a818a1998e0c0c87fb0de3f2f2da097e2..600ebabb1fc1fddd14fca00ad86a28cddf74c7e4 100644 (file)
@@ -1009,7 +1009,6 @@ COMMON_SFILES = \
        dbxread.c \
        dcache.c \
        debug.c \
-       demangle.c \
        dictionary.c \
        disasm.c \
        disasm-selftests.c \
@@ -1040,6 +1039,7 @@ COMMON_SFILES = \
        frame-base.c \
        frame-unwind.c \
        gcore.c \
+       gdb-demangle.c \
        gdb_bfd.c \
        gdb_obstack.c \
        gdb_regex.c \
similarity index 99%
rename from gdb/demangle.c
rename to gdb/gdb-demangle.c
index d8b03104d780f799ca62389454075b24ce95c5c0..2ed64d4e5b3caccac7801811fd572f73367e05af 100644 (file)
@@ -149,7 +149,7 @@ static char cplus_markers[] = {'$', '.', '\0'};
 
 /* See documentation in gdb-demangle.h.  */
 
-int
+bool
 is_cplus_marker (int c)
 {
   return c && strchr (cplus_markers, c) != NULL;
@@ -213,7 +213,7 @@ demangle_command (const char *args, int from_tty)
 }
 
 void
-_initialize_demangler (void)
+_initialize_gdb_demangle (void)
 {
   int i, ndems;
 
index 327a63313b40947b9199e2db585edb30d7b2d287..e68973f5b37d3e1f0cef489214b1a07e25170725 100644 (file)
@@ -29,6 +29,6 @@ extern bool demangle;
 extern bool asm_demangle;
 
 /* Check if a character is one of the commonly used C++ marker characters.  */
-extern int is_cplus_marker (int);
+extern bool is_cplus_marker (int);
 
 #endif /* GDB_DEMANGLE_H */
index 1e82182df793d77a0ca7e30385ce5c73a4681d47..8f95a3a4d2702ec801ca50669e85b0bc549d72b1 100644 (file)
@@ -33,6 +33,7 @@
 #include "gdbsupport/gdb_string_view.h"
 #include "gdbsupport/next-iterator.h"
 #include "completer.h"
+#include "gdb-demangle.h"
 
 /* Opaque declarations.  */
 struct ui_file;
@@ -553,7 +554,6 @@ extern const char *symbol_demangled_name
 
 #define SYMBOL_PRINT_NAME(symbol)                                      \
   (demangle ? SYMBOL_NATURAL_NAME (symbol) : SYMBOL_LINKAGE_NAME (symbol))
-extern bool demangle;
 
 /* Macro that returns the name to be used when sorting and searching symbols.
    In C++, we search for the demangled form of a name,