aboutsummaryrefslogtreecommitdiff
path: root/gprof/core.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1996-03-21 22:07:14 +0000
committerIan Lance Taylor <ian@airs.com>1996-03-21 22:07:14 +0000
commit0f579087abbd52ef11e1c0dc0236e0393ccfaba0 (patch)
tree4219135568b5e7b910d0e79702c9cad8924380e6 /gprof/core.c
parent9e4ebb1b3a69d506af5f46c3704458ff5bbfc999 (diff)
downloadgdb-0f579087abbd52ef11e1c0dc0236e0393ccfaba0.zip
gdb-0f579087abbd52ef11e1c0dc0236e0393ccfaba0.tar.gz
gdb-0f579087abbd52ef11e1c0dc0236e0393ccfaba0.tar.bz2
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.
Diffstat (limited to 'gprof/core.c')
-rw-r--r--gprof/core.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/gprof/core.c b/gprof/core.c
index d514178..b54c86e 100644
--- a/gprof/core.c
+++ b/gprof/core.c
@@ -3,6 +3,13 @@
#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;
@@ -199,15 +206,15 @@ DEFUN (core_sym_class, (sym), asymbol * sym)
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",
@@ -530,7 +537,7 @@ DEFUN (core_create_line_syms, (core_bfd), bfd * core_bfd)
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)