Back to index

cell-binutils  2.17cvs20070401
Enumerations | Functions | Variables
sym_ids.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  Table_Id {
  INCL_GRAPH = 0, EXCL_GRAPH, INCL_ARCS, EXCL_ARCS,
  INCL_FLAT, EXCL_FLAT, INCL_TIME, EXCL_TIME,
  INCL_ANNO, EXCL_ANNO, INCL_EXEC, EXCL_EXEC,
  NUM_TABLES
}

Functions

void sym_id_add (const char *, Table_Id)
void sym_id_parse (void)
bfd_boolean sym_id_arc_is_present (Sym_Table *, Sym *, Sym *)

Variables

Sym_Table syms [NUM_TABLES]

Enumeration Type Documentation

enum Table_Id
Enumerator:
INCL_GRAPH 
EXCL_GRAPH 
INCL_ARCS 
EXCL_ARCS 
INCL_FLAT 
EXCL_FLAT 
INCL_TIME 
EXCL_TIME 
INCL_ANNO 
EXCL_ANNO 
INCL_EXEC 
EXCL_EXEC 
NUM_TABLES 

Definition at line 24 of file sym_ids.h.


Function Documentation

void sym_id_add ( const char *  ,
Table_Id   
)

Definition at line 87 of file sym_ids.c.

{
  struct sym_id *id;
  int len = strlen (spec);

  id = (struct sym_id *) xmalloc (sizeof (*id) + len + 1);
  memset (id, 0, sizeof (*id));

  id->spec = (char *) id + sizeof (*id);
  strcpy (id->spec, spec);
  id->which_table = which_table;

  id->next = id_list;
  id_list = id;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 365 of file sym_ids.c.

{
  Sym *sym;

  for (sym = sym_tab->base; sym < sym_tab->limit; ++sym)
    {
      if (from->addr >= sym->addr && from->addr <= sym->end_addr
         && arc_lookup (sym, to))
       return TRUE;
    }

  return FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void sym_id_parse ( void  )

Definition at line 266 of file sym_ids.c.

{
  Sym *sym, *left, *right;
  struct sym_id *id;
  Sym_Table *tab;

  /* Convert symbol ids into Syms, so we can deal with them more easily.  */
  for (id = id_list; id; id = id->next)
    parse_id (id);

  /* First determine size of each table.  */
  for (sym = symtab.base; sym < symtab.limit; ++sym)
    {
      for (id = id_list; id; id = id->next)
       {
         if (match (&id->left.sym, sym))
           extend_match (&id->left, sym, &syms[id->which_table], FALSE);

         if (id->has_right && match (&id->right.sym, sym))
           extend_match (&id->right, sym, &right_ids, FALSE);
       }
    }

  /* Create tables of appropriate size and reset lengths.  */
  for (tab = syms; tab < &syms[NUM_TABLES]; ++tab)
    {
      if (tab->len)
       {
         tab->base = (Sym *) xmalloc (tab->len * sizeof (Sym));
         tab->limit = tab->base + tab->len;
         tab->len = 0;
       }
    }

  if (right_ids.len)
    {
      right_ids.base = (Sym *) xmalloc (right_ids.len * sizeof (Sym));
      right_ids.limit = right_ids.base + right_ids.len;
      right_ids.len = 0;
    }

  /* Make a second pass through symtab, creating syms as necessary.  */
  for (sym = symtab.base; sym < symtab.limit; ++sym)
    {
      for (id = id_list; id; id = id->next)
       {
         if (match (&id->left.sym, sym))
           extend_match (&id->left, sym, &syms[id->which_table], TRUE);

         if (id->has_right && match (&id->right.sym, sym))
           extend_match (&id->right, sym, &right_ids, TRUE);
       }
    }

  /* Go through ids creating arcs as needed.  */
  for (id = id_list; id; id = id->next)
    {
      if (id->has_right)
       {
         for (left = id->left.first_match; left; left = left->next)
           {
             for (right = id->right.first_match; right; right = right->next)
              {
                DBG (IDDEBUG,
                     printf (
                            "[sym_id_parse]: arc %s:%s(%lx-%lx) -> %s:%s(%lx-%lx) to %s\n",
                            left->file ? left->file->name : "*",
                            left->name ? left->name : "*",
                            (unsigned long) left->addr,
                            (unsigned long) left->end_addr,
                            right->file ? right->file->name : "*",
                            right->name ? right->name : "*",
                            (unsigned long) right->addr,
                            (unsigned long) right->end_addr,
                            table_name[id->which_table]));

                arc_add (left, right, (unsigned long) 0);
              }
           }
       }
    }

  /* Finally, we can sort the tables and we're done.  */
  for (tab = &syms[0]; tab < &syms[NUM_TABLES]; ++tab)
    {
      DBG (IDDEBUG, printf ("[sym_id_parse] syms[%s]:\n",
                         table_name[tab - &syms[0]]));
      symtab_finalize (tab);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 59 of file sym_ids.c.