diff options
author | Christian Biesinger <cbiesinger@google.com> | 2019-11-21 13:02:07 -0600 |
---|---|---|
committer | Christian Biesinger <cbiesinger@google.com> | 2019-11-21 16:36:00 -0600 |
commit | f10ffa4146416f1fb11ae1bc1a1c423d49e2dbf0 (patch) | |
tree | 067a4f1439920cbb1d3b19f1e31a22280a31769c | |
parent | 6ba185213659517b4299a3e4c92813839f19f045 (diff) | |
download | gdb-f10ffa4146416f1fb11ae1bc1a1c423d49e2dbf0.zip gdb-f10ffa4146416f1fb11ae1bc1a1c423d49e2dbf0.tar.gz gdb-f10ffa4146416f1fb11ae1bc1a1c423d49e2dbf0.tar.bz2 |
Rename demangle.c to gdb-demangle.c, and some cleanup
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
-rw-r--r-- | gdb/ChangeLog | 12 | ||||
-rw-r--r-- | gdb/Makefile.in | 2 | ||||
-rw-r--r-- | gdb/gdb-demangle.c (renamed from gdb/demangle.c) | 4 | ||||
-rw-r--r-- | gdb/gdb-demangle.h | 2 | ||||
-rw-r--r-- | gdb/symtab.h | 2 |
5 files changed, 17 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0c81de4..81c6690 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -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. diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 5a4ffd5..600ebab 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -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 \ diff --git a/gdb/demangle.c b/gdb/gdb-demangle.c index d8b0310..2ed64d4 100644 --- a/gdb/demangle.c +++ b/gdb/gdb-demangle.c @@ -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; diff --git a/gdb/gdb-demangle.h b/gdb/gdb-demangle.h index 327a633..e68973f 100644 --- a/gdb/gdb-demangle.h +++ b/gdb/gdb-demangle.h @@ -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 */ diff --git a/gdb/symtab.h b/gdb/symtab.h index 1e82182..8f95a3a 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -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, |