+2004-05-26 Ben Elliston <bje@au.ibm.com>
+
+ * alpha.c, basic_blocks.c, basic_blocks.h, bb_exit_func.c,
+ call_graph.c, call_graph.h, cg_arcs.c, cg_arcs.h, cg_dfn.c,
+ cg_dfn.h, cg_print.c, cg_print.h, corefile.c, corefile.h,
+ gmon_io.c, gmon_io.h, gprof.c, gprof.h, hertz.h, hist.c, hist.h,
+ i386.c, mips.c, search_list.c, search_list.h, source.c, source.h,
+ sparc.c, sym_ids.c, sym_ids.h, symtab.c, symtab.h, tahoe.c,
+ utils.c, utils.h, vax.c, gen-c-prog.awk: Convert K&R C to ANSI C.
+
2004-05-26 Ben Elliston <bje@au.ibm.com>
* corefile.c (core_init): Use a separate local variable,
static Sym indirect_child;
-void alpha_find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
+void alpha_find_call (Sym *, bfd_vma, bfd_vma);
/*
* On the Alpha we can only detect PC relative calls, which are
* potentially call integer division routines, for example.)
*/
void
-alpha_find_call (parent, p_lowpc, p_highpc)
- Sym *parent;
- bfd_vma p_lowpc;
- bfd_vma p_highpc;
+alpha_find_call (Sym *parent, bfd_vma p_lowpc, bfd_vma p_highpc)
{
bfd_vma pc, dest_pc;
unsigned int insn;
#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));
+static int cmp_bb (const PTR, const PTR);
+static int cmp_ncalls (const PTR, const PTR);
+static void fskip_string (FILE *);
+static void annotate_with_count (char *, unsigned int, int, PTR);
/* Default option values: */
bfd_boolean bb_annotate_all_lines = FALSE;
number, and address (in that order). */
static int
-cmp_bb (lp, rp)
- const PTR lp;
- const PTR rp;
+cmp_bb (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
-cmp_ncalls (lp, rp)
- const PTR lp;
- const PTR rp;
+cmp_ncalls (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
-fskip_string (fp)
- FILE *fp;
+fskip_string (FILE *fp)
{
int ch;
of file IFP and is provided for formatting error-messages only. */
void
-bb_read_rec (ifp, filename)
- FILE *ifp;
- const char *filename;
+bb_read_rec (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
-bb_write_blocks (ofp, filename)
- FILE *ofp;
- const char *filename;
+bb_write_blocks (FILE *ofp, const char *filename)
{
unsigned int nblocks = 0;
Sym *sym;
that starts the basic-block. */
static void
-annotate_with_count (buf, width, line_num, arg)
- char *buf;
- unsigned int width;
- int line_num;
- PTR arg;
+annotate_with_count (char *buf, unsigned int width, int line_num, PTR arg)
{
Source_File *sf = arg;
Sym *b;
extern int bb_table_length; /* Length of most-used bb table. */
extern unsigned long bb_min_calls; /* Minimum execution count. */
-extern void bb_read_rec PARAMS ((FILE *, const char *));
-extern void bb_write_blocks PARAMS ((FILE *, const char *));
-extern void bb_create_syms PARAMS ((void));
-extern void print_annotated_source PARAMS ((void));
-extern void print_exec_counts PARAMS ((void));
+extern void bb_read_rec (FILE *, const char *);
+extern void bb_write_blocks (FILE *, const char *);
+extern void bb_create_syms (void);
+extern void print_annotated_source (void);
+extern void print_exec_counts (void);
#endif /* basic_blocks_h */
void
-__bb_exit_func (void)
+__bb_exit_func ()
{
const int version = GMON_VERSION;
struct gmon_hdr ghdr;
#include "sym_ids.h"
void
-cg_tally (from_pc, self_pc, count)
- bfd_vma from_pc;
- bfd_vma self_pc;
- unsigned long count;
+cg_tally (bfd_vma from_pc, bfd_vma self_pc, unsigned long count)
{
Sym *parent;
Sym *child;
for formatting error-messages only. */
void
-cg_read_rec (ifp, filename)
- FILE *ifp;
- const char *filename;
+cg_read_rec (FILE *ifp, const char *filename)
{
bfd_vma from_pc, self_pc;
unsigned int count;
only. */
void
-cg_write_arcs (ofp, filename)
- FILE *ofp;
- const char *filename;
+cg_write_arcs (FILE *ofp, const char *filename)
{
Arc *arc;
Sym *sym;
#ifndef call_graph_h
#define call_graph_h
-extern void cg_tally PARAMS ((bfd_vma, bfd_vma, unsigned long));
-extern void cg_read_rec PARAMS ((FILE *, const char *));
-extern void cg_write_arcs PARAMS ((FILE *, const char *));
+extern void cg_tally (bfd_vma, bfd_vma, unsigned long);
+extern void cg_read_rec (FILE *, const char *);
+extern void cg_write_arcs (FILE *, const char *);
#endif /* call_graph_h */
#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));
+static int cmp_topo (const PTR, const PTR);
+static void propagate_time (Sym *);
+static void cycle_time (void);
+static void cycle_link (void);
+static void inherit_flags (Sym *);
+static void propagate_flags (Sym **);
+static int cmp_total (const PTR, const PTR);
Sym *cycle_header;
unsigned int num_cycles;
* range covered by CHILD.
*/
Arc *
-arc_lookup (parent, child)
- Sym *parent;
- Sym *child;
+arc_lookup (Sym *parent, Sym *child)
{
Arc *arc;
* Add (or just increment) an arc:
*/
void
-arc_add (parent, child, count)
- Sym *parent;
- Sym *child;
- unsigned long count;
+arc_add (Sym *parent, Sym *child, unsigned long count)
{
static unsigned int maxarcs = 0;
Arc *arc, **newarcs;
static int
-cmp_topo (lp, rp)
- const PTR lp;
- const PTR rp;
+cmp_topo (const PTR lp, const PTR rp)
{
const Sym *left = *(const Sym **) lp;
const Sym *right = *(const Sym **) rp;
static void
-propagate_time (parent)
- Sym *parent;
+propagate_time (Sym *parent)
{
Arc *arc;
Sym *child;
* fractions from parents.
*/
static void
-inherit_flags (child)
- Sym *child;
+inherit_flags (Sym *child)
{
Sym *head, *parent, *member;
Arc *arc;
* and while we're here, sum time for functions.
*/
static void
-propagate_flags (symbols)
- Sym **symbols;
+propagate_flags (Sym **symbols)
{
int index;
Sym *old_head, *child;
* first. All else being equal, compare by names.
*/
static int
-cmp_total (lp, rp)
- const PTR lp;
- const PTR rp;
+cmp_total (const PTR lp, const PTR rp)
{
const Sym *left = *(const Sym **) lp;
const Sym *right = *(const Sym **) rp;
extern unsigned int num_cycles; /* number of cycles discovered */
extern Sym *cycle_header; /* cycle headers */
-extern void arc_add PARAMS ((Sym * parent, Sym * child, unsigned long count));
-extern Arc *arc_lookup PARAMS ((Sym * parent, Sym * child));
-extern Sym **cg_assemble PARAMS ((void));
+extern void arc_add (Sym * parent, Sym * child, unsigned long count);
+extern Arc *arc_lookup (Sym * parent, Sym * child);
+extern Sym **cg_assemble (void);
extern Arc **arcs;
extern unsigned int numarcs;
}
DFN_Stack;
-static bfd_boolean is_numbered PARAMS ((Sym *));
-static bfd_boolean is_busy PARAMS ((Sym *));
-static void find_cycle PARAMS ((Sym *));
-static void pre_visit PARAMS ((Sym *));
-static void post_visit PARAMS ((Sym *));
+static bfd_boolean is_numbered (Sym *);
+static bfd_boolean is_busy (Sym *);
+static void find_cycle (Sym *);
+static void pre_visit (Sym *);
+static void post_visit (Sym *);
DFN_Stack *dfn_stack = NULL;
int dfn_maxdepth = 0;
* Is CHILD already numbered?
*/
static bfd_boolean
-is_numbered (child)
- Sym *child;
+is_numbered (Sym *child)
{
return child->cg.top_order != DFN_NAN && child->cg.top_order != DFN_BUSY;
}
* Is CHILD already busy?
*/
static bfd_boolean
-is_busy (child)
- Sym *child;
+is_busy (Sym *child)
{
if (child->cg.top_order == DFN_NAN)
{
* depth-first number).
*/
static void
-find_cycle (child)
- Sym *child;
+find_cycle (Sym *child)
{
Sym *head = 0;
Sym *tail;
* the stack and mark it busy.
*/
static void
-pre_visit (parent)
- Sym *parent;
+pre_visit (Sym *parent)
{
++dfn_depth;
* and number functions if PARENT is head of a cycle.
*/
static void
-post_visit (parent)
- Sym *parent;
+post_visit (Sym *parent)
{
Sym *member;
* Given this PARENT, depth first number its children.
*/
void
-cg_dfn (parent)
- Sym *parent;
+cg_dfn (Sym *parent)
{
Arc *arc;
* Depth-first numbering of a call-graph.
*/
-extern void cg_dfn PARAMS ((Sym * root));
+extern void cg_dfn (Sym * root);
#endif /* cg_dfn_h */
#define EQUALTO 0
#define GREATERTHAN 1
-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 print_header (void);
+static void print_cycle (Sym *);
+static int cmp_member (Sym *, Sym *);
+static void sort_members (Sym *);
+static void print_members (Sym *);
+static int cmp_arc (Arc *, Arc *);
+static void sort_parents (Sym *);
+static void print_parents (Sym *);
+static void sort_children (Sym *);
+static void print_children (Sym *);
+static void print_line (Sym *);
+static int cmp_name (const PTR, const PTR);
+static int cmp_arc_count (const PTR, const PTR);
+static int cmp_fun_nuses (const PTR, const PTR);
static void order_and_dump_functions_by_arcs
- PARAMS ((Arc **, unsigned long, int, Arc **, unsigned long *));
+ (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));
+extern void bsd_callg_blurb (FILE * fp);
+extern void fsf_callg_blurb (FILE * fp);
double print_time = 0.0;
/* Print a cycle header. */
static void
-print_cycle (cyc)
- Sym *cyc;
+print_cycle (Sym *cyc)
{
char buf[BUFSIZ];
CG.PROP.SELF+CG.PROP.CHILD, secondary key is NCALLS+CG.SELF_CALLS. */
static int
-cmp_member (left, right)
- Sym *left;
- Sym *right;
+cmp_member (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
-sort_members (cyc)
- Sym *cyc;
+sort_members (Sym *cyc)
{
Sym *todo, *doing, *prev;
/* Print the members of a cycle. */
static void
-print_members (cyc)
- Sym *cyc;
+print_members (Sym *cyc)
{
Sym *member;
arc count as minor key. */
static int
-cmp_arc (left, right)
- Arc *left;
- Arc *right;
+cmp_arc (Arc *left, Arc *right)
{
Sym *left_parent = left->parent;
Sym *left_child = left->child;
static void
-sort_parents (child)
- Sym * child;
+sort_parents (Sym * child)
{
Arc *arc, *detached, sorted, *prev;
static void
-print_parents (child)
- Sym *child;
+print_parents (Sym *child)
{
Sym *parent;
Arc *arc;
static void
-sort_children (parent)
- Sym *parent;
+sort_children (Sym *parent)
{
Arc *arc, *detached, sorted, *prev;
static void
-print_children (parent)
- Sym *parent;
+print_children (Sym *parent)
{
Sym *child;
Arc *arc;
static void
-print_line (np)
- Sym *np;
+print_line (Sym *np)
{
char buf[BUFSIZ];
/* Print dynamic call graph. */
void
-cg_print (timesortsym)
- Sym ** timesortsym;
+cg_print (Sym ** timesortsym)
{
unsigned int index;
Sym *parent;
static int
-cmp_name (left, right)
- const PTR left;
- const PTR right;
+cmp_name (const PTR left, const PTR right)
{
const Sym **npp1 = (const Sym **) left;
const Sym **npp2 = (const Sym **) right;
We want to sort in descending order. */
static int
-cmp_arc_count (left, right)
- const PTR left;
- const PTR right;
+cmp_arc_count (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
-cmp_fun_nuses (left, right)
- const PTR left;
- const PTR right;
+cmp_fun_nuses (const PTR left, const PTR right)
{
const Sym **npp1 = (const Sym **) left;
const Sym **npp2 = (const Sym **) right;
extern double print_time; /* Total of time being printed. */
-extern void cg_print PARAMS ((Sym **));
-extern void cg_print_index PARAMS ((void));
-extern void cg_print_file_ordering PARAMS ((void));
-extern void cg_print_function_ordering PARAMS ((void));
+extern void cg_print (Sym **);
+extern void cg_print_index (void);
+extern void cg_print_file_ordering (void);
+extern void cg_print_function_ordering (void);
#endif /* cg_print_h */
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 void read_function_mappings (const char *);
+static int core_sym_class (asymbol *);
static bfd_boolean get_src_info
- PARAMS ((bfd_vma, const char **, const char **, int *));
+ (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 tahoe_find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
-extern void sparc_find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
-extern void mips_find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
+extern void i386_find_call (Sym *, bfd_vma, bfd_vma);
+extern void alpha_find_call (Sym *, bfd_vma, bfd_vma);
+extern void vax_find_call (Sym *, bfd_vma, bfd_vma);
+extern void tahoe_find_call (Sym *, bfd_vma, bfd_vma);
+extern void sparc_find_call (Sym *, bfd_vma, bfd_vma);
+extern void mips_find_call (Sym *, bfd_vma, bfd_vma);
static void
-read_function_mappings (filename)
- const char *filename;
+read_function_mappings (const char *filename)
{
FILE *file = fopen (filename, "r");
char dummy[1024];
void
-core_init (aout_name)
- const char *aout_name;
+core_init (const char *aout_name)
{
int core_sym_bytes;
core_bfd = bfd_openr (aout_name, 0);
/* Read in the text space of an a.out file. */
void
-core_get_text_space (cbfd)
- bfd *cbfd;
+core_get_text_space (bfd *cbfd)
{
core_text_space = (PTR) malloc ((unsigned int) core_text_sect->_raw_size);
void
-find_call (parent, p_lowpc, p_highpc)
- Sym *parent;
- bfd_vma p_lowpc;
- bfd_vma p_highpc;
+find_call (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
-core_sym_class (sym)
- asymbol *sym;
+core_sym_class (asymbol *sym)
{
symbol_info syminfo;
const char *name;
/* Get whatever source info we can get regarding address ADDR. */
static bfd_boolean
-get_src_info (addr, filename, name, line_num)
- bfd_vma addr;
- const char **filename;
- const char **name;
- int *line_num;
+get_src_info (bfd_vma addr, const char **filename, const char **name, int *line_num)
{
const char *fname = 0, *func_name = 0;
int l = 0;
extern int offset_to_code; /* Offset (in bytes) of code from entry
address of routine. */
-extern void core_init PARAMS ((const char *));
-extern void core_get_text_space PARAMS ((bfd *));
-extern void core_create_function_syms PARAMS ((void));
-extern void core_create_line_syms PARAMS ((void));
+extern void core_init (const char *);
+extern void core_get_text_space (bfd *);
+extern void core_create_function_syms (void);
+extern void core_create_line_syms (void);
#endif /* corefile_h */
print "}"
curfun = FUNCTION
print ""
- print "void ", FUNCTION, "PARAMS ((FILE *));"
+ print "void ", FUNCTION, "(FILE *);"
print "void";
printf "%s (file)\n", FUNCTION
print " FILE *file;";
ptr_unsigned
};
-static enum gmon_ptr_size gmon_get_ptr_size PARAMS ((void));
-static enum gmon_ptr_signedness gmon_get_ptr_signedness PARAMS ((void));
+static enum gmon_ptr_size gmon_get_ptr_size (void);
+static enum gmon_ptr_signedness gmon_get_ptr_signedness (void);
#ifdef BFD_HOST_U_64_BIT
-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_io_read_64 (FILE *, BFD_HOST_U_64_BIT *);
+static int gmon_io_write_64 (FILE *, BFD_HOST_U_64_BIT);
#endif
static int gmon_read_raw_arc
- PARAMS ((FILE *, bfd_vma *, bfd_vma *, unsigned long *));
+ (FILE *, bfd_vma *, bfd_vma *, unsigned long *);
static int gmon_write_raw_arc
- PARAMS ((FILE *, bfd_vma, bfd_vma, unsigned long));
+ (FILE *, bfd_vma, bfd_vma, unsigned long);
int gmon_input = 0;
int gmon_file_version = 0; /* 0 == old (non-versioned) file format. */
}
int
-gmon_io_read_32 (ifp, valp)
- FILE *ifp;
- unsigned int *valp;
+gmon_io_read_32 (FILE *ifp, unsigned int *valp)
{
char buf[4];
#ifdef BFD_HOST_U_64_BIT
static int
-gmon_io_read_64 (ifp, valp)
- FILE *ifp;
- BFD_HOST_U_64_BIT *valp;
+gmon_io_read_64 (FILE *ifp, BFD_HOST_U_64_BIT *valp)
{
char buf[8];
#endif
int
-gmon_io_read_vma (ifp, valp)
- FILE *ifp;
- bfd_vma *valp;
+gmon_io_read_vma (FILE *ifp, bfd_vma *valp)
{
unsigned int val32;
#ifdef BFD_HOST_U_64_BIT
}
int
-gmon_io_read (ifp, buf, n)
- FILE *ifp;
- char *buf;
- size_t n;
+gmon_io_read (FILE *ifp, char *buf, size_t n)
{
if (fread (buf, 1, n, ifp) != n)
return 1;
}
int
-gmon_io_write_32 (ofp, val)
- FILE *ofp;
- unsigned int val;
+gmon_io_write_32 (FILE *ofp, unsigned int val)
{
char buf[4];
#ifdef BFD_HOST_U_64_BIT
static int
-gmon_io_write_64 (ofp, val)
- FILE *ofp;
- BFD_HOST_U_64_BIT val;
+gmon_io_write_64 (FILE *ofp, BFD_HOST_U_64_BIT val)
{
char buf[8];
#endif
int
-gmon_io_write_vma (ofp, val)
- FILE *ofp;
- bfd_vma val;
+gmon_io_write_vma (FILE *ofp, bfd_vma val)
{
switch (gmon_get_ptr_size ())
}
int
-gmon_io_write_8 (ofp, val)
- FILE *ofp;
- unsigned int val;
+gmon_io_write_8 (FILE *ofp, unsigned int val)
{
char buf[1];
}
int
-gmon_io_write (ofp, buf, n)
- FILE *ofp;
- char *buf;
- size_t n;
+gmon_io_write (FILE *ofp, char *buf, size_t n)
{
if (fwrite (buf, 1, n, ofp) != n)
return 1;
}
static int
-gmon_read_raw_arc (ifp, fpc, spc, cnt)
- FILE *ifp;
- bfd_vma *fpc;
- bfd_vma *spc;
- unsigned long *cnt;
+gmon_read_raw_arc (FILE *ifp, bfd_vma *fpc, bfd_vma *spc, unsigned long *cnt)
{
#ifdef BFD_HOST_U_64_BIT
BFD_HOST_U_64_BIT cnt64;
}
static int
-gmon_write_raw_arc (ofp, fpc, spc, cnt)
- FILE *ofp;
- bfd_vma fpc;
- bfd_vma spc;
- unsigned long cnt;
+gmon_write_raw_arc (FILE *ofp, bfd_vma fpc, bfd_vma spc, unsigned long cnt)
{
if (gmon_io_write_vma (ofp, fpc)
}
void
-gmon_out_read (filename)
- const char *filename;
+gmon_out_read (const char *filename)
{
FILE *ifp;
struct gmon_hdr ghdr;
void
-gmon_out_write (filename)
- const char *filename;
+gmon_out_write (const char *filename)
{
FILE *ofp;
struct gmon_hdr ghdr;
extern int gmon_input; /* What input did we see? */
extern int gmon_file_version; /* File version are we dealing with. */
-extern int gmon_io_read_vma PARAMS ((FILE *ifp, bfd_vma *valp));
-extern int gmon_io_read_32 PARAMS ((FILE *ifp, unsigned int *valp));
-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 int val));
-extern int gmon_io_write PARAMS ((FILE *ifp, char *buf, size_t n));
-
-extern void gmon_out_read PARAMS ((const char *));
-extern void gmon_out_write PARAMS ((const char *));
+extern int gmon_io_read_vma (FILE *ifp, bfd_vma *valp);
+extern int gmon_io_read_32 (FILE *ifp, unsigned int *valp);
+extern int gmon_io_read (FILE *ifp, char *buf, size_t n);
+extern int gmon_io_write_vma (FILE *ifp, bfd_vma val);
+extern int gmon_io_write_32 (FILE *ifp, unsigned int val);
+extern int gmon_io_write_8 (FILE *ifp, unsigned int val);
+extern int gmon_io_write (FILE *ifp, char *buf, size_t n);
+
+extern void gmon_out_read (const char *);
+extern void gmon_out_write (const char *);
#endif /* gmon_io_h */
#include "demangle.h"
#include "getopt.h"
-static void usage PARAMS ((FILE *, int)) ATTRIBUTE_NORETURN;
-int main PARAMS ((int, char **));
+static void usage (FILE *, int) ATTRIBUTE_NORETURN;
+int main (int, char **);
const char *whoami;
const char *function_mapping_file;
static void
-usage (stream, status)
- FILE *stream;
- int status;
+usage (FILE *stream, int status)
{
fprintf (stream, _("\
Usage: %s [-[abcDhilLsTvwxyz]] [-[ACeEfFJnNOpPqQZ][name]] [-I dirs]\n\
int
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
char **sp, *str;
Sym **cg = 0;
}
void
-done (status)
- int status;
+done (int status)
{
exit (status);
}
extern bfd_boolean first_output; /* no output so far? */
-extern void done PARAMS ((int status)) ATTRIBUTE_NORETURN;
+extern void done (int status) ATTRIBUTE_NORETURN;
#endif /* gprof_h */
* we return HZ_WRONG, an impossible sampling frequency.
*/
-extern int hertz PARAMS ((void));
+extern int hertz (void);
#endif /* hertz_h */
#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));
+static void scale_and_align_entries (void);
+static void print_header (int);
+static void print_line (Sym *, double);
+static int cmp_time (const PTR, const PTR);
/* Declarations of automatically generated functions to output blurbs. */
-extern void flat_blurb PARAMS ((FILE * fp));
+extern void flat_blurb (FILE * fp);
bfd_vma s_lowpc; /* Lowest address in .text. */
bfd_vma s_highpc = 0; /* Highest address in .text. */
is provided for formatting error messages only. */
void
-hist_read_rec (ifp, filename)
- FILE * ifp;
- const char *filename;
+hist_read_rec (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
-hist_write_hist (ofp, filename)
- FILE * ofp;
- const char *filename;
+hist_write_hist (FILE * ofp, const char *filename)
{
UNIT count;
int i;
/* Print header for flag histogram profile. */
static void
-print_header (prefix)
- int prefix;
+print_header (int prefix)
{
char unit[64];
static void
-print_line (sym, scale)
- Sym *sym;
- double scale;
+print_line (Sym *sym, double scale)
{
if (ignore_zeros && sym->ncalls == 0 && sym->hist.time == 0)
return;
lexicographic order of the function names. */
static int
-cmp_time (lp, rp)
- const PTR lp;
- const PTR rp;
+cmp_time (const PTR lp, const PTR rp)
{
const Sym *left = *(const Sym **) lp;
const Sym *right = *(const Sym **) rp;
extern double hist_scale;
-extern void hist_read_rec PARAMS ((FILE *, const char *));
-extern void hist_write_hist PARAMS ((FILE *, const char *));
-extern void hist_assign_samples PARAMS ((void));
-extern void hist_print PARAMS ((void));
+extern void hist_read_rec (FILE *, const char *);
+extern void hist_write_hist (FILE *, const char *);
+extern void hist_assign_samples (void);
+extern void hist_print (void);
#endif /* hist_h */
#include "corefile.h"
#include "hist.h"
-static int i386_iscall PARAMS ((unsigned char *));
-void i386_find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
+static int i386_iscall (unsigned char *);
+void i386_find_call (Sym *, bfd_vma, bfd_vma);
static int
-i386_iscall (ip)
- unsigned char *ip;
+i386_iscall (unsigned char *ip)
{
if (*ip == 0xe8)
return 1;
void
-i386_find_call (parent, p_lowpc, p_highpc)
- Sym *parent;
- bfd_vma p_lowpc;
- bfd_vma p_highpc;
+i386_find_call (Sym *parent, bfd_vma p_lowpc, bfd_vma p_highpc)
{
unsigned char *instructp;
Sym *child;
static Sym indirect_child;
-void mips_find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
+void mips_find_call (Sym *, bfd_vma, bfd_vma);
void
-mips_find_call (parent, p_lowpc, p_highpc)
- Sym *parent;
- bfd_vma p_lowpc;
- bfd_vma p_highpc;
+mips_find_call (Sym *parent, bfd_vma p_lowpc, bfd_vma p_highpc)
{
bfd_vma pc, dest_pc;
unsigned int op;
void
-search_list_append (list, paths)
- Search_List *list;
- const char *paths;
+search_list_append (Search_List *list, const char *paths)
{
Search_List_Elem *new_el;
const char *beg, *colon;
}
Search_List;
-extern void search_list_append PARAMS ((Search_List *, const char *));
+extern void search_list_append (Search_List *, const char *);
#endif /* search_list_h */
Source_File *
-source_file_lookup_path (path)
- const char *path;
+source_file_lookup_path (const char *path)
{
Source_File *sf;
Source_File *
-source_file_lookup_name (filename)
- const char *filename;
+source_file_lookup_name (const char *filename)
{
const char *fname;
Source_File *sf;
FILE *
-annotate_source (sf, max_width, annote, arg)
- Source_File *sf;
- unsigned int max_width;
- void (*annote) PARAMS ((char *, unsigned int, int, void *));
- void *arg;
+annotate_source (Source_File *sf, unsigned int max_width,
+ void (*annote) (char *, unsigned int, int, void *),
+ void *arg)
{
static bfd_boolean first_file = TRUE;
int i, line_num, nread;
extern Source_File *first_src_file;
/* Returns pointer to source file descriptor for PATH/FILENAME. */
-extern Source_File *source_file_lookup_path PARAMS ((const char *));
-extern Source_File *source_file_lookup_name PARAMS ((const char *));
+extern Source_File *source_file_lookup_path (const char *);
+extern Source_File *source_file_lookup_name (const char *);
/* Read source file SF output annotated source. The annotation is at
MAX_WIDTH characters wide and for each source-line an annotation is
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, unsigned int max_width,
+ (Source_File *sf, unsigned int max_width,
void (*annote) (char *, unsigned int, int, PTR arg),
- PTR arg));
+ PTR arg);
#endif /* source_h */
*/
#define CALL (0xc0000000)
-void sparc_find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
+void sparc_find_call (Sym *, bfd_vma, bfd_vma);
void
-sparc_find_call (parent, p_lowpc, p_highpc)
- Sym *parent;
- bfd_vma p_lowpc;
- bfd_vma p_highpc;
+sparc_find_call (Sym *parent, bfd_vma p_lowpc, bfd_vma p_highpc)
{
bfd_vma pc, dest_pc;
unsigned int insn;
*id_list;
static void parse_spec
- PARAMS ((char *, Sym *));
+ (char *, Sym *);
static void parse_id
- PARAMS ((struct sym_id *));
+ (struct sym_id *);
static bfd_boolean match
- PARAMS ((Sym *, Sym *));
+ (Sym *, Sym *);
static void extend_match
- PARAMS ((struct match *, Sym *, Sym_Table *, bfd_boolean));
+ (struct match *, Sym *, Sym_Table *, bfd_boolean);
Sym_Table syms[NUM_TABLES];
void
-sym_id_add (spec, which_table)
- const char *spec;
- Table_Id which_table;
+sym_id_add (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
-parse_spec (spec, sym)
- char *spec;
- Sym *sym;
+parse_spec (char *spec, Sym *sym)
{
char *colon;
by parse_spec(). */
static void
-parse_id (id)
- struct sym_id *id;
+parse_id (struct sym_id *id)
{
char *slash;
/* Return TRUE iff PATTERN matches SYM. */
static bfd_boolean
-match (pattern, sym)
- Sym *pattern;
- Sym *sym;
+match (Sym *pattern, Sym *sym)
{
return (pattern->file ? pattern->file == sym->file : TRUE)
&& (pattern->line_num ? pattern->line_num == sym->line_num : TRUE)
static void
-extend_match (m, sym, tab, second_pass)
- struct match *m;
- Sym *sym;
- Sym_Table *tab;
- bfd_boolean second_pass;
+extend_match (struct match *m, Sym *sym, Sym_Table *tab, bfd_boolean second_pass)
{
if (m->prev_match != sym - 1)
{
very big (the user has to type them!), so a linear search is probably
tolerable. */
bfd_boolean
-sym_id_arc_is_present (sym_tab, from, to)
- Sym_Table *sym_tab;
- Sym *from;
- Sym *to;
+sym_id_arc_is_present (Sym_Table *sym_tab, Sym *from, Sym *to)
{
Sym *sym;
extern Sym_Table syms[NUM_TABLES];
-extern void sym_id_add PARAMS ((const char *, Table_Id));
-extern void sym_id_parse PARAMS ((void));
-extern bfd_boolean sym_id_arc_is_present PARAMS ((Sym_Table *, Sym *, Sym *));
+extern void sym_id_add (const char *, Table_Id);
+extern void sym_id_parse (void);
+extern bfd_boolean sym_id_arc_is_present (Sym_Table *, Sym *, Sym *);
#endif /* sym_ids_h */
#include "cg_arcs.h"
#include "corefile.h"
-static int cmp_addr PARAMS ((const PTR, const PTR));
+static int cmp_addr (const PTR, const PTR);
Sym_Table symtab;
/* Initialize a symbol (so it's empty). */
void
-sym_init (sym)
- Sym *sym;
+sym_init (Sym *sym)
{
memset (sym, 0, sizeof (*sym));
the global symbol survives. */
static int
-cmp_addr (lp, rp)
- const PTR lp;
- const PTR rp;
+cmp_addr (const PTR lp, const PTR rp)
{
const Sym *left = (const Sym *) lp;
const Sym *right = (const Sym *) rp;
void
-symtab_finalize (tab)
- Sym_Table *tab;
+symtab_finalize (Sym_Table *tab)
{
Sym *src, *dst;
bfd_vma prev_addr;
#ifdef DEBUG
Sym *
-dbg_sym_lookup (sym_tab, address)
- Sym_Table *sym_tab;
- bfd_vma address;
+dbg_sym_lookup (Sym_Table *sym_tab, bfd_vma address)
{
long low, mid, high;
Sym *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 *
-sym_lookup (sym_tab, address)
- Sym_Table *sym_tab;
- bfd_vma address;
+sym_lookup (Sym_Table *sym_tab, bfd_vma address)
{
long low, high;
long mid = -1;
extern Sym_Table symtab; /* The symbol table. */
-extern void sym_init PARAMS ((Sym *));
-extern void symtab_finalize PARAMS ((Sym_Table *));
+extern void sym_init (Sym *);
+extern void symtab_finalize (Sym_Table *);
#ifdef DEBUG
-extern Sym *dbg_sym_lookup PARAMS ((Sym_Table *, bfd_vma));
+extern Sym *dbg_sym_lookup (Sym_Table *, bfd_vma);
#endif
-extern Sym *sym_lookup PARAMS ((Sym_Table *, bfd_vma));
-extern void find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
+extern Sym *sym_lookup (Sym_Table *, bfd_vma);
+extern void find_call (Sym *, bfd_vma, bfd_vma);
#endif /* symtab_h */
*/
static Sym indirectchild;
-static tahoe_operandenum tahoe_operandmode PARAMS ((unsigned char *));
-static char *tahoe_operandname PARAMS ((tahoe_operandenum));
-static long tahoe_operandlength PARAMS ((unsigned char *));
-static bfd_signed_vma tahoe_offset PARAMS ((unsigned char *));
-void tahoe_find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
+static tahoe_operandenum tahoe_operandmode (unsigned char *);
+static char *tahoe_operandname (tahoe_operandenum);
+static long tahoe_operandlength (unsigned char *);
+static bfd_signed_vma tahoe_offset (unsigned char *);
+void tahoe_find_call (Sym *, bfd_vma, bfd_vma);
static tahoe_operandenum
-tahoe_operandmode (modep)
- unsigned char *modep;
+tahoe_operandmode (unsigned char *modep)
{
long usesreg = *modep & 0xf;
}
static char *
-tahoe_operandname (mode)
- tahoe_operandenum mode;
+tahoe_operandname (tahoe_operandenum mode)
{
switch (mode)
}
static long
-tahoe_operandlength (modep)
- unsigned char *modep;
+tahoe_operandlength (unsigned char *modep
+)
{
switch (tahoe_operandmode (modep))
}
static bfd_signed_vma
-tahoe_offset (modep)
- unsigned char *modep;
+tahoe_offset (unsigned char *modep)
{
tahoe_operandenum mode = tahoe_operandmode (modep);
}
void
-tahoe_find_call (parent, p_lowpc, p_highpc)
- Sym *parent;
- bfd_vma p_lowpc;
- bfd_vma p_highpc;
+tahoe_find_call (Sym *parent, bfd_vma p_lowpc, bfd_vma p_highpc)
{
unsigned char *instructp;
long length;
* Print name of symbol. Return number of characters printed.
*/
int
-print_name_only (self)
- Sym *self;
+print_name_only (Sym *self)
{
const char *name = self->name;
const char *filename;
void
-print_name (self)
- Sym *self;
+print_name (Sym *self)
{
print_name_only (self);
#ifndef utils_h
#define utils_h
-extern int print_name_only PARAMS ((Sym * self));
-extern void print_name PARAMS ((Sym * self));
+extern int print_name_only (Sym * self);
+extern void print_name (Sym * self);
#endif /* utils_h */
*/
static Sym indirectchild;
-static operandenum vax_operandmode PARAMS ((unsigned char *));
-static char *vax_operandname PARAMS ((operandenum));
-static long vax_operandlength PARAMS ((unsigned char *));
-static bfd_signed_vma vax_offset PARAMS ((unsigned char *));
-void vax_find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
+static operandenum vax_operandmode (unsigned char *);
+static char *vax_operandname (operandenum);
+static long vax_operandlength (unsigned char *);
+static bfd_signed_vma vax_offset (unsigned char *);
+void vax_find_call (Sym *, bfd_vma, bfd_vma);
static operandenum
-vax_operandmode (modep)
- unsigned char *modep;
+vax_operandmode (unsigned char *modep)
{
int usesreg = *modep & 0xf;
}
static char *
-vax_operandname (mode)
- operandenum mode;
+vax_operandname (operandenum mode)
{
switch (mode)
}
static long
-vax_operandlength (modep)
- unsigned char *modep;
+vax_operandlength (unsigned char *modep)
{
switch (vax_operandmode (modep))
}
static bfd_signed_vma
-vax_offset (modep)
- unsigned char *modep;
+vax_offset (unsigned char *modep)
{
operandenum mode = vax_operandmode (modep);
void
-vax_find_call (parent, p_lowpc, p_highpc)
- Sym *parent;
- bfd_vma p_lowpc;
- bfd_vma p_highpc;
+vax_find_call (Sym *parent, bfd_vma p_lowpc, bfd_vma p_highpc)
{
unsigned char *instructp;
long length;