* 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.
2002-02-01 Alan Modra <amodra@bigpond.net.au>
+ * 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.
+
* Makefile.am: Run "make dep-am"
* Makefile.in: Regenerate.
bfd_vma p_highpc;
{
bfd_vma pc, dest_pc;
- unsigned long insn;
+ unsigned int insn;
Sym *child;
if (indirect_child.name == NULL)
DBG (CALLDEBUG, printf (_("[find_call] %s: 0x%lx to 0x%lx\n"),
parent->name, (unsigned long) p_lowpc,
(unsigned long) p_highpc));
- for (pc = (p_lowpc + 3) & ~3; pc < p_highpc; pc += 4)
+ for (pc = (p_lowpc + 3) & ~(bfd_vma) 3; pc < p_highpc; pc += 4)
{
insn = bfd_get_32 (core_bfd, ((unsigned char *) core_text_space
+ pc - core_text_sect->vma));
of basic-block info to/from gmon.out; computing and formatting of
basic-block related statistics.
- Copyright 2000, 2001 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of GNU Binutils.
#include "symtab.h"
#include "sym_ids.h"
+static int cmp_bb PARAMS ((const PTR, const PTR));
+static int cmp_ncalls PARAMS ((const PTR, const PTR));
+static void fskip_string PARAMS ((FILE *));
+static void annotate_with_count PARAMS ((char *, unsigned int, int, PTR));
+
/* Default option values: */
boolean bb_annotate_all_lines = false;
unsigned long bb_min_calls = 1;
number, and address (in that order). */
static int
-DEFUN (cmp_bb, (lp, rp), const void *lp AND const void *rp)
+cmp_bb (lp, rp)
+ const PTR lp;
+ const PTR rp;
{
int r;
const Sym *left = *(const Sym **) lp;
/* Helper for sorting. Order basic blocks in decreasing number of
calls, ties are broken in increasing order of line numbers. */
static int
-DEFUN (cmp_ncalls, (lp, rp), const void *lp AND const void *rp)
+cmp_ncalls (lp, rp)
+ const PTR lp;
+ const PTR rp;
{
const Sym *left = *(const Sym **) lp;
const Sym *right = *(const Sym **) rp;
/* Skip over variable length string. */
static void
-DEFUN (fskip_string, (fp), FILE * fp)
+fskip_string (fp)
+ FILE *fp;
{
int ch;
of file IFP and is provided for formatting error-messages only. */
void
-DEFUN (bb_read_rec, (ifp, filename), FILE * ifp AND const char *filename)
+bb_read_rec (ifp, filename)
+ FILE *ifp;
+ const char *filename;
{
int nblocks, b;
bfd_vma addr, ncalls;
is the name of OFP and is provided for producing error-messages
only. */
void
-DEFUN (bb_write_blocks, (ofp, filename), FILE * ofp AND const char *filename)
+bb_write_blocks (ofp, filename)
+ FILE *ofp;
+ const char *filename;
{
- int nblocks = 0;
+ unsigned int nblocks = 0;
Sym *sym;
int i;
for (i = 0; i < NBBS && sym->bb_addr[i]; i++)
{
if (gmon_io_write_vma (ofp, sym->bb_addr[i])
- || gmon_io_write_vma (ofp, sym->bb_calls[i]))
+ || gmon_io_write_vma (ofp, (bfd_vma) sym->bb_calls[i]))
{
perror (filename);
done (1);
<filename>:<line-number>: (<function-name>:<bb-addr): <ncalls> */
void
-DEFUN_VOID (print_exec_counts)
+print_exec_counts ()
{
Sym **sorted_bbs, *sym;
- int i, j, len;
+ unsigned int i, j, len;
if (first_output)
first_output = false;
that starts the basic-block. */
static void
-DEFUN (annotate_with_count, (buf, width, line_num, arg),
- char *buf AND int width AND int line_num AND void *arg)
+annotate_with_count (buf, width, line_num, arg)
+ char *buf;
+ unsigned int width;
+ int line_num;
+ PTR arg;
{
Source_File *sf = arg;
Sym *b;
- int i;
+ unsigned int i;
static unsigned long last_count;
unsigned long last_print = (unsigned long) -1;
char *p;
unsigned long ncalls;
int ncalls_set;
- int len;
+ unsigned int len;
++num_executable_lines;
if (! ncalls_set)
{
- int c;
+ unsigned int c;
for (c = 0; c < width; c++)
buf[c] = ' ';
}
else
{
- int c;
+ unsigned int c;
strcpy (buf + width - len, tmpbuf);
for (c = 0; c < width - len; ++c)
regarding that source file are printed. */
void
-DEFUN_VOID (print_annotated_source)
+print_annotated_source ()
{
Sym *sym, *line_stats, *new_line;
Source_File *sf;
/* basic_blocks.h
- Copyright 2000 Free Software Foundation, Inc.
+ Copyright 2000, 2002 Free Software Foundation, Inc.
This file is part of GNU Binutils.
/* call_graph.c - Create call graphs.
- Copyright 2000, 2001 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of GNU Binutils.
#include "gmon_out.h"
#include "sym_ids.h"
-extern void
-DEFUN (cg_tally, (from_pc, self_pc, count),
- bfd_vma from_pc AND bfd_vma self_pc AND unsigned long count)
+void
+cg_tally (from_pc, self_pc, count)
+ bfd_vma from_pc;
+ bfd_vma self_pc;
+ unsigned long count;
{
Sym *parent;
Sym *child;
for formatting error-messages only. */
void
-DEFUN (cg_read_rec, (ifp, filename), FILE * ifp AND CONST char *filename)
+cg_read_rec (ifp, filename)
+ FILE *ifp;
+ const char *filename;
{
bfd_vma from_pc, self_pc;
unsigned int count;
only. */
void
-DEFUN (cg_write_arcs, (ofp, filename), FILE * ofp AND const char *filename)
+cg_write_arcs (ofp, filename)
+ FILE *ofp;
+ const char *filename;
{
Arc *arc;
Sym *sym;
#include "utils.h"
#include "sym_ids.h"
+static int cmp_topo PARAMS ((const PTR, const PTR));
+static void propagate_time PARAMS ((Sym *));
+static void cycle_time PARAMS ((void));
+static void cycle_link PARAMS ((void));
+static void inherit_flags PARAMS ((Sym *));
+static void propagate_flags PARAMS ((Sym **));
+static int cmp_total PARAMS ((const PTR, const PTR));
+
Sym *cycle_header;
unsigned int num_cycles;
Arc **arcs;
* range covered by CHILD.
*/
Arc *
-DEFUN (arc_lookup, (parent, child), Sym * parent AND Sym * child)
+arc_lookup (parent, child)
+ Sym *parent;
+ Sym *child;
{
Arc *arc;
* Add (or just increment) an arc:
*/
void
-DEFUN (arc_add, (parent, child, count),
- Sym * parent AND Sym * child AND unsigned long count)
+arc_add (parent, child, count)
+ Sym *parent;
+ Sym *child;
+ unsigned long count;
{
static unsigned int maxarcs = 0;
Arc *arc, **newarcs;
static int
-DEFUN (cmp_topo, (lp, rp), const PTR lp AND const PTR rp)
+cmp_topo (lp, rp)
+ const PTR lp;
+ const PTR rp;
{
const Sym *left = *(const Sym **) lp;
const Sym *right = *(const Sym **) rp;
static void
-DEFUN (propagate_time, (parent), Sym * parent)
+propagate_time (parent)
+ Sym *parent;
{
Arc *arc;
Sym *child;
* its members.
*/
static void
-DEFUN_VOID (cycle_time)
+cycle_time ()
{
Sym *member, *cyc;
static void
-DEFUN_VOID (cycle_link)
+cycle_link ()
{
Sym *sym, *cyc, *member;
Arc *arc;
* fractions from parents.
*/
static void
-DEFUN (inherit_flags, (child), Sym * child)
+inherit_flags (child)
+ Sym *child;
{
Sym *head, *parent, *member;
Arc *arc;
* and while we're here, sum time for functions.
*/
static void
-DEFUN (propagate_flags, (symbols), Sym ** symbols)
+propagate_flags (symbols)
+ Sym **symbols;
{
int index;
Sym *old_head, *child;
* first. All else being equal, compare by names.
*/
static int
-DEFUN (cmp_total, (lp, rp), const PTR lp AND const PTR rp)
+cmp_total (lp, rp)
+ const PTR lp;
+ const PTR rp;
{
const Sym *left = *(const Sym **) lp;
const Sym *right = *(const Sym **) rp;
* time bottom up and flags top down.
*/
Sym **
-DEFUN_VOID (cg_assemble)
+cg_assemble ()
{
Sym *parent, **time_sorted_syms, **top_sorted_syms;
unsigned int index;
}
DFN_Stack;
+static boolean is_numbered PARAMS ((Sym *));
+static boolean is_busy PARAMS ((Sym *));
+static void find_cycle PARAMS ((Sym *));
+static void pre_visit PARAMS ((Sym *));
+static void post_visit PARAMS ((Sym *));
+
DFN_Stack *dfn_stack = NULL;
int dfn_maxdepth = 0;
int dfn_depth = 0;
* Is CHILD already numbered?
*/
static boolean
-DEFUN (is_numbered, (child), Sym * child)
+is_numbered (child)
+ Sym *child;
{
return child->cg.top_order != DFN_NAN && child->cg.top_order != DFN_BUSY;
}
* Is CHILD already busy?
*/
static boolean
-DEFUN (is_busy, (child), Sym * child)
+is_busy (child)
+ Sym *child;
{
if (child->cg.top_order == DFN_NAN)
{
* depth-first number).
*/
static void
-DEFUN (find_cycle, (child), Sym * child)
+find_cycle (child)
+ Sym *child;
{
Sym *head = 0;
Sym *tail;
* the stack and mark it busy.
*/
static void
-DEFUN (pre_visit, (parent), Sym * parent)
+pre_visit (parent)
+ Sym *parent;
{
++dfn_depth;
* and number functions if PARENT is head of a cycle.
*/
static void
-DEFUN (post_visit, (parent), Sym * parent)
+post_visit (parent)
+ Sym *parent;
{
Sym *member;
* Given this PARENT, depth first number its children.
*/
void
-DEFUN (cg_dfn, (parent), Sym * parent)
+cg_dfn (parent)
+ Sym *parent;
{
Arc *arc;
#include "cg_print.h"
#include "hist.h"
#include "utils.h"
+#include "corefile.h"
/* Return value of comparison functions used to sort tables. */
#define LESSTHAN -1
#define EQUALTO 0
#define GREATERTHAN 1
-static void order_and_dump_functions_by_arcs PARAMS ((Arc **, unsigned long,
- int, Arc **,
- unsigned long *));
+static void print_header PARAMS ((void));
+static void print_cycle PARAMS ((Sym *));
+static int cmp_member PARAMS ((Sym *, Sym *));
+static void sort_members PARAMS ((Sym *));
+static void print_members PARAMS ((Sym *));
+static int cmp_arc PARAMS ((Arc *, Arc *));
+static void sort_parents PARAMS ((Sym *));
+static void print_parents PARAMS ((Sym *));
+static void sort_children PARAMS ((Sym *));
+static void print_children PARAMS ((Sym *));
+static void print_line PARAMS ((Sym *));
+static int cmp_name PARAMS ((const PTR, const PTR));
+static int cmp_arc_count PARAMS ((const PTR, const PTR));
+static int cmp_fun_nuses PARAMS ((const PTR, const PTR));
+static void order_and_dump_functions_by_arcs
+ PARAMS ((Arc **, unsigned long, int, Arc **, unsigned long *));
+
/* Declarations of automatically generated functions to output blurbs. */
extern void bsd_callg_blurb PARAMS ((FILE * fp));
extern void fsf_callg_blurb PARAMS ((FILE * fp));
static void
-DEFUN_VOID (print_header)
+print_header ()
{
if (first_output)
first_output = false;
/* Print a cycle header. */
static void
-DEFUN (print_cycle, (cyc), Sym * cyc)
+print_cycle (cyc)
+ Sym *cyc;
{
char buf[BUFSIZ];
CG.PROP.SELF+CG.PROP.CHILD, secondary key is NCALLS+CG.SELF_CALLS. */
static int
-DEFUN (cmp_member, (left, right), Sym * left AND Sym * right)
+cmp_member (left, right)
+ Sym *left;
+ Sym *right;
{
double left_time = left->cg.prop.self + left->cg.prop.child;
double right_time = right->cg.prop.self + right->cg.prop.child;
/* Sort members of a cycle. */
static void
-DEFUN (sort_members, (cyc), Sym * cyc)
+sort_members (cyc)
+ Sym *cyc;
{
Sym *todo, *doing, *prev;
/* Print the members of a cycle. */
static void
-DEFUN (print_members, (cyc), Sym * cyc)
+print_members (cyc)
+ Sym *cyc;
{
Sym *member;
arc count as minor key. */
static int
-DEFUN (cmp_arc, (left, right), Arc * left AND Arc * right)
+cmp_arc (left, right)
+ Arc *left;
+ Arc *right;
{
Sym *left_parent = left->parent;
Sym *left_child = left->child;
static void
-DEFUN (sort_parents, (child), Sym * child)
+sort_parents (child)
+ Sym * child;
{
Arc *arc, *detached, sorted, *prev;
static void
-DEFUN (print_parents, (child), Sym * child)
+print_parents (child)
+ Sym *child;
{
Sym *parent;
Arc *arc;
static void
-DEFUN (sort_children, (parent), Sym * parent)
+sort_children (parent)
+ Sym *parent;
{
Arc *arc, *detached, sorted, *prev;
static void
-DEFUN (print_children, (parent), Sym * parent)
+print_children (parent)
+ Sym *parent;
{
Sym *child;
Arc *arc;
static void
-DEFUN (print_line, (np), Sym * np)
+print_line (np)
+ Sym *np;
{
char buf[BUFSIZ];
/* Print dynamic call graph. */
void
-DEFUN (cg_print, (timesortsym), Sym ** timesortsym)
+cg_print (timesortsym)
+ Sym ** timesortsym;
{
unsigned int index;
Sym *parent;
static int
-DEFUN (cmp_name, (left, right), const PTR left AND const PTR right)
+cmp_name (left, right)
+ const PTR left;
+ const PTR right;
{
const Sym **npp1 = (const Sym **) left;
const Sym **npp2 = (const Sym **) right;
void
-DEFUN_VOID (cg_print_index)
+cg_print_index ()
{
unsigned int index;
unsigned int nnames, todo, i, j;
We want to sort in descending order. */
static int
-DEFUN (cmp_arc_count, (left, right), const PTR left AND const PTR right)
+cmp_arc_count (left, right)
+ const PTR left;
+ const PTR right;
{
const Arc **npp1 = (const Arc **) left;
const Arc **npp2 = (const Arc **) right;
We want to sort in descending order. */
static int
-DEFUN (cmp_fun_nuses, (left, right), const PTR left AND const PTR right)
+cmp_fun_nuses (left, right)
+ const PTR left;
+ const PTR right;
{
const Sym **npp1 = (const Sym **) left;
const Sym **npp2 = (const Sym **) right;
of function ordering). */
void
-DEFUN_VOID (cg_print_function_ordering)
+cg_print_function_ordering ()
{
unsigned long index, used, unused, scratch_index;
unsigned long unplaced_arc_count, high_arc_count, scratch_arc_count;
free (unplaced_arcs);
}
-/* Place functions based on the arcs in ARCS with NUMARCS entries;
+/* Place functions based on the arcs in THE_ARCS with ARC_COUNT entries;
place unused arcs into UNPLACED_ARCS/UNPLACED_ARC_COUNT.
- If ALL is nonzero, then place all functions referenced by ARCS,
- else only place those referenced in the top 99% of the arcs in ARCS. */
+ If ALL is nonzero, then place all functions referenced by THE_ARCS,
+ else only place those referenced in the top 99% of the arcs in THE_ARCS. */
#define MOST 0.99
static void
-order_and_dump_functions_by_arcs (arcs, numarcs, all,
+order_and_dump_functions_by_arcs (the_arcs, arc_count, all,
unplaced_arcs, unplaced_arc_count)
- Arc **arcs;
- unsigned long numarcs;
+ Arc **the_arcs;
+ unsigned long arc_count;
int all;
Arc **unplaced_arcs;
unsigned long *unplaced_arc_count;
if (! all)
{
total_arcs = 0;
- for (index = 0; index < numarcs; index++)
- total_arcs += arcs[index]->count;
+ for (index = 0; index < arc_count; index++)
+ total_arcs += the_arcs[index]->count;
}
else
total_arcs = 0;
tmp_arcs = 0;
- for (index = 0; index < numarcs; index++)
+ for (index = 0; index < arc_count; index++)
{
Sym *sym1, *sym2;
Sym *child, *parent;
- tmp_arcs += arcs[index]->count;
+ tmp_arcs += the_arcs[index]->count;
/* Ignore this arc if it's already been placed. */
- if (arcs[index]->has_been_placed)
+ if (the_arcs[index]->has_been_placed)
continue;
- child = arcs[index]->child;
- parent = arcs[index]->parent;
+ child = the_arcs[index]->child;
+ parent = the_arcs[index]->parent;
/* If we're not using all arcs, and this is a rarely used
arc, then put it on the unplaced_arc list. Similarly
if ((! all && (double)tmp_arcs / (double)total_arcs > MOST)
|| child->has_been_placed || parent->has_been_placed)
{
- unplaced_arcs[(*unplaced_arc_count)++] = arcs[index];
+ unplaced_arcs[(*unplaced_arc_count)++] = the_arcs[index];
continue;
}
algorithm can use it to place function chains. */
if (parent->next && parent->prev && child->next && child->prev)
{
- unplaced_arcs[(*unplaced_arc_count)++] = arcs[index];
+ unplaced_arcs[(*unplaced_arc_count)++] = the_arcs[index];
continue;
}
{
/* Couldn't find anywhere to attach the functions,
put the arc on the unplaced arc list. */
- unplaced_arcs[(*unplaced_arc_count)++] = arcs[index];
+ unplaced_arcs[(*unplaced_arc_count)++] = the_arcs[index];
continue;
}
&& sym2 == parent)
{
/* This would tie two ends together. */
- unplaced_arcs[(*unplaced_arc_count)++] = arcs[index];
+ unplaced_arcs[(*unplaced_arc_count)++] = the_arcs[index];
continue;
}
/* parent-prev and child-next */
parent->prev = child;
child->next = parent;
- arcs[index]->has_been_placed = 1;
+ the_arcs[index]->has_been_placed = 1;
}
}
else if (parent->prev)
/* parent-next and child-prev */
parent->next = child;
child->prev = parent;
- arcs[index]->has_been_placed = 1;
+ the_arcs[index]->has_been_placed = 1;
}
}
else
/* parent-prev and child-next. */
parent->prev = child;
child->next = parent;
- arcs[index]->has_been_placed = 1;
+ the_arcs[index]->has_been_placed = 1;
}
else
{
/* parent-next and child-prev. */
parent->next = child;
child->prev = parent;
- arcs[index]->has_been_placed = 1;
+ the_arcs[index]->has_been_placed = 1;
}
}
}
/* Dump the chains of functions we've made. */
- for (index = 0; index < numarcs; index++)
+ for (index = 0; index < arc_count; index++)
{
Sym *sym;
- if (arcs[index]->parent->has_been_placed
- || arcs[index]->child->has_been_placed)
+ if (the_arcs[index]->parent->has_been_placed
+ || the_arcs[index]->child->has_been_placed)
continue;
- sym = arcs[index]->parent;
+ sym = the_arcs[index]->parent;
/* If this symbol isn't attached to any other
symbols, then we've got a rarely used arc.
/* If we want to place all the arcs, then output
those which weren't placed by the main algorithm. */
if (all)
- for (index = 0; index < numarcs; index++)
+ for (index = 0; index < arc_count; index++)
{
Sym *sym;
- if (arcs[index]->parent->has_been_placed
- || arcs[index]->child->has_been_placed)
+ if (the_arcs[index]->parent->has_been_placed
+ || the_arcs[index]->child->has_been_placed)
continue;
- sym = arcs[index]->parent;
+ sym = the_arcs[index]->parent;
sym->has_been_placed = 1;
printf ("%s\n", sym->name);
on profiling information. This uses the function placement
code for the bulk of its work. */
-struct function_map
-{
- char *function_name;
- char *file_name;
-};
-
void
-DEFUN_VOID (cg_print_file_ordering)
+cg_print_file_ordering ()
{
unsigned long scratch_arc_count, index;
Arc **scratch_arcs;
- extern struct function_map *symbol_map;
- extern unsigned int symbol_map_count;
char *last;
scratch_arc_count = 0;
int offset_to_code;
/* For mapping symbols to specific .o files during file ordering. */
-struct function_map
-{
- char *function_name;
- char *file_name;
-};
-
struct function_map *symbol_map;
unsigned int symbol_map_count;
+static void read_function_mappings PARAMS ((const char *));
+static int core_sym_class PARAMS ((asymbol *));
+static boolean get_src_info
+ PARAMS ((bfd_vma, const char **, const char **, int *));
+
extern void i386_find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
extern void alpha_find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
extern void vax_find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
extern void mips_find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
static void
-DEFUN (read_function_mappings, (filename), const char *filename)
+read_function_mappings (filename)
+ const char *filename;
{
FILE *file = fopen (filename, "r");
char dummy[1024];
void
-DEFUN (core_init, (a_out_name), const char *a_out_name)
+core_init (aout_name)
+ const char *aout_name;
{
- core_bfd = bfd_openr (a_out_name, 0);
+ core_bfd = bfd_openr (aout_name, 0);
if (!core_bfd)
{
- perror (a_out_name);
+ perror (aout_name);
done (1);
}
if (!bfd_check_format (core_bfd, bfd_object))
{
- fprintf (stderr, _("%s: %s: not in a.out format\n"), whoami, a_out_name);
+ fprintf (stderr, _("%s: %s: not in a.out format\n"), whoami, aout_name);
done (1);
}
if (!core_text_sect)
{
fprintf (stderr, _("%s: can't find .text section in %s\n"),
- whoami, a_out_name);
+ whoami, aout_name);
done (1);
}
}
core_num_syms = bfd_get_symtab_upper_bound (core_bfd);
if (core_num_syms < 0)
{
- fprintf (stderr, "%s: %s: %s\n", whoami, a_out_name,
+ fprintf (stderr, "%s: %s: %s\n", whoami, aout_name,
bfd_errmsg (bfd_get_error ()));
done (1);
}
if (core_num_syms < 0)
{
- fprintf (stderr, "%s: %s: %s\n", whoami, a_out_name,
+ fprintf (stderr, "%s: %s: %s\n", whoami, aout_name,
bfd_errmsg (bfd_get_error ()));
done (1);
}
/* Read in the text space of an a.out file. */
void
-DEFUN (core_get_text_space, (core_bfd), bfd * core_bfd)
+core_get_text_space (cbfd)
+ bfd *cbfd;
{
- core_text_space = (PTR) malloc (core_text_sect->_raw_size);
+ core_text_space = (PTR) malloc ((unsigned int) core_text_sect->_raw_size);
if (!core_text_space)
{
done (1);
}
- if (!bfd_get_section_contents (core_bfd, core_text_sect, core_text_space,
- 0, core_text_sect->_raw_size))
+ if (!bfd_get_section_contents (cbfd, core_text_sect, core_text_space,
+ (bfd_vma) 0, core_text_sect->_raw_size))
{
bfd_perror ("bfd_get_section_contents");
free (core_text_space);
void
-DEFUN (find_call, (parent, p_lowpc, p_highpc),
- Sym * parent AND bfd_vma p_lowpc AND bfd_vma p_highpc)
+find_call (parent, p_lowpc, p_highpc)
+ Sym *parent;
+ bfd_vma p_lowpc;
+ bfd_vma p_highpc;
{
switch (bfd_get_arch (core_bfd))
{
't' -> symbol is a local (static) name. */
static int
-DEFUN (core_sym_class, (sym), asymbol * sym)
+core_sym_class (sym)
+ asymbol *sym;
{
symbol_info syminfo;
const char *name;
/* Get whatever source info we can get regarding address ADDR. */
static boolean
-DEFUN (get_src_info, (addr, filename, name, line_num),
- bfd_vma addr AND const char **filename AND const char **name
- AND int *line_num)
+get_src_info (addr, filename, name, line_num)
+ bfd_vma addr;
+ const char **filename;
+ const char **name;
+ int *line_num;
{
const char *fname = 0, *func_name = 0;
int l = 0;
One symbol per function is entered. */
void
-core_create_function_syms (core_bfd)
- bfd *core_bfd ATTRIBUTE_UNUSED;
+core_create_function_syms (cbfd)
+ bfd *cbfd ATTRIBUTE_UNUSED;
{
- bfd_vma min_vma = ~0, max_vma = 0;
+ bfd_vma min_vma = ~(bfd_vma) 0;
+ bfd_vma max_vma = 0;
int class;
long i, found, skip;
unsigned int j;
sym_init (symtab.limit);
symtab.limit->name = "<hicore>";
symtab.limit->addr = max_vma + 1;
- symtab.limit->end_addr = ~0;
+ symtab.limit->end_addr = ~(bfd_vma) 0;
++symtab.limit;
symtab.len = symtab.limit - symtab.base;
One symbol per line of source code is entered. */
void
-DEFUN (core_create_line_syms, (core_bfd), bfd * core_bfd)
+core_create_line_syms (cbfd)
+ bfd *cbfd;
{
char *prev_name, *prev_filename;
- int prev_name_len, prev_filename_len;
- bfd_vma vma, min_vma = ~0, max_vma = 0;
+ unsigned int prev_name_len, prev_filename_len;
+ bfd_vma vma, min_vma = ~(bfd_vma) 0, max_vma = 0;
bfd_vma offset;
Sym *prev, dummy, *sentinel, *sym;
const char *filename;
/* Create symbols for functions as usual. This is necessary in
cases where parts of a program were not compiled with -g. For
those parts we still want to get info at the function level. */
- core_create_function_syms (core_bfd);
+ core_create_function_syms (cbfd);
/* Pass 1 - counter number of symbols. */
for (offset = 0; offset < core_text_sect->_raw_size; offset += min_insn_size)
{
- int len;
+ unsigned int len;
vma = core_text_sect->vma + offset;
}
/* Update sentinels. */
- sentinel = sym_lookup (&symtab, 0);
+ sentinel = sym_lookup (&symtab, (bfd_vma) 0);
if (strcmp (sentinel->name, "<locore>") == 0
&& min_vma <= sentinel->end_addr)
sentinel->end_addr = min_vma - 1;
- sentinel = sym_lookup (&symtab, ~0);
+ sentinel = sym_lookup (&symtab, ~(bfd_vma) 0);
if (strcmp (sentinel->name, "<hicore>") == 0 && max_vma >= sentinel->addr)
sentinel->addr = max_vma + 1;
/* corefile.h
- Copyright 2000, 2001 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of GNU Binutils.
#ifndef corefile_h
#define corefile_h
+struct function_map
+{
+ char *function_name;
+ char *file_name;
+};
+
+extern struct function_map *symbol_map;
+extern unsigned int symbol_map_count;
+
extern bfd *core_bfd; /* BFD for core-file. */
extern int core_num_syms; /* # of entries in symbol-table. */
extern asymbol **core_syms; /* Symbol table in a.out. */
#include "hist.h"
#include "libiberty.h"
+static int gmon_io_read_64 PARAMS ((FILE *, BFD_HOST_U_64_BIT *));
+static int gmon_io_write_64 PARAMS ((FILE *, BFD_HOST_U_64_BIT));
+static int gmon_read_raw_arc
+ PARAMS ((FILE *, bfd_vma *, bfd_vma *, unsigned long *));
+static int gmon_write_raw_arc
+ PARAMS ((FILE *, bfd_vma, bfd_vma, unsigned long));
+
int gmon_input = 0;
int gmon_file_version = 0; /* 0 == old (non-versioned) file format. */
int
-DEFUN (gmon_io_read_32, (ifp, valp), FILE * ifp AND unsigned int *valp)
+gmon_io_read_32 (ifp, valp)
+ FILE *ifp;
+ unsigned int *valp;
{
char buf[4];
return 0;
}
-int
-DEFUN (gmon_io_read_64, (ifp, valp), FILE * ifp AND BFD_HOST_U_64_BIT *valp)
+static int
+gmon_io_read_64 (ifp, valp)
+ FILE *ifp;
+ BFD_HOST_U_64_BIT *valp;
{
char buf[8];
}
int
-DEFUN (gmon_io_read_vma, (ifp, valp), FILE * ifp AND bfd_vma *valp)
+gmon_io_read_vma (ifp, valp)
+ FILE *ifp;
+ bfd_vma *valp;
{
unsigned int val32;
BFD_HOST_U_64_BIT val64;
}
int
-DEFUN (gmon_io_read, (ifp, buf, n), FILE * ifp AND char *buf AND size_t n)
+gmon_io_read (ifp, buf, n)
+ FILE *ifp;
+ char *buf;
+ size_t n;
{
if (fread (buf, 1, n, ifp) != n)
return 1;
}
int
-DEFUN (gmon_io_write_32, (ofp, val), FILE * ofp AND unsigned int val)
+gmon_io_write_32 (ofp, val)
+ FILE *ofp;
+ unsigned int val;
{
char buf[4];
- bfd_put_32 (core_bfd, val, buf);
+ bfd_put_32 (core_bfd, (bfd_vma) val, buf);
if (fwrite (buf, 1, 4, ofp) != 4)
return 1;
return 0;
}
-int
-DEFUN (gmon_io_write_64, (ofp, val), FILE * ofp AND BFD_HOST_U_64_BIT val)
+static int
+gmon_io_write_64 (ofp, val)
+ FILE *ofp;
+ BFD_HOST_U_64_BIT val;
{
char buf[8];
- bfd_put_64 (core_bfd, val, buf);
+ bfd_put_64 (core_bfd, (bfd_vma) val, buf);
if (fwrite (buf, 1, 8, ofp) != 8)
return 1;
return 0;
}
int
-DEFUN (gmon_io_write_vma, (ofp, val), FILE * ofp AND bfd_vma val)
+gmon_io_write_vma (ofp, val)
+ FILE *ofp;
+ bfd_vma val;
{
switch (bfd_arch_bits_per_address (core_bfd))
}
int
-DEFUN (gmon_io_write_8, (ofp, val), FILE * ofp AND unsigned char val)
+gmon_io_write_8 (ofp, val)
+ FILE *ofp;
+ unsigned int val;
{
char buf[1];
}
int
-DEFUN (gmon_io_write, (ofp, buf, n), FILE * ofp AND char *buf AND size_t n)
+gmon_io_write (ofp, buf, n)
+ FILE *ofp;
+ char *buf;
+ size_t n;
{
if (fwrite (buf, 1, n, ofp) != n)
return 1;
return 0;
}
-int
-DEFUN (gmon_read_raw_arc, (ifp, fpc, spc, cnt), FILE * ifp AND bfd_vma * fpc AND bfd_vma * spc AND unsigned long * cnt)
+static int
+gmon_read_raw_arc (ifp, fpc, spc, cnt)
+ FILE *ifp;
+ bfd_vma *fpc;
+ bfd_vma *spc;
+ unsigned long *cnt;
{
BFD_HOST_U_64_BIT cnt64;
unsigned int cnt32;
return 0;
}
-int
-DEFUN (gmon_write_raw_arc, (ofp, fpc, spc, cnt), FILE * ofp AND bfd_vma fpc AND bfd_vma spc AND unsigned long cnt)
+static int
+gmon_write_raw_arc (ofp, fpc, spc, cnt)
+ FILE *ofp;
+ bfd_vma fpc;
+ bfd_vma spc;
+ unsigned long cnt;
{
if (gmon_io_write_vma (ofp, fpc)
}
void
-DEFUN (gmon_out_read, (filename), const char *filename)
+gmon_out_read (filename)
+ const char *filename;
{
FILE *ifp;
struct gmon_hdr ghdr;
void
-DEFUN (gmon_out_write, (filename), const char *filename)
+gmon_out_write (filename)
+ const char *filename;
{
FILE *ofp;
struct gmon_hdr ghdr;
/* Write gmon header. */
memcpy (&ghdr.cookie[0], GMON_MAGIC, 4);
- bfd_put_32 (core_bfd, GMON_VERSION, (bfd_byte *) ghdr.version);
+ bfd_put_32 (core_bfd, (bfd_vma) GMON_VERSION, (bfd_byte *) ghdr.version);
if (fwrite (&ghdr, sizeof (ghdr), 1, ofp) != 1)
{
|| hz != hertz())
{
if (gmon_io_write_32 (ofp, GMONVERSION)
- || gmon_io_write_32 (ofp, hz))
+ || gmon_io_write_32 (ofp, (unsigned int) hz))
{
perror (filename);
done (1);
/* Dump the samples. */
for (i = 0; i < hist_num_bins; ++i)
{
- bfd_put_16 (core_bfd, hist_sample[i], (bfd_byte *) & raw_bin_count[0]);
+ bfd_put_16 (core_bfd, (bfd_vma) hist_sample[i],
+ (bfd_byte *) &raw_bin_count[0]);
if (fwrite (&raw_bin_count[0], sizeof (raw_bin_count), 1, ofp) != 1)
{
perror (filename);
/* gmon_io.h
- Copyright 2000, 2001 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of GNU Binutils.
extern int gmon_io_read PARAMS ((FILE *ifp, char *buf, size_t n));
extern int gmon_io_write_vma PARAMS ((FILE *ifp, bfd_vma val));
extern int gmon_io_write_32 PARAMS ((FILE *ifp, unsigned int val));
-extern int gmon_io_write_8 PARAMS ((FILE *ifp, unsigned char val));
+extern int gmon_io_write_8 PARAMS ((FILE *ifp, unsigned int val));
extern int gmon_io_write PARAMS ((FILE *ifp, char *buf, size_t n));
extern void gmon_out_read PARAMS ((const char *));
#include "sym_ids.h"
#include "demangle.h"
+static void usage PARAMS ((FILE *, int)) ATTRIBUTE_NORETURN;
+int main PARAMS ((int, char **));
+
const char *whoami;
const char *function_mapping_file;
const char *a_out_name = A_OUTNAME;
static void
-DEFUN (usage, (stream, status), FILE * stream AND int status)
+usage (stream, status)
+ FILE *stream;
+ int status;
{
fprintf (stream, _("\
Usage: %s [-[abcDhilLsTvwxyz]] [-[ACeEfFJnNOpPqQZ][name]] [-I dirs]\n\
int
-DEFUN (main, (argc, argv), int argc AND char **argv)
+main (argc, argv)
+ int argc;
+ char **argv;
{
char **sp, *str;
Sym **cg = 0;
extern boolean first_output; /* no output so far? */
-extern void done PARAMS ((int status));
+extern void done PARAMS ((int status)) ATTRIBUTE_NORETURN;
#endif /* gprof_h */
/* hist.c - Histogram related operations.
- Copyright 2000, 2001 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of GNU Binutils.
#define UNITS_TO_CODE (offset_to_code / sizeof(UNIT))
static void scale_and_align_entries PARAMS ((void));
+static void print_header PARAMS ((int));
+static void print_line PARAMS ((Sym *, double));
+static int cmp_time PARAMS ((const PTR, const PTR));
/* Declarations of automatically generated functions to output blurbs. */
extern void flat_blurb PARAMS ((FILE * fp));
is provided for formatting error messages only. */
void
-DEFUN (hist_read_rec, (ifp, filename), FILE * ifp AND const char *filename)
+hist_read_rec (ifp, filename)
+ FILE * ifp;
+ const char *filename;
{
bfd_vma n_lowpc, n_highpc;
int i, ncnt, profrate;
of OFP and is provided for formatting error-messages only. */
void
-DEFUN (hist_write_hist, (ofp, filename), FILE * ofp AND const char *filename)
+hist_write_hist (ofp, filename)
+ FILE * ofp;
+ const char *filename;
{
UNIT count;
int i;
for (i = 0; i < hist_num_bins; ++i)
{
- bfd_put_16 (core_bfd, hist_sample[i], (bfd_byte *) & count[0]);
+ bfd_put_16 (core_bfd, (bfd_vma) hist_sample[i], (bfd_byte *) &count[0]);
if (fwrite (&count[0], sizeof (count), 1, ofp) != 1)
{
cases, above). */
void
-DEFUN_VOID (hist_assign_samples)
+hist_assign_samples ()
{
bfd_vma bin_low_pc, bin_high_pc;
bfd_vma sym_low_pc, sym_high_pc;
/* Print header for flag histogram profile. */
static void
-DEFUN (print_header, (prefix), const char prefix)
+print_header (prefix)
+ int prefix;
{
char unit[64];
static void
-DEFUN (print_line, (sym, scale), Sym * sym AND double scale)
+print_line (sym, scale)
+ Sym *sym;
+ double scale;
{
if (ignore_zeros && sym->ncalls == 0 && sym->hist.time == 0)
return;
lexicographic order of the function names. */
static int
-DEFUN (cmp_time, (lp, rp), const PTR lp AND const PTR rp)
+cmp_time (lp, rp)
+ const PTR lp;
+ const PTR rp;
{
const Sym *left = *(const Sym **) lp;
const Sym *right = *(const Sym **) rp;
/* Print the flat histogram profile. */
void
-DEFUN_VOID (hist_print)
+hist_print ()
{
Sym **time_sorted_syms, *top_dog, *sym;
unsigned int index;
DBG (CALLDEBUG,
printf (_("[find_call] 0x%lx: jal"), (unsigned long) pc));
offset = (op & 0x03ffffff) << 2;
- dest_pc = (pc & ~0xfffffff) | offset;
+ dest_pc = (pc & ~(bfd_vma) 0xfffffff) | offset;
if (dest_pc >= s_lowpc && dest_pc <= s_highpc)
{
child = sym_lookup (&symtab, dest_pc);
/* search-list.c
- Copyright 2000, 2001 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of GNU Binutils.
void
-DEFUN (search_list_append, (list, paths),
- Search_List * list AND const char *paths)
+search_list_append (list, paths)
+ Search_List *list;
+ const char *paths;
{
Search_List_Elem *new_el;
const char *beg, *colon;
- int len;
+ unsigned int len;
colon = paths - 1;
do
/* source.c - Keep track of source files.
- Copyright 2000, 2001 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of GNU Binutils.
Source_File *
-DEFUN (source_file_lookup_path, (path), const char *path)
+source_file_lookup_path (path)
+ const char *path;
{
Source_File *sf;
Source_File *
-DEFUN (source_file_lookup_name, (filename), const char *filename)
+source_file_lookup_name (filename)
+ const char *filename;
{
const char *fname;
Source_File *sf;
FILE *
-DEFUN (annotate_source, (sf, max_width, annote, arg),
- Source_File * sf AND int max_width
- AND void (*annote) PARAMS ((char *buf, int w, int l, void *arg))
- AND void *arg)
+annotate_source (sf, max_width, annote, arg)
+ Source_File *sf;
+ unsigned int max_width;
+ void (*annote) PARAMS ((char *, unsigned int, int, void *));
+ void *arg;
{
static boolean first_file = true;
int i, line_num, nread;
/* source.h
- Copyright 2000, 2001 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of GNU Binutils.
Returns a pointer to the output file (which maybe stdout) such
that summary statistics can be printed. If the returned file
is not stdout, it should be closed when done with it. */
-extern FILE *annotate_source PARAMS ((Source_File * sf, int max_width,
- void (*annote) (char *b, int w, int l,
- void *arg),
- void *arg));
+extern FILE *annotate_source
+ PARAMS ((Source_File *sf, unsigned int max_width,
+ void (*annote) (char *, unsigned int, int, PTR arg),
+ PTR arg));
#endif /* source_h */
bfd_vma p_highpc;
{
bfd_vma pc, dest_pc;
- unsigned long insn;
+ unsigned int insn;
Sym *child;
if (core_text_space == 0)
DBG (CALLDEBUG, printf ("[find_call] %s: 0x%lx to 0x%lx\n",
parent->name, (unsigned long) p_lowpc,
(unsigned long) p_highpc));
- for (pc = (p_lowpc + 3) & ~3; pc < p_highpc; pc += 4)
+ for (pc = (p_lowpc + 3) & ~(bfd_vma) 3; pc < p_highpc; pc += 4)
{
insn = bfd_get_32 (core_bfd, ((unsigned char *) core_text_space
+ pc - core_text_sect->vma));
/* sym_ids.c
- Copyright 2000, 2001 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of GNU Binutils.
}
*id_list;
+static void parse_spec PARAMS ((char *, Sym *));
+static void parse_id PARAMS ((struct sym_id *));
+static boolean match PARAMS ((Sym *, Sym *));
+static void extend_match PARAMS ((struct match *, Sym *, Sym_Table *, boolean));
+
+
Sym_Table syms[NUM_TABLES];
#ifdef DEBUG
void
-DEFUN (sym_id_add, (spec, which_table),
- const char *spec AND Table_Id which_table)
+sym_id_add (spec, which_table)
+ const char *spec;
+ Table_Id which_table;
{
struct sym_id *id;
int len = strlen (spec);
FILENAME not containing a dot can be specified by FILENAME. */
static void
-DEFUN (parse_spec, (spec, sym), char *spec AND Sym * sym)
+parse_spec (spec, sym)
+ char *spec;
+ Sym *sym;
{
char *colon;
by parse_spec(). */
static void
-DEFUN (parse_id, (id), struct sym_id *id)
+parse_id (id)
+ struct sym_id *id;
{
char *slash;
/* Return TRUE iff PATTERN matches SYM. */
static boolean
-DEFUN (match, (pattern, sym), Sym * pattern AND Sym * sym)
+match (pattern, sym)
+ Sym *pattern;
+ Sym *sym;
{
return (pattern->file ? pattern->file == sym->file : true)
&& (pattern->line_num ? pattern->line_num == sym->line_num : true)
static void
-DEFUN (extend_match, (m, sym, tab, second_pass),
- struct match *m AND Sym * sym AND Sym_Table * tab AND boolean second_pass)
+extend_match (m, sym, tab, second_pass)
+ struct match *m;
+ Sym *sym;
+ Sym_Table *tab;
+ boolean second_pass;
{
if (m->prev_match != sym - 1)
{
requests---you get what you ask for! */
void
-DEFUN_VOID (sym_id_parse)
+sym_id_parse ()
{
Sym *sym, *left, *right;
struct sym_id *id;
very big (the user has to type them!), so a linear search is probably
tolerable. */
boolean
-DEFUN (sym_id_arc_is_present, (symtab, from, to),
- Sym_Table * symtab AND Sym * from AND Sym * to)
+sym_id_arc_is_present (sym_tab, from, to)
+ Sym_Table *sym_tab;
+ Sym *from;
+ Sym *to;
{
Sym *sym;
- for (sym = symtab->base; sym < symtab->limit; ++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))
/* sym_ids.h
- Copyright 2000, 2001 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of GNU Binutils.
/* symtab.c
- Copyright 2000, 2001 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of GNU Binutils.
#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));
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;
void
-DEFUN (symtab_finalize, (tab), Sym_Table * tab)
+symtab_finalize (tab)
+ Sym_Table *tab;
{
Sym *src, *dst;
bfd_vma prev_addr;
#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;
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;
/* 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;
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;
{
DBG (LOOKUPDEBUG,
printf ("[sym_lookup] %d probes (symtab->len=%u)\n",
- probes, symtab->len - 1));
+ probes, sym_tab->len - 1));
return &sym[mid];
}
}
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];
}
}
/* symtab.h
- Copyright 2000, 2001 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of GNU Binutils.
extern void sym_init PARAMS ((Sym *));
extern void symtab_finalize PARAMS ((Sym_Table *));
+#ifdef DEBUG
+extern Sym *dbg_sym_lookup PARAMS ((Sym_Table *, bfd_vma));
+#endif
extern Sym *sym_lookup PARAMS ((Sym_Table *, bfd_vma));
extern void find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
#include "source.h"
#include "symtab.h"
#include "cg_arcs.h"
+#include "utils.h"
/*
* Print name of symbol. Return number of characters printed.
*/
int
-DEFUN (print_name_only, (self), Sym * self)
+print_name_only (self)
+ Sym *self;
{
const char *name = self->name;
const char *filename;
void
-DEFUN (print_name, (self), Sym * self)
+print_name (self)
+ Sym *self;
{
print_name_only (self);