diff options
author | Ian Lance Taylor <ian@airs.com> | 1998-08-12 19:06:24 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1998-08-12 19:06:24 +0000 |
commit | 8c73afb3537b7271772a31466ec614a4d0634436 (patch) | |
tree | 639323c1b8888bf5fe9abcccb505211b1d56383b /gprof/call_graph.c | |
parent | 15ec5eb33b983e2900205cffd919cca52f8e1394 (diff) | |
download | gdb-8c73afb3537b7271772a31466ec614a4d0634436.zip gdb-8c73afb3537b7271772a31466ec614a4d0634436.tar.gz gdb-8c73afb3537b7271772a31466ec614a4d0634436.tar.bz2 |
Avoid some overflow cases:
* basic_blocks.h (bb_min_calls): Change to unsigned long.
* call_graph.h (cg_tally): Change count parameter to unsigned
long.
* cg_arcs.h (Arc): Change count field to unsigned long.
(arc_add): Change count parameter to unsigned long.
* source.h (Source_File): Change ncalls field to unsigned long.
* symtab.h (Sym): Change fields ncalls, bb_calls, and
cg.self_calls to unsigned long.
* Many files: Update accordingly.
Diffstat (limited to 'gprof/call_graph.c')
-rw-r--r-- | gprof/call_graph.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gprof/call_graph.c b/gprof/call_graph.c index 693d337..8f12cbd 100644 --- a/gprof/call_graph.c +++ b/gprof/call_graph.c @@ -8,7 +8,7 @@ extern void DEFUN (cg_tally, (from_pc, self_pc, count), - bfd_vma from_pc AND bfd_vma self_pc AND int count) + bfd_vma from_pc AND bfd_vma self_pc AND unsigned long count) { Sym *parent; Sym *child; @@ -45,7 +45,7 @@ DEFUN (cg_tally, (from_pc, self_pc, count), { child->ncalls += count; DBG (TALLYDEBUG, - printf (_("[cg_tally] arc from %s to %s traversed %d times\n"), + printf (_("[cg_tally] arc from %s to %s traversed %lu times\n"), parent->name, child->name, count)); arc_add (parent, child, count); } @@ -63,7 +63,7 @@ DEFUN (cg_read_rec, (ifp, filename), FILE * ifp AND CONST char *filename) { bfd_vma from_pc, self_pc; struct gmon_cg_arc_record arc; - int count; + unsigned long count; if (fread (&arc, sizeof (arc), 1, ifp) != 1) { @@ -75,7 +75,7 @@ DEFUN (cg_read_rec, (ifp, filename), FILE * ifp AND CONST char *filename) self_pc = get_vma (core_bfd, (bfd_byte *) arc.self_pc); count = bfd_get_32 (core_bfd, (bfd_byte *) arc.count); DBG (SAMPLEDEBUG, - printf ("[cg_read_rec] frompc 0x%lx selfpc 0x%lx count %d\n", + printf ("[cg_read_rec] frompc 0x%lx selfpc 0x%lx count %lu\n", from_pc, self_pc, count)); /* add this arc: */ cg_tally (from_pc, self_pc, count); @@ -109,7 +109,7 @@ DEFUN (cg_write_arcs, (ofp, filename), FILE * ofp AND const char *filename) done (1); } DBG (SAMPLEDEBUG, - printf ("[cg_write_arcs] frompc 0x%lx selfpc 0x%lx count %d\n", + printf ("[cg_write_arcs] frompc 0x%lx selfpc 0x%lx count %lu\n", arc->parent->addr, arc->child->addr, arc->count)); } } |