aboutsummaryrefslogtreecommitdiff
path: root/gprof/symtab.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2002-02-01 08:24:16 +0000
committerAlan Modra <amodra@gmail.com>2002-02-01 08:24:16 +0000
commit1355568ab48a9dcfd079493f7deb5e1c5e88015b (patch)
tree9b1cc576a383708096f9c89c5800bd25f6126768 /gprof/symtab.c
parent48fa4a5def1116273c2c2a236939e96eb9b6231a (diff)
downloadgdb-1355568ab48a9dcfd079493f7deb5e1c5e88015b.zip
gdb-1355568ab48a9dcfd079493f7deb5e1c5e88015b.tar.gz
gdb-1355568ab48a9dcfd079493f7deb5e1c5e88015b.tar.bz2
* alpha.c (alpha_find_call): Warning fixes.
* mips.c (mips_find_call): Likewise. * sparc.c (sparc_find_call): Likewise. * basic_blocks.c: Warning fixes. Eliminate DEFUN. * call_graph.c: Likewise. * cg_arcs.c: Likewise. * cg_dfn.cp: Likewise. * gprof.c: Likewise. * gprof.h: Likewise. * hist.c: Likewise. * search_list.c: Likewise. * source.c: Likewise. * source.h: Likewise. * sym_ids.c: Likewise. * symtab.c: Likewise. * symtab.h: Likewise. * utils.c: Likewise. * cg_print.c: Likewise. (struct function_map, symbol_map, symbol_map_count): Move declaration to.. * corefile: ..here. * corefile.c: Warning fixes. Eliminate DEFUN. (struct function_map): Remove declaration. * gmon_io.c: Warning fixes. Eliminate DEFUN. (gmon_io_read_64): Make static. (gmon_io_write_64): Likewise. (gmon_read_raw_arc): Likewise. (gmon_write_raw_arc): Likewise. (gmon_io_write_8): Don't pass char, pass int param. * gmon_io.h (gmon_io_write_8): Likewise. and a few copyright dates that should have been done previously.
Diffstat (limited to 'gprof/symtab.c')
-rw-r--r--gprof/symtab.c40
1 files changed, 25 insertions, 15 deletions
diff --git a/gprof/symtab.c b/gprof/symtab.c
index 9ca2002..c4ce7ed 100644
--- a/gprof/symtab.c
+++ b/gprof/symtab.c
@@ -1,6 +1,6 @@
/* symtab.c
- Copyright 2000, 2001 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of GNU Binutils.
@@ -26,13 +26,16 @@
#include "cg_arcs.h"
#include "corefile.h"
+static int cmp_addr PARAMS ((const PTR, const PTR));
+
Sym_Table symtab;
/* Initialize a symbol (so it's empty). */
void
-DEFUN (sym_init, (sym), Sym * sym)
+sym_init (sym)
+ Sym *sym;
{
memset (sym, 0, sizeof (*sym));
@@ -56,10 +59,12 @@ DEFUN (sym_init, (sym), Sym * sym)
the global symbol survives. */
static int
-DEFUN (cmp_addr, (lp, rp), const PTR lp AND const PTR rp)
+cmp_addr (lp, rp)
+ const PTR lp;
+ const PTR rp;
{
- Sym *left = (Sym *) lp;
- Sym *right = (Sym *) rp;
+ const Sym *left = (const Sym *) lp;
+ const Sym *right = (const Sym *) rp;
if (left->addr > right->addr)
return 1;
@@ -74,7 +79,8 @@ DEFUN (cmp_addr, (lp, rp), const PTR lp AND const PTR rp)
void
-DEFUN (symtab_finalize, (tab), Sym_Table * tab)
+symtab_finalize (tab)
+ Sym_Table *tab;
{
Sym *src, *dst;
bfd_vma prev_addr;
@@ -171,7 +177,9 @@ DEFUN (symtab_finalize, (tab), Sym_Table * tab)
#ifdef DEBUG
Sym *
-DEFUN (dbg_sym_lookup, (symtab, address), Sym_Table * symtab AND bfd_vma address)
+dbg_sym_lookup (sym_tab, address)
+ Sym_Table *sym_tab;
+ bfd_vma address;
{
long low, mid, high;
Sym *sym;
@@ -179,8 +187,8 @@ DEFUN (dbg_sym_lookup, (symtab, address), Sym_Table * symtab AND bfd_vma address
fprintf (stderr, "[dbg_sym_lookup] address 0x%lx\n",
(unsigned long) address);
- sym = symtab->base;
- for (low = 0, high = symtab->len - 1; low != high;)
+ sym = sym_tab->base;
+ for (low = 0, high = sym_tab->len - 1; low != high;)
{
mid = (high + low) >> 1;
@@ -210,7 +218,9 @@ DEFUN (dbg_sym_lookup, (symtab, address), Sym_Table * symtab AND bfd_vma address
/* Look up an address in the symbol-table that is sorted by address.
If address does not hit any symbol, 0 is returned. */
Sym *
-DEFUN (sym_lookup, (symtab, address), Sym_Table * symtab AND bfd_vma address)
+sym_lookup (sym_tab, address)
+ Sym_Table *sym_tab;
+ bfd_vma address;
{
long low, high;
long mid = -1;
@@ -219,11 +229,11 @@ DEFUN (sym_lookup, (symtab, address), Sym_Table * symtab AND bfd_vma address)
int probes = 0;
#endif /* DEBUG */
- if (!symtab->len)
+ if (!sym_tab->len)
return 0;
- sym = symtab->base;
- for (low = 0, high = symtab->len - 1; low != high;)
+ sym = sym_tab->base;
+ for (low = 0, high = sym_tab->len - 1; low != high;)
{
DBG (LOOKUPDEBUG, ++probes);
mid = (high + low) / 2;
@@ -240,7 +250,7 @@ DEFUN (sym_lookup, (symtab, address), Sym_Table * symtab AND bfd_vma address)
{
DBG (LOOKUPDEBUG,
printf ("[sym_lookup] %d probes (symtab->len=%u)\n",
- probes, symtab->len - 1));
+ probes, sym_tab->len - 1));
return &sym[mid];
}
}
@@ -261,7 +271,7 @@ DEFUN (sym_lookup, (symtab, address), Sym_Table * symtab AND bfd_vma address)
else
{
DBG (LOOKUPDEBUG, printf ("[sym_lookup] %d (%u) probes, fall off\n",
- probes, symtab->len - 1));
+ probes, sym_tab->len - 1));
return &sym[mid + 1];
}
}