Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Christian Biesinger via gdb-patches" <gdb-patches@sourceware.org>
To: gdb-patches@sourceware.org
Cc: Christian Biesinger <cbiesinger@google.com>
Subject: [PATCH] Rename demangle.c to gdb-demangle.c, and some cleanup
Date: Thu, 21 Nov 2019 19:10:00 -0000	[thread overview]
Message-ID: <20191121191019.28301-1-cbiesinger@google.com> (raw)

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/Makefile.in                    | 2 +-
 gdb/{demangle.c => gdb-demangle.c} | 4 ++--
 gdb/gdb-demangle.h                 | 2 +-
 gdb/symtab.h                       | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)
 rename gdb/{demangle.c => gdb-demangle.c} (99%)

diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 5a4ffd5a81..600ebabb1f 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
similarity index 99%
rename from gdb/demangle.c
rename to gdb/gdb-demangle.c
index d8b03104d7..2ed64d4e5b 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 327a63313b..e68973f5b3 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 1e82182df7..8f95a3a4d2 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,
-- 
2.24.0.432.g9d3f5f5b63-goog


             reply	other threads:[~2019-11-21 19:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-21 19:10 Christian Biesinger via gdb-patches [this message]
2019-11-21 22:31 ` Simon Marchi
2019-11-21 22:37   ` Christian Biesinger via gdb-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191121191019.28301-1-cbiesinger@google.com \
    --to=gdb-patches@sourceware.org \
    --cc=cbiesinger@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox