Ignore:
Timestamp:
Aug 16, 2003, 6:59:22 PM (22 years ago)
Author:
bird
Message:

binutils v2.14 - offical sources.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GNU/src/binutils/gprof/symtab.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r608 r609  
    11/* symtab.c
    22
    3    Copyright 2000, 2001 Free Software Foundation, Inc.
     3   Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
    44
    55   This file is part of GNU Binutils.
     
    2222
    2323#include "gprof.h"
     24#include "search_list.h"
     25#include "source.h"
     26#include "symtab.h"
    2427#include "cg_arcs.h"
    2528#include "corefile.h"
    26 #include "symtab.h"
     29
     30static int cmp_addr PARAMS ((const PTR, const PTR));
    2731
    2832Sym_Table symtab;
     
    3236
    3337void
    34 DEFUN (sym_init, (sym), Sym * sym)
     38sym_init (sym)
     39     Sym *sym;
    3540{
    3641  memset (sym, 0, sizeof (*sym));
     
    5661
    5762static int
    58 DEFUN (cmp_addr, (lp, rp), const PTR lp AND const PTR rp)
    59 {
    60   Sym *left = (Sym *) lp;
    61   Sym *right = (Sym *) rp;
     63cmp_addr (lp, rp)
     64     const PTR lp;
     65     const PTR rp;
     66{
     67  const Sym *left = (const Sym *) lp;
     68  const Sym *right = (const Sym *) rp;
    6269
    6370  if (left->addr > right->addr)
     
    7481
    7582void
    76 DEFUN (symtab_finalize, (tab), Sym_Table * tab)
     83symtab_finalize (tab)
     84     Sym_Table *tab;
    7785{
    7886  Sym *src, *dst;
     
    171179
    172180Sym *
    173 DEFUN (dbg_sym_lookup, (symtab, address), Sym_Table * symtab AND bfd_vma address)
     181dbg_sym_lookup (sym_tab, address)
     182     Sym_Table *sym_tab;
     183     bfd_vma address;
    174184{
    175185  long low, mid, high;
     
    179189           (unsigned long) address);
    180190
    181   sym = symtab->base;
    182   for (low = 0, high = symtab->len - 1; low != high;)
     191  sym = sym_tab->base;
     192  for (low = 0, high = sym_tab->len - 1; low != high;)
    183193    {
    184194      mid = (high + low) >> 1;
     
    210220   If address does not hit any symbol, 0 is returned.  */
    211221Sym *
    212 DEFUN (sym_lookup, (symtab, address), Sym_Table * symtab AND bfd_vma address)
     222sym_lookup (sym_tab, address)
     223     Sym_Table *sym_tab;
     224     bfd_vma address;
    213225{
    214226  long low, high;
     
    219231#endif /* DEBUG */
    220232
    221   if (!symtab->len)
     233  if (!sym_tab->len)
    222234    return 0;
    223235
    224   sym = symtab->base;
    225   for (low = 0, high = symtab->len - 1; low != high;)
     236  sym = sym_tab->base;
     237  for (low = 0, high = sym_tab->len - 1; low != high;)
    226238    {
    227239      DBG (LOOKUPDEBUG, ++probes);
     
    240252              DBG (LOOKUPDEBUG,
    241253                   printf ("[sym_lookup] %d probes (symtab->len=%u)\n",
    242                            probes, symtab->len - 1));
     254                           probes, sym_tab->len - 1));
    243255              return &sym[mid];
    244256            }
     
    261273        {
    262274          DBG (LOOKUPDEBUG, printf ("[sym_lookup] %d (%u) probes, fall off\n",
    263                                     probes, symtab->len - 1));
     275                                    probes, sym_tab->len - 1));
    264276          return &sym[mid + 1];
    265277        }
Note: See TracChangeset for help on using the changeset viewer.