Compare commits

..

2 Commits

Author SHA1 Message Date
Jason Molenda
a0749de2ef 1999-04-26 Jim Blandy <jimb@zwingli.cygnus.com>
Fix from Dave Holcomb.
        * hpux-thread.c (init_hpux_thread_ops): Use the right function
        name when initializing hpux_thread_ops.to_thread_alive.
1999-04-13  Jason Molenda  (jsm@bugshack.cygnus.com)
        * configure.in (HAVE_MULTIPLE_PROC_FDS): Don't define if we're
        on a Solaris host (of any architecture).
        * configure: Regenerated.
1999-05-27 00:11:14 +00:00
nobody
c1d4905c6e This commit was manufactured by cvs2svn to create branch 'gdb-4_18-branch'.
Sprout from master 1999-04-16 01:35:26 UTC Stan Shebs <shebs@codesourcery.com> 'Initial creation of sourceware repository'
Cherrypick from FSF 1999-04-16 01:34:55 UTC Stan Shebs <shebs@codesourcery.com> 'Initial creation of sourceware repository':
    readline/CHANGELOG
    readline/CHANGES
    readline/COPYING
    readline/INSTALL
    readline/MANIFEST
    readline/Makefile.in
    readline/README
    readline/acconfig.h
    readline/aclocal.m4
    readline/ansi_stdlib.h
    readline/bind.c
    readline/callback.c
    readline/chardefs.h
    readline/complete.c
    readline/config.h.in
    readline/configure
    readline/configure.in
    readline/display.c
    readline/doc/Makefile.in
    readline/doc/hist.texinfo
    readline/doc/hstech.texinfo
    readline/doc/hsuser.texinfo
    readline/doc/readline.3
    readline/doc/rlman.texinfo
    readline/doc/rltech.texinfo
    readline/doc/rluser.texinfo
    readline/doc/texi2dvi
    readline/doc/texi2html
    readline/emacs_keymap.c
    readline/examples/Inputrc
    readline/examples/Makefile.in
    readline/examples/fileman.c
    readline/examples/histexamp.c
    readline/examples/manexamp.c
    readline/examples/rl.c
    readline/examples/rltest.c
    readline/funmap.c
    readline/histexpand.c
    readline/histfile.c
    readline/histlib.h
    readline/history.c
    readline/history.h
    readline/histsearch.c
    readline/input.c
    readline/isearch.c
    readline/keymaps.c
    readline/keymaps.h
    readline/kill.c
    readline/macro.c
    readline/nls.c
    readline/parens.c
    readline/posixdir.h
    readline/posixjmp.h
    readline/posixstat.h
    readline/readline.c
    readline/readline.h
    readline/rlconf.h
    readline/rldefs.h
    readline/rltty.c
    readline/rltty.h
    readline/rlwinsize.h
    readline/search.c
    readline/shell.c
    readline/signals.c
    readline/support/config.guess
    readline/support/config.sub
    readline/support/install.sh
    readline/support/mkdirs
    readline/support/mkdist
    readline/tcap.h
    readline/terminal.c
    readline/tilde.c
    readline/tilde.h
    readline/undo.c
    readline/util.c
    readline/vi_keymap.c
    readline/vi_mode.c
    readline/xmalloc.c
Delete:
    gdb/windows-nat.c
1999-04-16 01:35:27 +00:00
1317 changed files with 231960 additions and 154116 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -143,12 +143,6 @@ Thu Dec 11 13:40:46 1997 Andrew Cagney <cagney@b1.cygnus.com>
* dwarf2read.c (dwarf_decode_lines): Change type of address to
CORE_ADDR.
Thu Dec 11 22:39:02 1997 Mark Alexander <marka@cygnus.com>
From change made to branch by Bob Manson <manson@cygnus.com>:
* tic80-tdep.c (tic80_push_arguments): The compiler always
passes structs by reference.
Thu Dec 11 14:28:01 1997 Michael Snyder (msnyder@cleaver.cygnus.com)
* tracepoint.c (trace_find_command): don't error if going
@@ -1022,10 +1016,6 @@ Sat Aug 9 01:50:14 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
Fri Aug 8 21:35:44 1997 Mark Alexander <marka@cygnus.com>
* config/tic80/tic80.mt:
(GDBSERVER-DEPFILES, GDBSERVER_LIBS): Define for gdbserver.
(SIM): Remove -lm to prevent make errors.
* configure.tgt: add gdbserver to configdirs for tic80.
* gdbserver/utils.c (error): Change prototype to match defs.h.
* gdbserver/low-sim.c: Change simulator calls to use new interface.
* remote.c (remote_write_bytes): Include '$' at start of packet
@@ -1161,11 +1151,6 @@ Wed Aug 6 16:15:31 1997 Geoffrey Noer <noer@cygnus.com>
(_initialize_bdm_ppc): new
* config/powerpc/tm-ppc-eabi.h: add necessary CPU32 BDM defines
Tue Aug 5 23:56:14 1997 Mark Alexander <marka@cygnus.com>
* tic80-tdep.c (tic80_init_extra_frame_info): Allow zero
as a valid SP-relative offset of a saved register.
Wed Aug 6 00:24:08 1997 Jeffrey A Law (law@cygnus.com)
* hpread.c (hpread_read_struct_type): Use accessor macros rather
@@ -1669,15 +1654,6 @@ Wed May 14 08:58:55 1997 Jeffrey A Law (law@cygnus.com)
symbols to find the end of the prologue.
* mn10300-tdep.c (mn10300_skip_prologue): Likewise.
Wed May 14 12:04:49 1997 Andrew Cagney <cagney@b1.cygnus.com>
* config/tic80/tm-tic80.h (NUM_REGS): 38 not 37.
Mon May 12 11:35:04 1997 Mark Alexander <marka@cygnus.com>
* tic80-tdep.c, config/tic80/tm-tic80.h: First cut at getting
basic C80 features working.
Thu May 8 08:42:47 1997 Andrew Cagney <cagney@b1.cygnus.com>
* configure.in (AC_TYPE_SIGNAL): Add
@@ -1719,10 +1695,6 @@ Thu May 1 02:28:21 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
* printcmd.c (disassemble_command): Adjust low function bound
by FUNCTION_START_OFFSET.
Wed Apr 30 15:23:02 1997 Andrew Cagney <cagney@b1.cygnus.com>
* config/tic80/tm-tic80.h (BREAKPOINT): Set it to trap 73.
Mon Apr 28 21:25:32 1997 Michael Snyder <msnyder@cleaver.cygnus.com>
* Makefile.in: Add rule for gnu-nat.o and i386gnu-nat.o (Gnu Hurd)
@@ -1790,15 +1762,6 @@ Thu Apr 24 13:31:10 1997 Jeffrey A Law (law@cygnus.com)
* mn10300-tdep.c (mn10300_analyze_prologue): Check for a return
insn at "pc", not "fi->pc".
Thu Apr 24 16:11:47 1997 Andrew Cagney <cagney@b1.cygnus.com>
* config/tic80/tm-tic80.h (NUM_REGS): Four 64bit accumulators.
(REGISTER_BYTE, REGISTER_RAW_SIZE, REGISTER_SIZE,
MAX_REGISTER_RAW_SIZE, REGISTER_VIRTUAL_TYPE): Adjust.
(NPC_REGNUM): Tic80 has a delay slot.
(R0_REGNUM, Rn_REGNUM, An_REGNUM): For sim, provide base/bound for
register blocks.
Wed Apr 23 11:18:45 1997 Jeffrey A Law (law@cygnus.com)
* config/mn10200/tm-mn10200.h (STORE_RETURN_VALUE): Pointers are
@@ -1817,10 +1780,6 @@ Tue Apr 22 11:58:15 1997 Fred Fish <fnf@cygnus.com>
(floatformat_from_doublest): Postswap output words for
the floatformat_littlebyte_bigwords format.
Mon Apr 21 22:44:47 1997 Andrew Cagney <cagney@b1.cygnus.com>
* config/tic80/tic80.mt (SIM): Link in simulator.
Tue Apr 22 09:02:10 1997 Stu Grossman (grossman@critters.cygnus.com)
* config/alpha/alpha-osf3.mh config/i386/{i386gnu linux}.mh
@@ -2143,11 +2102,6 @@ Mon Mar 31 14:55:53 1997 Ian Lance Taylor <ian@cygnus.com>
* configure.in: Generate .gdbinit from gdbinit.in.
* configure: Rebuild.
Sun Mar 30 12:28:24 1997 Fred Fish <fnf@cygnus.com>
* config/tic80/tic80.mt: Disable using the simulator
until it is ready.
Sat Mar 29 13:57:20 1997 Fred Fish <fnf@cygnus.com>
* COPYING: Install new version of file from FSF.
@@ -2157,10 +2111,6 @@ Fri Mar 28 18:33:41 1997 Ian Lance Taylor <ian@cygnus.com>
* Makefile.in (distclean): Remove .gdbinit.
Fri Mar 28 15:37:30 1997 Fred Fish <fnf@cygnus.com>
* config/tic80/tm-tic80.h (NAMES_HAVE_UNDERSCORE): Define.
Fri Mar 28 15:38:04 1997 Mike Meissner <meissner@cygnus.com>
* remote-sim.c (gdb_os_{,e}vprintf_filtered): Change stdarg type
@@ -2217,10 +2167,6 @@ Sat Mar 22 16:41:35 1997 Fred Fish <fnf@cygnus.com>
* remote-sim.c (simulator_command): Add comment about dealing with
NULL or empty args.
* Makefile.in (tic80-tdep.o): Add target.
* configure.tgt: Add tic80 case.
* tic80-tdep.c: New file.
* config/tic80/{tic80.mt, tm-tic80.h}: New files.
Sat Mar 22 02:48:11 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)

View File

@@ -3355,62 +3355,11 @@ Fri Dec 18 14:23:34 1998 Andrew Cagney <cagney@chook>
(mips_push_arguments, mips_push_dummy_frame, mips_pop_frame,
mips_extract_return_value): Update.
Fri Dec 18 12:56:56 1998 Andrew Cagney <cagney@chook>
* gdbarch.h (gdbarch_init_ftype): Pass struct gdbarch_info
by-value.
(struct gdbarch_info): Add struct gdbarch_tdep_info *tdep_info.
* gdbarch.c (gdbarch_update): Update.
* gdbarch.c (gdbarch_update): Add more tracing.
Thu Dec 17 02:15:40 1998 Andrew Cagney <cagney@chook.cygnus.com>
* configure.tgt (gdb_target): Identify mips64*vr4100*-*-elf* as
vr4100.
Thu Dec 17 02:01:58 1998 Andrew Cagney <cagney@chook>
* gdbtypes.c (_initialize_gdbtypes): Register all builtin types
with gdbarch so that they are updated whenever the architecture is
changed.
Thu Dec 17 01:58:16 1998 Andrew Cagney <cagney@chook>
* gdbarch.h (GDB_MULTI_ARCH): New macro, default to zero.
(current_gdbarch): Current architecture pointer.
* gdbarch.c (struct gdbarch): Define.
* gdbarch.h (TARGET_ARCHITECTURE, TARGET_BYTE_ORDER,
TARGET_LONG_BIT, TARGET_LONG_LONG_BIT, TARGET_PTR_BIT): When
multi-arch force definition.
* gdbarch.h, gdbarch.c (gdbarch_tdep, gdbarch_bfd_arch_info,
gdbarch_byte_order, {set,}gdbarch_long_bit,
{set,}gdbarch_long_long_bit, {set,}gdbarch_ptr_bit): Corresponding
functions.
* gdbarch.h (struct gdbarch_list, struct gdbarch_info,
gdbarch_init_ftype), gdbarch.c (register_gdbarch_init): Mechanism
for registering an architecture with GDB.
(gdbarch_list_lookup_by_info, gdbarch_alloc, gdbarch_update,
verify_gdbarch): Support functions.
* gdbarch.h (gdbarch_data_ftype), gdbarch.c
(register_gdbarch_data, gdbarch_data): Mechanism for maintaining
per-architecture pointers.
(init_gdbarch_data): Support functions.
* gdbarch.h (gdbarch_swap_ftype), gdbarch.c
(register_gdbarch_swap): Ditto for swapped memory regions.
(init_gdbarch_swap, swapout_gdbarch_swap, swapin_gdbarch_swap):
Support functions.
* gdbarch.c (set_endian_big, set_endian_little, set_architecture,
info_architecture, set_gdbarch_from_file): Hook in multi-arch
code by calling gdbarch_update.
(default_gdbarch): Default multi-arch vector. Use host's type
system for values.
Thu Dec 17 01:34:36 1998 Andrew Cagney <cagney@chook>
* gdbtypes.c (build_gdbtypes): New function.
@@ -4453,11 +4402,6 @@ Thu Oct 8 08:40:42 1998 Mark Alexander <marka@cygnus.com>
* rs6000-tdep.c (get_saved_register): Define only if
USE_GENERIC_DUMMY_FRAMES is defined.
Tue Oct 6 21:35:10 1998 Andrew Cagney <cagney@b1.cygnus.com>
* Makefile.in (DEPFILES): Add TARGET_OBS.
(TARGET_OBS): Defined by configure.
1998-10-06 Jason Molenda (jsm@bugshack.cygnus.com)
Eliminate a few warnings from the compiler.
@@ -5774,13 +5718,6 @@ Wed Apr 29 14:02:59 1998 David Taylor <taylor@texas.cygnus.com>
Wed Apr 29 10:20:40 1998 John Metzler <jmetzler@cygnus.com>
* nec4102rom.c: New file implements ROM monitor adapter for
nec-vr4102 board. This board hosts the vr4111 chip. This file
required extensions to the monitor_ops structure, hooks for wait
filter, new flags. This version does not support more than one
breakpoint and resuming after a breakpoint in 16 bit mode is
completely disfunctional.
* monitor.h: Defined additional hooks for dmpregs, configure_hooks
and wait_filter. These additions require that all ROM monitor
interfaces be recoded to initialize monitor ops using assignments
@@ -6544,9 +6481,6 @@ Wed Mar 4 01:39:08 1998 Ron Unrau <runrau@cygnus.com>
Tue Mar 3 17:19:08 1998 John Metzler <jmetzler@cygnus.com>
* config/mips/tm-vr4xxx.h: implements vr4111 as separate from 4300
* config/mips/vr4xxx.tm: implements vr4111 as separate from 4300
* configure.tgt: Recognise mips64vr4111-*-elf as vr4xxx
* dwarfread.c (read_tag_pointer_type): Pointer sizes now come from
TARGET_PTR_BIT rather from sizeof(char *) on host.

View File

@@ -1,39 +0,0 @@
hp testsuite (gdb.hp) Jimmy Guo adl-debugger-wdb-merge-guru@cup.hp.com
d10v target Andrew Cagney cagney@cygnus.com
d30v target Andrew Cagney cagney@cygnus.com
mips target Andrew Cagney cagney@cygnus.com
mn10300 target Andrew Cagney cagney@cygnus.com
generic arch support Andrew Cagney cagney@cygnus.com
target vector Andrew Cagney cagney@cygnus.com
remote.c Andrew Cagney cagney@cygnus.com
djgpp native DJ Delorie dj@cygnus.com
win32 host & native Chris Faylor cgf@cygnus.com
main (main.c, top.c) Elena Zannoni ezannoni@cygnus.com
readline Elena Zannoni ezannoni@cygnus.com
arm target Elena Zannoni ezannoni@cygnus.com
powerpc target Elena Zannoni ezannoni@cygnus.com
command interpreter Fernando Nasser fnasser@cygnus.com
generic symtabs Jim Blandy jimb@cygnus.com
dwarf readers Jim Blandy jimb@cygnus.com
elf reader Jim Blandy jimb@cygnus.com
stabs reader Jim Blandy jimb@cygnus.com
x86 linux native Jim Blandy jimb@cygnus.com
Scheme support Jim Blandy jimb@cygnus.com
svr4 shlibs (solib.c) Jim Blandy jimb@cygnus.com
hurd native Mark Kettenis kettenis@wins.va.nl
hpux, hp pa native Jeff Law law@cygnus.com
m32r target Michael Snyder msnyder@cygnus.com
tracing Michael Snyder msnyder@cygnus.com
threads Michael Snyder msnyder@cygnus.com
breakpoint.c Michael Snyder msnyder@cygnus.com
coff reader Philippe De Muyter phdm@macqel.be
macos host & native Stan Shebs shebs@cygnus.com
sds protocol Stan Shebs shebs@cygnus.com
rdi/adp protocol Stan Shebs shebs@cygnus.com
gdbserver Stan Shebs shebs@cygnus.com
documentation Stan Shebs shebs@cygnus.com
testsuite Stan Shebs shebs@cygnus.com
language support David Taylor taylor@cygnus.com
expression eval David Taylor taylor@cygnus.com
defs.h David Taylor taylor@cygnus.com
utils.c David Taylor taylor@cygnus.com

View File

@@ -1,4 +1,4 @@
# Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999
# Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998
# Free Software Foundation, Inc.
# This file is part of GDB.
@@ -39,7 +39,6 @@ man7dir = $(mandir)/man7
man8dir = $(mandir)/man8
man9dir = $(mandir)/man9
infodir = @infodir@
htmldir = $(prefix)/html
includedir = @includedir@
# This can be referenced by `INTLDEPS' as computed by CY_GNU_GETTEXT.
@@ -48,8 +47,6 @@ top_builddir = .
SHELL = @SHELL@
EXEEXT = @EXEEXT@
AWK = @AWK@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
@@ -90,10 +87,6 @@ YLWRAP = $(srcdir)/../ylwrap
# where to find makeinfo, preferably one designed for texinfo-2
MAKEINFO=makeinfo
MAKEHTML = texi2html
MAKEHTMLFLAGS = -glossary -menu -split_chapter
# Set this up with gcc if you have gnu ld and the loader will print out
# line numbers for undefined references.
#CC_LD=gcc -static
@@ -153,8 +146,6 @@ OPCODES_CFLAGS = -I$(OP_INCLUDE)
# should set this to list all the .o or .a files to be linked in.
SIM =
WIN32LIBS = @WIN32LIBS@
ENABLE_CFLAGS= @ENABLE_CFLAGS@
@@ -224,7 +215,7 @@ CDEPS = $(XM_CDEPS) $(TM_CDEPS) $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE) \
ADD_FILES = $(REGEX) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES)
ADD_DEPS = $(REGEX1) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES)
VERSION = 19990823
VERSION=4.18
DIST=gdb
LINT=/usr/5bin/lint
@@ -242,7 +233,7 @@ RUNTESTFLAGS=
# part of libiberty) a POSIX interface. But at least for now the
# host-dependent makefile fragment might need to use something else
# besides ser-unix.o
SER_HARDWIRE = ser-unix.o ser-pipe.o
SER_HARDWIRE = ser-unix.o
# The `remote' debugging target is supported for most architectures,
# but not all (e.g. 960)
@@ -258,13 +249,6 @@ ANNOTATE_OBS = annotate.o
@target_makefile_frag@
# End of host and target-dependent makefile fragments
# Possibly ignore the simulator. If the simulator is being ignored,
# these expand into SIM= and SIM_OBJ=, overriding the entries from
# target_makefile_frag
#
@IGNORE_SIM@
@IGNORE_SIM_OBS@
FLAGS_TO_PASS = \
"prefix=$(prefix)" \
"exec_prefix=$(exec_prefix)" \
@@ -281,8 +265,6 @@ FLAGS_TO_PASS = \
"DLLTOOL=$(DLLTOOL)" \
"RANLIB=$(RANLIB)" \
"MAKEINFO=$(MAKEINFO)" \
"MAKEHTML=$(MAKEHTML)" \
"MAKEHTMLFLAGS=$(MAKEHTMLFLAGS)" \
"INSTALL=$(INSTALL)" \
"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
"INSTALL_DATA=$(INSTALL_DATA)" \
@@ -365,7 +347,6 @@ TARGET_FLAGS_TO_PASS = \
"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
"INSTALL_DATA=$(INSTALL_DATA)" \
"MAKEINFO=$(MAKEINFO)" \
"MAKEHTML=$(MAKEHTML)" \
"RUNTEST=$(RUNTEST)" \
"RUNTESTFLAGS=$(RUNTESTFLAGS)"
@@ -378,10 +359,8 @@ SFILES = ax-general.c ax-gdb.c bcache.c blockframe.c breakpoint.c \
ch-exp.c ch-lang.c ch-typeprint.c ch-valprint.c coffread.c \
command.c complaints.c corefile.c cp-valprint.c dbxread.c \
demangle.c dwarfread.c dwarf2read.c elfread.c environ.c eval.c \
event-loop.c event-top.c \
expprint.c f-exp.y f-lang.c f-typeprint.c f-valprint.c \
findvar.c gdbarch.c gdbtypes.c infcmd.c inflow.c infrun.c language.c \
kod.c kod-cisco.c \
jv-exp.y jv-lang.c jv-valprint.c jv-typeprint.c \
m2-exp.y m2-lang.c m2-typeprint.c m2-valprint.c main.c maint.c \
mem-break.c minsyms.c mipsread.c nlmread.c objfiles.c parse.c \
@@ -445,11 +424,9 @@ gdbcmd_h = gdbcmd.h $(command_h)
defs_h = defs.h xm.h tm.h nm.h config.status config.h gdbarch.h
top_h = top.h
inferior_h = inferior.h $(breakpoint_h)
tracepoint_h = tracepoint.h
ax_h = ax.h
event_loop_h = event-loop.h
# Header files that need to have srcdir added. Note that in the cases
# where we use a macro like $(gdbcmd_h), things are carefully arranged
@@ -505,11 +482,8 @@ TAGFILES_WITH_SRCDIR = $(HFILES_WITH_SRCDIR)
COMMON_OBS = version.o blockframe.o breakpoint.o findvar.o stack.o thread.o \
source.o values.o eval.o valops.o valarith.o valprint.o printcmd.o \
symtab.o symfile.o symmisc.o infcmd.o infrun.o command.o \
expprint.o environ.o \
event-loop.o event-top.o \
gdbarch.o gdbtypes.o copying.o $(DEPFILES) \
expprint.o environ.o gdbarch.o gdbtypes.o copying.o $(DEPFILES) \
mem-break.o target.o parse.o language.o $(YYOBJ) buildsym.o \
kod.o kod-cisco.o \
exec.o bcache.o objfiles.o minsyms.o maint.o demangle.o \
dbxread.o coffread.o elfread.o \
dwarfread.o dwarf2read.o mipsread.o stabsread.o corefile.o \
@@ -531,7 +505,9 @@ NTSOBS = standalone.o
NTSSTART = kdb-start.o
SUBDIRS = @SUBDIRS@
SUBDIRS = doc \
testsuite \
nlm
# For now, shortcut the "configure GDB for fewer languages" stuff.
YYFILES = c-exp.tab.c \
@@ -565,7 +541,7 @@ check: force
$(MAKE) $(TARGET_FLAGS_TO_PASS) check; \
else true; fi
info dvi install-info clean-info html install-html: force
info dvi install-info clean-info: force
@$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
gdb.z:gdb.1
@@ -943,7 +919,7 @@ ALLDEPFILES = 29k-share/udi/udip2soc.c 29k-share/udi/udr.c \
convex-tdep.c convex-xdep.c \
core-sol2.c core-regset.c core-aout.c corelow.c \
dcache.c delta68-nat.c dpx2-nat.c dstread.c exec.c fork-child.c \
gould-tdep.c gould-xdep.c h8300-tdep.c h8500-tdep.c \
go32-xdep.c gould-tdep.c gould-xdep.c h8300-tdep.c h8500-tdep.c \
hp300ux-nat.c hppa-tdep.c hppab-nat.c hppah-nat.c \
hp-psymtab-read.c hp-symtab-read.c \
i386-tdep.c i386b-nat.c i386mach-nat.c i386v-nat.c \
@@ -953,9 +929,7 @@ ALLDEPFILES = 29k-share/udi/udip2soc.c 29k-share/udi/udr.c \
infptrace.c inftarg.c irix4-nat.c irix5-nat.c isi-xdep.c \
lynx-nat.c m3-nat.c \
m68k-tdep.c \
m88k-nat.c m88k-tdep.c mac-nat.c \
mcore-tdep.c \
mips-nat.c \
m88k-nat.c m88k-tdep.c mac-nat.c mips-nat.c \
mips-tdep.c mipsm3-nat.c mipsv4-nat.c news-xdep.c \
nindy-share/Onindy.c nindy-share/nindy.c \
nindy-share/ttyflush.c nindy-tdep.c \
@@ -968,8 +942,7 @@ ALLDEPFILES = 29k-share/udi/udip2soc.c 29k-share/udi/udr.c \
remote-st.c remote-utils.c dcache.c \
remote-udi.c remote-vx.c remote-vx29k.c \
rs6000-nat.c rs6000-tdep.c \
ser-go32.c ser-pipe.c ser-ocd.c ser-tcp.c \
sh-tdep.c solib.c sparc-nat.c \
ser-go32.c ser-ocd.c ser-tcp.c sh-tdep.c solib.c sparc-nat.c \
sparc-tdep.c sparcl-tdep.c sun3-nat.c sun386-nat.c \
symm-tdep.c symm-nat.c \
tahoe-tdep.c ultra3-nat.c ultra3-xdep.c umax-xdep.c \
@@ -996,7 +969,7 @@ alpha-nat.o: alpha-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) target.h
alpha-tdep.o: alpha-tdep.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) \
$(inferior_h) $(symtab_h) $(dis-asm.h) gdb_string.h
# OBSOLETE altos-xdep.o: altos-xdep.c $(defs_h) $(gdbcore_h) $(inferior_h)
altos-xdep.o: altos-xdep.c $(defs_h) $(gdbcore_h) $(inferior_h)
annotate.o: annotate.c $(defs_h) annotate.h $(value_h) target.h $(gdbtypes_h)
@@ -1058,11 +1031,11 @@ command.o: command.c $(defs_h) $(expression_h) $(gdbcmd_h) \
complaints.o: complaints.c complaints.h $(defs_h) $(gdbcmd_h)
# OBSOLETE convex-tdep.o: convex-tdep.c $(wait_h) $(defs_h) $(gdbcmd_h) \
# OBSOLETE $(gdbcore_h) $(inferior_h)
convex-tdep.o: convex-tdep.c $(wait_h) $(defs_h) $(gdbcmd_h) \
$(gdbcore_h) $(inferior_h)
# OBSOLETE convex-xdep.o: convex-xdep.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) \
# OBSOLETE $(inferior_h)
convex-xdep.o: convex-xdep.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) \
$(inferior_h)
copying.o: copying.c $(defs_h) $(gdbcmd_h)
@@ -1119,11 +1092,6 @@ eval.o: eval.c $(bfd_h) $(defs_h) $(expression_h) $(frame_h) \
$(gdbtypes_h) language.h $(symtab_h) target.h $(value_h) \
gdb_string.h
event-loop.o: event-loop.c $(defs_h) $(top_h) $(event_loop_h)
event-top.o: event-top.c top.h $(readline_headers) \
$(defs_h) $(inferior_h) $(event_loop_h) terminal.h
exec.o: exec.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) $(inferior_h) \
target.h language.h gdb_string.h
@@ -1149,6 +1117,8 @@ gdbtypes.o: gdbtypes.c $(bfd_h) complaints.h $(defs_h) $(expression_h) \
gnu-nat.o: process_reply_S.h exc_request_S.h notify_S.h msg_reply_S.h \
exc_request_U.h msg_U.h gnu-nat.h
go32-xdep.o: go32-xdep.c
# OBSOLETE gould-tdep.o: gould-tdep.c $(OP_INCLUDE)/np1.h $(defs_h) $(frame_h) \
# OBSOLETE $(gdbcore_h) $(symtab_h)
@@ -1208,7 +1178,7 @@ infptrace.o: infptrace.c $(defs_h) $(gdbcore_h) $(inferior_h) target.h \
gdb_string.h $(wait_h) $(command_h)
infrun.o: infrun.c $(wait_h) $(defs_h) $(gdbcmd_h) $(gdbcore_h) \
$(inferior_h) target.h gdbthread.h gdb_string.h $(event_loop_h)
$(inferior_h) target.h gdbthread.h gdb_string.h
inftarg.o: inftarg.c $(wait_h) $(defs_h) $(gdbcore_h) $(inferior_h) \
target.h terminal.h $(command_h)
@@ -1226,15 +1196,11 @@ jv-lang.o: jv-lang.c $(bfd_h) $(defs_h) $(symtab_h) $(gdbtypes_h) \
jv-typeprint.o: jv-typeprint.c $(bfd_h) $(defs_h) $(symtab_h) $(gdbtypes_h) \
$(value_h) $(INCLUDE_DIR)/demangle.h jv-lang.h gdb_string.h \
typeprint.h c-lang.h
typeprint.h
jv-valprint.o: jv-valprint.c $(bfd_h) $(defs_h) $(symtab_h) $(gdbtypes_h) \
$(expression_h) $(value_h) $(INCLUDE_DIR)/demangle.h valprint.h \
language.h jv-lang.h c-lang.h gdbcore.h annotate.h
kod.o: kod.c $(defs_h) $(command_h) $(gdbcmd_h) target.h gdb_string.h
kod-cisco.o: kod-cisco.c $(defs_h) gdb_string.h
language.h jv-lang.h c-lang.h
language.o: language.c $(bfd_h) $(defs_h) $(expression_h) $(frame_h) \
$(gdbcmd_h) $(gdbtypes_h) language.h parser-defs.h $(symtab_h) \
@@ -1270,16 +1236,11 @@ m88k-tdep.o: m88k-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h)
mac-nat.o: mac-nat.c $(defs_h) gdb_string.h
main.o: main.c top.h $(defs_h) gdb_string.h $(event_loop_h)
main.o: main.c top.h $(defs_h) gdb_string.h
maint.o: maint.c $(defs_h) $(gdbcmd_h) $(gdbtypes_h) $(symtab_h) language.h \
$(expression_h) objfiles.h symfile.h
mcore-tdep.o: mcore-tdep.c $(defs_h) $(frame_h) $(gdbcmd_h) $(value_h) $(symtab_h)
mcore-rom.o: mcore-rom.c $(defs_h) $(gdbcore_h) target.h monitor.h \
gdb_string.h
mdebugread.o: mdebugread.c buildsym.h complaints.h $(bfd_h) $(defs_h) \
$(expression_h) gdb-stabs.h $(gdbcore_h) $(gdbtypes_h) language.h \
objfiles.h partial-stab.h stabsread.h symfile.h $(symtab_h) \
@@ -1336,7 +1297,7 @@ nindy-tdep.o: nindy-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(gdbcore_h)
ns32k-tdep.o: ns32k-tdep.c $(bfd_h) $(dis-asm_h) $(defs_h)
objfiles.o: objfiles.c $(bfd_h) $(defs_h) objfiles.h symfile.h \
$(symtab_h) gdb_string.h $(breakpoint_h)
$(symtab_h) gdb_string.h
osfsolib.o: osfsolib.c $(command_h) $(defs_h) $(gdbcore_h) $(inferior_h) \
objfiles.h gnu-regex.h symfile.h target.h language.h gdb_string.h
@@ -1346,9 +1307,6 @@ somread.o: somread.c $(bfd_h) buildsym.h complaints.h $(defs_h) \
somsolib.o: somsolib.c $(defs_h)
pa64solib.o: pa64solib.c $(defs_h)
hpux-thread.o: hpux-thread.c $(defs_h) gdbthread.h target.h inferior.h
hpux-thread.o: hpux-thread.c $(defs_h) gdbthread.h target.h inferior.h
$(CC) -c $(INTERNAL_CFLAGS) -I$(srcdir)/osf-share \
-I$(srcdir)/osf-share/HP800 -I/usr/include/dce $(srcdir)/hpux-thread.c
@@ -1382,9 +1340,9 @@ printcmd.o: printcmd.c $(breakpoint_h) $(defs_h) $(expression_h) \
procfs.o: procfs.c $(command_h) $(defs_h) $(gdbcore_h) $(inferior_h) \
target.h gdb_string.h
# OBSOLETE pyr-tdep.o: pyr-tdep.c $(defs_h)
pyr-tdep.o: pyr-tdep.c $(defs_h)
# OBSOLETE pyr-xdep.o: pyr-xdep.c $(defs_h) $(gdbcore_h) $(inferior_h)
pyr-xdep.o: pyr-xdep.c $(defs_h) $(gdbcore_h) $(inferior_h)
gnu-regex.o: gnu-regex.c gnu-regex.h $(defs_h) gdb_string.h
@@ -1476,8 +1434,7 @@ remote-utils.o: remote-utils.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) \
$(inferior_h) $(remote_utils_h) gdb_string.h
remote.o: remote.c $(bfd_h) $(wait_h) $(defs_h) $(gdbcmd_h) \
$(inferior_h) $(remote_utils_h) symfile.h terminal.h gdb_string.h \
$(event_loop_h)
$(inferior_h) $(remote_utils_h) symfile.h terminal.h gdb_string.h
remote-nrom.o: remote-nrom.c $(bfd_h) $(wait_h) $(defs_h) $(gdbcmd_h) \
$(inferior_h) $(remote_utils_h) symfile.h terminal.h
@@ -1506,8 +1463,6 @@ ser-mac.o: ser-mac.c $(defs_h) serial.h signals.h
ser-ocd.o: ser-ocd.c $(defs_h) serial.h signals.h gdb_string.h
ser-pipe.o: ser-pipe.c $(defs_h) serial.h signals.h gdb_string.h
ser-tcp.o: ser-tcp.c $(defs_h) serial.h signals.h gdb_string.h
ser-unix.o: ser-unix.c $(defs_h) serial.h
@@ -1549,7 +1504,7 @@ stabsread.o: stabsread.c $(bfd_h) $(INCLUDE_DIR)/aout/stab.def \
stack.o: stack.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) $(inferior_h) \
language.h target.h gdb_string.h
ax-general.o: ax-general.c $(ax_h) $(defs_h) $(value_h)
ax-general.o: ax-general.c $(ax_h) $(defs_h)
ax-gdb.o: ax-gdb.c $(defs_h) $(symtab_h) symfile.h $(gdbtypes_h) \
$(value_h) $(expression_h) $(command_h) $(ax_h) $(gdbcmd_h) ax-gdb.h
@@ -1578,16 +1533,14 @@ symtab.o: symtab.c call-cmds.h $(defs_h) $(expression_h) $(frame_h) \
tahoe-tdep.o: tahoe-tdep.c $(OP_INCLUDE)/tahoe.h $(defs_h) \
$(symtab_h)
tic80-tdep.o: tic80-tdep.c $(defs_h)
target.o: target.c $(bfd_h) $(defs_h) $(gdbcmd_h) $(inferior_h) \
objfiles.h symfile.h target.h gdb_string.h
thread.o: thread.c $(defs_h) gdbthread.h $(gdbcmd_h) target.h
thread.o: thread.c $(defs_h) gdbthread.h $(gdbcmd_h)
top.o: top.c top.h $(bfd_h) $(getopt_h) $(readline_headers) call-cmds.h \
$(defs_h) $(gdbcmd_h) $(inferior_h) language.h signals.h \
$(remote_utils_h) gdb_string.h $(event_loop_h)
$(remote_utils_h) gdb_string.h
typeprint.o: typeprint.c $(defs_h) $(expression_h) $(gdbcmd_h) \
$(gdbcore_h) $(gdbtypes_h) language.h $(symtab_h) target.h \
@@ -1663,5 +1616,4 @@ m2-exp.tab.o: m2-exp.tab.c $(defs_h) $(expression_h) $(gdbtypes_h) \
language.h m2-lang.h parser-defs.h $(symtab_h) $(value_h) \
$(bfd_h) objfiles.h symfile.h
### end of the gdb Makefile.in.

View File

@@ -1,46 +1,6 @@
What has changed in GDB?
(Organized release by release)
*** Changes since GDB-4.18:
* New targets
Motorola MCore mcore-*-*
x86 VxWorks i[3456]86-*-vxworks*
PowerPC VxWorks powerpc-*-vxworks*
TI TMS320C80 tic80-*-*
* OBSOLETE configurations
Altos 3068 m68*-altos-*
Convex c1-*-*, c2-*-*
Pyramid pyramid-*-*
* Remote targets can connect to a sub-program
A popen(3) style serial-device has been added. This device starts a
sub-process (such as a stand-alone simulator) and then communicates
with that. The sub-program to run is specified using the syntax
``|<program> <args>'' vis:
(gdb) set remotedebug 1
(gdb) target extended-remote |mn10300-elf-sim program-args
* MIPS 64 remote protocol
A long standing bug in the mips64 remote protocol where by GDB
expected certain 32 bit registers (ex SR) to be transfered as 32
instead of 64 bits has been fixed.
The command ``set remote-mips64-transfers-32bit-regs on'' has been
added to provide backward compatibility with older versions of GDB.
* ``set remotebinarydownload'' replaced by ``set remote X-packet''
The command ``set remotebinarydownload'' command has been replaced by
``set remote X-packet''. Other commands in ``set remote'' family
include ``set remote P-packet''.
*** Changes in GDB-4.18:
* New native configurations

View File

@@ -4,8 +4,8 @@
This is GDB, the GNU source-level debugger.
A summary of new features is in the file `NEWS'.
See the GDB home page at http://sourceware.cygnus.com/gdb/ for up to
date release information, mailing list links and archives, etc.
See the GDB home page at http://www.cygnus.com/gdb/ for up to date
release information, mailing list links and archives, etc.
Unpacking and Installation -- quick overview
@@ -152,8 +152,6 @@ directory. That directory contains:
`gdb-4.18/readline'
source for the GNU command-line interface
NOTE: The readline library is compiled for use by GDB, but will
not be installed on your system when "make install" is issued.
`gdb-4.18/sim'
source for some simulators (ARM, D10V, SPARC, M32R, MIPS, PPC, V850, etc)

View File

@@ -9,20 +9,6 @@ General To Do List
This list is probably not up to date, and opinions vary about the
importance or even desirability of some of the items.
Document trace machinery.
Document overlay machinery.
Extend .gdbinit mechanism to specify name on command line, allow for
lists of files to load, include function of --tclcommand.
@c This does not work (yet if ever). FIXME.
@c @item --parse=@var{lang} @dots{}
@c Configure the @value{GDBN} expression parser to parse the listed languages.
@c @samp{all} configures @value{GDBN} for all supported languages. To get a
@c list of all supported languages, omit the argument. Without this
@c option, @value{GDBN} is configured to parse all supported languages.
Add an "info bfd" command that displays supported object formats,
similarly to objdump -i.
@@ -396,6 +382,9 @@ Why do we allow a target to omit standard register names (NO_STD_REGS
in tm-z8k.h)? I thought the standard register names were supposed to
be just that, standard.
Make DEBUG_EXPRESSIONS a maintenance command, dependent on
MAINTENANCE_COMMANDS.
Allow core file without exec file on RS/6000.
Make sure "shell" with no arguments works right on DOS.
@@ -477,9 +466,6 @@ Add a command for searching memory, a la adb. It specifies size,
mask, value, start address. ADB searches until it finds it or hits
an error (or is interrupted).
Remove the range and type checking code and documentation, if not
going to implement.
# Local Variables:
# mode: text
# End:

View File

@@ -3,22 +3,21 @@
Free Software Foundation, Inc.
Contributed by Cygnus Support. Written by Jim Kingdon.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "gdbcore.h"
@@ -60,10 +59,10 @@ struct prologue_info
{
CORE_ADDR pc; /* First addr after fn prologue */
unsigned rsize, msize; /* register stack frame size, mem stack ditto */
unsigned mfp_used:1; /* memory frame pointer used */
unsigned rsize_valid:1; /* Validity bits for the above */
unsigned msize_valid:1;
unsigned mfp_valid:1;
unsigned mfp_used : 1; /* memory frame pointer used */
unsigned rsize_valid : 1; /* Validity bits for the above */
unsigned msize_valid : 1;
unsigned mfp_valid : 1;
};
/* Examine the prologue of a function which starts at PC. Return
@@ -95,7 +94,7 @@ examine_prologue (pc, rsize, msize, mfp_used)
struct prologue_info *mi = 0;
if (msymbol != NULL)
mi = (struct prologue_info *) msymbol->info;
mi = (struct prologue_info *) msymbol -> info;
if (mi != 0)
{
@@ -125,21 +124,21 @@ examine_prologue (pc, rsize, msize, mfp_used)
*msize = 0;
if (mfp_used != NULL)
*mfp_used = 0;
/* Prologue must start with subtracting a constant from gr1.
Normally this is sub gr1,gr1,<rsize * 4>. */
insn = read_memory_integer (p, 4);
if ((insn & 0xffffff00) != 0x25010100)
{
/* If the frame is large, instead of a single instruction it
might be a pair of instructions:
const <reg>, <rsize * 4>
sub gr1,gr1,<reg>
*/
might be a pair of instructions:
const <reg>, <rsize * 4>
sub gr1,gr1,<reg>
*/
int reg;
/* Possible value for rsize. */
unsigned int rsize0;
if ((insn & 0xff000000) != 0x03000000)
{
p = pc;
@@ -173,7 +172,7 @@ examine_prologue (pc, rsize, msize, mfp_used)
* way down.
*/
insn = read_memory_integer (p, 4);
if ((insn & 0xff00ffff) == (0x5e000100 | RAB_HW_REGNUM))
if ((insn & 0xff00ffff) == (0x5e000100|RAB_HW_REGNUM))
{
p += 4;
}
@@ -192,9 +191,9 @@ examine_prologue (pc, rsize, msize, mfp_used)
else
{
/* However, for large frames it can be
const <reg>, <size *4>
add lr1,gr1,<reg>
*/
const <reg>, <size *4>
add lr1,gr1,<reg>
*/
int reg;
CORE_ADDR q;
@@ -222,8 +221,8 @@ examine_prologue (pc, rsize, msize, mfp_used)
to be looking for a "sub" instruction here, but the mask was set
up to lose all the time. */
insn = read_memory_integer (p, 4);
if (((insn & 0xff80ffff) == (0x15800000 | (MSP_HW_REGNUM << 8))) /* add */
|| ((insn & 0xff80ffff) == (0x81800000 | (MSP_HW_REGNUM << 8)))) /* sll */
if (((insn & 0xff80ffff) == (0x15800000|(MSP_HW_REGNUM<<8))) /* add */
|| ((insn & 0xff80ffff) == (0x81800000|(MSP_HW_REGNUM<<8)))) /* sll */
{
p += 4;
if (mfp_used != NULL)
@@ -239,24 +238,24 @@ examine_prologue (pc, rsize, msize, mfp_used)
Normally this is just
sub msp,msp,<msize>
*/
*/
insn = read_memory_integer (p, 4);
if ((insn & 0xffffff00) ==
(0x25000000 | (MSP_HW_REGNUM << 16) | (MSP_HW_REGNUM << 8)))
if ((insn & 0xffffff00) ==
(0x25000000|(MSP_HW_REGNUM<<16)|(MSP_HW_REGNUM<<8)))
{
p += 4;
if (msize != NULL)
if (msize != NULL)
*msize = insn & 0xff;
}
else
{
/* For large frames, instead of a single instruction it might
be
be
const <reg>, <msize>
consth <reg>, <msize> ; optional
sub msp,msp,<reg>
*/
const <reg>, <msize>
consth <reg>, <msize> ; optional
sub msp,msp,<reg>
*/
int reg;
unsigned msize0;
CORE_ADDR q = p;
@@ -277,8 +276,8 @@ examine_prologue (pc, rsize, msize, mfp_used)
insn = read_memory_integer (q, 4);
}
/* Check for sub msp,msp,<reg>. */
if ((insn & 0xffffff00) ==
(0x24000000 | (MSP_HW_REGNUM << 16) | (MSP_HW_REGNUM << 8))
if ((insn & 0xffffff00) ==
(0x24000000|(MSP_HW_REGNUM<<16)|(MSP_HW_REGNUM<<8))
&& (insn & 0xff) == reg)
{
p = q + 4;
@@ -296,19 +295,19 @@ examine_prologue (pc, rsize, msize, mfp_used)
* way down after everything else.
*/
insn = read_memory_integer (p, 4);
if ((insn & 0xff00ffff) == (0x5e000100 | RAB_HW_REGNUM))
if ((insn & 0xff00ffff) == (0x5e000100|RAB_HW_REGNUM))
{
p += 4;
}
done:
done:
if (msymbol != NULL)
{
if (mi == 0)
{
/* Add a new cache entry. */
mi = (struct prologue_info *) xmalloc (sizeof (struct prologue_info));
msymbol->info = (char *) mi;
mi = (struct prologue_info *)xmalloc (sizeof (struct prologue_info));
msymbol -> info = (char *)mi;
mi->rsize_valid = 0;
mi->msize_valid = 0;
mi->mfp_valid = 0;
@@ -338,7 +337,7 @@ done:
to reach some "real" code. */
CORE_ADDR
a29k_skip_prologue (pc)
skip_prologue (pc)
CORE_ADDR pc;
{
return examine_prologue (pc, NULL, NULL, NULL);
@@ -354,7 +353,7 @@ a29k_skip_prologue (pc)
* msize is return in bytes.
*/
static int /* 0/1 - failure/success of finding the tag word */
static int /* 0/1 - failure/success of finding the tag word */
examine_tag (p, is_trans, argcount, msize, mfp_used)
CORE_ADDR p;
int *is_trans;
@@ -367,20 +366,19 @@ examine_tag (p, is_trans, argcount, msize, mfp_used)
tag1 = read_memory_integer (p, 4);
if ((tag1 & TAGWORD_ZERO_MASK) != 0) /* Not a tag word */
return 0;
if (tag1 & (1 << 23)) /* A two word tag */
if (tag1 & (1<<23)) /* A two word tag */
{
tag2 = read_memory_integer (p - 4, 4);
if (msize)
*msize = tag2 * 2;
tag2 = read_memory_integer (p-4, 4);
if (msize)
*msize = tag2 * 2;
}
else
/* A one word tag */
else /* A one word tag */
{
if (msize)
*msize = tag1 & 0x7ff;
if (msize)
*msize = tag1 & 0x7ff;
}
if (is_trans)
*is_trans = ((tag1 & (1 << 21)) ? 1 : 0);
*is_trans = ((tag1 & (1<<21)) ? 1 : 0);
/* Note that this includes the frame pointer and the return address
register, so the actual number of registers of arguments is two less.
argcount can be zero, however, sometimes, for strange assembler
@@ -388,7 +386,7 @@ examine_tag (p, is_trans, argcount, msize, mfp_used)
if (argcount)
*argcount = (tag1 >> 16) & 0x1f;
if (mfp_used)
*mfp_used = ((tag1 & (1 << 22)) ? 1 : 0);
*mfp_used = ((tag1 & (1<<22)) ? 1 : 0);
return 1;
}
@@ -415,8 +413,8 @@ init_frame_info (innermost_frame, frame)
frame->frame = read_register (GR1_REGNUM);
else
frame->frame = frame->next->frame + frame->next->rsize;
#if 0 /* CALL_DUMMY_LOCATION == ON_STACK */
#if 0 /* CALL_DUMMY_LOCATION == ON_STACK */
This wont work;
#else
if (PC_IN_CALL_DUMMY (p, 0, 0))
@@ -424,35 +422,34 @@ init_frame_info (innermost_frame, frame)
{
frame->rsize = DUMMY_FRAME_RSIZE;
/* This doesn't matter since we never try to get locals or args
from a dummy frame. */
from a dummy frame. */
frame->msize = 0;
/* Dummy frames always use a memory frame pointer. */
frame->saved_msp =
frame->saved_msp =
read_register_stack_integer (frame->frame + DUMMY_FRAME_RSIZE - 4, 4);
frame->flags |= (TRANSPARENT_FRAME | MFP_USED);
frame->flags |= (TRANSPARENT_FRAME|MFP_USED);
return;
}
func = find_pc_function (p);
if (func != NULL)
p = BLOCK_START (SYMBOL_BLOCK_VALUE (func));
else
{
/* Search backward to find the trace-back tag. However,
do not trace back beyond the start of the text segment
(just as a sanity check to avoid going into never-never land). */
do not trace back beyond the start of the text segment
(just as a sanity check to avoid going into never-never land). */
#if 1
while (p >= text_start
&& ((insn = read_memory_integer (p, 4)) & TAGWORD_ZERO_MASK) != 0)
&& ((insn = read_memory_integer (p, 4)) & TAGWORD_ZERO_MASK) != 0)
p -= 4;
#else /* 0 */
char pat[4] =
{0, 0, 0, 0};
char pat[4] = {0, 0, 0, 0};
char mask[4];
char insn_raw[4];
store_unsigned_integer (mask, 4, TAGWORD_ZERO_MASK);
/* Enable this once target_search is enabled and tested. */
target_search (4, pat, mask, p, -4, text_start, p + 1, &p, &insn_raw);
target_search (4, pat, mask, p, -4, text_start, p+1, &p, &insn_raw);
insn = extract_unsigned_integer (insn_raw, 4);
#endif /* 0 */
@@ -478,18 +475,18 @@ init_frame_info (innermost_frame, frame)
If one doesn't exist, try using a more exhaustive search of
the prologue. */
if (examine_tag (p - 4, &trans, (int *) NULL, &msize, &mfp_used)) /* Found good tag */
examine_prologue (p, &rsize, 0, 0);
else /* No tag try prologue */
examine_prologue (p, &rsize, &msize, &mfp_used);
if (examine_tag(p-4,&trans,(int *)NULL,&msize,&mfp_used)) /* Found good tag */
examine_prologue (p, &rsize, 0, 0);
else /* No tag try prologue */
examine_prologue (p, &rsize, &msize, &mfp_used);
frame->rsize = rsize;
frame->msize = msize;
frame->flags = 0;
if (mfp_used)
frame->flags |= MFP_USED;
frame->flags |= MFP_USED;
if (trans)
frame->flags |= TRANSPARENT_FRAME;
frame->flags |= TRANSPARENT_FRAME;
if (innermost_frame)
{
frame->saved_msp = read_register (MSP_REGNUM) + msize;
@@ -497,10 +494,10 @@ init_frame_info (innermost_frame, frame)
else
{
if (mfp_used)
frame->saved_msp =
read_register_stack_integer (frame->frame + rsize - 4, 4);
frame->saved_msp =
read_register_stack_integer (frame->frame + rsize - 4, 4);
else
frame->saved_msp = frame->next->saved_msp + msize;
frame->saved_msp = frame->next->saved_msp + msize;
}
}
@@ -512,9 +509,8 @@ init_extra_frame_info (frame)
/* Assume innermost frame. May produce strange results for "info frame"
but there isn't any way to tell the difference. */
init_frame_info (1, frame);
else
{
/* We're in get_prev_frame.
else {
/* We're in get_prev_frame_info.
Take care of everything in init_frame_pc. */
;
}
@@ -526,7 +522,7 @@ init_frame_pc (fromleaf, frame)
struct frame_info *frame;
{
frame->pc = (fromleaf ? SAVED_PC_AFTER_CALL (frame->next) :
frame->next ? FRAME_SAVED_PC (frame->next) : read_pc ());
frame->next ? FRAME_SAVED_PC (frame->next) : read_pc ());
init_frame_info (fromleaf, frame);
}
@@ -538,7 +534,7 @@ CORE_ADDR
frame_locals_address (fi)
struct frame_info *fi;
{
if (fi->flags & MFP_USED)
if (fi->flags & MFP_USED)
return fi->saved_msp;
else
return fi->saved_msp - fi->msize;
@@ -566,11 +562,10 @@ read_register_stack (memaddr, myaddr, actual_mem_addr, lval)
long rsp = read_register (RSP_REGNUM);
/* If we don't do this 'info register' stops in the middle. */
if (memaddr >= rstack_high_address)
if (memaddr >= rstack_high_address)
{
/* a bogus value */
static char val[] =
{~0, ~0, ~0, ~0};
static char val[] = {~0, ~0, ~0, ~0};
/* It's in a local register, but off the end of the stack. */
int regnum = (memaddr - rsp) / 4 + LR0_REGNUM;
if (myaddr != NULL)
@@ -578,7 +573,7 @@ read_register_stack (memaddr, myaddr, actual_mem_addr, lval)
/* Provide bogusness */
memcpy (myaddr, val, 4);
}
supply_register (regnum, val); /* More bogusness */
supply_register(regnum, val); /* More bogusness */
if (lval != NULL)
*lval = lval_register;
if (actual_mem_addr != NULL)
@@ -604,7 +599,7 @@ read_register_stack (memaddr, myaddr, actual_mem_addr, lval)
else
{
/* It's in the memory portion of the register stack. */
if (myaddr != NULL)
if (myaddr != NULL)
read_memory (memaddr, myaddr, 4);
if (lval != NULL)
*lval = lval_memory;
@@ -637,11 +632,11 @@ write_register_stack (memaddr, myaddr, actual_mem_addr)
long rfb = read_register (RFB_REGNUM);
long rsp = read_register (RSP_REGNUM);
/* If we don't do this 'info register' stops in the middle. */
if (memaddr >= rstack_high_address)
if (memaddr >= rstack_high_address)
{
/* It's in a register, but off the end of the stack. */
if (actual_mem_addr != NULL)
*actual_mem_addr = 0;
*actual_mem_addr = 0;
}
else if (memaddr < rfb)
{
@@ -650,7 +645,7 @@ write_register_stack (memaddr, myaddr, actual_mem_addr)
if (regnum < LR0_REGNUM || regnum > LR0_REGNUM + 127)
error ("Attempt to read register stack out of range.");
if (myaddr != NULL)
write_register (regnum, *(long *) myaddr);
write_register (regnum, *(long *)myaddr);
if (actual_mem_addr != NULL)
*actual_mem_addr = 0;
}
@@ -673,7 +668,7 @@ write_register_stack (memaddr, myaddr, actual_mem_addr)
The argument RAW_BUFFER must point to aligned memory. */
void
a29k_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lvalp)
get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lvalp)
char *raw_buffer;
int *optimized;
CORE_ADDR *addrp;
@@ -738,7 +733,7 @@ a29k_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lvalp)
else if (regnum < LR0_REGNUM || regnum >= LR0_REGNUM + 128)
{
/* These registers are not saved over procedure calls,
so just print out the current values. */
so just print out the current values. */
if (raw_buffer != NULL)
read_register_gen (regnum, raw_buffer);
if (lvalp != NULL)
@@ -747,7 +742,7 @@ a29k_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lvalp)
*addrp = REGISTER_BYTE (regnum);
return;
}
addr = frame->frame + (regnum - LR0_REGNUM) * 4;
if (raw_buffer != NULL)
read_register_stack (addr, raw_buffer, &addr, &lval);
@@ -765,9 +760,9 @@ void
pop_frame ()
{
struct frame_info *frame = get_current_frame ();
CORE_ADDR rfb = read_register (RFB_REGNUM);
CORE_ADDR rfb = read_register (RFB_REGNUM);
CORE_ADDR gr1 = frame->frame + frame->rsize;
CORE_ADDR lr1;
CORE_ADDR lr1;
CORE_ADDR original_lr0;
int must_fix_lr0 = 0;
int i;
@@ -777,54 +772,54 @@ pop_frame ()
read_register (SP_REGNUM),
FRAME_FP (frame)))
{
int lrnum = LR0_REGNUM + DUMMY_ARG / 4;
int lrnum = LR0_REGNUM + DUMMY_ARG/4;
for (i = 0; i < DUMMY_SAVE_SR128; ++i)
write_register (SR_REGNUM (i + 128), read_register (lrnum++));
write_register (SR_REGNUM (i + 128),read_register (lrnum++));
for (i = 0; i < DUMMY_SAVE_SR160; ++i)
write_register (SR_REGNUM (i + 160), read_register (lrnum++));
write_register (SR_REGNUM(i+160), read_register (lrnum++));
for (i = 0; i < DUMMY_SAVE_GREGS; ++i)
write_register (RETURN_REGNUM + i, read_register (lrnum++));
/* Restore the PCs and prepare to restore LR0. */
write_register (PC_REGNUM, read_register (lrnum++));
write_register (NPC_REGNUM, read_register (lrnum++));
write_register (PC2_REGNUM, read_register (lrnum++));
write_register(PC_REGNUM, read_register (lrnum++));
write_register(NPC_REGNUM, read_register (lrnum++));
write_register(PC2_REGNUM, read_register (lrnum++));
original_lr0 = read_register (lrnum++);
must_fix_lr0 = 1;
}
/* Restore the memory stack pointer. */
write_register (MSP_REGNUM, frame->saved_msp);
/* Restore the register stack pointer. */
/* Restore the register stack pointer. */
write_register (GR1_REGNUM, gr1);
/* If we popped a dummy frame, restore lr0 now that gr1 has been restored. */
if (must_fix_lr0)
if (must_fix_lr0)
write_register (LR0_REGNUM, original_lr0);
/* Check whether we need to fill registers. */
lr1 = read_register (LR0_REGNUM + 1);
if (lr1 > rfb)
{
/* Fill. */
/* Check whether we need to fill registers. */
lr1 = read_register (LR0_REGNUM + 1);
if (lr1 > rfb)
{
/* Fill. */
int num_bytes = lr1 - rfb;
int i;
int i;
long word;
write_register (RAB_REGNUM, read_register (RAB_REGNUM) + num_bytes);
write_register (RFB_REGNUM, lr1);
for (i = 0; i < num_bytes; i += 4)
{
write_register (RAB_REGNUM, read_register (RAB_REGNUM) + num_bytes);
write_register (RFB_REGNUM, lr1);
for (i = 0; i < num_bytes; i += 4)
{
/* Note: word is in host byte order. */
word = read_memory_integer (rfb + i, 4);
write_register (LR0_REGNUM + ((rfb - gr1) % 0x80) + i / 4, word);
}
word = read_memory_integer (rfb + i, 4);
write_register (LR0_REGNUM + ((rfb - gr1) % 0x80) + i / 4, word);
}
}
flush_cached_frames ();
flush_cached_frames ();
}
/* Push an empty stack frame, to record the current PC, etc. */
void
void
push_dummy_frame ()
{
long w;
@@ -832,13 +827,13 @@ push_dummy_frame ()
CORE_ADDR msp = read_register (MSP_REGNUM);
int lrnum, i;
CORE_ADDR original_lr0;
/* Read original lr0 before changing gr1. This order isn't really needed
since GDB happens to have a snapshot of all the regs and doesn't toss
it when gr1 is changed. But it's The Right Thing To Do. */
original_lr0 = read_register (LR0_REGNUM);
/* Allocate the new frame. */
/* Allocate the new frame. */
gr1 = read_register (GR1_REGNUM) - DUMMY_FRAME_RSIZE;
write_register (GR1_REGNUM, gr1);
@@ -882,7 +877,7 @@ push_dummy_frame ()
write_register (MSP_REGNUM, msp - 16 * 4);
/* Save registers. */
lrnum = LR0_REGNUM + DUMMY_ARG / 4;
lrnum = LR0_REGNUM + DUMMY_ARG/4;
for (i = 0; i < DUMMY_SAVE_SR128; ++i)
write_register (lrnum++, read_register (SR_REGNUM (i + 128)));
for (i = 0; i < DUMMY_SAVE_SR160; ++i)
@@ -922,8 +917,8 @@ setup_arbitrary_frame (argc, argv)
frame = create_new_frame (argv[0], argv[1]);
if (!frame)
internal_error ("create_new_frame returned invalid frame id");
fatal ("internal: create_new_frame returned invalid frame id");
/* Creating a new frame munges the `frame' value from the current
GR1, so we restore it again here. FIXME, untangle all this
29K frame stuff... */
@@ -996,25 +991,25 @@ a29k_get_processor_type ()
#ifdef GET_LONGJMP_TARGET
/* Figure out where the longjmp will land. We expect that we have just entered
longjmp and haven't yet setup the stack frame, so the args are still in the
longjmp and haven't yet setup the stack frame, so the args are still in the
output regs. lr2 (LR2_REGNUM) points at the jmp_buf structure from which we
extract the pc (JB_PC) that we will land at. The pc is copied into ADDR.
This routine returns true on success */
int
get_longjmp_target (pc)
get_longjmp_target(pc)
CORE_ADDR *pc;
{
CORE_ADDR jb_addr;
char buf[sizeof (CORE_ADDR)];
char buf[sizeof(CORE_ADDR)];
jb_addr = read_register (LR2_REGNUM);
jb_addr = read_register(LR2_REGNUM);
if (target_read_memory (jb_addr + JB_PC * JB_ELEMENT_SIZE, (char *) buf,
sizeof (CORE_ADDR)))
if (target_read_memory(jb_addr + JB_PC * JB_ELEMENT_SIZE, (char *) buf,
sizeof(CORE_ADDR)))
return 0;
*pc = extract_address ((PTR) buf, sizeof (CORE_ADDR));
*pc = extract_address ((PTR) buf, sizeof(CORE_ADDR));
return 1;
}
#endif /* GET_LONGJMP_TARGET */
@@ -1029,7 +1024,7 @@ _initialize_a29k_tdep ()
/* FIXME, there should be a way to make a CORE_ADDR variable settable. */
add_show_from_set
(add_set_cmd ("rstack_high_address", class_support, var_uinteger,
(char *) &rstack_high_address,
(char *)&rstack_high_address,
"Set top address in memory of the register stack.\n\
Attempts to access registers saved above this address will be ignored\n\
or will produce the value -1.", &setlist),
@@ -1038,8 +1033,8 @@ or will produce the value -1.", &setlist),
/* FIXME, there should be a way to make a CORE_ADDR variable settable. */
add_show_from_set
(add_set_cmd ("call_scratch_address", class_support, var_uinteger,
(char *) &text_end,
"Set address in memory where small amounts of RAM can be used\n\
(char *)&text_end,
"Set address in memory where small amounts of RAM can be used\n\
when making function calls into the inferior.", &setlist),
&showlist);
}

View File

@@ -1,22 +1,21 @@
/* Host-dependent code for Apollo-68ks for GDB, the GNU debugger.
Copyright 1986, 1987, 1989, 1991 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "inferior.h"
@@ -31,40 +30,41 @@ extern int errno;
void
fetch_inferior_registers (ignored)
int ignored;
int ignored;
{
struct ptrace_$data_regs_m68k inferior_registers;
struct ptrace_$floating_regs_m68k inferior_fp_registers;
struct ptrace_$control_regs_m68k inferior_control_registers;
extern char registers[];
ptrace_$init_control (&inferior_control_registers);
inferior_fp_registers.size = sizeof (inferior_fp_registers);
ptrace_$init_control(&inferior_control_registers);
inferior_fp_registers.size = sizeof(inferior_fp_registers);
registers_fetched ();
ptrace (PTRACE_GETREGS, inferior_pid,
(PTRACE_ARG3_TYPE) & inferior_registers,
(PTRACE_ARG3_TYPE) &inferior_registers,
ptrace_$data_set,
(PTRACE_ARG3_TYPE) & inferior_registers,
(PTRACE_ARG3_TYPE) &inferior_registers,
ptrace_$data_set);
ptrace (PTRACE_GETREGS, inferior_pid,
(PTRACE_ARG3_TYPE) & inferior_fp_registers,
ptrace_$floating_set_m68k,
(PTRACE_ARG3_TYPE) & inferior_fp_registers,
ptrace_$floating_set_m68k);
(PTRACE_ARG3_TYPE) &inferior_fp_registers,
ptrace_$floating_set_m68k,
(PTRACE_ARG3_TYPE) &inferior_fp_registers,
ptrace_$floating_set_m68k);
ptrace (PTRACE_GETREGS, inferior_pid,
(PTRACE_ARG3_TYPE) & inferior_control_registers,
ptrace_$control_set_m68k,
(PTRACE_ARG3_TYPE) & inferior_control_registers,
ptrace_$control_set_m68k);
(PTRACE_ARG3_TYPE) &inferior_control_registers,
ptrace_$control_set_m68k,
(PTRACE_ARG3_TYPE) &inferior_control_registers,
ptrace_$control_set_m68k);
bcopy (&inferior_registers, registers, 16 * 4);
bcopy (&inferior_fp_registers, &registers[REGISTER_BYTE (FP0_REGNUM)],
sizeof inferior_fp_registers.regs);
*(int *) &registers[REGISTER_BYTE (PS_REGNUM)] = inferior_control_registers.sr;
*(int *) &registers[REGISTER_BYTE (PC_REGNUM)] = inferior_control_registers.pc;
*(int *)&registers[REGISTER_BYTE (PS_REGNUM)] = inferior_control_registers.sr;
*(int *)&registers[REGISTER_BYTE (PC_REGNUM)] = inferior_control_registers.pc;
}
/* Store our register values back into the inferior.
@@ -78,45 +78,46 @@ store_inferior_registers (regno)
struct ptrace_$data_regs_m68k inferior_registers;
struct ptrace_$floating_regs_m68k inferior_fp_registers;
struct ptrace_$control_regs_m68k inferior_control_registers;
extern char registers[];
ptrace_$init_control (&inferior_control_registers);
inferior_fp_registers.size = sizeof (inferior_fp_registers);
ptrace_$init_control(&inferior_control_registers);
inferior_fp_registers.size = sizeof(inferior_fp_registers);
ptrace (PTRACE_GETREGS, inferior_pid,
(PTRACE_ARG3_TYPE) & inferior_fp_registers,
ptrace_$floating_set_m68k,
(PTRACE_ARG3_TYPE) & inferior_fp_registers,
ptrace_$floating_set_m68k);
(PTRACE_ARG3_TYPE) &inferior_fp_registers,
ptrace_$floating_set_m68k,
(PTRACE_ARG3_TYPE) &inferior_fp_registers,
ptrace_$floating_set_m68k);
ptrace (PTRACE_GETREGS, inferior_pid,
(PTRACE_ARG3_TYPE) & inferior_control_registers,
ptrace_$control_set_m68k,
(PTRACE_ARG3_TYPE) & inferior_control_registers,
ptrace_$control_set_m68k);
(PTRACE_ARG3_TYPE) &inferior_control_registers,
ptrace_$control_set_m68k,
(PTRACE_ARG3_TYPE) &inferior_control_registers,
ptrace_$control_set_m68k);
bcopy (registers, &inferior_registers, sizeof (inferior_registers));
bcopy (registers, &inferior_registers, sizeof(inferior_registers));
bcopy (&registers[REGISTER_BYTE (FP0_REGNUM)], inferior_fp_registers.regs,
sizeof inferior_fp_registers.regs);
inferior_control_registers.sr = *(int *) &registers[REGISTER_BYTE (PS_REGNUM)];
inferior_control_registers.pc = *(int *) &registers[REGISTER_BYTE (PC_REGNUM)];
inferior_control_registers.sr = *(int *)&registers[REGISTER_BYTE (PS_REGNUM)];
inferior_control_registers.pc = *(int *)&registers[REGISTER_BYTE (PC_REGNUM)];
ptrace (PTRACE_SETREGS, inferior_pid,
(PTRACE_ARG3_TYPE) & inferior_registers,
(PTRACE_ARG3_TYPE) &inferior_registers,
ptrace_$data_set_m68k,
(PTRACE_ARG3_TYPE) & inferior_registers,
(PTRACE_ARG3_TYPE) &inferior_registers,
ptrace_$data_set_m68k);
ptrace (PTRACE_SETREGS, inferior_pid,
(PTRACE_ARG3_TYPE) & inferior_fp_registers,
(PTRACE_ARG3_TYPE) &inferior_fp_registers,
ptrace_$floating_set_m68k,
(PTRACE_ARG3_TYPE) & inferior_fp_registers,
(PTRACE_ARG3_TYPE) &inferior_fp_registers,
ptrace_$floating_set_m68k);
ptrace (PTRACE_SETREGS, inferior_pid,
(PTRACE_ARG3_TYPE) & inferior_control_registers,
(PTRACE_ARG3_TYPE) &inferior_control_registers,
ptrace_$control_set_m68k,
(PTRACE_ARG3_TYPE) & inferior_control_registers,
(PTRACE_ARG3_TYPE) &inferior_control_registers,
ptrace_$control_set_m68k);
}

View File

@@ -3,22 +3,21 @@
Written by Rob Savoye of Cygnus Support
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "gdbcore.h"
@@ -93,62 +92,61 @@ static char *abug_regnames[NUM_REGS] =
static struct target_ops abug_ops;
static char *abug_inits[] =
{"\r", NULL};
static char *abug_inits[] = {"\r", NULL};
static struct monitor_ops abug_cmds;
static struct monitor_ops abug_cmds ;
static void
init_abug_cmds (void)
static void
init_abug_cmds(void)
{
abug_cmds.flags = MO_CLR_BREAK_USES_ADDR;
abug_cmds.init = abug_inits; /* Init strings */
abug_cmds.cont = "g\r"; /* continue command */
abug_cmds.step = "t\r"; /* single step */
abug_cmds.stop = NULL; /* interrupt command */
abug_cmds.set_break = "br %x\r"; /* set a breakpoint */
abug_cmds.clr_break = "nobr %x\r"; /* clear a breakpoint */
abug_cmds.clr_all_break = "nobr\r"; /* clear all breakpoints */
abug_cmds.fill = "bf %x:%x %x;b\r"; /* fill (start count val) */
abug_cmds.setmem.cmdb = "ms %x %02x\r"; /* setmem.cmdb (addr, value) */
abug_cmds.setmem.cmdw = "ms %x %04x\r"; /* setmem.cmdw (addr, value) */
abug_cmds.setmem.cmdl = "ms %x %08x\r"; /* setmem.cmdl (addr, value) */
abug_cmds.setmem.cmdll = NULL; /* setmem.cmdll (addr, value) */
abug_cmds.setmem.resp_delim = NULL; /* setreg.resp_delim */
abug_cmds.setmem.term = NULL; /* setreg.term */
abug_cmds.setmem.term_cmd = NULL; /* setreg.term_cmd */
abug_cmds.getmem.cmdb = "md %x:%x;b\r"; /* getmem.cmdb (addr, len) */
abug_cmds.getmem.cmdw = "md %x:%x;b\r"; /* getmem.cmdw (addr, len) */
abug_cmds.getmem.cmdl = "md %x:%x;b\r"; /* getmem.cmdl (addr, len) */
abug_cmds.getmem.cmdll = NULL; /* getmem.cmdll (addr, len) */
abug_cmds.getmem.resp_delim = " "; /* getmem.resp_delim */
abug_cmds.getmem.term = NULL; /* getmem.term */
abug_cmds.getmem.term_cmd = NULL; /* getmem.term_cmd */
abug_cmds.setreg.cmd = "rm %s %x\r"; /* setreg.cmd (name, value) */
abug_cmds.setreg.resp_delim = "="; /* setreg.resp_delim */
abug_cmds.setreg.term = "? "; /* setreg.term */
abug_cmds.setreg.term_cmd = ".\r"; /* setreg.term_cmd */
abug_cmds.getreg.cmd = "rm %s\r"; /* getreg.cmd (name) */
abug_cmds.getreg.resp_delim = "="; /* getreg.resp_delim */
abug_cmds.getreg.term = "? "; /* getreg.term */
abug_cmds.getreg.term_cmd = ".\r"; /* getreg.term_cmd */
abug_cmds.dump_registers = "rd\r"; /* dump_registers */
abug_cmds.register_pattern = "\\(\\w+\\) +=\\([0-9a-fA-F]+\\b\\)"; /* register_pattern */
abug_cmds.supply_register = abug_supply_register; /* supply_register */
abug_cmds.load_routine = NULL; /* load_routine (defaults to SRECs) */
abug_cmds.load = "lo 0\r"; /* download command */
abug_cmds.loadresp = "\n"; /* load response */
abug_cmds.prompt = "135Bug>"; /* monitor command prompt */
abug_cmds.line_term = "\r"; /* end-of-line terminator */
abug_cmds.cmd_end = NULL; /* optional command terminator */
abug_cmds.target = &abug_ops; /* target operations */
abug_cmds.stopbits = SERIAL_1_STOPBITS; /* number of stop bits */
abug_cmds.regnames = abug_regnames; /* registers names */
abug_cmds.magic = MONITOR_OPS_MAGIC; /* magic */
};
abug_cmds.flags = MO_CLR_BREAK_USES_ADDR;
abug_cmds.init = abug_inits; /* Init strings */
abug_cmds.cont = "g\r"; /* continue command */
abug_cmds.step = "t\r"; /* single step */
abug_cmds.stop = NULL; /* interrupt command */
abug_cmds.set_break = "br %x\r"; /* set a breakpoint */
abug_cmds.clr_break = "nobr %x\r"; /* clear a breakpoint */
abug_cmds.clr_all_break = "nobr\r"; /* clear all breakpoints */
abug_cmds.fill = "bf %x:%x %x;b\r"; /* fill (start count val) */
abug_cmds.setmem.cmdb = "ms %x %02x\r"; /* setmem.cmdb (addr, value) */
abug_cmds.setmem.cmdw = "ms %x %04x\r"; /* setmem.cmdw (addr, value) */
abug_cmds.setmem.cmdl = "ms %x %08x\r"; /* setmem.cmdl (addr, value) */
abug_cmds.setmem.cmdll = NULL; /* setmem.cmdll (addr, value) */
abug_cmds.setmem.resp_delim = NULL; /* setreg.resp_delim */
abug_cmds.setmem.term = NULL; /* setreg.term */
abug_cmds.setmem.term_cmd = NULL; /* setreg.term_cmd */
abug_cmds.getmem.cmdb = "md %x:%x;b\r"; /* getmem.cmdb (addr, len) */
abug_cmds.getmem.cmdw = "md %x:%x;b\r"; /* getmem.cmdw (addr, len) */
abug_cmds.getmem.cmdl = "md %x:%x;b\r"; /* getmem.cmdl (addr, len) */
abug_cmds.getmem.cmdll = NULL; /* getmem.cmdll (addr, len) */
abug_cmds.getmem.resp_delim = " "; /* getmem.resp_delim */
abug_cmds.getmem.term = NULL; /* getmem.term */
abug_cmds.getmem.term_cmd = NULL; /* getmem.term_cmd */
abug_cmds.setreg.cmd = "rm %s %x\r"; /* setreg.cmd (name, value) */
abug_cmds.setreg.resp_delim = "="; /* setreg.resp_delim */
abug_cmds.setreg.term = "? "; /* setreg.term */
abug_cmds.setreg.term_cmd = ".\r" ; /* setreg.term_cmd */
abug_cmds.getreg.cmd = "rm %s\r"; /* getreg.cmd (name) */
abug_cmds.getreg.resp_delim = "="; /* getreg.resp_delim */
abug_cmds.getreg.term = "? "; /* getreg.term */
abug_cmds.getreg.term_cmd = ".\r" ; /* getreg.term_cmd */
abug_cmds.dump_registers = "rd\r"; /* dump_registers */
abug_cmds.register_pattern = "\\(\\w+\\) +=\\([0-9a-fA-F]+\\b\\)"; /* register_pattern */
abug_cmds.supply_register = abug_supply_register; /* supply_register */
abug_cmds.load_routine = NULL; /* load_routine (defaults to SRECs) */
abug_cmds.load = "lo 0\r"; /* download command */
abug_cmds.loadresp = "\n"; /* load response */
abug_cmds.prompt = "135Bug>"; /* monitor command prompt */
abug_cmds.line_term = "\r"; /* end-of-line terminator */
abug_cmds.cmd_end = NULL; /* optional command terminator */
abug_cmds.target = &abug_ops; /* target operations */
abug_cmds.stopbits = SERIAL_1_STOPBITS; /* number of stop bits */
abug_cmds.regnames = abug_regnames; /* registers names */
abug_cmds.magic = MONITOR_OPS_MAGIC ; /* magic */
};
static void
abug_open (args, from_tty)
abug_open(args, from_tty)
char *args;
int from_tty;
{
@@ -158,7 +156,7 @@ abug_open (args, from_tty)
void
_initialize_abug_rom ()
{
init_abug_cmds ();
init_abug_cmds() ;
init_monitor_ops (&abug_ops);
abug_ops.to_shortname = "abug";

View File

@@ -1,3 +1,17 @@
/* Whether malloc must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_MALLOC
/* Whether realloc must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_REALLOC
/* Whether free must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_FREE
/* Whether strerror must be declared even if <string.h> is included. */
#undef NEED_DECLARATION_STRERROR
@TOP@
/* Define if pstatus_t type is available */
#undef HAVE_PSTATUS_T
@@ -74,9 +88,6 @@
name, as a C string. */
#undef TARGET_CPU_DEFAULT
/* Define if the simulator is being linked in. */
#undef WITH_SIM
/* Set to true if the save_state_t structure is present */
#define HAVE_STRUCT_SAVE_STATE_T 0

View File

@@ -493,7 +493,7 @@ AC_DEFUN(CY_AC_PATH_ITCLCONFIG, [
if test x"${no_itcl}" = x ; then
# we reset no_itcl in case something fails here
no_itcl=true
AC_ARG_WITH(itclconfig, [ --with-itclconfig Directory containing itcl configuration (itclConfig.sh)],
AC_ARG_WITH(itclconfig, [ --with-itclconfig directory containing itcl configuration (itclConfig.sh)],
with_itclconfig=${withval})
AC_MSG_CHECKING([for Itcl configuration])
AC_CACHE_VAL(ac_cv_c_itclconfig,[
@@ -619,7 +619,7 @@ AC_DEFUN(CY_AC_PATH_ITKCONFIG, [
if test x"${no_itk}" = x ; then
# we reset no_itk in case something fails here
no_itk=true
AC_ARG_WITH(itkconfig, [ --with-itkconfig Directory containing itk configuration (itkConfig.sh)],
AC_ARG_WITH(itkconfig, [ --with-itkconfig directory containing itk configuration (itkConfig.sh)],
with_itkconfig=${withval})
AC_MSG_CHECKING([for Itk configuration])
AC_CACHE_VAL(ac_cv_c_itkconfig,[
@@ -765,7 +765,7 @@ AC_DEFUN(CY_AC_PATH_TIXCONFIG, [
if test x"${no_tix}" = x ; then
# we reset no_tix in case something fails here
no_tix=true
AC_ARG_WITH(tixconfig, [ --with-tixconfig Directory containing tix configuration (tixConfig.sh)],
AC_ARG_WITH(tixconfig, [ --with-tixconfig directory containing tix configuration (tixConfig.sh)],
with_tixconfig=${withval})
AC_MSG_CHECKING([for Tix configuration])
AC_CACHE_VAL(ac_cv_c_tixconfig,[

6
gdb/aclocal.m4 vendored
View File

@@ -505,7 +505,7 @@ AC_DEFUN(CY_AC_PATH_ITCLCONFIG, [
if test x"${no_itcl}" = x ; then
# we reset no_itcl in case something fails here
no_itcl=true
AC_ARG_WITH(itclconfig, [ --with-itclconfig Directory containing itcl configuration (itclConfig.sh)],
AC_ARG_WITH(itclconfig, [ --with-itclconfig directory containing itcl configuration (itclConfig.sh)],
with_itclconfig=${withval})
AC_MSG_CHECKING([for Itcl configuration])
AC_CACHE_VAL(ac_cv_c_itclconfig,[
@@ -631,7 +631,7 @@ AC_DEFUN(CY_AC_PATH_ITKCONFIG, [
if test x"${no_itk}" = x ; then
# we reset no_itk in case something fails here
no_itk=true
AC_ARG_WITH(itkconfig, [ --with-itkconfig Directory containing itk configuration (itkConfig.sh)],
AC_ARG_WITH(itkconfig, [ --with-itkconfig directory containing itk configuration (itkConfig.sh)],
with_itkconfig=${withval})
AC_MSG_CHECKING([for Itk configuration])
AC_CACHE_VAL(ac_cv_c_itkconfig,[
@@ -777,7 +777,7 @@ AC_DEFUN(CY_AC_PATH_TIXCONFIG, [
if test x"${no_tix}" = x ; then
# we reset no_tix in case something fails here
no_tix=true
AC_ARG_WITH(tixconfig, [ --with-tixconfig Directory containing tix configuration (tixConfig.sh)],
AC_ARG_WITH(tixconfig, [ --with-tixconfig directory containing tix configuration (tixConfig.sh)],
with_tixconfig=${withval})
AC_MSG_CHECKING([for Tix configuration])
AC_CACHE_VAL(ac_cv_c_tixconfig,[

View File

@@ -1,22 +1,21 @@
/* Low level Alpha interface, for GDB when running native.
Copyright 1993, 1995, 1996, 1998 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "inferior.h"
@@ -24,10 +23,10 @@
#include "target.h"
#include <sys/ptrace.h>
#ifdef __linux__
#include <asm/reg.h>
#include <alpha/ptrace.h>
# include <asm/reg.h>
# include <alpha/ptrace.h>
#else
#include <machine/reg.h>
# include <machine/reg.h>
#endif
#include <sys/user.h>
@@ -63,13 +62,13 @@ get_longjmp_target (pc)
CORE_ADDR jb_addr;
char raw_buffer[MAX_REGISTER_RAW_SIZE];
jb_addr = read_register (A0_REGNUM);
jb_addr = read_register(A0_REGNUM);
if (target_read_memory (jb_addr + JB_PC * JB_ELEMENT_SIZE, raw_buffer,
sizeof (CORE_ADDR)))
if (target_read_memory(jb_addr + JB_PC * JB_ELEMENT_SIZE, raw_buffer,
sizeof(CORE_ADDR)))
return 0;
*pc = extract_address (raw_buffer, sizeof (CORE_ADDR));
*pc = extract_address (raw_buffer, sizeof(CORE_ADDR));
return 1;
}
@@ -79,11 +78,11 @@ get_longjmp_target (pc)
CORE_REG_SECT points to the register values themselves, read into memory.
CORE_REG_SIZE is the size of that area.
WHICH says which set of registers we are handling (0 = int, 2 = float
on machines where they are discontiguous).
on machines where they are discontiguous).
REG_ADDR is the offset from u.u_ar0 to the register values relative to
core_reg_sect. This is used with old-fashioned core files to
locate the registers in a large upage-plus-stack ".reg" section.
Original upage address X is at location core_reg_sect+x+reg_addr.
core_reg_sect. This is used with old-fashioned core files to
locate the registers in a large upage-plus-stack ".reg" section.
Original upage address X is at location core_reg_sect+x+reg_addr.
*/
static void
@@ -102,18 +101,17 @@ fetch_osf_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
static int core_reg_mapping[NUM_REGS] =
{
#define EFL (EF_SIZE / 8)
EF_V0, EF_T0, EF_T1, EF_T2, EF_T3, EF_T4, EF_T5, EF_T6,
EF_T7, EF_S0, EF_S1, EF_S2, EF_S3, EF_S4, EF_S5, EF_S6,
EF_A0, EF_A1, EF_A2, EF_A3, EF_A4, EF_A5, EF_T8, EF_T9,
EF_T10, EF_T11, EF_RA, EF_T12, EF_AT, EF_GP, EF_SP, -1,
EFL + 0, EFL + 1, EFL + 2, EFL + 3, EFL + 4, EFL + 5, EFL + 6, EFL + 7,
EFL + 8, EFL + 9, EFL + 10, EFL + 11, EFL + 12, EFL + 13, EFL + 14, EFL + 15,
EFL + 16, EFL + 17, EFL + 18, EFL + 19, EFL + 20, EFL + 21, EFL + 22, EFL + 23,
EFL + 24, EFL + 25, EFL + 26, EFL + 27, EFL + 28, EFL + 29, EFL + 30, EFL + 31,
EF_PC, -1
EF_V0, EF_T0, EF_T1, EF_T2, EF_T3, EF_T4, EF_T5, EF_T6,
EF_T7, EF_S0, EF_S1, EF_S2, EF_S3, EF_S4, EF_S5, EF_S6,
EF_A0, EF_A1, EF_A2, EF_A3, EF_A4, EF_A5, EF_T8, EF_T9,
EF_T10, EF_T11, EF_RA, EF_T12, EF_AT, EF_GP, EF_SP, -1,
EFL+0, EFL+1, EFL+2, EFL+3, EFL+4, EFL+5, EFL+6, EFL+7,
EFL+8, EFL+9, EFL+10, EFL+11, EFL+12, EFL+13, EFL+14, EFL+15,
EFL+16, EFL+17, EFL+18, EFL+19, EFL+20, EFL+21, EFL+22, EFL+23,
EFL+24, EFL+25, EFL+26, EFL+27, EFL+28, EFL+29, EFL+30, EFL+31,
EF_PC, -1
};
static char zerobuf[MAX_REGISTER_RAW_SIZE] =
{0};
static char zerobuf[MAX_REGISTER_RAW_SIZE] = {0};
for (regno = 0; regno < NUM_REGS; regno++)
{
@@ -146,7 +144,7 @@ fetch_elf_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
int which;
CORE_ADDR reg_addr;
{
if (core_reg_size < 32 * 8)
if (core_reg_size < 32*8)
{
error ("Core file register section too small (%u bytes).", core_reg_size);
return;
@@ -155,15 +153,15 @@ fetch_elf_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
if (which == 2)
{
/* The FPU Registers. */
memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)], core_reg_sect, 31 * 8);
memset (&registers[REGISTER_BYTE (FP0_REGNUM + 31)], 0, 8);
memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)], core_reg_sect, 31*8);
memset (&registers[REGISTER_BYTE (FP0_REGNUM+31)], 0, 8);
memset (&register_valid[FP0_REGNUM], 1, 32);
}
else
{
/* The General Registers. */
memcpy (&registers[REGISTER_BYTE (V0_REGNUM)], core_reg_sect, 31 * 8);
memcpy (&registers[REGISTER_BYTE (PC_REGNUM)], core_reg_sect + 31 * 8, 8);
memcpy (&registers[REGISTER_BYTE (V0_REGNUM)], core_reg_sect, 31*8);
memcpy (&registers[REGISTER_BYTE (PC_REGNUM)], core_reg_sect+31*8, 8);
memset (&registers[REGISTER_BYTE (ZERO_REGNUM)], 0, 8);
memset (&register_valid[V0_REGNUM], 1, 32);
register_valid[PC_REGNUM] = 1;
@@ -203,19 +201,18 @@ kernel_u_size ()
* See the comment in m68k-tdep.c regarding the utility of these functions.
*/
void
void
supply_gregset (gregsetp)
gregset_t *gregsetp;
{
register int regi;
register long *regp = ALPHA_REGSET_BASE (gregsetp);
static char zerobuf[MAX_REGISTER_RAW_SIZE] =
{0};
static char zerobuf[MAX_REGISTER_RAW_SIZE] = {0};
for (regi = 0; regi < 31; regi++)
supply_register (regi, (char *) (regp + regi));
supply_register (regi, (char *)(regp + regi));
supply_register (PC_REGNUM, (char *) (regp + 31));
supply_register (PC_REGNUM, (char *)(regp + 31));
/* Fill inaccessible registers with zero. */
supply_register (ZERO_REGNUM, zerobuf);
@@ -251,7 +248,7 @@ supply_fpregset (fpregsetp)
register long *regp = ALPHA_REGSET_BASE (fpregsetp);
for (regi = 0; regi < 32; regi++)
supply_register (regi + FP0_REGNUM, (char *) (regp + regi));
supply_register (regi + FP0_REGNUM, (char *)(regp + regi));
}
void
@@ -272,8 +269,8 @@ fill_fpregset (fpregsetp, regno)
}
}
#endif
/* Register that we are able to handle alpha core file formats. */
static struct core_fns alpha_osf_core_fns =

File diff suppressed because it is too large Load Diff

View File

@@ -1,163 +1,164 @@
/* OBSOLETE /* Low level interface to ptrace, for GDB when running under m68k SVR2 Unix */
/* OBSOLETE on Altos 3068. Report bugs to Jyrki Kuoppala <jkp@cs.hut.fi> */
/* OBSOLETE Copyright (C) 1989, 1991 Free Software Foundation, Inc. */
/* OBSOLETE */
/* OBSOLETE This file is part of GDB. */
/* OBSOLETE */
/* OBSOLETE This program is free software; you can redistribute it and/or modify */
/* OBSOLETE it under the terms of the GNU General Public License as published by */
/* OBSOLETE the Free Software Foundation; either version 2 of the License, or */
/* OBSOLETE (at your option) any later version. */
/* OBSOLETE */
/* OBSOLETE This program is distributed in the hope that it will be useful, */
/* OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* OBSOLETE GNU General Public License for more details. */
/* OBSOLETE */
/* OBSOLETE You should have received a copy of the GNU General Public License */
/* OBSOLETE along with this program; if not, write to the Free Software */
/* OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *x/ */
/* OBSOLETE */
/* OBSOLETE #include "defs.h" */
/* OBSOLETE #include "frame.h" */
/* OBSOLETE #include "inferior.h" */
/* OBSOLETE */
/* OBSOLETE #ifdef USG */
/* OBSOLETE #include <sys/types.h> */
/* OBSOLETE #endif */
/* OBSOLETE */
/* OBSOLETE #include <sys/param.h> */
/* OBSOLETE #include <sys/dir.h> */
/* OBSOLETE #include <signal.h> */
/* OBSOLETE #include <sys/ioctl.h> */
/* OBSOLETE #include <fcntl.h> */
/* OBSOLETE #ifdef USG */
/* OBSOLETE #include <sys/page.h> */
/* OBSOLETE #ifdef ALTOS */
/* OBSOLETE #include <sys/net.h> */
/* OBSOLETE #include <errno.h> */
/* OBSOLETE #endif */
/* OBSOLETE #endif */
/* OBSOLETE */
/* OBSOLETE #include "gdbcore.h" */
/* OBSOLETE #include <sys/user.h> /* After a.out.h *x/ */
/* OBSOLETE #include <sys/file.h> */
/* OBSOLETE #include "gdb_stat.h" */
/* OBSOLETE */
/* OBSOLETE */
/* OBSOLETE /* Work with core dump and executable files, for GDB. */
/* OBSOLETE This code would be in corefile.c if it weren't machine-dependent. *x/ */
/* OBSOLETE */
/* OBSOLETE void */
/* OBSOLETE core_file_command (filename, from_tty) */
/* OBSOLETE char *filename; */
/* OBSOLETE int from_tty; */
/* OBSOLETE { */
/* OBSOLETE int val; */
/* OBSOLETE */
/* OBSOLETE /* Discard all vestiges of any previous core file */
/* OBSOLETE and mark data and stack spaces as empty. *x/ */
/* OBSOLETE */
/* OBSOLETE if (corefile) */
/* OBSOLETE free (corefile); */
/* OBSOLETE corefile = 0; */
/* OBSOLETE */
/* OBSOLETE if (corechan >= 0) */
/* OBSOLETE close (corechan); */
/* OBSOLETE corechan = -1; */
/* OBSOLETE */
/* OBSOLETE data_start = 0; */
/* OBSOLETE data_end = 0; */
/* OBSOLETE stack_start = STACK_END_ADDR; */
/* OBSOLETE stack_end = STACK_END_ADDR; */
/* OBSOLETE */
/* OBSOLETE /* Now, if a new core file was specified, open it and digest it. *x/ */
/* OBSOLETE */
/* OBSOLETE if (filename) */
/* OBSOLETE { */
/* OBSOLETE filename = tilde_expand (filename); */
/* OBSOLETE make_cleanup (free, filename); */
/* OBSOLETE */
/* OBSOLETE if (have_inferior_p ()) */
/* OBSOLETE error ("To look at a core file, you must kill the program with \"kill\"."); */
/* OBSOLETE corechan = open (filename, O_RDONLY, 0); */
/* OBSOLETE if (corechan < 0) */
/* OBSOLETE perror_with_name (filename); */
/* OBSOLETE /* 4.2-style (and perhaps also sysV-style) core dump file. *x/ */
/* OBSOLETE { */
/* OBSOLETE struct user u; */
/* OBSOLETE */
/* OBSOLETE unsigned int reg_offset; */
/* OBSOLETE */
/* OBSOLETE val = myread (corechan, &u, sizeof u); */
/* OBSOLETE if (val < 0) */
/* OBSOLETE perror_with_name ("Not a core file: reading upage"); */
/* OBSOLETE if (val != sizeof u) */
/* OBSOLETE error ("Not a core file: could only read %d bytes", val); */
/* OBSOLETE data_start = exec_data_start; */
/* OBSOLETE */
/* OBSOLETE #if !defined (NBPG) */
/* OBSOLETE #define NBPG NBPP */
/* OBSOLETE #endif */
/* OBSOLETE #if !defined (UPAGES) */
/* OBSOLETE #define UPAGES USIZE */
/* OBSOLETE #endif */
/* OBSOLETE */
/* OBSOLETE data_end = data_start + NBPG * u.u_dsize; */
/* OBSOLETE stack_start = stack_end - NBPG * u.u_ssize; */
/* OBSOLETE data_offset = NBPG * UPAGES + exec_data_start % NBPG /* Not sure about this //jkp *x/; */
/* OBSOLETE stack_offset = NBPG * (UPAGES + u.u_dsize); */
/* OBSOLETE */
/* OBSOLETE /* Some machines put an absolute address in here and some put */
/* OBSOLETE the offset in the upage of the regs. *x/ */
/* OBSOLETE reg_offset = (int) u.u_state; */
/* OBSOLETE if (reg_offset > NBPG * UPAGES) */
/* OBSOLETE reg_offset -= KERNEL_U_ADDR; */
/* OBSOLETE */
/* OBSOLETE memcpy (&core_aouthdr, &u.u_exdata, sizeof (AOUTHDR)); */
/* OBSOLETE printf_unfiltered ("Core file is from \"%s\".\n", u.u_comm); */
/* OBSOLETE */
/* OBSOLETE /* I don't know where to find this info. */
/* OBSOLETE So, for now, mark it as not available. *x/ */
/* OBSOLETE N_SET_MAGIC (core_aouthdr, 0); */
/* OBSOLETE */
/* OBSOLETE /* Read the register values out of the core file and store */
/* OBSOLETE them where `read_register' will find them. *x/ */
/* OBSOLETE */
/* OBSOLETE { */
/* OBSOLETE register int regno; */
/* OBSOLETE */
/* OBSOLETE for (regno = 0; regno < NUM_REGS; regno++) */
/* OBSOLETE { */
/* OBSOLETE char buf[MAX_REGISTER_RAW_SIZE]; */
/* OBSOLETE */
/* OBSOLETE val = lseek (corechan, register_addr (regno, reg_offset), 0); */
/* OBSOLETE if (val < 0 */
/* OBSOLETE || (val = myread (corechan, buf, sizeof buf)) < 0) */
/* OBSOLETE { */
/* OBSOLETE char * buffer = (char *) alloca (strlen (REGISTER_NAME (regno)) */
/* OBSOLETE + 30); */
/* OBSOLETE strcpy (buffer, "Reading register "); */
/* OBSOLETE strcat (buffer, REGISTER_NAME (regno)); */
/* OBSOLETE */
/* OBSOLETE perror_with_name (buffer); */
/* OBSOLETE } */
/* OBSOLETE */
/* OBSOLETE supply_register (regno, buf); */
/* OBSOLETE } */
/* OBSOLETE } */
/* OBSOLETE } */
/* OBSOLETE if (filename[0] == '/') */
/* OBSOLETE corefile = savestring (filename, strlen (filename)); */
/* OBSOLETE else */
/* OBSOLETE { */
/* OBSOLETE corefile = concat (current_directory, "/", filename, NULL); */
/* OBSOLETE } */
/* OBSOLETE */
/* OBSOLETE flush_cached_frames (); */
/* OBSOLETE select_frame (get_current_frame (), 0); */
/* OBSOLETE validate_files (); */
/* OBSOLETE } */
/* OBSOLETE else if (from_tty) */
/* OBSOLETE printf_unfiltered ("No core file now.\n"); */
/* OBSOLETE } */
/* Low level interface to ptrace, for GDB when running under m68k SVR2 Unix
on Altos 3068. Report bugs to Jyrki Kuoppala <jkp@cs.hut.fi>
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "frame.h"
#include "inferior.h"
#ifdef USG
#include <sys/types.h>
#endif
#include <sys/param.h>
#include <sys/dir.h>
#include <signal.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#ifdef USG
#include <sys/page.h>
#ifdef ALTOS
#include <sys/net.h>
#include <errno.h>
#endif
#endif
#include "gdbcore.h"
#include <sys/user.h> /* After a.out.h */
#include <sys/file.h>
#include "gdb_stat.h"
/* Work with core dump and executable files, for GDB.
This code would be in corefile.c if it weren't machine-dependent. */
void
core_file_command (filename, from_tty)
char *filename;
int from_tty;
{
int val;
extern char registers[];
/* Discard all vestiges of any previous core file
and mark data and stack spaces as empty. */
if (corefile)
free (corefile);
corefile = 0;
if (corechan >= 0)
close (corechan);
corechan = -1;
data_start = 0;
data_end = 0;
stack_start = STACK_END_ADDR;
stack_end = STACK_END_ADDR;
/* Now, if a new core file was specified, open it and digest it. */
if (filename)
{
filename = tilde_expand (filename);
make_cleanup (free, filename);
if (have_inferior_p ())
error ("To look at a core file, you must kill the program with \"kill\".");
corechan = open (filename, O_RDONLY, 0);
if (corechan < 0)
perror_with_name (filename);
/* 4.2-style (and perhaps also sysV-style) core dump file. */
{
struct user u;
unsigned int reg_offset;
val = myread (corechan, &u, sizeof u);
if (val < 0)
perror_with_name ("Not a core file: reading upage");
if (val != sizeof u)
error ("Not a core file: could only read %d bytes", val);
data_start = exec_data_start;
#if !defined (NBPG)
#define NBPG NBPP
#endif
#if !defined (UPAGES)
#define UPAGES USIZE
#endif
data_end = data_start + NBPG * u.u_dsize;
stack_start = stack_end - NBPG * u.u_ssize;
data_offset = NBPG * UPAGES + exec_data_start % NBPG /* Not sure about this //jkp */;
stack_offset = NBPG * (UPAGES + u.u_dsize);
/* Some machines put an absolute address in here and some put
the offset in the upage of the regs. */
reg_offset = (int) u.u_state;
if (reg_offset > NBPG * UPAGES)
reg_offset -= KERNEL_U_ADDR;
memcpy (&core_aouthdr, &u.u_exdata, sizeof (AOUTHDR));
printf_unfiltered ("Core file is from \"%s\".\n", u.u_comm);
/* I don't know where to find this info.
So, for now, mark it as not available. */
N_SET_MAGIC (core_aouthdr, 0);
/* Read the register values out of the core file and store
them where `read_register' will find them. */
{
register int regno;
for (regno = 0; regno < NUM_REGS; regno++)
{
char buf[MAX_REGISTER_RAW_SIZE];
val = lseek (corechan, register_addr (regno, reg_offset), 0);
if (val < 0
|| (val = myread (corechan, buf, sizeof buf)) < 0)
{
char * buffer = (char *) alloca (strlen (REGISTER_NAME (regno))
+ 30);
strcpy (buffer, "Reading register ");
strcat (buffer, REGISTER_NAME (regno));
perror_with_name (buffer);
}
supply_register (regno, buf);
}
}
}
if (filename[0] == '/')
corefile = savestring (filename, strlen (filename));
else
{
corefile = concat (current_directory, "/", filename, NULL);
}
flush_cached_frames ();
select_frame (get_current_frame (), 0);
validate_files ();
}
else if (from_tty)
printf_unfiltered ("No core file now.\n");
}

View File

@@ -1,22 +1,21 @@
/* Annotation routines for GDB.
Copyright 1986, 89, 90, 91, 92, 95, 98, 1999 Free Software Foundation, Inc.
Copyright 1986, 89, 90, 91, 92, 95, 1998 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "annotate.h"
@@ -28,8 +27,6 @@
/* Prototypes for local functions. */
extern void _initialize_annotate PARAMS ((void));
static void print_value_flags PARAMS ((struct type *));
static void breakpoint_changed PARAMS ((struct breakpoint *));
@@ -37,7 +34,6 @@ static void breakpoint_changed PARAMS ((struct breakpoint *));
void (*annotate_starting_hook) PARAMS ((void));
void (*annotate_stopped_hook) PARAMS ((void));
void (*annotate_signalled_hook) PARAMS ((void));
void (*annotate_signal_hook) PARAMS ((void));
void (*annotate_exited_hook) PARAMS ((void));
static void
@@ -93,9 +89,9 @@ annotate_starting ()
else
{
if (annotation_level > 1)
{
printf_filtered ("\n\032\032starting\n");
}
{
printf_filtered ("\n\032\032starting\n");
}
}
}
@@ -107,7 +103,7 @@ annotate_stopped ()
else
{
if (annotation_level > 1)
printf_filtered ("\n\032\032stopped\n");
printf_filtered ("\n\032\032stopped\n");
}
}
@@ -120,7 +116,7 @@ annotate_exited (exitstatus)
else
{
if (annotation_level > 1)
printf_filtered ("\n\032\032exited %d\n", exitstatus);
printf_filtered ("\n\032\032exited %d\n", exitstatus);
}
}
@@ -165,9 +161,6 @@ annotate_signal_string_end ()
void
annotate_signal ()
{
if (annotate_signal_hook)
annotate_signal_hook ();
if (annotation_level > 1)
printf_filtered ("\n\032\032signal\n");
}

View File

@@ -1,22 +1,21 @@
/* Annotation routines for GDB.
Copyright 1986, 1989, 1990, 1991, 1992, 1999 Free Software Foundation, Inc.
Copyright 1986, 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "symtab.h"
#include "gdbtypes.h"
@@ -102,5 +101,4 @@ extern void annotate_array_section_end PARAMS ((void));
extern void (*annotate_starting_hook) PARAMS ((void));
extern void (*annotate_stopped_hook) PARAMS ((void));
extern void (*annotate_signalled_hook) PARAMS ((void));
extern void (*annotate_signal_hook) PARAMS ((void));
extern void (*annotate_exited_hook) PARAMS ((void));

View File

@@ -1,22 +1,21 @@
/* ARC target-dependent stuff.
Copyright (C) 1995, 1997 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "frame.h"
@@ -33,20 +32,12 @@ char *arc_cpu_type;
char *tmp_arc_cpu_type;
/* Table of cpu names. */
struct
{
char *name;
int value;
}
arc_cpu_type_table[] =
{
{
"base", bfd_mach_arc_base
}
,
{
NULL, 0
}
struct {
char *name;
int value;
} arc_cpu_type_table[] = {
{ "base", bfd_mach_arc_base },
{ NULL, 0 }
};
/* Used by simulator. */
@@ -90,7 +81,7 @@ static void codestream_read PARAMS ((unsigned int *, int));
static void codestream_seek PARAMS ((CORE_ADDR));
static unsigned int codestream_fill PARAMS ((int));
#define CODESTREAM_BUFSIZ 16
#define CODESTREAM_BUFSIZ 16
static CORE_ADDR codestream_next_addr;
static CORE_ADDR codestream_addr;
static unsigned int codestream_buf[CODESTREAM_BUFSIZ];
@@ -108,9 +99,9 @@ static int codestream_cnt;
? codestream_fill (0) \
: codestream_buf[codestream_off++])
static unsigned int
static unsigned int
codestream_fill (peek_flag)
int peek_flag;
int peek_flag;
{
codestream_addr = codestream_next_addr;
codestream_next_addr += CODESTREAM_BUFSIZ * sizeof (codestream_buf[0]);
@@ -130,7 +121,7 @@ codestream_fill (peek_flag)
for (j = 0; j < n / 2; ++j)
tmp = p[j], p[j] = p[n - 1 - j], p[n - 1 - j] = tmp;
}
if (peek_flag)
return codestream_peek ();
else
@@ -139,7 +130,7 @@ codestream_fill (peek_flag)
static void
codestream_seek (place)
CORE_ADDR place;
CORE_ADDR place;
{
codestream_next_addr = place / CODESTREAM_BUFSIZ;
codestream_next_addr *= CODESTREAM_BUFSIZ;
@@ -212,16 +203,16 @@ arc_get_frame_setup (pc)
{
insn = codestream_get ();
/* Frame may not be necessary, even though blink is saved.
At least this is something we recognize. */
At least this is something we recognize. */
frame_size = 0;
}
if ((insn & BUILD_INSN (-1, 0, -1, -1, -1)) /* st fp,[sp] */
if ((insn & BUILD_INSN (-1, 0, -1, -1, -1)) /* st fp,[sp] */
== BUILD_INSN (2, 0, SP_REGNUM, FP_REGNUM, 0))
{
{
insn = codestream_get ();
if ((insn & BUILD_INSN (-1, -1, -1, -1, 0))
!= BUILD_INSN (12, FP_REGNUM, SP_REGNUM, SP_REGNUM, 0))
!= BUILD_INSN (12, FP_REGNUM, SP_REGNUM, SP_REGNUM, 0))
return -1;
/* Check for stack adjustment sub sp,sp,N. */
@@ -238,12 +229,12 @@ arc_get_frame_setup (pc)
if (frame_size < 0)
return -1;
codestream_get ();
codestream_get ();
/* This sequence is used to get the address of the return
buffer for a function that returns a structure. */
insn = codestream_peek ();
if ((insn & OPMASK) == 0x60000000)
if (insn & OPMASK == 0x60000000)
codestream_get ();
}
/* Frameless fn. */
@@ -273,7 +264,7 @@ arc_get_frame_setup (pc)
This allows a quicker answer. */
CORE_ADDR
arc_skip_prologue (pc, frameless_p)
skip_prologue (pc, frameless_p)
CORE_ADDR pc;
int frameless_p;
{
@@ -292,8 +283,8 @@ arc_skip_prologue (pc, frameless_p)
insn = codestream_peek ();
if ((insn & BUILD_INSN (-1, 0, -1, 0, 0))
!= BUILD_INSN (2, 0, SP_REGNUM, 0, 0))
break; /* not st insn */
if (!ARC_CALL_SAVED_REG (X_C (insn)))
break; /* not st insn */
if (! ARC_CALL_SAVED_REG (X_C (insn)))
break;
codestream_get ();
}
@@ -369,11 +360,11 @@ frame_find_saved_regs (fip, fsrp)
dummy_bottom = fip->frame - 4 - REGISTER_BYTES - CALL_DUMMY_LENGTH;
/* Check if the PC is in the stack, in a dummy frame. */
if (dummy_bottom <= fip->pc && fip->pc <= fip->frame)
if (dummy_bottom <= fip->pc && fip->pc <= fip->frame)
{
/* all regs were saved by push_call_dummy () */
adr = fip->frame;
for (i = 0; i < NUM_REGS; i++)
for (i = 0; i < NUM_REGS; i++)
{
adr -= REGISTER_RAW_SIZE (i);
fsrp->regs[i] = adr;
@@ -383,7 +374,7 @@ frame_find_saved_regs (fip, fsrp)
locals = arc_get_frame_setup (get_pc_function_start (fip->pc));
if (locals >= 0)
if (locals >= 0)
{
/* Set `adr' to the value of `sp'. */
adr = fip->frame - locals;
@@ -391,9 +382,9 @@ frame_find_saved_regs (fip, fsrp)
{
insn = codestream_get ();
if ((insn & BUILD_INSN (-1, 0, -1, 0, 0))
!= BUILD_INSN (2, 0, SP_REGNUM, 0, 0))
!= BUILD_INSN (2, 0, SP_REGNUM, 0, 0))
break;
regnum = X_C (insn);
regnum = X_C (insn);
offset = X_D (insn);
fsrp->regs[regnum] = adr + offset;
}
@@ -411,7 +402,7 @@ push_dummy_frame ()
char regbuf[MAX_REGISTER_RAW_SIZE];
read_register_gen (PC_REGNUM, regbuf);
write_memory (sp + 4, regbuf, REGISTER_SIZE);
write_memory (sp+4, regbuf, REGISTER_SIZE);
read_register_gen (FP_REGNUM, regbuf);
write_memory (sp, regbuf, REGISTER_SIZE);
write_register (FP_REGNUM, sp);
@@ -420,7 +411,7 @@ push_dummy_frame ()
read_register_gen (regnum, regbuf);
sp = push_bytes (sp, regbuf, REGISTER_RAW_SIZE (regnum));
}
sp += (2 * REGISTER_SIZE);
sp += (2*REGISTER_SIZE);
write_register (SP_REGNUM, sp);
}
@@ -432,10 +423,10 @@ pop_frame ()
int regnum;
struct frame_saved_regs fsr;
char regbuf[MAX_REGISTER_RAW_SIZE];
fp = FRAME_FP (frame);
get_frame_saved_regs (frame, &fsr);
for (regnum = 0; regnum < NUM_REGS; regnum++)
for (regnum = 0; regnum < NUM_REGS; regnum++)
{
CORE_ADDR adr;
adr = fsr.regs[regnum];
@@ -456,12 +447,11 @@ pop_frame ()
typedef enum
{
NORMAL4, /* a normal 4 byte insn */
NORMAL8, /* a normal 8 byte insn */
BRANCH4, /* a 4 byte branch insn, including ones without delay slots */
BRANCH8, /* an 8 byte branch insn, including ones with delay slots */
}
insn_type;
NORMAL4, /* a normal 4 byte insn */
NORMAL8, /* a normal 8 byte insn */
BRANCH4, /* a 4 byte branch insn, including ones without delay slots */
BRANCH8, /* an 8 byte branch insn, including ones with delay slots */
} insn_type;
/* Return the type of INSN and store in TARGET the destination address of a
branch if this is one. */
@@ -476,30 +466,26 @@ get_insn_type (insn, pc, target)
switch (insn >> 27)
{
case 0:
case 1:
case 2: /* load/store insns */
case 0 : case 1 : case 2 : /* load/store insns */
if (LIMM_P (X_A (insn))
|| LIMM_P (X_B (insn))
|| LIMM_P (X_C (insn)))
return NORMAL8;
return NORMAL4;
case 4:
case 5:
case 6: /* branch insns */
case 4 : case 5 : case 6 : /* branch insns */
*target = pc + 4 + X_L (insn);
/* ??? It isn't clear that this is always the right answer.
The problem occurs when the next insn is an 8 byte insn. If the
branch is conditional there's no worry as there shouldn't be an 8
byte insn following. The programmer may be cheating if s/he knows
the branch will never be taken, but we don't deal with that.
Note that the programmer is also allowed to play games by putting
an insn with long immediate data in the delay slot and then duplicate
the long immediate data at the branch target. Ugh! */
The problem occurs when the next insn is an 8 byte insn. If the
branch is conditional there's no worry as there shouldn't be an 8
byte insn following. The programmer may be cheating if s/he knows
the branch will never be taken, but we don't deal with that.
Note that the programmer is also allowed to play games by putting
an insn with long immediate data in the delay slot and then duplicate
the long immediate data at the branch target. Ugh! */
if (X_N (insn) == 0)
return BRANCH4;
return BRANCH8;
case 7: /* jump insns */
case 7 : /* jump insns */
if (LIMM_P (X_B (insn)))
{
limm = read_memory_integer (pc + 4, 4);
@@ -513,7 +499,7 @@ get_insn_type (insn, pc, target)
if (X_Q (insn) == 0 && X_N (insn) == 0)
return BRANCH4;
return BRANCH8;
default: /* arithmetic insns, etc. */
default : /* arithmetic insns, etc. */
if (LIMM_P (X_A (insn))
|| LIMM_P (X_B (insn))
|| LIMM_P (X_C (insn)))
@@ -532,7 +518,7 @@ get_insn_type (insn, pc, target)
void
arc_software_single_step (ignore, insert_breakpoints_p)
enum target_signal ignore; /* sig but we don't need it */
enum target_signal ignore; /* sig but we don't need it */
int insert_breakpoints_p;
{
static CORE_ADDR next_pc, target;
@@ -557,10 +543,10 @@ arc_software_single_step (ignore, insert_breakpoints_p)
brktrg_p = 0;
if ((type == BRANCH4 || type == BRANCH8)
/* Watch out for branches to the following location.
We just stored a breakpoint there and another call to
target_insert_breakpoint will think the real insn is the
breakpoint we just stored there. */
/* Watch out for branches to the following location.
We just stored a breakpoint there and another call to
target_insert_breakpoint will think the real insn is the
breakpoint we just stored there. */
&& target != next_pc)
{
brktrg_p = 1;
@@ -589,7 +575,7 @@ arc_software_single_step (ignore, insert_breakpoints_p)
This routine returns true on success. */
int
get_longjmp_target (pc)
get_longjmp_target(pc)
CORE_ADDR *pc;
{
char buf[TARGET_PTR_BIT / TARGET_CHAR_BIT];
@@ -597,7 +583,7 @@ get_longjmp_target (pc)
sp = read_register (SP_REGNUM);
if (target_read_memory (sp + SP_ARG0, /* Offset of first arg on stack */
if (target_read_memory (sp + SP_ARG0, /* Offset of first arg on stack */
buf,
TARGET_PTR_BIT / TARGET_CHAR_BIT))
return 0;
@@ -658,7 +644,7 @@ arc_set_cpu_type_command (args, from_tty)
return;
}
if (!arc_set_cpu_type (tmp_arc_cpu_type))
{
error ("Unknown cpu type `%s'.", tmp_arc_cpu_type);

File diff suppressed because it is too large Load Diff

View File

@@ -1,22 +1,21 @@
/* Acorn Risc Machine host machine support.
Copyright (C) 1988, 1989, 1991 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "frame.h"
@@ -43,7 +42,7 @@
void
fetch_inferior_registers (regno)
int regno; /* Original value discarded */
int regno; /* Original value discarded */
{
register unsigned int regaddr;
char buf[MAX_REGISTER_RAW_SIZE];
@@ -52,35 +51,34 @@ fetch_inferior_registers (regno)
struct user u;
unsigned int offset = (char *) &u.u_ar0 - (char *) &u;
offset = ptrace (PT_READ_U, inferior_pid, (PTRACE_ARG3_TYPE) offset, 0)
- KERNEL_U_ADDR;
- KERNEL_U_ADDR;
registers_fetched ();
for (regno = 0; regno < 16; regno++)
{
regaddr = offset + regno * 4;
*(int *) &buf[0] = ptrace (PT_READ_U, inferior_pid,
(PTRACE_ARG3_TYPE) regaddr, 0);
*(int *)&buf[0] = ptrace (PT_READ_U, inferior_pid,
(PTRACE_ARG3_TYPE) regaddr, 0);
if (regno == PC_REGNUM)
*(int *) &buf[0] = GET_PC_PART (*(int *) &buf[0]);
*(int *)&buf[0] = GET_PC_PART(*(int *)&buf[0]);
supply_register (regno, buf);
}
*(int *) &buf[0] = ptrace (PT_READ_U, inferior_pid,
(PTRACE_ARG3_TYPE) (offset + PC * 4), 0);
supply_register (PS_REGNUM, buf); /* set virtual register ps same as pc */
*(int *)&buf[0] = ptrace (PT_READ_U, inferior_pid,
(PTRACE_ARG3_TYPE) (offset + PC*4), 0);
supply_register (PS_REGNUM, buf); /* set virtual register ps same as pc */
/* read the floating point registers */
offset = (char *) &u.u_fp_regs - (char *) &u;
*(int *) buf = ptrace (PT_READ_U, inferior_pid, (PTRACE_ARG3_TYPE) offset, 0);
offset = (char *) &u.u_fp_regs - (char *)&u;
*(int *)buf = ptrace (PT_READ_U, inferior_pid, (PTRACE_ARG3_TYPE) offset, 0);
supply_register (FPS_REGNUM, buf);
for (regno = 16; regno < 24; regno++)
{
for (regno = 16; regno < 24; regno++) {
regaddr = offset + 4 + 12 * (regno - 16);
for (i = 0; i < 12; i += sizeof (int))
*(int *) &buf[i] = ptrace (PT_READ_U, inferior_pid,
(PTRACE_ARG3_TYPE) (regaddr + i), 0);
for (i = 0; i < 12; i += sizeof(int))
*(int *) &buf[i] = ptrace (PT_READ_U, inferior_pid,
(PTRACE_ARG3_TYPE) (regaddr + i), 0);
supply_register (regno, buf);
}
}
}
/* Store our register values back into the inferior.
@@ -98,17 +96,15 @@ store_inferior_registers (regno)
unsigned long value;
unsigned int offset = (char *) &u.u_ar0 - (char *) &u;
offset = ptrace (PT_READ_U, inferior_pid, (PTRACE_ARG3_TYPE) offset, 0)
- KERNEL_U_ADDR;
- KERNEL_U_ADDR;
if (regno >= 0)
{
if (regno >= 16)
return;
if (regno >= 0) {
if (regno >= 16) return;
regaddr = offset + 4 * regno;
errno = 0;
value = read_register (regno);
value = read_register(regno);
if (regno == PC_REGNUM)
value = SET_PC_PART (read_register (PS_REGNUM), value);
value = SET_PC_PART(read_register (PS_REGNUM), value);
ptrace (PT_WRITE_U, inferior_pid, (PTRACE_ARG3_TYPE) regaddr, value);
if (errno != 0)
{
@@ -116,21 +112,20 @@ store_inferior_registers (regno)
perror_with_name (buf);
}
}
else
for (regno = 0; regno < 15; regno++)
{
regaddr = offset + regno * 4;
errno = 0;
value = read_register (regno);
if (regno == PC_REGNUM)
value = SET_PC_PART (read_register (PS_REGNUM), value);
ptrace (6, inferior_pid, (PTRACE_ARG3_TYPE) regaddr, value);
if (errno != 0)
{
sprintf (buf, "writing all regs, number %d", regno);
perror_with_name (buf);
}
}
else for (regno = 0; regno < 15; regno++)
{
regaddr = offset + regno * 4;
errno = 0;
value = read_register(regno);
if (regno == PC_REGNUM)
value = SET_PC_PART(read_register (PS_REGNUM), value);
ptrace (6, inferior_pid, (PTRACE_ARG3_TYPE) regaddr, value);
if (errno != 0)
{
sprintf (buf, "writing all regs, number %d", regno);
perror_with_name (buf);
}
}
}
/* Work with core dump and executable files, for GDB.
@@ -140,21 +135,20 @@ store_inferior_registers (regno)
by the execfile.
e.g. prog shares Xt which shares X11 which shares c. */
struct shared_library
{
struct exec_header header;
char name[SHLIBLEN];
CORE_ADDR text_start; /* CORE_ADDR of 1st byte of text, this file */
long data_offset; /* offset of data section in file */
int chan; /* file descriptor for the file */
struct shared_library *shares; /* library this one shares */
struct shared_library {
struct exec_header header;
char name[SHLIBLEN];
CORE_ADDR text_start; /* CORE_ADDR of 1st byte of text, this file */
long data_offset; /* offset of data section in file */
int chan; /* file descriptor for the file */
struct shared_library *shares; /* library this one shares */
};
static struct shared_library *shlib = 0;
/* Hook for `exec_file_command' command to call. */
extern void (*exec_file_display_hook) ();
static CORE_ADDR unshared_text_start;
/* extended header from exec file (for shared library info) */
@@ -167,6 +161,7 @@ core_file_command (filename, from_tty)
int from_tty;
{
int val;
extern char registers[];
/* Discard all vestiges of any previous core file
and mark data and stack spaces as empty. */
@@ -190,7 +185,7 @@ core_file_command (filename, from_tty)
{
filename = tilde_expand (filename);
make_cleanup (free, filename);
if (have_inferior_p ())
error ("To look at a core file, you must kill the program with \"kill\".");
corechan = open (filename, O_RDONLY, 0);
@@ -224,7 +219,7 @@ core_file_command (filename, from_tty)
reg_offset = (int) u.u_ar0;
if (reg_offset > NBPG * UPAGES)
reg_offset -= KERNEL_U_ADDR;
fp_reg_offset = (char *) &u.u_fp_regs - (char *) &u;
fp_reg_offset = (char *) &u.u_fp_regs - (char *)&u;
/* I don't know where to find this info.
So, for now, mark it as not available. */
@@ -241,26 +236,26 @@ core_file_command (filename, from_tty)
char buf[MAX_REGISTER_RAW_SIZE];
if (regno < 16)
val = lseek (corechan, reg_offset + 4 * regno, 0);
val = lseek (corechan, reg_offset + 4 * regno, 0);
else if (regno < 24)
val = lseek (corechan, fp_reg_offset + 4 + 12 * (regno - 24), 0);
val = lseek (corechan, fp_reg_offset + 4 + 12*(regno - 24), 0);
else if (regno == 24)
val = lseek (corechan, fp_reg_offset, 0);
val = lseek (corechan, fp_reg_offset, 0);
else if (regno == 25)
val = lseek (corechan, reg_offset + 4 * PC, 0);
val = lseek (corechan, reg_offset + 4 * PC, 0);
if (val < 0
|| (val = myread (corechan, buf, sizeof buf)) < 0)
{
char *buffer = (char *) alloca (strlen (REGISTER_NAME (regno))
+ 30);
char * buffer = (char *) alloca (strlen (REGISTER_NAME (regno))
+ 30);
strcpy (buffer, "Reading register ");
strcat (buffer, REGISTER_NAME (regno));
perror_with_name (buffer);
}
if (regno == PC_REGNUM)
*(int *) buf = GET_PC_PART (*(int *) buf);
*(int *)buf = GET_PC_PART(*(int *)buf);
supply_register (regno, buf);
}
}
@@ -288,21 +283,20 @@ core_file_command (filename, from_tty)
by the execfile.
e.g. prog shares Xt which shares X11 which shares c. */
struct shared_library
{
struct exec_header header;
char name[SHLIBLEN];
CORE_ADDR text_start; /* CORE_ADDR of 1st byte of text, this file */
long data_offset; /* offset of data section in file */
int chan; /* file descriptor for the file */
struct shared_library *shares; /* library this one shares */
struct shared_library {
struct exec_header header;
char name[SHLIBLEN];
CORE_ADDR text_start; /* CORE_ADDR of 1st byte of text, this file */
long data_offset; /* offset of data section in file */
int chan; /* file descriptor for the file */
struct shared_library *shares; /* library this one shares */
};
static struct shared_library *shlib = 0;
/* Hook for `exec_file_command' command to call. */
extern void (*exec_file_display_hook) ();
static CORE_ADDR unshared_text_start;
/* extended header from exec file (for shared library info) */
@@ -332,11 +326,10 @@ exec_file_command (filename, from_tty)
if (execchan >= 0)
close (execchan);
execchan = -1;
if (shlib)
{
close_shared_library (shlib);
if (shlib) {
close_shared_library(shlib);
shlib = 0;
}
}
/* Now open and digest the file the user requested, if any. */
@@ -356,7 +349,7 @@ exec_file_command (filename, from_tty)
#ifdef HEADER_SEEK_FD
HEADER_SEEK_FD (execchan);
#endif
val = myread (execchan, &exec_header, sizeof exec_header);
exec_aouthdr = exec_header.a_exec;
@@ -367,23 +360,21 @@ exec_file_command (filename, from_tty)
/* Look for shared library if needed */
if (exec_header.a_exec.a_magic & MF_USES_SL)
shlib = open_shared_library (exec_header.a_shlibname, text_start);
shlib = open_shared_library(exec_header.a_shlibname, text_start);
text_offset = N_TXTOFF (exec_aouthdr);
exec_data_offset = N_TXTOFF (exec_aouthdr) + exec_aouthdr.a_text;
if (shlib)
{
unshared_text_start = shared_text_end (shlib) & ~0x7fff;
if (shlib) {
unshared_text_start = shared_text_end(shlib) & ~0x7fff;
stack_start = shlib->header.a_exec.a_sldatabase;
stack_end = STACK_END_ADDR;
}
else
unshared_text_start = 0x8000;
} else
unshared_text_start = 0x8000;
text_end = unshared_text_start + exec_aouthdr.a_text;
exec_data_start = unshared_text_start + exec_aouthdr.a_text;
exec_data_end = exec_data_start + exec_aouthdr.a_data;
exec_data_end = exec_data_start + exec_aouthdr.a_data;
data_start = exec_data_start;
data_end += exec_data_start;
@@ -431,19 +422,19 @@ xfer_core_file (memaddr, myaddr, len)
xferchan = 0;
/* Determine which file the next bunch of addresses reside in,
and where in the file. Set the file's read/write pointer
to point at the proper place for the desired address
and set xferfile and xferchan for the correct file.
and where in the file. Set the file's read/write pointer
to point at the proper place for the desired address
and set xferfile and xferchan for the correct file.
If desired address is nonexistent, leave them zero.
If desired address is nonexistent, leave them zero.
i is set to the number of bytes that can be handled
along with the next address.
i is set to the number of bytes that can be handled
along with the next address.
We put the most likely tests first for efficiency. */
We put the most likely tests first for efficiency. */
/* Note that if there is no core file
data_start and data_end are equal. */
data_start and data_end are equal. */
if (memaddr >= data_start && memaddr < data_end)
{
i = min (len, data_end - memaddr);
@@ -452,33 +443,29 @@ xfer_core_file (memaddr, myaddr, len)
xferchan = corechan;
}
/* Note that if there is no core file
stack_start and stack_end define the shared library data. */
stack_start and stack_end define the shared library data. */
else if (memaddr >= stack_start && memaddr < stack_end)
{
if (corechan < 0)
{
struct shared_library *lib;
for (lib = shlib; lib; lib = lib->shares)
if (memaddr >= lib->header.a_exec.a_sldatabase &&
memaddr < lib->header.a_exec.a_sldatabase +
lib->header.a_exec.a_data)
break;
if (lib)
{
i = min (len, lib->header.a_exec.a_sldatabase +
lib->header.a_exec.a_data - memaddr);
fileptr = lib->data_offset + memaddr -
lib->header.a_exec.a_sldatabase;
xferfile = execfile;
xferchan = lib->chan;
if (corechan < 0) {
struct shared_library *lib;
for (lib = shlib; lib; lib = lib->shares)
if (memaddr >= lib->header.a_exec.a_sldatabase &&
memaddr < lib->header.a_exec.a_sldatabase +
lib->header.a_exec.a_data)
break;
if (lib) {
i = min (len, lib->header.a_exec.a_sldatabase +
lib->header.a_exec.a_data - memaddr);
fileptr = lib->data_offset + memaddr -
lib->header.a_exec.a_sldatabase;
xferfile = execfile;
xferchan = lib->chan;
}
}
else
{
i = min (len, stack_end - memaddr);
fileptr = memaddr - stack_start + stack_offset;
xferfile = &corefile;
xferchan = corechan;
} else {
i = min (len, stack_end - memaddr);
fileptr = memaddr - stack_start + stack_offset;
xferfile = &corefile;
xferchan = corechan;
}
}
else if (corechan < 0
@@ -491,25 +478,22 @@ xfer_core_file (memaddr, myaddr, len)
}
else if (memaddr >= text_start && memaddr < text_end)
{
struct shared_library *lib;
for (lib = shlib; lib; lib = lib->shares)
if (memaddr >= lib->text_start &&
memaddr < lib->text_start + lib->header.a_exec.a_text)
break;
if (lib)
{
i = min (len, lib->header.a_exec.a_text +
lib->text_start - memaddr);
fileptr = memaddr - lib->text_start + text_offset;
xferfile = &execfile;
xferchan = lib->chan;
}
else
{
i = min (len, text_end - memaddr);
fileptr = memaddr - unshared_text_start + text_offset;
xferfile = &execfile;
xferchan = execchan;
struct shared_library *lib;
for (lib = shlib; lib; lib = lib->shares)
if (memaddr >= lib->text_start &&
memaddr < lib->text_start + lib->header.a_exec.a_text)
break;
if (lib) {
i = min (len, lib->header.a_exec.a_text +
lib->text_start - memaddr);
fileptr = memaddr - lib->text_start + text_offset;
xferfile = &execfile;
xferchan = lib->chan;
} else {
i = min (len, text_end - memaddr);
fileptr = memaddr - unshared_text_start + text_offset;
xferfile = &execfile;
xferchan = execchan;
}
}
else if (memaddr < text_start)
@@ -517,7 +501,7 @@ xfer_core_file (memaddr, myaddr, len)
i = min (len, text_start - memaddr);
}
else if (memaddr >= text_end
&& memaddr < (corechan >= 0 ? data_start : exec_data_start))
&& memaddr < (corechan >= 0? data_start : exec_data_start))
{
i = min (len, data_start - memaddr);
}
@@ -528,21 +512,21 @@ xfer_core_file (memaddr, myaddr, len)
}
else if (corechan < 0 && memaddr >= exec_data_end)
{
i = min (len, -memaddr);
i = min (len, - memaddr);
}
else if (memaddr >= stack_end && stack_end != 0)
{
i = min (len, -memaddr);
i = min (len, - memaddr);
}
else
{
/* Address did not classify into one of the known ranges.
This shouldn't happen; we catch the endpoints. */
internal_error ("Bad case logic in xfer_core_file.");
fatal ("Internal: Bad case logic in xfer_core_file.");
}
/* Now we know which file to use.
Set up its pointer and transfer the data. */
Set up its pointer and transfer the data. */
if (xferfile)
{
if (*xferfile == 0)
@@ -558,8 +542,8 @@ xfer_core_file (memaddr, myaddr, len)
perror_with_name (*xferfile);
}
/* If this address is for nonexistent memory,
read zeros if reading, or do nothing if writing.
Actually, we never right. */
read zeros if reading, or do nothing if writing.
Actually, we never right. */
else
{
memset (myaddr, '\0', i);

View File

@@ -1,22 +1,23 @@
/* GDB-specific functions for operating on agent expressions
Copyright 1998 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* $Id$ */
#include "defs.h"
#include "symtab.h"
@@ -44,20 +45,20 @@
pay for the simplicity of this code with less-than-optimal bytecode
strings.
Remember, "GBD" stands for "Great Britain, Dammit!" So be careful. */
Remember, "GBD" stands for "Great Britain, Dammit!" So be careful. */
/* Prototypes for local functions. */
/* There's a standard order to the arguments of these functions:
union exp_element ** --- pointer into expression
struct agent_expr * --- agent expression buffer to generate code into
struct axs_value * --- describes value left on top of stack */
static struct value *const_var_ref PARAMS ((struct symbol * var));
static struct value *const_expr PARAMS ((union exp_element ** pc));
static struct value *maybe_const_expr PARAMS ((union exp_element ** pc));
static struct value *const_var_ref PARAMS ((struct symbol *var));
static struct value *const_expr PARAMS ((union exp_element **pc));
static struct value *maybe_const_expr PARAMS ((union exp_element **pc));
static void gen_traced_pop PARAMS ((struct agent_expr *, struct axs_value *));
@@ -67,91 +68,91 @@ static void gen_fetch PARAMS ((struct agent_expr *, struct type *));
static void gen_left_shift PARAMS ((struct agent_expr *, int));
static void gen_frame_args_address PARAMS ((struct agent_expr *));
static void gen_frame_args_address PARAMS ((struct agent_expr *));
static void gen_frame_locals_address PARAMS ((struct agent_expr *));
static void gen_offset PARAMS ((struct agent_expr * ax, int offset));
static void gen_offset PARAMS ((struct agent_expr *ax, int offset));
static void gen_sym_offset PARAMS ((struct agent_expr *, struct symbol *));
static void gen_var_ref PARAMS ((struct agent_expr * ax,
struct axs_value * value,
struct symbol * var));
static void gen_var_ref PARAMS ((struct agent_expr *ax,
struct axs_value *value,
struct symbol *var));
static void gen_int_literal PARAMS ((struct agent_expr * ax,
struct axs_value * value,
LONGEST k, struct type * type));
static void gen_int_literal PARAMS ((struct agent_expr *ax,
struct axs_value *value,
LONGEST k, struct type *type));
static void require_rvalue PARAMS ((struct agent_expr * ax,
struct axs_value * value));
static void gen_usual_unary PARAMS ((struct agent_expr * ax,
struct axs_value * value));
static int type_wider_than PARAMS ((struct type * type1,
struct type * type2));
static struct type *max_type PARAMS ((struct type * type1,
struct type * type2));
static void gen_conversion PARAMS ((struct agent_expr * ax,
struct type * from,
struct type * to));
static int is_nontrivial_conversion PARAMS ((struct type * from,
struct type * to));
static void gen_usual_arithmetic PARAMS ((struct agent_expr * ax,
struct axs_value * value1,
struct axs_value * value2));
static void gen_integral_promotions PARAMS ((struct agent_expr * ax,
struct axs_value * value));
static void gen_cast PARAMS ((struct agent_expr * ax,
struct axs_value * value,
struct type * type));
static void gen_scale PARAMS ((struct agent_expr * ax,
static void require_rvalue PARAMS ((struct agent_expr *ax,
struct axs_value *value));
static void gen_usual_unary PARAMS ((struct agent_expr *ax,
struct axs_value *value));
static int type_wider_than PARAMS ((struct type *type1,
struct type *type2));
static struct type *max_type PARAMS ((struct type *type1,
struct type *type2));
static void gen_conversion PARAMS ((struct agent_expr *ax,
struct type *from,
struct type *to));
static int is_nontrivial_conversion PARAMS ((struct type *from,
struct type *to));
static void gen_usual_arithmetic PARAMS ((struct agent_expr *ax,
struct axs_value *value1,
struct axs_value *value2));
static void gen_integral_promotions PARAMS ((struct agent_expr *ax,
struct axs_value *value));
static void gen_cast PARAMS ((struct agent_expr *ax,
struct axs_value *value,
struct type *type));
static void gen_scale PARAMS ((struct agent_expr *ax,
enum agent_op op,
struct type * type));
static void gen_add PARAMS ((struct agent_expr * ax,
struct axs_value * value,
struct axs_value * value1,
struct axs_value * value2,
struct type *type));
static void gen_add PARAMS ((struct agent_expr *ax,
struct axs_value *value,
struct axs_value *value1,
struct axs_value *value2,
char *name));
static void gen_sub PARAMS ((struct agent_expr * ax,
struct axs_value * value,
struct axs_value * value1,
struct axs_value * value2));
static void gen_binop PARAMS ((struct agent_expr * ax,
struct axs_value * value,
struct axs_value * value1,
struct axs_value * value2,
static void gen_sub PARAMS ((struct agent_expr *ax,
struct axs_value *value,
struct axs_value *value1,
struct axs_value *value2));
static void gen_binop PARAMS ((struct agent_expr *ax,
struct axs_value *value,
struct axs_value *value1,
struct axs_value *value2,
enum agent_op op,
enum agent_op op_unsigned,
int may_carry,
char *name));
static void gen_logical_not PARAMS ((struct agent_expr * ax,
struct axs_value * value));
static void gen_complement PARAMS ((struct agent_expr * ax,
struct axs_value * value));
static void gen_logical_not PARAMS ((struct agent_expr *ax,
struct axs_value *value));
static void gen_complement PARAMS ((struct agent_expr *ax,
struct axs_value *value));
static void gen_deref PARAMS ((struct agent_expr *, struct axs_value *));
static void gen_address_of PARAMS ((struct agent_expr *, struct axs_value *));
static int find_field PARAMS ((struct type * type, char *name));
static void gen_bitfield_ref PARAMS ((struct agent_expr * ax,
struct axs_value * value,
struct type * type,
static int find_field PARAMS ((struct type *type, char *name));
static void gen_bitfield_ref PARAMS ((struct agent_expr *ax,
struct axs_value *value,
struct type *type,
int start, int end));
static void gen_struct_ref PARAMS ((struct agent_expr * ax,
struct axs_value * value,
static void gen_struct_ref PARAMS ((struct agent_expr *ax,
struct axs_value *value,
char *field,
char *operator_name,
char *operand_name));
static void gen_repeat PARAMS ((union exp_element ** pc,
struct agent_expr * ax,
struct axs_value * value));
static void gen_sizeof PARAMS ((union exp_element ** pc,
struct agent_expr * ax,
struct axs_value * value));
static void gen_expr PARAMS ((union exp_element ** pc,
struct agent_expr * ax,
struct axs_value * value));
static void gen_repeat PARAMS ((union exp_element **pc,
struct agent_expr *ax,
struct axs_value *value));
static void gen_sizeof PARAMS ((union exp_element **pc,
struct agent_expr *ax,
struct axs_value *value));
static void gen_expr PARAMS ((union exp_element **pc,
struct agent_expr *ax,
struct axs_value *value));
static void print_axs_value PARAMS ((GDB_FILE * f, struct axs_value * value));
static void print_axs_value PARAMS ((GDB_FILE *f, struct axs_value *value));
static void agent_command PARAMS ((char *exp, int from_tty));
/* Detecting constant expressions. */
/* If the variable reference at *PC is a constant, return its value.
@@ -220,7 +221,7 @@ const_expr (pc)
return v;
}
/* We could add more operators in here. */
/* We could add more operators in here. */
case UNOP_NEG:
(*pc)++;
@@ -248,11 +249,11 @@ maybe_const_expr (pc)
/* If we got a value, then update the real PC. */
if (v)
*pc = tentative_pc;
return v;
}
/* Generating bytecode from GDB expressions: general assumptions */
/* Here are a few general assumptions made throughout the code; if you
@@ -260,43 +261,43 @@ maybe_const_expr (pc)
better scan things pretty thoroughly.
- We assume that all values occupy one stack element. For example,
sometimes we'll swap to get at the left argument to a binary
operator. If we decide that void values should occupy no stack
elements, or that synthetic arrays (whose size is determined at
run time, created by the `@' operator) should occupy two stack
elements (address and length), then this will cause trouble.
sometimes we'll swap to get at the left argument to a binary
operator. If we decide that void values should occupy no stack
elements, or that synthetic arrays (whose size is determined at
run time, created by the `@' operator) should occupy two stack
elements (address and length), then this will cause trouble.
- We assume the stack elements are infinitely wide, and that we
don't have to worry what happens if the user requests an
operation that is wider than the actual interpreter's stack.
That is, it's up to the interpreter to handle directly all the
integer widths the user has access to. (Woe betide the language
with bignums!)
don't have to worry what happens if the user requests an
operation that is wider than the actual interpreter's stack.
That is, it's up to the interpreter to handle directly all the
integer widths the user has access to. (Woe betide the language
with bignums!)
- We don't support side effects. Thus, we don't have to worry about
GCC's generalized lvalues, function calls, etc.
GCC's generalized lvalues, function calls, etc.
- We don't support floating point. Many places where we switch on
some type don't bother to include cases for floating point; there
may be even more subtle ways this assumption exists. For
example, the arguments to % must be integers.
some type don't bother to include cases for floating point; there
may be even more subtle ways this assumption exists. For
example, the arguments to % must be integers.
- We assume all subexpressions have a static, unchanging type. If
we tried to support convenience variables, this would be a
problem.
we tried to support convenience variables, this would be a
problem.
- All values on the stack should always be fully zero- or
sign-extended.
sign-extended.
(I wasn't sure whether to choose this or its opposite --- that
only addresses are assumed extended --- but it turns out that
neither convention completely eliminates spurious extend
operations (if everything is always extended, then you have to
extend after add, because it could overflow; if nothing is
extended, then you end up producing extends whenever you change
sizes), and this is simpler.) */
(I wasn't sure whether to choose this or its opposite --- that
only addresses are assumed extended --- but it turns out that
neither convention completely eliminates spurious extend
operations (if everything is always extended, then you have to
extend after add, because it could overflow; if nothing is
extended, then you end up producing extends whenever you change
sizes), and this is simpler.) */
/* Generating bytecode from GDB expressions: the `trace' kludge */
/* The compiler in this file is a general-purpose mechanism for
@@ -335,7 +336,7 @@ gen_traced_pop (ax, value)
{
case axs_rvalue:
/* We don't trace rvalues, just the lvalues necessary to
produce them. So just dispose of this value. */
produce them. So just dispose of this value. */
ax_simple (ax, aop_pop);
break;
@@ -351,7 +352,7 @@ gen_traced_pop (ax, value)
ax_const_l (ax, length);
ax_simple (ax, aop_trace);
}
break;
break;
case axs_lvalue_register:
/* We need to mention the register somewhere in the bytecode,
@@ -365,9 +366,9 @@ gen_traced_pop (ax, value)
/* If we're not tracing, just pop the value. */
ax_simple (ax, aop_pop);
}
/* Generating bytecode from GDB expressions: helper functions */
/* Assume that the lower bits of the top of the stack is a value of
@@ -378,7 +379,7 @@ gen_sign_extend (ax, type)
struct type *type;
{
/* Do we need to sign-extend this? */
if (!TYPE_UNSIGNED (type))
if (! TYPE_UNSIGNED (type))
ax_ext (ax, type->length * TARGET_CHAR_BIT);
}
@@ -421,18 +422,10 @@ gen_fetch (ax, type)
many bytes long is it? */
switch (type->length)
{
case 8 / TARGET_CHAR_BIT:
ax_simple (ax, aop_ref8);
break;
case 16 / TARGET_CHAR_BIT:
ax_simple (ax, aop_ref16);
break;
case 32 / TARGET_CHAR_BIT:
ax_simple (ax, aop_ref32);
break;
case 64 / TARGET_CHAR_BIT:
ax_simple (ax, aop_ref64);
break;
case 8 / TARGET_CHAR_BIT: ax_simple (ax, aop_ref8 ); break;
case 16 / TARGET_CHAR_BIT: ax_simple (ax, aop_ref16); break;
case 32 / TARGET_CHAR_BIT: ax_simple (ax, aop_ref32); break;
case 64 / TARGET_CHAR_BIT: ax_simple (ax, aop_ref64); break;
/* Either our caller shouldn't have asked us to dereference
that pointer (other code's fault), or we're not
@@ -447,9 +440,9 @@ gen_fetch (ax, type)
default:
/* Either our caller shouldn't have asked us to dereference that
pointer (other code's fault), or we're not implementing
something we should be (this code's fault). In any case,
it's a bug the user shouldn't see. */
pointer (other code's fault), or we're not implementing
something we should be (this code's fault). In any case,
it's a bug the user shouldn't see. */
error ("GDB bug: ax-gdb.c (gen_fetch): bad type code");
}
}
@@ -474,9 +467,9 @@ gen_left_shift (ax, distance)
ax_simple (ax, aop_rsh_unsigned);
}
}
/* Generating bytecode from GDB expressions: symbol references */
/* Generate code to push the base address of the argument portion of
@@ -488,7 +481,7 @@ gen_frame_args_address (ax)
long frame_reg, frame_offset;
TARGET_VIRTUAL_FRAME_POINTER (ax->scope, &frame_reg, &frame_offset);
ax_reg (ax, frame_reg);
ax_reg (ax, frame_reg);
gen_offset (ax, frame_offset);
}
@@ -502,7 +495,7 @@ gen_frame_locals_address (ax)
long frame_reg, frame_offset;
TARGET_VIRTUAL_FRAME_POINTER (ax->scope, &frame_reg, &frame_offset);
ax_reg (ax, frame_reg);
ax_reg (ax, frame_reg);
gen_offset (ax, frame_offset);
}
@@ -629,9 +622,9 @@ gen_var_ref (ax, value, var)
break;
/* A lot like LOC_REF_ARG, but the pointer lives directly in a
register, not on the stack. Simpler than LOC_REGISTER and
LOC_REGPARM, because it's just like any other case where the
thing has a real address. */
register, not on the stack. Simpler than LOC_REGISTER and
LOC_REGPARM, because it's just like any other case where the
thing has a real address. */
case LOC_REGPARM_ADDR:
ax_reg (ax, SYMBOL_VALUE (var));
value->kind = axs_lvalue_memory;
@@ -639,16 +632,16 @@ gen_var_ref (ax, value, var)
case LOC_UNRESOLVED:
{
struct minimal_symbol *msym
= lookup_minimal_symbol (SYMBOL_NAME (var), NULL, NULL);
if (!msym)
struct minimal_symbol *msym
= lookup_minimal_symbol (SYMBOL_NAME (var), NULL, NULL);
if (! msym)
error ("Couldn't resolve symbol `%s'.", SYMBOL_SOURCE_NAME (var));
/* Push the address of the variable. */
ax_const_l (ax, SYMBOL_VALUE_ADDRESS (msym));
value->kind = axs_lvalue_memory;
}
break;
break;
case LOC_OPTIMIZED_OUT:
error ("The variable `%s' has been optimized out.",
@@ -661,9 +654,9 @@ gen_var_ref (ax, value, var)
break;
}
}
/* Generating bytecode from GDB expressions: literals */
static void
@@ -677,9 +670,9 @@ gen_int_literal (ax, value, k, type)
value->kind = axs_rvalue;
value->type = type;
}
/* Generating bytecode from GDB expressions: unary conversions, casts */
/* Take what's on the top of the stack (as described by VALUE), and
@@ -705,8 +698,8 @@ require_rvalue (ax, value)
/* There's nothing on the stack, but value->u.reg is the
register number containing the value.
When we add floating-point support, this is going to have to
change. What about SPARC register pairs, for example? */
When we add floating-point support, this is going to have to
change. What about SPARC register pairs, for example? */
ax_reg (ax, value->u.reg);
gen_extend (ax, value->type);
break;
@@ -751,7 +744,7 @@ gen_usual_unary (ax, value)
break;
/* Arrays get converted to a pointer to their first element, and
are no longer an lvalue. */
are no longer an lvalue. */
case TYPE_CODE_ARRAY:
{
struct type *elements = TYPE_TARGET_TYPE (value->type);
@@ -760,10 +753,10 @@ gen_usual_unary (ax, value)
/* We don't need to generate any code; the address of the array
is also the address of its first element. */
}
break;
break;
/* Don't try to convert structures and unions to rvalues. Let the
consumer signal an error. */
/* Don't try to convert structures and unions to rvalues. Let the
consumer signal an error. */
case TYPE_CODE_STRUCT:
case TYPE_CODE_UNION:
return;
@@ -788,7 +781,7 @@ type_wider_than (type1, type2)
return (TYPE_LENGTH (type1) > TYPE_LENGTH (type2)
|| (TYPE_LENGTH (type1) == TYPE_LENGTH (type2)
&& TYPE_UNSIGNED (type1)
&& !TYPE_UNSIGNED (type2)));
&& ! TYPE_UNSIGNED (type2)));
}
@@ -869,10 +862,10 @@ gen_usual_arithmetic (ax, value1, value2)
&& TYPE_CODE (value2->type) == TYPE_CODE_INT)
{
/* The ANSI integral promotions seem to work this way: Order the
integer types by size, and then by signedness: an n-bit
unsigned type is considered "wider" than an n-bit signed
type. Promote to the "wider" of the two types, and always
promote at least to int. */
integer types by size, and then by signedness: an n-bit
unsigned type is considered "wider" than an n-bit signed
type. Promote to the "wider" of the two types, and always
promote at least to int. */
struct type *target = max_type (builtin_type_int,
max_type (value1->type, value2->type));
@@ -902,12 +895,12 @@ gen_integral_promotions (ax, value)
struct agent_expr *ax;
struct axs_value *value;
{
if (!type_wider_than (value->type, builtin_type_int))
if (! type_wider_than (value->type, builtin_type_int))
{
gen_conversion (ax, value->type, builtin_type_int);
value->type = builtin_type_int;
}
else if (!type_wider_than (value->type, builtin_type_unsigned_int))
else if (! type_wider_than (value->type, builtin_type_unsigned_int))
{
gen_conversion (ax, value->type, builtin_type_unsigned_int);
value->type = builtin_type_unsigned_int;
@@ -949,16 +942,16 @@ gen_cast (ax, value, type)
cast like this? */
value->type = type;
break;
case TYPE_CODE_INT:
gen_conversion (ax, value->type, type);
break;
case TYPE_CODE_VOID:
/* We could pop the value, and rely on everyone else to check
the type and notice that this value doesn't occupy a stack
slot. But for now, leave the value on the stack, and
preserve the "value == stack element" assumption. */
the type and notice that this value doesn't occupy a stack
slot. But for now, leave the value on the stack, and
preserve the "value == stack element" assumption. */
break;
default:
@@ -967,9 +960,9 @@ gen_cast (ax, value, type)
value->type = type;
}
/* Generating bytecode from GDB expressions: arithmetic */
/* Scale the integer on the top of the stack by the size of the target
@@ -1009,7 +1002,7 @@ gen_add (ax, value, value1, value2, name)
ax_simple (ax, aop_swap);
gen_scale (ax, aop_mul, value2->type);
ax_simple (ax, aop_add);
gen_extend (ax, value2->type); /* Catch overflow. */
gen_extend (ax, value2->type); /* Catch overflow. */
value->type = value2->type;
}
@@ -1019,7 +1012,7 @@ gen_add (ax, value, value1, value2, name)
{
gen_scale (ax, aop_mul, value1->type);
ax_simple (ax, aop_add);
gen_extend (ax, value1->type); /* Catch overflow. */
gen_extend (ax, value1->type); /* Catch overflow. */
value->type = value1->type;
}
@@ -1029,7 +1022,7 @@ gen_add (ax, value, value1, value2, name)
&& value2->type->code == TYPE_CODE_INT)
{
ax_simple (ax, aop_add);
gen_extend (ax, value1->type); /* Catch overflow. */
gen_extend (ax, value1->type); /* Catch overflow. */
value->type = value1->type;
}
@@ -1058,20 +1051,20 @@ gen_sub (ax, value, value1, value2)
{
gen_scale (ax, aop_mul, value1->type);
ax_simple (ax, aop_sub);
gen_extend (ax, value1->type); /* Catch overflow. */
gen_extend (ax, value1->type); /* Catch overflow. */
value->type = value1->type;
}
/* Is it PTR - PTR? Strictly speaking, the types ought to
match, but this is what the normal GDB expression evaluator
tests for. */
match, but this is what the normal GDB expression evaluator
tests for. */
else if (value2->type->code == TYPE_CODE_PTR
&& (TYPE_LENGTH (TYPE_TARGET_TYPE (value1->type))
== TYPE_LENGTH (TYPE_TARGET_TYPE (value2->type))))
{
ax_simple (ax, aop_sub);
gen_scale (ax, aop_div_unsigned, value1->type);
value->type = builtin_type_long; /* FIXME --- should be ptrdiff_t */
value->type = builtin_type_long; /* FIXME --- should be ptrdiff_t */
}
else
error ("\
@@ -1084,10 +1077,10 @@ an integer nor a pointer of the same type.");
&& value2->type->code == TYPE_CODE_INT)
{
ax_simple (ax, aop_sub);
gen_extend (ax, value1->type); /* Catch overflow. */
gen_extend (ax, value1->type); /* Catch overflow. */
value->type = value1->type;
}
else
error ("Illegal combination of types in subtraction.");
@@ -1112,11 +1105,11 @@ gen_binop (ax, value, value1, value2, op, op_unsigned, may_carry, name)
if ((value1->type->code != TYPE_CODE_INT)
|| (value2->type->code != TYPE_CODE_INT))
error ("Illegal combination of types in %s.", name);
ax_simple (ax,
TYPE_UNSIGNED (value1->type) ? op_unsigned : op);
if (may_carry)
gen_extend (ax, value1->type); /* catch overflow */
gen_extend (ax, value1->type); /* catch overflow */
value->type = value1->type;
value->kind = axs_rvalue;
}
@@ -1150,9 +1143,9 @@ gen_complement (ax, value)
ax_simple (ax, aop_bit_not);
gen_extend (ax, value->type);
}
/* Generating bytecode from GDB expressions: * & . -> @ sizeof */
/* Dereference the value on the top of the stack. */
@@ -1256,8 +1249,7 @@ gen_bitfield_ref (ax, value, type, start, end)
{
/* Note that ops[i] fetches 8 << i bits. */
static enum agent_op ops[]
=
{aop_ref8, aop_ref16, aop_ref32, aop_ref64};
= { aop_ref8, aop_ref16, aop_ref32, aop_ref64 };
static int num_ops = (sizeof (ops) / sizeof (ops[0]));
/* We don't want to touch any byte that the bitfield doesn't
@@ -1268,19 +1260,19 @@ gen_bitfield_ref (ax, value, type, start, end)
It takes some fancy footwork to get the stack to work the way
we'd like. Say we're retrieving a bitfield that requires three
fetches. Initially, the stack just contains the address:
addr
addr
For the first fetch, we duplicate the address
addr addr
addr addr
then add the byte offset, do the fetch, and shift and mask as
needed, yielding a fragment of the value, properly aligned for
the final bitwise or:
addr frag1
addr frag1
then we swap, and repeat the process:
frag1 addr --- address on top
frag1 addr addr --- duplicate it
frag1 addr frag2 --- get second fragment
frag1 frag2 addr --- swap again
frag1 frag2 frag3 --- get third fragment
frag1 addr --- address on top
frag1 addr addr --- duplicate it
frag1 addr frag2 --- get second fragment
frag1 frag2 addr --- swap again
frag1 frag2 frag3 --- get third fragment
Notice that, since the third fragment is the last one, we don't
bother duplicating the address this time. Now we have all the
fragments on the stack, and we can simply `or' them together,
@@ -1289,9 +1281,9 @@ gen_bitfield_ref (ax, value, type, start, end)
/* The first and one-after-last bits in the field, but rounded down
and up to byte boundaries. */
int bound_start = (start / TARGET_CHAR_BIT) * TARGET_CHAR_BIT;
int bound_end = (((end + TARGET_CHAR_BIT - 1)
/ TARGET_CHAR_BIT)
* TARGET_CHAR_BIT);
int bound_end = (((end + TARGET_CHAR_BIT - 1)
/ TARGET_CHAR_BIT)
* TARGET_CHAR_BIT);
/* current bit offset within the structure */
int offset;
@@ -1320,17 +1312,17 @@ gen_bitfield_ref (ax, value, type, start, end)
int op_size = 8 << op;
/* The stack at this point, from bottom to top, contains zero or
more fragments, then the address. */
more fragments, then the address. */
/* Does this fetch fit within the bitfield? */
if (offset + op_size <= bound_end)
{
/* Is this the last fragment? */
int last_frag = (offset + op_size == bound_end);
if (!last_frag)
ax_simple (ax, aop_dup); /* keep a copy of the address */
if (! last_frag)
ax_simple (ax, aop_dup); /* keep a copy of the address */
/* Add the offset. */
gen_offset (ax, offset / TARGET_CHAR_BIT);
@@ -1342,47 +1334,47 @@ gen_bitfield_ref (ax, value, type, start, end)
/* Perform the fetch. */
ax_simple (ax, ops[op]);
/* Shift the bits we have to their proper position.
/* Shift the bits we have to their proper position.
gen_left_shift will generate right shifts when the operand
is negative.
A big-endian field diagram to ponder:
byte 0 byte 1 byte 2 byte 3 byte 4 byte 5 byte 6 byte 7
+------++------++------++------++------++------++------++------+
xxxxAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBCCCCCxxxxxxxxxxx
^ ^ ^ ^
bit number 16 32 48 53
A big-endian field diagram to ponder:
byte 0 byte 1 byte 2 byte 3 byte 4 byte 5 byte 6 byte 7
+------++------++------++------++------++------++------++------+
xxxxAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBCCCCCxxxxxxxxxxx
^ ^ ^ ^
bit number 16 32 48 53
These are bit numbers as supplied by GDB. Note that the
bit numbers run from right to left once you've fetched the
value!
A little-endian field diagram to ponder:
byte 7 byte 6 byte 5 byte 4 byte 3 byte 2 byte 1 byte 0
+------++------++------++------++------++------++------++------+
xxxxxxxxxxxAAAAABBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCxxxx
^ ^ ^ ^ ^
bit number 48 32 16 4 0
A little-endian field diagram to ponder:
byte 7 byte 6 byte 5 byte 4 byte 3 byte 2 byte 1 byte 0
+------++------++------++------++------++------++------++------+
xxxxxxxxxxxAAAAABBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCxxxx
^ ^ ^ ^ ^
bit number 48 32 16 4 0
In both cases, the most significant end is on the left
(i.e. normal numeric writing order), which means that you
don't go crazy thinking about `left' and `right' shifts.
In both cases, the most significant end is on the left
(i.e. normal numeric writing order), which means that you
don't go crazy thinking about `left' and `right' shifts.
We don't have to worry about masking yet:
- If they contain garbage off the least significant end, then we
must be looking at the low end of the field, and the right
shift will wipe them out.
- If they contain garbage off the most significant end, then we
must be looking at the most significant end of the word, and
the sign/zero extension will wipe them out.
- If we're in the interior of the word, then there is no garbage
on either end, because the ref operators zero-extend. */
We don't have to worry about masking yet:
- If they contain garbage off the least significant end, then we
must be looking at the low end of the field, and the right
shift will wipe them out.
- If they contain garbage off the most significant end, then we
must be looking at the most significant end of the word, and
the sign/zero extension will wipe them out.
- If we're in the interior of the word, then there is no garbage
on either end, because the ref operators zero-extend. */
if (TARGET_BYTE_ORDER == BIG_ENDIAN)
gen_left_shift (ax, end - (offset + op_size));
else
else
gen_left_shift (ax, offset - start);
if (!last_frag)
if (! last_frag)
/* Bring the copy of the address up to the top. */
ax_simple (ax, aop_swap);
@@ -1443,7 +1435,7 @@ gen_struct_ref (ax, value, field, operator_name, operand_name)
error ("Structure does not live in memory.");
i = find_field (type, field);
/* Is this a bitfield? */
if (TYPE_FIELD_PACKED (type, i))
gen_bitfield_ref (ax, value, TYPE_FIELD_TYPE (type, i),
@@ -1488,7 +1480,7 @@ gen_repeat (pc, ax, value)
struct value *v = const_expr (pc);
int length;
if (!v)
if (! v)
error ("Right operand of `@' must be a constant, in agent expressions.");
if (v->type->code != TYPE_CODE_INT)
error ("Right operand of `@' must be an integer.");
@@ -1500,9 +1492,9 @@ gen_repeat (pc, ax, value)
all we need to do is frob the type of the lvalue. */
{
/* FIXME-type-allocation: need a way to free this type when we are
done with it. */
done with it. */
struct type *range
= create_range_type (0, builtin_type_int, 0, length - 1);
= create_range_type (0, builtin_type_int, 0, length - 1);
struct type *array = create_array_type (0, value1.type, range);
value->kind = axs_lvalue_memory;
@@ -1531,13 +1523,13 @@ gen_sizeof (pc, ax, value)
/* Throw away the code we just generated. */
ax->len = start;
ax_const_l (ax, TYPE_LENGTH (value->type));
value->kind = axs_rvalue;
value->type = builtin_type_int;
}
/* Generating bytecode from GDB expressions: general recursive thingy */
/* A gen_expr function written by a Gen-X'er guy.
@@ -1555,7 +1547,7 @@ gen_expr (pc, ax, value)
/* If we're looking at a constant expression, just push its value. */
{
struct value *v = maybe_const_expr (pc);
if (v)
{
ax_const_l (ax, value_as_long (v));
@@ -1627,28 +1619,28 @@ gen_expr (pc, ax, value)
default:
/* We should only list operators in the outer case statement
that we actually handle in the inner case statement. */
that we actually handle in the inner case statement. */
error ("GDB bug: ax-gdb.c (gen_expr): op case sets don't match");
}
break;
/* Note that we need to be a little subtle about generating code
for comma. In C, we can do some optimizations here because
we know the left operand is only being evaluated for effect.
However, if the tracing kludge is in effect, then we always
need to evaluate the left hand side fully, so that all the
variables it mentions get traced. */
for comma. In C, we can do some optimizations here because
we know the left operand is only being evaluated for effect.
However, if the tracing kludge is in effect, then we always
need to evaluate the left hand side fully, so that all the
variables it mentions get traced. */
case BINOP_COMMA:
(*pc)++;
gen_expr (pc, ax, &value1);
/* Don't just dispose of the left operand. We might be tracing,
in which case we want to emit code to trace it if it's an
lvalue. */
in which case we want to emit code to trace it if it's an
lvalue. */
gen_traced_pop (ax, &value1);
gen_expr (pc, ax, value);
/* It's the consumer's responsibility to trace the right operand. */
break;
case OP_LONG: /* some integer constant */
{
struct type *type = (*pc)[1].type;
@@ -1656,7 +1648,7 @@ gen_expr (pc, ax, value)
(*pc) += 4;
gen_int_literal (ax, value, k, type);
}
break;
break;
case OP_VAR_VALUE:
gen_var_ref (ax, value, (*pc)[2].symbol);
@@ -1671,12 +1663,12 @@ gen_expr (pc, ax, value)
value->u.reg = reg;
value->type = REGISTER_VIRTUAL_TYPE (reg);
}
break;
break;
case OP_INTERNALVAR:
error ("GDB agent expressions cannot use convenience variables.");
/* Weirdo operator: see comments for gen_repeat for details. */
/* Weirdo operator: see comments for gen_repeat for details. */
case BINOP_REPEAT:
/* Note that gen_repeat handles its own argument evaluation. */
(*pc)++;
@@ -1690,7 +1682,7 @@ gen_expr (pc, ax, value)
gen_expr (pc, ax, value);
gen_cast (ax, value, type);
}
break;
break;
case UNOP_MEMVAL:
{
@@ -1707,13 +1699,13 @@ gen_expr (pc, ax, value)
value->type = type;
value->kind = axs_lvalue_memory;
}
break;
break;
case UNOP_NEG:
(*pc)++;
/* -FOO is equivalent to 0 - FOO. */
gen_int_literal (ax, &value1, (LONGEST) 0, builtin_type_int);
gen_usual_unary (ax, &value1); /* shouldn't do much */
gen_usual_unary (ax, &value1); /* shouldn't do much */
gen_expr (pc, ax, &value2);
gen_usual_unary (ax, &value2);
gen_usual_arithmetic (ax, &value1, &value2);
@@ -1750,8 +1742,8 @@ gen_expr (pc, ax, value)
case UNOP_SIZEOF:
(*pc)++;
/* Notice that gen_sizeof handles its own operand, unlike most
of the other unary operator functions. This is because we
have to throw away the code we generate. */
of the other unary operator functions. This is because we
have to throw away the code we generate. */
gen_sizeof (pc, ax, value);
break;
@@ -1770,10 +1762,10 @@ gen_expr (pc, ax, value)
"pointer to a structure or union");
else
/* If this `if' chain doesn't handle it, then the case list
shouldn't mention it, and we shouldn't be here. */
shouldn't mention it, and we shouldn't be here. */
error ("GDB bug: ax-gdb.c (gen_expr): unhandled struct case");
}
break;
break;
case OP_TYPE:
error ("Attempt to use a type name as an expression.");
@@ -1782,10 +1774,10 @@ gen_expr (pc, ax, value)
error ("Unsupported operator in expression.");
}
}
#if 0 /* not used */
#if 0 /* not used */
/* Generating bytecode from GDB expressions: driver */
/* Given a GDB expression EXPR, produce a string of agent bytecode
@@ -1873,9 +1865,9 @@ gen_trace_for_expr (scope, expr)
discard_cleanups (old_chain);
return ax;
}
/* The "agent" command, for testing: compile and disassemble an expression. */
static void
@@ -1911,7 +1903,8 @@ agent_command (exp, from_tty)
struct cleanup *old_chain = 0;
struct expression *expr;
struct agent_expr *agent;
struct frame_info *fi = get_current_frame (); /* need current scope */
struct agent_reqs reqs;
struct frame_info *fi = get_current_frame (); /* need current scope */
/* We don't deal with overlay debugging at the moment. We need to
think more carefully about this. If you copy this code into
@@ -1922,21 +1915,19 @@ agent_command (exp, from_tty)
if (exp == 0)
error_no_arg ("expression to translate");
expr = parse_expression (exp);
old_chain = make_cleanup ((make_cleanup_func) free_current_contents, &expr);
agent = gen_trace_for_expr (fi->pc, expr);
make_cleanup ((make_cleanup_func) free_agent_expr, agent);
ax_print (gdb_stdout, agent);
/* It would be nice to call ax_reqs here to gather some general info
about the expression, and then print out the result. */
ax_reqs (agent, &reqs);
do_cleanups (old_chain);
dont_repeat ();
}
/* Initialization code. */
void _initialize_ax_gdb PARAMS ((void));

View File

@@ -1,27 +1,28 @@
/* GDB-specific functions for operating on agent expressions
Copyright 1998 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* $Id$ */
#ifndef AX_GDB_H
#define AX_GDB_H
/* Types and enums */
/* GDB stores expressions in the form of a flattened tree (struct
@@ -49,66 +50,62 @@
/* Different kinds of agent expression static values. */
enum axs_lvalue_kind
{
/* We generated code to compute the subexpression's value.
Constants and arithmetic operators yield this. */
axs_rvalue,
enum axs_lvalue_kind {
/* We generated code to compute the subexpression's value.
Constants and arithmetic operators yield this. */
axs_rvalue,
/* We generated code to yield the subexpression's value's address on
the top of the stack. If the caller needs an rvalue, it should
call require_rvalue to produce the rvalue from this address. */
axs_lvalue_memory,
/* We generated code to yield the subexpression's value's address on
the top of the stack. If the caller needs an rvalue, it should
call require_rvalue to produce the rvalue from this address. */
axs_lvalue_memory,
/* We didn't generate any code, and the stack is undisturbed,
because the subexpression's value lives in a register; u.reg is
the register number. If the caller needs an rvalue, it should
call require_rvalue to produce the rvalue from this register
number. */
axs_lvalue_register
};
/* We didn't generate any code, and the stack is undisturbed,
because the subexpression's value lives in a register; u.reg is
the register number. If the caller needs an rvalue, it should
call require_rvalue to produce the rvalue from this register
number. */
axs_lvalue_register
};
/* Structure describing what we got from a subexpression. Think of
this as parallel to value.h's enum lval_type, except that we're
describing a value which will exist when the expression is
evaluated in the future, not a value we have in our hand. */
struct axs_value
{
enum axs_lvalue_kind kind; /* see above */
struct axs_value {
enum axs_lvalue_kind kind; /* see above */
/* The type of the subexpression. Even if lvalue == axs_lvalue_memory,
this is the type of the value itself; the value on the stack is a
"pointer to" an object of this type. */
struct type *type;
/* The type of the subexpression. Even if lvalue == axs_lvalue_memory,
this is the type of the value itself; the value on the stack is a
"pointer to" an object of this type. */
struct type *type;
union {
/* if kind == axs_lvalue_register, this is the register number */
int reg;
} u;
};
union
{
/* if kind == axs_lvalue_register, this is the register number */
int reg;
}
u;
};
/* Translating GDB expressions into agent expressions. */
/* Given a GDB expression EXPR, translate it into the agent bytecode,
and return it. FLAGS are from enum expr_to_agent_flags. */
extern struct agent_expr *expr_to_agent PARAMS ((struct expression * EXPR,
struct axs_value * VALUE));
extern struct agent_expr *expr_to_agent PARAMS ((struct expression *EXPR,
struct axs_value *VALUE));
/* Given a GDB expression EXPR denoting an lvalue in memory, produce a
string of agent bytecode which will leave its address and size on
the top of stack. Return the agent expression. */
extern struct agent_expr *expr_to_address_and_size
PARAMS ((struct expression * EXPR));
PARAMS ((struct expression *EXPR));
/* Given a GDB expression EXPR, return bytecode to trace its value.
The result will use the `trace' and `trace_quick' bytecodes to
record the value of all memory touched by the expression, and leave
no values on the stack. The caller can then use the ax_reqs
function to discover which registers the expression uses. */
extern struct agent_expr *gen_trace_for_expr PARAMS ((CORE_ADDR,
extern struct agent_expr *gen_trace_for_expr PARAMS ((CORE_ADDR,
struct expression *));
#endif /* AX_GDB_H */

View File

@@ -1,22 +1,23 @@
/* Functions for manipulating expressions designed to be executed on the agent
Copyright 1998 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* $Id$ */
/* Despite what the above comment says about this file being part of
GDB, we would like to keep these functions free of GDB
@@ -26,15 +27,6 @@
#include "defs.h"
#include "ax.h"
#include "value.h"
static void grow_expr PARAMS ((struct agent_expr * x, int n));
static void append_const PARAMS ((struct agent_expr * x, LONGEST val, int n));
static LONGEST read_const PARAMS ((struct agent_expr * x, int o, int n));
static void generic_ext PARAMS ((struct agent_expr * x, enum agent_op op, int n));
/* Functions for building expressions. */
@@ -44,10 +36,10 @@ new_agent_expr (scope)
CORE_ADDR scope;
{
struct agent_expr *x = xmalloc (sizeof (*x));
x->len = 0;
x->len = 0;
x->size = 1; /* Change this to a larger value once
reallocation code is tested. */
x->buf = xmalloc (x->size);
x->buf = xmalloc (x->size);
x->scope = scope;
return x;
@@ -116,7 +108,7 @@ read_const (x, o, n)
for (i = 0; i < n; i++)
accum = (accum << 8) | x->buf[o + i];
return accum;
}
@@ -195,8 +187,7 @@ ax_trace_quick (x, n)
for the target, and return the offset in EXPR of that space, so we
can backpatch it once we do know the target offset. Use ax_label
to do the backpatching. */
int
ax_goto (x, op)
int ax_goto (x, op)
struct agent_expr *x;
enum agent_op op;
{
@@ -210,7 +201,7 @@ ax_goto (x, op)
/* Suppose a given call to ax_goto returns some value PATCH. When you
know the offset TARGET that goto should jump to, call
ax_label (EXPR, PATCH, TARGET)
ax_label (EXPR, PATCH, TARGET)
to patch TARGET into the ax_goto instruction. */
void
ax_label (x, patch, target)
@@ -222,7 +213,7 @@ ax_label (x, patch, target)
offset; that's our magic sentinel value for unpatched branches. */
if (target < 0 || target >= 0xffff)
error ("GDB bug: ax-general.c (ax_label): label target out of range");
x->buf[patch] = (target >> 8) & 0xff;
x->buf[patch + 1] = target & 0xff;
}
@@ -235,8 +226,7 @@ ax_const_l (x, l)
LONGEST l;
{
static enum agent_op ops[]
=
{aop_const8, aop_const16, aop_const32, aop_const64};
= { aop_const8, aop_const16, aop_const32, aop_const64 };
int size;
int op;
@@ -273,8 +263,7 @@ ax_const_d (x, d)
/* Assemble code to push the value of register number REG on the
stack. */
void
ax_reg (x, reg)
void ax_reg (x, reg)
struct agent_expr *x;
int reg;
{
@@ -282,68 +271,67 @@ ax_reg (x, reg)
if (reg < 0 || reg > 0xffff)
error ("GDB bug: ax-general.c (ax_reg): register number out of range");
grow_expr (x, 3);
x->buf[x->len] = aop_reg;
x->buf[x->len ] = aop_reg;
x->buf[x->len + 1] = (reg >> 8) & 0xff;
x->buf[x->len + 2] = (reg) & 0xff;
x->buf[x->len + 2] = (reg ) & 0xff;
x->len += 3;
}
/* Functions for disassembling agent expressions, and otherwise
debugging the expression compiler. */
struct aop_map aop_map[] =
{
{0, 0, 0, 0, 0},
{"float", 0, 0, 0, 0}, /* 0x01 */
{"add", 0, 0, 2, 1}, /* 0x02 */
{"sub", 0, 0, 2, 1}, /* 0x03 */
{"mul", 0, 0, 2, 1}, /* 0x04 */
{"div_signed", 0, 0, 2, 1}, /* 0x05 */
{"div_unsigned", 0, 0, 2, 1}, /* 0x06 */
{"rem_signed", 0, 0, 2, 1}, /* 0x07 */
{"rem_unsigned", 0, 0, 2, 1}, /* 0x08 */
{"lsh", 0, 0, 2, 1}, /* 0x09 */
{"rsh_signed", 0, 0, 2, 1}, /* 0x0a */
{"rsh_unsigned", 0, 0, 2, 1}, /* 0x0b */
{"trace", 0, 0, 2, 0}, /* 0x0c */
{"trace_quick", 1, 0, 1, 1}, /* 0x0d */
{"log_not", 0, 0, 1, 1}, /* 0x0e */
{"bit_and", 0, 0, 2, 1}, /* 0x0f */
{"bit_or", 0, 0, 2, 1}, /* 0x10 */
{"bit_xor", 0, 0, 2, 1}, /* 0x11 */
{"bit_not", 0, 0, 1, 1}, /* 0x12 */
{"equal", 0, 0, 2, 1}, /* 0x13 */
{"less_signed", 0, 0, 2, 1}, /* 0x14 */
{"less_unsigned", 0, 0, 2, 1}, /* 0x15 */
{"ext", 1, 0, 1, 1}, /* 0x16 */
{"ref8", 0, 8, 1, 1}, /* 0x17 */
{"ref16", 0, 16, 1, 1}, /* 0x18 */
{"ref32", 0, 32, 1, 1}, /* 0x19 */
{"ref64", 0, 64, 1, 1}, /* 0x1a */
{"ref_float", 0, 0, 1, 1}, /* 0x1b */
{"ref_double", 0, 0, 1, 1}, /* 0x1c */
{"ref_long_double", 0, 0, 1, 1}, /* 0x1d */
{"l_to_d", 0, 0, 1, 1}, /* 0x1e */
{"d_to_l", 0, 0, 1, 1}, /* 0x1f */
{"if_goto", 2, 0, 1, 0}, /* 0x20 */
{"goto", 2, 0, 0, 0}, /* 0x21 */
{"const8", 1, 8, 0, 1}, /* 0x22 */
{"const16", 2, 16, 0, 1}, /* 0x23 */
{"const32", 4, 32, 0, 1}, /* 0x24 */
{"const64", 8, 64, 0, 1}, /* 0x25 */
{"reg", 2, 0, 0, 1}, /* 0x26 */
{"end", 0, 0, 0, 0}, /* 0x27 */
{"dup", 0, 0, 1, 2}, /* 0x28 */
{"pop", 0, 0, 1, 0}, /* 0x29 */
{"zero_ext", 1, 0, 1, 1}, /* 0x2a */
{"swap", 0, 0, 2, 2}, /* 0x2b */
{0, 0, 0, 0, 0}, /* 0x2c */
{0, 0, 0, 0, 0}, /* 0x2d */
{0, 0, 0, 0, 0}, /* 0x2e */
{0, 0, 0, 0, 0}, /* 0x2f */
{"trace16", 2, 0, 1, 1}, /* 0x30 */
struct aop_map aop_map[] = {
{ 0, 0, 0, 0, 0 },
{ "float", 0, 0, 0, 0 }, /* 0x01 */
{ "add", 0, 0, 2, 1 }, /* 0x02 */
{ "sub", 0, 0, 2, 1 }, /* 0x03 */
{ "mul", 0, 0, 2, 1 }, /* 0x04 */
{ "div_signed", 0, 0, 2, 1 }, /* 0x05 */
{ "div_unsigned", 0, 0, 2, 1 }, /* 0x06 */
{ "rem_signed", 0, 0, 2, 1 }, /* 0x07 */
{ "rem_unsigned", 0, 0, 2, 1 }, /* 0x08 */
{ "lsh", 0, 0, 2, 1 }, /* 0x09 */
{ "rsh_signed", 0, 0, 2, 1 }, /* 0x0a */
{ "rsh_unsigned", 0, 0, 2, 1 }, /* 0x0b */
{ "trace", 0, 0, 2, 0 }, /* 0x0c */
{ "trace_quick", 1, 0, 1, 1 }, /* 0x0d */
{ "log_not", 0, 0, 1, 1 }, /* 0x0e */
{ "bit_and", 0, 0, 2, 1 }, /* 0x0f */
{ "bit_or", 0, 0, 2, 1 }, /* 0x10 */
{ "bit_xor", 0, 0, 2, 1 }, /* 0x11 */
{ "bit_not", 0, 0, 1, 1 }, /* 0x12 */
{ "equal", 0, 0, 2, 1 }, /* 0x13 */
{ "less_signed", 0, 0, 2, 1 }, /* 0x14 */
{ "less_unsigned", 0, 0, 2, 1 }, /* 0x15 */
{ "ext", 1, 0, 1, 1 }, /* 0x16 */
{ "ref8", 0, 8, 1, 1 }, /* 0x17 */
{ "ref16", 0, 16, 1, 1 }, /* 0x18 */
{ "ref32", 0, 32, 1, 1 }, /* 0x19 */
{ "ref64", 0, 64, 1, 1 }, /* 0x1a */
{ "ref_float", 0, 0, 1, 1 }, /* 0x1b */
{ "ref_double", 0, 0, 1, 1 }, /* 0x1c */
{ "ref_long_double", 0, 0, 1, 1 }, /* 0x1d */
{ "l_to_d", 0, 0, 1, 1 }, /* 0x1e */
{ "d_to_l", 0, 0, 1, 1 }, /* 0x1f */
{ "if_goto", 2, 0, 1, 0 }, /* 0x20 */
{ "goto", 2, 0, 0, 0 }, /* 0x21 */
{ "const8", 1, 8, 0, 1 }, /* 0x22 */
{ "const16", 2, 16, 0, 1 }, /* 0x23 */
{ "const32", 4, 32, 0, 1 }, /* 0x24 */
{ "const64", 8, 64, 0, 1 }, /* 0x25 */
{ "reg", 2, 0, 0, 1 }, /* 0x26 */
{ "end", 0, 0, 0, 0 }, /* 0x27 */
{ "dup", 0, 0, 1, 2 }, /* 0x28 */
{ "pop", 0, 0, 1, 0 }, /* 0x29 */
{ "zero_ext", 1, 0, 1, 1 }, /* 0x2a */
{ "swap", 0, 0, 2, 2 }, /* 0x2b */
{ 0, 0, 0, 0, 0 }, /* 0x2c */
{ 0, 0, 0, 0, 0 }, /* 0x2d */
{ 0, 0, 0, 0, 0 }, /* 0x2e */
{ 0, 0, 0, 0, 0 }, /* 0x2f */
{ "trace16", 2, 0, 1, 1 }, /* 0x30 */
};
@@ -361,13 +349,13 @@ ax_print (f, x)
if ((sizeof (aop_map) / sizeof (aop_map[0]))
!= aop_last)
error ("GDB bug: ax-general.c (ax_print): opcode map out of sync");
for (i = 0; i < x->len;)
for (i = 0; i < x->len; )
{
enum agent_op op = x->buf[i];
if (op >= (sizeof (aop_map) / sizeof (aop_map[0]))
|| !aop_map[op].name)
|| ! aop_map[op].name)
{
fprintf_filtered (f, "%3d <bad opcode %02x>\n", i, op);
i++;
@@ -384,7 +372,7 @@ ax_print (f, x)
if (aop_map[op].op_size > 0)
{
fputs_filtered (" ", f);
print_longest (f, 'd', 0,
read_const (x, i + 1, aop_map[op].op_size));
}
@@ -445,13 +433,13 @@ ax_reqs (ax, reqs)
op = &aop_map[ax->buf[i]];
if (!op->name)
if (! op->name)
{
reqs->flaw = agent_flaw_bad_instruction;
free (reg_mask);
return;
}
if (i + 1 + op->op_size > ax->len)
{
reqs->flaw = agent_flaw_incomplete_instruction;
@@ -482,8 +470,8 @@ ax_reqs (ax, reqs)
reqs->max_data_size = op->data_size;
/* For jump instructions, check that the target is a valid
offset. If it is, record the fact that that location is a
jump target, and record the height we expect there. */
offset. If it is, record the fact that that location is a
jump target, and record the height we expect there. */
if (aop_goto == op - aop_map
|| aop_if_goto == op - aop_map)
{
@@ -510,13 +498,13 @@ ax_reqs (ax, reqs)
heights[target] = height;
}
}
/* For unconditional jumps with a successor, check that the
successor is a target, and pick up its stack height. */
if (aop_goto == op - aop_map
&& i + 3 < ax->len)
{
if (!targets[i + 3])
if (! targets[i + 3])
{
reqs->flaw = agent_flaw_hole;
free (reg_mask);
@@ -536,9 +524,9 @@ ax_reqs (ax, reqs)
if (byte >= reg_mask_len)
{
/* It's not appropriate to double here. This isn't a
string buffer. */
string buffer. */
int new_len = byte + 1;
reg_mask = xrealloc (reg_mask,
reg_mask = xrealloc (reg_mask,
new_len * sizeof (reg_mask[0]));
memset (reg_mask + reg_mask_len, 0,
(new_len - reg_mask_len) * sizeof (reg_mask[0]));

305
gdb/ax.h
View File

@@ -1,22 +1,23 @@
/* Definitions for expressions designed to be executed on the agent
Copyright 1998 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* $Id$ */
#ifndef AGENTEXPR_H
#define AGENTEXPR_H
@@ -48,8 +49,8 @@
is independent of symbolic information. This means the agent can
evaluate them on the fly without reference to data only available
to the host GDB. */
/* Agent expression data structures. */
/* The type of an element of the agent expression stack.
@@ -57,20 +58,18 @@
the value itself has no typing information. GDB generates all
bytecode streams, so we don't have to worry about type errors. */
union agent_val
{
LONGEST l;
DOUBLEST d;
};
union agent_val {
LONGEST l;
DOUBLEST d;
};
/* A buffer containing a agent expression. */
struct agent_expr
{
unsigned char *buf;
int len; /* number of characters used */
int size; /* allocated size */
CORE_ADDR scope;
};
struct agent_expr {
unsigned char *buf;
int len; /* number of characters used */
int size; /* allocated size */
CORE_ADDR scope;
};
@@ -85,57 +84,56 @@ struct agent_expr
agentexpr.h behaves like an opcode map. If you want to see them
grouped logically, see doc/agentexpr.texi. */
enum agent_op
{
aop_float = 0x01,
aop_add = 0x02,
aop_sub = 0x03,
aop_mul = 0x04,
aop_div_signed = 0x05,
aop_div_unsigned = 0x06,
aop_rem_signed = 0x07,
aop_rem_unsigned = 0x08,
aop_lsh = 0x09,
aop_rsh_signed = 0x0a,
aop_rsh_unsigned = 0x0b,
aop_trace = 0x0c,
aop_trace_quick = 0x0d,
aop_log_not = 0x0e,
aop_bit_and = 0x0f,
aop_bit_or = 0x10,
aop_bit_xor = 0x11,
aop_bit_not = 0x12,
aop_equal = 0x13,
aop_less_signed = 0x14,
aop_less_unsigned = 0x15,
aop_ext = 0x16,
aop_ref8 = 0x17,
aop_ref16 = 0x18,
aop_ref32 = 0x19,
aop_ref64 = 0x1a,
aop_ref_float = 0x1b,
aop_ref_double = 0x1c,
aop_ref_long_double = 0x1d,
aop_l_to_d = 0x1e,
aop_d_to_l = 0x1f,
aop_if_goto = 0x20,
aop_goto = 0x21,
aop_const8 = 0x22,
aop_const16 = 0x23,
aop_const32 = 0x24,
aop_const64 = 0x25,
aop_reg = 0x26,
aop_end = 0x27,
aop_dup = 0x28,
aop_pop = 0x29,
aop_zero_ext = 0x2a,
aop_swap = 0x2b,
aop_trace16 = 0x30,
aop_last
};
enum agent_op {
aop_float = 0x01,
aop_add = 0x02,
aop_sub = 0x03,
aop_mul = 0x04,
aop_div_signed = 0x05,
aop_div_unsigned = 0x06,
aop_rem_signed = 0x07,
aop_rem_unsigned = 0x08,
aop_lsh = 0x09,
aop_rsh_signed = 0x0a,
aop_rsh_unsigned = 0x0b,
aop_trace = 0x0c,
aop_trace_quick = 0x0d,
aop_log_not = 0x0e,
aop_bit_and = 0x0f,
aop_bit_or = 0x10,
aop_bit_xor = 0x11,
aop_bit_not = 0x12,
aop_equal = 0x13,
aop_less_signed = 0x14,
aop_less_unsigned = 0x15,
aop_ext = 0x16,
aop_ref8 = 0x17,
aop_ref16 = 0x18,
aop_ref32 = 0x19,
aop_ref64 = 0x1a,
aop_ref_float = 0x1b,
aop_ref_double = 0x1c,
aop_ref_long_double = 0x1d,
aop_l_to_d = 0x1e,
aop_d_to_l = 0x1f,
aop_if_goto = 0x20,
aop_goto = 0x21,
aop_const8 = 0x22,
aop_const16 = 0x23,
aop_const32 = 0x24,
aop_const64 = 0x25,
aop_reg = 0x26,
aop_end = 0x27,
aop_dup = 0x28,
aop_pop = 0x29,
aop_zero_ext = 0x2a,
aop_swap = 0x2b,
aop_trace16 = 0x30,
aop_last
};
/* Functions for building expressions. */
/* Allocate a new, empty agent expression. */
@@ -145,19 +143,19 @@ extern struct agent_expr *new_agent_expr PARAMS ((CORE_ADDR));
extern void free_agent_expr PARAMS ((struct agent_expr *));
/* Append a simple operator OP to EXPR. */
extern void ax_simple PARAMS ((struct agent_expr * EXPR, enum agent_op OP));
extern void ax_simple PARAMS ((struct agent_expr *EXPR, enum agent_op OP));
/* Append the floating-point prefix, for the next bytecode. */
#define ax_float(EXPR) (ax_simple ((EXPR), aop_float))
/* Append a sign-extension instruction to EXPR, to extend an N-bit value. */
extern void ax_ext PARAMS ((struct agent_expr * EXPR, int N));
extern void ax_ext PARAMS ((struct agent_expr *EXPR, int N));
/* Append a zero-extension instruction to EXPR, to extend an N-bit value. */
extern void ax_zero_ext PARAMS ((struct agent_expr * EXPR, int N));
extern void ax_zero_ext PARAMS ((struct agent_expr *EXPR, int N));
/* Append a trace_quick instruction to EXPR, to record N bytes. */
extern void ax_trace_quick PARAMS ((struct agent_expr * EXPR, int N));
extern void ax_trace_quick PARAMS ((struct agent_expr *EXPR, int N));
/* Append a goto op to EXPR. OP is the actual op (must be aop_goto or
aop_if_goto). We assume we don't know the target offset yet,
@@ -165,126 +163,123 @@ extern void ax_trace_quick PARAMS ((struct agent_expr * EXPR, int N));
for the target, and return the offset in EXPR of that space, so we
can backpatch it once we do know the target offset. Use ax_label
to do the backpatching. */
extern int ax_goto PARAMS ((struct agent_expr * EXPR, enum agent_op OP));
extern int ax_goto PARAMS ((struct agent_expr *EXPR, enum agent_op OP));
/* Suppose a given call to ax_goto returns some value PATCH. When you
know the offset TARGET that goto should jump to, call
ax_label (EXPR, PATCH, TARGET)
ax_label (EXPR, PATCH, TARGET)
to patch TARGET into the ax_goto instruction. */
extern void ax_label PARAMS ((struct agent_expr * EXPR, int patch, int target));
extern void ax_label PARAMS ((struct agent_expr *EXPR, int patch, int target));
/* Assemble code to push a constant on the stack. */
extern void ax_const_l PARAMS ((struct agent_expr * EXPR, LONGEST l));
extern void ax_const_d PARAMS ((struct agent_expr * EXPR, LONGEST d));
extern void ax_const_l PARAMS ((struct agent_expr *EXPR, LONGEST l));
extern void ax_const_d PARAMS ((struct agent_expr *EXPR, LONGEST d));
/* Assemble code to push the value of register number REG on the
stack. */
extern void ax_reg PARAMS ((struct agent_expr * EXPR, int REG));
extern void ax_reg PARAMS ((struct agent_expr *EXPR, int REG));
/* Functions for printing out expressions, and otherwise debugging
things. */
/* Disassemble the expression EXPR, writing to F. */
extern void ax_print PARAMS ((GDB_FILE * f, struct agent_expr * EXPR));
extern void ax_print PARAMS ((GDB_FILE *f, struct agent_expr *EXPR));
/* An entry in the opcode map. */
struct aop_map
{
struct aop_map {
/* The name of the opcode. Null means that this entry is not a
valid opcode --- a hole in the opcode space. */
char *name;
/* The name of the opcode. Null means that this entry is not a
valid opcode --- a hole in the opcode space. */
char *name;
/* All opcodes take no operands from the bytecode stream, or take
unsigned integers of various sizes. If this is a positive number
n, then the opcode is followed by an n-byte operand, which should
be printed as an unsigned integer. If this is zero, then the
opcode takes no operands from the bytecode stream.
/* All opcodes take no operands from the bytecode stream, or take
unsigned integers of various sizes. If this is a positive number
n, then the opcode is followed by an n-byte operand, which should
be printed as an unsigned integer. If this is zero, then the
opcode takes no operands from the bytecode stream.
If we get more complicated opcodes in the future, don't add other
magic values of this; that's a crock. Add an `enum encoding'
field to this, or something like that. */
int op_size;
If we get more complicated opcodes in the future, don't add other
magic values of this; that's a crock. Add an `enum encoding'
field to this, or something like that. */
int op_size;
/* The size of the data operated upon, in bits, for bytecodes that
care about that (ref and const). Zero for all others. */
int data_size;
/* The size of the data operated upon, in bits, for bytecodes that
care about that (ref and const). Zero for all others. */
int data_size;
/* Number of stack elements consumed, and number produced. */
int consumed, produced;
};
/* Number of stack elements consumed, and number produced. */
int consumed, produced;
};
/* Map of the bytecodes, indexed by bytecode number. */
extern struct aop_map aop_map[];
/* Different kinds of flaws an agent expression might have, as
detected by agent_reqs. */
enum agent_flaws
{
agent_flaw_none = 0, /* code is good */
enum agent_flaws {
agent_flaw_none = 0, /* code is good */
/* There is an invalid instruction in the stream. */
agent_flaw_bad_instruction,
/* There is an invalid instruction in the stream. */
agent_flaw_bad_instruction,
/* There is an incomplete instruction at the end of the expression. */
agent_flaw_incomplete_instruction,
/* There is an incomplete instruction at the end of the expression. */
agent_flaw_incomplete_instruction,
/* agent_reqs was unable to prove that every jump target is to a
valid offset. Valid offsets are within the bounds of the
expression, and to a valid instruction boundary. */
agent_flaw_bad_jump,
/* agent_reqs was unable to prove that every jump target is to a
valid offset. Valid offsets are within the bounds of the
expression, and to a valid instruction boundary. */
agent_flaw_bad_jump,
/* agent_reqs was unable to prove to its satisfaction that, for each
jump target location, the stack will have the same height whether
that location is reached via a jump or by straight execution. */
agent_flaw_height_mismatch,
/* agent_reqs was unable to prove to its satisfaction that, for each
jump target location, the stack will have the same height whether
that location is reached via a jump or by straight execution. */
agent_flaw_height_mismatch,
/* agent_reqs was unable to prove that every instruction following
an unconditional jump was the target of some other jump. */
agent_flaw_hole
};
/* agent_reqs was unable to prove that every instruction following
an unconditional jump was the target of some other jump. */
agent_flaw_hole
};
/* Structure describing the requirements of a bytecode expression. */
struct agent_reqs
{
struct agent_reqs {
/* If the following is not equal to agent_flaw_none, the rest of the
information in this structure is suspect. */
enum agent_flaws flaw;
/* If the following is not equal to agent_flaw_none, the rest of the
information in this structure is suspect. */
enum agent_flaws flaw;
/* Number of elements left on stack at end; may be negative if expr
only consumes elements. */
int final_height;
/* Number of elements left on stack at end; may be negative if expr
only consumes elements. */
int final_height;
/* Maximum and minimum stack height, relative to initial height. */
int max_height, min_height;
/* Maximum and minimum stack height, relative to initial height. */
int max_height, min_height;
/* Largest `ref' or `const' opcode used, in bits. Zero means the
expression has no such instructions. */
int max_data_size;
/* Largest `ref' or `const' opcode used, in bits. Zero means the
expression has no such instructions. */
int max_data_size;
/* Bit vector of registers used. Register R is used iff
/* Bit vector of registers used. Register R is used iff
reg_mask[R / 8] & (1 << (R % 8))
reg_mask[R / 8] & (1 << (R % 8))
is non-zero. Note! You may not assume that this bitmask is long
enough to hold bits for all the registers of the machine; the
agent expression code has no idea how many registers the machine
has. However, the bitmask is reg_mask_len bytes long, so the
valid register numbers run from 0 to reg_mask_len * 8 - 1.
is non-zero. Note! You may not assume that this bitmask is long
enough to hold bits for all the registers of the machine; the
agent expression code has no idea how many registers the machine
has. However, the bitmask is reg_mask_len bytes long, so the
valid register numbers run from 0 to reg_mask_len * 8 - 1.
We're assuming eight-bit bytes. So sue me.
We're assuming eight-bit bytes. So sue me.
The caller should free reg_list when done. */
int reg_mask_len;
unsigned char *reg_mask;
};
The caller should free reg_list when done. */
int reg_mask_len;
unsigned char *reg_mask;
};
/* Given an agent expression AX, fill in an agent_reqs structure REQS
describing it. */
extern void ax_reqs PARAMS ((struct agent_expr * ax,
struct agent_reqs * reqs));
extern void ax_reqs PARAMS ((struct agent_expr *ax,
struct agent_reqs *reqs));
#endif /* AGENTEXPR_H */

View File

@@ -2,22 +2,21 @@
Written by Fred Fish (fnf@cygnus.com)
Copyright 1995, 1998 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "obstack.h"
@@ -31,8 +30,8 @@ static unsigned int hash PARAMS ((void *, int));
static void *lookup_cache PARAMS ((void *, int, int, struct bcache *));
/* FIXME: Incredibly simplistic hash generator. Probably way too expensive
(consider long strings) and unlikely to have good distribution across hash
values for typical input. */
(consider long strings) and unlikely to have good distribution across hash
values for typical input. */
static unsigned int
hash (bytes, count)
@@ -69,7 +68,7 @@ lookup_cache (bytes, count, hashval, bcachep)
struct hashlink **hashtablep;
struct hashlink *linkp;
hashtablep = bcachep->indextable[count];
hashtablep = bcachep -> indextable[count];
if (hashtablep != NULL)
{
linkp = hashtablep[hashval];
@@ -80,7 +79,7 @@ lookup_cache (bytes, count, hashval, bcachep)
location = BCACHE_DATA (linkp);
break;
}
linkp = linkp->next;
linkp = linkp -> next;
}
}
return (location);
@@ -102,9 +101,9 @@ bcache (bytes, count, bcachep)
{
/* Rare enough to just stash unique copies */
location = (void *) obstack_alloc (&bcachep->cache, count);
bcachep->cache_bytes += count;
bcachep -> cache_bytes += count;
memcpy (location, bytes, count);
bcachep->bcache_overflows++;
bcachep -> bcache_overflows++;
}
else
{
@@ -112,26 +111,26 @@ bcache (bytes, count, bcachep)
location = lookup_cache (bytes, count, hashval, bcachep);
if (location != NULL)
{
bcachep->cache_savings += count;
bcachep->cache_hits++;
bcachep -> cache_savings += count;
bcachep -> cache_hits++;
}
else
{
bcachep->cache_misses++;
hashtablepp = &bcachep->indextable[count];
bcachep -> cache_misses++;
hashtablepp = &bcachep -> indextable[count];
if (*hashtablepp == NULL)
{
*hashtablepp = (struct hashlink **)
obstack_alloc (&bcachep->cache, BCACHE_HASHSIZE * sizeof (struct hashlink *));
bcachep->cache_bytes += BCACHE_HASHSIZE * sizeof (struct hashlink *);
bcachep -> cache_bytes += BCACHE_HASHSIZE * sizeof (struct hashlink *);
memset (*hashtablepp, 0, BCACHE_HASHSIZE * sizeof (struct hashlink *));
}
linkpp = &(*hashtablepp)[hashval];
newlink = (struct hashlink *)
obstack_alloc (&bcachep->cache, BCACHE_DATA_ALIGNMENT + count);
bcachep->cache_bytes += BCACHE_DATA_ALIGNMENT + count;
bcachep -> cache_bytes += BCACHE_DATA_ALIGNMENT + count;
memcpy (BCACHE_DATA (newlink), bytes, count);
newlink->next = *linkpp;
newlink -> next = *linkpp;
*linkpp = newlink;
location = BCACHE_DATA (newlink);
}
@@ -139,6 +138,8 @@ bcache (bytes, count, bcachep)
return (location);
}
#if MAINTENANCE_CMDS
void
print_bcache_statistics (bcachep, id)
struct bcache *bcachep;
@@ -150,7 +151,7 @@ print_bcache_statistics (bcachep, id)
for (lmax = lcount = tcount = hcount = tidx = 0; tidx < BCACHE_MAXLENGTH; tidx++)
{
hashtablep = bcachep->indextable[tidx];
hashtablep = bcachep -> indextable[tidx];
if (hashtablep != NULL)
{
tcount++;
@@ -160,7 +161,7 @@ print_bcache_statistics (bcachep, id)
if (linkp != NULL)
{
hcount++;
for (temp = 0; linkp != NULL; linkp = linkp->next)
for (temp = 0; linkp != NULL; linkp = linkp -> next)
{
lcount++;
temp++;
@@ -176,21 +177,21 @@ print_bcache_statistics (bcachep, id)
}
}
printf_filtered (" Cached '%s' statistics:\n", id);
printf_filtered (" Cache hits: %d\n", bcachep->cache_hits);
printf_filtered (" Cache misses: %d\n", bcachep->cache_misses);
printf_filtered (" Cache hits: %d\n", bcachep -> cache_hits);
printf_filtered (" Cache misses: %d\n", bcachep -> cache_misses);
printf_filtered (" Cache hit ratio: ");
if (bcachep->cache_hits + bcachep->cache_misses > 0)
if (bcachep -> cache_hits + bcachep -> cache_misses > 0)
{
printf_filtered ("%d%%\n", ((bcachep->cache_hits) * 100) /
(bcachep->cache_hits + bcachep->cache_misses));
printf_filtered ("%d%%\n", ((bcachep -> cache_hits) * 100) /
(bcachep -> cache_hits + bcachep -> cache_misses));
}
else
{
printf_filtered ("(not applicable)\n");
}
printf_filtered (" Space used for caching: %d\n", bcachep->cache_bytes);
printf_filtered (" Space saved by cache hits: %d\n", bcachep->cache_savings);
printf_filtered (" Number of bcache overflows: %d\n", bcachep->bcache_overflows);
printf_filtered (" Space used for caching: %d\n", bcachep -> cache_bytes);
printf_filtered (" Space saved by cache hits: %d\n", bcachep -> cache_savings);
printf_filtered (" Number of bcache overflows: %d\n", bcachep -> bcache_overflows);
printf_filtered (" Number of index buckets used: %d\n", tcount);
printf_filtered (" Number of hash table buckets used: %d\n", hcount);
printf_filtered (" Number of chained items: %d\n", lcount);
@@ -214,3 +215,5 @@ print_bcache_statistics (bcachep, id)
}
printf_filtered (" Maximum chain length %d at %d:%d\n", lmax, lmaxt, lmaxh);
}
#endif /* MAINTENANCE_CMDS */

View File

@@ -2,22 +2,21 @@
Written by Fred Fish (fnf@cygnus.com)
Copyright 1995 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef BCACHE_H
#define BCACHE_H 1
@@ -30,16 +29,13 @@
it needs to have the same alignment as the most strict alignment of
any type on the host machine. So do it the same way obstack does. */
struct hashlink
{
struct hashlink *next;
union
{
char data[1];
double dummy;
}
d;
};
struct hashlink {
struct hashlink *next;
union {
char data[1];
double dummy;
} d;
};
/* BCACHE_DATA is used to get the address of the cached data. */
@@ -53,21 +49,24 @@ struct hashlink
#define BCACHE_DATA_ALIGNMENT \
(((char *) BCACHE_DATA((struct hashlink*) 0) - (char *) 0))
struct bcache
{
struct obstack cache;
struct hashlink **indextable[BCACHE_MAXLENGTH];
int cache_hits;
int cache_misses;
int cache_bytes;
int cache_savings;
int bcache_overflows;
};
struct bcache {
struct obstack cache;
struct hashlink **indextable[BCACHE_MAXLENGTH];
int cache_hits;
int cache_misses;
int cache_bytes;
int cache_savings;
int bcache_overflows;
};
extern void *
bcache PARAMS ((void *bytes, int count, struct bcache * bcachep));
bcache PARAMS ((void *bytes, int count, struct bcache *bcachep));
#if MAINTENANCE_CMDS
extern void
print_bcache_statistics PARAMS ((struct bcache *, char *));
#endif /* MAINTENANCE_CMDS */
#endif /* BCACHE_H */

View File

@@ -1,24 +1,23 @@
/* Get info from stack frames;
convert between frames, blocks, functions and pc values.
Copyright 1986, 87, 88, 89, 91, 94, 95, 96, 97, 1998
Free Software Foundation, Inc.
Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "symtab.h"
@@ -34,7 +33,7 @@
/* Prototypes for exported functions. */
void _initialize_blockframe (void);
void _initialize_blockframe PARAMS ((void));
/* A default FRAME_CHAIN_VALID, in the form that is suitable for most
targets. If FRAME_CHAIN_VALID returns zero it means that the given
@@ -46,14 +45,14 @@ default_frame_chain_valid (chain, thisframe)
struct frame_info *thisframe;
{
return ((chain) != 0
&& !inside_main_func ((thisframe)->pc)
&& !inside_entry_func ((thisframe)->pc));
&& !inside_main_func ((thisframe) -> pc)
&& !inside_entry_func ((thisframe) -> pc));
}
/* Use the alternate method of avoiding running up off the end of the
frame chain or following frames back into the startup code. See
the comments in objfiles.h. */
int
alternate_frame_chain_valid (chain, thisframe)
CORE_ADDR chain;
@@ -64,7 +63,7 @@ alternate_frame_chain_valid (chain, thisframe)
}
/* A very simple method of determining a valid frame */
int
nonnull_frame_chain_valid (chain, thisframe)
CORE_ADDR chain;
@@ -89,16 +88,15 @@ inside_entry_file (addr)
return 1;
if (symfile_objfile == 0)
return 0;
if (CALL_DUMMY_LOCATION == AT_ENTRY_POINT)
{
/* Do not stop backtracing if the pc is in the call dummy
at the entry point. */
/* FIXME: Won't always work with zeros for the last two arguments */
if (PC_IN_CALL_DUMMY (addr, 0, 0))
return 0;
}
return (addr >= symfile_objfile->ei.entry_file_lowpc &&
addr < symfile_objfile->ei.entry_file_highpc);
#if CALL_DUMMY_LOCATION == AT_ENTRY_POINT
/* Do not stop backtracing if the pc is in the call dummy
at the entry point. */
/* FIXME: Won't always work with zeros for the last two arguments */
if (PC_IN_CALL_DUMMY (addr, 0, 0))
return 0;
#endif
return (addr >= symfile_objfile -> ei.entry_file_lowpc &&
addr < symfile_objfile -> ei.entry_file_highpc);
}
/* Test a specified PC value to see if it is in the range of addresses
@@ -111,7 +109,7 @@ inside_entry_file (addr)
int
inside_main_func (pc)
CORE_ADDR pc;
CORE_ADDR pc;
{
if (pc == 0)
return 1;
@@ -122,22 +120,22 @@ inside_main_func (pc)
This is for FRAME_CHAIN_VALID_ALTERNATE. I do this for coff, because
it is unable to set it up and symbol reading time. */
if (symfile_objfile->ei.main_func_lowpc == INVALID_ENTRY_LOWPC &&
symfile_objfile->ei.main_func_highpc == INVALID_ENTRY_HIGHPC)
if (symfile_objfile -> ei.main_func_lowpc == INVALID_ENTRY_LOWPC &&
symfile_objfile -> ei.main_func_highpc == INVALID_ENTRY_HIGHPC)
{
struct symbol *mainsym;
mainsym = lookup_symbol ("main", NULL, VAR_NAMESPACE, NULL, NULL);
if (mainsym && SYMBOL_CLASS (mainsym) == LOC_BLOCK)
{
symfile_objfile->ei.main_func_lowpc =
if (mainsym && SYMBOL_CLASS(mainsym) == LOC_BLOCK)
{
symfile_objfile->ei.main_func_lowpc =
BLOCK_START (SYMBOL_BLOCK_VALUE (mainsym));
symfile_objfile->ei.main_func_highpc =
symfile_objfile->ei.main_func_highpc =
BLOCK_END (SYMBOL_BLOCK_VALUE (mainsym));
}
}
}
return (symfile_objfile->ei.main_func_lowpc <= pc &&
symfile_objfile->ei.main_func_highpc > pc);
return (symfile_objfile -> ei.main_func_lowpc <= pc &&
symfile_objfile -> ei.main_func_highpc > pc);
}
/* Test a specified PC value to see if it is in the range of addresses
@@ -150,22 +148,21 @@ inside_main_func (pc)
int
inside_entry_func (pc)
CORE_ADDR pc;
CORE_ADDR pc;
{
if (pc == 0)
return 1;
if (symfile_objfile == 0)
return 0;
if (CALL_DUMMY_LOCATION == AT_ENTRY_POINT)
{
/* Do not stop backtracing if the pc is in the call dummy
at the entry point. */
/* FIXME: Won't always work with zeros for the last two arguments */
if (PC_IN_CALL_DUMMY (pc, 0, 0))
return 0;
}
return (symfile_objfile->ei.entry_func_lowpc <= pc &&
symfile_objfile->ei.entry_func_highpc > pc);
#if CALL_DUMMY_LOCATION == AT_ENTRY_POINT
/* Do not stop backtracing if the pc is in the call dummy
at the entry point. */
/* FIXME: Won't always work with zeros for the last two arguments */
if (PC_IN_CALL_DUMMY (pc, 0, 0))
return 0;
#endif
return (symfile_objfile -> ei.entry_func_lowpc <= pc &&
symfile_objfile -> ei.entry_func_highpc > pc);
}
/* Info about the innermost stack frame (contents of FP register) */
@@ -189,7 +186,7 @@ void
frame_saved_regs_zalloc (fi)
struct frame_info *fi;
{
fi->saved_regs = (CORE_ADDR *)
fi->saved_regs = (CORE_ADDR*)
frame_obstack_alloc (SIZEOF_FRAME_SAVED_REGS);
memset (fi->saved_regs, 0, SIZEOF_FRAME_SAVED_REGS);
}
@@ -238,7 +235,7 @@ create_new_frame (addr, pc)
fi->prev = NULL;
fi->frame = addr;
fi->pc = pc;
find_pc_partial_function (pc, &name, (CORE_ADDR *) NULL, (CORE_ADDR *) NULL);
find_pc_partial_function (pc, &name, (CORE_ADDR *)NULL,(CORE_ADDR *)NULL);
fi->signal_handler_caller = IN_SIGTRAMP (fi->pc, name);
#ifdef INIT_EXTRA_FRAME_INFO
@@ -248,6 +245,16 @@ create_new_frame (addr, pc)
return fi;
}
/* Return the frame that called FI.
If FI is the original frame (it has no caller), return 0. */
struct frame_info *
get_prev_frame (frame)
struct frame_info *frame;
{
return get_prev_frame_info (frame);
}
/* Return the frame that FRAME calls (NULL if FRAME is the innermost
frame). */
@@ -267,7 +274,7 @@ flush_cached_frames ()
obstack_free (&frame_cache_obstack, 0);
obstack_init (&frame_cache_obstack);
current_frame = NULL; /* Invalidate cache */
current_frame = NULL; /* Invalidate cache */
select_frame (NULL, -1);
annotate_frames_invalid ();
}
@@ -286,6 +293,11 @@ reinit_frame_cache ()
}
}
/* If a machine allows frameless functions, it should define a macro
FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) in param.h. FI is the struct
frame_info for the frame, and FRAMELESS should be set to nonzero
if it represents a frameless function invocation. */
/* Return nonzero if the function for this frame lacks a prologue. Many
machines can define FRAMELESS_FUNCTION_INVOCATION to just call this
function. */
@@ -295,26 +307,25 @@ frameless_look_for_prologue (frame)
struct frame_info *frame;
{
CORE_ADDR func_start, after_prologue;
func_start = get_pc_function_start (frame->pc);
if (func_start)
{
func_start += FUNCTION_START_OFFSET;
after_prologue = func_start;
#ifdef SKIP_PROLOGUE_FRAMELESS_P
/* This is faster, since only care whether there *is* a
prologue, not how long it is. */
after_prologue = SKIP_PROLOGUE_FRAMELESS_P (after_prologue);
/* This is faster, since only care whether there *is* a prologue,
not how long it is. */
SKIP_PROLOGUE_FRAMELESS_P (after_prologue);
#else
after_prologue = SKIP_PROLOGUE (after_prologue);
SKIP_PROLOGUE (after_prologue);
#endif
return after_prologue == func_start;
}
else if (frame->pc == 0)
/* A frame with a zero PC is usually created by dereferencing a
NULL function pointer, normally causing an immediate core dump
of the inferior. Mark function as frameless, as the inferior
has no chance of setting up a stack frame. */
/* A frame with a zero PC is usually created by dereferencing a NULL
function pointer, normally causing an immediate core dump of the
inferior. Mark function as frameless, as the inferior has no chance
of setting up a stack frame. */
return 1;
else
/* If we can't find the start of the function, we don't really
@@ -341,7 +352,7 @@ frameless_look_for_prologue (frame)
if there is no such frame. */
struct frame_info *
get_prev_frame (next_frame)
get_prev_frame_info (next_frame)
struct frame_info *next_frame;
{
CORE_ADDR address = 0;
@@ -357,9 +368,9 @@ get_prev_frame (next_frame)
{
#if 0
/* This screws value_of_variable, which just wants a nice clean
NULL return from block_innermost_frame if there are no frames.
I don't think I've ever seen this message happen otherwise.
And returning NULL here is a perfectly legitimate thing to do. */
NULL return from block_innermost_frame if there are no frames.
I don't think I've ever seen this message happen otherwise.
And returning NULL here is a perfectly legitimate thing to do. */
if (!current_frame)
{
error ("You haven't set up a process's stack to examine.");
@@ -378,32 +389,33 @@ get_prev_frame (next_frame)
define this macro to take two args; a frameinfo pointer
identifying a frame and a variable to set or clear if it is
or isn't leafless. */
#ifdef FRAMELESS_FUNCTION_INVOCATION
/* Still don't want to worry about this except on the innermost
frame. This macro will set FROMLEAF if NEXT_FRAME is a
frameless function invocation. */
if (!(next_frame->next))
{
fromleaf = FRAMELESS_FUNCTION_INVOCATION (next_frame);
FRAMELESS_FUNCTION_INVOCATION (next_frame, fromleaf);
if (fromleaf)
address = FRAME_FP (next_frame);
}
#endif
if (!fromleaf)
{
/* Two macros defined in tm.h specify the machine-dependent
actions to be performed here.
First, get the frame's chain-pointer.
If that is zero, the frame is the outermost frame or a leaf
called by the outermost frame. This means that if start
calls main without a frame, we'll return 0 (which is fine
anyway).
actions to be performed here.
First, get the frame's chain-pointer.
If that is zero, the frame is the outermost frame or a leaf
called by the outermost frame. This means that if start
calls main without a frame, we'll return 0 (which is fine
anyway).
Nope; there's a problem. This also returns when the current
routine is a leaf of main. This is unacceptable. We move
this to after the ffi test; I'd rather have backtraces from
start go curfluy than have an abort called from main not show
main. */
Nope; there's a problem. This also returns when the current
routine is a leaf of main. This is unacceptable. We move
this to after the ffi test; I'd rather have backtraces from
start go curfluy than have an abort called from main not show
main. */
address = FRAME_CHAIN (next_frame);
if (!FRAME_CHAIN_VALID (address, next_frame))
return 0;
@@ -429,11 +441,11 @@ get_prev_frame (next_frame)
after INIT_EXTRA_FRAME_INFO and come up with a simple way to
express what goes on here.
INIT_EXTRA_FRAME_INFO is called from two places: create_new_frame
(where the PC is already set up) and here (where it isn't).
INIT_FRAME_PC is only called from here, always after
INIT_EXTRA_FRAME_INFO.
INIT_EXTRA_FRAME_INFO is called from two places: create_new_frame
(where the PC is already set up) and here (where it isn't).
INIT_FRAME_PC is only called from here, always after
INIT_EXTRA_FRAME_INFO.
The catch is the MIPS, where INIT_EXTRA_FRAME_INFO requires the PC
value (which hasn't been set yet). Some other machines appear to
require INIT_EXTRA_FRAME_INFO before they can do INIT_FRAME_PC. Phoo.
@@ -445,24 +457,24 @@ get_prev_frame (next_frame)
INIT_EXTRA_FRAME_INFO, one possible scheme:
SETUP_INNERMOST_FRAME()
Default version is just create_new_frame (read_fp ()),
read_pc ()). Machines with extra frame info would do that (or the
local equivalent) and then set the extra fields.
Default version is just create_new_frame (read_fp ()),
read_pc ()). Machines with extra frame info would do that (or the
local equivalent) and then set the extra fields.
SETUP_ARBITRARY_FRAME(argc, argv)
Only change here is that create_new_frame would no longer init extra
frame info; SETUP_ARBITRARY_FRAME would have to do that.
Only change here is that create_new_frame would no longer init extra
frame info; SETUP_ARBITRARY_FRAME would have to do that.
INIT_PREV_FRAME(fromleaf, prev)
Replace INIT_EXTRA_FRAME_INFO and INIT_FRAME_PC. This should
also return a flag saying whether to keep the new frame, or
whether to discard it, because on some machines (e.g. mips) it
is really awkward to have FRAME_CHAIN_VALID called *before*
INIT_EXTRA_FRAME_INFO (there is no good way to get information
deduced in FRAME_CHAIN_VALID into the extra fields of the new frame).
Replace INIT_EXTRA_FRAME_INFO and INIT_FRAME_PC. This should
also return a flag saying whether to keep the new frame, or
whether to discard it, because on some machines (e.g. mips) it
is really awkward to have FRAME_CHAIN_VALID called *before*
INIT_EXTRA_FRAME_INFO (there is no good way to get information
deduced in FRAME_CHAIN_VALID into the extra fields of the new frame).
std_frame_pc(fromleaf, prev)
This is the default setting for INIT_PREV_FRAME. It just does what
the default INIT_FRAME_PC does. Some machines will call it from
INIT_PREV_FRAME (either at the beginning, the end, or in the middle).
Some machines won't use it.
This is the default setting for INIT_PREV_FRAME. It just does what
the default INIT_FRAME_PC does. Some machines will call it from
INIT_PREV_FRAME (either at the beginning, the end, or in the middle).
Some machines won't use it.
kingdon@cygnus.com, 13Apr93, 31Jan94, 14Dec94. */
#ifdef INIT_FRAME_PC_FIRST
@@ -470,13 +482,13 @@ get_prev_frame (next_frame)
#endif
#ifdef INIT_EXTRA_FRAME_INFO
INIT_EXTRA_FRAME_INFO (fromleaf, prev);
INIT_EXTRA_FRAME_INFO(fromleaf, prev);
#endif
/* This entry is in the frame queue now, which is good since
FRAME_SAVED_PC may use that queue to figure out its value
(see tm-sparc.h). We want the pc saved in the inferior frame. */
INIT_FRAME_PC (fromleaf, prev);
INIT_FRAME_PC(fromleaf, prev);
/* If ->frame and ->pc are unchanged, we are in the process of getting
ourselves into an infinite backtrace. Some architectures check this
@@ -494,7 +506,7 @@ get_prev_frame (next_frame)
}
find_pc_partial_function (prev->pc, &name,
(CORE_ADDR *) NULL, (CORE_ADDR *) NULL);
(CORE_ADDR *)NULL,(CORE_ADDR *)NULL);
if (IN_SIGTRAMP (prev->pc, name))
prev->signal_handler_caller = 1;
@@ -521,7 +533,7 @@ get_frame_saved_regs (frame, saved_regs_addr)
{
if (frame->saved_regs == NULL)
{
frame->saved_regs = (CORE_ADDR *)
frame->saved_regs = (CORE_ADDR*)
frame_obstack_alloc (SIZEOF_FRAME_SAVED_REGS);
}
if (saved_regs_addr == NULL)
@@ -615,13 +627,13 @@ blockvector_for_pc_sect (pc, section, pindex, symtab)
struct sec *section;
int *pindex;
struct symtab *symtab;
{
register struct block *b;
register int bot, top, half;
struct blockvector *bl;
if (symtab == 0) /* if no symtab specified by caller */
if (symtab == 0) /* if no symtab specified by caller */
{
/* First search all symtabs for one whose file contains our pc */
if ((symtab = find_pc_sect_symtab (pc, section)) == 0)
@@ -652,7 +664,7 @@ blockvector_for_pc_sect (pc, section, pindex, symtab)
while (bot >= 0)
{
b = BLOCKVECTOR_BLOCK (bl, bot);
if (BLOCK_END (b) > pc)
if (BLOCK_END (b) >= pc)
{
if (pindex)
*pindex = bot;
@@ -730,19 +742,19 @@ find_pc_function (pc)
/* These variables are used to cache the most recent result
* of find_pc_partial_function. */
static CORE_ADDR cache_pc_function_low = 0;
static CORE_ADDR cache_pc_function_high = 0;
static char *cache_pc_function_name = 0;
static CORE_ADDR cache_pc_function_low = 0;
static CORE_ADDR cache_pc_function_high = 0;
static char *cache_pc_function_name = 0;
static struct sec *cache_pc_function_section = NULL;
/* Clear cache, e.g. when symbol table is discarded. */
void
clear_pc_function_cache ()
clear_pc_function_cache()
{
cache_pc_function_low = 0;
cache_pc_function_high = 0;
cache_pc_function_name = (char *) 0;
cache_pc_function_name = (char *)0;
cache_pc_function_section = NULL;
}
@@ -759,23 +771,23 @@ clear_pc_function_cache ()
int
find_pc_sect_partial_function (pc, section, name, address, endaddr)
CORE_ADDR pc;
asection *section;
char **name;
CORE_ADDR pc;
asection *section;
char **name;
CORE_ADDR *address;
CORE_ADDR *endaddr;
{
struct partial_symtab *pst;
struct symbol *f;
struct symbol *f;
struct minimal_symbol *msymbol;
struct partial_symbol *psb;
struct obj_section *osect;
struct obj_section *osect;
int i;
CORE_ADDR mapped_pc;
mapped_pc = overlay_mapped_address (pc, section);
if (mapped_pc >= cache_pc_function_low &&
if (mapped_pc >= cache_pc_function_low &&
mapped_pc < cache_pc_function_high &&
section == cache_pc_function_section)
goto return_cached_value;
@@ -783,11 +795,11 @@ find_pc_sect_partial_function (pc, section, name, address, endaddr)
/* If sigtramp is in the u area, it counts as a function (especially
important for step_1). */
#if defined SIGTRAMP_START
if (IN_SIGTRAMP (mapped_pc, (char *) NULL))
if (IN_SIGTRAMP (mapped_pc, (char *)NULL))
{
cache_pc_function_low = SIGTRAMP_START (mapped_pc);
cache_pc_function_high = SIGTRAMP_END (mapped_pc);
cache_pc_function_name = "<sigtramp>";
cache_pc_function_low = SIGTRAMP_START (mapped_pc);
cache_pc_function_high = SIGTRAMP_END (mapped_pc);
cache_pc_function_name = "<sigtramp>";
cache_pc_function_section = section;
goto return_cached_value;
}
@@ -816,9 +828,9 @@ find_pc_sect_partial_function (pc, section, name, address, endaddr)
|| (BLOCK_START (SYMBOL_BLOCK_VALUE (f))
>= SYMBOL_VALUE_ADDRESS (msymbol))))
{
cache_pc_function_low = BLOCK_START (SYMBOL_BLOCK_VALUE (f));
cache_pc_function_high = BLOCK_END (SYMBOL_BLOCK_VALUE (f));
cache_pc_function_name = SYMBOL_NAME (f);
cache_pc_function_low = BLOCK_START (SYMBOL_BLOCK_VALUE (f));
cache_pc_function_high = BLOCK_END (SYMBOL_BLOCK_VALUE (f));
cache_pc_function_name = SYMBOL_NAME (f);
cache_pc_function_section = section;
goto return_cached_value;
}
@@ -869,21 +881,21 @@ find_pc_sect_partial_function (pc, section, name, address, endaddr)
return 0;
}
cache_pc_function_low = SYMBOL_VALUE_ADDRESS (msymbol);
cache_pc_function_name = SYMBOL_NAME (msymbol);
cache_pc_function_low = SYMBOL_VALUE_ADDRESS (msymbol);
cache_pc_function_name = SYMBOL_NAME (msymbol);
cache_pc_function_section = section;
/* Use the lesser of the next minimal symbol in the same section, or
the end of the section, as the end of the function. */
/* Step over other symbols at this same address, and symbols in
other sections, to find the next symbol in this section with
a different address. */
for (i = 1; SYMBOL_NAME (msymbol + i) != NULL; i++)
for (i=1; SYMBOL_NAME (msymbol+i) != NULL; i++)
{
if (SYMBOL_VALUE_ADDRESS (msymbol + i) != SYMBOL_VALUE_ADDRESS (msymbol)
&& SYMBOL_BFD_SECTION (msymbol + i) == SYMBOL_BFD_SECTION (msymbol))
if (SYMBOL_VALUE_ADDRESS (msymbol+i) != SYMBOL_VALUE_ADDRESS (msymbol)
&& SYMBOL_BFD_SECTION (msymbol+i) == SYMBOL_BFD_SECTION (msymbol))
break;
}
@@ -895,33 +907,33 @@ find_pc_sect_partial_function (pc, section, name, address, endaddr)
So the end address is the end of the section. */
cache_pc_function_high = osect->endaddr;
return_cached_value:
return_cached_value:
if (address)
{
if (pc_in_unmapped_range (pc, section))
*address = overlay_unmapped_address (cache_pc_function_low, section);
*address = overlay_unmapped_address (cache_pc_function_low, section);
else
*address = cache_pc_function_low;
*address = cache_pc_function_low;
}
if (name)
*name = cache_pc_function_name;
if (endaddr)
{
if (pc_in_unmapped_range (pc, section))
{
{
/* Because the high address is actually beyond the end of
the function (and therefore possibly beyond the end of
the overlay), we must actually convert (high - 1)
and then add one to that. */
*endaddr = 1 + overlay_unmapped_address (cache_pc_function_high - 1,
*endaddr = 1 + overlay_unmapped_address (cache_pc_function_high - 1,
section);
}
}
else
*endaddr = cache_pc_function_high;
*endaddr = cache_pc_function_high;
}
return 1;
@@ -931,12 +943,12 @@ return_cached_value:
int
find_pc_partial_function (pc, name, address, endaddr)
CORE_ADDR pc;
char **name;
CORE_ADDR pc;
char **name;
CORE_ADDR *address;
CORE_ADDR *endaddr;
{
asection *section;
asection *section;
section = find_pc_overlay (pc);
return find_pc_sect_partial_function (pc, section, name, address, endaddr);
@@ -979,7 +991,7 @@ find_frame_addr_in_frame_chain (frame_addr)
{
struct frame_info *frame = NULL;
if (frame_addr == (CORE_ADDR) 0)
if (frame_addr == (CORE_ADDR)0)
return NULL;
while (1)
@@ -1012,7 +1024,7 @@ sigtramp_saved_pc (frame)
ptrbytes);
else
sigcontext_addr = read_memory_integer (read_register (SP_REGNUM)
+ sigcontext_offs,
+ sigcontext_offs,
ptrbytes);
/* Don't cause a memory_error when accessing sigcontext in case the stack
@@ -1022,72 +1034,7 @@ sigtramp_saved_pc (frame)
}
#endif /* SIGCONTEXT_PC_OFFSET */
/* Are we in a call dummy? The code below which allows DECR_PC_AFTER_BREAK
below is for infrun.c, which may give the macro a pc without that
subtracted out. */
extern CORE_ADDR text_end;
int
pc_in_call_dummy_before_text_end (pc, sp, frame_address)
CORE_ADDR pc;
CORE_ADDR sp;
CORE_ADDR frame_address;
{
return ((pc) >= text_end - CALL_DUMMY_LENGTH
&& (pc) <= text_end + DECR_PC_AFTER_BREAK);
}
int
pc_in_call_dummy_after_text_end (pc, sp, frame_address)
CORE_ADDR pc;
CORE_ADDR sp;
CORE_ADDR frame_address;
{
return ((pc) >= text_end
&& (pc) <= text_end + CALL_DUMMY_LENGTH + DECR_PC_AFTER_BREAK);
}
/* Is the PC in a call dummy? SP and FRAME_ADDRESS are the bottom and
top of the stack frame which we are checking, where "bottom" and
"top" refer to some section of memory which contains the code for
the call dummy. Calls to this macro assume that the contents of
SP_REGNUM and FP_REGNUM (or the saved values thereof), respectively,
are the things to pass.
This won't work on the 29k, where SP_REGNUM and FP_REGNUM don't
have that meaning, but the 29k doesn't use ON_STACK. This could be
fixed by generalizing this scheme, perhaps by passing in a frame
and adding a few fields, at least on machines which need them for
PC_IN_CALL_DUMMY.
Something simpler, like checking for the stack segment, doesn't work,
since various programs (threads implementations, gcc nested function
stubs, etc) may either allocate stack frames in another segment, or
allocate other kinds of code on the stack. */
int
pc_in_call_dummy_on_stack (pc, sp, frame_address)
CORE_ADDR pc;
CORE_ADDR sp;
CORE_ADDR frame_address;
{
return (INNER_THAN ((sp), (pc))
&& (frame_address != 0)
&& INNER_THAN ((pc), (frame_address)));
}
int
pc_in_call_dummy_at_entry_point (pc, sp, frame_address)
CORE_ADDR pc;
CORE_ADDR sp;
CORE_ADDR frame_address;
{
return ((pc) >= CALL_DUMMY_ADDRESS ()
&& (pc) <= (CALL_DUMMY_ADDRESS () + DECR_PC_AFTER_BREAK));
}
#ifdef USE_GENERIC_DUMMY_FRAMES
/*
* GENERIC DUMMY FRAMES
@@ -1104,23 +1051,7 @@ pc_in_call_dummy_at_entry_point (pc, sp, frame_address)
* zero, and CALL_DUMMY_LOCATION to AT_ENTRY. Then you must remember
* to define PUSH_RETURN_ADDRESS, because no call instruction will be
* being executed by the target. Also FRAME_CHAIN_VALID as
* generic_frame_chain_valid and FIX_CALL_DUMMY as
* generic_fix_call_dummy. */
/* Dummy frame. This saves the processor state just prior to setting
up the inferior function call. Older targets save the registers
target stack (but that really slows down function calls). */
struct dummy_frame
{
struct dummy_frame *next;
CORE_ADDR pc;
CORE_ADDR fp;
CORE_ADDR sp;
CORE_ADDR top;
char *registers;
};
* generic_frame_chain_valid. */
static struct dummy_frame *dummy_frame_stack = NULL;
@@ -1128,23 +1059,21 @@ static struct dummy_frame *dummy_frame_stack = NULL;
Search the stack of dummy frames for one matching the given PC, FP and SP.
This is the work-horse for pc_in_call_dummy and read_register_dummy */
char *
char *
generic_find_dummy_frame (pc, fp)
CORE_ADDR pc;
CORE_ADDR fp;
{
struct dummy_frame *dummyframe;
struct dummy_frame * dummyframe;
if (pc != entry_point_address ())
return 0;
for (dummyframe = dummy_frame_stack; dummyframe != NULL;
dummyframe = dummyframe->next)
if (fp == dummyframe->fp
|| fp == dummyframe->sp
|| fp == dummyframe->top)
if (fp == dummyframe->fp || fp == dummyframe->sp)
/* The frame in question lies between the saved fp and sp, inclusive */
return dummyframe->registers;
return dummyframe->regs;
return 0;
}
@@ -1153,14 +1082,12 @@ generic_find_dummy_frame (pc, fp)
Return true if this is a dummy frame created by gdb for an inferior call */
int
generic_pc_in_call_dummy (pc, sp, fp)
generic_pc_in_call_dummy (pc, fp)
CORE_ADDR pc;
CORE_ADDR sp;
CORE_ADDR fp;
{
/* if find_dummy_frame succeeds, then PC is in a call dummy */
/* Note: SP and not FP is passed on. */
return (generic_find_dummy_frame (pc, sp) != 0);
return (generic_find_dummy_frame (pc, fp) != 0);
}
/* Function: read_register_dummy
@@ -1176,7 +1103,7 @@ generic_read_register_dummy (pc, fp, regno)
if (dummy_regs)
return extract_address (&dummy_regs[REGISTER_BYTE (regno)],
REGISTER_RAW_SIZE (regno));
REGISTER_RAW_SIZE(regno));
else
return 0;
}
@@ -1203,7 +1130,6 @@ generic_push_dummy_frame ()
if (INNER_THAN (dummy_frame->fp, fp)) /* stale -- destroy! */
{
dummy_frame_stack = dummy_frame->next;
free (dummy_frame->registers);
free (dummy_frame);
dummy_frame = dummy_frame_stack;
}
@@ -1211,34 +1137,24 @@ generic_push_dummy_frame ()
dummy_frame = dummy_frame->next;
dummy_frame = xmalloc (sizeof (struct dummy_frame));
dummy_frame->registers = xmalloc (REGISTER_BYTES);
dummy_frame->pc = read_register (PC_REGNUM);
dummy_frame->sp = read_register (SP_REGNUM);
dummy_frame->top = dummy_frame->sp;
dummy_frame->fp = fp;
read_register_bytes (0, dummy_frame->registers, REGISTER_BYTES);
dummy_frame->pc = read_register (PC_REGNUM);
dummy_frame->sp = read_register (SP_REGNUM);
dummy_frame->fp = fp;
read_register_bytes (0, dummy_frame->regs, REGISTER_BYTES);
dummy_frame->next = dummy_frame_stack;
dummy_frame_stack = dummy_frame;
}
void
generic_save_dummy_frame_tos (sp)
CORE_ADDR sp;
{
dummy_frame_stack->top = sp;
}
/* Function: pop_frame
Restore the machine state from either the saved dummy stack or a
real stack frame. */
void
generic_pop_current_frame (pop)
void (*pop) (struct frame_info * frame);
void (*pop) PARAMS ((struct frame_info *frame));
{
struct frame_info *frame = get_current_frame ();
if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
if (PC_IN_CALL_DUMMY(frame->pc, frame->frame, frame->frame))
generic_pop_dummy_frame ();
else
pop (frame);
@@ -1258,47 +1174,28 @@ generic_pop_dummy_frame ()
if (!dummy_frame)
error ("Can't pop dummy frame!");
dummy_frame_stack = dummy_frame->next;
write_register_bytes (0, dummy_frame->registers, REGISTER_BYTES);
write_register_bytes (0, dummy_frame->regs, REGISTER_BYTES);
flush_cached_frames ();
free (dummy_frame->registers);
free (dummy_frame);
}
/* Function: frame_chain_valid
Returns true for a user frame or a call_function_by_hand dummy frame,
and false for the CRT0 start-up frame. Purpose is to terminate backtrace */
int
generic_frame_chain_valid (fp, fi)
CORE_ADDR fp;
struct frame_info *fi;
{
if (PC_IN_CALL_DUMMY (FRAME_SAVED_PC (fi), fp, fp))
return 1; /* don't prune CALL_DUMMY frames */
else /* fall back to default algorithm (see frame.h) */
if (PC_IN_CALL_DUMMY(FRAME_SAVED_PC(fi), fp, fp))
return 1; /* don't prune CALL_DUMMY frames */
else /* fall back to default algorithm (see frame.h) */
return (fp != 0
&& (INNER_THAN (fi->frame, fp) || fi->frame == fp)
&& !inside_entry_file (FRAME_SAVED_PC (fi)));
&& !inside_entry_file (FRAME_SAVED_PC(fi)));
}
/* Function: fix_call_dummy
Stub function. Generic dumy frames typically do not need to fix
the frame being created */
void
generic_fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p)
char *dummy;
CORE_ADDR pc;
CORE_ADDR fun;
int nargs;
struct value **args;
struct type *type;
int gcc_p;
{
return;
}
/* Function: get_saved_register
Find register number REGNUM relative to FRAME and put its (raw,
target format) contents in *RAW_BUFFER.
@@ -1339,7 +1236,7 @@ generic_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval)
if (optimized != NULL)
*optimized = 0;
if (addrp) /* default assumption: not found in memory */
if (addrp) /* default assumption: not found in memory */
*addrp = 0;
/* Note: since the current frame's registers could only have been
@@ -1351,34 +1248,34 @@ generic_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval)
{
if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
{
if (lval) /* found it in a CALL_DUMMY frame */
if (lval) /* found it in a CALL_DUMMY frame */
*lval = not_lval;
if (raw_buffer)
memcpy (raw_buffer,
generic_find_dummy_frame (frame->pc, frame->frame) +
memcpy (raw_buffer,
generic_find_dummy_frame (frame->pc, frame->frame) +
REGISTER_BYTE (regnum),
REGISTER_RAW_SIZE (regnum));
return;
return;
}
FRAME_INIT_SAVED_REGS (frame);
if (frame->saved_regs != NULL
&& frame->saved_regs[regnum] != 0)
{
if (lval) /* found it saved on the stack */
if (lval) /* found it saved on the stack */
*lval = lval_memory;
if (regnum == SP_REGNUM)
{
if (raw_buffer) /* SP register treated specially */
store_address (raw_buffer, REGISTER_RAW_SIZE (regnum),
if (raw_buffer) /* SP register treated specially */
store_address (raw_buffer, REGISTER_RAW_SIZE (regnum),
frame->saved_regs[regnum]);
}
else
{
if (addrp) /* any other register */
if (addrp) /* any other register */
*addrp = frame->saved_regs[regnum];
if (raw_buffer)
read_memory (frame->saved_regs[regnum], raw_buffer,
read_memory (frame->saved_regs[regnum], raw_buffer,
REGISTER_RAW_SIZE (regnum));
}
return;
@@ -1388,16 +1285,17 @@ generic_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval)
/* If we get thru the loop to this point, it means the register was
not saved in any frame. Return the actual live-register value. */
if (lval) /* found it in a live register */
if (lval) /* found it in a live register */
*lval = lval_register;
if (addrp)
*addrp = REGISTER_BYTE (regnum);
if (raw_buffer)
read_register_gen (regnum, raw_buffer);
}
#endif /* USE_GENERIC_DUMMY_FRAMES */
void
_initialize_blockframe (void)
_initialize_blockframe ()
{
obstack_init (&frame_cache_obstack);
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,22 +1,21 @@
/* Data structures associated with breakpoints in GDB.
Copyright (C) 1992, 93, 94, 95, 96, 98, 1999 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#if !defined (BREAKPOINT_H)
#define BREAKPOINT_H 1
@@ -35,34 +34,33 @@
here. This includes:
* single-step (for machines where we have to simulate single stepping)
(probably, though perhaps it is better for it to look as much as
possible like a single-step to wait_for_inferior). */
(probably, though perhaps it is better for it to look as much as
possible like a single-step to wait_for_inferior). */
enum bptype
{
bp_none = 0, /* Eventpoint has been deleted. */
bp_breakpoint, /* Normal breakpoint */
bp_hardware_breakpoint, /* Hardware assisted breakpoint */
bp_until, /* used by until command */
bp_finish, /* used by finish command */
bp_watchpoint, /* Watchpoint */
bp_hardware_watchpoint, /* Hardware assisted watchpoint */
bp_read_watchpoint, /* read watchpoint, (hardware assisted) */
bp_access_watchpoint, /* access watchpoint, (hardware assisted) */
bp_longjmp, /* secret breakpoint to find longjmp() */
bp_longjmp_resume, /* secret breakpoint to escape longjmp() */
enum bptype {
bp_none = 0, /* Eventpoint has been deleted. */
bp_breakpoint, /* Normal breakpoint */
bp_hardware_breakpoint, /* Hardware assisted breakpoint */
bp_until, /* used by until command */
bp_finish, /* used by finish command */
bp_watchpoint, /* Watchpoint */
bp_hardware_watchpoint, /* Hardware assisted watchpoint */
bp_read_watchpoint, /* read watchpoint, (hardware assisted) */
bp_access_watchpoint, /* access watchpoint, (hardware assisted) */
bp_longjmp, /* secret breakpoint to find longjmp() */
bp_longjmp_resume, /* secret breakpoint to escape longjmp() */
/* Used by wait_for_inferior for stepping over subroutine calls, for
stepping over signal handlers, and for skipping prologues. */
bp_step_resume,
/* Used by wait_for_inferior for stepping over subroutine calls, for
stepping over signal handlers, and for skipping prologues. */
bp_step_resume,
/* Used by wait_for_inferior for stepping over signal handlers. */
bp_through_sigtramp,
/* Used by wait_for_inferior for stepping over signal handlers. */
bp_through_sigtramp,
/* Used to detect when a watchpoint expression has gone out of
scope. These breakpoints are usually not visible to the user.
/* Used to detect when a watchpoint expression has gone out of
scope. These breakpoints are usually not visible to the user.
This breakpoint has some interesting properties:
This breakpoint has some interesting properties:
1) There's always a 1:1 mapping between watchpoints
on local variables and watchpoint_scope breakpoints.
@@ -71,89 +69,77 @@ enum bptype
associated with when hit.
3) It can never be disabled. */
bp_watchpoint_scope,
bp_watchpoint_scope,
/* The breakpoint at the end of a call dummy. */
/* FIXME: What if the function we are calling longjmp()s out of the
call, or the user gets out with the "return" command? We currently
have no way of cleaning up the breakpoint in these (obscure) situations.
(Probably can solve this by noticing longjmp, "return", etc., it's
similar to noticing when a watchpoint on a local variable goes out
of scope (with hardware support for watchpoints)). */
bp_call_dummy,
/* The breakpoint at the end of a call dummy. */
/* FIXME: What if the function we are calling longjmp()s out of the
call, or the user gets out with the "return" command? We currently
have no way of cleaning up the breakpoint in these (obscure) situations.
(Probably can solve this by noticing longjmp, "return", etc., it's
similar to noticing when a watchpoint on a local variable goes out
of scope (with hardware support for watchpoints)). */
bp_call_dummy,
/* Some dynamic linkers (HP, maybe Solaris) can arrange for special
code in the inferior to run when significant events occur in the
dynamic linker (for example a library is loaded or unloaded).
/* Some dynamic linkers (HP, maybe Solaris) can arrange for special
code in the inferior to run when significant events occur in the
dynamic linker (for example a library is loaded or unloaded).
By placing a breakpoint in this magic code GDB will get control
when these significant events occur. GDB can then re-examine
the dynamic linker's data structures to discover any newly loaded
dynamic libraries. */
bp_shlib_event,
By placing a breakpoint in this magic code GDB will get control
when these significant events occur. GDB can then re-examine
the dynamic linker's data structures to discover any newly loaded
dynamic libraries. */
bp_shlib_event,
/* These breakpoints are used to implement the "catch load" command
on platforms whose dynamic linkers support such functionality. */
bp_catch_load,
/* These breakpoints are used to implement the "catch unload" command
on platforms whose dynamic linkers support such functionality. */
bp_catch_unload,
/* These are not really breakpoints, but are catchpoints that
implement the "catch fork", "catch vfork" and "catch exec" commands
on platforms whose kernel support such functionality. (I.e.,
kernels which can raise an event when a fork or exec occurs, as
opposed to the debugger setting breakpoints on functions named
"fork" or "exec".) */
bp_catch_fork,
bp_catch_vfork,
bp_catch_exec,
/* These breakpoints are used to implement the "catch load" command
on platforms whose dynamic linkers support such functionality. */
bp_catch_load,
/* These breakpoints are used to implement the "catch unload" command
on platforms whose dynamic linkers support such functionality. */
bp_catch_unload,
/* These are not really breakpoints, but are catchpoints that
implement the "catch fork", "catch vfork" and "catch exec" commands
on platforms whose kernel support such functionality. (I.e.,
kernels which can raise an event when a fork or exec occurs, as
opposed to the debugger setting breakpoints on functions named
"fork" or "exec".) */
bp_catch_fork,
bp_catch_vfork,
bp_catch_exec,
/* These are catchpoints to implement "catch catch" and "catch throw"
commands for C++ exception handling. */
bp_catch_catch,
bp_catch_throw
};
/* These are catchpoints to implement "catch catch" and "catch throw"
commands for C++ exception handling. */
bp_catch_catch,
bp_catch_throw
};
/* States of enablement of breakpoint. */
enum enable
{
disabled, /* The eventpoint is inactive, and cannot trigger. */
enabled, /* The eventpoint is active, and can trigger. */
shlib_disabled, /* The eventpoint's address is in an unloaded solib.
The eventpoint will be automatically enabled
and reset when that solib is loaded. */
call_disabled /* The eventpoint has been disabled while a call
into the inferior is "in flight", because some
eventpoints interfere with the implementation of
a call on some targets. The eventpoint will be
automatically enabled and reset when the call
"lands" (either completes, or stops at another
eventpoint). */
};
enum enable {
disabled, /* The eventpoint is inactive, and cannot trigger. */
enabled, /* The eventpoint is active, and can trigger. */
shlib_disabled, /* The eventpoint's address is within an unloaded solib.
The eventpoint will be automatically enabled & reset
when that solib is loaded. */
call_disabled /* The eventpoint has been disabled while a call into
the inferior is "in flight", because some eventpoints
interfere with the implementation of a call on some
targets. The eventpoint will be automatically enabled
& reset when the call "lands" (either completes, or
stops at another eventpoint). */
};
/* Disposition of breakpoint. Ie: what to do after hitting it. */
enum bpdisp
{
del, /* Delete it */
del_at_next_stop, /* Delete at next stop, whether hit or not */
disable, /* Disable it */
donttouch /* Leave it alone */
};
enum target_hw_bp_type
{
hw_write = 0, /* Common HW watchpoint */
hw_read = 1, /* Read HW watchpoint */
hw_access = 2, /* Access HW watchpoint */
hw_execute = 3 /* Execute HW breakpoint */
};
enum bpdisp {
del, /* Delete it */
del_at_next_stop, /* Delete at next stop, whether hit or not */
disable, /* Disable it */
donttouch /* Leave it alone */
};
/* Note that the ->silent field is not currently used by any commands
(though the code is in there if it was to be, and set_raw_breakpoint
@@ -164,125 +150,122 @@ enum target_hw_bp_type
/* This is for a breakpoint or a watchpoint. */
struct breakpoint
{
struct breakpoint *next;
/* Type of breakpoint. */
enum bptype type;
/* Zero means disabled; remember the info but don't break here. */
enum enable enable;
/* What to do with this breakpoint after we hit it. */
enum bpdisp disposition;
/* Number assigned to distinguish breakpoints. */
int number;
{
struct breakpoint *next;
/* Type of breakpoint. */
enum bptype type;
/* Zero means disabled; remember the info but don't break here. */
enum enable enable;
/* What to do with this breakpoint after we hit it. */
enum bpdisp disposition;
/* Number assigned to distinguish breakpoints. */
int number;
/* Address to break at, or NULL if not a breakpoint. */
CORE_ADDR address;
/* Address to break at, or NULL if not a breakpoint. */
CORE_ADDR address;
/* Line number of this address. Only matters if address is
non-NULL. */
/* Line number of this address. Only matters if address is
non-NULL. */
int line_number;
int line_number;
/* Source file name of this address. Only matters if address is
non-NULL. */
/* Source file name of this address. Only matters if address is
non-NULL. */
char *source_file;
char *source_file;
/* Non-zero means a silent breakpoint (don't print frame info
if we stop here). */
unsigned char silent;
/* Number of stops at this breakpoint that should
be continued automatically before really stopping. */
int ignore_count;
/* "Real" contents of byte where breakpoint has been inserted.
Valid only when breakpoints are in the program. Under the complete
control of the target insert_breakpoint and remove_breakpoint routines.
No other code should assume anything about the value(s) here. */
char shadow_contents[BREAKPOINT_MAX];
/* Nonzero if this breakpoint is now inserted. Only matters if address
is non-NULL. */
char inserted;
/* Nonzero if this is not the first breakpoint in the list
for the given address. Only matters if address is non-NULL. */
char duplicate;
/* Chain of command lines to execute when this breakpoint is hit. */
struct command_line *commands;
/* Stack depth (address of frame). If nonzero, break only if fp
equals this. */
CORE_ADDR frame;
/* Conditional. Break only if this expression's value is nonzero. */
struct expression *cond;
/* Non-zero means a silent breakpoint (don't print frame info
if we stop here). */
unsigned char silent;
/* Number of stops at this breakpoint that should
be continued automatically before really stopping. */
int ignore_count;
/* "Real" contents of byte where breakpoint has been inserted.
Valid only when breakpoints are in the program. Under the complete
control of the target insert_breakpoint and remove_breakpoint routines.
No other code should assume anything about the value(s) here. */
char shadow_contents[BREAKPOINT_MAX];
/* Nonzero if this breakpoint is now inserted. Only matters if address
is non-NULL. */
char inserted;
/* Nonzero if this is not the first breakpoint in the list
for the given address. Only matters if address is non-NULL. */
char duplicate;
/* Chain of command lines to execute when this breakpoint is hit. */
struct command_line *commands;
/* Stack depth (address of frame). If nonzero, break only if fp
equals this. */
CORE_ADDR frame;
/* Conditional. Break only if this expression's value is nonzero. */
struct expression *cond;
/* String we used to set the breakpoint (malloc'd). Only matters if
address is non-NULL. */
char *addr_string;
/* Language we used to set the breakpoint. */
enum language language;
/* Input radix we used to set the breakpoint. */
int input_radix;
/* String form of the breakpoint condition (malloc'd), or NULL if there
is no condition. */
char *cond_string;
/* String form of exp (malloc'd), or NULL if none. */
char *exp_string;
/* String we used to set the breakpoint (malloc'd). Only matters if
address is non-NULL. */
char *addr_string;
/* Language we used to set the breakpoint. */
enum language language;
/* Input radix we used to set the breakpoint. */
int input_radix;
/* String form of the breakpoint condition (malloc'd), or NULL if there
is no condition. */
char *cond_string;
/* String form of exp (malloc'd), or NULL if none. */
char *exp_string;
/* The expression we are watching, or NULL if not a watchpoint. */
struct expression *exp;
/* The largest block within which it is valid, or NULL if it is
valid anywhere (e.g. consists just of global symbols). */
struct block *exp_valid_block;
/* Value of the watchpoint the last time we checked it. */
value_ptr val;
/* The expression we are watching, or NULL if not a watchpoint. */
struct expression *exp;
/* The largest block within which it is valid, or NULL if it is
valid anywhere (e.g. consists just of global symbols). */
struct block *exp_valid_block;
/* Value of the watchpoint the last time we checked it. */
value_ptr val;
/* Holds the value chain for a hardware watchpoint expression. */
value_ptr val_chain;
/* Holds the value chain for a hardware watchpoint expression. */
value_ptr val_chain;
/* Holds the address of the related watchpoint_scope breakpoint
when using watchpoints on local variables (might the concept
of a related breakpoint be useful elsewhere, if not just call
it the watchpoint_scope breakpoint or something like that. FIXME). */
struct breakpoint *related_breakpoint;
/* Holds the address of the related watchpoint_scope breakpoint
when using watchpoints on local variables (might the concept
of a related breakpoint be useful elsewhere, if not just call
it the watchpoint_scope breakpoint or something like that. FIXME). */
struct breakpoint *related_breakpoint;
/* Holds the frame address which identifies the frame this watchpoint
should be evaluated in, or NULL if the watchpoint should be evaluated
on the outermost frame. */
CORE_ADDR watchpoint_frame;
/* Holds the frame address which identifies the frame this watchpoint
should be evaluated in, or NULL if the watchpoint should be evaluated
on the outermost frame. */
CORE_ADDR watchpoint_frame;
/* Thread number for thread-specific breakpoint, or -1 if don't care */
int thread;
/* Thread number for thread-specific breakpoint, or -1 if don't care */
int thread;
/* Count of the number of times this breakpoint was taken, dumped
with the info, but not used for anything else. Useful for
seeing how many times you hit a break prior to the program
aborting, so you can back up to just before the abort. */
int hit_count;
/* Count of the number of times this breakpoint was taken, dumped
with the info, but not used for anything else. Useful for
seeing how many times you hit a break prior to the program
aborting, so you can back up to just before the abort. */
int hit_count;
/* Filename of a dynamically-linked library (dll), used for
bp_catch_load and bp_catch_unload (malloc'd), or NULL if any
library is significant. */
char *dll_pathname;
/* Filename of a dll whose state change (e.g., load or unload)
triggered this catchpoint. This field is only vaid immediately
after this catchpoint has triggered. */
char *triggered_dll_pathname;
/* Process id of a child process whose forking triggered this
catchpoint. This field is only vaid immediately after this
catchpoint has triggered. */
int forked_inferior_pid;
/* Filename of a program whose exec triggered this catchpoint.
This field is only vaid immediately after this catchpoint has
triggered. */
char *exec_pathname;
asection *section;
};
/* Filename of a dynamically-linked library (dll), used for bp_catch_load
and bp_catch_unload (malloc'd), or NULL if any library is significant. */
char * dll_pathname;
/* Filename of a dll whose state change (e.g., load or unload)
triggered this catchpoint. This field is only vaid immediately
after this catchpoint has triggered. */
char * triggered_dll_pathname;
/* Process id of a child process whose forking triggered this catchpoint.
This field is only vaid immediately after this catchpoint has triggered. */
int forked_inferior_pid;
/* Filename of a program whose exec triggered this catchpoint. This
field is only vaid immediately after this catchpoint has triggered. */
char * exec_pathname;
asection *section;
};
/* The following stuff is an abstract data type "bpstat" ("breakpoint
status"). This provides the ability to determine whether we have
stopped at a breakpoint, and what we should do about it. */
/* The following stuff is an abstract data type "bpstat" ("breakpoint status").
This provides the ability to determine whether we have stopped at a
breakpoint, and what we should do about it. */
typedef struct bpstats *bpstat;
@@ -300,73 +283,71 @@ extern bpstat bpstat_stop_status PARAMS ((CORE_ADDR *, int));
/* This bpstat_what stuff tells wait_for_inferior what to do with a
breakpoint (a challenging task). */
enum bpstat_what_main_action
{
/* Perform various other tests; that is, this bpstat does not
say to perform any action (e.g. failed watchpoint and nothing
else). */
BPSTAT_WHAT_KEEP_CHECKING,
enum bpstat_what_main_action {
/* Perform various other tests; that is, this bpstat does not
say to perform any action (e.g. failed watchpoint and nothing
else). */
BPSTAT_WHAT_KEEP_CHECKING,
/* Rather than distinguish between noisy and silent stops here, it
might be cleaner to have bpstat_print make that decision (also
taking into account stop_print_frame and source_only). But the
implications are a bit scary (interaction with auto-displays, etc.),
so I won't try it. */
/* Rather than distinguish between noisy and silent stops here, it
might be cleaner to have bpstat_print make that decision (also
taking into account stop_print_frame and source_only). But the
implications are a bit scary (interaction with auto-displays, etc.),
so I won't try it. */
/* Stop silently. */
BPSTAT_WHAT_STOP_SILENT,
/* Stop silently. */
BPSTAT_WHAT_STOP_SILENT,
/* Stop and print. */
BPSTAT_WHAT_STOP_NOISY,
/* Stop and print. */
BPSTAT_WHAT_STOP_NOISY,
/* Remove breakpoints, single step once, then put them back in and
go back to what we were doing. It's possible that this should be
removed from the main_action and put into a separate field, to more
cleanly handle BPSTAT_WHAT_CLEAR_LONGJMP_RESUME_SINGLE. */
BPSTAT_WHAT_SINGLE,
/* Remove breakpoints, single step once, then put them back in and
go back to what we were doing. It's possible that this should be
removed from the main_action and put into a separate field, to more
cleanly handle BPSTAT_WHAT_CLEAR_LONGJMP_RESUME_SINGLE. */
BPSTAT_WHAT_SINGLE,
/* Set longjmp_resume breakpoint, remove all other breakpoints,
and continue. The "remove all other breakpoints" part is required
if we are also stepping over another breakpoint as well as doing
the longjmp handling. */
BPSTAT_WHAT_SET_LONGJMP_RESUME,
/* Set longjmp_resume breakpoint, remove all other breakpoints,
and continue. The "remove all other breakpoints" part is required
if we are also stepping over another breakpoint as well as doing
the longjmp handling. */
BPSTAT_WHAT_SET_LONGJMP_RESUME,
/* Clear longjmp_resume breakpoint, then handle as
BPSTAT_WHAT_KEEP_CHECKING. */
BPSTAT_WHAT_CLEAR_LONGJMP_RESUME,
/* Clear longjmp_resume breakpoint, then handle as
BPSTAT_WHAT_KEEP_CHECKING. */
BPSTAT_WHAT_CLEAR_LONGJMP_RESUME,
/* Clear longjmp_resume breakpoint, then handle as BPSTAT_WHAT_SINGLE. */
BPSTAT_WHAT_CLEAR_LONGJMP_RESUME_SINGLE,
/* Clear longjmp_resume breakpoint, then handle as BPSTAT_WHAT_SINGLE. */
BPSTAT_WHAT_CLEAR_LONGJMP_RESUME_SINGLE,
/* Clear step resume breakpoint, and keep checking. */
BPSTAT_WHAT_STEP_RESUME,
/* Clear step resume breakpoint, and keep checking. */
BPSTAT_WHAT_STEP_RESUME,
/* Clear through_sigtramp breakpoint, muck with trap_expected, and keep
checking. */
BPSTAT_WHAT_THROUGH_SIGTRAMP,
/* Clear through_sigtramp breakpoint, muck with trap_expected, and keep
checking. */
BPSTAT_WHAT_THROUGH_SIGTRAMP,
/* Check the dynamic linker's data structures for new libraries, then
keep checking. */
BPSTAT_WHAT_CHECK_SHLIBS,
/* Check the dynamic linker's data structures for new libraries, then
keep checking. */
BPSTAT_WHAT_CHECK_SHLIBS,
/* Check the dynamic linker's data structures for new libraries, then
resume out of the dynamic linker's callback, stop and print. */
BPSTAT_WHAT_CHECK_SHLIBS_RESUME_FROM_HOOK,
/* Check the dynamic linker's data structures for new libraries, then
resume out of the dynamic linker's callback, stop and print. */
BPSTAT_WHAT_CHECK_SHLIBS_RESUME_FROM_HOOK,
/* This is just used to keep track of how many enums there are. */
BPSTAT_WHAT_LAST
};
/* This is just used to keep track of how many enums there are. */
BPSTAT_WHAT_LAST
};
struct bpstat_what {
enum bpstat_what_main_action main_action;
struct bpstat_what
{
enum bpstat_what_main_action main_action;
/* Did we hit a call dummy breakpoint? This only goes with a main_action
of BPSTAT_WHAT_STOP_SILENT or BPSTAT_WHAT_STOP_NOISY (the concept of
continuing from a call dummy without popping the frame is not a
useful one). */
int call_dummy;
};
/* Did we hit a call dummy breakpoint? This only goes with a main_action
of BPSTAT_WHAT_STOP_SILENT or BPSTAT_WHAT_STOP_NOISY (the concept of
continuing from a call dummy without popping the frame is not a
useful one). */
int call_dummy;
};
/* Tell what to do about this bpstat. */
struct bpstat_what bpstat_what PARAMS ((bpstat));
@@ -382,9 +363,9 @@ bpstat bpstat_find_breakpoint PARAMS ((bpstat, struct breakpoint *));
step_resume breakpoint.
See wait_for_inferior's use of this function.
*/
*/
extern struct breakpoint *
bpstat_find_step_resume_breakpoint PARAMS ((bpstat));
bpstat_find_step_resume_breakpoint PARAMS ((bpstat));
/* Nonzero if a signal that we got in wait() was due to circumstances
explained by the BS. */
@@ -423,45 +404,45 @@ extern void bpstat_clear_actions PARAMS ((bpstat));
/* Given a bpstat that records zero or more triggered eventpoints, this
function returns another bpstat which contains only the catchpoints
on that first list, if any.
*/
*/
extern void bpstat_get_triggered_catchpoints PARAMS ((bpstat, bpstat *));
/* Implementation: */
struct bpstats
{
/* Linked list because there can be two breakpoints at the same
place, and a bpstat reflects the fact that both have been hit. */
bpstat next;
/* Breakpoint that we are at. */
struct breakpoint *breakpoint_at;
/* Commands left to be done. */
struct command_line *commands;
/* Old value associated with a watchpoint. */
value_ptr old_val;
{
/* Linked list because there can be two breakpoints at the
same place, and a bpstat reflects the fact that both have been hit. */
bpstat next;
/* Breakpoint that we are at. */
struct breakpoint *breakpoint_at;
/* Commands left to be done. */
struct command_line *commands;
/* Old value associated with a watchpoint. */
value_ptr old_val;
/* Nonzero if this breakpoint tells us to print the frame. */
char print;
/* Nonzero if this breakpoint tells us to print the frame. */
char print;
/* Nonzero if this breakpoint tells us to stop. */
char stop;
/* Nonzero if this breakpoint tells us to stop. */
char stop;
/* Function called by bpstat_print to print stuff associated with
this element of the bpstat chain. Returns 0 or 1 just like
bpstat_print, or -1 if it can't deal with it. */
int (*print_it) PARAMS ((bpstat bs));
};
/* Function called by bpstat_print to print stuff associated with
this element of the bpstat chain. Returns 0 or 1 just like
bpstat_print, or -1 if it can't deal with it. */
int (*print_it) PARAMS((bpstat bs));
};
enum inf_context
{
inf_starting,
inf_running,
inf_exited
};
{
inf_starting,
inf_running,
inf_exited
};
/* Prototypes for breakpoint-related functions. */
#ifdef __STDC__ /* Forward declarations for prototypes */
#ifdef __STDC__ /* Forward declarations for prototypes */
struct frame_info;
#endif
@@ -486,8 +467,7 @@ extern struct breakpoint *set_momentary_breakpoint
extern void set_ignore_count PARAMS ((int, int, int));
extern void set_default_breakpoint PARAMS ((int, CORE_ADDR,
struct symtab *, int));
extern void set_default_breakpoint PARAMS ((int, CORE_ADDR, struct symtab *, int));
extern void mark_breakpoints_out PARAMS ((void));
@@ -519,16 +499,16 @@ extern int reattach_breakpoints PARAMS ((int));
This function causes the following:
- All eventpoints are marked "not inserted".
- All eventpoints with a symbolic address are reset such that
the symbolic address must be reevaluated before the eventpoints
can be reinserted.
- The solib breakpoints are explicitly removed from the breakpoint
list.
- A step-resume breakpoint, if any, is explicitly removed from the
breakpoint list.
- All eventpoints without a symbolic address are removed from the
breakpoint list. */
- All eventpoints are marked "not inserted".
- All eventpoints with a symbolic address are reset such that
the symbolic address must be reevaluated before the eventpoints
can be reinserted.
- The solib breakpoints are explicitly removed from the breakpoint
list.
- A step-resume breakpoint, if any, is explicitly removed from the
breakpoint list.
- All eventpoints without a symbolic address are removed from the
breakpoint list. */
extern void update_breakpoints_after_exec PARAMS ((void));
/* This function can be used to physically remove hardware breakpoints
@@ -537,11 +517,11 @@ extern void update_breakpoints_after_exec PARAMS ((void));
those targets which support following the processes of a fork() or
vfork() system call, when one of the resulting two processes is to
be detached and allowed to run free.
It is an error to use this function on the process whose id is
inferior_pid. */
extern int detach_breakpoints PARAMS ((int));
extern void enable_longjmp_breakpoint PARAMS ((void));
extern void disable_longjmp_breakpoint PARAMS ((void));
@@ -575,7 +555,7 @@ disable_watchpoints_before_interactive_call_start PARAMS ((void));
extern void
enable_watchpoints_after_interactive_call_stop PARAMS ((void));
extern void clear_breakpoint_hit_counts PARAMS ((void));
/* The following are for displays, which aren't really breakpoints, but
@@ -601,26 +581,24 @@ extern void disable_breakpoints_in_shlibs PARAMS ((int silent));
extern void re_enable_breakpoints_in_shlibs PARAMS ((void));
extern void create_solib_load_event_breakpoint PARAMS ((char *, int,
char *, char *));
extern void create_solib_unload_event_breakpoint PARAMS ((char *, int,
char *, char *));
extern void create_solib_load_event_breakpoint PARAMS ((char *, int, char *, char *));
extern void create_solib_unload_event_breakpoint PARAMS ((char *, int, char *, char *));
extern void create_fork_event_catchpoint PARAMS ((int, char *));
extern void create_vfork_event_catchpoint PARAMS ((int, char *));
extern void create_exec_event_catchpoint PARAMS ((int, char *));
/* This function returns TRUE if ep is a catchpoint. */
extern int ep_is_catchpoint PARAMS ((struct breakpoint *));
/* This function returns TRUE if ep is a catchpoint of a
shared library (aka dynamically-linked library) event,
such as a library load or unload. */
extern int ep_is_shlib_catchpoint PARAMS ((struct breakpoint *));
extern struct breakpoint *set_breakpoint_sal PARAMS ((struct symtab_and_line));
#endif /* !defined (BREAKPOINT_H) */

View File

@@ -1,22 +1,21 @@
/* Support routines for building symbol tables in GDB's internal format.
Copyright 1986-1999 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* This module provides subroutines used for creating and adding to
the symbol table. These routines are called from various symbol-
@@ -36,8 +35,7 @@
#include "gdb_string.h"
/* Ask buildsym.h to define the vars it normally declares `extern'. */
#define EXTERN
/**/
#define EXTERN /**/
#include "buildsym.h" /* Our own declarations */
#undef EXTERN
@@ -148,7 +146,7 @@ find_symbol_in_list (struct pending *list, char *name, int length)
/* ARGSUSED */
void
really_free_pendings (PTR dummy)
really_free_pendings (int foo)
{
struct pending *next, *next1;
@@ -222,7 +220,7 @@ finish_block (struct symbol *symbol, struct pending **listhead,
}
block = (struct block *) obstack_alloc (&objfile->symbol_obstack,
(sizeof (struct block) + ((i - 1) * sizeof (struct symbol *))));
(sizeof (struct block) + ((i - 1) * sizeof (struct symbol *))));
/* Copy the symbols into the block. */
@@ -384,7 +382,7 @@ finish_block (struct symbol *symbol, struct pending **listhead,
else
{
complain (&innerblock_anon_complaint, BLOCK_START (pblock->block),
BLOCK_END (pblock->block), BLOCK_START (block),
BLOCK_END (pblock->block), BLOCK_START (block),
BLOCK_END (block));
}
if (BLOCK_START (pblock->block) < BLOCK_START (block))
@@ -571,7 +569,7 @@ start_subfile (char *name, char *dirname)
program. But to demangle we need to set the language to C++. We
can distinguish cfront code by the fact that it has #line
directives which specify a file name ending in .C.
So if the filename of this subfile ends in .C, then change the
language of any pending subfiles from C to C++. We also accept
any other C++ suffixes accepted by deduce_language_from_filename
@@ -697,7 +695,7 @@ record_line (register struct subfile *subfile, int line, CORE_ADDR pc)
subfile->line_vector_length = INITIAL_LINE_VECTOR_LENGTH;
subfile->line_vector = (struct linetable *)
xmalloc (sizeof (struct linetable)
+ subfile->line_vector_length * sizeof (struct linetable_entry));
+ subfile->line_vector_length * sizeof (struct linetable_entry));
subfile->line_vector->nitems = 0;
have_line_numbers = 1;
}
@@ -857,7 +855,7 @@ end_symtab (CORE_ADDR end_addr, struct objfile *objfile, int section)
/* Cleanup any undefined types that have been left hanging around
(this needs to be done before the finish_blocks so that
file_symbols is still good).
Both cleanup_undefined_types and finish_global_stabs are stabs
specific, but harmless for other symbol readers, since on gdb
startup or when finished reading stabs, the state is set so these
@@ -923,7 +921,7 @@ end_symtab (CORE_ADDR end_addr, struct objfile *objfile, int section)
if (objfile->flags & OBJF_REORDERED)
qsort (subfile->line_vector->item,
subfile->line_vector->nitems,
sizeof (struct linetable_entry), compare_line_numbers);
sizeof (struct linetable_entry), compare_line_numbers);
}
/* Now, allocate a symbol table. */
@@ -970,8 +968,8 @@ end_symtab (CORE_ADDR end_addr, struct objfile *objfile, int section)
if (subfile->debugformat != NULL)
{
symtab->debugformat = obsavestring (subfile->debugformat,
strlen (subfile->debugformat),
&objfile->symbol_obstack);
strlen (subfile->debugformat),
&objfile->symbol_obstack);
}
/* All symtabs for the main file and the subfiles share a
@@ -1027,7 +1025,7 @@ push_context (int desc, CORE_ADDR valu)
context_stack_size *= 2;
context_stack = (struct context_stack *)
xrealloc ((char *) context_stack,
(context_stack_size * sizeof (struct context_stack)));
(context_stack_size * sizeof (struct context_stack)));
}
new = &context_stack[context_stack_depth++];

View File

@@ -1,22 +1,21 @@
/* Build symbol tables in GDB's internal format.
Copyright 1986-1993, 1996-1999 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#if !defined (BUILDSYM_H)
#define BUILDSYM_H 1
@@ -243,7 +242,7 @@ extern void finish_block (struct symbol *symbol,
CORE_ADDR start, CORE_ADDR end,
struct objfile *objfile);
extern void really_free_pendings (PTR dummy);
extern void really_free_pendings (int foo);
extern void start_subfile (char *name, char *dirname);

2796
gdb/c-exp.tab.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,22 +1,21 @@
/* C language support routines for GDB, the GNU debugger.
Copyright 1992, 1993, 1994 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "symtab.h"
@@ -26,8 +25,7 @@
#include "language.h"
#include "c-lang.h"
extern void _initialize_c_language PARAMS ((void));
static void c_emit_char PARAMS ((int c, GDB_FILE * stream, int quoter));
static void c_emit_char PARAMS ((int c, GDB_FILE *stream, int quoter));
/* Print the character C on STREAM as part of the contents of a literal
string whose delimiter is QUOTER. Note that that format for printing
@@ -118,7 +116,7 @@ c_printstr (stream, string, length, width, force_ellipses)
style. */
if (!force_ellipses
&& length > 0
&& extract_unsigned_integer (string + (length - 1) * width, width) == '\0')
&& extract_unsigned_integer (string + (length - 1) * width, width) == '\0')
length--;
if (length == 0)
@@ -130,7 +128,7 @@ c_printstr (stream, string, length, width, force_ellipses)
for (i = 0; i < length && things_printed < print_max; ++i)
{
/* Position of the character we are examining
to see whether it is repeated. */
to see whether it is repeated. */
unsigned int rep1;
/* Number of repetitions we have detected so far. */
unsigned int reps;
@@ -150,7 +148,7 @@ c_printstr (stream, string, length, width, force_ellipses)
reps = 1;
while (rep1 < length
&& extract_unsigned_integer (string + rep1 * width, width)
== current_char)
== current_char)
{
++rep1;
++reps;
@@ -232,192 +230,191 @@ c_create_fundamental_type (objfile, typeid)
switch (typeid)
{
default:
/* FIXME: For now, if we are asked to produce a type not in this
language, create the equivalent of a C integer type with the
name "<?type?>". When all the dust settles from the type
reconstruction work, this should probably become an error. */
type = init_type (TYPE_CODE_INT,
TARGET_INT_BIT / TARGET_CHAR_BIT,
0, "<?type?>", objfile);
warning ("internal error: no C/C++ fundamental type %d", typeid);
break;
case FT_VOID:
type = init_type (TYPE_CODE_VOID,
TARGET_CHAR_BIT / TARGET_CHAR_BIT,
0, "void", objfile);
break;
case FT_BOOLEAN:
type = init_type (TYPE_CODE_BOOL,
TARGET_CHAR_BIT / TARGET_CHAR_BIT,
0, "bool", objfile);
default:
/* FIXME: For now, if we are asked to produce a type not in this
language, create the equivalent of a C integer type with the
name "<?type?>". When all the dust settles from the type
reconstruction work, this should probably become an error. */
type = init_type (TYPE_CODE_INT,
TARGET_INT_BIT / TARGET_CHAR_BIT,
0, "<?type?>", objfile);
warning ("internal error: no C/C++ fundamental type %d", typeid);
break;
case FT_VOID:
type = init_type (TYPE_CODE_VOID,
TARGET_CHAR_BIT / TARGET_CHAR_BIT,
0, "void", objfile);
break;
case FT_BOOLEAN:
type = init_type (TYPE_CODE_BOOL,
TARGET_CHAR_BIT / TARGET_CHAR_BIT,
0, "bool", objfile);
break;
case FT_CHAR:
type = init_type (TYPE_CODE_INT,
TARGET_CHAR_BIT / TARGET_CHAR_BIT,
0, "char", objfile);
TYPE_FLAGS (type) |= TYPE_FLAG_NOSIGN;
break;
case FT_SIGNED_CHAR:
type = init_type (TYPE_CODE_INT,
TARGET_CHAR_BIT / TARGET_CHAR_BIT,
0, "signed char", objfile);
break;
case FT_UNSIGNED_CHAR:
type = init_type (TYPE_CODE_INT,
TARGET_CHAR_BIT / TARGET_CHAR_BIT,
TYPE_FLAG_UNSIGNED, "unsigned char", objfile);
break;
case FT_SHORT:
type = init_type (TYPE_CODE_INT,
TARGET_SHORT_BIT / TARGET_CHAR_BIT,
0, "short", objfile);
break;
case FT_SIGNED_SHORT:
type = init_type (TYPE_CODE_INT,
TARGET_SHORT_BIT / TARGET_CHAR_BIT,
0, "short", objfile); /* FIXME-fnf */
break;
case FT_UNSIGNED_SHORT:
type = init_type (TYPE_CODE_INT,
TARGET_SHORT_BIT / TARGET_CHAR_BIT,
TYPE_FLAG_UNSIGNED, "unsigned short", objfile);
break;
case FT_INTEGER:
type = init_type (TYPE_CODE_INT,
TARGET_INT_BIT / TARGET_CHAR_BIT,
0, "int", objfile);
break;
case FT_SIGNED_INTEGER:
type = init_type (TYPE_CODE_INT,
TARGET_INT_BIT / TARGET_CHAR_BIT,
0, "int", objfile); /* FIXME -fnf */
break;
case FT_UNSIGNED_INTEGER:
type = init_type (TYPE_CODE_INT,
TARGET_INT_BIT / TARGET_CHAR_BIT,
TYPE_FLAG_UNSIGNED, "unsigned int", objfile);
break;
case FT_LONG:
type = init_type (TYPE_CODE_INT,
TARGET_LONG_BIT / TARGET_CHAR_BIT,
0, "long", objfile);
break;
case FT_SIGNED_LONG:
type = init_type (TYPE_CODE_INT,
TARGET_LONG_BIT / TARGET_CHAR_BIT,
0, "long", objfile); /* FIXME -fnf */
break;
case FT_UNSIGNED_LONG:
type = init_type (TYPE_CODE_INT,
TARGET_LONG_BIT / TARGET_CHAR_BIT,
TYPE_FLAG_UNSIGNED, "unsigned long", objfile);
break;
case FT_LONG_LONG:
type = init_type (TYPE_CODE_INT,
TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
0, "long long", objfile);
break;
case FT_SIGNED_LONG_LONG:
type = init_type (TYPE_CODE_INT,
TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
0, "signed long long", objfile);
break;
case FT_UNSIGNED_LONG_LONG:
type = init_type (TYPE_CODE_INT,
TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
TYPE_FLAG_UNSIGNED, "unsigned long long", objfile);
break;
case FT_FLOAT:
type = init_type (TYPE_CODE_FLT,
TARGET_FLOAT_BIT / TARGET_CHAR_BIT,
0, "float", objfile);
break;
case FT_DBL_PREC_FLOAT:
type = init_type (TYPE_CODE_FLT,
TARGET_DOUBLE_BIT / TARGET_CHAR_BIT,
0, "double", objfile);
break;
case FT_EXT_PREC_FLOAT:
type = init_type (TYPE_CODE_FLT,
TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT,
0, "long double", objfile);
break;
case FT_TEMPLATE_ARG:
type = init_type (TYPE_CODE_TEMPLATE_ARG,
0,
0, "<template arg>", objfile);
break;
case FT_CHAR:
type = init_type (TYPE_CODE_INT,
TARGET_CHAR_BIT / TARGET_CHAR_BIT,
0, "char", objfile);
TYPE_FLAGS (type) |= TYPE_FLAG_NOSIGN;
break;
case FT_SIGNED_CHAR:
type = init_type (TYPE_CODE_INT,
TARGET_CHAR_BIT / TARGET_CHAR_BIT,
0, "signed char", objfile);
break;
case FT_UNSIGNED_CHAR:
type = init_type (TYPE_CODE_INT,
TARGET_CHAR_BIT / TARGET_CHAR_BIT,
TYPE_FLAG_UNSIGNED, "unsigned char", objfile);
break;
case FT_SHORT:
type = init_type (TYPE_CODE_INT,
TARGET_SHORT_BIT / TARGET_CHAR_BIT,
0, "short", objfile);
break;
case FT_SIGNED_SHORT:
type = init_type (TYPE_CODE_INT,
TARGET_SHORT_BIT / TARGET_CHAR_BIT,
0, "short", objfile); /* FIXME-fnf */
break;
case FT_UNSIGNED_SHORT:
type = init_type (TYPE_CODE_INT,
TARGET_SHORT_BIT / TARGET_CHAR_BIT,
TYPE_FLAG_UNSIGNED, "unsigned short", objfile);
break;
case FT_INTEGER:
type = init_type (TYPE_CODE_INT,
TARGET_INT_BIT / TARGET_CHAR_BIT,
0, "int", objfile);
break;
case FT_SIGNED_INTEGER:
type = init_type (TYPE_CODE_INT,
TARGET_INT_BIT / TARGET_CHAR_BIT,
0, "int", objfile); /* FIXME -fnf */
break;
case FT_UNSIGNED_INTEGER:
type = init_type (TYPE_CODE_INT,
TARGET_INT_BIT / TARGET_CHAR_BIT,
TYPE_FLAG_UNSIGNED, "unsigned int", objfile);
break;
case FT_LONG:
type = init_type (TYPE_CODE_INT,
TARGET_LONG_BIT / TARGET_CHAR_BIT,
0, "long", objfile);
break;
case FT_SIGNED_LONG:
type = init_type (TYPE_CODE_INT,
TARGET_LONG_BIT / TARGET_CHAR_BIT,
0, "long", objfile); /* FIXME -fnf */
break;
case FT_UNSIGNED_LONG:
type = init_type (TYPE_CODE_INT,
TARGET_LONG_BIT / TARGET_CHAR_BIT,
TYPE_FLAG_UNSIGNED, "unsigned long", objfile);
break;
case FT_LONG_LONG:
type = init_type (TYPE_CODE_INT,
TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
0, "long long", objfile);
break;
case FT_SIGNED_LONG_LONG:
type = init_type (TYPE_CODE_INT,
TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
0, "signed long long", objfile);
break;
case FT_UNSIGNED_LONG_LONG:
type = init_type (TYPE_CODE_INT,
TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
TYPE_FLAG_UNSIGNED, "unsigned long long", objfile);
break;
case FT_FLOAT:
type = init_type (TYPE_CODE_FLT,
TARGET_FLOAT_BIT / TARGET_CHAR_BIT,
0, "float", objfile);
break;
case FT_DBL_PREC_FLOAT:
type = init_type (TYPE_CODE_FLT,
TARGET_DOUBLE_BIT / TARGET_CHAR_BIT,
0, "double", objfile);
break;
case FT_EXT_PREC_FLOAT:
type = init_type (TYPE_CODE_FLT,
TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT,
0, "long double", objfile);
break;
case FT_TEMPLATE_ARG:
type = init_type (TYPE_CODE_TEMPLATE_ARG,
0,
0, "<template arg>", objfile);
break;
}
break;
}
return (type);
}
/* Table mapping opcodes into strings for printing operators
and precedences of the operators. */
const struct op_print c_op_print_tab[] =
{
{",", BINOP_COMMA, PREC_COMMA, 0},
{"=", BINOP_ASSIGN, PREC_ASSIGN, 1},
{"||", BINOP_LOGICAL_OR, PREC_LOGICAL_OR, 0},
{"&&", BINOP_LOGICAL_AND, PREC_LOGICAL_AND, 0},
{"|", BINOP_BITWISE_IOR, PREC_BITWISE_IOR, 0},
{"^", BINOP_BITWISE_XOR, PREC_BITWISE_XOR, 0},
{"&", BINOP_BITWISE_AND, PREC_BITWISE_AND, 0},
{"==", BINOP_EQUAL, PREC_EQUAL, 0},
{"!=", BINOP_NOTEQUAL, PREC_EQUAL, 0},
{"<=", BINOP_LEQ, PREC_ORDER, 0},
{">=", BINOP_GEQ, PREC_ORDER, 0},
{">", BINOP_GTR, PREC_ORDER, 0},
{"<", BINOP_LESS, PREC_ORDER, 0},
{">>", BINOP_RSH, PREC_SHIFT, 0},
{"<<", BINOP_LSH, PREC_SHIFT, 0},
{"+", BINOP_ADD, PREC_ADD, 0},
{"-", BINOP_SUB, PREC_ADD, 0},
{"*", BINOP_MUL, PREC_MUL, 0},
{"/", BINOP_DIV, PREC_MUL, 0},
{"%", BINOP_REM, PREC_MUL, 0},
{"@", BINOP_REPEAT, PREC_REPEAT, 0},
{"-", UNOP_NEG, PREC_PREFIX, 0},
{"!", UNOP_LOGICAL_NOT, PREC_PREFIX, 0},
{"~", UNOP_COMPLEMENT, PREC_PREFIX, 0},
{"*", UNOP_IND, PREC_PREFIX, 0},
{"&", UNOP_ADDR, PREC_PREFIX, 0},
{"sizeof ", UNOP_SIZEOF, PREC_PREFIX, 0},
{"++", UNOP_PREINCREMENT, PREC_PREFIX, 0},
{"--", UNOP_PREDECREMENT, PREC_PREFIX, 0},
{
{",", BINOP_COMMA, PREC_COMMA, 0},
{"=", BINOP_ASSIGN, PREC_ASSIGN, 1},
{"||", BINOP_LOGICAL_OR, PREC_LOGICAL_OR, 0},
{"&&", BINOP_LOGICAL_AND, PREC_LOGICAL_AND, 0},
{"|", BINOP_BITWISE_IOR, PREC_BITWISE_IOR, 0},
{"^", BINOP_BITWISE_XOR, PREC_BITWISE_XOR, 0},
{"&", BINOP_BITWISE_AND, PREC_BITWISE_AND, 0},
{"==", BINOP_EQUAL, PREC_EQUAL, 0},
{"!=", BINOP_NOTEQUAL, PREC_EQUAL, 0},
{"<=", BINOP_LEQ, PREC_ORDER, 0},
{">=", BINOP_GEQ, PREC_ORDER, 0},
{">", BINOP_GTR, PREC_ORDER, 0},
{"<", BINOP_LESS, PREC_ORDER, 0},
{">>", BINOP_RSH, PREC_SHIFT, 0},
{"<<", BINOP_LSH, PREC_SHIFT, 0},
{"+", BINOP_ADD, PREC_ADD, 0},
{"-", BINOP_SUB, PREC_ADD, 0},
{"*", BINOP_MUL, PREC_MUL, 0},
{"/", BINOP_DIV, PREC_MUL, 0},
{"%", BINOP_REM, PREC_MUL, 0},
{"@", BINOP_REPEAT, PREC_REPEAT, 0},
{"-", UNOP_NEG, PREC_PREFIX, 0},
{"!", UNOP_LOGICAL_NOT, PREC_PREFIX, 0},
{"~", UNOP_COMPLEMENT, PREC_PREFIX, 0},
{"*", UNOP_IND, PREC_PREFIX, 0},
{"&", UNOP_ADDR, PREC_PREFIX, 0},
{"sizeof ", UNOP_SIZEOF, PREC_PREFIX, 0},
{"++", UNOP_PREINCREMENT, PREC_PREFIX, 0},
{"--", UNOP_PREDECREMENT, PREC_PREFIX, 0},
/* C++ */
{"::", BINOP_SCOPE, PREC_PREFIX, 0},
{NULL, 0, 0, 0}
{"::", BINOP_SCOPE, PREC_PREFIX, 0},
{NULL, 0, 0, 0}
};
struct type **CONST_PTR (c_builtin_types[]) =
struct type ** CONST_PTR (c_builtin_types[]) =
{
&builtin_type_int,
&builtin_type_long,
&builtin_type_short,
&builtin_type_char,
&builtin_type_float,
&builtin_type_double,
&builtin_type_void,
&builtin_type_long_long,
&builtin_type_signed_char,
&builtin_type_unsigned_char,
&builtin_type_unsigned_short,
&builtin_type_unsigned_int,
&builtin_type_unsigned_long,
&builtin_type_unsigned_long_long,
&builtin_type_long_double,
&builtin_type_complex,
&builtin_type_double_complex,
0
&builtin_type_long,
&builtin_type_short,
&builtin_type_char,
&builtin_type_float,
&builtin_type_double,
&builtin_type_void,
&builtin_type_long_long,
&builtin_type_signed_char,
&builtin_type_unsigned_char,
&builtin_type_unsigned_short,
&builtin_type_unsigned_int,
&builtin_type_unsigned_long,
&builtin_type_unsigned_long_long,
&builtin_type_long_double,
&builtin_type_complex,
&builtin_type_double_complex,
0
};
const struct language_defn c_language_defn =
{
const struct language_defn c_language_defn = {
"c", /* Language name */
language_c,
c_builtin_types,
@@ -433,43 +430,42 @@ const struct language_defn c_language_defn =
c_print_type, /* Print a type using appropriate syntax */
c_val_print, /* Print a value using appropriate syntax */
c_value_print, /* Print a top-level value */
{"", "", "", ""}, /* Binary format info */
{"0%lo", "0", "o", ""}, /* Octal format info */
{"%ld", "", "d", ""}, /* Decimal format info */
{"0x%lx", "0x", "x", ""}, /* Hex format info */
{"", "", "", ""}, /* Binary format info */
{"0%lo", "0", "o", ""}, /* Octal format info */
{"%ld", "", "d", ""}, /* Decimal format info */
{"0x%lx", "0x", "x", ""}, /* Hex format info */
c_op_print_tab, /* expression operators for printing */
1, /* c-style arrays */
0, /* String lower bound */
&builtin_type_char, /* Type of string elements */
&builtin_type_char, /* Type of string elements */
LANG_MAGIC
};
struct type **const (cplus_builtin_types[]) =
struct type ** const (cplus_builtin_types[]) =
{
&builtin_type_int,
&builtin_type_long,
&builtin_type_short,
&builtin_type_char,
&builtin_type_float,
&builtin_type_double,
&builtin_type_void,
&builtin_type_long_long,
&builtin_type_signed_char,
&builtin_type_unsigned_char,
&builtin_type_unsigned_short,
&builtin_type_unsigned_int,
&builtin_type_unsigned_long,
&builtin_type_unsigned_long_long,
&builtin_type_long_double,
&builtin_type_complex,
&builtin_type_double_complex,
&builtin_type_bool,
0
&builtin_type_long,
&builtin_type_short,
&builtin_type_char,
&builtin_type_float,
&builtin_type_double,
&builtin_type_void,
&builtin_type_long_long,
&builtin_type_signed_char,
&builtin_type_unsigned_char,
&builtin_type_unsigned_short,
&builtin_type_unsigned_int,
&builtin_type_unsigned_long,
&builtin_type_unsigned_long_long,
&builtin_type_long_double,
&builtin_type_complex,
&builtin_type_double_complex,
&builtin_type_bool,
0
};
const struct language_defn cplus_language_defn =
{
"c++", /* Language name */
const struct language_defn cplus_language_defn = {
"c++", /* Language name */
language_cplus,
cplus_builtin_types,
range_check_off,
@@ -484,19 +480,18 @@ const struct language_defn cplus_language_defn =
c_print_type, /* Print a type using appropriate syntax */
c_val_print, /* Print a value using appropriate syntax */
c_value_print, /* Print a top-level value */
{"", "", "", ""}, /* Binary format info */
{"0%lo", "0", "o", ""}, /* Octal format info */
{"%ld", "", "d", ""}, /* Decimal format info */
{"0x%lx", "0x", "x", ""}, /* Hex format info */
{"", "", "", ""}, /* Binary format info */
{"0%lo", "0", "o", ""}, /* Octal format info */
{"%ld", "", "d", ""}, /* Decimal format info */
{"0x%lx", "0x", "x", ""}, /* Hex format info */
c_op_print_tab, /* expression operators for printing */
1, /* c-style arrays */
0, /* String lower bound */
&builtin_type_char, /* Type of string elements */
&builtin_type_char, /* Type of string elements */
LANG_MAGIC
};
const struct language_defn asm_language_defn =
{
const struct language_defn asm_language_defn = {
"asm", /* Language name */
language_asm,
c_builtin_types,
@@ -512,14 +507,14 @@ const struct language_defn asm_language_defn =
c_print_type, /* Print a type using appropriate syntax */
c_val_print, /* Print a value using appropriate syntax */
c_value_print, /* Print a top-level value */
{"", "", "", ""}, /* Binary format info */
{"0%lo", "0", "o", ""}, /* Octal format info */
{"%ld", "", "d", ""}, /* Decimal format info */
{"0x%lx", "0x", "x", ""}, /* Hex format info */
{"", "", "", ""}, /* Binary format info */
{"0%lo", "0", "o", ""}, /* Octal format info */
{"%ld", "", "d", ""}, /* Decimal format info */
{"0x%lx", "0x", "x", ""}, /* Hex format info */
c_op_print_tab, /* expression operators for printing */
1, /* c-style arrays */
0, /* String lower bound */
&builtin_type_char, /* Type of string elements */
&builtin_type_char, /* Type of string elements */
LANG_MAGIC
};

View File

@@ -1,22 +1,21 @@
/* C language support definitions for GDB, the GNU debugger.
Copyright 1992, 1996 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#if !defined (C_LANG_H)
@@ -43,15 +42,15 @@ c_value_print PARAMS ((struct value *, GDB_FILE *, int, enum val_prettyprint));
/* These are in c-lang.c: */
extern void c_printchar PARAMS ((int, GDB_FILE *));
extern void c_printchar PARAMS ((int, GDB_FILE*));
extern void c_printstr PARAMS ((GDB_FILE * stream, char *string,
extern void c_printstr PARAMS ((GDB_FILE *stream, char *string,
unsigned int length, int width,
int force_ellipses));
extern struct type *c_create_fundamental_type PARAMS ((struct objfile *, int));
extern struct type * c_create_fundamental_type PARAMS ((struct objfile*, int));
extern struct type **CONST_PTR (c_builtin_types[]);
extern struct type ** CONST_PTR (c_builtin_types[]);
/* These are in c-typeprint.c: */
@@ -76,7 +75,7 @@ cp_print_class_method PARAMS ((char *, struct type *, GDB_FILE *));
extern void
cp_print_value_fields PARAMS ((struct type *, struct type *, char *, int, CORE_ADDR,
GDB_FILE *, int, int, enum val_prettyprint,
struct type **, int));
struct type**, int));
extern int
cp_is_vtbl_ptr_type PARAMS ((struct type *));
@@ -85,4 +84,4 @@ extern int
cp_is_vtbl_member PARAMS ((struct type *));
#endif /* !defined (C_LANG_H) */
#endif /* !defined (C_LANG_H) */

View File

@@ -2,22 +2,21 @@
Copyright 1986, 1988, 1989, 1991, 1993, 1994, 1995, 1996, 1998, 1999
Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "obstack.h"
@@ -42,8 +41,6 @@
/* Flag indicating target was compiled by HP compiler */
extern int hp_som_som_object_present;
static void cp_type_print_method_args PARAMS ((struct type ** args, char *prefix, char *varstring, int staticp, GDB_FILE * stream));
static void
c_type_print_args PARAMS ((struct type *, GDB_FILE *));
@@ -55,58 +52,58 @@ c_type_print_varspec_prefix PARAMS ((struct type *, GDB_FILE *, int, int));
static void
c_type_print_cv_qualifier PARAMS ((struct type *, GDB_FILE *, int, int));
/* Print a description of a type in the format of a
typedef for the current language.
NEW is the new name for a type TYPE. */
void
c_typedef_print (type, new, stream)
struct type *type;
struct symbol *new;
GDB_FILE *stream;
struct type *type;
struct symbol *new;
GDB_FILE *stream;
{
CHECK_TYPEDEF (type);
switch (current_language->la_language)
{
switch (current_language->la_language)
{
#ifdef _LANG_c
case language_c:
case language_cplus:
fprintf_filtered (stream, "typedef ");
type_print (type, "", stream, 0);
if (TYPE_NAME ((SYMBOL_TYPE (new))) == 0
|| !STREQ (TYPE_NAME ((SYMBOL_TYPE (new))), SYMBOL_NAME (new)))
fprintf_filtered (stream, " %s", SYMBOL_SOURCE_NAME (new));
case language_c:
case language_cplus:
fprintf_filtered(stream, "typedef ");
type_print(type,"",stream,0);
if(TYPE_NAME ((SYMBOL_TYPE (new))) == 0
|| !STREQ (TYPE_NAME ((SYMBOL_TYPE (new))), SYMBOL_NAME (new)))
fprintf_filtered(stream, " %s", SYMBOL_SOURCE_NAME(new));
break;
#endif
#ifdef _LANG_m2
case language_m2:
fprintf_filtered (stream, "TYPE ");
if (!TYPE_NAME (SYMBOL_TYPE (new)) ||
!STREQ (TYPE_NAME (SYMBOL_TYPE (new)), SYMBOL_NAME (new)))
fprintf_filtered (stream, "%s = ", SYMBOL_SOURCE_NAME (new));
case language_m2:
fprintf_filtered(stream, "TYPE ");
if(!TYPE_NAME(SYMBOL_TYPE(new)) ||
!STREQ (TYPE_NAME(SYMBOL_TYPE(new)), SYMBOL_NAME(new)))
fprintf_filtered(stream, "%s = ", SYMBOL_SOURCE_NAME(new));
else
fprintf_filtered (stream, "<builtin> = ");
type_print (type, "", stream, 0);
fprintf_filtered(stream, "<builtin> = ");
type_print(type,"",stream,0);
break;
#endif
#ifdef _LANG_chill
case language_chill:
fprintf_filtered (stream, "SYNMODE ");
if (!TYPE_NAME (SYMBOL_TYPE (new)) ||
!STREQ (TYPE_NAME (SYMBOL_TYPE (new)), SYMBOL_NAME (new)))
fprintf_filtered (stream, "%s = ", SYMBOL_SOURCE_NAME (new));
case language_chill:
fprintf_filtered(stream, "SYNMODE ");
if(!TYPE_NAME(SYMBOL_TYPE(new)) ||
!STREQ (TYPE_NAME(SYMBOL_TYPE(new)), SYMBOL_NAME(new)))
fprintf_filtered(stream, "%s = ", SYMBOL_SOURCE_NAME(new));
else
fprintf_filtered (stream, "<builtin> = ");
type_print (type, "", stream, 0);
fprintf_filtered(stream, "<builtin> = ");
type_print(type,"",stream,0);
break;
#endif
default:
error ("Language not supported.");
}
fprintf_filtered (stream, ";\n");
default:
error("Language not supported.");
}
fprintf_filtered(stream, ";\n");
}
@@ -130,8 +127,8 @@ c_print_type (type, varstring, stream, show, level)
code = TYPE_CODE (type);
if ((varstring != NULL && *varstring != '\0')
||
/* Need a space if going to print stars or brackets;
but not if we will print just a type name. */
/* Need a space if going to print stars or brackets;
but not if we will print just a type name. */
((show > 0 || TYPE_NAME (type) == 0)
&&
(code == TYPE_CODE_PTR || code == TYPE_CODE_FUNC
@@ -147,33 +144,33 @@ c_print_type (type, varstring, stream, show, level)
fputs_filtered (varstring, stream);
/* For demangled function names, we have the arglist as part of the name,
so don't print an additional pair of ()'s */
so don't print an additional pair of ()'s */
demangled_args = strchr (varstring, '(') != NULL;
demangled_args = strchr(varstring, '(') != NULL;
c_type_print_varspec_suffix (type, stream, show, 0, demangled_args);
}
}
/* If TYPE is a derived type, then print out derivation information.
Print only the actual base classes of this type, not the base classes
of the base classes. I.E. for the derivation hierarchy:
class A { int a; };
class B : public A {int b; };
class C : public B {int c; };
class A { int a; };
class B : public A {int b; };
class C : public B {int c; };
Print the type of class C as:
class C : public B {
int c;
}
class C : public B {
int c;
}
Not as the following (like gdb used to), which is not legal C++ syntax for
derived types and may be confused with the multiple inheritance form:
class C : public B : public A {
int c;
}
class C : public B : public A {
int c;
}
In general, gdb should try to print the types as closely as possible to
the form that they appear in the source code.
@@ -193,9 +190,9 @@ cp_type_print_derivation_info (stream, type)
{
fputs_filtered (i == 0 ? ": " : ", ", stream);
fprintf_filtered (stream, "%s%s ",
BASETYPE_VIA_PUBLIC (type, i) ? "public"
: (TYPE_FIELD_PROTECTED (type, i) ? "protected" : "private"),
BASETYPE_VIA_VIRTUAL (type, i) ? " virtual" : "");
BASETYPE_VIA_PUBLIC (type, i) ? "public"
: (TYPE_FIELD_PROTECTED (type, i) ? "protected" : "private"),
BASETYPE_VIA_VIRTUAL(type, i) ? " virtual" : "");
name = type_name_no_tag (TYPE_BASECLASS (type, i));
fprintf_filtered (stream, "%s", name ? name : "(null)");
}
@@ -205,8 +202,8 @@ cp_type_print_derivation_info (stream, type)
}
}
/* Print the C++ method arguments ARGS to the file STREAM. */
static void
void
cp_type_print_method_args (args, prefix, varstring, staticp, stream)
struct type **args;
char *prefix;
@@ -215,34 +212,33 @@ cp_type_print_method_args (args, prefix, varstring, staticp, stream)
GDB_FILE *stream;
{
int i;
fprintf_symbol_filtered (stream, prefix, language_cplus, DMGL_ANSI);
fprintf_symbol_filtered (stream, varstring, language_cplus, DMGL_ANSI);
fputs_filtered ("(", stream);
if (args && args[!staticp] && args[!staticp]->code != TYPE_CODE_VOID)
{
i = !staticp; /* skip the class variable */
i = !staticp; /* skip the class variable */
while (1)
{
type_print (args[i++], "", stream, 0);
if (!args[i])
{
fprintf_filtered (stream, " ...");
break;
}
else if (args[i]->code != TYPE_CODE_VOID)
{
fprintf_filtered (stream, ", ");
}
else
break;
}
{
type_print (args[i++], "", stream, 0);
if (!args[i])
{
fprintf_filtered (stream, " ...");
break;
}
else if (args[i]->code != TYPE_CODE_VOID)
{
fprintf_filtered (stream, ", ");
}
else break;
}
}
else if (current_language->la_language == language_cplus)
{
fprintf_filtered (stream, "void");
}
fprintf_filtered (stream, ")");
}
@@ -288,7 +284,7 @@ c_type_print_varspec_prefix (type, stream, show, passed_a_ptr)
if (name)
fputs_filtered (name, stream);
else
c_type_print_base (TYPE_DOMAIN_TYPE (type), stream, 0, passed_a_ptr);
c_type_print_base (TYPE_DOMAIN_TYPE (type), stream, 0, passed_a_ptr);
fprintf_filtered (stream, "::");
break;
@@ -339,7 +335,7 @@ c_type_print_varspec_prefix (type, stream, show, passed_a_ptr)
case TYPE_CODE_COMPLEX:
case TYPE_CODE_TYPEDEF:
/* These types need no prefix. They are listed here so that
gcc -Wall will reveal any types that haven't been handled. */
gcc -Wall will reveal any types that haven't been handled. */
break;
}
}
@@ -351,25 +347,25 @@ c_type_print_varspec_prefix (type, stream, show, passed_a_ptr)
static void
c_type_print_cv_qualifier (type, stream, need_pre_space, need_post_space)
struct type *type;
GDB_FILE *stream;
int need_pre_space;
int need_post_space;
struct type *type;
GDB_FILE *stream;
int need_pre_space;
int need_post_space;
{
int flag = 0;
if (TYPE_CONST (type))
{
if (need_pre_space)
fprintf_filtered (stream, " ");
fprintf_filtered (stream, " ");
fprintf_filtered (stream, "const");
flag = 1;
}
if (TYPE_VOLATILE (type))
{
if (flag || need_pre_space)
fprintf_filtered (stream, " ");
fprintf_filtered (stream, " ");
fprintf_filtered (stream, "volatile");
flag = 1;
}
@@ -398,10 +394,10 @@ c_type_print_args (type, stream)
fprintf_filtered (stream, "...");
}
else if ((args[1]->code == TYPE_CODE_VOID) &&
(current_language->la_language == language_cplus))
{
fprintf_filtered (stream, "void");
}
(current_language->la_language == language_cplus))
{
fprintf_filtered (stream, "void");
}
else
{
for (i = 1;
@@ -409,11 +405,11 @@ c_type_print_args (type, stream)
i++)
{
c_print_type (args[i], "", stream, -1, 0);
if (args[i + 1] == NULL)
if (args[i+1] == NULL)
{
fprintf_filtered (stream, "...");
}
else if (args[i + 1]->code != TYPE_CODE_VOID)
else if (args[i+1]->code != TYPE_CODE_VOID)
{
fprintf_filtered (stream, ",");
wrap_here (" ");
@@ -425,7 +421,7 @@ c_type_print_args (type, stream)
{
fprintf_filtered (stream, "void");
}
fprintf_filtered (stream, ")");
}
@@ -454,15 +450,15 @@ c_type_print_varspec_suffix (type, stream, show, passed_a_ptr, demangled_args)
case TYPE_CODE_ARRAY:
if (passed_a_ptr)
fprintf_filtered (stream, ")");
fprintf_filtered (stream, "[");
if (TYPE_LENGTH (type) >= 0 && TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0
&& TYPE_ARRAY_UPPER_BOUND_TYPE (type) != BOUND_CANNOT_BE_DETERMINED)
&& TYPE_ARRAY_UPPER_BOUND_TYPE(type) != BOUND_CANNOT_BE_DETERMINED)
fprintf_filtered (stream, "%d",
(TYPE_LENGTH (type)
/ TYPE_LENGTH (TYPE_TARGET_TYPE (type))));
fprintf_filtered (stream, "]");
c_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 0, 0);
break;
@@ -491,23 +487,22 @@ c_type_print_varspec_suffix (type, stream, show, passed_a_ptr, demangled_args)
if (passed_a_ptr)
fprintf_filtered (stream, ")");
if (!demangled_args)
{
int i, len = TYPE_NFIELDS (type);
{ int i, len = TYPE_NFIELDS (type);
fprintf_filtered (stream, "(");
if ((len == 0) && (current_language->la_language == language_cplus))
{
fprintf_filtered (stream, "void");
}
else
for (i = 0; i < len; i++)
{
if (i > 0)
{
fputs_filtered (", ", stream);
wrap_here (" ");
}
c_print_type (TYPE_FIELD_TYPE (type, i), "", stream, -1, 0);
}
if ((len == 0) && (current_language->la_language == language_cplus))
{
fprintf_filtered (stream, "void");
}
else
for (i = 0; i < len; i++)
{
if (i > 0)
{
fputs_filtered (", ", stream);
wrap_here (" ");
}
c_print_type (TYPE_FIELD_TYPE (type, i), "", stream, -1, 0);
}
fprintf_filtered (stream, ")");
}
c_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0,
@@ -531,7 +526,7 @@ c_type_print_varspec_suffix (type, stream, show, passed_a_ptr, demangled_args)
case TYPE_CODE_COMPLEX:
case TYPE_CODE_TYPEDEF:
/* These types do not need a suffix. They are listed so that
gcc -Wall will report types that may not have been considered. */
gcc -Wall will report types that may not have been considered. */
break;
}
}
@@ -565,11 +560,7 @@ c_type_print_base (type, stream, show, level)
char *mangled_name;
char *demangled_name;
char *demangled_no_static;
enum
{
s_none, s_public, s_private, s_protected
}
section_type;
enum {s_none, s_public, s_private, s_protected} section_type;
int need_access_label = 0;
int j, len2;
@@ -597,7 +588,7 @@ c_type_print_base (type, stream, show, level)
}
CHECK_TYPEDEF (type);
switch (TYPE_CODE (type))
{
case TYPE_CODE_TYPEDEF:
@@ -615,32 +606,28 @@ c_type_print_base (type, stream, show, level)
/* Note TYPE_CODE_STRUCT and TYPE_CODE_CLASS have the same value,
* so we use another means for distinguishing them.
*/
if (HAVE_CPLUS_STRUCT (type))
{
switch (TYPE_DECLARED_TYPE (type))
{
case DECLARED_TYPE_CLASS:
fprintf_filtered (stream, "class ");
break;
case DECLARED_TYPE_UNION:
fprintf_filtered (stream, "union ");
break;
case DECLARED_TYPE_STRUCT:
fprintf_filtered (stream, "struct ");
break;
default:
/* If there is a CPLUS_STRUCT, assume class if not
* otherwise specified in the declared_type field.
*/
fprintf_filtered (stream, "class ");
break;
} /* switch */
}
else
{
/* If not CPLUS_STRUCT, then assume it's a C struct */
fprintf_filtered (stream, "struct ");
}
if (HAVE_CPLUS_STRUCT (type)) {
switch (TYPE_DECLARED_TYPE(type)) {
case DECLARED_TYPE_CLASS:
fprintf_filtered (stream, "class ");
break;
case DECLARED_TYPE_UNION:
fprintf_filtered (stream, "union ");
break;
case DECLARED_TYPE_STRUCT:
fprintf_filtered (stream, "struct ");
break;
default:
/* If there is a CPLUS_STRUCT, assume class if not
* otherwise specified in the declared_type field.
*/
fprintf_filtered (stream, "class ");
break;
} /* switch */
} else {
/* If not CPLUS_STRUCT, then assume it's a C struct */
fprintf_filtered (stream, "struct ");
}
goto struct_union;
case TYPE_CODE_UNION:
@@ -656,7 +643,7 @@ c_type_print_base (type, stream, show, level)
* want to print.
*/
if (TYPE_TAG_NAME (type) != NULL &&
strncmp (TYPE_TAG_NAME (type), "{unnamed", 8))
strncmp(TYPE_TAG_NAME(type), "{unnamed", 8))
{
fputs_filtered (TYPE_TAG_NAME (type), stream);
if (show > 0)
@@ -672,7 +659,7 @@ c_type_print_base (type, stream, show, level)
else if (show > 0 || TYPE_TAG_NAME (type) == NULL)
{
cp_type_print_derivation_info (stream, type);
fprintf_filtered (stream, "{\n");
if ((TYPE_NFIELDS (type) == 0) && (TYPE_NFN_FIELDS (type) == 0))
{
@@ -688,71 +675,71 @@ c_type_print_base (type, stream, show, level)
section_type = s_none;
/* For a class, if all members are private, there's no need
for a "private:" label; similarly, for a struct or union
masquerading as a class, if all members are public, there's
no need for a "public:" label. */
/* For a class, if all members are private, there's no need
for a "private:" label; similarly, for a struct or union
masquerading as a class, if all members are public, there's
no need for a "public:" label. */
if ((TYPE_DECLARED_TYPE (type) == DECLARED_TYPE_CLASS) ||
(TYPE_DECLARED_TYPE (type) == DECLARED_TYPE_TEMPLATE))
{
QUIT;
len = TYPE_NFIELDS (type);
for (i = TYPE_N_BASECLASSES (type); i < len; i++)
if (!TYPE_FIELD_PRIVATE (type, i))
{
need_access_label = 1;
break;
}
QUIT;
if (!need_access_label)
{
len2 = TYPE_NFN_FIELDS (type);
for (j = 0; j < len2; j++)
{
len = TYPE_FN_FIELDLIST_LENGTH (type, j);
for (i = 0; i < len; i++)
if (!TYPE_FN_FIELD_PRIVATE (TYPE_FN_FIELDLIST1 (type, j), i))
{
need_access_label = 1;
break;
}
if (need_access_label)
break;
}
}
}
else if ((TYPE_DECLARED_TYPE (type) == DECLARED_TYPE_STRUCT) ||
(TYPE_DECLARED_TYPE (type) == DECLARED_TYPE_UNION))
{
QUIT;
len = TYPE_NFIELDS (type);
for (i = TYPE_N_BASECLASSES (type); i < len; i++)
if (TYPE_FIELD_PRIVATE (type, i) || TYPE_FIELD_PROTECTED (type, i))
{
need_access_label = 1;
break;
}
QUIT;
if (!need_access_label)
{
len2 = TYPE_NFN_FIELDS (type);
for (j = 0; j < len2; j++)
{
QUIT;
len = TYPE_FN_FIELDLIST_LENGTH (type, j);
for (i = 0; i < len; i++)
if (TYPE_FN_FIELD_PRIVATE (TYPE_FN_FIELDLIST1 (type, j), i) ||
TYPE_FN_FIELD_PROTECTED (TYPE_FN_FIELDLIST1 (type, j), i))
{
need_access_label = 1;
break;
}
if (need_access_label)
break;
}
}
}
if ((TYPE_DECLARED_TYPE (type) == DECLARED_TYPE_CLASS) ||
(TYPE_DECLARED_TYPE (type) == DECLARED_TYPE_TEMPLATE))
{
QUIT;
len = TYPE_NFIELDS (type);
for (i = TYPE_N_BASECLASSES (type); i < len; i++)
if (!TYPE_FIELD_PRIVATE (type, i))
{
need_access_label = 1;
break;
}
QUIT;
if (!need_access_label)
{
len2 = TYPE_NFN_FIELDS (type);
for (j = 0; j < len2; j++)
{
len = TYPE_FN_FIELDLIST_LENGTH (type, j);
for (i = 0; i < len; i++)
if (!TYPE_FN_FIELD_PRIVATE (TYPE_FN_FIELDLIST1 (type, j), i))
{
need_access_label = 1;
break;
}
if (need_access_label)
break;
}
}
}
else if ((TYPE_DECLARED_TYPE (type) == DECLARED_TYPE_STRUCT) ||
(TYPE_DECLARED_TYPE (type) == DECLARED_TYPE_UNION))
{
QUIT;
len = TYPE_NFIELDS (type);
for (i = TYPE_N_BASECLASSES (type); i < len; i++)
if (TYPE_FIELD_PRIVATE (type, i) || TYPE_FIELD_PROTECTED (type, i))
{
need_access_label = 1;
break;
}
QUIT;
if (!need_access_label)
{
len2 = TYPE_NFN_FIELDS (type);
for (j = 0; j < len2; j++)
{
QUIT;
len = TYPE_FN_FIELDLIST_LENGTH (type, j);
for (i = 0; i < len; i++)
if (TYPE_FN_FIELD_PRIVATE (TYPE_FN_FIELDLIST1 (type, j), i) ||
TYPE_FN_FIELD_PROTECTED (TYPE_FN_FIELDLIST1 (type, j), i))
{
need_access_label = 1;
break;
}
if (need_access_label)
break;
}
}
}
/* If there is a base class for this type,
do not print the field that it occupies. */
@@ -762,17 +749,17 @@ c_type_print_base (type, stream, show, level)
{
QUIT;
/* Don't print out virtual function table. */
/* HP ANSI C++ case */
if (TYPE_HAS_VTABLE (type) && (STREQN (TYPE_FIELD_NAME (type, i), "__vfp", 5)))
continue;
/* Other compilers */
/* pai:: FIXME : check for has_vtable < 0 */
/* HP ANSI C++ case */
if (TYPE_HAS_VTABLE(type) && (STREQN (TYPE_FIELD_NAME (type, i), "__vfp", 5)))
continue;
/* Other compilers */
/* pai:: FIXME : check for has_vtable < 0 */
if (STREQN (TYPE_FIELD_NAME (type, i), "_vptr", 5)
&& is_cplus_marker ((TYPE_FIELD_NAME (type, i))[5]))
continue;
/* If this is a C++ class we can print the various C++ section
labels. */
labels. */
if (HAVE_CPLUS_STRUCT (type) && need_access_label)
{
@@ -828,7 +815,7 @@ c_type_print_base (type, stream, show, level)
/* If there are both fields and methods, put a space between. */
len = TYPE_NFN_FIELDS (type);
if (len && section_type != s_none)
fprintf_filtered (stream, "\n");
fprintf_filtered (stream, "\n");
/* C++: print out the methods */
for (i = 0; i < len; i++)
@@ -837,16 +824,16 @@ c_type_print_base (type, stream, show, level)
int j, len2 = TYPE_FN_FIELDLIST_LENGTH (type, i);
char *method_name = TYPE_FN_FIELDLIST_NAME (type, i);
char *name = type_name_no_tag (type);
int is_constructor = name && STREQ (method_name, name);
int is_constructor = name && STREQ(method_name, name);
for (j = 0; j < len2; j++)
{
char *physname = TYPE_FN_FIELD_PHYSNAME (f, j);
int is_full_physname_constructor =
((physname[0] == '_' && physname[1] == '_'
&& strchr ("0123456789Qt", physname[2]))
|| STREQN (physname, "__ct__", 6)
|| DESTRUCTOR_PREFIX_P (physname)
|| STREQN (physname, "__dt__", 6));
int is_full_physname_constructor =
((physname[0] == '_' && physname[1] == '_'
&& strchr ("0123456789Qt", physname[2]))
|| STREQN (physname, "__ct__", 6)
|| DESTRUCTOR_PREFIX_P (physname)
|| STREQN (physname, "__dt__", 6));
QUIT;
if (TYPE_FN_FIELD_PROTECTED (f, j))
@@ -884,13 +871,13 @@ c_type_print_base (type, stream, show, level)
{
/* Keep GDB from crashing here. */
fprintf_filtered (stream, "<undefined type> %s;\n",
TYPE_FN_FIELD_PHYSNAME (f, j));
TYPE_FN_FIELD_PHYSNAME (f, j));
break;
}
else if (!is_constructor && /* constructors don't have declared types */
!is_full_physname_constructor && /* " " */
!strstr (method_name, "operator ")) /* Not a type conversion operator */
/* (note space -- other operators don't have it) */
else if (!is_constructor && /* constructors don't have declared types */
!is_full_physname_constructor && /* " " */
!strstr (method_name, "operator ")) /* Not a type conversion operator */
/* (note space -- other operators don't have it) */
{
type_print (TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE (f, j)),
"", stream, -1);
@@ -908,14 +895,14 @@ c_type_print_base (type, stream, show, level)
if (demangled_name == NULL)
{
/* in some cases (for instance with the HP demangling),
if a function has more than 10 arguments,
the demangling will fail.
Let's try to reconstruct the function signature from
the symbol information */
if a function has more than 10 arguments,
the demangling will fail.
Let's try to reconstruct the function signature from
the symbol information */
if (!TYPE_FN_FIELD_STUB (f, j))
cp_type_print_method_args (TYPE_FN_FIELD_ARGS (f, j), "",
method_name,
TYPE_FN_FIELD_STATIC_P (f, j),
TYPE_FN_FIELD_STATIC_P (f, j),
stream);
else
fprintf_filtered (stream, "<badly mangled name '%s'>",
@@ -925,8 +912,8 @@ c_type_print_base (type, stream, show, level)
{
char *p;
char *demangled_no_class = demangled_name;
while ((p = strchr (demangled_no_class, ':')))
while (p = strchr (demangled_no_class, ':'))
{
demangled_no_class = p;
if (*++demangled_no_class == ':')
@@ -939,7 +926,7 @@ c_type_print_base (type, stream, show, level)
int length = p - demangled_no_class;
demangled_no_static = (char *) xmalloc (length + 1);
strncpy (demangled_no_static, demangled_no_class, length);
*(demangled_no_static + length) = '\0';
*(demangled_no_static + length) = '\0';
fputs_filtered (demangled_no_static, stream);
free (demangled_no_static);
}
@@ -955,40 +942,40 @@ c_type_print_base (type, stream, show, level)
}
}
if (TYPE_LOCALTYPE_PTR (type) && show >= 0)
fprintfi_filtered (level, stream, " (Local at %s:%d)\n",
TYPE_LOCALTYPE_FILE (type),
TYPE_LOCALTYPE_LINE (type));
if (TYPE_LOCALTYPE_PTR (type) && show >= 0)
fprintfi_filtered (level, stream, " (Local at %s:%d)\n",
TYPE_LOCALTYPE_FILE (type),
TYPE_LOCALTYPE_LINE (type));
fprintfi_filtered (level, stream, "}");
}
if (TYPE_CODE (type) == TYPE_CODE_TEMPLATE)
goto go_back;
if (TYPE_CODE(type) == TYPE_CODE_TEMPLATE)
goto go_back;
break;
case TYPE_CODE_ENUM:
c_type_print_cv_qualifier (type, stream, 0, 1);
/* HP C supports sized enums */
if (hp_som_som_object_present)
switch (TYPE_LENGTH (type))
{
case 1:
fputs_filtered ("char ", stream);
break;
case 2:
fputs_filtered ("short ", stream);
break;
default:
break;
}
fprintf_filtered (stream, "enum ");
switch (TYPE_LENGTH (type))
{
case 1:
fputs_filtered ("char ", stream);
break;
case 2:
fputs_filtered ("short ", stream);
break;
default:
break;
}
fprintf_filtered (stream, "enum ");
/* Print the tag name if it exists.
The aCC compiler emits a spurious
"{unnamed struct}"/"{unnamed union}"/"{unnamed enum}"
tag for unnamed struct/union/enum's, which we don't
want to print. */
if (TYPE_TAG_NAME (type) != NULL &&
strncmp (TYPE_TAG_NAME (type), "{unnamed", 8))
strncmp(TYPE_TAG_NAME(type), "{unnamed", 8))
{
fputs_filtered (TYPE_TAG_NAME (type), stream);
if (show > 0)
@@ -1010,8 +997,7 @@ c_type_print_base (type, stream, show, level)
for (i = 0; i < len; i++)
{
QUIT;
if (i)
fprintf_filtered (stream, ", ");
if (i) fprintf_filtered (stream, ", ");
wrap_here (" ");
fputs_filtered (TYPE_FIELD_NAME (type, i), stream);
if (lastval != TYPE_FIELD_BITPOS (type, i))
@@ -1045,45 +1031,41 @@ c_type_print_base (type, stream, show, level)
case TYPE_CODE_TEMPLATE:
/* Called on "ptype t" where "t" is a template.
Prints the template header (with args), e.g.:
template <class T1, class T2> class "
template <class T1, class T2> class "
and then merges with the struct/union/class code to
print the rest of the definition. */
c_type_print_cv_qualifier (type, stream, 0, 1);
fprintf_filtered (stream, "template <");
for (i = 0; i < TYPE_NTEMPLATE_ARGS (type); i++)
{
struct template_arg templ_arg;
templ_arg = TYPE_TEMPLATE_ARG (type, i);
fprintf_filtered (stream, "class %s", templ_arg.name);
if (i < TYPE_NTEMPLATE_ARGS (type) - 1)
fprintf_filtered (stream, ", ");
}
for (i = 0; i < TYPE_NTEMPLATE_ARGS(type); i++) {
struct template_arg templ_arg;
templ_arg = TYPE_TEMPLATE_ARG(type, i);
fprintf_filtered (stream, "class %s", templ_arg.name);
if (i < TYPE_NTEMPLATE_ARGS(type)-1)
fprintf_filtered (stream, ", ");
}
fprintf_filtered (stream, "> class ");
/* Yuck, factor this out to a subroutine so we can call
it and return to the point marked with the "goback:" label... - RT */
goto struct_union;
go_back:
if (TYPE_NINSTANTIATIONS (type) > 0)
{
fprintf_filtered (stream, "\ntemplate instantiations:\n");
for (i = 0; i < TYPE_NINSTANTIATIONS (type); i++)
{
fprintf_filtered (stream, " ");
c_type_print_base (TYPE_INSTANTIATION (type, i), stream, 0, level);
if (i < TYPE_NINSTANTIATIONS (type) - 1)
fprintf_filtered (stream, "\n");
}
}
goto struct_union;
go_back:
if (TYPE_NINSTANTIATIONS(type) > 0) {
fprintf_filtered (stream, "\ntemplate instantiations:\n");
for (i = 0; i < TYPE_NINSTANTIATIONS(type); i++) {
fprintf_filtered(stream, " ");
c_type_print_base (TYPE_INSTANTIATION(type, i), stream, 0, level);
if (i < TYPE_NINSTANTIATIONS(type)-1) fprintf_filtered(stream, "\n");
}
}
break;
default:
/* Handle types not explicitly handled by the other cases,
such as fundamental types. For these, just print whatever
the type name is, as recorded in the type itself. If there
is no type name, then complain. */
such as fundamental types. For these, just print whatever
the type name is, as recorded in the type itself. If there
is no type name, then complain. */
if (TYPE_NAME (type) != NULL)
{
c_type_print_cv_qualifier (type, stream, 0, 1);
c_type_print_cv_qualifier (type, stream, 0, 1);
fputs_filtered (TYPE_NAME (type), stream);
}
else
@@ -1096,3 +1078,12 @@ c_type_print_base (type, stream, show, level)
break;
}
}

View File

@@ -1,23 +1,22 @@
/* Support for printing C values for GDB, the GNU debugger.
Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997
Free Software Foundation, Inc.
Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "symtab.h"
@@ -28,8 +27,8 @@
#include "valprint.h"
#include "language.h"
#include "c-lang.h"
/* Print data of type TYPE located at VALADDR (within GDB), which came from
the inferior at address ADDRESS, onto stdio stream STREAM according to
FORMAT (a letter or 0 for natural format). The data at VALADDR is in
@@ -56,7 +55,7 @@ c_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
int recurse;
enum val_prettyprint pretty;
{
register unsigned int i = 0; /* Number of characters printed */
register unsigned int i = 0; /* Number of characters printed */
unsigned len;
struct type *elttype;
unsigned eltlen;
@@ -84,11 +83,11 @@ c_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
&& (format == 0 || format == 's'))
{
/* If requested, look for the first null char and only print
elements up to it. */
elements up to it. */
if (stop_print_at_null)
{
int temp_len;
/* Look for a NULL char. */
for (temp_len = 0;
(valaddr + embedded_offset)[temp_len]
@@ -96,7 +95,7 @@ c_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
temp_len++);
len = temp_len;
}
LA_PRINT_STRING (stream, valaddr + embedded_offset, len, eltlen, 0);
i = len;
}
@@ -104,7 +103,7 @@ c_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
{
fprintf_filtered (stream, "{");
/* If this is a virtual function table, print the 0th
entry specially, and the rest of the members normally. */
entry specially, and the rest of the members normally. */
if (cp_is_vtbl_ptr_type (elttype))
{
i = 1;
@@ -115,7 +114,7 @@ c_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
i = 0;
}
val_print_array_elements (type, valaddr + embedded_offset, address, stream,
format, deref_ref, recurse, pretty, i);
format, deref_ref, recurse, pretty, i);
fprintf_filtered (stream, "}");
}
break;
@@ -130,13 +129,13 @@ c_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
print_scalar_formatted (valaddr + embedded_offset, type, format, 0, stream);
break;
}
if (vtblprint && cp_is_vtbl_ptr_type (type))
if (vtblprint && cp_is_vtbl_ptr_type(type))
{
/* Print the unmangled name if desired. */
/* Print the unmangled name if desired. */
/* Print vtable entry - we only get here if we ARE using
-fvtable_thunks. (Otherwise, look under TYPE_CODE_STRUCT.) */
print_address_demangle (extract_address (valaddr + embedded_offset, TYPE_LENGTH (type)),
stream, demangle);
print_address_demangle(extract_address (valaddr + embedded_offset, TYPE_LENGTH (type)),
stream, demangle);
break;
}
elttype = check_typedef (TYPE_TARGET_TYPE (type));
@@ -154,7 +153,7 @@ c_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
{
addr = unpack_pointer (type, valaddr + embedded_offset);
print_unpacked_pointer:
elttype = check_typedef (TYPE_TARGET_TYPE (type));
elttype = check_typedef (TYPE_TARGET_TYPE (type));
if (TYPE_CODE (elttype) == TYPE_CODE_FUNC)
{
@@ -180,13 +179,13 @@ c_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
{
i = val_print_string (addr, -1, TYPE_LENGTH (elttype), stream);
}
else if (cp_is_vtbl_member (type))
{
else if (cp_is_vtbl_member(type))
{
/* print vtbl's nicely */
CORE_ADDR vt_address = unpack_pointer (type, valaddr + embedded_offset);
struct minimal_symbol *msymbol =
lookup_minimal_symbol_by_pc (vt_address);
lookup_minimal_symbol_by_pc (vt_address);
if ((msymbol != NULL) &&
(vt_address == SYMBOL_VALUE_ADDRESS (msymbol)))
{
@@ -195,25 +194,25 @@ c_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
fputs_filtered (">", stream);
}
if (vt_address && vtblprint)
{
{
value_ptr vt_val;
struct symbol *wsym = (struct symbol *) NULL;
struct type *wtype;
struct symbol *wsym = (struct symbol *)NULL;
struct type *wtype;
struct symtab *s;
struct block *block = (struct block *) NULL;
struct block *block = (struct block *)NULL;
int is_this_fld;
if (msymbol != NULL)
wsym = lookup_symbol (SYMBOL_NAME (msymbol), block,
VAR_NAMESPACE, &is_this_fld, &s);
wsym = lookup_symbol (SYMBOL_NAME(msymbol), block,
VAR_NAMESPACE, &is_this_fld, &s);
if (wsym)
{
wtype = SYMBOL_TYPE (wsym);
wtype = SYMBOL_TYPE(wsym);
}
else
{
wtype = TYPE_TARGET_TYPE (type);
wtype = TYPE_TARGET_TYPE(type);
}
vt_val = value_at (wtype, vt_address, NULL);
val_print (VALUE_TYPE (vt_val), VALUE_CONTENTS (vt_val), 0,
@@ -224,8 +223,8 @@ c_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream);
}
}
}
}
}
/* Return number of characters printed, including the terminating
'\0' if we reached the end. val_print_string takes care including
@@ -241,41 +240,41 @@ c_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
case TYPE_CODE_REF:
elttype = check_typedef (TYPE_TARGET_TYPE (type));
if (TYPE_CODE (elttype) == TYPE_CODE_MEMBER)
{
{
cp_print_class_member (valaddr + embedded_offset,
TYPE_DOMAIN_TYPE (elttype),
stream, "");
break;
}
if (addressprint)
{
{
fprintf_filtered (stream, "@");
print_address_numeric
(extract_address (valaddr + embedded_offset,
TARGET_PTR_BIT / HOST_CHAR_BIT), 1, stream);
if (deref_ref)
fputs_filtered (": ", stream);
}
}
/* De-reference the reference. */
if (deref_ref)
{
if (TYPE_CODE (elttype) != TYPE_CODE_UNDEF)
{
value_ptr deref_val =
value_at
(TYPE_TARGET_TYPE (type),
unpack_pointer (lookup_pointer_type (builtin_type_void),
valaddr + embedded_offset),
NULL);
value_at
(TYPE_TARGET_TYPE (type),
unpack_pointer (lookup_pointer_type (builtin_type_void),
valaddr + embedded_offset),
NULL);
val_print (VALUE_TYPE (deref_val),
VALUE_CONTENTS (deref_val),
0,
VALUE_ADDRESS (deref_val),
stream,
format,
deref_ref,
recurse,
pretty);
VALUE_CONTENTS (deref_val),
0,
VALUE_ADDRESS (deref_val),
stream,
format,
deref_ref,
recurse,
pretty);
}
else
fputs_filtered ("???", stream);
@@ -290,16 +289,16 @@ c_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
}
/* Fall through. */
case TYPE_CODE_STRUCT:
if (vtblprint && cp_is_vtbl_ptr_type (type))
if (vtblprint && cp_is_vtbl_ptr_type(type))
{
/* Print the unmangled name if desired. */
/* Print the unmangled name if desired. */
/* Print vtable entry - we only get here if NOT using
-fvtable_thunks. (Otherwise, look under TYPE_CODE_PTR.) */
print_address_demangle (extract_address (
valaddr + embedded_offset +
TYPE_FIELD_BITPOS (type, VTBL_FNADDR_OFFSET) / 8,
TYPE_LENGTH (TYPE_FIELD_TYPE (type, VTBL_FNADDR_OFFSET))),
stream, demangle);
print_address_demangle (extract_address (
valaddr + embedded_offset +
TYPE_FIELD_BITPOS (type, VTBL_FNADDR_OFFSET) / 8,
TYPE_LENGTH (TYPE_FIELD_TYPE (type, VTBL_FNADDR_OFFSET))),
stream, demangle);
}
else
cp_print_value_fields (type, type, valaddr, embedded_offset, address, stream, format,
@@ -339,7 +338,7 @@ c_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
break;
}
/* FIXME, we should consider, at least for ANSI C language, eliminating
the distinction made between FUNCs and POINTERs to FUNCs. */
the distinction made between FUNCs and POINTERs to FUNCs. */
fprintf_filtered (stream, "{");
type_print (type, "", stream, -1);
fprintf_filtered (stream, "} ");
@@ -365,12 +364,12 @@ c_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
case TYPE_CODE_RANGE:
/* FIXME: create_range_type does not set the unsigned bit in a
range type (I think it probably should copy it from the target
type), so we won't print values which are too large to
fit in a signed integer correctly. */
range type (I think it probably should copy it from the target
type), so we won't print values which are too large to
fit in a signed integer correctly. */
/* FIXME: Doesn't handle ranges of enums correctly. (Can't just
print with the target type, though, because the size of our type
and the target type might differ). */
print with the target type, though, because the size of our type
and the target type might differ). */
/* FALLTHROUGH */
case TYPE_CODE_INT:
@@ -403,13 +402,10 @@ c_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
}
else
{
val = unpack_long (type, valaddr + embedded_offset);
if (TYPE_UNSIGNED (type))
fprintf_filtered (stream, "%u", (unsigned int) val);
else
fprintf_filtered (stream, "%d", (int) val);
fprintf_filtered (stream, TYPE_UNSIGNED (type) ? "%u" : "%d",
unpack_long (type, valaddr + embedded_offset));
fputs_filtered (" ", stream);
LA_PRINT_CHAR ((unsigned char) val, stream);
LA_PRINT_CHAR ((unsigned char) unpack_long (type, valaddr + embedded_offset), stream);
}
break;
@@ -438,8 +434,8 @@ c_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
case TYPE_CODE_UNDEF:
/* This happens (without TYPE_FLAG_STUB set) on systems which don't use
dbx xrefs (NO_DBX_XREFS in gcc) if a file has a "struct foo *bar"
and no complete type for struct foo in that file. */
dbx xrefs (NO_DBX_XREFS in gcc) if a file has a "struct foo *bar"
and no complete type for struct foo in that file. */
fprintf_filtered (stream, "<incomplete type>");
break;
@@ -458,9 +454,9 @@ c_value_print (val, stream, format, pretty)
enum val_prettyprint pretty;
{
struct type *type = VALUE_TYPE (val);
struct type *real_type;
struct type * real_type;
int full, top, using_enc;
/* If it is a pointer, indicate what it points to.
Print type also if it is a reference.
@@ -471,7 +467,7 @@ c_value_print (val, stream, format, pretty)
TYPE_CODE (type) == TYPE_CODE_REF)
{
/* Hack: remove (char *) for char strings. Their
type is indicated by the quoted string anyway. */
type is indicated by the quoted string anyway. */
if (TYPE_CODE (type) == TYPE_CODE_PTR &&
TYPE_NAME (type) == NULL &&
TYPE_NAME (TYPE_TARGET_TYPE (type)) != NULL &&
@@ -480,28 +476,28 @@ c_value_print (val, stream, format, pretty)
/* Print nothing */
}
else if (objectprint && (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_CLASS))
{
/* Pointer to class, check real type of object */
{
/* Pointer to class, check real type of object */
fprintf_filtered (stream, "(");
type = value_rtti_target_type (val, &full, &top, &using_enc);
if (type)
{
/* RTTI entry found */
type = lookup_pointer_type (type);
type_print (type, "", stream, -1);
}
else
{
/* No RTTI fields, do whatever we can */
type = VALUE_ENCLOSING_TYPE (val);
type_print (type, "", stream, -1);
fprintf_filtered (stream, " ?");
}
type = value_rtti_target_type (val, &full, &top, &using_enc);
if (type)
{
/* RTTI entry found */
type = lookup_pointer_type (type);
type_print (type, "", stream, -1);
}
else
{
/* No RTTI fields, do whatever we can */
type = VALUE_ENCLOSING_TYPE (val);
type_print (type, "", stream, -1);
fprintf_filtered (stream, " ?");
}
fprintf_filtered (stream, ") ");
}
}
else
{
/* normal case */
/* normal case */
fprintf_filtered (stream, "(");
type_print (type, "", stream, -1);
fprintf_filtered (stream, ") ");
@@ -511,29 +507,29 @@ c_value_print (val, stream, format, pretty)
{
/* Attempt to determine real type of object */
real_type = value_rtti_type (val, &full, &top, &using_enc);
if (real_type)
{
/* We have RTTI information, so use it */
val = value_full_object (val, real_type, full, top, using_enc);
fprintf_filtered (stream, "(%s%s) ",
TYPE_NAME (real_type),
full ? "" : " [incomplete object]");
/* Print out object: enclosing type is same as real_type if full */
return val_print (VALUE_ENCLOSING_TYPE (val), VALUE_CONTENTS_ALL (val), 0,
VALUE_ADDRESS (val), stream, format, 1, 0, pretty);
}
if (real_type)
{
/* We have RTTI information, so use it */
val = value_full_object (val, real_type, full, top, using_enc);
fprintf_filtered (stream, "(%s%s) ",
TYPE_NAME (real_type),
full ? "" : " [incomplete object]");
/* Print out object: enclosing type is same as real_type if full */
return val_print (VALUE_ENCLOSING_TYPE (val), VALUE_CONTENTS_ALL (val), 0,
VALUE_ADDRESS (val), stream, format, 1, 0, pretty);
}
else if (type != VALUE_ENCLOSING_TYPE (val))
{
/* No RTTI information, so let's do our best */
fprintf_filtered (stream, "(%s ?) ",
TYPE_NAME (VALUE_ENCLOSING_TYPE (val)));
return val_print (VALUE_ENCLOSING_TYPE (val), VALUE_CONTENTS_ALL (val), 0,
VALUE_ADDRESS (val), stream, format, 1, 0, pretty);
}
{
/* No RTTI information, so let's do our best */
fprintf_filtered (stream, "(%s ?) ",
TYPE_NAME (VALUE_ENCLOSING_TYPE (val)));
return val_print (VALUE_ENCLOSING_TYPE (val), VALUE_CONTENTS_ALL (val), 0,
VALUE_ADDRESS (val), stream, format, 1, 0, pretty);
}
/* Otherwise, we end up at the return outside this "if" */
}
return val_print (type, VALUE_CONTENTS_ALL (val), VALUE_EMBEDDED_OFFSET (val),
return val_print (type, VALUE_CONTENTS_ALL (val), VALUE_EMBEDDED_OFFSET (val),
VALUE_ADDRESS (val),
stream, format, 1, 0, pretty);
}

View File

@@ -1,20 +1,19 @@
/* Prototypes for GDB commands that are called internally by other functions.
Copyright 1992 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
extern void
initialize_all_files PARAMS ((void));

File diff suppressed because it is too large Load Diff

View File

@@ -1,22 +1,21 @@
/* Chill language support routines for GDB, the GNU debugger.
Copyright 1992, 1995, 1996 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "symtab.h"
@@ -27,25 +26,23 @@
#include "language.h"
#include "ch-lang.h"
extern void _initialize_chill_language PARAMS ((void));
static value_ptr
evaluate_subexp_chill PARAMS ((struct type *, struct expression *, int *, enum noside));
static value_ptr
evaluate_subexp_chill PARAMS ((struct type *, struct expression *, int *, enum noside));
value_chill_max_min PARAMS ((enum exp_opcode, value_ptr));
static value_ptr
value_chill_max_min PARAMS ((enum exp_opcode, value_ptr));
value_chill_card PARAMS ((value_ptr));
static value_ptr
value_chill_card PARAMS ((value_ptr));
static value_ptr
value_chill_length PARAMS ((value_ptr));
value_chill_length PARAMS ((value_ptr));
static struct type *
chill_create_fundamental_type PARAMS ((struct objfile *, int));
chill_create_fundamental_type PARAMS ((struct objfile *, int));
static void
chill_printstr PARAMS ((GDB_FILE * stream, char *string, unsigned int length, int width, int force_ellipses));
chill_printstr PARAMS ((GDB_FILE *stream, char *string, unsigned int length, int width, int force_ellipses));
static void
chill_printchar PARAMS ((int, GDB_FILE *));
@@ -111,7 +108,7 @@ chill_printchar (c, stream)
an explicit null byte. So we always assume an implied null byte
until gdb is able to maintain non-null terminated strings as well
as null terminated strings (FIXME).
*/
*/
static void
chill_printstr (stream, string, length, width, force_ellipses)
@@ -139,7 +136,7 @@ chill_printstr (stream, string, length, width, force_ellipses)
for (i = 0; i < length && things_printed < print_max; ++i)
{
/* Position of the character we are examining
to see whether it is repeated. */
to see whether it is repeated. */
unsigned int rep1;
/* Number of repetitions we have detected so far. */
unsigned int reps;
@@ -178,7 +175,7 @@ chill_printstr (stream, string, length, width, force_ellipses)
}
else
{
if (!in_literal_form && !in_control_form)
if (! in_literal_form && ! in_control_form)
fputs_filtered ("\"", stream);
if (PRINT_LITERAL_FORM (c))
{
@@ -240,91 +237,90 @@ chill_create_fundamental_type (objfile, typeid)
switch (typeid)
{
default:
/* FIXME: For now, if we are asked to produce a type not in this
language, create the equivalent of a C integer type with the
name "<?type?>". When all the dust settles from the type
reconstruction work, this should probably become an error. */
type = init_type (TYPE_CODE_INT, 2, 0, "<?type?>", objfile);
warning ("internal error: no chill fundamental type %d", typeid);
break;
case FT_VOID:
/* FIXME: Currently the GNU Chill compiler emits some DWARF entries for
typedefs, unrelated to anything directly in the code being compiled,
that have some FT_VOID types. Just fake it for now. */
type = init_type (TYPE_CODE_VOID, 0, 0, "<?VOID?>", objfile);
break;
case FT_BOOLEAN:
type = init_type (TYPE_CODE_BOOL, 1, TYPE_FLAG_UNSIGNED, "BOOL", objfile);
break;
case FT_CHAR:
type = init_type (TYPE_CODE_CHAR, 1, TYPE_FLAG_UNSIGNED, "CHAR", objfile);
break;
case FT_SIGNED_CHAR:
type = init_type (TYPE_CODE_INT, 1, 0, "BYTE", objfile);
break;
case FT_UNSIGNED_CHAR:
type = init_type (TYPE_CODE_INT, 1, TYPE_FLAG_UNSIGNED, "UBYTE", objfile);
break;
case FT_SHORT: /* Chill ints are 2 bytes */
type = init_type (TYPE_CODE_INT, 2, 0, "INT", objfile);
break;
case FT_UNSIGNED_SHORT: /* Chill ints are 2 bytes */
type = init_type (TYPE_CODE_INT, 2, TYPE_FLAG_UNSIGNED, "UINT", objfile);
break;
case FT_INTEGER: /* FIXME? */
case FT_SIGNED_INTEGER: /* FIXME? */
case FT_LONG: /* Chill longs are 4 bytes */
case FT_SIGNED_LONG: /* Chill longs are 4 bytes */
type = init_type (TYPE_CODE_INT, 4, 0, "LONG", objfile);
break;
case FT_UNSIGNED_INTEGER: /* FIXME? */
case FT_UNSIGNED_LONG: /* Chill longs are 4 bytes */
type = init_type (TYPE_CODE_INT, 4, TYPE_FLAG_UNSIGNED, "ULONG", objfile);
break;
case FT_FLOAT:
type = init_type (TYPE_CODE_FLT, 4, 0, "REAL", objfile);
break;
case FT_DBL_PREC_FLOAT:
type = init_type (TYPE_CODE_FLT, 8, 0, "LONG_REAL", objfile);
break;
}
default:
/* FIXME: For now, if we are asked to produce a type not in this
language, create the equivalent of a C integer type with the
name "<?type?>". When all the dust settles from the type
reconstruction work, this should probably become an error. */
type = init_type (TYPE_CODE_INT, 2, 0, "<?type?>", objfile);
warning ("internal error: no chill fundamental type %d", typeid);
break;
case FT_VOID:
/* FIXME: Currently the GNU Chill compiler emits some DWARF entries for
typedefs, unrelated to anything directly in the code being compiled,
that have some FT_VOID types. Just fake it for now. */
type = init_type (TYPE_CODE_VOID, 0, 0, "<?VOID?>", objfile);
break;
case FT_BOOLEAN:
type = init_type (TYPE_CODE_BOOL, 1, TYPE_FLAG_UNSIGNED, "BOOL", objfile);
break;
case FT_CHAR:
type = init_type (TYPE_CODE_CHAR, 1, TYPE_FLAG_UNSIGNED, "CHAR", objfile);
break;
case FT_SIGNED_CHAR:
type = init_type (TYPE_CODE_INT, 1, 0, "BYTE", objfile);
break;
case FT_UNSIGNED_CHAR:
type = init_type (TYPE_CODE_INT, 1, TYPE_FLAG_UNSIGNED, "UBYTE", objfile);
break;
case FT_SHORT: /* Chill ints are 2 bytes */
type = init_type (TYPE_CODE_INT, 2, 0, "INT", objfile);
break;
case FT_UNSIGNED_SHORT: /* Chill ints are 2 bytes */
type = init_type (TYPE_CODE_INT, 2, TYPE_FLAG_UNSIGNED, "UINT", objfile);
break;
case FT_INTEGER: /* FIXME? */
case FT_SIGNED_INTEGER: /* FIXME? */
case FT_LONG: /* Chill longs are 4 bytes */
case FT_SIGNED_LONG: /* Chill longs are 4 bytes */
type = init_type (TYPE_CODE_INT, 4, 0, "LONG", objfile);
break;
case FT_UNSIGNED_INTEGER: /* FIXME? */
case FT_UNSIGNED_LONG: /* Chill longs are 4 bytes */
type = init_type (TYPE_CODE_INT, 4, TYPE_FLAG_UNSIGNED, "ULONG", objfile);
break;
case FT_FLOAT:
type = init_type (TYPE_CODE_FLT, 4, 0, "REAL", objfile);
break;
case FT_DBL_PREC_FLOAT:
type = init_type (TYPE_CODE_FLT, 8, 0, "LONG_REAL", objfile);
break;
}
return (type);
}
/* Table of operators and their precedences for printing expressions. */
static const struct op_print chill_op_print_tab[] =
{
{"AND", BINOP_LOGICAL_AND, PREC_LOGICAL_AND, 0},
{"OR", BINOP_LOGICAL_OR, PREC_LOGICAL_OR, 0},
{"NOT", UNOP_LOGICAL_NOT, PREC_PREFIX, 0},
{"MOD", BINOP_MOD, PREC_MUL, 0},
{"REM", BINOP_REM, PREC_MUL, 0},
{"SIZE", UNOP_SIZEOF, PREC_BUILTIN_FUNCTION, 0},
{"LOWER", UNOP_LOWER, PREC_BUILTIN_FUNCTION, 0},
{"UPPER", UNOP_UPPER, PREC_BUILTIN_FUNCTION, 0},
{"CARD", UNOP_CARD, PREC_BUILTIN_FUNCTION, 0},
{"MAX", UNOP_CHMAX, PREC_BUILTIN_FUNCTION, 0},
{"MIN", UNOP_CHMIN, PREC_BUILTIN_FUNCTION, 0},
{":=", BINOP_ASSIGN, PREC_ASSIGN, 1},
{"=", BINOP_EQUAL, PREC_EQUAL, 0},
{"/=", BINOP_NOTEQUAL, PREC_EQUAL, 0},
{"<=", BINOP_LEQ, PREC_ORDER, 0},
{">=", BINOP_GEQ, PREC_ORDER, 0},
{">", BINOP_GTR, PREC_ORDER, 0},
{"<", BINOP_LESS, PREC_ORDER, 0},
{"+", BINOP_ADD, PREC_ADD, 0},
{"-", BINOP_SUB, PREC_ADD, 0},
{"*", BINOP_MUL, PREC_MUL, 0},
{"/", BINOP_DIV, PREC_MUL, 0},
{"//", BINOP_CONCAT, PREC_PREFIX, 0}, /* FIXME: precedence? */
{"-", UNOP_NEG, PREC_PREFIX, 0},
{"->", UNOP_IND, PREC_SUFFIX, 1},
{"->", UNOP_ADDR, PREC_PREFIX, 0},
{":", BINOP_RANGE, PREC_ASSIGN, 0},
{NULL, 0, 0, 0}
static const struct op_print chill_op_print_tab[] = {
{"AND", BINOP_LOGICAL_AND, PREC_LOGICAL_AND, 0},
{"OR", BINOP_LOGICAL_OR, PREC_LOGICAL_OR, 0},
{"NOT", UNOP_LOGICAL_NOT, PREC_PREFIX, 0},
{"MOD", BINOP_MOD, PREC_MUL, 0},
{"REM", BINOP_REM, PREC_MUL, 0},
{"SIZE",UNOP_SIZEOF, PREC_BUILTIN_FUNCTION, 0},
{"LOWER",UNOP_LOWER, PREC_BUILTIN_FUNCTION, 0},
{"UPPER",UNOP_UPPER, PREC_BUILTIN_FUNCTION, 0},
{"CARD",UNOP_CARD, PREC_BUILTIN_FUNCTION, 0},
{"MAX",UNOP_CHMAX, PREC_BUILTIN_FUNCTION, 0},
{"MIN",UNOP_CHMIN, PREC_BUILTIN_FUNCTION, 0},
{":=", BINOP_ASSIGN, PREC_ASSIGN, 1},
{"=", BINOP_EQUAL, PREC_EQUAL, 0},
{"/=", BINOP_NOTEQUAL, PREC_EQUAL, 0},
{"<=", BINOP_LEQ, PREC_ORDER, 0},
{">=", BINOP_GEQ, PREC_ORDER, 0},
{">", BINOP_GTR, PREC_ORDER, 0},
{"<", BINOP_LESS, PREC_ORDER, 0},
{"+", BINOP_ADD, PREC_ADD, 0},
{"-", BINOP_SUB, PREC_ADD, 0},
{"*", BINOP_MUL, PREC_MUL, 0},
{"/", BINOP_DIV, PREC_MUL, 0},
{"//", BINOP_CONCAT, PREC_PREFIX, 0}, /* FIXME: precedence? */
{"-", UNOP_NEG, PREC_PREFIX, 0},
{"->", UNOP_IND, PREC_SUFFIX, 1},
{"->", UNOP_ADDR, PREC_PREFIX, 0},
{":", BINOP_RANGE, PREC_ASSIGN, 0},
{NULL, 0, 0, 0}
};
/* The built-in types of Chill. */
@@ -335,14 +331,14 @@ struct type *builtin_type_chill_long;
struct type *builtin_type_chill_ulong;
struct type *builtin_type_chill_real;
struct type **CONST_PTR (chill_builtin_types[]) =
struct type ** CONST_PTR (chill_builtin_types[]) =
{
&builtin_type_chill_bool,
&builtin_type_chill_char,
&builtin_type_chill_long,
&builtin_type_chill_ulong,
&builtin_type_chill_real,
0
&builtin_type_chill_char,
&builtin_type_chill_long,
&builtin_type_chill_ulong,
&builtin_type_chill_real,
0
};
/* Calculate LOWER or UPPER of TYPE.
@@ -351,7 +347,7 @@ struct type **CONST_PTR (chill_builtin_types[]) =
LONGEST
type_lower_upper (op, type, result_type)
enum exp_opcode op; /* Either UNOP_LOWER or UNOP_UPPER */
enum exp_opcode op; /* Either UNOP_LOWER or UNOP_UPPER */
struct type *type;
struct type **result_type;
{
@@ -368,7 +364,7 @@ type_lower_upper (op, type, result_type)
case TYPE_CODE_ARRAY:
case TYPE_CODE_BITSTRING:
case TYPE_CODE_STRING:
type = TYPE_FIELD_TYPE (type, 0); /* Get index type */
type = TYPE_FIELD_TYPE (type, 0); /* Get index type */
/* ... fall through ... */
case TYPE_CODE_RANGE:
@@ -507,8 +503,8 @@ value_chill_max_min (op, val)
error ("bad argument to %s builtin", op == UNOP_CHMAX ? "MAX" : "MIN");
return value_from_longest (TYPE_CODE (elttype) == TYPE_CODE_RANGE
? TYPE_TARGET_TYPE (elttype)
: elttype,
? TYPE_TARGET_TYPE (elttype)
: elttype,
tmp);
}
@@ -562,12 +558,12 @@ evaluate_subexp_chill (expect_type, exp, pos, noside)
for (; tem <= nargs && tem <= TYPE_NFIELDS (type); tem++)
{
argvec[tem]
= evaluate_subexp_chill (TYPE_FIELD_TYPE (type, tem - 1),
= evaluate_subexp_chill (TYPE_FIELD_TYPE (type, tem-1),
exp, pos, noside);
}
for (; tem <= nargs; tem++)
argvec[tem] = evaluate_subexp_with_coercion (exp, pos, noside);
argvec[tem] = 0; /* signal end of arglist */
argvec[tem] = 0; /* signal end of arglist */
return call_function_by_hand (argvec[0], nargs, argvec + 1);
default:
@@ -618,12 +614,11 @@ evaluate_subexp_chill (expect_type, exp, pos, noside)
}
return evaluate_subexp_standard (expect_type, exp, pos, noside);
nosideret:
nosideret:
return value_from_longest (builtin_type_long, (LONGEST) 1);
}
const struct language_defn chill_language_defn =
{
const struct language_defn chill_language_defn = {
"chill",
language_chill,
chill_builtin_types,
@@ -635,18 +630,18 @@ const struct language_defn chill_language_defn =
chill_printchar, /* print a character constant */
chill_printstr, /* function to print a string constant */
NULL, /* Function to print a single char */
chill_create_fundamental_type, /* Create fundamental type in this language */
chill_create_fundamental_type,/* Create fundamental type in this language */
chill_print_type, /* Print a type using appropriate syntax */
chill_val_print, /* Print a value using appropriate syntax */
chill_value_print, /* Print a top-levl value */
{"", "B'", "", ""}, /* Binary format info */
{"O'%lo", "O'", "o", ""}, /* Octal format info */
{"D'%ld", "D'", "d", ""}, /* Decimal format info */
{"H'%lx", "H'", "x", ""}, /* Hex format info */
{"", "B'", "", ""}, /* Binary format info */
{"O'%lo", "O'", "o", ""}, /* Octal format info */
{"D'%ld", "D'", "d", ""}, /* Decimal format info */
{"H'%lx", "H'", "x", ""}, /* Hex format info */
chill_op_print_tab, /* expression operators for printing */
0, /* arrays are first-class (not c-style) */
0, /* String lower bound */
&builtin_type_chill_char, /* Type of string elements */
&builtin_type_chill_char, /* Type of string elements */
LANG_MAGIC
};

View File

@@ -1,24 +1,23 @@
/* Chill language support definitions for GDB, the GNU debugger.
Copyright 1992 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifdef __STDC__ /* Forward decls for prototypes */
#ifdef __STDC__ /* Forward decls for prototypes */
struct value;
#endif
@@ -40,4 +39,4 @@ chill_value_print PARAMS ((struct value *, GDB_FILE *,
int, enum val_prettyprint));
extern LONGEST
type_lower_upper PARAMS ((enum exp_opcode, struct type *, struct type **));
type_lower_upper PARAMS ((enum exp_opcode, struct type *, struct type **));

View File

@@ -1,22 +1,21 @@
/* Support for printing Chill types for GDB, the GNU debugger.
Copyright 1986, 1988, 1989, 1991 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "obstack.h"
@@ -105,246 +104,243 @@ chill_type_print_base (type, stream, show, level)
switch (TYPE_CODE (type))
{
case TYPE_CODE_TYPEDEF:
chill_type_print_base (TYPE_TARGET_TYPE (type), stream, 0, level);
break;
case TYPE_CODE_PTR:
if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_VOID)
{
fprintf_filtered (stream,
TYPE_NAME (type) ? TYPE_NAME (type) : "PTR");
break;
}
fprintf_filtered (stream, "REF ");
chill_type_print_base (TYPE_TARGET_TYPE (type), stream, 0, level);
break;
case TYPE_CODE_TYPEDEF:
chill_type_print_base (TYPE_TARGET_TYPE (type), stream, 0, level);
break;
case TYPE_CODE_PTR:
if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_VOID)
{
fprintf_filtered (stream,
TYPE_NAME (type) ? TYPE_NAME (type) : "PTR");
break;
}
fprintf_filtered (stream, "REF ");
chill_type_print_base (TYPE_TARGET_TYPE (type), stream, 0, level);
break;
case TYPE_CODE_BOOL:
/* FIXME: we should probably just print the TYPE_NAME, in case
anyone ever fixes the compiler to give us the real names
in the presence of the chill equivalent of typedef (assuming
there is one). */
fprintf_filtered (stream,
TYPE_NAME (type) ? TYPE_NAME (type) : "BOOL");
break;
case TYPE_CODE_BOOL:
/* FIXME: we should probably just print the TYPE_NAME, in case
anyone ever fixes the compiler to give us the real names
in the presence of the chill equivalent of typedef (assuming
there is one). */
fprintf_filtered (stream,
TYPE_NAME (type) ? TYPE_NAME (type) : "BOOL");
break;
case TYPE_CODE_ARRAY:
fputs_filtered ("ARRAY (", stream);
range_type = TYPE_FIELD_TYPE (type, 0);
if (TYPE_CODE (range_type) != TYPE_CODE_RANGE)
chill_print_type (range_type, "", stream, 0, level);
else
{
index_type = TYPE_TARGET_TYPE (range_type);
low_bound = TYPE_FIELD_BITPOS (range_type, 0);
high_bound = TYPE_FIELD_BITPOS (range_type, 1);
print_type_scalar (index_type, low_bound, stream);
fputs_filtered (":", stream);
print_type_scalar (index_type, high_bound, stream);
}
fputs_filtered (") ", stream);
chill_print_type (TYPE_TARGET_TYPE (type), "", stream, 0, level);
break;
case TYPE_CODE_BITSTRING:
fprintf_filtered (stream, "BOOLS (%d)",
TYPE_FIELD_BITPOS (TYPE_FIELD_TYPE (type, 0), 1) + 1);
break;
case TYPE_CODE_SET:
fputs_filtered ("POWERSET ", stream);
chill_print_type (TYPE_INDEX_TYPE (type), "", stream,
show - 1, level);
break;
case TYPE_CODE_STRING:
range_type = TYPE_FIELD_TYPE (type, 0);
index_type = TYPE_TARGET_TYPE (range_type);
high_bound = TYPE_FIELD_BITPOS (range_type, 1);
fputs_filtered ("CHARS (", stream);
print_type_scalar (index_type, high_bound + 1, stream);
fputs_filtered (")", stream);
break;
case TYPE_CODE_MEMBER:
fprintf_filtered (stream, "MEMBER ");
chill_type_print_base (TYPE_TARGET_TYPE (type), stream, 0, level);
break;
case TYPE_CODE_REF:
fprintf_filtered (stream, "/*LOC*/ ");
chill_type_print_base (TYPE_TARGET_TYPE (type), stream, show, level);
break;
case TYPE_CODE_FUNC:
fprintf_filtered (stream, "PROC (");
len = TYPE_NFIELDS (type);
for (i = 0; i < len; i++)
{
struct type *param_type = TYPE_FIELD_TYPE (type, i);
if (i > 0)
{
fputs_filtered (", ", stream);
wrap_here (" ");
}
if (TYPE_CODE (param_type) == TYPE_CODE_REF)
{
chill_type_print_base (TYPE_TARGET_TYPE (param_type),
stream, 0, level);
fputs_filtered (" LOC", stream);
}
else
chill_type_print_base (param_type, stream, show, level);
}
fprintf_filtered (stream, ")");
if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_VOID)
{
fputs_filtered (" RETURNS (", stream);
chill_type_print_base (TYPE_TARGET_TYPE (type), stream, 0, level);
fputs_filtered (")", stream);
}
break;
case TYPE_CODE_STRUCT:
if (chill_varying_type (type))
{
chill_type_print_base (TYPE_FIELD_TYPE (type, 1),
stream, 0, level);
fputs_filtered (" VARYING", stream);
}
else
{
fprintf_filtered (stream, "STRUCT ");
fprintf_filtered (stream, "(\n");
if ((TYPE_NFIELDS (type) == 0) && (TYPE_NFN_FIELDS (type) == 0))
{
if (TYPE_FLAGS (type) & TYPE_FLAG_STUB)
{
fprintfi_filtered (level + 4, stream, "<incomplete type>\n");
}
else
{
fprintfi_filtered (level + 4, stream, "<no data fields>\n");
}
}
else
{
len = TYPE_NFIELDS (type);
for (i = TYPE_N_BASECLASSES (type); i < len; i++)
{
struct type *field_type = TYPE_FIELD_TYPE (type, i);
QUIT;
print_spaces_filtered (level + 4, stream);
if (TYPE_CODE (field_type) == TYPE_CODE_UNION)
{
int j; /* variant number */
fputs_filtered ("CASE OF\n", stream);
for (j = 0; j < TYPE_NFIELDS (field_type); j++)
{
int k; /* variant field index */
struct type *variant_type
= TYPE_FIELD_TYPE (field_type, j);
int var_len = TYPE_NFIELDS (variant_type);
print_spaces_filtered (level + 4, stream);
if (strcmp (TYPE_FIELD_NAME (field_type, j),
"else") == 0)
fputs_filtered ("ELSE\n", stream);
else
fputs_filtered (":\n", stream);
if (TYPE_CODE (variant_type) != TYPE_CODE_STRUCT)
error ("variant record confusion");
for (k = 0; k < var_len; k++)
{
print_spaces_filtered (level + 8, stream);
chill_print_type (TYPE_FIELD_TYPE (variant_type, k),
TYPE_FIELD_NAME (variant_type, k),
stream, show - 1, level + 8);
if (k < (var_len - 1))
fputs_filtered (",", stream);
fputs_filtered ("\n", stream);
}
}
print_spaces_filtered (level + 4, stream);
fputs_filtered ("ESAC", stream);
}
else
chill_print_type (field_type,
TYPE_FIELD_NAME (type, i),
stream, show - 1, level + 4);
if (i < (len - 1))
{
fputs_filtered (",", stream);
}
fputs_filtered ("\n", stream);
}
}
fprintfi_filtered (level, stream, ")");
}
break;
case TYPE_CODE_RANGE:
{
struct type *target = TYPE_TARGET_TYPE (type);
if (target && TYPE_NAME (target))
fputs_filtered (TYPE_NAME (target), stream);
case TYPE_CODE_ARRAY:
fputs_filtered ("ARRAY (", stream);
range_type = TYPE_FIELD_TYPE (type, 0);
if (TYPE_CODE (range_type) != TYPE_CODE_RANGE)
chill_print_type (range_type, "", stream, 0, level);
else
fputs_filtered ("RANGE", stream);
if (target == NULL)
target = builtin_type_long;
fputs_filtered (" (", stream);
print_type_scalar (target, TYPE_LOW_BOUND (type), stream);
fputs_filtered (":", stream);
print_type_scalar (target, TYPE_HIGH_BOUND (type), stream);
fputs_filtered (")", stream);
}
break;
{
index_type = TYPE_TARGET_TYPE (range_type);
low_bound = TYPE_FIELD_BITPOS (range_type, 0);
high_bound = TYPE_FIELD_BITPOS (range_type, 1);
print_type_scalar (index_type, low_bound, stream);
fputs_filtered (":", stream);
print_type_scalar (index_type, high_bound, stream);
}
fputs_filtered (") ", stream);
chill_print_type (TYPE_TARGET_TYPE (type), "", stream, 0, level);
break;
case TYPE_CODE_ENUM:
{
register int lastval = 0;
fprintf_filtered (stream, "SET (");
case TYPE_CODE_BITSTRING:
fprintf_filtered (stream, "BOOLS (%d)",
TYPE_FIELD_BITPOS (TYPE_FIELD_TYPE(type,0), 1) + 1);
break;
case TYPE_CODE_SET:
fputs_filtered ("POWERSET ", stream);
chill_print_type (TYPE_INDEX_TYPE (type), "", stream,
show - 1, level);
break;
case TYPE_CODE_STRING:
range_type = TYPE_FIELD_TYPE (type, 0);
index_type = TYPE_TARGET_TYPE (range_type);
high_bound = TYPE_FIELD_BITPOS (range_type, 1);
fputs_filtered ("CHARS (", stream);
print_type_scalar (index_type, high_bound + 1, stream);
fputs_filtered (")", stream);
break;
case TYPE_CODE_MEMBER:
fprintf_filtered (stream, "MEMBER ");
chill_type_print_base (TYPE_TARGET_TYPE (type), stream, 0, level);
break;
case TYPE_CODE_REF:
fprintf_filtered (stream, "/*LOC*/ ");
chill_type_print_base (TYPE_TARGET_TYPE (type), stream, show, level);
break;
case TYPE_CODE_FUNC:
fprintf_filtered (stream, "PROC (");
len = TYPE_NFIELDS (type);
for (i = 0; i < len; i++)
{
QUIT;
if (i)
fprintf_filtered (stream, ", ");
wrap_here (" ");
fputs_filtered (TYPE_FIELD_NAME (type, i), stream);
if (lastval != TYPE_FIELD_BITPOS (type, i))
struct type *param_type = TYPE_FIELD_TYPE (type, i);
if (i > 0)
{
fprintf_filtered (stream, " = %d", TYPE_FIELD_BITPOS (type, i));
lastval = TYPE_FIELD_BITPOS (type, i);
fputs_filtered (", ", stream);
wrap_here (" ");
}
lastval++;
if (TYPE_CODE (param_type) == TYPE_CODE_REF)
{
chill_type_print_base (TYPE_TARGET_TYPE (param_type),
stream, 0, level);
fputs_filtered (" LOC", stream);
}
else
chill_type_print_base (param_type, stream, show, level);
}
fprintf_filtered (stream, ")");
if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_VOID)
{
fputs_filtered (" RETURNS (", stream);
chill_type_print_base (TYPE_TARGET_TYPE (type), stream, 0, level);
fputs_filtered (")", stream);
}
break;
case TYPE_CODE_STRUCT:
if (chill_varying_type (type))
{
chill_type_print_base (TYPE_FIELD_TYPE (type, 1),
stream, 0, level);
fputs_filtered (" VARYING", stream);
}
else
{
fprintf_filtered (stream, "STRUCT ");
fprintf_filtered (stream, "(\n");
if ((TYPE_NFIELDS (type) == 0) && (TYPE_NFN_FIELDS (type) == 0))
{
if (TYPE_FLAGS (type) & TYPE_FLAG_STUB)
{
fprintfi_filtered (level + 4, stream, "<incomplete type>\n");
}
else
{
fprintfi_filtered (level + 4, stream, "<no data fields>\n");
}
}
else
{
len = TYPE_NFIELDS (type);
for (i = TYPE_N_BASECLASSES (type); i < len; i++)
{
struct type *field_type = TYPE_FIELD_TYPE (type, i);
QUIT;
print_spaces_filtered (level + 4, stream);
if (TYPE_CODE (field_type) == TYPE_CODE_UNION)
{ int j; /* variant number */
fputs_filtered ("CASE OF\n", stream);
for (j = 0; j < TYPE_NFIELDS (field_type); j++)
{ int k; /* variant field index */
struct type *variant_type
= TYPE_FIELD_TYPE (field_type, j);
int var_len = TYPE_NFIELDS (variant_type);
print_spaces_filtered (level + 4, stream);
if (strcmp (TYPE_FIELD_NAME (field_type, j),
"else") == 0)
fputs_filtered ("ELSE\n", stream);
else
fputs_filtered (":\n", stream);
if (TYPE_CODE (variant_type) != TYPE_CODE_STRUCT)
error ("variant record confusion");
for (k = 0; k < var_len; k++)
{
print_spaces_filtered (level + 8, stream);
chill_print_type (TYPE_FIELD_TYPE (variant_type, k),
TYPE_FIELD_NAME (variant_type, k),
stream, show - 1, level + 8);
if (k < (var_len - 1))
fputs_filtered (",", stream);
fputs_filtered ("\n", stream);
}
}
print_spaces_filtered (level + 4, stream);
fputs_filtered ("ESAC", stream);
}
else
chill_print_type (field_type,
TYPE_FIELD_NAME (type, i),
stream, show - 1, level + 4);
if (i < (len - 1))
{
fputs_filtered (",", stream);
}
fputs_filtered ("\n", stream);
}
}
fprintfi_filtered (level, stream, ")");
}
break;
case TYPE_CODE_RANGE:
{
struct type *target = TYPE_TARGET_TYPE (type);
if (target && TYPE_NAME (target))
fputs_filtered (TYPE_NAME (target), stream);
else
fputs_filtered ("RANGE", stream);
if (target == NULL)
target = builtin_type_long;
fputs_filtered (" (", stream);
print_type_scalar (target, TYPE_LOW_BOUND (type), stream);
fputs_filtered (":", stream);
print_type_scalar (target, TYPE_HIGH_BOUND (type), stream);
fputs_filtered (")", stream);
}
break;
case TYPE_CODE_ENUM:
{
register int lastval = 0;
fprintf_filtered (stream, "SET (");
len = TYPE_NFIELDS (type);
for (i = 0; i < len; i++)
{
QUIT;
if (i) fprintf_filtered (stream, ", ");
wrap_here (" ");
fputs_filtered (TYPE_FIELD_NAME (type, i), stream);
if (lastval != TYPE_FIELD_BITPOS (type, i))
{
fprintf_filtered (stream, " = %d", TYPE_FIELD_BITPOS (type, i));
lastval = TYPE_FIELD_BITPOS (type, i);
}
lastval++;
}
fprintf_filtered (stream, ")");
}
break;
case TYPE_CODE_VOID:
case TYPE_CODE_UNDEF:
case TYPE_CODE_ERROR:
case TYPE_CODE_UNION:
case TYPE_CODE_METHOD:
error ("missing language support in chill_type_print_base");
break;
default:
/* Handle types not explicitly handled by the other cases,
such as fundamental types. For these, just print whatever
the type name is, as recorded in the type itself. If there
is no type name, then complain. */
if (TYPE_NAME (type) != NULL)
{
fputs_filtered (TYPE_NAME (type), stream);
}
else
{
error ("Unrecognized type code (%d) in symbol table.",
TYPE_CODE (type));
}
break;
}
break;
case TYPE_CODE_VOID:
case TYPE_CODE_UNDEF:
case TYPE_CODE_ERROR:
case TYPE_CODE_UNION:
case TYPE_CODE_METHOD:
error ("missing language support in chill_type_print_base");
break;
default:
/* Handle types not explicitly handled by the other cases,
such as fundamental types. For these, just print whatever
the type name is, as recorded in the type itself. If there
is no type name, then complain. */
if (TYPE_NAME (type) != NULL)
{
fputs_filtered (TYPE_NAME (type), stream);
}
else
{
error ("Unrecognized type code (%d) in symbol table.",
TYPE_CODE (type));
}
break;
}
}

View File

@@ -2,22 +2,21 @@
Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994
Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "obstack.h"
@@ -28,7 +27,7 @@
#include "value.h"
#include "language.h"
#include "demangle.h"
#include "c-lang.h" /* For c_val_print */
#include "c-lang.h" /* For c_val_print */
#include "typeprint.h"
#include "ch-lang.h"
#include "annotate.h"
@@ -42,9 +41,9 @@ chill_print_type_scalar PARAMS ((struct type *, LONGEST, GDB_FILE *));
static void
chill_val_print_array_elements PARAMS ((struct type *, char *, CORE_ADDR, GDB_FILE *,
int, int, int, enum val_prettyprint));
int, int, int, enum val_prettyprint));
/* Print integral scalar data VAL, of type TYPE, onto stdio stream STREAM.
Used to print data from type structures in a specified type. For example,
array bounds may be characters or booleans in some languages, and this
@@ -121,8 +120,8 @@ chill_val_print_array_elements (type, valaddr, address, stream,
unsigned int rep1;
/* Number of repetitions we have detected so far. */
unsigned int reps;
LONGEST low_bound = TYPE_FIELD_BITPOS (range_type, 0);
LONGEST low_bound = TYPE_FIELD_BITPOS (range_type, 0);
elttype = check_typedef (TYPE_TARGET_TYPE (type));
eltlen = TYPE_LENGTH (elttype);
len = TYPE_LENGTH (type) / eltlen;
@@ -147,7 +146,7 @@ chill_val_print_array_elements (type, valaddr, address, stream,
rep1 = i + 1;
reps = 1;
while ((rep1 < len) &&
while ((rep1 < len) &&
!memcmp (valaddr + i * eltlen, valaddr + rep1 * eltlen, eltlen))
{
++reps;
@@ -199,7 +198,7 @@ chill_val_print_array_elements (type, valaddr, address, stream,
int
chill_val_print (type, valaddr, embedded_offset, address,
stream, format, deref_ref, recurse, pretty)
stream, format, deref_ref, recurse, pretty)
struct type *type;
char *valaddr;
int embedded_offset;
@@ -228,7 +227,7 @@ chill_val_print (type, valaddr, embedded_offset, address,
}
fprintf_filtered (stream, "[");
chill_val_print_array_elements (type, valaddr, address, stream,
format, deref_ref, recurse, pretty);
format, deref_ref, recurse, pretty);
fprintf_filtered (stream, "]");
}
else
@@ -289,8 +288,8 @@ chill_val_print (type, valaddr, embedded_offset, address,
case TYPE_CODE_UNDEF:
/* This happens (without TYPE_FLAG_STUB set) on systems which don't use
dbx xrefs (NO_DBX_XREFS in gcc) if a file has a "struct foo *bar"
and no complete type for struct foo in that file. */
dbx xrefs (NO_DBX_XREFS in gcc) if a file has a "struct foo *bar"
and no complete type for struct foo in that file. */
fprintf_filtered (stream, "<incomplete type>");
break;
@@ -309,7 +308,7 @@ chill_val_print (type, valaddr, embedded_offset, address,
fputs_filtered ("NULL", stream);
return 0;
}
if (TYPE_CODE (elttype) == TYPE_CODE_FUNC)
{
/* Try to print what function it points to. */
@@ -321,20 +320,20 @@ chill_val_print (type, valaddr, embedded_offset, address,
{
print_address_numeric (addr, 1, stream);
}
/* For a pointer to char or unsigned char, also print the string
pointed to, unless pointer is null. */
pointed to, unless pointer is null. */
if (TYPE_LENGTH (elttype) == 1
&& TYPE_CODE (elttype) == TYPE_CODE_CHAR
&& (format == 0 || format == 's')
&& addr != 0
&& /* If print_max is UINT_MAX, the alloca below will fail.
In that case don't try to print the string. */
&& /* If print_max is UINT_MAX, the alloca below will fail.
In that case don't try to print the string. */
print_max < UINT_MAX)
i = val_print_string (addr, -1, TYPE_LENGTH (elttype), stream);
/* Return number of characters printed, plus one for the
terminating null if we have "reached the end". */
terminating null if we have "reached the end". */
return (i + (print_max && i != print_max));
break;
@@ -342,7 +341,7 @@ chill_val_print (type, valaddr, embedded_offset, address,
i = TYPE_LENGTH (type);
LA_PRINT_STRING (stream, valaddr, i, 1, 0);
/* Return number of characters printed, plus one for the terminating
null if we have "reached the end". */
null if we have "reached the end". */
return (i + (print_max && i != print_max));
break;
@@ -394,11 +393,11 @@ chill_val_print (type, valaddr, embedded_offset, address,
need_comma = 1;
/* Look for a continuous range of true elements. */
if (i + 1 <= high_bound && value_bit_index (type, valaddr, ++i))
if (i+1 <= high_bound && value_bit_index (type, valaddr, ++i))
{
int j = i; /* j is the upper bound so far of the range */
int j = i; /* j is the upper bound so far of the range */
fputs_filtered (":", stream);
while (i + 1 <= high_bound
while (i+1 <= high_bound
&& value_bit_index (type, valaddr, ++i))
j = i;
chill_print_type_scalar (range, (LONGEST) j, stream);
@@ -419,14 +418,14 @@ chill_val_print (type, valaddr, embedded_offset, address,
struct type *inner = check_typedef (TYPE_FIELD_TYPE (type, 1));
long length = unpack_long (TYPE_FIELD_TYPE (type, 0), valaddr);
char *data_addr = valaddr + TYPE_FIELD_BITPOS (type, 1) / 8;
switch (TYPE_CODE (inner))
{
case TYPE_CODE_STRING:
if (length > TYPE_LENGTH (type) - 2)
{
fprintf_filtered (stream,
"<dynamic length %ld > static length %d> *invalid*",
"<dynamic length %ld > static length %d> *invalid*",
length, TYPE_LENGTH (type));
/* Don't print the string; doing so might produce a
@@ -445,7 +444,7 @@ chill_val_print (type, valaddr, embedded_offset, address,
case TYPE_CODE_REF:
if (addressprint)
{
{
fprintf_filtered (stream, "LOC(");
print_address_numeric
(extract_address (valaddr, TARGET_PTR_BIT / HOST_CHAR_BIT),
@@ -454,21 +453,21 @@ chill_val_print (type, valaddr, embedded_offset, address,
fprintf_filtered (stream, ")");
if (deref_ref)
fputs_filtered (": ", stream);
}
}
/* De-reference the reference. */
if (deref_ref)
{
if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_UNDEF)
{
value_ptr deref_val =
value_at
(TYPE_TARGET_TYPE (type),
unpack_pointer (lookup_pointer_type (builtin_type_void),
valaddr),
NULL);
value_at
(TYPE_TARGET_TYPE (type),
unpack_pointer (lookup_pointer_type (builtin_type_void),
valaddr),
NULL);
val_print (VALUE_TYPE (deref_val),
VALUE_CONTENTS (deref_val),
0,
0,
VALUE_ADDRESS (deref_val), stream, format,
deref_ref, recurse + 1, pretty);
}
@@ -495,7 +494,7 @@ chill_val_print (type, valaddr, embedded_offset, address,
case TYPE_CODE_ERROR:
default:
/* Let's defer printing to the C printer, rather than
print an error message. FIXME! */
print an error message. FIXME! */
c_val_print (type, valaddr, 0, address, stream, format,
deref_ref, recurse, pretty);
}
@@ -548,7 +547,7 @@ chill_print_value_fields (type, valaddr, stream, format, recurse, pretty,
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream);
}
else
else
{
wrap_here (n_spaces (2 + 2 * recurse));
}
@@ -561,16 +560,16 @@ chill_print_value_fields (type, valaddr, stream, format, recurse, pretty,
value_ptr v;
/* Bitfields require special handling, especially due to byte
order problems. */
order problems. */
v = value_from_longest (TYPE_FIELD_TYPE (type, i),
unpack_field_as_long (type, valaddr, i));
unpack_field_as_long (type, valaddr, i));
chill_val_print (TYPE_FIELD_TYPE (type, i), VALUE_CONTENTS (v), 0, 0,
stream, format, 0, recurse + 1, pretty);
}
else
{
chill_val_print (TYPE_FIELD_TYPE (type, i),
chill_val_print (TYPE_FIELD_TYPE (type, i),
valaddr + TYPE_FIELD_BITPOS (type, i) / 8, 0,
0, stream, format, 0, recurse + 1, pretty);
}
@@ -592,7 +591,7 @@ chill_value_print (val, stream, format, pretty)
enum val_prettyprint pretty;
{
struct type *type = VALUE_TYPE (val);
struct type *real_type = check_typedef (type);
struct type *real_type = check_typedef (type);
/* If it is a pointer, indicate what it points to.
@@ -627,3 +626,5 @@ chill_value_print (val, stream, format, pretty)
return (val_print (type, VALUE_CONTENTS (val), 0,
VALUE_ADDRESS (val), stream, format, 1, 0, pretty));
}

View File

@@ -1,22 +1,21 @@
/* Handle COFF SVR3 shared libraries for GDB, the GNU Debugger.
Copyright 1993 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "defs.h"
@@ -28,31 +27,31 @@
/*
GLOBAL FUNCTION
GLOBAL FUNCTION
coff_solib_add -- add a shared library files to the symtab list. We
examine the `.lib' section of the exec file and determine the names of
the shared libraries.
coff_solib_add -- add a shared library files to the symtab list. We
examine the `.lib' section of the exec file and determine the names of
the shared libraries.
This function is responsible for discovering those names and
addresses, and saving sufficient information about them to allow
their symbols to be read at a later time.
This function is responsible for discovering those names and
addresses, and saving sufficient information about them to allow
their symbols to be read at a later time.
SYNOPSIS
SYNOPSIS
void coff_solib_add (char *arg_string, int from_tty,
struct target_ops *target)
void coff_solib_add (char *arg_string, int from_tty,
struct target_ops *target)
DESCRIPTION
DESCRIPTION
*/
*/
void
coff_solib_add (arg_string, from_tty, target)
char *arg_string;
int from_tty;
struct target_ops *target;
{
{
asection *libsect;
libsect = bfd_get_section_by_name (exec_bfd, ".lib");
@@ -80,7 +79,7 @@ coff_solib_add (arg_string, from_tty, target)
int len, nameoffset;
char *filename;
ent = (struct libent *) lib;
ent = (struct libent *)lib;
len = bfd_get_32 (exec_bfd, ent->len);
@@ -89,47 +88,47 @@ coff_solib_add (arg_string, from_tty, target)
if (len <= 0)
break;
filename = (char *) ent + nameoffset * 4;
filename = (char *)ent + nameoffset * 4;
objfile = symbol_file_add (filename, from_tty,
0, /* addr */
0, /* not mainline */
0, /* not mapped */
0, /* Not readnow */
0, /* Not user loaded */
1); /* Is a solib */
0, /* addr */
0, /* not mainline */
0, /* not mapped */
0, /* Not readnow */
0, /* Not user loaded */
1); /* Is a solib */
libsize -= len * 4;
lib += len * 4;
}
/* Getting new symbols may change our opinion about what is
frameless. */
frameless. */
reinit_frame_cache ();
}
}
/*
GLOBAL FUNCTION
coff_solib_create_inferior_hook -- shared library startup support
SYNOPSIS
void coff_solib_create_inferior_hook()
DESCRIPTION
When gdb starts up the inferior, the kernel maps in the shared
libraries. We get here with the target stopped at it's first
instruction, and the libraries already mapped. At this point, this
function gets called via expansion of the macro
SOLIB_CREATE_INFERIOR_HOOK.
*/
GLOBAL FUNCTION
coff_solib_create_inferior_hook -- shared library startup support
SYNOPSIS
void coff_solib_create_inferior_hook()
DESCRIPTION
When gdb starts up the inferior, the kernel maps in the shared
libraries. We get here with the target stopped at it's first
instruction, and the libraries already mapped. At this point, this
function gets called via expansion of the macro
SOLIB_CREATE_INFERIOR_HOOK.
*/
void
coff_solib_create_inferior_hook ()
void
coff_solib_create_inferior_hook()
{
coff_solib_add ((char *) 0, 0, (struct target_ops *) 0);
}

View File

@@ -1,24 +1,23 @@
/* COFF (SVR3) Shared library declarations for GDB, the GNU Debugger.
Copyright (C) 1992 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifdef __STDC__ /* Forward decl's for prototypes */
#ifdef __STDC__ /* Forward decl's for prototypes */
struct target_ops;
#endif
@@ -48,7 +47,7 @@ coff_solib_add PARAMS ((char *, int, struct target_ops *));
#define SOLIB_CREATE_INFERIOR_HOOK(PID) coff_solib_create_inferior_hook()
extern void
coff_solib_create_inferior_hook PARAMS ((void)); /* solib.c */
coff_solib_create_inferior_hook PARAMS((void)); /* solib.c */
/* Function to be called to remove the connection between debugger and
dynamic linker that was established by SOLIB_CREATE_INFERIOR_HOOK.
@@ -56,7 +55,7 @@ coff_solib_create_inferior_hook PARAMS ((void)); /* solib.c */
the debugger, as CLEAR_SOLIB does.)
This functionality is presently not implemented for this target.
*/
*/
#define SOLIB_REMOVE_INFERIOR_HOOK(PID) (0)
/* This function is called by the "catch load" command. It allows
@@ -64,7 +63,7 @@ coff_solib_create_inferior_hook PARAMS ((void)); /* solib.c */
library file (or any library file, if filename is NULL) is loaded.
Presently, this functionality is not implemented.
*/
*/
#define SOLIB_CREATE_CATCH_LOAD_HOOK(pid,tempflag,filename,cond_string) \
error("catch of library loads/unloads not yet implemented on this platform")
@@ -73,7 +72,7 @@ coff_solib_create_inferior_hook PARAMS ((void)); /* solib.c */
library file (or any library file, if filename is NULL) is unloaded.
Presently, this functionality is not implemented.
*/
*/
#define SOLIB_CREATE_CATCH_UNLOAD_HOOK(pid,tempflag,filename,cond_string) \
error("catch of library loads/unloads not yet implemented on this platform")
@@ -84,11 +83,11 @@ coff_solib_create_inferior_hook PARAMS ((void)); /* solib.c */
the dynamic linker hook, or undefined results are guaranteed.
Presently, this functionality is not implemented.
*/
*/
/*
#define SOLIB_HAVE_LOAD_EVENT(pid) \
#define SOLIB_HAVE_LOAD_EVENT(pid) \
error("catch of library loads/unloads not yet implemented on this platform")
*/
*/
#define SOLIB_HAVE_LOAD_EVENT(pid) \
(0)
@@ -105,12 +104,12 @@ coff_solib_create_inferior_hook PARAMS ((void)); /* solib.c */
string if they wish to continue the inferior and then access the string.
Presently, this functionality is not implemented.
*/
*/
/*
#define SOLIB_LOADED_LIBRARY_PATHNAME(pid) \
#define SOLIB_LOADED_LIBRARY_PATHNAME(pid) \
error("catch of library loads/unloads not yet implemented on this platform")
*/
*/
#define SOLIB_LOADED_LIBRARY_PATHNAME(pid) \
(0)
@@ -122,11 +121,11 @@ coff_solib_create_inferior_hook PARAMS ((void)); /* solib.c */
the dynamic linker hook, or undefined results are guaranteed.
Presently, this functionality is not implemented.
*/
*/
/*
#define SOLIB_HAVE_UNLOAD_EVENT(pid) \
#define SOLIB_HAVE_UNLOAD_EVENT(pid) \
error("catch of library loads/unloads not yet implemented on this platform")
*/
*/
#define SOLIB_HAVE_UNLOAD_EVENT(pid) \
(0)
@@ -143,11 +142,11 @@ coff_solib_create_inferior_hook PARAMS ((void)); /* solib.c */
string if they wish to continue the inferior and then access the string.
Presently, this functionality is not implemented.
*/
*/
/*
#define SOLIB_UNLOADED_LIBRARY_PATHNAME(pid) \
#define SOLIB_UNLOADED_LIBRARY_PATHNAME(pid) \
error("catch of library loads/unloads not yet implemented on this platform")
*/
*/
#define SOLIB_UNLOADED_LIBRARY_PATHNAME(pid) \
(0)
@@ -161,12 +160,12 @@ coff_solib_create_inferior_hook PARAMS ((void)); /* solib.c */
results are guaranteed.
Presently, this functionality is not implemented.
*/
*/
/*
#define SOLIB_IN_DYNAMIC_LINKER(pid,pc) \
#define SOLIB_IN_DYNAMIC_LINKER(pid,pc) \
error("catch of library loads/unloads not yet implemented on this platform")
*/
*/
#define SOLIB_IN_DYNAMIC_LINKER(pid,pc) \
(0)
@@ -176,7 +175,7 @@ coff_solib_create_inferior_hook PARAMS ((void)); /* solib.c */
any symbol tables.
Presently, this functionality is not implemented.
*/
*/
#define SOLIB_RESTART() \
(0)
@@ -187,5 +186,5 @@ coff_solib_create_inferior_hook PARAMS ((void)); /* solib.c */
#define DISABLE_UNSETTABLE_BREAK(addr) coff_solib_address(addr)
extern int
solib_address PARAMS ((CORE_ADDR)); /* solib.c */
solib_address PARAMS ((CORE_ADDR)); /* solib.c */
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -1,20 +1,19 @@
/* Handle lists of commands, their decoding and documentation, for GDB.
Copyright 1986, 1989, 1990, 1991, 1998 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "gdbcmd.h"
@@ -27,20 +26,15 @@
#endif
#ifdef HAVE_WAIT_H
#include <wait.h>
# include <wait.h>
#else
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif
# ifdef HAVE_SYS_WAIT_H
# include <sys/wait.h>
# endif
#endif
#include "wait.h"
/* FIXME: this should be auto-configured! */
#ifdef __MSDOS__
# define CANT_FORK
#endif
/* Prototypes for local functions */
static void undef_cmd_error PARAMS ((char *, char *));
@@ -57,12 +51,6 @@ static int parse_binary_operation PARAMS ((char *));
static void print_doc_line PARAMS ((GDB_FILE *, char *));
static struct cmd_list_element *find_cmd PARAMS ((char *command,
int len,
struct cmd_list_element * clist,
int ignore_help_classes,
int *nfound));
void _initialize_command PARAMS ((void));
/* Add element named NAME.
@@ -91,7 +79,7 @@ add_cmd (name, class, fun, doc, list)
struct cmd_list_element **list;
{
register struct cmd_list_element *c
= (struct cmd_list_element *) xmalloc (sizeof (struct cmd_list_element));
= (struct cmd_list_element *) xmalloc (sizeof (struct cmd_list_element));
struct cmd_list_element *p;
delete_cmd (name, list);
@@ -105,9 +93,9 @@ add_cmd (name, class, fun, doc, list)
{
p = *list;
while (p->next && STRCMP (p->next->name, name) <= 0)
{
p = p->next;
}
{
p = p->next;
}
c->next = p->next;
p->next = c;
}
@@ -135,7 +123,7 @@ add_cmd (name, class, fun, doc, list)
/* Same as above, except that the abbrev_flag is set. */
#if 0 /* Currently unused */
#if 0 /* Currently unused */
struct cmd_list_element *
add_abbrev_cmd (name, class, fun, doc, list)
@@ -146,7 +134,7 @@ add_abbrev_cmd (name, class, fun, doc, list)
struct cmd_list_element **list;
{
register struct cmd_list_element *c
= add_cmd (name, class, fun, doc, list);
= add_cmd (name, class, fun, doc, list);
c->abbrev_flag = 1;
return c;
@@ -168,7 +156,7 @@ add_alias_cmd (name, oldname, class, abbrev_flag, list)
register struct cmd_list_element *c;
copied_name = (char *) alloca (strlen (oldname) + 1);
strcpy (copied_name, oldname);
old = lookup_cmd (&copied_name, *list, "", 1, 1);
old = lookup_cmd (&copied_name, *list, "", 1, 1);
if (old == 0)
{
@@ -210,7 +198,7 @@ add_prefix_cmd (name, class, fun, doc, prefixlist, prefixname,
}
/* Like add_prefix_cmd but sets the abbrev_flag on the new command. */
struct cmd_list_element *
add_abbrev_prefix_cmd (name, class, fun, doc, prefixlist, prefixname,
allow_unknown, list)
@@ -267,7 +255,7 @@ add_set_cmd (name, class, var_type, var, doc, list)
struct cmd_list_element **list;
{
struct cmd_list_element *c
= add_cmd (name, class, NO_FUNCTION, doc, list);
= add_cmd (name, class, NO_FUNCTION, doc, list);
c->type = set_cmd;
c->var_type = var_type;
@@ -283,7 +271,7 @@ add_set_cmd (name, class, var_type, var, doc, list)
CLASS is as in add_cmd.
ENUMLIST is a list of strings which may follow NAME.
VAR is address of the variable which will contain the matching string
(from ENUMLIST).
(from ENUMLIST).
DOC is the documentation string. */
struct cmd_list_element *
@@ -296,7 +284,7 @@ add_set_enum_cmd (name, class, enumlist, var, doc, list)
struct cmd_list_element **list;
{
struct cmd_list_element *c
= add_set_cmd (name, class, var_enum, var, doc, list);
= add_set_cmd (name, class, var_enum, var, doc, list);
c->enums = enumlist;
return c;
@@ -311,21 +299,21 @@ add_show_from_set (setcmd, list)
struct cmd_list_element **list;
{
struct cmd_list_element *showcmd =
(struct cmd_list_element *) xmalloc (sizeof (struct cmd_list_element));
(struct cmd_list_element *) xmalloc (sizeof (struct cmd_list_element));
struct cmd_list_element *p;
memcpy (showcmd, setcmd, sizeof (struct cmd_list_element));
delete_cmd (showcmd->name, list);
showcmd->type = show_cmd;
/* Replace "set " at start of docstring with "show ". */
if (setcmd->doc[0] == 'S' && setcmd->doc[1] == 'e'
&& setcmd->doc[2] == 't' && setcmd->doc[3] == ' ')
showcmd->doc = concat ("Show ", setcmd->doc + 4, NULL);
else
fprintf_unfiltered (gdb_stderr, "GDB internal error: Bad docstring for set command\n");
if (*list == NULL || STRCMP ((*list)->name, showcmd->name) >= 0)
if (*list == NULL || STRCMP ((*list)->name, showcmd->name) >= 0)
{
showcmd->next = *list;
*list = showcmd;
@@ -334,9 +322,9 @@ add_show_from_set (setcmd, list)
{
p = *list;
while (p->next && STRCMP (p->next->name, showcmd->name) <= 0)
{
p = p->next;
}
{
p = p->next;
}
showcmd->next = p->next;
p->next = showcmd;
}
@@ -359,7 +347,7 @@ delete_cmd (name, list)
if ((*list)->hookee)
(*list)->hookee->hook = 0; /* Hook slips out of its mouth */
p = (*list)->next;
free ((PTR) * list);
free ((PTR)*list);
*list = p;
}
@@ -369,9 +357,9 @@ delete_cmd (name, list)
if (STREQ (c->next->name, name))
{
if (c->next->hookee)
c->next->hookee->hook = 0; /* hooked cmd gets away. */
c->next->hookee->hook = 0; /* hooked cmd gets away. */
p = c->next->next;
free ((PTR) c->next);
free ((PTR)c->next);
c->next = p;
}
else
@@ -412,10 +400,10 @@ help_cmd (command, stream)
/* There are three cases here.
If c->prefixlist is nonzero, we have a prefix command.
Print its documentation, then list its subcommands.
If c->function is nonzero, we really have a command.
Print its documentation and return.
If c->function is zero, we have a class name.
Print its documentation (as if it were a command)
and then set class to the number of this class
@@ -462,7 +450,7 @@ help_list (list, cmdtype, class, stream)
{
int len;
char *cmdtype1, *cmdtype2;
/* If CMDTYPE is "foo ", CMDTYPE1 gets " foo" and CMDTYPE2 gets "foo sub" */
len = strlen (cmdtype);
cmdtype1 = (char *) alloca (len + 1);
@@ -483,19 +471,19 @@ help_list (list, cmdtype, class, stream)
else
fprintf_filtered (stream, "List of %scommands:\n\n", cmdtype2);
help_cmd_list (list, class, cmdtype, (int) class >= 0, stream);
help_cmd_list (list, class, cmdtype, (int)class >= 0, stream);
if (class == all_classes)
fprintf_filtered (stream, "\n\
Type \"help%s\" followed by a class name for a list of commands in that class.",
cmdtype1);
cmdtype1);
fprintf_filtered (stream, "\n\
Type \"help%s\" followed by %scommand name for full documentation.\n\
Command name abbreviations are allowed if unambiguous.\n",
cmdtype1, cmdtype2);
cmdtype1, cmdtype2);
}
/* Print only the first line of STR on STREAM. */
static void
print_doc_line (stream, str)
@@ -518,7 +506,7 @@ print_doc_line (stream, str)
if (p - str > line_size - 1)
{
line_size = p - str + 1;
free ((PTR) line_buffer);
free ((PTR)line_buffer);
line_buffer = (char *) xmalloc (line_size);
}
strncpy (line_buffer, str, p - str);
@@ -535,10 +523,10 @@ print_doc_line (stream, str)
* PREFIX is the prefix to print before each command name.
* STREAM is the stream upon which the output should be written.
* CLASS should be:
* A non-negative class number to list only commands in that
* A non-negative class number to list only commands in that
* class.
* ALL_COMMANDS to list all commands in list.
* ALL_CLASSES to list all classes in list.
* ALL_COMMANDS to list all commands in list.
* ALL_CLASSES to list all classes in list.
*
* Note that RECURSE will be active on *all* sublists, not just the
* ones selected by the criteria above (ie. the selection mechanism
@@ -558,8 +546,8 @@ help_cmd_list (list, class, prefix, recurse, stream)
{
if (c->abbrev_flag == 0 &&
(class == all_commands
|| (class == all_classes && c->function.cfunc == NULL)
|| (class == c->class && c->function.cfunc != NULL)))
|| (class == all_classes && c->function.cfunc == NULL)
|| (class == c->class && c->function.cfunc != NULL)))
{
fprintf_filtered (stream, "%s%s -- ", prefix, c->name);
print_doc_line (stream, c->doc);
@@ -571,35 +559,34 @@ help_cmd_list (list, class, prefix, recurse, stream)
help_cmd_list (*c->prefixlist, class, c->prefixname, 1, stream);
}
}
/* Search the input clist for 'command'. Return the command if
found (or NULL if not), and return the number of commands
found in nfound */
static struct cmd_list_element *
find_cmd (command, len, clist, ignore_help_classes, nfound)
find_cmd(command, len, clist, ignore_help_classes, nfound)
char *command;
int len;
struct cmd_list_element *clist;
int ignore_help_classes;
int *nfound;
{
struct cmd_list_element *found, *c;
found = (struct cmd_list_element *) NULL;
found = (struct cmd_list_element *)NULL;
*nfound = 0;
for (c = clist; c; c = c->next)
if (!strncmp (command, c->name, len)
&& (!ignore_help_classes || c->function.cfunc))
&& (!ignore_help_classes || c->function.cfunc))
{
found = c;
(*nfound)++;
if (c->name[len] == '\0')
{
*nfound = 1;
break;
}
found = c;
(*nfound)++;
if (c->name[len] == '\0')
{
*nfound = 1;
break;
}
}
return found;
}
@@ -635,7 +622,7 @@ find_cmd (command, len, clist, ignore_help_classes, nfound)
affect the operation).
This routine does *not* modify the text pointed to by TEXT.
If IGNORE_HELP_CLASSES is nonzero, ignore any command list elements which
are actually help classes rather than commands (i.e. the function field of
the struct cmd_list_element is NULL). */
@@ -657,7 +644,7 @@ lookup_cmd_1 (text, clist, result_list, ignore_help_classes)
so that "set args_foo()" doesn't get interpreted as
"set args _foo()". */
for (p = *text;
*p && (isalnum (*p) || *p == '-' || *p == '_' ||
*p && (isalnum(*p) || *p == '-' || *p == '_' ||
(tui_version &&
(*p == '+' || *p == '<' || *p == '>' || *p == '$')) ||
(xdb_commands && (*p == '!' || *p == '/' || *p == '?')));
@@ -667,7 +654,7 @@ lookup_cmd_1 (text, clist, result_list, ignore_help_classes)
/* If nothing but whitespace, return 0. */
if (p == *text)
return 0;
len = p - *text;
/* *text and p now bracket the first command word to lookup (and
@@ -685,20 +672,20 @@ lookup_cmd_1 (text, clist, result_list, ignore_help_classes)
/* Look it up. */
found = 0;
nfound = 0;
found = find_cmd (command, len, clist, ignore_help_classes, &nfound);
found = find_cmd(command, len, clist, ignore_help_classes, &nfound);
/*
** We didn't find the command in the entered case, so lower case it
** and search again.
*/
** We didn't find the command in the entered case, so lower case it
** and search again.
*/
if (!found || nfound == 0)
{
for (tmp = 0; tmp < len; tmp++)
{
char x = command[tmp];
command[tmp] = isupper (x) ? tolower (x) : x;
}
found = find_cmd (command, len, clist, ignore_help_classes, &nfound);
{
char x = command[tmp];
command[tmp] = isupper(x) ? tolower(x) : x;
}
found = find_cmd(command, len, clist, ignore_help_classes, &nfound);
}
/* If nothing matches, we have a simple failure. */
@@ -710,8 +697,8 @@ lookup_cmd_1 (text, clist, result_list, ignore_help_classes)
if (result_list != NULL)
/* Will be modified in calling routine
if we know what the prefix command is. */
*result_list = 0;
return (struct cmd_list_element *) -1; /* Ambiguous. */
*result_list = 0;
return (struct cmd_list_element *) -1; /* Ambiguous. */
}
/* We've matched something on this list. Move text pointer forward. */
@@ -744,9 +731,9 @@ lookup_cmd_1 (text, clist, result_list, ignore_help_classes)
if (result_list != NULL)
if (!*result_list)
/* This used to say *result_list = *found->prefixlist
If that was correct, need to modify the documentation
at the top of this function to clarify what is supposed
to be going on. */
If that was correct, need to modify the documentation
at the top of this function to clarify what is supposed
to be going on. */
*result_list = found;
return c;
}
@@ -771,11 +758,11 @@ undef_cmd_error (cmdtype, q)
char *cmdtype, *q;
{
error ("Undefined %scommand: \"%s\". Try \"help%s%.*s\".",
cmdtype,
q,
*cmdtype ? " " : "",
strlen (cmdtype) - 1,
cmdtype);
cmdtype,
q,
*cmdtype? " ": "",
strlen(cmdtype)-1,
cmdtype);
}
/* Look up the contents of *LINE as a command in the command list LIST.
@@ -802,7 +789,7 @@ lookup_cmd (line, list, cmdtype, allow_unknown, ignore_help_classes)
{
struct cmd_list_element *last_list = 0;
struct cmd_list_element *c =
lookup_cmd_1 (line, list, &last_list, ignore_help_classes);
lookup_cmd_1 (line, list, &last_list, ignore_help_classes);
#if 0
/* This is wrong for complete_command. */
char *ptr = (*line) + strlen (*line) - 1;
@@ -812,7 +799,7 @@ lookup_cmd (line, list, cmdtype, allow_unknown, ignore_help_classes)
ptr--;
*(ptr + 1) = '\0';
#endif
if (!c)
{
if (!allow_unknown)
@@ -823,7 +810,7 @@ lookup_cmd (line, list, cmdtype, allow_unknown, ignore_help_classes)
{
char *p = *line, *q;
while (isalnum (*p) || *p == '-')
while (isalnum(*p) || *p == '-')
p++;
q = (char *) alloca (p - *line + 1);
@@ -838,13 +825,13 @@ lookup_cmd (line, list, cmdtype, allow_unknown, ignore_help_classes)
else if (c == (struct cmd_list_element *) -1)
{
/* Ambigous. Local values should be off prefixlist or called
values. */
values. */
int local_allow_unknown = (last_list ? last_list->allow_unknown :
allow_unknown);
char *local_cmdtype = last_list ? last_list->prefixname : cmdtype;
struct cmd_list_element *local_list =
(last_list ? *(last_list->prefixlist) : list);
(last_list ? *(last_list->prefixlist) : list);
if (local_allow_unknown < 0)
{
if (last_list)
@@ -863,12 +850,12 @@ lookup_cmd (line, list, cmdtype, allow_unknown, ignore_help_classes)
&& (*line)[amb_len] != '\t');
amb_len++)
;
ambbuf[0] = 0;
for (c = local_list; c; c = c->next)
if (!strncmp (*line, c->name, amb_len))
{
if (strlen (ambbuf) + strlen (c->name) + 6 < (int) sizeof ambbuf)
if (strlen (ambbuf) + strlen (c->name) + 6 < (int)sizeof ambbuf)
{
if (strlen (ambbuf))
strcat (ambbuf, ", ");
@@ -900,7 +887,7 @@ lookup_cmd (line, list, cmdtype, allow_unknown, ignore_help_classes)
}
return 0;
}
#if 0
/* Look up the contents of *LINE as a command in the command list LIST.
LIST is a chain of struct cmd_list_element's.
@@ -941,7 +928,7 @@ lookup_cmd (line, list, cmdtype, allow_unknown)
/* Find end of command name. */
p = *line;
while (*p == '-' || isalnum (*p))
while (*p == '-' || isalnum(*p))
p++;
/* Look up the command name.
@@ -956,18 +943,18 @@ lookup_cmd (line, list, cmdtype, allow_unknown)
error ("Lack of needed %scommand", cmdtype);
return 0;
}
/* Copy over to a local buffer, converting to lowercase on the way.
This is in case the command being parsed is a subcommand which
doesn't match anything, and that's ok. We want the original
untouched for the routine of the original command. */
processed_cmd = (char *) alloca (p - *line + 1);
for (cmd_len = 0; cmd_len < p - *line; cmd_len++)
{
char x = (*line)[cmd_len];
if (isupper (x))
processed_cmd[cmd_len] = tolower (x);
if (isupper(x))
processed_cmd[cmd_len] = tolower(x);
else
processed_cmd[cmd_len] = x;
}
@@ -1022,8 +1009,7 @@ lookup_cmd (line, list, cmdtype, allow_unknown)
/* Skip whitespace before the argument. */
while (*p == ' ' || *p == '\t')
p++;
while (*p == ' ' || *p == '\t') p++;
*line = p;
if (found->prefixlist && *p)
@@ -1073,12 +1059,12 @@ complete_on_cmdlist (list, text, word)
if (matches == sizeof_matchlist)
{
sizeof_matchlist *= 2;
matchlist = (char **) xrealloc ((char *) matchlist,
matchlist = (char **) xrealloc ((char *)matchlist,
(sizeof_matchlist
* sizeof (char *)));
}
matchlist[matches] = (char *)
matchlist[matches] = (char *)
xmalloc (strlen (word) + strlen (ptr->name) + 1);
if (word == text)
strcpy (matchlist[matches], ptr->name);
@@ -1099,13 +1085,13 @@ complete_on_cmdlist (list, text, word)
if (matches == 0)
{
free ((PTR) matchlist);
free ((PTR)matchlist);
matchlist = 0;
}
else
{
matchlist = (char **) xrealloc ((char *) matchlist, ((matches + 1)
* sizeof (char *)));
matchlist = (char **) xrealloc ((char *)matchlist, ((matches + 1)
* sizeof (char *)));
matchlist[matches] = (char *) 0;
}
@@ -1145,12 +1131,12 @@ complete_on_enum (enumlist, text, word)
if (matches == sizeof_matchlist)
{
sizeof_matchlist *= 2;
matchlist = (char **) xrealloc ((char *) matchlist,
matchlist = (char **) xrealloc ((char *)matchlist,
(sizeof_matchlist
* sizeof (char *)));
}
matchlist[matches] = (char *)
matchlist[matches] = (char *)
xmalloc (strlen (word) + strlen (name) + 1);
if (word == text)
strcpy (matchlist[matches], name);
@@ -1171,13 +1157,13 @@ complete_on_enum (enumlist, text, word)
if (matches == 0)
{
free ((PTR) matchlist);
free ((PTR)matchlist);
matchlist = 0;
}
else
{
matchlist = (char **) xrealloc ((char *) matchlist, ((matches + 1)
* sizeof (char *)));
matchlist = (char **) xrealloc ((char *)matchlist, ((matches + 1)
* sizeof (char *)));
matchlist[matches] = (char *) 0;
}
@@ -1202,15 +1188,16 @@ parse_binary_operation (arg)
|| !strncmp (arg, "1", length)
|| !strncmp (arg, "yes", length))
return 1;
else if (!strncmp (arg, "off", length)
|| !strncmp (arg, "0", length)
|| !strncmp (arg, "no", length))
return 0;
else
{
error ("\"on\" or \"off\" expected.");
if (!strncmp (arg, "off", length)
|| !strncmp (arg, "0", length)
|| !strncmp (arg, "no", length))
return 0;
}
else
{
error ("\"on\" or \"off\" expected.");
return 0;
}
}
/* Do a "set" or "show" command. ARG is NULL if no argument, or the text
@@ -1233,12 +1220,11 @@ do_setshow_command (arg, from_tty, c)
char *p;
char *q;
int ch;
if (arg == NULL)
arg = "";
new = (char *) xmalloc (strlen (arg) + 2);
p = arg;
q = new;
p = arg; q = new;
while ((ch = *p++) != '\000')
{
if (ch == '\\')
@@ -1254,7 +1240,7 @@ do_setshow_command (arg, from_tty, c)
break;
ch = parse_escape (&p);
if (ch == 0)
break; /* C loses */
break; /* C loses */
else if (ch > 0)
*q++ = ch;
}
@@ -1267,24 +1253,24 @@ do_setshow_command (arg, from_tty, c)
#endif
*q++ = '\0';
new = (char *) xrealloc (new, q - new);
if (*(char **) c->var != NULL)
free (*(char **) c->var);
if (*(char **)c->var != NULL)
free (*(char **)c->var);
*(char **) c->var = new;
}
break;
case var_string_noescape:
if (arg == NULL)
arg = "";
if (*(char **) c->var != NULL)
free (*(char **) c->var);
if (*(char **)c->var != NULL)
free (*(char **)c->var);
*(char **) c->var = savestring (arg, strlen (arg));
break;
case var_filename:
if (arg == NULL)
error_no_arg ("filename to set it to.");
if (*(char **) c->var != NULL)
free (*(char **) c->var);
*(char **) c->var = tilde_expand (arg);
if (*(char **)c->var != NULL)
free (*(char **)c->var);
*(char **)c->var = tilde_expand (arg);
break;
case var_boolean:
*(int *) c->var = parse_binary_operation (arg);
@@ -1339,7 +1325,7 @@ do_setshow_command (arg, from_tty, c)
}
p = strchr (arg, ' ');
if (p)
len = p - arg;
else
@@ -1359,7 +1345,7 @@ do_setshow_command (arg, from_tty, c)
if (nmatches > 1)
error ("Ambiguous item \"%s\".", arg);
*(char **) c->var = match;
*(char **)c->var = match;
}
break;
default:
@@ -1370,61 +1356,59 @@ do_setshow_command (arg, from_tty, c)
{
/* Print doc minus "show" at start. */
print_doc_line (gdb_stdout, c->doc + 5);
fputs_filtered (" is ", gdb_stdout);
wrap_here (" ");
switch (c->var_type)
{
case var_string:
{
unsigned char *p;
case var_string:
{
unsigned char *p;
fputs_filtered ("\"", gdb_stdout);
if (*(unsigned char **) c->var)
fputstr_filtered (*(unsigned char **) c->var, '"', gdb_stdout);
fputs_filtered ("\"", gdb_stdout);
}
break;
case var_string_noescape:
case var_filename:
case var_enum:
fputs_filtered ("\"", gdb_stdout);
if (*(char **) c->var)
fputs_filtered (*(char **) c->var, gdb_stdout);
if (*(unsigned char **)c->var)
for (p = *(unsigned char **) c->var; *p != '\0'; p++)
gdb_printchar (*p, gdb_stdout, '"');
fputs_filtered ("\"", gdb_stdout);
break;
case var_boolean:
fputs_filtered (*(int *) c->var ? "on" : "off", gdb_stdout);
break;
case var_uinteger:
if (*(unsigned int *) c->var == UINT_MAX)
{
fputs_filtered ("unlimited", gdb_stdout);
break;
}
/* else fall through */
case var_zinteger:
fprintf_filtered (gdb_stdout, "%u", *(unsigned int *) c->var);
break;
case var_integer:
if (*(int *) c->var == INT_MAX)
{
fputs_filtered ("unlimited", gdb_stdout);
}
else
fprintf_filtered (gdb_stdout, "%d", *(int *) c->var);
break;
default:
error ("gdb internal error: bad var_type in do_setshow_command");
}
break;
case var_string_noescape:
case var_filename:
case var_enum:
fputs_filtered ("\"", gdb_stdout);
if (*(char **)c->var)
fputs_filtered (*(char **) c->var, gdb_stdout);
fputs_filtered ("\"", gdb_stdout);
break;
case var_boolean:
fputs_filtered (*(int *) c->var ? "on" : "off", gdb_stdout);
break;
case var_uinteger:
if (*(unsigned int *) c->var == UINT_MAX) {
fputs_filtered ("unlimited", gdb_stdout);
break;
}
/* else fall through */
case var_zinteger:
fprintf_filtered (gdb_stdout, "%u", *(unsigned int *) c->var);
break;
case var_integer:
if (*(int *) c->var == INT_MAX)
{
fputs_filtered ("unlimited", gdb_stdout);
}
else
fprintf_filtered (gdb_stdout, "%d", *(int *) c->var);
break;
default:
error ("gdb internal error: bad var_type in do_setshow_command");
}
fputs_filtered (".\n", gdb_stdout);
}
else
error ("gdb internal error: bad cmd_type in do_setshow_command");
(*c->function.sfunc) (NULL, from_tty, c);
if (c->type == set_cmd && set_hook)
set_hook (c);
}
/* Show all the settings in a list of show commands. */
@@ -1435,20 +1419,19 @@ cmd_show_list (list, from_tty, prefix)
int from_tty;
char *prefix;
{
for (; list != NULL; list = list->next)
{
/* If we find a prefix, run its list, prefixing our output by its
prefix (with "show " skipped). */
if (list->prefixlist && !list->abbrev_flag)
cmd_show_list (*list->prefixlist, from_tty, list->prefixname + 5);
if (list->type == show_cmd)
{
fputs_filtered (prefix, gdb_stdout);
fputs_filtered (list->name, gdb_stdout);
fputs_filtered (": ", gdb_stdout);
do_setshow_command ((char *) NULL, from_tty, list);
}
}
for (; list != NULL; list = list->next) {
/* If we find a prefix, run its list, prefixing our output by its
prefix (with "show " skipped). */
if (list->prefixlist && !list->abbrev_flag)
cmd_show_list (*list->prefixlist, from_tty, list->prefixname + 5);
if (list->type == show_cmd)
{
fputs_filtered (prefix, gdb_stdout);
fputs_filtered (list->name, gdb_stdout);
fputs_filtered (": ", gdb_stdout);
do_setshow_command ((char *)NULL, from_tty, list);
}
}
}
/* ARGSUSED */
@@ -1458,29 +1441,9 @@ shell_escape (arg, from_tty)
int from_tty;
{
#ifdef CANT_FORK
/* If ARG is NULL, they want an inferior shell, but `system' just
reports if the shell is available when passed a NULL arg. */
int rc = system (arg ? arg : "");
if (!arg)
arg = "inferior shell";
if (rc == -1)
{
fprintf_unfiltered (gdb_stderr, "Cannot execute %s: %s\n", arg,
safe_strerror (errno));
gdb_flush (gdb_stderr);
}
else if (rc)
{
fprintf_unfiltered (gdb_stderr, "%s exited with status %d\n", arg, rc);
gdb_flush (gdb_stderr);
}
#ifdef __DJGPP__
/* Make sure to return to the directory GDB thinks it is, in case the
shell command we just ran changed it. */
chdir (current_directory);
#endif
/* FIXME: what about errors (I don't know how GO32 system() handles
them)? */
system (arg);
#else /* Can fork. */
int rc, status, pid;
char *p, *user_shell;
@@ -1494,7 +1457,7 @@ shell_escape (arg, from_tty)
else
p++; /* Get past '/' */
if ((pid = fork ()) == 0)
if ((pid = fork()) == 0)
{
if (!arg)
execl (user_shell, p, 0);
@@ -1526,11 +1489,11 @@ make_command (arg, from_tty)
p = "make";
else
{
p = xmalloc (sizeof ("make ") + strlen (arg));
p = xmalloc (sizeof("make ") + strlen(arg));
strcpy (p, "make ");
strcpy (p + sizeof ("make ") - 1, arg);
strcpy (p + sizeof("make ")-1, arg);
}
shell_escape (p, from_tty);
}
@@ -1550,7 +1513,7 @@ show_user_1 (c, stream)
while (cmdlines)
{
print_command_line (cmdlines, 4, stream);
print_command_line (cmdlines, 4);
cmdlines = cmdlines->next;
}
fputs_filtered ("\n", stream);
@@ -1590,11 +1553,11 @@ _initialize_command ()
With no arguments, run an inferior shell.");
if (xdb_commands)
add_com_alias ("!", "shell", class_support, 0);
add_com_alias("!", "shell", class_support, 0);
add_com ("make", class_support, make_command,
"Run the ``make'' program using the rest of the line as arguments.");
add_cmd ("user", no_class, show_user,
"Run the ``make'' program using the rest of the line as arguments.");
add_cmd ("user", no_class, show_user,
"Show definitions of user defined commands.\n\
Argument is the name of the user defined command.\n\
With no argument, show definitions of all user defined commands.", &showlist);

View File

@@ -1,20 +1,19 @@
/* Header file for command-reading library command.c.
Copyright (C) 1986, 1989, 1990 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#if !defined (COMMAND_H)
#define COMMAND_H 1
@@ -22,46 +21,42 @@
/* Not a set/show command. Note that some commands which begin with
"set" or "show" might be in this category, if their syntax does
not fall into one of the following categories. */
typedef enum cmd_types
{
not_set_cmd,
set_cmd,
show_cmd
}
cmd_types;
typedef enum cmd_types {
not_set_cmd,
set_cmd,
show_cmd
} cmd_types;
/* Types of "set" or "show" command. */
typedef enum var_types
{
/* "on" or "off". *VAR is an integer which is nonzero for on,
zero for off. */
var_boolean,
/* Unsigned Integer. *VAR is an unsigned int. The user can type 0
to mean "unlimited", which is stored in *VAR as UINT_MAX. */
var_uinteger,
typedef enum var_types {
/* "on" or "off". *VAR is an integer which is nonzero for on,
zero for off. */
var_boolean,
/* Unsigned Integer. *VAR is an unsigned int. The user can type 0
to mean "unlimited", which is stored in *VAR as UINT_MAX. */
var_uinteger,
/* Like var_uinteger but signed. *VAR is an int. The user can type 0
to mean "unlimited", which is stored in *VAR as INT_MAX. */
var_integer,
/* Like var_uinteger but signed. *VAR is an int. The user can type 0
to mean "unlimited", which is stored in *VAR as INT_MAX. */
var_integer,
/* String which the user enters with escapes (e.g. the user types \n and
it is a real newline in the stored string).
*VAR is a malloc'd string, or NULL if the string is empty. */
var_string,
/* String which stores what the user types verbatim.
*VAR is a malloc'd string, or NULL if the string is empty. */
var_string_noescape,
/* String which stores a filename.
*VAR is a malloc'd string, or NULL if the string is empty. */
var_filename,
/* ZeroableInteger. *VAR is an int. Like Unsigned Integer except
that zero really means zero. */
var_zinteger,
/* Enumerated type. Can only have one of the specified values. *VAR is a
char pointer to the name of the element that we find. */
var_enum
}
var_types;
/* String which the user enters with escapes (e.g. the user types \n and
it is a real newline in the stored string).
*VAR is a malloc'd string, or NULL if the string is empty. */
var_string,
/* String which stores what the user types verbatim.
*VAR is a malloc'd string, or NULL if the string is empty. */
var_string_noescape,
/* String which stores a filename.
*VAR is a malloc'd string, or NULL if the string is empty. */
var_filename,
/* ZeroableInteger. *VAR is an int. Like Unsigned Integer except
that zero really means zero. */
var_zinteger,
/* Enumerated type. Can only have one of the specified values. *VAR is a
char pointer to the name of the element that we find. */
var_enum
} var_types;
/* This structure records one command'd definition. */
@@ -87,10 +82,9 @@ struct cmd_list_element
/* If type is cmd_set or show_cmd, first set the variables, and
then call this. */
void (*sfunc) PARAMS ((char *args, int from_tty,
struct cmd_list_element * c));
}
function;
#define NO_FUNCTION ((void (*) PARAMS((char *args, int from_tty))) 0)
struct cmd_list_element *c));
} function;
# define NO_FUNCTION ((void (*) PARAMS((char *args, int from_tty))) 0)
/* Documentation of this command (or help topic).
First line is brief documentation; remaining lines form, with it,
@@ -135,7 +129,7 @@ struct cmd_list_element
returned relative to this position. For example, suppose TEXT is "foo"
and we want to complete to "foobar". If WORD is "oo", return
"oobar"; if WORD is "baz/foo", return "baz/foobar". */
char **(*completer) PARAMS ((char *text, char *word));
char ** (*completer) PARAMS ((char *text, char *word));
/* Type of "set" or "show" command (or SET_NOT_SET if not "set"
or "show"). */
@@ -166,33 +160,33 @@ struct cmd_list_element
/* Forward-declarations of the entry-points of command.c. */
extern struct cmd_list_element *
add_cmd PARAMS ((char *, enum command_class, void (*fun) (char *, int),
char *, struct cmd_list_element **));
add_cmd PARAMS ((char *, enum command_class, void (*fun) (char *, int),
char *, struct cmd_list_element **));
extern struct cmd_list_element *
add_alias_cmd PARAMS ((char *, char *, enum command_class, int,
struct cmd_list_element **));
add_alias_cmd PARAMS ((char *, char *, enum command_class, int,
struct cmd_list_element **));
extern struct cmd_list_element *
add_prefix_cmd PARAMS ((char *, enum command_class, void (*fun) (char *, int),
char *, struct cmd_list_element **, char *, int,
struct cmd_list_element **));
add_prefix_cmd PARAMS ((char *, enum command_class, void (*fun) (char *, int),
char *, struct cmd_list_element **, char *, int,
struct cmd_list_element **));
extern struct cmd_list_element *
add_abbrev_prefix_cmd PARAMS ((char *, enum command_class,
void (*fun) (char *, int), char *,
struct cmd_list_element **, char *, int,
struct cmd_list_element **));
add_abbrev_prefix_cmd PARAMS ((char *, enum command_class,
void (*fun) (char *, int), char *,
struct cmd_list_element **, char *, int,
struct cmd_list_element **));
extern struct cmd_list_element *
lookup_cmd PARAMS ((char **, struct cmd_list_element *, char *, int, int));
lookup_cmd PARAMS ((char **, struct cmd_list_element *, char *, int, int));
extern struct cmd_list_element *
lookup_cmd_1 PARAMS ((char **, struct cmd_list_element *,
struct cmd_list_element **, int));
lookup_cmd_1 PARAMS ((char **, struct cmd_list_element *,
struct cmd_list_element **, int));
extern void
add_com PARAMS ((char *, enum command_class, void (*fun) (char *, int),
add_com PARAMS ((char *, enum command_class, void (*fun)(char *, int),
char *));
extern void
@@ -205,10 +199,10 @@ extern void
add_info_alias PARAMS ((char *, char *, int));
extern char **
complete_on_cmdlist PARAMS ((struct cmd_list_element *, char *, char *));
complete_on_cmdlist PARAMS ((struct cmd_list_element *, char *, char *));
extern char **
complete_on_enum PARAMS ((char **enumlist, char *, char *));
complete_on_enum PARAMS ((char **enumlist, char *, char *));
extern void
delete_cmd PARAMS ((char *, struct cmd_list_element **));
@@ -225,16 +219,16 @@ help_cmd_list PARAMS ((struct cmd_list_element *, enum command_class, char *,
int, GDB_FILE *));
extern struct cmd_list_element *
add_set_cmd PARAMS ((char *, enum command_class, var_types, char *, char *,
struct cmd_list_element **));
add_set_cmd PARAMS ((char *, enum command_class, var_types, char *, char *,
struct cmd_list_element **));
extern struct cmd_list_element *
add_set_enum_cmd PARAMS ((char *name, enum command_class, char *list[],
char *var, char *doc, struct cmd_list_element ** c));
add_set_enum_cmd PARAMS ((char *name, enum command_class, char *list[],
char *var, char *doc, struct cmd_list_element **c));
extern struct cmd_list_element *
add_show_from_set PARAMS ((struct cmd_list_element *,
struct cmd_list_element **));
add_show_from_set PARAMS ((struct cmd_list_element *,
struct cmd_list_element **));
/* Do a "set" or "show" command. ARG is NULL if no argument, or the text
of the argument, and FROM_TTY is nonzero if this command is being entered

View File

@@ -1,37 +1,33 @@
/* Support for complaint handling during symbol reading in GDB.
Copyright (C) 1990, 1991, 1992 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "complaints.h"
#include "gdbcmd.h"
extern void _initialize_complaints PARAMS ((void));
/* Structure to manage complaints about symbol file contents. */
struct complaint complaint_root[1] =
{
struct complaint complaint_root[1] = {
{
(char *) NULL, /* Complaint message */
0, /* Complaint counter */
complaint_root /* Next complaint. */
(char *) NULL, /* Complaint message */
0, /* Complaint counter */
complaint_root /* Next complaint. */
}
};
@@ -46,33 +42,46 @@ static unsigned int stop_whining = 0;
case 0: self explanatory message.
case 1: First message of a series that must start off with explanation.
case 2: Subsequent message, when user already knows we are reading
symbols and we can just state our piece. */
symbols and we can just state our piece. */
static int complaint_series = 0;
/* External variables and functions referenced. */
extern int info_verbose;
/* Functions to handle complaints during symbol reading. */
/* Print a complaint about the input symbols, and link the complaint block
into a chain for later handling. */
/* VARARGS */
void
complain (struct complaint *complaint,...)
#ifdef ANSI_PROTOTYPES
complain (struct complaint *complaint, ...)
#else
complain (va_alist)
va_dcl
#endif
{
va_list args;
#ifdef ANSI_PROTOTYPES
va_start (args, complaint);
#else
struct complaint *complaint;
complaint->counter++;
if (complaint->next == NULL)
va_start (args);
complaint = va_arg (args, struct complaint *);
#endif
complaint -> counter++;
if (complaint -> next == NULL)
{
complaint->next = complaint_root->next;
complaint_root->next = complaint;
complaint -> next = complaint_root -> next;
complaint_root -> next = complaint;
}
if (complaint->counter > stop_whining)
if (complaint -> counter > stop_whining)
{
return;
}
@@ -82,31 +91,31 @@ complain (struct complaint *complaint,...)
{
/* Isolated messages, must be self-explanatory. */
case 0:
begin_line ();
puts_filtered ("During symbol reading, ");
wrap_here ("");
vprintf_filtered (complaint->message, args);
puts_filtered (".\n");
break;
case 0:
begin_line ();
puts_filtered ("During symbol reading, ");
wrap_here ("");
vprintf_filtered (complaint -> message, args);
puts_filtered (".\n");
break;
/* First of a series, without `set verbose'. */
case 1:
begin_line ();
puts_filtered ("During symbol reading...");
vprintf_filtered (complaint->message, args);
puts_filtered ("...");
wrap_here ("");
complaint_series++;
break;
case 1:
begin_line ();
puts_filtered ("During symbol reading...");
vprintf_filtered (complaint -> message, args);
puts_filtered ("...");
wrap_here ("");
complaint_series++;
break;
/* Subsequent messages of a series, or messages under `set verbose'.
(We'll already have produced a "Reading in symbols for XXX..."
message and will clean up at the end with a newline.) */
default:
vprintf_filtered (complaint->message, args);
puts_filtered ("...");
wrap_here ("");
(We'll already have produced a "Reading in symbols for XXX..."
message and will clean up at the end with a newline.) */
default:
vprintf_filtered (complaint -> message, args);
puts_filtered ("...");
wrap_here ("");
}
/* If GDB dumps core, we'd like to see the complaints first. Presumably
GDB will not be sending so many complaints that this becomes a
@@ -130,9 +139,9 @@ clear_complaints (sym_reading, noisy)
{
struct complaint *p;
for (p = complaint_root->next; p != complaint_root; p = p->next)
for (p = complaint_root -> next; p != complaint_root; p = p -> next)
{
p->counter = 0;
p -> counter = 0;
}
if (!sym_reading && !noisy && complaint_series > 1)

View File

@@ -1,22 +1,21 @@
/* Definitions for complaint handling during symbol reading in GDB.
Copyright (C) 1990, 1991, 1992 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#if !defined (COMPLAINTS_H)
@@ -31,11 +30,11 @@
if verbose, we report how many of each problem we had. */
struct complaint
{
char *message;
unsigned counter;
struct complaint *next;
};
{
char *message;
unsigned counter;
struct complaint *next;
};
/* Root of the chain of complaints that have at some point been issued.
This is used to reset the counters, and/or report the total counts. */
@@ -45,10 +44,10 @@ extern struct complaint complaint_root[1];
/* Functions that handle complaints. (in complaints.c) */
extern void
complain PARAMS ((struct complaint *,...));
complain PARAMS ((struct complaint *, ...));
extern void
clear_complaints PARAMS ((int, int));
#endif /* !defined (COMPLAINTS_H) */
#endif /* !defined (COMPLAINTS_H) */

View File

@@ -1,5 +1,17 @@
/* config.in. Generated automatically from configure.in by autoheader. */
/* Whether malloc must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_MALLOC
/* Whether realloc must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_REALLOC
/* Whether free must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_FREE
/* Whether strerror must be declared even if <string.h> is included. */
#undef NEED_DECLARATION_STRERROR
/* Define if on AIX 3.
System headers sometimes define this.
We just want to avoid a redefinition error message. */
@@ -104,13 +116,6 @@
size_t, and assorted other type changes. */
#undef PROC_SERVICE_IS_OLD
/* If you want to specify a default CPU variant, define this to be its
name, as a C string. */
#undef TARGET_CPU_DEFAULT
/* Define if the simulator is being linked in. */
#undef WITH_SIM
/* Set to true if the save_state_t structure is present */
#define HAVE_STRUCT_SAVE_STATE_T 0
@@ -150,9 +155,6 @@
/* Define if you have the munmap function. */
#undef HAVE_MUNMAP
/* Define if you have the poll function. */
#undef HAVE_POLL
/* Define if you have the putenv function. */
#undef HAVE_PUTENV
@@ -171,9 +173,6 @@
/* Define if you have the sigaction function. */
#undef HAVE_SIGACTION
/* Define if you have the socketpair function. */
#undef HAVE_SOCKETPAIR
/* Define if you have the stpcpy function. */
#undef HAVE_STPCPY
@@ -249,9 +248,6 @@
/* Define if you have the <sys/reg.h> header file. */
#undef HAVE_SYS_REG_H
/* Define if you have the <sys/select.h> header file. */
#undef HAVE_SYS_SELECT_H
/* Define if you have the <sys/wait.h> header file. */
#undef HAVE_SYS_WAIT_H
@@ -285,9 +281,6 @@
/* Define if you have the m library (-lm). */
#undef HAVE_LIBM
/* Define if you have the socket library (-lsocket). */
#undef HAVE_LIBSOCKET
/* Define if you have the w library (-lw). */
#undef HAVE_LIBW
@@ -318,9 +311,6 @@
/* Define if strdup is not declared in system header files. */
#undef NEED_DECLARATION_STRDUP
/* Define if strstr is not declared in system header files. */
#undef NEED_DECLARATION_STRSTR
/* Define if <sys/procfs.h> has pstatus_t. */
#undef HAVE_PSTATUS_T

View File

@@ -2,22 +2,21 @@
Copyright (C) 1986, 1987, 1989, 1991, 1992 Free Software Foundation, Inc.
Contributed by David Wood (wood@lab.ultra.nyu.edu).
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* If we ever *do* end up using the standard fetch_inferior_registers,
this is the right value for U_REGS_OFFSET. */

View File

@@ -2,22 +2,21 @@
Copyright 1990, 1991, 1993, 1994 Free Software Foundation, Inc.
Contributed by Cygnus Support. Written by Jim Kingdon.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Parameters for an EB29K (a board which plugs into a PC and is
accessed through EBMON software running on the PC, which we
@@ -44,8 +43,9 @@
/* Advance PC across any function entry prologue instructions
to reach some "real" code. */
#define SKIP_PROLOGUE(pc) (a29k_skip_prologue (pc))
CORE_ADDR a29k_skip_prologue ();
#define SKIP_PROLOGUE(pc) \
{ pc = skip_prologue (pc); }
CORE_ADDR skip_prologue ();
/* Immediately after a function call, return the saved pc.
Can't go through the frames for this because on some machines
@@ -136,7 +136,7 @@ CORE_ADDR a29k_skip_prologue ();
/*
* Converts an sdb register number to an internal gdb register number.
* Currently under epi, gr96->0...gr127->31...lr0->32...lr127->159, or...
* gr64->0...gr95->31, lr0->32...lr127->159.
* gr64->0...gr95->31, lr0->32...lr127->159.
*/
#define SDB_REG_TO_REGNUM(value) \
(((value) >= 96 && (value) <= 127) ? ((value) - 96) : \
@@ -149,8 +149,8 @@ CORE_ADDR a29k_skip_prologue ();
* register sets. Namely, gcc can compile (-mkernel-registers) so that
* it uses gr64-gr95 in stead of gr96-gr127.
*/
#define MSP_HW_REGNUM 125 /* gr125 */
#define RAB_HW_REGNUM 126 /* gr126 */
#define MSP_HW_REGNUM 125 /* gr125 */
#define RAB_HW_REGNUM 126 /* gr126 */
/* Convert Processor Special register #x to REGISTER_NAMES register # */
#define SR_REGNUM(x) \
@@ -171,7 +171,7 @@ CORE_ADDR a29k_skip_prologue ();
/* This needs to be the memory stack pointer, not the register stack pointer,
to make call_function work right. */
#define SP_REGNUM MSP_REGNUM
#define FP_REGNUM 33 /* lr1 */
#define FP_REGNUM 33 /* lr1 */
/* Return register for transparent calling convention (gr122). */
#define TPC_REGNUM (122 - 96 + GR96_REGNUM)
@@ -208,8 +208,8 @@ CORE_ADDR a29k_skip_prologue ();
#define RBP_REGNUM (VAB_REGNUM + 7)
#define TMC_REGNUM (VAB_REGNUM + 8)
#define TMR_REGNUM (VAB_REGNUM + 9)
#define NPC_REGNUM (VAB_REGNUM + 10) /* pc0 */
#define PC_REGNUM (VAB_REGNUM + 11) /* pc1 */
#define NPC_REGNUM (VAB_REGNUM + 10) /* pc0 */
#define PC_REGNUM (VAB_REGNUM + 11) /* pc1 */
#define PC2_REGNUM (VAB_REGNUM + 12)
#define MMU_REGNUM (VAB_REGNUM + 13)
#define LRU_REGNUM (VAB_REGNUM + 14)
@@ -224,7 +224,7 @@ CORE_ADDR a29k_skip_prologue ();
#define IPA_REGNUM (VAB_REGNUM + 22)
#define IPB_REGNUM (VAB_REGNUM + 23)
#endif /* !defined(REGISTER_NAMES) */
#endif /* !defined(REGISTER_NAMES) */
/* Total amount of space needed to store our copies of the machine's
register state, the array `registers'. */
@@ -310,7 +310,7 @@ extern use_struct_convention_fn a29k_use_struct_convention;
write_register_bytes (REGISTER_BYTE (RETURN_REGNUM), (char *)(VALBUF), \
TYPE_LENGTH (TYPE)); \
}
/* *INDENT-OFF* */
/* The a29k user's guide documents well what the stacks look like.
But what isn't so clear there is how this interracts with the
symbols, or with GDB.
@@ -321,10 +321,10 @@ extern use_struct_convention_fn a29k_use_struct_convention;
alloca()), the result of the calculation msp + msize.
LOC_ARG, LOC_LOCAL - For GCC, these are relative to saved_msp.
For high C, these are relative to msp (making alloca impossible).
For high C, these are relative to msp (making alloca impossible).
LOC_REGISTER, LOC_REGPARM - The register number is the number at the
time the function is running (after the prologue), or in the case
of LOC_REGPARM, may be a register number in the range 160-175.
time the function is running (after the prologue), or in the case
of LOC_REGPARM, may be a register number in the range 160-175.
The compilers do things like store an argument into memory, and then put out
a LOC_ARG for it, or put it into global registers and put out a
@@ -349,75 +349,73 @@ extern use_struct_convention_fn a29k_use_struct_convention;
registers need to be filled in the function epilogue.
Consider the code:
< call bar>
loc1: . . .
bar: sub gr1,gr1,rsize_b
. . .
add mfp,msp,0
sub msp,msp,msize_b
. . .
< call foo >
loc2: . . .
foo: sub gr1,gr1,rsize_f
. . .
add mfp,msp,0
sub msp,msp,msize_f
. . .
loc3: < suppose the inferior stops here >
< call bar>
loc1: . . .
bar: sub gr1,gr1,rsize_b
. . .
add mfp,msp,0
sub msp,msp,msize_b
. . .
< call foo >
loc2: . . .
foo: sub gr1,gr1,rsize_f
. . .
add mfp,msp,0
sub msp,msp,msize_f
. . .
loc3: < suppose the inferior stops here >
memory stack register stack
| | |____________|
| | |____loc1____|
+------->|___________| | | ^
| | ^ | | locals_b | |
| | | | |____________| |
| | | | | | | rsize_b
| | | msize_b | | args_to_f | |
| | | | |____________| |
| | | | |____lr1_____| V
| | V | |____loc2____|<----------------+
| +--->|___________|<---------mfp | ^ |
| | | ^ | | locals_f | | |
| | | | msize_f | |____________| | |
| | | | | | | | rsize_f |
| | | V | | args | | |
| | |___________|<msp |____________| | |
| | |_____lr1____| V |
| | |___garbage__| <- gr1 <----+ |
| | | |
| | | |
| | pc=loc3 | |
| | | |
| | | |
| | frame cache | |
| | |_________________| | |
| | |rsize=rsize_b | | |
| | |msize=msize_b | | |
+---|--------saved_msp | | |
| |frame------------------------------------|---+
| |pc=loc2 | |
| |_________________| |
| |rsize=rsize_f | |
| |msize=msize_f | |
+--------saved_msp | |
|frame------------------------------------+
|pc=loc3 |
|_________________|
memory stack register stack
| | |____________|
| | |____loc1____|
+------->|___________| | | ^
| | ^ | | locals_b | |
| | | | |____________| |
| | | | | | | rsize_b
| | | msize_b | | args_to_f | |
| | | | |____________| |
| | | | |____lr1_____| V
| | V | |____loc2____|<----------------+
| +--->|___________|<---------mfp | ^ |
| | | ^ | | locals_f | | |
| | | | msize_f | |____________| | |
| | | | | | | | rsize_f |
| | | V | | args | | |
| | |___________|<msp |____________| | |
| | |_____lr1____| V |
| | |___garbage__| <- gr1 <----+ |
| | | |
| | | |
| | pc=loc3 | |
| | | |
| | | |
| | frame cache | |
| | |_________________| | |
| | |rsize=rsize_b | | |
| | |msize=msize_b | | |
+---|--------saved_msp | | |
| |frame------------------------------------|---+
| |pc=loc2 | |
| |_________________| |
| |rsize=rsize_f | |
| |msize=msize_f | |
+--------saved_msp | |
|frame------------------------------------+
|pc=loc3 |
|_________________|
So, is that sufficiently confusing? Welcome to the 29000.
Notes:
* The frame for foo uses a memory frame pointer but the frame for
bar does not. In the latter case the saved_msp is
computed by adding msize to the saved_msp of the
next frame.
bar does not. In the latter case the saved_msp is
computed by adding msize to the saved_msp of the
next frame.
* msize is in the frame cache only for high C's sake. */
/* *INDENT-ON* */
void read_register_stack ();
long read_register_stack_integer ();
#define FRAME_INIT_SAVED_REGS(fi) /*no-op */
#define FRAME_INIT_SAVED_REGS(fi) /*no-op*/
#define EXTRA_FRAME_INFO \
CORE_ADDR saved_msp; \
@@ -431,14 +429,14 @@ long read_register_stack_integer ();
/* Because INIT_FRAME_PC gets passed fromleaf, that's where we init
not only ->pc and ->frame, but all the extra stuff, when called from
get_prev_frame, that is. */
get_prev_frame_info, that is. */
#define INIT_EXTRA_FRAME_INFO(fromleaf, fci) init_extra_frame_info(fci)
void init_extra_frame_info ();
#define INIT_FRAME_PC(fromleaf, fci) init_frame_pc(fromleaf, fci)
void init_frame_pc ();
/* FRAME_CHAIN takes a FRAME
and produces the frame's chain-pointer.
@@ -474,10 +472,11 @@ void init_frame_pc ();
/* Define other aspects of the stack frame. */
/* An expression that tells us whether the function invocation represented
by FI does not have a frame on the stack associated with it. */
#define FRAMELESS_FUNCTION_INVOCATION(FI) \
(frameless_look_for_prologue (FI))
/* A macro that tells us whether the function invocation represented
by FI does not have a frame on the stack associated with it. If it
does not, FRAMELESS is set to 1, else 0. */
#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
(FRAMELESS) = frameless_look_for_prologue(FI)
/* Saved pc (i.e. return address). */
#define FRAME_SAVED_PC(fraim) \
@@ -496,7 +495,7 @@ extern CORE_ADDR frame_locals_address ();
the argcount field from it, to support debugging assembler code.
Problem was, the "argcount" field never did hold the argument
count. */
#define FRAME_NUM_ARGS(fi) (-1)
#define FRAME_NUM_ARGS(numargs, fi) ((numargs) = -1)
#define FRAME_ARGS_ADDRESS(fi) FRAME_LOCALS_ADDRESS (fi)
@@ -507,16 +506,10 @@ extern CORE_ADDR frame_locals_address ();
/* Provide our own get_saved_register. HAVE_REGISTER_WINDOWS is insufficient
because registers get renumbered on the a29k without getting saved. */
#ifdef __STDC__
enum lval_type;
struct frame_info;
#endif
void a29k_get_saved_register PARAMS ((char *raw_buffer, int *optimized, CORE_ADDR * addrp, struct frame_info * frame, int regnum, enum lval_type * lvalp));
#define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) \
a29k_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval)
#define GET_SAVED_REGISTER
/* Call function stuff. */
/* *INDENT-OFF* */
/* The dummy frame looks like this (see also the general frame picture
above):
@@ -566,10 +559,7 @@ void a29k_get_saved_register PARAMS ((char *raw_buffer, int *optimized, CORE_ADD
retaddr_sproc: Contains the PC at the time we call the function.
set by PUSH_DUMMY_FRAME and read by POP_FRAME.
retaddr_dummy: This points to a breakpoint instruction in the dummy. */
/* *INDENT-ON* */
/* Rsize for dummy frame, in bytes. */
/* Bytes for outgoing args, lr1, and retaddr. */
@@ -606,14 +596,14 @@ extern void pop_frame ();
mtsrim cr, 15
loadm 0, 0, lr2, msp ; load first 16 words of arguments into registers
add msp, msp, 16 * 4 ; point to the remaining arguments
CONST_INSN:
const lr0,inf ; (replaced by half of target addr)
consth lr0,inf ; (replaced by other half of target addr)
CONST_INSN:
const lr0,inf ; (replaced by half of target addr)
consth lr0,inf ; (replaced by other half of target addr)
calli lr0, lr0
aseq 0x40,gr1,gr1 ; nop
BREAKPT_INSN:
asneq 0x50,gr1,gr1 ; breakpoint (replaced by local breakpoint insn)
*/
BREAKPT_INSN:
asneq 0x50,gr1,gr1 ; breakpoint (replaced by local breakpoint insn)
*/
#if TARGET_BYTE_ORDER == HOST_BYTE_ORDER
#define BS(const) const
@@ -638,7 +628,7 @@ extern void pop_frame ();
BS(0x72500101)}
#define CALL_DUMMY_LENGTH (8 * 4)
#define CALL_DUMMY_START_OFFSET 0 /* Start execution at beginning of dummy */
#define CALL_DUMMY_START_OFFSET 0 /* Start execution at beginning of dummy */
/* Helper macro for FIX_CALL_DUMMY. WORDP is a long * which points to a
word in target byte order; bits 0-7 and 16-23 of *WORDP are replaced with
@@ -653,9 +643,9 @@ extern void pop_frame ();
#else /* Target is little endian. */
#define STUFF_I16(WORDP, DATA) \
{
*(char *) (WORDP) = ((DATA) & 0xff);
*((char *) (WORDP) + 2) = (((DATA) >> 8) & 0xff);
}
*(char *)(WORDP) = ((DATA) & 0xff);
*((char *)(WORDP) + 2) = (((DATA) >> 8) & 0xff);
}
#endif /* Target is little endian. */
/* Insert the specified number of args and function address
@@ -699,8 +689,7 @@ extern void pop_frame ();
(num), SYMBOL_SOURCE_NAME (sym)), (num) \
: (num))
extern enum a29k_processor_types
{
extern enum a29k_processor_types {
a29k_unknown,
/* Bit 0x400 of the CPS does *not* identify freeze mode, i.e. 29000,
@@ -709,8 +698,7 @@ extern enum a29k_processor_types
/* Bit 0x400 of the CPS does identify freeze mode, i.e. 29050. */
a29k_freeze_mode
}
processor_type;
} processor_type;
/* We need three arguments for a general frame specification for the
"frame" or "info frame" command. */

View File

@@ -1,23 +1,22 @@
/* Parameters for NYU Ultracomputer 29000 target, for GDB, the GNU debugger.
Copyright 1990, 1991 Free Software Foundation, Inc.
Contributed by David Wood @ New York University (wood@nyu.edu).
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* This file includes tm-a29k.h, but predefines REGISTER_NAMES and
related macros. The file supports a a29k running our flavor of
@@ -29,7 +28,7 @@
/* Initializer for an array of names of registers.
There should be NUM_REGS strings in this initializer.
*/
#define NUM_REGS (EXO_REGNUM + 1)
#define NUM_REGS (EXO_REGNUM + 1)
#define REGISTER_NAMES { \
"gr1", \
@@ -63,14 +62,14 @@
#ifdef KERNEL_DEBUGGING
#define PADDR_U_REGNUM 22 /* gr86 */
#define RETURN_REGNUM GR64_REGNUM
# define PADDR_U_REGNUM 22 /* gr86 */
# define RETURN_REGNUM GR64_REGNUM
#else
#define RETURN_REGNUM GR96_REGNUM
#endif /* KERNEL_DEBUGGING */
# define RETURN_REGNUM GR96_REGNUM
#endif /* KERNEL_DEBUGGING */
/* Should rename all GR96_REGNUM to RETURN_REGNUM */
/* Should rename all GR96_REGNUM to RETURN_REGNUM */
#define GR1_REGNUM (0)
#define GR64_REGNUM 1
#define GR96_REGNUM (GR64_REGNUM + 32)
@@ -91,41 +90,41 @@
#define RFB_REGNUM (127 - 96 + RETURN_REGNUM)
/* Register Stack Pointer. */
#define RSP_REGNUM GR1_REGNUM
#define LR0_REGNUM ( 32 + GR96_REGNUM)
#define LR0_REGNUM ( 32 + GR96_REGNUM)
/* Protected Special registers */
#define VAB_REGNUM (LR0_REGNUM + 128)
#define OPS_REGNUM (VAB_REGNUM + 1)
#define CPS_REGNUM (VAB_REGNUM + 2)
#define CFG_REGNUM (VAB_REGNUM + 3)
#define CHA_REGNUM (VAB_REGNUM + 4)
#define CHD_REGNUM (VAB_REGNUM + 5)
#define CHC_REGNUM (VAB_REGNUM + 6)
#define RBP_REGNUM (VAB_REGNUM + 7)
#define TMC_REGNUM (VAB_REGNUM + 8)
#define TMR_REGNUM (VAB_REGNUM + 9)
#define OPS_REGNUM (VAB_REGNUM + 1)
#define CPS_REGNUM (VAB_REGNUM + 2)
#define CFG_REGNUM (VAB_REGNUM + 3)
#define CHA_REGNUM (VAB_REGNUM + 4)
#define CHD_REGNUM (VAB_REGNUM + 5)
#define CHC_REGNUM (VAB_REGNUM + 6)
#define RBP_REGNUM (VAB_REGNUM + 7)
#define TMC_REGNUM (VAB_REGNUM + 8)
#define TMR_REGNUM (VAB_REGNUM + 9)
#define NPC_REGNUM (VAB_REGNUM + 10) /* pc0 */
#define PC_REGNUM (VAB_REGNUM + 11) /* pc1 */
#define PC2_REGNUM (VAB_REGNUM + 12) /* pc2 */
#define PC_REGNUM (VAB_REGNUM + 11) /* pc1 */
#define PC2_REGNUM (VAB_REGNUM + 12) /* pc2 */
#define MMU_REGNUM (VAB_REGNUM + 13)
#define LRU_REGNUM (VAB_REGNUM + 14)
/* Register sequence gap */
/* Unprotected Special registers */
#define IPC_REGNUM (LRU_REGNUM + 1)
#define IPA_REGNUM (IPC_REGNUM + 1)
#define IPB_REGNUM (IPC_REGNUM + 2)
#define Q_REGNUM (IPC_REGNUM + 3)
#define ALU_REGNUM (IPC_REGNUM + 4)
#define IPC_REGNUM (LRU_REGNUM + 1)
#define IPA_REGNUM (IPC_REGNUM + 1)
#define IPB_REGNUM (IPC_REGNUM + 2)
#define Q_REGNUM (IPC_REGNUM + 3)
#define ALU_REGNUM (IPC_REGNUM + 4)
#define PS_REGNUM ALU_REGNUM
#define BP_REGNUM (IPC_REGNUM + 5)
#define FC_REGNUM (IPC_REGNUM + 6)
#define CR_REGNUM (IPC_REGNUM + 7)
#define BP_REGNUM (IPC_REGNUM + 5)
#define FC_REGNUM (IPC_REGNUM + 6)
#define CR_REGNUM (IPC_REGNUM + 7)
/* Register sequence gap */
#define FPE_REGNUM (CR_REGNUM + 1)
#define INT_REGNUM (FPE_REGNUM + 1)
#define FPS_REGNUM (FPE_REGNUM + 2)
#define FPE_REGNUM (CR_REGNUM + 1)
#define INT_REGNUM (FPE_REGNUM + 1)
#define FPS_REGNUM (FPE_REGNUM + 2)
/* Register sequence gap */
#define EXO_REGNUM (FPS_REGNUM + 1)
#define EXO_REGNUM (FPS_REGNUM + 1)
/* Special register #x. */
#define SR_REGNUM(x) \
@@ -161,7 +160,7 @@
/*
* Converts an sdb register number to an internal gdb register number.
* Currently under gcc, gr96->0...gr128->31...lr0->32...lr127->159, or...
* gr64->0...gr95->31, lr0->32...lr127->159.
* gr64->0...gr95->31, lr0->32...lr127->159.
*/
#define SDB_REG_TO_REGNUM(value) (((value)<32) ? ((value)+RETURN_REGNUM) : \
((value)-32+LR0_REGNUM))
@@ -169,7 +168,7 @@
#ifdef KERNEL_DEBUGGING
/* ublock virtual address as defined in our sys/param.h */
/* FIXME: Should get this from sys/param.h */
#define UVADDR ((32*0x100000)-8192)
# define UVADDR ((32*0x100000)-8192)
#endif
/*
@@ -178,12 +177,11 @@
*/
#if !defined(KERNEL_DEBUGGING)
#ifdef SYM1
#define IN_SIGTRAMP(pc, name) (name && STREQ ("sigtramp", name))
# define IN_SIGTRAMP(pc, name) (name && STREQ ("sigtramp", name))
#else
Need to define
IN_SIGTRAMP () for sym2.
Need to define IN_SIGTRAMP() for sym2.
#endif
#endif /* !KERNEL_DEBUGGING */
#endif /* !KERNEL_DEBUGGING */
#include "a29k/tm-a29k.h"
@@ -193,35 +191,36 @@ IN_SIGTRAMP () for sym2.
mtsrim cr, 15
loadm 0, 0, lr2, msp ; load first 16 words of arguments into registers
add msp, msp, 16 * 4 ; point to the remaining arguments
CONST_INSN:
CONST_INSN:
const gr96,inf
consth gr96,inf
calli lr0, gr96
aseq 0x40,gr1,gr1 ; nop
asneq 0x50,gr1,gr1 ; breakpoint
When KERNEL_DEBUGGIN is defined, msp -> gr93, gr96 -> gr64,
7d -> 5d, 60 -> 40
*/
7d -> 5d, 60 -> 40
*/
/* Position of the "const" instruction within CALL_DUMMY in bytes. */
#undef CALL_DUMMY
#if TARGET_BYTE_ORDER == HOST_BYTE_ORDER
#ifdef KERNEL_DEBUGGING /* gr96 -> gr64 */
#define CALL_DUMMY {0x0400870f, 0x3600825d, 0x155d5d40, 0x03ff40ff, \
#ifdef KERNEL_DEBUGGING /* gr96 -> gr64 */
# define CALL_DUMMY {0x0400870f, 0x3600825d, 0x155d5d40, 0x03ff40ff, \
0x02ff40ff, 0xc8008040, 0x70400101, 0x72500101}
#else
#define CALL_DUMMY {0x0400870f, 0x3600827d, 0x157d7d40, 0x03ff60ff, \
# define CALL_DUMMY {0x0400870f, 0x3600827d, 0x157d7d40, 0x03ff60ff, \
0x02ff60ff, 0xc8008060, 0x70400101, 0x72500101}
#endif /* KERNEL_DEBUGGING */
#else /* Byte order differs. */
you lose
#endif /* Byte order differs. */
#endif /* KERNEL_DEBUGGING */
#else /* Byte order differs. */
you lose
#endif /* Byte order differs. */
#if !defined(KERNEL_DEBUGGING)
#ifdef SYM1
#undef DECR_PC_AFTER_BREAK
#define DECR_PC_AFTER_BREAK 0 /* Sym1 kernel does the decrement */
#else
->"ULTRA3 running other than sym1 OS" !;
#endif
# ifdef SYM1
# undef DECR_PC_AFTER_BREAK
# define DECR_PC_AFTER_BREAK 0 /* Sym1 kernel does the decrement */
# else
->"ULTRA3 running other than sym1 OS"!;
# endif
#endif /* !KERNEL_DEBUGGING */

View File

@@ -1,26 +1,28 @@
/* Target machine description for VxWorks on the 29k, for GDB, the GNU debugger.
Copyright 1994, 1999 Free Software Foundation, Inc.
Copyright 1994 Free Software Foundation, Inc.
Contributed by Cygnus Support.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "a29k/tm-a29k.h"
#include "tm-vxworks.h"
#define GDBINIT_FILENAME ".vxgdbinit"
#define DEFAULT_PROMPT "(vxgdb) "
/* Number of registers in a ptrace_getregs call. */
@@ -69,9 +71,9 @@
want the inferior to stop after the function call has completed.
call_function_by_hand () sets a breakpoint here (via CALL_DUMMY_BREAK_SET),
which POP_FRAME later deletes (via CALL_DUMMY_BREAK_DELETE). */
#define CALL_DUMMY_STOP_OFFSET (7 * 4)
/* The offset of the first instruction of the CALL_DUMMY code fragment
relative to the frame pointer for a dummy frame. This is equal to
the size of the CALL_DUMMY plus the arg_slop area size (see the diagram
@@ -119,12 +121,12 @@
frame pointer in the dummy frame.
NOTE: in the both of the following definitions, we take advantage of
knowledge of the implementation of the target breakpoint operation,
in that we pass a null pointer as the second argument. It seems
reasonable to assume that any target requiring the use of
CALL_DUMMY_BREAK_{SET,DELETE} will not store the breakpoint
shadow contents in GDB; in any case, this assumption is vaild
for all VxWorks-related targets. */
knowledge of the implementation of the target breakpoint operation,
in that we pass a null pointer as the second argument. It seems
reasonable to assume that any target requiring the use of
CALL_DUMMY_BREAK_{SET,DELETE} will not store the breakpoint
shadow contents in GDB; in any case, this assumption is vaild
for all VxWorks-related targets. */
#define CALL_DUMMY_BREAK_SET(call_dummy_addr) \
target_insert_breakpoint ((call_dummy_addr) + CALL_DUMMY_STOP_OFFSET, \
@@ -147,7 +149,7 @@
the CALL_DUMMY handling for all targets (at least, a clean solution
would probably require this). Arguably, this should go in "tm-29k.h"
rather than here. */
#define STRUCT_VAL_ARGS_UNSUPPORTED
#define BKPT_OFFSET (7 * 4)
@@ -160,16 +162,16 @@
STUFF_I16((char *)dummyname + CONST_INSN + 4, fun >> 16);\
*(int *)((char *)dummyname + BKPT_OFFSET) = BKPT_INSTR;\
}
/* Offsets into jmp_buf. They are derived from VxWorks' REG_SET struct
(see VxWorks' setjmp.h). Note that Sun2, Sun3 and SunOS4 and VxWorks have
different REG_SET structs, hence different layouts for the jmp_buf struct.
Only JB_PC is needed for getting the saved PC value. */
#define JB_ELEMENT_SIZE 4 /* size of each element in jmp_buf */
#define JB_ELEMENT_SIZE 4 /* size of each element in jmp_buf */
#define JB_PC 3 /* offset of pc (pc1) in jmp_buf */
/* Figure out where the longjmp will land. We expect that we have just entered
longjmp and haven't yet setup the stack frame, so the args are still in the
output regs. lr2 (LR2_REGNUM) points at the jmp_buf structure from which we
@@ -180,14 +182,14 @@
extern int get_longjmp_target PARAMS ((CORE_ADDR *));
/* VxWorks adjusts the PC after a breakpoint has been hit. */
#undef DECR_PC_AFTER_BREAK
#define DECR_PC_AFTER_BREAK 0
/* Do whatever promotions are appropriate on a value being returned
from a function. VAL is the user-supplied value, and FUNC_TYPE
is the return type of the function if known, else 0.
For the Am29k, as far as I understand, if the function return type is known,
cast the value to that type; otherwise, ensure that integer return values
fill all of gr96.
@@ -196,7 +198,7 @@ extern int get_longjmp_target PARAMS ((CORE_ADDR *));
to most Am29K-based systems; but once moved into that file, it might
need to be redefined for all Am29K-based targets that also redefine
STORE_RETURN_VALUE. For now, to be safe, we define it here. */
#define PROMOTE_RETURN_VALUE(val, func_type) \
do { \
if (func_type) \

View File

@@ -2,22 +2,21 @@
Copyright (C) 1986, 1987, 1989, 1991 Free Software Foundation, Inc.
Contributed by David Wood (wood@lab.ultra.nyu.edu).
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Here at NYU we have what we call an ULTRA3 PE board. So
ifdefs for ULTRA3 are my doing. At this point in time,
@@ -28,22 +27,22 @@
#define HAVE_WAIT_STRUCT
#ifndef L_SET
#define L_SET 0 /* set the seek pointer */
#define L_INCR 1 /* increment the seek pointer */
#define L_XTND 2 /* extend the file size */
# define L_SET 0 /* set the seek pointer */
# define L_INCR 1 /* increment the seek pointer */
# define L_XTND 2 /* extend the file size */
#endif
#ifndef O_RDONLY
#define O_RDONLY 0
#define O_WRONLY 1
#define O_RDWR 2
# define O_RDONLY 0
# define O_WRONLY 1
# define O_RDWR 2
#endif
#ifndef F_OK
#define R_OK 4
#define W_OK 2
#define X_OK 1
#define F_OK 0
# define R_OK 4
# define W_OK 2
# define X_OK 1
# define F_OK 0
#endif
/* System doesn't provide siginterrupt(). */

View File

@@ -1,22 +1,21 @@
/* Native definitions for alpha running Linux.
Copyright (C) 1993, 1994 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/* Figure out where the longjmp will land. We expect that we have just entered
longjmp and haven't yet setup the stack frame, so the args are still in the

View File

@@ -1,22 +1,21 @@
/* Native definitions for alpha running OSF/1.
Copyright (C) 1993, 1994 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Figure out where the longjmp will land. We expect that we have just entered
longjmp and haven't yet setup the stack frame, so the args are still in the

View File

@@ -1,22 +1,21 @@
/* Native definitions for alpha running OSF/1-2.x, using procfs.
Copyright (C) 1995 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Get generic OSF/1 definitions. */
#include "alpha/nm-osf.h"

View File

@@ -1,22 +1,21 @@
/* Native definitions for alpha running OSF/1-3.x and higher, using procfs.
Copyright (C) 1995 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* OSF/1-3.x fixes some OSF/1-2.x procfs peculiarities and adds
a new one. */

View File

@@ -2,22 +2,21 @@
also used by the Alpha/Netware and Alpha/Linux targets.
Copyright 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef TM_ALPHA_H
#define TM_ALPHA_H
@@ -60,7 +59,7 @@ struct symbol;
/* Advance PC across any function entry prologue instructions
to reach some "real" code. */
#define SKIP_PROLOGUE(pc) (alpha_skip_prologue(pc, 0))
#define SKIP_PROLOGUE(pc) pc = alpha_skip_prologue(pc, 0)
extern CORE_ADDR alpha_skip_prologue PARAMS ((CORE_ADDR addr, int lenient));
/* Immediately after a function call, return the saved pc.
@@ -70,7 +69,7 @@ extern CORE_ADDR alpha_skip_prologue PARAMS ((CORE_ADDR addr, int lenient));
#define SAVED_PC_AFTER_CALL(frame) alpha_saved_pc_after_call(frame)
extern CORE_ADDR
alpha_saved_pc_after_call PARAMS ((struct frame_info *));
alpha_saved_pc_after_call PARAMS ((struct frame_info *));
/* Are we currently handling a signal ? */
@@ -80,7 +79,7 @@ extern CORE_ADDR
#define INNER_THAN(lhs,rhs) ((lhs) < (rhs))
#define BREAKPOINT {0x80, 0, 0, 0} /* call_pal bpt */
#define BREAKPOINT {0x80, 0, 0, 0} /* call_pal bpt */
/* Amount PC must be decremented by after a breakpoint.
This is often the number of bytes in BREAKPOINT
@@ -111,7 +110,7 @@ extern CORE_ADDR
"f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \
"f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \
"f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23",\
"f24", "f25", "f26", "f27", "f28", "f29", "f30", "fpcr",\
"f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31",\
"pc", "vfp", \
}
@@ -131,9 +130,8 @@ extern CORE_ADDR
#define SP_REGNUM 30 /* Contains address of top of stack */
#define RA_REGNUM 26 /* Contains return address value */
#define ZERO_REGNUM 31 /* Read-only register, always 0 */
#define FP0_REGNUM 32 /* Floating point register 0 */
#define FPA0_REGNUM 48 /* First float arg during a subr call */
#define FPCR_REGNUM 63 /* Floating point control register */
#define FP0_REGNUM 32 /* Floating point register 0 */
#define FPA0_REGNUM 48 /* First float arg during a subr call */
#define PC_REGNUM 64 /* Contains program counter */
#define FP_REGNUM 65 /* Virtual frame pointer */
@@ -173,12 +171,12 @@ extern CORE_ADDR
from raw format to virtual format.
The alpha needs a conversion between register and memory format if
the register is a floating point register and
memory format is float, as the register format must be double
memory format is float, as the register format must be double
or
memory format is an integer with 4 bytes or less, as the representation
of integers in floating point registers is different. */
memory format is an integer with 4 bytes or less, as the representation
of integers in floating point registers is different. */
#define REGISTER_CONVERTIBLE(N) ((N) >= FP0_REGNUM && (N) < FP0_REGNUM + 31)
#define REGISTER_CONVERTIBLE(N) ((N) >= FP0_REGNUM && (N) < FP0_REGNUM + 32)
/* Convert data from raw format for register REGNUM in buffer FROM
to virtual format with type TYPE in buffer TO. */
@@ -200,14 +198,13 @@ alpha_register_convert_to_raw PARAMS ((struct type *, int, char *, char *));
of data in register N. */
#define REGISTER_VIRTUAL_TYPE(N) \
(((N) >= FP0_REGNUM && (N) < FP0_REGNUM+31) \
(((N) >= FP0_REGNUM && (N) < FP0_REGNUM+32) \
? builtin_type_double : builtin_type_long) \
/* Store the address of the place in which to copy the structure the
subroutine will return. Handled by alpha_push_arguments. */
#define STORE_STRUCT_RETURN(addr, sp)
/**/
#define STORE_STRUCT_RETURN(addr, sp) /**/
/* Extract from an array REGBUF containing the (raw) register state
a function return value of type TYPE, and copy that, in virtual format,
@@ -240,8 +237,8 @@ alpha_store_return_value PARAMS ((struct type *, char *));
/* Structures are returned by ref in extra arg0 */
#define USE_STRUCT_CONVENTION(gcc_p, type) 1
/* Describe the pointer in each stack frame to the previous stack frame
(its caller). */
@@ -254,17 +251,18 @@ extern CORE_ADDR alpha_frame_chain PARAMS ((struct frame_info *));
/* Define other aspects of the stack frame. */
/* An expression that tells us whether the function invocation represented
by FI does not have a frame on the stack associated with it. */
/* A macro that tells us whether the function invocation represented
by FI does not have a frame on the stack associated with it. If it
does not, FRAMELESS is set to 1, else 0. */
/* We handle this differently for alpha, and maybe we should not */
#define FRAMELESS_FUNCTION_INVOCATION(FI) (0)
#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) {(FRAMELESS) = 0;}
/* Saved Pc. */
#define FRAME_SAVED_PC(FRAME) (alpha_frame_saved_pc(FRAME))
extern CORE_ADDR
alpha_frame_saved_pc PARAMS ((struct frame_info *));
alpha_frame_saved_pc PARAMS ((struct frame_info *));
/* The alpha has two different virtual pointers for arguments and locals.
@@ -288,7 +286,7 @@ extern CORE_ADDR
/* Return number of args passed to a frame.
Can return -1, meaning no way to tell. */
#define FRAME_NUM_ARGS(fi) (-1)
#define FRAME_NUM_ARGS(num, fi) ((num) = -1)
/* Return number of bytes at start of arglist that are not really args. */
@@ -308,14 +306,14 @@ extern void alpha_find_saved_regs PARAMS ((struct frame_info *));
alpha_find_saved_regs (frame_info); \
(frame_info)->saved_regs[SP_REGNUM] = (frame_info)->frame; \
} while (0)
/* Things needed for making the inferior call functions. */
#define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \
(alpha_push_arguments((nargs), (args), (sp), (struct_return), (struct_addr)))
sp = alpha_push_arguments((nargs), (args), (sp), (struct_return), (struct_addr))
extern CORE_ADDR
alpha_push_arguments PARAMS ((int, struct value **, CORE_ADDR, int, CORE_ADDR));
alpha_push_arguments PARAMS ((int, struct value **, CORE_ADDR, int, CORE_ADDR));
/* Push an empty stack frame, to record the current PC, etc. */
@@ -368,7 +366,7 @@ extern CORE_ADDR alpha_call_dummy_address PARAMS ((void));
/* There's a mess in stack frame creation. See comments in blockframe.c
near reference to INIT_FRAME_PC_FIRST. */
#define INIT_FRAME_PC(fromleaf, prev) /* nada */
#define INIT_FRAME_PC(fromleaf, prev) /* nada */
#define INIT_FRAME_PC_FIRST(fromleaf, prev) \
(prev)->pc = ((fromleaf) ? SAVED_PC_AFTER_CALL ((prev)->next) : \
@@ -384,12 +382,10 @@ extern void ecoff_relocate_efi PARAMS ((struct symbol *, CORE_ADDR));
This overlays the ALPHA's PDR records,
alpharead.c (ab)uses this to save memory */
typedef struct alpha_extra_func_info
{
long numargs; /* number of args to procedure (was iopt) */
PDR pdr; /* Procedure descriptor record */
}
*alpha_extra_func_info_t;
typedef struct alpha_extra_func_info {
long numargs; /* number of args to procedure (was iopt) */
PDR pdr; /* Procedure descriptor record */
} *alpha_extra_func_info_t;
/* Define the extra_func_info that mipsread.c needs.
FIXME: We should define our own PDR interface, perhaps in a separate

View File

@@ -2,22 +2,21 @@
definitions here are used when the _target_ system is running Linux.
Copyright 1996 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef TM_LINUXALPHA_H
#define TM_LINUXALPHA_H

View File

@@ -1,22 +1,21 @@
/* Host definitions for GDB running on an Alpha under Linux
Copyright (C) 1996 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#if !defined (HOST_BYTE_ORDER)
#define HOST_BYTE_ORDER LITTLE_ENDIAN

View File

@@ -1,22 +1,21 @@
/* Host definitions for GDB running on an alpha under OSF/1
Copyright (C) 1992, 1993 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#if !defined (HOST_BYTE_ORDER)
#define HOST_BYTE_ORDER LITTLE_ENDIAN

View File

@@ -2,22 +2,21 @@
Copyright (C) 1995 Free Software Foundation, Inc.
Contributed by Cygnus Support.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Used by arc-tdep.c to set the default cpu type. */
#define DEFAULT_ARC_CPU_TYPE "base"
@@ -38,9 +37,11 @@
knows that the function has a frame. Its result is equal
to its input PC if the function is frameless, unequal otherwise. */
#define SKIP_PROLOGUE(pc) (arc_skip_prologue (pc, 0))
#define SKIP_PROLOGUE_FRAMELESS_P(pc) (arc_skip_prologue (pc, 1))
extern CORE_ADDR arc_skip_prologue PARAMS ((CORE_ADDR, int));
#define SKIP_PROLOGUE(pc) \
{ pc = skip_prologue (pc, 0); }
#define SKIP_PROLOGUE_FRAMELESS_P(pc) \
{ pc = skip_prologue (pc, 1); }
extern CORE_ADDR skip_prologue PARAMS ((CORE_ADDR, int));
/* Sequence of bytes for breakpoint instruction.
??? The current value is "sr -1,[-1]" and is for the simulator only.
@@ -117,15 +118,15 @@ extern void arc_software_single_step PARAMS ((unsigned int, int));
/* Register numbers of various important registers (used to index
into arrays of register names and register values). */
#define R0_REGNUM 0 /* First local register */
#define R59_REGNUM 59 /* Last local register */
#define FP_REGNUM 27 /* Contains address of executing stack frame */
#define SP_REGNUM 28 /* stack pointer */
#define BLINK_REGNUM 31 /* link register */
#define STA_REGNUM 61 /* processor status word */
#define PC_REGNUM 91 /* instruction pointer */
#define AUX_BEG_REGNUM 61 /* aux reg begins */
#define AUX_END_REGNUM 90 /* aux reg ends, pc not real aux reg */
#define R0_REGNUM 0 /* First local register */
#define R59_REGNUM 59 /* Last local register */
#define FP_REGNUM 27 /* Contains address of executing stack frame */
#define SP_REGNUM 28 /* stack pointer */
#define BLINK_REGNUM 31 /* link register */
#define STA_REGNUM 61 /* processor status word */
#define PC_REGNUM 91 /* instruction pointer */
#define AUX_BEG_REGNUM 61 /* aux reg begins */
#define AUX_END_REGNUM 90 /* aux reg ends, pc not real aux reg */
/* Fake registers used to mark immediate data. */
#define SHIMM_FLAG_REGNUM 61
@@ -159,8 +160,8 @@ extern void arc_software_single_step PARAMS ((unsigned int, int));
0 \
} \
}
#define PFP_REGNUM R0_REGNUM /* Previous frame pointer */
#define PFP_REGNUM R0_REGNUM /* Previous frame pointer */
/* Total amount of space needed to store our copies of the machine's
register state, the array `registers'. */
@@ -185,8 +186,8 @@ extern void arc_software_single_step PARAMS ((unsigned int, int));
/* Return the GDB type object for the "standard" data type
of data in register N. */
#define REGISTER_VIRTUAL_TYPE(N) (builtin_type_int)
/* Macros for understanding function return values... */
/* Does the specified function use the "struct returning" convention
@@ -208,7 +209,7 @@ extern void arc_software_single_step PARAMS ((unsigned int, int));
a function return value of type TYPE, and copy that, in virtual format,
into VALBUF. This is only called if USE_STRUCT_CONVENTION for this
type is 0.
*/
*/
#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
memcpy(VALBUF, REGBUF+REGISTER_BYTE(R0_REGNUM), TYPE_LENGTH (TYPE))
@@ -229,8 +230,8 @@ extern void arc_software_single_step PARAMS ((unsigned int, int));
subroutine will return. This is called from call_function. */
#define STORE_STRUCT_RETURN(ADDR, SP) \
error ("Returning values from functions is not implemented in arc gdb")
/* Describe the pointer in each stack frame to the previous stack frame
(its caller). */
@@ -266,17 +267,23 @@ extern void arc_software_single_step PARAMS ((unsigned int, int));
and has no caller. */
#define FRAME_CHAIN_VALID(chain, thisframe) nonnull_frame_chain_valid (chain, thisframe)
/* An expression that tells us whether the function invocation represented
by FI does not have a frame on the stack associated with it. */
/* A macro that tells us whether the function invocation represented
by FI does not have a frame on the stack associated with it. If it
does not, FRAMELESS is set to 1, else 0. */
#define FRAMELESS_FUNCTION_INVOCATION(FI) \
(((FI)->signal_handler_caller) ? 0 : frameless_look_for_prologue (FI))
#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
do { \
if ((FI)->signal_handler_caller) \
(FRAMELESS) = 0; \
else \
(FRAMELESS) = frameless_look_for_prologue (FI); \
} while (0)
/* Where is the PC for a specific frame.
A leaf function may never save blink, so we have to check for that here. */
#define FRAME_SAVED_PC(frame) (arc_frame_saved_pc (frame))
struct frame_info; /* in case frame.h not included yet */
struct frame_info; /* in case frame.h not included yet */
CORE_ADDR arc_frame_saved_pc PARAMS ((struct frame_info *));
/* If the argument is on the stack, it will be here.
@@ -295,7 +302,7 @@ CORE_ADDR arc_frame_saved_pc PARAMS ((struct frame_info *));
/* Set NUMARGS to the number of args passed to a frame.
Can return -1, meaning no way to tell. */
#define FRAME_NUM_ARGS(fi) (-1)
#define FRAME_NUM_ARGS(numargs, fi) (numargs = -1)
/* Return number of bytes at start of arglist that are not really args. */
@@ -305,9 +312,9 @@ CORE_ADDR arc_frame_saved_pc PARAMS ((struct frame_info *));
#define FRAME_FIND_SAVED_REGS(frame_info_addr, sr) \
frame_find_saved_regs (frame_info_addr, &sr)
extern void frame_find_saved_regs (); /* See arc-tdep.c */
extern void frame_find_saved_regs(); /* See arc-tdep.c */
/* Things needed for making calls to functions in the inferior process */
#define PUSH_DUMMY_FRAME \
push_dummy_frame ()
@@ -317,14 +324,14 @@ extern void frame_find_saved_regs (); /* See arc-tdep.c */
pop_frame ()
/* This sequence of words is the instructions bl xxxx, flag 1 */
#define CALL_DUMMY { 0x28000000, 0x1fbe8001 }
#define CALL_DUMMY { 0x28000000, 0x1fbe8001 }
#define CALL_DUMMY_LENGTH 8
/* Start execution at beginning of dummy */
#define CALL_DUMMY_START_OFFSET 0
#define CALL_DUMMY_START_OFFSET 0
/* Insert the specified number of args and function address
into a call sequence of the above form stored at 'dummyname'. */
into a call sequence of the above form stored at 'dummyname'.*/
#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
{ \
int from, to, delta, loc; \
@@ -337,3 +344,4 @@ extern void frame_find_saved_regs (); /* See arc-tdep.c */
*((char *)(dummyname) + 3) = ((delta >> 9) & 0xff); \
*((char *)(dummyname) + 4) = ((delta >> 17) & 0x7); \
}

View File

@@ -1,5 +1,5 @@
# Target: Acorn RISC machine (ARM) with simulator
TDEPFILES= arm-tdep.o remote-rdp.o remote-rdi.o rdi-share/libangsd.a
TDEPFILES= arm-tdep.o remote-rdp.o
TM_FILE= tm-arm.h
SIM_OBS = remote-sim.o

View File

@@ -1,22 +1,21 @@
/* Definitions to make GDB run on an ARM under RISCiX (4.3bsd).
Copyright (C) 1986, 1987, 1989 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* This is the amount to subtract from u.u_ar0
to get the offset in the core file of the register values. */

View File

@@ -1,24 +1,23 @@
/* Definitions to make GDB target for an ARM
Copyright 1986-1989, 1991, 1993-1999 Free Software Foundation, Inc.
Copyright 1986, 1987, 1989, 1991, 1993, 1997, 1998 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifdef __STDC__ /* Forward decls for prototypes */
#ifdef __STDC__ /* Forward decls for prototypes */
struct type;
struct value;
#endif
@@ -57,7 +56,7 @@ CORE_ADDR arm_addr_bits_remove PARAMS ((CORE_ADDR));
extern CORE_ADDR arm_skip_prologue PARAMS ((CORE_ADDR pc));
#define SKIP_PROLOGUE(pc) (arm_skip_prologue (pc))
#define SKIP_PROLOGUE(pc) { pc = arm_skip_prologue (pc); }
/* Immediately after a function call, return the saved pc.
Can't always go through the frames for this because on some machines
@@ -200,7 +199,7 @@ extern char **arm_register_names;
/* Largest value REGISTER_RAW_SIZE can have. */
#define MAX_REGISTER_RAW_SIZE 12
#define MAX_REGISTER_RAW_SIZE 12
/* Largest value REGISTER_VIRTUAL_SIZE can have. */
@@ -269,15 +268,14 @@ extern use_struct_convention_fn arm_use_struct_convention;
the address in which a function should return its structure value,
as a CORE_ADDR (or an expression that can be used as one). */
#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
(extract_address ((PTR) (REGBUF), REGISTER_RAW_SIZE(0)))
#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (*(int *)(REGBUF))
/* Specify that for the native compiler variables for a particular
lexical context are listed after the beginning LBRAC instead of
before in the executables list of symbols. */
#define VARIABLES_INSIDE_BLOCK(desc, gcc_p) (!(gcc_p))
/* Define other aspects of the stack frame.
We keep the offsets of all saved registers, 'cause we need 'em a lot!
We also keep the current size of the stack frame, and the offset of
@@ -290,10 +288,8 @@ extern use_struct_convention_fn arm_use_struct_convention;
int frameoffset; \
int framereg;
extern void arm_init_extra_frame_info PARAMS ((int fromleaf,
struct frame_info *fi));
#define INIT_EXTRA_FRAME_INFO(fromleaf, fi) \
arm_init_extra_frame_info (fromleaf, fi)
extern void arm_init_extra_frame_info PARAMS ((struct frame_info *fi));
#define INIT_EXTRA_FRAME_INFO(fromleaf, fi) arm_init_extra_frame_info (fi)
/* Return the frame address. On ARM, it is R11; on Thumb it is R7. */
CORE_ADDR arm_target_read_fp PARAMS ((void));
@@ -318,23 +314,17 @@ extern int arm_frame_chain_valid PARAMS ((CORE_ADDR, struct frame_info *));
/* A macro that tells us whether the function invocation represented
by FI does not have a frame on the stack associated with it. If it
does not, FRAMELESS is set to 1, else 0.
does not, FRAMELESS is set to 1, else 0. */
#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
{ \
CORE_ADDR func_start, after_prologue; \
func_start = (get_pc_function_start ((FI)->pc) + \
FUNCTION_START_OFFSET); \
after_prologue = func_start; \
SKIP_PROLOGUE (after_prologue); \
(FRAMELESS) = (after_prologue == func_start); \
}
Sometimes we have functions that do a little setup (like saving the vN
registers with the stmdb instruction, but DO NOT set up a frame.
The symbol table will report this as a prologue. However, it is
important not to try to parse these partial frames as frames, or we
will get really confused.
So I will demand 3 instructions between the start & end of the prologue
before I call it a real prologue, i.e. at least
mov ip, sp,
stmdb sp!, {}
sub sp, ip, #4. */
#define FRAMELESS_FUNCTION_INVOCATION(FI) \
(arm_frameless_function_invocation (FI))
/* Saved Pc. */
#define FRAME_SAVED_PC(FRAME) arm_frame_saved_pc (FRAME)
@@ -347,7 +337,7 @@ extern CORE_ADDR arm_frame_saved_pc PARAMS ((struct frame_info *));
/* Return number of args passed to a frame.
Can return -1, meaning no way to tell. */
#define FRAME_NUM_ARGS(fi) (-1)
#define FRAME_NUM_ARGS(numargs, fi) (numargs = -1)
/* Return number of bytes at start of arglist that are not really args. */
@@ -361,18 +351,19 @@ extern CORE_ADDR arm_frame_saved_pc PARAMS ((struct frame_info *));
struct frame_saved_regs;
struct frame_info;
void frame_find_saved_regs PARAMS ((struct frame_info * fi,
struct frame_saved_regs * fsr));
void frame_find_saved_regs PARAMS((struct frame_info *fi,
struct frame_saved_regs *fsr));
#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
arm_frame_find_saved_regs (frame_info, &(frame_saved_regs));
/* Things needed for making the inferior call functions. */
#define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \
(arm_push_arguments ((nargs), (args), (sp), (struct_return), (struct_addr)))
extern CORE_ADDR arm_push_arguments PARAMS ((int, struct value **, CORE_ADDR, int, CORE_ADDR));
sp = arm_push_arguments ((nargs), (args), (sp), (struct_return), (struct_addr))
extern CORE_ADDR
arm_push_arguments PARAMS ((int, struct value **, CORE_ADDR, int, CORE_ADDR));
/* Push an empty stack frame, to record the current PC, etc. */
@@ -388,15 +379,15 @@ void arm_pop_frame PARAMS ((void));
/* This sequence of words is the instructions
mov lr,pc
mov pc,r4
illegal
mov lr,pc
mov pc,r4
illegal
Note this is 12 bytes. */
#define CALL_DUMMY {0xe1a0e00f, 0xe1a0f004, 0xE7FFDEFE}
#define CALL_DUMMY_START_OFFSET 0 /* Start execution at beginning of dummy */
#define CALL_DUMMY_START_OFFSET 0 /* Start execution at beginning of dummy */
#define CALL_DUMMY_BREAKPOINT_OFFSET arm_call_dummy_breakpoint_offset()
extern int arm_call_dummy_breakpoint_offset PARAMS ((void));
@@ -408,15 +399,15 @@ extern int arm_call_dummy_breakpoint_offset PARAMS ((void));
arm_fix_call_dummy (dummyname, pc, fun, nargs, args, type, gcc_p)
void arm_fix_call_dummy PARAMS ((char *dummy, CORE_ADDR pc, CORE_ADDR fun,
int nargs, struct value ** args,
struct type * type, int gcc_p));
int nargs, struct value **args,
struct type *type, int gcc_p));
CORE_ADDR arm_get_next_pc PARAMS ((CORE_ADDR));
/* Functions for dealing with Thumb call thunks. */
#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) arm_in_call_stub (pc, name)
#define SKIP_TRAMPOLINE_CODE(pc) arm_skip_stub (pc)
extern int arm_in_call_stub PARAMS ((CORE_ADDR pc, char *name));
extern int arm_in_call_stub PARAMS ((CORE_ADDR pc, char *name));
extern CORE_ADDR arm_skip_stub PARAMS ((CORE_ADDR pc));
/* Function to determine whether MEMADDR is in a Thumb function. */
@@ -431,18 +422,18 @@ extern int arm_pc_is_thumb_dummy PARAMS ((bfd_vma memaddr));
"info" field is used for this purpose. This field is already
being used to store the symbol size, so the assumption is
that the symbol size cannot exceed 2^31.
COFF_MAKE_MSYMBOL_SPECIAL
ELF_MAKE_MSYMBOL_SPECIAL tests whether the COFF or ELF symbol corresponds
to a thumb function, and sets a "special" bit in a
minimal symbol to indicate that it does
MSYMBOL_SET_SPECIAL actually sets the "special" bit
ELF_MAKE_MSYMBOL_SPECIAL tests whether the COFF or ELF symbol corresponds
to a thumb function, and sets a "special" bit in a
minimal symbol to indicate that it does
MSYMBOL_SET_SPECIAL actually sets the "special" bit
MSYMBOL_IS_SPECIAL tests the "special" bit in a minimal symbol
MSYMBOL_SIZE returns the size of the minimal symbol, i.e.
the "info" field with the "special" bit masked out
*/
extern int coff_sym_is_thumb (int val);
the "info" field with the "special" bit masked out
*/
extern int coff_sym_is_thumb(int val);
#define MSYMBOL_SET_SPECIAL(msym) \
MSYMBOL_INFO (msym) = (char *) (((long) MSYMBOL_INFO (msym)) | 0x80000000)
#define MSYMBOL_IS_SPECIAL(msym) \
@@ -454,7 +445,7 @@ extern int coff_sym_is_thumb (int val);
#define ELF_MAKE_MSYMBOL_SPECIAL(sym,msym) \
{ if(ELF_ST_TYPE(((elf_symbol_type *)(sym))->internal_elf_sym.st_info) == STT_LOPROC) \
MSYMBOL_SET_SPECIAL(msym); }
#define COFF_MAKE_MSYMBOL_SPECIAL(val,msym) \
{ if(coff_sym_is_thumb(val)) MSYMBOL_SET_SPECIAL(msym); }

View File

@@ -1,26 +1,25 @@
/* Definitions to make GDB run on an ARM under RISCiX (4.3bsd).
Copyright (C) 1986, 1987, 1989 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define HOST_BYTE_ORDER LITTLE_ENDIAN
#if 0
/* Interface definitions for kernel debugger KDB. */

View File

@@ -1,164 +1,163 @@
@c OBSOLETE
@c OBSOLETE @node Convex,,, Top
@c OBSOLETE @appendix Convex-specific info
@c OBSOLETE @cindex Convex notes
@c OBSOLETE
@c OBSOLETE Scalar registers are 64 bits long, which is a pain since
@c OBSOLETE left half of an S register frequently contains noise.
@c OBSOLETE Therefore there are two ways to obtain the value of an S register.
@c OBSOLETE
@c OBSOLETE @table @kbd
@c OBSOLETE @item $s0
@c OBSOLETE returns the low half of the register as an int
@c OBSOLETE
@c OBSOLETE @item $S0
@c OBSOLETE returns the whole register as a long long
@c OBSOLETE @end table
@c OBSOLETE
@c OBSOLETE You can print the value in floating point by using @samp{p/f $s0} or @samp{p/f $S0}
@c OBSOLETE to print a single or double precision value.
@c OBSOLETE
@c OBSOLETE @cindex vector registers
@c OBSOLETE Vector registers are handled similarly, with @samp{$V0} denoting the whole
@c OBSOLETE 64-bit register and @kbd{$v0} denoting the 32-bit low half; @samp{p/f $v0}
@c OBSOLETE or @samp{p/f $V0} can be used to examine the register in floating point.
@c OBSOLETE The length of the vector registers is taken from @samp{$vl}.
@c OBSOLETE
@c OBSOLETE Individual elements of a vector register are denoted in the obvious way;
@c OBSOLETE @samp{print $v3[9]} prints the tenth element of register @kbd{v3}, and
@c OBSOLETE @samp{set $v3[9] = 1234} alters it.
@c OBSOLETE
@c OBSOLETE @kbd{$vl} and @kbd{$vs} are int, and @kbd{$vm} is an int vector.
@c OBSOLETE Elements of @kbd{$vm} can't be assigned to.
@c OBSOLETE
@c OBSOLETE @cindex communication registers
@c OBSOLETE @kindex info comm-registers
@c OBSOLETE Communication registers have names @kbd{$C0 .. $C63}, with @kbd{$c0 .. $c63}
@c OBSOLETE denoting the low-order halves. @samp{info comm-registers} will print them
@c OBSOLETE all out, and tell which are locked. (A communication register is
@c OBSOLETE locked when a value is sent to it, and unlocked when the value is
@c OBSOLETE received.) Communication registers are, of course, global to all
@c OBSOLETE threads, so it does not matter what the currently selected thread is.
@c OBSOLETE @samp{info comm-reg @var{name}} prints just that one communication
@c OBSOLETE register; @samp{name} may also be a communication register number
@c OBSOLETE @samp{nn} or @samp{0xnn}.
@c OBSOLETE @samp{info comm-reg @var{address}} prints the contents of the resource
@c OBSOLETE structure at that address.
@c OBSOLETE
@c OBSOLETE @kindex info psw
@c OBSOLETE The command @samp{info psw} prints the processor status word @kbd{$ps}
@c OBSOLETE bit by bit.
@c OBSOLETE
@c OBSOLETE @kindex set base
@c OBSOLETE GDB normally prints all integers in base 10, but the leading
@c OBSOLETE @kbd{0x80000000} of pointers is intolerable in decimal, so the default
@c OBSOLETE output radix has been changed to try to print addresses appropriately.
@c OBSOLETE The @samp{set base} command can be used to change this.
@c OBSOLETE
@c OBSOLETE @table @code
@c OBSOLETE @item set base 10
@c OBSOLETE Integer values always print in decimal.
@c OBSOLETE
@c OBSOLETE @item set base 16
@c OBSOLETE Integer values always print in hex.
@c OBSOLETE
@c OBSOLETE @item set base
@c OBSOLETE Go back to the initial state, which prints integer values in hex if they
@c OBSOLETE look like pointers (specifically, if they start with 0x8 or 0xf in the
@c OBSOLETE stack), otherwise in decimal.
@c OBSOLETE @end table
@c OBSOLETE
@c OBSOLETE @kindex set pipeline
@c OBSOLETE When an exception such as a bus error or overflow happens, usually the PC
@c OBSOLETE is several instructions ahead by the time the exception is detected.
@c OBSOLETE The @samp{set pipe} command will disable this.
@c OBSOLETE
@c OBSOLETE @table @code
@c OBSOLETE @item set pipeline off
@c OBSOLETE Forces serial execution of instructions; no vector chaining and no
@c OBSOLETE scalar instruction overlap. With this, exceptions are detected with
@c OBSOLETE the PC pointing to the instruction after the one in error.
@c OBSOLETE
@c OBSOLETE @item set pipeline on
@c OBSOLETE Returns to normal, fast, execution. This is the default.
@c OBSOLETE @end table
@c OBSOLETE
@c OBSOLETE @cindex parallel
@c OBSOLETE In a parallel program, multiple threads may be executing, each
@c OBSOLETE with its own registers, stack, and local memory. When one of them
@c OBSOLETE hits a breakpoint, that thread is selected. Other threads do
@c OBSOLETE not run while the thread is in the breakpoint.
@c OBSOLETE
@c OBSOLETE @kindex 1cont
@c OBSOLETE The selected thread can be single-stepped, given signals, and so
@c OBSOLETE on. Any other threads remain stopped. When a @samp{cont} command is given,
@c OBSOLETE all threads are resumed. To resume just the selected thread, use
@c OBSOLETE the command @samp{1cont}.
@c OBSOLETE
@c OBSOLETE @kindex thread
@c OBSOLETE The @samp{thread} command will show the active threads and the
@c OBSOLETE instruction they are about to execute. The selected thread is marked
@c OBSOLETE with an asterisk. The command @samp{thread @var{n}} will select thread @var{n},
@c OBSOLETE shifting the debugger's attention to it for single-stepping,
@c OBSOLETE registers, local memory, and so on.
@c OBSOLETE
@c OBSOLETE @kindex info threads
@c OBSOLETE The @samp{info threads} command will show what threads, if any, have
@c OBSOLETE invisibly hit breakpoints or signals and are waiting to be noticed.
@c OBSOLETE
@c OBSOLETE @kindex set parallel
@c OBSOLETE The @samp{set parallel} command controls how many threads can be active.
@c OBSOLETE
@c OBSOLETE @table @code
@c OBSOLETE @item set parallel off
@c OBSOLETE One thread. Requests by the program that other threads join in
@c OBSOLETE (spawn and pfork instructions) do not cause other threads to start up.
@c OBSOLETE This does the same thing as the @samp{limit concurrency 1} command.
@c OBSOLETE
@c OBSOLETE @item set parallel fixed
@c OBSOLETE All CPUs are assigned to your program whenever it runs. When it
@c OBSOLETE executes a pfork or spawn instruction, it begins parallel execution
@c OBSOLETE immediately. This does the same thing as the @samp{mpa -f} command.
@c OBSOLETE
@c OBSOLETE @item set parallel on
@c OBSOLETE One or more threads. Spawn and pfork cause CPUs to join in when and if
@c OBSOLETE they are free. This is the default. It is very good for system
@c OBSOLETE throughput, but not very good for finding bugs in parallel code. If you
@c OBSOLETE suspect a bug in parallel code, you probably want @samp{set parallel fixed.}
@c OBSOLETE @end table
@c OBSOLETE
@c OBSOLETE @subsection Limitations
@c OBSOLETE
@c OBSOLETE WARNING: Convex GDB evaluates expressions in long long, because S
@c OBSOLETE registers are 64 bits long. However, GDB expression semantics are not
@c OBSOLETE exactly C semantics. This is a bug, strictly speaking, but it's not one I
@c OBSOLETE know how to fix. If @samp{x} is a program variable of type int, then it
@c OBSOLETE is also type int to GDB, but @samp{x + 1} is long long, as is @samp{x + y}
@c OBSOLETE or any other expression requiring computation. So is the expression
@c OBSOLETE @samp{1}, or any other constant. You only really have to watch out for
@c OBSOLETE calls. The innocuous expression @samp{list_node (0x80001234)} has an
@c OBSOLETE argument of type long long. You must explicitly cast it to int.
@c OBSOLETE
@c OBSOLETE It is not possible to continue after an uncaught fatal signal by using
@c OBSOLETE @samp{signal 0}, @samp{return}, @samp{jump}, or anything else. The difficulty is with
@c OBSOLETE Unix, not GDB.
@c OBSOLETE
@c OBSOLETE I have made no big effort to make such things as single-stepping a
@c OBSOLETE @kbd{join} instruction do something reasonable. If the program seems to
@c OBSOLETE hang when doing this, type @kbd{ctrl-c} and @samp{cont}, or use
@c OBSOLETE @samp{thread} to shift to a live thread. Single-stepping a @kbd{spawn}
@c OBSOLETE instruction apparently causes new threads to be born with their T bit set;
@c OBSOLETE this is not handled gracefully. When a thread has hit a breakpoint, other
@c OBSOLETE threads may have invisibly hit the breakpoint in the background; if you
@c OBSOLETE clear the breakpoint gdb will be surprised when threads seem to continue
@c OBSOLETE to stop at it. All of these situations produce spurious signal 5 traps;
@c OBSOLETE if this happens, just type @samp{cont}. If it becomes a nuisance, use
@c OBSOLETE @samp{handle 5 nostop}. (It will ask if you are sure. You are.)
@c OBSOLETE
@c OBSOLETE There is no way in GDB to store a float in a register, as with
@c OBSOLETE @kbd{set $s0 = 3.1416}. The identifier @kbd{$s0} denotes an integer,
@c OBSOLETE and like any C expression which assigns to an integer variable, the
@c OBSOLETE right-hand side is casted to type int. If you should need to do
@c OBSOLETE something like this, you can assign the value to @kbd{@{float@} ($sp-4)}
@c OBSOLETE and then do @kbd{set $s0 = $sp[-4]}. Same deal with @kbd{set $v0[69] = 6.9}.
@node Convex,,, Top
@appendix Convex-specific info
@cindex Convex notes
Scalar registers are 64 bits long, which is a pain since
left half of an S register frequently contains noise.
Therefore there are two ways to obtain the value of an S register.
@table @kbd
@item $s0
returns the low half of the register as an int
@item $S0
returns the whole register as a long long
@end table
You can print the value in floating point by using @samp{p/f $s0} or @samp{p/f $S0}
to print a single or double precision value.
@cindex vector registers
Vector registers are handled similarly, with @samp{$V0} denoting the whole
64-bit register and @kbd{$v0} denoting the 32-bit low half; @samp{p/f $v0}
or @samp{p/f $V0} can be used to examine the register in floating point.
The length of the vector registers is taken from @samp{$vl}.
Individual elements of a vector register are denoted in the obvious way;
@samp{print $v3[9]} prints the tenth element of register @kbd{v3}, and
@samp{set $v3[9] = 1234} alters it.
@kbd{$vl} and @kbd{$vs} are int, and @kbd{$vm} is an int vector.
Elements of @kbd{$vm} can't be assigned to.
@cindex communication registers
@kindex info comm-registers
Communication registers have names @kbd{$C0 .. $C63}, with @kbd{$c0 .. $c63}
denoting the low-order halves. @samp{info comm-registers} will print them
all out, and tell which are locked. (A communication register is
locked when a value is sent to it, and unlocked when the value is
received.) Communication registers are, of course, global to all
threads, so it does not matter what the currently selected thread is.
@samp{info comm-reg @var{name}} prints just that one communication
register; @samp{name} may also be a communication register number
@samp{nn} or @samp{0xnn}.
@samp{info comm-reg @var{address}} prints the contents of the resource
structure at that address.
@kindex info psw
The command @samp{info psw} prints the processor status word @kbd{$ps}
bit by bit.
@kindex set base
GDB normally prints all integers in base 10, but the leading
@kbd{0x80000000} of pointers is intolerable in decimal, so the default
output radix has been changed to try to print addresses appropriately.
The @samp{set base} command can be used to change this.
@table @code
@item set base 10
Integer values always print in decimal.
@item set base 16
Integer values always print in hex.
@item set base
Go back to the initial state, which prints integer values in hex if they
look like pointers (specifically, if they start with 0x8 or 0xf in the
stack), otherwise in decimal.
@end table
@kindex set pipeline
When an exception such as a bus error or overflow happens, usually the PC
is several instructions ahead by the time the exception is detected.
The @samp{set pipe} command will disable this.
@table @code
@item set pipeline off
Forces serial execution of instructions; no vector chaining and no
scalar instruction overlap. With this, exceptions are detected with
the PC pointing to the instruction after the one in error.
@item set pipeline on
Returns to normal, fast, execution. This is the default.
@end table
@cindex parallel
In a parallel program, multiple threads may be executing, each
with its own registers, stack, and local memory. When one of them
hits a breakpoint, that thread is selected. Other threads do
not run while the thread is in the breakpoint.
@kindex 1cont
The selected thread can be single-stepped, given signals, and so
on. Any other threads remain stopped. When a @samp{cont} command is given,
all threads are resumed. To resume just the selected thread, use
the command @samp{1cont}.
@kindex thread
The @samp{thread} command will show the active threads and the
instruction they are about to execute. The selected thread is marked
with an asterisk. The command @samp{thread @var{n}} will select thread @var{n},
shifting the debugger's attention to it for single-stepping,
registers, local memory, and so on.
@kindex info threads
The @samp{info threads} command will show what threads, if any, have
invisibly hit breakpoints or signals and are waiting to be noticed.
@kindex set parallel
The @samp{set parallel} command controls how many threads can be active.
@table @code
@item set parallel off
One thread. Requests by the program that other threads join in
(spawn and pfork instructions) do not cause other threads to start up.
This does the same thing as the @samp{limit concurrency 1} command.
@item set parallel fixed
All CPUs are assigned to your program whenever it runs. When it
executes a pfork or spawn instruction, it begins parallel execution
immediately. This does the same thing as the @samp{mpa -f} command.
@item set parallel on
One or more threads. Spawn and pfork cause CPUs to join in when and if
they are free. This is the default. It is very good for system
throughput, but not very good for finding bugs in parallel code. If you
suspect a bug in parallel code, you probably want @samp{set parallel fixed.}
@end table
@subsection Limitations
WARNING: Convex GDB evaluates expressions in long long, because S
registers are 64 bits long. However, GDB expression semantics are not
exactly C semantics. This is a bug, strictly speaking, but it's not one I
know how to fix. If @samp{x} is a program variable of type int, then it
is also type int to GDB, but @samp{x + 1} is long long, as is @samp{x + y}
or any other expression requiring computation. So is the expression
@samp{1}, or any other constant. You only really have to watch out for
calls. The innocuous expression @samp{list_node (0x80001234)} has an
argument of type long long. You must explicitly cast it to int.
It is not possible to continue after an uncaught fatal signal by using
@samp{signal 0}, @samp{return}, @samp{jump}, or anything else. The difficulty is with
Unix, not GDB.
I have made no big effort to make such things as single-stepping a
@kbd{join} instruction do something reasonable. If the program seems to
hang when doing this, type @kbd{ctrl-c} and @samp{cont}, or use
@samp{thread} to shift to a live thread. Single-stepping a @kbd{spawn}
instruction apparently causes new threads to be born with their T bit set;
this is not handled gracefully. When a thread has hit a breakpoint, other
threads may have invisibly hit the breakpoint in the background; if you
clear the breakpoint gdb will be surprised when threads seem to continue
to stop at it. All of these situations produce spurious signal 5 traps;
if this happens, just type @samp{cont}. If it becomes a nuisance, use
@samp{handle 5 nostop}. (It will ask if you are sure. You are.)
There is no way in GDB to store a float in a register, as with
@kbd{set $s0 = 3.1416}. The identifier @kbd{$s0} denotes an integer,
and like any C expression which assigns to an integer variable, the
right-hand side is casted to type int. If you should need to do
something like this, you can assign the value to @kbd{@{float@} ($sp-4)}
and then do @kbd{set $s0 = $sp[-4]}. Same deal with @kbd{set $v0[69] = 6.9}.

View File

@@ -1,3 +1,3 @@
# OBSOLETE # Host: Convex Unix (4bsd)
# OBSOLETE XDEPFILES= convex-xdep.o
# OBSOLETE XM_FILE= xm-convex.h
# Host: Convex Unix (4bsd)
XDEPFILES= convex-xdep.o
XM_FILE= xm-convex.h

View File

@@ -1,3 +1,3 @@
# OBSOLETE # Target: Convex Unix (4bsd)
# OBSOLETE TDEPFILES= convex-tdep.o
# OBSOLETE TM_FILE= tm-convex.h
# Target: Convex Unix (4bsd)
TDEPFILES= convex-tdep.o
TM_FILE= tm-convex.h

View File

@@ -1,486 +1,511 @@
/* OBSOLETE /* Definitions to make GDB run on Convex Unix (4bsd) */
/* OBSOLETE Copyright 1989, 1991, 1993 Free Software Foundation, Inc. */
/* OBSOLETE */
/* OBSOLETE This file is part of GDB. */
/* OBSOLETE */
/* OBSOLETE This program is free software; you can redistribute it and/or modify */
/* OBSOLETE it under the terms of the GNU General Public License as published by */
/* OBSOLETE the Free Software Foundation; either version 2 of the License, or */
/* OBSOLETE (at your option) any later version. */
/* OBSOLETE */
/* OBSOLETE This program is distributed in the hope that it will be useful, */
/* OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* OBSOLETE GNU General Public License for more details. */
/* OBSOLETE */
/* OBSOLETE You should have received a copy of the GNU General Public License */
/* OBSOLETE along with this program; if not, write to the Free Software */
/* OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *x/ */
/* OBSOLETE */
/* OBSOLETE #define TARGET_BYTE_ORDER BIG_ENDIAN */
/* OBSOLETE */
/* OBSOLETE /* There is come problem with the debugging symbols generated by the */
/* OBSOLETE compiler such that the debugging symbol for the first line of a */
/* OBSOLETE function overlap with the function prologue. *x/ */
/* OBSOLETE #define PROLOGUE_FIRSTLINE_OVERLAP */
/* OBSOLETE */
/* OBSOLETE /* When convex pcc says CHAR or SHORT, it provides the correct address. *x/ */
/* OBSOLETE */
/* OBSOLETE #define BELIEVE_PCC_PROMOTION 1 */
/* OBSOLETE */
/* OBSOLETE /* Symbol types to ignore. *x/ */
/* OBSOLETE /* 0xc4 is N_MONPT. Use the numeric value for the benefit of people */
/* OBSOLETE with (rather) old OS's. *x/ */
/* OBSOLETE #define IGNORE_SYMBOL(TYPE) \ */
/* OBSOLETE (((TYPE) & ~N_EXT) == N_TBSS \ */
/* OBSOLETE || ((TYPE) & ~N_EXT) == N_TDATA \ */
/* OBSOLETE || ((TYPE) & ~N_EXT) == 0xc4) */
/* OBSOLETE */
/* OBSOLETE /* Offset from address of function to start of its code. */
/* OBSOLETE Zero on most machines. *x/ */
/* OBSOLETE */
/* OBSOLETE #define FUNCTION_START_OFFSET 0 */
/* OBSOLETE */
/* OBSOLETE /* Advance PC across any function entry prologue instructions */
/* OBSOLETE to reach some "real" code. */
/* OBSOLETE Convex prolog is: */
/* OBSOLETE [sub.w #-,sp] in one of 3 possible sizes */
/* OBSOLETE [mov psw,- fc/vc main program prolog */
/* OBSOLETE and #-,- (skip it because the "mov psw" saves the */
/* OBSOLETE mov -,psw] T bit, so continue gets a surprise trap) */
/* OBSOLETE [and #-,sp] fc/vc O2 main program prolog */
/* OBSOLETE [ld.- -(ap),-] pcc/gcc register arg loads */
/* OBSOLETE *x/ */
/* OBSOLETE */
/* OBSOLETE extern CORE_ADDR convex_skip_prologue PARAMS ((CORE_ADDR pc)); */
/* OBSOLETE #define SKIP_PROLOGUE(pc) (convex_skip_prologue (pc)) */
/* OBSOLETE */
/* OBSOLETE /* Immediately after a function call, return the saved pc. */
/* OBSOLETE (ignore frame and return *$sp so we can handle both calls and callq) *x/ */
/* OBSOLETE */
/* OBSOLETE #define SAVED_PC_AFTER_CALL(frame) \ */
/* OBSOLETE read_memory_integer (read_register (SP_REGNUM), 4) */
/* OBSOLETE */
/* OBSOLETE /* Address of end of stack space. */
/* OBSOLETE This is ((USRSTACK + 0xfff) & -0x1000)) from <convex/vmparam.h> but */
/* OBSOLETE that expression depends on the kernel version; instead, fetch a */
/* OBSOLETE page-zero pointer and get it from that. This will be invalid if */
/* OBSOLETE they ever change the way bkpt signals are delivered. *x/ */
/* OBSOLETE */
/* OBSOLETE #define STACK_END_ADDR (0xfffff000 & *(unsigned *) 0x80000050) */
/* OBSOLETE */
/* OBSOLETE /* User-mode traps push an extended rtn block, */
/* OBSOLETE then fault with one of the following PCs *x/ */
/* OBSOLETE */
/* OBSOLETE #define is_trace_pc(pc) ((unsigned) ((pc) - (*(int *) 0x80000040)) <= 4) */
/* OBSOLETE #define is_arith_pc(pc) ((unsigned) ((pc) - (*(int *) 0x80000044)) <= 4) */
/* OBSOLETE #define is_break_pc(pc) ((unsigned) ((pc) - (*(int *) 0x80000050)) <= 4) */
/* OBSOLETE */
/* OBSOLETE /* We need to manipulate trap bits in the psw *x/ */
/* OBSOLETE */
/* OBSOLETE #define PSW_TRAP_FLAGS 0x69670000 */
/* OBSOLETE #define PSW_T_BIT 0x08000000 */
/* OBSOLETE #define PSW_S_BIT 0x01000000 */
/* OBSOLETE */
/* OBSOLETE /* Stack grows downward. *x/ */
/* OBSOLETE */
/* OBSOLETE #define INNER_THAN(lhs,rhs) ((lhs) < (rhs)) */
/* OBSOLETE */
/* OBSOLETE /* Sequence of bytes for breakpoint instruction. (bkpt) *x/ */
/* OBSOLETE */
/* OBSOLETE #define BREAKPOINT {0x7d,0x50} */
/* OBSOLETE */
/* OBSOLETE /* Amount PC must be decremented by after a breakpoint. */
/* OBSOLETE This is often the number of bytes in BREAKPOINT but not always. */
/* OBSOLETE (The break PC needs to be decremented by 2, but we do it when the */
/* OBSOLETE break frame is recognized and popped. That way gdb can tell breaks */
/* OBSOLETE from trace traps with certainty.) *x/ */
/* OBSOLETE */
/* OBSOLETE #define DECR_PC_AFTER_BREAK 0 */
/* OBSOLETE */
/* OBSOLETE /* Say how long (ordinary) registers are. This is a piece of bogosity */
/* OBSOLETE used in push_word and a few other places; REGISTER_RAW_SIZE is the */
/* OBSOLETE real way to know how big a register is. *x/ */
/* OBSOLETE */
/* OBSOLETE #define REGISTER_SIZE 8 */
/* OBSOLETE */
/* OBSOLETE /* Number of machine registers *x/ */
/* OBSOLETE */
/* OBSOLETE #define NUM_REGS 26 */
/* OBSOLETE */
/* OBSOLETE /* Initializer for an array of names of registers. */
/* OBSOLETE There should be NUM_REGS strings in this initializer. *x/ */
/* OBSOLETE */
/* OBSOLETE #define REGISTER_NAMES {"pc","psw","fp","ap","a5","a4","a3","a2","a1","sp",\ */
/* OBSOLETE "s7","s6","s5","s4","s3","s2","s1","s0",\ */
/* OBSOLETE "S7","S6","S5","S4","S3","S2","S1","S0"} */
/* OBSOLETE */
/* OBSOLETE /* Register numbers of various important registers. */
/* OBSOLETE Note that some of these values are "real" register numbers, */
/* OBSOLETE and correspond to the general registers of the machine, */
/* OBSOLETE and some are "phony" register numbers which are too large */
/* OBSOLETE to be actual register numbers as far as the user is concerned */
/* OBSOLETE but do serve to get the desired values when passed to read_register. *x/ */
/* OBSOLETE */
/* OBSOLETE #define S0_REGNUM 25 /* the real S regs *x/ */
/* OBSOLETE #define S7_REGNUM 18 */
/* OBSOLETE #define s0_REGNUM 17 /* low-order halves of S regs *x/ */
/* OBSOLETE #define s7_REGNUM 10 */
/* OBSOLETE #define SP_REGNUM 9 /* A regs *x/ */
/* OBSOLETE #define A1_REGNUM 8 */
/* OBSOLETE #define A5_REGNUM 4 */
/* OBSOLETE #define AP_REGNUM 3 */
/* OBSOLETE #define FP_REGNUM 2 /* Contains address of executing stack frame *x/ */
/* OBSOLETE #define PS_REGNUM 1 /* Contains processor status *x/ */
/* OBSOLETE #define PC_REGNUM 0 /* Contains program counter *x/ */
/* OBSOLETE */
/* OBSOLETE /* convert dbx stab register number (from `r' declaration) to a gdb REGNUM *x/ */
/* OBSOLETE */
/* OBSOLETE #define STAB_REG_TO_REGNUM(value) \ */
/* OBSOLETE ((value) < 8 ? S0_REGNUM - (value) : SP_REGNUM - ((value) - 8)) */
/* OBSOLETE */
/* OBSOLETE /* Vector register numbers, not handled as ordinary regs. */
/* OBSOLETE They are treated as convenience variables whose values are read */
/* OBSOLETE from the inferior when needed. *x/ */
/* OBSOLETE */
/* OBSOLETE #define V0_REGNUM 0 */
/* OBSOLETE #define V7_REGNUM 7 */
/* OBSOLETE #define VM_REGNUM 8 */
/* OBSOLETE #define VS_REGNUM 9 */
/* OBSOLETE #define VL_REGNUM 10 */
/* OBSOLETE */
/* OBSOLETE /* Total amount of space needed to store our copies of the machine's */
/* OBSOLETE register state, the array `registers'. *x/ */
/* OBSOLETE #define REGISTER_BYTES (4*10 + 8*8) */
/* OBSOLETE */
/* OBSOLETE /* Index within `registers' of the first byte of the space for */
/* OBSOLETE register N. */
/* OBSOLETE NB: must match structure of struct syscall_context for correct operation *x/ */
/* OBSOLETE */
/* OBSOLETE #define REGISTER_BYTE(N) ((N) < s7_REGNUM ? 4*(N) : \ */
/* OBSOLETE (N) < S7_REGNUM ? 44 + 8 * ((N)-s7_REGNUM) : \ */
/* OBSOLETE 40 + 8 * ((N)-S7_REGNUM)) */
/* OBSOLETE */
/* OBSOLETE /* Number of bytes of storage in the actual machine representation */
/* OBSOLETE for register N. *x/ */
/* OBSOLETE */
/* OBSOLETE #define REGISTER_RAW_SIZE(N) ((N) < S7_REGNUM ? 4 : 8) */
/* OBSOLETE */
/* OBSOLETE /* Number of bytes of storage in the program's representation */
/* OBSOLETE for register N. *x/ */
/* OBSOLETE */
/* OBSOLETE #define REGISTER_VIRTUAL_SIZE(N) REGISTER_RAW_SIZE(N) */
/* OBSOLETE */
/* OBSOLETE /* Largest value REGISTER_RAW_SIZE can have. *x/ */
/* OBSOLETE */
/* OBSOLETE #define MAX_REGISTER_RAW_SIZE 8 */
/* OBSOLETE */
/* OBSOLETE /* Largest value REGISTER_VIRTUAL_SIZE can have. *x/ */
/* OBSOLETE */
/* OBSOLETE #define MAX_REGISTER_VIRTUAL_SIZE 8 */
/* OBSOLETE */
/* OBSOLETE /* Return the GDB type object for the "standard" data type */
/* OBSOLETE of data in register N. *x/ */
/* OBSOLETE */
/* OBSOLETE #define REGISTER_VIRTUAL_TYPE(N) \ */
/* OBSOLETE ((N) < S7_REGNUM ? builtin_type_int : builtin_type_long_long) */
/* OBSOLETE */
/* OBSOLETE /* Store the address of the place in which to copy the structure the */
/* OBSOLETE subroutine will return. This is called from call_function. *x/ */
/* OBSOLETE */
/* OBSOLETE #define STORE_STRUCT_RETURN(ADDR, SP) \ */
/* OBSOLETE { write_register (A1_REGNUM, (ADDR)); } */
/* OBSOLETE */
/* OBSOLETE /* Extract from an array REGBUF containing the (raw) register state */
/* OBSOLETE a function return value of type TYPE, and copy that, in virtual format, */
/* OBSOLETE into VALBUF. *x/ */
/* OBSOLETE */
/* OBSOLETE #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ */
/* OBSOLETE memcpy (VALBUF, &((char *) REGBUF) [REGISTER_BYTE (S0_REGNUM) + \ */
/* OBSOLETE 8 - TYPE_LENGTH (TYPE)],\ */
/* OBSOLETE TYPE_LENGTH (TYPE)) */
/* OBSOLETE */
/* OBSOLETE /* Write into appropriate registers a function return value */
/* OBSOLETE of type TYPE, given in virtual format. *x/ */
/* OBSOLETE */
/* OBSOLETE #define STORE_RETURN_VALUE(TYPE,VALBUF) \ */
/* OBSOLETE write_register_bytes (REGISTER_BYTE (S0_REGNUM), VALBUF, 8) */
/* OBSOLETE */
/* OBSOLETE /* Extract from an array REGBUF containing the (raw) register state */
/* OBSOLETE the address in which a function should return its structure value, */
/* OBSOLETE as a CORE_ADDR (or an expression that can be used as one). *x/ */
/* OBSOLETE */
/* OBSOLETE #define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \ */
/* OBSOLETE (*(int *) & ((char *) REGBUF) [REGISTER_BYTE (s0_REGNUM)]) */
/* OBSOLETE */
/* OBSOLETE /* Define trapped internal variable hooks to read and write */
/* OBSOLETE vector and communication registers. *x/ */
/* OBSOLETE */
/* OBSOLETE #define IS_TRAPPED_INTERNALVAR is_trapped_internalvar */
/* OBSOLETE #define VALUE_OF_TRAPPED_INTERNALVAR value_of_trapped_internalvar */
/* OBSOLETE #define SET_TRAPPED_INTERNALVAR set_trapped_internalvar */
/* OBSOLETE */
/* OBSOLETE extern struct value *value_of_trapped_internalvar (); */
/* OBSOLETE */
/* OBSOLETE /* Hooks to read data from soff exec and core files, */
/* OBSOLETE and to describe the files. *x/ */
/* OBSOLETE */
/* OBSOLETE #define FILES_INFO_HOOK print_maps */
/* OBSOLETE */
/* OBSOLETE /* Hook to call to print a typeless integer value, normally printed in decimal. */
/* OBSOLETE For convex, use hex instead if the number looks like an address. *x/ */
/* OBSOLETE */
/* OBSOLETE #define PRINT_TYPELESS_INTEGER decout */
/* OBSOLETE */
/* OBSOLETE /* For the native compiler, variables for a particular lexical context */
/* OBSOLETE are listed after the beginning LBRAC instead of before in the */
/* OBSOLETE executables list of symbols. Using "gcc_compiled." to distinguish */
/* OBSOLETE between GCC and native compiler doesn't work on Convex because the */
/* OBSOLETE linker sorts the symbols to put "gcc_compiled." in the wrong place. */
/* OBSOLETE desc is nonzero for native, zero for gcc. *x/ */
/* OBSOLETE #define VARIABLES_INSIDE_BLOCK(desc, gcc_p) (desc != 0) */
/* OBSOLETE */
/* OBSOLETE /* Pcc occaisionally puts an SO where there should be an SOL. *x/ */
/* OBSOLETE #define PCC_SOL_BROKEN */
/* OBSOLETE */
/* OBSOLETE /* Describe the pointer in each stack frame to the previous stack frame */
/* OBSOLETE (its caller). *x/ */
/* OBSOLETE */
/* OBSOLETE /* FRAME_CHAIN takes a frame_info with a frame's nominal address in fi->frame, */
/* OBSOLETE and produces the frame's chain-pointer. *x/ */
/* OBSOLETE */
/* OBSOLETE /* (caller fp is saved at 8(fp)) *x/ */
/* OBSOLETE */
/* OBSOLETE #define FRAME_CHAIN(fi) (read_memory_integer ((fi)->frame + 8, 4)) */
/* OBSOLETE */
/* OBSOLETE /* Define other aspects of the stack frame. *x/ */
/* OBSOLETE */
/* OBSOLETE /* We need the boundaries of the text in the exec file, as a kludge, */
/* OBSOLETE for FRAMELESS_FUNCTION_INVOCATION and CALL_DUMMY_LOCATION. *x/ */
/* OBSOLETE */
/* OBSOLETE #define NEED_TEXT_START_END 1 */
/* OBSOLETE */
/* OBSOLETE /* An expression that tells us whether the function invocation represented */
/* OBSOLETE by FI does not have a frame on the stack associated with it. */
/* OBSOLETE On convex, check at the return address for `callq' -- if so, frameless, */
/* OBSOLETE otherwise, not. *x/ */
/* OBSOLETE */
/* OBSOLETE extern int convex_frameless_function_invocation PARAMS ((struct frame_info *fi)); */
/* OBSOLETE #define FRAMELESS_FUNCTION_INVOCATION(FI) (convex_frameless_function_invocatio (FI)) */
/* OBSOLETE */
/* OBSOLETE #define FRAME_SAVED_PC(fi) (read_memory_integer ((fi)->frame, 4)) */
/* OBSOLETE */
/* OBSOLETE #define FRAME_ARGS_ADDRESS(fi) (read_memory_integer ((fi)->frame + 12, 4)) */
/* OBSOLETE */
/* OBSOLETE #define FRAME_LOCALS_ADDRESS(fi) (fi)->frame */
/* OBSOLETE */
/* OBSOLETE /* Return number of args passed to a frame. */
/* OBSOLETE Can return -1, meaning no way to tell. *x/ */
/* OBSOLETE */
/* OBSOLETE extern int convex_frame_num_args PARAMS ((struct frame_info *fi)); */
/* OBSOLETE #define FRAME_NUM_ARGS(fi) (convex_frame_num_args ((fi))) */
/* OBSOLETE */
/* OBSOLETE /* Return number of bytes at start of arglist that are not really args. *x/ */
/* OBSOLETE */
/* OBSOLETE #define FRAME_ARGS_SKIP 0 */
/* OBSOLETE */
/* OBSOLETE /* Put here the code to store, into a struct frame_saved_regs, */
/* OBSOLETE the addresses of the saved registers of frame described by FRAME_INFO. */
/* OBSOLETE This includes special registers such as pc and fp saved in special */
/* OBSOLETE ways in the stack frame. sp is even more special: */
/* OBSOLETE the address we return for it IS the sp for the next frame. *x/ */
/* OBSOLETE */
/* OBSOLETE /* Normal (short) frames save only PC, FP, (callee's) AP. To reasonably */
/* OBSOLETE handle gcc and pcc register variables, scan the code following the */
/* OBSOLETE call for the instructions the compiler inserts to reload register */
/* OBSOLETE variables from stack slots and record the stack slots as the saved */
/* OBSOLETE locations of those registers. This will occasionally identify some */
/* OBSOLETE random load as a saved register; this is harmless. vc does not */
/* OBSOLETE declare its register allocation actions in the stabs. *x/ */
/* OBSOLETE */
/* OBSOLETE #define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \ */
/* OBSOLETE { register int regnum; \ */
/* OBSOLETE register int frame_length = /* 3 short, 2 long, 1 extended, 0 context *x/\ */
/* OBSOLETE (read_memory_integer ((frame_info)->frame + 4, 4) >> 25) & 3; \ */
/* OBSOLETE register CORE_ADDR frame_fp = \ */
/* OBSOLETE read_memory_integer ((frame_info)->frame + 8, 4); \ */
/* OBSOLETE register CORE_ADDR next_addr; \ */
/* OBSOLETE memset (&frame_saved_regs, '\0', sizeof frame_saved_regs); \ */
/* OBSOLETE (frame_saved_regs).regs[PC_REGNUM] = (frame_info)->frame + 0; \ */
/* OBSOLETE (frame_saved_regs).regs[PS_REGNUM] = (frame_info)->frame + 4; \ */
/* OBSOLETE (frame_saved_regs).regs[FP_REGNUM] = (frame_info)->frame + 8; \ */
/* OBSOLETE (frame_saved_regs).regs[AP_REGNUM] = frame_fp + 12; \ */
/* OBSOLETE next_addr = (frame_info)->frame + 12; \ */
/* OBSOLETE if (frame_length < 3) \ */
/* OBSOLETE for (regnum = A5_REGNUM; regnum < SP_REGNUM; ++regnum) \ */
/* OBSOLETE (frame_saved_regs).regs[regnum] = (next_addr += 4); \ */
/* OBSOLETE if (frame_length < 2) \ */
/* OBSOLETE (frame_saved_regs).regs[SP_REGNUM] = (next_addr += 4); \ */
/* OBSOLETE next_addr -= 4; \ */
/* OBSOLETE if (frame_length < 3) \ */
/* OBSOLETE for (regnum = S7_REGNUM; regnum < S0_REGNUM; ++regnum) \ */
/* OBSOLETE (frame_saved_regs).regs[regnum] = (next_addr += 8); \ */
/* OBSOLETE if (frame_length < 2) \ */
/* OBSOLETE (frame_saved_regs).regs[S0_REGNUM] = (next_addr += 8); \ */
/* OBSOLETE else \ */
/* OBSOLETE (frame_saved_regs).regs[SP_REGNUM] = next_addr + 8; \ */
/* OBSOLETE if (frame_length == 3) { \ */
/* OBSOLETE CORE_ADDR pc = read_memory_integer ((frame_info)->frame, 4); \ */
/* OBSOLETE int op, ix, disp; \ */
/* OBSOLETE op = read_memory_integer (pc, 2); \ */
/* OBSOLETE if ((op & 0xffc7) == 0x1480) pc += 4; /* add.w #-,sp *x/ \ */
/* OBSOLETE else if ((op & 0xffc7) == 0x58c0) pc += 2; /* add.w #-,sp *x/ \ */
/* OBSOLETE op = read_memory_integer (pc, 2); \ */
/* OBSOLETE if ((op & 0xffc7) == 0x2a06) pc += 4; /* ld.w -,ap *x/ \ */
/* OBSOLETE for (;;) { \ */
/* OBSOLETE op = read_memory_integer (pc, 2); \ */
/* OBSOLETE ix = (op >> 3) & 7; \ */
/* OBSOLETE if ((op & 0xfcc0) == 0x2800) { /* ld.- -,ak *x/ \ */
/* OBSOLETE regnum = SP_REGNUM - (op & 7); \ */
/* OBSOLETE disp = read_memory_integer (pc + 2, 2); \ */
/* OBSOLETE pc += 4;} \ */
/* OBSOLETE else if ((op & 0xfcc0) == 0x2840) { /* ld.- -,ak *x/ \ */
/* OBSOLETE regnum = SP_REGNUM - (op & 7); \ */
/* OBSOLETE disp = read_memory_integer (pc + 2, 4); \ */
/* OBSOLETE pc += 6;} \ */
/* OBSOLETE if ((op & 0xfcc0) == 0x3000) { /* ld.- -,sk *x/ \ */
/* OBSOLETE regnum = S0_REGNUM - (op & 7); \ */
/* OBSOLETE disp = read_memory_integer (pc + 2, 2); \ */
/* OBSOLETE pc += 4;} \ */
/* OBSOLETE else if ((op & 0xfcc0) == 0x3040) { /* ld.- -,sk *x/ \ */
/* OBSOLETE regnum = S0_REGNUM - (op & 7); \ */
/* OBSOLETE disp = read_memory_integer (pc + 2, 4); \ */
/* OBSOLETE pc += 6;} \ */
/* OBSOLETE else if ((op & 0xff00) == 0x7100) { /* br crossjump *x/ \ */
/* OBSOLETE pc += 2 * (char) op; \ */
/* OBSOLETE continue;} \ */
/* OBSOLETE else if (op == 0x0140) { /* jmp crossjump *x/ \ */
/* OBSOLETE pc = read_memory_integer (pc + 2, 4); \ */
/* OBSOLETE continue;} \ */
/* OBSOLETE else break; \ */
/* OBSOLETE if ((frame_saved_regs).regs[regnum]) \ */
/* OBSOLETE break; \ */
/* OBSOLETE if (ix == 7) disp += frame_fp; \ */
/* OBSOLETE else if (ix == 6) disp += read_memory_integer (frame_fp + 12, 4); \ */
/* OBSOLETE else if (ix != 0) break; \ */
/* OBSOLETE (frame_saved_regs).regs[regnum] = \ */
/* OBSOLETE disp - 8 + (1 << ((op >> 8) & 3)); \ */
/* OBSOLETE if (regnum >= S7_REGNUM) \ */
/* OBSOLETE (frame_saved_regs).regs[regnum - S0_REGNUM + s0_REGNUM] = \ */
/* OBSOLETE disp - 4 + (1 << ((op >> 8) & 3)); \ */
/* OBSOLETE } \ */
/* OBSOLETE } \ */
/* OBSOLETE } */
/* OBSOLETE */
/* OBSOLETE /* Things needed for making the inferior call functions. *x/ */
/* OBSOLETE */
/* OBSOLETE #define CALL_DUMMY_LOCATION BEFORE_TEXT_END */
/* OBSOLETE */
/* OBSOLETE /* Push an empty stack frame, to record the current PC, etc. *x/ */
/* OBSOLETE */
/* OBSOLETE #define PUSH_DUMMY_FRAME \ */
/* OBSOLETE { register CORE_ADDR sp = read_register (SP_REGNUM); \ */
/* OBSOLETE register int regnum; \ */
/* OBSOLETE char buf[8]; \ */
/* OBSOLETE long word; \ */
/* OBSOLETE for (regnum = S0_REGNUM; regnum >= S7_REGNUM; --regnum) { \ */
/* OBSOLETE read_register_bytes (REGISTER_BYTE (regnum), buf, 8); \ */
/* OBSOLETE sp = push_bytes (sp, buf, 8);} \ */
/* OBSOLETE for (regnum = SP_REGNUM; regnum >= FP_REGNUM; --regnum) { \ */
/* OBSOLETE word = read_register (regnum); \ */
/* OBSOLETE sp = push_bytes (sp, &word, 4);} \ */
/* OBSOLETE word = (read_register (PS_REGNUM) &~ (3<<25)) | (1<<25); \ */
/* OBSOLETE sp = push_bytes (sp, &word, 4); \ */
/* OBSOLETE word = read_register (PC_REGNUM); \ */
/* OBSOLETE sp = push_bytes (sp, &word, 4); \ */
/* OBSOLETE write_register (SP_REGNUM, sp); \ */
/* OBSOLETE write_register (FP_REGNUM, sp); \ */
/* OBSOLETE write_register (AP_REGNUM, sp);} */
/* OBSOLETE */
/* OBSOLETE /* Discard from the stack the innermost frame, restoring all registers. *x/ */
/* OBSOLETE */
/* OBSOLETE #define POP_FRAME do {\ */
/* OBSOLETE register CORE_ADDR fp = read_register (FP_REGNUM); \ */
/* OBSOLETE register int regnum; \ */
/* OBSOLETE register int frame_length = /* 3 short, 2 long, 1 extended, 0 context *x/ \ */
/* OBSOLETE (read_memory_integer (fp + 4, 4) >> 25) & 3; \ */
/* OBSOLETE char buf[8]; \ */
/* OBSOLETE write_register (PC_REGNUM, read_memory_integer (fp, 4)); \ */
/* OBSOLETE write_register (PS_REGNUM, read_memory_integer (fp += 4, 4)); \ */
/* OBSOLETE write_register (FP_REGNUM, read_memory_integer (fp += 4, 4)); \ */
/* OBSOLETE write_register (AP_REGNUM, read_memory_integer (fp += 4, 4)); \ */
/* OBSOLETE if (frame_length < 3) \ */
/* OBSOLETE for (regnum = A5_REGNUM; regnum < SP_REGNUM; ++regnum) \ */
/* OBSOLETE write_register (regnum, read_memory_integer (fp += 4, 4)); \ */
/* OBSOLETE if (frame_length < 2) \ */
/* OBSOLETE write_register (SP_REGNUM, read_memory_integer (fp += 4, 4)); \ */
/* OBSOLETE fp -= 4; \ */
/* OBSOLETE if (frame_length < 3) \ */
/* OBSOLETE for (regnum = S7_REGNUM; regnum < S0_REGNUM; ++regnum) { \ */
/* OBSOLETE read_memory (fp += 8, buf, 8); \ */
/* OBSOLETE write_register_bytes (REGISTER_BYTE (regnum), buf, 8);} \ */
/* OBSOLETE if (frame_length < 2) { \ */
/* OBSOLETE read_memory (fp += 8, buf, 8); \ */
/* OBSOLETE write_register_bytes (REGISTER_BYTE (regnum), buf, 8);} \ */
/* OBSOLETE else write_register (SP_REGNUM, fp + 8); \ */
/* OBSOLETE flush_cached_frames (); \ */
/* OBSOLETE } while (0) */
/* OBSOLETE */
/* OBSOLETE /* This sequence of words is the instructions */
/* OBSOLETE mov sp,ap */
/* OBSOLETE pshea 69696969 */
/* OBSOLETE calls 32323232 */
/* OBSOLETE bkpt */
/* OBSOLETE Note this is 16 bytes. *x/ */
/* OBSOLETE */
/* OBSOLETE #define CALL_DUMMY {0x50860d4069696969LL,0x2140323232327d50LL} */
/* OBSOLETE */
/* OBSOLETE #define CALL_DUMMY_LENGTH 16 */
/* OBSOLETE */
/* OBSOLETE #define CALL_DUMMY_START_OFFSET 0 */
/* OBSOLETE */
/* OBSOLETE /* Insert the specified number of args and function address */
/* OBSOLETE into a call sequence of the above form stored at DUMMYNAME. *x/ */
/* OBSOLETE */
/* OBSOLETE #define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \ */
/* OBSOLETE { *(int *)((char *) dummyname + 4) = nargs; \ */
/* OBSOLETE *(int *)((char *) dummyname + 10) = fun; } */
/* OBSOLETE */
/* OBSOLETE /* Defs to read soff symbol tables, see dbxread.c *x/ */
/* OBSOLETE */
/* OBSOLETE #define NUMBER_OF_SYMBOLS ((long) opthdr.o_nsyms) */
/* OBSOLETE #define STRING_TABLE_OFFSET ((long) filehdr.h_strptr) */
/* OBSOLETE #define SYMBOL_TABLE_OFFSET ((long) opthdr.o_symptr) */
/* OBSOLETE #define STRING_TABLE_SIZE ((long) filehdr.h_strsiz) */
/* OBSOLETE #define SIZE_OF_TEXT_SEGMENT ((long) txthdr.s_size) */
/* OBSOLETE #define ENTRY_POINT ((long) opthdr.o_entry) */
/* OBSOLETE */
/* OBSOLETE #define READ_STRING_TABLE_SIZE(BUFFER) \ */
/* OBSOLETE (BUFFER = STRING_TABLE_SIZE) */
/* OBSOLETE */
/* OBSOLETE #define DECLARE_FILE_HEADERS \ */
/* OBSOLETE FILEHDR filehdr; \ */
/* OBSOLETE OPTHDR opthdr; \ */
/* OBSOLETE SCNHDR txthdr */
/* OBSOLETE */
/* OBSOLETE #define READ_FILE_HEADERS(DESC,NAME) \ */
/* OBSOLETE { \ */
/* OBSOLETE int n; \ */
/* OBSOLETE val = myread (DESC, &filehdr, sizeof filehdr); \ */
/* OBSOLETE if (val < 0) \ */
/* OBSOLETE perror_with_name (NAME); \ */
/* OBSOLETE if (! IS_SOFF_MAGIC (filehdr.h_magic)) \ */
/* OBSOLETE error ("%s: not an executable file.", NAME); \ */
/* OBSOLETE lseek (DESC, 0L, 0); \ */
/* OBSOLETE if (myread (DESC, &filehdr, sizeof filehdr) < 0) \ */
/* OBSOLETE perror_with_name (NAME); \ */
/* OBSOLETE if (myread (DESC, &opthdr, filehdr.h_opthdr) <= 0) \ */
/* OBSOLETE perror_with_name (NAME); \ */
/* OBSOLETE for (n = 0; n < filehdr.h_nscns; n++) \ */
/* OBSOLETE { \ */
/* OBSOLETE if (myread (DESC, &txthdr, sizeof txthdr) < 0) \ */
/* OBSOLETE perror_with_name (NAME); \ */
/* OBSOLETE if ((txthdr.s_flags & S_TYPMASK) == S_TEXT) \ */
/* OBSOLETE break; \ */
/* OBSOLETE } \ */
/* OBSOLETE } */
/* Definitions to make GDB run on Convex Unix (4bsd)
Copyright 1989, 1991, 1993 Free Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define TARGET_BYTE_ORDER BIG_ENDIAN
/* There is come problem with the debugging symbols generated by the
compiler such that the debugging symbol for the first line of a
function overlap with the function prologue. */
#define PROLOGUE_FIRSTLINE_OVERLAP
/* When convex pcc says CHAR or SHORT, it provides the correct address. */
#define BELIEVE_PCC_PROMOTION 1
/* Symbol types to ignore. */
/* 0xc4 is N_MONPT. Use the numeric value for the benefit of people
with (rather) old OS's. */
#define IGNORE_SYMBOL(TYPE) \
(((TYPE) & ~N_EXT) == N_TBSS \
|| ((TYPE) & ~N_EXT) == N_TDATA \
|| ((TYPE) & ~N_EXT) == 0xc4)
/* Offset from address of function to start of its code.
Zero on most machines. */
#define FUNCTION_START_OFFSET 0
/* Advance PC across any function entry prologue instructions
to reach some "real" code.
Convex prolog is:
[sub.w #-,sp] in one of 3 possible sizes
[mov psw,- fc/vc main program prolog
and #-,- (skip it because the "mov psw" saves the
mov -,psw] T bit, so continue gets a surprise trap)
[and #-,sp] fc/vc O2 main program prolog
[ld.- -(ap),-] pcc/gcc register arg loads
*/
#define SKIP_PROLOGUE(pc) \
{ int op, ix; \
op = read_memory_integer (pc, 2); \
if ((op & 0xffc7) == 0x5ac0) pc += 2; \
else if (op == 0x1580) pc += 4; \
else if (op == 0x15c0) pc += 6; \
if ((read_memory_integer (pc, 2) & 0xfff8) == 0x7c40 \
&& (read_memory_integer (pc + 2, 2) & 0xfff8) == 0x1240 \
&& (read_memory_integer (pc + 8, 2) & 0xfff8) == 0x7c48) \
pc += 10; \
if (read_memory_integer (pc, 2) == 0x1240) pc += 6; \
for (;;) { \
op = read_memory_integer (pc, 2); \
ix = (op >> 3) & 7; \
if (ix != 6) break; \
if ((op & 0xfcc0) == 0x3000) pc += 4; \
else if ((op & 0xfcc0) == 0x3040) pc += 6; \
else if ((op & 0xfcc0) == 0x2800) pc += 4; \
else if ((op & 0xfcc0) == 0x2840) pc += 6; \
else break;}}
/* Immediately after a function call, return the saved pc.
(ignore frame and return *$sp so we can handle both calls and callq) */
#define SAVED_PC_AFTER_CALL(frame) \
read_memory_integer (read_register (SP_REGNUM), 4)
/* Address of end of stack space.
This is ((USRSTACK + 0xfff) & -0x1000)) from <convex/vmparam.h> but
that expression depends on the kernel version; instead, fetch a
page-zero pointer and get it from that. This will be invalid if
they ever change the way bkpt signals are delivered. */
#define STACK_END_ADDR (0xfffff000 & *(unsigned *) 0x80000050)
/* User-mode traps push an extended rtn block,
then fault with one of the following PCs */
#define is_trace_pc(pc) ((unsigned) ((pc) - (*(int *) 0x80000040)) <= 4)
#define is_arith_pc(pc) ((unsigned) ((pc) - (*(int *) 0x80000044)) <= 4)
#define is_break_pc(pc) ((unsigned) ((pc) - (*(int *) 0x80000050)) <= 4)
/* We need to manipulate trap bits in the psw */
#define PSW_TRAP_FLAGS 0x69670000
#define PSW_T_BIT 0x08000000
#define PSW_S_BIT 0x01000000
/* Stack grows downward. */
#define INNER_THAN(lhs,rhs) ((lhs) < (rhs))
/* Sequence of bytes for breakpoint instruction. (bkpt) */
#define BREAKPOINT {0x7d,0x50}
/* Amount PC must be decremented by after a breakpoint.
This is often the number of bytes in BREAKPOINT but not always.
(The break PC needs to be decremented by 2, but we do it when the
break frame is recognized and popped. That way gdb can tell breaks
from trace traps with certainty.) */
#define DECR_PC_AFTER_BREAK 0
/* Say how long (ordinary) registers are. This is a piece of bogosity
used in push_word and a few other places; REGISTER_RAW_SIZE is the
real way to know how big a register is. */
#define REGISTER_SIZE 8
/* Number of machine registers */
#define NUM_REGS 26
/* Initializer for an array of names of registers.
There should be NUM_REGS strings in this initializer. */
#define REGISTER_NAMES {"pc","psw","fp","ap","a5","a4","a3","a2","a1","sp",\
"s7","s6","s5","s4","s3","s2","s1","s0",\
"S7","S6","S5","S4","S3","S2","S1","S0"}
/* Register numbers of various important registers.
Note that some of these values are "real" register numbers,
and correspond to the general registers of the machine,
and some are "phony" register numbers which are too large
to be actual register numbers as far as the user is concerned
but do serve to get the desired values when passed to read_register. */
#define S0_REGNUM 25 /* the real S regs */
#define S7_REGNUM 18
#define s0_REGNUM 17 /* low-order halves of S regs */
#define s7_REGNUM 10
#define SP_REGNUM 9 /* A regs */
#define A1_REGNUM 8
#define A5_REGNUM 4
#define AP_REGNUM 3
#define FP_REGNUM 2 /* Contains address of executing stack frame */
#define PS_REGNUM 1 /* Contains processor status */
#define PC_REGNUM 0 /* Contains program counter */
/* convert dbx stab register number (from `r' declaration) to a gdb REGNUM */
#define STAB_REG_TO_REGNUM(value) \
((value) < 8 ? S0_REGNUM - (value) : SP_REGNUM - ((value) - 8))
/* Vector register numbers, not handled as ordinary regs.
They are treated as convenience variables whose values are read
from the inferior when needed. */
#define V0_REGNUM 0
#define V7_REGNUM 7
#define VM_REGNUM 8
#define VS_REGNUM 9
#define VL_REGNUM 10
/* Total amount of space needed to store our copies of the machine's
register state, the array `registers'. */
#define REGISTER_BYTES (4*10 + 8*8)
/* Index within `registers' of the first byte of the space for
register N.
NB: must match structure of struct syscall_context for correct operation */
#define REGISTER_BYTE(N) ((N) < s7_REGNUM ? 4*(N) : \
(N) < S7_REGNUM ? 44 + 8 * ((N)-s7_REGNUM) : \
40 + 8 * ((N)-S7_REGNUM))
/* Number of bytes of storage in the actual machine representation
for register N. */
#define REGISTER_RAW_SIZE(N) ((N) < S7_REGNUM ? 4 : 8)
/* Number of bytes of storage in the program's representation
for register N. */
#define REGISTER_VIRTUAL_SIZE(N) REGISTER_RAW_SIZE(N)
/* Largest value REGISTER_RAW_SIZE can have. */
#define MAX_REGISTER_RAW_SIZE 8
/* Largest value REGISTER_VIRTUAL_SIZE can have. */
#define MAX_REGISTER_VIRTUAL_SIZE 8
/* Return the GDB type object for the "standard" data type
of data in register N. */
#define REGISTER_VIRTUAL_TYPE(N) \
((N) < S7_REGNUM ? builtin_type_int : builtin_type_long_long)
/* Store the address of the place in which to copy the structure the
subroutine will return. This is called from call_function. */
#define STORE_STRUCT_RETURN(ADDR, SP) \
{ write_register (A1_REGNUM, (ADDR)); }
/* Extract from an array REGBUF containing the (raw) register state
a function return value of type TYPE, and copy that, in virtual format,
into VALBUF. */
#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
memcpy (VALBUF, &((char *) REGBUF) [REGISTER_BYTE (S0_REGNUM) + \
8 - TYPE_LENGTH (TYPE)],\
TYPE_LENGTH (TYPE))
/* Write into appropriate registers a function return value
of type TYPE, given in virtual format. */
#define STORE_RETURN_VALUE(TYPE,VALBUF) \
write_register_bytes (REGISTER_BYTE (S0_REGNUM), VALBUF, 8)
/* Extract from an array REGBUF containing the (raw) register state
the address in which a function should return its structure value,
as a CORE_ADDR (or an expression that can be used as one). */
#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
(*(int *) & ((char *) REGBUF) [REGISTER_BYTE (s0_REGNUM)])
/* Define trapped internal variable hooks to read and write
vector and communication registers. */
#define IS_TRAPPED_INTERNALVAR is_trapped_internalvar
#define VALUE_OF_TRAPPED_INTERNALVAR value_of_trapped_internalvar
#define SET_TRAPPED_INTERNALVAR set_trapped_internalvar
extern struct value *value_of_trapped_internalvar ();
/* Hooks to read data from soff exec and core files,
and to describe the files. */
#define FILES_INFO_HOOK print_maps
/* Hook to call to print a typeless integer value, normally printed in decimal.
For convex, use hex instead if the number looks like an address. */
#define PRINT_TYPELESS_INTEGER decout
/* For the native compiler, variables for a particular lexical context
are listed after the beginning LBRAC instead of before in the
executables list of symbols. Using "gcc_compiled." to distinguish
between GCC and native compiler doesn't work on Convex because the
linker sorts the symbols to put "gcc_compiled." in the wrong place.
desc is nonzero for native, zero for gcc. */
#define VARIABLES_INSIDE_BLOCK(desc, gcc_p) (desc != 0)
/* Pcc occaisionally puts an SO where there should be an SOL. */
#define PCC_SOL_BROKEN
/* Describe the pointer in each stack frame to the previous stack frame
(its caller). */
/* FRAME_CHAIN takes a frame_info with a frame's nominal address in fi->frame,
and produces the frame's chain-pointer. */
/* (caller fp is saved at 8(fp)) */
#define FRAME_CHAIN(fi) (read_memory_integer ((fi)->frame + 8, 4))
/* Define other aspects of the stack frame. */
/* We need the boundaries of the text in the exec file, as a kludge,
for FRAMELESS_FUNCTION_INVOCATION and CALL_DUMMY_LOCATION. */
#define NEED_TEXT_START_END 1
/* A macro that tells us whether the function invocation represented
by FI does not have a frame on the stack associated with it. If it
does not, FRAMELESS is set to 1, else 0.
On convex, check at the return address for `callq' -- if so, frameless,
otherwise, not. */
#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
{ \
extern CORE_ADDR text_start, text_end; \
CORE_ADDR call_addr = SAVED_PC_AFTER_CALL (FI); \
(FRAMELESS) = (call_addr >= text_start && call_addr < text_end \
&& read_memory_integer (call_addr - 6, 1) == 0x22); \
}
#define FRAME_SAVED_PC(fi) (read_memory_integer ((fi)->frame, 4))
#define FRAME_ARGS_ADDRESS(fi) (read_memory_integer ((fi)->frame + 12, 4))
#define FRAME_LOCALS_ADDRESS(fi) (fi)->frame
/* Return number of args passed to a frame.
Can return -1, meaning no way to tell. */
#define FRAME_NUM_ARGS(numargs, fi) \
{ numargs = read_memory_integer (FRAME_ARGS_ADDRESS (fi) - 4, 4); \
if (numargs < 0 || numargs >= 256) numargs = -1;}
/* Return number of bytes at start of arglist that are not really args. */
#define FRAME_ARGS_SKIP 0
/* Put here the code to store, into a struct frame_saved_regs,
the addresses of the saved registers of frame described by FRAME_INFO.
This includes special registers such as pc and fp saved in special
ways in the stack frame. sp is even more special:
the address we return for it IS the sp for the next frame. */
/* Normal (short) frames save only PC, FP, (callee's) AP. To reasonably
handle gcc and pcc register variables, scan the code following the
call for the instructions the compiler inserts to reload register
variables from stack slots and record the stack slots as the saved
locations of those registers. This will occasionally identify some
random load as a saved register; this is harmless. vc does not
declare its register allocation actions in the stabs. */
#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
{ register int regnum; \
register int frame_length = /* 3 short, 2 long, 1 extended, 0 context */\
(read_memory_integer ((frame_info)->frame + 4, 4) >> 25) & 3; \
register CORE_ADDR frame_fp = \
read_memory_integer ((frame_info)->frame + 8, 4); \
register CORE_ADDR next_addr; \
memset (&frame_saved_regs, '\0', sizeof frame_saved_regs); \
(frame_saved_regs).regs[PC_REGNUM] = (frame_info)->frame + 0; \
(frame_saved_regs).regs[PS_REGNUM] = (frame_info)->frame + 4; \
(frame_saved_regs).regs[FP_REGNUM] = (frame_info)->frame + 8; \
(frame_saved_regs).regs[AP_REGNUM] = frame_fp + 12; \
next_addr = (frame_info)->frame + 12; \
if (frame_length < 3) \
for (regnum = A5_REGNUM; regnum < SP_REGNUM; ++regnum) \
(frame_saved_regs).regs[regnum] = (next_addr += 4); \
if (frame_length < 2) \
(frame_saved_regs).regs[SP_REGNUM] = (next_addr += 4); \
next_addr -= 4; \
if (frame_length < 3) \
for (regnum = S7_REGNUM; regnum < S0_REGNUM; ++regnum) \
(frame_saved_regs).regs[regnum] = (next_addr += 8); \
if (frame_length < 2) \
(frame_saved_regs).regs[S0_REGNUM] = (next_addr += 8); \
else \
(frame_saved_regs).regs[SP_REGNUM] = next_addr + 8; \
if (frame_length == 3) { \
CORE_ADDR pc = read_memory_integer ((frame_info)->frame, 4); \
int op, ix, disp; \
op = read_memory_integer (pc, 2); \
if ((op & 0xffc7) == 0x1480) pc += 4; /* add.w #-,sp */ \
else if ((op & 0xffc7) == 0x58c0) pc += 2; /* add.w #-,sp */ \
op = read_memory_integer (pc, 2); \
if ((op & 0xffc7) == 0x2a06) pc += 4; /* ld.w -,ap */ \
for (;;) { \
op = read_memory_integer (pc, 2); \
ix = (op >> 3) & 7; \
if ((op & 0xfcc0) == 0x2800) { /* ld.- -,ak */ \
regnum = SP_REGNUM - (op & 7); \
disp = read_memory_integer (pc + 2, 2); \
pc += 4;} \
else if ((op & 0xfcc0) == 0x2840) { /* ld.- -,ak */ \
regnum = SP_REGNUM - (op & 7); \
disp = read_memory_integer (pc + 2, 4); \
pc += 6;} \
if ((op & 0xfcc0) == 0x3000) { /* ld.- -,sk */ \
regnum = S0_REGNUM - (op & 7); \
disp = read_memory_integer (pc + 2, 2); \
pc += 4;} \
else if ((op & 0xfcc0) == 0x3040) { /* ld.- -,sk */ \
regnum = S0_REGNUM - (op & 7); \
disp = read_memory_integer (pc + 2, 4); \
pc += 6;} \
else if ((op & 0xff00) == 0x7100) { /* br crossjump */ \
pc += 2 * (char) op; \
continue;} \
else if (op == 0x0140) { /* jmp crossjump */ \
pc = read_memory_integer (pc + 2, 4); \
continue;} \
else break; \
if ((frame_saved_regs).regs[regnum]) \
break; \
if (ix == 7) disp += frame_fp; \
else if (ix == 6) disp += read_memory_integer (frame_fp + 12, 4); \
else if (ix != 0) break; \
(frame_saved_regs).regs[regnum] = \
disp - 8 + (1 << ((op >> 8) & 3)); \
if (regnum >= S7_REGNUM) \
(frame_saved_regs).regs[regnum - S0_REGNUM + s0_REGNUM] = \
disp - 4 + (1 << ((op >> 8) & 3)); \
} \
} \
}
/* Things needed for making the inferior call functions. */
#define CALL_DUMMY_LOCATION BEFORE_TEXT_END
/* Push an empty stack frame, to record the current PC, etc. */
#define PUSH_DUMMY_FRAME \
{ register CORE_ADDR sp = read_register (SP_REGNUM); \
register int regnum; \
char buf[8]; \
long word; \
for (regnum = S0_REGNUM; regnum >= S7_REGNUM; --regnum) { \
read_register_bytes (REGISTER_BYTE (regnum), buf, 8); \
sp = push_bytes (sp, buf, 8);} \
for (regnum = SP_REGNUM; regnum >= FP_REGNUM; --regnum) { \
word = read_register (regnum); \
sp = push_bytes (sp, &word, 4);} \
word = (read_register (PS_REGNUM) &~ (3<<25)) | (1<<25); \
sp = push_bytes (sp, &word, 4); \
word = read_register (PC_REGNUM); \
sp = push_bytes (sp, &word, 4); \
write_register (SP_REGNUM, sp); \
write_register (FP_REGNUM, sp); \
write_register (AP_REGNUM, sp);}
/* Discard from the stack the innermost frame, restoring all registers. */
#define POP_FRAME do {\
register CORE_ADDR fp = read_register (FP_REGNUM); \
register int regnum; \
register int frame_length = /* 3 short, 2 long, 1 extended, 0 context */ \
(read_memory_integer (fp + 4, 4) >> 25) & 3; \
char buf[8]; \
write_register (PC_REGNUM, read_memory_integer (fp, 4)); \
write_register (PS_REGNUM, read_memory_integer (fp += 4, 4)); \
write_register (FP_REGNUM, read_memory_integer (fp += 4, 4)); \
write_register (AP_REGNUM, read_memory_integer (fp += 4, 4)); \
if (frame_length < 3) \
for (regnum = A5_REGNUM; regnum < SP_REGNUM; ++regnum) \
write_register (regnum, read_memory_integer (fp += 4, 4)); \
if (frame_length < 2) \
write_register (SP_REGNUM, read_memory_integer (fp += 4, 4)); \
fp -= 4; \
if (frame_length < 3) \
for (regnum = S7_REGNUM; regnum < S0_REGNUM; ++regnum) { \
read_memory (fp += 8, buf, 8); \
write_register_bytes (REGISTER_BYTE (regnum), buf, 8);} \
if (frame_length < 2) { \
read_memory (fp += 8, buf, 8); \
write_register_bytes (REGISTER_BYTE (regnum), buf, 8);} \
else write_register (SP_REGNUM, fp + 8); \
flush_cached_frames (); \
} while (0)
/* This sequence of words is the instructions
mov sp,ap
pshea 69696969
calls 32323232
bkpt
Note this is 16 bytes. */
#define CALL_DUMMY {0x50860d4069696969LL,0x2140323232327d50LL}
#define CALL_DUMMY_LENGTH 16
#define CALL_DUMMY_START_OFFSET 0
/* Insert the specified number of args and function address
into a call sequence of the above form stored at DUMMYNAME. */
#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
{ *(int *)((char *) dummyname + 4) = nargs; \
*(int *)((char *) dummyname + 10) = fun; }
/* Defs to read soff symbol tables, see dbxread.c */
#define NUMBER_OF_SYMBOLS ((long) opthdr.o_nsyms)
#define STRING_TABLE_OFFSET ((long) filehdr.h_strptr)
#define SYMBOL_TABLE_OFFSET ((long) opthdr.o_symptr)
#define STRING_TABLE_SIZE ((long) filehdr.h_strsiz)
#define SIZE_OF_TEXT_SEGMENT ((long) txthdr.s_size)
#define ENTRY_POINT ((long) opthdr.o_entry)
#define READ_STRING_TABLE_SIZE(BUFFER) \
(BUFFER = STRING_TABLE_SIZE)
#define DECLARE_FILE_HEADERS \
FILEHDR filehdr; \
OPTHDR opthdr; \
SCNHDR txthdr
#define READ_FILE_HEADERS(DESC,NAME) \
{ \
int n; \
val = myread (DESC, &filehdr, sizeof filehdr); \
if (val < 0) \
perror_with_name (NAME); \
if (! IS_SOFF_MAGIC (filehdr.h_magic)) \
error ("%s: not an executable file.", NAME); \
lseek (DESC, 0L, 0); \
if (myread (DESC, &filehdr, sizeof filehdr) < 0) \
perror_with_name (NAME); \
if (myread (DESC, &opthdr, filehdr.h_opthdr) <= 0) \
perror_with_name (NAME); \
for (n = 0; n < filehdr.h_nscns; n++) \
{ \
if (myread (DESC, &txthdr, sizeof txthdr) < 0) \
perror_with_name (NAME); \
if ((txthdr.s_flags & S_TYPMASK) == S_TEXT) \
break; \
} \
}

View File

@@ -1,35 +1,35 @@
/* OBSOLETE /* Definitions to make GDB run on Convex Unix (4bsd) */
/* OBSOLETE Copyright 1989, 1991, 1992, 1996 Free Software Foundation, Inc. */
/* OBSOLETE */
/* OBSOLETE This file is part of GDB. */
/* OBSOLETE */
/* OBSOLETE This program is free software; you can redistribute it and/or modify */
/* OBSOLETE it under the terms of the GNU General Public License as published by */
/* OBSOLETE the Free Software Foundation; either version 2 of the License, or */
/* OBSOLETE (at your option) any later version. */
/* OBSOLETE */
/* OBSOLETE This program is distributed in the hope that it will be useful, */
/* OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* OBSOLETE GNU General Public License for more details. */
/* OBSOLETE */
/* OBSOLETE You should have received a copy of the GNU General Public License */
/* OBSOLETE along with this program; if not, write to the Free Software */
/* OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *x/ */
/* OBSOLETE */
/* OBSOLETE #define HOST_BYTE_ORDER BIG_ENDIAN */
/* OBSOLETE */
/* OBSOLETE #define ATTACH_DETACH */
/* OBSOLETE #define HAVE_WAIT_STRUCT */
/* OBSOLETE #define NO_SIGINTERRUPT */
/* OBSOLETE */
/* OBSOLETE /* Use SIGCONT rather than SIGTSTP because convex Unix occasionally */
/* OBSOLETE turkeys SIGTSTP. I think. *x/ */
/* OBSOLETE */
/* OBSOLETE #define STOP_SIGNAL SIGCONT */
/* OBSOLETE */
/* OBSOLETE /* Hook to call after creating inferior process. Now init_trace_fun */
/* OBSOLETE is in the same place. So re-write this to use the init_trace_fun */
/* OBSOLETE (making convex a debugging target). FIXME. *x/ */
/* OBSOLETE */
/* OBSOLETE #define CREATE_INFERIOR_HOOK create_inferior_hook */
/* Definitions to make GDB run on Convex Unix (4bsd)
Copyright 1989, 1991, 1992, 1996 Free Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define HOST_BYTE_ORDER BIG_ENDIAN
#define ATTACH_DETACH
#define HAVE_WAIT_STRUCT
#define NO_SIGINTERRUPT
/* Use SIGCONT rather than SIGTSTP because convex Unix occasionally
turkeys SIGTSTP. I think. */
#define STOP_SIGNAL SIGCONT
/* Hook to call after creating inferior process. Now init_trace_fun
is in the same place. So re-write this to use the init_trace_fun
(making convex a debugging target). FIXME. */
#define CREATE_INFERIOR_HOOK create_inferior_hook

View File

@@ -1,33 +1,28 @@
/* Target-specific definition for the Mitsubishi D10V
Copyright (C) 1996,1999 Free Software Foundation, Inc.
Copyright (C) 1996 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Contributed by Martin Hunt, hunt@cygnus.com */
#define GDB_MULTI_ARCH 1
/* #define GDB_TARGET_IS_D10V - moved to gdbarch.h */
#define GDB_TARGET_IS_D10V
/* Define the bit, byte, and word ordering of the machine. */
#if !GDB_MULTI_ARCH
#define TARGET_BYTE_ORDER BIG_ENDIAN
/* Offset from address of function to start of its code.
@@ -35,30 +30,48 @@
#define FUNCTION_START_OFFSET 0
/* these are the addresses the D10V-EVA board maps data */
/* and instruction memory to. */
#define DMEM_START 0x0000000
#define IMEM_START 0x1000000
#define STACK_START 0x0007ffe
#ifdef __STDC__ /* Forward decls for prototypes */
struct frame_info;
struct frame_saved_regs;
struct type;
struct value;
#endif
/* Advance PC across any function entry prologue instructions
to reach some "real" code. */
extern CORE_ADDR d10v_skip_prologue ();
#define SKIP_PROLOGUE(ip) (d10v_skip_prologue (ip))
#define SKIP_PROLOGUE(ip) \
{(ip) = d10v_skip_prologue(ip);}
/* Stack grows downward. */
#define INNER_THAN(lhs,rhs) (core_addr_lessthan ((lhs), (rhs)))
#define INNER_THAN(lhs,rhs) ((lhs) < (rhs))
/* for a breakpoint, use "dbt || nop" */
extern breakpoint_from_pc_fn d10v_breakpoint_from_pc;
#define BREAKPOINT_FROM_PC(PCPTR,LENPTR) (d10v_breakpoint_from_pc ((PCPTR), (LENPTR)))
#define BREAKPOINT {0x2f, 0x90, 0x5e, 0x00}
/* If your kernel resets the pc after the trap happens you may need to
define this before including this file. */
#define DECR_PC_AFTER_BREAK 4
extern char *d10v_register_name PARAMS ((int reg_nr));
#define REGISTER_NAME(NR) (d10v_register_name (NR))
#define REGISTER_NAMES \
{ "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
"r8", "r9", "r10","r11","r12", "r13", "r14","r15",\
"psw","bpsw","pc","bpc", "cr4", "cr5", "cr6", "rpt_c",\
"rpt_s","rpt_e", "mod_s", "mod_e", "cr12", "cr13", "iba", "cr15",\
"imap0","imap1","dmap","a0", "a1"\
}
#define NUM_REGS 37
#endif /* GDB_MULTI_ARCH */
/* Register numbers of various important registers.
Note that some of these values are "real" register numbers,
and correspond to the general registers of the machine,
@@ -66,43 +79,34 @@ extern char *d10v_register_name PARAMS ((int reg_nr));
to be actual register numbers as far as the user is concerned
but do serve to get the desired values when passed to read_register. */
/* Used by both d10v-tdep.c and remote-d10v.c */
#define R0_REGNUM 0
#define LR_REGNUM 13
#if !GDB_MULTI_ARCH
#define SP_REGNUM 15
#define FP_REGNUM 11
#define PC_REGNUM 18
#endif
#define PSW_REGNUM 16
#define IMAP0_REGNUM 32
#define IMAP1_REGNUM 33
#define DMAP_REGNUM 34
#define A0_REGNUM 35
#if !GDB_MULTI_ARCH
/* ??? */
#define REGISTER_SIZE 2
/* Say how much memory is needed to store a copy of the register set */
#define REGISTER_BYTES ((37/*NUM_REGS*/-2)*2+16)
#define REGISTER_BYTES ((NUM_REGS-2)*2+16)
/* Index within `registers' of the first byte of the space for
register N. */
extern int d10v_register_byte PARAMS ((int reg_nr));
#define REGISTER_BYTE(N) (d10v_register_byte (N))
#define REGISTER_BYTE(N) \
( ((N) > A0_REGNUM) ? ( ((N)-A0_REGNUM)*8 + A0_REGNUM*2 ) : ((N) * 2) )
/* Number of bytes of storage in the actual machine representation
for register N. */
extern int d10v_register_raw_size PARAMS ((int reg_nr));
#define REGISTER_RAW_SIZE(N) (d10v_register_raw_size (N))
#define REGISTER_RAW_SIZE(N) ( ((N) >= A0_REGNUM) ? 8 : 2 )
/* Number of bytes of storage in the program's representation
for register N. */
extern int d10v_register_virtual_size PARAMS ((int reg_nr));
#define REGISTER_VIRTUAL_SIZE(N) (d10v_register_virtual_size (N))
for register N. */
#define REGISTER_VIRTUAL_SIZE(N) ( ((N) >= A0_REGNUM) ? 8 : ( ((N) == PC_REGNUM || (N) == SP_REGNUM) ? 4 : 2 ))
/* Largest value REGISTER_RAW_SIZE can have. */
@@ -115,33 +119,39 @@ extern int d10v_register_virtual_size PARAMS ((int reg_nr));
/* Return the GDB type object for the "standard" data type
of data in register N. */
extern struct type *d10v_register_virtual_type PARAMS ((int reg_nr));
#define REGISTER_VIRTUAL_TYPE(N) (d10v_register_virtual_type (N))
#define REGISTER_VIRTUAL_TYPE(N) \
( ((N) < A0_REGNUM ) ? ((N) == PC_REGNUM || (N) == SP_REGNUM ? builtin_type_long : builtin_type_short) : builtin_type_long_long)
/* convert $pc and $sp to/from virtual addresses */
extern int d10v_register_convertible PARAMS ((int nr));
extern void d10v_register_convert_to_virtual PARAMS ((int regnum, struct type * type, char *from, char *to));
extern void d10v_register_convert_to_raw PARAMS ((struct type * type, int regnum, char *from, char *to));
#define REGISTER_CONVERTIBLE(N) (d10v_register_convertible ((N)))
#define REGISTER_CONVERTIBLE(N) ((N) == PC_REGNUM || (N) == SP_REGNUM)
#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,TYPE,FROM,TO) \
d10v_register_convert_to_virtual ((REGNUM), (TYPE), (FROM), (TO))
{ \
ULONGEST x = extract_unsigned_integer ((FROM), REGISTER_RAW_SIZE (REGNUM)); \
if (REGNUM == PC_REGNUM) x = (x << 2) | IMEM_START; \
else x |= DMEM_START; \
store_unsigned_integer ((TO), TYPE_LENGTH(TYPE), x); \
}
#define REGISTER_CONVERT_TO_RAW(TYPE,REGNUM,FROM,TO) \
d10v_register_convert_to_raw ((TYPE), (REGNUM), (FROM), (TO))
{ \
ULONGEST x = extract_unsigned_integer ((FROM), TYPE_LENGTH(TYPE)); \
x &= 0x3ffff; \
if (REGNUM == PC_REGNUM) x >>= 2; \
store_unsigned_integer ((TO), 2, x); \
}
extern CORE_ADDR d10v_make_daddr PARAMS ((CORE_ADDR x));
#define D10V_MAKE_DADDR(x) (d10v_make_daddr (x))
extern CORE_ADDR d10v_make_iaddr PARAMS ((CORE_ADDR x));
#define D10V_MAKE_IADDR(x) (d10v_make_iaddr (x))
#define D10V_MAKE_DADDR(x) ((x) | DMEM_START)
#define D10V_MAKE_IADDR(x) (((x) << 2) | IMEM_START)
extern int d10v_daddr_p PARAMS ((CORE_ADDR x));
#define D10V_DADDR_P(X) (d10v_daddr_p (X))
extern int d10v_iaddr_p PARAMS ((CORE_ADDR x));
#define D10V_IADDR_P(X) (d10v_iaddr_p (X))
#define D10V_DADDR_P(X) (((X) & 0x3000000) == DMEM_START)
#define D10V_IADDR_P(X) (((X) & 0x3000000) == IMEM_START)
extern CORE_ADDR d10v_convert_daddr_to_raw PARAMS ((CORE_ADDR x));
#define D10V_CONVERT_DADDR_TO_RAW(X) (d10v_convert_daddr_to_raw (X))
extern CORE_ADDR d10v_convert_iaddr_to_raw PARAMS ((CORE_ADDR x));
#define D10V_CONVERT_IADDR_TO_RAW(X) (d10v_convert_iaddr_to_raw (X))
#define D10V_CONVERT_IADDR_TO_RAW(X) (((X) >> 2) & 0xffff)
#define D10V_CONVERT_DADDR_TO_RAW(X) ((X) & 0xffff)
#define ARG1_REGNUM R0_REGNUM
#define ARGN_REGNUM 3
#define RET1_REGNUM R0_REGNUM
/* Store the address of the place in which to copy the structure the
subroutine will return. This is called from call_function.
@@ -149,8 +159,8 @@ extern CORE_ADDR d10v_convert_iaddr_to_raw PARAMS ((CORE_ADDR x));
We store structs through a pointer passed in the first Argument
register. */
extern void d10v_store_struct_return PARAMS ((CORE_ADDR addr, CORE_ADDR sp));
#define STORE_STRUCT_RETURN(ADDR, SP) d10v_store_struct_return ((ADDR), (SP))
#define STORE_STRUCT_RETURN(ADDR, SP) \
{ write_register (ARG1_REGNUM, (ADDR)); }
/* Write into appropriate registers a function return value
@@ -158,16 +168,16 @@ extern void d10v_store_struct_return PARAMS ((CORE_ADDR addr, CORE_ADDR sp));
Things always get returned in RET1_REGNUM, RET2_REGNUM, ... */
extern void d10v_store_return_value PARAMS ((struct type * type, char *valbuf));
#define STORE_RETURN_VALUE(TYPE,VALBUF) d10v_store_return_value ((TYPE), (VALBUF))
#define STORE_RETURN_VALUE(TYPE,VALBUF) \
write_register_bytes (REGISTER_BYTE(RET1_REGNUM), VALBUF, TYPE_LENGTH (TYPE))
/* Extract from an array REGBUF containing the (raw) register state
the address in which a function should return its structure value,
as a CORE_ADDR (or an expression that can be used as one). */
extern CORE_ADDR d10v_extract_struct_value_address PARAMS ((char *regbuf));
#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (d10v_extract_struct_value_address ((REGBUF)))
#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
(extract_address ((REGBUF) + REGISTER_BYTE (ARG1_REGNUM), REGISTER_RAW_SIZE (ARG1_REGNUM)) | DMEM_START)
/* Should we use EXTRACT_STRUCT_VALUE_ADDRESS instead of
EXTRACT_RETURN_VALUE? GCC_P is true if compiled with gcc
@@ -178,60 +188,67 @@ extern CORE_ADDR d10v_extract_struct_value_address PARAMS ((char *regbuf));
extern use_struct_convention_fn d10v_use_struct_convention;
#define USE_STRUCT_CONVENTION(gcc_p, type) d10v_use_struct_convention (gcc_p, type)
/* Define other aspects of the stack frame.
we keep a copy of the worked out return pc lying around, since it
is a useful bit of info */
extern void d10v_init_extra_frame_info PARAMS ((int fromleaf, struct frame_info * fi));
#define EXTRA_FRAME_INFO \
CORE_ADDR return_pc; \
int frameless; \
int size;
#define INIT_EXTRA_FRAME_INFO(fromleaf, fi) \
d10v_init_extra_frame_info(fromleaf, fi)
d10v_init_extra_frame_info(fromleaf, fi)
extern void d10v_init_extra_frame_info PARAMS (( int fromleaf, struct frame_info *fi ));
/* A macro that tells us whether the function invocation represented
by FI does not have a frame on the stack associated with it. If it
does not, FRAMELESS is set to 1, else 0. */
#define FRAMELESS_FUNCTION_INVOCATION(FI) \
(frameless_look_for_prologue (FI))
#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
(FRAMELESS) = frameless_look_for_prologue(FI)
extern CORE_ADDR d10v_frame_chain PARAMS ((struct frame_info * frame));
#define FRAME_CHAIN(FRAME) d10v_frame_chain(FRAME)
extern int d10v_frame_chain_valid PARAMS ((CORE_ADDR, struct frame_info *));
#define FRAME_CHAIN_VALID(chain, thisframe) d10v_frame_chain_valid (chain, thisframe)
extern CORE_ADDR d10v_frame_saved_pc PARAMS ((struct frame_info * fi));
#define FRAME_SAVED_PC(fi) (d10v_frame_saved_pc ((fi)))
extern CORE_ADDR d10v_frame_args_address PARAMS ((struct frame_info * fi));
#define FRAME_ARGS_ADDRESS(fi) (d10v_frame_args_address ((fi)))
extern CORE_ADDR d10v_frame_locals_address PARAMS ((struct frame_info * fi));
#define FRAME_LOCALS_ADDRESS(fi) (d10v_frame_locals_address ((fi)))
#define FRAME_SAVED_PC(FRAME) ((FRAME)->return_pc)
#define FRAME_ARGS_ADDRESS(fi) (fi)->frame
#define FRAME_LOCALS_ADDRESS(fi) (fi)->frame
/* Immediately after a function call, return the saved pc. We can't */
/* use frame->return_pc beause that is determined by reading R13 off the */
/*stack and that may not be written yet. */
extern CORE_ADDR d10v_saved_pc_after_call PARAMS ((struct frame_info * frame));
#define SAVED_PC_AFTER_CALL(frame) (d10v_saved_pc_after_call ((frame)))
#define SAVED_PC_AFTER_CALL(frame) ((read_register(LR_REGNUM) << 2) | IMEM_START)
/* Set VAL to the number of args passed to frame described by FI.
Can set VAL to -1, meaning no way to tell. */
/* We can't tell how many args there are */
#define FRAME_NUM_ARGS(fi) (-1)
#define FRAME_NUM_ARGS(val,fi) (val = -1)
/* Return number of bytes at start of arglist that are not really args. */
#define FRAME_ARGS_SKIP 0
/* Put here the code to store, into frame_info->saved_regs, the
addresses of the saved registers of frame described by FRAME_INFO.
This includes special registers such as pc and fp saved in special
ways in the stack frame. sp is even more special: the address we
return for it IS the sp for the next frame. */
extern void d10v_frame_init_saved_regs PARAMS ((struct frame_info *));
#define FRAME_INIT_SAVED_REGS(frame_info) \
d10v_frame_init_saved_regs(frame_info)
/* Put here the code to store, into a struct frame_saved_regs,
the addresses of the saved registers of frame described by FRAME_INFO.
This includes special registers such as pc and fp saved in special
ways in the stack frame. sp is even more special:
the address we return for it IS the sp for the next frame. */
#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
d10v_frame_find_saved_regs(frame_info, &(frame_saved_regs))
extern void d10v_frame_find_saved_regs PARAMS ((struct frame_info *, struct frame_saved_regs *));
#define NAMES_HAVE_UNDERSCORE
/* DUMMY FRAMES. Need these to support inferior function calls. They
work like this on D10V: First we set a breakpoint at 0 or __start.
@@ -242,10 +259,10 @@ extern void d10v_frame_init_saved_regs PARAMS ((struct frame_info *));
breakpoint, clear the break point and pop the old register contents
off the stack. */
extern void d10v_pop_frame PARAMS ((void));
#define POP_FRAME d10v_pop_frame ()
extern void d10v_pop_frame PARAMS ((struct frame_info *frame));
#define POP_FRAME generic_pop_current_frame (d10v_pop_frame)
#define USE_GENERIC_DUMMY_FRAMES 1
#define USE_GENERIC_DUMMY_FRAMES
#define CALL_DUMMY {0}
#define CALL_DUMMY_START_OFFSET (0)
#define CALL_DUMMY_BREAKPOINT_OFFSET (0)
@@ -255,18 +272,18 @@ extern void d10v_pop_frame PARAMS ((void));
extern CORE_ADDR d10v_push_return_address PARAMS ((CORE_ADDR pc, CORE_ADDR sp));
#define PUSH_RETURN_ADDRESS(PC, SP) d10v_push_return_address (PC, SP)
#define PC_IN_CALL_DUMMY(PC, SP, FP) generic_pc_in_call_dummy (PC, SP, FP)
#define PC_IN_CALL_DUMMY(PC, SP, FP) generic_pc_in_call_dummy (PC, SP)
/* #define PC_IN_CALL_DUMMY(pc, sp, frame_address) ( pc == IMEM_START + 4 ) */
#define PUSH_DUMMY_FRAME generic_push_dummy_frame ()
/* override the default get_saved_register function with one that
takes account of generic CALL_DUMMY frames */
#define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) \
generic_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval)
#define GET_SAVED_REGISTER
#define get_saved_register generic_get_saved_register
#define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \
(d10v_push_arguments((nargs), (args), (sp), (struct_return), (struct_addr)))
sp = d10v_push_arguments((nargs), (args), (sp), (struct_return), (struct_addr))
extern CORE_ADDR d10v_push_arguments PARAMS ((int, struct value **, CORE_ADDR, int, CORE_ADDR));
@@ -276,9 +293,19 @@ extern CORE_ADDR d10v_push_arguments PARAMS ((int, struct value **, CORE_ADDR, i
#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
d10v_extract_return_value(TYPE, REGBUF, VALBUF)
extern void d10v_extract_return_value PARAMS ((struct type *, char *, char *));
extern void
d10v_extract_return_value PARAMS ((struct type *, char *, char *));
#define REGISTER_SIZE 2
#ifdef CC_HAS_LONG_LONG
# define LONGEST long long
#else
# define LONGEST long
#endif
#define ULONGEST unsigned LONGEST
void d10v_write_pc PARAMS ((CORE_ADDR val, int pid));
CORE_ADDR d10v_read_pc PARAMS ((int pid));
void d10v_write_sp PARAMS ((CORE_ADDR val));
@@ -298,14 +325,13 @@ CORE_ADDR d10v_read_fp PARAMS ((void));
#define TARGET_PTR_BIT (4 * TARGET_CHAR_BIT)
#define TARGET_DOUBLE_BIT (4 * TARGET_CHAR_BIT)
#define TARGET_LONG_DOUBLE_BIT (8 * TARGET_CHAR_BIT)
/* For the d10v when talking to the remote d10v board, GDB addresses
need to be translated into a format that the d10v rom monitor
understands. */
extern void remote_d10v_translate_xfer_address PARAMS ((CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR * rem_addr, int *rem_len));
int remote_d10v_translate_xfer_address PARAMS ((CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr));
#define REMOTE_TRANSLATE_XFER_ADDRESS(GDB_ADDR, GDB_LEN, REM_ADDR, REM_LEN) \
remote_d10v_translate_xfer_address ((GDB_ADDR), (GDB_LEN), (REM_ADDR), (REM_LEN))
(REM_LEN) = remote_d10v_translate_xfer_address ((GDB_ADDR), (GDB_LEN), &(REM_ADDR))
#endif

View File

@@ -1,22 +1,21 @@
/* Target-specific definition for the Mitsubishi D30V
Copyright (C) 1997 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef TM_D30V_H
#define TM_D30V_H
@@ -34,12 +33,12 @@
/* and instruction memory to. */
#define DMEM_START 0x20000000
#define IMEM_START 0x00000000 /* was 0x10000000 */
#define IMEM_START 0x00000000 /* was 0x10000000 */
#define STACK_START 0x20007ffe
#ifdef __STDC__ /* Forward decls for prototypes */
#ifdef __STDC__ /* Forward decls for prototypes */
struct frame_info;
struct frame_saved_regs;
struct frame_saved_regs;
struct type;
struct value;
#endif
@@ -47,8 +46,9 @@ struct value;
/* Advance PC across any function entry prologue instructions
to reach some "real" code. */
extern CORE_ADDR d30v_skip_prologue PARAMS ((CORE_ADDR));
#define SKIP_PROLOGUE(ip) (d30v_skip_prologue (ip))
extern CORE_ADDR d30v_skip_prologue ();
#define SKIP_PROLOGUE(ip) \
{(ip) = d30v_skip_prologue(ip);}
/* Stack grows downward. */
@@ -94,9 +94,9 @@ extern CORE_ADDR d30v_skip_prologue PARAMS ((CORE_ADDR));
#define SPU_REGNUM 65 /* User stack pointer */
#define CREGS_START 66
#define PSW_REGNUM (CREGS_START + 0) /* psw, bpsw, or dpsw??? */
#define PSW_REGNUM (CREGS_START + 0) /* psw, bpsw, or dpsw??? */
#define PSW_SM (((unsigned long)0x80000000) >> 0) /* Stack mode: 0/SPI */
/* 1/SPU */
/* 1/SPU */
#define PSW_EA (((unsigned long)0x80000000) >> 2) /* Execution status */
#define PSW_DB (((unsigned long)0x80000000) >> 3) /* Debug mode */
#define PSW_DS (((unsigned long)0x80000000) >> 4) /* Debug EIT status */
@@ -112,25 +112,25 @@ extern CORE_ADDR d30v_skip_prologue PARAMS ((CORE_ADDR));
#define PSW_VA (((unsigned long)0x80000000) >> 29) /* Accum. overflow */
#define PSW_C (((unsigned long)0x80000000) >> 31) /* Carry/Borrow flag */
#define BPSW_REGNUM (CREGS_START + 1) /* Backup PSW (on interrupt) */
#define PC_REGNUM (CREGS_START + 2) /* pc, bpc, or dpc??? */
#define BPC_REGNUM (CREGS_START + 3) /* Backup PC (on interrupt) */
#define DPSW_REGNUM (CREGS_START + 4) /* Backup PSW (on debug trap) */
#define DPC_REGNUM (CREGS_START + 5) /* Backup PC (on debug trap) */
#define RPT_C_REGNUM (CREGS_START + 7) /* Loop count */
#define RPT_S_REGNUM (CREGS_START + 8) /* Loop start address */
#define RPT_E_REGNUM (CREGS_START + 9) /* Loop end address */
#define BPSW_REGNUM (CREGS_START + 1) /* Backup PSW (on interrupt) */
#define PC_REGNUM (CREGS_START + 2) /* pc, bpc, or dpc??? */
#define BPC_REGNUM (CREGS_START + 3) /* Backup PC (on interrupt) */
#define DPSW_REGNUM (CREGS_START + 4) /* Backup PSW (on debug trap) */
#define DPC_REGNUM (CREGS_START + 5) /* Backup PC (on debug trap) */
#define RPT_C_REGNUM (CREGS_START + 7) /* Loop count */
#define RPT_S_REGNUM (CREGS_START + 8) /* Loop start address*/
#define RPT_E_REGNUM (CREGS_START + 9) /* Loop end address */
#define MOD_S_REGNUM (CREGS_START + 10)
#define MOD_E_REGNUM (CREGS_START + 11)
#define IBA_REGNUM (CREGS_START + 14) /* Instruction break address */
#define EIT_VB_REGNUM (CREGS_START + 15) /* Vector base address */
#define INT_S_REGNUM (CREGS_START + 16) /* Interrupt status */
#define INT_M_REGNUM (CREGS_START + 17) /* Interrupt mask */
#define IBA_REGNUM (CREGS_START + 14) /* Instruction break address */
#define EIT_VB_REGNUM (CREGS_START + 15) /* Vector base address */
#define INT_S_REGNUM (CREGS_START + 16) /* Interrupt status */
#define INT_M_REGNUM (CREGS_START + 17) /* Interrupt mask */
#define A0_REGNUM 84
#define A1_REGNUM 85
/* Say how much memory is needed to store a copy of the register set */
#define REGISTER_BYTES ((NUM_REGS - 2) * 4 + 2 * 8)
#define REGISTER_BYTES ((NUM_REGS - 2) * 4 + 2 * 8)
/* Index within `registers' of the first byte of the space for
register N. */
@@ -144,7 +144,7 @@ extern CORE_ADDR d30v_skip_prologue PARAMS ((CORE_ADDR));
#define REGISTER_RAW_SIZE(N) ( ((N) >= A0_REGNUM) ? 8 : 4 )
/* Number of bytes of storage in the program's representation
for register N. */
for register N. */
#define REGISTER_VIRTUAL_SIZE(N) REGISTER_RAW_SIZE(N)
/* Largest value REGISTER_RAW_SIZE can have. */
@@ -205,21 +205,21 @@ void d30v_do_registers_info PARAMS ((int regnum, int fpregs));
int size;
#define INIT_EXTRA_FRAME_INFO(fromleaf, fi) \
d30v_init_extra_frame_info(fromleaf, fi)
d30v_init_extra_frame_info(fromleaf, fi)
extern void d30v_init_extra_frame_info PARAMS ((int fromleaf, struct frame_info * fi));
extern void d30v_init_extra_frame_info PARAMS (( int fromleaf, struct frame_info *fi ));
/* A macro that tells us whether the function invocation represented
by FI does not have a frame on the stack associated with it. If it
does not, FRAMELESS is set to 1, else 0. */
#define FRAMELESS_FUNCTION_INVOCATION(FI) \
(frameless_look_for_prologue (FI))
#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
(FRAMELESS) = frameless_look_for_prologue(FI)
#define FRAME_CHAIN(FRAME) d30v_frame_chain(FRAME)
extern int d30v_frame_chain_valid PARAMS ((CORE_ADDR, struct frame_info *));
#define FRAME_CHAIN_VALID(chain, thisframe) d30v_frame_chain_valid (chain, thisframe)
#define FRAME_SAVED_PC(FRAME) ((FRAME)->return_pc)
#define FRAME_SAVED_PC(FRAME) ((FRAME)->return_pc)
#define FRAME_ARGS_ADDRESS(fi) (fi)->frame
#define FRAME_LOCALS_ADDRESS(fi) (fi)->frame
@@ -231,12 +231,12 @@ extern int d30v_frame_chain_valid PARAMS ((CORE_ADDR, struct frame_info *));
/* stack and that may not be written yet. */
#define SAVED_PC_AFTER_CALL(frame) (read_register(LR_REGNUM))
/* Set VAL to the number of args passed to frame described by FI.
Can set VAL to -1, meaning no way to tell. */
/* We can't tell how many args there are */
#define FRAME_NUM_ARGS(fi) (-1)
#define FRAME_NUM_ARGS(val,fi) (val = -1)
/* Return number of bytes at start of arglist that are not really args. */
@@ -254,6 +254,8 @@ extern int d30v_frame_chain_valid PARAMS ((CORE_ADDR, struct frame_info *));
extern void d30v_frame_find_saved_regs PARAMS ((struct frame_info *, struct frame_saved_regs *));
#define NAMES_HAVE_UNDERSCORE
/* DUMMY FRAMES. Need these to support inferior function calls.
They work like this on D30V:
First we set a breakpoint at 0 or __start.
@@ -264,9 +266,9 @@ extern void d30v_frame_find_saved_regs PARAMS ((struct frame_info *, struct fram
When it hits the breakpoint, clear the break point and pop the old
register contents off the stack. */
#define CALL_DUMMY { 0 }
#define CALL_DUMMY { 0 }
#define PUSH_DUMMY_FRAME
#define CALL_DUMMY_START_OFFSET 0
#define CALL_DUMMY_START_OFFSET 0
#define CALL_DUMMY_LOCATION AT_ENTRY_POINT
#define CALL_DUMMY_BREAKPOINT_OFFSET (0)
@@ -279,10 +281,10 @@ sp = d30v_fix_call_dummy (dummyname, pc, fun, nargs, args, type, gcc_p)
#define PC_IN_CALL_DUMMY(pc, sp, frame_address) ( pc == IMEM_START + 4 )
extern CORE_ADDR d30v_fix_call_dummy PARAMS ((char *, CORE_ADDR, CORE_ADDR,
int, struct value **,
struct type *, int));
int, struct value **,
struct type *, int));
#define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \
(d30v_push_arguments((nargs), (args), (sp), (struct_return), (struct_addr)))
sp = d30v_push_arguments((nargs), (args), (sp), (struct_return), (struct_addr))
extern CORE_ADDR d30v_push_arguments PARAMS ((int, struct value **, CORE_ADDR, int, CORE_ADDR));
@@ -292,14 +294,14 @@ extern CORE_ADDR d30v_push_arguments PARAMS ((int, struct value **, CORE_ADDR, i
#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
d30v_extract_return_value(TYPE, REGBUF, VALBUF)
extern void
extern void
d30v_extract_return_value PARAMS ((struct type *, char *, char *));
/* Discard from the stack the innermost frame,
restoring all saved registers. */
#define POP_FRAME d30v_pop_frame();
extern void d30v_pop_frame PARAMS ((void));
extern void d30v_pop_frame PARAMS((void));
#define REGISTER_SIZE 4

View File

@@ -1,22 +1,20 @@
/* Parameters for execution on a Fujitsu FR30 processor.
Copyright 1999, Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define FR30_GENREGS 16
#define FR30_DEDICATEDREGS 8
@@ -85,7 +83,7 @@
#define REGISTER_RAW_SIZE(N) FR30_REGSIZE
/* Largest value REGISTER_RAW_SIZE can have. */
#define MAX_REGISTER_RAW_SIZE FR30_REGSIZE
#define MAX_REGISTER_RAW_SIZE FR30_REGSIZE
/* Number of bytes of storage in the program's representation
for register N. */
@@ -97,7 +95,7 @@
extern void fr30_pop_frame PARAMS ((void));
#define POP_FRAME fr30_pop_frame()
#define USE_GENERIC_DUMMY_FRAMES 1
#define USE_GENERIC_DUMMY_FRAMES
#define CALL_DUMMY {0}
#define CALL_DUMMY_START_OFFSET (0)
#define CALL_DUMMY_BREAKPOINT_OFFSET (0)
@@ -131,14 +129,14 @@ extern void fr30_pop_frame PARAMS ((void));
#define STORE_STRUCT_RETURN(ADDR, SP) \
{ write_register (RETVAL_REG, (ADDR)); }
#define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)
#define FRAME_ARGS_ADDRESS(fi) (fi->frame)
#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
/* Return number of args passed to a frame.
Can return -1, meaning no way to tell. */
#define FRAME_NUM_ARGS(fi) (-1)
#define FRAME_NUM_ARGS(numargs, fi) (numargs = -1)
#ifdef __STDC__ /* Forward decls for prototypes */
#ifdef __STDC__ /* Forward decls for prototypes */
struct frame_info;
struct frame_saved_regs;
struct type;
@@ -151,25 +149,22 @@ struct value;
int frameoffset; \
int framereg;
extern CORE_ADDR fr30_frame_chain PARAMS ((struct frame_info * fi));
extern CORE_ADDR fr30_frame_chain PARAMS ((struct frame_info *fi));
#define FRAME_CHAIN(fi) fr30_frame_chain (fi)
extern CORE_ADDR fr30_frame_saved_pc PARAMS ((struct frame_info *));
extern CORE_ADDR fr30_frame_saved_pc PARAMS ((struct frame_info *));
#define FRAME_SAVED_PC(fi) (fr30_frame_saved_pc (fi))
#define SAVED_PC_AFTER_CALL(fi) read_register (RP_REGNUM)
extern CORE_ADDR fr30_skip_prologue PARAMS ((CORE_ADDR pc));
#define SKIP_PROLOGUE(pc) (fr30_skip_prologue (pc))
#define SKIP_PROLOGUE(pc) pc = fr30_skip_prologue (pc)
/* Write into appropriate registers a function return value of type
TYPE, given in virtual format. VALBUF is in the target byte order;
it's typically the VALUE_CONTENTS of some struct value, and those
are in the target's byte order. */
extern void fr30_store_return_value PARAMS ((struct type * type, char *valbuf));
/* Write into appropriate registers a function return value
of type TYPE, given in virtual format. */
#define STORE_RETURN_VALUE(TYPE,VALBUF) \
(fr30_store_return_value ((TYPE), (VALBUF)))
write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE))
/* Put here the code to store, into a struct frame_saved_regs,
the addresses of the saved registers of frame described by FRAME_INFO.
@@ -191,24 +186,32 @@ extern void fr30_store_return_value PARAMS ((struct type * type, char *valbuf));
/* Define other aspects of the stack frame. */
/* An expression that tells us whether the function invocation represented
by FI does not have a frame on the stack associated with it. */
extern int fr30_frameless_function_invocation PARAMS ((struct frame_info * frame));
#define FRAMELESS_FUNCTION_INVOCATION(FI) (fr30_frameless_function_invocation (FI));
/* A macro that tells us whether the function invocation represented
by FI does not have a frame on the stack associated with it. If it
does not, FRAMELESS is set to 1, else 0. */
#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
{ \
CORE_ADDR func_start, after_prologue; \
func_start = (get_pc_function_start ((FI)->pc) + \
FUNCTION_START_OFFSET); \
after_prologue = func_start; \
SKIP_PROLOGUE (after_prologue); \
(FRAMELESS) = (after_prologue == func_start); \
}
extern void fr30_init_extra_frame_info PARAMS ((struct frame_info * fi));
extern void fr30_init_extra_frame_info PARAMS ((struct frame_info *fi));
#define INIT_EXTRA_FRAME_INFO(fromleaf, fi) fr30_init_extra_frame_info (fi)
#define FRAME_CHAIN_VALID(FP, FI) generic_frame_chain_valid (FP, FI)
extern CORE_ADDR
fr30_push_arguments PARAMS ((int nargs, struct value ** args, CORE_ADDR sp,
int struct_return,
CORE_ADDR struct_addr));
fr30_push_arguments PARAMS ((int nargs, struct value **args, CORE_ADDR sp,
int struct_return,
CORE_ADDR struct_addr));
#define PUSH_ARGUMENTS(NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR) \
(fr30_push_arguments (NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR))
(SP) = fr30_push_arguments (NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR)
#define PC_IN_CALL_DUMMY(PC, SP, FP) generic_pc_in_call_dummy (PC, SP, FP)
#define PC_IN_CALL_DUMMY(PC, SP, FP) generic_pc_in_call_dummy (PC, SP)
/* Fujitsu's ABI requires all structs to be passed using a pointer.
That is obviously not very efficient, so I am leaving the definitions
@@ -227,12 +230,3 @@ extern CORE_ADDR
#endif
/* alway return struct by value by input pointer */
#define USE_STRUCT_CONVENTION(GCC_P, TYPE) 1
/* The stack should always be aligned on a four-word boundary. */
#define STACK_ALIGN(len) (((len) + 3) & ~3)
/* I think the comment about this in value_arg_coerce is wrong; this
should be true on any system where you can rely on the prototyping
information. When this is true, value_arg_coerce will promote
floats to doubles iff the function is not prototyped. */
#define COERCE_FLOAT_TO_DOUBLE 1

View File

@@ -31,48 +31,48 @@
/* OBSOLETE #define NO_GNU_STABS */
/* OBSOLETE */
/* OBSOLETE /* Macro for text-offset and data info (in NPL a.out format). *x/ */
/* OBSOLETE #define TEXTINFO \ */
/* OBSOLETE text_offset = N_TXTOFF (exec_coffhdr, exec_aouthdr); \ */
/* OBSOLETE #define TEXTINFO \ */
/* OBSOLETE text_offset = N_TXTOFF (exec_coffhdr, exec_aouthdr); \ */
/* OBSOLETE exec_data_offset = N_TXTOFF (exec_coffhdr, exec_aouthdr)\ */
/* OBSOLETE + exec_aouthdr.a_text */
/* OBSOLETE */
/* OBSOLETE /* Macro for number of symbol table entries *x/ */
/* OBSOLETE #define NUMBER_OF_SYMBOLS \ */
/* OBSOLETE (coffhdr.f_nsyms) */
/* OBSOLETE #define NUMBER_OF_SYMBOLS \ */
/* OBSOLETE (coffhdr.f_nsyms) */
/* OBSOLETE */
/* OBSOLETE /* Macro for file-offset of symbol table (in NPL a.out format). *x/ */
/* OBSOLETE #define SYMBOL_TABLE_OFFSET \ */
/* OBSOLETE N_SYMOFF (coffhdr) */
/* OBSOLETE #define SYMBOL_TABLE_OFFSET \ */
/* OBSOLETE N_SYMOFF (coffhdr) */
/* OBSOLETE */
/* OBSOLETE /* Macro for file-offset of string table (in NPL a.out format). *x/ */
/* OBSOLETE #define STRING_TABLE_OFFSET \ */
/* OBSOLETE (N_STROFF (coffhdr)) */
/* OBSOLETE #define STRING_TABLE_OFFSET \ */
/* OBSOLETE (N_STROFF (coffhdr)) */
/* OBSOLETE */
/* OBSOLETE /* Macro to store the length of the string table data in INTO. *x/ */
/* OBSOLETE #define READ_STRING_TABLE_SIZE(INTO) \ */
/* OBSOLETE { INTO = hdr.a_stsize; } */
/* OBSOLETE #define READ_STRING_TABLE_SIZE(INTO) \ */
/* OBSOLETE { INTO = hdr.a_stsize; } */
/* OBSOLETE */
/* OBSOLETE /* Macro to declare variables to hold the file's header data. *x/ */
/* OBSOLETE #define DECLARE_FILE_HEADERS struct exec hdr; \ */
/* OBSOLETE FILHDR coffhdr */
/* OBSOLETE #define DECLARE_FILE_HEADERS struct exec hdr; \ */
/* OBSOLETE FILHDR coffhdr */
/* OBSOLETE */
/* OBSOLETE /* Macro to read the header data from descriptor DESC and validate it. */
/* OBSOLETE NAME is the file name, for error messages. *x/ */
/* OBSOLETE #define READ_FILE_HEADERS(DESC, NAME) \ */
/* OBSOLETE { val = myread (DESC, &coffhdr, sizeof coffhdr); \ */
/* OBSOLETE if (val < 0) \ */
/* OBSOLETE perror_with_name (NAME); \ */
/* OBSOLETE val = myread (DESC, &hdr, sizeof hdr); \ */
/* OBSOLETE if (val < 0) \ */
/* OBSOLETE perror_with_name (NAME); \ */
/* OBSOLETE if (coffhdr.f_magic != GNP1MAGIC) \ */
/* OBSOLETE error ("File \"%s\" not in coff executable format.", NAME); \ */
/* OBSOLETE if (N_BADMAG (hdr)) \ */
/* OBSOLETE #define READ_FILE_HEADERS(DESC, NAME) \ */
/* OBSOLETE { val = myread (DESC, &coffhdr, sizeof coffhdr); \ */
/* OBSOLETE if (val < 0) \ */
/* OBSOLETE perror_with_name (NAME); \ */
/* OBSOLETE val = myread (DESC, &hdr, sizeof hdr); \ */
/* OBSOLETE if (val < 0) \ */
/* OBSOLETE perror_with_name (NAME); \ */
/* OBSOLETE if (coffhdr.f_magic != GNP1MAGIC) \ */
/* OBSOLETE error ("File \"%s\" not in coff executable format.", NAME); \ */
/* OBSOLETE if (N_BADMAG (hdr)) \ */
/* OBSOLETE error ("File \"%s\" not in executable format.", NAME); } */
/* OBSOLETE */
/* OBSOLETE /* Define COFF and other symbolic names needed on NP1 *x/ */
/* OBSOLETE #define NS32GMAGIC GNP1MAGIC */
/* OBSOLETE #define NS32SMAGIC GPNMAGIC */
/* OBSOLETE #define NS32GMAGIC GNP1MAGIC */
/* OBSOLETE #define NS32SMAGIC GPNMAGIC */
/* OBSOLETE */
/* OBSOLETE /* Address of blocks in N_LBRAC and N_RBRAC symbols are absolute addresses, */
/* OBSOLETE not relative to start of source address. *x/ */
@@ -80,7 +80,7 @@
/* OBSOLETE */
/* OBSOLETE /* Offset from address of function to start of its code. */
/* OBSOLETE Zero on most machines. *x/ */
/* OBSOLETE #define FUNCTION_START_OFFSET 8 */
/* OBSOLETE #define FUNCTION_START_OFFSET 8 */
/* OBSOLETE */
/* OBSOLETE /* Advance PC across any function entry prologue instructions */
/* OBSOLETE to reach some "real" code. One NPL we can have one two startup */
@@ -97,70 +97,70 @@
/* OBSOLETE or */
/* OBSOLETE Optional "stw r2,8(b3)" (Gould first argument register passing) */
/* OBSOLETE *x/ */
/* OBSOLETE #define SKIP_PROLOGUE(pc) { \ */
/* OBSOLETE register int op = read_memory_integer ((pc), 4); \ */
/* OBSOLETE if ((op & 0xffff0000) == 0xFA0B0000) { \ */
/* OBSOLETE pc += 4; \ */
/* OBSOLETE op = read_memory_integer ((pc), 4); \ */
/* OBSOLETE if ((op & 0xffff0000) == 0x59400000) { \ */
/* OBSOLETE pc += 4; \ */
/* OBSOLETE op = read_memory_integer ((pc), 4); \ */
/* OBSOLETE if ((op & 0xffff0000) == 0x5F000000) { \ */
/* OBSOLETE pc += 4; \ */
/* OBSOLETE op = read_memory_integer ((pc), 4); \ */
/* OBSOLETE if (op == 0xD4820008) { \ */
/* OBSOLETE pc += 4; \ */
/* OBSOLETE op = read_memory_integer ((pc), 4); \ */
/* OBSOLETE if (op == 0x5582000C) { \ */
/* OBSOLETE pc += 4; \ */
/* OBSOLETE op = read_memory_integer ((pc), 2); \ */
/* OBSOLETE if (op == 0x2fa0) { \ */
/* OBSOLETE pc += 2; \ */
/* OBSOLETE } else { \ */
/* OBSOLETE op = read_memory_integer ((pc), 4); \ */
/* OBSOLETE if (op == 0xd5030008) { \ */
/* OBSOLETE pc += 4; \ */
/* OBSOLETE } \ */
/* OBSOLETE } \ */
/* OBSOLETE } else { \ */
/* OBSOLETE op = read_memory_integer ((pc), 2); \ */
/* OBSOLETE if (op == 0x2fa0) { \ */
/* OBSOLETE pc += 2; \ */
/* OBSOLETE } \ */
/* OBSOLETE } \ */
/* OBSOLETE } \ */
/* OBSOLETE } \ */
/* OBSOLETE } \ */
/* OBSOLETE } \ */
/* OBSOLETE if ((op & 0xffff0000) == 0x59000000) { \ */
/* OBSOLETE pc += 4; \ */
/* OBSOLETE op = read_memory_integer ((pc), 4); \ */
/* OBSOLETE if ((op & 0xffff0000) == 0x5F000000) { \ */
/* OBSOLETE pc += 4; \ */
/* OBSOLETE op = read_memory_integer ((pc), 4); \ */
/* OBSOLETE if (op == 0xD4820008) { \ */
/* OBSOLETE pc += 4; \ */
/* OBSOLETE op = read_memory_integer ((pc), 4); \ */
/* OBSOLETE if (op == 0x5582000C) { \ */
/* OBSOLETE pc += 4; \ */
/* OBSOLETE op = read_memory_integer ((pc), 2); \ */
/* OBSOLETE if (op == 0x2fa0) { \ */
/* OBSOLETE pc += 2; \ */
/* OBSOLETE } else { \ */
/* OBSOLETE op = read_memory_integer ((pc), 4); \ */
/* OBSOLETE if (op == 0xd5030008) { \ */
/* OBSOLETE pc += 4; \ */
/* OBSOLETE } \ */
/* OBSOLETE } \ */
/* OBSOLETE } else { \ */
/* OBSOLETE op = read_memory_integer ((pc), 2); \ */
/* OBSOLETE if (op == 0x2fa0) { \ */
/* OBSOLETE pc += 2; \ */
/* OBSOLETE } \ */
/* OBSOLETE } \ */
/* OBSOLETE } \ */
/* OBSOLETE } \ */
/* OBSOLETE } \ */
/* OBSOLETE #define SKIP_PROLOGUE(pc) { \ */
/* OBSOLETE register int op = read_memory_integer ((pc), 4); \ */
/* OBSOLETE if ((op & 0xffff0000) == 0xFA0B0000) { \ */
/* OBSOLETE pc += 4; \ */
/* OBSOLETE op = read_memory_integer ((pc), 4); \ */
/* OBSOLETE if ((op & 0xffff0000) == 0x59400000) { \ */
/* OBSOLETE pc += 4; \ */
/* OBSOLETE op = read_memory_integer ((pc), 4); \ */
/* OBSOLETE if ((op & 0xffff0000) == 0x5F000000) { \ */
/* OBSOLETE pc += 4; \ */
/* OBSOLETE op = read_memory_integer ((pc), 4); \ */
/* OBSOLETE if (op == 0xD4820008) { \ */
/* OBSOLETE pc += 4; \ */
/* OBSOLETE op = read_memory_integer ((pc), 4); \ */
/* OBSOLETE if (op == 0x5582000C) { \ */
/* OBSOLETE pc += 4; \ */
/* OBSOLETE op = read_memory_integer ((pc), 2); \ */
/* OBSOLETE if (op == 0x2fa0) { \ */
/* OBSOLETE pc += 2; \ */
/* OBSOLETE } else { \ */
/* OBSOLETE op = read_memory_integer ((pc), 4); \ */
/* OBSOLETE if (op == 0xd5030008) { \ */
/* OBSOLETE pc += 4; \ */
/* OBSOLETE } \ */
/* OBSOLETE } \ */
/* OBSOLETE } else { \ */
/* OBSOLETE op = read_memory_integer ((pc), 2); \ */
/* OBSOLETE if (op == 0x2fa0) { \ */
/* OBSOLETE pc += 2; \ */
/* OBSOLETE } \ */
/* OBSOLETE } \ */
/* OBSOLETE } \ */
/* OBSOLETE } \ */
/* OBSOLETE } \ */
/* OBSOLETE } \ */
/* OBSOLETE if ((op & 0xffff0000) == 0x59000000) { \ */
/* OBSOLETE pc += 4; \ */
/* OBSOLETE op = read_memory_integer ((pc), 4); \ */
/* OBSOLETE if ((op & 0xffff0000) == 0x5F000000) { \ */
/* OBSOLETE pc += 4; \ */
/* OBSOLETE op = read_memory_integer ((pc), 4); \ */
/* OBSOLETE if (op == 0xD4820008) { \ */
/* OBSOLETE pc += 4; \ */
/* OBSOLETE op = read_memory_integer ((pc), 4); \ */
/* OBSOLETE if (op == 0x5582000C) { \ */
/* OBSOLETE pc += 4; \ */
/* OBSOLETE op = read_memory_integer ((pc), 2); \ */
/* OBSOLETE if (op == 0x2fa0) { \ */
/* OBSOLETE pc += 2; \ */
/* OBSOLETE } else { \ */
/* OBSOLETE op = read_memory_integer ((pc), 4); \ */
/* OBSOLETE if (op == 0xd5030008) { \ */
/* OBSOLETE pc += 4; \ */
/* OBSOLETE } \ */
/* OBSOLETE } \ */
/* OBSOLETE } else { \ */
/* OBSOLETE op = read_memory_integer ((pc), 2); \ */
/* OBSOLETE if (op == 0x2fa0) { \ */
/* OBSOLETE pc += 2; \ */
/* OBSOLETE } \ */
/* OBSOLETE } \ */
/* OBSOLETE } \ */
/* OBSOLETE } \ */
/* OBSOLETE } \ */
/* OBSOLETE } */
/* OBSOLETE */
/* OBSOLETE /* Immediately after a function call, return the saved pc. */
@@ -169,10 +169,10 @@
/* OBSOLETE some instructions. True on NPL! Return address is in R1. */
/* OBSOLETE The true return address is REALLY 4 past that location! *x/ */
/* OBSOLETE #define SAVED_PC_AFTER_CALL(frame) \ */
/* OBSOLETE (read_register(R1_REGNUM) + 4) */
/* OBSOLETE (read_register(R1_REGNUM) + 4) */
/* OBSOLETE */
/* OBSOLETE /* Address of end of stack space. *x/ */
/* OBSOLETE #define STACK_END_ADDR 0x7fffc000 */
/* OBSOLETE #define STACK_END_ADDR 0x7fffc000 */
/* OBSOLETE */
/* OBSOLETE /* Stack grows downward. *x/ */
/* OBSOLETE #define INNER_THAN(lhs,rhs) ((lhs) < (rhs)) */
@@ -181,15 +181,15 @@
/* OBSOLETE This is padded out to the size of a machine word. When it was just */
/* OBSOLETE {0x28, 0x09} it gave problems if hit breakpoint on returning from a */
/* OBSOLETE function call. *x/ */
/* OBSOLETE #define BREAKPOINT {0x28, 0x09, 0x0, 0x0} */
/* OBSOLETE #define BREAKPOINT {0x28, 0x09, 0x0, 0x0} */
/* OBSOLETE */
/* OBSOLETE /* Amount PC must be decremented by after a breakpoint. */
/* OBSOLETE This is often the number of bytes in BREAKPOINT */
/* OBSOLETE but not always. *x/ */
/* OBSOLETE #define DECR_PC_AFTER_BREAK 2 */
/* OBSOLETE #define DECR_PC_AFTER_BREAK 2 */
/* OBSOLETE */
/* OBSOLETE /* Return 1 if P points to an invalid floating point value. *x/ */
/* OBSOLETE #define INVALID_FLOAT(p, len) ((*(short *)p & 0xff80) == 0x8000) */
/* OBSOLETE #define INVALID_FLOAT(p, len) ((*(short *)p & 0xff80) == 0x8000) */
/* OBSOLETE */
/* OBSOLETE /* Say how long (ordinary) registers are. This is a piece of bogosity */
/* OBSOLETE used in push_word and a few other places; REGISTER_RAW_SIZE is the */
@@ -198,13 +198,13 @@
/* OBSOLETE #define REGISTER_SIZE 4 */
/* OBSOLETE */
/* OBSOLETE /* Size of bytes of vector register (NP1 only), 32 elements * sizeof(int) *x/ */
/* OBSOLETE #define VR_SIZE 128 */
/* OBSOLETE #define VR_SIZE 128 */
/* OBSOLETE */
/* OBSOLETE /* Number of machine registers *x/ */
/* OBSOLETE #define NUM_REGS 27 */
/* OBSOLETE #define NUM_GEN_REGS 16 */
/* OBSOLETE #define NUM_CPU_REGS 4 */
/* OBSOLETE #define NUM_VECTOR_REGS 7 */
/* OBSOLETE #define NUM_REGS 27 */
/* OBSOLETE #define NUM_GEN_REGS 16 */
/* OBSOLETE #define NUM_CPU_REGS 4 */
/* OBSOLETE #define NUM_VECTOR_REGS 7 */
/* OBSOLETE */
/* OBSOLETE /* Initializer for an array of names of registers. */
/* OBSOLETE There should be NUM_REGS strings in this initializer. *x/ */
@@ -221,52 +221,52 @@
/* OBSOLETE and some are "phony" register numbers which are too large */
/* OBSOLETE to be actual register numbers as far as the user is concerned */
/* OBSOLETE but do serve to get the desired values when passed to read_register. *x/ */
/* OBSOLETE #define R1_REGNUM 1 /* Gr1 => return address of caller *x/ */
/* OBSOLETE #define R2_REGNUM 2 /* Gr2 => return value from function *x/ */
/* OBSOLETE #define R4_REGNUM 4 /* Gr4 => register save area *x/ */
/* OBSOLETE #define R5_REGNUM 5 /* Gr5 => register save area *x/ */
/* OBSOLETE #define R6_REGNUM 6 /* Gr6 => register save area *x/ */
/* OBSOLETE #define R7_REGNUM 7 /* Gr7 => register save area *x/ */
/* OBSOLETE #define B1_REGNUM 9 /* Br1 => start of this code routine *x/ */
/* OBSOLETE #define SP_REGNUM 10 /* Br2 == (sp) *x/ */
/* OBSOLETE #define AP_REGNUM 11 /* Br3 == (ap) *x/ */
/* OBSOLETE #define FP_REGNUM 16 /* A copy of Br2 saved in trap *x/ */
/* OBSOLETE #define PS_REGNUM 17 /* Contains processor status *x/ */
/* OBSOLETE #define PC_REGNUM 18 /* Contains program counter *x/ */
/* OBSOLETE #define VE_REGNUM 19 /* Vector end (user setup) register *x/ */
/* OBSOLETE #define V1_REGNUM 20 /* First vector register *x/ */
/* OBSOLETE #define V7_REGNUM 26 /* First vector register *x/ */
/* OBSOLETE #define R1_REGNUM 1 /* Gr1 => return address of caller *x/ */
/* OBSOLETE #define R2_REGNUM 2 /* Gr2 => return value from function *x/ */
/* OBSOLETE #define R4_REGNUM 4 /* Gr4 => register save area *x/ */
/* OBSOLETE #define R5_REGNUM 5 /* Gr5 => register save area *x/ */
/* OBSOLETE #define R6_REGNUM 6 /* Gr6 => register save area *x/ */
/* OBSOLETE #define R7_REGNUM 7 /* Gr7 => register save area *x/ */
/* OBSOLETE #define B1_REGNUM 9 /* Br1 => start of this code routine *x/ */
/* OBSOLETE #define SP_REGNUM 10 /* Br2 == (sp) *x/ */
/* OBSOLETE #define AP_REGNUM 11 /* Br3 == (ap) *x/ */
/* OBSOLETE #define FP_REGNUM 16 /* A copy of Br2 saved in trap *x/ */
/* OBSOLETE #define PS_REGNUM 17 /* Contains processor status *x/ */
/* OBSOLETE #define PC_REGNUM 18 /* Contains program counter *x/ */
/* OBSOLETE #define VE_REGNUM 19 /* Vector end (user setup) register *x/ */
/* OBSOLETE #define V1_REGNUM 20 /* First vector register *x/ */
/* OBSOLETE #define V7_REGNUM 26 /* First vector register *x/ */
/* OBSOLETE */
/* OBSOLETE /* Total amount of space needed to store our copies of the machine's */
/* OBSOLETE register state, the array `registers'. *x/ */
/* OBSOLETE #define REGISTER_BYTES \ */
/* OBSOLETE (NUM_GEN_REGS*4 + NUM_VECTOR_REGS*VR_SIZE + NUM_CPU_REGS*4) */
/* OBSOLETE (NUM_GEN_REGS*4 + NUM_VECTOR_REGS*VR_SIZE + NUM_CPU_REGS*4) */
/* OBSOLETE */
/* OBSOLETE /* Index within `registers' of the first byte of the space for */
/* OBSOLETE register N. *x/ */
/* OBSOLETE #define REGISTER_BYTE(N) \ */
/* OBSOLETE (((N) < V1_REGNUM) ? ((N) * 4) : (((N) - V1_REGNUM) * VR_SIZE) + 80) */
/* OBSOLETE (((N) < V1_REGNUM) ? ((N) * 4) : (((N) - V1_REGNUM) * VR_SIZE) + 80) */
/* OBSOLETE */
/* OBSOLETE /* Number of bytes of storage in the actual machine representation */
/* OBSOLETE for register N. On the NP1, all normal regs are 4 bytes, but */
/* OBSOLETE the vector registers are VR_SIZE*4 bytes long. *x/ */
/* OBSOLETE #define REGISTER_RAW_SIZE(N) \ */
/* OBSOLETE (((N) < V1_REGNUM) ? 4 : VR_SIZE) */
/* OBSOLETE (((N) < V1_REGNUM) ? 4 : VR_SIZE) */
/* OBSOLETE */
/* OBSOLETE /* Number of bytes of storage in the program's representation */
/* OBSOLETE for register N. On the NP1, all regs are 4 bytes. *x/ */
/* OBSOLETE #define REGISTER_VIRTUAL_SIZE(N) \ */
/* OBSOLETE (((N) < V1_REGNUM) ? 4 : VR_SIZE) */
/* OBSOLETE (((N) < V1_REGNUM) ? 4 : VR_SIZE) */
/* OBSOLETE */
/* OBSOLETE /* Largest value REGISTER_RAW_SIZE can have. *x/ */
/* OBSOLETE #define MAX_REGISTER_RAW_SIZE VR_SIZE */
/* OBSOLETE #define MAX_REGISTER_RAW_SIZE VR_SIZE */
/* OBSOLETE */
/* OBSOLETE /* Largest value REGISTER_VIRTUAL_SIZE can have. *x/ */
/* OBSOLETE #define MAX_REGISTER_VIRTUAL_SIZE VR_SIZE */
/* OBSOLETE #define MAX_REGISTER_VIRTUAL_SIZE VR_SIZE */
/* OBSOLETE */
/* OBSOLETE /* Return the GDB type object for the "standard" data type */
/* OBSOLETE of data in register N. *x/ */
/* OBSOLETE #define REGISTER_VIRTUAL_TYPE(N) \ */
/* OBSOLETE #define REGISTER_VIRTUAL_TYPE(N) \ */
/* OBSOLETE ((N) > VE_REGNUM ? builtin_type_np1_vector : builtin_type_int) */
/* OBSOLETE extern struct type *builtin_type_np1_vector; */
/* OBSOLETE */
@@ -283,14 +283,14 @@
/* OBSOLETE into VALBUF. *x/ */
/* OBSOLETE */
/* OBSOLETE #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ */
/* OBSOLETE memcpy (VALBUF, ((int *)(REGBUF)) + 2, TYPE_LENGTH (TYPE)) */
/* OBSOLETE memcpy (VALBUF, ((int *)(REGBUF)) + 2, TYPE_LENGTH (TYPE)) */
/* OBSOLETE */
/* OBSOLETE /* Write into appropriate registers a function return value */
/* OBSOLETE of type TYPE, given in virtual format. *x/ */
/* OBSOLETE */
/* OBSOLETE #define STORE_RETURN_VALUE(TYPE,VALBUF) \ */
/* OBSOLETE write_register_bytes (REGISTER_BYTE (R2_REGNUM), VALBUF, \ */
/* OBSOLETE TYPE_LENGTH (TYPE)) */
/* OBSOLETE write_register_bytes (REGISTER_BYTE (R2_REGNUM), VALBUF, \ */
/* OBSOLETE TYPE_LENGTH (TYPE)) */
/* OBSOLETE */
/* OBSOLETE /* Extract from an array REGBUF containing the (raw) register state */
/* OBSOLETE the address in which a function should return its structure value, */
@@ -315,31 +315,31 @@
/* OBSOLETE /* In the case of the NPL, the frame's norminal address is Br2 and the */
/* OBSOLETE previous routines frame is up the stack X bytes, where X is the */
/* OBSOLETE value stored in the code function header xA(Br1). *x/ */
/* OBSOLETE #define FRAME_CHAIN(thisframe) (findframe(thisframe)) */
/* OBSOLETE #define FRAME_CHAIN(thisframe) (findframe(thisframe)) */
/* OBSOLETE */
/* OBSOLETE extern int gould_frame_chain_valid PARAMS ((CORE_ADDR, struct frame_info *)); */
/* OBSOLETE #define FRAME_CHAIN_VALID(chain, thisframe) gould_frame_chain_valid (chain, thisframe) */
/* OBSOLETE */
/* OBSOLETE /* Define other aspects of the stack frame on NPL. *x/ */
/* OBSOLETE #define FRAME_SAVED_PC(FRAME) \ */
/* OBSOLETE (read_memory_integer ((FRAME)->frame + 8, 4)) */
/* OBSOLETE (read_memory_integer ((FRAME)->frame + 8, 4)) */
/* OBSOLETE */
/* OBSOLETE #define FRAME_ARGS_ADDRESS(fi) \ */
/* OBSOLETE ((fi)->next ? \ */
/* OBSOLETE read_memory_integer ((fi)->frame + 12, 4) : \ */
/* OBSOLETE read_register (AP_REGNUM)) */
/* OBSOLETE ((fi)->next ? \ */
/* OBSOLETE read_memory_integer ((fi)->frame + 12, 4) : \ */
/* OBSOLETE read_register (AP_REGNUM)) */
/* OBSOLETE */
/* OBSOLETE #define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame) */
/* OBSOLETE #define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame) */
/* OBSOLETE */
/* OBSOLETE /* Set VAL to the number of args passed to frame described by FI. */
/* OBSOLETE Can set VAL to -1, meaning no way to tell. *x/ */
/* OBSOLETE */
/* OBSOLETE /* We can check the stab info to see how */
/* OBSOLETE many arg we have. No info in stack will tell us *x/ */
/* OBSOLETE #define FRAME_NUM_ARGS(fi) (findarg(fi)) */
/* OBSOLETE #define FRAME_NUM_ARGS(val,fi) (val = findarg(fi)) */
/* OBSOLETE */
/* OBSOLETE /* Return number of bytes at start of arglist that are not really args. *x/ */
/* OBSOLETE #define FRAME_ARGS_SKIP 8 */
/* OBSOLETE #define FRAME_ARGS_SKIP 8 */
/* OBSOLETE */
/* OBSOLETE /* Put here the code to store, into a struct frame_saved_regs, */
/* OBSOLETE the addresses of the saved registers of frame described by FRAME_INFO. */
@@ -347,21 +347,21 @@
/* OBSOLETE ways in the stack frame. sp is even more special: */
/* OBSOLETE the address we return for it IS the sp for the next frame. *x/ */
/* OBSOLETE */
/* OBSOLETE #define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \ */
/* OBSOLETE #define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \ */
/* OBSOLETE { \ */
/* OBSOLETE memset (&frame_saved_regs, '\0', sizeof frame_saved_regs); \ */
/* OBSOLETE memset (&frame_saved_regs, '\0', sizeof frame_saved_regs); \ */
/* OBSOLETE (frame_saved_regs).regs[SP_REGNUM] = framechain (frame_info); \ */
/* OBSOLETE (frame_saved_regs).regs[PC_REGNUM] = (frame_info)->frame + 8; \ */
/* OBSOLETE (frame_saved_regs).regs[R4_REGNUM] = (frame_info)->frame + 0x30; \ */
/* OBSOLETE (frame_saved_regs).regs[R5_REGNUM] = (frame_info)->frame + 0x34; \ */
/* OBSOLETE (frame_saved_regs).regs[R6_REGNUM] = (frame_info)->frame + 0x38; \ */
/* OBSOLETE (frame_saved_regs).regs[R7_REGNUM] = (frame_info)->frame + 0x3C; \ */
/* OBSOLETE (frame_saved_regs).regs[PC_REGNUM] = (frame_info)->frame + 8; \ */
/* OBSOLETE (frame_saved_regs).regs[R4_REGNUM] = (frame_info)->frame + 0x30; \ */
/* OBSOLETE (frame_saved_regs).regs[R5_REGNUM] = (frame_info)->frame + 0x34; \ */
/* OBSOLETE (frame_saved_regs).regs[R6_REGNUM] = (frame_info)->frame + 0x38; \ */
/* OBSOLETE (frame_saved_regs).regs[R7_REGNUM] = (frame_info)->frame + 0x3C; \ */
/* OBSOLETE } */
/* OBSOLETE */
/* OBSOLETE /* Things needed for making the inferior call functions. *x/ */
/* OBSOLETE */
/* OBSOLETE #define CALL_DUMMY_LOCATION BEFORE_TEXT_END */
/* OBSOLETE #define NEED_TEXT_START_END 1 */
/* OBSOLETE #define CALL_DUMMY_LOCATION BEFORE_TEXT_END */
/* OBSOLETE #define NEED_TEXT_START_END 1 */
/* OBSOLETE */
/* OBSOLETE /* Push an empty stack frame, to record the current PC, etc. *x/ */
/* OBSOLETE */
@@ -414,15 +414,15 @@
/* OBSOLETE *x/ */
/* OBSOLETE */
/* OBSOLETE #define CALL_DUMMY {0x00000000, \ */
/* OBSOLETE 0x00000000, \ */
/* OBSOLETE 0x59000000, \ */
/* OBSOLETE 0x598a0000, \ */
/* OBSOLETE 0xb5030008, \ */
/* OBSOLETE 0x5c820000, \ */
/* OBSOLETE 0x44810008, \ */
/* OBSOLETE 0x00000000, \ */
/* OBSOLETE 0x590a0000, \ */
/* OBSOLETE 0x28090000 } */
/* OBSOLETE 0x00000000, \ */
/* OBSOLETE 0x59000000, \ */
/* OBSOLETE 0x598a0000, \ */
/* OBSOLETE 0xb5030008, \ */
/* OBSOLETE 0x5c820000, \ */
/* OBSOLETE 0x44810008, \ */
/* OBSOLETE 0x00000000, \ */
/* OBSOLETE 0x590a0000, \ */
/* OBSOLETE 0x28090000 } */
/* OBSOLETE */
/* OBSOLETE #define CALL_DUMMY_LENGTH 40 */
/* OBSOLETE */
@@ -450,9 +450,9 @@
/* OBSOLETE int arg_len = 0, total_len;\ */
/* OBSOLETE old_sp = push_word(old_sp,fun);\ */
/* OBSOLETE for(i = nargs - 1;i >= 0;i--)\ */
/* OBSOLETE arg_len += TYPE_LENGTH (VALUE_TYPE (value_arg_coerce (args[i])));\ */
/* OBSOLETE arg_len += TYPE_LENGTH (VALUE_TYPE (value_arg_coerce (args[i])));\ */
/* OBSOLETE if(struct_return)\ */
/* OBSOLETE arg_len += TYPE_LENGTH(value_type);\ */
/* OBSOLETE arg_len += TYPE_LENGTH(value_type);\ */
/* OBSOLETE total_len = DUMMY_FRAME_SIZE+CALL_DUMMY_STACK_ADJUST+4+arg_len;\ */
/* OBSOLETE dummyname[0] += total_len;\ */
/* OBSOLETE dummyname[2] += total_len;\ */

View File

@@ -29,58 +29,58 @@
/* OBSOLETE #define NO_GNU_STABS */
/* OBSOLETE */
/* OBSOLETE /* Macro for text-offset and data info (in PN a.out format). *x/ */
/* OBSOLETE #define TEXTINFO \ */
/* OBSOLETE text_offset = N_TXTOFF (exec_coffhdr); \ */
/* OBSOLETE exec_data_offset = N_TXTOFF (exec_coffhdr) \ */
/* OBSOLETE + exec_aouthdr.a_text */
/* OBSOLETE #define TEXTINFO \ */
/* OBSOLETE text_offset = N_TXTOFF (exec_coffhdr); \ */
/* OBSOLETE exec_data_offset = N_TXTOFF (exec_coffhdr) \ */
/* OBSOLETE + exec_aouthdr.a_text */
/* OBSOLETE */
/* OBSOLETE /* Macro for number of symbol table entries (this used to be checked */
/* OBSOLETE in dbxread.c and caused the last psymtab to use this as the end of */
/* OBSOLETE text. I'm not sure whether it would still be necessary). *x/ */
/* OBSOLETE #define END_OF_TEXT_DEFAULT \ */
/* OBSOLETE (0xffffff) */
/* OBSOLETE #define END_OF_TEXT_DEFAULT \ */
/* OBSOLETE (0xffffff) */
/* OBSOLETE */
/* OBSOLETE /* Macro for number of symbol table entries *x/ */
/* OBSOLETE #define NUMBER_OF_SYMBOLS \ */
/* OBSOLETE (coffhdr.f_nsyms) */
/* OBSOLETE #define NUMBER_OF_SYMBOLS \ */
/* OBSOLETE (coffhdr.f_nsyms) */
/* OBSOLETE */
/* OBSOLETE /* Macro for file-offset of symbol table (in usual a.out format). *x/ */
/* OBSOLETE #define SYMBOL_TABLE_OFFSET \ */
/* OBSOLETE N_SYMOFF (coffhdr) */
/* OBSOLETE #define SYMBOL_TABLE_OFFSET \ */
/* OBSOLETE N_SYMOFF (coffhdr) */
/* OBSOLETE */
/* OBSOLETE /* Macro for file-offset of string table (in usual a.out format). *x/ */
/* OBSOLETE #define STRING_TABLE_OFFSET \ */
/* OBSOLETE (N_STROFF (coffhdr) + sizeof(int)) */
/* OBSOLETE #define STRING_TABLE_OFFSET \ */
/* OBSOLETE (N_STROFF (coffhdr) + sizeof(int)) */
/* OBSOLETE */
/* OBSOLETE /* Macro to store the length of the string table data in INTO. *x/ */
/* OBSOLETE #define READ_STRING_TABLE_SIZE(INTO) \ */
/* OBSOLETE { INTO = hdr.a_stsize; } */
/* OBSOLETE #define READ_STRING_TABLE_SIZE(INTO) \ */
/* OBSOLETE { INTO = hdr.a_stsize; } */
/* OBSOLETE */
/* OBSOLETE /* Macro to declare variables to hold the file's header data. *x/ */
/* OBSOLETE #define DECLARE_FILE_HEADERS struct old_exec hdr; \ */
/* OBSOLETE FILHDR coffhdr */
/* OBSOLETE #define DECLARE_FILE_HEADERS struct old_exec hdr; \ */
/* OBSOLETE FILHDR coffhdr */
/* OBSOLETE */
/* OBSOLETE /* Macro to read the header data from descriptor DESC and validate it. */
/* OBSOLETE NAME is the file name, for error messages. *x/ */
/* OBSOLETE #define READ_FILE_HEADERS(DESC, NAME) \ */
/* OBSOLETE { val = myread (DESC, &coffhdr, sizeof coffhdr); \ */
/* OBSOLETE if (val < 0) \ */
/* OBSOLETE perror_with_name (NAME); \ */
/* OBSOLETE val = myread (DESC, &hdr, sizeof hdr); \ */
/* OBSOLETE if (val < 0) \ */
/* OBSOLETE perror_with_name (NAME); \ */
/* OBSOLETE if (coffhdr.f_magic != GNP1MAGIC) \ */
/* OBSOLETE error ("File \"%s\" not in coff executable format.", NAME); \ */
/* OBSOLETE if (N_BADMAG (hdr)) \ */
/* OBSOLETE #define READ_FILE_HEADERS(DESC, NAME) \ */
/* OBSOLETE { val = myread (DESC, &coffhdr, sizeof coffhdr); \ */
/* OBSOLETE if (val < 0) \ */
/* OBSOLETE perror_with_name (NAME); \ */
/* OBSOLETE val = myread (DESC, &hdr, sizeof hdr); \ */
/* OBSOLETE if (val < 0) \ */
/* OBSOLETE perror_with_name (NAME); \ */
/* OBSOLETE if (coffhdr.f_magic != GNP1MAGIC) \ */
/* OBSOLETE error ("File \"%s\" not in coff executable format.", NAME); \ */
/* OBSOLETE if (N_BADMAG (hdr)) \ */
/* OBSOLETE error ("File \"%s\" not in executable format.", NAME); } */
/* OBSOLETE */
/* OBSOLETE /* Define COFF and other symbolic names needed on NP1 *x/ */
/* OBSOLETE #define NS32GMAGIC GDPMAGIC */
/* OBSOLETE #define NS32SMAGIC PN_MAGIC */
/* OBSOLETE #define NS32GMAGIC GDPMAGIC */
/* OBSOLETE #define NS32SMAGIC PN_MAGIC */
/* OBSOLETE */
/* OBSOLETE /* Offset from address of function to start of its code. */
/* OBSOLETE Zero on most machines. *x/ */
/* OBSOLETE #define FUNCTION_START_OFFSET 4 */
/* OBSOLETE #define FUNCTION_START_OFFSET 4 */
/* OBSOLETE */
/* OBSOLETE /* Advance PC across any function entry prologue instructions */
/* OBSOLETE to reach some "real" code. One PN we can have one or two startup */
@@ -97,70 +97,70 @@
/* OBSOLETE or */
/* OBSOLETE Optional "stw r2,8(b3)" (Gould first argument register passing) */
/* OBSOLETE *x/ */
/* OBSOLETE #define SKIP_PROLOGUE(pc) { \ */
/* OBSOLETE register int op = read_memory_integer ((pc), 4); \ */
/* OBSOLETE if ((op & 0xffff0000) == 0x580B0000) { \ */
/* OBSOLETE pc += 4; \ */
/* OBSOLETE op = read_memory_integer ((pc), 4); \ */
/* OBSOLETE if ((op & 0xffff0000) == 0x59400000) { \ */
/* OBSOLETE pc += 4; \ */
/* OBSOLETE op = read_memory_integer ((pc), 4); \ */
/* OBSOLETE if ((op & 0xffff0000) == 0x5F000000) { \ */
/* OBSOLETE pc += 4; \ */
/* OBSOLETE op = read_memory_integer ((pc), 4); \ */
/* OBSOLETE if (op == 0xD4820008) { \ */
/* OBSOLETE pc += 4; \ */
/* OBSOLETE op = read_memory_integer ((pc), 4); \ */
/* OBSOLETE if (op == 0x5582000C) { \ */
/* OBSOLETE pc += 4; \ */
/* OBSOLETE op = read_memory_integer ((pc), 2); \ */
/* OBSOLETE if (op == 0x2fa0) { \ */
/* OBSOLETE pc += 2; \ */
/* OBSOLETE } else { \ */
/* OBSOLETE op = read_memory_integer ((pc), 4); \ */
/* OBSOLETE if (op == 0xd5030008) { \ */
/* OBSOLETE pc += 4; \ */
/* OBSOLETE } \ */
/* OBSOLETE } \ */
/* OBSOLETE } else { \ */
/* OBSOLETE op = read_memory_integer ((pc), 2); \ */
/* OBSOLETE if (op == 0x2fa0) { \ */
/* OBSOLETE pc += 2; \ */
/* OBSOLETE } \ */
/* OBSOLETE } \ */
/* OBSOLETE } \ */
/* OBSOLETE } \ */
/* OBSOLETE } \ */
/* OBSOLETE } \ */
/* OBSOLETE if ((op & 0xffff0000) == 0x59000000) { \ */
/* OBSOLETE pc += 4; \ */
/* OBSOLETE op = read_memory_integer ((pc), 4); \ */
/* OBSOLETE if ((op & 0xffff0000) == 0x5F000000) { \ */
/* OBSOLETE pc += 4; \ */
/* OBSOLETE op = read_memory_integer ((pc), 4); \ */
/* OBSOLETE if (op == 0xD4820008) { \ */
/* OBSOLETE pc += 4; \ */
/* OBSOLETE op = read_memory_integer ((pc), 4); \ */
/* OBSOLETE if (op == 0x5582000C) { \ */
/* OBSOLETE pc += 4; \ */
/* OBSOLETE op = read_memory_integer ((pc), 2); \ */
/* OBSOLETE if (op == 0x2fa0) { \ */
/* OBSOLETE pc += 2; \ */
/* OBSOLETE } else { \ */
/* OBSOLETE op = read_memory_integer ((pc), 4); \ */
/* OBSOLETE if (op == 0xd5030008) { \ */
/* OBSOLETE pc += 4; \ */
/* OBSOLETE } \ */
/* OBSOLETE } \ */
/* OBSOLETE } else { \ */
/* OBSOLETE op = read_memory_integer ((pc), 2); \ */
/* OBSOLETE if (op == 0x2fa0) { \ */
/* OBSOLETE pc += 2; \ */
/* OBSOLETE } \ */
/* OBSOLETE } \ */
/* OBSOLETE } \ */
/* OBSOLETE } \ */
/* OBSOLETE } \ */
/* OBSOLETE #define SKIP_PROLOGUE(pc) { \ */
/* OBSOLETE register int op = read_memory_integer ((pc), 4); \ */
/* OBSOLETE if ((op & 0xffff0000) == 0x580B0000) { \ */
/* OBSOLETE pc += 4; \ */
/* OBSOLETE op = read_memory_integer ((pc), 4); \ */
/* OBSOLETE if ((op & 0xffff0000) == 0x59400000) { \ */
/* OBSOLETE pc += 4; \ */
/* OBSOLETE op = read_memory_integer ((pc), 4); \ */
/* OBSOLETE if ((op & 0xffff0000) == 0x5F000000) { \ */
/* OBSOLETE pc += 4; \ */
/* OBSOLETE op = read_memory_integer ((pc), 4); \ */
/* OBSOLETE if (op == 0xD4820008) { \ */
/* OBSOLETE pc += 4; \ */
/* OBSOLETE op = read_memory_integer ((pc), 4); \ */
/* OBSOLETE if (op == 0x5582000C) { \ */
/* OBSOLETE pc += 4; \ */
/* OBSOLETE op = read_memory_integer ((pc), 2); \ */
/* OBSOLETE if (op == 0x2fa0) { \ */
/* OBSOLETE pc += 2; \ */
/* OBSOLETE } else { \ */
/* OBSOLETE op = read_memory_integer ((pc), 4); \ */
/* OBSOLETE if (op == 0xd5030008) { \ */
/* OBSOLETE pc += 4; \ */
/* OBSOLETE } \ */
/* OBSOLETE } \ */
/* OBSOLETE } else { \ */
/* OBSOLETE op = read_memory_integer ((pc), 2); \ */
/* OBSOLETE if (op == 0x2fa0) { \ */
/* OBSOLETE pc += 2; \ */
/* OBSOLETE } \ */
/* OBSOLETE } \ */
/* OBSOLETE } \ */
/* OBSOLETE } \ */
/* OBSOLETE } \ */
/* OBSOLETE } \ */
/* OBSOLETE if ((op & 0xffff0000) == 0x59000000) { \ */
/* OBSOLETE pc += 4; \ */
/* OBSOLETE op = read_memory_integer ((pc), 4); \ */
/* OBSOLETE if ((op & 0xffff0000) == 0x5F000000) { \ */
/* OBSOLETE pc += 4; \ */
/* OBSOLETE op = read_memory_integer ((pc), 4); \ */
/* OBSOLETE if (op == 0xD4820008) { \ */
/* OBSOLETE pc += 4; \ */
/* OBSOLETE op = read_memory_integer ((pc), 4); \ */
/* OBSOLETE if (op == 0x5582000C) { \ */
/* OBSOLETE pc += 4; \ */
/* OBSOLETE op = read_memory_integer ((pc), 2); \ */
/* OBSOLETE if (op == 0x2fa0) { \ */
/* OBSOLETE pc += 2; \ */
/* OBSOLETE } else { \ */
/* OBSOLETE op = read_memory_integer ((pc), 4); \ */
/* OBSOLETE if (op == 0xd5030008) { \ */
/* OBSOLETE pc += 4; \ */
/* OBSOLETE } \ */
/* OBSOLETE } \ */
/* OBSOLETE } else { \ */
/* OBSOLETE op = read_memory_integer ((pc), 2); \ */
/* OBSOLETE if (op == 0x2fa0) { \ */
/* OBSOLETE pc += 2; \ */
/* OBSOLETE } \ */
/* OBSOLETE } \ */
/* OBSOLETE } \ */
/* OBSOLETE } \ */
/* OBSOLETE } \ */
/* OBSOLETE } */
/* OBSOLETE */
/* OBSOLETE /* Immediately after a function call, return the saved pc. */
@@ -169,24 +169,24 @@
/* OBSOLETE some instructions. True on PN! Return address is in R1. */
/* OBSOLETE Note: true return location is 4 bytes past R1! *x/ */
/* OBSOLETE #define SAVED_PC_AFTER_CALL(frame) \ */
/* OBSOLETE (read_register(R1_REGNUM) + 4) */
/* OBSOLETE (read_register(R1_REGNUM) + 4) */
/* OBSOLETE */
/* OBSOLETE /* Address of end of stack space. *x/ */
/* OBSOLETE #define STACK_END_ADDR 0x480000 */
/* OBSOLETE #define STACK_END_ADDR 0x480000 */
/* OBSOLETE */
/* OBSOLETE /* Stack grows downward. *x/ */
/* OBSOLETE #define INNER_THAN(lhs,rhs) ((lhs) < (rhs)) */
/* OBSOLETE */
/* OBSOLETE /* Sequence of bytes for breakpoint instruction. *x/ */
/* OBSOLETE #define BREAKPOINT {0x28, 0x09} */
/* OBSOLETE #define BREAKPOINT {0x28, 0x09} */
/* OBSOLETE */
/* OBSOLETE /* Amount PC must be decremented by after a breakpoint. */
/* OBSOLETE This is often the number of bytes in BREAKPOINT */
/* OBSOLETE but not always. *x/ */
/* OBSOLETE #define DECR_PC_AFTER_BREAK 2 */
/* OBSOLETE #define DECR_PC_AFTER_BREAK 2 */
/* OBSOLETE */
/* OBSOLETE /* Return 1 if P points to an invalid floating point value. *x/ */
/* OBSOLETE #define INVALID_FLOAT(p, len) ((*(short *)p & 0xff80) == 0x8000) */
/* OBSOLETE #define INVALID_FLOAT(p, len) ((*(short *)p & 0xff80) == 0x8000) */
/* OBSOLETE */
/* OBSOLETE /* Say how long (ordinary) registers are. This is a piece of bogosity */
/* OBSOLETE used in push_word and a few other places; REGISTER_RAW_SIZE is the */
@@ -195,9 +195,9 @@
/* OBSOLETE #define REGISTER_SIZE 4 */
/* OBSOLETE */
/* OBSOLETE /* Number of machine registers *x/ */
/* OBSOLETE #define NUM_REGS 19 */
/* OBSOLETE #define NUM_GEN_REGS 16 */
/* OBSOLETE #define NUM_CPU_REGS 3 */
/* OBSOLETE #define NUM_REGS 19 */
/* OBSOLETE #define NUM_GEN_REGS 16 */
/* OBSOLETE #define NUM_CPU_REGS 3 */
/* OBSOLETE */
/* OBSOLETE /* Initializer for an array of names of registers. */
/* OBSOLETE There should be NUM_REGS strings in this initializer. *x/ */
@@ -213,43 +213,43 @@
/* OBSOLETE and some are "phony" register numbers which are too large */
/* OBSOLETE to be actual register numbers as far as the user is concerned */
/* OBSOLETE but do serve to get the desired values when passed to read_register. *x/ */
/* OBSOLETE #define R1_REGNUM 1 /* Gr1 => return address of caller *x/ */
/* OBSOLETE #define R4_REGNUM 4 /* Gr4 => register save area *x/ */
/* OBSOLETE #define R5_REGNUM 5 /* Gr5 => register save area *x/ */
/* OBSOLETE #define R6_REGNUM 6 /* Gr6 => register save area *x/ */
/* OBSOLETE #define R7_REGNUM 7 /* Gr7 => register save area *x/ */
/* OBSOLETE #define B1_REGNUM 9 /* Br1 => start of this code routine *x/ */
/* OBSOLETE #define FP_REGNUM 10 /* Br2 == (sp) *x/ */
/* OBSOLETE #define AP_REGNUM 11 /* Br3 == (ap) *x/ */
/* OBSOLETE #define SP_REGNUM 16 /* A copy of Br2 saved in trap *x/ */
/* OBSOLETE #define PS_REGNUM 17 /* Contains processor status *x/ */
/* OBSOLETE #define PC_REGNUM 18 /* Contains program counter *x/ */
/* OBSOLETE #define R1_REGNUM 1 /* Gr1 => return address of caller *x/ */
/* OBSOLETE #define R4_REGNUM 4 /* Gr4 => register save area *x/ */
/* OBSOLETE #define R5_REGNUM 5 /* Gr5 => register save area *x/ */
/* OBSOLETE #define R6_REGNUM 6 /* Gr6 => register save area *x/ */
/* OBSOLETE #define R7_REGNUM 7 /* Gr7 => register save area *x/ */
/* OBSOLETE #define B1_REGNUM 9 /* Br1 => start of this code routine *x/ */
/* OBSOLETE #define FP_REGNUM 10 /* Br2 == (sp) *x/ */
/* OBSOLETE #define AP_REGNUM 11 /* Br3 == (ap) *x/ */
/* OBSOLETE #define SP_REGNUM 16 /* A copy of Br2 saved in trap *x/ */
/* OBSOLETE #define PS_REGNUM 17 /* Contains processor status *x/ */
/* OBSOLETE #define PC_REGNUM 18 /* Contains program counter *x/ */
/* OBSOLETE */
/* OBSOLETE /* Total amount of space needed to store our copies of the machine's */
/* OBSOLETE register state, the array `registers'. *x/ */
/* OBSOLETE #define REGISTER_BYTES (NUM_GEN_REGS*4 + NUM_CPU_REGS*4) */
/* OBSOLETE #define REGISTER_BYTES (NUM_GEN_REGS*4 + NUM_CPU_REGS*4) */
/* OBSOLETE */
/* OBSOLETE /* Index within `registers' of the first byte of the space for */
/* OBSOLETE register N. *x/ */
/* OBSOLETE #define REGISTER_BYTE(N) ((N) * 4) */
/* OBSOLETE #define REGISTER_BYTE(N) ((N) * 4) */
/* OBSOLETE */
/* OBSOLETE /* Number of bytes of storage in the actual machine representation */
/* OBSOLETE for register N. On the PN, all normal regs are 4 bytes. *x/ */
/* OBSOLETE #define REGISTER_RAW_SIZE(N) (4) */
/* OBSOLETE #define REGISTER_RAW_SIZE(N) (4) */
/* OBSOLETE */
/* OBSOLETE /* Number of bytes of storage in the program's representation */
/* OBSOLETE for register N. On the PN, all regs are 4 bytes. *x/ */
/* OBSOLETE #define REGISTER_VIRTUAL_SIZE(N) (4) */
/* OBSOLETE #define REGISTER_VIRTUAL_SIZE(N) (4) */
/* OBSOLETE */
/* OBSOLETE /* Largest value REGISTER_RAW_SIZE can have. *x/ */
/* OBSOLETE #define MAX_REGISTER_RAW_SIZE (4) */
/* OBSOLETE #define MAX_REGISTER_RAW_SIZE (4) */
/* OBSOLETE */
/* OBSOLETE /* Largest value REGISTER_VIRTUAL_SIZE can have. *x/ */
/* OBSOLETE #define MAX_REGISTER_VIRTUAL_SIZE (4) */
/* OBSOLETE #define MAX_REGISTER_VIRTUAL_SIZE (4) */
/* OBSOLETE */
/* OBSOLETE /* Return the GDB type object for the "standard" data type */
/* OBSOLETE of data in register N. *x/ */
/* OBSOLETE #define REGISTER_VIRTUAL_TYPE(N) (builtin_type_int) */
/* OBSOLETE #define REGISTER_VIRTUAL_TYPE(N) (builtin_type_int) */
/* OBSOLETE */
/* OBSOLETE /* Store the address of the place in which to copy the structure the */
/* OBSOLETE subroutine will return. This is called from call_function. */
@@ -264,13 +264,13 @@
/* OBSOLETE into VALBUF. *x/ */
/* OBSOLETE */
/* OBSOLETE #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ */
/* OBSOLETE memcpy (VALBUF, REGBUF, TYPE_LENGTH (TYPE)) */
/* OBSOLETE memcpy (VALBUF, REGBUF, TYPE_LENGTH (TYPE)) */
/* OBSOLETE */
/* OBSOLETE /* Write into appropriate registers a function return value */
/* OBSOLETE of type TYPE, given in virtual format. *x/ */
/* OBSOLETE */
/* OBSOLETE #define STORE_RETURN_VALUE(TYPE,VALBUF) \ */
/* OBSOLETE write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE)) */
/* OBSOLETE write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE)) */
/* OBSOLETE */
/* OBSOLETE /* Extract from an array REGBUF containing the (raw) register state */
/* OBSOLETE the address in which a function should return its structure value, */
@@ -291,31 +291,31 @@
/* OBSOLETE /* In the case of the NPL, the frame's norminal address is Br2 and the */
/* OBSOLETE previous routines frame is up the stack X bytes, where X is the */
/* OBSOLETE value stored in the code function header xA(Br1). *x/ */
/* OBSOLETE #define FRAME_CHAIN(thisframe) (findframe(thisframe)) */
/* OBSOLETE #define FRAME_CHAIN(thisframe) (findframe(thisframe)) */
/* OBSOLETE */
/* OBSOLETE extern int gould_frame_chain_valid PARAMS ((CORE_ADDR, struct frame_info *)); */
/* OBSOLETE #define FRAME_CHAIN_VALID(chain, thisframe) gould_frame_chain_valid (chain, thisframe) */
/* OBSOLETE */
/* OBSOLETE /* Define other aspects of the stack frame on NPL. *x/ */
/* OBSOLETE #define FRAME_SAVED_PC(frame) \ */
/* OBSOLETE (read_memory_integer ((frame)->frame + 8, 4)) */
/* OBSOLETE (read_memory_integer ((frame)->frame + 8, 4)) */
/* OBSOLETE */
/* OBSOLETE #define FRAME_ARGS_ADDRESS(fi) \ */
/* OBSOLETE ((fi)->next ? \ */
/* OBSOLETE read_memory_integer ((fi)->frame + 12, 4) : \ */
/* OBSOLETE read_register (AP_REGNUM)) */
/* OBSOLETE ((fi)->next ? \ */
/* OBSOLETE read_memory_integer ((fi)->frame + 12, 4) : \ */
/* OBSOLETE read_register (AP_REGNUM)) */
/* OBSOLETE */
/* OBSOLETE #define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame + 80) */
/* OBSOLETE #define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame + 80) */
/* OBSOLETE */
/* OBSOLETE /* Set VAL to the number of args passed to frame described by FI. */
/* OBSOLETE Can set VAL to -1, meaning no way to tell. *x/ */
/* OBSOLETE */
/* OBSOLETE /* We can check the stab info to see how */
/* OBSOLETE many arg we have. No info in stack will tell us *x/ */
/* OBSOLETE #define FRAME_NUM_ARGS(fi) (findarg(fi)) */
/* OBSOLETE #define FRAME_NUM_ARGS(val,fi) (val = findarg(fi)) */
/* OBSOLETE */
/* OBSOLETE /* Return number of bytes at start of arglist that are not really args. *x/ */
/* OBSOLETE #define FRAME_ARGS_SKIP 8 */
/* OBSOLETE #define FRAME_ARGS_SKIP 8 */
/* OBSOLETE */
/* OBSOLETE /* Put here the code to store, into a struct frame_saved_regs, */
/* OBSOLETE the addresses of the saved registers of frame described by FRAME_INFO. */
@@ -323,14 +323,14 @@
/* OBSOLETE ways in the stack frame. sp is even more special: */
/* OBSOLETE the address we return for it IS the sp for the next frame. *x/ */
/* OBSOLETE */
/* OBSOLETE #define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \ */
/* OBSOLETE #define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \ */
/* OBSOLETE { \ */
/* OBSOLETE memset (&frame_saved_regs, '\0', sizeof frame_saved_regs); \ */
/* OBSOLETE (frame_saved_regs).regs[PC_REGNUM] = (frame_info)->frame + 8; \ */
/* OBSOLETE (frame_saved_regs).regs[R4_REGNUM] = (frame_info)->frame + 0x30; \ */
/* OBSOLETE (frame_saved_regs).regs[R5_REGNUM] = (frame_info)->frame + 0x34; \ */
/* OBSOLETE (frame_saved_regs).regs[R6_REGNUM] = (frame_info)->frame + 0x38; \ */
/* OBSOLETE (frame_saved_regs).regs[R7_REGNUM] = (frame_info)->frame + 0x3C; \ */
/* OBSOLETE memset (&frame_saved_regs, '\0', sizeof frame_saved_regs); \ */
/* OBSOLETE (frame_saved_regs).regs[PC_REGNUM] = (frame_info)->frame + 8; \ */
/* OBSOLETE (frame_saved_regs).regs[R4_REGNUM] = (frame_info)->frame + 0x30; \ */
/* OBSOLETE (frame_saved_regs).regs[R5_REGNUM] = (frame_info)->frame + 0x34; \ */
/* OBSOLETE (frame_saved_regs).regs[R6_REGNUM] = (frame_info)->frame + 0x38; \ */
/* OBSOLETE (frame_saved_regs).regs[R7_REGNUM] = (frame_info)->frame + 0x3C; \ */
/* OBSOLETE } */
/* OBSOLETE */
/* OBSOLETE /* Things needed for making the inferior call functions. *x/ */
@@ -338,36 +338,36 @@
/* OBSOLETE /* Push an empty stack frame, to record the current PC, etc. *x/ */
/* OBSOLETE */
/* OBSOLETE #define PUSH_DUMMY_FRAME \ */
/* OBSOLETE { register CORE_ADDR sp = read_register (SP_REGNUM); \ */
/* OBSOLETE register int regnum; \ */
/* OBSOLETE sp = push_word (sp, read_register (PC_REGNUM)); \ */
/* OBSOLETE sp = push_word (sp, read_register (FP_REGNUM)); \ */
/* OBSOLETE write_register (FP_REGNUM, sp); \ */
/* OBSOLETE for (regnum = FP_REGNUM - 1; regnum >= 0; regnum--) \ */
/* OBSOLETE sp = push_word (sp, read_register (regnum)); \ */
/* OBSOLETE sp = push_word (sp, read_register (PS_REGNUM)); \ */
/* OBSOLETE { register CORE_ADDR sp = read_register (SP_REGNUM); \ */
/* OBSOLETE register int regnum; \ */
/* OBSOLETE sp = push_word (sp, read_register (PC_REGNUM)); \ */
/* OBSOLETE sp = push_word (sp, read_register (FP_REGNUM)); \ */
/* OBSOLETE write_register (FP_REGNUM, sp); \ */
/* OBSOLETE for (regnum = FP_REGNUM - 1; regnum >= 0; regnum--) \ */
/* OBSOLETE sp = push_word (sp, read_register (regnum)); \ */
/* OBSOLETE sp = push_word (sp, read_register (PS_REGNUM)); \ */
/* OBSOLETE write_register (SP_REGNUM, sp); } */
/* OBSOLETE */
/* OBSOLETE /* Discard from the stack the innermost frame, */
/* OBSOLETE restoring all saved registers. *x/ */
/* OBSOLETE */
/* OBSOLETE #define POP_FRAME \ */
/* OBSOLETE { register struct frame_info *frame = get_current_frame (); \ */
/* OBSOLETE register CORE_ADDR fp; \ */
/* OBSOLETE register int regnum; \ */
/* OBSOLETE struct frame_saved_regs fsr; \ */
/* OBSOLETE struct frame_info *fi; \ */
/* OBSOLETE fp = frame->frame; \ */
/* OBSOLETE get_frame_saved_regs (frame, &fsr); \ */
/* OBSOLETE for (regnum = FP_REGNUM - 1; regnum >= 0; regnum--) \ */
/* OBSOLETE if (fsr.regs[regnum]) \ */
/* OBSOLETE { register struct frame_info *frame = get_current_frame (); \ */
/* OBSOLETE register CORE_ADDR fp; \ */
/* OBSOLETE register int regnum; \ */
/* OBSOLETE struct frame_saved_regs fsr; \ */
/* OBSOLETE struct frame_info *fi; \ */
/* OBSOLETE fp = frame->frame; \ */
/* OBSOLETE get_frame_saved_regs (frame, &fsr); \ */
/* OBSOLETE for (regnum = FP_REGNUM - 1; regnum >= 0; regnum--) \ */
/* OBSOLETE if (fsr.regs[regnum]) \ */
/* OBSOLETE write_register (regnum, read_memory_integer (fsr.regs[regnum], 4)); \ */
/* OBSOLETE if (fsr.regs[PS_REGNUM]) \ */
/* OBSOLETE if (fsr.regs[PS_REGNUM]) \ */
/* OBSOLETE write_register (PS_REGNUM, read_memory_integer (fsr.regs[PS_REGNUM], 4)); \ */
/* OBSOLETE write_register (FP_REGNUM, read_memory_integer (fp, 4)); \ */
/* OBSOLETE write_register (FP_REGNUM, read_memory_integer (fp, 4)); \ */
/* OBSOLETE write_register (PC_REGNUM, read_memory_integer (fp + 4, 4)); \ */
/* OBSOLETE write_register (SP_REGNUM, fp + 8); \ */
/* OBSOLETE flush_cached_frames (); \ */
/* OBSOLETE write_register (SP_REGNUM, fp + 8); \ */
/* OBSOLETE flush_cached_frames (); \ */
/* OBSOLETE } */
/* OBSOLETE */
/* OBSOLETE /* This sequence of words is the instructions: */
@@ -375,19 +375,19 @@
/* OBSOLETE halt */
/* OBSOLETE halt */
/* OBSOLETE halt */
/* OBSOLETE suabr b2, #<stacksize> */
/* OBSOLETE lwbr b6, #con */
/* OBSOLETE stw r1, 8(b2) - save caller address, do we care? */
/* OBSOLETE lw r2, 60(b2) - arg1 */
/* OBSOLETE labr b3, 50(b2) */
/* OBSOLETE std r4, 30(b2) - save r4-r7 */
/* OBSOLETE std r6, 38(b2) */
/* OBSOLETE lwbr b1, #<func> - load function call address */
/* OBSOLETE brlnk r1, 8(b1) - call function */
/* OBSOLETE suabr b2, #<stacksize> */
/* OBSOLETE lwbr b6, #con */
/* OBSOLETE stw r1, 8(b2) - save caller address, do we care? */
/* OBSOLETE lw r2, 60(b2) - arg1 */
/* OBSOLETE labr b3, 50(b2) */
/* OBSOLETE std r4, 30(b2) - save r4-r7 */
/* OBSOLETE std r6, 38(b2) */
/* OBSOLETE lwbr b1, #<func> - load function call address */
/* OBSOLETE brlnk r1, 8(b1) - call function */
/* OBSOLETE halt */
/* OBSOLETE halt */
/* OBSOLETE ld r4, 30(b2) - restore r4-r7 */
/* OBSOLETE ld r6, 38(b2) */
/* OBSOLETE ld r4, 30(b2) - restore r4-r7 */
/* OBSOLETE ld r6, 38(b2) */
/* OBSOLETE */
/* OBSOLETE Setup our stack frame, load argumemts, call and then restore registers. */
/* OBSOLETE *x/ */

View File

@@ -20,20 +20,20 @@
/* OBSOLETE #define HOST_BYTE_ORDER BIG_ENDIAN */
/* OBSOLETE */
/* OBSOLETE /* Address of U in kernel space *x/ */
/* OBSOLETE #define KERNEL_U_ADDR 0x7fffc000 */
/* OBSOLETE #define KERNEL_U_ADDR 0x7fffc000 */
/* OBSOLETE */
/* OBSOLETE /* This is a piece of magic that is given a register number REGNO */
/* OBSOLETE and as BLOCKEND the address in the system of the end of the user structure */
/* OBSOLETE and stores in ADDR the address in the kernel or core dump */
/* OBSOLETE of that register. *x/ */
/* OBSOLETE #define REGISTER_U_ADDR(addr, blockend, regno) { \ */
/* OBSOLETE addr = blockend + regno * 4; \ */
/* OBSOLETE if (regno == VE_REGNUM) addr = blockend - 9 * 4; \ */
/* OBSOLETE if (regno == PC_REGNUM) addr = blockend - 8 * 4; \ */
/* OBSOLETE if (regno == PS_REGNUM) addr = blockend - 7 * 4; \ */
/* OBSOLETE if (regno == FP_REGNUM) addr = blockend - 6 * 4; \ */
/* OBSOLETE if (regno >= V1_REGNUM) \ */
/* OBSOLETE addr = blockend + 16 * 4 + (regno - V1_REGNUM) * VR_SIZE; \ */
/* OBSOLETE #define REGISTER_U_ADDR(addr, blockend, regno) { \ */
/* OBSOLETE addr = blockend + regno * 4; \ */
/* OBSOLETE if (regno == VE_REGNUM) addr = blockend - 9 * 4; \ */
/* OBSOLETE if (regno == PC_REGNUM) addr = blockend - 8 * 4; \ */
/* OBSOLETE if (regno == PS_REGNUM) addr = blockend - 7 * 4; \ */
/* OBSOLETE if (regno == FP_REGNUM) addr = blockend - 6 * 4; \ */
/* OBSOLETE if (regno >= V1_REGNUM) \ */
/* OBSOLETE addr = blockend + 16 * 4 + (regno - V1_REGNUM) * VR_SIZE; \ */
/* OBSOLETE } */
/* OBSOLETE */
/* OBSOLETE /* Don't try to write the frame pointer. *x/ */
@@ -80,8 +80,8 @@
/* OBSOLETE The fault code will be on the stack beyond the last register. *x/ */
/* OBSOLETE */
/* OBSOLETE #define PUSH_REGISTERS \ */
/* OBSOLETE { asm ("clrw -(sp)"); \ */
/* OBSOLETE asm ("pea 10(sp)"); \ */
/* OBSOLETE { asm ("clrw -(sp)"); \ */
/* OBSOLETE asm ("pea 10(sp)"); \ */
/* OBSOLETE asm ("movem $ 0xfffe,-(sp)"); } */
/* OBSOLETE */
/* OBSOLETE /* Assuming the registers (including processor status) have been */

View File

@@ -20,17 +20,17 @@
/* OBSOLETE #define HOST_BYTE_ORDER BIG_ENDIAN */
/* OBSOLETE */
/* OBSOLETE /* Address of U in kernel space *x/ */
/* OBSOLETE #define KERNEL_U_ADDR 0x3fc000 */
/* OBSOLETE #define KERNEL_U_ADDR 0x3fc000 */
/* OBSOLETE */
/* OBSOLETE /* This is a piece of magic that is given a register number REGNO */
/* OBSOLETE and as BLOCKEND the address in the system of the end of the user structure */
/* OBSOLETE and stores in ADDR the address in the kernel or core dump */
/* OBSOLETE of that register. *x/ */
/* OBSOLETE #define REGISTER_U_ADDR(addr, blockend, regno) { \ */
/* OBSOLETE addr = blockend + regno * 4; \ */
/* OBSOLETE if (regno == PC_REGNUM) addr = blockend - 8 * 4; \ */
/* OBSOLETE if (regno == PS_REGNUM) addr = blockend - 7 * 4; \ */
/* OBSOLETE if (regno == SP_REGNUM) addr = blockend - 6 * 4; \ */
/* OBSOLETE #define REGISTER_U_ADDR(addr, blockend, regno) { \ */
/* OBSOLETE addr = blockend + regno * 4; \ */
/* OBSOLETE if (regno == PC_REGNUM) addr = blockend - 8 * 4; \ */
/* OBSOLETE if (regno == PS_REGNUM) addr = blockend - 7 * 4; \ */
/* OBSOLETE if (regno == SP_REGNUM) addr = blockend - 6 * 4; \ */
/* OBSOLETE } */
/* OBSOLETE */
/* OBSOLETE /* No KDB support, Yet! *x/ */
@@ -73,8 +73,8 @@
/* OBSOLETE The fault code will be on the stack beyond the last register. *x/ */
/* OBSOLETE */
/* OBSOLETE #define PUSH_REGISTERS \ */
/* OBSOLETE { asm ("clrw -(sp)"); \ */
/* OBSOLETE asm ("pea 10(sp)"); \ */
/* OBSOLETE { asm ("clrw -(sp)"); \ */
/* OBSOLETE asm ("pea 10(sp)"); \ */
/* OBSOLETE asm ("movem $ 0xfffe,-(sp)"); } */
/* OBSOLETE */
/* OBSOLETE /* Assuming the registers (including processor status) have been */

View File

@@ -1,22 +1,21 @@
/* Parameters for execution on a H8/300 series machine.
Copyright 1992, 1993 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Contributed by Steve Chamberlain sac@cygnus.com */
@@ -70,7 +69,7 @@ extern void h8300_init_extra_frame_info ();
/* Advance PC across any function entry prologue instructions
to reach some "real" code. */
#define SKIP_PROLOGUE(ip) (h8300_skip_prologue(ip))
#define SKIP_PROLOGUE(ip) {(ip) = h8300_skip_prologue(ip);}
extern CORE_ADDR h8300_skip_prologue ();
/* Immediately after a function call, return the saved pc.
@@ -85,9 +84,9 @@ extern CORE_ADDR h8300_skip_prologue ();
#define INNER_THAN(lhs,rhs) ((lhs) < (rhs))
/*#define BREAKPOINT {0x7A, 0xFF} */
#define BREAKPOINT {0x01, 0x80} /* Sleep */
#define REMOTE_BREAKPOINT { 0x57, 0x30} /* trapa #3 */
/*#define BREAKPOINT {0x7A, 0xFF}*/
#define BREAKPOINT {0x01, 0x80} /* Sleep */
#define REMOTE_BREAKPOINT { 0x57, 0x30} /* trapa #3 */
/* If your kernel resets the pc after the trap happens you may need to
define this before including this file. */
@@ -97,7 +96,7 @@ extern CORE_ADDR h8300_skip_prologue ();
#define REGISTER_SIZE 4
#define NUM_REGS 13
#define NUM_REGS 13
#define REGISTER_BYTES (NUM_REGS * 4)
@@ -161,7 +160,7 @@ extern char **h8300_register_names;
/* FIXME: Won't work with both h8/300's. */
extern void h8300_extract_return_value PARAMS ((struct type *, char *, char *));
extern void h8300_extract_return_value PARAMS((struct type *, char *, char *));
#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
h8300_extract_return_value (TYPE, (char *)(REGBUF), (char *)(VALBUF))
@@ -170,7 +169,7 @@ extern void h8300_extract_return_value PARAMS ((struct type *, char *, char *));
in d0/d1. */
/* FIXME: Won't work with both h8/300's. */
extern void h8300_store_return_value PARAMS ((struct type *, char *));
extern void h8300_store_return_value PARAMS((struct type *, char *));
#define STORE_RETURN_VALUE(TYPE,VALBUF) \
h8300_store_return_value(TYPE, (char *) (VALBUF))
@@ -187,7 +186,7 @@ extern void h8300_store_return_value PARAMS ((struct type *, char *));
#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
extract_address (REGBUF + REGISTER_BYTE (0), \
REGISTER_RAW_SIZE (0))
/* Describe the pointer in each stack frame to the previous stack frame
(its caller). */
@@ -214,8 +213,8 @@ CORE_ADDR h8300_frame_chain PARAMS ((struct frame_info *));
/* A macro that tells us whether the function invocation represented
by FI does not have a frame on the stack associated with it. If it
does not, FRAMELESS is set to 1, else 0. */
#define FRAMELESS_FUNCTION_INVOCATION(FI) \
(frameless_look_for_prologue (FI))
#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
(FRAMELESS) = frameless_look_for_prologue(FI)
/* Any function with a frame looks like this
SECOND ARG
@@ -226,7 +225,7 @@ CORE_ADDR h8300_frame_chain PARAMS ((struct frame_info *));
SAVED FP <-FP POINTS HERE
LOCALS0
LOCALS1 <-SP POINTS HERE
*/
*/
#define FRAME_SAVED_PC(FRAME) h8300_frame_saved_pc(FRAME)
@@ -240,7 +239,7 @@ CORE_ADDR h8300_frame_chain PARAMS ((struct frame_info *));
/* We can't tell how many args there are
now that the C compiler delays popping them. */
#define FRAME_NUM_ARGS(fi) (-1)
#define FRAME_NUM_ARGS(val,fi) (val = -1)
/* Return number of bytes at start of arglist that are not really args. */
@@ -264,7 +263,7 @@ typedef unsigned short INSN_WORD;
#define GDB_TARGET_IS_H8300
#define NUM_REALREGS 10
#define NOP { 0x01, 0x80} /* A sleep insn */
#define NOP { 0x01, 0x80} /* A sleep insn */
#define BELIEVE_PCC_PROMOTION 1
@@ -272,7 +271,7 @@ typedef unsigned short INSN_WORD;
* CALL_DUMMY stuff:
*/
#define USE_GENERIC_DUMMY_FRAMES 1
#define USE_GENERIC_DUMMY_FRAMES
#define CALL_DUMMY {0}
#define CALL_DUMMY_LENGTH (0)
#define CALL_DUMMY_ADDRESS() entry_point_address ()
@@ -280,17 +279,17 @@ typedef unsigned short INSN_WORD;
#define CALL_DUMMY_START_OFFSET (0)
#define CALL_DUMMY_BREAKPOINT_OFFSET (0)
extern CORE_ADDR h8300_push_arguments PARAMS ((int nargs,
struct value ** args,
extern CORE_ADDR h8300_push_arguments PARAMS ((int nargs,
struct value **args,
CORE_ADDR sp,
unsigned char struct_return,
CORE_ADDR struct_addr));
extern CORE_ADDR h8300_push_return_address PARAMS ((CORE_ADDR, CORE_ADDR));
#define PC_IN_CALL_DUMMY(PC, SP, FP) generic_pc_in_call_dummy (PC, SP, FP)
#define PC_IN_CALL_DUMMY(PC, SP, FP) generic_pc_in_call_dummy (PC, SP)
#define FIX_CALL_DUMMY(DUMMY, START_SP, FUNADDR, NARGS, ARGS, TYPE, GCCP)
#define PUSH_ARGUMENTS(NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR) \
(h8300_push_arguments (NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR))
(SP) = h8300_push_arguments (NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR)
/* Push an empty stack frame, to record the current PC, etc. */
#define PUSH_DUMMY_FRAME generic_push_dummy_frame ()
/* Discard from the stack the innermost frame, restoring all registers. */
@@ -299,5 +298,6 @@ extern CORE_ADDR h8300_push_return_address PARAMS ((CORE_ADDR, CORE_ADDR));
/* override the standard get_saved_register function with
one that takes account of generic CALL_DUMMY frames */
#define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) \
generic_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval)
#define GET_SAVED_REGISTER

View File

@@ -1,22 +1,21 @@
/* Parameters for execution on a H8/500 series machine.
Copyright (C) 1993, 1995 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Contributed by Steve Chamberlain sac@cygnus.com */
@@ -44,7 +43,7 @@
/* Advance PC across any function entry prologue instructions
to reach some "real" code. */
#define SKIP_PROLOGUE(ip) (h8500_skip_prologue (ip))
#define SKIP_PROLOGUE(ip) { (ip) = h8500_skip_prologue(ip); }
extern CORE_ADDR h8500_skip_prologue PARAMS ((CORE_ADDR));
/* Immediately after a function call, return the saved pc.
@@ -75,7 +74,7 @@ extern CORE_ADDR saved_pc_after_call PARAMS ((void));
/* Say how much memory is needed to store a copy of the register set */
#define REGISTER_BYTES (NUM_REGS * 4)
#define REGISTER_BYTES (NUM_REGS * 4)
/* Index within `registers' of the first byte of the space for
register N. */
@@ -149,8 +148,8 @@ extern struct type *h8500_register_virtual_type PARAMS ((int regno));
#define NUM_REGS 22
#define SP_REGNUM PR7_REGNUM /* Contains address of top of stack */
#define FP_REGNUM PR6_REGNUM /* Contains address of executing stack frame */
#define SP_REGNUM PR7_REGNUM /* Contains address of top of stack */
#define FP_REGNUM PR6_REGNUM /* Contains address of executing stack frame */
#define PTR_SIZE (minimum_mode ? 2 : 4)
#define PTR_MASK (minimum_mode ? 0x0000ffff : 0x00ffffff)
@@ -159,7 +158,7 @@ extern struct type *h8500_register_virtual_type PARAMS ((int regno));
subroutine will return. This is called from call_function. */
/*#define STORE_STRUCT_RETURN(ADDR, SP) \
{ write_register (0, (ADDR)); abort(); } */
{ write_register (0, (ADDR)); abort(); }*/
/* Extract from an array REGBUF containing the (raw) register state
a function return value of type TYPE, and copy that, in virtual format,
@@ -179,16 +178,16 @@ extern struct type *h8500_register_virtual_type PARAMS ((int regno));
as a CORE_ADDR (or an expression that can be used as one). */
#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (*(CORE_ADDR *)(REGBUF))
/* Define other aspects of the stack frame. */
/* A macro that tells us whether the function invocation represented
by FI does not have a frame on the stack associated with it. If it
does not, FRAMELESS is set to 1, else 0. */
#define FRAMELESS_FUNCTION_INVOCATION(FI) \
(frameless_look_for_prologue (FI))
#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
(FRAMELESS) = frameless_look_for_prologue(FI)
/* Any function with a frame looks like this
SECOND ARG
@@ -199,18 +198,18 @@ extern struct type *h8500_register_virtual_type PARAMS ((int regno));
SAVED FP <-FP POINTS HERE
LOCALS0
LOCALS1 <-SP POINTS HERE
*/
*/
#define INIT_EXTRA_FRAME_INFO(fromleaf, fci) ;
/* (fci)->frame |= read_register(SEG_T_REGNUM) << 16; */
/* (fci)->frame |= read_register(SEG_T_REGNUM) << 16;*/
#define FRAME_CHAIN(FRAME) h8500_frame_chain(FRAME)
struct frame_info;
extern CORE_ADDR h8500_frame_chain PARAMS ((struct frame_info *));
#define FRAME_SAVED_PC(FRAME) frame_saved_pc(FRAME)
extern CORE_ADDR frame_saved_pc PARAMS ((struct frame_info * frame));
extern CORE_ADDR frame_saved_pc PARAMS ((struct frame_info *frame));
#define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)
@@ -222,7 +221,7 @@ extern CORE_ADDR frame_saved_pc PARAMS ((struct frame_info * frame));
/* We can't tell how many args there are
now that the C compiler delays popping them. */
#define FRAME_NUM_ARGS(fi) (-1)
#define FRAME_NUM_ARGS(val,fi) (val = -1)
/* Return number of bytes at start of arglist that are not really args. */
@@ -237,7 +236,7 @@ extern CORE_ADDR frame_saved_pc PARAMS ((struct frame_info * frame));
#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
frame_find_saved_regs(frame_info, &(frame_saved_regs))
struct frame_saved_regs;
extern void frame_find_saved_regs PARAMS ((struct frame_info * frame_info, struct frame_saved_regs * frame_saved_regs));
extern void frame_find_saved_regs PARAMS ((struct frame_info *frame_info, struct frame_saved_regs *frame_saved_regs));
/* Discard from the stack the innermost frame, restoring all registers. */
@@ -248,6 +247,8 @@ extern void h8500_pop_frame PARAMS ((void));
#define SHORT_INT_MAX 32767
#define SHORT_INT_MIN -32768
#define NAMES_HAVE_UNDERSCORE
typedef unsigned short INSN_WORD;
extern CORE_ADDR h8500_addr_bits_remove PARAMS ((CORE_ADDR));
@@ -268,10 +269,10 @@ extern int minimum_mode;
extern int h8500_is_trapped_internalvar PARAMS ((char *name));
#define VALUE_OF_TRAPPED_INTERNALVAR h8500_value_of_trapped_internalvar
extern struct value *h8500_value_of_trapped_internalvar ( /* struct internalvar *var */ );
extern struct value * h8500_value_of_trapped_internalvar (/* struct internalvar *var */);
#define SET_TRAPPED_INTERNALVAR h8500_set_trapped_internalvar
extern void h8500_set_trapped_internalvar ( /* struct internalvar *var, value newval, int bitpos, int bitsize, int offset */ );
extern void h8500_set_trapped_internalvar (/* struct internalvar *var, value newval, int bitpos, int bitsize, int offset */);
extern CORE_ADDR h8500_read_sp PARAMS ((void));
extern void h8500_write_sp PARAMS ((CORE_ADDR));

View File

@@ -1,3 +0,0 @@
# Target: Embedded Intel 386
TDEPFILES= i386-tdep.o i387-tdep.o
TM_FILE= tm-i386v.h

View File

@@ -1,19 +1,8 @@
# Host: Intel x86 running DJGPP
# we don't need mmalloc on DJGPP
MH_CFLAGS= -DNO_MMALLOC
MMALLOC=
MMALLOC_CFLAGS=
MH_CFLAGS=-D__GO32__ -D__MSDOS__
XDEPFILES= go32-xdep.o
XM_FILE= xm-go32.h
XDEPFILES=
NAT_FILE= nm-go32.h
NATDEPFILES= go32-nat.o
TERMCAP=
HOST_IPC=
HOST_IPC=-DDOS_IPC
SER_HARDWIRE= ser-go32.o
CC= gcc
XM_CLIBS= -ldbg
CC=i386-go32-gcc -O2 -fno-omit-frame-pointer

View File

@@ -1,3 +0,0 @@
# Target: Intel 386 running DJGPP
TDEPFILES= i386-tdep.o i387-tdep.o
TM_FILE= tm-go32.h

View File

@@ -1,22 +1,21 @@
/* Native-dependent definitions for Intel 386 running BSD Unix, for GDB.
Copyright 1986, 1987, 1989, 1992, 1996 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef NM_FREEBSD_H
#define NM_FREEBSD_H

View File

@@ -1,22 +1,21 @@
/* Native-dependent definitions for Intel 386 running the GNU Hurd
Copyright 1994, 1995 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Include the generic hurd definitions. */

View File

@@ -1,83 +0,0 @@
/* Native definitions for Intel x86 running DJGPP.
Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#define NO_PTRACE_H
#include "i386/nm-i386v.h"
#define TARGET_HAS_HARDWARE_WATCHPOINTS
/* Returns the number of hardware watchpoints of type TYPE that we can
set. Value is positive if we can set CNT watchpoints, zero if
setting watchpoints of type TYPE is not supported, and negative if
CNT is more than the maximum number of watchpoints of type TYPE
that we can support. TYPE is one of bp_hardware_watchpoint,
bp_read_watchpoint, bp_write_watchpoint, or bp_hardware_breakpoint.
CNT is the number of such watchpoints used so far (including this
one). OTHERTYPE is non-zero if other types of watchpoints are
currently enabled.
We always return 1 here because we don't have enough information
about possible overlap of addresses that they want to watch. As
an extreme example, consider the case where all the watchpoints
watch the same address and the same region length: then we can
handle a virtually unlimited number of watchpoints, due to debug
register sharing implemented via reference counts in go32-nat.c. */
#define TARGET_CAN_USE_HARDWARE_WATCHPOINT(type, cnt, ot) 1
/* Returns non-zero if we can use hardware watchpoints to watch a region
whose address is ADDR and whose length is LEN. */
#define TARGET_REGION_OK_FOR_HW_WATCHPOINT(addr,len) \
go32_region_ok_for_watchpoint(addr,len)
/* After a watchpoint trap, the PC points to the instruction after the
one that caused the trap. Therefore we don't need to step over it.
But we do need to reset the status register to avoid another trap. */
#define HAVE_CONTINUABLE_WATCHPOINT
#define STOPPED_BY_WATCHPOINT(W) \
go32_stopped_by_watchpoint (inferior_pid, 0)
#define target_stopped_data_address() \
go32_stopped_by_watchpoint (inferior_pid, 1)
/* Use these macros for watchpoint insertion/removal. */
#define target_insert_watchpoint(addr, len, type) \
go32_insert_watchpoint (inferior_pid, addr, len, type)
#define target_remove_watchpoint(addr, len, type) \
go32_remove_watchpoint (inferior_pid, addr, len, type)
#define target_insert_hw_breakpoint(addr, shadow) \
go32_insert_hw_breakpoint(addr, shadow)
#define target_remove_hw_breakpoint(addr, shadow) \
go32_remove_hw_breakpoint(addr, shadow)
#define DECR_PC_AFTER_HW_BREAK 0
#undef FLOAT_INFO
#define FLOAT_INFO { i386_go32_float_info (); }
extern void i386_go32_float_info (void);

View File

@@ -1,26 +1,25 @@
/* Native support for i386 aix ps/2.
Copyright 1986, 1987, 1989, 1992, 1993 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/*
* Changes for IBM AIX PS/2 by Minh Tran-Le (tranle@intellicorp.com)
* Revision: 5-May-93 00:11:35
* Revision: 5-May-93 00:11:35
*/
#ifndef NM_I386AIX_H

View File

@@ -1,22 +1,21 @@
/* Native-dependent definitions for Intel 386 running BSD Unix, for GDB.
Copyright 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef NM_I386BSD_H
#define NM_I386BSD_H
@@ -27,7 +26,7 @@
#include <machine/vmparam.h>
#define KERNEL_U_ADDR USRSTACK
#undef FLOAT_INFO /* No float info yet */
#undef FLOAT_INFO /* No float info yet */
#define REGISTER_U_ADDR(addr, blockend, regno) \
(addr) = i386_register_u_addr ((blockend),(regno));

View File

@@ -1,22 +1,21 @@
/* Native-dependent definitions for Intel 386 running LynxOS.
Copyright 1993 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef NM_I386LYNX_H
#define NM_I386LYNX_H

View File

@@ -1,25 +1,24 @@
/* Native definitions for Mach on an Intel 386
Copyright (C) 1986, 1987, 1989, 1991, 1992 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Do implement the attach and detach commands. */
/* #define ATTACH_DETACH 1 */
/* #define ATTACH_DETACH 1 */
/* Override copies of {fetch,store}_inferior_registers in infptrace.c. */
#define FETCH_INFERIOR_REGISTERS

View File

@@ -2,22 +2,21 @@
Copyright 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
Changes for 80386 by Pace Willisson (pace@prep.ai.mit.edu), July 1988.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#if 0
/* code to execute to print interesting information about the
@@ -28,7 +27,7 @@
do this unless we *know* we aren't cross-debugging. FIXME.
*/
#define FLOAT_INFO { i386_float_info (); }
#endif /*0 */
#endif /*0*/
#define REGISTER_U_ADDR(addr, blockend, regno) \
(addr) = i386_register_u_addr ((blockend),(regno));

View File

@@ -3,22 +3,21 @@
Contributed by Cygnus Support. By Ian Lance Taylor
<ian@cygnus.com> based on work by Martin Walker <maw@netcom.com>.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* SCO 3.2v4 is actually just like SCO 3.2v2, except that it
additionally supports attaching to a process. */

View File

@@ -5,29 +5,28 @@
work by Ian Lance Taylor <ian@cygnus.com> and
Martin Walker <maw@netcom.com>.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/* Basically, its a lot like the older versions ... */
#include "i386/nm-i386sco.h"
/* ... but it can do a lot of SVR4 type stuff too. */
#define SVR4_SHARED_LIBS
#include "solib.h" /* Pick up shared library support */
#include "solib.h" /* Pick up shared library support */
#define ATTACH_DETACH
@@ -36,3 +35,5 @@
#define PTRACE_ATTACH 10
#define PTRACE_DETACH 11

View File

@@ -1,22 +1,21 @@
/* Native support for i386 running Solaris 2.
Copyright 1998 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "nm-sysv4.h"
@@ -28,6 +27,9 @@ struct objfile;
#define target_new_objfile(OBJFILE) sol_thread_new_objfile (OBJFILE)
void sol_thread_new_objfile PARAMS ((struct objfile * objfile));
void sol_thread_new_objfile PARAMS ((struct objfile *objfile));
#define FIND_NEW_THREADS sol_find_new_threads
void sol_find_new_threads PARAMS ((void));
#endif

View File

@@ -2,22 +2,21 @@
Copyright 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
Changes for 80386 by Pace Willisson (pace@prep.ai.mit.edu), July 1988.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#if 0
/* code to execute to print interesting information about the
@@ -28,7 +27,7 @@
do this unless we *know* we aren't cross-debugging. FIXME.
*/
#define FLOAT_INFO { i386_float_info (); }
#endif /*0 */
#endif /*0*/
#define REGISTER_U_ADDR(addr, blockend, regno) \
(addr) = i386_register_u_addr ((blockend),(regno));

View File

@@ -2,22 +2,21 @@
Copyright 1986, 1987, 1989, 1992, 1996 Free Software Foundation, Inc.
Changes for 80386 by Pace Willisson (pace@prep.ai.mit.edu), July 1988.
This file is part of GDB.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "nm-sysv4.h"

Some files were not shown because too many files have changed in this diff Show More