import gdb-1999-08-30 snapshot
This commit is contained in:
parent
fd485a97b1
commit
104c1213b4
132 changed files with 8907 additions and 3077 deletions
252
gdb/ChangeLog
252
gdb/ChangeLog
|
@ -1,5 +1,236 @@
|
|||
1999-08-30 Stan Shebs <shebs@andros.cygnus.com>
|
||||
|
||||
* infrun.c (prepare_to_wait): New function, broken out from the
|
||||
wfi_continue label in handle_inferior_event.
|
||||
(handle_inferior_event): Change more gotos into function calls.
|
||||
|
||||
1999-08-30 Michael Snyder <msnyder@cleaver.cygnus.com>
|
||||
|
||||
* tracepoint.c: -Wall warning cleanup.
|
||||
(parse_and_eval_memrange): remove (unused).
|
||||
(output_command, args_info, locals_info, registers_info): add decls.
|
||||
(getpkt, putpkt, remote_console_output): add decls.
|
||||
(isalnum, isspace): cast arg to avoid warning.
|
||||
(printf, fprintf, sprintf): use [fs]printf_vma for printing addrs.
|
||||
|
||||
Mon Aug 30 21:47:58 1999 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
|
||||
* d10v-tdep.c: #include "language.h".
|
||||
|
||||
Mon Aug 30 20:38:57 1999 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
|
||||
* configure.in (AC_CHECK_HEADERS): Check for <time.h>.
|
||||
* configure, acconfig.in: Re-generate.
|
||||
|
||||
* remote-rdp.c: #include <time.h>
|
||||
|
||||
* config/arm/tm-arm.h (arm_float_info): Add declaration.
|
||||
|
||||
* arm-tdep.c (convert_from_extended, convert_to_extended): Change
|
||||
double ptr arg to void ptr arg.
|
||||
|
||||
* config/arm/tm-arm.h (arm_frameless_function_invocation): Add
|
||||
declaration.
|
||||
(arm_frame_find_saved_regs): Rename frame_find_saved_regs.
|
||||
(convert_from_extended, convert_to_extended): Add declaration.
|
||||
|
||||
Mon Aug 30 19:05:32 1999 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
|
||||
* configure.in (WERR_CFLAGS): Separate the -Werror flag.
|
||||
* configure: Re-generate.
|
||||
|
||||
* Makefile.in (INTERNAL_CFLAGS): Re-define using
|
||||
INTERNAL_WARN_CFLAGS.
|
||||
(INTERNAL_WARN_CFLAGS): Define. Leave off WERR_CFLAGS.
|
||||
(tracepoint.o): Add explicit rule.
|
||||
(WERR_CFLAGS): Add definition.
|
||||
|
||||
Mon Aug 30 17:52:17 1999 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
|
||||
* utils.c: #include "event-loop.h" for declaration of
|
||||
async_request_quit.
|
||||
* Makefile.in (utils.o): Add dependency on event-loop.h.
|
||||
|
||||
* event-top.c (mark_async_signal_handler_wrapper,
|
||||
async_request_quit): Move declaration from here.
|
||||
* event-loop.h: To here.
|
||||
|
||||
* defs.h: Add declaration of exec.c:exec_set_section_offsets.
|
||||
|
||||
* event-top.c: #include "gdbcmd.h" which includes "command.h" and
|
||||
hence expose declaration of function dont_repeat.
|
||||
|
||||
* top.c (ISATTY), tracepoint.c (ISATTY), utils.c (ISATTY),
|
||||
event-top.c (ISATTY): Move definitions from here.
|
||||
* defs.h (ISATTY): To here. #include <unistd.h>.
|
||||
|
||||
* sol-thread.c, solib.c, source.c, sparcl-tdep.c, tracepoint.c,
|
||||
utils.c, win32-nat.c, wince.c, top.c, symfile.c, ser-unix.c,
|
||||
ser-tcp.c, procfs.c, maint.c, infttrace.c, hppa-tdep.c,
|
||||
ser-pipe.c, remote-rdp.c, main.c, inftarg.c, inflow.c,
|
||||
hpux-thread.c, hp-psymtab-read.c, go32-nat.c, fork-child.c,
|
||||
corelow.c, command.c: Do not #include <unistd.h>, moved to defs.h.
|
||||
|
||||
Mon Aug 30 15:14:43 1999 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
|
||||
* defs.h (struct tui_stream, enum streamtype): Move from here.
|
||||
* utils.c: To here.
|
||||
|
||||
* main.c (tui_file_fputs): Move from here.
|
||||
* utils.c: To here.
|
||||
|
||||
Sun Aug 29 10:03:32 1999 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
|
||||
* gdb-events.h, gdb-events.c, gdb-events.sh: New files.
|
||||
|
||||
1999-08-27 Michael Snyder <msnyder@cleaver.cygnus.com>
|
||||
|
||||
* solib.c (open_symbol_file_object): new function.
|
||||
Called when attaching to a new process, if there is no loaded
|
||||
symbol file. Attempts to locate the executable file for the
|
||||
attached process and load symbols from it.
|
||||
(solib_add): Call open_symbol_file_object if attaching to a
|
||||
new process and no open symbol file.
|
||||
|
||||
1999-08-27 Jason Molenda (jsm@bugshack.cygnus.com)
|
||||
|
||||
* config/i386/tm-sun386.h (GDB_TARGET_IS_SUN386): Definition
|
||||
removed--no longer checked anywhere in gdb.
|
||||
|
||||
1999-08-27 Stan Shebs <shebs@andros.cygnus.com>
|
||||
|
||||
* infrun.c (stop_stepping): New function, broken out from
|
||||
stop_stepping label in handle_inferior_event.
|
||||
(handle_inferior_event): Change gotos into function calls.
|
||||
|
||||
Fri Aug 27 20:13:22 1999 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
|
||||
* defs.h (LONGEST): Move definition to earlier in file - to just
|
||||
after BFD.
|
||||
(paddr_u, paddr_d): Declare.
|
||||
* utils.c (decimal2str): New function.
|
||||
(paddr_u, paddr_d): Define.
|
||||
|
||||
* remote.c (remote_cisco_section_offsets,
|
||||
compare_sections_command): Fix XprintfX arguments. Use paddr...
|
||||
(putpkt_binary): Fix XprintfX arguments.
|
||||
|
||||
Tue Aug 24 21:30:36 1999 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
|
||||
* arm-tdep.c (arm_init_extra_frame_info): Add braces. Recommended
|
||||
by gcc -Wparentheses.
|
||||
|
||||
1999-08-26 Stan Shebs <shebs@andros.cygnus.com>
|
||||
|
||||
* infrun.c (check_sigtramp2): New function, broken out from
|
||||
check_sigtramp2 label in handle_inferior_event.
|
||||
(handle_inferior_event): Change gotos into function calls.
|
||||
|
||||
Declare Tahoe configuration obsolete.
|
||||
* configure.host, configure.tgt: Comment out Tahoe configs.
|
||||
* Makefile.in: Comment out Tahoe-related action.
|
||||
* tahoe-tdep.c, config/tahoe/*: Comment out.
|
||||
* NEWS: Mention obsolete status.
|
||||
|
||||
1999-08-26 J.T. Conklin <jtc@redback.com>
|
||||
|
||||
* i386-stub.c, m32r-stub.c, m68k-stub.c, sh-stub.c, sh-stub.c,
|
||||
sparc-stub, sparcl-stub.c sparclet-stub.c (getpacket): If '$',
|
||||
the packet start character is received in the 'middle' of a
|
||||
packet, assume that packet end character has been lost and
|
||||
start a new packet.
|
||||
|
||||
* i386-stub.c, m32r-stub.c, m68k-stub.c, sh-stub.c, sparc-stub.c,
|
||||
sparcl-stub.c sparclet-stub.c (getpacket): Changed to return ptr
|
||||
to first character of input buffer. Removed & 0x7f masks.
|
||||
(handle_exception): Don't access remcomInBuffer directly.
|
||||
|
||||
1999-08-25 Stan Shebs <shebs@andros.cygnus.com>
|
||||
|
||||
* breakpoint.c (disable_breakpoints_in_shlibs): Only disable
|
||||
enabled breakpoints.
|
||||
|
||||
Tue Aug 24 14:59:23 1999 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
|
||||
* tracepoint.c, remote.c, pa64solib.h, value.h, somsolib.h,
|
||||
solib.h, scm-lang.h, language.h, inferior.h, defs.h, coff-solib.h,
|
||||
ch-lang.h, breakpoint.h, annotate.h: Remove #if __STDC__ wrapping
|
||||
struct declarations.
|
||||
|
||||
* config/sparc/nm-sun4sol2.h, config/mn10300/tm-mn10300.h,
|
||||
config/mn10200/tm-mn10200.h, config/i386/tm-i386.h,
|
||||
config/i386/tm-i386v.h, config/i386/nm-i386sol2.h,
|
||||
config/pa/nm-hppah.h, config/rs6000/nm-rs6000.h,
|
||||
config/sparc/tm-sp64.h, config/v850/tm-v850.h,
|
||||
config/tic80/tm-tic80.h, config/sparc/tm-sparc.h,
|
||||
config/sh/tm-sh.h, config/rs6000/tm-rs6000.h, config/pa/tm-hppa.h,
|
||||
config/mips/tm-mips.h, config/m68k/tm-m68k.h,
|
||||
config/m32r/tm-m32r.h, config/i960/tm-mon960.h,
|
||||
config/fr30/tm-fr30.h, config/h8300/tm-h8300.h,
|
||||
config/arm/tm-arm.h, config/alpha/tm-alpha.h,
|
||||
config/a29k/tm-a29k.h: Ditto.
|
||||
|
||||
Wed Aug 25 10:45:33 1999 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
|
||||
* Makefile.in (gdb$(EXEEXT)): Add dependency on TDEPLIBS.
|
||||
|
||||
* config/arm/arm.mt (TDEPLIBS): Define. Move libangsd.a to here.
|
||||
(TDEPFILES): From here.
|
||||
|
||||
1999-08-24 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
|
||||
|
||||
* top.c (init_main): Add new set/show command exec-done-display,
|
||||
default value is off.
|
||||
* event-loop.h: Export exec_done_display_p.
|
||||
* event-top.c: New variable exec_done_display_p.
|
||||
* infrun.c (complete_execution): Print completion message if
|
||||
corresponding flag is set.
|
||||
|
||||
* top.c (DEFAULT_PROMPT): Add space after "(gdb)" at end of prompt.
|
||||
|
||||
From: J.T. Conklin <jtc@redback.com>
|
||||
* top.c (DEFAULT_PROMPT): Set to "(gdb)" if not already defined.
|
||||
(init_main): Always use DEFAULT_PROMPT.
|
||||
|
||||
Tue Aug 24 03:23:31 1999 Jeffrey A Law (law@cygnus.com)
|
||||
|
||||
* hppa-tdep.c: Remove useless "purecov: deadcode" comments.
|
||||
(hppa_use_struct_convention): Update for PA64.
|
||||
(hppa_frame_saved_pc): Properly extract the saved PC in a call
|
||||
dummy frame.
|
||||
(in_solib_call_trampoline): Return nonzero if we are in a function
|
||||
called ".stub".
|
||||
(prologue_inst_adjust_sp): Handle std,ma.
|
||||
(skip_prologue_hard_way): Handle more PA2.0/PA64 insns.
|
||||
(hppa_frame_find_saved_regs): Similarly. Handle indirect save of
|
||||
%r3 into the stack.
|
||||
|
||||
* config/pa/tm-hppa64.h (CALL_DUMMY_BREAKPOINT_OFFSET_P): Define.
|
||||
(CALL_DUMMY_BREAKPOINT_OFFSET): Define.
|
||||
|
||||
Tue Aug 24 14:59:23 1999 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
|
||||
* Makefile.in (gdb$(EXEEXT)): Add dependency on main.o that was
|
||||
lost when libgdb.a was added.
|
||||
|
||||
Tue Aug 24 14:26:34 1999 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
|
||||
* gdbarch.c, gdbarch.h: Convert to pure ISO-C.
|
||||
|
||||
* gdbarch.sh: New file.
|
||||
* gdbarch.c, gdbarch.h: Add note describing gdbarch.sh
|
||||
|
||||
Mon Aug 23 19:36:17 1999 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
|
||||
* Makefile.in (libgdb.a): New target.
|
||||
(gdb$(EXEEXT)): Add dependency on libgdb.a.
|
||||
(libgdb-files, LIBGDB_OBS, libgdb, LIBGDBDEPS, LIBGDBFILES): Delete.
|
||||
|
||||
Mon Aug 23 10:16:32 1999 Jeffrey A Law (law@cygnus.com)
|
||||
|
||||
* infttrate.c (child_pid_to_exec_file): Find the correct base
|
||||
of the stack for PA64.
|
||||
|
||||
* pa64solib.c: Fix some minor whitespace problems.
|
||||
(bfd_lookup_symbol): New function.
|
||||
(pa64_solib_create_inferior_hook): Find the address __dld_break
|
||||
|
@ -43,6 +274,7 @@ Fri Aug 20 10:53:38 1999 Jeffrey A Law (law@cygnus.com)
|
|||
* breakpoint.h (target_hw_bp_type): new enum.
|
||||
* breakpoint.c (insert_breakpoints): use enum instead of consts.
|
||||
(remove_breakpoint): use enum instead of consts.
|
||||
(throughout): use "warning" instead of "fprintf(stderr, ..."
|
||||
[Also clean up a bunch of excessively long lines.]
|
||||
|
||||
1999-08-19 J.T. Conklin <jtc@redback.com>
|
||||
|
@ -537,8 +769,8 @@ Sun Aug 8 12:06:47 1999 Fred Fish <fnf@cygnus.com>
|
|||
1999-08-08 James Ingham <jingham@leda.cygnus.com>
|
||||
|
||||
* remote.c (remote_insert_breakpoint): Fix typo in Z packet support.
|
||||
Also move Z packet support OUTSIDE of REMOTE_BREAKPOINT ifdef,
|
||||
since this is not set for all targets that support the Z packet.
|
||||
Also move Z packet support OUTSIDE of REMOTE_BREAKPOINT ifdef,
|
||||
since this is not set for all targets that support the Z packet.
|
||||
|
||||
Fri Aug 6 17:17:28 1999 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
|
||||
|
@ -624,7 +856,7 @@ Fri Aug 6 19:26:03 1999 Andrew Cagney <cagney@b1.cygnus.com>
|
|||
(arm_othernames): Use the set_disassembly_flavor.
|
||||
(_initialize_arm_tdep): Setup the disassembly flavor commands, and
|
||||
initialize the flavor.
|
||||
(arm_frameless_function_invocation): Adjust for
|
||||
(arm_frameless_function_invocation): Adjust for
|
||||
frameless functions that have 1 or 2 instructions that mimic the
|
||||
standard APCS form.
|
||||
(arm_scan_prologue): Be more careful about scanning the function
|
||||
|
@ -886,7 +1118,7 @@ Wed Aug 4 10:42:58 1999 Fred Fish <fnf@cygnus.com>
|
|||
|
||||
1999-07-28 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
|
||||
|
||||
From Eli Zaretskii <eliz@is.elta.co.il>:
|
||||
From Eli Zaretskii <eliz@is.elta.co.il>:
|
||||
* top.c (gdb_init) [__MSDOS__]: Arrange for GDB to return to the
|
||||
original directory before exiting.
|
||||
(cd_command) [_WIN32 || __MSDOS__]: Canonicalize the new directory
|
||||
|
@ -916,8 +1148,8 @@ Mon Jul 26 17:13:39 1999 Andrew Cagney <cagney@b1.cygnus.com>
|
|||
|
||||
1999-07-24 Fred Fish <fnf@cygnus.com>
|
||||
|
||||
* symfile.c (default_symfile_offsets): Clear section_offsets
|
||||
before filling it in.
|
||||
* symfile.c (default_symfile_offsets): Clear section_offsets
|
||||
before filling it in.
|
||||
|
||||
1999-07-16 Keith Seitz <keiths@cygnus.com>
|
||||
|
||||
|
@ -1016,10 +1248,10 @@ Mon Jul 12 11:15:09 1999 Andrew Cagney <cagney@b1.cygnus.com>
|
|||
|
||||
1999-07-12 Keith Seitz <keiths@cygnus.com>
|
||||
|
||||
* rdi-share/unixcomm.c (Unix_ResetSerial): Remove CYGWIN32
|
||||
* rdi-share/unixcomm.c (Unix_ResetSerial): Remove CYGWIN32
|
||||
conditional. It's no longer needed.
|
||||
(SERPORT1, SERPORT2): Linux serial ports are "/dev/ttyX", not
|
||||
"/dev/cuaX" (X=0,1,2,3,...).
|
||||
(SERPORT1, SERPORT2): Linux serial ports are "/dev/ttyX", not
|
||||
"/dev/cuaX" (X=0,1,2,3,...).
|
||||
|
||||
Mon Jul 12 02:02:00 1999 Andrew Cagney <cagney@amy.cygnus.com>
|
||||
|
||||
|
@ -1684,7 +1916,7 @@ Thu Jun 10 20:04:02 1999 Andrew Cagney <cagney@b1.cygnus.com>
|
|||
(mcore_push_arguments): Fix compiler warning.
|
||||
|
||||
1999-06-09 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
|
||||
|
||||
|
||||
* rs6000-tdep.c (skip_prologue): Don't mistake a branch for a
|
||||
subroutine call.
|
||||
|
||||
|
|
|
@ -125,6 +125,7 @@ READLINE_SRC = $(srcdir)/$(READLINE_DIR)
|
|||
READLINE_CFLAGS = -I$(READLINE_SRC)/..
|
||||
|
||||
WARN_CFLAGS = @WARN_CFLAGS@
|
||||
WERROR_CFLAGS = @WERROR_CFLAGS@
|
||||
|
||||
# Where is the INTL library? Typically in ../intl.
|
||||
INTL_DIR = ../intl
|
||||
|
@ -183,10 +184,12 @@ CFLAGS = -g
|
|||
CXXFLAGS = -g -O
|
||||
|
||||
# INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros.
|
||||
INTERNAL_CFLAGS = $(CFLAGS) $(GLOBAL_CFLAGS) $(PROFILE_CFLAGS) \
|
||||
INTERNAL_WARN_CFLAGS = \
|
||||
$(CFLAGS) $(GLOBAL_CFLAGS) $(PROFILE_CFLAGS) \
|
||||
$(GDB_CFLAGS) $(OPCODES_CFLAGS) $(READLINE_CFLAGS) \
|
||||
$(BFD_CFLAGS) $(MMALLOC_CFLAGS) $(INCLUDE_CFLAGS) \
|
||||
$(INTL_CFLAGS) $(TUI_CFLAGS) $(ENABLE_CFLAGS) $(WARN_CFLAGS)
|
||||
INTERNAL_CFLAGS = $(INTERNAL_WARN_CFLAGS) $(WERROR_CFLAGS)
|
||||
|
||||
# LDFLAGS is specifically reserved for setting from the command line
|
||||
# when running make.
|
||||
|
@ -224,7 +227,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 = 19990830
|
||||
DIST=gdb
|
||||
|
||||
LINT=/usr/5bin/lint
|
||||
|
@ -510,6 +513,7 @@ COMMON_OBS = version.o blockframe.o breakpoint.o findvar.o stack.o thread.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 \
|
||||
gdb-events.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 \
|
||||
|
@ -521,9 +525,7 @@ COMMON_OBS = version.o blockframe.o breakpoint.o findvar.o stack.o thread.o \
|
|||
c-valprint.o cp-valprint.o ch-valprint.o f-valprint.o m2-valprint.o \
|
||||
nlmread.o serial.o mdebugread.o os9kread.o top.o utils.o
|
||||
|
||||
OBS = $(COMMON_OBS) $(ANNOTATE_OBS) main.o
|
||||
|
||||
LIBGDB_OBS =
|
||||
OBS = $(COMMON_OBS) $(ANNOTATE_OBS)
|
||||
|
||||
TSOBS = inflow.o
|
||||
|
||||
|
@ -645,28 +647,22 @@ init.c: $(OBS) $(TSOBS)
|
|||
.PRECIOUS: init.c
|
||||
|
||||
# Removing the old gdb first works better if it is running, at least on SunOS.
|
||||
gdb$(EXEEXT): $(OBS) $(BUILD_TUI) $(TSOBS) $(ADD_DEPS) $(CDEPS) init.o
|
||||
gdb$(EXEEXT): main.o libgdb.a $(ADD_DEPS) $(CDEPS) $(TDEPLIBS)
|
||||
rm -f gdb$(EXEEXT)
|
||||
$(HLDENV) $(CC_LD) $(INTERNAL_LDFLAGS) $(WIN32LDAPP) -o gdb$(EXEEXT) \
|
||||
init.o $(OBS) $(TSOBS) $(TUI_LIBRARY) $(ADD_FILES) $(CLIBS) $(LOADLIBES)
|
||||
$(HLDENV) $(CC_LD) $(INTERNAL_LDFLAGS) $(WIN32LDAPP) -o gdb$(EXEEXT) main.o libgdb.a $(TDEPLIBS) $(TUI_LIBRARY) $(CLIBS) $(LOADLIBES)
|
||||
|
||||
nlm: force
|
||||
rootme=`pwd`; export rootme; $(MAKE) $(TARGET_FLAGS_TO_PASS) DO=all DODIRS=nlm subdir_do
|
||||
|
||||
libgdb: libgdb-files $(LIBGDB_OBS)
|
||||
|
||||
# libproc is not listed here because all-libproc is a dependency of all-gui,
|
||||
# not all-gdb, and thus might be built after us.
|
||||
LIBGDBDEPS=$(COMMON_OBS) $(LIBGDB_OBS) $(TSOBS) $(ADD_DEPS) $(CDEPS) init.o
|
||||
# libproc needs to be before libiberty for alloca.
|
||||
LIBGDBFILES=$(COMMON_OBS) $(LIBGDB_OBS) $(TSOBS) ../libproc/libproc.a \
|
||||
$(ADD_DEPS) $(CDEPS) init.o
|
||||
|
||||
libgdb-files: $(LIBGDBDEPS) Makefile.in
|
||||
-rm -f libgdb-files
|
||||
for i in $(LIBGDBFILES); do\
|
||||
echo $$i >> libgdb-files;\
|
||||
done
|
||||
# Create a library of the gdb object files and build GDB by linking
|
||||
# against that.
|
||||
#
|
||||
# init.o is very important. It pulls in the rest of GDB.
|
||||
LIBGDB_OBS= $(OBS) $(TSOBS) $(ADD_FILES) init.o
|
||||
libgdb.a: $(LIBGDB_OBS)
|
||||
-rm -f libgdb.a
|
||||
$(AR) q libgdb.a $(LIBGDB_OBS)
|
||||
$(RANLIB) libgdb.a
|
||||
|
||||
saber_gdb: $(SFILES) $(DEPFILES) copying.c version.c
|
||||
#setopt load_flags $(CFLAGS) $(BFD_CFLAGS) -DHOST_SYS=SUN4_SYS
|
||||
|
@ -756,7 +752,7 @@ clean mostlyclean:
|
|||
@$(MAKE) $(FLAGS_TO_PASS) DO=clean "DODIRS=$(SUBDIRS)" subdir_do
|
||||
rm -f *.o *.a $(ADD_FILES) *~ init.c-tmp
|
||||
rm -f init.c version.c
|
||||
rm -f gdb$(EXEEXT) core make.log libgdb-files
|
||||
rm -f gdb$(EXEEXT) core make.log
|
||||
rm -f gdb[0-9]$(EXEEXT)
|
||||
|
||||
# This used to depend on c-exp.tab.c m2-exp.tab.c TAGS
|
||||
|
@ -1009,7 +1005,8 @@ blockframe.o: blockframe.c $(defs_h) $(gdbcore_h) $(inferior_h) \
|
|||
objfiles.h symfile.h target.h
|
||||
|
||||
breakpoint.o: breakpoint.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) \
|
||||
$(inferior_h) language.h target.h gdbthread.h gdb_string.h
|
||||
$(inferior_h) language.h target.h gdbthread.h gdb_string.h \
|
||||
gdb-events.h
|
||||
|
||||
buildsym.o: buildsym.c $(bfd_h) buildsym.h complaints.h $(defs_h) \
|
||||
objfiles.h symfile.h $(symtab_h) gdb_string.h
|
||||
|
@ -1122,7 +1119,7 @@ eval.o: eval.c $(bfd_h) $(defs_h) $(expression_h) $(frame_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
|
||||
$(defs_h) $(inferior_h) $(event_loop_h) terminal.h $(gdbcmd_h)
|
||||
|
||||
exec.o: exec.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) $(inferior_h) \
|
||||
target.h language.h gdb_string.h
|
||||
|
@ -1136,9 +1133,12 @@ findvar.o: findvar.c $(defs_h) $(gdbcore_h) $(inferior_h) target.h \
|
|||
fork-child.o: fork-child.c $(wait_h) $(defs_h) $(gdbcore_h) \
|
||||
$(inferior_h) target.h terminal.h gdbthread.h gdb_string.h
|
||||
|
||||
# Due to several ``enum enabled'' declaration clashes it is difficult
|
||||
# to fix breakpoint.c's compiler warnings.
|
||||
tracepoint.o: tracepoint.c $(defs_h) $(symtab_h) $(frame_h) $(tracepoint_h) \
|
||||
$(gdbtypes_h) $(expression_h) $(gdbcmd_h) $(value_h) target.h \
|
||||
language.h gdb_string.h $(readline_headers)
|
||||
$(CC) -c $(INTERNAL_WARN_CFLAGS) $(NO_WERROR_CFLAGS) $<
|
||||
|
||||
gdbarch.o: gdbarch.c $(defs_h) $(bfd_h) $(gdbcmd_h)
|
||||
|
||||
|
@ -1575,8 +1575,8 @@ symtab.o: symtab.c call-cmds.h $(defs_h) $(expression_h) $(frame_h) \
|
|||
gnu-regex.h symfile.h $(symtab_h) target.h $(value_h) \
|
||||
gdb_string.h
|
||||
|
||||
tahoe-tdep.o: tahoe-tdep.c $(OP_INCLUDE)/tahoe.h $(defs_h) \
|
||||
$(symtab_h)
|
||||
# OBSOLETE tahoe-tdep.o: tahoe-tdep.c $(OP_INCLUDE)/tahoe.h $(defs_h) \
|
||||
# OBSOLETE $(symtab_h)
|
||||
|
||||
tic80-tdep.o: tic80-tdep.c $(defs_h)
|
||||
|
||||
|
@ -1601,7 +1601,7 @@ umax-xdep.o: umax-xdep.c $(defs_h) $(gdbcore_h) $(inferior_h)
|
|||
|
||||
utils.o: utils.c $(bfd_h) $(defs_h) $(expression_h) $(gdbcmd_h) \
|
||||
language.h signals.h target.h terminal.h $(readline_headers) \
|
||||
gdb_string.h
|
||||
gdb_string.h $(event_loop_h)
|
||||
|
||||
valarith.o: valarith.c $(bfd_h) $(defs_h) $(expression_h) \
|
||||
$(gdbtypes_h) language.h $(symtab_h) target.h $(value_h) \
|
||||
|
@ -1663,5 +1663,7 @@ 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
|
||||
|
||||
gdb-events.o: gdb-events.c gdb-events.h $(defs_h) $(gdbcmd_h)
|
||||
|
||||
|
||||
### end of the gdb Makefile.in.
|
||||
|
|
7
gdb/NEWS
7
gdb/NEWS
|
@ -3,6 +3,12 @@
|
|||
|
||||
*** Changes since GDB-4.18:
|
||||
|
||||
* New features
|
||||
|
||||
On SVR4 native platforms (such as Solaris), if you attach to a process
|
||||
without first loading a symbol file, GDB will now attempt to locate and
|
||||
load symbols from the running process's executable file.
|
||||
|
||||
* New targets
|
||||
|
||||
Motorola MCore mcore-*-*
|
||||
|
@ -15,6 +21,7 @@ TI TMS320C80 tic80-*-*
|
|||
Altos 3068 m68*-altos-*
|
||||
Convex c1-*-*, c2-*-*
|
||||
Pyramid pyramid-*-*
|
||||
Tahoe tahoe-*-*
|
||||
|
||||
* Remote targets can connect to a sub-program
|
||||
|
||||
|
|
|
@ -44,9 +44,7 @@ extern void annotate_breakpoints_table_end PARAMS ((void));
|
|||
|
||||
extern void annotate_frames_invalid PARAMS ((void));
|
||||
|
||||
#ifdef __STDC__
|
||||
struct type;
|
||||
#endif
|
||||
|
||||
extern void annotate_field_begin PARAMS ((struct type *));
|
||||
extern void annotate_field_name_end PARAMS ((void));
|
||||
|
|
|
@ -833,18 +833,23 @@ arm_init_extra_frame_info (fromleaf, fi)
|
|||
{
|
||||
arm_scan_prologue (fi);
|
||||
|
||||
if (!fi->next) /* this is the innermost frame? */
|
||||
if (!fi->next)
|
||||
/* this is the innermost frame? */
|
||||
fi->frame = read_register (fi->framereg);
|
||||
else /* not the innermost frame */
|
||||
else
|
||||
/* not the innermost frame */
|
||||
/* If we have an FP, the callee saved it. */
|
||||
if (fi->framereg == FP_REGNUM || fi->framereg == THUMB_FP_REGNUM)
|
||||
if (fi->next->fsr.regs[fi->framereg] != 0)
|
||||
fi->frame = read_memory_integer (fi->next->fsr.regs[fi->framereg],
|
||||
4);
|
||||
else if (fromleaf) /* If we were called by a frameless fn.
|
||||
then our frame is still in the frame pointer
|
||||
register on the board... */
|
||||
fi->frame = read_fp ();
|
||||
{
|
||||
if (fi->next->fsr.regs[fi->framereg] != 0)
|
||||
fi->frame =
|
||||
read_memory_integer (fi->next->fsr.regs[fi->framereg], 4);
|
||||
else if (fromleaf)
|
||||
/* If we were called by a frameless fn. then our frame
|
||||
is still in the frame pointer register on the
|
||||
board... */
|
||||
fi->frame = read_fp ();
|
||||
}
|
||||
|
||||
/* Calculate actual addresses of saved registers using offsets determined
|
||||
by arm_scan_prologue. */
|
||||
|
@ -1246,17 +1251,17 @@ arm_othernames ()
|
|||
void
|
||||
convert_from_extended (ptr, dbl)
|
||||
void *ptr;
|
||||
double *dbl;
|
||||
void *dbl;
|
||||
{
|
||||
*dbl = *(double *) ptr;
|
||||
*(double *) dbl = *(double *) ptr;
|
||||
}
|
||||
|
||||
void
|
||||
convert_to_extended (dbl, ptr)
|
||||
void *ptr;
|
||||
double *dbl;
|
||||
void *dbl;
|
||||
{
|
||||
*(double *) ptr = *dbl;
|
||||
*(double *) ptr = *(double *) dbl;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
@ -40,6 +40,8 @@
|
|||
#include "symfile.h"
|
||||
#include "objfiles.h"
|
||||
|
||||
#include "gdb-events.h"
|
||||
|
||||
/* Prototypes for local functions. */
|
||||
|
||||
static void
|
||||
|
@ -3347,6 +3349,9 @@ create_solib_event_breakpoint (address)
|
|||
b->type = bp_shlib_event;
|
||||
}
|
||||
|
||||
/* Disable any breakpoints that are on code in shared libraries. Only
|
||||
apply to enabled breakpoints, disabled ones can just stay disabled. */
|
||||
|
||||
void
|
||||
disable_breakpoints_in_shlibs (silent)
|
||||
int silent;
|
||||
|
@ -3360,8 +3365,7 @@ disable_breakpoints_in_shlibs (silent)
|
|||
#if defined (PC_SOLIB)
|
||||
if (((b->type == bp_breakpoint) ||
|
||||
(b->type == bp_hardware_breakpoint)) &&
|
||||
(b->enable != shlib_disabled) &&
|
||||
(b->enable != call_disabled) &&
|
||||
b->enable == enabled &&
|
||||
!b->duplicate &&
|
||||
PC_SOLIB (b->address))
|
||||
{
|
||||
|
@ -3736,6 +3740,7 @@ mention (b)
|
|||
delete_breakpoint_hook and so on. */
|
||||
if (create_breakpoint_hook)
|
||||
create_breakpoint_hook (b);
|
||||
breakpoint_create_event (b->number);
|
||||
|
||||
switch (b->type)
|
||||
{
|
||||
|
@ -5850,6 +5855,7 @@ delete_breakpoint (bpt)
|
|||
|
||||
if (delete_breakpoint_hook)
|
||||
delete_breakpoint_hook (bpt);
|
||||
breakpoint_delete_event (bpt->number);
|
||||
|
||||
if (bpt->inserted)
|
||||
remove_breakpoint (bpt, mark_uninserted);
|
||||
|
@ -6381,6 +6387,7 @@ disable_breakpoint (bpt)
|
|||
|
||||
if (modify_breakpoint_hook)
|
||||
modify_breakpoint_hook (bpt);
|
||||
breakpoint_modify_event (bpt->number);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
|
@ -6513,6 +6520,7 @@ have been allocated for other watchpoints.\n", bpt->number);
|
|||
}
|
||||
if (modify_breakpoint_hook)
|
||||
modify_breakpoint_hook (bpt);
|
||||
breakpoint_modify_event (bpt->number);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -24,6 +24,8 @@
|
|||
#include "frame.h"
|
||||
#include "value.h"
|
||||
|
||||
#include "gdb-events.h"
|
||||
|
||||
/* This is the maximum number of bytes a breakpoint instruction can take.
|
||||
Feel free to increase it. It's just used in a few places to size
|
||||
arrays that should be independent of the target architecture. */
|
||||
|
@ -461,9 +463,8 @@ enum inf_context
|
|||
|
||||
/* Prototypes for breakpoint-related functions. */
|
||||
|
||||
#ifdef __STDC__ /* Forward declarations for prototypes */
|
||||
/* Forward declarations for prototypes */
|
||||
struct frame_info;
|
||||
#endif
|
||||
|
||||
extern int breakpoint_here_p PARAMS ((CORE_ADDR));
|
||||
|
||||
|
|
|
@ -18,9 +18,8 @@
|
|||
Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef __STDC__ /* Forward decls for prototypes */
|
||||
/* Forward decls for prototypes */
|
||||
struct value;
|
||||
#endif
|
||||
|
||||
extern int
|
||||
chill_parse PARAMS ((void)); /* Defined in ch-exp.y */
|
||||
|
|
|
@ -18,9 +18,8 @@
|
|||
Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef __STDC__ /* Forward decl's for prototypes */
|
||||
/* Forward decl's for prototypes */
|
||||
struct target_ops;
|
||||
#endif
|
||||
|
||||
/* Called when we free all symtabs, to free the shared library information
|
||||
as well. */
|
||||
|
|
|
@ -22,9 +22,6 @@
|
|||
#include "value.h"
|
||||
#include <ctype.h>
|
||||
#include "gdb_string.h"
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_WAIT_H
|
||||
#include <wait.h>
|
||||
|
|
|
@ -264,6 +264,9 @@
|
|||
/* Define if you have the <termios.h> header file. */
|
||||
#undef HAVE_TERMIOS_H
|
||||
|
||||
/* Define if you have the <time.h> header file. */
|
||||
#undef HAVE_TIME_H
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
|
|
|
@ -507,10 +507,7 @@ 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)
|
||||
|
|
|
@ -26,12 +26,10 @@
|
|||
#include "coff/sym.h" /* Needed for PDR below. */
|
||||
#include "coff/symconst.h"
|
||||
|
||||
#ifdef __STDC__
|
||||
struct frame_info;
|
||||
struct type;
|
||||
struct value;
|
||||
struct symbol;
|
||||
#endif
|
||||
|
||||
#if !defined (TARGET_BYTE_ORDER)
|
||||
#define TARGET_BYTE_ORDER LITTLE_ENDIAN
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
# 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 remote-rdi.o
|
||||
TDEPLIBS= rdi-share/libangsd.a
|
||||
TM_FILE= tm-arm.h
|
||||
|
||||
SIM_OBS = remote-sim.o
|
||||
|
|
|
@ -18,10 +18,9 @@
|
|||
Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef __STDC__ /* Forward decls for prototypes */
|
||||
/* Forward decls for prototypes */
|
||||
struct type;
|
||||
struct value;
|
||||
#endif
|
||||
|
||||
#define TARGET_BYTE_ORDER_SELECTABLE
|
||||
|
||||
|
@ -105,6 +104,8 @@ extern breakpoint_from_pc_fn arm_breakpoint_from_pc;
|
|||
* floating point processor (if any)
|
||||
* No need to define if there is nothing to do.
|
||||
*/
|
||||
extern void arm_float_info (void);
|
||||
|
||||
#define FLOAT_INFO { arm_float_info (); }
|
||||
|
||||
/* Say how long (ordinary) registers are. This is a piece of bogosity
|
||||
|
@ -213,6 +214,8 @@ extern char **arm_register_names;
|
|||
/* Convert data from raw format for register REGNUM in buffer FROM
|
||||
to virtual format with type TYPE in buffer TO. */
|
||||
|
||||
void convert_from_extended (void *ptr, /*double*/void *dbl);
|
||||
|
||||
#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,TYPE,FROM,TO) \
|
||||
{ \
|
||||
double val; \
|
||||
|
@ -223,6 +226,8 @@ extern char **arm_register_names;
|
|||
/* Convert data from virtual format with type TYPE in buffer FROM
|
||||
to raw format for register REGNUM in buffer TO. */
|
||||
|
||||
extern void convert_to_extended (void *ptr, /*double*/void *dbl);
|
||||
|
||||
#define REGISTER_CONVERT_TO_RAW(TYPE,REGNUM,FROM,TO) \
|
||||
{ \
|
||||
double val = extract_floating ((FROM), TYPE_LENGTH (TYPE)); \
|
||||
|
@ -332,6 +337,7 @@ extern int arm_frame_chain_valid PARAMS ((CORE_ADDR, struct frame_info *));
|
|||
stmdb sp!, {}
|
||||
sub sp, ip, #4. */
|
||||
|
||||
extern int arm_frameless_function_invocation (struct frame_info *fi);
|
||||
#define FRAMELESS_FUNCTION_INVOCATION(FI) \
|
||||
(arm_frameless_function_invocation (FI))
|
||||
|
||||
|
@ -361,8 +367,8 @@ 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 arm_frame_find_saved_regs (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));
|
||||
|
|
|
@ -37,12 +37,11 @@
|
|||
#define IMEM_START 0x00000000 /* was 0x10000000 */
|
||||
#define STACK_START 0x20007ffe
|
||||
|
||||
#ifdef __STDC__ /* Forward decls for prototypes */
|
||||
/* 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. */
|
||||
|
|
|
@ -138,12 +138,11 @@ extern void fr30_pop_frame PARAMS ((void));
|
|||
Can return -1, meaning no way to tell. */
|
||||
#define FRAME_NUM_ARGS(fi) (-1)
|
||||
|
||||
#ifdef __STDC__ /* Forward decls for prototypes */
|
||||
/* Forward decls for prototypes */
|
||||
struct frame_info;
|
||||
struct frame_saved_regs;
|
||||
struct type;
|
||||
struct value;
|
||||
#endif
|
||||
|
||||
#define EXTRA_FRAME_INFO \
|
||||
struct frame_saved_regs fsr; \
|
||||
|
|
|
@ -20,12 +20,10 @@
|
|||
|
||||
/* Contributed by Steve Chamberlain sac@cygnus.com */
|
||||
|
||||
#ifdef __STDC__
|
||||
struct frame_info;
|
||||
struct frame_saved_regs;
|
||||
struct value;
|
||||
struct type;
|
||||
#endif
|
||||
|
||||
/* 1 if debugging H8/300H application */
|
||||
extern int h8300hmode;
|
||||
|
|
|
@ -22,9 +22,7 @@
|
|||
|
||||
#ifdef HAVE_THREAD_DB_LIB
|
||||
|
||||
#ifdef __STDC__
|
||||
struct objfile;
|
||||
#endif
|
||||
|
||||
#define target_new_objfile(OBJFILE) sol_thread_new_objfile (OBJFILE)
|
||||
|
||||
|
|
|
@ -21,11 +21,10 @@
|
|||
#ifndef TM_I386_H
|
||||
#define TM_I386_H 1
|
||||
|
||||
#ifdef __STDC__ /* Forward decl's for prototypes */
|
||||
/* Forward decl's for prototypes */
|
||||
struct frame_info;
|
||||
struct frame_saved_regs;
|
||||
struct type;
|
||||
#endif
|
||||
|
||||
#define TARGET_BYTE_ORDER LITTLE_ENDIAN
|
||||
|
||||
|
|
|
@ -153,10 +153,9 @@
|
|||
#undef FRAME_NUM_ARGS
|
||||
#define FRAME_NUM_ARGS(fi) (-1)
|
||||
|
||||
#ifdef __STDC__ /* Forward decl's for prototypes */
|
||||
/* Forward decl's for prototypes */
|
||||
struct frame_info;
|
||||
struct frame_saved_regs;
|
||||
#endif
|
||||
|
||||
extern int
|
||||
i386_frame_num_args PARAMS ((struct frame_info *));
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#ifndef sun386
|
||||
#define sun386
|
||||
#endif
|
||||
#define GDB_TARGET_IS_SUN386 1
|
||||
#define SUNOS4
|
||||
#define USE_MACHINE_REG_H
|
||||
|
||||
|
|
|
@ -26,9 +26,7 @@
|
|||
#include "i960/tm-i960.h"
|
||||
|
||||
/* forward declarations */
|
||||
#ifdef __STDC__
|
||||
struct frame_info;
|
||||
#endif
|
||||
|
||||
/* redefined from tm-i960.h */
|
||||
/* Number of machine registers */
|
||||
|
|
|
@ -26,9 +26,7 @@
|
|||
#include "i960/tm-i960.h"
|
||||
|
||||
/* forward declarations */
|
||||
#ifdef __STDC__
|
||||
struct frame_info;
|
||||
#endif
|
||||
|
||||
/* Override the standard gdb prompt when compiled for this target. */
|
||||
|
||||
|
|
|
@ -89,12 +89,10 @@
|
|||
/* mvs_check SAVED_PC_AFTER_CALL */
|
||||
#define SAVED_PC_AFTER_CALL(fi) read_register (RP_REGNUM)
|
||||
|
||||
#ifdef __STDC__
|
||||
struct frame_info;
|
||||
struct frame_saved_regs;
|
||||
struct type;
|
||||
struct value;
|
||||
#endif
|
||||
|
||||
/* Define other aspects of the stack frame.
|
||||
We keep the offsets of all saved registers, 'cause we need 'em a lot!
|
||||
|
|
|
@ -43,10 +43,8 @@ extern CORE_ADDR m68k_skip_prologue PARAMS ((CORE_ADDR ip));
|
|||
the new frame is not set up until the new function executes
|
||||
some instructions. */
|
||||
|
||||
#ifdef __STDC__
|
||||
struct frame_info;
|
||||
struct frame_saved_regs;
|
||||
#endif
|
||||
|
||||
extern CORE_ADDR m68k_saved_pc_after_call PARAMS ((struct frame_info *));
|
||||
extern void m68k_find_saved_regs PARAMS ((struct frame_info *, struct frame_saved_regs *));
|
||||
|
|
|
@ -24,12 +24,10 @@
|
|||
#ifndef TM_MIPS_H
|
||||
#define TM_MIPS_H 1
|
||||
|
||||
#ifdef __STDC__
|
||||
struct frame_info;
|
||||
struct symbol;
|
||||
struct type;
|
||||
struct value;
|
||||
#endif
|
||||
|
||||
#include <bfd.h>
|
||||
#include "coff/sym.h" /* Needed for PDR below. */
|
||||
|
|
|
@ -92,12 +92,10 @@
|
|||
#define SAVED_PC_AFTER_CALL(frame) \
|
||||
(read_memory_integer (read_register (SP_REGNUM), REGISTER_SIZE) & 0xffffff)
|
||||
|
||||
#ifdef __STDC__
|
||||
struct frame_info;
|
||||
struct frame_saved_regs;
|
||||
struct type;
|
||||
struct value;
|
||||
#endif
|
||||
|
||||
#define EXTRA_FRAME_INFO struct frame_saved_regs fsr; int status; int stack_size;
|
||||
|
||||
|
|
|
@ -70,11 +70,9 @@ extern CORE_ADDR mn10300_saved_pc_after_call PARAMS ((struct frame_info * frame)
|
|||
#define SAVED_PC_AFTER_CALL(frame) \
|
||||
mn10300_saved_pc_after_call (frame)
|
||||
|
||||
#ifdef __STDC__
|
||||
struct frame_info;
|
||||
struct type;
|
||||
struct value;
|
||||
#endif
|
||||
|
||||
extern void mn10300_init_extra_frame_info PARAMS ((struct frame_info *));
|
||||
#define INIT_EXTRA_FRAME_INFO(fromleaf, fi) mn10300_init_extra_frame_info (fi)
|
||||
|
|
|
@ -279,9 +279,7 @@ extern int hppa_resume_execd_vforking_child_to_get_parent_vfork PARAMS ((void));
|
|||
|
||||
#ifdef HAVE_HPUX_THREAD_SUPPORT
|
||||
|
||||
#ifdef __STDC__
|
||||
struct objfile;
|
||||
#endif
|
||||
|
||||
void hpux_thread_new_objfile PARAMS ((struct objfile * objfile));
|
||||
#define target_new_objfile(OBJFILE) hpux_thread_new_objfile (OBJFILE)
|
||||
|
|
|
@ -24,13 +24,11 @@
|
|||
|
||||
/* Forward declarations of some types we use in prototypes */
|
||||
|
||||
#ifdef __STDC__
|
||||
struct frame_info;
|
||||
struct frame_saved_regs;
|
||||
struct value;
|
||||
struct type;
|
||||
struct inferior_status;
|
||||
#endif
|
||||
|
||||
/* Target system byte order. */
|
||||
|
||||
|
|
|
@ -191,6 +191,9 @@ call_dummy
|
|||
0xe820f0000fb110d3LL, 0x0001000400151820LL,\
|
||||
0xe6c0000008000240LL}
|
||||
|
||||
#define CALL_DUMMY_BREAKPOINT_OFFSET_P 1
|
||||
#define CALL_DUMMY_BREAKPOINT_OFFSET 22 * 4
|
||||
|
||||
/* CALL_DUMMY_LENGTH is computed based on the size of a word on the target
|
||||
machine, not the size of an instruction. Since a word on this target
|
||||
holds two instructions we have to divide the instruction size by two to
|
||||
|
|
|
@ -50,9 +50,7 @@
|
|||
xcoff_relocate_core (c);
|
||||
|
||||
extern void xcoff_relocate_symtab PARAMS ((unsigned int));
|
||||
#ifdef __STDC__
|
||||
struct target_ops;
|
||||
#endif
|
||||
extern void xcoff_relocate_core PARAMS ((struct target_ops *));
|
||||
|
||||
/* Return sizeof user struct to callers in less machine dependent routines */
|
||||
|
|
|
@ -20,11 +20,10 @@
|
|||
Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef __STDC__ /* Forward decls for prototypes */
|
||||
/* Forward decls for prototypes */
|
||||
struct frame_info;
|
||||
struct type;
|
||||
struct value;
|
||||
#endif
|
||||
|
||||
/* Minimum possible text address in AIX */
|
||||
|
||||
|
@ -520,10 +519,9 @@ CORE_ADDR (*find_toc_address_hook) PARAMS ((CORE_ADDR));
|
|||
for a given object file.
|
||||
It is used under native AIX configurations for determining the
|
||||
TOC address when calling functions in the inferior. */
|
||||
#ifdef __STDC__
|
||||
struct objfile;
|
||||
#endif
|
||||
extern CORE_ADDR get_toc_offset PARAMS ((struct objfile *));
|
||||
|
||||
struct objfile;
|
||||
extern CORE_ADDR get_toc_offset PARAMS ((struct objfile *));
|
||||
|
||||
/* Usually a function pointer's representation is simply the address
|
||||
of the function. On the RS/6000 however, a function pointer is
|
||||
|
|
|
@ -20,12 +20,10 @@
|
|||
|
||||
/* Contributed by Steve Chamberlain sac@cygnus.com */
|
||||
|
||||
#ifdef __STDC__
|
||||
struct frame_info;
|
||||
struct frame_saved_regs;
|
||||
struct value;
|
||||
struct type;
|
||||
#endif
|
||||
|
||||
#define GDB_TARGET_IS_SH
|
||||
|
||||
|
|
|
@ -32,9 +32,7 @@
|
|||
|
||||
#ifdef HAVE_THREAD_DB_LIB
|
||||
|
||||
#ifdef __STDC__
|
||||
struct objfile;
|
||||
#endif
|
||||
|
||||
#define target_new_objfile(OBJFILE) sol_thread_new_objfile (OBJFILE)
|
||||
|
||||
|
|
|
@ -24,9 +24,7 @@
|
|||
|
||||
#define GDB_TARGET_IS_SPARC64
|
||||
|
||||
#ifdef __STDC__
|
||||
struct value;
|
||||
#endif
|
||||
|
||||
/* Eeeew. Ok, we have to assume (for now) that the processor really is
|
||||
in sparc64 mode. While this is the same instruction sequence as
|
||||
|
|
|
@ -21,11 +21,9 @@
|
|||
Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef __STDC__
|
||||
struct frame_info;
|
||||
struct type;
|
||||
struct value;
|
||||
#endif
|
||||
|
||||
#define TARGET_BYTE_ORDER BIG_ENDIAN
|
||||
|
||||
|
@ -205,10 +203,7 @@ extern CORE_ADDR sparc_pc_adjust PARAMS ((CORE_ADDR));
|
|||
outs change into ins in different frames. HAVE_REGISTER_WINDOWS can't
|
||||
deal with this case and also handle flat frames at the same time. */
|
||||
|
||||
#ifdef __STDC__
|
||||
struct frame_info;
|
||||
enum lval_type;
|
||||
#endif
|
||||
void sparc_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) \
|
||||
sparc_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Host: CCI or Harris Tahoe running BSD Unix
|
||||
|
||||
XM_FILE= xm-tahoe.h
|
||||
XDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o core-aout.o
|
||||
# OBSOLETE # Host: CCI or Harris Tahoe running BSD Unix
|
||||
# OBSOLETE
|
||||
# OBSOLETE XM_FILE= xm-tahoe.h
|
||||
# OBSOLETE XDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o core-aout.o
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
# Target: CCI or Harris Tahoe running BSD Unix
|
||||
TDEPFILES= tahoe-tdep.o
|
||||
TM_FILE= tm-tahoe.h
|
||||
# OBSOLETE # Target: CCI or Harris Tahoe running BSD Unix
|
||||
# OBSOLETE TDEPFILES= tahoe-tdep.o
|
||||
# OBSOLETE TM_FILE= tm-tahoe.h
|
||||
|
|
|
@ -1,271 +1,271 @@
|
|||
/* Definitions to make GDB target for a tahoe running 4.3-Reno.
|
||||
Copyright 1986, 1987, 1989, 1991, 1992, 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. */
|
||||
|
||||
/*
|
||||
* Ported by the State University of New York at Buffalo by the Distributed
|
||||
* Computer Systems Lab, Department of Computer Science, 1991.
|
||||
*/
|
||||
|
||||
#define TARGET_BYTE_ORDER BIG_ENDIAN
|
||||
#define BITS_BIG_ENDIAN 0
|
||||
|
||||
/* Offset from address of function to start of its code.
|
||||
Zero on most machines. */
|
||||
|
||||
#define FUNCTION_START_OFFSET 2
|
||||
|
||||
/* Advance PC across any function entry prologue instructions
|
||||
to reach some "real" code. */
|
||||
|
||||
extern CORE_ADDR tahoe_skip_prologue PARAMS ((CORE_ADDR));
|
||||
#define SKIP_PROLOGUE(pc) (tahoe_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
|
||||
the new frame is not set up until the new function executes
|
||||
some instructions. */
|
||||
|
||||
#define SAVED_PC_AFTER_CALL(frame) FRAME_SAVED_PC(frame)
|
||||
|
||||
/* Wrong for cross-debugging. I don't know the real values. */
|
||||
#include <machine/param.h>
|
||||
#define TARGET_UPAGES UPAGES
|
||||
#define TARGET_NBPG NBPG
|
||||
|
||||
/* Address of end of stack space. */
|
||||
|
||||
#define STACK_END_ADDR (0xc0000000 - (TARGET_UPAGES * TARGET_NBPG))
|
||||
|
||||
/* On BSD, sigtramp is in the u area. Can't check the exact
|
||||
addresses because for cross-debugging we don't have target include
|
||||
files around. This should be close enough. */
|
||||
#define IN_SIGTRAMP(pc, name) ((pc) >= STACK_END_ADDR && (pc < 0xc0000000))
|
||||
|
||||
/* Stack grows downward. */
|
||||
|
||||
#define INNER_THAN(lhs,rhs) ((lhs) < (rhs))
|
||||
|
||||
/* Sequence of bytes for breakpoint instruction. */
|
||||
|
||||
#define BREAKPOINT {0x30}
|
||||
|
||||
/* Amount PC must be decremented by after a breakpoint.
|
||||
This is often the number of bytes in BREAKPOINT
|
||||
but not always. */
|
||||
|
||||
#define DECR_PC_AFTER_BREAK 0
|
||||
|
||||
/* Return 1 if P points to an invalid floating point value.
|
||||
LEN is the length in bytes -- not relevant on the Tahoe. */
|
||||
|
||||
#define INVALID_FLOAT(p, len) ((*(short *) p & 0xff80) == 0x8000)
|
||||
|
||||
/* 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 4
|
||||
|
||||
/* Number of machine registers */
|
||||
|
||||
#define NUM_REGS 19
|
||||
|
||||
/* Initializer for an array of names of registers.
|
||||
There should be NUM_REGS strings in this initializer. */
|
||||
|
||||
#define REGISTER_NAMES {"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12", "fp", "sp", "pc", "ps", "al", "ah"}
|
||||
|
||||
#define FP_REGNUM 13 /* Contains address of executing stack frame */
|
||||
#define SP_REGNUM 14 /* Contains address of top of stack */
|
||||
#define PC_REGNUM 15 /* Contains program counter */
|
||||
#define PS_REGNUM 16 /* Contains processor status */
|
||||
|
||||
#define AL_REGNUM 17 /* Contains accumulator */
|
||||
#define AH_REGNUM 18
|
||||
|
||||
/* Total amount of space needed to store our copies of the machine's
|
||||
register state, the array `registers'. */
|
||||
|
||||
#define REGISTER_BYTES (19*4)
|
||||
|
||||
/* Index within `registers' of the first byte of the space for
|
||||
register N. */
|
||||
|
||||
#define REGISTER_BYTE(N) ((N) * 4)
|
||||
|
||||
/* Number of bytes of storage in the actual machine representation
|
||||
for register N. On the tahoe, all regs are 4 bytes. */
|
||||
|
||||
#define REGISTER_RAW_SIZE(N) 4
|
||||
|
||||
/* Number of bytes of storage in the program's representation
|
||||
for register N. On the tahoe, all regs are 4 bytes. */
|
||||
|
||||
#define REGISTER_VIRTUAL_SIZE(N) 4
|
||||
|
||||
/* Largest value REGISTER_RAW_SIZE can have. */
|
||||
|
||||
#define MAX_REGISTER_RAW_SIZE 4
|
||||
|
||||
/* Largest value REGISTER_VIRTUAL_SIZE can have. */
|
||||
|
||||
#define MAX_REGISTER_VIRTUAL_SIZE 4
|
||||
|
||||
/* Return the GDB type object for the "standard" data type
|
||||
of data in register N. */
|
||||
|
||||
#define REGISTER_VIRTUAL_TYPE(N) builtin_type_int
|
||||
|
||||
/* 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 (1, (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, REGBUF, 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 (0, 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). */
|
||||
|
||||
#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) (*(int *)(REGBUF))
|
||||
|
||||
/* Describe the pointer in each stack frame to the previous stack frame
|
||||
(its caller).
|
||||
|
||||
FRAME_CHAIN takes a frame's nominal address
|
||||
and produces the frame's chain-pointer. */
|
||||
|
||||
/* In the case of the Tahoe, the frame's nominal address is the FP value,
|
||||
and it points to the old FP */
|
||||
|
||||
#define FRAME_CHAIN(thisframe) \
|
||||
(!inside_entry_file ((thisframe)->pc) ? \
|
||||
read_memory_integer ((thisframe)->frame, 4) :\
|
||||
0)
|
||||
|
||||
/* Define other aspects of the stack frame. */
|
||||
|
||||
/* Saved PC */
|
||||
|
||||
#define FRAME_SAVED_PC(FRAME) (read_memory_integer ((FRAME)->frame - 8, 4))
|
||||
|
||||
/* In most of GDB, getting the args address is too important to
|
||||
just say "I don't know". */
|
||||
|
||||
#define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)
|
||||
|
||||
/* Address to use as an anchor for finding local variables */
|
||||
|
||||
#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
|
||||
|
||||
/* Return number of args passed to a frame.
|
||||
Can return -1, meaning no way to tell. */
|
||||
|
||||
extern int tahoe_frame_num_args PARAMS ((struct frame_info * fi));
|
||||
#define FRAME_NUM_ARGS(fi) (tahoe_frame_num_args ((fi)))
|
||||
|
||||
/* 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. */
|
||||
|
||||
#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
|
||||
{ register int regnum; \
|
||||
register int rmask = read_memory_integer ((frame_info)->frame-4, 4) >> 16;\
|
||||
register CORE_ADDR next_addr; \
|
||||
memset (&frame_saved_regs, '\0', sizeof frame_saved_regs); \
|
||||
next_addr = (frame_info)->frame - 8; \
|
||||
for (regnum = 12; regnum >= 0; regnum--, rmask <<= 1) \
|
||||
(frame_saved_regs).regs[regnum] = (rmask & 0x1000) ? (next_addr -= 4) : 0;\
|
||||
(frame_saved_regs).regs[SP_REGNUM] = (frame_info)->frame + 4; \
|
||||
(frame_saved_regs).regs[PC_REGNUM] = (frame_info)->frame - 8; \
|
||||
(frame_saved_regs).regs[FP_REGNUM] = (frame_info)->frame; \
|
||||
}
|
||||
|
||||
/* Things needed for making the inferior call functions. */
|
||||
|
||||
/* 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; \
|
||||
printf("PUSH_DUMMY_FRAME\n"); \
|
||||
sp = push_word (sp, read_register (FP_REGNUM)); \
|
||||
write_register (FP_REGNUM, sp); \
|
||||
sp = push_word (sp, 0x1fff0004); /*SAVE MASK*/ \
|
||||
sp = push_word (sp, read_register (PC_REGNUM)); \
|
||||
for (regnum = 12; regnum >= 0; regnum--) \
|
||||
sp = push_word (sp, read_register (regnum)); \
|
||||
write_register (SP_REGNUM, sp); \
|
||||
}
|
||||
|
||||
/* Discard from the stack the innermost frame, restoring all registers. */
|
||||
|
||||
#define POP_FRAME \
|
||||
{ register CORE_ADDR fp = read_register (FP_REGNUM); \
|
||||
register int regnum; \
|
||||
register int regmask = read_memory_integer (fp-4, 4); \
|
||||
printf("POP_FRAME\n"); \
|
||||
regmask >>= 16; \
|
||||
write_register (SP_REGNUM, fp+4); \
|
||||
write_register (PC_REGNUM, read_memory_integer(fp-8, 4)); \
|
||||
write_register (FP_REGNUM, read_memory_integer(fp, 4)); \
|
||||
fp -= 8; \
|
||||
for (regnum = 12; regnum >= 0; regnum--, regmask <<= 1) \
|
||||
if (regmask & 0x1000) \
|
||||
write_register (regnum, read_memory_integer (fp-=4, 4)); \
|
||||
flush_cached_frames (); \
|
||||
}
|
||||
|
||||
/* This sequence of words is the instructions
|
||||
calls #69, @#32323232
|
||||
bpt
|
||||
Note this is 8 bytes. */
|
||||
|
||||
#define CALL_DUMMY {0xbf699f32, 0x32323230}
|
||||
|
||||
/* Start execution at beginning of dummy */
|
||||
|
||||
#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, valtype, using_gcc) \
|
||||
{ int temp = (int) fun; \
|
||||
*((char *) dummyname + 1) = nargs; \
|
||||
memcpy((char *)dummyname+3,&temp,4); }
|
||||
/* OBSOLETE /* Definitions to make GDB target for a tahoe running 4.3-Reno. */
|
||||
/* OBSOLETE Copyright 1986, 1987, 1989, 1991, 1992, 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, */
|
||||
/* OBSOLETE Boston, MA 02111-1307, USA. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* */
|
||||
/* OBSOLETE * Ported by the State University of New York at Buffalo by the Distributed */
|
||||
/* OBSOLETE * Computer Systems Lab, Department of Computer Science, 1991. */
|
||||
/* OBSOLETE *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define TARGET_BYTE_ORDER BIG_ENDIAN */
|
||||
/* OBSOLETE #define BITS_BIG_ENDIAN 0 */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Offset from address of function to start of its code. */
|
||||
/* OBSOLETE Zero on most machines. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define FUNCTION_START_OFFSET 2 */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Advance PC across any function entry prologue instructions */
|
||||
/* OBSOLETE to reach some "real" code. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE extern CORE_ADDR tahoe_skip_prologue PARAMS ((CORE_ADDR)); */
|
||||
/* OBSOLETE #define SKIP_PROLOGUE(pc) (tahoe_skip_prologue (pc)) */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Immediately after a function call, return the saved pc. */
|
||||
/* OBSOLETE Can't always go through the frames for this because on some machines */
|
||||
/* OBSOLETE the new frame is not set up until the new function executes */
|
||||
/* OBSOLETE some instructions. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define SAVED_PC_AFTER_CALL(frame) FRAME_SAVED_PC(frame) */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Wrong for cross-debugging. I don't know the real values. *x/ */
|
||||
/* OBSOLETE #include <machine/param.h> */
|
||||
/* OBSOLETE #define TARGET_UPAGES UPAGES */
|
||||
/* OBSOLETE #define TARGET_NBPG NBPG */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Address of end of stack space. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define STACK_END_ADDR (0xc0000000 - (TARGET_UPAGES * TARGET_NBPG)) */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* On BSD, sigtramp is in the u area. Can't check the exact */
|
||||
/* OBSOLETE addresses because for cross-debugging we don't have target include */
|
||||
/* OBSOLETE files around. This should be close enough. *x/ */
|
||||
/* OBSOLETE #define IN_SIGTRAMP(pc, name) ((pc) >= STACK_END_ADDR && (pc < 0xc0000000)) */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Stack grows downward. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define INNER_THAN(lhs,rhs) ((lhs) < (rhs)) */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Sequence of bytes for breakpoint instruction. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define BREAKPOINT {0x30} */
|
||||
/* 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 */
|
||||
/* OBSOLETE #define DECR_PC_AFTER_BREAK 0 */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Return 1 if P points to an invalid floating point value. */
|
||||
/* OBSOLETE LEN is the length in bytes -- not relevant on the Tahoe. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* 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 */
|
||||
/* OBSOLETE real way to know how big a register is. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define REGISTER_SIZE 4 */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Number of machine registers *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define NUM_REGS 19 */
|
||||
/* 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 {"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12", "fp", "sp", "pc", "ps", "al", "ah"} */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define FP_REGNUM 13 /* Contains address of executing stack frame *x/ */
|
||||
/* OBSOLETE #define SP_REGNUM 14 /* Contains address of top of stack *x/ */
|
||||
/* OBSOLETE #define PC_REGNUM 15 /* Contains program counter *x/ */
|
||||
/* OBSOLETE #define PS_REGNUM 16 /* Contains processor status *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define AL_REGNUM 17 /* Contains accumulator *x/ */
|
||||
/* OBSOLETE #define AH_REGNUM 18 */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Total amount of space needed to store our copies of the machine's */
|
||||
/* OBSOLETE register state, the array `registers'. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define REGISTER_BYTES (19*4) */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Index within `registers' of the first byte of the space for */
|
||||
/* OBSOLETE register N. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* 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 tahoe, all regs are 4 bytes. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* 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 tahoe, all regs are 4 bytes. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define REGISTER_VIRTUAL_SIZE(N) 4 */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Largest value REGISTER_RAW_SIZE can have. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define MAX_REGISTER_RAW_SIZE 4 */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Largest value REGISTER_VIRTUAL_SIZE can have. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* 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 */
|
||||
/* 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. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define STORE_STRUCT_RETURN(ADDR, SP) \ */
|
||||
/* OBSOLETE { write_register (1, (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, 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 */
|
||||
/* 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) (*(int *)(REGBUF)) */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Describe the pointer in each stack frame to the previous stack frame */
|
||||
/* OBSOLETE (its caller). */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE FRAME_CHAIN takes a frame's nominal address */
|
||||
/* OBSOLETE and produces the frame's chain-pointer. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* In the case of the Tahoe, the frame's nominal address is the FP value, */
|
||||
/* OBSOLETE and it points to the old FP *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define FRAME_CHAIN(thisframe) \ */
|
||||
/* OBSOLETE (!inside_entry_file ((thisframe)->pc) ? \ */
|
||||
/* OBSOLETE read_memory_integer ((thisframe)->frame, 4) :\ */
|
||||
/* OBSOLETE 0) */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Define other aspects of the stack frame. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Saved PC *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define FRAME_SAVED_PC(FRAME) (read_memory_integer ((FRAME)->frame - 8, 4)) */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* In most of GDB, getting the args address is too important to */
|
||||
/* OBSOLETE just say "I don't know". *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define FRAME_ARGS_ADDRESS(fi) ((fi)->frame) */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Address to use as an anchor for finding local variables *x/ */
|
||||
/* 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 tahoe_frame_num_args PARAMS ((struct frame_info * fi)); */
|
||||
/* OBSOLETE #define FRAME_NUM_ARGS(fi) (tahoe_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 #define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \ */
|
||||
/* OBSOLETE { register int regnum; \ */
|
||||
/* OBSOLETE register int rmask = read_memory_integer ((frame_info)->frame-4, 4) >> 16;\ */
|
||||
/* OBSOLETE register CORE_ADDR next_addr; \ */
|
||||
/* OBSOLETE memset (&frame_saved_regs, '\0', sizeof frame_saved_regs); \ */
|
||||
/* OBSOLETE next_addr = (frame_info)->frame - 8; \ */
|
||||
/* OBSOLETE for (regnum = 12; regnum >= 0; regnum--, rmask <<= 1) \ */
|
||||
/* OBSOLETE (frame_saved_regs).regs[regnum] = (rmask & 0x1000) ? (next_addr -= 4) : 0;\ */
|
||||
/* OBSOLETE (frame_saved_regs).regs[SP_REGNUM] = (frame_info)->frame + 4; \ */
|
||||
/* OBSOLETE (frame_saved_regs).regs[PC_REGNUM] = (frame_info)->frame - 8; \ */
|
||||
/* OBSOLETE (frame_saved_regs).regs[FP_REGNUM] = (frame_info)->frame; \ */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Things needed for making the inferior call functions. *x/ */
|
||||
/* 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 printf("PUSH_DUMMY_FRAME\n"); \ */
|
||||
/* OBSOLETE sp = push_word (sp, read_register (FP_REGNUM)); \ */
|
||||
/* OBSOLETE write_register (FP_REGNUM, sp); \ */
|
||||
/* OBSOLETE sp = push_word (sp, 0x1fff0004); /*SAVE MASK*x/ \ */
|
||||
/* OBSOLETE sp = push_word (sp, read_register (PC_REGNUM)); \ */
|
||||
/* OBSOLETE for (regnum = 12; regnum >= 0; regnum--) \ */
|
||||
/* OBSOLETE sp = push_word (sp, read_register (regnum)); \ */
|
||||
/* OBSOLETE write_register (SP_REGNUM, sp); \ */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Discard from the stack the innermost frame, restoring all registers. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define POP_FRAME \ */
|
||||
/* OBSOLETE { register CORE_ADDR fp = read_register (FP_REGNUM); \ */
|
||||
/* OBSOLETE register int regnum; \ */
|
||||
/* OBSOLETE register int regmask = read_memory_integer (fp-4, 4); \ */
|
||||
/* OBSOLETE printf("POP_FRAME\n"); \ */
|
||||
/* OBSOLETE regmask >>= 16; \ */
|
||||
/* OBSOLETE write_register (SP_REGNUM, fp+4); \ */
|
||||
/* OBSOLETE write_register (PC_REGNUM, read_memory_integer(fp-8, 4)); \ */
|
||||
/* OBSOLETE write_register (FP_REGNUM, read_memory_integer(fp, 4)); \ */
|
||||
/* OBSOLETE fp -= 8; \ */
|
||||
/* OBSOLETE for (regnum = 12; regnum >= 0; regnum--, regmask <<= 1) \ */
|
||||
/* OBSOLETE if (regmask & 0x1000) \ */
|
||||
/* OBSOLETE write_register (regnum, read_memory_integer (fp-=4, 4)); \ */
|
||||
/* OBSOLETE flush_cached_frames (); \ */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* This sequence of words is the instructions */
|
||||
/* OBSOLETE calls #69, @#32323232 */
|
||||
/* OBSOLETE bpt */
|
||||
/* OBSOLETE Note this is 8 bytes. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define CALL_DUMMY {0xbf699f32, 0x32323230} */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Start execution at beginning of dummy *x/ */
|
||||
/* 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, valtype, using_gcc) \ */
|
||||
/* OBSOLETE { int temp = (int) fun; \ */
|
||||
/* OBSOLETE *((char *) dummyname + 1) = nargs; \ */
|
||||
/* OBSOLETE memcpy((char *)dummyname+3,&temp,4); } */
|
||||
|
|
|
@ -1,137 +1,137 @@
|
|||
/* Definitions to make GDB hosted on a tahoe running 4.3-Reno
|
||||
Copyright 1986, 1987, 1989, 1991, 1992 Free Software Foundation, Inc.
|
||||
Contributed by the State University of New York at Buffalo, by the
|
||||
Distributed Computer Systems Lab, Department of Computer Science, 1991.
|
||||
|
||||
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. */
|
||||
|
||||
/* Make sure the system include files define BIG_ENDIAN, UINT_MAX, const,
|
||||
etc, rather than GDB's files. */
|
||||
#include <stdio.h>
|
||||
#include <sys/param.h>
|
||||
|
||||
/* Host is big-endian */
|
||||
|
||||
#define HOST_BYTE_ORDER BIG_ENDIAN
|
||||
|
||||
/* This is the amount to subtract from u.u_ar0
|
||||
to get the offset in the core file of the register values. */
|
||||
|
||||
#define KERNEL_U_ADDR (0xc0000000 - (TARGET_UPAGES * TARGET_NBPG))
|
||||
|
||||
#define REGISTER_U_ADDR(addr, blockend, regno) \
|
||||
{ addr = blockend - 100 + regno * 4; \
|
||||
if (regno == PC_REGNUM) addr = blockend - 8; \
|
||||
if (regno == PS_REGNUM) addr = blockend - 4; \
|
||||
if (regno == FP_REGNUM) addr = blockend - 40; \
|
||||
if (regno == SP_REGNUM) addr = blockend - 36; \
|
||||
if (regno == AL_REGNUM) addr = blockend - 20; \
|
||||
if (regno == AH_REGNUM) addr = blockend - 24;}
|
||||
|
||||
/* Interface definitions for kernel debugger KDB. */
|
||||
|
||||
/* Map machine fault codes into signal numbers.
|
||||
First subtract 0, divide by 4, then index in a table.
|
||||
Faults for which the entry in this table is 0
|
||||
are not handled by KDB; the program's own trap handler
|
||||
gets to handle then. */
|
||||
|
||||
#define FAULT_CODE_ORIGIN 0
|
||||
#define FAULT_CODE_UNITS 4
|
||||
#define FAULT_TABLE \
|
||||
{ 0, SIGKILL, SIGSEGV, 0, 0, 0, 0, 0, \
|
||||
0, 0, SIGTRAP, SIGTRAP, 0, 0, 0, 0, \
|
||||
0, 0, 0, 0, 0, 0, 0, 0}
|
||||
|
||||
/* Start running with a stack stretching from BEG to END.
|
||||
BEG and END should be symbols meaningful to the assembler.
|
||||
This is used only for kdb. */
|
||||
|
||||
#define INIT_STACK(beg, end) \
|
||||
{ asm (".globl end"); \
|
||||
asm ("movl $ end, sp"); \
|
||||
asm ("clrl fp"); }
|
||||
|
||||
/* Push the frame pointer register on the stack. */
|
||||
|
||||
#define PUSH_FRAME_PTR \
|
||||
asm ("pushl fp");
|
||||
|
||||
/* Copy the top-of-stack to the frame pointer register. */
|
||||
|
||||
#define POP_FRAME_PTR \
|
||||
asm ("movl (sp), fp");
|
||||
|
||||
/* After KDB is entered by a fault, push all registers
|
||||
that GDB thinks about (all NUM_REGS of them),
|
||||
so that they appear in order of ascending GDB register number.
|
||||
The fault code will be on the stack beyond the last register. */
|
||||
|
||||
#define PUSH_REGISTERS \
|
||||
{ asm ("pushl 8(sp)"); \
|
||||
asm ("pushl 8(sp)"); \
|
||||
asm ("pushal 0x41(sp)"); \
|
||||
asm ("pushl r0" ); \
|
||||
asm ("pushl r1" ); \
|
||||
asm ("pushl r2" ); \
|
||||
asm ("pushl r3" ); \
|
||||
asm ("pushl r4" ); \
|
||||
asm ("pushl r5" ); \
|
||||
asm ("pushl r6" ); \
|
||||
asm ("pushl r7" ); \
|
||||
asm ("pushl r8" ); \
|
||||
asm ("pushl r9" ); \
|
||||
asm ("pushl r10" ); \
|
||||
asm ("pushl r11" ); \
|
||||
asm ("pushl r12" ); \
|
||||
asm ("pushl fp" ); \
|
||||
asm ("pushl sp" ); \
|
||||
asm ("pushl pc" ); \
|
||||
asm ("pushl ps" ); \
|
||||
asm ("pushl aclo" ); \
|
||||
asm ("pushl achi" ); \
|
||||
}
|
||||
|
||||
/* Assuming the registers (including processor status) have been
|
||||
pushed on the stack in order of ascending GDB register number,
|
||||
restore them and return to the address in the saved PC register. */
|
||||
|
||||
#define POP_REGISTERS \
|
||||
{ \
|
||||
asm ("movl (sp)+, achi"); \
|
||||
asm ("movl (sp)+, aclo"); \
|
||||
asm ("movl (sp)+, ps"); \
|
||||
asm ("movl (sp)+, pc"); \
|
||||
asm ("movl (sp)+, sp"); \
|
||||
asm ("movl (sp)+, fp"); \
|
||||
asm ("movl (sp)+, r12"); \
|
||||
asm ("movl (sp)+, r11"); \
|
||||
asm ("movl (sp)+, r10"); \
|
||||
asm ("movl (sp)+, r9"); \
|
||||
asm ("movl (sp)+, r8"); \
|
||||
asm ("movl (sp)+, r7"); \
|
||||
asm ("movl (sp)+, r6"); \
|
||||
asm ("movl (sp)+, r5"); \
|
||||
asm ("movl (sp)+, r4"); \
|
||||
asm ("movl (sp)+, r3"); \
|
||||
asm ("movl (sp)+, r2"); \
|
||||
asm ("movl (sp)+, r1"); \
|
||||
asm ("movl (sp)+, r0"); \
|
||||
asm ("subl2 $8,(sp)"); \
|
||||
asm ("movl (sp),sp"); \
|
||||
asm ("rei"); }
|
||||
/* OBSOLETE /* Definitions to make GDB hosted on a tahoe running 4.3-Reno */
|
||||
/* OBSOLETE Copyright 1986, 1987, 1989, 1991, 1992 Free Software Foundation, Inc. */
|
||||
/* OBSOLETE Contributed by the State University of New York at Buffalo, by the */
|
||||
/* OBSOLETE Distributed Computer Systems Lab, Department of Computer Science, 1991. */
|
||||
/* 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, */
|
||||
/* OBSOLETE Boston, MA 02111-1307, USA. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Make sure the system include files define BIG_ENDIAN, UINT_MAX, const, */
|
||||
/* OBSOLETE etc, rather than GDB's files. *x/ */
|
||||
/* OBSOLETE #include <stdio.h> */
|
||||
/* OBSOLETE #include <sys/param.h> */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Host is big-endian *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define HOST_BYTE_ORDER BIG_ENDIAN */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* This is the amount to subtract from u.u_ar0 */
|
||||
/* OBSOLETE to get the offset in the core file of the register values. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define KERNEL_U_ADDR (0xc0000000 - (TARGET_UPAGES * TARGET_NBPG)) */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define REGISTER_U_ADDR(addr, blockend, regno) \ */
|
||||
/* OBSOLETE { addr = blockend - 100 + regno * 4; \ */
|
||||
/* OBSOLETE if (regno == PC_REGNUM) addr = blockend - 8; \ */
|
||||
/* OBSOLETE if (regno == PS_REGNUM) addr = blockend - 4; \ */
|
||||
/* OBSOLETE if (regno == FP_REGNUM) addr = blockend - 40; \ */
|
||||
/* OBSOLETE if (regno == SP_REGNUM) addr = blockend - 36; \ */
|
||||
/* OBSOLETE if (regno == AL_REGNUM) addr = blockend - 20; \ */
|
||||
/* OBSOLETE if (regno == AH_REGNUM) addr = blockend - 24;} */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Interface definitions for kernel debugger KDB. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Map machine fault codes into signal numbers. */
|
||||
/* OBSOLETE First subtract 0, divide by 4, then index in a table. */
|
||||
/* OBSOLETE Faults for which the entry in this table is 0 */
|
||||
/* OBSOLETE are not handled by KDB; the program's own trap handler */
|
||||
/* OBSOLETE gets to handle then. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define FAULT_CODE_ORIGIN 0 */
|
||||
/* OBSOLETE #define FAULT_CODE_UNITS 4 */
|
||||
/* OBSOLETE #define FAULT_TABLE \ */
|
||||
/* OBSOLETE { 0, SIGKILL, SIGSEGV, 0, 0, 0, 0, 0, \ */
|
||||
/* OBSOLETE 0, 0, SIGTRAP, SIGTRAP, 0, 0, 0, 0, \ */
|
||||
/* OBSOLETE 0, 0, 0, 0, 0, 0, 0, 0} */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Start running with a stack stretching from BEG to END. */
|
||||
/* OBSOLETE BEG and END should be symbols meaningful to the assembler. */
|
||||
/* OBSOLETE This is used only for kdb. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define INIT_STACK(beg, end) \ */
|
||||
/* OBSOLETE { asm (".globl end"); \ */
|
||||
/* OBSOLETE asm ("movl $ end, sp"); \ */
|
||||
/* OBSOLETE asm ("clrl fp"); } */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Push the frame pointer register on the stack. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define PUSH_FRAME_PTR \ */
|
||||
/* OBSOLETE asm ("pushl fp"); */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Copy the top-of-stack to the frame pointer register. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define POP_FRAME_PTR \ */
|
||||
/* OBSOLETE asm ("movl (sp), fp"); */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* After KDB is entered by a fault, push all registers */
|
||||
/* OBSOLETE that GDB thinks about (all NUM_REGS of them), */
|
||||
/* OBSOLETE so that they appear in order of ascending GDB register number. */
|
||||
/* OBSOLETE The fault code will be on the stack beyond the last register. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define PUSH_REGISTERS \ */
|
||||
/* OBSOLETE { asm ("pushl 8(sp)"); \ */
|
||||
/* OBSOLETE asm ("pushl 8(sp)"); \ */
|
||||
/* OBSOLETE asm ("pushal 0x41(sp)"); \ */
|
||||
/* OBSOLETE asm ("pushl r0" ); \ */
|
||||
/* OBSOLETE asm ("pushl r1" ); \ */
|
||||
/* OBSOLETE asm ("pushl r2" ); \ */
|
||||
/* OBSOLETE asm ("pushl r3" ); \ */
|
||||
/* OBSOLETE asm ("pushl r4" ); \ */
|
||||
/* OBSOLETE asm ("pushl r5" ); \ */
|
||||
/* OBSOLETE asm ("pushl r6" ); \ */
|
||||
/* OBSOLETE asm ("pushl r7" ); \ */
|
||||
/* OBSOLETE asm ("pushl r8" ); \ */
|
||||
/* OBSOLETE asm ("pushl r9" ); \ */
|
||||
/* OBSOLETE asm ("pushl r10" ); \ */
|
||||
/* OBSOLETE asm ("pushl r11" ); \ */
|
||||
/* OBSOLETE asm ("pushl r12" ); \ */
|
||||
/* OBSOLETE asm ("pushl fp" ); \ */
|
||||
/* OBSOLETE asm ("pushl sp" ); \ */
|
||||
/* OBSOLETE asm ("pushl pc" ); \ */
|
||||
/* OBSOLETE asm ("pushl ps" ); \ */
|
||||
/* OBSOLETE asm ("pushl aclo" ); \ */
|
||||
/* OBSOLETE asm ("pushl achi" ); \ */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Assuming the registers (including processor status) have been */
|
||||
/* OBSOLETE pushed on the stack in order of ascending GDB register number, */
|
||||
/* OBSOLETE restore them and return to the address in the saved PC register. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #define POP_REGISTERS \ */
|
||||
/* OBSOLETE { \ */
|
||||
/* OBSOLETE asm ("movl (sp)+, achi"); \ */
|
||||
/* OBSOLETE asm ("movl (sp)+, aclo"); \ */
|
||||
/* OBSOLETE asm ("movl (sp)+, ps"); \ */
|
||||
/* OBSOLETE asm ("movl (sp)+, pc"); \ */
|
||||
/* OBSOLETE asm ("movl (sp)+, sp"); \ */
|
||||
/* OBSOLETE asm ("movl (sp)+, fp"); \ */
|
||||
/* OBSOLETE asm ("movl (sp)+, r12"); \ */
|
||||
/* OBSOLETE asm ("movl (sp)+, r11"); \ */
|
||||
/* OBSOLETE asm ("movl (sp)+, r10"); \ */
|
||||
/* OBSOLETE asm ("movl (sp)+, r9"); \ */
|
||||
/* OBSOLETE asm ("movl (sp)+, r8"); \ */
|
||||
/* OBSOLETE asm ("movl (sp)+, r7"); \ */
|
||||
/* OBSOLETE asm ("movl (sp)+, r6"); \ */
|
||||
/* OBSOLETE asm ("movl (sp)+, r5"); \ */
|
||||
/* OBSOLETE asm ("movl (sp)+, r4"); \ */
|
||||
/* OBSOLETE asm ("movl (sp)+, r3"); \ */
|
||||
/* OBSOLETE asm ("movl (sp)+, r2"); \ */
|
||||
/* OBSOLETE asm ("movl (sp)+, r1"); \ */
|
||||
/* OBSOLETE asm ("movl (sp)+, r0"); \ */
|
||||
/* OBSOLETE asm ("subl2 $8,(sp)"); \ */
|
||||
/* OBSOLETE asm ("movl (sp),sp"); \ */
|
||||
/* OBSOLETE asm ("rei"); } */
|
||||
|
|
|
@ -22,13 +22,12 @@
|
|||
#ifndef TM_TIC80_H
|
||||
#define TM_TIC80_H
|
||||
|
||||
#ifdef __STDC__ /* Forward declare structs used in prototypes */
|
||||
/* Forward declare structs used in prototypes */
|
||||
struct frame_info;
|
||||
struct type;
|
||||
struct value;
|
||||
struct symbol;
|
||||
struct frame_saved_regs;
|
||||
#endif
|
||||
|
||||
#define TARGET_BYTE_ORDER LITTLE_ENDIAN
|
||||
|
||||
|
|
|
@ -92,12 +92,10 @@ extern char **v850_register_names;
|
|||
|
||||
#define SAVED_PC_AFTER_CALL(fi) read_register (RP_REGNUM)
|
||||
|
||||
#ifdef __STDC__
|
||||
struct frame_info;
|
||||
struct frame_saved_regs;
|
||||
struct type;
|
||||
struct value;
|
||||
#endif
|
||||
|
||||
#define EXTRA_FRAME_INFO struct frame_saved_regs fsr;
|
||||
|
||||
|
|
|
@ -198,9 +198,7 @@ extern CORE_ADDR mz8k_skip_prologue PARAMS ((CORE_ADDR ip));
|
|||
|
||||
#define FRAME_ARGS_SKIP 8
|
||||
|
||||
#ifdef __STDC__
|
||||
struct frame_info;
|
||||
#endif
|
||||
extern void z8k_frame_init_saved_regs PARAMS ((struct frame_info *));
|
||||
#define FRAME_INIT_SAVED_REGS(fi) z8k_frame_init_saved_regs (fi)
|
||||
|
||||
|
|
308
gdb/configure
vendored
308
gdb/configure
vendored
File diff suppressed because it is too large
Load diff
|
@ -155,7 +155,7 @@ sparc64-*-*) gdb_host=sun4sol2 ;;
|
|||
|
||||
strongarm-*-*) gdb_host=arm ;;
|
||||
|
||||
tahoe-*-*) gdb_host=tahoe ;;
|
||||
# OBSOLETE tahoe-*-*) gdb_host=tahoe ;;
|
||||
|
||||
vax-*-bsd*) gdb_host=vaxbsd ;;
|
||||
vax-*-ultrix2*) gdb_host=vaxult2 ;;
|
||||
|
|
|
@ -83,7 +83,8 @@ AC_CHECK_HEADERS(ctype.h curses.h endian.h link.h \
|
|||
memory.h objlist.h ptrace.h sgtty.h stddef.h stdlib.h \
|
||||
string.h sys/procfs.h sys/ptrace.h sys/reg.h \
|
||||
term.h termio.h termios.h unistd.h wait.h sys/wait.h \
|
||||
wchar.h wctype.h asm/debugreg.h sys/debugreg.h sys/select.h)
|
||||
wchar.h wctype.h asm/debugreg.h sys/debugreg.h sys/select.h \
|
||||
time.h)
|
||||
AC_HEADER_STAT
|
||||
|
||||
AC_C_CONST
|
||||
|
@ -400,13 +401,21 @@ case "${enableval}" in
|
|||
*) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
|
||||
esac],[build_warnings=""])dnl
|
||||
|
||||
WARN_CFLAGS=""
|
||||
WERROR_CFLAGS=""
|
||||
if test "x${build_warnings}" != x -a "x$GCC" = xyes
|
||||
then
|
||||
WARN_CFLAGS="${build_warnings}"
|
||||
else
|
||||
WARN_CFLAGS=""
|
||||
# Separate out the -Werror flag as some files just cannot be
|
||||
# compiled with it enabled.
|
||||
for w in ${build_warnings}; do
|
||||
case $w in
|
||||
-Werr*) WERROR_CFLAGS=-Werror ;;
|
||||
*) WARN_CFLAGS="${WARN_CFLAGS} $w"
|
||||
esac
|
||||
done
|
||||
fi
|
||||
AC_SUBST(WARN_CFLAGS)
|
||||
AC_SUBST(WERROR_CFLAGS)
|
||||
|
||||
MMALLOC_CFLAGS=
|
||||
MMALLOC=
|
||||
|
|
|
@ -262,7 +262,7 @@ sparc86x-*-*) gdb_target=sparclite ;;
|
|||
#sparc64-*-solaris2*) gdb_target=sp64sol2 ;;
|
||||
sparc64-*-*) gdb_target=sp64 ;;
|
||||
|
||||
tahoe-*-*) gdb_target=tahoe ;;
|
||||
# OBSOLETE tahoe-*-*) gdb_target=tahoe ;;
|
||||
|
||||
tic80-*-*) gdb_target=tic80
|
||||
configdirs="${configdirs} gdbserver" ;;
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
#include <errno.h>
|
||||
#include <signal.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include "frame.h" /* required by inferior.h */
|
||||
#include "inferior.h"
|
||||
#include "symtab.h"
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include "dis-asm.h"
|
||||
#include "symfile.h"
|
||||
#include "objfiles.h"
|
||||
#include "language.h"
|
||||
|
||||
struct frame_extra_info
|
||||
{
|
||||
|
|
116
gdb/defs.h
116
gdb/defs.h
|
@ -34,6 +34,10 @@
|
|||
# include <sys/types.h> /* for size_t */
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
/* Just in case they're not defined in stdio.h. */
|
||||
|
||||
#ifndef SEEK_SET
|
||||
|
@ -72,6 +76,36 @@ extern char *strsignal PARAMS ((int));
|
|||
|
||||
typedef bfd_vma CORE_ADDR;
|
||||
|
||||
/* This is to make sure that LONGEST is at least as big as CORE_ADDR. */
|
||||
|
||||
#ifndef LONGEST
|
||||
|
||||
#ifdef BFD64
|
||||
|
||||
#define LONGEST BFD_HOST_64_BIT
|
||||
#define ULONGEST BFD_HOST_U_64_BIT
|
||||
|
||||
#else /* No BFD64 */
|
||||
|
||||
# ifdef CC_HAS_LONG_LONG
|
||||
# define LONGEST long long
|
||||
# define ULONGEST unsigned long long
|
||||
# else
|
||||
/* BFD_HOST_64_BIT is defined for some hosts that don't have long long
|
||||
(e.g. i386-windows) so try it. */
|
||||
# ifdef BFD_HOST_64_BIT
|
||||
# define LONGEST BFD_HOST_64_BIT
|
||||
# define ULONGEST BFD_HOST_U_64_BIT
|
||||
# else
|
||||
# define LONGEST long
|
||||
# define ULONGEST unsigned long
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#endif /* No BFD64 */
|
||||
|
||||
#endif /* ! LONGEST */
|
||||
|
||||
extern int core_addr_lessthan PARAMS ((CORE_ADDR lhs, CORE_ADDR rhs));
|
||||
extern int core_addr_greaterthan PARAMS ((CORE_ADDR lhs, CORE_ADDR rhs));
|
||||
|
||||
|
@ -231,10 +265,8 @@ struct cleanup
|
|||
|
||||
/* Needed for various prototypes */
|
||||
|
||||
#ifdef __STDC__
|
||||
struct symtab;
|
||||
struct breakpoint;
|
||||
#endif
|
||||
|
||||
/* From blockframe.c */
|
||||
|
||||
|
@ -340,23 +372,6 @@ extern void wrap_here PARAMS ((char *));
|
|||
|
||||
extern void reinitialize_more_filter PARAMS ((void));
|
||||
|
||||
/* new */
|
||||
enum streamtype
|
||||
{
|
||||
afile,
|
||||
astring
|
||||
};
|
||||
|
||||
/* new */
|
||||
struct tui_stream
|
||||
{
|
||||
int *ts_magic;
|
||||
enum streamtype ts_streamtype;
|
||||
FILE *ts_filestream;
|
||||
char *ts_strbuf;
|
||||
int ts_buflen;
|
||||
};
|
||||
|
||||
struct gdb_file;
|
||||
typedef struct gdb_file GDB_FILE; /* deprecated */
|
||||
|
||||
|
@ -504,15 +519,18 @@ extern void fputstrn_unfiltered PARAMS ((const char *str, int n, int quotr, GDB_
|
|||
|
||||
extern void gdb_print_address PARAMS ((void *, GDB_FILE *));
|
||||
|
||||
typedef bfd_vma t_addr;
|
||||
/* Convert a CORE_ADDR into a HEX string. paddr() is like %08lx.
|
||||
paddr_nz() is like %lx. paddr_u() is like %lu. paddr_width() is
|
||||
for ``%*''. */
|
||||
extern int strlen_paddr ();
|
||||
extern char* paddr (CORE_ADDR addr);
|
||||
extern char* paddr_nz (CORE_ADDR addr);
|
||||
extern char* paddr_u (CORE_ADDR addr);
|
||||
extern char* paddr_d (LONGEST addr);
|
||||
|
||||
typedef bfd_vma t_reg;
|
||||
extern char* paddr PARAMS ((t_addr addr));
|
||||
|
||||
extern char* preg PARAMS ((t_reg reg));
|
||||
|
||||
extern char* paddr_nz PARAMS ((t_addr addr));
|
||||
|
||||
extern char* preg_nz PARAMS ((t_reg reg));
|
||||
extern char* preg (t_reg reg);
|
||||
extern char* preg_nz (t_reg reg);
|
||||
|
||||
extern void fprintf_symbol_filtered PARAMS ((GDB_FILE *, char *,
|
||||
enum language, int));
|
||||
|
@ -570,6 +588,12 @@ extern void init_source_path PARAMS ((void));
|
|||
|
||||
extern char *symtab_to_filename PARAMS ((struct symtab *));
|
||||
|
||||
/* From exec.c */
|
||||
|
||||
extern void exec_set_section_offsets (bfd_signed_vma text_off,
|
||||
bfd_signed_vma data_off,
|
||||
bfd_signed_vma bss_off);
|
||||
|
||||
/* From findvar.c */
|
||||
|
||||
extern int read_relative_register_raw_bytes PARAMS ((int, char *));
|
||||
|
@ -763,36 +787,6 @@ enum val_prettyprint
|
|||
#define LONG_MAX ((long)(ULONG_MAX >> 1)) /* 0x7FFFFFFF for 32-bits */
|
||||
#endif
|
||||
|
||||
#ifndef LONGEST
|
||||
|
||||
#ifdef BFD64
|
||||
|
||||
/* This is to make sure that LONGEST is at least as big as CORE_ADDR. */
|
||||
|
||||
#define LONGEST BFD_HOST_64_BIT
|
||||
#define ULONGEST BFD_HOST_U_64_BIT
|
||||
|
||||
#else /* No BFD64 */
|
||||
|
||||
# ifdef CC_HAS_LONG_LONG
|
||||
# define LONGEST long long
|
||||
# define ULONGEST unsigned long long
|
||||
# else
|
||||
/* BFD_HOST_64_BIT is defined for some hosts that don't have long long
|
||||
(e.g. i386-windows) so try it. */
|
||||
# ifdef BFD_HOST_64_BIT
|
||||
# define LONGEST BFD_HOST_64_BIT
|
||||
# define ULONGEST BFD_HOST_U_64_BIT
|
||||
# else
|
||||
# define LONGEST long
|
||||
# define ULONGEST unsigned long
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#endif /* No BFD64 */
|
||||
|
||||
#endif /* ! LONGEST */
|
||||
|
||||
/* Convert a LONGEST to an int. This is used in contexts (e.g. number of
|
||||
arguments to a function, number in a value history, register number, etc.)
|
||||
where the value must not be larger than can fit in an int. */
|
||||
|
@ -1145,10 +1139,8 @@ extern CORE_ADDR push_word PARAMS ((CORE_ADDR, ULONGEST));
|
|||
extern int watchdog;
|
||||
|
||||
/* Hooks for alternate command interfaces. */
|
||||
#ifdef __STDC__
|
||||
struct target_waitstatus;
|
||||
struct cmd_list_element;
|
||||
#endif
|
||||
|
||||
/* Should the asynchronous variant of the interpreter (using the
|
||||
event-loop) be enabled? */
|
||||
|
@ -1257,4 +1249,10 @@ extern int use_windows;
|
|||
#define STDERR_FILENO 2
|
||||
#endif
|
||||
|
||||
/* If this definition isn't overridden by the header files, assume
|
||||
that isatty and fileno exist on this system. */
|
||||
#ifndef ISATTY
|
||||
#define ISATTY(FP) (isatty (fileno (FP)))
|
||||
#endif
|
||||
|
||||
#endif /* #ifndef DEFS_H */
|
||||
|
|
|
@ -1,3 +1,22 @@
|
|||
1999-08-30 Stan Shebs <shebs@andros.cygnus.com>
|
||||
|
||||
* gdb.texinfo: Create a new "Configurations" chapter with
|
||||
platform-specific info, inline remote.texi and move sections of it
|
||||
into the new chapter, move bits about info proc, heuristic search,
|
||||
and register stack into the new chapter.
|
||||
* remote.texi: Remove, now part of gdb.texinfo.
|
||||
* Makefile.in (SFILES_INCLUDED): Remove ref to remote.texi.
|
||||
|
||||
1999-08-27 Jason Molenda (jsm@bugshack.cygnus.com)
|
||||
|
||||
* gdbint.texinfo (GDB_TARGET_IS_SUN3, GDB_TARGET_IS_SUN386,
|
||||
GDB_TARGET_IS_MACH386): These kludges have gone away.
|
||||
|
||||
Wed Aug 25 10:47:03 1999 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
|
||||
* gdbint.texinfo (Target Architecture Definition): Mention
|
||||
TDEPLIBS.
|
||||
|
||||
1999-08-20 Stan Shebs <shebs@andros.cygnus.com>
|
||||
|
||||
* gdb.texinfo: Remove remaining "HPPA" conditionals, rewrite
|
||||
|
|
|
@ -83,7 +83,7 @@ TEXINDEX = texindex
|
|||
DVIPS = dvips
|
||||
|
||||
# Main GDB manual's source files
|
||||
SFILES_INCLUDED = gdb-cfg.texi $(srcdir)/remote.texi
|
||||
SFILES_INCLUDED = gdb-cfg.texi
|
||||
|
||||
SFILES_LOCAL = $(srcdir)/gdb.texinfo GDBvn.texi $(SFILES_INCLUDED)
|
||||
|
||||
|
|
2976
gdb/doc/gdb.texinfo
2976
gdb/doc/gdb.texinfo
File diff suppressed because it is too large
Load diff
|
@ -1418,11 +1418,6 @@ partial-stab.h is used to mangle multiple-symbol-table files from
|
|||
HPPA's. This should all be ripped out, and a scheme like elfread.c
|
||||
used.
|
||||
|
||||
@item GDB_TARGET_IS_MACH386
|
||||
@item GDB_TARGET_IS_SUN3
|
||||
@item GDB_TARGET_IS_SUN386
|
||||
Kludges that should go away.
|
||||
|
||||
@item GET_LONGJMP_TARGET
|
||||
For most machines, this is a target-dependent parameter. On the
|
||||
DECstation and the Iris, this is a native-dependent parameter, since
|
||||
|
@ -1749,10 +1744,13 @@ The following files define a target to GDB:
|
|||
@item gdb/config/@var{arch}/@var{ttt}.mt
|
||||
Contains a Makefile fragment specific to this target. Specifies what
|
||||
object files are needed for target @var{ttt}, by defining
|
||||
@samp{TDEPFILES=@dots{}}. Also specifies the header file which
|
||||
describes @var{ttt}, by defining @samp{TM_FILE= tm-@var{ttt}.h}. You
|
||||
can also define @samp{TM_CFLAGS}, @samp{TM_CLIBS}, @samp{TM_CDEPS}, but
|
||||
these are now deprecated and may go away in future versions of GDB.
|
||||
@samp{TDEPFILES=@dots{}} and @samp{TDEPLIBS=@dots{}}. Also specifies
|
||||
the header file which describes @var{ttt}, by defining @samp{TM_FILE=
|
||||
tm-@var{ttt}.h}.
|
||||
|
||||
You can also define @samp{TM_CFLAGS}, @samp{TM_CLIBS}, @samp{TM_CDEPS},
|
||||
but these are now deprecated, replaced by autoconf, and may go away in
|
||||
future versions of GDB.
|
||||
|
||||
@item gdb/config/@var{arch}/tm-@var{ttt}.h
|
||||
(@file{tm.h} is a link to this file, created by configure). Contains
|
||||
|
|
|
@ -228,7 +228,7 @@ extern void start_event_loop PARAMS ((void));
|
|||
extern void delete_file_handler PARAMS ((int));
|
||||
extern void add_file_handler PARAMS ((int, void (*) (void), gdb_client_data));
|
||||
extern void mark_async_signal_handler PARAMS ((async_signal_handler *));
|
||||
extern async_signal_handler *
|
||||
extern async_signal_handler *
|
||||
create_async_signal_handler PARAMS ((handler_func *, gdb_client_data));
|
||||
extern void delete_async_signal_handler PARAMS ((async_signal_handler ** async_handler_ptr));
|
||||
|
||||
|
@ -246,13 +246,16 @@ extern void pop_prompt PARAMS ((void));
|
|||
extern void push_prompt PARAMS ((char *, char *, char *));
|
||||
extern void gdb_readline2 PARAMS ((void));
|
||||
|
||||
/* Exported variables from event-top.c.
|
||||
/* Exported variables and functions from event-top.c.
|
||||
FIXME: these should really go into top.h. */
|
||||
|
||||
extern int async_command_editing_p;
|
||||
extern int exec_done_display_p;
|
||||
extern char *async_annotation_suffix;
|
||||
extern char *new_async_prompt;
|
||||
extern struct prompts the_prompts;
|
||||
extern void (*call_readline) PARAMS ((void));
|
||||
extern void (*input_handler) PARAMS ((char *));
|
||||
extern int input_fd;
|
||||
void mark_async_signal_handler_wrapper (void *);
|
||||
void async_request_quit (gdb_client_data);
|
||||
|
|
|
@ -26,6 +26,9 @@
|
|||
#include <signal.h>
|
||||
#include "event-loop.h"
|
||||
|
||||
/* For dont_repeat() */
|
||||
#include "gdbcmd.h"
|
||||
|
||||
/* readline include files */
|
||||
#include <readline/readline.h>
|
||||
#include <readline/history.h>
|
||||
|
@ -60,18 +63,11 @@ void handle_stop_sig PARAMS ((int));
|
|||
|
||||
/* Functions to be invoked by the event loop in response to
|
||||
signals. */
|
||||
void async_request_quit PARAMS ((gdb_client_data));
|
||||
static void async_do_nothing PARAMS ((gdb_client_data));
|
||||
static void async_disconnect PARAMS ((gdb_client_data));
|
||||
static void async_float_handler PARAMS ((gdb_client_data));
|
||||
static void async_stop_sig PARAMS ((gdb_client_data));
|
||||
|
||||
/* If this definition isn't overridden by the header files, assume
|
||||
that isatty and fileno exist on this system. */
|
||||
#ifndef ISATTY
|
||||
#define ISATTY(FP) (isatty (fileno (FP)))
|
||||
#endif
|
||||
|
||||
/* Readline offers an alternate interface, via callback
|
||||
functions. These are all included in the file callback.c in the
|
||||
readline distribution. This file provides (mainly) a function, which
|
||||
|
@ -113,6 +109,10 @@ char *new_async_prompt;
|
|||
annotation_level is 2. */
|
||||
char *async_annotation_suffix;
|
||||
|
||||
/* This is used to display the notification of the completion of an
|
||||
asynchronous execution command. */
|
||||
int exec_done_display_p = 0;
|
||||
|
||||
/* This is the file descriptor for the input stream that GDB uses to
|
||||
read commands from. */
|
||||
int input_fd;
|
||||
|
@ -141,8 +141,6 @@ PTR sigwinch_token;
|
|||
PTR sigtstp_token;
|
||||
#endif
|
||||
|
||||
void mark_async_signal_handler_wrapper PARAMS ((void *));
|
||||
|
||||
/* Structure to save a partially entered command. This is used when
|
||||
the user types '\' at the end of a command line. This is necessary
|
||||
because each line of input is handled by a different call to
|
||||
|
|
|
@ -30,9 +30,6 @@
|
|||
#include "gdbthread.h"
|
||||
|
||||
#include <signal.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
/* This just gets used as a default if we can't find SHELL */
|
||||
#ifndef SHELL_FILE
|
||||
|
|
227
gdb/gdb-events.c
Normal file
227
gdb/gdb-events.c
Normal file
|
@ -0,0 +1,227 @@
|
|||
/* User Interface Events.
|
||||
Copyright 1999 Free Software Foundation, Inc.
|
||||
|
||||
Contributed by Cygnus Solutions.
|
||||
|
||||
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. */
|
||||
|
||||
/* Work in progress */
|
||||
|
||||
/* This file was created with the aid of ``gdb-events.sh''.
|
||||
|
||||
The bourn shell script ``gdb-events.sh'' creates the files
|
||||
``new-gdb-events.c'' and ``new-gdb-events.h and then compares
|
||||
them against the existing ``gdb-events.[hc]''. Any differences
|
||||
found being reported.
|
||||
|
||||
If editing this file, please also run gdb-events.sh and merge any
|
||||
changes into that script. Conversely, when making sweeping changes
|
||||
to this file, modifying gdb-events.sh and using its output may
|
||||
prove easier. */
|
||||
|
||||
|
||||
#include "defs.h"
|
||||
#include "gdb-events.h"
|
||||
#include "gdbcmd.h"
|
||||
|
||||
#undef XMALLOC
|
||||
#define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
|
||||
|
||||
#if WITH_GDB_EVENTS
|
||||
static struct gdb_events null_event_hooks;
|
||||
static struct gdb_events queue_event_hooks;
|
||||
static struct gdb_events *current_event_hooks = &null_event_hooks;
|
||||
#endif
|
||||
|
||||
int gdb_events_debug;
|
||||
|
||||
#if WITH_GDB_EVENTS
|
||||
|
||||
void
|
||||
breakpoint_create_event (int b)
|
||||
{
|
||||
if (gdb_events_debug)
|
||||
fprintf_unfiltered (gdb_stdlog, "breakpoint_create_event\n");
|
||||
if (!current_event_hooks->breakpoint_create)
|
||||
return;
|
||||
current_event_hooks->breakpoint_create (b);
|
||||
}
|
||||
|
||||
void
|
||||
breakpoint_delete_event (int b)
|
||||
{
|
||||
if (gdb_events_debug)
|
||||
fprintf_unfiltered (gdb_stdlog, "breakpoint_delete_event\n");
|
||||
if (!current_event_hooks->breakpoint_delete)
|
||||
return;
|
||||
current_event_hooks->breakpoint_delete (b);
|
||||
}
|
||||
|
||||
void
|
||||
breakpoint_modify_event (int b)
|
||||
{
|
||||
if (gdb_events_debug)
|
||||
fprintf_unfiltered (gdb_stdlog, "breakpoint_modify_event\n");
|
||||
if (!current_event_hooks->breakpoint_modify)
|
||||
return;
|
||||
current_event_hooks->breakpoint_modify (b);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if WITH_GDB_EVENTS
|
||||
void
|
||||
set_gdb_event_hooks (struct gdb_events *vector)
|
||||
{
|
||||
if (vector == NULL)
|
||||
current_event_hooks = &queue_event_hooks;
|
||||
else
|
||||
current_event_hooks = vector;
|
||||
}
|
||||
#endif
|
||||
|
||||
enum gdb_event
|
||||
{
|
||||
breakpoint_create,
|
||||
breakpoint_delete,
|
||||
breakpoint_modify,
|
||||
nr_gdb_events
|
||||
};
|
||||
|
||||
struct breakpoint_create
|
||||
{
|
||||
int b;
|
||||
};
|
||||
|
||||
struct breakpoint_delete
|
||||
{
|
||||
int b;
|
||||
};
|
||||
|
||||
struct breakpoint_modify
|
||||
{
|
||||
int b;
|
||||
};
|
||||
|
||||
struct event
|
||||
{
|
||||
enum gdb_event type;
|
||||
struct event *next;
|
||||
union
|
||||
{
|
||||
struct breakpoint_create breakpoint_create;
|
||||
struct breakpoint_delete breakpoint_delete;
|
||||
struct breakpoint_modify breakpoint_modify;
|
||||
}
|
||||
data;
|
||||
};
|
||||
struct event *pending_events;
|
||||
struct event *delivering_events;
|
||||
|
||||
static void
|
||||
append (struct event *new_event)
|
||||
{
|
||||
struct event **event = &pending_events;
|
||||
while ((*event) != NULL)
|
||||
event = &((*event)->next);
|
||||
(*event) = new_event;
|
||||
(*event)->next = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
queue_breakpoint_create (int b)
|
||||
{
|
||||
struct event *event = XMALLOC (struct event);
|
||||
event->type = breakpoint_create;
|
||||
event->data.breakpoint_create.b = b;
|
||||
append (event);
|
||||
}
|
||||
|
||||
static void
|
||||
queue_breakpoint_delete (int b)
|
||||
{
|
||||
struct event *event = XMALLOC (struct event);
|
||||
event->type = breakpoint_delete;
|
||||
event->data.breakpoint_delete.b = b;
|
||||
append (event);
|
||||
}
|
||||
|
||||
static void
|
||||
queue_breakpoint_modify (int b)
|
||||
{
|
||||
struct event *event = XMALLOC (struct event);
|
||||
event->type = breakpoint_modify;
|
||||
event->data.breakpoint_modify.b = b;
|
||||
append (event);
|
||||
}
|
||||
|
||||
void
|
||||
gdb_events_deliver (struct gdb_events *vector)
|
||||
{
|
||||
/* Just zap any events left around from last time. */
|
||||
while (delivering_events != NULL)
|
||||
{
|
||||
struct event *event = delivering_events;
|
||||
delivering_events = event->next;
|
||||
free (event);
|
||||
}
|
||||
/* Process any pending events. Because one of the deliveries could
|
||||
bail out we move everything off of the pending queue onto an
|
||||
in-progress queue where it can, later, be cleaned up if
|
||||
necessary. */
|
||||
delivering_events = pending_events;
|
||||
pending_events = NULL;
|
||||
while (delivering_events != NULL)
|
||||
{
|
||||
struct event *event = delivering_events;
|
||||
switch (event->type)
|
||||
{
|
||||
case breakpoint_create:
|
||||
vector->breakpoint_create
|
||||
(event->data.breakpoint_create.b);
|
||||
break;
|
||||
case breakpoint_delete:
|
||||
vector->breakpoint_delete
|
||||
(event->data.breakpoint_delete.b);
|
||||
break;
|
||||
case breakpoint_modify:
|
||||
vector->breakpoint_modify
|
||||
(event->data.breakpoint_modify.b);
|
||||
break;
|
||||
}
|
||||
delivering_events = event->next;
|
||||
free (event);
|
||||
}
|
||||
}
|
||||
|
||||
void _initialize_gdb_events (void);
|
||||
void
|
||||
_initialize_gdb_events (void)
|
||||
{
|
||||
#if WITH_GDB_EVENTS
|
||||
queue_event_hooks.breakpoint_create = queue_breakpoint_create;
|
||||
queue_event_hooks.breakpoint_delete = queue_breakpoint_delete;
|
||||
queue_event_hooks.breakpoint_modify = queue_breakpoint_modify;
|
||||
#endif
|
||||
add_show_from_set (add_set_cmd ("eventdebug",
|
||||
class_maintenance,
|
||||
var_zinteger,
|
||||
(char *)&gdb_events_debug,
|
||||
"Set event debugging.\n\
|
||||
When non-zero, event/notify debugging is enabled.", &setlist),
|
||||
&showlist);
|
||||
}
|
97
gdb/gdb-events.h
Normal file
97
gdb/gdb-events.h
Normal file
|
@ -0,0 +1,97 @@
|
|||
/* User Interface Events.
|
||||
Copyright 1999 Free Software Foundation, Inc.
|
||||
|
||||
Contributed by Cygnus Solutions.
|
||||
|
||||
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. */
|
||||
|
||||
/* Work in progress */
|
||||
|
||||
/* This file was created with the aid of ``gdb-events.sh''.
|
||||
|
||||
The bourn shell script ``gdb-events.sh'' creates the files
|
||||
``new-gdb-events.c'' and ``new-gdb-events.h and then compares
|
||||
them against the existing ``gdb-events.[hc]''. Any differences
|
||||
found being reported.
|
||||
|
||||
If editing this file, please also run gdb-events.sh and merge any
|
||||
changes into that script. Conversely, when making sweeping changes
|
||||
to this file, modifying gdb-events.sh and using its output may
|
||||
prove easier. */
|
||||
|
||||
|
||||
#ifndef GDB_EVENTS_H
|
||||
#define GDB_EVENTS_H
|
||||
|
||||
#ifndef WITH_GDB_EVENTS
|
||||
#define WITH_GDB_EVENTS 1
|
||||
#endif
|
||||
|
||||
|
||||
/* COMPAT: pointer variables for old, unconverted events.
|
||||
A call to set_gdb_events() will automatically update these. */
|
||||
|
||||
|
||||
|
||||
/* Type definition of all hook functions.
|
||||
Recommended pratice is to first declare each hook function using
|
||||
the below ftype and then define it. */
|
||||
|
||||
typedef void (gdb_events_breakpoint_create_ftype) (int b);
|
||||
typedef void (gdb_events_breakpoint_delete_ftype) (int b);
|
||||
typedef void (gdb_events_breakpoint_modify_ftype) (int b);
|
||||
|
||||
|
||||
/* gdb-events: object. */
|
||||
|
||||
struct gdb_events
|
||||
{
|
||||
gdb_events_breakpoint_create_ftype *breakpoint_create;
|
||||
gdb_events_breakpoint_delete_ftype *breakpoint_delete;
|
||||
gdb_events_breakpoint_modify_ftype *breakpoint_modify;
|
||||
};
|
||||
|
||||
|
||||
/* Interface into events functions.
|
||||
Where a *_p() predicate is present, it must called before calling
|
||||
the hook proper. */
|
||||
extern void breakpoint_create_event (int b);
|
||||
extern void breakpoint_delete_event (int b);
|
||||
extern void breakpoint_modify_event (int b);
|
||||
|
||||
|
||||
/* When GDB_EVENTS are not being used, completly disable them. */
|
||||
|
||||
#if !WITH_GDB_EVENTS
|
||||
#define breakpoint_create_event(b) 0
|
||||
#define breakpoint_delete_event(b) 0
|
||||
#define breakpoint_modify_event(b) 0
|
||||
#endif
|
||||
|
||||
/* Install custom gdb-events hooks. */
|
||||
extern void set_gdb_event_hooks (struct gdb_events *vector);
|
||||
|
||||
/* Deliver any pending events. */
|
||||
extern void gdb_events_deliver (struct gdb_events *vector);
|
||||
|
||||
#if !WITH_GDB_EVENTS
|
||||
#define set_gdb_events(x) 0
|
||||
#define set_gdb_event_hooks(x) 0
|
||||
#define gdb_events_deliver(x) 0
|
||||
#endif
|
||||
|
||||
#endif
|
568
gdb/gdb-events.sh
Executable file
568
gdb/gdb-events.sh
Executable file
|
@ -0,0 +1,568 @@
|
|||
#!/bin/sh
|
||||
|
||||
# User Interface Events.
|
||||
# Copyright 1999 Free Software Foundation, Inc.
|
||||
#
|
||||
# Contributed by Cygnus Solutions.
|
||||
#
|
||||
# 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.
|
||||
|
||||
#
|
||||
# What happens next:
|
||||
#
|
||||
|
||||
# The gdb-events.h/gdb-events.c files this script generates are commited
|
||||
# and published.
|
||||
|
||||
# Any UI module that is installing events is changed so that the
|
||||
# events are installed using the ``set_gdb_events()'' and
|
||||
# ``gdb_event_hooks()'' interfaces. There could prove to be an issue
|
||||
# here with respect to annotate. We might need to accomodate a hook
|
||||
# stack that allows several ui blocks to install their own events.
|
||||
|
||||
# Each of the variable events (as currently generated) is converteded
|
||||
# to either a straight function call or a function call with a
|
||||
# predicate.
|
||||
|
||||
|
||||
IFS=:
|
||||
|
||||
read="class returntype function formal actual attrib"
|
||||
|
||||
function_list ()
|
||||
{
|
||||
# category:
|
||||
# # -> disable
|
||||
# * -> compatibility - pointer variable that is initialized
|
||||
# by set_gdb_events().
|
||||
# ? -> Predicate and function proper.
|
||||
# f -> always call (must have a void returntype)
|
||||
# return-type
|
||||
# name
|
||||
# formal argument list
|
||||
# actual argument list
|
||||
# attributes
|
||||
# description
|
||||
cat <<EOF |
|
||||
f:void:breakpoint_create:int b:b
|
||||
f:void:breakpoint_delete:int b:b
|
||||
f:void:breakpoint_modify:int b:b
|
||||
#*:void:annotate_starting_hook:void
|
||||
#*:void:annotate_stopped_hook:void
|
||||
#*:void:annotate_signalled_hook:void
|
||||
#*:void:annotate_signal_hook:void
|
||||
#*:void:annotate_exited_hook:void
|
||||
##*:void:print_register_hook:int
|
||||
##*:CORE_ADDR:find_toc_address_hook:CORE_ADDR
|
||||
##*:void:sparc_print_register_hook:int regno:regno
|
||||
#*:void:target_resume_hook:void
|
||||
#*:void:target_wait_loop_hook:void
|
||||
#*:void:init_gdb_hook:char *argv0:argv0
|
||||
#*:void:command_loop_hook:void
|
||||
#*:void:fputs_unfiltered_hook:const char *linebuff,GDB_FILE *stream:linebuff, stream
|
||||
#*:void:print_frame_info_listing_hook:struct symtab *s, int line, int stopline, int noerror:s, line, stopline, noerror
|
||||
#*:int:query_hook:const char *query, va_list args:query, args
|
||||
#*:void:warning_hook:const char *string, va_list args:string, args
|
||||
#*:void:flush_hook:GDB_FILE *stream:stream
|
||||
#*:void:target_output_hook:char *b:b
|
||||
#*:void:interactive_hook:void
|
||||
#*:void:registers_changed_hook:void
|
||||
#*:void:readline_begin_hook:char *format, ...:format
|
||||
#*:char *:readline_hook:char *prompt:prompt
|
||||
#*:void:readline_end_hook:void
|
||||
#*:void:register_changed_hook:int regno:regno
|
||||
#*:void:memory_changed_hook:CORE_ADDR addr, int len:addr, len
|
||||
#*:void:context_hook:int num:num
|
||||
#*:int:target_wait_hook:int pid, struct target_waitstatus *status:pid, status
|
||||
#*:void:call_command_hook:struct cmd_list_element *c, char *cmd, int from_tty:c, cmd, from_tty
|
||||
#*:NORETURN void:error_hook:void:: ATTR_NORETURN
|
||||
#*:void:error_begin_hook:void
|
||||
##*:int:target_architecture_hook:const struct bfd_arch_info *
|
||||
#*:void:exec_file_display_hook:char *filename:filename
|
||||
#*:void:file_changed_hook:char *filename:filename
|
||||
##*:void:specify_exec_file_hook:
|
||||
#*:int:gdb_load_progress_hook:char *section, unsigned long num:section, num
|
||||
#*:void:pre_add_symbol_hook:char *name:name
|
||||
#*:void:post_add_symbol_hook:void
|
||||
#*:void:selected_frame_level_changed_hook:int level:level
|
||||
#*:int:gdb_loop_hook:int signo:signo
|
||||
##*:void:solib_create_inferior_hook:void
|
||||
##*:void:xcoff_relocate_symtab_hook:unsigned int
|
||||
EOF
|
||||
grep -v '^#'
|
||||
}
|
||||
|
||||
copyright ()
|
||||
{
|
||||
cat <<EOF
|
||||
/* User Interface Events.
|
||||
Copyright 1999 Free Software Foundation, Inc.
|
||||
|
||||
Contributed by Cygnus Solutions.
|
||||
|
||||
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. */
|
||||
|
||||
/* Work in progress */
|
||||
|
||||
/* This file was created with the aid of \`\`gdb-events.sh''.
|
||||
|
||||
The bourn shell script \`\`gdb-events.sh'' creates the files
|
||||
\`\`new-gdb-events.c'' and \`\`new-gdb-events.h and then compares
|
||||
them against the existing \`\`gdb-events.[hc]''. Any differences
|
||||
found being reported.
|
||||
|
||||
If editing this file, please also run gdb-events.sh and merge any
|
||||
changes into that script. Conversely, when making sweeping changes
|
||||
to this file, modifying gdb-events.sh and using its output may
|
||||
prove easier. */
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
#
|
||||
# The .h file
|
||||
#
|
||||
|
||||
exec > new-gdb-events.h
|
||||
copyright
|
||||
cat <<EOF
|
||||
|
||||
#ifndef GDB_EVENTS_H
|
||||
#define GDB_EVENTS_H
|
||||
|
||||
#ifndef WITH_GDB_EVENTS
|
||||
#define WITH_GDB_EVENTS 1
|
||||
#endif
|
||||
EOF
|
||||
|
||||
# pointer declarations
|
||||
echo ""
|
||||
echo ""
|
||||
cat <<EOF
|
||||
/* COMPAT: pointer variables for old, unconverted events.
|
||||
A call to set_gdb_events() will automatically update these. */
|
||||
EOF
|
||||
echo ""
|
||||
function_list | while eval read $read
|
||||
do
|
||||
case "${class}" in
|
||||
"*" )
|
||||
echo "extern ${returntype} (*${function}_event) (${formal})${attrib};"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# function typedef's
|
||||
echo ""
|
||||
echo ""
|
||||
cat <<EOF
|
||||
/* Type definition of all hook functions.
|
||||
Recommended pratice is to first declare each hook function using
|
||||
the below ftype and then define it. */
|
||||
EOF
|
||||
echo ""
|
||||
function_list | while eval read $read
|
||||
do
|
||||
echo "typedef ${returntype} (gdb_events_${function}_ftype) (${formal});"
|
||||
done
|
||||
|
||||
# gdb_events object
|
||||
echo ""
|
||||
echo ""
|
||||
cat <<EOF
|
||||
/* gdb-events: object. */
|
||||
EOF
|
||||
echo ""
|
||||
echo "struct gdb_events"
|
||||
echo " {"
|
||||
function_list | while eval read $read
|
||||
do
|
||||
echo " gdb_events_${function}_ftype *${function}${attrib};"
|
||||
done
|
||||
echo " };"
|
||||
|
||||
# function declarations
|
||||
echo ""
|
||||
echo ""
|
||||
cat <<EOF
|
||||
/* Interface into events functions.
|
||||
Where a *_p() predicate is present, it must called before calling
|
||||
the hook proper. */
|
||||
EOF
|
||||
function_list | while eval read $read
|
||||
do
|
||||
case "${class}" in
|
||||
"*" ) continue ;;
|
||||
"?" )
|
||||
echo "extern int ${function}_p (void);"
|
||||
echo "extern ${returntype} ${function}_event (${formal})${attrib};"
|
||||
;;
|
||||
"f" )
|
||||
echo "extern ${returntype} ${function}_event (${formal})${attrib};"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# function macros
|
||||
echo ""
|
||||
echo ""
|
||||
cat <<EOF
|
||||
/* When GDB_EVENTS are not being used, completly disable them. */
|
||||
EOF
|
||||
echo ""
|
||||
echo "#if !WITH_GDB_EVENTS"
|
||||
function_list | while eval read $read
|
||||
do
|
||||
case "${class}" in
|
||||
"*" ) continue ;;
|
||||
"?" )
|
||||
echo "#define ${function}_event_p() 0"
|
||||
echo "#define ${function}_event(${actual}) 0"
|
||||
;;
|
||||
"f" )
|
||||
echo "#define ${function}_event(${actual}) 0"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
echo "#endif"
|
||||
|
||||
# our set function
|
||||
cat <<EOF
|
||||
|
||||
/* Install custom gdb-events hooks. */
|
||||
extern void set_gdb_event_hooks (struct gdb_events *vector);
|
||||
|
||||
/* Deliver any pending events. */
|
||||
extern void gdb_events_deliver (struct gdb_events *vector);
|
||||
|
||||
#if !WITH_GDB_EVENTS
|
||||
#define set_gdb_events(x) 0
|
||||
#define set_gdb_event_hooks(x) 0
|
||||
#define gdb_events_deliver(x) 0
|
||||
#endif
|
||||
EOF
|
||||
|
||||
# close it off
|
||||
echo ""
|
||||
echo "#endif"
|
||||
exec 1>&2
|
||||
#../move-if-change new-gdb-events.h gdb-events.h
|
||||
if ! test -r gdb-events.h
|
||||
then
|
||||
echo "File missing? mv new-gdb-events.h gdb-events.h" 1>&2
|
||||
elif ! diff -c gdb-events.h new-gdb-events.h
|
||||
then
|
||||
echo "gdb-events.h changed? cp new-gdb-events.h gdb-events.h" 1>&2
|
||||
fi
|
||||
|
||||
|
||||
|
||||
#
|
||||
# C file
|
||||
#
|
||||
|
||||
exec > new-gdb-events.c
|
||||
copyright
|
||||
cat <<EOF
|
||||
|
||||
#include "defs.h"
|
||||
#include "gdb-events.h"
|
||||
#include "gdbcmd.h"
|
||||
|
||||
#undef XMALLOC
|
||||
#define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
|
||||
|
||||
#if WITH_GDB_EVENTS
|
||||
static struct gdb_events null_event_hooks;
|
||||
static struct gdb_events queue_event_hooks;
|
||||
static struct gdb_events *current_event_hooks = &null_event_hooks;
|
||||
#endif
|
||||
|
||||
int gdb_events_debug;
|
||||
EOF
|
||||
|
||||
# global pointer variables - always have this
|
||||
#echo ""
|
||||
#function_list | while eval read $read
|
||||
#do
|
||||
# case "${class}" in
|
||||
# "*" )
|
||||
# echo "${returntype} (*${function}_event) (${formal})${attrib} = 0;"
|
||||
# ;;
|
||||
# esac
|
||||
#done
|
||||
|
||||
# function bodies
|
||||
echo ""
|
||||
echo "#if WITH_GDB_EVENTS"
|
||||
function_list | while eval read $read
|
||||
do
|
||||
case "${class}" in
|
||||
"*" ) continue ;;
|
||||
"?" )
|
||||
echo ""
|
||||
echo "int"
|
||||
echo "${function}_event_p (${formal})"
|
||||
echo "{"
|
||||
echo " return current_event_hooks->${function};"
|
||||
echo "}"
|
||||
echo ""
|
||||
echo "${returntype}"
|
||||
echo "${function}_event (${formal})"
|
||||
echo "{"
|
||||
echo " return current_events->${function} (${actual});"
|
||||
echo "}"
|
||||
;;
|
||||
"f" )
|
||||
echo ""
|
||||
echo "void"
|
||||
echo "${function}_event (${formal})"
|
||||
echo "{"
|
||||
echo " if (gdb_events_debug)"
|
||||
echo " fprintf_unfiltered (gdb_stdlog, \"${function}_event\\n\");"
|
||||
echo " if (!current_event_hooks->${function})"
|
||||
echo " return;"
|
||||
echo " current_event_hooks->${function} (${actual});"
|
||||
echo "}"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
echo ""
|
||||
echo "#endif"
|
||||
|
||||
# Set hooks function
|
||||
echo ""
|
||||
cat <<EOF
|
||||
#if WITH_GDB_EVENTS
|
||||
void
|
||||
set_gdb_event_hooks (struct gdb_events *vector)
|
||||
{
|
||||
if (vector == NULL)
|
||||
current_event_hooks = &queue_event_hooks;
|
||||
else
|
||||
current_event_hooks = vector;
|
||||
EOF
|
||||
function_list | while eval read $read
|
||||
do
|
||||
case "${class}" in
|
||||
"*" )
|
||||
echo " ${function}_event = hooks->${function};"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
cat <<EOF
|
||||
}
|
||||
#endif
|
||||
EOF
|
||||
|
||||
# event type
|
||||
echo ""
|
||||
cat <<EOF
|
||||
enum gdb_event
|
||||
{
|
||||
EOF
|
||||
function_list | while eval read $read
|
||||
do
|
||||
case "${class}" in
|
||||
"f" )
|
||||
echo " ${function},"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
cat <<EOF
|
||||
nr_gdb_events
|
||||
};
|
||||
EOF
|
||||
|
||||
# event data
|
||||
echo ""
|
||||
function_list | while eval read $read
|
||||
do
|
||||
case "${class}" in
|
||||
"f" )
|
||||
echo "struct ${function}"
|
||||
echo " {"
|
||||
echo " `echo ${formal} | tr '[,]' '[;]'`;"
|
||||
echo " };"
|
||||
echo ""
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# event queue
|
||||
cat <<EOF
|
||||
struct event
|
||||
{
|
||||
enum gdb_event type;
|
||||
struct event *next;
|
||||
union
|
||||
{
|
||||
EOF
|
||||
function_list | while eval read $read
|
||||
do
|
||||
case "${class}" in
|
||||
"f" )
|
||||
echo " struct ${function} ${function};"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
cat <<EOF
|
||||
}
|
||||
data;
|
||||
};
|
||||
struct event *pending_events;
|
||||
struct event *delivering_events;
|
||||
EOF
|
||||
|
||||
# append
|
||||
echo ""
|
||||
cat <<EOF
|
||||
static void
|
||||
append (struct event *new_event)
|
||||
{
|
||||
struct event **event = &pending_events;
|
||||
while ((*event) != NULL)
|
||||
event = &((*event)->next);
|
||||
(*event) = new_event;
|
||||
(*event)->next = NULL;
|
||||
}
|
||||
EOF
|
||||
|
||||
# schedule a given event
|
||||
function_list | while eval read $read
|
||||
do
|
||||
case "${class}" in
|
||||
"f" )
|
||||
echo ""
|
||||
echo "static void"
|
||||
echo "queue_${function} (${formal})"
|
||||
echo "{"
|
||||
echo " struct event *event = XMALLOC (struct event);"
|
||||
echo " event->type = ${function};"
|
||||
for arg in `echo ${actual} | tr '[,]' '[ ]'`; do
|
||||
echo " event->data.${function}.${arg} = ${arg};"
|
||||
done
|
||||
echo " append (event);"
|
||||
echo "}"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# deliver
|
||||
echo ""
|
||||
cat <<EOF
|
||||
void
|
||||
gdb_events_deliver (struct gdb_events *vector)
|
||||
{
|
||||
/* Just zap any events left around from last time. */
|
||||
while (delivering_events != NULL)
|
||||
{
|
||||
struct event *event = delivering_events;
|
||||
delivering_events = event->next;
|
||||
free (event);
|
||||
}
|
||||
/* Process any pending events. Because one of the deliveries could
|
||||
bail out we move everything off of the pending queue onto an
|
||||
in-progress queue where it can, later, be cleaned up if
|
||||
necessary. */
|
||||
delivering_events = pending_events;
|
||||
pending_events = NULL;
|
||||
while (delivering_events != NULL)
|
||||
{
|
||||
struct event *event = delivering_events;
|
||||
switch (event->type)
|
||||
{
|
||||
EOF
|
||||
function_list | while eval read $read
|
||||
do
|
||||
case "${class}" in
|
||||
"f" )
|
||||
echo " case ${function}:"
|
||||
echo " vector->${function}"
|
||||
sep=" ("
|
||||
ass=""
|
||||
for arg in `echo ${actual} | tr '[,]' '[ ]'`; do
|
||||
ass="${ass}${sep}event->data.${function}.${arg}"
|
||||
sep=",
|
||||
"
|
||||
done
|
||||
echo "${ass});"
|
||||
echo " break;"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
cat <<EOF
|
||||
}
|
||||
delivering_events = event->next;
|
||||
free (event);
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
# Finally the initialization
|
||||
echo ""
|
||||
cat <<EOF
|
||||
void _initialize_gdb_events (void);
|
||||
void
|
||||
_initialize_gdb_events (void)
|
||||
{
|
||||
#if WITH_GDB_EVENTS
|
||||
EOF
|
||||
function_list | while eval read $read
|
||||
do
|
||||
case "${class}" in
|
||||
"f" )
|
||||
echo " queue_event_hooks.${function} = queue_${function};"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
cat <<EOF
|
||||
#endif
|
||||
add_show_from_set (add_set_cmd ("eventdebug",
|
||||
class_maintenance,
|
||||
var_zinteger,
|
||||
(char *)&gdb_events_debug,
|
||||
"Set event debugging.\n\\
|
||||
When non-zero, event/notify debugging is enabled.", &setlist),
|
||||
&showlist);
|
||||
}
|
||||
EOF
|
||||
|
||||
# close things off
|
||||
exec 1>&2
|
||||
#../move-if-change new-gdb-events.c gdb-events.c
|
||||
if ! test -r gdb-events.c
|
||||
then
|
||||
echo "File missing? mv new-gdb-events.c gdb-events.c" 1>&2
|
||||
elif ! diff -c gdb-events.c new-gdb-events.c
|
||||
then
|
||||
echo "gdb-events.c changed? cp new-gdb-events.c gdb-events.c" 1>&2
|
||||
fi
|
653
gdb/gdbarch.c
653
gdb/gdbarch.c
File diff suppressed because it is too large
Load diff
478
gdb/gdbarch.h
478
gdb/gdbarch.h
File diff suppressed because it is too large
Load diff
1858
gdb/gdbarch.sh
Executable file
1858
gdb/gdbarch.sh
Executable file
File diff suppressed because it is too large
Load diff
|
@ -34,7 +34,6 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <io.h>
|
||||
#include <dpmi.h>
|
||||
#include <debug/v2load.h>
|
||||
|
|
|
@ -75,7 +75,6 @@ static struct partial_symtab *hpread_end_psymtab
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
/* check for the existance of a file, given its full pathname */
|
||||
int
|
||||
|
|
106
gdb/hppa-tdep.c
106
gdb/hppa-tdep.c
|
@ -58,9 +58,6 @@
|
|||
#include "symfile.h"
|
||||
#include "objfiles.h"
|
||||
|
||||
/* To support asking "What CPU is this?" */
|
||||
#include <unistd.h>
|
||||
|
||||
/* To support detection of the pseudo-initial frame
|
||||
that threads have. */
|
||||
#define THREAD_INITIAL_FRAME_SYMBOL "__pthread_exit"
|
||||
|
@ -159,7 +156,7 @@ hppa_use_struct_convention (gcc_p, type)
|
|||
int gcc_p;
|
||||
struct type *type;
|
||||
{
|
||||
return (TYPE_LENGTH (type) > 8);
|
||||
return (TYPE_LENGTH (type) > 2 * REGISTER_SIZE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -458,8 +455,8 @@ read_unwind_info (objfile)
|
|||
|
||||
if (elf_unwind_sec)
|
||||
{
|
||||
elf_unwind_size = bfd_section_size (objfile->obfd, elf_unwind_sec); /* purecov: deadcode */
|
||||
elf_unwind_entries = elf_unwind_size / UNWIND_ENTRY_SIZE; /* purecov: deadcode */
|
||||
elf_unwind_size = bfd_section_size (objfile->obfd, elf_unwind_sec);
|
||||
elf_unwind_entries = elf_unwind_size / UNWIND_ENTRY_SIZE;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -576,7 +573,7 @@ find_unwind_entry (pc)
|
|||
{
|
||||
read_unwind_info (objfile);
|
||||
if (objfile->obj_private == NULL)
|
||||
error ("Internal error reading unwind information."); /* purecov: deadcode */
|
||||
error ("Internal error reading unwind information.");
|
||||
ui = ((obj_private_data_t *) (objfile->obj_private))->unwind_info;
|
||||
}
|
||||
|
||||
|
@ -652,7 +649,9 @@ pc_in_interrupt_handler (pc)
|
|||
}
|
||||
|
||||
/* Called when no unwind descriptor was found for PC. Returns 1 if it
|
||||
appears that PC is in a linker stub. */
|
||||
appears that PC is in a linker stub.
|
||||
|
||||
?!? Need to handle stubs which appear in PA64 code. */
|
||||
|
||||
static int
|
||||
pc_in_linker_stub (pc)
|
||||
|
@ -866,6 +865,27 @@ hppa_frame_saved_pc (frame)
|
|||
return read_memory_integer (frame->frame + PC_REGNUM * 4,
|
||||
TARGET_PTR_BIT / 8) & ~0x3;
|
||||
|
||||
if ((frame->pc >= frame->frame
|
||||
&& frame->pc <= (frame->frame
|
||||
/* A call dummy is sized in words, but it is
|
||||
actually a series of instructions. Account
|
||||
for that scaling factor. */
|
||||
+ ((REGISTER_SIZE / INSTRUCTION_SIZE)
|
||||
* CALL_DUMMY_LENGTH)
|
||||
/* Similarly we have to account for 64bit
|
||||
wide register saves. */
|
||||
+ (32 * REGISTER_SIZE)
|
||||
/* We always consider FP regs 8 bytes long. */
|
||||
+ (NUM_REGS - FP0_REGNUM) * 8
|
||||
/* Similarly we have to account for 64bit
|
||||
wide register saves. */
|
||||
+ (6 * REGISTER_SIZE))))
|
||||
{
|
||||
return read_memory_integer ((frame->frame
|
||||
+ (TARGET_PTR_BIT == 64 ? -16 : -20)),
|
||||
TARGET_PTR_BIT / 8) & ~0x3;
|
||||
}
|
||||
|
||||
#ifdef FRAME_SAVED_PC_IN_SIGTRAMP
|
||||
/* Deal with signal handler caller frames too. */
|
||||
if (frame->signal_handler_caller)
|
||||
|
@ -1890,7 +1910,7 @@ find_stub_with_shl_get (function, handle)
|
|||
|
||||
target_read_memory (value_return_addr, (char *) &stub_addr, sizeof (stub_addr));
|
||||
if (stub_addr <= 0)
|
||||
error ("call to __d_shl_get failed, error code is %d", err_value); /* purecov: deadcode */
|
||||
error ("call to __d_shl_get failed, error code is %d", err_value);
|
||||
|
||||
return (stub_addr);
|
||||
}
|
||||
|
@ -2820,6 +2840,10 @@ in_solib_call_trampoline (pc, name)
|
|||
if (pc == dyncall || pc == sr4export)
|
||||
return 1;
|
||||
|
||||
minsym = lookup_minimal_symbol_by_pc (pc);
|
||||
if (minsym && strcmp (SYMBOL_NAME (minsym), ".stub") == 0)
|
||||
return 1;
|
||||
|
||||
/* Get the unwind descriptor corresponding to PC, return zero
|
||||
if no unwind was found. */
|
||||
u = find_unwind_entry (pc);
|
||||
|
@ -2865,12 +2889,12 @@ in_solib_call_trampoline (pc, name)
|
|||
}
|
||||
|
||||
/* Should never happen. */
|
||||
warning ("Unable to find branch in parameter relocation stub.\n"); /* purecov: deadcode */
|
||||
return 0; /* purecov: deadcode */
|
||||
warning ("Unable to find branch in parameter relocation stub.\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Unknown stub type. For now, just return zero. */
|
||||
return 0; /* purecov: deadcode */
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Return one if PC is in the return path of a trampoline, else return zero.
|
||||
|
@ -2927,12 +2951,12 @@ in_solib_return_trampoline (pc, name)
|
|||
}
|
||||
|
||||
/* Should never happen. */
|
||||
warning ("Unable to find branch in parameter relocation stub.\n"); /* purecov: deadcode */
|
||||
return 0; /* purecov: deadcode */
|
||||
warning ("Unable to find branch in parameter relocation stub.\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Unknown stub type. For now, just return zero. */
|
||||
return 0; /* purecov: deadcode */
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
|
@ -3246,6 +3270,10 @@ prologue_inst_adjust_sp (inst)
|
|||
if ((inst & 0xffe00000) == 0x6fc00000)
|
||||
return extract_14 (inst);
|
||||
|
||||
/* std,ma X,D(sp) */
|
||||
if ((inst & 0xffe00008) == 0x73c00008)
|
||||
return (inst & 0x1 ? -1 << 16 : 0) | (((inst >> 4) & 0x3ff) << 3);
|
||||
|
||||
/* addil high21,%r1; ldo low11,(%r1),%r30)
|
||||
save high bits in save_high21 for later use. */
|
||||
if ((inst & 0xffe00000) == 0x28200000)
|
||||
|
@ -3461,9 +3489,10 @@ restart:
|
|||
if (inst == 0x6bc23fd9 || inst == 0x0fc212c1)
|
||||
save_rp = 0;
|
||||
|
||||
/* This is the only way we save SP into the stack. At this time
|
||||
/* These are the only ways we save SP into the stack. At this time
|
||||
the HP compilers never bother to save SP into the stack. */
|
||||
if ((inst & 0xffffc000) == 0x6fc10000)
|
||||
if ((inst & 0xffffc000) == 0x6fc10000
|
||||
|| (inst & 0xffffc00c) == 0x73c10008)
|
||||
save_sp = 0;
|
||||
|
||||
/* Account for general and floating-point register saves. */
|
||||
|
@ -3788,17 +3817,22 @@ hppa_frame_find_saved_regs (frame_info, frame_saved_regs)
|
|||
/* Note the interesting effects of this instruction. */
|
||||
stack_remaining -= prologue_inst_adjust_sp (inst);
|
||||
|
||||
/* There is only one instruction used for saving RP into the stack. */
|
||||
if (inst == 0x6bc23fd9)
|
||||
/* There are limited ways to store the return pointer into the
|
||||
stack. */
|
||||
if (inst == 0x6bc23fd9 || inst == 0x0fc212c1)
|
||||
{
|
||||
save_rp = 0;
|
||||
frame_saved_regs->regs[RP_REGNUM] = frame_info->frame - 20;
|
||||
}
|
||||
|
||||
/* Just note that we found the save of SP into the stack. The
|
||||
value for frame_saved_regs was computed above. */
|
||||
if ((inst & 0xffffc000) == 0x6fc10000)
|
||||
save_sp = 0;
|
||||
/* Note if we saved SP into the stack. This also happens to indicate
|
||||
the location of the saved frame pointer. */
|
||||
if ((inst & 0xffffc000) == 0x6fc10000
|
||||
|| (inst & 0xffffc00c) == 0x73c10008)
|
||||
{
|
||||
frame_saved_regs->regs[FP_REGNUM] = frame_info->frame;
|
||||
save_sp = 0;
|
||||
}
|
||||
|
||||
/* Account for general and floating-point register saves. */
|
||||
reg = inst_saves_gr (inst);
|
||||
|
@ -3811,16 +3845,28 @@ hppa_frame_find_saved_regs (frame_info, frame_saved_regs)
|
|||
if ((inst >> 26) == 0x1b
|
||||
&& extract_14 (inst) >= 0)
|
||||
frame_saved_regs->regs[reg] = frame_info->frame;
|
||||
/* A std has explicit post_modify forms. */
|
||||
else if ((inst & 0xfc00000c0) == 0x70000008)
|
||||
frame_saved_regs->regs[reg] = frame_info->frame;
|
||||
else
|
||||
{
|
||||
CORE_ADDR offset;
|
||||
|
||||
if ((inst >> 26) == 0x1c)
|
||||
offset = (inst & 0x1 ? -1 << 16 : 0) | (((inst >> 4) & 0x3ff) << 3);
|
||||
else if ((inst >> 26) == 0x03)
|
||||
offset = low_sign_extend (inst & 0x1f, 5);
|
||||
else
|
||||
offset = extract_14 (inst);
|
||||
|
||||
/* Handle code with and without frame pointers. */
|
||||
if (u->Save_SP)
|
||||
frame_saved_regs->regs[reg]
|
||||
= frame_info->frame + extract_14 (inst);
|
||||
= frame_info->frame + offset;
|
||||
else
|
||||
frame_saved_regs->regs[reg]
|
||||
= frame_info->frame + (u->Total_frame_size << 3)
|
||||
+ extract_14 (inst);
|
||||
= (frame_info->frame + (u->Total_frame_size << 3)
|
||||
+ offset);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4219,8 +4265,8 @@ child_enable_exception_callback (kind, enable)
|
|||
}
|
||||
else
|
||||
{
|
||||
warning ("Internal error: Invalid inferior pid? Cannot intercept exception events."); /* purecov: deadcode */
|
||||
return (struct symtab_and_line *) -1; /* purecov: deadcode */
|
||||
warning ("Internal error: Invalid inferior pid? Cannot intercept exception events.");
|
||||
return (struct symtab_and_line *) -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4242,8 +4288,8 @@ child_enable_exception_callback (kind, enable)
|
|||
return (struct symtab_and_line *) -1;
|
||||
}
|
||||
break;
|
||||
default: /* purecov: deadcode */
|
||||
error ("Request to enable unknown or unsupported exception event."); /* purecov: deadcode */
|
||||
default:
|
||||
error ("Request to enable unknown or unsupported exception event.");
|
||||
}
|
||||
|
||||
/* Copy break address into new sal struct, malloc'ing if needed. */
|
||||
|
|
|
@ -40,7 +40,6 @@
|
|||
#include "target.h"
|
||||
#include "inferior.h"
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#include "gdbcore.h"
|
||||
|
||||
|
|
127
gdb/i386-stub.c
127
gdb/i386-stub.c
|
@ -456,65 +456,82 @@ char ch;
|
|||
return (-1);
|
||||
}
|
||||
|
||||
|
||||
/* scan for the sequence $<data>#<checksum> */
|
||||
void getpacket(buffer)
|
||||
char * buffer;
|
||||
|
||||
unsigned char *
|
||||
getpacket (buffer)
|
||||
unsigned char *buffer;
|
||||
{
|
||||
unsigned char checksum;
|
||||
unsigned char xmitcsum;
|
||||
int i;
|
||||
int count;
|
||||
int count;
|
||||
char ch;
|
||||
|
||||
do {
|
||||
/* wait around for the start character, ignore all other characters */
|
||||
while ((ch = (getDebugChar() & 0x7f)) != '$');
|
||||
checksum = 0;
|
||||
xmitcsum = -1;
|
||||
while (1)
|
||||
{
|
||||
/* wait around for the start character, ignore all other characters */
|
||||
while ((ch = getDebugChar ()) != '$')
|
||||
;
|
||||
|
||||
count = 0;
|
||||
retry:
|
||||
checksum = 0;
|
||||
xmitcsum = -1;
|
||||
count = 0;
|
||||
|
||||
/* now, read until a # or end of buffer is found */
|
||||
while (count < BUFMAX) {
|
||||
ch = getDebugChar() & 0x7f;
|
||||
if (ch == '#') break;
|
||||
checksum = checksum + ch;
|
||||
buffer[count] = ch;
|
||||
count = count + 1;
|
||||
}
|
||||
buffer[count] = 0;
|
||||
/* now, read until a # or end of buffer is found */
|
||||
while (count < BUFMAX)
|
||||
{
|
||||
ch = getDebugChar ();
|
||||
if (ch == '$')
|
||||
goto retry;
|
||||
if (ch == '#')
|
||||
break;
|
||||
checksum = checksum + ch;
|
||||
buffer[count] = ch;
|
||||
count = count + 1;
|
||||
}
|
||||
buffer[count] = 0;
|
||||
|
||||
if (ch == '#') {
|
||||
xmitcsum = hex(getDebugChar() & 0x7f) << 4;
|
||||
xmitcsum += hex(getDebugChar() & 0x7f);
|
||||
if ((remote_debug ) && (checksum != xmitcsum)) {
|
||||
fprintf (stderr ,"bad checksum. My count = 0x%x, sent=0x%x. buf=%s\n",
|
||||
checksum,xmitcsum,buffer);
|
||||
}
|
||||
if (ch == '#')
|
||||
{
|
||||
ch = getDebugChar ();
|
||||
xmitcsum = hex (ch) << 4;
|
||||
ch = getDebugChar ();
|
||||
xmitcsum += hex (ch);
|
||||
|
||||
if (checksum != xmitcsum) putDebugChar('-'); /* failed checksum */
|
||||
else {
|
||||
putDebugChar('+'); /* successful transfer */
|
||||
/* if a sequence char is present, reply the sequence ID */
|
||||
if (buffer[2] == ':') {
|
||||
putDebugChar( buffer[0] );
|
||||
putDebugChar( buffer[1] );
|
||||
/* remove sequence chars from buffer */
|
||||
count = strlen(buffer);
|
||||
for (i=3; i <= count; i++) buffer[i-3] = buffer[i];
|
||||
}
|
||||
}
|
||||
if (checksum != xmitcsum)
|
||||
{
|
||||
if (remote_debug)
|
||||
{
|
||||
fprintf (stderr,
|
||||
"bad checksum. My count = 0x%x, sent=0x%x. buf=%s\n",
|
||||
checksum, xmitcsum, buffer);
|
||||
}
|
||||
putDebugChar ('-'); /* failed checksum */
|
||||
}
|
||||
else
|
||||
{
|
||||
putDebugChar ('+'); /* successful transfer */
|
||||
|
||||
/* if a sequence char is present, reply the sequence ID */
|
||||
if (buffer[2] == ':')
|
||||
{
|
||||
putDebugChar (buffer[0]);
|
||||
putDebugChar (buffer[1]);
|
||||
|
||||
return &buffer[3];
|
||||
}
|
||||
|
||||
return &buffer[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
} while (checksum != xmitcsum);
|
||||
|
||||
}
|
||||
|
||||
/* send the packet in buffer. */
|
||||
|
||||
|
||||
void putpacket(buffer)
|
||||
char * buffer;
|
||||
unsigned char *buffer;
|
||||
{
|
||||
unsigned char checksum;
|
||||
int count;
|
||||
|
@ -536,7 +553,7 @@ char * buffer;
|
|||
putDebugChar(hexchars[checksum >> 4]);
|
||||
putDebugChar(hexchars[checksum % 16]);
|
||||
|
||||
} while ((getDebugChar() & 0x7f) != '+');
|
||||
} while (getDebugChar() != '+');
|
||||
|
||||
}
|
||||
|
||||
|
@ -698,7 +715,7 @@ int hexToInt(char **ptr, int *intValue)
|
|||
*/
|
||||
void handle_exception(int exceptionVector)
|
||||
{
|
||||
int sigval;
|
||||
int sigval, stepping;
|
||||
int addr, length;
|
||||
char * ptr;
|
||||
int newPC;
|
||||
|
@ -719,11 +736,14 @@ void handle_exception(int exceptionVector)
|
|||
|
||||
putpacket(remcomOutBuffer);
|
||||
|
||||
stepping = 0;
|
||||
|
||||
while (1==1) {
|
||||
error = 0;
|
||||
remcomOutBuffer[0] = 0;
|
||||
getpacket(remcomInBuffer);
|
||||
switch (remcomInBuffer[0]) {
|
||||
ptr = getpacket(remcomInBuffer);
|
||||
|
||||
switch (*ptr++) {
|
||||
case '?' : remcomOutBuffer[0] = 'S';
|
||||
remcomOutBuffer[1] = hexchars[sigval >> 4];
|
||||
remcomOutBuffer[2] = hexchars[sigval % 16];
|
||||
|
@ -735,14 +755,13 @@ void handle_exception(int exceptionVector)
|
|||
mem2hex((char*) registers, remcomOutBuffer, NUMREGBYTES, 0);
|
||||
break;
|
||||
case 'G' : /* set the value of the CPU registers - return OK */
|
||||
hex2mem(&remcomInBuffer[1], (char*) registers, NUMREGBYTES, 0);
|
||||
hex2mem(ptr, (char*) registers, NUMREGBYTES, 0);
|
||||
strcpy(remcomOutBuffer,"OK");
|
||||
break;
|
||||
case 'P' : /* set the value of a single CPU register - return OK */
|
||||
{
|
||||
int regno;
|
||||
|
||||
ptr = &remcomInBuffer[1];
|
||||
if (hexToInt (&ptr, ®no) && *ptr++ == '=')
|
||||
if (regno >= 0 && regno < NUMREGS)
|
||||
{
|
||||
|
@ -758,7 +777,6 @@ void handle_exception(int exceptionVector)
|
|||
/* mAA..AA,LLLL Read LLLL bytes at address AA..AA */
|
||||
case 'm' :
|
||||
/* TRY TO READ %x,%x. IF SUCCEED, SET PTR = 0 */
|
||||
ptr = &remcomInBuffer[1];
|
||||
if (hexToInt(&ptr,&addr))
|
||||
if (*(ptr++) == ',')
|
||||
if (hexToInt(&ptr,&length))
|
||||
|
@ -775,14 +793,12 @@ void handle_exception(int exceptionVector)
|
|||
if (ptr)
|
||||
{
|
||||
strcpy(remcomOutBuffer,"E01");
|
||||
debug_error("malformed read memory command: %s",remcomInBuffer);
|
||||
}
|
||||
break;
|
||||
|
||||
/* MAA..AA,LLLL: Write LLLL bytes at address AA.AA return OK */
|
||||
case 'M' :
|
||||
/* TRY TO READ '%x,%x:'. IF SUCCEED, SET PTR = 0 */
|
||||
ptr = &remcomInBuffer[1];
|
||||
if (hexToInt(&ptr,&addr))
|
||||
if (*(ptr++) == ',')
|
||||
if (hexToInt(&ptr,&length))
|
||||
|
@ -803,16 +819,15 @@ void handle_exception(int exceptionVector)
|
|||
if (ptr)
|
||||
{
|
||||
strcpy(remcomOutBuffer,"E02");
|
||||
debug_error("malformed write memory command: %s",remcomInBuffer);
|
||||
}
|
||||
break;
|
||||
|
||||
/* cAA..AA Continue at address AA..AA(optional) */
|
||||
/* sAA..AA Step one instruction from AA..AA(optional) */
|
||||
case 'c' :
|
||||
case 's' :
|
||||
stepping = 1;
|
||||
case 'c' :
|
||||
/* try to read optional parameter, pc unchanged if no parm */
|
||||
ptr = &remcomInBuffer[1];
|
||||
if (hexToInt(&ptr,&addr))
|
||||
registers[ PC ] = addr;
|
||||
|
||||
|
@ -822,7 +837,7 @@ void handle_exception(int exceptionVector)
|
|||
registers[ PS ] &= 0xfffffeff;
|
||||
|
||||
/* set the trace bit if we're stepping */
|
||||
if (remcomInBuffer[0] == 's') registers[ PS ] |= 0x100;
|
||||
if (stepping) registers[ PS ] |= 0x100;
|
||||
|
||||
/*
|
||||
* If we found a match for the PC AND we are not returning
|
||||
|
|
|
@ -36,9 +36,7 @@
|
|||
control to the inferior which you don't want showing up in your
|
||||
control variables. */
|
||||
|
||||
#ifdef __STDC__
|
||||
struct inferior_status;
|
||||
#endif
|
||||
|
||||
extern struct inferior_status *save_inferior_status PARAMS ((int));
|
||||
|
||||
|
|
|
@ -31,9 +31,6 @@
|
|||
#include "gdb_string.h"
|
||||
#include <signal.h>
|
||||
#include <fcntl.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SELECT_H
|
||||
#include <sys/select.h>
|
||||
#endif
|
||||
|
|
306
gdb/infrun.c
306
gdb/infrun.c
|
@ -1136,6 +1136,10 @@ void init_execution_control_state (struct execution_control_state * ecs);
|
|||
|
||||
void handle_inferior_event (struct execution_control_state * ecs);
|
||||
|
||||
static void check_sigtramp2 (struct execution_control_state *ecs);
|
||||
static void stop_stepping (struct execution_control_state *ecs);
|
||||
static void prepare_to_wait (struct execution_control_state *ecs);
|
||||
|
||||
/* Wait for control to return from inferior to debugger.
|
||||
If inferior gets a signal, we may decide to start it up again
|
||||
instead of returning. That is why there is a loop in this function.
|
||||
|
@ -1337,7 +1341,8 @@ handle_inferior_event (struct execution_control_state *ecs)
|
|||
else
|
||||
target_resume (-1, 0, TARGET_SIGNAL_0);
|
||||
ecs->infwait_state = infwait_normal_state;
|
||||
goto wfi_continue;
|
||||
prepare_to_wait (ecs);
|
||||
return;
|
||||
|
||||
case infwait_nullified_state:
|
||||
break;
|
||||
|
@ -1388,7 +1393,8 @@ handle_inferior_event (struct execution_control_state *ecs)
|
|||
make progress. */
|
||||
|
||||
target_resume (-1, 0, TARGET_SIGNAL_0);
|
||||
goto wfi_continue;
|
||||
prepare_to_wait (ecs);
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -1423,11 +1429,13 @@ handle_inferior_event (struct execution_control_state *ecs)
|
|||
}
|
||||
#endif
|
||||
resume (0, TARGET_SIGNAL_0);
|
||||
goto wfi_continue;
|
||||
prepare_to_wait (ecs);
|
||||
return;
|
||||
|
||||
case TARGET_WAITKIND_SPURIOUS:
|
||||
resume (0, TARGET_SIGNAL_0);
|
||||
goto wfi_continue;
|
||||
prepare_to_wait (ecs);
|
||||
return;
|
||||
|
||||
case TARGET_WAITKIND_EXITED:
|
||||
target_terminal_ours (); /* Must do this before mourn anyway */
|
||||
|
@ -1447,7 +1455,8 @@ handle_inferior_event (struct execution_control_state *ecs)
|
|||
target_mourn_inferior ();
|
||||
singlestep_breakpoints_inserted_p = 0; /*SOFTWARE_SINGLE_STEP_P */
|
||||
stop_print_frame = 0;
|
||||
goto stop_stepping;
|
||||
stop_stepping (ecs);
|
||||
return;
|
||||
|
||||
case TARGET_WAITKIND_SIGNALLED:
|
||||
stop_print_frame = 0;
|
||||
|
@ -1475,7 +1484,8 @@ handle_inferior_event (struct execution_control_state *ecs)
|
|||
printf_filtered ("The program no longer exists.\n");
|
||||
gdb_flush (gdb_stdout);
|
||||
singlestep_breakpoints_inserted_p = 0; /*SOFTWARE_SINGLE_STEP_P */
|
||||
goto stop_stepping;
|
||||
stop_stepping (ecs);
|
||||
return;
|
||||
|
||||
/* The following are the only cases in which we keep going;
|
||||
the above cases end in a continue or goto. */
|
||||
|
@ -1492,7 +1502,8 @@ handle_inferior_event (struct execution_control_state *ecs)
|
|||
pending_follow.fork_event.saw_parent_fork = 1;
|
||||
pending_follow.fork_event.parent_pid = ecs->pid;
|
||||
pending_follow.fork_event.child_pid = ecs->ws.value.related_pid;
|
||||
goto wfi_continue;
|
||||
prepare_to_wait (ecs);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1552,7 +1563,8 @@ handle_inferior_event (struct execution_control_state *ecs)
|
|||
if (follow_vfork_when_exec)
|
||||
{
|
||||
target_resume (ecs->pid, 0, TARGET_SIGNAL_0);
|
||||
goto wfi_continue;
|
||||
prepare_to_wait (ecs);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1580,7 +1592,8 @@ handle_inferior_event (struct execution_control_state *ecs)
|
|||
if (pending_follow.kind == TARGET_WAITKIND_VFORKED)
|
||||
ENSURE_VFORKING_PARENT_REMAINS_STOPPED (pending_follow.fork_event.parent_pid);
|
||||
target_resume (ecs->pid, 0, TARGET_SIGNAL_0);
|
||||
goto wfi_continue;
|
||||
prepare_to_wait (ecs);
|
||||
return;
|
||||
}
|
||||
inferior_ignoring_leading_exec_events =
|
||||
target_reported_exec_events_per_exec_call () - 1;
|
||||
|
@ -1615,7 +1628,8 @@ handle_inferior_event (struct execution_control_state *ecs)
|
|||
if (RESUME_EXECD_VFORKING_CHILD_TO_GET_PARENT_VFORK ())
|
||||
target_resume (ecs->pid, 1, TARGET_SIGNAL_0);
|
||||
/* We expect the parent vfork event to be available now. */
|
||||
goto wfi_continue;
|
||||
prepare_to_wait (ecs);
|
||||
return;
|
||||
}
|
||||
|
||||
/* This causes the eventpoints and symbol table to be reset. Must
|
||||
|
@ -1661,7 +1675,8 @@ handle_inferior_event (struct execution_control_state *ecs)
|
|||
TARGET_DISABLE_HW_WATCHPOINTS (inferior_pid);
|
||||
}
|
||||
resume (0, TARGET_SIGNAL_0);
|
||||
goto wfi_continue;
|
||||
prepare_to_wait (ecs);
|
||||
return;
|
||||
|
||||
/* Before examining the threads further, step this thread to
|
||||
get it entirely out of the syscall. (We get notice of the
|
||||
|
@ -1686,7 +1701,8 @@ handle_inferior_event (struct execution_control_state *ecs)
|
|||
ecs->enable_hw_watchpoints_after_wait =
|
||||
(number_of_threads_in_syscalls == 0);
|
||||
}
|
||||
goto wfi_continue;
|
||||
prepare_to_wait (ecs);
|
||||
return;
|
||||
|
||||
case TARGET_WAITKIND_STOPPED:
|
||||
stop_signal = ecs->ws.value.sig;
|
||||
|
@ -1703,7 +1719,8 @@ handle_inferior_event (struct execution_control_state *ecs)
|
|||
if (ecs->new_thread_event)
|
||||
{
|
||||
target_resume (-1, 0, TARGET_SIGNAL_0);
|
||||
goto wfi_continue;
|
||||
prepare_to_wait (ecs);
|
||||
return;
|
||||
}
|
||||
|
||||
stop_pc = read_pc_pid (ecs->pid);
|
||||
|
@ -1750,7 +1767,8 @@ handle_inferior_event (struct execution_control_state *ecs)
|
|||
ecs->waiton_pid = ecs->pid;
|
||||
ecs->wp = &(ecs->ws);
|
||||
ecs->infwait_state = infwait_thread_hop_state;
|
||||
goto wfi_continue;
|
||||
prepare_to_wait (ecs);
|
||||
return;
|
||||
}
|
||||
|
||||
/* We need to restart all the threads now,
|
||||
|
@ -1761,7 +1779,8 @@ handle_inferior_event (struct execution_control_state *ecs)
|
|||
target_resume (ecs->pid, 0, TARGET_SIGNAL_0);
|
||||
else
|
||||
target_resume (-1, 0, TARGET_SIGNAL_0);
|
||||
goto wfi_continue;
|
||||
prepare_to_wait (ecs);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1827,7 +1846,8 @@ handle_inferior_event (struct execution_control_state *ecs)
|
|||
stop_signal = TARGET_SIGNAL_0;
|
||||
|
||||
target_resume (ecs->pid, 0, stop_signal);
|
||||
goto wfi_continue;
|
||||
prepare_to_wait (ecs);
|
||||
return;
|
||||
}
|
||||
|
||||
/* It's a SIGTRAP or a signal we're interested in. Switch threads,
|
||||
|
@ -1893,7 +1913,8 @@ handle_inferior_event (struct execution_control_state *ecs)
|
|||
ecs->infwait_state = infwait_nullified_state;
|
||||
ecs->waiton_pid = ecs->pid;
|
||||
ecs->wp = &(ecs->tmpstatus);
|
||||
goto wfi_continue;
|
||||
prepare_to_wait (ecs);
|
||||
return;
|
||||
}
|
||||
|
||||
/* It may not be necessary to disable the watchpoint to stop over
|
||||
|
@ -1902,7 +1923,8 @@ handle_inferior_event (struct execution_control_state *ecs)
|
|||
if (HAVE_STEPPABLE_WATCHPOINT && STOPPED_BY_WATCHPOINT (ecs->ws))
|
||||
{
|
||||
resume (1, 0);
|
||||
goto wfi_continue;
|
||||
prepare_to_wait (ecs);
|
||||
return;
|
||||
}
|
||||
|
||||
/* It is far more common to need to disable a watchpoint to step
|
||||
|
@ -1936,7 +1958,8 @@ handle_inferior_event (struct execution_control_state *ecs)
|
|||
ecs->waiton_pid = ecs->pid;
|
||||
ecs->wp = &(ecs->ws);
|
||||
ecs->infwait_state = infwait_nonstep_watch_state;
|
||||
goto wfi_continue;
|
||||
prepare_to_wait (ecs);
|
||||
return;
|
||||
}
|
||||
|
||||
/* It may be possible to simply continue after a watchpoint. */
|
||||
|
@ -1985,10 +2008,14 @@ handle_inferior_event (struct execution_control_state *ecs)
|
|||
if (stop_signal == TARGET_SIGNAL_TRAP && stop_after_trap)
|
||||
{
|
||||
stop_print_frame = 0;
|
||||
goto wfi_break;
|
||||
stop_stepping (ecs);
|
||||
return;
|
||||
}
|
||||
if (stop_soon_quietly)
|
||||
goto wfi_break;
|
||||
{
|
||||
stop_stepping (ecs);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Don't even think about breakpoints
|
||||
if just proceeded over a breakpoint.
|
||||
|
@ -2130,7 +2157,10 @@ handle_inferior_event (struct execution_control_state *ecs)
|
|||
gdb_flush (gdb_stdout);
|
||||
}
|
||||
if (signal_stop[stop_signal])
|
||||
goto wfi_break;
|
||||
{
|
||||
stop_stepping (ecs);
|
||||
return;
|
||||
}
|
||||
/* If not going to stop, give terminal back
|
||||
if we took it away. */
|
||||
else if (printed)
|
||||
|
@ -2172,7 +2202,7 @@ handle_inferior_event (struct execution_control_state *ecs)
|
|||
this probably breaks that. As with anything else, it's up to
|
||||
the HP-UX maintainer to furnish a fix that doesn't break other
|
||||
platforms. --JimB, 20 May 1999 */
|
||||
goto check_sigtramp2;
|
||||
check_sigtramp2 (ecs);
|
||||
}
|
||||
|
||||
/* Handle cases caused by hitting a breakpoint. */
|
||||
|
@ -2267,7 +2297,8 @@ handle_inferior_event (struct execution_control_state *ecs)
|
|||
through_sigtramp_breakpoint via the cleanup chain, so
|
||||
no need to worry about it here. */
|
||||
|
||||
goto stop_stepping;
|
||||
stop_stepping (ecs);
|
||||
return;
|
||||
|
||||
case BPSTAT_WHAT_STOP_SILENT:
|
||||
stop_print_frame = 0;
|
||||
|
@ -2276,7 +2307,8 @@ handle_inferior_event (struct execution_control_state *ecs)
|
|||
through_sigtramp_breakpoint via the cleanup chain, so
|
||||
no need to worry about it here. */
|
||||
|
||||
goto stop_stepping;
|
||||
stop_stepping (ecs);
|
||||
return;
|
||||
|
||||
case BPSTAT_WHAT_STEP_RESUME:
|
||||
/* This proably demands a more elegant solution, but, yeah
|
||||
|
@ -2349,7 +2381,8 @@ handle_inferior_event (struct execution_control_state *ecs)
|
|||
if (stop_on_solib_events)
|
||||
{
|
||||
stop_print_frame = 0;
|
||||
goto stop_stepping;
|
||||
stop_stepping (ecs);
|
||||
return;
|
||||
}
|
||||
|
||||
/* If we stopped due to an explicit catchpoint, then the
|
||||
|
@ -2429,7 +2462,8 @@ handle_inferior_event (struct execution_control_state *ecs)
|
|||
stop_bpstat = bpstat_copy (ecs->stepping_through_solib_catchpoints);
|
||||
bpstat_clear (&ecs->stepping_through_solib_catchpoints);
|
||||
stop_print_frame = 1;
|
||||
goto stop_stepping;
|
||||
stop_stepping (ecs);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!CALL_DUMMY_BREAKPOINT_OFFSET_P)
|
||||
|
@ -2452,23 +2486,30 @@ handle_inferior_event (struct execution_control_state *ecs)
|
|||
#ifdef HP_OS_BUG
|
||||
trap_expected_after_continue = 1;
|
||||
#endif
|
||||
goto wfi_break;
|
||||
stop_stepping (ecs);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (step_resume_breakpoint)
|
||||
/* Having a step-resume breakpoint overrides anything
|
||||
else having to do with stepping commands until
|
||||
that breakpoint is reached. */
|
||||
/* I'm not sure whether this needs to be check_sigtramp2 or
|
||||
whether it could/should be keep_going. */
|
||||
goto check_sigtramp2;
|
||||
|
||||
{
|
||||
/* Having a step-resume breakpoint overrides anything
|
||||
else having to do with stepping commands until
|
||||
that breakpoint is reached. */
|
||||
/* I'm not sure whether this needs to be check_sigtramp2 or
|
||||
whether it could/should be keep_going. */
|
||||
check_sigtramp2 (ecs);
|
||||
goto keep_going;
|
||||
}
|
||||
|
||||
if (step_range_end == 0)
|
||||
/* Likewise if we aren't even stepping. */
|
||||
/* I'm not sure whether this needs to be check_sigtramp2 or
|
||||
whether it could/should be keep_going. */
|
||||
goto check_sigtramp2;
|
||||
{
|
||||
/* Likewise if we aren't even stepping. */
|
||||
/* I'm not sure whether this needs to be check_sigtramp2 or
|
||||
whether it could/should be keep_going. */
|
||||
check_sigtramp2 (ecs);
|
||||
goto keep_going;
|
||||
}
|
||||
|
||||
/* If stepping through a line, keep going if still within it.
|
||||
|
||||
|
@ -2480,7 +2521,8 @@ handle_inferior_event (struct execution_control_state *ecs)
|
|||
{
|
||||
/* We might be doing a BPSTAT_WHAT_SINGLE and getting a signal.
|
||||
So definately need to check for sigtramp here. */
|
||||
goto check_sigtramp2;
|
||||
check_sigtramp2 (ecs);
|
||||
goto keep_going;
|
||||
}
|
||||
|
||||
/* We stepped out of the stepping range. */
|
||||
|
@ -2595,7 +2637,8 @@ handle_inferior_event (struct execution_control_state *ecs)
|
|||
supposed to be stepping at the assembly language level
|
||||
("stepi"). Just stop. */
|
||||
stop_step = 1;
|
||||
goto wfi_break;
|
||||
stop_stepping (ecs);
|
||||
return;
|
||||
}
|
||||
|
||||
if (step_over_calls > 0 || IGNORE_HELPER_CALL (stop_pc))
|
||||
|
@ -2706,7 +2749,8 @@ handle_inferior_event (struct execution_control_state *ecs)
|
|||
{
|
||||
/* We are already there: stop now. */
|
||||
stop_step = 1;
|
||||
goto wfi_break;
|
||||
stop_stepping (ecs);
|
||||
return;
|
||||
}
|
||||
else
|
||||
/* Put the step-breakpoint there and go until there. */
|
||||
|
@ -2740,7 +2784,8 @@ handle_inferior_event (struct execution_control_state *ecs)
|
|||
/* It is stepi or nexti. We always want to stop stepping after
|
||||
one instruction. */
|
||||
stop_step = 1;
|
||||
goto wfi_break;
|
||||
stop_stepping (ecs);
|
||||
return;
|
||||
}
|
||||
|
||||
/* If we're in the return path from a shared library trampoline,
|
||||
|
@ -2783,7 +2828,8 @@ handle_inferior_event (struct execution_control_state *ecs)
|
|||
when we do "s" in a function with no line numbers,
|
||||
or can this happen as a result of a return or longjmp?). */
|
||||
stop_step = 1;
|
||||
goto wfi_break;
|
||||
stop_stepping (ecs);
|
||||
return;
|
||||
}
|
||||
|
||||
if ((stop_pc == ecs->sal.pc)
|
||||
|
@ -2794,7 +2840,8 @@ handle_inferior_event (struct execution_control_state *ecs)
|
|||
That is said to make things like for (;;) statements work
|
||||
better. */
|
||||
stop_step = 1;
|
||||
goto wfi_break;
|
||||
stop_stepping (ecs);
|
||||
return;
|
||||
}
|
||||
|
||||
/* We aren't done stepping.
|
||||
|
@ -2812,7 +2859,8 @@ handle_inferior_event (struct execution_control_state *ecs)
|
|||
in which after skipping the prologue we better stop even though
|
||||
we will be in mid-line. */
|
||||
stop_step = 1;
|
||||
goto wfi_break;
|
||||
stop_stepping (ecs);
|
||||
return;
|
||||
}
|
||||
step_range_start = ecs->sal.pc;
|
||||
step_range_end = ecs->sal.end;
|
||||
|
@ -2829,42 +2877,6 @@ handle_inferior_event (struct execution_control_state *ecs)
|
|||
step_frame_address = current_frame;
|
||||
}
|
||||
|
||||
|
||||
goto keep_going;
|
||||
|
||||
check_sigtramp2:
|
||||
if (trap_expected
|
||||
&& IN_SIGTRAMP (stop_pc, ecs->stop_func_name)
|
||||
&& !IN_SIGTRAMP (prev_pc, prev_func_name)
|
||||
&& INNER_THAN (read_sp (), step_sp))
|
||||
{
|
||||
/* What has happened here is that we have just stepped the inferior
|
||||
with a signal (because it is a signal which shouldn't make
|
||||
us stop), thus stepping into sigtramp.
|
||||
|
||||
So we need to set a step_resume_break_address breakpoint
|
||||
and continue until we hit it, and then step. FIXME: This should
|
||||
be more enduring than a step_resume breakpoint; we should know
|
||||
that we will later need to keep going rather than re-hitting
|
||||
the breakpoint here (see testsuite/gdb.t06/signals.exp where
|
||||
it says "exceedingly difficult"). */
|
||||
struct symtab_and_line sr_sal;
|
||||
|
||||
INIT_SAL (&sr_sal); /* initialize to zeroes */
|
||||
sr_sal.pc = prev_pc;
|
||||
sr_sal.section = find_pc_overlay (sr_sal.pc);
|
||||
/* We perhaps could set the frame if we kept track of what
|
||||
the frame corresponding to prev_pc was. But we don't,
|
||||
so don't. */
|
||||
through_sigtramp_breakpoint =
|
||||
set_momentary_breakpoint (sr_sal, NULL, bp_through_sigtramp);
|
||||
if (breakpoints_inserted)
|
||||
insert_breakpoints ();
|
||||
|
||||
ecs->remove_breakpoints_on_following_step = 1;
|
||||
ecs->another_trap = 1;
|
||||
}
|
||||
|
||||
keep_going:
|
||||
/* Come to this label when you need to resume the inferior.
|
||||
It's really much cleaner to do a goto than a maze of if-else
|
||||
|
@ -2932,7 +2944,10 @@ handle_inferior_event (struct execution_control_state *ecs)
|
|||
{
|
||||
breakpoints_failed = insert_breakpoints ();
|
||||
if (breakpoints_failed)
|
||||
goto wfi_break;
|
||||
{
|
||||
stop_stepping (ecs);
|
||||
return;
|
||||
}
|
||||
breakpoints_inserted = 1;
|
||||
}
|
||||
|
||||
|
@ -2971,40 +2986,73 @@ handle_inferior_event (struct execution_control_state *ecs)
|
|||
resume (currently_stepping (ecs), stop_signal);
|
||||
}
|
||||
|
||||
/* Former continues in the main loop goto here. */
|
||||
wfi_continue:
|
||||
/* This used to be at the top of the loop. */
|
||||
if (ecs->infwait_state == infwait_normal_state)
|
||||
{
|
||||
overlay_cache_invalid = 1;
|
||||
|
||||
/* We have to invalidate the registers BEFORE calling
|
||||
target_wait because they can be loaded from the target
|
||||
while in target_wait. This makes remote debugging a bit
|
||||
more efficient for those targets that provide critical
|
||||
registers as part of their normal status mechanism. */
|
||||
|
||||
registers_changed ();
|
||||
ecs->waiton_pid = -1;
|
||||
ecs->wp = &(ecs->ws);
|
||||
}
|
||||
/* This is the old end of the while loop. Let everybody know
|
||||
we want to wait for the inferior some more and get called
|
||||
again soon. */
|
||||
ecs->wait_some_more = 1;
|
||||
prepare_to_wait (ecs);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Former breaks in the main loop goto here. */
|
||||
wfi_break:
|
||||
} /* extra brace, to preserve old indentation */
|
||||
|
||||
stop_stepping:
|
||||
stop_stepping (ecs);
|
||||
}
|
||||
|
||||
/* Are we in the middle of stepping? */
|
||||
|
||||
static int
|
||||
currently_stepping (struct execution_control_state *ecs)
|
||||
{
|
||||
return ((through_sigtramp_breakpoint == NULL
|
||||
&& !ecs->handling_longjmp
|
||||
&& ((step_range_end && step_resume_breakpoint == NULL)
|
||||
|| trap_expected))
|
||||
|| ecs->stepping_through_solib_after_catch
|
||||
|| bpstat_should_step ());
|
||||
}
|
||||
|
||||
static void
|
||||
check_sigtramp2 (struct execution_control_state *ecs)
|
||||
{
|
||||
if (trap_expected
|
||||
&& IN_SIGTRAMP (stop_pc, ecs->stop_func_name)
|
||||
&& !IN_SIGTRAMP (prev_pc, prev_func_name)
|
||||
&& INNER_THAN (read_sp (), step_sp))
|
||||
{
|
||||
/* What has happened here is that we have just stepped the
|
||||
inferior with a signal (because it is a signal which
|
||||
shouldn't make us stop), thus stepping into sigtramp.
|
||||
|
||||
So we need to set a step_resume_break_address breakpoint and
|
||||
continue until we hit it, and then step. FIXME: This should
|
||||
be more enduring than a step_resume breakpoint; we should
|
||||
know that we will later need to keep going rather than
|
||||
re-hitting the breakpoint here (see the testsuite,
|
||||
gdb.base/signals.exp where it says "exceedingly difficult"). */
|
||||
|
||||
struct symtab_and_line sr_sal;
|
||||
|
||||
INIT_SAL (&sr_sal); /* initialize to zeroes */
|
||||
sr_sal.pc = prev_pc;
|
||||
sr_sal.section = find_pc_overlay (sr_sal.pc);
|
||||
/* We perhaps could set the frame if we kept track of what the
|
||||
frame corresponding to prev_pc was. But we don't, so don't. */
|
||||
through_sigtramp_breakpoint =
|
||||
set_momentary_breakpoint (sr_sal, NULL, bp_through_sigtramp);
|
||||
if (breakpoints_inserted)
|
||||
insert_breakpoints ();
|
||||
|
||||
ecs->remove_breakpoints_on_following_step = 1;
|
||||
ecs->another_trap = 1;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
stop_stepping (struct execution_control_state *ecs)
|
||||
{
|
||||
if (target_has_execution)
|
||||
{
|
||||
/* Are we stopping for a vfork event? We only stop when we see
|
||||
the child's event. However, we may not yet have seen the
|
||||
parent's event. And, inferior_pid is still set to the parent's
|
||||
pid, until we resume again and follow either the parent or child.
|
||||
parent's event. And, inferior_pid is still set to the
|
||||
parent's pid, until we resume again and follow either the
|
||||
parent or child.
|
||||
|
||||
To ensure that we can really touch inferior_pid (aka, the
|
||||
parent process) -- which calls to functions like read_pc
|
||||
|
@ -3031,21 +3079,36 @@ stop_stepping:
|
|||
prev_func_start = ecs->stop_func_start;
|
||||
prev_func_name = ecs->stop_func_name;
|
||||
}
|
||||
|
||||
/* Let callers know we don't want to wait for the inferior anymore. */
|
||||
ecs->wait_some_more = 0;
|
||||
}
|
||||
|
||||
/* Are we in the middle of stepping? */
|
||||
/* This function normally comes after a resume, before
|
||||
handle_inferior_event exits. It takes care of any last bits of
|
||||
housekeeping, and sets the all-important wait_some_more flag. */
|
||||
|
||||
static int
|
||||
currently_stepping (struct execution_control_state *ecs)
|
||||
static void
|
||||
prepare_to_wait (struct execution_control_state *ecs)
|
||||
{
|
||||
return ((through_sigtramp_breakpoint == NULL
|
||||
&& !ecs->handling_longjmp
|
||||
&& ((step_range_end && step_resume_breakpoint == NULL)
|
||||
|| trap_expected))
|
||||
|| ecs->stepping_through_solib_after_catch
|
||||
|| bpstat_should_step ());
|
||||
if (ecs->infwait_state == infwait_normal_state)
|
||||
{
|
||||
overlay_cache_invalid = 1;
|
||||
|
||||
/* We have to invalidate the registers BEFORE calling
|
||||
target_wait because they can be loaded from the target while
|
||||
in target_wait. This makes remote debugging a bit more
|
||||
efficient for those targets that provide critical registers
|
||||
as part of their normal status mechanism. */
|
||||
|
||||
registers_changed ();
|
||||
ecs->waiton_pid = -1;
|
||||
ecs->wp = &(ecs->ws);
|
||||
}
|
||||
/* This is the old end of the while loop. Let everybody know we
|
||||
want to wait for the inferior some more and get called again
|
||||
soon. */
|
||||
ecs->wait_some_more = 1;
|
||||
}
|
||||
|
||||
/* This function returns TRUE if ep is an internal breakpoint
|
||||
|
@ -3100,6 +3163,11 @@ complete_execution (void)
|
|||
cleanup_sigint_signal_handler ();
|
||||
display_gdb_prompt (0);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (exec_done_display_p)
|
||||
printf_unfiltered ("completed.\n");
|
||||
}
|
||||
}
|
||||
|
||||
/* Here to return control to GDB when the inferior stops for real.
|
||||
|
|
|
@ -42,9 +42,6 @@
|
|||
|
||||
/* "wait.h" fills in the gaps left by <wait.h> */
|
||||
#include "wait.h"
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
extern struct symtab_and_line *
|
||||
child_enable_exception_callback PARAMS ((enum exception_event_kind, int));
|
||||
|
|
|
@ -45,9 +45,6 @@
|
|||
#include <sys/ioctl.h>
|
||||
|
||||
#include <sys/ttrace.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <sys/mman.h>
|
||||
|
||||
#ifndef NO_PTRACE_H
|
||||
|
@ -5216,7 +5213,7 @@ child_pid_to_exec_file (tid)
|
|||
hack that DDE uses, of pawing through the process' data
|
||||
segment to find the pathname.
|
||||
*/
|
||||
top_of_stack = 0x7b03a000;
|
||||
top_of_stack = (TARGET_PTR_BIT == 64 ? 0x800003ffff7f0000 : 0x7b03a000);
|
||||
name_index = 0;
|
||||
done = 0;
|
||||
|
||||
|
|
|
@ -23,12 +23,11 @@
|
|||
#if !defined (LANGUAGE_H)
|
||||
#define LANGUAGE_H 1
|
||||
|
||||
#ifdef __STDC__ /* Forward decls for prototypes */
|
||||
/* Forward decls for prototypes */
|
||||
struct value;
|
||||
struct objfile;
|
||||
struct expression;
|
||||
/* enum exp_opcode; ANSI's `wisdom' didn't include forward enum decls. */
|
||||
#endif
|
||||
|
||||
/* This used to be included to configure GDB for one or more specific
|
||||
languages. Now it is shortcutted to configure for all of them. FIXME. */
|
||||
|
|
140
gdb/m32r-stub.c
140
gdb/m32r-stub.c
|
@ -179,7 +179,7 @@ extern void breakpoint(void);
|
|||
|
||||
static int computeSignal(int);
|
||||
static void putpacket(unsigned char *);
|
||||
static void getpacket(unsigned char *);
|
||||
static unsigned char *getpacket(unsigned char *);
|
||||
|
||||
static unsigned char *mem2hex(unsigned char *, unsigned char *, int, int);
|
||||
static unsigned char *hex2mem(unsigned char *, unsigned char *, int, int);
|
||||
|
@ -204,7 +204,7 @@ static int strlen (const unsigned char *);
|
|||
void
|
||||
handle_exception(int exceptionVector)
|
||||
{
|
||||
int sigval;
|
||||
int sigval, stepping;
|
||||
int addr, length, i;
|
||||
unsigned char * ptr;
|
||||
unsigned char buf[16];
|
||||
|
@ -306,15 +306,16 @@ handle_exception(int exceptionVector)
|
|||
|
||||
putpacket(remcomOutBuffer);
|
||||
|
||||
stepping = 0;
|
||||
|
||||
while (1==1) {
|
||||
remcomOutBuffer[0] = 0;
|
||||
getpacket(remcomInBuffer);
|
||||
ptr = getpacket(remcomInBuffer);
|
||||
binary = 0;
|
||||
switch (remcomInBuffer[0]) {
|
||||
switch (*ptr++) {
|
||||
default: /* Unknown code. Return an empty reply message. */
|
||||
break;
|
||||
case 'R':
|
||||
ptr = &remcomInBuffer[1];
|
||||
if (hexToInt (&ptr, &addr))
|
||||
registers[PC] = addr;
|
||||
strcpy(remcomOutBuffer, "OK");
|
||||
|
@ -327,7 +328,6 @@ handle_exception(int exceptionVector)
|
|||
case 'M': /* MAA..AA,LLLL: Write LLLL bytes at address AA.AA return OK */
|
||||
/* TRY TO READ '%x,%x:'. IF SUCCEED, SET PTR = 0 */
|
||||
{
|
||||
ptr = &remcomInBuffer[1];
|
||||
if (hexToInt(&ptr,&addr))
|
||||
if (*(ptr++) == ',')
|
||||
if (hexToInt(&ptr,&length))
|
||||
|
@ -349,14 +349,11 @@ handle_exception(int exceptionVector)
|
|||
if (ptr)
|
||||
{
|
||||
strcpy(remcomOutBuffer,"E02");
|
||||
gdb_error("malformed write memory command: %s",
|
||||
remcomInBuffer);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'm': /* mAA..AA,LLLL Read LLLL bytes at address AA..AA */
|
||||
/* TRY TO READ %x,%x. IF SUCCEED, SET PTR = 0 */
|
||||
ptr = &remcomInBuffer[1];
|
||||
if (hexToInt(&ptr,&addr))
|
||||
if (*(ptr++) == ',')
|
||||
if (hexToInt(&ptr,&length))
|
||||
|
@ -372,8 +369,6 @@ handle_exception(int exceptionVector)
|
|||
if (ptr)
|
||||
{
|
||||
strcpy(remcomOutBuffer,"E01");
|
||||
gdb_error("malformed read memory command: %s",
|
||||
remcomInBuffer);
|
||||
}
|
||||
break;
|
||||
case '?':
|
||||
|
@ -392,7 +387,6 @@ handle_exception(int exceptionVector)
|
|||
{
|
||||
int regno;
|
||||
|
||||
ptr = &remcomInBuffer[1];
|
||||
if (hexToInt (&ptr, ®no) && *ptr++ == '=')
|
||||
if (regno >= 0 && regno < NUMREGS)
|
||||
{
|
||||
|
@ -435,17 +429,17 @@ handle_exception(int exceptionVector)
|
|||
break;
|
||||
}
|
||||
case 'G': /* set the value of the CPU registers - return OK */
|
||||
hex2mem(&remcomInBuffer[1], (unsigned char*) registers, NUMREGBYTES, 0);
|
||||
hex2mem(&ptr, (unsigned char*) registers, NUMREGBYTES, 0);
|
||||
strcpy(remcomOutBuffer,"OK");
|
||||
break;
|
||||
case 's': /* sAA..AA Step one instruction from AA..AA(optional) */
|
||||
stepping = 1;
|
||||
case 'c': /* cAA..AA Continue from address AA..AA(optional) */
|
||||
/* try to read optional parameter, pc unchanged if no parm */
|
||||
ptr = &remcomInBuffer[1];
|
||||
if (hexToInt(&ptr,&addr))
|
||||
registers[ PC ] = addr;
|
||||
|
||||
if (remcomInBuffer[0] == 's') /* single-stepping */
|
||||
if (stepping) /* single-stepping */
|
||||
{
|
||||
if (!prepare_to_step(0)) /* set up for single-step */
|
||||
{
|
||||
|
@ -505,7 +499,6 @@ handle_exception(int exceptionVector)
|
|||
break;
|
||||
#endif
|
||||
case 'q':
|
||||
ptr = &remcomInBuffer[1];
|
||||
if (*ptr++ == 'C' &&
|
||||
*ptr++ == 'R' &&
|
||||
*ptr++ == 'C' &&
|
||||
|
@ -581,65 +574,78 @@ hex(ch)
|
|||
|
||||
/* scan for the sequence $<data>#<checksum> */
|
||||
|
||||
static void
|
||||
getpacket(buffer)
|
||||
unsigned char * buffer;
|
||||
unsigned char *
|
||||
getpacket (buffer)
|
||||
unsigned char *buffer;
|
||||
{
|
||||
unsigned char checksum;
|
||||
unsigned char xmitcsum;
|
||||
int i;
|
||||
int count;
|
||||
unsigned char ch;
|
||||
int count;
|
||||
char ch;
|
||||
|
||||
do {
|
||||
/* wait around for the start character, ignore all other characters */
|
||||
while ((ch = getDebugChar()) != '$');
|
||||
checksum = 0;
|
||||
xmitcsum = -1;
|
||||
while (1)
|
||||
{
|
||||
/* wait around for the start character, ignore all other characters */
|
||||
while ((ch = getDebugChar ()) != '$')
|
||||
;
|
||||
|
||||
count = 0;
|
||||
retry:
|
||||
checksum = 0;
|
||||
xmitcsum = -1;
|
||||
count = 0;
|
||||
|
||||
/* now, read until a # or end of buffer is found */
|
||||
while (count < BUFMAX) {
|
||||
ch = getDebugChar();
|
||||
|
||||
if (ch == '#' && (count == 0 || buffer[count-1] != 0x7d))
|
||||
break;
|
||||
|
||||
checksum = checksum + ch;
|
||||
buffer[count] = ch;
|
||||
count = count + 1;
|
||||
}
|
||||
buffer[count] = 0;
|
||||
|
||||
if (ch == '#') {
|
||||
xmitcsum = hex(getDebugChar()) << 4;
|
||||
xmitcsum += hex(getDebugChar());
|
||||
if (checksum != xmitcsum) {
|
||||
if (remote_debug) {
|
||||
unsigned char buf[16];
|
||||
|
||||
mem2hex((unsigned char *) &checksum, buf, 4, 0);
|
||||
gdb_error("Bad checksum: my count = %s, ", buf);
|
||||
mem2hex((unsigned char *) &xmitcsum, buf, 4, 0);
|
||||
gdb_error("sent count = %s\n", buf);
|
||||
gdb_error(" -- Bad buffer: \"%s\"\n", buffer);
|
||||
}
|
||||
|
||||
putDebugChar('-'); /* failed checksum */
|
||||
} else {
|
||||
putDebugChar('+'); /* successful transfer */
|
||||
/* if a sequence char is present, reply the sequence ID */
|
||||
if (buffer[2] == ':') {
|
||||
putDebugChar( buffer[0] );
|
||||
putDebugChar( buffer[1] );
|
||||
/* remove sequence chars from buffer */
|
||||
count = strlen(buffer);
|
||||
for (i=3; i <= count; i++) buffer[i-3] = buffer[i];
|
||||
/* now, read until a # or end of buffer is found */
|
||||
while (count < BUFMAX)
|
||||
{
|
||||
ch = getDebugChar ();
|
||||
if (ch == '$')
|
||||
goto retry;
|
||||
if (ch == '#')
|
||||
break;
|
||||
checksum = checksum + ch;
|
||||
buffer[count] = ch;
|
||||
count = count + 1;
|
||||
}
|
||||
buffer[count] = 0;
|
||||
|
||||
if (ch == '#')
|
||||
{
|
||||
ch = getDebugChar ();
|
||||
xmitcsum = hex (ch) << 4;
|
||||
ch = getDebugChar ();
|
||||
xmitcsum += hex (ch);
|
||||
|
||||
if (checksum != xmitcsum)
|
||||
{
|
||||
if (remote_debug)
|
||||
{
|
||||
unsigned char buf[16];
|
||||
|
||||
mem2hex((unsigned char *) &checksum, buf, 4, 0);
|
||||
gdb_error("Bad checksum: my count = %s, ", buf);
|
||||
mem2hex((unsigned char *) &xmitcsum, buf, 4, 0);
|
||||
gdb_error("sent count = %s\n", buf);
|
||||
gdb_error(" -- Bad buffer: \"%s\"\n", buffer);
|
||||
}
|
||||
putDebugChar ('-'); /* failed checksum */
|
||||
}
|
||||
else
|
||||
{
|
||||
putDebugChar ('+'); /* successful transfer */
|
||||
|
||||
/* if a sequence char is present, reply the sequence ID */
|
||||
if (buffer[2] == ':')
|
||||
{
|
||||
putDebugChar (buffer[0]);
|
||||
putDebugChar (buffer[1]);
|
||||
|
||||
return &buffer[3];
|
||||
}
|
||||
|
||||
return &buffer[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} while (checksum != xmitcsum);
|
||||
}
|
||||
|
||||
/* send the packet in buffer. */
|
||||
|
|
142
gdb/m68k-stub.c
142
gdb/m68k-stub.c
|
@ -523,57 +523,73 @@ char ch;
|
|||
}
|
||||
|
||||
|
||||
/* scan for the sequence $<data>#<checksum> */
|
||||
void getpacket(buffer)
|
||||
char * buffer;
|
||||
unsigned char *
|
||||
getpacket (unsigned char *buffer)
|
||||
{
|
||||
unsigned char checksum;
|
||||
unsigned char xmitcsum;
|
||||
int i;
|
||||
int count;
|
||||
int count;
|
||||
char ch;
|
||||
|
||||
do {
|
||||
/* wait around for the start character, ignore all other characters */
|
||||
while ((ch = (getDebugChar() & 0x7f)) != '$');
|
||||
checksum = 0;
|
||||
xmitcsum = -1;
|
||||
|
||||
count = 0;
|
||||
|
||||
/* now, read until a # or end of buffer is found */
|
||||
while (count < BUFMAX) {
|
||||
ch = getDebugChar() & 0x7f;
|
||||
if (ch == '#') break;
|
||||
checksum = checksum + ch;
|
||||
buffer[count] = ch;
|
||||
count = count + 1;
|
||||
}
|
||||
buffer[count] = 0;
|
||||
|
||||
if (ch == '#') {
|
||||
xmitcsum = hex(getDebugChar() & 0x7f) << 4;
|
||||
xmitcsum += hex(getDebugChar() & 0x7f);
|
||||
if ((remote_debug ) && (checksum != xmitcsum)) {
|
||||
fprintf (stderr,"bad checksum. My count = 0x%x, sent=0x%x. buf=%s\n",
|
||||
checksum,xmitcsum,buffer);
|
||||
}
|
||||
|
||||
if (checksum != xmitcsum) putDebugChar('-'); /* failed checksum */
|
||||
else {
|
||||
putDebugChar('+'); /* successful transfer */
|
||||
/* if a sequence char is present, reply the sequence ID */
|
||||
if (buffer[2] == ':') {
|
||||
putDebugChar( buffer[0] );
|
||||
putDebugChar( buffer[1] );
|
||||
/* remove sequence chars from buffer */
|
||||
count = strlen(buffer);
|
||||
for (i=3; i <= count; i++) buffer[i-3] = buffer[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
} while (checksum != xmitcsum);
|
||||
|
||||
while (1)
|
||||
{
|
||||
/* wait around for the start character, ignore all other characters */
|
||||
while ((ch = getDebugChar ()) != '$')
|
||||
;
|
||||
|
||||
retry:
|
||||
checksum = 0;
|
||||
xmitcsum = -1;
|
||||
count = 0;
|
||||
|
||||
/* now, read until a # or end of buffer is found */
|
||||
while (count < BUFMAX)
|
||||
{
|
||||
ch = getDebugChar ();
|
||||
if (ch == '$')
|
||||
goto retry;
|
||||
if (ch == '#')
|
||||
break;
|
||||
checksum = checksum + ch;
|
||||
buffer[count] = ch;
|
||||
count = count + 1;
|
||||
}
|
||||
buffer[count] = 0;
|
||||
|
||||
if (ch == '#')
|
||||
{
|
||||
ch = getDebugChar ();
|
||||
xmitcsum = hex (ch) << 4;
|
||||
ch = getDebugChar ();
|
||||
xmitcsum += hex (ch);
|
||||
|
||||
if (checksum != xmitcsum)
|
||||
{
|
||||
if (remote_debug)
|
||||
{
|
||||
fprintf (stderr,
|
||||
"bad checksum. My count = 0x%x, sent=0x%x. buf=%s\n",
|
||||
checksum, xmitcsum, buffer);
|
||||
}
|
||||
putDebugChar ('-'); /* failed checksum */
|
||||
}
|
||||
else
|
||||
{
|
||||
putDebugChar ('+'); /* successful transfer */
|
||||
|
||||
/* if a sequence char is present, reply the sequence ID */
|
||||
if (buffer[2] == ':')
|
||||
{
|
||||
putDebugChar (buffer[0]);
|
||||
putDebugChar (buffer[1]);
|
||||
|
||||
return &buffer[3];
|
||||
}
|
||||
|
||||
return &buffer[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* send the packet in buffer. */
|
||||
|
@ -738,7 +754,7 @@ int hexToInt(char **ptr, int *intValue)
|
|||
*/
|
||||
void handle_exception(int exceptionVector)
|
||||
{
|
||||
int sigval;
|
||||
int sigval, stepping;
|
||||
int addr, length;
|
||||
char * ptr;
|
||||
int newPC;
|
||||
|
@ -758,11 +774,13 @@ void handle_exception(int exceptionVector)
|
|||
|
||||
putpacket(remcomOutBuffer);
|
||||
|
||||
stepping = 0;
|
||||
|
||||
while (1==1) {
|
||||
error = 0;
|
||||
remcomOutBuffer[0] = 0;
|
||||
getpacket(remcomInBuffer);
|
||||
switch (remcomInBuffer[0]) {
|
||||
ptr = getpacket(remcomInBuffer);
|
||||
switch (*ptr++) {
|
||||
case '?' : remcomOutBuffer[0] = 'S';
|
||||
remcomOutBuffer[1] = hexchars[sigval >> 4];
|
||||
remcomOutBuffer[2] = hexchars[sigval % 16];
|
||||
|
@ -774,7 +792,7 @@ void handle_exception(int exceptionVector)
|
|||
mem2hex((char*) registers, remcomOutBuffer, NUMREGBYTES);
|
||||
break;
|
||||
case 'G' : /* set the value of the CPU registers - return OK */
|
||||
hex2mem(&remcomInBuffer[1], (char*) registers, NUMREGBYTES);
|
||||
hex2mem(&ptr, (char*) registers, NUMREGBYTES);
|
||||
strcpy(remcomOutBuffer,"OK");
|
||||
break;
|
||||
|
||||
|
@ -785,7 +803,6 @@ void handle_exception(int exceptionVector)
|
|||
exceptionHandler(2,handle_buserror);
|
||||
|
||||
/* TRY TO READ %x,%x. IF SUCCEED, SET PTR = 0 */
|
||||
ptr = &remcomInBuffer[1];
|
||||
if (hexToInt(&ptr,&addr))
|
||||
if (*(ptr++) == ',')
|
||||
if (hexToInt(&ptr,&length))
|
||||
|
@ -797,14 +814,12 @@ void handle_exception(int exceptionVector)
|
|||
if (ptr)
|
||||
{
|
||||
strcpy(remcomOutBuffer,"E01");
|
||||
debug_error("malformed read memory command: %s",remcomInBuffer);
|
||||
}
|
||||
}
|
||||
else {
|
||||
}
|
||||
} else {
|
||||
exceptionHandler(2,_catchException);
|
||||
strcpy(remcomOutBuffer,"E03");
|
||||
debug_error("bus error");
|
||||
}
|
||||
}
|
||||
|
||||
/* restore handler for bus error */
|
||||
exceptionHandler(2,_catchException);
|
||||
|
@ -816,7 +831,6 @@ void handle_exception(int exceptionVector)
|
|||
exceptionHandler(2,handle_buserror);
|
||||
|
||||
/* TRY TO READ '%x,%x:'. IF SUCCEED, SET PTR = 0 */
|
||||
ptr = &remcomInBuffer[1];
|
||||
if (hexToInt(&ptr,&addr))
|
||||
if (*(ptr++) == ',')
|
||||
if (hexToInt(&ptr,&length))
|
||||
|
@ -829,14 +843,12 @@ void handle_exception(int exceptionVector)
|
|||
if (ptr)
|
||||
{
|
||||
strcpy(remcomOutBuffer,"E02");
|
||||
debug_error("malformed write memory command: %s",remcomInBuffer);
|
||||
}
|
||||
}
|
||||
else {
|
||||
}
|
||||
} else {
|
||||
exceptionHandler(2,_catchException);
|
||||
strcpy(remcomOutBuffer,"E03");
|
||||
debug_error("bus error");
|
||||
}
|
||||
}
|
||||
|
||||
/* restore handler for bus error */
|
||||
exceptionHandler(2,_catchException);
|
||||
|
@ -844,10 +856,10 @@ void handle_exception(int exceptionVector)
|
|||
|
||||
/* cAA..AA Continue at address AA..AA(optional) */
|
||||
/* sAA..AA Step one instruction from AA..AA(optional) */
|
||||
case 'c' :
|
||||
case 's' :
|
||||
stepping = 1;
|
||||
case 'c' :
|
||||
/* try to read optional parameter, pc unchanged if no parm */
|
||||
ptr = &remcomInBuffer[1];
|
||||
if (hexToInt(&ptr,&addr))
|
||||
registers[ PC ] = addr;
|
||||
|
||||
|
@ -857,7 +869,7 @@ void handle_exception(int exceptionVector)
|
|||
registers[ PS ] &= 0x7fff;
|
||||
|
||||
/* set the trace bit if we're stepping */
|
||||
if (remcomInBuffer[0] == 's') registers[ PS ] |= 0x8000;
|
||||
if (stepping) registers[ PS ] |= 0x8000;
|
||||
|
||||
/*
|
||||
* look for newPC in the linked list of exception frames.
|
||||
|
|
84
gdb/main.c
84
gdb/main.c
|
@ -24,9 +24,6 @@
|
|||
#include "target.h"
|
||||
#include "inferior.h"
|
||||
#include "call-cmds.h"
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include "getopt.h"
|
||||
|
||||
|
@ -715,84 +712,3 @@ GDB manual (available as on-line info or a printed manual).\n\
|
|||
Report bugs to \"bug-gdb@prep.ai.mit.edu\".\
|
||||
", stream);
|
||||
}
|
||||
|
||||
|
||||
/* All TUI I/O sent to the *_filtered and *_unfiltered functions
|
||||
eventually ends up here. The fputs_unfiltered_hook is primarily
|
||||
used by GUIs to collect all output and send it to the GUI, instead
|
||||
of the controlling terminal. Only output to gdb_stdout and
|
||||
gdb_stderr are sent to the hook. Everything else is sent on to
|
||||
fputs to allow file I/O to be handled appropriately. */
|
||||
|
||||
/* FIXME: Should be broken up and moved to a TUI specific file. */
|
||||
|
||||
void
|
||||
tui_file_fputs (linebuffer, file)
|
||||
const char *linebuffer;
|
||||
GDB_FILE *file;
|
||||
{
|
||||
struct tui_stream *stream = gdb_file_data (file);
|
||||
#if defined(TUI)
|
||||
extern int tui_owns_terminal;
|
||||
#endif
|
||||
/* If anything (GUI, TUI) wants to capture GDB output, this is
|
||||
* the place... the way to do it is to set up
|
||||
* fputs_unfiltered_hook.
|
||||
* Our TUI ("gdb -tui") used to hook output, but in the
|
||||
* new (XDB style) scheme, we do not do that anymore... - RT
|
||||
*/
|
||||
if (fputs_unfiltered_hook
|
||||
&& (file == gdb_stdout
|
||||
|| file == gdb_stderr))
|
||||
fputs_unfiltered_hook (linebuffer, file);
|
||||
else
|
||||
{
|
||||
#if defined(TUI)
|
||||
if (tui_version && tui_owns_terminal)
|
||||
{
|
||||
/* If we get here somehow while updating the TUI (from
|
||||
* within a tuiDo(), then we need to temporarily
|
||||
* set up the terminal for GDB output. This probably just
|
||||
* happens on error output.
|
||||
*/
|
||||
|
||||
if (stream->ts_streamtype == astring)
|
||||
{
|
||||
gdb_file_adjust_strbuf (strlen (linebuffer), stream);
|
||||
strcat (stream->ts_strbuf, linebuffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
tuiTermUnsetup (0, (tui_version) ? cmdWin->detail.commandInfo.curch : 0);
|
||||
fputs (linebuffer, stream->ts_filestream);
|
||||
tuiTermSetup (0);
|
||||
if (linebuffer[strlen (linebuffer) - 1] == '\n')
|
||||
tuiClearCommandCharCount ();
|
||||
else
|
||||
tuiIncrCommandCharCountBy (strlen (linebuffer));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* The normal case - just do a fputs() */
|
||||
if (stream->ts_streamtype == astring)
|
||||
{
|
||||
gdb_file_adjust_strbuf (strlen (linebuffer), stream);
|
||||
strcat (stream->ts_strbuf, linebuffer);
|
||||
}
|
||||
else
|
||||
fputs (linebuffer, stream->ts_filestream);
|
||||
}
|
||||
|
||||
|
||||
#else
|
||||
if (stream->ts_streamtype == astring)
|
||||
{
|
||||
gdb_file_adjust_strbuf (strlen (linebuffer), file);
|
||||
strcat (stream->ts_strbuf, linebuffer);
|
||||
}
|
||||
else
|
||||
fputs (linebuffer, stream->ts_filestream);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,10 +35,6 @@
|
|||
#include "objfiles.h"
|
||||
#include "value.h"
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
extern void _initialize_maint_cmds PARAMS ((void));
|
||||
|
||||
static void maintenance_command PARAMS ((char *, int));
|
||||
|
|
|
@ -19,11 +19,9 @@
|
|||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* Forward decl's for prototypes */
|
||||
#ifdef __STDC__
|
||||
struct target_ops;
|
||||
struct objfile;
|
||||
struct section_offsets;
|
||||
#endif
|
||||
|
||||
/* Called to add symbols from a shared library to gdb's symbol table. */
|
||||
|
||||
|
|
|
@ -46,7 +46,6 @@
|
|||
#include "gdb_string.h"
|
||||
#include <stropts.h>
|
||||
#include <poll.h>
|
||||
#include <unistd.h>
|
||||
#include "gdb_stat.h"
|
||||
|
||||
#include "inferior.h"
|
||||
|
|
|
@ -47,11 +47,11 @@
|
|||
#include "symfile.h"
|
||||
#include "remote-utils.h"
|
||||
#include "gdb_string.h"
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include "gdbcore.h"
|
||||
|
||||
#ifdef HAVE_TIME_H
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
||||
extern struct target_ops remote_rdp_ops;
|
||||
static serial_t io;
|
||||
|
|
|
@ -196,9 +196,7 @@ void remote_console_output PARAMS ((char *));
|
|||
|
||||
static void check_binary_download PARAMS ((CORE_ADDR addr));
|
||||
|
||||
#if __STDC__
|
||||
struct packet_config;
|
||||
#endif
|
||||
|
||||
static void show_packet_config_cmd PARAMS ((struct packet_config * config));
|
||||
|
||||
|
|
|
@ -22,9 +22,8 @@
|
|||
#define SCM_CODE(x) SCM_CAR(SCM_CLOSCAR (x))
|
||||
#define SCM_MAKINUM(x) (((x)<<2)+2L)
|
||||
|
||||
#ifdef __STDC__ /* Forward decls for prototypes */
|
||||
/* Forward decls for prototypes */
|
||||
struct value;
|
||||
#endif
|
||||
|
||||
extern int scm_value_print PARAMS ((struct value *, GDB_FILE *,
|
||||
int, enum val_prettyprint));
|
||||
|
|
|
@ -29,9 +29,6 @@
|
|||
#include <sys/socket.h>
|
||||
#include <sys/time.h>
|
||||
#include <fcntl.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include "signals.h"
|
||||
#include "gdb_string.h"
|
||||
|
|
|
@ -26,9 +26,6 @@
|
|||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
#include <sys/socket.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CYGWIN32__
|
||||
#include <netinet/tcp.h>
|
||||
|
|
|
@ -23,9 +23,6 @@
|
|||
#include <fcntl.h>
|
||||
#include <sys/types.h>
|
||||
#include "terminal.h"
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_TERMIOS
|
||||
|
||||
|
|
|
@ -199,7 +199,7 @@ static int hex (char);
|
|||
static char *mem2hex (char *, char *, int);
|
||||
static char *hex2mem (char *, char *, int);
|
||||
static int hexToInt (char **, int *);
|
||||
static void getpacket (char *);
|
||||
static unsigned char *getpacket (unsigned char *);
|
||||
static void putpacket (char *);
|
||||
static void handle_buserror (void);
|
||||
static int computeSignal (int exceptionVector);
|
||||
|
@ -382,28 +382,32 @@ hexToInt (char **ptr, int *intValue)
|
|||
|
||||
/* scan for the sequence $<data>#<checksum> */
|
||||
|
||||
static
|
||||
void
|
||||
getpacket (char *buffer)
|
||||
char *
|
||||
getpacket (buffer)
|
||||
char *buffer;
|
||||
{
|
||||
unsigned char checksum;
|
||||
unsigned char xmitcsum;
|
||||
int i;
|
||||
int count;
|
||||
char ch;
|
||||
do
|
||||
|
||||
while (1)
|
||||
{
|
||||
/* wait around for the start character, ignore all other characters */
|
||||
while ((ch = getDebugChar ()) != '$');
|
||||
while ((ch = getDebugChar ()) != '$')
|
||||
;
|
||||
|
||||
retry:
|
||||
checksum = 0;
|
||||
xmitcsum = -1;
|
||||
|
||||
count = 0;
|
||||
|
||||
/* now, read until a # or end of buffer is found */
|
||||
while (count < BUFMAX)
|
||||
{
|
||||
ch = getDebugChar ();
|
||||
if (ch == '$')
|
||||
goto retry;
|
||||
if (ch == '#')
|
||||
break;
|
||||
checksum = checksum + ch;
|
||||
|
@ -414,28 +418,32 @@ getpacket (char *buffer)
|
|||
|
||||
if (ch == '#')
|
||||
{
|
||||
xmitcsum = hex (getDebugChar ()) << 4;
|
||||
xmitcsum += hex (getDebugChar ());
|
||||
ch = getDebugChar ();
|
||||
xmitcsum = hex (ch) << 4;
|
||||
ch = getDebugChar ();
|
||||
xmitcsum += hex (ch);
|
||||
|
||||
if (checksum != xmitcsum)
|
||||
putDebugChar ('-'); /* failed checksum */
|
||||
{
|
||||
putDebugChar ('-'); /* failed checksum */
|
||||
}
|
||||
else
|
||||
{
|
||||
putDebugChar ('+'); /* successful transfer */
|
||||
|
||||
/* if a sequence char is present, reply the sequence ID */
|
||||
if (buffer[2] == ':')
|
||||
{
|
||||
putDebugChar (buffer[0]);
|
||||
putDebugChar (buffer[1]);
|
||||
/* remove sequence chars from buffer */
|
||||
count = strlen (buffer);
|
||||
for (i = 3; i <= count; i++)
|
||||
buffer[i - 3] = buffer[i];
|
||||
|
||||
return &buffer[3];
|
||||
}
|
||||
|
||||
return &buffer[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
while (checksum != xmitcsum);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -492,7 +500,6 @@ putpacket (register char *buffer)
|
|||
putDebugChar (lowhex(checksum));
|
||||
}
|
||||
while (getDebugChar() != '+');
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -648,7 +655,7 @@ When in the monitor mode we talk a human on the serial line rather than gdb.
|
|||
void
|
||||
gdb_handle_exception (int exceptionVector)
|
||||
{
|
||||
int sigval;
|
||||
int sigval, stepping;
|
||||
int addr, length;
|
||||
char *ptr;
|
||||
|
||||
|
@ -677,12 +684,14 @@ gdb_handle_exception (int exceptionVector)
|
|||
*/
|
||||
undoSStep ();
|
||||
|
||||
stepping = 0;
|
||||
|
||||
while (1)
|
||||
{
|
||||
remcomOutBuffer[0] = 0;
|
||||
getpacket (remcomInBuffer);
|
||||
ptr = getpacket (remcomInBuffer);
|
||||
|
||||
switch (remcomInBuffer[0])
|
||||
switch (*ptr++)
|
||||
{
|
||||
case '?':
|
||||
remcomOutBuffer[0] = 'S';
|
||||
|
@ -697,7 +706,7 @@ gdb_handle_exception (int exceptionVector)
|
|||
mem2hex ((char *) registers, remcomOutBuffer, NUMREGBYTES);
|
||||
break;
|
||||
case 'G': /* set the value of the CPU registers - return OK */
|
||||
hex2mem (&remcomInBuffer[1], (char *) registers, NUMREGBYTES);
|
||||
hex2mem (&ptr, (char *) registers, NUMREGBYTES);
|
||||
strcpy (remcomOutBuffer, "OK");
|
||||
break;
|
||||
|
||||
|
@ -707,7 +716,6 @@ gdb_handle_exception (int exceptionVector)
|
|||
{
|
||||
dofault = 0;
|
||||
/* TRY, TO READ %x,%x. IF SUCCEED, SET PTR = 0 */
|
||||
ptr = &remcomInBuffer[1];
|
||||
if (hexToInt (&ptr, &addr))
|
||||
if (*(ptr++) == ',')
|
||||
if (hexToInt (&ptr, &length))
|
||||
|
@ -732,7 +740,6 @@ gdb_handle_exception (int exceptionVector)
|
|||
dofault = 0;
|
||||
|
||||
/* TRY, TO READ '%x,%x:'. IF SUCCEED, SET PTR = 0 */
|
||||
ptr = &remcomInBuffer[1];
|
||||
if (hexToInt (&ptr, &addr))
|
||||
if (*(ptr++) == ',')
|
||||
if (hexToInt (&ptr, &length))
|
||||
|
@ -754,15 +761,15 @@ gdb_handle_exception (int exceptionVector)
|
|||
|
||||
/* cAA..AA Continue at address AA..AA(optional) */
|
||||
/* sAA..AA Step one instruction from AA..AA(optional) */
|
||||
case 'c':
|
||||
case 's':
|
||||
stepping = 1;
|
||||
case 'c':
|
||||
{
|
||||
/* tRY, to read optional parameter, pc unchanged if no parm */
|
||||
ptr = &remcomInBuffer[1];
|
||||
if (hexToInt (&ptr, &addr))
|
||||
registers[PC] = addr;
|
||||
|
||||
if (remcomInBuffer[0] == 's')
|
||||
if (stepping)
|
||||
doSStep ();
|
||||
}
|
||||
return;
|
||||
|
|
|
@ -54,7 +54,6 @@
|
|||
#include "target.h"
|
||||
#include "inferior.h"
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <dlfcn.h>
|
||||
#include "gdbcmd.h"
|
||||
|
|
77
gdb/solib.c
77
gdb/solib.c
|
@ -31,7 +31,6 @@
|
|||
#include "gdb_string.h"
|
||||
#include <sys/param.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#ifndef SVR4_SHARED_LIBS
|
||||
/* SunOS shared libs need the nlist structure. */
|
||||
|
@ -888,6 +887,70 @@ first_link_map_member ()
|
|||
return (lm);
|
||||
}
|
||||
|
||||
#ifdef SVR4_SHARED_LIBS
|
||||
/*
|
||||
|
||||
LOCAL FUNCTION
|
||||
|
||||
open_exec_file_object
|
||||
|
||||
SYNOPSIS
|
||||
|
||||
void open_symbol_file_object (int from_tty)
|
||||
|
||||
DESCRIPTION
|
||||
|
||||
If no open symbol file, attempt to locate and open the main symbol
|
||||
file. On SVR4 systems, this is the first link map entry. If its
|
||||
name is here, we can open it. Useful when attaching to a process
|
||||
without first loading its symbol file.
|
||||
|
||||
*/
|
||||
|
||||
int
|
||||
open_symbol_file_object (arg)
|
||||
PTR arg;
|
||||
{
|
||||
int from_tty = (int) arg; /* sneak past catch_errors */
|
||||
struct link_map *lm, lmcopy;
|
||||
char *filename;
|
||||
int errcode;
|
||||
|
||||
if (symfile_objfile)
|
||||
if (!query ("Attempt to reload symbols from process? "))
|
||||
return 0;
|
||||
|
||||
if ((debug_base = locate_base ()) == 0)
|
||||
return 0; /* failed somehow... */
|
||||
|
||||
/* First link map member should be the executable. */
|
||||
if ((lm = first_link_map_member ()) == NULL)
|
||||
return 0; /* failed somehow... */
|
||||
|
||||
/* Read from target memory to GDB. */
|
||||
read_memory ((CORE_ADDR) lm, (void *) &lmcopy, sizeof (lmcopy));
|
||||
|
||||
if (lmcopy.l_name == 0)
|
||||
return 0; /* no filename. */
|
||||
|
||||
/* Now fetch the filename from target memory. */
|
||||
target_read_string ((CORE_ADDR) lmcopy.l_name, &filename,
|
||||
MAX_PATH_SIZE - 1, &errcode);
|
||||
if (errcode)
|
||||
{
|
||||
warning ("failed to read exec filename from attached file: %s",
|
||||
safe_strerror (errcode));
|
||||
return 0;
|
||||
}
|
||||
|
||||
make_cleanup ((make_cleanup_func) free, (void *) filename);
|
||||
/* Have a pathname: read the symbol file. */
|
||||
symbol_file_command (filename, from_tty);
|
||||
|
||||
return 1;
|
||||
}
|
||||
#endif /* SVR4_SHARED_LIBS */
|
||||
|
||||
/*
|
||||
|
||||
LOCAL FUNCTION
|
||||
|
@ -1099,6 +1162,18 @@ solib_add (arg_string, from_tty, target)
|
|||
int count;
|
||||
int old;
|
||||
|
||||
#ifdef SVR4_SHARED_LIBS
|
||||
/* If we are attaching to a running process for which we
|
||||
have not opened a symbol file, we may be able to get its
|
||||
symbols now! */
|
||||
if (attach_flag &&
|
||||
symfile_objfile == NULL)
|
||||
catch_errors (open_symbol_file_object, (PTR) from_tty,
|
||||
"Error reading attached process's symbol file.\n",
|
||||
RETURN_MASK_ALL);
|
||||
|
||||
#endif SVR4_SHARED_LIBS
|
||||
|
||||
if ((re_err = re_comp (arg_string ? arg_string : ".")) != NULL)
|
||||
{
|
||||
error ("Invalid regexp: %s", re_err);
|
||||
|
|
|
@ -18,9 +18,8 @@
|
|||
Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef __STDC__ /* Forward decl's for prototypes */
|
||||
/* Forward decl's for prototypes */
|
||||
struct target_ops;
|
||||
#endif
|
||||
|
||||
/* Called when we free all symtabs, to free the shared library information
|
||||
as well. */
|
||||
|
|
|
@ -21,11 +21,10 @@
|
|||
Written by the Center for Software Science at the Univerity of Utah
|
||||
and by Cygnus Support. */
|
||||
|
||||
#ifdef __STDC__ /* Forward decl's for prototypes */
|
||||
/* Forward decl's for prototypes */
|
||||
struct target_ops;
|
||||
struct objfile;
|
||||
struct section_offsets;
|
||||
#endif
|
||||
|
||||
/* Called to add symbols from a shared library to gdb's symbol table. */
|
||||
|
||||
|
|
|
@ -31,9 +31,6 @@
|
|||
#include "gdb_string.h"
|
||||
#include "gdb_stat.h"
|
||||
#include <fcntl.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include "gdbcore.h"
|
||||
#include "gnu-regex.h"
|
||||
#include "symfile.h"
|
||||
|
|
|
@ -286,70 +286,68 @@ hex(ch)
|
|||
|
||||
/* scan for the sequence $<data>#<checksum> */
|
||||
|
||||
static void
|
||||
getpacket(buffer)
|
||||
char *buffer;
|
||||
unsigned char *
|
||||
getpacket (buffer)
|
||||
unsigned char *buffer;
|
||||
{
|
||||
unsigned char checksum;
|
||||
unsigned char xmitcsum;
|
||||
int i;
|
||||
int count;
|
||||
unsigned char ch;
|
||||
char ch;
|
||||
|
||||
do
|
||||
while (1)
|
||||
{
|
||||
/* wait around for the start character, ignore all other characters */
|
||||
while ((ch = (getDebugChar() & 0x7f)) != '$') ;
|
||||
while ((ch = getDebugChar ()) != '$')
|
||||
;
|
||||
|
||||
retry:
|
||||
checksum = 0;
|
||||
xmitcsum = -1;
|
||||
|
||||
count = 0;
|
||||
|
||||
/* now, read until a # or end of buffer is found */
|
||||
while (count < BUFMAX)
|
||||
{
|
||||
ch = getDebugChar() & 0x7f;
|
||||
ch = getDebugChar ();
|
||||
if (ch == '$')
|
||||
goto retry;
|
||||
if (ch == '#')
|
||||
break;
|
||||
checksum = checksum + ch;
|
||||
buffer[count] = ch;
|
||||
count = count + 1;
|
||||
}
|
||||
|
||||
if (count >= BUFMAX)
|
||||
continue;
|
||||
|
||||
buffer[count] = 0;
|
||||
|
||||
if (ch == '#')
|
||||
{
|
||||
xmitcsum = hex(getDebugChar() & 0x7f) << 4;
|
||||
xmitcsum |= hex(getDebugChar() & 0x7f);
|
||||
#if 0
|
||||
/* Humans shouldn't have to figure out checksums to type to it. */
|
||||
putDebugChar ('+');
|
||||
return;
|
||||
#endif
|
||||
ch = getDebugChar ();
|
||||
xmitcsum = hex (ch) << 4;
|
||||
ch = getDebugChar ();
|
||||
xmitcsum += hex (ch);
|
||||
|
||||
if (checksum != xmitcsum)
|
||||
putDebugChar('-'); /* failed checksum */
|
||||
{
|
||||
putDebugChar ('-'); /* failed checksum */
|
||||
}
|
||||
else
|
||||
{
|
||||
putDebugChar('+'); /* successful transfer */
|
||||
putDebugChar ('+'); /* successful transfer */
|
||||
|
||||
/* if a sequence char is present, reply the sequence ID */
|
||||
if (buffer[2] == ':')
|
||||
{
|
||||
putDebugChar(buffer[0]);
|
||||
putDebugChar(buffer[1]);
|
||||
/* remove sequence chars from buffer */
|
||||
count = strlen(buffer);
|
||||
for (i=3; i <= count; i++)
|
||||
buffer[i-3] = buffer[i];
|
||||
putDebugChar (buffer[0]);
|
||||
putDebugChar (buffer[1]);
|
||||
|
||||
return &buffer[3];
|
||||
}
|
||||
|
||||
return &buffer[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
while (checksum != xmitcsum);
|
||||
}
|
||||
|
||||
/* send the packet in buffer. */
|
||||
|
@ -381,7 +379,7 @@ putpacket(buffer)
|
|||
putDebugChar(hexchars[checksum & 0xf]);
|
||||
|
||||
}
|
||||
while ((getDebugChar() & 0x7f) != '+');
|
||||
while (getDebugChar() != '+');
|
||||
}
|
||||
|
||||
static char remcomInBuffer[BUFMAX];
|
||||
|
@ -655,8 +653,8 @@ handle_exception (registers)
|
|||
{
|
||||
remcomOutBuffer[0] = 0;
|
||||
|
||||
getpacket(remcomInBuffer);
|
||||
switch (remcomInBuffer[0])
|
||||
ptr = getpacket(remcomInBuffer);
|
||||
switch (*ptr++)
|
||||
{
|
||||
case '?':
|
||||
remcomOutBuffer[0] = 'S';
|
||||
|
@ -665,8 +663,7 @@ handle_exception (registers)
|
|||
remcomOutBuffer[3] = 0;
|
||||
break;
|
||||
|
||||
case 'd':
|
||||
/* toggle debug flag */
|
||||
case 'd': /* toggle debug flag */
|
||||
break;
|
||||
|
||||
case 'g': /* return the value of the CPU registers */
|
||||
|
@ -688,7 +685,6 @@ handle_exception (registers)
|
|||
|
||||
psr = registers[PSR];
|
||||
|
||||
ptr = &remcomInBuffer[1];
|
||||
hex2mem(ptr, (char *)registers, 16 * 4, 0); /* G & O regs */
|
||||
hex2mem(ptr + 16 * 4 * 2, sp + 0, 16 * 4, 0); /* L & I regs */
|
||||
hex2mem(ptr + 64 * 4 * 2, (char *)®isters[Y],
|
||||
|
@ -714,8 +710,6 @@ handle_exception (registers)
|
|||
case 'm': /* mAA..AA,LLLL Read LLLL bytes at address AA..AA */
|
||||
/* Try to read %x,%x. */
|
||||
|
||||
ptr = &remcomInBuffer[1];
|
||||
|
||||
if (hexToInt(&ptr, &addr)
|
||||
&& *ptr++ == ','
|
||||
&& hexToInt(&ptr, &length))
|
||||
|
@ -732,8 +726,6 @@ handle_exception (registers)
|
|||
case 'M': /* MAA..AA,LLLL: Write LLLL bytes at address AA.AA return OK */
|
||||
/* Try to read '%x,%x:'. */
|
||||
|
||||
ptr = &remcomInBuffer[1];
|
||||
|
||||
if (hexToInt(&ptr, &addr)
|
||||
&& *ptr++ == ','
|
||||
&& hexToInt(&ptr, &length)
|
||||
|
@ -751,7 +743,6 @@ handle_exception (registers)
|
|||
case 'c': /* cAA..AA Continue at address AA..AA(optional) */
|
||||
/* try to read optional parameter, pc unchanged if no parm */
|
||||
|
||||
ptr = &remcomInBuffer[1];
|
||||
if (hexToInt(&ptr, &addr))
|
||||
{
|
||||
registers[PC] = addr;
|
||||
|
@ -787,7 +778,6 @@ Disabled until we can unscrew this properly
|
|||
int baudrate;
|
||||
extern void set_timer_3();
|
||||
|
||||
ptr = &remcomInBuffer[1];
|
||||
if (!hexToInt(&ptr, &baudrate))
|
||||
{
|
||||
strcpy(remcomOutBuffer,"B01");
|
||||
|
|
|
@ -136,16 +136,6 @@ extern void trap_low();
|
|||
nasty interactions between app code and the stub (for instance if user steps
|
||||
into strlen, etc..) */
|
||||
|
||||
static int
|
||||
strlen (const char *s)
|
||||
{
|
||||
const char *s1 = s;
|
||||
|
||||
while (*s1++ != '\000');
|
||||
|
||||
return s1 - s;
|
||||
}
|
||||
|
||||
static char *
|
||||
strcpy (char *dst, const char *src)
|
||||
{
|
||||
|
@ -392,70 +382,68 @@ hex(ch)
|
|||
|
||||
/* scan for the sequence $<data>#<checksum> */
|
||||
|
||||
static void
|
||||
getpacket(buffer)
|
||||
char *buffer;
|
||||
unsigned char *
|
||||
getpacket (buffer)
|
||||
unsigned char *buffer;
|
||||
{
|
||||
unsigned char checksum;
|
||||
unsigned char xmitcsum;
|
||||
int i;
|
||||
int count;
|
||||
unsigned char ch;
|
||||
char ch;
|
||||
|
||||
do
|
||||
while (1)
|
||||
{
|
||||
/* wait around for the start character, ignore all other characters */
|
||||
while ((ch = (getDebugChar() & 0x7f)) != '$') ;
|
||||
while ((ch = getDebugChar ()) != '$')
|
||||
;
|
||||
|
||||
retry:
|
||||
checksum = 0;
|
||||
xmitcsum = -1;
|
||||
|
||||
count = 0;
|
||||
|
||||
/* now, read until a # or end of buffer is found */
|
||||
while (count < BUFMAX)
|
||||
{
|
||||
ch = getDebugChar() & 0x7f;
|
||||
ch = getDebugChar ();
|
||||
if (ch == '$')
|
||||
goto retry;
|
||||
if (ch == '#')
|
||||
break;
|
||||
checksum = checksum + ch;
|
||||
buffer[count] = ch;
|
||||
count = count + 1;
|
||||
}
|
||||
|
||||
if (count >= BUFMAX)
|
||||
continue;
|
||||
|
||||
buffer[count] = 0;
|
||||
|
||||
if (ch == '#')
|
||||
{
|
||||
xmitcsum = hex(getDebugChar() & 0x7f) << 4;
|
||||
xmitcsum |= hex(getDebugChar() & 0x7f);
|
||||
#if 0
|
||||
/* Humans shouldn't have to figure out checksums to type to it. */
|
||||
putDebugChar ('+');
|
||||
return;
|
||||
#endif
|
||||
ch = getDebugChar ();
|
||||
xmitcsum = hex (ch) << 4;
|
||||
ch = getDebugChar ();
|
||||
xmitcsum += hex (ch);
|
||||
|
||||
if (checksum != xmitcsum)
|
||||
putDebugChar('-'); /* failed checksum */
|
||||
{
|
||||
putDebugChar ('-'); /* failed checksum */
|
||||
}
|
||||
else
|
||||
{
|
||||
putDebugChar('+'); /* successful transfer */
|
||||
putDebugChar ('+'); /* successful transfer */
|
||||
|
||||
/* if a sequence char is present, reply the sequence ID */
|
||||
if (buffer[2] == ':')
|
||||
{
|
||||
putDebugChar(buffer[0]);
|
||||
putDebugChar(buffer[1]);
|
||||
/* remove sequence chars from buffer */
|
||||
count = strlen(buffer);
|
||||
for (i=3; i <= count; i++)
|
||||
buffer[i-3] = buffer[i];
|
||||
putDebugChar (buffer[0]);
|
||||
putDebugChar (buffer[1]);
|
||||
|
||||
return &buffer[3];
|
||||
}
|
||||
|
||||
return &buffer[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
while (checksum != xmitcsum);
|
||||
}
|
||||
|
||||
/* send the packet in buffer. */
|
||||
|
@ -487,7 +475,7 @@ putpacket(buffer)
|
|||
putDebugChar(hexchars[checksum & 0xf]);
|
||||
|
||||
}
|
||||
while ((getDebugChar() & 0x7f) != '+');
|
||||
while (getDebugChar() != '+');
|
||||
}
|
||||
|
||||
static char remcomInBuffer[BUFMAX];
|
||||
|
@ -808,8 +796,8 @@ handle_exception (registers)
|
|||
{
|
||||
remcomOutBuffer[0] = 0;
|
||||
|
||||
getpacket(remcomInBuffer);
|
||||
switch (remcomInBuffer[0])
|
||||
ptr = getpacket(remcomInBuffer);
|
||||
switch (*ptr++)
|
||||
{
|
||||
case '?':
|
||||
remcomOutBuffer[0] = 'S';
|
||||
|
@ -834,9 +822,7 @@ handle_exception (registers)
|
|||
|
||||
psr = registers[PSR];
|
||||
|
||||
ptr = &remcomInBuffer[1];
|
||||
|
||||
if (remcomInBuffer[0] == 'P')
|
||||
if (ptr[-1] == 'P')
|
||||
{
|
||||
int regno;
|
||||
|
||||
|
@ -878,8 +864,6 @@ handle_exception (registers)
|
|||
case 'm': /* mAA..AA,LLLL Read LLLL bytes at address AA..AA */
|
||||
/* Try to read %x,%x. */
|
||||
|
||||
ptr = &remcomInBuffer[1];
|
||||
|
||||
if (hexToInt(&ptr, &addr)
|
||||
&& *ptr++ == ','
|
||||
&& hexToInt(&ptr, &length))
|
||||
|
@ -896,8 +880,6 @@ handle_exception (registers)
|
|||
case 'M': /* MAA..AA,LLLL: Write LLLL bytes at address AA.AA return OK */
|
||||
/* Try to read '%x,%x:'. */
|
||||
|
||||
ptr = &remcomInBuffer[1];
|
||||
|
||||
if (hexToInt(&ptr, &addr)
|
||||
&& *ptr++ == ','
|
||||
&& hexToInt(&ptr, &length)
|
||||
|
@ -914,8 +896,6 @@ handle_exception (registers)
|
|||
|
||||
case 'c': /* cAA..AA Continue at address AA..AA(optional) */
|
||||
/* try to read optional parameter, pc unchanged if no parm */
|
||||
|
||||
ptr = &remcomInBuffer[1];
|
||||
if (hexToInt(&ptr, &addr))
|
||||
{
|
||||
registers[PC] = addr;
|
||||
|
@ -965,7 +945,6 @@ Disabled until we can unscrew this properly
|
|||
int baudrate;
|
||||
extern void set_timer_3();
|
||||
|
||||
ptr = &remcomInBuffer[1];
|
||||
if (!hexToInt(&ptr, &baudrate))
|
||||
{
|
||||
strcpy(remcomOutBuffer,"B01");
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
#if (!defined(__GO32__) && !defined(_WIN32)) || defined(__CYGWIN32__)
|
||||
#define HAVE_SOCKETS
|
||||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netdb.h>
|
||||
|
|
|
@ -452,67 +452,68 @@ hex(ch)
|
|||
|
||||
/* scan for the sequence $<data>#<checksum> */
|
||||
|
||||
static void
|
||||
getpacket(buffer)
|
||||
char *buffer;
|
||||
unsigned char *
|
||||
getpacket (buffer)
|
||||
unsigned char *buffer;
|
||||
{
|
||||
unsigned char checksum;
|
||||
unsigned char xmitcsum;
|
||||
int i;
|
||||
int count;
|
||||
unsigned char ch;
|
||||
char ch;
|
||||
|
||||
do
|
||||
while (1)
|
||||
{
|
||||
/* wait around for the start character, ignore all other characters */
|
||||
while ((ch = (getDebugChar() & 0x7f)) != '$')
|
||||
while ((ch = getDebugChar ()) != '$')
|
||||
;
|
||||
|
||||
retry:
|
||||
checksum = 0;
|
||||
xmitcsum = -1;
|
||||
|
||||
count = 0;
|
||||
|
||||
/* now, read until a # or end of buffer is found */
|
||||
while (count < BUFMAX)
|
||||
{
|
||||
ch = getDebugChar() & 0x7f;
|
||||
ch = getDebugChar ();
|
||||
if (ch == '$')
|
||||
goto retry;
|
||||
if (ch == '#')
|
||||
break;
|
||||
checksum = checksum + ch;
|
||||
buffer[count] = ch;
|
||||
count = count + 1;
|
||||
}
|
||||
|
||||
if (count >= BUFMAX)
|
||||
continue;
|
||||
|
||||
buffer[count] = 0;
|
||||
|
||||
if (ch == '#')
|
||||
{
|
||||
xmitcsum = hex(ch = getDebugChar() & 0x7f) << 4;
|
||||
xmitcsum |= hex(ch = getDebugChar() & 0x7f);
|
||||
ch = getDebugChar ();
|
||||
xmitcsum = hex (ch) << 4;
|
||||
ch = getDebugChar ();
|
||||
xmitcsum += hex (ch);
|
||||
|
||||
if (checksum != xmitcsum)
|
||||
putDebugChar('-'); /* failed checksum */
|
||||
{
|
||||
putDebugChar ('-'); /* failed checksum */
|
||||
}
|
||||
else
|
||||
{
|
||||
putDebugChar('+'); /* successful transfer */
|
||||
putDebugChar ('+'); /* successful transfer */
|
||||
|
||||
/* if a sequence char is present, reply the sequence ID */
|
||||
if (buffer[2] == ':')
|
||||
{
|
||||
putDebugChar(buffer[0]);
|
||||
putDebugChar(buffer[1]);
|
||||
/* remove sequence chars from buffer */
|
||||
count = strlen(buffer);
|
||||
for (i=3; i <= count; i++)
|
||||
buffer[i-3] = buffer[i];
|
||||
putDebugChar (buffer[0]);
|
||||
putDebugChar (buffer[1]);
|
||||
|
||||
return &buffer[3];
|
||||
}
|
||||
|
||||
return &buffer[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
while (checksum != xmitcsum);
|
||||
}
|
||||
|
||||
/* send the packet in buffer. */
|
||||
|
@ -544,7 +545,7 @@ putpacket(buffer)
|
|||
putDebugChar(hexchars[checksum & 0xf]);
|
||||
|
||||
}
|
||||
while ((getDebugChar() & 0x7f) != '+');
|
||||
while (getDebugChar() != '+');
|
||||
}
|
||||
|
||||
static char remcomInBuffer[BUFMAX];
|
||||
|
@ -880,8 +881,8 @@ handle_exception (registers)
|
|||
{
|
||||
remcomOutBuffer[0] = 0;
|
||||
|
||||
getpacket(remcomInBuffer);
|
||||
switch (remcomInBuffer[0])
|
||||
ptr = getpacket(remcomInBuffer);
|
||||
switch (*ptr++)
|
||||
{
|
||||
case '?':
|
||||
remcomOutBuffer[0] = 'S';
|
||||
|
@ -928,9 +929,7 @@ handle_exception (registers)
|
|||
|
||||
psr = registers[PSR];
|
||||
|
||||
ptr = &remcomInBuffer[1];
|
||||
|
||||
if (remcomInBuffer[0] == 'P') /* do a single register */
|
||||
if (ptr[-1] == 'P') /* do a single register */
|
||||
{
|
||||
int regno;
|
||||
|
||||
|
@ -981,8 +980,6 @@ handle_exception (registers)
|
|||
case 'm': /* mAA..AA,LLLL Read LLLL bytes at address AA..AA */
|
||||
/* Try to read %x,%x. */
|
||||
|
||||
ptr = &remcomInBuffer[1];
|
||||
|
||||
if (hexToInt(&ptr, &addr)
|
||||
&& *ptr++ == ','
|
||||
&& hexToInt(&ptr, &length))
|
||||
|
@ -999,8 +996,6 @@ handle_exception (registers)
|
|||
case 'M': /* MAA..AA,LLLL: Write LLLL bytes at address AA.AA return OK */
|
||||
/* Try to read '%x,%x:'. */
|
||||
|
||||
ptr = &remcomInBuffer[1];
|
||||
|
||||
if (hexToInt(&ptr, &addr)
|
||||
&& *ptr++ == ','
|
||||
&& hexToInt(&ptr, &length)
|
||||
|
@ -1018,7 +1013,6 @@ handle_exception (registers)
|
|||
case 'c': /* cAA..AA Continue at address AA..AA(optional) */
|
||||
/* try to read optional parameter, pc unchanged if no parm */
|
||||
|
||||
ptr = &remcomInBuffer[1];
|
||||
if (hexToInt(&ptr, &addr))
|
||||
{
|
||||
registers[PC] = addr;
|
||||
|
@ -1054,7 +1048,6 @@ Disabled until we can unscrew this properly
|
|||
int baudrate;
|
||||
extern void set_timer_3();
|
||||
|
||||
ptr = &remcomInBuffer[1];
|
||||
if (!hexToInt(&ptr, &baudrate))
|
||||
{
|
||||
strcpy(remcomOutBuffer,"B01");
|
||||
|
|
|
@ -45,9 +45,6 @@
|
|||
#include "gdb_stat.h"
|
||||
#include <ctype.h>
|
||||
#include <time.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifndef O_BINARY
|
||||
#define O_BINARY 0
|
||||
|
|
524
gdb/tahoe-tdep.c
524
gdb/tahoe-tdep.c
|
@ -1,262 +1,262 @@
|
|||
/* Print instructions for Tahoe target machines, for GDB.
|
||||
Copyright 1986, 1989, 1991, 1992 Free Software Foundation, Inc.
|
||||
Contributed by the State University of New York at Buffalo, by the
|
||||
Distributed Computer Systems Lab, Department of Computer Science, 1991.
|
||||
|
||||
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 "symtab.h"
|
||||
#include "opcode/tahoe.h"
|
||||
|
||||
/* Tahoe instructions are never longer than this. */
|
||||
#define MAXLEN 62
|
||||
|
||||
/* Number of elements in the opcode table. */
|
||||
#define NOPCODES (sizeof votstrs / sizeof votstrs[0])
|
||||
|
||||
static unsigned char *print_insn_arg ();
|
||||
|
||||
/* Advance PC across any function entry prologue instructions
|
||||
to reach some "real" code. */
|
||||
|
||||
CORE_ADDR
|
||||
tahoe_skip_prologue (pc)
|
||||
CORE_ADDR pc;
|
||||
{
|
||||
register int op = (unsigned char) read_memory_integer (pc, 1);
|
||||
if (op == 0x11)
|
||||
pc += 2; /* skip brb */
|
||||
if (op == 0x13)
|
||||
pc += 3; /* skip brw */
|
||||
if (op == 0x2c
|
||||
&& ((unsigned char) read_memory_integer (pc + 2, 1)) == 0x5e)
|
||||
pc += 3; /* skip subl2 */
|
||||
if (op == 0xe9
|
||||
&& ((unsigned char) read_memory_integer (pc + 1, 1)) == 0xae
|
||||
&& ((unsigned char) read_memory_integer (pc + 3, 1)) == 0x5e)
|
||||
pc += 4; /* skip movab */
|
||||
if (op == 0xe9
|
||||
&& ((unsigned char) read_memory_integer (pc + 1, 1)) == 0xce
|
||||
&& ((unsigned char) read_memory_integer (pc + 4, 1)) == 0x5e)
|
||||
pc += 5; /* skip movab */
|
||||
if (op == 0xe9
|
||||
&& ((unsigned char) read_memory_integer (pc + 1, 1)) == 0xee
|
||||
&& ((unsigned char) read_memory_integer (pc + 6, 1)) == 0x5e)
|
||||
pc += 7; /* skip movab */
|
||||
return pc;
|
||||
}
|
||||
|
||||
/* Return number of args passed to a frame.
|
||||
Can return -1, meaning no way to tell. */
|
||||
|
||||
int
|
||||
tahoe_frame_num_args (fi)
|
||||
struct frame_info *fi;
|
||||
{
|
||||
return (((0xffff & read_memory_integer (((fi)->frame - 4), 4)) - 4) >> 2);
|
||||
}
|
||||
|
||||
/* Print the Tahoe instruction at address MEMADDR in debugged memory,
|
||||
on STREAM. Returns length of the instruction, in bytes. */
|
||||
|
||||
int
|
||||
tahoe_print_insn (memaddr, stream)
|
||||
CORE_ADDR memaddr;
|
||||
GDB_FILE *stream;
|
||||
{
|
||||
unsigned char buffer[MAXLEN];
|
||||
register int i;
|
||||
register unsigned char *p;
|
||||
register char *d;
|
||||
|
||||
read_memory (memaddr, buffer, MAXLEN);
|
||||
|
||||
for (i = 0; i < NOPCODES; i++)
|
||||
if (votstrs[i].detail.code == buffer[0]
|
||||
|| votstrs[i].detail.code == *(unsigned short *) buffer)
|
||||
break;
|
||||
|
||||
/* Handle undefined instructions. */
|
||||
if (i == NOPCODES)
|
||||
{
|
||||
fprintf_unfiltered (stream, "0%o", buffer[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
fprintf_unfiltered (stream, "%s", votstrs[i].name);
|
||||
|
||||
/* Point at first byte of argument data,
|
||||
and at descriptor for first argument. */
|
||||
p = buffer + 1 + (votstrs[i].detail.code >= 0x100);
|
||||
d = votstrs[i].detail.args;
|
||||
|
||||
if (*d)
|
||||
fputc_unfiltered ('\t', stream);
|
||||
|
||||
while (*d)
|
||||
{
|
||||
p = print_insn_arg (d, p, memaddr + (p - buffer), stream);
|
||||
d += 2;
|
||||
if (*d)
|
||||
fprintf_unfiltered (stream, ",");
|
||||
}
|
||||
return p - buffer;
|
||||
}
|
||||
/*******************************************************************/
|
||||
static unsigned char *
|
||||
print_insn_arg (d, p, addr, stream)
|
||||
char *d;
|
||||
register char *p;
|
||||
CORE_ADDR addr;
|
||||
GDB_FILE *stream;
|
||||
{
|
||||
int temp1 = 0;
|
||||
register int regnum = *p & 0xf;
|
||||
float floatlitbuf;
|
||||
|
||||
if (*d == 'b')
|
||||
{
|
||||
if (d[1] == 'b')
|
||||
fprintf_unfiltered (stream, "0x%x", addr + *p++ + 1);
|
||||
else
|
||||
{
|
||||
|
||||
temp1 = *p;
|
||||
temp1 <<= 8;
|
||||
temp1 |= *(p + 1);
|
||||
fprintf_unfiltered (stream, "0x%x", addr + temp1 + 2);
|
||||
p += 2;
|
||||
}
|
||||
}
|
||||
else
|
||||
switch ((*p++ >> 4) & 0xf)
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
case 3: /* Literal (short immediate byte) mode */
|
||||
if (d[1] == 'd' || d[1] == 'f' || d[1] == 'g' || d[1] == 'h')
|
||||
{
|
||||
*(int *) &floatlitbuf = 0x4000 + ((p[-1] & 0x3f) << 4);
|
||||
fprintf_unfiltered (stream, "$%f", floatlitbuf);
|
||||
}
|
||||
else
|
||||
fprintf_unfiltered (stream, "$%d", p[-1] & 0x3f);
|
||||
break;
|
||||
|
||||
case 4: /* Indexed */
|
||||
p = (char *) print_insn_arg (d, p, addr + 1, stream);
|
||||
fprintf_unfiltered (stream, "[%s]", REGISTER_NAME (regnum));
|
||||
break;
|
||||
|
||||
case 5: /* Register */
|
||||
fprintf_unfiltered (stream, REGISTER_NAME (regnum));
|
||||
break;
|
||||
|
||||
case 7: /* Autodecrement */
|
||||
fputc_unfiltered ('-', stream);
|
||||
case 6: /* Register deferred */
|
||||
fprintf_unfiltered (stream, "(%s)", REGISTER_NAME (regnum));
|
||||
break;
|
||||
|
||||
case 9: /* Absolute Address & Autoincrement deferred */
|
||||
fputc_unfiltered ('*', stream);
|
||||
if (regnum == PC_REGNUM)
|
||||
{
|
||||
temp1 = *p;
|
||||
temp1 <<= 8;
|
||||
temp1 |= *(p + 1);
|
||||
|
||||
fputc_unfiltered ('$', stream);
|
||||
print_address (temp1, stream);
|
||||
p += 4;
|
||||
break;
|
||||
}
|
||||
case 8: /*Immediate & Autoincrement SP */
|
||||
if (regnum == 8) /*88 is Immediate Byte Mode */
|
||||
fprintf_unfiltered (stream, "$%d", *p++);
|
||||
|
||||
else if (regnum == 9) /*89 is Immediate Word Mode */
|
||||
{
|
||||
temp1 = *p;
|
||||
temp1 <<= 8;
|
||||
temp1 |= *(p + 1);
|
||||
fprintf_unfiltered (stream, "$%d", temp1);
|
||||
p += 2;
|
||||
}
|
||||
|
||||
else if (regnum == PC_REGNUM) /*8F is Immediate Long Mode */
|
||||
{
|
||||
temp1 = *p;
|
||||
temp1 <<= 8;
|
||||
temp1 |= *(p + 1);
|
||||
temp1 <<= 8;
|
||||
temp1 |= *(p + 2);
|
||||
temp1 <<= 8;
|
||||
temp1 |= *(p + 3);
|
||||
fprintf_unfiltered (stream, "$%d", temp1);
|
||||
p += 4;
|
||||
}
|
||||
|
||||
else /*8E is Autoincrement SP Mode */
|
||||
fprintf_unfiltered (stream, "(%s)+", REGISTER_NAME (regnum));
|
||||
break;
|
||||
|
||||
case 11: /* Register + Byte Displacement Deferred Mode */
|
||||
fputc_unfiltered ('*', stream);
|
||||
case 10: /* Register + Byte Displacement Mode */
|
||||
if (regnum == PC_REGNUM)
|
||||
print_address (addr + *p + 2, stream);
|
||||
else
|
||||
fprintf_unfiltered (stream, "%d(%s)", *p, REGISTER_NAME (regnum));
|
||||
p += 1;
|
||||
break;
|
||||
|
||||
case 13: /* Register + Word Displacement Deferred Mode */
|
||||
fputc_unfiltered ('*', stream);
|
||||
case 12: /* Register + Word Displacement Mode */
|
||||
temp1 = *p;
|
||||
temp1 <<= 8;
|
||||
temp1 |= *(p + 1);
|
||||
if (regnum == PC_REGNUM)
|
||||
print_address (addr + temp1 + 3, stream);
|
||||
else
|
||||
fprintf_unfiltered (stream, "%d(%s)", temp1, REGISTER_NAME (regnum));
|
||||
p += 2;
|
||||
break;
|
||||
|
||||
case 15: /* Register + Long Displacement Deferred Mode */
|
||||
fputc_unfiltered ('*', stream);
|
||||
case 14: /* Register + Long Displacement Mode */
|
||||
temp1 = *p;
|
||||
temp1 <<= 8;
|
||||
temp1 |= *(p + 1);
|
||||
temp1 <<= 8;
|
||||
temp1 |= *(p + 2);
|
||||
temp1 <<= 8;
|
||||
temp1 |= *(p + 3);
|
||||
if (regnum == PC_REGNUM)
|
||||
print_address (addr + temp1 + 5, stream);
|
||||
else
|
||||
fprintf_unfiltered (stream, "%d(%s)", temp1, REGISTER_NAME (regnum));
|
||||
p += 4;
|
||||
}
|
||||
|
||||
return (unsigned char *) p;
|
||||
}
|
||||
/* OBSOLETE /* Print instructions for Tahoe target machines, for GDB. */
|
||||
/* OBSOLETE Copyright 1986, 1989, 1991, 1992 Free Software Foundation, Inc. */
|
||||
/* OBSOLETE Contributed by the State University of New York at Buffalo, by the */
|
||||
/* OBSOLETE Distributed Computer Systems Lab, Department of Computer Science, 1991. */
|
||||
/* 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, */
|
||||
/* OBSOLETE Boston, MA 02111-1307, USA. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #include "defs.h" */
|
||||
/* OBSOLETE #include "symtab.h" */
|
||||
/* OBSOLETE #include "opcode/tahoe.h" */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Tahoe instructions are never longer than this. *x/ */
|
||||
/* OBSOLETE #define MAXLEN 62 */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Number of elements in the opcode table. *x/ */
|
||||
/* OBSOLETE #define NOPCODES (sizeof votstrs / sizeof votstrs[0]) */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE static unsigned char *print_insn_arg (); */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Advance PC across any function entry prologue instructions */
|
||||
/* OBSOLETE to reach some "real" code. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE CORE_ADDR */
|
||||
/* OBSOLETE tahoe_skip_prologue (pc) */
|
||||
/* OBSOLETE CORE_ADDR pc; */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE register int op = (unsigned char) read_memory_integer (pc, 1); */
|
||||
/* OBSOLETE if (op == 0x11) */
|
||||
/* OBSOLETE pc += 2; /* skip brb *x/ */
|
||||
/* OBSOLETE if (op == 0x13) */
|
||||
/* OBSOLETE pc += 3; /* skip brw *x/ */
|
||||
/* OBSOLETE if (op == 0x2c */
|
||||
/* OBSOLETE && ((unsigned char) read_memory_integer (pc + 2, 1)) == 0x5e) */
|
||||
/* OBSOLETE pc += 3; /* skip subl2 *x/ */
|
||||
/* OBSOLETE if (op == 0xe9 */
|
||||
/* OBSOLETE && ((unsigned char) read_memory_integer (pc + 1, 1)) == 0xae */
|
||||
/* OBSOLETE && ((unsigned char) read_memory_integer (pc + 3, 1)) == 0x5e) */
|
||||
/* OBSOLETE pc += 4; /* skip movab *x/ */
|
||||
/* OBSOLETE if (op == 0xe9 */
|
||||
/* OBSOLETE && ((unsigned char) read_memory_integer (pc + 1, 1)) == 0xce */
|
||||
/* OBSOLETE && ((unsigned char) read_memory_integer (pc + 4, 1)) == 0x5e) */
|
||||
/* OBSOLETE pc += 5; /* skip movab *x/ */
|
||||
/* OBSOLETE if (op == 0xe9 */
|
||||
/* OBSOLETE && ((unsigned char) read_memory_integer (pc + 1, 1)) == 0xee */
|
||||
/* OBSOLETE && ((unsigned char) read_memory_integer (pc + 6, 1)) == 0x5e) */
|
||||
/* OBSOLETE pc += 7; /* skip movab *x/ */
|
||||
/* OBSOLETE return pc; */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Return number of args passed to a frame. */
|
||||
/* OBSOLETE Can return -1, meaning no way to tell. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE int */
|
||||
/* OBSOLETE tahoe_frame_num_args (fi) */
|
||||
/* OBSOLETE struct frame_info *fi; */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE return (((0xffff & read_memory_integer (((fi)->frame - 4), 4)) - 4) >> 2); */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Print the Tahoe instruction at address MEMADDR in debugged memory, */
|
||||
/* OBSOLETE on STREAM. Returns length of the instruction, in bytes. *x/ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE int */
|
||||
/* OBSOLETE tahoe_print_insn (memaddr, stream) */
|
||||
/* OBSOLETE CORE_ADDR memaddr; */
|
||||
/* OBSOLETE GDB_FILE *stream; */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE unsigned char buffer[MAXLEN]; */
|
||||
/* OBSOLETE register int i; */
|
||||
/* OBSOLETE register unsigned char *p; */
|
||||
/* OBSOLETE register char *d; */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE read_memory (memaddr, buffer, MAXLEN); */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE for (i = 0; i < NOPCODES; i++) */
|
||||
/* OBSOLETE if (votstrs[i].detail.code == buffer[0] */
|
||||
/* OBSOLETE || votstrs[i].detail.code == *(unsigned short *) buffer) */
|
||||
/* OBSOLETE break; */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Handle undefined instructions. *x/ */
|
||||
/* OBSOLETE if (i == NOPCODES) */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE fprintf_unfiltered (stream, "0%o", buffer[0]); */
|
||||
/* OBSOLETE return 1; */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE fprintf_unfiltered (stream, "%s", votstrs[i].name); */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Point at first byte of argument data, */
|
||||
/* OBSOLETE and at descriptor for first argument. *x/ */
|
||||
/* OBSOLETE p = buffer + 1 + (votstrs[i].detail.code >= 0x100); */
|
||||
/* OBSOLETE d = votstrs[i].detail.args; */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE if (*d) */
|
||||
/* OBSOLETE fputc_unfiltered ('\t', stream); */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE while (*d) */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE p = print_insn_arg (d, p, memaddr + (p - buffer), stream); */
|
||||
/* OBSOLETE d += 2; */
|
||||
/* OBSOLETE if (*d) */
|
||||
/* OBSOLETE fprintf_unfiltered (stream, ","); */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE return p - buffer; */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE /*******************************************************************x/ */
|
||||
/* OBSOLETE static unsigned char * */
|
||||
/* OBSOLETE print_insn_arg (d, p, addr, stream) */
|
||||
/* OBSOLETE char *d; */
|
||||
/* OBSOLETE register char *p; */
|
||||
/* OBSOLETE CORE_ADDR addr; */
|
||||
/* OBSOLETE GDB_FILE *stream; */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE int temp1 = 0; */
|
||||
/* OBSOLETE register int regnum = *p & 0xf; */
|
||||
/* OBSOLETE float floatlitbuf; */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE if (*d == 'b') */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE if (d[1] == 'b') */
|
||||
/* OBSOLETE fprintf_unfiltered (stream, "0x%x", addr + *p++ + 1); */
|
||||
/* OBSOLETE else */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE temp1 = *p; */
|
||||
/* OBSOLETE temp1 <<= 8; */
|
||||
/* OBSOLETE temp1 |= *(p + 1); */
|
||||
/* OBSOLETE fprintf_unfiltered (stream, "0x%x", addr + temp1 + 2); */
|
||||
/* OBSOLETE p += 2; */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE else */
|
||||
/* OBSOLETE switch ((*p++ >> 4) & 0xf) */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE case 0: */
|
||||
/* OBSOLETE case 1: */
|
||||
/* OBSOLETE case 2: */
|
||||
/* OBSOLETE case 3: /* Literal (short immediate byte) mode *x/ */
|
||||
/* OBSOLETE if (d[1] == 'd' || d[1] == 'f' || d[1] == 'g' || d[1] == 'h') */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE *(int *) &floatlitbuf = 0x4000 + ((p[-1] & 0x3f) << 4); */
|
||||
/* OBSOLETE fprintf_unfiltered (stream, "$%f", floatlitbuf); */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE else */
|
||||
/* OBSOLETE fprintf_unfiltered (stream, "$%d", p[-1] & 0x3f); */
|
||||
/* OBSOLETE break; */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE case 4: /* Indexed *x/ */
|
||||
/* OBSOLETE p = (char *) print_insn_arg (d, p, addr + 1, stream); */
|
||||
/* OBSOLETE fprintf_unfiltered (stream, "[%s]", REGISTER_NAME (regnum)); */
|
||||
/* OBSOLETE break; */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE case 5: /* Register *x/ */
|
||||
/* OBSOLETE fprintf_unfiltered (stream, REGISTER_NAME (regnum)); */
|
||||
/* OBSOLETE break; */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE case 7: /* Autodecrement *x/ */
|
||||
/* OBSOLETE fputc_unfiltered ('-', stream); */
|
||||
/* OBSOLETE case 6: /* Register deferred *x/ */
|
||||
/* OBSOLETE fprintf_unfiltered (stream, "(%s)", REGISTER_NAME (regnum)); */
|
||||
/* OBSOLETE break; */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE case 9: /* Absolute Address & Autoincrement deferred *x/ */
|
||||
/* OBSOLETE fputc_unfiltered ('*', stream); */
|
||||
/* OBSOLETE if (regnum == PC_REGNUM) */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE temp1 = *p; */
|
||||
/* OBSOLETE temp1 <<= 8; */
|
||||
/* OBSOLETE temp1 |= *(p + 1); */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE fputc_unfiltered ('$', stream); */
|
||||
/* OBSOLETE print_address (temp1, stream); */
|
||||
/* OBSOLETE p += 4; */
|
||||
/* OBSOLETE break; */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE case 8: /*Immediate & Autoincrement SP *x/ */
|
||||
/* OBSOLETE if (regnum == 8) /*88 is Immediate Byte Mode *x/ */
|
||||
/* OBSOLETE fprintf_unfiltered (stream, "$%d", *p++); */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE else if (regnum == 9) /*89 is Immediate Word Mode *x/ */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE temp1 = *p; */
|
||||
/* OBSOLETE temp1 <<= 8; */
|
||||
/* OBSOLETE temp1 |= *(p + 1); */
|
||||
/* OBSOLETE fprintf_unfiltered (stream, "$%d", temp1); */
|
||||
/* OBSOLETE p += 2; */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE else if (regnum == PC_REGNUM) /*8F is Immediate Long Mode *x/ */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE temp1 = *p; */
|
||||
/* OBSOLETE temp1 <<= 8; */
|
||||
/* OBSOLETE temp1 |= *(p + 1); */
|
||||
/* OBSOLETE temp1 <<= 8; */
|
||||
/* OBSOLETE temp1 |= *(p + 2); */
|
||||
/* OBSOLETE temp1 <<= 8; */
|
||||
/* OBSOLETE temp1 |= *(p + 3); */
|
||||
/* OBSOLETE fprintf_unfiltered (stream, "$%d", temp1); */
|
||||
/* OBSOLETE p += 4; */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE else /*8E is Autoincrement SP Mode *x/ */
|
||||
/* OBSOLETE fprintf_unfiltered (stream, "(%s)+", REGISTER_NAME (regnum)); */
|
||||
/* OBSOLETE break; */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE case 11: /* Register + Byte Displacement Deferred Mode *x/ */
|
||||
/* OBSOLETE fputc_unfiltered ('*', stream); */
|
||||
/* OBSOLETE case 10: /* Register + Byte Displacement Mode *x/ */
|
||||
/* OBSOLETE if (regnum == PC_REGNUM) */
|
||||
/* OBSOLETE print_address (addr + *p + 2, stream); */
|
||||
/* OBSOLETE else */
|
||||
/* OBSOLETE fprintf_unfiltered (stream, "%d(%s)", *p, REGISTER_NAME (regnum)); */
|
||||
/* OBSOLETE p += 1; */
|
||||
/* OBSOLETE break; */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE case 13: /* Register + Word Displacement Deferred Mode *x/ */
|
||||
/* OBSOLETE fputc_unfiltered ('*', stream); */
|
||||
/* OBSOLETE case 12: /* Register + Word Displacement Mode *x/ */
|
||||
/* OBSOLETE temp1 = *p; */
|
||||
/* OBSOLETE temp1 <<= 8; */
|
||||
/* OBSOLETE temp1 |= *(p + 1); */
|
||||
/* OBSOLETE if (regnum == PC_REGNUM) */
|
||||
/* OBSOLETE print_address (addr + temp1 + 3, stream); */
|
||||
/* OBSOLETE else */
|
||||
/* OBSOLETE fprintf_unfiltered (stream, "%d(%s)", temp1, REGISTER_NAME (regnum)); */
|
||||
/* OBSOLETE p += 2; */
|
||||
/* OBSOLETE break; */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE case 15: /* Register + Long Displacement Deferred Mode *x/ */
|
||||
/* OBSOLETE fputc_unfiltered ('*', stream); */
|
||||
/* OBSOLETE case 14: /* Register + Long Displacement Mode *x/ */
|
||||
/* OBSOLETE temp1 = *p; */
|
||||
/* OBSOLETE temp1 <<= 8; */
|
||||
/* OBSOLETE temp1 |= *(p + 1); */
|
||||
/* OBSOLETE temp1 <<= 8; */
|
||||
/* OBSOLETE temp1 |= *(p + 2); */
|
||||
/* OBSOLETE temp1 <<= 8; */
|
||||
/* OBSOLETE temp1 |= *(p + 3); */
|
||||
/* OBSOLETE if (regnum == PC_REGNUM) */
|
||||
/* OBSOLETE print_address (addr + temp1 + 5, stream); */
|
||||
/* OBSOLETE else */
|
||||
/* OBSOLETE fprintf_unfiltered (stream, "%d(%s)", temp1, REGISTER_NAME (regnum)); */
|
||||
/* OBSOLETE p += 4; */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE return (unsigned char *) p; */
|
||||
/* OBSOLETE } */
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue