Back to index

cell-binutils  2.17cvs20070401
Functions
utils.c File Reference
#include "demangle.h"
#include "gprof.h"
#include "search_list.h"
#include "source.h"
#include "symtab.h"
#include "cg_arcs.h"
#include "utils.h"

Go to the source code of this file.

Functions

int print_name_only (Sym *self)
void print_name (Sym *self)

Function Documentation

void print_name ( Sym self)

Definition at line 101 of file utils.c.

{
  print_name_only (self);

  if (self->cg.cyc.num != 0)
    {
      printf (_(" <cycle %d>"), self->cg.cyc.num);
    }
  if (self->cg.index != 0)
    {
      if (self->cg.print_flag)
       {
         printf (" [%d]", self->cg.index);
       }
      else
       {
         printf (" (%d)", self->cg.index);
       }
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

int print_name_only ( Sym self)

Definition at line 42 of file utils.c.

{
  const char *name = self->name;
  const char *filename;
  char *demangled = 0;
  char buf[PATH_MAX];
  int size = 0;

  if (name)
    {
      if (!bsd_style_output)
       {
         if (name[0] == '_' && name[1] && discard_underscores)
           {
             name++;
           }
         if (demangle)
           {
             demangled = cplus_demangle (name, DMGL_ANSI | DMGL_PARAMS);
             if (demangled)
              {
                name = demangled;
              }
           }
       }
      printf ("%s", name);
      size = strlen (name);
      if (line_granularity && self->file)
       {
         filename = self->file->name;
         if (!print_path)
           {
             filename = strrchr (filename, '/');
             if (filename)
              {
                ++filename;
              }
             else
              {
                filename = self->file->name;
              }
           }
         sprintf (buf, " (%s:%d @ %lx)", filename, self->line_num,
                 (unsigned long) self->addr);
         printf ("%s", buf);
         size += strlen (buf);
       }
      if (demangled)
       {
         free (demangled);
       }
      DBG (DFNDEBUG, printf ("{%d} ", self->cg.top_order));
      DBG (PROPDEBUG, printf ("%4.0f%% ", 100.0 * self->cg.prop.fract));
    }
  return size;
}

Here is the call graph for this function:

Here is the caller graph for this function: