Back to index

cell-binutils  2.17cvs20070401
Functions | Variables
cxxfilt.c File Reference
#include "config.h"
#include "bfd.h"
#include "bucomm.h"
#include "libiberty.h"
#include "demangle.h"
#include "getopt.h"
#include "safe-ctype.h"

Go to the source code of this file.

Functions

static void demangle_it (char *mangled_name)
static void print_demangler_list (FILE *stream)
static void usage (FILE *stream, int status)
static const char * standard_symbol_characters (void)
static const char * hp_symbol_characters (void)
int main (int, char **)

Variables

static int flags = DMGL_PARAMS | DMGL_ANSI | DMGL_VERBOSE
static int strip_underscore = TARGET_PREPENDS_UNDERSCORE
static struct option []

Function Documentation

static void demangle_it ( char *  mangled_name) [static]

Definition at line 50 of file cxxfilt.c.

{
  char *result;
  unsigned int skip_first = 0;

  /* _ and $ are sometimes found at the start of function names
     in assembler sources in order to distinguish them from other
     names (eg register names).  So skip them here.  */
  if (mangled_name[0] == '.' || mangled_name[0] == '$')
    ++skip_first;
  if (strip_underscore && mangled_name[skip_first] == '_')
    ++skip_first;

  result = cplus_demangle (mangled_name + skip_first, flags);

  if (result == NULL)
    printf (mangled_name);
  else
    {
      if (mangled_name[0] == '.')
       putchar ('.');
      printf (result);
      free (result);
    }
}

Here is the call graph for this function:

static const char* hp_symbol_characters ( void  ) [static]

Definition at line 164 of file cxxfilt.c.

{
  return "_$.<>#,*&[]:(){}";
}
int main ( int  argc,
char **  argv 
)
static void print_demangler_list ( FILE *  stream) [static]

Definition at line 77 of file cxxfilt.c.

{
  const struct demangler_engine *demangler;

  fprintf (stream, "{%s", libiberty_demanglers->demangling_style_name);

  for (demangler = libiberty_demanglers + 1;
       demangler->demangling_style != unknown_demangling;
       ++demangler)
    fprintf (stream, ",%s", demangler->demangling_style_name);

  fprintf (stream, "}");
}

Here is the call graph for this function:

Here is the caller graph for this function:

static const char* standard_symbol_characters ( void  ) [static]

Definition at line 128 of file cxxfilt.c.

{
  return "_$.";
}
static void usage ( FILE *  stream,
int  status 
) [static]

Definition at line 92 of file cxxfilt.c.

{
  fprintf (stream, "\
Usage: %s [options] [mangled names]\n", program_name);
  fprintf (stream, "\
Options are:\n\
  [-_|--strip-underscore]     Ignore first leading underscore%s\n",
          TARGET_PREPENDS_UNDERSCORE ? " (default)" : "");
  fprintf (stream, "\
  [-n|--no-strip-underscore]  Do not ignore a leading underscore%s\n",
          TARGET_PREPENDS_UNDERSCORE ? "" : " (default)");
  fprintf (stream, "\
  [-p|--no-params]            Do not display function arguments\n\
  [-i|--no-verbose]           Do not show implementation details (if any)\n\
  [-t|--types]                Also attempt to demangle type encodings\n\
  [-s|--format ");
  print_demangler_list (stream);
  fprintf (stream, "]\n");

  fprintf (stream, "\
  [@<file>]                   Read extra options from <file>\n\
  [-h|--help]                 Display this information\n\
  [-v|--version]              Show the version information\n\
Demangled names are displayed to stdout.\n\
If a name cannot be demangled it is just echoed to stdout.\n\
If no names are provided on the command line, stdin is read.\n");
  if (REPORT_BUGS_TO[0] && status == 0)
    fprintf (stream, _("Report bugs to %s.\n"), REPORT_BUGS_TO);
  exit (status);
}

Here is the call graph for this function:


Variable Documentation

Definition at line 33 of file cxxfilt.c.

struct option[] [static]
Initial value:
{
  {"strip-underscore", no_argument, NULL, '_'},
  {"format", required_argument, NULL, 's'},
  {"help", no_argument, NULL, 'h'},
  {"no-params", no_argument, NULL, 'p'},
  {"no-strip-underscores", no_argument, NULL, 'n'},
  {"no-verbose", no_argument, NULL, 'i'},
  {"types", no_argument, NULL, 't'},
  {"version", no_argument, NULL, 'v'},
  {NULL, no_argument, NULL, 0}
}

Definition at line 36 of file cxxfilt.c.

int strip_underscore = TARGET_PREPENDS_UNDERSCORE [static]

Definition at line 34 of file cxxfilt.c.