This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


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

[PATCH]demangle.c


This patches gets gdb to use the list of demanglers available in
libiberty instead of the table in gdb. This eliminates the need to
duplicate this information in more than one place. Indirectly it will
add access to the new ABI demangler since this was missing in the GDB
version of the table.


2000-06-19  Kenneth Block  <krblock@computer.org>

	* demangle.c: Use demangler table from libiberty instead of local copy.
*** demangle.c.orig	Mon Jun 19 17:28:16 2000
--- demangle.c	Mon Jun 19 17:57:36 2000
***************
*** 49,106 ****
  
  static char *current_demangling_style_string;
  
- /* List of supported demangling styles.  Contains the name of the style as
-    seen by the user, and the enum value that corresponds to that style. */
- 
- static const struct demangler
-   {
-     char *demangling_style_name;
-     enum demangling_styles demangling_style;
-     char *demangling_style_doc;
-   }
- demanglers[] =
- {
-   {
-     AUTO_DEMANGLING_STYLE_STRING,
-       auto_demangling,
-       "Automatic selection based on executable"
-   }
-   ,
-   {
-     GNU_DEMANGLING_STYLE_STRING,
-       gnu_demangling,
-       "GNU (g++) style demangling"
-   }
-   ,
-   {
-     LUCID_DEMANGLING_STYLE_STRING,
-       lucid_demangling,
-       "Lucid (lcc) style demangling"
-   }
-   ,
-   {
-     ARM_DEMANGLING_STYLE_STRING,
-       arm_demangling,
-       "ARM style demangling"
-   }
-   ,
-   {
-     HP_DEMANGLING_STYLE_STRING,
-       hp_demangling,
-       "HP (aCC) style demangling"
-   }
-   ,
-   {
-     EDG_DEMANGLING_STYLE_STRING,
-       edg_demangling,
-       "EDG style demangling"
-   }
-   ,
-   {
-     NULL, unknown_demangling, NULL
-   }
- };
- 
  static void set_demangling_command (char *, int, struct cmd_list_element *);
  
  /* Set current demangling style.  Called by the "set demangle-style"
--- 49,54 ----
***************
*** 125,138 ****
       int from_tty;
       struct cmd_list_element *c;
  {
!   const struct demangler *dem;
  
    /*  First just try to match whatever style name the user supplied with
       one of the known ones.  Don't bother special casing for an empty
       name, we just treat it as any other style name that doesn't match.
       If we match, update the current demangling style enum. */
  
!   for (dem = demanglers; dem->demangling_style_name != NULL; dem++)
      {
        if (STREQ (current_demangling_style_string,
  		 dem->demangling_style_name))
--- 73,86 ----
       int from_tty;
       struct cmd_list_element *c;
  {
!   const struct demangler_engine *dem;
  
    /*  First just try to match whatever style name the user supplied with
       one of the known ones.  Don't bother special casing for an empty
       name, we just treat it as any other style name that doesn't match.
       If we match, update the current demangling style enum. */
  
!   for (dem = libiberty_demanglers; dem->demangling_style_name != NULL; dem++)
      {
        if (STREQ (current_demangling_style_string,
  		 dem->demangling_style_name))
***************
*** 154,160 ****
  			     current_demangling_style_string);
  	}
        printf_unfiltered ("The currently understood settings are:\n\n");
!       for (dem = demanglers; dem->demangling_style_name != NULL; dem++)
  	{
  	  printf_unfiltered ("%-10s %s\n", dem->demangling_style_name,
  			     dem->demangling_style_doc);
--- 102,110 ----
  			     current_demangling_style_string);
  	}
        printf_unfiltered ("The currently understood settings are:\n\n");
!       for (dem = libiberty_demanglers; 
! 	   dem->demangling_style_name != NULL; 
! 	   dem++)
  	{
  	  printf_unfiltered ("%-10s %s\n", dem->demangling_style_name,
  			     dem->demangling_style_doc);
***************
*** 171,180 ****
  	  /* This can happen during initialization if gdb is compiled with
  	     a DEMANGLING_STYLE value that is unknown, so pick the first
  	     one as the default. */
! 	  current_demangling_style = demanglers[0].demangling_style;
  	  current_demangling_style_string =
! 	    savestring (demanglers[0].demangling_style_name,
! 			strlen (demanglers[0].demangling_style_name));
  	  warning ("`%s' style demangling chosen as the default.\n",
  		   current_demangling_style_string);
  	}
--- 121,131 ----
  	  /* This can happen during initialization if gdb is compiled with
  	     a DEMANGLING_STYLE value that is unknown, so pick the first
  	     one as the default. */
! 	  current_demangling_style = libiberty_demanglers[0].demangling_style;
  	  current_demangling_style_string =
! 	    savestring (libiberty_demanglers[0].demangling_style_name,
! 			strlen (
!                           libiberty_demanglers[0].demangling_style_name));
  	  warning ("`%s' style demangling chosen as the default.\n",
  		   current_demangling_style_string);
  	}

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