#include "cg_arcs.h"
#include "basic_blocks.h"
#include "bfd.h"
-#include "core.h"
+#include "corefile.h"
#include "call_graph.h"
#include "gmon_io.h"
#include "gmon_out.h"
case 8:
return bfd_get_64 (abfd, addr);
default:
- fprintf (stderr, "%s: bfd_vma has unexpected size of %ld bytes\n",
+ fprintf (stderr, _("%s: bfd_vma has unexpected size of %ld bytes\n"),
whoami, (long) sizeof (char*));
done (1);
}
bfd_put_64 (abfd, val, addr);
break;
default:
- fprintf (stderr, "%s: bfd_vma has unexpected size of %ld bytes\n",
+ fprintf (stderr, _("%s: bfd_vma has unexpected size of %ld bytes\n"),
whoami, (long) sizeof (char*));
done (1);
}
}
if (fread (&ghdr, sizeof (struct gmon_hdr), 1, ifp) != 1)
{
- fprintf (stderr, "%s: file too short to be a gmon file\n",
+ fprintf (stderr, _("%s: file too short to be a gmon file\n"),
filename);
done (1);
}
{
if (file_format == FF_MAGIC && strncmp (&ghdr.cookie[0], GMON_MAGIC, 4))
{
- fprintf (stderr, "%s: file `%s' has bad magic cookie\n",
+ fprintf (stderr, _("%s: file `%s' has bad magic cookie\n"),
whoami, filename);
done (1);
}
if (gmon_file_version != GMON_VERSION && gmon_file_version != 0)
{
fprintf (stderr,
- "%s: file `%s' has unsupported version %d\n",
+ _("%s: file `%s' has unsupported version %d\n"),
whoami, filename, gmon_file_version);
done (1);
}
default:
fprintf (stderr,
- "%s: %s: found bad tag %d (file corrupted?)\n",
+ _("%s: %s: found bad tag %d (file corrupted?)\n"),
whoami, filename, tag);
done (1);
}
if (fread (&raw, 1, sizeof (struct raw_phdr), ifp)
!= sizeof (struct raw_phdr))
{
- fprintf (stderr, "%s: file too short to be a gmon file\n",
+ fprintf (stderr, _("%s: file too short to be a gmon file\n"),
filename);
done (1);
}
- tmp.low_pc = get_vma (core_bfd, (bfd_byte *) & raw.low_pc[0]);
- tmp.high_pc = get_vma (core_bfd, (bfd_byte *) & raw.high_pc[0]);
- tmp.ncnt = bfd_get_32 (core_bfd, (bfd_byte *) & raw.ncnt[0]);
+ tmp.low_pc = get_vma (core_bfd, (bfd_byte *) &raw.low_pc[0]);
+ tmp.high_pc = get_vma (core_bfd, (bfd_byte *) &raw.high_pc[0]);
+ tmp.ncnt = bfd_get_32 (core_bfd, (bfd_byte *) &raw.ncnt[0]);
+
+#ifdef BSD44_FORMAT
+ {
+ int profrate;
+
+ profrate = bfd_get_32 (core_bfd, (bfd_byte *) &raw.profrate[0]);
+ if (!s_highpc)
+ hz = profrate;
+ else if (hz != profrate)
+ {
+ fprintf (stderr,
+ _("%s: profiling rate incompatible with first gmon file\n"),
+ filename);
+ done (1);
+ }
+ }
+#endif
+
if (s_highpc && (tmp.low_pc != h.low_pc ||
tmp.high_pc != h.high_pc || tmp.ncnt != h.ncnt))
{
- fprintf (stderr, "%s: incompatible with first gmon file\n",
+ fprintf (stderr, _("%s: incompatible with first gmon file\n"),
filename);
done (1);
}
if (fread (raw_bin_count, sizeof (raw_bin_count), 1, ifp) != 1)
{
fprintf (stderr,
- "%s: unexpected EOF after reading %d/%d bins\n",
+ _("%s: unexpected EOF after reading %d/%d bins\n"),
whoami, --i, hist_num_bins);
done (1);
}
if (hz == HZ_WRONG)
{
hz = 1;
- fprintf (stderr, "time is in ticks, not seconds\n");
+ fprintf (stderr, _("time is in ticks, not seconds\n"));
}
}
}
else
{
- fprintf (stderr, "%s: don't know how to deal with file format %d\n",
+ fprintf (stderr, _("%s: don't know how to deal with file format %d\n"),
whoami, file_format);
done (1);
}
if (output_style & STYLE_GMON_INFO)
{
- printf ("File `%s' (version %d) contains:\n",
+ printf (_("File `%s' (version %d) contains:\n"),
filename, gmon_file_version);
- printf ("\t%d histogram record%s\n",
+ printf (_("\t%d histogram record%s\n"),
nhist, nhist == 1 ? "" : "s");
- printf ("\t%d call-graph record%s\n",
+ printf (_("\t%d call-graph record%s\n"),
narcs, narcs == 1 ? "" : "s");
- printf ("\t%d basic-block count record%s\n",
+ printf (_("\t%d basic-block count record%s\n"),
nbbs, nbbs == 1 ? "" : "s");
first_output = FALSE;
}
}
else
{
- fprintf (stderr, "%s: don't know how to deal with file format %d\n",
+ fprintf (stderr, _("%s: don't know how to deal with file format %d\n"),
whoami, file_format);
done (1);
}