mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-10-16 12:24:19 +08:00
* 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.
This commit is contained in:
@ -1,3 +1,13 @@
|
|||||||
|
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>
|
2004-05-26 Ben Elliston <bje@au.ibm.com>
|
||||||
|
|
||||||
* corefile.c (core_init): Use a separate local variable,
|
* corefile.c (core_init): Use a separate local variable,
|
||||||
|
@ -78,7 +78,7 @@ alpha_Instruction;
|
|||||||
|
|
||||||
static Sym indirect_child;
|
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
|
* On the Alpha we can only detect PC relative calls, which are
|
||||||
@ -88,10 +88,7 @@ void alpha_find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
|
|||||||
* potentially call integer division routines, for example.)
|
* potentially call integer division routines, for example.)
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
alpha_find_call (parent, p_lowpc, p_highpc)
|
alpha_find_call (Sym *parent, bfd_vma p_lowpc, bfd_vma p_highpc)
|
||||||
Sym *parent;
|
|
||||||
bfd_vma p_lowpc;
|
|
||||||
bfd_vma p_highpc;
|
|
||||||
{
|
{
|
||||||
bfd_vma pc, dest_pc;
|
bfd_vma pc, dest_pc;
|
||||||
unsigned int insn;
|
unsigned int insn;
|
||||||
|
@ -32,10 +32,10 @@
|
|||||||
#include "symtab.h"
|
#include "symtab.h"
|
||||||
#include "sym_ids.h"
|
#include "sym_ids.h"
|
||||||
|
|
||||||
static int cmp_bb PARAMS ((const PTR, const PTR));
|
static int cmp_bb (const PTR, const PTR);
|
||||||
static int cmp_ncalls PARAMS ((const PTR, const PTR));
|
static int cmp_ncalls (const PTR, const PTR);
|
||||||
static void fskip_string PARAMS ((FILE *));
|
static void fskip_string (FILE *);
|
||||||
static void annotate_with_count PARAMS ((char *, unsigned int, int, PTR));
|
static void annotate_with_count (char *, unsigned int, int, PTR);
|
||||||
|
|
||||||
/* Default option values: */
|
/* Default option values: */
|
||||||
bfd_boolean bb_annotate_all_lines = FALSE;
|
bfd_boolean bb_annotate_all_lines = FALSE;
|
||||||
@ -52,9 +52,7 @@ static long num_lines_executed;
|
|||||||
number, and address (in that order). */
|
number, and address (in that order). */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
cmp_bb (lp, rp)
|
cmp_bb (const PTR lp, const PTR rp)
|
||||||
const PTR lp;
|
|
||||||
const PTR rp;
|
|
||||||
{
|
{
|
||||||
int r;
|
int r;
|
||||||
const Sym *left = *(const Sym **) lp;
|
const Sym *left = *(const Sym **) lp;
|
||||||
@ -83,9 +81,7 @@ cmp_bb (lp, rp)
|
|||||||
/* Helper for sorting. Order basic blocks in decreasing number of
|
/* Helper for sorting. Order basic blocks in decreasing number of
|
||||||
calls, ties are broken in increasing order of line numbers. */
|
calls, ties are broken in increasing order of line numbers. */
|
||||||
static int
|
static int
|
||||||
cmp_ncalls (lp, rp)
|
cmp_ncalls (const PTR lp, const PTR rp)
|
||||||
const PTR lp;
|
|
||||||
const PTR rp;
|
|
||||||
{
|
{
|
||||||
const Sym *left = *(const Sym **) lp;
|
const Sym *left = *(const Sym **) lp;
|
||||||
const Sym *right = *(const Sym **) rp;
|
const Sym *right = *(const Sym **) rp;
|
||||||
@ -105,8 +101,7 @@ cmp_ncalls (lp, rp)
|
|||||||
|
|
||||||
/* Skip over variable length string. */
|
/* Skip over variable length string. */
|
||||||
static void
|
static void
|
||||||
fskip_string (fp)
|
fskip_string (FILE *fp)
|
||||||
FILE *fp;
|
|
||||||
{
|
{
|
||||||
int ch;
|
int ch;
|
||||||
|
|
||||||
@ -121,9 +116,7 @@ fskip_string (fp)
|
|||||||
of file IFP and is provided for formatting error-messages only. */
|
of file IFP and is provided for formatting error-messages only. */
|
||||||
|
|
||||||
void
|
void
|
||||||
bb_read_rec (ifp, filename)
|
bb_read_rec (FILE *ifp, const char *filename)
|
||||||
FILE *ifp;
|
|
||||||
const char *filename;
|
|
||||||
{
|
{
|
||||||
int nblocks, b;
|
int nblocks, b;
|
||||||
bfd_vma addr, ncalls;
|
bfd_vma addr, ncalls;
|
||||||
@ -211,9 +204,7 @@ bb_read_rec (ifp, filename)
|
|||||||
is the name of OFP and is provided for producing error-messages
|
is the name of OFP and is provided for producing error-messages
|
||||||
only. */
|
only. */
|
||||||
void
|
void
|
||||||
bb_write_blocks (ofp, filename)
|
bb_write_blocks (FILE *ofp, const char *filename)
|
||||||
FILE *ofp;
|
|
||||||
const char *filename;
|
|
||||||
{
|
{
|
||||||
unsigned int nblocks = 0;
|
unsigned int nblocks = 0;
|
||||||
Sym *sym;
|
Sym *sym;
|
||||||
@ -323,11 +314,7 @@ print_exec_counts ()
|
|||||||
that starts the basic-block. */
|
that starts the basic-block. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
annotate_with_count (buf, width, line_num, arg)
|
annotate_with_count (char *buf, unsigned int width, int line_num, PTR arg)
|
||||||
char *buf;
|
|
||||||
unsigned int width;
|
|
||||||
int line_num;
|
|
||||||
PTR arg;
|
|
||||||
{
|
{
|
||||||
Source_File *sf = arg;
|
Source_File *sf = arg;
|
||||||
Sym *b;
|
Sym *b;
|
||||||
|
@ -25,9 +25,9 @@ extern bfd_boolean bb_annotate_all_lines; /* Force annotation of all lines? */
|
|||||||
extern int bb_table_length; /* Length of most-used bb table. */
|
extern int bb_table_length; /* Length of most-used bb table. */
|
||||||
extern unsigned long bb_min_calls; /* Minimum execution count. */
|
extern unsigned long bb_min_calls; /* Minimum execution count. */
|
||||||
|
|
||||||
extern void bb_read_rec PARAMS ((FILE *, const char *));
|
extern void bb_read_rec (FILE *, const char *);
|
||||||
extern void bb_write_blocks PARAMS ((FILE *, const char *));
|
extern void bb_write_blocks (FILE *, const char *);
|
||||||
extern void bb_create_syms PARAMS ((void));
|
extern void bb_create_syms (void);
|
||||||
extern void print_annotated_source PARAMS ((void));
|
extern void print_annotated_source (void);
|
||||||
extern void print_exec_counts PARAMS ((void));
|
extern void print_exec_counts (void);
|
||||||
#endif /* basic_blocks_h */
|
#endif /* basic_blocks_h */
|
||||||
|
@ -44,7 +44,7 @@ struct bb *__bb_head = (struct bb *) 0;
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
__bb_exit_func (void)
|
__bb_exit_func ()
|
||||||
{
|
{
|
||||||
const int version = GMON_VERSION;
|
const int version = GMON_VERSION;
|
||||||
struct gmon_hdr ghdr;
|
struct gmon_hdr ghdr;
|
||||||
|
@ -31,10 +31,7 @@
|
|||||||
#include "sym_ids.h"
|
#include "sym_ids.h"
|
||||||
|
|
||||||
void
|
void
|
||||||
cg_tally (from_pc, self_pc, count)
|
cg_tally (bfd_vma from_pc, bfd_vma self_pc, unsigned long count)
|
||||||
bfd_vma from_pc;
|
|
||||||
bfd_vma self_pc;
|
|
||||||
unsigned long count;
|
|
||||||
{
|
{
|
||||||
Sym *parent;
|
Sym *parent;
|
||||||
Sym *child;
|
Sym *child;
|
||||||
@ -80,9 +77,7 @@ cg_tally (from_pc, self_pc, count)
|
|||||||
for formatting error-messages only. */
|
for formatting error-messages only. */
|
||||||
|
|
||||||
void
|
void
|
||||||
cg_read_rec (ifp, filename)
|
cg_read_rec (FILE *ifp, const char *filename)
|
||||||
FILE *ifp;
|
|
||||||
const char *filename;
|
|
||||||
{
|
{
|
||||||
bfd_vma from_pc, self_pc;
|
bfd_vma from_pc, self_pc;
|
||||||
unsigned int count;
|
unsigned int count;
|
||||||
@ -109,9 +104,7 @@ cg_read_rec (ifp, filename)
|
|||||||
only. */
|
only. */
|
||||||
|
|
||||||
void
|
void
|
||||||
cg_write_arcs (ofp, filename)
|
cg_write_arcs (FILE *ofp, const char *filename)
|
||||||
FILE *ofp;
|
|
||||||
const char *filename;
|
|
||||||
{
|
{
|
||||||
Arc *arc;
|
Arc *arc;
|
||||||
Sym *sym;
|
Sym *sym;
|
||||||
|
@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||||||
#ifndef call_graph_h
|
#ifndef call_graph_h
|
||||||
#define call_graph_h
|
#define call_graph_h
|
||||||
|
|
||||||
extern void cg_tally PARAMS ((bfd_vma, bfd_vma, unsigned long));
|
extern void cg_tally (bfd_vma, bfd_vma, unsigned long);
|
||||||
extern void cg_read_rec PARAMS ((FILE *, const char *));
|
extern void cg_read_rec (FILE *, const char *);
|
||||||
extern void cg_write_arcs PARAMS ((FILE *, const char *));
|
extern void cg_write_arcs (FILE *, const char *);
|
||||||
|
|
||||||
#endif /* call_graph_h */
|
#endif /* call_graph_h */
|
||||||
|
@ -38,13 +38,13 @@
|
|||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "sym_ids.h"
|
#include "sym_ids.h"
|
||||||
|
|
||||||
static int cmp_topo PARAMS ((const PTR, const PTR));
|
static int cmp_topo (const PTR, const PTR);
|
||||||
static void propagate_time PARAMS ((Sym *));
|
static void propagate_time (Sym *);
|
||||||
static void cycle_time PARAMS ((void));
|
static void cycle_time (void);
|
||||||
static void cycle_link PARAMS ((void));
|
static void cycle_link (void);
|
||||||
static void inherit_flags PARAMS ((Sym *));
|
static void inherit_flags (Sym *);
|
||||||
static void propagate_flags PARAMS ((Sym **));
|
static void propagate_flags (Sym **);
|
||||||
static int cmp_total PARAMS ((const PTR, const PTR));
|
static int cmp_total (const PTR, const PTR);
|
||||||
|
|
||||||
Sym *cycle_header;
|
Sym *cycle_header;
|
||||||
unsigned int num_cycles;
|
unsigned int num_cycles;
|
||||||
@ -56,9 +56,7 @@ unsigned int numarcs;
|
|||||||
* range covered by CHILD.
|
* range covered by CHILD.
|
||||||
*/
|
*/
|
||||||
Arc *
|
Arc *
|
||||||
arc_lookup (parent, child)
|
arc_lookup (Sym *parent, Sym *child)
|
||||||
Sym *parent;
|
|
||||||
Sym *child;
|
|
||||||
{
|
{
|
||||||
Arc *arc;
|
Arc *arc;
|
||||||
|
|
||||||
@ -87,10 +85,7 @@ arc_lookup (parent, child)
|
|||||||
* Add (or just increment) an arc:
|
* Add (or just increment) an arc:
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
arc_add (parent, child, count)
|
arc_add (Sym *parent, Sym *child, unsigned long count)
|
||||||
Sym *parent;
|
|
||||||
Sym *child;
|
|
||||||
unsigned long count;
|
|
||||||
{
|
{
|
||||||
static unsigned int maxarcs = 0;
|
static unsigned int maxarcs = 0;
|
||||||
Arc *arc, **newarcs;
|
Arc *arc, **newarcs;
|
||||||
@ -156,9 +151,7 @@ arc_add (parent, child, count)
|
|||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
cmp_topo (lp, rp)
|
cmp_topo (const PTR lp, const PTR rp)
|
||||||
const PTR lp;
|
|
||||||
const PTR rp;
|
|
||||||
{
|
{
|
||||||
const Sym *left = *(const Sym **) lp;
|
const Sym *left = *(const Sym **) lp;
|
||||||
const Sym *right = *(const Sym **) rp;
|
const Sym *right = *(const Sym **) rp;
|
||||||
@ -168,8 +161,7 @@ cmp_topo (lp, rp)
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
propagate_time (parent)
|
propagate_time (Sym *parent)
|
||||||
Sym *parent;
|
|
||||||
{
|
{
|
||||||
Arc *arc;
|
Arc *arc;
|
||||||
Sym *child;
|
Sym *child;
|
||||||
@ -365,8 +357,7 @@ cycle_link ()
|
|||||||
* fractions from parents.
|
* fractions from parents.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
inherit_flags (child)
|
inherit_flags (Sym *child)
|
||||||
Sym *child;
|
|
||||||
{
|
{
|
||||||
Sym *head, *parent, *member;
|
Sym *head, *parent, *member;
|
||||||
Arc *arc;
|
Arc *arc;
|
||||||
@ -444,8 +435,7 @@ inherit_flags (child)
|
|||||||
* and while we're here, sum time for functions.
|
* and while we're here, sum time for functions.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
propagate_flags (symbols)
|
propagate_flags (Sym **symbols)
|
||||||
Sym **symbols;
|
|
||||||
{
|
{
|
||||||
int index;
|
int index;
|
||||||
Sym *old_head, *child;
|
Sym *old_head, *child;
|
||||||
@ -545,9 +535,7 @@ propagate_flags (symbols)
|
|||||||
* first. All else being equal, compare by names.
|
* first. All else being equal, compare by names.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
cmp_total (lp, rp)
|
cmp_total (const PTR lp, const PTR rp)
|
||||||
const PTR lp;
|
|
||||||
const PTR rp;
|
|
||||||
{
|
{
|
||||||
const Sym *left = *(const Sym **) lp;
|
const Sym *left = *(const Sym **) lp;
|
||||||
const Sym *right = *(const Sym **) rp;
|
const Sym *right = *(const Sym **) rp;
|
||||||
|
@ -24,9 +24,9 @@ Arc;
|
|||||||
extern unsigned int num_cycles; /* number of cycles discovered */
|
extern unsigned int num_cycles; /* number of cycles discovered */
|
||||||
extern Sym *cycle_header; /* cycle headers */
|
extern Sym *cycle_header; /* cycle headers */
|
||||||
|
|
||||||
extern void arc_add PARAMS ((Sym * parent, Sym * child, unsigned long count));
|
extern void arc_add (Sym * parent, Sym * child, unsigned long count);
|
||||||
extern Arc *arc_lookup PARAMS ((Sym * parent, Sym * child));
|
extern Arc *arc_lookup (Sym * parent, Sym * child);
|
||||||
extern Sym **cg_assemble PARAMS ((void));
|
extern Sym **cg_assemble (void);
|
||||||
extern Arc **arcs;
|
extern Arc **arcs;
|
||||||
extern unsigned int numarcs;
|
extern unsigned int numarcs;
|
||||||
|
|
||||||
|
@ -44,11 +44,11 @@ typedef struct
|
|||||||
}
|
}
|
||||||
DFN_Stack;
|
DFN_Stack;
|
||||||
|
|
||||||
static bfd_boolean is_numbered PARAMS ((Sym *));
|
static bfd_boolean is_numbered (Sym *);
|
||||||
static bfd_boolean is_busy PARAMS ((Sym *));
|
static bfd_boolean is_busy (Sym *);
|
||||||
static void find_cycle PARAMS ((Sym *));
|
static void find_cycle (Sym *);
|
||||||
static void pre_visit PARAMS ((Sym *));
|
static void pre_visit (Sym *);
|
||||||
static void post_visit PARAMS ((Sym *));
|
static void post_visit (Sym *);
|
||||||
|
|
||||||
DFN_Stack *dfn_stack = NULL;
|
DFN_Stack *dfn_stack = NULL;
|
||||||
int dfn_maxdepth = 0;
|
int dfn_maxdepth = 0;
|
||||||
@ -60,8 +60,7 @@ int dfn_counter = DFN_NAN;
|
|||||||
* Is CHILD already numbered?
|
* Is CHILD already numbered?
|
||||||
*/
|
*/
|
||||||
static bfd_boolean
|
static bfd_boolean
|
||||||
is_numbered (child)
|
is_numbered (Sym *child)
|
||||||
Sym *child;
|
|
||||||
{
|
{
|
||||||
return child->cg.top_order != DFN_NAN && child->cg.top_order != DFN_BUSY;
|
return child->cg.top_order != DFN_NAN && child->cg.top_order != DFN_BUSY;
|
||||||
}
|
}
|
||||||
@ -71,8 +70,7 @@ is_numbered (child)
|
|||||||
* Is CHILD already busy?
|
* Is CHILD already busy?
|
||||||
*/
|
*/
|
||||||
static bfd_boolean
|
static bfd_boolean
|
||||||
is_busy (child)
|
is_busy (Sym *child)
|
||||||
Sym *child;
|
|
||||||
{
|
{
|
||||||
if (child->cg.top_order == DFN_NAN)
|
if (child->cg.top_order == DFN_NAN)
|
||||||
{
|
{
|
||||||
@ -89,8 +87,7 @@ is_busy (child)
|
|||||||
* depth-first number).
|
* depth-first number).
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
find_cycle (child)
|
find_cycle (Sym *child)
|
||||||
Sym *child;
|
|
||||||
{
|
{
|
||||||
Sym *head = 0;
|
Sym *head = 0;
|
||||||
Sym *tail;
|
Sym *tail;
|
||||||
@ -213,8 +210,7 @@ find_cycle (child)
|
|||||||
* the stack and mark it busy.
|
* the stack and mark it busy.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
pre_visit (parent)
|
pre_visit (Sym *parent)
|
||||||
Sym *parent;
|
|
||||||
{
|
{
|
||||||
++dfn_depth;
|
++dfn_depth;
|
||||||
|
|
||||||
@ -238,8 +234,7 @@ pre_visit (parent)
|
|||||||
* and number functions if PARENT is head of a cycle.
|
* and number functions if PARENT is head of a cycle.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
post_visit (parent)
|
post_visit (Sym *parent)
|
||||||
Sym *parent;
|
|
||||||
{
|
{
|
||||||
Sym *member;
|
Sym *member;
|
||||||
|
|
||||||
@ -273,8 +268,7 @@ post_visit (parent)
|
|||||||
* Given this PARENT, depth first number its children.
|
* Given this PARENT, depth first number its children.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
cg_dfn (parent)
|
cg_dfn (Sym *parent)
|
||||||
Sym *parent;
|
|
||||||
{
|
{
|
||||||
Arc *arc;
|
Arc *arc;
|
||||||
|
|
||||||
|
@ -12,6 +12,6 @@
|
|||||||
* Depth-first numbering of a call-graph.
|
* Depth-first numbering of a call-graph.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern void cg_dfn PARAMS ((Sym * root));
|
extern void cg_dfn (Sym * root);
|
||||||
|
|
||||||
#endif /* cg_dfn_h */
|
#endif /* cg_dfn_h */
|
||||||
|
@ -35,26 +35,26 @@
|
|||||||
#define EQUALTO 0
|
#define EQUALTO 0
|
||||||
#define GREATERTHAN 1
|
#define GREATERTHAN 1
|
||||||
|
|
||||||
static void print_header PARAMS ((void));
|
static void print_header (void);
|
||||||
static void print_cycle PARAMS ((Sym *));
|
static void print_cycle (Sym *);
|
||||||
static int cmp_member PARAMS ((Sym *, Sym *));
|
static int cmp_member (Sym *, Sym *);
|
||||||
static void sort_members PARAMS ((Sym *));
|
static void sort_members (Sym *);
|
||||||
static void print_members PARAMS ((Sym *));
|
static void print_members (Sym *);
|
||||||
static int cmp_arc PARAMS ((Arc *, Arc *));
|
static int cmp_arc (Arc *, Arc *);
|
||||||
static void sort_parents PARAMS ((Sym *));
|
static void sort_parents (Sym *);
|
||||||
static void print_parents PARAMS ((Sym *));
|
static void print_parents (Sym *);
|
||||||
static void sort_children PARAMS ((Sym *));
|
static void sort_children (Sym *);
|
||||||
static void print_children PARAMS ((Sym *));
|
static void print_children (Sym *);
|
||||||
static void print_line PARAMS ((Sym *));
|
static void print_line (Sym *);
|
||||||
static int cmp_name PARAMS ((const PTR, const PTR));
|
static int cmp_name (const PTR, const PTR);
|
||||||
static int cmp_arc_count PARAMS ((const PTR, const PTR));
|
static int cmp_arc_count (const PTR, const PTR);
|
||||||
static int cmp_fun_nuses PARAMS ((const PTR, const PTR));
|
static int cmp_fun_nuses (const PTR, const PTR);
|
||||||
static void order_and_dump_functions_by_arcs
|
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. */
|
/* Declarations of automatically generated functions to output blurbs. */
|
||||||
extern void bsd_callg_blurb PARAMS ((FILE * fp));
|
extern void bsd_callg_blurb (FILE * fp);
|
||||||
extern void fsf_callg_blurb PARAMS ((FILE * fp));
|
extern void fsf_callg_blurb (FILE * fp);
|
||||||
|
|
||||||
double print_time = 0.0;
|
double print_time = 0.0;
|
||||||
|
|
||||||
@ -109,8 +109,7 @@ print_header ()
|
|||||||
/* Print a cycle header. */
|
/* Print a cycle header. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
print_cycle (cyc)
|
print_cycle (Sym *cyc)
|
||||||
Sym *cyc;
|
|
||||||
{
|
{
|
||||||
char buf[BUFSIZ];
|
char buf[BUFSIZ];
|
||||||
|
|
||||||
@ -133,9 +132,7 @@ print_cycle (cyc)
|
|||||||
CG.PROP.SELF+CG.PROP.CHILD, secondary key is NCALLS+CG.SELF_CALLS. */
|
CG.PROP.SELF+CG.PROP.CHILD, secondary key is NCALLS+CG.SELF_CALLS. */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
cmp_member (left, right)
|
cmp_member (Sym *left, Sym *right)
|
||||||
Sym *left;
|
|
||||||
Sym *right;
|
|
||||||
{
|
{
|
||||||
double left_time = left->cg.prop.self + left->cg.prop.child;
|
double left_time = left->cg.prop.self + left->cg.prop.child;
|
||||||
double right_time = right->cg.prop.self + right->cg.prop.child;
|
double right_time = right->cg.prop.self + right->cg.prop.child;
|
||||||
@ -160,8 +157,7 @@ cmp_member (left, right)
|
|||||||
/* Sort members of a cycle. */
|
/* Sort members of a cycle. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
sort_members (cyc)
|
sort_members (Sym *cyc)
|
||||||
Sym *cyc;
|
|
||||||
{
|
{
|
||||||
Sym *todo, *doing, *prev;
|
Sym *todo, *doing, *prev;
|
||||||
|
|
||||||
@ -188,8 +184,7 @@ sort_members (cyc)
|
|||||||
/* Print the members of a cycle. */
|
/* Print the members of a cycle. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
print_members (cyc)
|
print_members (Sym *cyc)
|
||||||
Sym *cyc;
|
|
||||||
{
|
{
|
||||||
Sym *member;
|
Sym *member;
|
||||||
|
|
||||||
@ -223,9 +218,7 @@ print_members (cyc)
|
|||||||
arc count as minor key. */
|
arc count as minor key. */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
cmp_arc (left, right)
|
cmp_arc (Arc *left, Arc *right)
|
||||||
Arc *left;
|
|
||||||
Arc *right;
|
|
||||||
{
|
{
|
||||||
Sym *left_parent = left->parent;
|
Sym *left_parent = left->parent;
|
||||||
Sym *left_child = left->child;
|
Sym *left_child = left->child;
|
||||||
@ -311,8 +304,7 @@ cmp_arc (left, right)
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
sort_parents (child)
|
sort_parents (Sym * child)
|
||||||
Sym * child;
|
|
||||||
{
|
{
|
||||||
Arc *arc, *detached, sorted, *prev;
|
Arc *arc, *detached, sorted, *prev;
|
||||||
|
|
||||||
@ -345,8 +337,7 @@ sort_parents (child)
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
print_parents (child)
|
print_parents (Sym *child)
|
||||||
Sym *child;
|
|
||||||
{
|
{
|
||||||
Sym *parent;
|
Sym *parent;
|
||||||
Arc *arc;
|
Arc *arc;
|
||||||
@ -400,8 +391,7 @@ print_parents (child)
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
sort_children (parent)
|
sort_children (Sym *parent)
|
||||||
Sym *parent;
|
|
||||||
{
|
{
|
||||||
Arc *arc, *detached, sorted, *prev;
|
Arc *arc, *detached, sorted, *prev;
|
||||||
|
|
||||||
@ -434,8 +424,7 @@ sort_children (parent)
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
print_children (parent)
|
print_children (Sym *parent)
|
||||||
Sym *parent;
|
|
||||||
{
|
{
|
||||||
Sym *child;
|
Sym *child;
|
||||||
Arc *arc;
|
Arc *arc;
|
||||||
@ -474,8 +463,7 @@ print_children (parent)
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
print_line (np)
|
print_line (Sym *np)
|
||||||
Sym *np;
|
|
||||||
{
|
{
|
||||||
char buf[BUFSIZ];
|
char buf[BUFSIZ];
|
||||||
|
|
||||||
@ -508,8 +496,7 @@ print_line (np)
|
|||||||
/* Print dynamic call graph. */
|
/* Print dynamic call graph. */
|
||||||
|
|
||||||
void
|
void
|
||||||
cg_print (timesortsym)
|
cg_print (Sym ** timesortsym)
|
||||||
Sym ** timesortsym;
|
|
||||||
{
|
{
|
||||||
unsigned int index;
|
unsigned int index;
|
||||||
Sym *parent;
|
Sym *parent;
|
||||||
@ -560,9 +547,7 @@ cg_print (timesortsym)
|
|||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
cmp_name (left, right)
|
cmp_name (const PTR left, const PTR right)
|
||||||
const PTR left;
|
|
||||||
const PTR right;
|
|
||||||
{
|
{
|
||||||
const Sym **npp1 = (const Sym **) left;
|
const Sym **npp1 = (const Sym **) left;
|
||||||
const Sym **npp2 = (const Sym **) right;
|
const Sym **npp2 = (const Sym **) right;
|
||||||
@ -686,9 +671,7 @@ cg_print_index ()
|
|||||||
We want to sort in descending order. */
|
We want to sort in descending order. */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
cmp_arc_count (left, right)
|
cmp_arc_count (const PTR left, const PTR right)
|
||||||
const PTR left;
|
|
||||||
const PTR right;
|
|
||||||
{
|
{
|
||||||
const Arc **npp1 = (const Arc **) left;
|
const Arc **npp1 = (const Arc **) left;
|
||||||
const Arc **npp2 = (const Arc **) right;
|
const Arc **npp2 = (const Arc **) right;
|
||||||
@ -705,9 +688,7 @@ cmp_arc_count (left, right)
|
|||||||
We want to sort in descending order. */
|
We want to sort in descending order. */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
cmp_fun_nuses (left, right)
|
cmp_fun_nuses (const PTR left, const PTR right)
|
||||||
const PTR left;
|
|
||||||
const PTR right;
|
|
||||||
{
|
{
|
||||||
const Sym **npp1 = (const Sym **) left;
|
const Sym **npp1 = (const Sym **) left;
|
||||||
const Sym **npp2 = (const Sym **) right;
|
const Sym **npp2 = (const Sym **) right;
|
||||||
|
@ -23,9 +23,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||||||
|
|
||||||
extern double print_time; /* Total of time being printed. */
|
extern double print_time; /* Total of time being printed. */
|
||||||
|
|
||||||
extern void cg_print PARAMS ((Sym **));
|
extern void cg_print (Sym **);
|
||||||
extern void cg_print_index PARAMS ((void));
|
extern void cg_print_index (void);
|
||||||
extern void cg_print_file_ordering PARAMS ((void));
|
extern void cg_print_file_ordering (void);
|
||||||
extern void cg_print_function_ordering PARAMS ((void));
|
extern void cg_print_function_ordering (void);
|
||||||
|
|
||||||
#endif /* cg_print_h */
|
#endif /* cg_print_h */
|
||||||
|
@ -39,21 +39,20 @@ int offset_to_code;
|
|||||||
struct function_map *symbol_map;
|
struct function_map *symbol_map;
|
||||||
unsigned int symbol_map_count;
|
unsigned int symbol_map_count;
|
||||||
|
|
||||||
static void read_function_mappings PARAMS ((const char *));
|
static void read_function_mappings (const char *);
|
||||||
static int core_sym_class PARAMS ((asymbol *));
|
static int core_sym_class (asymbol *);
|
||||||
static bfd_boolean get_src_info
|
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 i386_find_call (Sym *, bfd_vma, bfd_vma);
|
||||||
extern void alpha_find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
|
extern void alpha_find_call (Sym *, bfd_vma, bfd_vma);
|
||||||
extern void vax_find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
|
extern void vax_find_call (Sym *, bfd_vma, bfd_vma);
|
||||||
extern void tahoe_find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
|
extern void tahoe_find_call (Sym *, bfd_vma, bfd_vma);
|
||||||
extern void sparc_find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
|
extern void sparc_find_call (Sym *, bfd_vma, bfd_vma);
|
||||||
extern void mips_find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
|
extern void mips_find_call (Sym *, bfd_vma, bfd_vma);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
read_function_mappings (filename)
|
read_function_mappings (const char *filename)
|
||||||
const char *filename;
|
|
||||||
{
|
{
|
||||||
FILE *file = fopen (filename, "r");
|
FILE *file = fopen (filename, "r");
|
||||||
char dummy[1024];
|
char dummy[1024];
|
||||||
@ -139,8 +138,7 @@ read_function_mappings (filename)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
core_init (aout_name)
|
core_init (const char *aout_name)
|
||||||
const char *aout_name;
|
|
||||||
{
|
{
|
||||||
int core_sym_bytes;
|
int core_sym_bytes;
|
||||||
core_bfd = bfd_openr (aout_name, 0);
|
core_bfd = bfd_openr (aout_name, 0);
|
||||||
@ -216,8 +214,7 @@ core_init (aout_name)
|
|||||||
/* Read in the text space of an a.out file. */
|
/* Read in the text space of an a.out file. */
|
||||||
|
|
||||||
void
|
void
|
||||||
core_get_text_space (cbfd)
|
core_get_text_space (bfd *cbfd)
|
||||||
bfd *cbfd;
|
|
||||||
{
|
{
|
||||||
core_text_space = (PTR) malloc ((unsigned int) core_text_sect->_raw_size);
|
core_text_space = (PTR) malloc ((unsigned int) core_text_sect->_raw_size);
|
||||||
|
|
||||||
@ -242,10 +239,7 @@ core_get_text_space (cbfd)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
find_call (parent, p_lowpc, p_highpc)
|
find_call (Sym *parent, bfd_vma p_lowpc, bfd_vma p_highpc)
|
||||||
Sym *parent;
|
|
||||||
bfd_vma p_lowpc;
|
|
||||||
bfd_vma p_highpc;
|
|
||||||
{
|
{
|
||||||
switch (bfd_get_arch (core_bfd))
|
switch (bfd_get_arch (core_bfd))
|
||||||
{
|
{
|
||||||
@ -288,8 +282,7 @@ find_call (parent, p_lowpc, p_highpc)
|
|||||||
't' -> symbol is a local (static) name. */
|
't' -> symbol is a local (static) name. */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
core_sym_class (sym)
|
core_sym_class (asymbol *sym)
|
||||||
asymbol *sym;
|
|
||||||
{
|
{
|
||||||
symbol_info syminfo;
|
symbol_info syminfo;
|
||||||
const char *name;
|
const char *name;
|
||||||
@ -372,11 +365,7 @@ core_sym_class (sym)
|
|||||||
/* Get whatever source info we can get regarding address ADDR. */
|
/* Get whatever source info we can get regarding address ADDR. */
|
||||||
|
|
||||||
static bfd_boolean
|
static bfd_boolean
|
||||||
get_src_info (addr, filename, name, line_num)
|
get_src_info (bfd_vma addr, const char **filename, const char **name, int *line_num)
|
||||||
bfd_vma addr;
|
|
||||||
const char **filename;
|
|
||||||
const char **name;
|
|
||||||
int *line_num;
|
|
||||||
{
|
{
|
||||||
const char *fname = 0, *func_name = 0;
|
const char *fname = 0, *func_name = 0;
|
||||||
int l = 0;
|
int l = 0;
|
||||||
|
@ -39,9 +39,9 @@ extern int min_insn_size; /* Size of smallest instruction, in bytes. */
|
|||||||
extern int offset_to_code; /* Offset (in bytes) of code from entry
|
extern int offset_to_code; /* Offset (in bytes) of code from entry
|
||||||
address of routine. */
|
address of routine. */
|
||||||
|
|
||||||
extern void core_init PARAMS ((const char *));
|
extern void core_init (const char *);
|
||||||
extern void core_get_text_space PARAMS ((bfd *));
|
extern void core_get_text_space (bfd *);
|
||||||
extern void core_create_function_syms PARAMS ((void));
|
extern void core_create_function_syms (void);
|
||||||
extern void core_create_line_syms PARAMS ((void));
|
extern void core_create_line_syms (void);
|
||||||
|
|
||||||
#endif /* corefile_h */
|
#endif /* corefile_h */
|
||||||
|
@ -13,7 +13,7 @@ NR == 1 {
|
|||||||
print "}"
|
print "}"
|
||||||
curfun = FUNCTION
|
curfun = FUNCTION
|
||||||
print ""
|
print ""
|
||||||
print "void ", FUNCTION, "PARAMS ((FILE *));"
|
print "void ", FUNCTION, "(FILE *);"
|
||||||
print "void";
|
print "void";
|
||||||
printf "%s (file)\n", FUNCTION
|
printf "%s (file)\n", FUNCTION
|
||||||
print " FILE *file;";
|
print " FILE *file;";
|
||||||
|
@ -44,17 +44,17 @@ enum gmon_ptr_signedness {
|
|||||||
ptr_unsigned
|
ptr_unsigned
|
||||||
};
|
};
|
||||||
|
|
||||||
static enum gmon_ptr_size gmon_get_ptr_size PARAMS ((void));
|
static enum gmon_ptr_size gmon_get_ptr_size (void);
|
||||||
static enum gmon_ptr_signedness gmon_get_ptr_signedness PARAMS ((void));
|
static enum gmon_ptr_signedness gmon_get_ptr_signedness (void);
|
||||||
|
|
||||||
#ifdef BFD_HOST_U_64_BIT
|
#ifdef BFD_HOST_U_64_BIT
|
||||||
static int gmon_io_read_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 PARAMS ((FILE *, BFD_HOST_U_64_BIT));
|
static int gmon_io_write_64 (FILE *, BFD_HOST_U_64_BIT);
|
||||||
#endif
|
#endif
|
||||||
static int gmon_read_raw_arc
|
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
|
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_input = 0;
|
||||||
int gmon_file_version = 0; /* 0 == old (non-versioned) file format. */
|
int gmon_file_version = 0; /* 0 == old (non-versioned) file format. */
|
||||||
@ -98,9 +98,7 @@ gmon_get_ptr_signedness ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
gmon_io_read_32 (ifp, valp)
|
gmon_io_read_32 (FILE *ifp, unsigned int *valp)
|
||||||
FILE *ifp;
|
|
||||||
unsigned int *valp;
|
|
||||||
{
|
{
|
||||||
char buf[4];
|
char buf[4];
|
||||||
|
|
||||||
@ -112,9 +110,7 @@ gmon_io_read_32 (ifp, valp)
|
|||||||
|
|
||||||
#ifdef BFD_HOST_U_64_BIT
|
#ifdef BFD_HOST_U_64_BIT
|
||||||
static int
|
static int
|
||||||
gmon_io_read_64 (ifp, valp)
|
gmon_io_read_64 (FILE *ifp, BFD_HOST_U_64_BIT *valp)
|
||||||
FILE *ifp;
|
|
||||||
BFD_HOST_U_64_BIT *valp;
|
|
||||||
{
|
{
|
||||||
char buf[8];
|
char buf[8];
|
||||||
|
|
||||||
@ -126,9 +122,7 @@ gmon_io_read_64 (ifp, valp)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
int
|
int
|
||||||
gmon_io_read_vma (ifp, valp)
|
gmon_io_read_vma (FILE *ifp, bfd_vma *valp)
|
||||||
FILE *ifp;
|
|
||||||
bfd_vma *valp;
|
|
||||||
{
|
{
|
||||||
unsigned int val32;
|
unsigned int val32;
|
||||||
#ifdef BFD_HOST_U_64_BIT
|
#ifdef BFD_HOST_U_64_BIT
|
||||||
@ -163,10 +157,7 @@ gmon_io_read_vma (ifp, valp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
gmon_io_read (ifp, buf, n)
|
gmon_io_read (FILE *ifp, char *buf, size_t n)
|
||||||
FILE *ifp;
|
|
||||||
char *buf;
|
|
||||||
size_t n;
|
|
||||||
{
|
{
|
||||||
if (fread (buf, 1, n, ifp) != n)
|
if (fread (buf, 1, n, ifp) != n)
|
||||||
return 1;
|
return 1;
|
||||||
@ -174,9 +165,7 @@ gmon_io_read (ifp, buf, n)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
gmon_io_write_32 (ofp, val)
|
gmon_io_write_32 (FILE *ofp, unsigned int val)
|
||||||
FILE *ofp;
|
|
||||||
unsigned int val;
|
|
||||||
{
|
{
|
||||||
char buf[4];
|
char buf[4];
|
||||||
|
|
||||||
@ -188,9 +177,7 @@ gmon_io_write_32 (ofp, val)
|
|||||||
|
|
||||||
#ifdef BFD_HOST_U_64_BIT
|
#ifdef BFD_HOST_U_64_BIT
|
||||||
static int
|
static int
|
||||||
gmon_io_write_64 (ofp, val)
|
gmon_io_write_64 (FILE *ofp, BFD_HOST_U_64_BIT val)
|
||||||
FILE *ofp;
|
|
||||||
BFD_HOST_U_64_BIT val;
|
|
||||||
{
|
{
|
||||||
char buf[8];
|
char buf[8];
|
||||||
|
|
||||||
@ -202,9 +189,7 @@ gmon_io_write_64 (ofp, val)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
int
|
int
|
||||||
gmon_io_write_vma (ofp, val)
|
gmon_io_write_vma (FILE *ofp, bfd_vma val)
|
||||||
FILE *ofp;
|
|
||||||
bfd_vma val;
|
|
||||||
{
|
{
|
||||||
|
|
||||||
switch (gmon_get_ptr_size ())
|
switch (gmon_get_ptr_size ())
|
||||||
@ -225,9 +210,7 @@ gmon_io_write_vma (ofp, val)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
gmon_io_write_8 (ofp, val)
|
gmon_io_write_8 (FILE *ofp, unsigned int val)
|
||||||
FILE *ofp;
|
|
||||||
unsigned int val;
|
|
||||||
{
|
{
|
||||||
char buf[1];
|
char buf[1];
|
||||||
|
|
||||||
@ -238,10 +221,7 @@ gmon_io_write_8 (ofp, val)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
gmon_io_write (ofp, buf, n)
|
gmon_io_write (FILE *ofp, char *buf, size_t n)
|
||||||
FILE *ofp;
|
|
||||||
char *buf;
|
|
||||||
size_t n;
|
|
||||||
{
|
{
|
||||||
if (fwrite (buf, 1, n, ofp) != n)
|
if (fwrite (buf, 1, n, ofp) != n)
|
||||||
return 1;
|
return 1;
|
||||||
@ -249,11 +229,7 @@ gmon_io_write (ofp, buf, n)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
gmon_read_raw_arc (ifp, fpc, spc, cnt)
|
gmon_read_raw_arc (FILE *ifp, bfd_vma *fpc, bfd_vma *spc, unsigned long *cnt)
|
||||||
FILE *ifp;
|
|
||||||
bfd_vma *fpc;
|
|
||||||
bfd_vma *spc;
|
|
||||||
unsigned long *cnt;
|
|
||||||
{
|
{
|
||||||
#ifdef BFD_HOST_U_64_BIT
|
#ifdef BFD_HOST_U_64_BIT
|
||||||
BFD_HOST_U_64_BIT cnt64;
|
BFD_HOST_U_64_BIT cnt64;
|
||||||
@ -284,11 +260,7 @@ gmon_read_raw_arc (ifp, fpc, spc, cnt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
gmon_write_raw_arc (ofp, fpc, spc, cnt)
|
gmon_write_raw_arc (FILE *ofp, bfd_vma fpc, bfd_vma spc, unsigned long cnt)
|
||||||
FILE *ofp;
|
|
||||||
bfd_vma fpc;
|
|
||||||
bfd_vma spc;
|
|
||||||
unsigned long cnt;
|
|
||||||
{
|
{
|
||||||
|
|
||||||
if (gmon_io_write_vma (ofp, fpc)
|
if (gmon_io_write_vma (ofp, fpc)
|
||||||
@ -313,8 +285,7 @@ gmon_write_raw_arc (ofp, fpc, spc, cnt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gmon_out_read (filename)
|
gmon_out_read (const char *filename)
|
||||||
const char *filename;
|
|
||||||
{
|
{
|
||||||
FILE *ifp;
|
FILE *ifp;
|
||||||
struct gmon_hdr ghdr;
|
struct gmon_hdr ghdr;
|
||||||
@ -619,8 +590,7 @@ gmon_out_read (filename)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
gmon_out_write (filename)
|
gmon_out_write (const char *filename)
|
||||||
const char *filename;
|
|
||||||
{
|
{
|
||||||
FILE *ofp;
|
FILE *ofp;
|
||||||
struct gmon_hdr ghdr;
|
struct gmon_hdr ghdr;
|
||||||
|
@ -46,15 +46,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||||||
extern int gmon_input; /* What input did we see? */
|
extern int gmon_input; /* What input did we see? */
|
||||||
extern int gmon_file_version; /* File version are we dealing with. */
|
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_vma (FILE *ifp, bfd_vma *valp);
|
||||||
extern int gmon_io_read_32 PARAMS ((FILE *ifp, unsigned int *valp));
|
extern int gmon_io_read_32 (FILE *ifp, unsigned int *valp);
|
||||||
extern int gmon_io_read PARAMS ((FILE *ifp, char *buf, size_t n));
|
extern int gmon_io_read (FILE *ifp, char *buf, size_t n);
|
||||||
extern int gmon_io_write_vma PARAMS ((FILE *ifp, bfd_vma val));
|
extern int gmon_io_write_vma (FILE *ifp, bfd_vma val);
|
||||||
extern int gmon_io_write_32 PARAMS ((FILE *ifp, unsigned int val));
|
extern int gmon_io_write_32 (FILE *ifp, unsigned int val);
|
||||||
extern int gmon_io_write_8 PARAMS ((FILE *ifp, unsigned int val));
|
extern int gmon_io_write_8 (FILE *ifp, unsigned int val);
|
||||||
extern int gmon_io_write PARAMS ((FILE *ifp, char *buf, size_t n));
|
extern int gmon_io_write (FILE *ifp, char *buf, size_t n);
|
||||||
|
|
||||||
extern void gmon_out_read PARAMS ((const char *));
|
extern void gmon_out_read (const char *);
|
||||||
extern void gmon_out_write PARAMS ((const char *));
|
extern void gmon_out_write (const char *);
|
||||||
|
|
||||||
#endif /* gmon_io_h */
|
#endif /* gmon_io_h */
|
||||||
|
@ -44,8 +44,8 @@
|
|||||||
#include "demangle.h"
|
#include "demangle.h"
|
||||||
#include "getopt.h"
|
#include "getopt.h"
|
||||||
|
|
||||||
static void usage PARAMS ((FILE *, int)) ATTRIBUTE_NORETURN;
|
static void usage (FILE *, int) ATTRIBUTE_NORETURN;
|
||||||
int main PARAMS ((int, char **));
|
int main (int, char **);
|
||||||
|
|
||||||
const char *whoami;
|
const char *whoami;
|
||||||
const char *function_mapping_file;
|
const char *function_mapping_file;
|
||||||
@ -156,9 +156,7 @@ static struct option long_options[] =
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
usage (stream, status)
|
usage (FILE *stream, int status)
|
||||||
FILE *stream;
|
|
||||||
int status;
|
|
||||||
{
|
{
|
||||||
fprintf (stream, _("\
|
fprintf (stream, _("\
|
||||||
Usage: %s [-[abcDhilLsTvwxyz]] [-[ACeEfFJnNOpPqQZ][name]] [-I dirs]\n\
|
Usage: %s [-[abcDhilLsTvwxyz]] [-[ACeEfFJnNOpPqQZ][name]] [-I dirs]\n\
|
||||||
@ -182,9 +180,7 @@ Usage: %s [-[abcDhilLsTvwxyz]] [-[ACeEfFJnNOpPqQZ][name]] [-I dirs]\n\
|
|||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
main (argc, argv)
|
main (int argc, char **argv)
|
||||||
int argc;
|
|
||||||
char **argv;
|
|
||||||
{
|
{
|
||||||
char **sp, *str;
|
char **sp, *str;
|
||||||
Sym **cg = 0;
|
Sym **cg = 0;
|
||||||
@ -650,8 +646,7 @@ This program is free software. This program has absolutely no warranty.\n"));
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
done (status)
|
done (int status)
|
||||||
int status;
|
|
||||||
{
|
{
|
||||||
exit (status);
|
exit (status);
|
||||||
}
|
}
|
||||||
|
@ -134,6 +134,6 @@ extern File_Format file_format; /* requested file format */
|
|||||||
|
|
||||||
extern bfd_boolean first_output; /* no output so far? */
|
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 */
|
#endif /* gprof_h */
|
||||||
|
@ -8,6 +8,6 @@
|
|||||||
* we return HZ_WRONG, an impossible sampling frequency.
|
* we return HZ_WRONG, an impossible sampling frequency.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern int hertz PARAMS ((void));
|
extern int hertz (void);
|
||||||
|
|
||||||
#endif /* hertz_h */
|
#endif /* hertz_h */
|
||||||
|
29
gprof/hist.c
29
gprof/hist.c
@ -33,13 +33,13 @@
|
|||||||
|
|
||||||
#define UNITS_TO_CODE (offset_to_code / sizeof(UNIT))
|
#define UNITS_TO_CODE (offset_to_code / sizeof(UNIT))
|
||||||
|
|
||||||
static void scale_and_align_entries PARAMS ((void));
|
static void scale_and_align_entries (void);
|
||||||
static void print_header PARAMS ((int));
|
static void print_header (int);
|
||||||
static void print_line PARAMS ((Sym *, double));
|
static void print_line (Sym *, double);
|
||||||
static int cmp_time PARAMS ((const PTR, const PTR));
|
static int cmp_time (const PTR, const PTR);
|
||||||
|
|
||||||
/* Declarations of automatically generated functions to output blurbs. */
|
/* 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_lowpc; /* Lowest address in .text. */
|
||||||
bfd_vma s_highpc = 0; /* Highest address in .text. */
|
bfd_vma s_highpc = 0; /* Highest address in .text. */
|
||||||
@ -80,9 +80,7 @@ SItab[] =
|
|||||||
is provided for formatting error messages only. */
|
is provided for formatting error messages only. */
|
||||||
|
|
||||||
void
|
void
|
||||||
hist_read_rec (ifp, filename)
|
hist_read_rec (FILE * ifp, const char *filename)
|
||||||
FILE * ifp;
|
|
||||||
const char *filename;
|
|
||||||
{
|
{
|
||||||
bfd_vma n_lowpc, n_highpc;
|
bfd_vma n_lowpc, n_highpc;
|
||||||
int i, ncnt, profrate;
|
int i, ncnt, profrate;
|
||||||
@ -157,9 +155,7 @@ hist_read_rec (ifp, filename)
|
|||||||
of OFP and is provided for formatting error-messages only. */
|
of OFP and is provided for formatting error-messages only. */
|
||||||
|
|
||||||
void
|
void
|
||||||
hist_write_hist (ofp, filename)
|
hist_write_hist (FILE * ofp, const char *filename)
|
||||||
FILE * ofp;
|
|
||||||
const char *filename;
|
|
||||||
{
|
{
|
||||||
UNIT count;
|
UNIT count;
|
||||||
int i;
|
int i;
|
||||||
@ -351,8 +347,7 @@ hist_assign_samples ()
|
|||||||
/* Print header for flag histogram profile. */
|
/* Print header for flag histogram profile. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
print_header (prefix)
|
print_header (int prefix)
|
||||||
int prefix;
|
|
||||||
{
|
{
|
||||||
char unit[64];
|
char unit[64];
|
||||||
|
|
||||||
@ -391,9 +386,7 @@ print_header (prefix)
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
print_line (sym, scale)
|
print_line (Sym *sym, double scale)
|
||||||
Sym *sym;
|
|
||||||
double scale;
|
|
||||||
{
|
{
|
||||||
if (ignore_zeros && sym->ncalls == 0 && sym->hist.time == 0)
|
if (ignore_zeros && sym->ncalls == 0 && sym->hist.time == 0)
|
||||||
return;
|
return;
|
||||||
@ -430,9 +423,7 @@ print_line (sym, scale)
|
|||||||
lexicographic order of the function names. */
|
lexicographic order of the function names. */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
cmp_time (lp, rp)
|
cmp_time (const PTR lp, const PTR rp)
|
||||||
const PTR lp;
|
|
||||||
const PTR rp;
|
|
||||||
{
|
{
|
||||||
const Sym *left = *(const Sym **) lp;
|
const Sym *left = *(const Sym **) lp;
|
||||||
const Sym *right = *(const Sym **) rp;
|
const Sym *right = *(const Sym **) rp;
|
||||||
|
@ -32,9 +32,9 @@ extern int *hist_sample; /* Code histogram. */
|
|||||||
extern double hist_scale;
|
extern double hist_scale;
|
||||||
|
|
||||||
|
|
||||||
extern void hist_read_rec PARAMS ((FILE *, const char *));
|
extern void hist_read_rec (FILE *, const char *);
|
||||||
extern void hist_write_hist PARAMS ((FILE *, const char *));
|
extern void hist_write_hist (FILE *, const char *);
|
||||||
extern void hist_assign_samples PARAMS ((void));
|
extern void hist_assign_samples (void);
|
||||||
extern void hist_print PARAMS ((void));
|
extern void hist_print (void);
|
||||||
|
|
||||||
#endif /* hist_h */
|
#endif /* hist_h */
|
||||||
|
12
gprof/i386.c
12
gprof/i386.c
@ -34,12 +34,11 @@
|
|||||||
#include "corefile.h"
|
#include "corefile.h"
|
||||||
#include "hist.h"
|
#include "hist.h"
|
||||||
|
|
||||||
static int i386_iscall PARAMS ((unsigned char *));
|
static int i386_iscall (unsigned char *);
|
||||||
void i386_find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
|
void i386_find_call (Sym *, bfd_vma, bfd_vma);
|
||||||
|
|
||||||
static int
|
static int
|
||||||
i386_iscall (ip)
|
i386_iscall (unsigned char *ip)
|
||||||
unsigned char *ip;
|
|
||||||
{
|
{
|
||||||
if (*ip == 0xe8)
|
if (*ip == 0xe8)
|
||||||
return 1;
|
return 1;
|
||||||
@ -48,10 +47,7 @@ i386_iscall (ip)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
i386_find_call (parent, p_lowpc, p_highpc)
|
i386_find_call (Sym *parent, bfd_vma p_lowpc, bfd_vma p_highpc)
|
||||||
Sym *parent;
|
|
||||||
bfd_vma p_lowpc;
|
|
||||||
bfd_vma p_highpc;
|
|
||||||
{
|
{
|
||||||
unsigned char *instructp;
|
unsigned char *instructp;
|
||||||
Sym *child;
|
Sym *child;
|
||||||
|
@ -36,13 +36,10 @@
|
|||||||
|
|
||||||
static Sym indirect_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
|
void
|
||||||
mips_find_call (parent, p_lowpc, p_highpc)
|
mips_find_call (Sym *parent, bfd_vma p_lowpc, bfd_vma p_highpc)
|
||||||
Sym *parent;
|
|
||||||
bfd_vma p_lowpc;
|
|
||||||
bfd_vma p_highpc;
|
|
||||||
{
|
{
|
||||||
bfd_vma pc, dest_pc;
|
bfd_vma pc, dest_pc;
|
||||||
unsigned int op;
|
unsigned int op;
|
||||||
|
@ -25,9 +25,7 @@
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
search_list_append (list, paths)
|
search_list_append (Search_List *list, const char *paths)
|
||||||
Search_List *list;
|
|
||||||
const char *paths;
|
|
||||||
{
|
{
|
||||||
Search_List_Elem *new_el;
|
Search_List_Elem *new_el;
|
||||||
const char *beg, *colon;
|
const char *beg, *colon;
|
||||||
|
@ -43,6 +43,6 @@ typedef struct
|
|||||||
}
|
}
|
||||||
Search_List;
|
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 */
|
#endif /* search_list_h */
|
||||||
|
@ -35,8 +35,7 @@ Source_File *first_src_file = 0;
|
|||||||
|
|
||||||
|
|
||||||
Source_File *
|
Source_File *
|
||||||
source_file_lookup_path (path)
|
source_file_lookup_path (const char *path)
|
||||||
const char *path;
|
|
||||||
{
|
{
|
||||||
Source_File *sf;
|
Source_File *sf;
|
||||||
|
|
||||||
@ -63,8 +62,7 @@ source_file_lookup_path (path)
|
|||||||
|
|
||||||
|
|
||||||
Source_File *
|
Source_File *
|
||||||
source_file_lookup_name (filename)
|
source_file_lookup_name (const char *filename)
|
||||||
const char *filename;
|
|
||||||
{
|
{
|
||||||
const char *fname;
|
const char *fname;
|
||||||
Source_File *sf;
|
Source_File *sf;
|
||||||
@ -91,11 +89,9 @@ source_file_lookup_name (filename)
|
|||||||
|
|
||||||
|
|
||||||
FILE *
|
FILE *
|
||||||
annotate_source (sf, max_width, annote, arg)
|
annotate_source (Source_File *sf, unsigned int max_width,
|
||||||
Source_File *sf;
|
void (*annote) (char *, unsigned int, int, void *),
|
||||||
unsigned int max_width;
|
void *arg)
|
||||||
void (*annote) PARAMS ((char *, unsigned int, int, void *));
|
|
||||||
void *arg;
|
|
||||||
{
|
{
|
||||||
static bfd_boolean first_file = TRUE;
|
static bfd_boolean first_file = TRUE;
|
||||||
int i, line_num, nread;
|
int i, line_num, nread;
|
||||||
|
@ -44,8 +44,8 @@ extern Search_List src_search_list;
|
|||||||
extern Source_File *first_src_file;
|
extern Source_File *first_src_file;
|
||||||
|
|
||||||
/* Returns pointer to source file descriptor for PATH/FILENAME. */
|
/* 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_path (const char *);
|
||||||
extern Source_File *source_file_lookup_name PARAMS ((const char *));
|
extern Source_File *source_file_lookup_name (const char *);
|
||||||
|
|
||||||
/* Read source file SF output annotated source. The annotation is at
|
/* Read source file SF output annotated source. The annotation is at
|
||||||
MAX_WIDTH characters wide and for each source-line an annotation is
|
MAX_WIDTH characters wide and for each source-line an annotation is
|
||||||
@ -56,7 +56,7 @@ extern Source_File *source_file_lookup_name PARAMS ((const char *));
|
|||||||
that summary statistics can be printed. If the returned file
|
that summary statistics can be printed. If the returned file
|
||||||
is not stdout, it should be closed when done with it. */
|
is not stdout, it should be closed when done with it. */
|
||||||
extern FILE *annotate_source
|
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),
|
void (*annote) (char *, unsigned int, int, PTR arg),
|
||||||
PTR arg));
|
PTR arg);
|
||||||
#endif /* source_h */
|
#endif /* source_h */
|
||||||
|
@ -39,13 +39,10 @@
|
|||||||
*/
|
*/
|
||||||
#define CALL (0xc0000000)
|
#define CALL (0xc0000000)
|
||||||
|
|
||||||
void sparc_find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
|
void sparc_find_call (Sym *, bfd_vma, bfd_vma);
|
||||||
|
|
||||||
void
|
void
|
||||||
sparc_find_call (parent, p_lowpc, p_highpc)
|
sparc_find_call (Sym *parent, bfd_vma p_lowpc, bfd_vma p_highpc)
|
||||||
Sym *parent;
|
|
||||||
bfd_vma p_lowpc;
|
|
||||||
bfd_vma p_highpc;
|
|
||||||
{
|
{
|
||||||
bfd_vma pc, dest_pc;
|
bfd_vma pc, dest_pc;
|
||||||
unsigned int insn;
|
unsigned int insn;
|
||||||
|
@ -47,13 +47,13 @@ struct sym_id
|
|||||||
*id_list;
|
*id_list;
|
||||||
|
|
||||||
static void parse_spec
|
static void parse_spec
|
||||||
PARAMS ((char *, Sym *));
|
(char *, Sym *);
|
||||||
static void parse_id
|
static void parse_id
|
||||||
PARAMS ((struct sym_id *));
|
(struct sym_id *);
|
||||||
static bfd_boolean match
|
static bfd_boolean match
|
||||||
PARAMS ((Sym *, Sym *));
|
(Sym *, Sym *);
|
||||||
static void extend_match
|
static void extend_match
|
||||||
PARAMS ((struct match *, Sym *, Sym_Table *, bfd_boolean));
|
(struct match *, Sym *, Sym_Table *, bfd_boolean);
|
||||||
|
|
||||||
|
|
||||||
Sym_Table syms[NUM_TABLES];
|
Sym_Table syms[NUM_TABLES];
|
||||||
@ -84,9 +84,7 @@ static Source_File non_existent_file =
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
sym_id_add (spec, which_table)
|
sym_id_add (const char *spec, Table_Id which_table)
|
||||||
const char *spec;
|
|
||||||
Table_Id which_table;
|
|
||||||
{
|
{
|
||||||
struct sym_id *id;
|
struct sym_id *id;
|
||||||
int len = strlen (spec);
|
int len = strlen (spec);
|
||||||
@ -114,9 +112,7 @@ sym_id_add (spec, which_table)
|
|||||||
FILENAME not containing a dot can be specified by FILENAME. */
|
FILENAME not containing a dot can be specified by FILENAME. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
parse_spec (spec, sym)
|
parse_spec (char *spec, Sym *sym)
|
||||||
char *spec;
|
|
||||||
Sym *sym;
|
|
||||||
{
|
{
|
||||||
char *colon;
|
char *colon;
|
||||||
|
|
||||||
@ -171,8 +167,7 @@ parse_spec (spec, sym)
|
|||||||
by parse_spec(). */
|
by parse_spec(). */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
parse_id (id)
|
parse_id (struct sym_id *id)
|
||||||
struct sym_id *id;
|
|
||||||
{
|
{
|
||||||
char *slash;
|
char *slash;
|
||||||
|
|
||||||
@ -221,9 +216,7 @@ parse_id (id)
|
|||||||
/* Return TRUE iff PATTERN matches SYM. */
|
/* Return TRUE iff PATTERN matches SYM. */
|
||||||
|
|
||||||
static bfd_boolean
|
static bfd_boolean
|
||||||
match (pattern, sym)
|
match (Sym *pattern, Sym *sym)
|
||||||
Sym *pattern;
|
|
||||||
Sym *sym;
|
|
||||||
{
|
{
|
||||||
return (pattern->file ? pattern->file == sym->file : TRUE)
|
return (pattern->file ? pattern->file == sym->file : TRUE)
|
||||||
&& (pattern->line_num ? pattern->line_num == sym->line_num : TRUE)
|
&& (pattern->line_num ? pattern->line_num == sym->line_num : TRUE)
|
||||||
@ -235,11 +228,7 @@ match (pattern, sym)
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
extend_match (m, sym, tab, second_pass)
|
extend_match (struct match *m, Sym *sym, Sym_Table *tab, bfd_boolean second_pass)
|
||||||
struct match *m;
|
|
||||||
Sym *sym;
|
|
||||||
Sym_Table *tab;
|
|
||||||
bfd_boolean second_pass;
|
|
||||||
{
|
{
|
||||||
if (m->prev_match != sym - 1)
|
if (m->prev_match != sym - 1)
|
||||||
{
|
{
|
||||||
@ -373,10 +362,7 @@ sym_id_parse ()
|
|||||||
very big (the user has to type them!), so a linear search is probably
|
very big (the user has to type them!), so a linear search is probably
|
||||||
tolerable. */
|
tolerable. */
|
||||||
bfd_boolean
|
bfd_boolean
|
||||||
sym_id_arc_is_present (sym_tab, from, to)
|
sym_id_arc_is_present (Sym_Table *sym_tab, Sym *from, Sym *to)
|
||||||
Sym_Table *sym_tab;
|
|
||||||
Sym *from;
|
|
||||||
Sym *to;
|
|
||||||
{
|
{
|
||||||
Sym *sym;
|
Sym *sym;
|
||||||
|
|
||||||
|
@ -35,8 +35,8 @@ Table_Id;
|
|||||||
|
|
||||||
extern Sym_Table syms[NUM_TABLES];
|
extern Sym_Table syms[NUM_TABLES];
|
||||||
|
|
||||||
extern void sym_id_add PARAMS ((const char *, Table_Id));
|
extern void sym_id_add (const char *, Table_Id);
|
||||||
extern void sym_id_parse PARAMS ((void));
|
extern void sym_id_parse (void);
|
||||||
extern bfd_boolean sym_id_arc_is_present PARAMS ((Sym_Table *, Sym *, Sym *));
|
extern bfd_boolean sym_id_arc_is_present (Sym_Table *, Sym *, Sym *);
|
||||||
|
|
||||||
#endif /* sym_ids_h */
|
#endif /* sym_ids_h */
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
#include "cg_arcs.h"
|
#include "cg_arcs.h"
|
||||||
#include "corefile.h"
|
#include "corefile.h"
|
||||||
|
|
||||||
static int cmp_addr PARAMS ((const PTR, const PTR));
|
static int cmp_addr (const PTR, const PTR);
|
||||||
|
|
||||||
Sym_Table symtab;
|
Sym_Table symtab;
|
||||||
|
|
||||||
@ -34,8 +34,7 @@ Sym_Table symtab;
|
|||||||
/* Initialize a symbol (so it's empty). */
|
/* Initialize a symbol (so it's empty). */
|
||||||
|
|
||||||
void
|
void
|
||||||
sym_init (sym)
|
sym_init (Sym *sym)
|
||||||
Sym *sym;
|
|
||||||
{
|
{
|
||||||
memset (sym, 0, sizeof (*sym));
|
memset (sym, 0, sizeof (*sym));
|
||||||
|
|
||||||
@ -59,9 +58,7 @@ sym_init (sym)
|
|||||||
the global symbol survives. */
|
the global symbol survives. */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
cmp_addr (lp, rp)
|
cmp_addr (const PTR lp, const PTR rp)
|
||||||
const PTR lp;
|
|
||||||
const PTR rp;
|
|
||||||
{
|
{
|
||||||
const Sym *left = (const Sym *) lp;
|
const Sym *left = (const Sym *) lp;
|
||||||
const Sym *right = (const Sym *) rp;
|
const Sym *right = (const Sym *) rp;
|
||||||
@ -79,8 +76,7 @@ cmp_addr (lp, rp)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
symtab_finalize (tab)
|
symtab_finalize (Sym_Table *tab)
|
||||||
Sym_Table *tab;
|
|
||||||
{
|
{
|
||||||
Sym *src, *dst;
|
Sym *src, *dst;
|
||||||
bfd_vma prev_addr;
|
bfd_vma prev_addr;
|
||||||
@ -177,9 +173,7 @@ symtab_finalize (tab)
|
|||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
|
||||||
Sym *
|
Sym *
|
||||||
dbg_sym_lookup (sym_tab, address)
|
dbg_sym_lookup (Sym_Table *sym_tab, bfd_vma address)
|
||||||
Sym_Table *sym_tab;
|
|
||||||
bfd_vma address;
|
|
||||||
{
|
{
|
||||||
long low, mid, high;
|
long low, mid, high;
|
||||||
Sym *sym;
|
Sym *sym;
|
||||||
@ -218,9 +212,7 @@ dbg_sym_lookup (sym_tab, address)
|
|||||||
/* Look up an address in the symbol-table that is sorted by address.
|
/* Look up an address in the symbol-table that is sorted by address.
|
||||||
If address does not hit any symbol, 0 is returned. */
|
If address does not hit any symbol, 0 is returned. */
|
||||||
Sym *
|
Sym *
|
||||||
sym_lookup (sym_tab, address)
|
sym_lookup (Sym_Table *sym_tab, bfd_vma address)
|
||||||
Sym_Table *sym_tab;
|
|
||||||
bfd_vma address;
|
|
||||||
{
|
{
|
||||||
long low, high;
|
long low, high;
|
||||||
long mid = -1;
|
long mid = -1;
|
||||||
|
@ -111,12 +111,12 @@ Sym_Table;
|
|||||||
|
|
||||||
extern Sym_Table symtab; /* The symbol table. */
|
extern Sym_Table symtab; /* The symbol table. */
|
||||||
|
|
||||||
extern void sym_init PARAMS ((Sym *));
|
extern void sym_init (Sym *);
|
||||||
extern void symtab_finalize PARAMS ((Sym_Table *));
|
extern void symtab_finalize (Sym_Table *);
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
extern Sym *dbg_sym_lookup PARAMS ((Sym_Table *, bfd_vma));
|
extern Sym *dbg_sym_lookup (Sym_Table *, bfd_vma);
|
||||||
#endif
|
#endif
|
||||||
extern Sym *sym_lookup PARAMS ((Sym_Table *, bfd_vma));
|
extern Sym *sym_lookup (Sym_Table *, bfd_vma);
|
||||||
extern void find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
|
extern void find_call (Sym *, bfd_vma, bfd_vma);
|
||||||
|
|
||||||
#endif /* symtab_h */
|
#endif /* symtab_h */
|
||||||
|
@ -58,15 +58,14 @@ typedef enum tahoe_opermodes tahoe_operandenum;
|
|||||||
*/
|
*/
|
||||||
static Sym indirectchild;
|
static Sym indirectchild;
|
||||||
|
|
||||||
static tahoe_operandenum tahoe_operandmode PARAMS ((unsigned char *));
|
static tahoe_operandenum tahoe_operandmode (unsigned char *);
|
||||||
static char *tahoe_operandname PARAMS ((tahoe_operandenum));
|
static char *tahoe_operandname (tahoe_operandenum);
|
||||||
static long tahoe_operandlength PARAMS ((unsigned char *));
|
static long tahoe_operandlength (unsigned char *);
|
||||||
static bfd_signed_vma tahoe_offset PARAMS ((unsigned char *));
|
static bfd_signed_vma tahoe_offset (unsigned char *);
|
||||||
void tahoe_find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
|
void tahoe_find_call (Sym *, bfd_vma, bfd_vma);
|
||||||
|
|
||||||
static tahoe_operandenum
|
static tahoe_operandenum
|
||||||
tahoe_operandmode (modep)
|
tahoe_operandmode (unsigned char *modep)
|
||||||
unsigned char *modep;
|
|
||||||
{
|
{
|
||||||
long usesreg = *modep & 0xf;
|
long usesreg = *modep & 0xf;
|
||||||
|
|
||||||
@ -107,8 +106,7 @@ tahoe_operandmode (modep)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
tahoe_operandname (mode)
|
tahoe_operandname (tahoe_operandenum mode)
|
||||||
tahoe_operandenum mode;
|
|
||||||
{
|
{
|
||||||
|
|
||||||
switch (mode)
|
switch (mode)
|
||||||
@ -161,8 +159,8 @@ tahoe_operandname (mode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static long
|
static long
|
||||||
tahoe_operandlength (modep)
|
tahoe_operandlength (unsigned char *modep
|
||||||
unsigned char *modep;
|
)
|
||||||
{
|
{
|
||||||
|
|
||||||
switch (tahoe_operandmode (modep))
|
switch (tahoe_operandmode (modep))
|
||||||
@ -199,8 +197,7 @@ tahoe_operandlength (modep)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bfd_signed_vma
|
static bfd_signed_vma
|
||||||
tahoe_offset (modep)
|
tahoe_offset (unsigned char *modep)
|
||||||
unsigned char *modep;
|
|
||||||
{
|
{
|
||||||
tahoe_operandenum mode = tahoe_operandmode (modep);
|
tahoe_operandenum mode = tahoe_operandmode (modep);
|
||||||
|
|
||||||
@ -220,10 +217,7 @@ tahoe_offset (modep)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
tahoe_find_call (parent, p_lowpc, p_highpc)
|
tahoe_find_call (Sym *parent, bfd_vma p_lowpc, bfd_vma p_highpc)
|
||||||
Sym *parent;
|
|
||||||
bfd_vma p_lowpc;
|
|
||||||
bfd_vma p_highpc;
|
|
||||||
{
|
{
|
||||||
unsigned char *instructp;
|
unsigned char *instructp;
|
||||||
long length;
|
long length;
|
||||||
|
@ -39,8 +39,7 @@
|
|||||||
* Print name of symbol. Return number of characters printed.
|
* Print name of symbol. Return number of characters printed.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
print_name_only (self)
|
print_name_only (Sym *self)
|
||||||
Sym *self;
|
|
||||||
{
|
{
|
||||||
const char *name = self->name;
|
const char *name = self->name;
|
||||||
const char *filename;
|
const char *filename;
|
||||||
@ -99,8 +98,7 @@ print_name_only (self)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
print_name (self)
|
print_name (Sym *self)
|
||||||
Sym *self;
|
|
||||||
{
|
{
|
||||||
print_name_only (self);
|
print_name_only (self);
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#ifndef utils_h
|
#ifndef utils_h
|
||||||
#define utils_h
|
#define utils_h
|
||||||
|
|
||||||
extern int print_name_only PARAMS ((Sym * self));
|
extern int print_name_only (Sym * self);
|
||||||
extern void print_name PARAMS ((Sym * self));
|
extern void print_name (Sym * self);
|
||||||
|
|
||||||
#endif /* utils_h */
|
#endif /* utils_h */
|
||||||
|
27
gprof/vax.c
27
gprof/vax.c
@ -68,15 +68,14 @@ struct modebyte
|
|||||||
*/
|
*/
|
||||||
static Sym indirectchild;
|
static Sym indirectchild;
|
||||||
|
|
||||||
static operandenum vax_operandmode PARAMS ((unsigned char *));
|
static operandenum vax_operandmode (unsigned char *);
|
||||||
static char *vax_operandname PARAMS ((operandenum));
|
static char *vax_operandname (operandenum);
|
||||||
static long vax_operandlength PARAMS ((unsigned char *));
|
static long vax_operandlength (unsigned char *);
|
||||||
static bfd_signed_vma vax_offset PARAMS ((unsigned char *));
|
static bfd_signed_vma vax_offset (unsigned char *);
|
||||||
void vax_find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
|
void vax_find_call (Sym *, bfd_vma, bfd_vma);
|
||||||
|
|
||||||
static operandenum
|
static operandenum
|
||||||
vax_operandmode (modep)
|
vax_operandmode (unsigned char *modep)
|
||||||
unsigned char *modep;
|
|
||||||
{
|
{
|
||||||
int usesreg = *modep & 0xf;
|
int usesreg = *modep & 0xf;
|
||||||
|
|
||||||
@ -117,8 +116,7 @@ vax_operandmode (modep)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
vax_operandname (mode)
|
vax_operandname (operandenum mode)
|
||||||
operandenum mode;
|
|
||||||
{
|
{
|
||||||
|
|
||||||
switch (mode)
|
switch (mode)
|
||||||
@ -171,8 +169,7 @@ vax_operandname (mode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static long
|
static long
|
||||||
vax_operandlength (modep)
|
vax_operandlength (unsigned char *modep)
|
||||||
unsigned char *modep;
|
|
||||||
{
|
{
|
||||||
|
|
||||||
switch (vax_operandmode (modep))
|
switch (vax_operandmode (modep))
|
||||||
@ -209,8 +206,7 @@ vax_operandlength (modep)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bfd_signed_vma
|
static bfd_signed_vma
|
||||||
vax_offset (modep)
|
vax_offset (unsigned char *modep)
|
||||||
unsigned char *modep;
|
|
||||||
{
|
{
|
||||||
operandenum mode = vax_operandmode (modep);
|
operandenum mode = vax_operandmode (modep);
|
||||||
|
|
||||||
@ -231,10 +227,7 @@ vax_offset (modep)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
vax_find_call (parent, p_lowpc, p_highpc)
|
vax_find_call (Sym *parent, bfd_vma p_lowpc, bfd_vma p_highpc)
|
||||||
Sym *parent;
|
|
||||||
bfd_vma p_lowpc;
|
|
||||||
bfd_vma p_highpc;
|
|
||||||
{
|
{
|
||||||
unsigned char *instructp;
|
unsigned char *instructp;
|
||||||
long length;
|
long length;
|
||||||
|
Reference in New Issue
Block a user