acconfig.h
aclocal.m4
alpha.c
-alpha.h
basic_blocks.c
basic_blocks.h
bsd_callg_bl.m
configure.in
core.c
core.h
-dummy.c
-dummy.h
flat_bl.m
fsf_callg_bl.m
gconfig.in
hist.c
hist.h
i386.c
-i386.h
-ns532.c
-ns532.h
search_list.c
search_list.h
source.c
source.h
sparc.c
-sparc.h
stamp-h.in
sym_ids.c
sym_ids.h
symtab.c
symtab.h
tahoe.c
-tahoe.h
utils.c
utils.h
vax.c
-vax.h
Things-to-lose:
+Tue Feb 3 14:25:25 1998 Brent Baccala <baccala@freesoft.org>
+
+ Make it possible to build a cross gprof, although a few cases are
+ still not handled:
+ * configure.in: Don't set MY_TARGET.
+ * gprof.h: Don't include MACHINE_H. Don't define FOPEN_RB or
+ FOPEN_WB; just get them from sysdep.h.
+ * core.h (min_insn_size, offset_to_code): Declare.
+ * core.c (MIN_INSN_SIZE): Don't define.
+ (min_insn_size, offset_to_code): New variables.
+ (core_init): Initialize min_insn_size and offset_to_code.
+ (find_call): New function.
+ (core_create_line_syms): Don't use min_dist. Set is_static in
+ pass 2.
+ * hist.c (UNITS_TO_CODE): Define.
+ * gprof.c (default_excluded_list): Add "__mcount_internal".
+ * gmon.h: Change TARGET_alpha to __alpha__.
+ * hertz.h: Ifdef MACH, define hertz as HZ.
+ * alpha.c (alpha_Instruction): Rename from Instruction. Change
+ all references.
+ (alpha_find_call): Rename from find_call.
+ * alpha.h: Remove.
+ * dummy.c, dummy.h: Remove.
+ * i386.c (i386_iscall): Rename from iscall. Change all
+ references. Check for call instruction, not jump or lcall.
+ (i386_find_call): Rename from find_call. Correct for VMA.
+ Correct call destination computation. Don't dereference symbol if
+ it is NULL.
+ * i386.h: Remove.
+ * ns532.c, ns532.h: Remove.
+ * sparc.c (CALL): Define.
+ (sparc_find_call): Rename from find_call.
+ * sparc.h: Remove.
+ * tahoe.c: Include cg_arcs.h, core.h, hist.h, and symtab.h. Don't
+ include time_host.h.
+ (CALLF, PC): Define.
+ (enum tahoe_opermodes, tahoe_operandenum): Define. Rename all
+ references to opermodes or operandenum to these.
+ (tahoe_operandmode): Rename from operandmode. Call abort if
+ switch does not return.
+ (tahoe_operandname): Rename from operandname. Call abort if
+ switch does not return.
+ (tahoe_operandlength): Rename from operandlength. Call abort if
+ switch does not return.
+ (tahoe_reladdr): Rename from reladdr.
+ (tahoe_find_call): Rename from find_call. Use core_text_space
+ rather than textspace.
+ * tahoe.h: Remove.
+ * vax.c (CALLS, PC): Define.
+ (enum opermodes, operandenum, struct modebyte): Define.
+ (vax_operandmode): Rename from operandmode. Call abort if switch
+ does not return.
+ (vax_operandname): Rename from operandname. Call abort if switch
+ does not return.
+ (vax_operandlength): Rename from operandlength. Call abort if
+ switch does not return.
+ (vax_reladdr): Rename from reladdr.
+ (vax_find_call): Rename from find_call.
+ * vax.h: Remove.
+ * Makefile.am (AUTOMAKE_OPTIONS): Set to cygnus.
+ (MY_TARGET): Remove.
+ (INCLUDES): Remove -DTARGET_$(MY_TARGET) and -DMACHINE_H=
+ \"$(MY_TARGET).h\".
+ (gprof_SOURCES): Add i386.c, alpha.c, vax.c, tahoe.c, sparc.c.
+ (gprof_DEPENDENCIES): Remove $(MY_TARGET).o.
+ (gprof_LDADD): Likewise.
+ (noinst_HEADERS): Remove alpha.h, i386.h, ns532.h, sparc.h,
+ tahoe.h, vax.h, dummy.h.
+ (EXTRA_DIST): Remove alpha.c, i386.c, ns532.c, sparc.c, tahoe.c,
+ vax.c, dummy.c.
+ ($(OBJECTS)): Don't depend upon $(MY_TARGET).h.
+ ($(MY_TARGET).o): Remove target.
+ (i386.o, alpha.o, vax.o, tahoe.o, sparc.o): New targets.
+ * configure, Makefile.in, aclocal.m4: Rebuild.
+
Mon Dec 29 14:17:08 1997 Ian Lance Taylor <ian@cygnus.com>
* core.c (core_sym_class): Treat weak symbols as text symbols.
## Process this file with automake to generate Makefile.in
-## We should have cygnus in AUTOMAKE_OPTIONS, but it doesn't work yet.
-AUTOMAKE_OPTIONS = foreign
+AUTOMAKE_OPTIONS = cygnus
SUFFIXES = .m
-INCLUDES = -D_GNU_SOURCE -DDEBUG -DTARGET_$(MY_TARGET) -DMACHINE_H=\"$(MY_TARGET).h\" -I../bfd -I$(srcdir)/../include -I$(srcdir)/../bfd
-
-MY_TARGET = @MY_TARGET@
+INCLUDES = -D_GNU_SOURCE -DDEBUG -I../bfd -I$(srcdir)/../include -I$(srcdir)/../bfd
bin_PROGRAMS = gprof
gprof_SOURCES = basic_blocks.c call_graph.c cg_arcs.c cg_dfn.c \
cg_print.c core.c gmon_io.c gprof.c hertz.c hist.c source.c \
search_list.c symtab.c sym_ids.c utils.c \
- flat_bl.c bsd_callg_bl.c fsf_callg_bl.c
-gprof_DEPENDENCIES = $(MY_TARGET).o ../bfd/libbfd.la ../libiberty/libiberty.a
-gprof_LDADD = $(MY_TARGET).o ../bfd/libbfd.la ../libiberty/libiberty.a
+ flat_bl.c bsd_callg_bl.c fsf_callg_bl.c \
+ i386.c alpha.c vax.c tahoe.c sparc.c
+gprof_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a
+gprof_LDADD = ../bfd/libbfd.la ../libiberty/libiberty.a
noinst_HEADERS = \
- alpha.h i386.h ns532.h sparc.h tahoe.h vax.h dummy.h \
basic_blocks.h call_graph.h cg_arcs.h cg_dfn.h cg_print.h \
core.h gmon.h gmon_io.h gmon_out.h gprof.h hertz.h hist.h \
- search_list.h source.h sparc.h sym_ids.h symtab.h utils.h
+ search_list.h source.h sym_ids.h symtab.h utils.h
-EXTRA_DIST = \
- alpha.c i386.c ns532.c sparc.c tahoe.c vax.c dummy.c \
- flat_bl.c bsd_callg_bl.c fsf_callg_bl.c \
+EXTRA_DIST = flat_bl.c bsd_callg_bl.c fsf_callg_bl.c
BUILT_SOURCES = flat_bl.c bsd_callg_bl.c fsf_callg_bl.c
core.h gmon_io.h gmon_out.h gprof.h hertz.h hist.h \
search_list.h source.h sym_ids.h symtab.h utils.h \
$(srcdir)/../include/libiberty.h $(srcdir)/../bfd/sysdep.h \
- gconfig.h ../bfd/config.h $(MY_TARGET).h
-$(MY_TARGET).o: $(MY_TARGET).c
+ gconfig.h ../bfd/config.h
basic_blocks.o: basic_blocks.c
bsd_call_bl.o: bsd_call_bl.c
call_graph.o: call_graph.c
symtab.o: symtab.c
sym_ids.o: sym_ids.c
utils.o: utils.c
+i386.o: i386.c
+alpha.o: alpha.c
+vax.o: vax.c
+tahoe.o: tahoe.c
+sparc.o: sparc.c
# gives unlimited permission to copy, distribute and modify it.
-SHELL = /bin/sh
+SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
RANLIB = @RANLIB@
VERSION = @VERSION@
-AUTOMAKE_OPTIONS = foreign
+AUTOMAKE_OPTIONS = cygnus
SUFFIXES = .m
-INCLUDES = -D_GNU_SOURCE -DDEBUG -DTARGET_$(MY_TARGET) -DMACHINE_H=\"$(MY_TARGET).h\" -I../bfd -I$(srcdir)/../include -I$(srcdir)/../bfd
-
-MY_TARGET = @MY_TARGET@
+INCLUDES = -D_GNU_SOURCE -DDEBUG -I../bfd -I$(srcdir)/../include -I$(srcdir)/../bfd
bin_PROGRAMS = gprof
gprof_SOURCES = basic_blocks.c call_graph.c cg_arcs.c cg_dfn.c \
cg_print.c core.c gmon_io.c gprof.c hertz.c hist.c source.c \
search_list.c symtab.c sym_ids.c utils.c \
- flat_bl.c bsd_callg_bl.c fsf_callg_bl.c
-gprof_DEPENDENCIES = $(MY_TARGET).o ../bfd/libbfd.la ../libiberty/libiberty.a
-gprof_LDADD = $(MY_TARGET).o ../bfd/libbfd.la ../libiberty/libiberty.a
+ flat_bl.c bsd_callg_bl.c fsf_callg_bl.c \
+ i386.c alpha.c vax.c tahoe.c sparc.c
+gprof_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a
+gprof_LDADD = ../bfd/libbfd.la ../libiberty/libiberty.a
noinst_HEADERS = \
- alpha.h i386.h ns532.h sparc.h tahoe.h vax.h dummy.h \
basic_blocks.h call_graph.h cg_arcs.h cg_dfn.h cg_print.h \
core.h gmon.h gmon_io.h gmon_out.h gprof.h hertz.h hist.h \
- search_list.h source.h sparc.h sym_ids.h symtab.h utils.h
+ search_list.h source.h sym_ids.h symtab.h utils.h
+
+EXTRA_DIST = flat_bl.c bsd_callg_bl.c fsf_callg_bl.c
-EXTRA_DIST = \
- alpha.c i386.c ns532.c sparc.c tahoe.c vax.c dummy.c \
- flat_bl.c bsd_callg_bl.c fsf_callg_bl.c \
BUILT_SOURCES = flat_bl.c bsd_callg_bl.c fsf_callg_bl.c
info_TEXINFOS = gprof.texi
gprof_OBJECTS = basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o \
cg_print.o core.o gmon_io.o gprof.o hertz.o hist.o source.o \
search_list.o symtab.o sym_ids.o utils.o flat_bl.o bsd_callg_bl.o \
-fsf_callg_bl.o
+fsf_callg_bl.o i386.o alpha.o vax.o tahoe.o sparc.o
gprof_LDFLAGS =
CFLAGS = @CFLAGS@
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
default: all
.SUFFIXES:
-.SUFFIXES: .c .dvi .info .lo .m .o .ps .texi .texinfo
+.SUFFIXES: .S .c .dvi .info .lo .m .o .ps .s .texi .texinfo
$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile
rm -f $(bindir)/`echo $$p|sed '$(transform)'`; \
done
+.s.o:
+ $(COMPILE) -c $<
+
+.S.o:
+ $(COMPILE) -c $<
+
.c.o:
$(COMPILE) -c $<
.c.lo:
$(LIBTOOL) --mode=compile $(COMPILE) -c $<
+# These are just copies of the above rule.
+.s.lo:
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+.S.lo:
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
mostlyclean-libtool:
rm -f *.lo
core.h gmon_io.h gmon_out.h gprof.h hertz.h hist.h \
search_list.h source.h sym_ids.h symtab.h utils.h \
$(srcdir)/../include/libiberty.h $(srcdir)/../bfd/sysdep.h \
- gconfig.h ../bfd/config.h $(MY_TARGET).h
-$(MY_TARGET).o: $(MY_TARGET).c
+ gconfig.h ../bfd/config.h
basic_blocks.o: basic_blocks.c
bsd_call_bl.o: bsd_call_bl.c
call_graph.o: call_graph.c
symtab.o: symtab.c
sym_ids.o: sym_ids.c
utils.o: utils.c
+i386.o: i386.c
+alpha.o: alpha.c
+vax.o: vax.c
+tahoe.o: tahoe.c
+sparc.o: sparc.c
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
-Thu Feb 9 16:48:04 1995
-- documentation
-- optimize bfd_find_nearest_line_num() (or replace by different interface)
- gmon_io.c cannot deal with target architecture that have a pointer size
that is different from the host architectures pointer size---fix this
(gmon_out.h, and gmon_io.c)
- add support for prof file format so that prof files can be displayed
at the line-level (this is useful for the uprofile tool under DEC's
OSF/1)
+- take a hard look at --file-ordering (broken) and --function-ordering
++ documentation
++ optimize bfd_find_nearest_line_num() (or replace by different interface)
+ cleanup _bfd_ecoff_find_nearest_line_num() fixes & description
+ ensure "cc -pg" produces good files under OSF/1 v3.0
+ make sure gprof works together with OSF/1 v3.0's profiling libraries
AC_REQUIRE([AC_PROG_LN_S])
# Always use our own libtool.
-LIBTOOL='$(top_builddir)/libtool'
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
AC_SUBST(LIBTOOL)
+dnl CYGNUS LOCAL arguments to enable-shared
dnl Allow the --disable-shared flag to stop us from building shared libs.
AC_ARG_ENABLE(shared,
[ --enable-shared build shared libraries [default=yes]],
-[if test "$enableval" = no; then
- enable_shared=no
-else
- enable_shared=yes
-fi])
+[p=${PACKAGE-bogus-package-name}
+ case "$enableval" in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ # The value of $p (aka $PACKAGE) is assumed to come from AM_INIT_AUTOMAKE.
+ # If it didn't, it'll be `bogus-package-name', thus making this condition
+ # not be used.
+ *$p*) enable_shared=yes ;;
+ *) shared=no ;;
+esac])
libtool_shared=
test "$enable_shared" = no && libtool_shared=" --disable-shared"
+dnl END CYGNUS LOCAL
dnl Allow the --disable-static flag to stop us from building static libs.
AC_ARG_ENABLE(static,
dnl AM_CYGWIN32()
AC_DEFUN(AM_CYGWIN32,
[AC_CACHE_CHECK(for Cygwin32 environment, am_cv_cygwin32,
-[AC_TRY_COMPILE(,[int main () { return __CYGWIN32__; }],
+[AC_TRY_COMPILE(,[return __CYGWIN32__;],
am_cv_cygwin32=yes, am_cv_cygwin32=no)
rm -f conftest*])
CYGWIN32=
dnl to see if there is a suffix for executables.
AC_DEFUN(AM_EXEEXT,
[AC_REQUIRE([AM_CYGWIN32])
+AC_REQUIRE([AM_MINGW32])
AC_MSG_CHECKING([for executable suffix])
-AC_CACHE_VAL(am_cv_exeext,
-[if test "$CYGWIN32" = yes; then
+AC_CACHE_VAL(am_cv_exeext,[
+if test "$CYGWIN32" = yes -o "$MINGW32" = yes; then
am_cv_exeext=.exe
else
cat > am_c_test.c << 'EOF'
AC_MSG_RESULT(${am_cv_exeext})
AC_SUBST(EXEEXT)])
+# Check to see if we're running under Mingw, without using
+# AC_CANONICAL_*. If so, set output variable MINGW32 to "yes".
+# Otherwise set it to "no".
+
+dnl AM_MINGW32()
+AC_DEFUN(AM_MINGW32,
+[AC_CACHE_CHECK(for Mingw32 environment, am_cv_mingw32,
+[AC_TRY_COMPILE(,[return __MINGW32__;],
+am_cv_mingw32=yes, am_cv_mingw32=no)
+rm -f conftest*])
+MINGW32=
+test "$am_cv_mingw32" = yes && MINGW32=yes])
+
}
j; /* jump format */
}
-Instruction;
+alpha_Instruction;
static Sym indirect_child;
* potentially call integer division routines, for example.)
*/
void
-find_call (parent, p_lowpc, p_highpc)
+alpha_find_call (parent, p_lowpc, p_highpc)
Sym *parent;
bfd_vma p_lowpc;
bfd_vma p_highpc;
{
static bfd_vma delta = 0;
bfd_vma dest_pc;
- Instruction *pc;
+ alpha_Instruction *pc;
Sym *child;
if (!delta)
}
DBG (CALLDEBUG, printf ("[find_call] %s: 0x%lx to 0x%lx\n",
parent->name, p_lowpc, p_highpc));
- for (pc = (Instruction *) (p_lowpc + delta);
- pc < (Instruction *) (p_highpc + delta);
+ for (pc = (alpha_Instruction *) (p_lowpc + delta);
+ pc < (alpha_Instruction *) (p_highpc + delta);
++pc)
{
switch (pc->a.op_code)
+++ /dev/null
-/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are permitted
- * provided that: (1) source distributions retain this entire copyright
- * notice and comment, and (2) distributions including binaries display
- * the following acknowledgement: ``This product includes software
- * developed by the University of California, Berkeley and its contributors''
- * in the documentation or other materials provided with the distribution
- * and in all advertising materials mentioning features or use of this
- * software. Neither the name of the University nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- *
- * @(#)alpha.h 1.4 (Berkeley) 6/1/90
- */
-#ifndef alpha_h
-#define alpha_h
-
-/*
- * Offset (in bytes) of the code from the entry address of a routine.
- * (see hist_assign_samples for use and explanation.)
- */
-#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 */
# Initialize some other variables.
subdirs=
MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
# Maximum number of lines to put in a shell here document.
ac_max_here_lines=12
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:579: checking host system type" >&5
+echo "configure:580: checking host system type" >&5
host_alias=$host
case "$host_alias" in
echo "$ac_t""$host" 1>&6
echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:600: checking target system type" >&5
+echo "configure:601: checking target system type" >&5
target_alias=$target
case "$target_alias" in
echo "$ac_t""$target" 1>&6
echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:618: checking build system type" >&5
+echo "configure:619: checking build system type" >&5
build_alias=$build
case "$build_alias" in
# SunOS /usr/etc/install
# IRIX /sbin/install
# AIX /bin/install
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:652: checking for a BSD compatible install" >&5
+echo "configure:654: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
/|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
*)
# OSF1 and SCO ODT 3.0 have their own names for install.
- for ac_prog in ginstall installbsd scoinst install; do
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
if test -f $ac_dir/$ac_prog; then
if test $ac_prog = install &&
grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
- # OSF/1 installbsd also uses dspmsg, but is usable.
:
else
ac_cv_path_install="$ac_dir/$ac_prog -c"
EOF
echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:721: checking whether build environment is sane" >&5
+echo "configure:724: checking whether build environment is sane" >&5
# Just in case
sleep 1
echo timestamp > conftestfile
missing_dir=`cd $ac_aux_dir && pwd`
echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:768: checking for working aclocal" >&5
+echo "configure:771: checking for working aclocal" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
fi
echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:781: checking for working autoconf" >&5
+echo "configure:784: checking for working autoconf" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
fi
echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:794: checking for working automake" >&5
+echo "configure:797: checking for working automake" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
fi
echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:807: checking for working autoheader" >&5
+echo "configure:810: checking for working autoheader" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
fi
echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:820: checking for working makeinfo" >&5
+echo "configure:823: checking for working makeinfo" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
fi
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:833: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:836: checking whether ${MAKE-make} sets \${MAKE}" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:863: checking for $ac_word" >&5
+echo "configure:866: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:892: checking for $ac_word" >&5
+echo "configure:895: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:940: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:943: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext <<EOF
-#line 950 "configure"
+#line 953 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:954: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:957: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:974: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:977: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:979: checking whether we are using GNU C" >&5
+echo "configure:982: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:988: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:991: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1003: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1006: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1033: checking for $ac_word" >&5
+echo "configure:1036: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "$with_gnu_ld" = yes; then
echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:1069: checking for GNU ld" >&5
+echo "configure:1072: checking for GNU ld" >&5
else
echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1072: checking for non-GNU ld" >&5
+echo "configure:1075: checking for non-GNU ld" >&5
fi
if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
echo $ac_n "checking whether we are using GNU ld""... $ac_c" 1>&6
-echo "configure:1111: checking whether we are using GNU ld" >&5
+echo "configure:1114: checking whether we are using GNU ld" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1127: checking whether ln -s works" >&5
+echo "configure:1130: checking whether ln -s works" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Always use our own libtool.
-LIBTOOL='$(top_builddir)/libtool'
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
# Check whether --enable-shared or --disable-shared was given.
if test "${enable_shared+set}" = set; then
enableval="$enable_shared"
- if test "$enableval" = no; then
- enable_shared=no
-else
- enable_shared=yes
-fi
+ p=${PACKAGE-bogus-package-name}
+ case "$enableval" in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ # The value of $p (aka $PACKAGE) is assumed to come from AM_INIT_AUTOMAKE.
+ # If it didn't, it'll be `bogus-package-name', thus making this condition
+ # not be used.
+ *$p*) enable_shared=yes ;;
+ *) shared=no ;;
+esac
fi
libtool_shared=
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1224: checking for $ac_word" >&5
+echo "configure:1232: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1253: checking for $ac_word" >&5
+echo "configure:1261: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1301: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1309: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext <<EOF
-#line 1311 "configure"
+#line 1319 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:1315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1323: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1335: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1343: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1340: checking whether we are using GNU C" >&5
+echo "configure:1348: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1349: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1357: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1364: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1372: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
-echo "configure:1396: checking for POSIXized ISC" >&5
+echo "configure:1404: checking for POSIXized ISC" >&5
if test -d /etc/conf/kconfig.d &&
grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
then
fi
-case "${target}" in
-alpha-*-*) MY_TARGET=alpha ;;
-i[3456]86-*-*) MY_TARGET=i386 ;;
-sparc-*-*) MY_TARGET=sparc ;;
-tahoe-*-*) MY_TARGET=tahoe ;;
-vax-*-*) MY_TARGET=vax ;;
-ns32k-*-*) MY_TARGET=ns532;;
-*-*-*) MY_TARGET=dummy ;;
-esac
-
-
-
case "${target}" in
*-*-bsd4.4* | *-*-netbsd* | *-*-freebsd* | *-*-openbsd*)
cat >> confdefs.h <<\EOF
esac
echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:1439: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:1435: checking whether to enable maintainer-specific portions of Makefiles" >&5
# Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
if test "${enable_maintainer_mode+set}" = set; then
enableval="$enable_maintainer_mode"
echo $ac_n "checking for Cygwin32 environment""... $ac_c" 1>&6
-echo "configure:1457: checking for Cygwin32 environment" >&5
+echo "configure:1453: checking for Cygwin32 environment" >&5
if eval "test \"`echo '$''{'am_cv_cygwin32'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1462 "configure"
+#line 1458 "configure"
#include "confdefs.h"
int main() {
-int main () { return __CYGWIN32__; }
+return __CYGWIN32__;
; return 0; }
EOF
-if { (eval echo configure:1469: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1465: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
am_cv_cygwin32=yes
else
echo "$ac_t""$am_cv_cygwin32" 1>&6
CYGWIN32=
test "$am_cv_cygwin32" = yes && CYGWIN32=yes
+echo $ac_n "checking for Mingw32 environment""... $ac_c" 1>&6
+echo "configure:1482: checking for Mingw32 environment" >&5
+if eval "test \"`echo '$''{'am_cv_mingw32'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1487 "configure"
+#include "confdefs.h"
+
+int main() {
+return __MINGW32__;
+; return 0; }
+EOF
+if { (eval echo configure:1494: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ am_cv_mingw32=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ am_cv_mingw32=no
+fi
+rm -f conftest*
+rm -f conftest*
+fi
+
+echo "$ac_t""$am_cv_mingw32" 1>&6
+MINGW32=
+test "$am_cv_mingw32" = yes && MINGW32=yes
+
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:1487: checking for executable suffix" >&5
+echo "configure:1513: checking for executable suffix" >&5
if eval "test \"`echo '$''{'am_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- if test "$CYGWIN32" = yes; then
+
+if test "$CYGWIN32" = yes -o "$MINGW32" = yes; then
am_cv_exeext=.exe
else
cat > am_c_test.c << 'EOF'
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
(set) 2>&1 |
- case `(ac_space=' '; set) 2>&1` in
+ case `(ac_space=' '; set) 2>&1 | grep ac_space` in
*ac_space=\ *)
# `set' does not quote correctly, so add quotes (double-quote substitution
# turns \\\\ into \\, and sed turns \\ into \).
s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
$ac_vpsub
$extrasub
+s%@SHELL@%$SHELL%g
s%@CFLAGS@%$CFLAGS%g
s%@CPPFLAGS@%$CPPFLAGS%g
s%@CXXFLAGS@%$CXXFLAGS%g
s%@LD@%$LD%g
s%@LN_S@%$LN_S%g
s%@LIBTOOL@%$LIBTOOL%g
-s%@MY_TARGET@%$MY_TARGET%g
s%@MAINT@%$MAINT%g
s%@EXEEXT@%$EXEEXT%g
AC_ISC_POSIX
-case "${target}" in
-alpha-*-*) MY_TARGET=alpha ;;
-changequote(,)dnl
-i[3456]86-*-*) MY_TARGET=i386 ;;
-changequote([,])dnl
-sparc-*-*) MY_TARGET=sparc ;;
-tahoe-*-*) MY_TARGET=tahoe ;;
-vax-*-*) MY_TARGET=vax ;;
-ns32k-*-*) MY_TARGET=ns532;;
-*-*-*) MY_TARGET=dummy ;;
-esac
-
-AC_SUBST(MY_TARGET)
-
dnl We need to set BSD44_FORMAT on a host which uses the additional
dnl header fields. This is an attempt to do that. I can't think of a
dnl good feature test for this.
#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;
asection *core_text_sect;
PTR core_text_space;
+int min_insn_size;
+int offset_to_code;
+
/* For mapping symbols to specific .o files during file ordering. */
struct function_map {
char *function_name;
struct function_map *symbol_map;
int symbol_map_count;
+extern void i386_find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
+extern void alpha_find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
+extern void vax_find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
+extern void tahoe_find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
+extern void sparc_find_call PARAMS ((Sym *, bfd_vma, bfd_vma));
+
static void
DEFUN (read_function_mappings, (filename), const char *filename)
{
done (1);
}
+ min_insn_size = 1;
+ offset_to_code = 0;
+
+ switch (bfd_get_arch (core_bfd))
+ {
+ case bfd_arch_vax:
+ case bfd_arch_tahoe:
+ offset_to_code = 2;
+ break;
+
+ case bfd_arch_alpha:
+ min_insn_size = 4;
+ break;
+
+ default:
+ }
+
if (function_mapping_file)
read_function_mappings (function_mapping_file);
}
}
+void
+DEFUN (find_call, (parent, p_lowpc, p_highpc),
+ Sym * parent AND bfd_vma p_lowpc AND bfd_vma p_highpc)
+{
+ switch (bfd_get_arch (core_bfd))
+ {
+ case bfd_arch_i386:
+ i386_find_call (parent, p_lowpc, p_highpc);
+ break;
+
+ case bfd_arch_alpha:
+ alpha_find_call (parent, p_lowpc, p_highpc);
+ break;
+
+ case bfd_arch_vax:
+ vax_find_call (parent, p_lowpc, p_highpc);
+ break;
+
+ case bfd_arch_sparc:
+ sparc_find_call (parent, p_lowpc, p_highpc);
+ break;
+
+ case bfd_arch_tahoe:
+ tahoe_find_call (parent, p_lowpc, p_highpc);
+ break;
+
+ default:
+ fprintf (stderr, "%s: -c not supported on architecture %s\n",
+ whoami, bfd_printable_name(core_bfd));
+
+ /* Don't give the error more than once. */
+ ignore_direct_calls = FALSE;
+ }
+}
+
/*
* Return class of symbol SYM. The returned class can be any of:
* 0 -> symbol is not interesting to us
symtab.limit->mapped = 0;
}
-#ifdef __osf__
- /*
- * Suppress symbols that are not function names. This is
- * useful to suppress code-labels and aliases.
- *
- * This is known to be useful under DEC's OSF/1. Under SunOS 4.x,
- * labels do not appear in the symbol table info, so this isn't
- * necessary.
- */
+ /* Lookup filename and line number, if we can */
+
{
const char *filename, *func_name;
{
symtab.limit->file = source_file_lookup_path (filename);
+ /* FIXME: Checking __osf__ here does not work with a cross
+ gprof. */
+#ifdef __osf__
+ /*
+ * Suppress symbols that are not function names. This is
+ * useful to suppress code-labels and aliases.
+ *
+ * This is known to be useful under DEC's OSF/1. Under SunOS 4.x,
+ * labels do not appear in the symbol table info, so this isn't
+ * necessary.
+ */
+
if (strcmp (symtab.limit->name, func_name) != 0)
{
/*
symtab.limit->name, func_name));
continue;
}
+#endif
}
}
-#endif
symtab.limit->is_func = TRUE;
symtab.limit->is_bb_head = TRUE;
{
char prev_name[PATH_MAX], prev_filename[PATH_MAX];
bfd_vma vma, min_vma = ~0, max_vma = 0;
- bfd_vma offset, prev_offset, min_dist;
+ bfd_vma offset;
Sym *prev, dummy, *sentinel, *sym;
const char *filename;
- int prev_line_num, i;
+ int prev_line_num;
Sym_Table ltab;
/*
* Create symbols for functions as usual. This is necessary in
* it is time to create a new symbol.
*
* Of course, this is rather slow and it would be better if
- * bfd would provide an iterator for enumerating all line
- * infos, but for now, we try to speed up the second pass
- * by determining what the minimum code distance between two
- * lines is.
+ * bfd would provide an iterator for enumerating all line infos
*/
prev_name[0] = '\0';
ltab.len = 0;
- min_dist = core_text_sect->_raw_size;
- prev_offset = -min_dist;
prev_filename[0] = '\0';
prev_line_num = 0;
- for (offset = 0; offset < core_text_sect->_raw_size; offset += MIN_INSN_SIZE)
+ 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)
strcpy (prev_name, dummy.name);
strcpy (prev_filename, filename);
- if (offset - prev_offset < min_dist)
- {
- min_dist = offset - prev_offset;
- }
- prev_offset = offset;
-
min_vma = MIN (vma, min_vma);
max_vma = MAX (vma, max_vma);
}
- DBG (AOUTDEBUG, printf ("[core_create_line_syms] min_dist=%lx\n", min_dist));
-
/* make room for function symbols, too: */
ltab.len += symtab.len;
ltab.base = (Sym *) xmalloc (ltab.len * sizeof (Sym));
/* pass 2 - create symbols: */
+ /* We now set is_static as we go along, rather than by running
+ through the symbol table at the end.
+
+ The old way called symtab_finalize before the is_static pass,
+ causing a problem since symtab_finalize uses is_static as part of
+ its address conflict resolution algorithm. Since global symbols
+ were prefered over static symbols, and all line symbols were
+ global at that point, static function names that conflicted with
+ their own line numbers (static, but labeled as global) were
+ rejected in favor of the line num.
+
+ This was not the desired functionality. We always want to keep
+ our function symbols and discard any conflicting line symbols.
+ Perhaps symtab_finalize should be modified to make this
+ distinction as well, but the current fix works and the code is a
+ lot cleaner now. */
+
prev = 0;
- for (offset = 0; offset < core_text_sect->_raw_size; offset += min_dist)
+ for (offset = 0; offset < core_text_sect->_raw_size; offset += min_insn_size)
{
sym_init (ltab.limit);
if (!get_src_info (core_text_sect->vma + offset, &filename,
ltab.limit->file = source_file_lookup_path (filename);
ltab.limit->addr = core_text_sect->vma + offset;
+
+ /* Set is_static based on the enclosing function, using either:
+ * 1) the previous symbol, if it's from the same function, or
+ * 2) a symtab lookup
+ */
+
+ if (prev && ltab.limit->file == prev->file &&
+ strcmp (ltab.limit->name, prev->name) == 0)
+ {
+ ltab.limit->is_static = prev->is_static;
+ }
+ else
+ {
+ sym = sym_lookup(&symtab, ltab.limit->addr);
+ ltab.limit->is_static = sym->is_static;
+ }
+
prev = ltab.limit;
/*
}
DBG (AOUTDEBUG, printf ("[core_create_line_syms] %d %s 0x%lx\n",
- ltab.len, ltab.limit->name,
+ ltab.limit - ltab.base, ltab.limit->name,
ltab.limit->addr));
++ltab.limit;
}
if (ltab.limit - ltab.base != ltab.len)
{
fprintf (stderr,
- "%s: somebody miscounted: ltab.len=%ld instead of %d\n",
- whoami, (long) (ltab.limit - ltab.base), ltab.len);
+ "%s: somebody miscounted: ltab.len=%d instead of %ld\n",
+ whoami, ltab.len, (long) (ltab.limit - ltab.base));
done (1);
}
free (symtab.base);
symtab = ltab;
- /* now go through all core symbols and set is_static accordingly: */
-
- for (i = 0; i < core_num_syms; ++i)
- {
- if (core_sym_class (core_syms[i]) == 't')
- {
- sym = sym_lookup (&symtab, core_syms[i]->value
- + core_syms[i]->section->vma);
- do
- {
- sym++->is_static = TRUE;
- }
- while (sym->file == sym[-1].file &&
- strcmp (sym->name, sym[-1].name) == 0);
- }
- }
-
}
extern asection *core_text_sect; /* core text section */
extern PTR core_text_space; /* text space of a.out in core */
+extern int min_insn_size; /* size of smallest instruction, in bytes */
+extern int offset_to_code; /* offset (in bytes) of code from entry
+ address of routine */
+
extern void core_init PARAMS ((const char *a_out_name));
extern void core_get_text_space PARAMS ((bfd * core_bfd));
extern void core_create_function_syms PARAMS ((bfd * core_bfd));
+++ /dev/null
-#include "gprof.h"
-#include "symtab.h"
-
-
-/*
- * dummy.c -- This file should be used for an unsupported processor type.
- * It does nothing, but prevents findcall() from being unresolved.
- */
-
-void
-DEFUN (find_call, (parent, p_lowpc, p_highpc),
- Sym * parent AND bfd_vma p_lowpc AND bfd_vma p_highpc)
-{
- fprintf (stderr, "%s: -c not supported on this machine architecture\n",
- whoami);
-
- /* Don't give the error more than once. */
- ignore_direct_calls = FALSE;
-}
+++ /dev/null
-/*-
- * Copyright (c) 1991 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)dummy.h 5.1 (Berkeley) 4/18/91
- */
-#ifndef dummy_h
-#define dummy_h
-
-/*
- * dummy.h -- This file should be used when a processor is not yet supported.
- */
-
-/*
- * Offset (in bytes) of the code from the entry address of a routine.
- * (see hist_assign_samples()) for use and explanation.)
- */
-#define OFFSET_TO_CODE 0
-#define UNITS_TO_CODE (OFFSET_TO_CODE / sizeof(UNIT))
-
-enum opermodes
- {
- dummy
- };
-typedef enum opermodes operandenum;
-
-#endif /* dummy_h */
struct raw_phdr
{
-#ifdef TARGET_alpha
+ /* FIXME: Checking a host compiler define means that we can't use
+ a cross gprof to the alpha. */
+#ifdef __alpha__
char low_pc[8]; /* base pc address of sample buffer */
char high_pc[8]; /* max pc address of sampled buffer */
#else
#endif
char ncnt[4]; /* size of sample buffer (plus this header) */
+ /* FIXME: Checking host compiler defines here means that we can't
+ use a cross gprof alpha OSF. */
#if defined (__alpha__) && defined (__osf__)
/*
* DEC's OSF v3.0 uses 4 bytes of padding to bring the header to
*/
struct raw_arc
{
-#ifdef TARGET_alpha
+ /* FIXME: Checking a host compiler define means that we can't use
+ a cross gprof to the alpha. */
+#ifdef __alpha__
char from_pc[8];
char self_pc[8];
char count[8];
*/
static char *default_excluded_list[] =
{
- "_gprof_mcount", "mcount", "_mcount", "__mcount", "__mcleanup",
+ "_gprof_mcount", "mcount", "_mcount", "__mcount", "__mcount_internal",
+ "__mcleanup",
"<locore>", "<hicore>",
0
};
/* AIX defines hz as a macro. */
#undef hz
-#ifdef MACHINE_H
-#include MACHINE_H
-#else
-#if vax
-#include "vax.h"
-#endif
-#if sun
-#include "sun.h"
-#endif
-#if tahoe
-#include "tahoe.h"
-#endif
-#endif
-
-#ifndef FOPEN_RB
-#define FOPEN_RB "r"
-#endif
-#ifndef FOPEN_WB
-#define FOPEN_WB "w"
-#endif
-
#ifndef PATH_MAX
#define PATH_MAX 1024
#endif
* Discover the tick frequency of the machine if something goes wrong,
* we return HZ_WRONG, an impossible sampling frequency.
*/
+
+/* FIXME: Checking for MACH here makes no sense when for a cross
+ gprof. */
+#ifdef MACH
+#include <machine/mach_param.h>
+#define hertz() (HZ)
+#else
extern int hertz PARAMS ((void));
+#endif
#endif /* hertz_h */
#include "sym_ids.h"
#include "utils.h"
+#define UNITS_TO_CODE (offset_to_code / sizeof(UNIT))
+
static void scale_and_align_entries PARAMS ((void));
/* declarations of automatically generated functions to output blurbs: */
int
-DEFUN (iscall, (ip), unsigned char *ip)
+DEFUN (i386_iscall, (ip), unsigned char *ip)
{
- if (*ip == 0xeb || *ip == 0x9a)
+ if (*ip == 0xe8)
return 1;
return 0;
}
void
-find_call (parent, p_lowpc, p_highpc)
+i386_find_call (parent, p_lowpc, p_highpc)
Sym *parent;
bfd_vma p_lowpc;
bfd_vma p_highpc;
{
unsigned char *instructp;
- long length;
Sym *child;
- bfd_vma destpc;
+ bfd_vma destpc, delta;
if (core_text_space == 0)
{
}
DBG (CALLDEBUG, printf ("[findcall] %s: 0x%lx to 0x%lx\n",
parent->name, p_lowpc, p_highpc));
- for (instructp = (unsigned char *) core_text_space + p_lowpc;
- instructp < (unsigned char *) core_text_space + p_highpc;
- instructp += length)
+
+ delta = (bfd_vma) core_text_space - core_text_sect->vma;
+
+ for (instructp = (unsigned char *) (p_lowpc + delta);
+ instructp < (unsigned char *) (p_highpc + delta);
+ instructp ++)
{
- length = 1;
- if (iscall (instructp))
+ if (i386_iscall (instructp))
{
DBG (CALLDEBUG,
- printf ("[findcall]\t0x%x:callf",
- instructp - (unsigned char *) core_text_space));
- length = 4;
+ printf ("[findcall]\t0x%x:call",
+ instructp - (unsigned char *) delta));
/*
* regular pc relative addressing
* check that this is the address of
* a function.
*/
- destpc = ((bfd_vma) instructp + 5 - (bfd_vma) core_text_space);
+
+ destpc = ((bfd_vma) bfd_get_32 (core_bfd, instructp + 1)
+ + (bfd_vma) instructp - (bfd_vma) delta + 5);
if (destpc >= s_lowpc && destpc <= s_highpc)
{
child = sym_lookup (&symtab, destpc);
- DBG (CALLDEBUG,
- printf ("[findcall]\tdestpc 0x%lx", destpc);
- printf (" child->name %s", child->name);
- printf (" child->addr 0x%lx\n", child->addr);
- );
- if (child->addr == destpc)
+ if (child && child->addr == destpc)
{
/*
* a hit
*/
+ DBG (CALLDEBUG,
+ printf ("\tdestpc 0x%lx (%s)\n", destpc, child->name));
arc_add (parent, child, (long) 0);
- length += 4; /* constant lengths */
+ instructp += 4; /* call is a 5 byte instruction */
continue;
}
- goto botched;
}
/*
* else:
- * it looked like a callf,
- * but it wasn't to anywhere.
- */
- botched:
- /*
- * something funny going on.
+ * it looked like a callf, but it:
+ * a) wasn't actually a callf, or
+ * b) didn't point to a known function in the symtab, or
+ * c) something funny is going on.
*/
- DBG (CALLDEBUG, printf ("[findcall]\tbut it's a botch\n"));
- length = 1;
- continue;
+ DBG (CALLDEBUG, printf ("\tbut it's a botch\n"));
}
}
}
+++ /dev/null
-/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are permitted
- * provided that: (1) source distributions retain this entire copyright
- * notice and comment, and (2) distributions including binaries display
- * the following acknowledgement: ``This product includes software
- * developed by the University of California, Berkeley and its contributors''
- * in the documentation or other materials provided with the distribution
- * and in all advertising materials mentioning features or use of this
- * software. Neither the name of the University nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- *
- * @(#)tahoe.h 1.4 (Berkeley) 6/1/90
- */
-
-/*
- * Right now, this does very little
- */
-
- /*
- * opcode of the `callf' instruction
- */
- /*
- * offset (in bytes) of the code from the entry address of a routine.
- * (see asgnsamples for use and explanation.)
- */
-#define OFFSET_TO_CODE 0
-#define UNITS_TO_CODE (OFFSET_TO_CODE / sizeof(UNIT))
-
-#ifdef __MSDOS__
-#define FOPEN_RB "rb"
-#endif
+++ /dev/null
-#include "gprof.h"
-#include "symtab.h"
-
-/*
- * dummy.c -- This file should be used for an unsupported processor type.
- * It does nothing, but prevents findcall() from being unresolved.
- */
-
-void
-find_call (parent, p_lowpc, p_highpc)
- Sym *parent;
- bfd_vma p_lowpc;
- bfd_vma p_highpc;
-{
- fprintf (stderr, "%s: -c supported on this machine architecture\n",
- whoami);
-}
+++ /dev/null
-/*-
- * Copyright (c) 1991 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)dummy.h 5.1 (Berkeley) 4/18/91
- */
-
-/*
- * offset (in bytes) of the code from the entry address of a routine.
- * (see asgnsamples for use and explanation.)
- */
-#ifdef MACH
-#include <machine/mach_param.h>
-#define hertz() (HZ)
-#endif
-#define OFFSET_OF_CODE 0
-#define UNITS_TO_CODE (OFFSET_OF_CODE / sizeof(UNIT))
-
-enum opermodes
- {
- dummy
- };
-typedef enum opermodes operandenum;
#include "hist.h"
#include "symtab.h"
+ /*
+ * opcode of the `callf' instruction
+ */
+#define CALL (0xc0000000)
void
-find_call (parent, p_lowpc, p_highpc)
+sparc_find_call (parent, p_lowpc, p_highpc)
Sym *parent;
bfd_vma p_lowpc;
bfd_vma p_highpc;
+++ /dev/null
-/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are permitted
- * provided that: (1) source distributions retain this entire copyright
- * notice and comment, and (2) distributions including binaries display
- * the following acknowledgement: ``This product includes software
- * developed by the University of California, Berkeley and its contributors''
- * in the documentation or other materials provided with the distribution
- * and in all advertising materials mentioning features or use of this
- * software. Neither the name of the University nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- *
- * @(#)tahoe.h 1.4 (Berkeley) 6/1/90
- */
-
- /*
- * opcode of the `callf' instruction
- */
-#define CALL (0xc0000000)
- /*
- * offset (in bytes) of the code from the entry address of a routine.
- * (see asgnsamples for use and explanation.)
- */
-#define OFFSET_TO_CODE 0
-#define UNITS_TO_CODE (OFFSET_TO_CODE / sizeof(UNIT))
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
#include "gprof.h"
-#include "time_host.h"
+#include "cg_arcs.h"
+#include "core.h"
+#include "hist.h"
+#include "symtab.h"
+
+ /*
+ * opcode of the `callf' instruction
+ */
+#define CALLF 0xfe
+
+ /*
+ * register for pc relative addressing
+ */
+#define PC 0xf
+
+enum tahoe_opermodes
+ {
+ literal, indexed, reg, regdef, autodec, autoinc, autoincdef,
+ bytedisp, bytedispdef, worddisp, worddispdef, longdisp, longdispdef,
+ immediate, absolute, byterel, bytereldef, wordrel, wordreldef,
+ longrel, longreldef
+ };
+typedef enum tahoe_opermodes tahoe_operandenum;
/*
* A symbol to be the child of indirect callf:
Sym indirectchild;
-operandenum
-operandmode (modep)
+tahoe_operandenum
+tahoe_operandmode (modep)
unsigned char *modep;
{
long usesreg = ((long) *modep) & 0xf;
return usesreg != PC ? longdispdef : longreldef;
}
/* NOTREACHED */
+ abort ();
}
char *
-operandname (mode)
- operandenum mode;
+tahoe_operandname (mode)
+ tahoe_operandenum mode;
{
switch (mode)
return "long relative deferred";
}
/* NOTREACHED */
+ abort ();
}
long
-operandlength (modep)
+tahoe_operandlength (modep)
unsigned char *modep;
{
- switch (operandmode (modep))
+ switch (tahoe_operandmode (modep))
{
case literal:
case reg:
case longreldef:
return 5;
case indexed:
- return 1 + operandlength (modep + 1);
+ return 1 + tahoe_operandlength (modep + 1);
}
/* NOTREACHED */
+ abort ();
}
bfd_vma
-reladdr (modep)
+tahoe_reladdr (modep)
char *modep;
{
- operandenum mode = operandmode (modep);
+ tahoe_operandenum mode = tahoe_operandmode (modep);
char *cp;
short *sp;
long *lp;
}
}
-find_call (parent, p_lowpc, p_highpc)
+void
+tahoe_find_call (parent, p_lowpc, p_highpc)
Sym *parent;
bfd_vma p_lowpc;
bfd_vma p_highpc;
unsigned char *instructp;
long length;
Sym *child;
- operandenum mode;
- operandenum firstmode;
+ tahoe_operandenum mode;
+ tahoe_operandenum firstmode;
bfd_vma destpc;
static bool inited = FALSE;
indirectchild.cg.cyc.head = &indirectchild;
}
- if (textspace == 0)
+ if (core_text_space == 0)
{
return;
}
{
p_highpc = s_highpc;
}
- DBG (CALLDEBUG, printf ("[findcall] %s: 0x%x to 0x%x\n",
+ DBG (CALLDEBUG, printf ("[findcall] %s: 0x%lx to 0x%lx\n",
parent->name, p_lowpc, p_highpc));
- for (instructp = textspace + p_lowpc;
- instructp < textspace + p_highpc;
+ for (instructp = (unsigned char *) core_text_space + p_lowpc;
+ instructp < (unsigned char *) core_text_space + p_highpc;
instructp += length)
{
length = 1;
* skip the count of the number of arguments.
*/
DBG (CALLDEBUG, printf ("[findcall]\t0x%x:callf",
- instructp - textspace));
- firstmode = operandmode (instructp + length);
+ instructp - (unsigned char *) core_text_space));
+ firstmode = tahoe_operandmode (instructp + length);
switch (firstmode)
{
case literal:
default:
goto botched;
}
- length += operandlength (instructp + length);
- mode = operandmode (instructp + length);
+ length += tahoe_operandlength (instructp + length);
+ mode = tahoe_operandmode (instructp + length);
DBG (CALLDEBUG,
- printf ("\tfirst operand is %s", operandname (firstmode));
- printf ("\tsecond operand is %s\n", operandname (mode));
+ printf ("\tfirst operand is %s", tahoe_operandname (firstmode));
+ printf ("\tsecond operand is %s\n", tahoe_operandname (mode));
);
switch (mode)
{
* e.g. arrays of pointers to functions???]
*/
arc_add (parent, &indirectchild, (long) 0);
- length += operandlength (instructp + length);
+ length += tahoe_operandlength (instructp + length);
continue;
case byterel:
case wordrel:
* check that this is the address of
* a function.
*/
- destpc = reladdr (instructp + length)
- - (bfd_vma) textspace;
+ destpc = tahoe_reladdr (instructp + length)
+ - (bfd_vma) core_text_space;
if (destpc >= s_lowpc && destpc <= s_highpc)
{
- child = sym_lookup (destpc);
+ child = sym_lookup (&symtab, destpc);
DBG (CALLDEBUG,
- printf ("[findcall]\tdestpc 0x%x", destpc);
+ printf ("[findcall]\tdestpc 0x%lx", destpc);
printf (" child->name %s", child->name);
- printf (" child->addr 0x%x\n", child->addr);
+ printf (" child->addr 0x%lx\n", child->addr);
);
if (child->addr == destpc)
{
* a hit
*/
arc_add (parent, child, (long) 0);
- length += operandlength (instructp + length);
+ length += tahoe_operandlength (instructp + length);
continue;
}
goto botched;
+++ /dev/null
-/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are permitted
- * provided that: (1) source distributions retain this entire copyright
- * notice and comment, and (2) distributions including binaries display
- * the following acknowledgement: ``This product includes software
- * developed by the University of California, Berkeley and its contributors''
- * in the documentation or other materials provided with the distribution
- * and in all advertising materials mentioning features or use of this
- * software. Neither the name of the University nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- *
- * @(#)tahoe.h 1.4 (Berkeley) 6/1/90
- */
-
- /*
- * opcode of the `callf' instruction
- */
-#define CALLF 0xfe
-
- /*
- * offset (in bytes) of the code from the entry address of a routine.
- * (see asgnsamples for use and explanation.)
- */
-#define OFFSET_TO_CODE 2
-#define UNITS_TO_CODE (OFFSET_TO_CODE / sizeof(UNIT))
-
- /*
- * register for pc relative addressing
- */
-#define PC 0xf
-
-enum opermodes
- {
- literal, indexed, reg, regdef, autodec, autoinc, autoincdef,
- bytedisp, bytedispdef, worddisp, worddispdef, longdisp, longdispdef,
- immediate, absolute, byterel, bytereldef, wordrel, wordreldef,
- longrel, longreldef
- };
-typedef enum opermodes operandenum;
#include "hist.h"
#include "symtab.h"
+ /*
+ * opcode of the `calls' instruction
+ */
+#define CALLS 0xfb
+
+ /*
+ * register for pc relative addressing
+ */
+#define PC 0xf
+
+enum opermodes
+ {
+ literal, indexed, reg, regdef, autodec, autoinc, autoincdef,
+ bytedisp, bytedispdef, worddisp, worddispdef, longdisp, longdispdef,
+ immediate, absolute, byterel, bytereldef, wordrel, wordreldef,
+ longrel, longreldef
+ };
+typedef enum opermodes operandenum;
+
+struct modebyte
+ {
+ unsigned int regfield:4;
+ unsigned int modefield:4;
+ };
+
/*
* A symbol to be the child of indirect calls:
*/
static operandenum
-operandmode (modep)
+vax_operandmode (modep)
struct modebyte *modep;
{
long usesreg = modep->regfield;
return usesreg != PC ? longdispdef : longreldef;
}
/* NOTREACHED */
+ abort ();
}
static char *
-operandname (mode)
+vax_operandname (mode)
operandenum mode;
{
return "long relative deferred";
}
/* NOTREACHED */
+ abort ();
}
static long
-operandlength (modep)
+vax_operandlength (modep)
struct modebyte *modep;
{
- switch (operandmode (modep))
+ switch (vax_operandmode (modep))
{
case literal:
case reg:
case longreldef:
return 5;
case indexed:
- return 1 + operandlength ((struct modebyte *) ((char *) modep) + 1);
+ return 1 + vax_operandlength ((struct modebyte *) ((char *) modep) + 1);
}
/* NOTREACHED */
+ abort ();
}
static bfd_vma
-reladdr (modep)
+vax_reladdr (modep)
struct modebyte *modep;
{
- operandenum mode = operandmode (modep);
+ operandenum mode = vax_operandmode (modep);
char *cp;
short *sp;
long *lp;
void
-find_call (parent, p_lowpc, p_highpc)
+vax_find_call (parent, p_lowpc, p_highpc)
Sym *parent;
bfd_vma p_lowpc;
bfd_vma p_highpc;
DBG (CALLDEBUG,
printf ("[findcall]\t0x%x:calls",
instructp - (unsigned char *) core_text_space));
- firstmode = operandmode ((struct modebyte *) (instructp + length));
+ firstmode = vax_operandmode ((struct modebyte *) (instructp + length));
switch (firstmode)
{
case literal:
default:
goto botched;
}
- length += operandlength ((struct modebyte *) (instructp + length));
- mode = operandmode ((struct modebyte *) (instructp + length));
+ length += vax_operandlength ((struct modebyte *) (instructp + length));
+ mode = vax_operandmode ((struct modebyte *) (instructp + length));
DBG (CALLDEBUG,
- printf ("\tfirst operand is %s", operandname (firstmode));
- printf ("\tsecond operand is %s\n", operandname (mode)));
+ printf ("\tfirst operand is %s", vax_operandname (firstmode));
+ printf ("\tsecond operand is %s\n", vax_operandname (mode)));
switch (mode)
{
case regdef:
* e.g. arrays of pointers to functions???]
*/
arc_add (parent, &indirectchild, (long) 0);
- length += operandlength (
+ length += vax_operandlength (
(struct modebyte *) (instructp + length));
continue;
case byterel:
* check that this is the address of
* a function.
*/
- destpc = reladdr ((struct modebyte *) (instructp + length))
+ destpc = vax_reladdr ((struct modebyte *) (instructp + length))
- (bfd_vma) core_text_space;
if (destpc >= s_lowpc && destpc <= s_highpc)
{
* a hit
*/
arc_add (parent, child, (long) 0);
- length += operandlength ((struct modebyte *)
- (instructp + length));
+ length += vax_operandlength ((struct modebyte *)
+ (instructp + length));
continue;
}
goto botched;
+++ /dev/null
-/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are permitted
- * provided that: (1) source distributions retain this entire copyright
- * notice and comment, and (2) distributions including binaries display
- * the following acknowledgement: ``This product includes software
- * developed by the University of California, Berkeley and its contributors''
- * in the documentation or other materials provided with the distribution
- * and in all advertising materials mentioning features or use of this
- * software. Neither the name of the University nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- *
- * @(#)vax.h 5.4 (Berkeley) 6/1/90
- */
-
- /*
- * opcode of the `calls' instruction
- */
-#define CALLS 0xfb
-
- /*
- * offset (in bytes) of the code from the entry address of a routine.
- * (see asgnsamples for use and explanation.)
- */
-#define OFFSET_TO_CODE 2
-#define UNITS_TO_CODE (OFFSET_TO_CODE / sizeof(UNIT))
-
- /*
- * register for pc relative addressing
- */
-#define PC 0xf
-
-enum opermodes
- {
- literal, indexed, reg, regdef, autodec, autoinc, autoincdef,
- bytedisp, bytedispdef, worddisp, worddispdef, longdisp, longdispdef,
- immediate, absolute, byterel, bytereldef, wordrel, wordreldef,
- longrel, longreldef
- };
-typedef enum opermodes operandenum;
-
-struct modebyte
- {
- unsigned int regfield:4;
- unsigned int modefield:4;
- };