projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* frags.h: Remove ANSI_PROTOTYPES conditional code.
[deliverable/binutils-gdb.git]
/
gprof
/
symtab.c
diff --git
a/gprof/symtab.c
b/gprof/symtab.c
index 6b5a093d067fcdbcd977aabda991a1c5fb6fbe11..aed66a740aff8e5cd29a859c3b7b544f24c3e09c 100644
(file)
--- a/
gprof/symtab.c
+++ b/
gprof/symtab.c
@@
-1,6
+1,6
@@
/* symtab.c
/* symtab.c
- Copyright
2000, 2001
Free Software Foundation, Inc.
+ Copyright
1999, 2000, 2001, 2002, 2004
Free Software Foundation, Inc.
This file is part of GNU Binutils.
This file is part of GNU Binutils.
@@
-16,13
+16,17
@@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 5
9 Temple Place - Suite 330
, Boston, MA
- 0211
1-1307
, USA. */
+ Foundation, Inc., 5
1 Franklin Street - Fifth Floor
, Boston, MA
+ 0211
0-1301
, USA. */
\f
#include "gprof.h"
\f
#include "gprof.h"
+#include "search_list.h"
+#include "source.h"
+#include "symtab.h"
#include "cg_arcs.h"
#include "corefile.h"
#include "cg_arcs.h"
#include "corefile.h"
-#include "symtab.h"
+
+static int cmp_addr (const PTR, const PTR);
Sym_Table symtab;
Sym_Table symtab;
@@
-30,7
+34,7
@@
Sym_Table symtab;
/* Initialize a symbol (so it's empty). */
void
/* Initialize a symbol (so it's empty). */
void
-
DEFUN (sym_init, (sym), Sym *
sym)
+
sym_init (Sym *
sym)
{
memset (sym, 0, sizeof (*sym));
{
memset (sym, 0, sizeof (*sym));
@@
-54,10
+58,10
@@
DEFUN (sym_init, (sym), Sym * sym)
the global symbol survives. */
static int
the global symbol survives. */
static int
-
DEFUN (cmp_addr, (lp, rp), const PTR lp AND
const PTR rp)
+
cmp_addr (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;
if (left->addr > right->addr)
return 1;
@@
-72,7
+76,7
@@
DEFUN (cmp_addr, (lp, rp), const PTR lp AND const PTR rp)
void
void
-
DEFUN (symtab_finalize, (tab), Sym_Table *
tab)
+
symtab_finalize (Sym_Table *
tab)
{
Sym *src, *dst;
bfd_vma prev_addr;
{
Sym *src, *dst;
bfd_vma prev_addr;
@@
-144,7
+148,8
@@
DEFUN (symtab_finalize, (tab), Sym_Table * tab)
}
if (tab->len > 0 && dst[-1].end_addr == 0)
}
if (tab->len > 0 && dst[-1].end_addr == 0)
- dst[-1].end_addr = core_text_sect->vma + core_text_sect->_raw_size - 1;
+ dst[-1].end_addr
+ = core_text_sect->vma + bfd_get_section_size (core_text_sect) - 1;
DBG (AOUTDEBUG | IDDEBUG,
printf ("[symtab_finalize]: removed %d duplicate entries\n",
DBG (AOUTDEBUG | IDDEBUG,
printf ("[symtab_finalize]: removed %d duplicate entries\n",
@@
-169,7
+174,7
@@
DEFUN (symtab_finalize, (tab), Sym_Table * tab)
#ifdef DEBUG
Sym *
#ifdef DEBUG
Sym *
-
DEFUN (dbg_sym_lookup, (symtab, address), Sym_Table * symtab AND
bfd_vma address)
+
dbg_sym_lookup (Sym_Table *sym_tab,
bfd_vma address)
{
long low, mid, high;
Sym *sym;
{
long low, mid, high;
Sym *sym;
@@
-177,8
+182,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);
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;
{
mid = (high + low) >> 1;
@@
-208,7
+213,7
@@
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 *
/* 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_Table *sym_tab,
bfd_vma address)
{
long low, high;
long mid = -1;
{
long low, high;
long mid = -1;
@@
-217,11
+222,11
@@
DEFUN (sym_lookup, (symtab, address), Sym_Table * symtab AND bfd_vma address)
int probes = 0;
#endif /* DEBUG */
int probes = 0;
#endif /* DEBUG */
- if (!symtab->len)
+ if (!sym
_
tab->len)
return 0;
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;
{
DBG (LOOKUPDEBUG, ++probes);
mid = (high + low) / 2;
@@
-238,7
+243,7
@@
DEFUN (sym_lookup, (symtab, address), Sym_Table * symtab AND bfd_vma address)
{
DBG (LOOKUPDEBUG,
printf ("[sym_lookup] %d probes (symtab->len=%u)\n",
{
DBG (LOOKUPDEBUG,
printf ("[sym_lookup] %d probes (symtab->len=%u)\n",
- probes, symtab->len - 1));
+ probes, sym
_
tab->len - 1));
return &sym[mid];
}
}
return &sym[mid];
}
}
@@
-259,7
+264,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",
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];
}
}
return &sym[mid + 1];
}
}
This page took
0.026687 seconds
and
4
git commands to generate.