projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Implement proper "startup-with-shell" support on gdbserver
[deliverable/binutils-gdb.git]
/
gprof
/
gmon_io.c
diff --git
a/gprof/gmon_io.c
b/gprof/gmon_io.c
index bf74c263bd0ee6b1f1e251593a4e466346b79471..71ff604433b7d81b30fcaffbfcf3f70e8a28454a 100644
(file)
--- a/
gprof/gmon_io.c
+++ b/
gprof/gmon_io.c
@@
-1,7
+1,6
@@
/* gmon_io.c - Input and output from/to gmon.out files.
/* gmon_io.c - Input and output from/to gmon.out files.
- Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008
- Free Software Foundation, Inc.
+ Copyright (C) 1999-2017 Free Software Foundation, Inc.
This file is part of GNU Binutils.
This file is part of GNU Binutils.
@@
-62,7
+61,7
@@
int gmon_input = 0;
int gmon_file_version = 0; /* 0 == old (non-versioned) file format. */
static enum gmon_ptr_size
int gmon_file_version = 0; /* 0 == old (non-versioned) file format. */
static enum gmon_ptr_size
-gmon_get_ptr_size ()
+gmon_get_ptr_size (
void
)
{
int size;
{
int size;
@@
-88,7
+87,7
@@
gmon_get_ptr_size ()
}
static enum gmon_ptr_signedness
}
static enum gmon_ptr_signedness
-gmon_get_ptr_signedness ()
+gmon_get_ptr_signedness (
void
)
{
int sext;
{
int sext;
@@
-493,14
+492,14
@@
gmon_out_read (const char *filename)
if (!histograms)
{
num_histograms = 1;
if (!histograms)
{
num_histograms = 1;
- histograms = xmalloc (sizeof (struct histogram));
+ histograms =
(struct histogram *)
xmalloc (sizeof (struct histogram));
histograms->lowpc = tmp.low_pc;
histograms->highpc = tmp.high_pc;
histograms->num_bins = hist_num_bins;
hist_scale = (double)((tmp.high_pc - tmp.low_pc) / sizeof (UNIT))
/ hist_num_bins;
histograms->lowpc = tmp.low_pc;
histograms->highpc = tmp.high_pc;
histograms->num_bins = hist_num_bins;
hist_scale = (double)((tmp.high_pc - tmp.low_pc) / sizeof (UNIT))
/ hist_num_bins;
- histograms->sample = xmalloc (hist_num_bins * sizeof (int));
- memset (histograms->sample, 0,
+ histograms->sample =
(int *)
xmalloc (hist_num_bins * sizeof (int));
+ memset (histograms->sample, 0,
hist_num_bins * sizeof (int));
}
hist_num_bins * sizeof (int));
}
@@
-533,7
+532,7
@@
gmon_out_read (const char *filename)
done (1);
}
done (1);
}
- histograms->sample[i]
+ histograms->sample[i]
+= bfd_get_16 (core_bfd, (bfd_byte *) raw_bin_count);
}
+= bfd_get_16 (core_bfd, (bfd_byte *) raw_bin_count);
}
@@
-551,8
+550,6
@@
gmon_out_read (const char *filename)
cg_tally (from_pc, self_pc, count);
}
cg_tally (from_pc, self_pc, count);
}
- fclose (ifp);
-
if (hz == HZ_WRONG)
{
/* How many ticks per second? If we can't tell, report
if (hz == HZ_WRONG)
{
/* How many ticks per second? If we can't tell, report
@@
-573,6
+570,9
@@
gmon_out_read (const char *filename)
done (1);
}
done (1);
}
+ if (ifp != stdin)
+ fclose (ifp);
+
if (output_style & STYLE_GMON_INFO)
{
printf (_("File `%s' (version %d) contains:\n"),
if (output_style & STYLE_GMON_INFO)
{
printf (_("File `%s' (version %d) contains:\n"),
@@
-671,7
+671,7
@@
gmon_out_write (const char *filename)
case ptr_64bit:
hdrsize = GMON_HDRSIZE_OLDBSD_64;
/* FIXME: Checking host compiler defines here means that we can't
case ptr_64bit:
hdrsize = GMON_HDRSIZE_OLDBSD_64;
/* FIXME: Checking host compiler defines here means that we can't
- use a cross gprof alpha OSF. */
+ use a cross gprof alpha OSF. */
#if defined(__alpha__) && defined (__osf__)
padsize = 4;
#endif
#if defined(__alpha__) && defined (__osf__)
padsize = 4;
#endif
@@
-683,7
+683,7
@@
gmon_out_write (const char *filename)
old BSD and 4.4BSD formats. */
if (gmon_io_write_vma (ofp, histograms->lowpc)
|| gmon_io_write_vma (ofp, histograms->highpc)
old BSD and 4.4BSD formats. */
if (gmon_io_write_vma (ofp, histograms->lowpc)
|| gmon_io_write_vma (ofp, histograms->highpc)
- || gmon_io_write_32 (ofp, histograms->num_bins
+ || gmon_io_write_32 (ofp, histograms->num_bins
* sizeof (UNIT) + hdrsize))
{
perror (filename);
* sizeof (UNIT) + hdrsize))
{
perror (filename);
This page took
0.024433 seconds
and
4
git commands to generate.