This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

let gdb turn off demangling


Occasionally demangling identifiers just confuses me.  Particularly when
I'm tracking what appears to be a linker bug rather than something about
the language itself.

The following lets me say "set demangle-style none" and get the raw
symbol names.

Applied to src and gcc repositories.


r~



include/
	* demangle.h (no_demangling): New.
	(NO_DEMANGLING_STYLE_STRING): New.

libiberty/
	* cplus-dem.c (libiberty_demanglers): Add no_demangling case.
	(cplus_demangle): Support no_demangling.

Index: include/demangle.h
===================================================================
RCS file: /cvs/src/src/include/demangle.h,v
retrieving revision 1.9
diff -c -p -d -r1.9 demangle.h
*** demangle.h	2001/10/07 17:23:43	1.9
--- demangle.h	2001/12/06 21:44:47
***************
*** 54,59 ****
--- 54,60 ----
  
  extern enum demangling_styles
  {
+   no_demangling = -1,
    unknown_demangling = 0,
    auto_demangling = DMGL_AUTO,
    gnu_demangling = DMGL_GNU,
*************** extern enum demangling_styles
*** 68,73 ****
--- 69,75 ----
  
  /* Define string names for the various demangling styles. */
  
+ #define NO_DEMANGLING_STYLE_STRING            "none"
  #define AUTO_DEMANGLING_STYLE_STRING	      "auto"
  #define GNU_DEMANGLING_STYLE_STRING    	      "gnu"
  #define LUCID_DEMANGLING_STYLE_STRING	      "lucid"
Index: libiberty/cplus-dem.c
===================================================================
RCS file: /cvs/src/src/libiberty/cplus-dem.c,v
retrieving revision 1.23
diff -c -p -d -r1.23 cplus-dem.c
*** cplus-dem.c	2001/10/17 22:35:28	1.23
--- cplus-dem.c	2001/12/06 21:44:47
*************** typedef enum type_kind_t
*** 259,264 ****
--- 259,270 ----
  const struct demangler_engine libiberty_demanglers[] =
  {
    {
+     NO_DEMANGLING_STYLE_STRING,
+     no_demangling,
+     "Demangling disabled"
+   }
+   ,
+   {
      AUTO_DEMANGLING_STYLE_STRING,
        auto_demangling,
        "Automatic selection based on executable"
*************** cplus_demangle (mangled, options)
*** 909,914 ****
--- 915,924 ----
  {
    char *ret;
    struct work_stuff work[1];
+ 
+   if (current_demangling_style == no_demangling)
+     return xstrdup (mangled);
+ 
    memset ((char *) work, 0, sizeof (work));
    work->options = options;
    if ((work->options & DMGL_STYLE_MASK) == 0)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]