* gprof.c (default_excluded_list): Add "__mcount".
* gprof.c (main): Change ifdef __osf__ to __alpha__.
* gmon_io.c (gmon_out_read): If BSD44_FORMAT is defined, get the
profiling rate from the header.
* gmon.h (struct raw_phdr): Only include pad if both __alpha__ and
__osf__ are defined. Add new fields if BSD44_FORMAT is defined.
* alpha.h (MIN_INSN_SIZE): Define.
* core.c (MIN_INSN_SIZE): If not defined, define as 1.
(core_sym_class): Ignore debugging symbols.
(core_create_line_syms): Use MIN_INSN_SIZE when gathering line
information.
+Thu Mar 21 17:02:02 1996 David Mosberger-Tang <davidm@azstarnet.com>
+
+ * gprof.c (default_excluded_list): Add "__mcount".
+
+ * gprof.c (main): Change ifdef __osf__ to __alpha__.
+
+ * gmon_io.c (gmon_out_read): If BSD44_FORMAT is defined, get the
+ profiling rate from the header.
+
+ * gmon.h (struct raw_phdr): Only include pad if both __alpha__ and
+ __osf__ are defined. Add new fields if BSD44_FORMAT is defined.
+
+ * alpha.h (MIN_INSN_SIZE): Define.
+ * core.c (MIN_INSN_SIZE): If not defined, define as 1.
+ (core_sym_class): Ignore debugging symbols.
+ (core_create_line_syms): Use MIN_INSN_SIZE when gathering line
+ information.
+
Wed Mar 20 18:15:47 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* cg_print.c (cg_print_function_ordering): Fix __GNUC__ misspelled
#define OFFSET_TO_CODE 0
#define UNITS_TO_CODE (OFFSET_TO_CODE / sizeof(UNIT))
+/*
+ * Minimum size of an instruction (in bytes):
+ */
+#define MIN_INSN_SIZE 4
+
#endif /* alpha_h */
#include "core.h"
#include "symtab.h"
+#ifndef MIN_INSN_SIZE
+/* If not defined in MACHINE_H, assume smallest instruction is 1 byte
+ long. THis is safe but may be needlessly slow on machines where
+ all instructions are longer. */
+#define MIN_INSN_SIZE 1
+#endif
+
bfd *core_bfd;
int core_num_syms;
asymbol **core_syms;
char sym_prefix;
int i;
- /*
- * Must be a text symbol, and static text symbols don't qualify if
- * ignore_static_funcs set.
- */
- if (!sym->section)
+ if (sym->section == NULL || (sym->flags & BSF_DEBUGGING) != 0)
{
return 0;
}
+ /*
+ * Must be a text symbol, and static text symbols don't qualify if
+ * ignore_static_funcs set.
+ */
if (ignore_static_funcs && (sym->flags & BSF_LOCAL))
{
DBG (AOUTDEBUG, printf ("[core_sym_class] %s: not a function\n",
prev_offset = -min_dist;
prev_filename[0] = '\0';
prev_line_num = 0;
- for (offset = 0; offset < core_text_sect->_raw_size; ++offset)
+ for (offset = 0; offset < core_text_sect->_raw_size; offset += MIN_INSN_SIZE)
{
vma = core_text_sect->vma + offset;
if (!get_src_info (vma, &filename, &dummy.name, &dummy.line_num)
char low_pc[sizeof (bfd_vma)]; /* base pc address of sample buffer */
char high_pc[sizeof (bfd_vma)]; /* max pc address of sampled buffer */
char ncnt[4]; /* size of sample buffer (plus this header) */
-#ifdef __osf__
+
+#if defined (__alpha__) && defined (__osf__)
/*
* DEC's OSF v3.0 uses 4 bytes of padding to bring the header to
* a size that is a multiple of 8.
*/
char pad[4];
+#elif defined (BSD44_FORMAT)
+ char version[4]; /* version number */
+ char profrate[4]; /* profiling clock rate */
+ char spare[3*4]; /* reserved */
#endif
};
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.version[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))
{
*/
static char *default_excluded_list[] =
{
- "_gprof_mcount", "mcount", "_mcount", "__mcleanup",
+ "_gprof_mcount", "mcount", "_mcount", "__mcount", "__mcleanup",
"<locore>", "<hicore>",
0
};
{
sym_id_add (*sp, EXCL_TIME);
sym_id_add (*sp, EXCL_GRAPH);
-#ifdef __osf__
+#ifdef __alpha__
sym_id_add (*sp, EXCL_FLAT);
#endif
}