diff options
Diffstat (limited to 'gdb')
118 files changed, 8533 insertions, 2780 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index fe8c1357..5e0dbf9 100644 --- a/gdb/ChangeLog +++ b/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. diff --git a/gdb/Makefile.in b/gdb/Makefile.in index df4caad..a2652aa 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -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. @@ -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 diff --git a/gdb/annotate.h b/gdb/annotate.h index 1a509b1..e80313a 100644 --- a/gdb/annotate.h +++ b/gdb/annotate.h @@ -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)); diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 7598a8d..b3ad024 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -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 diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index c4987b3..46f5a72 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -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 diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index 3f710aa..ee03af7 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -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)); diff --git a/gdb/ch-lang.h b/gdb/ch-lang.h index 764d321..2957872 100644 --- a/gdb/ch-lang.h +++ b/gdb/ch-lang.h @@ -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 */ diff --git a/gdb/coff-solib.h b/gdb/coff-solib.h index 71f707f..e1a6758 100644 --- a/gdb/coff-solib.h +++ b/gdb/coff-solib.h @@ -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. */ diff --git a/gdb/command.c b/gdb/command.c index 277d7e5..28d07fc 100644 --- a/gdb/command.c +++ b/gdb/command.c @@ -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> diff --git a/gdb/config.in b/gdb/config.in index d0ae5a2..a8a5636 100644 --- a/gdb/config.in +++ b/gdb/config.in @@ -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 diff --git a/gdb/config/a29k/tm-a29k.h b/gdb/config/a29k/tm-a29k.h index 5d759e7..25a5bea 100644 --- a/gdb/config/a29k/tm-a29k.h +++ b/gdb/config/a29k/tm-a29k.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) diff --git a/gdb/config/alpha/tm-alpha.h b/gdb/config/alpha/tm-alpha.h index aaa2a82..f7e8a79 100644 --- a/gdb/config/alpha/tm-alpha.h +++ b/gdb/config/alpha/tm-alpha.h @@ -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 diff --git a/gdb/config/arm/arm.mt b/gdb/config/arm/arm.mt index 0f2cab3..f6f16a3 100644 --- a/gdb/config/arm/arm.mt +++ b/gdb/config/arm/arm.mt @@ -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 diff --git a/gdb/config/arm/tm-arm.h b/gdb/config/arm/tm-arm.h index 4fbeafd..d33477d 100644 --- a/gdb/config/arm/tm-arm.h +++ b/gdb/config/arm/tm-arm.h @@ -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)); diff --git a/gdb/config/d30v/tm-d30v.h b/gdb/config/d30v/tm-d30v.h index f823f94..2c6131b 100644 --- a/gdb/config/d30v/tm-d30v.h +++ b/gdb/config/d30v/tm-d30v.h @@ -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. */ diff --git a/gdb/config/fr30/tm-fr30.h b/gdb/config/fr30/tm-fr30.h index 2dd8a8e..0bd5476 100644 --- a/gdb/config/fr30/tm-fr30.h +++ b/gdb/config/fr30/tm-fr30.h @@ -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; \ diff --git a/gdb/config/h8300/tm-h8300.h b/gdb/config/h8300/tm-h8300.h index 5ca6f87..e91f142 100644 --- a/gdb/config/h8300/tm-h8300.h +++ b/gdb/config/h8300/tm-h8300.h @@ -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; diff --git a/gdb/config/i386/nm-i386sol2.h b/gdb/config/i386/nm-i386sol2.h index 279c9b0..05ab066 100644 --- a/gdb/config/i386/nm-i386sol2.h +++ b/gdb/config/i386/nm-i386sol2.h @@ -22,9 +22,7 @@ #ifdef HAVE_THREAD_DB_LIB -#ifdef __STDC__ struct objfile; -#endif #define target_new_objfile(OBJFILE) sol_thread_new_objfile (OBJFILE) diff --git a/gdb/config/i386/tm-i386.h b/gdb/config/i386/tm-i386.h index ee9017b..0bfb2e6 100644 --- a/gdb/config/i386/tm-i386.h +++ b/gdb/config/i386/tm-i386.h @@ -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 diff --git a/gdb/config/i386/tm-i386v.h b/gdb/config/i386/tm-i386v.h index 1e6a2b2..308da1f 100644 --- a/gdb/config/i386/tm-i386v.h +++ b/gdb/config/i386/tm-i386v.h @@ -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 *)); diff --git a/gdb/config/i386/tm-sun386.h b/gdb/config/i386/tm-sun386.h index 5d4c39c..a4ef54c 100644 --- a/gdb/config/i386/tm-sun386.h +++ b/gdb/config/i386/tm-sun386.h @@ -26,7 +26,6 @@ #ifndef sun386 #define sun386 #endif -#define GDB_TARGET_IS_SUN386 1 #define SUNOS4 #define USE_MACHINE_REG_H diff --git a/gdb/config/i960/tm-mon960.h b/gdb/config/i960/tm-mon960.h index 21c4812..61b937e 100644 --- a/gdb/config/i960/tm-mon960.h +++ b/gdb/config/i960/tm-mon960.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 */ diff --git a/gdb/config/i960/tm-nindy960.h b/gdb/config/i960/tm-nindy960.h index 1a0b562..7a20af3 100644 --- a/gdb/config/i960/tm-nindy960.h +++ b/gdb/config/i960/tm-nindy960.h @@ -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. */ diff --git a/gdb/config/m32r/tm-m32r.h b/gdb/config/m32r/tm-m32r.h index e0c8c23..7898f66 100644 --- a/gdb/config/m32r/tm-m32r.h +++ b/gdb/config/m32r/tm-m32r.h @@ -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! diff --git a/gdb/config/m68k/tm-m68k.h b/gdb/config/m68k/tm-m68k.h index da80f10..c3574ee 100644 --- a/gdb/config/m68k/tm-m68k.h +++ b/gdb/config/m68k/tm-m68k.h @@ -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 *)); diff --git a/gdb/config/mips/tm-mips.h b/gdb/config/mips/tm-mips.h index 3df3dab..fecdea6 100644 --- a/gdb/config/mips/tm-mips.h +++ b/gdb/config/mips/tm-mips.h @@ -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. */ diff --git a/gdb/config/mn10200/tm-mn10200.h b/gdb/config/mn10200/tm-mn10200.h index 082ab0e..8816de0 100644 --- a/gdb/config/mn10200/tm-mn10200.h +++ b/gdb/config/mn10200/tm-mn10200.h @@ -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; diff --git a/gdb/config/mn10300/tm-mn10300.h b/gdb/config/mn10300/tm-mn10300.h index 7a4482b..f9e38e0 100644 --- a/gdb/config/mn10300/tm-mn10300.h +++ b/gdb/config/mn10300/tm-mn10300.h @@ -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) diff --git a/gdb/config/pa/nm-hppah.h b/gdb/config/pa/nm-hppah.h index 19bf2f7..269593f 100644 --- a/gdb/config/pa/nm-hppah.h +++ b/gdb/config/pa/nm-hppah.h @@ -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) diff --git a/gdb/config/pa/tm-hppa.h b/gdb/config/pa/tm-hppa.h index 907978f..60ec037 100644 --- a/gdb/config/pa/tm-hppa.h +++ b/gdb/config/pa/tm-hppa.h @@ -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. */ diff --git a/gdb/config/pa/tm-hppa64.h b/gdb/config/pa/tm-hppa64.h index 11cfd3b..3b1ab44 100644 --- a/gdb/config/pa/tm-hppa64.h +++ b/gdb/config/pa/tm-hppa64.h @@ -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 diff --git a/gdb/config/rs6000/nm-rs6000.h b/gdb/config/rs6000/nm-rs6000.h index 1d6f970..52a98f0 100644 --- a/gdb/config/rs6000/nm-rs6000.h +++ b/gdb/config/rs6000/nm-rs6000.h @@ -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 */ diff --git a/gdb/config/rs6000/tm-rs6000.h b/gdb/config/rs6000/tm-rs6000.h index d45fe9b..3c34431 100644 --- a/gdb/config/rs6000/tm-rs6000.h +++ b/gdb/config/rs6000/tm-rs6000.h @@ -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 diff --git a/gdb/config/sh/tm-sh.h b/gdb/config/sh/tm-sh.h index f39f308..0c1c109 100644 --- a/gdb/config/sh/tm-sh.h +++ b/gdb/config/sh/tm-sh.h @@ -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 diff --git a/gdb/config/sparc/nm-sun4sol2.h b/gdb/config/sparc/nm-sun4sol2.h index 6b930f5..8baf893 100644 --- a/gdb/config/sparc/nm-sun4sol2.h +++ b/gdb/config/sparc/nm-sun4sol2.h @@ -32,9 +32,7 @@ #ifdef HAVE_THREAD_DB_LIB -#ifdef __STDC__ struct objfile; -#endif #define target_new_objfile(OBJFILE) sol_thread_new_objfile (OBJFILE) diff --git a/gdb/config/sparc/tm-sp64.h b/gdb/config/sparc/tm-sp64.h index bba364d..dbdf510 100644 --- a/gdb/config/sparc/tm-sp64.h +++ b/gdb/config/sparc/tm-sp64.h @@ -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 diff --git a/gdb/config/sparc/tm-sparc.h b/gdb/config/sparc/tm-sparc.h index ab0ad16..a8db2f5 100644 --- a/gdb/config/sparc/tm-sparc.h +++ b/gdb/config/sparc/tm-sparc.h @@ -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) diff --git a/gdb/config/tahoe/tahoe.mh b/gdb/config/tahoe/tahoe.mh index 0814c01..0b20f33 100644 --- a/gdb/config/tahoe/tahoe.mh +++ b/gdb/config/tahoe/tahoe.mh @@ -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 diff --git a/gdb/config/tahoe/tahoe.mt b/gdb/config/tahoe/tahoe.mt index b91a77e..a5f6185 100644 --- a/gdb/config/tahoe/tahoe.mt +++ b/gdb/config/tahoe/tahoe.mt @@ -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 diff --git a/gdb/config/tahoe/tm-tahoe.h b/gdb/config/tahoe/tm-tahoe.h index 6028337..5332548 100644 --- a/gdb/config/tahoe/tm-tahoe.h +++ b/gdb/config/tahoe/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); } */ diff --git a/gdb/config/tahoe/xm-tahoe.h b/gdb/config/tahoe/xm-tahoe.h index c9e18d8..f20dda0 100644 --- a/gdb/config/tahoe/xm-tahoe.h +++ b/gdb/config/tahoe/xm-tahoe.h @@ -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"); } */ diff --git a/gdb/config/tic80/tm-tic80.h b/gdb/config/tic80/tm-tic80.h index 0ec4887..a7accac 100644 --- a/gdb/config/tic80/tm-tic80.h +++ b/gdb/config/tic80/tm-tic80.h @@ -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 diff --git a/gdb/config/v850/tm-v850.h b/gdb/config/v850/tm-v850.h index ecea72d..03efe94 100644 --- a/gdb/config/v850/tm-v850.h +++ b/gdb/config/v850/tm-v850.h @@ -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; diff --git a/gdb/config/z8k/tm-z8k.h b/gdb/config/z8k/tm-z8k.h index 4f0ec94..bf6d4c9 100644 --- a/gdb/config/z8k/tm-z8k.h +++ b/gdb/config/z8k/tm-z8k.h @@ -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) diff --git a/gdb/configure b/gdb/configure index b487dba..6701bd1 100755 --- a/gdb/configure +++ b/gdb/configure @@ -3216,21 +3216,22 @@ for ac_hdr in 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 do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3224: checking for $ac_hdr" >&5 +echo "configure:3225: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3229 "configure" +#line 3230 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3234: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3235: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3257,12 +3258,12 @@ fi done echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6 -echo "configure:3261: checking whether stat file-mode macros are broken" >&5 +echo "configure:3262: checking whether stat file-mode macros are broken" >&5 if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3266 "configure" +#line 3267 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/stat.h> @@ -3314,12 +3315,12 @@ fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:3318: checking for working const" >&5 +echo "configure:3319: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3323 "configure" +#line 3324 "configure" #include "confdefs.h" int main() { @@ -3368,7 +3369,7 @@ ccp = (char const *const *) p; ; return 0; } EOF -if { (eval echo configure:3372: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3373: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -3392,12 +3393,12 @@ fi for ac_func in setpgid sbrk sigaction isascii bzero bcopy btowc poll do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3396: checking for $ac_func" >&5 +echo "configure:3397: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3401 "configure" +#line 3402 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3420,7 +3421,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3424: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3447,19 +3448,19 @@ done # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:3451: checking for working alloca.h" >&5 +echo "configure:3452: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3456 "configure" +#line 3457 "configure" #include "confdefs.h" #include <alloca.h> int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:3463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3464: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -3480,12 +3481,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:3484: checking for alloca" >&5 +echo "configure:3485: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3489 "configure" +#line 3490 "configure" #include "confdefs.h" #ifdef __GNUC__ @@ -3513,7 +3514,7 @@ int main() { char *p = (char *) alloca(1); ; return 0; } EOF -if { (eval echo configure:3517: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3518: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -3545,12 +3546,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:3549: checking whether alloca needs Cray hooks" >&5 +echo "configure:3550: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3554 "configure" +#line 3555 "configure" #include "confdefs.h" #if defined(CRAY) && ! defined(CRAY2) webecray @@ -3575,12 +3576,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3579: checking for $ac_func" >&5 +echo "configure:3580: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3584 "configure" +#line 3585 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3603,7 +3604,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3608: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3630,7 +3631,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:3634: checking stack direction for C alloca" >&5 +echo "configure:3635: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3638,7 +3639,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <<EOF -#line 3642 "configure" +#line 3643 "configure" #include "confdefs.h" find_stack_direction () { @@ -3657,7 +3658,7 @@ main () exit (find_stack_direction() < 0); } EOF -if { (eval echo configure:3661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3662: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -3680,7 +3681,7 @@ fi echo $ac_n "checking for socketpair in -lsocket""... $ac_c" 1>&6 -echo "configure:3684: checking for socketpair in -lsocket" >&5 +echo "configure:3685: checking for socketpair in -lsocket" >&5 ac_lib_var=`echo socket'_'socketpair | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3688,7 +3689,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <<EOF -#line 3692 "configure" +#line 3693 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3699,7 +3700,7 @@ int main() { socketpair() ; return 0; } EOF -if { (eval echo configure:3703: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3704: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3729,12 +3730,12 @@ fi for ac_func in socketpair do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3733: checking for $ac_func" >&5 +echo "configure:3734: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3738 "configure" +#line 3739 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3757,7 +3758,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3761: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3762: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3784,12 +3785,12 @@ done echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6 -echo "configure:3788: checking whether malloc must be declared" >&5 +echo "configure:3789: checking whether malloc must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_malloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3793 "configure" +#line 3794 "configure" #include "confdefs.h" #include <stdio.h> @@ -3810,7 +3811,7 @@ int main() { char *(*pfn) = (char *(*)) malloc ; return 0; } EOF -if { (eval echo configure:3814: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3815: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_malloc=no else @@ -3831,12 +3832,12 @@ EOF fi echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6 -echo "configure:3835: checking whether realloc must be declared" >&5 +echo "configure:3836: checking whether realloc must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_realloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3840 "configure" +#line 3841 "configure" #include "confdefs.h" #include <stdio.h> @@ -3857,7 +3858,7 @@ int main() { char *(*pfn) = (char *(*)) realloc ; return 0; } EOF -if { (eval echo configure:3861: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3862: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_realloc=no else @@ -3878,12 +3879,12 @@ EOF fi echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6 -echo "configure:3882: checking whether free must be declared" >&5 +echo "configure:3883: checking whether free must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3887 "configure" +#line 3888 "configure" #include "confdefs.h" #include <stdio.h> @@ -3904,7 +3905,7 @@ int main() { char *(*pfn) = (char *(*)) free ; return 0; } EOF -if { (eval echo configure:3908: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3909: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_free=no else @@ -3925,12 +3926,12 @@ EOF fi echo $ac_n "checking whether strerror must be declared""... $ac_c" 1>&6 -echo "configure:3929: checking whether strerror must be declared" >&5 +echo "configure:3930: checking whether strerror must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strerror'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3934 "configure" +#line 3935 "configure" #include "confdefs.h" #include <stdio.h> @@ -3951,7 +3952,7 @@ int main() { char *(*pfn) = (char *(*)) strerror ; return 0; } EOF -if { (eval echo configure:3955: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3956: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strerror=no else @@ -3972,12 +3973,12 @@ EOF fi echo $ac_n "checking whether strdup must be declared""... $ac_c" 1>&6 -echo "configure:3976: checking whether strdup must be declared" >&5 +echo "configure:3977: checking whether strdup must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strdup'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3981 "configure" +#line 3982 "configure" #include "confdefs.h" #include <stdio.h> @@ -3998,7 +3999,7 @@ int main() { char *(*pfn) = (char *(*)) strdup ; return 0; } EOF -if { (eval echo configure:4002: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4003: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strdup=no else @@ -4019,12 +4020,12 @@ EOF fi echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6 -echo "configure:4023: checking whether strstr must be declared" >&5 +echo "configure:4024: checking whether strstr must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4028 "configure" +#line 4029 "configure" #include "confdefs.h" #include <stdio.h> @@ -4045,7 +4046,7 @@ int main() { char *(*pfn) = (char *(*)) strstr ; return 0; } EOF -if { (eval echo configure:4049: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4050: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strstr=no else @@ -4072,9 +4073,9 @@ fi # could be expunged. --jsm 1999-03-22 echo $ac_n "checking for HPUX save_state structure""... $ac_c" 1>&6 -echo "configure:4076: checking for HPUX save_state structure" >&5 +echo "configure:4077: checking for HPUX save_state structure" >&5 cat > conftest.$ac_ext <<EOF -#line 4078 "configure" +#line 4079 "configure" #include "confdefs.h" #include <machine/save_state.h> EOF @@ -4089,7 +4090,7 @@ fi rm -f conftest* cat > conftest.$ac_ext <<EOF -#line 4093 "configure" +#line 4094 "configure" #include "confdefs.h" #include <machine/save_state.h> EOF @@ -4141,7 +4142,7 @@ EOF gdb_cv_hostos_is_solaris=yes ;; esac echo $ac_n "checking for directory proc entries""... $ac_c" 1>&6 -echo "configure:4145: checking for directory proc entries" >&5 +echo "configure:4146: checking for directory proc entries" >&5 # The [gdb_host != sun4sol2] hack is because Solaris does provide the # multiple procfs files as of Solaris 2.6, but GDB can't use it right now. if test "$ac_cv_header_sys_procfs_h" = yes -a \ @@ -4163,19 +4164,19 @@ fi if test "$ac_cv_header_sys_procfs_h" = yes; then echo $ac_n "checking for pstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4167: checking for pstatus_t in sys/procfs.h" >&5 +echo "configure:4168: checking for pstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4172 "configure" +#line 4173 "configure" #include "confdefs.h" #include <sys/procfs.h> int main() { pstatus_t avar ; return 0; } EOF -if { (eval echo configure:4179: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4180: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pstatus_t=yes else @@ -4197,19 +4198,19 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus_t" 1>&6 echo $ac_n "checking for prrun_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4201: checking for prrun_t in sys/procfs.h" >&5 +echo "configure:4202: checking for prrun_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prrun_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4206 "configure" +#line 4207 "configure" #include "confdefs.h" #include <sys/procfs.h> int main() { prrun_t avar ; return 0; } EOF -if { (eval echo configure:4213: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4214: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prrun_t=yes else @@ -4231,19 +4232,19 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prrun_t" 1>&6 echo $ac_n "checking for gregset_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4235: checking for gregset_t in sys/procfs.h" >&5 +echo "configure:4236: checking for gregset_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_gregset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4240 "configure" +#line 4241 "configure" #include "confdefs.h" #include <sys/procfs.h> int main() { gregset_t avar ; return 0; } EOF -if { (eval echo configure:4247: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4248: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_gregset_t=yes else @@ -4265,19 +4266,19 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_gregset_t" 1>&6 echo $ac_n "checking for fpregset_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4269: checking for fpregset_t in sys/procfs.h" >&5 +echo "configure:4270: checking for fpregset_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_fpregset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4274 "configure" +#line 4275 "configure" #include "confdefs.h" #include <sys/procfs.h> int main() { fpregset_t avar ; return 0; } EOF -if { (eval echo configure:4281: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4282: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_fpregset_t=yes else @@ -4301,12 +4302,12 @@ EOF echo $ac_n "checking for PIOCSET ioctl entry in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4305: checking for PIOCSET ioctl entry in sys/procfs.h" >&5 +echo "configure:4306: checking for PIOCSET ioctl entry in sys/procfs.h" >&5 if eval "test \"`echo '$''{'gdb_cv_have_procfs_piocset'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4310 "configure" +#line 4311 "configure" #include "confdefs.h" #include <unistd.h> #include <sys/types.h> @@ -4319,7 +4320,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:4323: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4324: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_procfs_piocset=yes else @@ -4341,7 +4342,7 @@ EOF fi echo $ac_n "checking for main in -lm""... $ac_c" 1>&6 -echo "configure:4345: checking for main in -lm" >&5 +echo "configure:4346: checking for main in -lm" >&5 ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4349,14 +4350,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <<EOF -#line 4353 "configure" +#line 4354 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:4360: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4361: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4385,7 +4386,7 @@ fi echo $ac_n "checking for wctype in -lc""... $ac_c" 1>&6 -echo "configure:4389: checking for wctype in -lc" >&5 +echo "configure:4390: checking for wctype in -lc" >&5 ac_lib_var=`echo c'_'wctype | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4393,7 +4394,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lc $LIBS" cat > conftest.$ac_ext <<EOF -#line 4397 "configure" +#line 4398 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4404,7 +4405,7 @@ int main() { wctype() ; return 0; } EOF -if { (eval echo configure:4408: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4423,7 +4424,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for wctype in -lw""... $ac_c" 1>&6 -echo "configure:4427: checking for wctype in -lw" >&5 +echo "configure:4428: checking for wctype in -lw" >&5 ac_lib_var=`echo w'_'wctype | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4431,7 +4432,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lw $LIBS" cat > conftest.$ac_ext <<EOF -#line 4435 "configure" +#line 4436 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4442,7 +4443,7 @@ int main() { wctype() ; return 0; } EOF -if { (eval echo configure:4446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4447: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4474,12 +4475,12 @@ fi echo $ac_n "checking for long long support in compiler""... $ac_c" 1>&6 -echo "configure:4478: checking for long long support in compiler" >&5 +echo "configure:4479: checking for long long support in compiler" >&5 if eval "test \"`echo '$''{'gdb_cv_c_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4483 "configure" +#line 4484 "configure" #include "confdefs.h" int main() { @@ -4489,7 +4490,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:4493: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4494: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_c_long_long=yes else @@ -4511,7 +4512,7 @@ fi echo $ac_n "checking for long long support in printf""... $ac_c" 1>&6 -echo "configure:4515: checking for long long support in printf" >&5 +echo "configure:4516: checking for long long support in printf" >&5 if eval "test \"`echo '$''{'gdb_cv_printf_has_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4519,7 +4520,7 @@ else gdb_cv_printf_has_long_long=no else cat > conftest.$ac_ext <<EOF -#line 4523 "configure" +#line 4524 "configure" #include "confdefs.h" int main () { @@ -4533,7 +4534,7 @@ int main () { return (strcmp ("0x0123456789abcdef", buf)); } EOF -if { (eval echo configure:4537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4538: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then gdb_cv_printf_has_long_long=yes else @@ -4557,19 +4558,19 @@ echo "$ac_t""$gdb_cv_printf_has_long_long" 1>&6 echo $ac_n "checking for long double support in compiler""... $ac_c" 1>&6 -echo "configure:4561: checking for long double support in compiler" >&5 +echo "configure:4562: checking for long double support in compiler" >&5 if eval "test \"`echo '$''{'ac_cv_c_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4566 "configure" +#line 4567 "configure" #include "confdefs.h" int main() { long double foo; ; return 0; } EOF -if { (eval echo configure:4573: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4574: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_long_double=yes else @@ -4591,7 +4592,7 @@ fi echo $ac_n "checking for long double support in printf""... $ac_c" 1>&6 -echo "configure:4595: checking for long double support in printf" >&5 +echo "configure:4596: checking for long double support in printf" >&5 if eval "test \"`echo '$''{'gdb_cv_printf_has_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4599,7 +4600,7 @@ else gdb_cv_printf_has_long_double=no else cat > conftest.$ac_ext <<EOF -#line 4603 "configure" +#line 4604 "configure" #include "confdefs.h" int main () { @@ -4609,7 +4610,7 @@ int main () { return (strncmp ("3.14159", buf, 7)); } EOF -if { (eval echo configure:4613: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4614: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then gdb_cv_printf_has_long_double=yes else @@ -4633,7 +4634,7 @@ echo "$ac_t""$gdb_cv_printf_has_long_double" 1>&6 echo $ac_n "checking for long double support in scanf""... $ac_c" 1>&6 -echo "configure:4637: checking for long double support in scanf" >&5 +echo "configure:4638: checking for long double support in scanf" >&5 if eval "test \"`echo '$''{'gdb_cv_scanf_has_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4641,7 +4642,7 @@ else gdb_cv_scanf_has_long_double=no else cat > conftest.$ac_ext <<EOF -#line 4645 "configure" +#line 4646 "configure" #include "confdefs.h" int main () { @@ -4651,7 +4652,7 @@ int main () { return !(f > 3.14159 && f < 3.14160); } EOF -if { (eval echo configure:4655: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then gdb_cv_scanf_has_long_double=yes else @@ -4677,17 +4678,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4681: checking for $ac_hdr" >&5 +echo "configure:4682: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4686 "configure" +#line 4687 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4691: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4692: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4716,12 +4717,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4720: checking for $ac_func" >&5 +echo "configure:4721: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4725 "configure" +#line 4726 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -4744,7 +4745,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:4748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4749: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4769,7 +4770,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:4773: checking for working mmap" >&5 +echo "configure:4774: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4777,7 +4778,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <<EOF -#line 4781 "configure" +#line 4782 "configure" #include "confdefs.h" /* Thanks to Mike Haertel and Jim Avera for this test. @@ -4917,7 +4918,7 @@ main() } EOF -if { (eval echo configure:4921: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4922: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -4946,7 +4947,7 @@ if test ${build} = ${host} -a ${host} = ${target} ; then case ${host_os} in hpux*) echo $ac_n "checking for HPUX/OSF thread support""... $ac_c" 1>&6 -echo "configure:4950: checking for HPUX/OSF thread support" >&5 +echo "configure:4951: checking for HPUX/OSF thread support" >&5 if test -f /usr/include/dce/cma_config.h ; then if test "$GCC" = "yes" ; then echo "$ac_t""yes" 1>&6 @@ -4965,7 +4966,7 @@ EOF ;; solaris*) echo $ac_n "checking for Solaris thread debugging library""... $ac_c" 1>&6 -echo "configure:4969: checking for Solaris thread debugging library" >&5 +echo "configure:4970: checking for Solaris thread debugging library" >&5 if test -f /usr/lib/libthread_db.so.1 ; then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF @@ -4975,7 +4976,7 @@ EOF CONFIG_OBS="${CONFIG_OBS} sol-thread.o" CONFIG_SRCS="${CONFIG_SRCS} sol-thread.c" echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:4979: checking for dlopen in -ldl" >&5 +echo "configure:4980: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4983,7 +4984,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <<EOF -#line 4987 "configure" +#line 4988 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4994,7 +4995,7 @@ int main() { dlopen() ; return 0; } EOF -if { (eval echo configure:4998: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5026,17 +5027,17 @@ fi # all symbols visible in the dynamic symbol table. hold_ldflags=$LDFLAGS echo $ac_n "checking for the ld -export-dynamic flag""... $ac_c" 1>&6 -echo "configure:5030: checking for the ld -export-dynamic flag" >&5 +echo "configure:5031: checking for the ld -export-dynamic flag" >&5 LDFLAGS="${LDFLAGS} -Wl,-export-dynamic" cat > conftest.$ac_ext <<EOF -#line 5033 "configure" +#line 5034 "configure" #include "confdefs.h" int main() { int i; ; return 0; } EOF -if { (eval echo configure:5040: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5041: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* found=yes else @@ -5055,13 +5056,13 @@ rm -f conftest* # Sun randomly tweaked the prototypes in <proc_service.h> # at one point. echo $ac_n "checking if <proc_service.h> is old""... $ac_c" 1>&6 -echo "configure:5059: checking if <proc_service.h> is old" >&5 +echo "configure:5060: checking if <proc_service.h> is old" >&5 if eval "test \"`echo '$''{'gdb_cv_proc_service_is_old'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5065 "configure" +#line 5066 "configure" #include "confdefs.h" #include <proc_service.h> @@ -5072,7 +5073,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:5076: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5077: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_proc_service_is_old=no else @@ -5166,14 +5167,22 @@ else build_warnings="" fi +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 + MMALLOC_CFLAGS= MMALLOC= @@ -5207,12 +5216,12 @@ fi # In the Cygwin environment, we need some additional flags. echo $ac_n "checking for cygwin""... $ac_c" 1>&6 -echo "configure:5334: checking for cygwin" >&5 +echo "configure:5343: checking for cygwin" >&5 if eval "test \"`echo '$''{'gdb_cv_os_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5339 "configure" +#line 5348 "configure" #include "confdefs.h" #if defined (__CYGWIN__) || defined (__CYGWIN32__) @@ -5246,7 +5255,7 @@ if test x$gdb_cv_os_cygwin = xyes; then else TERM_LIB= echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6 -echo "configure:5373: checking for tgetent in -lncurses" >&5 +echo "configure:5382: checking for tgetent in -lncurses" >&5 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5254,7 +5263,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lncurses $LIBS" cat > conftest.$ac_ext <<EOF -#line 5381 "configure" +#line 5390 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -5265,7 +5274,7 @@ int main() { tgetent() ; return 0; } EOF -if { (eval echo configure:5392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5401: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5284,7 +5293,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -lHcurses""... $ac_c" 1>&6 -echo "configure:5411: checking for tgetent in -lHcurses" >&5 +echo "configure:5420: checking for tgetent in -lHcurses" >&5 ac_lib_var=`echo Hcurses'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5292,7 +5301,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lHcurses $LIBS" cat > conftest.$ac_ext <<EOF -#line 5419 "configure" +#line 5428 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -5303,7 +5312,7 @@ int main() { tgetent() ; return 0; } EOF -if { (eval echo configure:5430: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5322,7 +5331,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -ltermlib""... $ac_c" 1>&6 -echo "configure:5449: checking for tgetent in -ltermlib" >&5 +echo "configure:5458: checking for tgetent in -ltermlib" >&5 ac_lib_var=`echo termlib'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5330,7 +5339,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ltermlib $LIBS" cat > conftest.$ac_ext <<EOF -#line 5457 "configure" +#line 5466 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -5341,7 +5350,7 @@ int main() { tgetent() ; return 0; } EOF -if { (eval echo configure:5468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5477: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5360,7 +5369,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6 -echo "configure:5487: checking for tgetent in -ltermcap" >&5 +echo "configure:5496: checking for tgetent in -ltermcap" >&5 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5368,7 +5377,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ltermcap $LIBS" cat > conftest.$ac_ext <<EOF -#line 5495 "configure" +#line 5504 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -5379,7 +5388,7 @@ int main() { tgetent() ; return 0; } EOF -if { (eval echo configure:5506: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5398,7 +5407,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6 -echo "configure:5525: checking for tgetent in -lcurses" >&5 +echo "configure:5534: checking for tgetent in -lcurses" >&5 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5406,7 +5415,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcurses $LIBS" cat > conftest.$ac_ext <<EOF -#line 5533 "configure" +#line 5542 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -5417,7 +5426,7 @@ int main() { tgetent() ; return 0; } EOF -if { (eval echo configure:5544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5553: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5436,7 +5445,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -lterminfo""... $ac_c" 1>&6 -echo "configure:5563: checking for tgetent in -lterminfo" >&5 +echo "configure:5572: checking for tgetent in -lterminfo" >&5 ac_lib_var=`echo terminfo'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5444,7 +5453,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lterminfo $LIBS" cat > conftest.$ac_ext <<EOF -#line 5571 "configure" +#line 5580 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -5455,7 +5464,7 @@ int main() { tgetent() ; return 0; } EOF -if { (eval echo configure:5582: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5591: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5507,7 +5516,7 @@ fi # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 -echo "configure:6718: checking for X" >&5 +echo "configure:6727: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -5569,12 +5578,12 @@ if test "$ac_x_includes" = NO; then # First, try using that file with no special directory specified. cat > conftest.$ac_ext <<EOF -#line 6780 "configure" +#line 6789 "configure" #include "confdefs.h" #include <$x_direct_test_include> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6785: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6794: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5643,14 +5652,14 @@ if test "$ac_x_libraries" = NO; then ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <<EOF -#line 6854 "configure" +#line 6863 "configure" #include "confdefs.h" int main() { ${x_direct_test_function}() ; return 0; } EOF -if { (eval echo configure:6861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. @@ -5930,12 +5939,12 @@ fi echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:7212: checking for Cygwin environment" >&5 +echo "configure:7221: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7217 "configure" +#line 7226 "configure" #include "confdefs.h" int main() { @@ -5946,7 +5955,7 @@ int main() { return __CYGWIN__; ; return 0; } EOF -if { (eval echo configure:7228: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7237: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -5963,19 +5972,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:7245: checking for mingw32 environment" >&5 +echo "configure:7254: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7250 "configure" +#line 7259 "configure" #include "confdefs.h" int main() { return __MINGW32__; ; return 0; } EOF -if { (eval echo configure:7257: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7266: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -5994,7 +6003,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:7276: checking for executable suffix" >&5 +echo "configure:7285: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6004,7 +6013,7 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:7286: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:7295: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj) ;; @@ -6210,6 +6219,7 @@ s%@CONFIG_LDFLAGS@%$CONFIG_LDFLAGS%g s%@BUILD_TUI@%$BUILD_TUI%g s%@TUI_LIBRARY@%$TUI_LIBRARY%g s%@WARN_CFLAGS@%$WARN_CFLAGS%g +s%@WERROR_CFLAGS@%$WERROR_CFLAGS%g s%@MMALLOC_CFLAGS@%$MMALLOC_CFLAGS%g s%@MMALLOC@%$MMALLOC%g s%@MACHINE_OBS@%$MACHINE_OBS%g diff --git a/gdb/configure.host b/gdb/configure.host index dae1801a..a4acf1b 100644 --- a/gdb/configure.host +++ b/gdb/configure.host @@ -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 ;; diff --git a/gdb/configure.in b/gdb/configure.in index 5707546..f558110 100644 --- a/gdb/configure.in +++ b/gdb/configure.in @@ -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= diff --git a/gdb/configure.tgt b/gdb/configure.tgt index 312b050..1994911 100644 --- a/gdb/configure.tgt +++ b/gdb/configure.tgt @@ -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" ;; diff --git a/gdb/corelow.c b/gdb/corelow.c index 3e405de..816fbed 100644 --- a/gdb/corelow.c +++ b/gdb/corelow.c @@ -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" diff --git a/gdb/d10v-tdep.c b/gdb/d10v-tdep.c index 5d191a3..902f36b 100644 --- a/gdb/d10v-tdep.c +++ b/gdb/d10v-tdep.c @@ -33,6 +33,7 @@ #include "dis-asm.h" #include "symfile.h" #include "objfiles.h" +#include "language.h" struct frame_extra_info { @@ -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; -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)); +/* 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); -extern char* preg_nz PARAMS ((t_reg reg)); +typedef bfd_vma t_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 */ diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 98e37cf..9217a4b 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -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 diff --git a/gdb/doc/Makefile.in b/gdb/doc/Makefile.in index ad93b5e..9cbacbb 100644 --- a/gdb/doc/Makefile.in +++ b/gdb/doc/Makefile.in @@ -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) diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 7d77765..bfa9cc4 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -142,6 +142,7 @@ Copyright (C) 1988-1999 Free Software Foundation, Inc. * Altering:: Altering execution * GDB Files:: @value{GDBN} files * Targets:: Specifying a debugging target +* Configurations:: Configuration-specific information * Controlling GDB:: Controlling @value{GDBN} * Sequences:: Canned sequences of commands * Emacs:: Using @value{GDBN} under @sc{gnu} Emacs @@ -1299,7 +1300,6 @@ kill a child process. * Input/Output:: Your program's input and output * Attach:: Debugging an already-running process * Kill Process:: Killing the child process -* Process Information:: Additional process information * Threads:: Debugging programs with multiple threads * Processes:: Debugging programs with multiple processes @@ -1691,51 +1691,6 @@ next type @code{run}, @value{GDBN} notices that the file has changed, and reads the symbol table again (while trying to preserve your current breakpoint settings). -@node Process Information -@section Additional process information - -@kindex /proc -@cindex process image - -Some operating systems provide a facility called @samp{/proc} that can -be used to examine the image of a running process using file-system -subroutines. If @value{GDBN} is configured for an operating system with this -facility, the command @code{info proc} is available to report on several -kinds of information about the process running your program. -@code{info proc} works only on SVR4 systems that support @code{procfs}. -This includes OSF/1 (Digital Unix), Solaris, Irix, and Unixware, -but not HP-UX or Linux, for example. - -@table @code -@kindex info proc -@item info proc -Summarize available information about the process. - -@kindex info proc mappings -@item info proc mappings -Report on the address ranges accessible in the program, with information -on whether your program may read, write, or execute each range. - -@kindex info proc times -@item info proc times -Starting time, user CPU time, and system CPU time for your program and -its children. - -@kindex info proc id -@item info proc id -Report on the process IDs related to your program: its own process ID, -the ID of its parent, the process group ID, and the session ID. - -@kindex info proc status -@item info proc status -General information on the state of the process. If the process is -stopped, this report includes the reason for stopping, and any signal -received. - -@item info proc all -Show all the above information about the process. -@end table - @node Threads @section Debugging programs with multiple threads @@ -3392,7 +3347,6 @@ currently executing frame and describes it briefly, similar to the * Backtrace:: Backtraces * Selection:: Selecting a frame * Frame Info:: Information on a frame -* Alpha/MIPS Stack:: Alpha and MIPS machines and the function stack @end menu @@ -3684,40 +3638,6 @@ exception handlers, visit the associated frame (using the @code{up}, @end table -@node Alpha/MIPS Stack -@section MIPS/Alpha machines and the function stack - -@cindex stack on Alpha -@cindex stack on MIPS -@cindex Alpha stack -@cindex MIPS stack -Alpha- and MIPS-based computers use an unusual stack frame, which -sometimes requires @value{GDBN} to search backward in the object code to -find the beginning of a function. - -@cindex response time, MIPS debugging -To improve response time (especially for embedded applications, where -@value{GDBN} may be restricted to a slow serial line for this search) -you may want to limit the size of this search, using one of these -commands: - -@table @code -@cindex @code{heuristic-fence-post} (Alpha,MIPS) -@item set heuristic-fence-post @var{limit} -Restrict @value{GDBN} to examining at most @var{limit} bytes in its search -for the beginning of a function. A value of @var{0} (the default) -means there is no limit. However, except for @var{0}, the larger the -limit the more bytes @code{heuristic-fence-post} must search and -therefore the longer it takes to run. - -@item show heuristic-fence-post -Display the current limit. -@end table - -@noindent -These commands are available @emph{only} when @value{GDBN} is configured -for debugging programs on Alpha or MIPS processors. - @node Source @chapter Examining Source Files @@ -5226,27 +5146,6 @@ code generated by your compiler. If some registers are not saved, or if @value{GDBN} is unable to locate the saved registers, the selected stack frame makes no difference. -@table @code -@kindex set rstack_high_address -@cindex AMD 29K register stack -@cindex register stack, AMD29K -@item set rstack_high_address @var{address} -On AMD 29000 family processors, registers are saved in a separate -``register stack''. There is no way for @value{GDBN} to determine the extent -of this stack. Normally, @value{GDBN} just assumes that the stack is ``large -enough''. This may result in @value{GDBN} referencing memory locations that -do not exist. If necessary, you can get around this problem by -specifying the ending address of the register stack with the @code{set -rstack_high_address} command. The argument should be an address, which -you probably want to precede with @samp{0x} to specify in -hexadecimal. - -@kindex show rstack_high_address -@item show rstack_high_address -Display the current limit of the register stack, on AMD 29000 family -processors. -@end table - @node Floating Point Hardware @section Floating point hardware @cindex floating point @@ -5639,7 +5538,7 @@ language reference or tutorial. @menu * C:: C and C++ * Modula-2:: Modula-2 -* Chill:: Chill +* Chill:: Chill @end menu @node C @@ -6607,8 +6506,8 @@ This section covers the following Chill related topics and the features of @value{GDBN} which support these topics. @menu -* How modes are displayed:: How modes are displayed -* Locations:: Locations and their accesses +* How modes are displayed:: How modes are displayed +* Locations:: Locations and their accesses * Values and their Operations:: Values and their Operations * Chill type and range checks:: * Chill defaults:: @@ -8074,176 +7973,29 @@ it somewhere in memory where it won't get clobbered by the download. @kindex target sim @item target sim -CPU simulator. @xref{Simulator,,Simulated CPU Target}. +Builtin CPU simulator. GDB includes simulators for most architectures. +In general, +@example + target sim + load + run +@end example +works; however, you cannot assume that a specific memory map, device +drivers, or even basic I/O is available, although some simulator do +provide these. For info about any processor-specific simulator details, +see the appropriate section in @ref{Embedded Processors, ,Embedded +Processors}. + @end table -The following targets are all CPU-specific, and only available for -specific configurations. -@c should organize by CPU +Some configurations may include these targets as well: @table @code -@kindex target abug -@item target abug @var{dev} -ABug ROM monitor for M68K. - -@kindex target adapt -@item target adapt @var{dev} -Adapt monitor for A29K. - -@kindex target amd-eb -@item target amd-eb @var{dev} @var{speed} @var{PROG} -@cindex AMD EB29K -Remote PC-resident AMD EB29K board, attached over serial lines. -@var{dev} is the serial device, as for @code{target remote}; -@var{speed} allows you to specify the linespeed; and @var{PROG} is the -name of the program to be debugged, as it appears to DOS on the PC. -@xref{EB29K Remote, ,The EBMON protocol for AMD29K}. - -@kindex target array -@item target array @var{dev} -Array Tech LSI33K RAID controller board. - -@kindex target bug -@item target bug @var{dev} -BUG monitor, running on a MVME187 (m88k) board. - -@kindex target cpu32bug -@item target cpu32bug @var{dev} -CPU32BUG monitor, running on a CPU32 (M68K) board. - -@kindex target dbug -@item target dbug @var{dev} -dBUG ROM monitor for Motorola ColdFire. - -@kindex target ddb -@item target ddb @var{dev} -NEC's DDB monitor for Mips Vr4300. - -@kindex target dink32 -@item target dink32 @var{dev} -DINK32 ROM monitor for PowerPC. - -@kindex target e7000 -@item target e7000 @var{dev} -E7000 emulator for Hitachi H8 and SH. - -@kindex target es1800 -@item target es1800 @var{dev} -ES-1800 emulator for M68K. - -@kindex target est -@item target est @var{dev} -EST-300 ICE monitor, running on a CPU32 (M68K) board. - -@kindex target hms -@item target hms @var{dev} -A Hitachi SH, H8/300, or H8/500 board, attached via serial line to your host. -Use special commands @code{device} and @code{speed} to control the serial -line and the communications speed used. -@xref{Hitachi Remote,,@value{GDBN} and Hitachi Microprocessors}. - -@kindex target lsi -@item target lsi @var{dev} -LSI ROM monitor for Mips. - -@kindex target m32r -@item target m32r @var{dev} -Mitsubishi M32R/D ROM monitor. - -@kindex target mips -@item target mips @var{dev} -IDT/SIM ROM monitor for Mips. - -@kindex target mon960 -@item target mon960 @var{dev} -MON960 monitor for Intel i960. - -@kindex target nindy -@item target nindy @var{devicename} -An Intel 960 board controlled by a Nindy Monitor. @var{devicename} is -the name of the serial device to use for the connection, e.g. -@file{/dev/ttya}. @xref{i960-Nindy Remote, ,@value{GDBN} with a remote i960 (Nindy)}. - @kindex target nrom @item target nrom @var{dev} NetROM ROM emulator. This target only supports downloading. -@kindex target op50n -@item target op50n @var{dev} -OP50N monitor, running on an OKI HPPA board. - -@kindex target pmon -@item target pmon @var{dev} -PMON ROM monitor for Mips. - -@kindex target ppcbug -@item target ppcbug @var{dev} -@kindex target ppcbug1 -@item target ppcbug1 @var{dev} -PPCBUG ROM monitor for PowerPC. - -@kindex target r3900 -@item target r3900 @var{dev} -Densan DVE-R3900 ROM monitor for Toshiba R3900 Mips. - -@kindex target rdi -@item target rdi @var{dev} -ARM Angel monitor, via RDI library interface. - -@kindex target rdp -@item target rdp @var{dev} -ARM Demon monitor. - -@kindex target rom68k -@item target rom68k @var{dev} -ROM 68K monitor, running on an M68K IDP board. - -@kindex target rombug -@item target rombug @var{dev} -ROMBUG ROM monitor for OS/9000. - -@kindex target sds -@item target sds @var{dev} -SDS monitor, running on a PowerPC board (such as Motorola's ADS). - -@kindex target sparclite -@item target sparclite @var{dev} -Fujitsu sparclite boards, used only for the purpose of loading. -You must use an additional command to debug the program. -For example: target remote @var{dev} using @value{GDBN} standard -remote protocol. - -@kindex target sh3 -@kindex target sh3e -@item target sh3 @var{dev} -@item target sh3e @var{dev} -Hitachi SH-3 and SH-3E target systems. - -@kindex target st2000 -@item target st2000 @var{dev} @var{speed} -A Tandem ST2000 phone switch, running Tandem's STDBUG protocol. @var{dev} -is the name of the device attached to the ST2000 serial line; -@var{speed} is the communication line speed. The arguments are not used -if @value{GDBN} is configured to connect to the ST2000 using TCP or Telnet. -@xref{ST2000 Remote,,@value{GDBN} with a Tandem ST2000}. - -@kindex target udi -@item target udi @var{keyword} -Remote AMD29K target, using the AMD UDI protocol. The @var{keyword} -argument specifies which 29K board or simulator to use. @xref{UDI29K -Remote,,The UDI protocol for AMD29K}. - -@kindex target vxworks -@item target vxworks @var{machinename} -A VxWorks system, attached via TCP/IP. The argument @var{machinename} -is the target system's machine name or IP address. -@xref{VxWorks Remote, ,@value{GDBN} and VxWorks}. - -@kindex target w89k -@item target w89k @var{dev} -W89K monitor, running on a Winbond HPPA board. - @end table Different targets are available on different configurations of @value{GDBN}; @@ -8273,24 +8025,6 @@ link the program; for other formats, like a.out, the object file format specifies a fixed address. @c FIXME! This would be a good place for an xref to the GNU linker doc. -On VxWorks, @code{load} links @var{filename} dynamically on the -current target system as well as adding its symbols in @value{GDBN}. - -@cindex download to Nindy-960 -With the Nindy interface to an Intel 960 board, @code{load} -downloads @var{filename} to the 960 as well as adding its symbols in -@value{GDBN}. - -@cindex download to H8/300 or H8/500 -@cindex H8/300 or H8/500 download -@cindex download to Hitachi SH -@cindex Hitachi SH download -When you select remote debugging to a Hitachi SH, H8/300, or H8/500 board -(@pxref{Hitachi Remote,,@value{GDBN} and Hitachi Microprocessors}), -the @code{load} command downloads your program to the Hitachi board and also -opens it as the current executable target for @value{GDBN} on your host -(like the @code{file} command). - @code{load} does not repeat if you press @key{RET} again after using it. @end table @@ -8354,27 +8088,1173 @@ communicate with @value{GDBN}. Other remote targets may be available in your configuration of @value{GDBN}; use @code{help target} to list them. -@c Text on starting up GDB in various specific cases; it goes up front -@c in manuals configured for any of those particular situations, here -@c otherwise. @menu * Remote Serial:: @value{GDBN} remote serial protocol -* i960-Nindy Remote:: @value{GDBN} with a remote i960 (Nindy) -* UDI29K Remote:: The UDI protocol for AMD29K -* EB29K Remote:: The EBMON protocol for AMD29K -* VxWorks Remote:: @value{GDBN} and VxWorks -* ST2000 Remote:: @value{GDBN} with a Tandem ST2000 -* Hitachi Remote:: @value{GDBN} and Hitachi Microprocessors -* MIPS Remote:: @value{GDBN} and MIPS boards -* Sparclet Remote:: @value{GDBN} and Sparclet boards -* Simulator:: Simulated CPU target @end menu -@include remote.texi +@node Remote Serial +@subsection The @value{GDBN} remote serial protocol + +@cindex remote serial debugging, overview +To debug a program running on another machine (the debugging +@dfn{target} machine), you must first arrange for all the usual +prerequisites for the program to run by itself. For example, for a C +program, you need: + +@enumerate +@item +A startup routine to set up the C runtime environment; these usually +have a name like @file{crt0}. The startup routine may be supplied by +your hardware supplier, or you may have to write your own. + +@item +You probably need a C subroutine library to support your program's +subroutine calls, notably managing input and output. + +@item +A way of getting your program to the other machine---for example, a +download program. These are often supplied by the hardware +manufacturer, but you may have to write your own from hardware +documentation. +@end enumerate + +The next step is to arrange for your program to use a serial port to +communicate with the machine where @value{GDBN} is running (the @dfn{host} +machine). In general terms, the scheme looks like this: + +@table @emph +@item On the host, +@value{GDBN} already understands how to use this protocol; when everything +else is set up, you can simply use the @samp{target remote} command +(@pxref{Targets,,Specifying a Debugging Target}). + +@item On the target, +you must link with your program a few special-purpose subroutines that +implement the @value{GDBN} remote serial protocol. The file containing these +subroutines is called a @dfn{debugging stub}. + +On certain remote targets, you can use an auxiliary program +@code{gdbserver} instead of linking a stub into your program. +@xref{Server,,Using the @code{gdbserver} program}, for details. +@end table + +The debugging stub is specific to the architecture of the remote +machine; for example, use @file{sparc-stub.c} to debug programs on +@sc{sparc} boards. + +@cindex remote serial stub list +These working remote stubs are distributed with @value{GDBN}: + +@table @code + +@item i386-stub.c +@kindex i386-stub.c +@cindex Intel +@cindex i386 +For Intel 386 and compatible architectures. + +@item m68k-stub.c +@kindex m68k-stub.c +@cindex Motorola 680x0 +@cindex m680x0 +For Motorola 680x0 architectures. + +@item sh-stub.c +@kindex sh-stub.c +@cindex Hitachi +@cindex SH +For Hitachi SH architectures. + +@item sparc-stub.c +@kindex sparc-stub.c +@cindex Sparc +For @sc{sparc} architectures. + +@item sparcl-stub.c +@kindex sparcl-stub.c +@cindex Fujitsu +@cindex SparcLite +For Fujitsu @sc{sparclite} architectures. + +@end table + +The @file{README} file in the @value{GDBN} distribution may list other +recently added stubs. + +@menu +* Stub Contents:: What the stub can do for you +* Bootstrapping:: What you must do for the stub +* Debug Session:: Putting it all together +* Protocol:: Definition of the communication protocol +* Server:: Using the `gdbserver' program +* NetWare:: Using the `gdbserve.nlm' program +@end menu + +@node Stub Contents +@subsubsection What the stub can do for you + +@cindex remote serial stub +The debugging stub for your architecture supplies these three +subroutines: + +@table @code +@item set_debug_traps +@kindex set_debug_traps +@cindex remote serial stub, initialization +This routine arranges for @code{handle_exception} to run when your +program stops. You must call this subroutine explicitly near the +beginning of your program. + +@item handle_exception +@kindex handle_exception +@cindex remote serial stub, main routine +This is the central workhorse, but your program never calls it +explicitly---the setup code arranges for @code{handle_exception} to +run when a trap is triggered. + +@code{handle_exception} takes control when your program stops during +execution (for example, on a breakpoint), and mediates communications +with @value{GDBN} on the host machine. This is where the communications +protocol is implemented; @code{handle_exception} acts as the @value{GDBN} +representative on the target machine; it begins by sending summary +information on the state of your program, then continues to execute, +retrieving and transmitting any information @value{GDBN} needs, until you +execute a @value{GDBN} command that makes your program resume; at that point, +@code{handle_exception} returns control to your own code on the target +machine. + +@item breakpoint +@cindex @code{breakpoint} subroutine, remote +Use this auxiliary subroutine to make your program contain a +breakpoint. Depending on the particular situation, this may be the only +way for @value{GDBN} to get control. For instance, if your target +machine has some sort of interrupt button, you won't need to call this; +pressing the interrupt button transfers control to +@code{handle_exception}---in effect, to @value{GDBN}. On some machines, +simply receiving characters on the serial port may also trigger a trap; +again, in that situation, you don't need to call @code{breakpoint} from +your own program---simply running @samp{target remote} from the host +@value{GDBN} session gets control. + +Call @code{breakpoint} if none of these is true, or if you simply want +to make certain your program stops at a predetermined point for the +start of your debugging session. +@end table + +@node Bootstrapping +@subsubsection What you must do for the stub + +@cindex remote stub, support routines +The debugging stubs that come with @value{GDBN} are set up for a particular +chip architecture, but they have no information about the rest of your +debugging target machine. + +First of all you need to tell the stub how to communicate with the +serial port. + +@table @code +@item int getDebugChar() +@kindex getDebugChar +Write this subroutine to read a single character from the serial port. +It may be identical to @code{getchar} for your target system; a +different name is used to allow you to distinguish the two if you wish. + +@item void putDebugChar(int) +@kindex putDebugChar +Write this subroutine to write a single character to the serial port. +It may be identical to @code{putchar} for your target system; a +different name is used to allow you to distinguish the two if you wish. +@end table + +@cindex control C, and remote debugging +@cindex interrupting remote targets +If you want @value{GDBN} to be able to stop your program while it is +running, you need to use an interrupt-driven serial driver, and arrange +for it to stop when it receives a @code{^C} (@samp{\003}, the control-C +character). That is the character which @value{GDBN} uses to tell the +remote system to stop. + +Getting the debugging target to return the proper status to @value{GDBN} +probably requires changes to the standard stub; one quick and dirty way +is to just execute a breakpoint instruction (the ``dirty'' part is that +@value{GDBN} reports a @code{SIGTRAP} instead of a @code{SIGINT}). + +Other routines you need to supply are: + +@table @code +@item void exceptionHandler (int @var{exception_number}, void *@var{exception_address}) +@kindex exceptionHandler +Write this function to install @var{exception_address} in the exception +handling tables. You need to do this because the stub does not have any +way of knowing what the exception handling tables on your target system +are like (for example, the processor's table might be in @sc{rom}, +containing entries which point to a table in @sc{ram}). +@var{exception_number} is the exception number which should be changed; +its meaning is architecture-dependent (for example, different numbers +might represent divide by zero, misaligned access, etc). When this +exception occurs, control should be transferred directly to +@var{exception_address}, and the processor state (stack, registers, +and so on) should be just as it is when a processor exception occurs. So if +you want to use a jump instruction to reach @var{exception_address}, it +should be a simple jump, not a jump to subroutine. + +For the 386, @var{exception_address} should be installed as an interrupt +gate so that interrupts are masked while the handler runs. The gate +should be at privilege level 0 (the most privileged level). The +@sc{sparc} and 68k stubs are able to mask interrupts themselves without +help from @code{exceptionHandler}. + +@item void flush_i_cache() +@kindex flush_i_cache +(sparc and sparclite only) Write this subroutine to flush the +instruction cache, if any, on your target machine. If there is no +instruction cache, this subroutine may be a no-op. + +On target machines that have instruction caches, @value{GDBN} requires this +function to make certain that the state of your program is stable. +@end table + +@noindent +You must also make sure this library routine is available: + +@table @code +@item void *memset(void *, int, int) +@kindex memset +This is the standard library function @code{memset} that sets an area of +memory to a known value. If you have one of the free versions of +@code{libc.a}, @code{memset} can be found there; otherwise, you must +either obtain it from your hardware manufacturer, or write your own. +@end table + +If you do not use the GNU C compiler, you may need other standard +library subroutines as well; this varies from one stub to another, +but in general the stubs are likely to use any of the common library +subroutines which @code{gcc} generates as inline code. + + +@node Debug Session +@subsubsection Putting it all together + +@cindex remote serial debugging summary +In summary, when your program is ready to debug, you must follow these +steps. + +@enumerate +@item +Make sure you have the supporting low-level routines +(@pxref{Bootstrapping,,What you must do for the stub}): +@display +@code{getDebugChar}, @code{putDebugChar}, +@code{flush_i_cache}, @code{memset}, @code{exceptionHandler}. +@end display + +@item +Insert these lines near the top of your program: + +@example +set_debug_traps(); +breakpoint(); +@end example + +@item +For the 680x0 stub only, you need to provide a variable called +@code{exceptionHook}. Normally you just use: + +@example +void (*exceptionHook)() = 0; +@end example + +but if before calling @code{set_debug_traps}, you set it to point to a +function in your program, that function is called when +@code{@value{GDBN}} continues after stopping on a trap (for example, bus +error). The function indicated by @code{exceptionHook} is called with +one parameter: an @code{int} which is the exception number. + +@item +Compile and link together: your program, the @value{GDBN} debugging stub for +your target architecture, and the supporting subroutines. + +@item +Make sure you have a serial connection between your target machine and +the @value{GDBN} host, and identify the serial port on the host. + +@item +@c The "remote" target now provides a `load' command, so we should +@c document that. FIXME. +Download your program to your target machine (or get it there by +whatever means the manufacturer provides), and start it. + +@item +To start remote debugging, run @value{GDBN} on the host machine, and specify +as an executable file the program that is running in the remote machine. +This tells @value{GDBN} how to find your program's symbols and the contents +of its pure text. + +@cindex serial line, @code{target remote} +Then establish communication using the @code{target remote} command. +Its argument specifies how to communicate with the target +machine---either via a devicename attached to a direct serial line, or a +TCP port (usually to a terminal server which in turn has a serial line +to the target). For example, to use a serial line connected to the +device named @file{/dev/ttyb}: + +@example +target remote /dev/ttyb +@end example + +@cindex TCP port, @code{target remote} +To use a TCP connection, use an argument of the form +@code{@var{host}:port}. For example, to connect to port 2828 on a +terminal server named @code{manyfarms}: + +@example +target remote manyfarms:2828 +@end example +@end enumerate + +Now you can use all the usual commands to examine and change data and to +step and continue the remote program. + +To resume the remote program and stop debugging it, use the @code{detach} +command. + +@cindex interrupting remote programs +@cindex remote programs, interrupting +Whenever @value{GDBN} is waiting for the remote program, if you type the +interrupt character (often @key{C-C}), @value{GDBN} attempts to stop the +program. This may or may not succeed, depending in part on the hardware +and the serial drivers the remote system uses. If you type the +interrupt character once again, @value{GDBN} displays this prompt: + +@example +Interrupted while waiting for the program. +Give up (and stop debugging it)? (y or n) +@end example + +If you type @kbd{y}, @value{GDBN} abandons the remote debugging session. +(If you decide you want to try again later, you can use @samp{target +remote} again to connect once more.) If you type @kbd{n}, @value{GDBN} +goes back to waiting. + +@node Protocol +@subsubsection Communication protocol + +@cindex debugging stub, example +@cindex remote stub, example +@cindex stub example, remote debugging +The stub files provided with @value{GDBN} implement the target side of the +communication protocol, and the @value{GDBN} side is implemented in the +@value{GDBN} source file @file{remote.c}. Normally, you can simply allow +these subroutines to communicate, and ignore the details. (If you're +implementing your own stub file, you can still ignore the details: start +with one of the existing stub files. @file{sparc-stub.c} is the best +organized, and therefore the easiest to read.) + +However, there may be occasions when you need to know something about +the protocol---for example, if there is only one serial port to your +target machine, you might want your program to do something special if +it recognizes a packet meant for @value{GDBN}. + +In the examples below, @samp{<-} and @samp{->} are used to indicate +transmitted and received data respectfully. + +@cindex protocol, @value{GDBN} remote serial +@cindex serial protocol, @value{GDBN} remote +@cindex remote serial protocol +All @value{GDBN} commands and responses (other than acknowledgments) +are sent as a @var{packet}. A @var{packet} is introduced with the +character @samp{$}, this is followed by an optional two-digit +@var{sequence-id} and the character @samp{:}, the actual +@var{packet-data}, and the terminating character @samp{#} followed by a +two-digit @var{checksum}: + +@example +@code{$}@var{packet-data}@code{#}@var{checksum} +@end example +@noindent +or, with the optional @var{sequence-id}: +@example +@code{$}@var{sequence-id}@code{:}@var{packet-data}@code{#}@var{checksum} +@end example + +@cindex checksum, for @value{GDBN} remote +@noindent +The two-digit @var{checksum} is computed as the modulo 256 sum of all +characters between the leading @samp{$} and the trailing @samp{#} (that +consisting of both the optional @var{sequence-id}@code{:} and the actual +@var{packet-data}). + +@cindex sequence-id, for @value{GDBN} remote +@noindent +The two-digit @var{sequence-id}, when present, is returned with the +acknowledgment. Beyond that its meaning is poorly defined. +@value{GDBN} is not known to output @var{sequence-id}s. + +When either the host or the target machine receives a packet, the first +response expected is an acknowledgment: either @samp{+} (to indicate +the package was received correctly) or @samp{-} (to request +retransmission): + +@example +<- @code{$}@var{packet-data}@code{#}@var{checksum} +-> @code{+} +@end example +@noindent +If the received packet included a @var{sequence-id} than that is +appended to a positive acknowledgment: + +@example +<- @code{$}@var{sequence-id}@code{:}@var{packet-data}@code{#}@var{checksum} +-> @code{+}@var{sequence-id} +@end example + +The host (@value{GDBN}) sends @var{command}s, and the target (the +debugging stub incorporated in your program) sends a @var{response}. In +the case of step and continue @var{command}s, the response is only sent +when the operation has completed (the target has again stopped). + +@var{packet-data} consists of a sequence of characters with the +exception of @samp{#} and @samp{$} (see @samp{X} packet for an +exception). @samp{:} can not appear as the third character in a packet. +Fields within the packet should be separated using @samp{,} and @samp{;} +(unfortunately some packets chose to use @samp{:}). Except where +otherwise noted all numbers are represented in HEX with leading zeros +suppressed. + +Response @var{data} can be run-length encoded to save space. A @samp{*} +means that the next character is an ASCII encoding giving a repeat count +which stands for that many repetitions of the character preceding the +@samp{*}. The encoding is @code{n+29}, yielding a printable character +where @code{n >=3} (which is where rle starts to win). Don't use an +@code{n > 126}. + +So: +@example +"@code{0* }" +@end example +@noindent +means the same as "0000". + +The error response, returned for some packets includes a two character +error number. That number is not well defined. + +For any @var{command} not supported by the stub, an empty response +(@samp{$#00}) should be returned. That way it is possible to extend the +protocol. A newer @value{GDBN} can tell if a packet is supported based +on the response. + +Below is a complete list of all currently defined @var{command}s and +their corresponding response @var{data}: + +@multitable @columnfractions .30 .30 .40 +@item Packet +@tab Request +@tab Description + +@item extended ops @emph{(optional)} +@tab @code{!} +@tab +Use the extended remote protocol. Sticky -- only needs to be set once. +The extended remote protocol support the @samp{R} packet. +@item +@tab reply @samp{} +@tab +Stubs that support the extended remote protocol return @samp{} which, +unfortunately, is identical to the response returned by stubs that do not +support protocol extensions. + +@item last signal +@tab @code{?} +@tab +Reply the current reason for stopping. This is the same reply as is +generated for step or cont : @code{S}@var{AA} where @var{AA} is the +signal number. + +@item reserved +@tab @code{a} +@tab Reserved for future use + +@item set program arguments @strong{(reserved)} @emph{(optional)} +@tab @code{A}@var{arglen}@code{,}@var{argnum}@code{,}@var{arg}@code{,...} +@tab +Initialized @samp{argv[]} array passed into program. @var{arglen} +specifies the number of bytes in the hex encoded byte stream @var{arg}. +@item +@tab reply @code{OK} +@item +@tab reply @code{E}@var{NN} + +@item set baud @strong{(deprecated)} +@tab @code{b}@var{baud} +@tab +Change the serial line speed to @var{baud}. JTC: @emph{When does the +transport layer state change? When it's received, or after the ACK is +transmitted. In either case, there are problems if the command or the +acknowledgment packet is dropped.} Stan: @emph{If people really wanted +to add something like this, and get it working for the first time, they +ought to modify ser-unix.c to send some kind of out-of-band message to a +specially-setup stub and have the switch happen "in between" packets, so +that from remote protocol's point of view, nothing actually +happened.} + +@item set breakpoint @strong{(deprecated)} +@tab @code{B}@var{addr},@var{mode} +@tab +Set (@var{mode} is @samp{S}) or clear (@var{mode} is @samp{C}) a +breakpoint at @var{addr}. @emph{This has been replaced by the @samp{Z} and +@samp{z} packets.} + +@item continue +@tab @code{c}@var{addr} +@tab +@var{addr} is address to resume. If @var{addr} is omitted, resume at +current address. +@item +@tab reply +@tab see below + +@item continue with signal @emph{(optional)} +@tab @code{C}@var{sig}@code{;}@var{addr} +@tab +Continue with signal @var{sig} (hex signal number). If +@code{;}@var{addr} is omitted, resume at same address. +@item +@tab reply +@tab see below + +@item toggle debug @emph{(optional)} +@tab @code{d} +@tab +toggle debug flag (see 386 & 68k stubs) + +@item detach @emph{(optional)} +@tab @code{D} +@tab Reply OK. + +@item reserved +@tab @code{e} +@tab Reserved for future use + +@item reserved +@tab @code{E} +@tab Reserved for future use + +@item reserved +@tab @code{f} +@tab Reserved for future use + +@item reserved +@tab @code{F} +@tab Reserved for future use + +@item read registers +@tab @code{g} +@tab Read general registers. +@item +@tab reply @var{XX...} +@tab +Each byte of register data is described by two hex digits. The bytes +with the register are transmitted in target byte order. The size of +each register and their position within the @samp{g} @var{packet} is +determined by the @var{REGISTER_RAW_SIZE} and @var{REGISTER_NAME} +macros. +@item +@tab @code{E}@var{NN} +@tab for an error. + +@item write regs +@tab @code{G}@var{XX...} +@tab +See @samp{g} for a description of the @var{XX...} data. +@item +@tab reply @code{OK} +@tab for success +@item +@tab reply @code{E}@var{NN} +@tab for an error + +@item reserved +@tab @code{h} +@tab Reserved for future use + +@item set thread @emph{(optional)} +@tab @code{H}@var{c}@var{t...} +@tab +Set thread for subsequent operations. @var{c} = @samp{c} for thread +used in step and continue; @var{t...} can be -1 for all threads. +@var{c} = @samp{g} for thread used in other operations. If zero, pick a +thread, any thread. +@item +@tab reply @code{OK} +@tab for success +@item +@tab reply @code{E}@var{NN} +@tab for an error + +@item cycle step @strong{(draft)} @emph{(optional)} +@tab @code{i}@var{addr}@code{,}@var{nnn} +@tab +Step the remote target by a single clock cycle. If @code{,}@var{nnn} is +present, cycle step @var{nnn} cycles. If @var{addr} is present, cycle +step starting at that address. + +@item signal then cycle step @strong{(reserved)} @emph{(optional)} +@tab @code{I} +@tab +See @samp{i} and @samp{S} for likely syntax and semantics. + +@item reserved +@tab @code{j} +@tab Reserved for future use + +@item reserved +@tab @code{J} +@tab Reserved for future use + +@item kill request @emph{(optional)} +@tab @code{k} +@tab + +@item reserved +@tab @code{l} +@tab Reserved for future use + +@item reserved +@tab @code{L} +@tab Reserved for future use + +@item read memory +@tab @code{m}@var{addr}@code{,}@var{length} +@tab +Read @var{length} bytes of memory starting at address @var{addr}. +@item +@tab reply @var{XX...} +@tab +@var{XX...} is mem contents. Can be fewer bytes than requested if able to +read only part of the data. +@item +@tab reply @code{E}@var{NN} +@tab @var{NN} is errno + +@item write mem +@tab @code{M}@var{addr},@var{length}@code{:}@var{XX...} +@tab +Write @var{length} bytes of memory starting at address @var{addr}. +@var{XX...} is the data. +@item +@tab reply @code{OK} +@tab for success +@item +@tab reply @code{E}@var{NN} +@tab +for an error (this includes the case where only part of the data was +written). + +@item reserved +@tab @code{n} +@tab Reserved for future use + +@item reserved +@tab @code{N} +@tab Reserved for future use + +@item reserved +@tab @code{o} +@tab Reserved for future use + +@item reserved +@tab @code{O} +@tab Reserved for future use + +@item read reg @strong{(reserved)} +@tab @code{p}@var{n...} +@tab +See write register. +@item +@tab return @var{r....} +@tab The hex encoded value of the register in target byte order. + +@item write reg @emph{(optional)} +@tab @code{P}@var{n...}@code{=}@var{r...} +@tab +Write register @var{n...} with value @var{r...}, which contains two hex +digits for each byte in the register (target byte order). +@item +@tab reply @code{OK} +@tab for success +@item +@tab reply @code{E}@var{NN} +@tab for an error + +@item general query @emph{(optional)} +@tab @code{q}@var{query} +@tab +Request info about @var{query}. In general @value{GDBN} @var{query}'s +have a leading upper case letter. Custom vendor queries should use a +leading lower case letter and a company prefix, ex: @samp{qfsf.var}. +@var{query} may optionally be followed by a @samp{,} or @samp{;} +separated list. Stubs should ensure that they fully match any +@var{query} name. +@item +@tab reply @code{XX...} +@tab Hex encoded data from query. The reply can not be empty. +@item +@tab reply @code{E}@var{NN} +@tab error reply +@item +@tab reply @samp{} +@tab Indicating an unrecognized @var{query}. + +@item current thread +@tab @code{q}@code{C} +@tab Return the current thread id. +@item +@tab reply @code{QC}@var{pid} +@tab +Where @var{pid} is a HEX encoded 16 bit process id. +@item +@tab reply * +@tab Any other reply implies the old pid. + +@item compute CRC of memory block +@tab @code{q}@code{CRC:}@var{addr}@code{,}@var{length} +@tab +@item +@tab reply @code{E}@var{NN} +@tab An error (such as memory fault) +@item +@tab reply @code{C}@var{CRC32} +@tab A 32 bit cyclic redundancy check of the specified memory region. + +@item query @var{LIST} or @var{threadLIST} +@tab @code{q}@code{L}@var{startflag}@var{threadcount}@var{nextthread} +@tab +Obtain thread information from RTOS. @var{startflag} is one hex digit; +@var{threadcount} is two hex digits; and @var{nextthread} is 16 hex +digits. +@item +@tab reply * +@tab +See @code{remote.c:parse_threadlist_response()}. + +@item query sect offs +@tab @code{q}@code{Offsets} +@tab Get section offsets. +@item +@tab reply @code{Text=}@var{xxx}@code{;Data=}@var{yyy}@code{;Bss=}@var{zzz} + +@item thread info request +@tab @code{q}@code{P}@var{mode}@var{threadid} +@tab +Returns information on @var{threadid}. Where: @var{mode} is a hex +encoded 32 bit mode; @var{threadid} is a hex encoded 64 bit thread ID. +@item +@tab reply * +@tab +See @code{remote.c:remote_unpack_thread_info_response()}. + +@item remote command +@tab @code{q}@code{Rcmd,}@var{COMMAND} +@tab +@var{COMMAND} (hex encoded) is passed to the local interpreter for +execution. Invalid commands should be reported using the output string. +Before the final result packet, the target may also respond with a +number of intermediate @code{O}@var{OUTPUT} console output +packets. @emph{Implementors should note that providing access to a +stubs's interpreter may have security implications}. +@item +@tab reply @code{OK} +@tab +A command response with no output. +@item +@tab reply @var{OUTPUT} +@tab +A command response with the hex encoded output string @var{OUTPUT}. +@item +@tab reply @code{E}@var{NN} +@tab +Indicate a badly formed request. + +@item +@tab reply @samp{} +@tab +When @samp{q}@samp{Rcmd} is not recognized. + +@item general set @emph{(optional)} +@tab @code{Q}@var{var}@code{=}@var{val} +@tab +Set value of @var{var} to @var{val}. See @samp{q} for a discussing of +naming conventions. + +@item reset @emph{(optional)} +@tab r +@tab reset -- see sparc stub. + +@item remote restart @emph{(optional)} +@tab @code{R}@var{XX} +@tab +Restart the remote server. @var{XX} while needed has no clear +definition. + +@item step @emph{(optional)} +@tab @code{s}@var{addr} +@tab +@var{addr} is address to resume. If @var{addr} is omitted, resume at +same address. +@item +@tab reply +@tab see below + +@item step with signal @emph{(optional)} +@tab @code{S}@var{sig}@code{;}@var{addr} +@tab +Like @samp{C} but step not continue. +@item +@tab reply +@tab see below + +@item search @emph{(optional)} +@tab @code{t}@var{addr}@code{:}@var{PP}@code{,}@var{MM} +@tab +Search backwards starting at address @var{addr} for a match with pattern +@var{PP} and mask @var{MM}. @var{PP} and @var{MM} are 4 +bytes. @var{addr} must be at least 3 digits. + +@item thread alive @emph{(optional)} +@tab @code{T}@var{XX} +@tab Find out if the thread XX is alive. +@item +@tab reply @code{OK} +@tab thread is still alive +@item +@tab reply @code{E}@var{NN} +@tab thread is dead + +@item reserved +@tab @code{u} +@tab Reserved for future use + +@item reserved +@tab @code{U} +@tab Reserved for future use + +@item reserved +@tab @code{v} +@tab Reserved for future use + +@item reserved +@tab @code{V} +@tab Reserved for future use + +@item reserved +@tab @code{w} +@tab Reserved for future use + +@item reserved +@tab @code{W} +@tab Reserved for future use + +@item reserved +@tab @code{x} +@tab Reserved for future use + +@item write mem (binary) @emph{(optional)} +@tab @code{X}@var{addr}@code{,}@var{length}@var{:}@var{XX...} +@tab +@var{addr} is address, @var{length} is number of bytes, @var{XX...} is +binary data. +@item +@tab reply @code{OK} +@tab for success +@item +@tab reply @code{E}@var{NN} +@tab for an error + +@item reserved +@tab @code{y} +@tab Reserved for future use + +@item reserved +@tab @code{Y} +@tab Reserved for future use + +@item remove break or watchpoint @strong{(draft)} @emph{(optional)} +@tab @code{z}@var{t}@code{,}@var{addr}@code{,}@var{length} +@tab +See @samp{Z}. + +@item insert break or watchpoint @strong{(draft)} @emph{(optional)} +@tab @code{Z}@var{t}@code{,}@var{addr}@code{,}@var{length} +@tab +@var{t} is type: @samp{0} - software breakpoint, @samp{1} - hardware +breakpoint, @samp{2} - write watchpoint, @samp{3} - read watchpoint, +@samp{4} - access watchpoint; @var{addr} is address; @var{length} is in +bytes. For a software breakpoint, @var{length} specifies the size of +the instruction to be patched. For hardware breakpoints and watchpoints +@var{length} specifies the memory region to be monitored. +@item +@tab reply @code{E}@var{NN} +@tab for an error +@item +@tab reply @code{OK} +@tab for success +@item +@tab @samp{} +@tab If not supported. + +@item reserved +@tab <other> +@tab Reserved for future use + +@end multitable + +In the case of the @samp{C}, @samp{c}, @samp{S} and @samp{s} packets, +there is no immediate response. The reply, described below, comes when +the machine stops: + +@multitable @columnfractions .4 .6 + +@item @code{S}@var{AA} +@tab @var{AA} is the signal number + +@item @code{T}@var{AA}@var{n...}@code{:}@var{r...}@code{;}@var{n...}@code{:}@var{r...}@code{;}@var{n...}@code{:}@var{r...}@code{;} +@tab +@var{AA} = two hex digit signal number; @var{n...} = register number +(hex), @var{r...} = target byte ordered register contents, size defined +by @code{REGISTER_RAW_SIZE}; @var{n...} = @samp{thread}, @var{r...} = +thread process ID, this is a hex integer; @var{n...} = other string not +starting with valid hex digit. @value{GDBN} should ignore this +@var{n...}, @var{r...} pair and go on to the next. This way we can +extend the protocol. + +@item @code{W}@var{AA} +@tab +The process exited, and @var{AA} is the exit status. This is only +applicable for certains sorts of targets. + +@item @code{X}@var{AA} +@tab +The process terminated with signal @var{AA}. + +@item @code{N}@var{AA}@code{;}@var{tttttttt}@code{;}@var{dddddddd}@code{;}@var{bbbbbbbb} @strong{(obsolete)} +@tab +@var{AA} = signal number; @var{tttttttt} = address of symbol "_start"; +@var{dddddddd} = base of data section; @var{bbbbbbbb} = base of bss +section. @emph{Note: only used by Cisco Systems targets. The difference +between this reply and the "qOffsets" query is that the 'N' packet may +arrive spontaneously whereas the 'qOffsets' is a query initiated by the +host debugger.} + +@item @code{O}@var{XX...} +@tab +@var{XX...} is hex encoding of ASCII data. This can happen at any time +while the program is running and the debugger should continue to wait +for 'W', 'T', etc. + +@end multitable + +Example sequence of a target being re-started. Notice how the restart +does not get any direct output: + +@example +<- @code{R00} +-> @code{+} +@emph{target restarts} +<- @code{?} +-> @code{+} +-> @code{T001:1234123412341234} +<- @code{+} +@end example + +Example sequence of a target being stepped by a single instruction: + +@example +<- @code{G1445...} +-> @code{+} +<- @code{s} +-> @code{+} +@emph{time passes} +-> @code{T001:1234123412341234} +<- @code{+} +<- @code{g} +-> @code{+} +-> @code{1455...} +<- @code{+} +@end example + +@kindex set remotedebug +@kindex show remotedebug +@cindex packets, reporting on stdout +@cindex serial connections, debugging +If you have trouble with the serial connection, you can use the command +@code{set remotedebug}. This makes @value{GDBN} report on all packets sent +back and forth across the serial line to the remote machine. The +packet-debugging information is printed on the @value{GDBN} standard output +stream. @code{set remotedebug off} turns it off, and @code{show +remotedebug} shows you its current state. + +@node Server +@subsubsection Using the @code{gdbserver} program + +@kindex gdbserver +@cindex remote connection without stubs +@code{gdbserver} is a control program for Unix-like systems, which +allows you to connect your program with a remote @value{GDBN} via +@code{target remote}---but without linking in the usual debugging stub. + +@code{gdbserver} is not a complete replacement for the debugging stubs, +because it requires essentially the same operating-system facilities +that @value{GDBN} itself does. In fact, a system that can run +@code{gdbserver} to connect to a remote @value{GDBN} could also run +@value{GDBN} locally! @code{gdbserver} is sometimes useful nevertheless, +because it is a much smaller program than @value{GDBN} itself. It is +also easier to port than all of @value{GDBN}, so you may be able to get +started more quickly on a new system by using @code{gdbserver}. +Finally, if you develop code for real-time systems, you may find that +the tradeoffs involved in real-time operation make it more convenient to +do as much development work as possible on another system, for example +by cross-compiling. You can use @code{gdbserver} to make a similar +choice for debugging. + +@value{GDBN} and @code{gdbserver} communicate via either a serial line +or a TCP connection, using the standard @value{GDBN} remote serial +protocol. + +@table @emph +@item On the target machine, +you need to have a copy of the program you want to debug. +@code{gdbserver} does not need your program's symbol table, so you can +strip the program if necessary to save space. @value{GDBN} on the host +system does all the symbol handling. + +To use the server, you must tell it how to communicate with @value{GDBN}; +the name of your program; and the arguments for your program. The +syntax is: + +@smallexample +target> gdbserver @var{comm} @var{program} [ @var{args} @dots{} ] +@end smallexample + +@var{comm} is either a device name (to use a serial line) or a TCP +hostname and portnumber. For example, to debug Emacs with the argument +@samp{foo.txt} and communicate with @value{GDBN} over the serial port +@file{/dev/com1}: + +@smallexample +target> gdbserver /dev/com1 emacs foo.txt +@end smallexample + +@code{gdbserver} waits passively for the host @value{GDBN} to communicate +with it. +To use a TCP connection instead of a serial line: + +@smallexample +target> gdbserver host:2345 emacs foo.txt +@end smallexample + +The only difference from the previous example is the first argument, +specifying that you are communicating with the host @value{GDBN} via +TCP. The @samp{host:2345} argument means that @code{gdbserver} is to +expect a TCP connection from machine @samp{host} to local TCP port 2345. +(Currently, the @samp{host} part is ignored.) You can choose any number +you want for the port number as long as it does not conflict with any +TCP ports already in use on the target system (for example, @code{23} is +reserved for @code{telnet}).@footnote{If you choose a port number that +conflicts with another service, @code{gdbserver} prints an error message +and exits.} You must use the same port number with the host @value{GDBN} +@code{target remote} command. + +@item On the @value{GDBN} host machine, +you need an unstripped copy of your program, since @value{GDBN} needs +symbols and debugging information. Start up @value{GDBN} as usual, +using the name of the local copy of your program as the first argument. +(You may also need the @w{@samp{--baud}} option if the serial line is +running at anything other than 9600 bps.) After that, use @code{target +remote} to establish communications with @code{gdbserver}. Its argument +is either a device name (usually a serial device, like +@file{/dev/ttyb}), or a TCP port descriptor in the form +@code{@var{host}:@var{PORT}}. For example: + +@smallexample +(@value{GDBP}) target remote /dev/ttyb +@end smallexample + +@noindent +communicates with the server via serial line @file{/dev/ttyb}, and + +@smallexample +(@value{GDBP}) target remote the-target:2345 +@end smallexample + +@noindent +communicates via a TCP connection to port 2345 on host @w{@file{the-target}}. +For TCP connections, you must start up @code{gdbserver} prior to using +the @code{target remote} command. Otherwise you may get an error whose +text depends on the host system, but which usually looks something like +@samp{Connection refused}. +@end table + +@node NetWare +@subsubsection Using the @code{gdbserve.nlm} program + +@kindex gdbserve.nlm +@code{gdbserve.nlm} is a control program for NetWare systems, which +allows you to connect your program with a remote @value{GDBN} via +@code{target remote}. + +@value{GDBN} and @code{gdbserve.nlm} communicate via a serial line, +using the standard @value{GDBN} remote serial protocol. + +@table @emph +@item On the target machine, +you need to have a copy of the program you want to debug. +@code{gdbserve.nlm} does not need your program's symbol table, so you +can strip the program if necessary to save space. @value{GDBN} on the +host system does all the symbol handling. + +To use the server, you must tell it how to communicate with +@value{GDBN}; the name of your program; and the arguments for your +program. The syntax is: + +@smallexample +load gdbserve [ BOARD=@var{board} ] [ PORT=@var{port} ] + [ BAUD=@var{baud} ] @var{program} [ @var{args} @dots{} ] +@end smallexample + +@var{board} and @var{port} specify the serial line; @var{baud} specifies +the baud rate used by the connection. @var{port} and @var{node} default +to 0, @var{baud} defaults to 9600 bps. + +For example, to debug Emacs with the argument @samp{foo.txt}and +communicate with @value{GDBN} over serial port number 2 or board 1 +using a 19200 bps connection: + +@smallexample +load gdbserve BOARD=1 PORT=2 BAUD=19200 emacs foo.txt +@end smallexample + +@item On the @value{GDBN} host machine, +you need an unstripped copy of your program, since @value{GDBN} needs +symbols and debugging information. Start up @value{GDBN} as usual, +using the name of the local copy of your program as the first argument. +(You may also need the @w{@samp{--baud}} option if the serial line is +running at anything other than 9600 bps. After that, use @code{target +remote} to establish communications with @code{gdbserve.nlm}. Its +argument is a device name (usually a serial device, like +@file{/dev/ttyb}). For example: + +@smallexample +(@value{GDBP}) target remote /dev/ttyb +@end smallexample + +@noindent +communications with the server via serial line @file{/dev/ttyb}. +@end table @node KOD @section Kernel Object Display + @cindex kernel object display @cindex kernel object @cindex KOD @@ -8411,6 +9291,1508 @@ There is currently no way to determine whether a given operating system is supported other than to try it. +@node Configurations +@chapter Configuration-Specific Information + +While nearly all @value{GDBN} commands are available for all native and +cross versions of the debugger, there are some exceptions. This chapter +describes things that are only available in certain configurations. + +There are three major categories of configurations: native +configurations, where the host and target are the same, embedded +operating system configurations, which are usually the same for several +different processor architectures, and bare embedded processors, which +are quite different from each other. + +@menu +* Native:: +* Embedded OS:: +* Embedded Processors:: +* Architectures:: +@end menu + +@node Native +@section Native + +This section describes details specific to particular native +configurations. + +@menu +* HP-UX:: HP-UX +* SVR4 Process Information:: SVR4 process information +@end menu + +@node HP-UX +@subsection HP-UX + +On HP-UX systems, if you refer to a function or variable name that +begins with a dollar sign, @value{GDBN} searches for a user or system +name first, before it searches for a convenience variable. + +@node SVR4 Process Information +@subsection SVR4 process information + +@kindex /proc +@cindex process image + +Many versions of SVR4 provide a facility called @samp{/proc} that can be +used to examine the image of a running process using file-system +subroutines. If @value{GDBN} is configured for an operating system with +this facility, the command @code{info proc} is available to report on +several kinds of information about the process running your program. +@code{info proc} works only on SVR4 systems that include the +@code{procfs} code. This includes OSF/1 (Digital Unix), Solaris, Irix, +and Unixware, but not HP-UX or Linux, for example. + +@table @code +@kindex info proc +@item info proc +Summarize available information about the process. + +@kindex info proc mappings +@item info proc mappings +Report on the address ranges accessible in the program, with information +on whether your program may read, write, or execute each range. + +@kindex info proc times +@item info proc times +Starting time, user CPU time, and system CPU time for your program and +its children. + +@kindex info proc id +@item info proc id +Report on the process IDs related to your program: its own process ID, +the ID of its parent, the process group ID, and the session ID. + +@kindex info proc status +@item info proc status +General information on the state of the process. If the process is +stopped, this report includes the reason for stopping, and any signal +received. + +@item info proc all +Show all the above information about the process. +@end table + +@node Embedded OS +@section Embedded Operating Systems + +This section describes configurations involving the debugging of +embedded operating systems that are available for several different +architectures. + +@menu +* VxWorks:: Using @value{GDBN} with VxWorks +@end menu + +@value{GDBN} includes the ability to debug programs running on +various real-time operating systems. + +@node VxWorks +@subsection Using @value{GDBN} with VxWorks + +@cindex VxWorks + +@table @code + +@kindex target vxworks +@item target vxworks @var{machinename} +A VxWorks system, attached via TCP/IP. The argument @var{machinename} +is the target system's machine name or IP address. + +@end table + +On VxWorks, @code{load} links @var{filename} dynamically on the +current target system as well as adding its symbols in @value{GDBN}. + +@value{GDBN} enables developers to spawn and debug tasks running on networked +VxWorks targets from a Unix host. Already-running tasks spawned from +the VxWorks shell can also be debugged. @value{GDBN} uses code that runs on +both the Unix host and on the VxWorks target. The program +@code{gdb} is installed and executed on the Unix host. (It may be +installed with the name @code{vxgdb}, to distinguish it from a +@value{GDBN} for debugging programs on the host itself.) + +@table @code +@item VxWorks-timeout @var{args} +@kindex vxworks-timeout +All VxWorks-based targets now support the option @code{vxworks-timeout}. +This option is set by the user, and @var{args} represents the number of +seconds @value{GDBN} waits for responses to rpc's. You might use this if +your VxWorks target is a slow software simulator or is on the far side +of a thin network line. +@end table + +The following information on connecting to VxWorks was current when +this manual was produced; newer releases of VxWorks may use revised +procedures. + +@kindex INCLUDE_RDB +To use @value{GDBN} with VxWorks, you must rebuild your VxWorks kernel +to include the remote debugging interface routines in the VxWorks +library @file{rdb.a}. To do this, define @code{INCLUDE_RDB} in the +VxWorks configuration file @file{configAll.h} and rebuild your VxWorks +kernel. The resulting kernel contains @file{rdb.a}, and spawns the +source debugging task @code{tRdbTask} when VxWorks is booted. For more +information on configuring and remaking VxWorks, see the manufacturer's +manual. +@c VxWorks, see the @cite{VxWorks Programmer's Guide}. + +Once you have included @file{rdb.a} in your VxWorks system image and set +your Unix execution search path to find @value{GDBN}, you are ready to +run @value{GDBN}. From your Unix host, run @code{gdb} (or @code{vxgdb}, +depending on your installation). + +@value{GDBN} comes up showing the prompt: + +@example +(vxgdb) +@end example + +@menu +* VxWorks Connection:: Connecting to VxWorks +* VxWorks Download:: VxWorks download +* VxWorks Attach:: Running tasks +@end menu + +@node VxWorks Connection +@subsubsection Connecting to VxWorks + +The @value{GDBN} command @code{target} lets you connect to a VxWorks target on the +network. To connect to a target whose host name is ``@code{tt}'', type: + +@example +(vxgdb) target vxworks tt +@end example + +@need 750 +@value{GDBN} displays messages like these: + +@smallexample +Attaching remote machine across net... +Connected to tt. +@end smallexample + +@need 1000 +@value{GDBN} then attempts to read the symbol tables of any object modules +loaded into the VxWorks target since it was last booted. @value{GDBN} locates +these files by searching the directories listed in the command search +path (@pxref{Environment, ,Your program's environment}); if it fails +to find an object file, it displays a message such as: + +@example +prog.o: No such file or directory. +@end example + +When this happens, add the appropriate directory to the search path with +the @value{GDBN} command @code{path}, and execute the @code{target} +command again. + +@node VxWorks Download +@subsubsection VxWorks download + +@cindex download to VxWorks +If you have connected to the VxWorks target and you want to debug an +object that has not yet been loaded, you can use the @value{GDBN} +@code{load} command to download a file from Unix to VxWorks +incrementally. The object file given as an argument to the @code{load} +command is actually opened twice: first by the VxWorks target in order +to download the code, then by @value{GDBN} in order to read the symbol +table. This can lead to problems if the current working directories on +the two systems differ. If both systems have NFS mounted the same +filesystems, you can avoid these problems by using absolute paths. +Otherwise, it is simplest to set the working directory on both systems +to the directory in which the object file resides, and then to reference +the file by its name, without any path. For instance, a program +@file{prog.o} may reside in @file{@var{vxpath}/vw/demo/rdb} in VxWorks +and in @file{@var{hostpath}/vw/demo/rdb} on the host. To load this +program, type this on VxWorks: + +@example +-> cd "@var{vxpath}/vw/demo/rdb" +@end example +v +Then, in @value{GDBN}, type: + +@example +(vxgdb) cd @var{hostpath}/vw/demo/rdb +(vxgdb) load prog.o +@end example + +@value{GDBN} displays a response similar to this: + +@smallexample +Reading symbol data from wherever/vw/demo/rdb/prog.o... done. +@end smallexample + +You can also use the @code{load} command to reload an object module +after editing and recompiling the corresponding source file. Note that +this makes @value{GDBN} delete all currently-defined breakpoints, +auto-displays, and convenience variables, and to clear the value +history. (This is necessary in order to preserve the integrity of +debugger data structures that reference the target system's symbol +table.) + +@node VxWorks Attach +@subsubsection Running tasks + +@cindex running VxWorks tasks +You can also attach to an existing task using the @code{attach} command as +follows: + +@example +(vxgdb) attach @var{task} +@end example + +@noindent +where @var{task} is the VxWorks hexadecimal task ID. The task can be running +or suspended when you attach to it. Running tasks are suspended at +the time of attachment. + +@node Embedded Processors +@section Embedded Processors + +This section goes into details specific to particular embedded +configurations. + +@menu +* A29K Embedded:: AMD A29K Embedded +* ARM:: ARM +* H8/300:: Hitachi H8/300 +* H8/500:: Hitachi H8/500 +* i960:: Intel i960 +* M32R/D:: Mitsubishi M32R/D +* M68K:: Motorola M68K +* M88K:: Motorola M88K +* MIPS Embedded:: MIPS Embedded +* PA:: HP PA Embedded +* PowerPC: PowerPC +* SH:: Hitachi SH +* Sparclet:: Tsqware Sparclet +* Sparclite:: Fujitsu Sparclite +* ST2000:: Tandem ST2000 +* Z8000:: Zilog Z8000 +@end menu + +@node A29K Embedded +@subsection AMD A29K Embedded + +@menu +* A29K UDI:: +* A29K EB29K:: +* Comms (EB29K):: Communications setup +* gdb-EB29K:: EB29K cross-debugging +* Remote Log:: Remote log +@end menu + +@table @code + +@kindex target adapt +@item target adapt @var{dev} +Adapt monitor for A29K. + +@kindex target amd-eb +@item target amd-eb @var{dev} @var{speed} @var{PROG} +@cindex AMD EB29K +Remote PC-resident AMD EB29K board, attached over serial lines. +@var{dev} is the serial device, as for @code{target remote}; +@var{speed} allows you to specify the linespeed; and @var{PROG} is the +name of the program to be debugged, as it appears to DOS on the PC. +@xref{A29K EB29K, ,EBMON protocol for AMD29K}. + +@end table + +@node A29K UDI +@subsubsection A29K UDI + +@cindex UDI +@cindex AMD29K via UDI + +@value{GDBN} supports AMD's UDI (``Universal Debugger Interface'') +protocol for debugging the a29k processor family. To use this +configuration with AMD targets running the MiniMON monitor, you need the +program @code{MONTIP}, available from AMD at no charge. You can also +use @value{GDBN} with the UDI-conformant a29k simulator program +@code{ISSTIP}, also available from AMD. + +@table @code +@item target udi @var{keyword} +@kindex udi +Select the UDI interface to a remote a29k board or simulator, where +@var{keyword} is an entry in the AMD configuration file @file{udi_soc}. +This file contains keyword entries which specify parameters used to +connect to a29k targets. If the @file{udi_soc} file is not in your +working directory, you must set the environment variable @samp{UDICONF} +to its pathname. +@end table + +@node A29K EB29K +@subsubsection EBMON protocol for AMD29K + +@cindex EB29K board +@cindex running 29K programs + +AMD distributes a 29K development board meant to fit in a PC, together +with a DOS-hosted monitor program called @code{EBMON}. As a shorthand +term, this development system is called the ``EB29K''. To use +@value{GDBN} from a Unix system to run programs on the EB29K board, you +must first connect a serial cable between the PC (which hosts the EB29K +board) and a serial port on the Unix system. In the following, we +assume you've hooked the cable between the PC's @file{COM1} port and +@file{/dev/ttya} on the Unix system. + +@node Comms (EB29K) +@subsubsection Communications setup + +The next step is to set up the PC's port, by doing something like this +in DOS on the PC: + +@example +C:\> MODE com1:9600,n,8,1,none +@end example + +@noindent +This example---run on an MS DOS 4.0 system---sets the PC port to 9600 +bps, no parity, eight data bits, one stop bit, and no ``retry'' action; +you must match the communications parameters when establishing the Unix +end of the connection as well. +@c FIXME: Who knows what this "no retry action" crud from the DOS manual may +@c mean? It's optional; leave it out? ---doc@cygnus.com, 25feb91 + +To give control of the PC to the Unix side of the serial line, type +the following at the DOS console: + +@example +C:\> CTTY com1 +@end example + +@noindent +(Later, if you wish to return control to the DOS console, you can use +the command @code{CTTY con}---but you must send it over the device that +had control, in our example over the @file{COM1} serial line). + +From the Unix host, use a communications program such as @code{tip} or +@code{cu} to communicate with the PC; for example, + +@example +cu -s 9600 -l /dev/ttya +@end example + +@noindent +The @code{cu} options shown specify, respectively, the linespeed and the +serial port to use. If you use @code{tip} instead, your command line +may look something like the following: + +@example +tip -9600 /dev/ttya +@end example + +@noindent +Your system may require a different name where we show +@file{/dev/ttya} as the argument to @code{tip}. The communications +parameters, including which port to use, are associated with the +@code{tip} argument in the ``remote'' descriptions file---normally the +system table @file{/etc/remote}. +@c FIXME: What if anything needs doing to match the "n,8,1,none" part of +@c the DOS side's comms setup? cu can support -o (odd +@c parity), -e (even parity)---apparently no settings for no parity or +@c for character size. Taken from stty maybe...? John points out tip +@c can set these as internal variables, eg ~s parity=none; man stty +@c suggests that it *might* work to stty these options with stdin or +@c stdout redirected... ---doc@cygnus.com, 25feb91 + +@kindex EBMON +Using the @code{tip} or @code{cu} connection, change the DOS working +directory to the directory containing a copy of your 29K program, then +start the PC program @code{EBMON} (an EB29K control program supplied +with your board by AMD). You should see an initial display from +@code{EBMON} similar to the one that follows, ending with the +@code{EBMON} prompt @samp{#}--- + +@example +C:\> G: + +G:\> CD \usr\joe\work29k + +G:\USR\JOE\WORK29K> EBMON +Am29000 PC Coprocessor Board Monitor, version 3.0-18 +Copyright 1990 Advanced Micro Devices, Inc. +Written by Gibbons and Associates, Inc. + +Enter '?' or 'H' for help + +PC Coprocessor Type = EB29K +I/O Base = 0x208 +Memory Base = 0xd0000 + +Data Memory Size = 2048KB +Available I-RAM Range = 0x8000 to 0x1fffff +Available D-RAM Range = 0x80002000 to 0x801fffff + +PageSize = 0x400 +Register Stack Size = 0x800 +Memory Stack Size = 0x1800 + +CPU PRL = 0x3 +Am29027 Available = No +Byte Write Available = Yes + +# ~. +@end example + +Then exit the @code{cu} or @code{tip} program (done in the example by +typing @code{~.} at the @code{EBMON} prompt). @code{EBMON} keeps +running, ready for @value{GDBN} to take over. + +For this example, we've assumed what is probably the most convenient +way to make sure the same 29K program is on both the PC and the Unix +system: a PC/NFS connection that establishes ``drive @code{G:}'' on the +PC as a file system on the Unix host. If you do not have PC/NFS or +something similar connecting the two systems, you must arrange some +other way---perhaps floppy-disk transfer---of getting the 29K program +from the Unix system to the PC; @value{GDBN} does @emph{not} download it over the +serial line. + +@node gdb-EB29K +@subsubsection EB29K cross-debugging + +Finally, @code{cd} to the directory containing an image of your 29K +program on the Unix system, and start @value{GDBN}---specifying as argument the +name of your 29K program: + +@example +cd /usr/joe/work29k +@value{GDBP} myfoo +@end example + +@need 500 +Now you can use the @code{target} command: + +@example +target amd-eb /dev/ttya 9600 MYFOO +@c FIXME: test above 'target amd-eb' as spelled, with caps! caps are meant to +@c emphasize that this is the name as seen by DOS (since I think DOS is +@c single-minded about case of letters). ---doc@cygnus.com, 25feb91 +@end example + +@noindent +In this example, we've assumed your program is in a file called +@file{myfoo}. Note that the filename given as the last argument to +@code{target amd-eb} should be the name of the program as it appears to DOS. +In our example this is simply @code{MYFOO}, but in general it can include +a DOS path, and depending on your transfer mechanism may not resemble +the name on the Unix side. + +At this point, you can set any breakpoints you wish; when you are ready +to see your program run on the 29K board, use the @value{GDBN} command +@code{run}. + +To stop debugging the remote program, use the @value{GDBN} @code{detach} +command. + +To return control of the PC to its console, use @code{tip} or @code{cu} +once again, after your @value{GDBN} session has concluded, to attach to +@code{EBMON}. You can then type the command @code{q} to shut down +@code{EBMON}, returning control to the DOS command-line interpreter. +Type @code{CTTY con} to return command input to the main DOS console, +and type @kbd{~.} to leave @code{tip} or @code{cu}. + +@node Remote Log +@subsubsection Remote log +@kindex eb.log +@cindex log file for EB29K + +The @code{target amd-eb} command creates a file @file{eb.log} in the +current working directory, to help debug problems with the connection. +@file{eb.log} records all the output from @code{EBMON}, including echoes +of the commands sent to it. Running @samp{tail -f} on this file in +another window often helps to understand trouble with @code{EBMON}, or +unexpected events on the PC side of the connection. + +@node ARM +@subsection ARM + +@table @code + +@kindex target rdi +@item target rdi @var{dev} +ARM Angel monitor, via RDI library interface to ADP protocol. You may +use this target to communicate with both boards running the Angel +monitor, or with the EmbeddedICE JTAG debug device. + +@kindex target rdp +@item target rdp @var{dev} +ARM Demon monitor. + +@end table + +@node H8/300 +@subsection Hitachi H8/300 + +@table @code + +@kindex target hms +@item target hms @var{dev} +A Hitachi SH, H8/300, or H8/500 board, attached via serial line to your host. +Use special commands @code{device} and @code{speed} to control the serial +line and the communications speed used. + +@kindex target e7000 +@item target e7000 @var{dev} +E7000 emulator for Hitachi H8 and SH. + +@kindex target sh3 +@kindex target sh3e +@item target sh3 @var{dev} +@item target sh3e @var{dev} +Hitachi SH-3 and SH-3E target systems. + +@end table + +@cindex download to H8/300 or H8/500 +@cindex H8/300 or H8/500 download +@cindex download to Hitachi SH +@cindex Hitachi SH download +When you select remote debugging to a Hitachi SH, H8/300, or H8/500 +board, the @code{load} command downloads your program to the Hitachi +board and also opens it as the current executable target for +@value{GDBN} on your host (like the @code{file} command). + +@value{GDBN} needs to know these things to talk to your +Hitachi SH, H8/300, or H8/500: + +@enumerate +@item +that you want to use @samp{target hms}, the remote debugging interface +for Hitachi microprocessors, or @samp{target e7000}, the in-circuit +emulator for the Hitachi SH and the Hitachi 300H. (@samp{target hms} is +the default when GDB is configured specifically for the Hitachi SH, +H8/300, or H8/500.) + +@item +what serial device connects your host to your Hitachi board (the first +serial device available on your host is the default). + +@item +what speed to use over the serial device. +@end enumerate + +@menu +* Hitachi Boards:: Connecting to Hitachi boards. +* Hitachi ICE:: Using the E7000 In-Circuit Emulator. +* Hitachi Special:: Special @value{GDBN} commands for Hitachi micros. +@end menu + +@node Hitachi Boards +@subsubsection Connecting to Hitachi boards + +@c only for Unix hosts +@kindex device +@cindex serial device, Hitachi micros +Use the special @code{@value{GDBP}} command @samp{device @var{port}} if you +need to explicitly set the serial device. The default @var{port} is the +first available port on your host. This is only necessary on Unix +hosts, where it is typically something like @file{/dev/ttya}. + +@kindex speed +@cindex serial line speed, Hitachi micros +@code{@value{GDBP}} has another special command to set the communications +speed: @samp{speed @var{bps}}. This command also is only used from Unix +hosts; on DOS hosts, set the line speed as usual from outside GDB with +the DOS @kbd{mode} command (for instance, @w{@samp{mode +com2:9600,n,8,1,p}} for a 9600 bps connection). + +The @samp{device} and @samp{speed} commands are available only when you +use a Unix host to debug your Hitachi microprocessor programs. If you +use a DOS host, +@value{GDBN} depends on an auxiliary terminate-and-stay-resident program +called @code{asynctsr} to communicate with the development board +through a PC serial port. You must also use the DOS @code{mode} command +to set up the serial port on the DOS side. + +The following sample session illustrates the steps needed to start a +program under @value{GDBN} control on an H8/300. The example uses a +sample H8/300 program called @file{t.x}. The procedure is the same for +the Hitachi SH and the H8/500. + +First hook up your development board. In this example, we use a +board attached to serial port @code{COM2}; if you use a different serial +port, substitute its name in the argument of the @code{mode} command. +When you call @code{asynctsr}, the auxiliary comms program used by the +degugger, you give it just the numeric part of the serial port's name; +for example, @samp{asyncstr 2} below runs @code{asyncstr} on +@code{COM2}. + +@example +C:\H8300\TEST> asynctsr 2 +C:\H8300\TEST> mode com2:9600,n,8,1,p + +Resident portion of MODE loaded + +COM2: 9600, n, 8, 1, p + +@end example + +@quotation +@emph{Warning:} We have noticed a bug in PC-NFS that conflicts with +@code{asynctsr}. If you also run PC-NFS on your DOS host, you may need to +disable it, or even boot without it, to use @code{asynctsr} to control +your development board. +@end quotation + +@kindex target hms +Now that serial communications are set up, and the development board is +connected, you can start up @value{GDBN}. Call @code{@value{GDBP}} with +the name of your program as the argument. @code{@value{GDBP}} prompts +you, as usual, with the prompt @samp{(@value{GDBP})}. Use two special +commands to begin your debugging session: @samp{target hms} to specify +cross-debugging to the Hitachi board, and the @code{load} command to +download your program to the board. @code{load} displays the names of +the program's sections, and a @samp{*} for each 2K of data downloaded. +(If you want to refresh @value{GDBN} data on symbols or on the +executable file without downloading, use the @value{GDBN} commands +@code{file} or @code{symbol-file}. These commands, and @code{load} +itself, are described in @ref{Files,,Commands to specify files}.) + +@smallexample +(eg-C:\H8300\TEST) @value{GDBP} t.x +GDB is free software and you are welcome to distribute copies + of it under certain conditions; type "show copying" to see + the conditions. +There is absolutely no warranty for GDB; type "show warranty" +for details. +GDB @value{GDBVN}, Copyright 1992 Free Software Foundation, Inc... +(gdb) target hms +Connected to remote H8/300 HMS system. +(gdb) load t.x +.text : 0x8000 .. 0xabde *********** +.data : 0xabde .. 0xad30 * +.stack : 0xf000 .. 0xf014 * +@end smallexample + +At this point, you're ready to run or debug your program. From here on, +you can use all the usual @value{GDBN} commands. The @code{break} command +sets breakpoints; the @code{run} command starts your program; +@code{print} or @code{x} display data; the @code{continue} command +resumes execution after stopping at a breakpoint. You can use the +@code{help} command at any time to find out more about @value{GDBN} commands. + +Remember, however, that @emph{operating system} facilities aren't +available on your development board; for example, if your program hangs, +you can't send an interrupt---but you can press the @sc{reset} switch! + +Use the @sc{reset} button on the development board +@itemize @bullet +@item +to interrupt your program (don't use @kbd{ctl-C} on the DOS host---it has +no way to pass an interrupt signal to the development board); and + +@item +to return to the @value{GDBN} command prompt after your program finishes +normally. The communications protocol provides no other way for @value{GDBN} +to detect program completion. +@end itemize + +In either case, @value{GDBN} sees the effect of a @sc{reset} on the +development board as a ``normal exit'' of your program. + +@node Hitachi ICE +@subsubsection Using the E7000 in-circuit emulator + +@kindex target e7000 +You can use the E7000 in-circuit emulator to develop code for either the +Hitachi SH or the H8/300H. Use one of these forms of the @samp{target +e7000} command to connect @value{GDBN} to your E7000: + +@table @code +@item target e7000 @var{port} @var{speed} +Use this form if your E7000 is connected to a serial port. The +@var{port} argument identifies what serial port to use (for example, +@samp{com2}). The third argument is the line speed in bits per second +(for example, @samp{9600}). + +@item target e7000 @var{hostname} +If your E7000 is installed as a host on a TCP/IP network, you can just +specify its hostname; @value{GDBN} uses @code{telnet} to connect. +@end table + +@node Hitachi Special +@subsubsection Special @value{GDBN} commands for Hitachi micros + +Some @value{GDBN} commands are available only for the H8/300: + +@table @code + +@kindex set machine +@kindex show machine +@item set machine h8300 +@itemx set machine h8300h +Condition @value{GDBN} for one of the two variants of the H8/300 +architecture with @samp{set machine}. You can use @samp{show machine} +to check which variant is currently in effect. + +@end table + +@node H8/500 +@subsection H8/500 + +@table @code + +@kindex set memory @var{mod} +@cindex memory models, H8/500 +@item set memory @var{mod} +@itemx show memory +Specify which H8/500 memory model (@var{mod}) you are using with +@samp{set memory}; check which memory model is in effect with @samp{show +memory}. The accepted values for @var{mod} are @code{small}, +@code{big}, @code{medium}, and @code{compact}. + +@end table + +@node i960 +@subsection Intel i960 + +@table @code + +@kindex target mon960 +@item target mon960 @var{dev} +MON960 monitor for Intel i960. + +@item target nindy @var{devicename} +An Intel 960 board controlled by a Nindy Monitor. @var{devicename} is +the name of the serial device to use for the connection, e.g. +@file{/dev/ttya}. + +@end table + +@cindex Nindy +@cindex i960 +@dfn{Nindy} is a ROM Monitor program for Intel 960 target systems. When +@value{GDBN} is configured to control a remote Intel 960 using Nindy, you can +tell @value{GDBN} how to connect to the 960 in several ways: + +@itemize @bullet +@item +Through command line options specifying serial port, version of the +Nindy protocol, and communications speed; + +@item +By responding to a prompt on startup; + +@item +By using the @code{target} command at any point during your @value{GDBN} +session. @xref{Target Commands, ,Commands for managing targets}. + +@kindex target nindy +@item target nindy @var{devicename} +An Intel 960 board controlled by a Nindy Monitor. @var{devicename} is +the name of the serial device to use for the connection, e.g. +@file{/dev/ttya}. + +@end itemize + +@cindex download to Nindy-960 +With the Nindy interface to an Intel 960 board, @code{load} +downloads @var{filename} to the 960 as well as adding its symbols in +@value{GDBN}. + +@menu +* Nindy Startup:: Startup with Nindy +* Nindy Options:: Options for Nindy +* Nindy Reset:: Nindy reset command +@end menu + +@node Nindy Startup +@subsubsection Startup with Nindy + +If you simply start @code{@value{GDBP}} without using any command-line +options, you are prompted for what serial port to use, @emph{before} you +reach the ordinary @value{GDBN} prompt: + +@example +Attach /dev/ttyNN -- specify NN, or "quit" to quit: +@end example + +@noindent +Respond to the prompt with whatever suffix (after @samp{/dev/tty}) +identifies the serial port you want to use. You can, if you choose, +simply start up with no Nindy connection by responding to the prompt +with an empty line. If you do this and later wish to attach to Nindy, +use @code{target} (@pxref{Target Commands, ,Commands for managing targets}). + +@node Nindy Options +@subsubsection Options for Nindy + +These are the startup options for beginning your @value{GDBN} session with a +Nindy-960 board attached: + +@table @code +@item -r @var{port} +Specify the serial port name of a serial interface to be used to connect +to the target system. This option is only available when @value{GDBN} is +configured for the Intel 960 target architecture. You may specify +@var{port} as any of: a full pathname (e.g. @samp{-r /dev/ttya}), a +device name in @file{/dev} (e.g. @samp{-r ttya}), or simply the unique +suffix for a specific @code{tty} (e.g. @samp{-r a}). + +@item -O +(An uppercase letter ``O'', not a zero.) Specify that @value{GDBN} should use +the ``old'' Nindy monitor protocol to connect to the target system. +This option is only available when @value{GDBN} is configured for the Intel 960 +target architecture. + +@quotation +@emph{Warning:} if you specify @samp{-O}, but are actually trying to +connect to a target system that expects the newer protocol, the connection +fails, appearing to be a speed mismatch. @value{GDBN} repeatedly +attempts to reconnect at several different line speeds. You can abort +this process with an interrupt. +@end quotation + +@item -brk +Specify that @value{GDBN} should first send a @code{BREAK} signal to the target +system, in an attempt to reset it, before connecting to a Nindy target. + +@quotation +@emph{Warning:} Many target systems do not have the hardware that this +requires; it only works with a few boards. +@end quotation +@end table + +The standard @samp{-b} option controls the line speed used on the serial +port. + +@c @group +@node Nindy Reset +@subsubsection Nindy reset command + +@table @code +@item reset +@kindex reset +For a Nindy target, this command sends a ``break'' to the remote target +system; this is only useful if the target has been equipped with a +circuit to perform a hard reset (or some other interesting action) when +a break is detected. +@end table +@c @end group + +@node M32R/D +@subsection Mitsubishi M32R/D + +@table @code + +@kindex target m32r +@item target m32r @var{dev} +Mitsubishi M32R/D ROM monitor. + +@end table + +@node M68K +@subsection M68k + +The Motorola m68k configuration includes ColdFire support, and +target command for the following ROM monitors. + +@table @code + +@kindex target abug +@item target abug @var{dev} +ABug ROM monitor for M68K. + +@kindex target cpu32bug +@item target cpu32bug @var{dev} +CPU32BUG monitor, running on a CPU32 (M68K) board. + +@kindex target dbug +@item target dbug @var{dev} +dBUG ROM monitor for Motorola ColdFire. + +@kindex target est +@item target est @var{dev} +EST-300 ICE monitor, running on a CPU32 (M68K) board. + +@kindex target rom68k +@item target rom68k @var{dev} +ROM 68K monitor, running on an M68K IDP board. + +@end table + +If @value{GDBN} is configured with @code{m68*-ericsson-*}, it will +instead have only a single special target command: + +@table @code + +@kindex target es1800 +@item target es1800 @var{dev} +ES-1800 emulator for M68K. + +@end table + +[context?] + +@table @code + +@kindex target rombug +@item target rombug @var{dev} +ROMBUG ROM monitor for OS/9000. + +@end table + +@node M88K +@subsection M88K + +@table @code + +@kindex target bug +@item target bug @var{dev} +BUG monitor, running on a MVME187 (m88k) board. + +@end table + +@node MIPS Embedded +@subsection MIPS Embedded + +@cindex MIPS boards +@value{GDBN} can use the MIPS remote debugging protocol to talk to a +MIPS board attached to a serial line. This is available when +you configure @value{GDBN} with @samp{--target=mips-idt-ecoff}. + +@need 1000 +Use these @value{GDBN} commands to specify the connection to your target board: + +@table @code +@item target mips @var{port} +@kindex target mips @var{port} +To run a program on the board, start up @code{@value{GDBP}} with the +name of your program as the argument. To connect to the board, use the +command @samp{target mips @var{port}}, where @var{port} is the name of +the serial port connected to the board. If the program has not already +been downloaded to the board, you may use the @code{load} command to +download it. You can then use all the usual @value{GDBN} commands. + +For example, this sequence connects to the target board through a serial +port, and loads and runs a program called @var{prog} through the +debugger: + +@example +host$ @value{GDBP} @var{prog} +GDB is free software and @dots{} +(gdb) target mips /dev/ttyb +(gdb) load @var{prog} +(gdb) run +@end example + +@item target mips @var{hostname}:@var{portnumber} +On some @value{GDBN} host configurations, you can specify a TCP +connection (for instance, to a serial line managed by a terminal +concentrator) instead of a serial port, using the syntax +@samp{@var{hostname}:@var{portnumber}}. + +@item target pmon @var{port} +@kindex target pmon @var{port} +PMON ROM monitor. + +@item target ddb @var{port} +@kindex target ddb @var{port} +NEC's DDB variant of PMON for Vr4300. + +@item target lsi @var{port} +@kindex target lsi @var{port} +LSI variant of PMON. + +@kindex target r3900 +@item target r3900 @var{dev} +Densan DVE-R3900 ROM monitor for Toshiba R3900 Mips. + +@kindex target array +@item target array @var{dev} +Array Tech LSI33K RAID controller board. + +@end table + + +@noindent +@value{GDBN} also supports these special commands for MIPS targets: + +@table @code +@item set processor @var{args} +@itemx show processor +@kindex set processor @var{args} +@kindex show processor +Use the @code{set processor} command to set the type of MIPS +processor when you want to access processor-type-specific registers. +For example, @code{set processor @var{r3041}} tells @value{GDBN} +to use the CPO registers appropriate for the 3041 chip. +Use the @code{show processor} command to see what MIPS processor @value{GDBN} +is using. Use the @code{info reg} command to see what registers +@value{GDBN} is using. + +@item set mipsfpu double +@itemx set mipsfpu single +@itemx set mipsfpu none +@itemx show mipsfpu +@kindex set mipsfpu +@kindex show mipsfpu +@cindex MIPS remote floating point +@cindex floating point, MIPS remote +If your target board does not support the MIPS floating point +coprocessor, you should use the command @samp{set mipsfpu none} (if you +need this, you may wish to put the command in your @value{GDBINIT} +file). This tells @value{GDBN} how to find the return value of +functions which return floating point values. It also allows +@value{GDBN} to avoid saving the floating point registers when calling +functions on the board. If you are using a floating point coprocessor +with only single precision floating point support, as on the @sc{r4650} +processor, use the command @samp{set mipsfpu single}. The default +double precision floating point coprocessor may be selected using +@samp{set mipsfpu double}. + +In previous versions the only choices were double precision or no +floating point, so @samp{set mipsfpu on} will select double precision +and @samp{set mipsfpu off} will select no floating point. + +As usual, you can inquire about the @code{mipsfpu} variable with +@samp{show mipsfpu}. + +@item set remotedebug @var{n} +@itemx show remotedebug +@kindex set remotedebug +@kindex show remotedebug +@cindex @code{remotedebug}, MIPS protocol +@cindex MIPS @code{remotedebug} protocol +@c FIXME! For this to be useful, you must know something about the MIPS +@c FIXME...protocol. Where is it described? +You can see some debugging information about communications with the board +by setting the @code{remotedebug} variable. If you set it to @code{1} using +@samp{set remotedebug 1}, every packet is displayed. If you set it +to @code{2}, every character is displayed. You can check the current value +at any time with the command @samp{show remotedebug}. + +@item set timeout @var{seconds} +@itemx set retransmit-timeout @var{seconds} +@itemx show timeout +@itemx show retransmit-timeout +@cindex @code{timeout}, MIPS protocol +@cindex @code{retransmit-timeout}, MIPS protocol +@kindex set timeout +@kindex show timeout +@kindex set retransmit-timeout +@kindex show retransmit-timeout +You can control the timeout used while waiting for a packet, in the MIPS +remote protocol, with the @code{set timeout @var{seconds}} command. The +default is 5 seconds. Similarly, you can control the timeout used while +waiting for an acknowledgement of a packet with the @code{set +retransmit-timeout @var{seconds}} command. The default is 3 seconds. +You can inspect both values with @code{show timeout} and @code{show +retransmit-timeout}. (These commands are @emph{only} available when +@value{GDBN} is configured for @samp{--target=mips-idt-ecoff}.) + +The timeout set by @code{set timeout} does not apply when @value{GDBN} +is waiting for your program to stop. In that case, @value{GDBN} waits +forever because it has no way of knowing how long the program is going +to run before stopping. +@end table + +@node PowerPC +@subsection PowerPC + +@table @code + +@kindex target dink32 +@item target dink32 @var{dev} +DINK32 ROM monitor. + +@kindex target ppcbug +@item target ppcbug @var{dev} +@kindex target ppcbug1 +@item target ppcbug1 @var{dev} +PPCBUG ROM monitor for PowerPC. + +@kindex target sds +@item target sds @var{dev} +SDS monitor, running on a PowerPC board (such as Motorola's ADS). + +@end table + +@node PA +@subsection HP PA Embedded + +@table @code + +@kindex target op50n +@item target op50n @var{dev} +OP50N monitor, running on an OKI HPPA board. + +@kindex target w89k +@item target w89k @var{dev} +W89K monitor, running on a Winbond HPPA board. + +@end table + +@node SH +@subsection Hitachi SH + +@table @code + +@kindex target hms +@item target hms @var{dev} +A Hitachi SH board attached via serial line to your host. Use special +commands @code{device} and @code{speed} to control the serial line and +the communications speed used. + +@kindex target e7000 +@item target e7000 @var{dev} +E7000 emulator for Hitachi SH. + +@kindex target sh3 +@kindex target sh3e +@item target sh3 @var{dev} +@item target sh3e @var{dev} +Hitachi SH-3 and SH-3E target systems. + +@end table + +@node Sparclet +@subsection Tsqware Sparclet + +@cindex Sparclet + +@value{GDBN} enables developers to debug tasks running on +Sparclet targets from a Unix host. +@value{GDBN} uses code that runs on +both the Unix host and on the Sparclet target. The program +@code{gdb} is installed and executed on the Unix host. + +@table @code +@item timeout @var{args} +@kindex remotetimeout +@value{GDBN} now supports the option @code{remotetimeout}. +This option is set by the user, and @var{args} represents the number of +seconds @value{GDBN} waits for responses. +@end table + +@kindex Compiling +When compiling for debugging, include the options "-g" to get debug +information and "-Ttext" to relocate the program to where you wish to +load it on the target. You may also want to add the options "-n" or +"-N" in order to reduce the size of the sections. + +@example +sparclet-aout-gcc prog.c -Ttext 0x12010000 -g -o prog -N +@end example + +You can use objdump to verify that the addresses are what you intended. + +@example +sparclet-aout-objdump --headers --syms prog +@end example + +@kindex Running +Once you have set +your Unix execution search path to find @value{GDBN}, you are ready to +run @value{GDBN}. From your Unix host, run @code{gdb} +(or @code{sparclet-aout-gdb}, depending on your installation). + +@value{GDBN} comes up showing the prompt: + +@example +(gdbslet) +@end example + +@menu +* Sparclet File:: Setting the file to debug +* Sparclet Connection:: Connecting to Sparclet +* Sparclet Download:: Sparclet download +* Sparclet Execution:: Running and debugging +@end menu + +@node Sparclet File +@subsubsection Setting file to debug + +The @value{GDBN} command @code{file} lets you choose with program to debug. + +@example +(gdbslet) file prog +@end example + +@need 1000 +@value{GDBN} then attempts to read the symbol table of @file{prog}. +@value{GDBN} locates +the file by searching the directories listed in the command search +path. +If the file was compiled with debug information (option "-g"), source +files will be searched as well. +@value{GDBN} locates +the source files by searching the directories listed in the directory search +path (@pxref{Environment, ,Your program's environment}). +If it fails +to find a file, it displays a message such as: + +@example +prog: No such file or directory. +@end example + +When this happens, add the appropriate directories to the search paths with +the @value{GDBN} commands @code{path} and @code{dir}, and execute the +@code{target} command again. + +@node Sparclet Connection +@subsubsection Connecting to Sparclet + +The @value{GDBN} command @code{target} lets you connect to a Sparclet target. +To connect to a target on serial port ``@code{ttya}'', type: + +@example +(gdbslet) target sparclet /dev/ttya +Remote target sparclet connected to /dev/ttya +main () at ../prog.c:3 +@end example + +@need 750 +@value{GDBN} displays messages like these: + +@smallexample +Connected to ttya. +@end smallexample + +@node Sparclet Download +@subsubsection Sparclet download + +@cindex download to Sparclet +Once connected to the Sparclet target, +you can use the @value{GDBN} +@code{load} command to download the file from the host to the target. +The file name and load offset should be given as arguments to the @code{load} +command. +Since the file format is aout, the program must be loaded to the starting +address. You can use objdump to find out what this value is. The load +offset is an offset which is added to the VMA (virtual memory address) +of each of the file's sections. +For instance, if the program +@file{prog} was linked to text address 0x1201000, with data at 0x12010160 +and bss at 0x12010170, in @value{GDBN}, type: + +@example +(gdbslet) load prog 0x12010000 +Loading section .text, size 0xdb0 vma 0x12010000 +@end example + +If the code is loaded at a different address then what the program was linked +to, you may need to use the @code{section} and @code{add-symbol-file} commands +to tell @value{GDBN} where to map the symbol table. + +@node Sparclet Execution +@subsubsection Running and debugging + +@cindex running and debugging Sparclet programs +You can now begin debugging the task using @value{GDBN}'s execution control +commands, @code{b}, @code{step}, @code{run}, etc. See the @value{GDBN} +manual for the list of commands. + +@example +(gdbslet) b main +Breakpoint 1 at 0x12010000: file prog.c, line 3. +(gdbslet) run +Starting program: prog +Breakpoint 1, main (argc=1, argv=0xeffff21c) at prog.c:3 +3 char *symarg = 0; +(gdbslet) step +4 char *execarg = "hello!"; +(gdbslet) +@end example + +@node Sparclite +@subsection Fujitsu Sparclite + +@table @code + +@kindex target sparclite +@item target sparclite @var{dev} +Fujitsu sparclite boards, used only for the purpose of loading. +You must use an additional command to debug the program. +For example: target remote @var{dev} using @value{GDBN} standard +remote protocol. + +@end table + +@node ST2000 +@subsection Tandem ST2000 + +GDB may be used with a Tandem ST2000 phone switch, running Tandem's +STDBUG protocol. + +To connect your ST2000 to the host system, see the manufacturer's +manual. Once the ST2000 is physically attached, you can run: + +@example +target st2000 @var{dev} @var{speed} +@end example + +@noindent +to establish it as your debugging environment. @var{dev} is normally +the name of a serial device, such as @file{/dev/ttya}, connected to the +ST2000 via a serial line. You can instead specify @var{dev} as a TCP +connection (for example, to a serial line attached via a terminal +concentrator) using the syntax @code{@var{hostname}:@var{portnumber}}. + +The @code{load} and @code{attach} commands are @emph{not} defined for +this target; you must load your program into the ST2000 as you normally +would for standalone operation. @value{GDBN} reads debugging information +(such as symbols) from a separate, debugging version of the program +available on your host computer. +@c FIXME!! This is terribly vague; what little content is here is +@c basically hearsay. + +@cindex ST2000 auxiliary commands +These auxiliary @value{GDBN} commands are available to help you with the ST2000 +environment: + +@table @code +@item st2000 @var{command} +@kindex st2000 @var{cmd} +@cindex STDBUG commands (ST2000) +@cindex commands to STDBUG (ST2000) +Send a @var{command} to the STDBUG monitor. See the manufacturer's +manual for available commands. + +@item connect +@cindex connect (to STDBUG) +Connect the controlling terminal to the STDBUG command monitor. When +you are done interacting with STDBUG, typing either of two character +sequences gets you back to the @value{GDBN} command prompt: +@kbd{@key{RET}~.} (Return, followed by tilde and period) or +@kbd{@key{RET}~@key{C-d}} (Return, followed by tilde and control-D). +@end table + +@node Z8000 +@subsection Zilog Z8000 + +@cindex Z8000 +@cindex simulator, Z8000 +@cindex Zilog Z8000 simulator + +When configured for debugging Zilog Z8000 targets, @value{GDBN} includes +a Z8000 simulator. + +For the Z8000 family, @samp{target sim} simulates either the Z8002 (the +unsegmented variant of the Z8000 architecture) or the Z8001 (the +segmented variant). The simulator recognizes which architecture is +appropriate by inspecting the object code. + +@table @code +@item target sim @var{args} +@kindex sim +@kindex target sim +Debug programs on a simulated CPU. If the simulator supports setup +options, specify them via @var{args}. +@end table + +@noindent +After specifying this target, you can debug programs for the simulated +CPU in the same style as programs for your host computer; use the +@code{file} command to load a new program image, the @code{run} command +to run your program, and so on. + +As well as making available all the usual machine registers (see +@code{info reg}), the Z8000 simulator provides three additional items +of information as specially named registers: + +@table @code + +@item cycles +Counts clock-ticks in the simulator. + +@item insts +Counts instructions run in the simulator. + +@item time +Execution time in 60ths of a second. + +@end table + +You can refer to these values in @value{GDBN} expressions with the usual +conventions; for example, @w{@samp{b fputc if $cycles>5000}} sets a +conditional breakpoint that suspends only after at least 5000 +simulated clock ticks. + +@node Architectures +@section Architectures + +This section describes characteristics of architectures that affect +all uses of GDB with this architecture, both native and cross. + +@menu +* A29K:: +* Alpha:: +* MIPS:: +@end menu + +@node A29K +@subsection A29K + +@table @code + +@kindex set rstack_high_address +@cindex AMD 29K register stack +@cindex register stack, AMD29K +@item set rstack_high_address @var{address} +On AMD 29000 family processors, registers are saved in a separate +``register stack''. There is no way for @value{GDBN} to determine the +extent of this stack. Normally, @value{GDBN} just assumes that the +stack is ``large enough''. This may result in @value{GDBN} referencing +memory locations that do not exist. If necessary, you can get around +this problem by specifying the ending address of the register stack with +the @code{set rstack_high_address} command. The argument should be an +address, which you probably want to precede with @samp{0x} to specify in +hexadecimal. + +@kindex show rstack_high_address +@item show rstack_high_address +Display the current limit of the register stack, on AMD 29000 family +processors. + +@end table + +@node Alpha +@subsection Alpha + +See the following section. + +@node MIPS +@subsection MIPS + +@cindex stack on Alpha +@cindex stack on MIPS +@cindex Alpha stack +@cindex MIPS stack +Alpha- and MIPS-based computers use an unusual stack frame, which +sometimes requires @value{GDBN} to search backward in the object code to +find the beginning of a function. + +@cindex response time, MIPS debugging +To improve response time (especially for embedded applications, where +@value{GDBN} may be restricted to a slow serial line for this search) +you may want to limit the size of this search, using one of these +commands: + +@table @code +@cindex @code{heuristic-fence-post} (Alpha,MIPS) +@item set heuristic-fence-post @var{limit} +Restrict @value{GDBN} to examining at most @var{limit} bytes in its +search for the beginning of a function. A value of @var{0} (the +default) means there is no limit. However, except for @var{0}, the +larger the limit the more bytes @code{heuristic-fence-post} must search +and therefore the longer it takes to run. + +@item show heuristic-fence-post +Display the current limit. +@end table + +@noindent +These commands are available @emph{only} when @value{GDBN} is configured +for debugging programs on Alpha or MIPS processors. + + @node Controlling GDB @chapter Controlling @value{GDBN} diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo index d7df1e5..a60c9f3 100644 --- a/gdb/doc/gdbint.texinfo +++ b/gdb/doc/gdbint.texinfo @@ -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 diff --git a/gdb/event-loop.h b/gdb/event-loop.h index bde1784..9e046e0 100644 --- a/gdb/event-loop.h +++ b/gdb/event-loop.h @@ -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); diff --git a/gdb/event-top.c b/gdb/event-top.c index eb4f820..75b24e9 100644 --- a/gdb/event-top.c +++ b/gdb/event-top.c @@ -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 diff --git a/gdb/fork-child.c b/gdb/fork-child.c index 754367b..33cbb33 100644 --- a/gdb/fork-child.c +++ b/gdb/fork-child.c @@ -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 diff --git a/gdb/gdb-events.c b/gdb/gdb-events.c new file mode 100644 index 0000000..a8c4192 --- /dev/null +++ b/gdb/gdb-events.c @@ -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); +} diff --git a/gdb/gdb-events.h b/gdb/gdb-events.h new file mode 100644 index 0000000..ab60517 --- /dev/null +++ b/gdb/gdb-events.h @@ -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 diff --git a/gdb/gdb-events.sh b/gdb/gdb-events.sh new file mode 100755 index 0000000..ab70bb1 --- /dev/null +++ b/gdb/gdb-events.sh @@ -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 diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index aceeed7..17870d0 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -18,7 +18,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* *INDENT-OFF* */ /* typedef (f)();'' confuses indent */ +/* *INDENT-OFF* */ /* ``typedef (f)();'' confuses indent */ + +/* This file was created with the aid of ``gdbarch.sh''. + + The bourn shell script ``gdbarch.sh'' creates the files + ``new-gdbarch.c'' and ``new-gdbarch.h and then compares them + against the existing ``gdbarch.[hc]''. Any differences found + being reported. + + If editing this file, please also run gdbarch.sh and merge any + changes into that script. Conversely, when makeing sweeping changes + to this file, modifying gdbarch.sh and using its output may prove + easier. */ #include "defs.h" @@ -46,6 +58,14 @@ #include "symcat.h" +/* Static function declarations */ + +static void verify_gdbarch (struct gdbarch *gdbarch); +static void init_gdbarch_data (struct gdbarch *); +static void init_gdbarch_swap (struct gdbarch *); +static void swapout_gdbarch_swap (struct gdbarch *); +static void swapin_gdbarch_swap (struct gdbarch *); + /* Convenience macro for allocting typesafe memory. */ #ifndef XMALLOC @@ -289,9 +309,8 @@ struct gdbarch *current_gdbarch = &default_gdbarch; ``struct gdbarch_info''. */ struct gdbarch * -gdbarch_alloc (info, tdep) - const struct gdbarch_info *info; - struct gdbarch_tdep *tdep; +gdbarch_alloc (const struct gdbarch_info *info, + struct gdbarch_tdep *tdep) { struct gdbarch *gdbarch = XMALLOC (struct gdbarch); memset (gdbarch, 0, sizeof (*gdbarch)); @@ -328,10 +347,8 @@ gdbarch_alloc (info, tdep) /* Ensure that all values in a GDBARCH are reasonable. */ -static void verify_gdbarch PARAMS ((struct gdbarch *gdbarch)); static void -verify_gdbarch (gdbarch) - struct gdbarch *gdbarch; +verify_gdbarch (struct gdbarch *gdbarch) { /* Only perform sanity checks on a multi-arch target. */ if (GDB_MULTI_ARCH <= 0) @@ -573,7 +590,7 @@ verify_gdbarch (gdbarch) /* Print out the details of the current architecture. */ void -gdbarch_dump () +gdbarch_dump (void) { if (TARGET_ARCHITECTURE != NULL) fprintf_unfiltered (gdb_stdlog, @@ -875,8 +892,7 @@ gdbarch_dump () } struct gdbarch_tdep * -gdbarch_tdep (gdbarch) - struct gdbarch *gdbarch; +gdbarch_tdep (struct gdbarch *gdbarch) { if (gdbarch_debug >= 2) /* FIXME: gdb_std??? */ @@ -886,8 +902,7 @@ gdbarch_tdep (gdbarch) const struct bfd_arch_info * -gdbarch_bfd_arch_info (gdbarch) - struct gdbarch *gdbarch; +gdbarch_bfd_arch_info (struct gdbarch *gdbarch) { if (gdbarch_debug >= 2) /* FIXME: gdb_std??? */ @@ -896,8 +911,7 @@ gdbarch_bfd_arch_info (gdbarch) } int -gdbarch_byte_order (gdbarch) - struct gdbarch *gdbarch; +gdbarch_byte_order (struct gdbarch *gdbarch) { if (gdbarch_debug >= 2) /* FIXME: gdb_std??? */ @@ -906,8 +920,7 @@ gdbarch_byte_order (gdbarch) } int -gdbarch_ptr_bit (gdbarch) - struct gdbarch *gdbarch; +gdbarch_ptr_bit (struct gdbarch *gdbarch) { if (gdbarch->ptr_bit == 0) internal_error ("gdbarch: gdbarch_ptr_bit invalid"); @@ -918,16 +931,14 @@ gdbarch_ptr_bit (gdbarch) } void -set_gdbarch_ptr_bit (gdbarch, ptr_bit) - struct gdbarch *gdbarch; - int ptr_bit; +set_gdbarch_ptr_bit (struct gdbarch *gdbarch, + int ptr_bit) { gdbarch->ptr_bit = ptr_bit; } int -gdbarch_short_bit (gdbarch) - struct gdbarch *gdbarch; +gdbarch_short_bit (struct gdbarch *gdbarch) { if (gdbarch->short_bit == 0) internal_error ("gdbarch: gdbarch_short_bit invalid"); @@ -938,16 +949,14 @@ gdbarch_short_bit (gdbarch) } void -set_gdbarch_short_bit (gdbarch, short_bit) - struct gdbarch *gdbarch; - int short_bit; +set_gdbarch_short_bit (struct gdbarch *gdbarch, + int short_bit) { gdbarch->short_bit = short_bit; } int -gdbarch_int_bit (gdbarch) - struct gdbarch *gdbarch; +gdbarch_int_bit (struct gdbarch *gdbarch) { if (gdbarch->int_bit == 0) internal_error ("gdbarch: gdbarch_int_bit invalid"); @@ -958,16 +967,14 @@ gdbarch_int_bit (gdbarch) } void -set_gdbarch_int_bit (gdbarch, int_bit) - struct gdbarch *gdbarch; - int int_bit; +set_gdbarch_int_bit (struct gdbarch *gdbarch, + int int_bit) { gdbarch->int_bit = int_bit; } int -gdbarch_long_bit (gdbarch) - struct gdbarch *gdbarch; +gdbarch_long_bit (struct gdbarch *gdbarch) { if (gdbarch->long_bit == 0) internal_error ("gdbarch: gdbarch_long_bit invalid"); @@ -978,16 +985,14 @@ gdbarch_long_bit (gdbarch) } void -set_gdbarch_long_bit (gdbarch, long_bit) - struct gdbarch *gdbarch; - int long_bit; +set_gdbarch_long_bit (struct gdbarch *gdbarch, + int long_bit) { gdbarch->long_bit = long_bit; } int -gdbarch_long_long_bit (gdbarch) - struct gdbarch *gdbarch; +gdbarch_long_long_bit (struct gdbarch *gdbarch) { if (gdbarch->long_long_bit == 0) internal_error ("gdbarch: gdbarch_long_long_bit invalid"); @@ -998,16 +1003,14 @@ gdbarch_long_long_bit (gdbarch) } void -set_gdbarch_long_long_bit (gdbarch, long_long_bit) - struct gdbarch *gdbarch; - int long_long_bit; +set_gdbarch_long_long_bit (struct gdbarch *gdbarch, + int long_long_bit) { gdbarch->long_long_bit = long_long_bit; } int -gdbarch_float_bit (gdbarch) - struct gdbarch *gdbarch; +gdbarch_float_bit (struct gdbarch *gdbarch) { if (gdbarch->float_bit == 0) internal_error ("gdbarch: gdbarch_float_bit invalid"); @@ -1018,16 +1021,14 @@ gdbarch_float_bit (gdbarch) } void -set_gdbarch_float_bit (gdbarch, float_bit) - struct gdbarch *gdbarch; - int float_bit; +set_gdbarch_float_bit (struct gdbarch *gdbarch, + int float_bit) { gdbarch->float_bit = float_bit; } int -gdbarch_double_bit (gdbarch) - struct gdbarch *gdbarch; +gdbarch_double_bit (struct gdbarch *gdbarch) { if (gdbarch->double_bit == 0) internal_error ("gdbarch: gdbarch_double_bit invalid"); @@ -1038,16 +1039,14 @@ gdbarch_double_bit (gdbarch) } void -set_gdbarch_double_bit (gdbarch, double_bit) - struct gdbarch *gdbarch; - int double_bit; +set_gdbarch_double_bit (struct gdbarch *gdbarch, + int double_bit) { gdbarch->double_bit = double_bit; } int -gdbarch_long_double_bit (gdbarch) - struct gdbarch *gdbarch; +gdbarch_long_double_bit (struct gdbarch *gdbarch) { if (gdbarch->long_double_bit == 0) internal_error ("gdbarch: gdbarch_long_double_bit invalid"); @@ -1058,9 +1057,8 @@ gdbarch_long_double_bit (gdbarch) } void -set_gdbarch_long_double_bit (gdbarch, long_double_bit) - struct gdbarch *gdbarch; - int long_double_bit; +set_gdbarch_long_double_bit (struct gdbarch *gdbarch, + int long_double_bit) { gdbarch->long_double_bit = long_double_bit; } @@ -1077,9 +1075,8 @@ gdbarch_read_pc (struct gdbarch *gdbarch, int pid) } void -set_gdbarch_read_pc (gdbarch, read_pc) - struct gdbarch *gdbarch; - gdbarch_read_pc_ftype read_pc; +set_gdbarch_read_pc (struct gdbarch *gdbarch, + gdbarch_read_pc_ftype read_pc) { gdbarch->read_pc = read_pc; } @@ -1096,9 +1093,8 @@ gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, int pid) } void -set_gdbarch_write_pc (gdbarch, write_pc) - struct gdbarch *gdbarch; - gdbarch_write_pc_ftype write_pc; +set_gdbarch_write_pc (struct gdbarch *gdbarch, + gdbarch_write_pc_ftype write_pc) { gdbarch->write_pc = write_pc; } @@ -1115,9 +1111,8 @@ gdbarch_read_fp (struct gdbarch *gdbarch) } void -set_gdbarch_read_fp (gdbarch, read_fp) - struct gdbarch *gdbarch; - gdbarch_read_fp_ftype read_fp; +set_gdbarch_read_fp (struct gdbarch *gdbarch, + gdbarch_read_fp_ftype read_fp) { gdbarch->read_fp = read_fp; } @@ -1134,9 +1129,8 @@ gdbarch_write_fp (struct gdbarch *gdbarch, CORE_ADDR val) } void -set_gdbarch_write_fp (gdbarch, write_fp) - struct gdbarch *gdbarch; - gdbarch_write_fp_ftype write_fp; +set_gdbarch_write_fp (struct gdbarch *gdbarch, + gdbarch_write_fp_ftype write_fp) { gdbarch->write_fp = write_fp; } @@ -1153,9 +1147,8 @@ gdbarch_read_sp (struct gdbarch *gdbarch) } void -set_gdbarch_read_sp (gdbarch, read_sp) - struct gdbarch *gdbarch; - gdbarch_read_sp_ftype read_sp; +set_gdbarch_read_sp (struct gdbarch *gdbarch, + gdbarch_read_sp_ftype read_sp) { gdbarch->read_sp = read_sp; } @@ -1172,16 +1165,14 @@ gdbarch_write_sp (struct gdbarch *gdbarch, CORE_ADDR val) } void -set_gdbarch_write_sp (gdbarch, write_sp) - struct gdbarch *gdbarch; - gdbarch_write_sp_ftype write_sp; +set_gdbarch_write_sp (struct gdbarch *gdbarch, + gdbarch_write_sp_ftype write_sp) { gdbarch->write_sp = write_sp; } int -gdbarch_num_regs (gdbarch) - struct gdbarch *gdbarch; +gdbarch_num_regs (struct gdbarch *gdbarch) { if (gdbarch->num_regs == -1) internal_error ("gdbarch: gdbarch_num_regs invalid"); @@ -1192,16 +1183,14 @@ gdbarch_num_regs (gdbarch) } void -set_gdbarch_num_regs (gdbarch, num_regs) - struct gdbarch *gdbarch; - int num_regs; +set_gdbarch_num_regs (struct gdbarch *gdbarch, + int num_regs) { gdbarch->num_regs = num_regs; } int -gdbarch_sp_regnum (gdbarch) - struct gdbarch *gdbarch; +gdbarch_sp_regnum (struct gdbarch *gdbarch) { if (gdbarch->sp_regnum == -1) internal_error ("gdbarch: gdbarch_sp_regnum invalid"); @@ -1212,16 +1201,14 @@ gdbarch_sp_regnum (gdbarch) } void -set_gdbarch_sp_regnum (gdbarch, sp_regnum) - struct gdbarch *gdbarch; - int sp_regnum; +set_gdbarch_sp_regnum (struct gdbarch *gdbarch, + int sp_regnum) { gdbarch->sp_regnum = sp_regnum; } int -gdbarch_fp_regnum (gdbarch) - struct gdbarch *gdbarch; +gdbarch_fp_regnum (struct gdbarch *gdbarch) { if (gdbarch->fp_regnum == -1) internal_error ("gdbarch: gdbarch_fp_regnum invalid"); @@ -1232,16 +1219,14 @@ gdbarch_fp_regnum (gdbarch) } void -set_gdbarch_fp_regnum (gdbarch, fp_regnum) - struct gdbarch *gdbarch; - int fp_regnum; +set_gdbarch_fp_regnum (struct gdbarch *gdbarch, + int fp_regnum) { gdbarch->fp_regnum = fp_regnum; } int -gdbarch_pc_regnum (gdbarch) - struct gdbarch *gdbarch; +gdbarch_pc_regnum (struct gdbarch *gdbarch) { if (gdbarch->pc_regnum == -1) internal_error ("gdbarch: gdbarch_pc_regnum invalid"); @@ -1252,9 +1237,8 @@ gdbarch_pc_regnum (gdbarch) } void -set_gdbarch_pc_regnum (gdbarch, pc_regnum) - struct gdbarch *gdbarch; - int pc_regnum; +set_gdbarch_pc_regnum (struct gdbarch *gdbarch, + int pc_regnum) { gdbarch->pc_regnum = pc_regnum; } @@ -1271,16 +1255,14 @@ gdbarch_register_name (struct gdbarch *gdbarch, int regnr) } void -set_gdbarch_register_name (gdbarch, register_name) - struct gdbarch *gdbarch; - gdbarch_register_name_ftype register_name; +set_gdbarch_register_name (struct gdbarch *gdbarch, + gdbarch_register_name_ftype register_name) { gdbarch->register_name = register_name; } int -gdbarch_register_size (gdbarch) - struct gdbarch *gdbarch; +gdbarch_register_size (struct gdbarch *gdbarch) { if (gdbarch->register_size == -1) internal_error ("gdbarch: gdbarch_register_size invalid"); @@ -1291,16 +1273,14 @@ gdbarch_register_size (gdbarch) } void -set_gdbarch_register_size (gdbarch, register_size) - struct gdbarch *gdbarch; - int register_size; +set_gdbarch_register_size (struct gdbarch *gdbarch, + int register_size) { gdbarch->register_size = register_size; } int -gdbarch_register_bytes (gdbarch) - struct gdbarch *gdbarch; +gdbarch_register_bytes (struct gdbarch *gdbarch) { if (gdbarch->register_bytes == -1) internal_error ("gdbarch: gdbarch_register_bytes invalid"); @@ -1311,9 +1291,8 @@ gdbarch_register_bytes (gdbarch) } void -set_gdbarch_register_bytes (gdbarch, register_bytes) - struct gdbarch *gdbarch; - int register_bytes; +set_gdbarch_register_bytes (struct gdbarch *gdbarch, + int register_bytes) { gdbarch->register_bytes = register_bytes; } @@ -1330,9 +1309,8 @@ gdbarch_register_byte (struct gdbarch *gdbarch, int reg_nr) } void -set_gdbarch_register_byte (gdbarch, register_byte) - struct gdbarch *gdbarch; - gdbarch_register_byte_ftype register_byte; +set_gdbarch_register_byte (struct gdbarch *gdbarch, + gdbarch_register_byte_ftype register_byte) { gdbarch->register_byte = register_byte; } @@ -1349,16 +1327,14 @@ gdbarch_register_raw_size (struct gdbarch *gdbarch, int reg_nr) } void -set_gdbarch_register_raw_size (gdbarch, register_raw_size) - struct gdbarch *gdbarch; - gdbarch_register_raw_size_ftype register_raw_size; +set_gdbarch_register_raw_size (struct gdbarch *gdbarch, + gdbarch_register_raw_size_ftype register_raw_size) { gdbarch->register_raw_size = register_raw_size; } int -gdbarch_max_register_raw_size (gdbarch) - struct gdbarch *gdbarch; +gdbarch_max_register_raw_size (struct gdbarch *gdbarch) { if (gdbarch->max_register_raw_size == -1) internal_error ("gdbarch: gdbarch_max_register_raw_size invalid"); @@ -1369,9 +1345,8 @@ gdbarch_max_register_raw_size (gdbarch) } void -set_gdbarch_max_register_raw_size (gdbarch, max_register_raw_size) - struct gdbarch *gdbarch; - int max_register_raw_size; +set_gdbarch_max_register_raw_size (struct gdbarch *gdbarch, + int max_register_raw_size) { gdbarch->max_register_raw_size = max_register_raw_size; } @@ -1388,16 +1363,14 @@ gdbarch_register_virtual_size (struct gdbarch *gdbarch, int reg_nr) } void -set_gdbarch_register_virtual_size (gdbarch, register_virtual_size) - struct gdbarch *gdbarch; - gdbarch_register_virtual_size_ftype register_virtual_size; +set_gdbarch_register_virtual_size (struct gdbarch *gdbarch, + gdbarch_register_virtual_size_ftype register_virtual_size) { gdbarch->register_virtual_size = register_virtual_size; } int -gdbarch_max_register_virtual_size (gdbarch) - struct gdbarch *gdbarch; +gdbarch_max_register_virtual_size (struct gdbarch *gdbarch) { if (gdbarch->max_register_virtual_size == -1) internal_error ("gdbarch: gdbarch_max_register_virtual_size invalid"); @@ -1408,9 +1381,8 @@ gdbarch_max_register_virtual_size (gdbarch) } void -set_gdbarch_max_register_virtual_size (gdbarch, max_register_virtual_size) - struct gdbarch *gdbarch; - int max_register_virtual_size; +set_gdbarch_max_register_virtual_size (struct gdbarch *gdbarch, + int max_register_virtual_size) { gdbarch->max_register_virtual_size = max_register_virtual_size; } @@ -1427,16 +1399,14 @@ gdbarch_register_virtual_type (struct gdbarch *gdbarch, int reg_nr) } void -set_gdbarch_register_virtual_type (gdbarch, register_virtual_type) - struct gdbarch *gdbarch; - gdbarch_register_virtual_type_ftype register_virtual_type; +set_gdbarch_register_virtual_type (struct gdbarch *gdbarch, + gdbarch_register_virtual_type_ftype register_virtual_type) { gdbarch->register_virtual_type = register_virtual_type; } int -gdbarch_use_generic_dummy_frames (gdbarch) - struct gdbarch *gdbarch; +gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch) { if (gdbarch->use_generic_dummy_frames == -1) internal_error ("gdbarch: gdbarch_use_generic_dummy_frames invalid"); @@ -1447,16 +1417,14 @@ gdbarch_use_generic_dummy_frames (gdbarch) } void -set_gdbarch_use_generic_dummy_frames (gdbarch, use_generic_dummy_frames) - struct gdbarch *gdbarch; - int use_generic_dummy_frames; +set_gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch, + int use_generic_dummy_frames) { gdbarch->use_generic_dummy_frames = use_generic_dummy_frames; } int -gdbarch_call_dummy_location (gdbarch) - struct gdbarch *gdbarch; +gdbarch_call_dummy_location (struct gdbarch *gdbarch) { if (gdbarch->call_dummy_location == 0) internal_error ("gdbarch: gdbarch_call_dummy_location invalid"); @@ -1467,9 +1435,8 @@ gdbarch_call_dummy_location (gdbarch) } void -set_gdbarch_call_dummy_location (gdbarch, call_dummy_location) - struct gdbarch *gdbarch; - int call_dummy_location; +set_gdbarch_call_dummy_location (struct gdbarch *gdbarch, + int call_dummy_location) { gdbarch->call_dummy_location = call_dummy_location; } @@ -1486,16 +1453,14 @@ gdbarch_call_dummy_address (struct gdbarch *gdbarch) } void -set_gdbarch_call_dummy_address (gdbarch, call_dummy_address) - struct gdbarch *gdbarch; - gdbarch_call_dummy_address_ftype call_dummy_address; +set_gdbarch_call_dummy_address (struct gdbarch *gdbarch, + gdbarch_call_dummy_address_ftype call_dummy_address) { gdbarch->call_dummy_address = call_dummy_address; } CORE_ADDR -gdbarch_call_dummy_start_offset (gdbarch) - struct gdbarch *gdbarch; +gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch) { if (gdbarch->call_dummy_start_offset == -1) internal_error ("gdbarch: gdbarch_call_dummy_start_offset invalid"); @@ -1506,16 +1471,14 @@ gdbarch_call_dummy_start_offset (gdbarch) } void -set_gdbarch_call_dummy_start_offset (gdbarch, call_dummy_start_offset) - struct gdbarch *gdbarch; - CORE_ADDR call_dummy_start_offset; +set_gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch, + CORE_ADDR call_dummy_start_offset) { gdbarch->call_dummy_start_offset = call_dummy_start_offset; } CORE_ADDR -gdbarch_call_dummy_breakpoint_offset (gdbarch) - struct gdbarch *gdbarch; +gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch) { if (gdbarch->call_dummy_breakpoint_offset == -1) internal_error ("gdbarch: gdbarch_call_dummy_breakpoint_offset invalid"); @@ -1526,16 +1489,14 @@ gdbarch_call_dummy_breakpoint_offset (gdbarch) } void -set_gdbarch_call_dummy_breakpoint_offset (gdbarch, call_dummy_breakpoint_offset) - struct gdbarch *gdbarch; - CORE_ADDR call_dummy_breakpoint_offset; +set_gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch, + CORE_ADDR call_dummy_breakpoint_offset) { gdbarch->call_dummy_breakpoint_offset = call_dummy_breakpoint_offset; } int -gdbarch_call_dummy_breakpoint_offset_p (gdbarch) - struct gdbarch *gdbarch; +gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch) { if (gdbarch->call_dummy_breakpoint_offset_p == -1) internal_error ("gdbarch: gdbarch_call_dummy_breakpoint_offset_p invalid"); @@ -1546,16 +1507,14 @@ gdbarch_call_dummy_breakpoint_offset_p (gdbarch) } void -set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, call_dummy_breakpoint_offset_p) - struct gdbarch *gdbarch; - int call_dummy_breakpoint_offset_p; +set_gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch, + int call_dummy_breakpoint_offset_p) { gdbarch->call_dummy_breakpoint_offset_p = call_dummy_breakpoint_offset_p; } int -gdbarch_call_dummy_length (gdbarch) - struct gdbarch *gdbarch; +gdbarch_call_dummy_length (struct gdbarch *gdbarch) { if (gdbarch->call_dummy_length == -1) internal_error ("gdbarch: gdbarch_call_dummy_length invalid"); @@ -1566,9 +1525,8 @@ gdbarch_call_dummy_length (gdbarch) } void -set_gdbarch_call_dummy_length (gdbarch, call_dummy_length) - struct gdbarch *gdbarch; - int call_dummy_length; +set_gdbarch_call_dummy_length (struct gdbarch *gdbarch, + int call_dummy_length) { gdbarch->call_dummy_length = call_dummy_length; } @@ -1585,16 +1543,14 @@ gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, C } void -set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy) - struct gdbarch *gdbarch; - gdbarch_pc_in_call_dummy_ftype pc_in_call_dummy; +set_gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, + gdbarch_pc_in_call_dummy_ftype pc_in_call_dummy) { gdbarch->pc_in_call_dummy = pc_in_call_dummy; } int -gdbarch_call_dummy_p (gdbarch) - struct gdbarch *gdbarch; +gdbarch_call_dummy_p (struct gdbarch *gdbarch) { if (gdbarch->call_dummy_p == -1) internal_error ("gdbarch: gdbarch_call_dummy_p invalid"); @@ -1605,16 +1561,14 @@ gdbarch_call_dummy_p (gdbarch) } void -set_gdbarch_call_dummy_p (gdbarch, call_dummy_p) - struct gdbarch *gdbarch; - int call_dummy_p; +set_gdbarch_call_dummy_p (struct gdbarch *gdbarch, + int call_dummy_p) { gdbarch->call_dummy_p = call_dummy_p; } LONGEST * -gdbarch_call_dummy_words (gdbarch) - struct gdbarch *gdbarch; +gdbarch_call_dummy_words (struct gdbarch *gdbarch) { if (gdbarch_debug >= 2) /* FIXME: gdb_std??? */ @@ -1623,16 +1577,14 @@ gdbarch_call_dummy_words (gdbarch) } void -set_gdbarch_call_dummy_words (gdbarch, call_dummy_words) - struct gdbarch *gdbarch; - LONGEST * call_dummy_words; +set_gdbarch_call_dummy_words (struct gdbarch *gdbarch, + LONGEST * call_dummy_words) { gdbarch->call_dummy_words = call_dummy_words; } int -gdbarch_sizeof_call_dummy_words (gdbarch) - struct gdbarch *gdbarch; +gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch) { if (gdbarch_debug >= 2) /* FIXME: gdb_std??? */ @@ -1641,16 +1593,14 @@ gdbarch_sizeof_call_dummy_words (gdbarch) } void -set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof_call_dummy_words) - struct gdbarch *gdbarch; - int sizeof_call_dummy_words; +set_gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch, + int sizeof_call_dummy_words) { gdbarch->sizeof_call_dummy_words = sizeof_call_dummy_words; } int -gdbarch_call_dummy_stack_adjust_p (gdbarch) - struct gdbarch *gdbarch; +gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch) { if (gdbarch->call_dummy_stack_adjust_p == -1) internal_error ("gdbarch: gdbarch_call_dummy_stack_adjust_p invalid"); @@ -1661,16 +1611,14 @@ gdbarch_call_dummy_stack_adjust_p (gdbarch) } void -set_gdbarch_call_dummy_stack_adjust_p (gdbarch, call_dummy_stack_adjust_p) - struct gdbarch *gdbarch; - int call_dummy_stack_adjust_p; +set_gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch, + int call_dummy_stack_adjust_p) { gdbarch->call_dummy_stack_adjust_p = call_dummy_stack_adjust_p; } int -gdbarch_call_dummy_stack_adjust (gdbarch) - struct gdbarch *gdbarch; +gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch) { if (gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0) internal_error ("gdbarch: gdbarch_call_dummy_stack_adjust invalid"); @@ -1681,9 +1629,8 @@ gdbarch_call_dummy_stack_adjust (gdbarch) } void -set_gdbarch_call_dummy_stack_adjust (gdbarch, call_dummy_stack_adjust) - struct gdbarch *gdbarch; - int call_dummy_stack_adjust; +set_gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch, + int call_dummy_stack_adjust) { gdbarch->call_dummy_stack_adjust = call_dummy_stack_adjust; } @@ -1700,16 +1647,14 @@ gdbarch_fix_call_dummy (struct gdbarch *gdbarch, char *dummy, CORE_ADDR pc, CORE } void -set_gdbarch_fix_call_dummy (gdbarch, fix_call_dummy) - struct gdbarch *gdbarch; - gdbarch_fix_call_dummy_ftype fix_call_dummy; +set_gdbarch_fix_call_dummy (struct gdbarch *gdbarch, + gdbarch_fix_call_dummy_ftype fix_call_dummy) { gdbarch->fix_call_dummy = fix_call_dummy; } int -gdbarch_believe_pcc_promotion (gdbarch) - struct gdbarch *gdbarch; +gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch) { if (gdbarch_debug >= 2) /* FIXME: gdb_std??? */ @@ -1718,16 +1663,14 @@ gdbarch_believe_pcc_promotion (gdbarch) } void -set_gdbarch_believe_pcc_promotion (gdbarch, believe_pcc_promotion) - struct gdbarch *gdbarch; - int believe_pcc_promotion; +set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch, + int believe_pcc_promotion) { gdbarch->believe_pcc_promotion = believe_pcc_promotion; } int -gdbarch_believe_pcc_promotion_type (gdbarch) - struct gdbarch *gdbarch; +gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch) { if (gdbarch_debug >= 2) /* FIXME: gdb_std??? */ @@ -1736,9 +1679,8 @@ gdbarch_believe_pcc_promotion_type (gdbarch) } void -set_gdbarch_believe_pcc_promotion_type (gdbarch, believe_pcc_promotion_type) - struct gdbarch *gdbarch; - int believe_pcc_promotion_type; +set_gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch, + int believe_pcc_promotion_type) { gdbarch->believe_pcc_promotion_type = believe_pcc_promotion_type; } @@ -1755,9 +1697,8 @@ gdbarch_get_saved_register (struct gdbarch *gdbarch, char *raw_buffer, int *opti } void -set_gdbarch_get_saved_register (gdbarch, get_saved_register) - struct gdbarch *gdbarch; - gdbarch_get_saved_register_ftype get_saved_register; +set_gdbarch_get_saved_register (struct gdbarch *gdbarch, + gdbarch_get_saved_register_ftype get_saved_register) { gdbarch->get_saved_register = get_saved_register; } @@ -1774,9 +1715,8 @@ gdbarch_register_convertible (struct gdbarch *gdbarch, int nr) } void -set_gdbarch_register_convertible (gdbarch, register_convertible) - struct gdbarch *gdbarch; - gdbarch_register_convertible_ftype register_convertible; +set_gdbarch_register_convertible (struct gdbarch *gdbarch, + gdbarch_register_convertible_ftype register_convertible) { gdbarch->register_convertible = register_convertible; } @@ -1793,9 +1733,8 @@ gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum, struct } void -set_gdbarch_register_convert_to_virtual (gdbarch, register_convert_to_virtual) - struct gdbarch *gdbarch; - gdbarch_register_convert_to_virtual_ftype register_convert_to_virtual; +set_gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, + gdbarch_register_convert_to_virtual_ftype register_convert_to_virtual) { gdbarch->register_convert_to_virtual = register_convert_to_virtual; } @@ -1812,9 +1751,8 @@ gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, struct type *type, int } void -set_gdbarch_register_convert_to_raw (gdbarch, register_convert_to_raw) - struct gdbarch *gdbarch; - gdbarch_register_convert_to_raw_ftype register_convert_to_raw; +set_gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, + gdbarch_register_convert_to_raw_ftype register_convert_to_raw) { gdbarch->register_convert_to_raw = register_convert_to_raw; } @@ -1831,9 +1769,8 @@ gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, char * } void -set_gdbarch_extract_return_value (gdbarch, extract_return_value) - struct gdbarch *gdbarch; - gdbarch_extract_return_value_ftype extract_return_value; +set_gdbarch_extract_return_value (struct gdbarch *gdbarch, + gdbarch_extract_return_value_ftype extract_return_value) { gdbarch->extract_return_value = extract_return_value; } @@ -1850,9 +1787,8 @@ gdbarch_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, } void -set_gdbarch_push_arguments (gdbarch, push_arguments) - struct gdbarch *gdbarch; - gdbarch_push_arguments_ftype push_arguments; +set_gdbarch_push_arguments (struct gdbarch *gdbarch, + gdbarch_push_arguments_ftype push_arguments) { gdbarch->push_arguments = push_arguments; } @@ -1869,9 +1805,8 @@ gdbarch_push_dummy_frame (struct gdbarch *gdbarch) } void -set_gdbarch_push_dummy_frame (gdbarch, push_dummy_frame) - struct gdbarch *gdbarch; - gdbarch_push_dummy_frame_ftype push_dummy_frame; +set_gdbarch_push_dummy_frame (struct gdbarch *gdbarch, + gdbarch_push_dummy_frame_ftype push_dummy_frame) { gdbarch->push_dummy_frame = push_dummy_frame; } @@ -1888,9 +1823,8 @@ gdbarch_push_return_address (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp } void -set_gdbarch_push_return_address (gdbarch, push_return_address) - struct gdbarch *gdbarch; - gdbarch_push_return_address_ftype push_return_address; +set_gdbarch_push_return_address (struct gdbarch *gdbarch, + gdbarch_push_return_address_ftype push_return_address) { gdbarch->push_return_address = push_return_address; } @@ -1907,9 +1841,8 @@ gdbarch_pop_frame (struct gdbarch *gdbarch) } void -set_gdbarch_pop_frame (gdbarch, pop_frame) - struct gdbarch *gdbarch; - gdbarch_pop_frame_ftype pop_frame; +set_gdbarch_pop_frame (struct gdbarch *gdbarch, + gdbarch_pop_frame_ftype pop_frame) { gdbarch->pop_frame = pop_frame; } @@ -1926,9 +1859,8 @@ gdbarch_d10v_make_daddr (struct gdbarch *gdbarch, CORE_ADDR x) } void -set_gdbarch_d10v_make_daddr (gdbarch, d10v_make_daddr) - struct gdbarch *gdbarch; - gdbarch_d10v_make_daddr_ftype d10v_make_daddr; +set_gdbarch_d10v_make_daddr (struct gdbarch *gdbarch, + gdbarch_d10v_make_daddr_ftype d10v_make_daddr) { gdbarch->d10v_make_daddr = d10v_make_daddr; } @@ -1945,9 +1877,8 @@ gdbarch_d10v_make_iaddr (struct gdbarch *gdbarch, CORE_ADDR x) } void -set_gdbarch_d10v_make_iaddr (gdbarch, d10v_make_iaddr) - struct gdbarch *gdbarch; - gdbarch_d10v_make_iaddr_ftype d10v_make_iaddr; +set_gdbarch_d10v_make_iaddr (struct gdbarch *gdbarch, + gdbarch_d10v_make_iaddr_ftype d10v_make_iaddr) { gdbarch->d10v_make_iaddr = d10v_make_iaddr; } @@ -1964,9 +1895,8 @@ gdbarch_d10v_daddr_p (struct gdbarch *gdbarch, CORE_ADDR x) } void -set_gdbarch_d10v_daddr_p (gdbarch, d10v_daddr_p) - struct gdbarch *gdbarch; - gdbarch_d10v_daddr_p_ftype d10v_daddr_p; +set_gdbarch_d10v_daddr_p (struct gdbarch *gdbarch, + gdbarch_d10v_daddr_p_ftype d10v_daddr_p) { gdbarch->d10v_daddr_p = d10v_daddr_p; } @@ -1983,9 +1913,8 @@ gdbarch_d10v_iaddr_p (struct gdbarch *gdbarch, CORE_ADDR x) } void -set_gdbarch_d10v_iaddr_p (gdbarch, d10v_iaddr_p) - struct gdbarch *gdbarch; - gdbarch_d10v_iaddr_p_ftype d10v_iaddr_p; +set_gdbarch_d10v_iaddr_p (struct gdbarch *gdbarch, + gdbarch_d10v_iaddr_p_ftype d10v_iaddr_p) { gdbarch->d10v_iaddr_p = d10v_iaddr_p; } @@ -2002,9 +1931,8 @@ gdbarch_d10v_convert_daddr_to_raw (struct gdbarch *gdbarch, CORE_ADDR x) } void -set_gdbarch_d10v_convert_daddr_to_raw (gdbarch, d10v_convert_daddr_to_raw) - struct gdbarch *gdbarch; - gdbarch_d10v_convert_daddr_to_raw_ftype d10v_convert_daddr_to_raw; +set_gdbarch_d10v_convert_daddr_to_raw (struct gdbarch *gdbarch, + gdbarch_d10v_convert_daddr_to_raw_ftype d10v_convert_daddr_to_raw) { gdbarch->d10v_convert_daddr_to_raw = d10v_convert_daddr_to_raw; } @@ -2021,9 +1949,8 @@ gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch *gdbarch, CORE_ADDR x) } void -set_gdbarch_d10v_convert_iaddr_to_raw (gdbarch, d10v_convert_iaddr_to_raw) - struct gdbarch *gdbarch; - gdbarch_d10v_convert_iaddr_to_raw_ftype d10v_convert_iaddr_to_raw; +set_gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch *gdbarch, + gdbarch_d10v_convert_iaddr_to_raw_ftype d10v_convert_iaddr_to_raw) { gdbarch->d10v_convert_iaddr_to_raw = d10v_convert_iaddr_to_raw; } @@ -2040,9 +1967,8 @@ gdbarch_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR } void -set_gdbarch_store_struct_return (gdbarch, store_struct_return) - struct gdbarch *gdbarch; - gdbarch_store_struct_return_ftype store_struct_return; +set_gdbarch_store_struct_return (struct gdbarch *gdbarch, + gdbarch_store_struct_return_ftype store_struct_return) { gdbarch->store_struct_return = store_struct_return; } @@ -2059,9 +1985,8 @@ gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, char *va } void -set_gdbarch_store_return_value (gdbarch, store_return_value) - struct gdbarch *gdbarch; - gdbarch_store_return_value_ftype store_return_value; +set_gdbarch_store_return_value (struct gdbarch *gdbarch, + gdbarch_store_return_value_ftype store_return_value) { gdbarch->store_return_value = store_return_value; } @@ -2078,9 +2003,8 @@ gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf) } void -set_gdbarch_extract_struct_value_address (gdbarch, extract_struct_value_address) - struct gdbarch *gdbarch; - gdbarch_extract_struct_value_address_ftype extract_struct_value_address; +set_gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, + gdbarch_extract_struct_value_address_ftype extract_struct_value_address) { gdbarch->extract_struct_value_address = extract_struct_value_address; } @@ -2097,9 +2021,8 @@ gdbarch_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type * } void -set_gdbarch_use_struct_convention (gdbarch, use_struct_convention) - struct gdbarch *gdbarch; - gdbarch_use_struct_convention_ftype use_struct_convention; +set_gdbarch_use_struct_convention (struct gdbarch *gdbarch, + gdbarch_use_struct_convention_ftype use_struct_convention) { gdbarch->use_struct_convention = use_struct_convention; } @@ -2116,9 +2039,8 @@ gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, struct frame_info *frame } void -set_gdbarch_frame_init_saved_regs (gdbarch, frame_init_saved_regs) - struct gdbarch *gdbarch; - gdbarch_frame_init_saved_regs_ftype frame_init_saved_regs; +set_gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, + gdbarch_frame_init_saved_regs_ftype frame_init_saved_regs) { gdbarch->frame_init_saved_regs = frame_init_saved_regs; } @@ -2135,9 +2057,8 @@ gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, int fromleaf, struct fra } void -set_gdbarch_init_extra_frame_info (gdbarch, init_extra_frame_info) - struct gdbarch *gdbarch; - gdbarch_init_extra_frame_info_ftype init_extra_frame_info; +set_gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, + gdbarch_init_extra_frame_info_ftype init_extra_frame_info) { gdbarch->init_extra_frame_info = init_extra_frame_info; } @@ -2154,9 +2075,8 @@ gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip) } void -set_gdbarch_skip_prologue (gdbarch, skip_prologue) - struct gdbarch *gdbarch; - gdbarch_skip_prologue_ftype skip_prologue; +set_gdbarch_skip_prologue (struct gdbarch *gdbarch, + gdbarch_skip_prologue_ftype skip_prologue) { gdbarch->skip_prologue = skip_prologue; } @@ -2173,9 +2093,8 @@ gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs) } void -set_gdbarch_inner_than (gdbarch, inner_than) - struct gdbarch *gdbarch; - gdbarch_inner_than_ftype inner_than; +set_gdbarch_inner_than (struct gdbarch *gdbarch, + gdbarch_inner_than_ftype inner_than) { gdbarch->inner_than = inner_than; } @@ -2192,16 +2111,14 @@ gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenp } void -set_gdbarch_breakpoint_from_pc (gdbarch, breakpoint_from_pc) - struct gdbarch *gdbarch; - gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc; +set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, + gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc) { gdbarch->breakpoint_from_pc = breakpoint_from_pc; } CORE_ADDR -gdbarch_decr_pc_after_break (gdbarch) - struct gdbarch *gdbarch; +gdbarch_decr_pc_after_break (struct gdbarch *gdbarch) { if (gdbarch->decr_pc_after_break == -1) internal_error ("gdbarch: gdbarch_decr_pc_after_break invalid"); @@ -2212,16 +2129,14 @@ gdbarch_decr_pc_after_break (gdbarch) } void -set_gdbarch_decr_pc_after_break (gdbarch, decr_pc_after_break) - struct gdbarch *gdbarch; - CORE_ADDR decr_pc_after_break; +set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch, + CORE_ADDR decr_pc_after_break) { gdbarch->decr_pc_after_break = decr_pc_after_break; } CORE_ADDR -gdbarch_function_start_offset (gdbarch) - struct gdbarch *gdbarch; +gdbarch_function_start_offset (struct gdbarch *gdbarch) { if (gdbarch->function_start_offset == -1) internal_error ("gdbarch: gdbarch_function_start_offset invalid"); @@ -2232,9 +2147,8 @@ gdbarch_function_start_offset (gdbarch) } void -set_gdbarch_function_start_offset (gdbarch, function_start_offset) - struct gdbarch *gdbarch; - CORE_ADDR function_start_offset; +set_gdbarch_function_start_offset (struct gdbarch *gdbarch, + CORE_ADDR function_start_offset) { gdbarch->function_start_offset = function_start_offset; } @@ -2251,16 +2165,14 @@ gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, CORE_ADDR gdb_ad } void -set_gdbarch_remote_translate_xfer_address (gdbarch, remote_translate_xfer_address) - struct gdbarch *gdbarch; - gdbarch_remote_translate_xfer_address_ftype remote_translate_xfer_address; +set_gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, + gdbarch_remote_translate_xfer_address_ftype remote_translate_xfer_address) { gdbarch->remote_translate_xfer_address = remote_translate_xfer_address; } CORE_ADDR -gdbarch_frame_args_skip (gdbarch) - struct gdbarch *gdbarch; +gdbarch_frame_args_skip (struct gdbarch *gdbarch) { if (gdbarch->frame_args_skip == -1) internal_error ("gdbarch: gdbarch_frame_args_skip invalid"); @@ -2271,9 +2183,8 @@ gdbarch_frame_args_skip (gdbarch) } void -set_gdbarch_frame_args_skip (gdbarch, frame_args_skip) - struct gdbarch *gdbarch; - CORE_ADDR frame_args_skip; +set_gdbarch_frame_args_skip (struct gdbarch *gdbarch, + CORE_ADDR frame_args_skip) { gdbarch->frame_args_skip = frame_args_skip; } @@ -2290,9 +2201,8 @@ gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, struct frame_inf } void -set_gdbarch_frameless_function_invocation (gdbarch, frameless_function_invocation) - struct gdbarch *gdbarch; - gdbarch_frameless_function_invocation_ftype frameless_function_invocation; +set_gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, + gdbarch_frameless_function_invocation_ftype frameless_function_invocation) { gdbarch->frameless_function_invocation = frameless_function_invocation; } @@ -2309,9 +2219,8 @@ gdbarch_frame_chain (struct gdbarch *gdbarch, struct frame_info *frame) } void -set_gdbarch_frame_chain (gdbarch, frame_chain) - struct gdbarch *gdbarch; - gdbarch_frame_chain_ftype frame_chain; +set_gdbarch_frame_chain (struct gdbarch *gdbarch, + gdbarch_frame_chain_ftype frame_chain) { gdbarch->frame_chain = frame_chain; } @@ -2328,9 +2237,8 @@ gdbarch_frame_chain_valid (struct gdbarch *gdbarch, CORE_ADDR chain, struct fram } void -set_gdbarch_frame_chain_valid (gdbarch, frame_chain_valid) - struct gdbarch *gdbarch; - gdbarch_frame_chain_valid_ftype frame_chain_valid; +set_gdbarch_frame_chain_valid (struct gdbarch *gdbarch, + gdbarch_frame_chain_valid_ftype frame_chain_valid) { gdbarch->frame_chain_valid = frame_chain_valid; } @@ -2347,9 +2255,8 @@ gdbarch_frame_saved_pc (struct gdbarch *gdbarch, struct frame_info *fi) } void -set_gdbarch_frame_saved_pc (gdbarch, frame_saved_pc) - struct gdbarch *gdbarch; - gdbarch_frame_saved_pc_ftype frame_saved_pc; +set_gdbarch_frame_saved_pc (struct gdbarch *gdbarch, + gdbarch_frame_saved_pc_ftype frame_saved_pc) { gdbarch->frame_saved_pc = frame_saved_pc; } @@ -2366,9 +2273,8 @@ gdbarch_frame_args_address (struct gdbarch *gdbarch, struct frame_info *fi) } void -set_gdbarch_frame_args_address (gdbarch, frame_args_address) - struct gdbarch *gdbarch; - gdbarch_frame_args_address_ftype frame_args_address; +set_gdbarch_frame_args_address (struct gdbarch *gdbarch, + gdbarch_frame_args_address_ftype frame_args_address) { gdbarch->frame_args_address = frame_args_address; } @@ -2385,9 +2291,8 @@ gdbarch_frame_locals_address (struct gdbarch *gdbarch, struct frame_info *fi) } void -set_gdbarch_frame_locals_address (gdbarch, frame_locals_address) - struct gdbarch *gdbarch; - gdbarch_frame_locals_address_ftype frame_locals_address; +set_gdbarch_frame_locals_address (struct gdbarch *gdbarch, + gdbarch_frame_locals_address_ftype frame_locals_address) { gdbarch->frame_locals_address = frame_locals_address; } @@ -2404,9 +2309,8 @@ gdbarch_saved_pc_after_call (struct gdbarch *gdbarch, struct frame_info *frame) } void -set_gdbarch_saved_pc_after_call (gdbarch, saved_pc_after_call) - struct gdbarch *gdbarch; - gdbarch_saved_pc_after_call_ftype saved_pc_after_call; +set_gdbarch_saved_pc_after_call (struct gdbarch *gdbarch, + gdbarch_saved_pc_after_call_ftype saved_pc_after_call) { gdbarch->saved_pc_after_call = saved_pc_after_call; } @@ -2423,9 +2327,8 @@ gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame) } void -set_gdbarch_frame_num_args (gdbarch, frame_num_args) - struct gdbarch *gdbarch; - gdbarch_frame_num_args_ftype frame_num_args; +set_gdbarch_frame_num_args (struct gdbarch *gdbarch, + gdbarch_frame_num_args_ftype frame_num_args) { gdbarch->frame_num_args = frame_num_args; } @@ -2458,8 +2361,7 @@ struct gdbarch_data_registrary gdbarch_data_registrary = }; struct gdbarch_data * -register_gdbarch_data (init) - gdbarch_data_ftype *init; +register_gdbarch_data (gdbarch_data_ftype *init) { struct gdbarch_data_registration **curr; for (curr = &gdbarch_data_registrary.registrations; @@ -2476,10 +2378,8 @@ register_gdbarch_data (init) /* Walk through all the registered users initializing each in turn. */ -static void init_gdbarch_data PARAMS ((struct gdbarch *)); static void -init_gdbarch_data (gdbarch) - struct gdbarch *gdbarch; +init_gdbarch_data (struct gdbarch *gdbarch) { struct gdbarch_data_registration *rego; gdbarch->nr_data = gdbarch_data_registrary.nr + 1; @@ -2537,10 +2437,9 @@ struct gdbarch_swap_registrary gdbarch_swap_registrary = }; void -register_gdbarch_swap (data, sizeof_data, init) - void *data; - unsigned long sizeof_data; - gdbarch_swap_ftype *init; +register_gdbarch_swap (void *data, + unsigned long sizeof_data, + gdbarch_swap_ftype *init) { struct gdbarch_swap_registration **rego; for (rego = &gdbarch_swap_registrary.registrations; @@ -2554,10 +2453,8 @@ register_gdbarch_swap (data, sizeof_data, init) } -static void init_gdbarch_swap PARAMS ((struct gdbarch *)); static void -init_gdbarch_swap (gdbarch) - struct gdbarch *gdbarch; +init_gdbarch_swap (struct gdbarch *gdbarch) { struct gdbarch_swap_registration *rego; struct gdbarch_swap **curr = &gdbarch->swap; @@ -2579,10 +2476,8 @@ init_gdbarch_swap (gdbarch) } } -static void swapout_gdbarch_swap PARAMS ((struct gdbarch *)); static void -swapout_gdbarch_swap (gdbarch) - struct gdbarch *gdbarch; +swapout_gdbarch_swap (struct gdbarch *gdbarch) { struct gdbarch_swap *curr; for (curr = gdbarch->swap; @@ -2591,10 +2486,8 @@ swapout_gdbarch_swap (gdbarch) memcpy (curr->swap, curr->source->data, curr->source->sizeof_data); } -static void swapin_gdbarch_swap PARAMS ((struct gdbarch *)); static void -swapin_gdbarch_swap (gdbarch) - struct gdbarch *gdbarch; +swapin_gdbarch_swap (struct gdbarch *gdbarch) { struct gdbarch_swap *curr; for (curr = gdbarch->swap; @@ -2617,9 +2510,8 @@ struct gdbarch_init_registration static struct gdbarch_init_registration *gdbarch_init_registrary = NULL; void -register_gdbarch_init (bfd_architecture, init) - enum bfd_architecture bfd_architecture; - gdbarch_init_ftype *init; +register_gdbarch_init (enum bfd_architecture bfd_architecture, + gdbarch_init_ftype *init) { struct gdbarch_init_registration **curr; const struct bfd_arch_info *bfd_arch_info; @@ -2657,9 +2549,8 @@ register_gdbarch_init (bfd_architecture, init) BFD_ARCH_INFO and BYTE_ORDER. */ struct gdbarch_list * -gdbarch_list_lookup_by_info (arches, info) - struct gdbarch_list *arches; - const struct gdbarch_info *info; +gdbarch_list_lookup_by_info (struct gdbarch_list *arches, + const struct gdbarch_info *info) { for (; arches != NULL; arches = arches->next) { @@ -2677,8 +2568,7 @@ gdbarch_list_lookup_by_info (arches, info) failed. */ int -gdbarch_update (info) - struct gdbarch_info info; +gdbarch_update (struct gdbarch_info info) { struct gdbarch *new_gdbarch; struct gdbarch_list **list; @@ -2855,11 +2745,8 @@ int target_byte_order_auto = 1; static struct cmd_list_element *endianlist = NULL; /* Called by ``show endian''. */ -static void show_endian PARAMS ((char *, int)); static void -show_endian (args, from_tty) - char *args; - int from_tty; +show_endian (char *args, int from_tty) { char *msg = (TARGET_BYTE_ORDER_AUTO @@ -2869,22 +2756,16 @@ show_endian (args, from_tty) } /* Called if the user enters ``set endian'' without an argument. */ -static void set_endian PARAMS ((char *, int)); static void -set_endian (args, from_tty) - char *args; - int from_tty; +set_endian (char *args, int from_tty) { printf_unfiltered ("\"set endian\" must be followed by \"auto\", \"big\" or \"little\".\n"); show_endian (args, from_tty); } /* Called by ``set endian big''. */ -static void set_endian_big PARAMS ((char *, int)); static void -set_endian_big (args, from_tty) - char *args; - int from_tty; +set_endian_big (char *args, int from_tty) { if (TARGET_BYTE_ORDER_SELECTABLE_P) { @@ -2906,11 +2787,8 @@ set_endian_big (args, from_tty) } /* Called by ``set endian little''. */ -static void set_endian_little PARAMS ((char *, int)); static void -set_endian_little (args, from_tty) - char *args; - int from_tty; +set_endian_little (char *args, int from_tty) { if (TARGET_BYTE_ORDER_SELECTABLE_P) { @@ -2932,11 +2810,8 @@ set_endian_little (args, from_tty) } /* Called by ``set endian auto''. */ -static void set_endian_auto PARAMS ((char *, int)); static void -set_endian_auto (args, from_tty) - char *args; - int from_tty; +set_endian_auto (char *args, int from_tty) { if (TARGET_BYTE_ORDER_SELECTABLE_P) { @@ -2950,10 +2825,8 @@ set_endian_auto (args, from_tty) } /* Set the endianness from a BFD. */ -static void set_endian_from_file PARAMS ((bfd *)); static void -set_endian_from_file (abfd) - bfd *abfd; +set_endian_from_file (bfd *abfd) { if (TARGET_BYTE_ORDER_SELECTABLE_P) { @@ -2985,17 +2858,30 @@ set_endian_from_file (abfd) /* Functions to manipulate the architecture of the target */ +enum set_arch { set_arch_auto, set_arch_manual }; + int target_architecture_auto = 1; extern const struct bfd_arch_info bfd_default_arch_struct; const struct bfd_arch_info *target_architecture = &bfd_default_arch_struct; -int (*target_architecture_hook) PARAMS ((const struct bfd_arch_info *ap)); +int (*target_architecture_hook) (const struct bfd_arch_info *ap); + +static void show_endian (char *, int); +static void set_endian (char *, int); +static void set_endian_big (char *, int); +static void set_endian_little (char *, int); +static void set_endian_auto (char *, int); +static void set_endian_from_file (bfd *); +static int arch_ok (const struct bfd_arch_info *arch); +static void set_arch (const struct bfd_arch_info *arch, enum set_arch type); +static void show_architecture (char *, int); +static void set_architecture (char *, int); +static void info_architecture (char *, int); +static void set_architecture_from_file (bfd *); /* Do the real work of changing the current architecture */ -static int arch_ok PARAMS ((const struct bfd_arch_info *arch)); static int -arch_ok (arch) - const struct bfd_arch_info *arch; +arch_ok (const struct bfd_arch_info *arch) { /* Should be performing the more basic check that the binary is compatible with GDB. */ @@ -3004,13 +2890,9 @@ arch_ok (arch) || target_architecture_hook (arch)); } -enum set_arch { set_arch_auto, set_arch_manual }; - -static void set_arch PARAMS ((const struct bfd_arch_info *arch, enum set_arch type)); static void -set_arch (arch, type) - const struct bfd_arch_info *arch; - enum set_arch type; +set_arch (const struct bfd_arch_info *arch, + enum set_arch type) { switch (type) { @@ -3038,11 +2920,8 @@ set_arch (arch, type) } /* Called if the user enters ``show architecture'' without an argument. */ -static void show_architecture PARAMS ((char *, int)); static void -show_architecture (args, from_tty) - char *args; - int from_tty; +show_architecture (char *args, int from_tty) { const char *arch; arch = TARGET_ARCHITECTURE->printable_name; @@ -3054,11 +2933,8 @@ show_architecture (args, from_tty) /* Called if the user enters ``set architecture'' with or without an argument. */ -static void set_architecture PARAMS ((char *, int)); static void -set_architecture (args, from_tty) - char *args; - int from_tty; +set_architecture (char *args, int from_tty) { if (args == NULL) { @@ -3095,11 +2971,8 @@ set_architecture (args, from_tty) } /* Called if the user enters ``info architecture'' without an argument. */ -static void info_architecture PARAMS ((char *, int)); static void -info_architecture (args, from_tty) - char *args; - int from_tty; +info_architecture (char *args, int from_tty) { enum bfd_architecture a; if (GDB_MULTI_ARCH) @@ -3163,10 +3036,8 @@ set_architecture_from_arch_mach (arch, mach) } /* Set the architecture from a BFD */ -static void set_architecture_from_file PARAMS ((bfd *)); static void -set_architecture_from_file (abfd) - bfd *abfd; +set_architecture_from_file (bfd *abfd) { const struct bfd_arch_info *wanted = bfd_get_arch_info (abfd); if (target_architecture_auto) @@ -3202,7 +3073,7 @@ generic_register_convertible_not (num) /* Disassembler */ /* Pointer to the target-dependent disassembly function. */ -int (*tm_print_insn) PARAMS ((bfd_vma, disassemble_info *)); +int (*tm_print_insn) (bfd_vma, disassemble_info *); disassemble_info tm_print_insn_info; @@ -3234,7 +3105,7 @@ int sizeof_call_dummy_words = sizeof (call_dummy_words); #endif -extern void _initialize_gdbarch PARAMS ((void)); +extern void _initialize_gdbarch (void); void _initialize_gdbarch () { diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index d7583fd..72cef37 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -18,15 +18,25 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* *INDENT-OFF* */ /* typedef (f)();'' confuses indent */ +/* *INDENT-OFF* */ /* ``typedef (f)();'' confuses indent */ + +/* This file was created with the aid of ``gdbarch.sh''. + + The bourn shell script ``gdbarch.sh'' creates the files + ``new-gdbarch.c'' and ``new-gdbarch.h and then compares them + against the existing ``gdbarch.[hc]''. Any differences found + being reported. + + If editing this file, please also run gdbarch.sh and merge any + changes into that script. Conversely, when makeing sweeping changes + to this file, modifying gdbarch.sh and using its output may prove + easier. */ #ifndef GDBARCH_H #define GDBARCH_H -#ifdef __STDC__ struct frame_info; struct value; -#endif #ifndef GDB_MULTI_ARCH @@ -70,7 +80,7 @@ extern struct gdbarch *current_gdbarch; /* The following are pre-initialized by GDBARCH. */ -extern const struct bfd_arch_info * gdbarch_bfd_arch_info PARAMS ((struct gdbarch *gdbarch)); +extern const struct bfd_arch_info * gdbarch_bfd_arch_info (struct gdbarch *gdbarch); /* set_gdbarch_bfd_arch_info() - not applicable - pre-initialized. */ #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (TARGET_ARCHITECTURE) @@ -78,7 +88,7 @@ extern const struct bfd_arch_info * gdbarch_bfd_arch_info PARAMS ((struct gdbarc #endif #endif -extern int gdbarch_byte_order PARAMS ((struct gdbarch *gdbarch)); +extern int gdbarch_byte_order (struct gdbarch *gdbarch); /* set_gdbarch_byte_order() - not applicable - pre-initialized. */ #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (TARGET_BYTE_ORDER) @@ -89,686 +99,686 @@ extern int gdbarch_byte_order PARAMS ((struct gdbarch *gdbarch)); /* The following are initialized by the target dependant code. */ -extern int gdbarch_ptr_bit PARAMS ((struct gdbarch *gdbarch)); -extern void set_gdbarch_ptr_bit PARAMS ((struct gdbarch *gdbarch, int ptr_bit)); +extern int gdbarch_ptr_bit (struct gdbarch *gdbarch); +extern void set_gdbarch_ptr_bit (struct gdbarch *gdbarch, int ptr_bit); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (TARGET_PTR_BIT) #define TARGET_PTR_BIT (gdbarch_ptr_bit (current_gdbarch)) #endif #endif -extern int gdbarch_short_bit PARAMS ((struct gdbarch *gdbarch)); -extern void set_gdbarch_short_bit PARAMS ((struct gdbarch *gdbarch, int short_bit)); +extern int gdbarch_short_bit (struct gdbarch *gdbarch); +extern void set_gdbarch_short_bit (struct gdbarch *gdbarch, int short_bit); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (TARGET_SHORT_BIT) #define TARGET_SHORT_BIT (gdbarch_short_bit (current_gdbarch)) #endif #endif -extern int gdbarch_int_bit PARAMS ((struct gdbarch *gdbarch)); -extern void set_gdbarch_int_bit PARAMS ((struct gdbarch *gdbarch, int int_bit)); +extern int gdbarch_int_bit (struct gdbarch *gdbarch); +extern void set_gdbarch_int_bit (struct gdbarch *gdbarch, int int_bit); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (TARGET_INT_BIT) #define TARGET_INT_BIT (gdbarch_int_bit (current_gdbarch)) #endif #endif -extern int gdbarch_long_bit PARAMS ((struct gdbarch *gdbarch)); -extern void set_gdbarch_long_bit PARAMS ((struct gdbarch *gdbarch, int long_bit)); +extern int gdbarch_long_bit (struct gdbarch *gdbarch); +extern void set_gdbarch_long_bit (struct gdbarch *gdbarch, int long_bit); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (TARGET_LONG_BIT) #define TARGET_LONG_BIT (gdbarch_long_bit (current_gdbarch)) #endif #endif -extern int gdbarch_long_long_bit PARAMS ((struct gdbarch *gdbarch)); -extern void set_gdbarch_long_long_bit PARAMS ((struct gdbarch *gdbarch, int long_long_bit)); +extern int gdbarch_long_long_bit (struct gdbarch *gdbarch); +extern void set_gdbarch_long_long_bit (struct gdbarch *gdbarch, int long_long_bit); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (TARGET_LONG_LONG_BIT) #define TARGET_LONG_LONG_BIT (gdbarch_long_long_bit (current_gdbarch)) #endif #endif -extern int gdbarch_float_bit PARAMS ((struct gdbarch *gdbarch)); -extern void set_gdbarch_float_bit PARAMS ((struct gdbarch *gdbarch, int float_bit)); +extern int gdbarch_float_bit (struct gdbarch *gdbarch); +extern void set_gdbarch_float_bit (struct gdbarch *gdbarch, int float_bit); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (TARGET_FLOAT_BIT) #define TARGET_FLOAT_BIT (gdbarch_float_bit (current_gdbarch)) #endif #endif -extern int gdbarch_double_bit PARAMS ((struct gdbarch *gdbarch)); -extern void set_gdbarch_double_bit PARAMS ((struct gdbarch *gdbarch, int double_bit)); +extern int gdbarch_double_bit (struct gdbarch *gdbarch); +extern void set_gdbarch_double_bit (struct gdbarch *gdbarch, int double_bit); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (TARGET_DOUBLE_BIT) #define TARGET_DOUBLE_BIT (gdbarch_double_bit (current_gdbarch)) #endif #endif -extern int gdbarch_long_double_bit PARAMS ((struct gdbarch *gdbarch)); -extern void set_gdbarch_long_double_bit PARAMS ((struct gdbarch *gdbarch, int long_double_bit)); +extern int gdbarch_long_double_bit (struct gdbarch *gdbarch); +extern void set_gdbarch_long_double_bit (struct gdbarch *gdbarch, int long_double_bit); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (TARGET_LONG_DOUBLE_BIT) #define TARGET_LONG_DOUBLE_BIT (gdbarch_long_double_bit (current_gdbarch)) #endif #endif -typedef CORE_ADDR (gdbarch_read_pc_ftype) PARAMS ((int pid)); -extern CORE_ADDR gdbarch_read_pc PARAMS ((struct gdbarch *gdbarch, int pid)); -extern void set_gdbarch_read_pc PARAMS ((struct gdbarch *gdbarch, gdbarch_read_pc_ftype *read_pc)); +typedef CORE_ADDR (gdbarch_read_pc_ftype) (int pid); +extern CORE_ADDR gdbarch_read_pc (struct gdbarch *gdbarch, int pid); +extern void set_gdbarch_read_pc (struct gdbarch *gdbarch, gdbarch_read_pc_ftype *read_pc); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (TARGET_READ_PC) #define TARGET_READ_PC(pid) (gdbarch_read_pc (current_gdbarch, pid)) #endif #endif -typedef void (gdbarch_write_pc_ftype) PARAMS ((CORE_ADDR val, int pid)); -extern void gdbarch_write_pc PARAMS ((struct gdbarch *gdbarch, CORE_ADDR val, int pid)); -extern void set_gdbarch_write_pc PARAMS ((struct gdbarch *gdbarch, gdbarch_write_pc_ftype *write_pc)); +typedef void (gdbarch_write_pc_ftype) (CORE_ADDR val, int pid); +extern void gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, int pid); +extern void set_gdbarch_write_pc (struct gdbarch *gdbarch, gdbarch_write_pc_ftype *write_pc); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (TARGET_WRITE_PC) #define TARGET_WRITE_PC(val, pid) (gdbarch_write_pc (current_gdbarch, val, pid)) #endif #endif -typedef CORE_ADDR (gdbarch_read_fp_ftype) PARAMS ((void)); -extern CORE_ADDR gdbarch_read_fp PARAMS ((struct gdbarch *gdbarch)); -extern void set_gdbarch_read_fp PARAMS ((struct gdbarch *gdbarch, gdbarch_read_fp_ftype *read_fp)); +typedef CORE_ADDR (gdbarch_read_fp_ftype) (void); +extern CORE_ADDR gdbarch_read_fp (struct gdbarch *gdbarch); +extern void set_gdbarch_read_fp (struct gdbarch *gdbarch, gdbarch_read_fp_ftype *read_fp); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (TARGET_READ_FP) #define TARGET_READ_FP() (gdbarch_read_fp (current_gdbarch)) #endif #endif -typedef void (gdbarch_write_fp_ftype) PARAMS ((CORE_ADDR val)); -extern void gdbarch_write_fp PARAMS ((struct gdbarch *gdbarch, CORE_ADDR val)); -extern void set_gdbarch_write_fp PARAMS ((struct gdbarch *gdbarch, gdbarch_write_fp_ftype *write_fp)); +typedef void (gdbarch_write_fp_ftype) (CORE_ADDR val); +extern void gdbarch_write_fp (struct gdbarch *gdbarch, CORE_ADDR val); +extern void set_gdbarch_write_fp (struct gdbarch *gdbarch, gdbarch_write_fp_ftype *write_fp); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (TARGET_WRITE_FP) #define TARGET_WRITE_FP(val) (gdbarch_write_fp (current_gdbarch, val)) #endif #endif -typedef CORE_ADDR (gdbarch_read_sp_ftype) PARAMS ((void)); -extern CORE_ADDR gdbarch_read_sp PARAMS ((struct gdbarch *gdbarch)); -extern void set_gdbarch_read_sp PARAMS ((struct gdbarch *gdbarch, gdbarch_read_sp_ftype *read_sp)); +typedef CORE_ADDR (gdbarch_read_sp_ftype) (void); +extern CORE_ADDR gdbarch_read_sp (struct gdbarch *gdbarch); +extern void set_gdbarch_read_sp (struct gdbarch *gdbarch, gdbarch_read_sp_ftype *read_sp); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (TARGET_READ_SP) #define TARGET_READ_SP() (gdbarch_read_sp (current_gdbarch)) #endif #endif -typedef void (gdbarch_write_sp_ftype) PARAMS ((CORE_ADDR val)); -extern void gdbarch_write_sp PARAMS ((struct gdbarch *gdbarch, CORE_ADDR val)); -extern void set_gdbarch_write_sp PARAMS ((struct gdbarch *gdbarch, gdbarch_write_sp_ftype *write_sp)); +typedef void (gdbarch_write_sp_ftype) (CORE_ADDR val); +extern void gdbarch_write_sp (struct gdbarch *gdbarch, CORE_ADDR val); +extern void set_gdbarch_write_sp (struct gdbarch *gdbarch, gdbarch_write_sp_ftype *write_sp); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (TARGET_WRITE_SP) #define TARGET_WRITE_SP(val) (gdbarch_write_sp (current_gdbarch, val)) #endif #endif -extern int gdbarch_num_regs PARAMS ((struct gdbarch *gdbarch)); -extern void set_gdbarch_num_regs PARAMS ((struct gdbarch *gdbarch, int num_regs)); +extern int gdbarch_num_regs (struct gdbarch *gdbarch); +extern void set_gdbarch_num_regs (struct gdbarch *gdbarch, int num_regs); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (NUM_REGS) #define NUM_REGS (gdbarch_num_regs (current_gdbarch)) #endif #endif -extern int gdbarch_sp_regnum PARAMS ((struct gdbarch *gdbarch)); -extern void set_gdbarch_sp_regnum PARAMS ((struct gdbarch *gdbarch, int sp_regnum)); +extern int gdbarch_sp_regnum (struct gdbarch *gdbarch); +extern void set_gdbarch_sp_regnum (struct gdbarch *gdbarch, int sp_regnum); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (SP_REGNUM) #define SP_REGNUM (gdbarch_sp_regnum (current_gdbarch)) #endif #endif -extern int gdbarch_fp_regnum PARAMS ((struct gdbarch *gdbarch)); -extern void set_gdbarch_fp_regnum PARAMS ((struct gdbarch *gdbarch, int fp_regnum)); +extern int gdbarch_fp_regnum (struct gdbarch *gdbarch); +extern void set_gdbarch_fp_regnum (struct gdbarch *gdbarch, int fp_regnum); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (FP_REGNUM) #define FP_REGNUM (gdbarch_fp_regnum (current_gdbarch)) #endif #endif -extern int gdbarch_pc_regnum PARAMS ((struct gdbarch *gdbarch)); -extern void set_gdbarch_pc_regnum PARAMS ((struct gdbarch *gdbarch, int pc_regnum)); +extern int gdbarch_pc_regnum (struct gdbarch *gdbarch); +extern void set_gdbarch_pc_regnum (struct gdbarch *gdbarch, int pc_regnum); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (PC_REGNUM) #define PC_REGNUM (gdbarch_pc_regnum (current_gdbarch)) #endif #endif -typedef char * (gdbarch_register_name_ftype) PARAMS ((int regnr)); -extern char * gdbarch_register_name PARAMS ((struct gdbarch *gdbarch, int regnr)); -extern void set_gdbarch_register_name PARAMS ((struct gdbarch *gdbarch, gdbarch_register_name_ftype *register_name)); +typedef char * (gdbarch_register_name_ftype) (int regnr); +extern char * gdbarch_register_name (struct gdbarch *gdbarch, int regnr); +extern void set_gdbarch_register_name (struct gdbarch *gdbarch, gdbarch_register_name_ftype *register_name); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (REGISTER_NAME) #define REGISTER_NAME(regnr) (gdbarch_register_name (current_gdbarch, regnr)) #endif #endif -extern int gdbarch_register_size PARAMS ((struct gdbarch *gdbarch)); -extern void set_gdbarch_register_size PARAMS ((struct gdbarch *gdbarch, int register_size)); +extern int gdbarch_register_size (struct gdbarch *gdbarch); +extern void set_gdbarch_register_size (struct gdbarch *gdbarch, int register_size); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (REGISTER_SIZE) #define REGISTER_SIZE (gdbarch_register_size (current_gdbarch)) #endif #endif -extern int gdbarch_register_bytes PARAMS ((struct gdbarch *gdbarch)); -extern void set_gdbarch_register_bytes PARAMS ((struct gdbarch *gdbarch, int register_bytes)); +extern int gdbarch_register_bytes (struct gdbarch *gdbarch); +extern void set_gdbarch_register_bytes (struct gdbarch *gdbarch, int register_bytes); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (REGISTER_BYTES) #define REGISTER_BYTES (gdbarch_register_bytes (current_gdbarch)) #endif #endif -typedef int (gdbarch_register_byte_ftype) PARAMS ((int reg_nr)); -extern int gdbarch_register_byte PARAMS ((struct gdbarch *gdbarch, int reg_nr)); -extern void set_gdbarch_register_byte PARAMS ((struct gdbarch *gdbarch, gdbarch_register_byte_ftype *register_byte)); +typedef int (gdbarch_register_byte_ftype) (int reg_nr); +extern int gdbarch_register_byte (struct gdbarch *gdbarch, int reg_nr); +extern void set_gdbarch_register_byte (struct gdbarch *gdbarch, gdbarch_register_byte_ftype *register_byte); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (REGISTER_BYTE) #define REGISTER_BYTE(reg_nr) (gdbarch_register_byte (current_gdbarch, reg_nr)) #endif #endif -typedef int (gdbarch_register_raw_size_ftype) PARAMS ((int reg_nr)); -extern int gdbarch_register_raw_size PARAMS ((struct gdbarch *gdbarch, int reg_nr)); -extern void set_gdbarch_register_raw_size PARAMS ((struct gdbarch *gdbarch, gdbarch_register_raw_size_ftype *register_raw_size)); +typedef int (gdbarch_register_raw_size_ftype) (int reg_nr); +extern int gdbarch_register_raw_size (struct gdbarch *gdbarch, int reg_nr); +extern void set_gdbarch_register_raw_size (struct gdbarch *gdbarch, gdbarch_register_raw_size_ftype *register_raw_size); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (REGISTER_RAW_SIZE) #define REGISTER_RAW_SIZE(reg_nr) (gdbarch_register_raw_size (current_gdbarch, reg_nr)) #endif #endif -extern int gdbarch_max_register_raw_size PARAMS ((struct gdbarch *gdbarch)); -extern void set_gdbarch_max_register_raw_size PARAMS ((struct gdbarch *gdbarch, int max_register_raw_size)); +extern int gdbarch_max_register_raw_size (struct gdbarch *gdbarch); +extern void set_gdbarch_max_register_raw_size (struct gdbarch *gdbarch, int max_register_raw_size); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (MAX_REGISTER_RAW_SIZE) #define MAX_REGISTER_RAW_SIZE (gdbarch_max_register_raw_size (current_gdbarch)) #endif #endif -typedef int (gdbarch_register_virtual_size_ftype) PARAMS ((int reg_nr)); -extern int gdbarch_register_virtual_size PARAMS ((struct gdbarch *gdbarch, int reg_nr)); -extern void set_gdbarch_register_virtual_size PARAMS ((struct gdbarch *gdbarch, gdbarch_register_virtual_size_ftype *register_virtual_size)); +typedef int (gdbarch_register_virtual_size_ftype) (int reg_nr); +extern int gdbarch_register_virtual_size (struct gdbarch *gdbarch, int reg_nr); +extern void set_gdbarch_register_virtual_size (struct gdbarch *gdbarch, gdbarch_register_virtual_size_ftype *register_virtual_size); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (REGISTER_VIRTUAL_SIZE) #define REGISTER_VIRTUAL_SIZE(reg_nr) (gdbarch_register_virtual_size (current_gdbarch, reg_nr)) #endif #endif -extern int gdbarch_max_register_virtual_size PARAMS ((struct gdbarch *gdbarch)); -extern void set_gdbarch_max_register_virtual_size PARAMS ((struct gdbarch *gdbarch, int max_register_virtual_size)); +extern int gdbarch_max_register_virtual_size (struct gdbarch *gdbarch); +extern void set_gdbarch_max_register_virtual_size (struct gdbarch *gdbarch, int max_register_virtual_size); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (MAX_REGISTER_VIRTUAL_SIZE) #define MAX_REGISTER_VIRTUAL_SIZE (gdbarch_max_register_virtual_size (current_gdbarch)) #endif #endif -typedef struct type * (gdbarch_register_virtual_type_ftype) PARAMS ((int reg_nr)); -extern struct type * gdbarch_register_virtual_type PARAMS ((struct gdbarch *gdbarch, int reg_nr)); -extern void set_gdbarch_register_virtual_type PARAMS ((struct gdbarch *gdbarch, gdbarch_register_virtual_type_ftype *register_virtual_type)); +typedef struct type * (gdbarch_register_virtual_type_ftype) (int reg_nr); +extern struct type * gdbarch_register_virtual_type (struct gdbarch *gdbarch, int reg_nr); +extern void set_gdbarch_register_virtual_type (struct gdbarch *gdbarch, gdbarch_register_virtual_type_ftype *register_virtual_type); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (REGISTER_VIRTUAL_TYPE) #define REGISTER_VIRTUAL_TYPE(reg_nr) (gdbarch_register_virtual_type (current_gdbarch, reg_nr)) #endif #endif -extern int gdbarch_use_generic_dummy_frames PARAMS ((struct gdbarch *gdbarch)); -extern void set_gdbarch_use_generic_dummy_frames PARAMS ((struct gdbarch *gdbarch, int use_generic_dummy_frames)); +extern int gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch); +extern void set_gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch, int use_generic_dummy_frames); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (USE_GENERIC_DUMMY_FRAMES) #define USE_GENERIC_DUMMY_FRAMES (gdbarch_use_generic_dummy_frames (current_gdbarch)) #endif #endif -extern int gdbarch_call_dummy_location PARAMS ((struct gdbarch *gdbarch)); -extern void set_gdbarch_call_dummy_location PARAMS ((struct gdbarch *gdbarch, int call_dummy_location)); +extern int gdbarch_call_dummy_location (struct gdbarch *gdbarch); +extern void set_gdbarch_call_dummy_location (struct gdbarch *gdbarch, int call_dummy_location); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (CALL_DUMMY_LOCATION) #define CALL_DUMMY_LOCATION (gdbarch_call_dummy_location (current_gdbarch)) #endif #endif -typedef CORE_ADDR (gdbarch_call_dummy_address_ftype) PARAMS ((void)); -extern CORE_ADDR gdbarch_call_dummy_address PARAMS ((struct gdbarch *gdbarch)); -extern void set_gdbarch_call_dummy_address PARAMS ((struct gdbarch *gdbarch, gdbarch_call_dummy_address_ftype *call_dummy_address)); +typedef CORE_ADDR (gdbarch_call_dummy_address_ftype) (void); +extern CORE_ADDR gdbarch_call_dummy_address (struct gdbarch *gdbarch); +extern void set_gdbarch_call_dummy_address (struct gdbarch *gdbarch, gdbarch_call_dummy_address_ftype *call_dummy_address); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (CALL_DUMMY_ADDRESS) #define CALL_DUMMY_ADDRESS() (gdbarch_call_dummy_address (current_gdbarch)) #endif #endif -extern CORE_ADDR gdbarch_call_dummy_start_offset PARAMS ((struct gdbarch *gdbarch)); -extern void set_gdbarch_call_dummy_start_offset PARAMS ((struct gdbarch *gdbarch, CORE_ADDR call_dummy_start_offset)); +extern CORE_ADDR gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch); +extern void set_gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch, CORE_ADDR call_dummy_start_offset); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (CALL_DUMMY_START_OFFSET) #define CALL_DUMMY_START_OFFSET (gdbarch_call_dummy_start_offset (current_gdbarch)) #endif #endif -extern CORE_ADDR gdbarch_call_dummy_breakpoint_offset PARAMS ((struct gdbarch *gdbarch)); -extern void set_gdbarch_call_dummy_breakpoint_offset PARAMS ((struct gdbarch *gdbarch, CORE_ADDR call_dummy_breakpoint_offset)); +extern CORE_ADDR gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch); +extern void set_gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch, CORE_ADDR call_dummy_breakpoint_offset); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (CALL_DUMMY_BREAKPOINT_OFFSET) #define CALL_DUMMY_BREAKPOINT_OFFSET (gdbarch_call_dummy_breakpoint_offset (current_gdbarch)) #endif #endif -extern int gdbarch_call_dummy_breakpoint_offset_p PARAMS ((struct gdbarch *gdbarch)); -extern void set_gdbarch_call_dummy_breakpoint_offset_p PARAMS ((struct gdbarch *gdbarch, int call_dummy_breakpoint_offset_p)); +extern int gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch); +extern void set_gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch, int call_dummy_breakpoint_offset_p); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (CALL_DUMMY_BREAKPOINT_OFFSET_P) #define CALL_DUMMY_BREAKPOINT_OFFSET_P (gdbarch_call_dummy_breakpoint_offset_p (current_gdbarch)) #endif #endif -extern int gdbarch_call_dummy_length PARAMS ((struct gdbarch *gdbarch)); -extern void set_gdbarch_call_dummy_length PARAMS ((struct gdbarch *gdbarch, int call_dummy_length)); +extern int gdbarch_call_dummy_length (struct gdbarch *gdbarch); +extern void set_gdbarch_call_dummy_length (struct gdbarch *gdbarch, int call_dummy_length); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (CALL_DUMMY_LENGTH) #define CALL_DUMMY_LENGTH (gdbarch_call_dummy_length (current_gdbarch)) #endif #endif -typedef int (gdbarch_pc_in_call_dummy_ftype) PARAMS ((CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address)); -extern int gdbarch_pc_in_call_dummy PARAMS ((struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address)); -extern void set_gdbarch_pc_in_call_dummy PARAMS ((struct gdbarch *gdbarch, gdbarch_pc_in_call_dummy_ftype *pc_in_call_dummy)); +typedef int (gdbarch_pc_in_call_dummy_ftype) (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address); +extern int gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address); +extern void set_gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, gdbarch_pc_in_call_dummy_ftype *pc_in_call_dummy); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (PC_IN_CALL_DUMMY) #define PC_IN_CALL_DUMMY(pc, sp, frame_address) (gdbarch_pc_in_call_dummy (current_gdbarch, pc, sp, frame_address)) #endif #endif -extern int gdbarch_call_dummy_p PARAMS ((struct gdbarch *gdbarch)); -extern void set_gdbarch_call_dummy_p PARAMS ((struct gdbarch *gdbarch, int call_dummy_p)); +extern int gdbarch_call_dummy_p (struct gdbarch *gdbarch); +extern void set_gdbarch_call_dummy_p (struct gdbarch *gdbarch, int call_dummy_p); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (CALL_DUMMY_P) #define CALL_DUMMY_P (gdbarch_call_dummy_p (current_gdbarch)) #endif #endif -extern LONGEST * gdbarch_call_dummy_words PARAMS ((struct gdbarch *gdbarch)); -extern void set_gdbarch_call_dummy_words PARAMS ((struct gdbarch *gdbarch, LONGEST * call_dummy_words)); +extern LONGEST * gdbarch_call_dummy_words (struct gdbarch *gdbarch); +extern void set_gdbarch_call_dummy_words (struct gdbarch *gdbarch, LONGEST * call_dummy_words); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (CALL_DUMMY_WORDS) #define CALL_DUMMY_WORDS (gdbarch_call_dummy_words (current_gdbarch)) #endif #endif -extern int gdbarch_sizeof_call_dummy_words PARAMS ((struct gdbarch *gdbarch)); -extern void set_gdbarch_sizeof_call_dummy_words PARAMS ((struct gdbarch *gdbarch, int sizeof_call_dummy_words)); +extern int gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch); +extern void set_gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch, int sizeof_call_dummy_words); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (SIZEOF_CALL_DUMMY_WORDS) #define SIZEOF_CALL_DUMMY_WORDS (gdbarch_sizeof_call_dummy_words (current_gdbarch)) #endif #endif -extern int gdbarch_call_dummy_stack_adjust_p PARAMS ((struct gdbarch *gdbarch)); -extern void set_gdbarch_call_dummy_stack_adjust_p PARAMS ((struct gdbarch *gdbarch, int call_dummy_stack_adjust_p)); +extern int gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch); +extern void set_gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch, int call_dummy_stack_adjust_p); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (CALL_DUMMY_STACK_ADJUST_P) #define CALL_DUMMY_STACK_ADJUST_P (gdbarch_call_dummy_stack_adjust_p (current_gdbarch)) #endif #endif -extern int gdbarch_call_dummy_stack_adjust PARAMS ((struct gdbarch *gdbarch)); -extern void set_gdbarch_call_dummy_stack_adjust PARAMS ((struct gdbarch *gdbarch, int call_dummy_stack_adjust)); +extern int gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch); +extern void set_gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch, int call_dummy_stack_adjust); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (CALL_DUMMY_STACK_ADJUST) #define CALL_DUMMY_STACK_ADJUST (gdbarch_call_dummy_stack_adjust (current_gdbarch)) #endif #endif -typedef void (gdbarch_fix_call_dummy_ftype) PARAMS ((char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p)); -extern void gdbarch_fix_call_dummy PARAMS ((struct gdbarch *gdbarch, char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p)); -extern void set_gdbarch_fix_call_dummy PARAMS ((struct gdbarch *gdbarch, gdbarch_fix_call_dummy_ftype *fix_call_dummy)); +typedef void (gdbarch_fix_call_dummy_ftype) (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p); +extern void gdbarch_fix_call_dummy (struct gdbarch *gdbarch, char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p); +extern void set_gdbarch_fix_call_dummy (struct gdbarch *gdbarch, gdbarch_fix_call_dummy_ftype *fix_call_dummy); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (FIX_CALL_DUMMY) #define FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p) (gdbarch_fix_call_dummy (current_gdbarch, dummy, pc, fun, nargs, args, type, gcc_p)) #endif #endif -extern int gdbarch_believe_pcc_promotion PARAMS ((struct gdbarch *gdbarch)); -extern void set_gdbarch_believe_pcc_promotion PARAMS ((struct gdbarch *gdbarch, int believe_pcc_promotion)); +extern int gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch); +extern void set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch, int believe_pcc_promotion); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (BELIEVE_PCC_PROMOTION) #define BELIEVE_PCC_PROMOTION (gdbarch_believe_pcc_promotion (current_gdbarch)) #endif #endif -extern int gdbarch_believe_pcc_promotion_type PARAMS ((struct gdbarch *gdbarch)); -extern void set_gdbarch_believe_pcc_promotion_type PARAMS ((struct gdbarch *gdbarch, int believe_pcc_promotion_type)); +extern int gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch); +extern void set_gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch, int believe_pcc_promotion_type); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (BELIEVE_PCC_PROMOTION_TYPE) #define BELIEVE_PCC_PROMOTION_TYPE (gdbarch_believe_pcc_promotion_type (current_gdbarch)) #endif #endif -typedef void (gdbarch_get_saved_register_ftype) PARAMS ((char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval)); -extern void gdbarch_get_saved_register PARAMS ((struct gdbarch *gdbarch, char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval)); -extern void set_gdbarch_get_saved_register PARAMS ((struct gdbarch *gdbarch, gdbarch_get_saved_register_ftype *get_saved_register)); +typedef void (gdbarch_get_saved_register_ftype) (char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval); +extern void gdbarch_get_saved_register (struct gdbarch *gdbarch, char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval); +extern void set_gdbarch_get_saved_register (struct gdbarch *gdbarch, gdbarch_get_saved_register_ftype *get_saved_register); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (GET_SAVED_REGISTER) #define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) (gdbarch_get_saved_register (current_gdbarch, raw_buffer, optimized, addrp, frame, regnum, lval)) #endif #endif -typedef int (gdbarch_register_convertible_ftype) PARAMS ((int nr)); -extern int gdbarch_register_convertible PARAMS ((struct gdbarch *gdbarch, int nr)); -extern void set_gdbarch_register_convertible PARAMS ((struct gdbarch *gdbarch, gdbarch_register_convertible_ftype *register_convertible)); +typedef int (gdbarch_register_convertible_ftype) (int nr); +extern int gdbarch_register_convertible (struct gdbarch *gdbarch, int nr); +extern void set_gdbarch_register_convertible (struct gdbarch *gdbarch, gdbarch_register_convertible_ftype *register_convertible); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (REGISTER_CONVERTIBLE) #define REGISTER_CONVERTIBLE(nr) (gdbarch_register_convertible (current_gdbarch, nr)) #endif #endif -typedef void (gdbarch_register_convert_to_virtual_ftype) PARAMS ((int regnum, struct type *type, char *from, char *to)); -extern void gdbarch_register_convert_to_virtual PARAMS ((struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to)); -extern void set_gdbarch_register_convert_to_virtual PARAMS ((struct gdbarch *gdbarch, gdbarch_register_convert_to_virtual_ftype *register_convert_to_virtual)); +typedef void (gdbarch_register_convert_to_virtual_ftype) (int regnum, struct type *type, char *from, char *to); +extern void gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to); +extern void set_gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, gdbarch_register_convert_to_virtual_ftype *register_convert_to_virtual); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (REGISTER_CONVERT_TO_VIRTUAL) #define REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to) (gdbarch_register_convert_to_virtual (current_gdbarch, regnum, type, from, to)) #endif #endif -typedef void (gdbarch_register_convert_to_raw_ftype) PARAMS ((struct type *type, int regnum, char *from, char *to)); -extern void gdbarch_register_convert_to_raw PARAMS ((struct gdbarch *gdbarch, struct type *type, int regnum, char *from, char *to)); -extern void set_gdbarch_register_convert_to_raw PARAMS ((struct gdbarch *gdbarch, gdbarch_register_convert_to_raw_ftype *register_convert_to_raw)); +typedef void (gdbarch_register_convert_to_raw_ftype) (struct type *type, int regnum, char *from, char *to); +extern void gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, struct type *type, int regnum, char *from, char *to); +extern void set_gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, gdbarch_register_convert_to_raw_ftype *register_convert_to_raw); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (REGISTER_CONVERT_TO_RAW) #define REGISTER_CONVERT_TO_RAW(type, regnum, from, to) (gdbarch_register_convert_to_raw (current_gdbarch, type, regnum, from, to)) #endif #endif -typedef void (gdbarch_extract_return_value_ftype) PARAMS ((struct type *type, char *regbuf, char *valbuf)); -extern void gdbarch_extract_return_value PARAMS ((struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf)); -extern void set_gdbarch_extract_return_value PARAMS ((struct gdbarch *gdbarch, gdbarch_extract_return_value_ftype *extract_return_value)); +typedef void (gdbarch_extract_return_value_ftype) (struct type *type, char *regbuf, char *valbuf); +extern void gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf); +extern void set_gdbarch_extract_return_value (struct gdbarch *gdbarch, gdbarch_extract_return_value_ftype *extract_return_value); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (EXTRACT_RETURN_VALUE) #define EXTRACT_RETURN_VALUE(type, regbuf, valbuf) (gdbarch_extract_return_value (current_gdbarch, type, regbuf, valbuf)) #endif #endif -typedef CORE_ADDR (gdbarch_push_arguments_ftype) PARAMS ((int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)); -extern CORE_ADDR gdbarch_push_arguments PARAMS ((struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)); -extern void set_gdbarch_push_arguments PARAMS ((struct gdbarch *gdbarch, gdbarch_push_arguments_ftype *push_arguments)); +typedef CORE_ADDR (gdbarch_push_arguments_ftype) (int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr); +extern CORE_ADDR gdbarch_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr); +extern void set_gdbarch_push_arguments (struct gdbarch *gdbarch, gdbarch_push_arguments_ftype *push_arguments); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (PUSH_ARGUMENTS) #define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) (gdbarch_push_arguments (current_gdbarch, nargs, args, sp, struct_return, struct_addr)) #endif #endif -typedef void (gdbarch_push_dummy_frame_ftype) PARAMS ((void)); -extern void gdbarch_push_dummy_frame PARAMS ((struct gdbarch *gdbarch)); -extern void set_gdbarch_push_dummy_frame PARAMS ((struct gdbarch *gdbarch, gdbarch_push_dummy_frame_ftype *push_dummy_frame)); +typedef void (gdbarch_push_dummy_frame_ftype) (void); +extern void gdbarch_push_dummy_frame (struct gdbarch *gdbarch); +extern void set_gdbarch_push_dummy_frame (struct gdbarch *gdbarch, gdbarch_push_dummy_frame_ftype *push_dummy_frame); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (PUSH_DUMMY_FRAME) #define PUSH_DUMMY_FRAME (gdbarch_push_dummy_frame (current_gdbarch)) #endif #endif -typedef CORE_ADDR (gdbarch_push_return_address_ftype) PARAMS ((CORE_ADDR pc, CORE_ADDR sp)); -extern CORE_ADDR gdbarch_push_return_address PARAMS ((struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp)); -extern void set_gdbarch_push_return_address PARAMS ((struct gdbarch *gdbarch, gdbarch_push_return_address_ftype *push_return_address)); +typedef CORE_ADDR (gdbarch_push_return_address_ftype) (CORE_ADDR pc, CORE_ADDR sp); +extern CORE_ADDR gdbarch_push_return_address (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp); +extern void set_gdbarch_push_return_address (struct gdbarch *gdbarch, gdbarch_push_return_address_ftype *push_return_address); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (PUSH_RETURN_ADDRESS) #define PUSH_RETURN_ADDRESS(pc, sp) (gdbarch_push_return_address (current_gdbarch, pc, sp)) #endif #endif -typedef void (gdbarch_pop_frame_ftype) PARAMS ((void)); -extern void gdbarch_pop_frame PARAMS ((struct gdbarch *gdbarch)); -extern void set_gdbarch_pop_frame PARAMS ((struct gdbarch *gdbarch, gdbarch_pop_frame_ftype *pop_frame)); +typedef void (gdbarch_pop_frame_ftype) (void); +extern void gdbarch_pop_frame (struct gdbarch *gdbarch); +extern void set_gdbarch_pop_frame (struct gdbarch *gdbarch, gdbarch_pop_frame_ftype *pop_frame); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (POP_FRAME) #define POP_FRAME (gdbarch_pop_frame (current_gdbarch)) #endif #endif -typedef CORE_ADDR (gdbarch_d10v_make_daddr_ftype) PARAMS ((CORE_ADDR x)); -extern CORE_ADDR gdbarch_d10v_make_daddr PARAMS ((struct gdbarch *gdbarch, CORE_ADDR x)); -extern void set_gdbarch_d10v_make_daddr PARAMS ((struct gdbarch *gdbarch, gdbarch_d10v_make_daddr_ftype *d10v_make_daddr)); +typedef CORE_ADDR (gdbarch_d10v_make_daddr_ftype) (CORE_ADDR x); +extern CORE_ADDR gdbarch_d10v_make_daddr (struct gdbarch *gdbarch, CORE_ADDR x); +extern void set_gdbarch_d10v_make_daddr (struct gdbarch *gdbarch, gdbarch_d10v_make_daddr_ftype *d10v_make_daddr); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (D10V_MAKE_DADDR) #define D10V_MAKE_DADDR(x) (gdbarch_d10v_make_daddr (current_gdbarch, x)) #endif #endif -typedef CORE_ADDR (gdbarch_d10v_make_iaddr_ftype) PARAMS ((CORE_ADDR x)); -extern CORE_ADDR gdbarch_d10v_make_iaddr PARAMS ((struct gdbarch *gdbarch, CORE_ADDR x)); -extern void set_gdbarch_d10v_make_iaddr PARAMS ((struct gdbarch *gdbarch, gdbarch_d10v_make_iaddr_ftype *d10v_make_iaddr)); +typedef CORE_ADDR (gdbarch_d10v_make_iaddr_ftype) (CORE_ADDR x); +extern CORE_ADDR gdbarch_d10v_make_iaddr (struct gdbarch *gdbarch, CORE_ADDR x); +extern void set_gdbarch_d10v_make_iaddr (struct gdbarch *gdbarch, gdbarch_d10v_make_iaddr_ftype *d10v_make_iaddr); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (D10V_MAKE_IADDR) #define D10V_MAKE_IADDR(x) (gdbarch_d10v_make_iaddr (current_gdbarch, x)) #endif #endif -typedef int (gdbarch_d10v_daddr_p_ftype) PARAMS ((CORE_ADDR x)); -extern int gdbarch_d10v_daddr_p PARAMS ((struct gdbarch *gdbarch, CORE_ADDR x)); -extern void set_gdbarch_d10v_daddr_p PARAMS ((struct gdbarch *gdbarch, gdbarch_d10v_daddr_p_ftype *d10v_daddr_p)); +typedef int (gdbarch_d10v_daddr_p_ftype) (CORE_ADDR x); +extern int gdbarch_d10v_daddr_p (struct gdbarch *gdbarch, CORE_ADDR x); +extern void set_gdbarch_d10v_daddr_p (struct gdbarch *gdbarch, gdbarch_d10v_daddr_p_ftype *d10v_daddr_p); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (D10V_DADDR_P) #define D10V_DADDR_P(x) (gdbarch_d10v_daddr_p (current_gdbarch, x)) #endif #endif -typedef int (gdbarch_d10v_iaddr_p_ftype) PARAMS ((CORE_ADDR x)); -extern int gdbarch_d10v_iaddr_p PARAMS ((struct gdbarch *gdbarch, CORE_ADDR x)); -extern void set_gdbarch_d10v_iaddr_p PARAMS ((struct gdbarch *gdbarch, gdbarch_d10v_iaddr_p_ftype *d10v_iaddr_p)); +typedef int (gdbarch_d10v_iaddr_p_ftype) (CORE_ADDR x); +extern int gdbarch_d10v_iaddr_p (struct gdbarch *gdbarch, CORE_ADDR x); +extern void set_gdbarch_d10v_iaddr_p (struct gdbarch *gdbarch, gdbarch_d10v_iaddr_p_ftype *d10v_iaddr_p); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (D10V_IADDR_P) #define D10V_IADDR_P(x) (gdbarch_d10v_iaddr_p (current_gdbarch, x)) #endif #endif -typedef CORE_ADDR (gdbarch_d10v_convert_daddr_to_raw_ftype) PARAMS ((CORE_ADDR x)); -extern CORE_ADDR gdbarch_d10v_convert_daddr_to_raw PARAMS ((struct gdbarch *gdbarch, CORE_ADDR x)); -extern void set_gdbarch_d10v_convert_daddr_to_raw PARAMS ((struct gdbarch *gdbarch, gdbarch_d10v_convert_daddr_to_raw_ftype *d10v_convert_daddr_to_raw)); +typedef CORE_ADDR (gdbarch_d10v_convert_daddr_to_raw_ftype) (CORE_ADDR x); +extern CORE_ADDR gdbarch_d10v_convert_daddr_to_raw (struct gdbarch *gdbarch, CORE_ADDR x); +extern void set_gdbarch_d10v_convert_daddr_to_raw (struct gdbarch *gdbarch, gdbarch_d10v_convert_daddr_to_raw_ftype *d10v_convert_daddr_to_raw); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (D10V_CONVERT_DADDR_TO_RAW) #define D10V_CONVERT_DADDR_TO_RAW(x) (gdbarch_d10v_convert_daddr_to_raw (current_gdbarch, x)) #endif #endif -typedef CORE_ADDR (gdbarch_d10v_convert_iaddr_to_raw_ftype) PARAMS ((CORE_ADDR x)); -extern CORE_ADDR gdbarch_d10v_convert_iaddr_to_raw PARAMS ((struct gdbarch *gdbarch, CORE_ADDR x)); -extern void set_gdbarch_d10v_convert_iaddr_to_raw PARAMS ((struct gdbarch *gdbarch, gdbarch_d10v_convert_iaddr_to_raw_ftype *d10v_convert_iaddr_to_raw)); +typedef CORE_ADDR (gdbarch_d10v_convert_iaddr_to_raw_ftype) (CORE_ADDR x); +extern CORE_ADDR gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch *gdbarch, CORE_ADDR x); +extern void set_gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch *gdbarch, gdbarch_d10v_convert_iaddr_to_raw_ftype *d10v_convert_iaddr_to_raw); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (D10V_CONVERT_IADDR_TO_RAW) #define D10V_CONVERT_IADDR_TO_RAW(x) (gdbarch_d10v_convert_iaddr_to_raw (current_gdbarch, x)) #endif #endif -typedef void (gdbarch_store_struct_return_ftype) PARAMS ((CORE_ADDR addr, CORE_ADDR sp)); -extern void gdbarch_store_struct_return PARAMS ((struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp)); -extern void set_gdbarch_store_struct_return PARAMS ((struct gdbarch *gdbarch, gdbarch_store_struct_return_ftype *store_struct_return)); +typedef void (gdbarch_store_struct_return_ftype) (CORE_ADDR addr, CORE_ADDR sp); +extern void gdbarch_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp); +extern void set_gdbarch_store_struct_return (struct gdbarch *gdbarch, gdbarch_store_struct_return_ftype *store_struct_return); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (STORE_STRUCT_RETURN) #define STORE_STRUCT_RETURN(addr, sp) (gdbarch_store_struct_return (current_gdbarch, addr, sp)) #endif #endif -typedef void (gdbarch_store_return_value_ftype) PARAMS ((struct type *type, char *valbuf)); -extern void gdbarch_store_return_value PARAMS ((struct gdbarch *gdbarch, struct type *type, char *valbuf)); -extern void set_gdbarch_store_return_value PARAMS ((struct gdbarch *gdbarch, gdbarch_store_return_value_ftype *store_return_value)); +typedef void (gdbarch_store_return_value_ftype) (struct type *type, char *valbuf); +extern void gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf); +extern void set_gdbarch_store_return_value (struct gdbarch *gdbarch, gdbarch_store_return_value_ftype *store_return_value); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (STORE_RETURN_VALUE) #define STORE_RETURN_VALUE(type, valbuf) (gdbarch_store_return_value (current_gdbarch, type, valbuf)) #endif #endif -typedef CORE_ADDR (gdbarch_extract_struct_value_address_ftype) PARAMS ((char *regbuf)); -extern CORE_ADDR gdbarch_extract_struct_value_address PARAMS ((struct gdbarch *gdbarch, char *regbuf)); -extern void set_gdbarch_extract_struct_value_address PARAMS ((struct gdbarch *gdbarch, gdbarch_extract_struct_value_address_ftype *extract_struct_value_address)); +typedef CORE_ADDR (gdbarch_extract_struct_value_address_ftype) (char *regbuf); +extern CORE_ADDR gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf); +extern void set_gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, gdbarch_extract_struct_value_address_ftype *extract_struct_value_address); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (EXTRACT_STRUCT_VALUE_ADDRESS) #define EXTRACT_STRUCT_VALUE_ADDRESS(regbuf) (gdbarch_extract_struct_value_address (current_gdbarch, regbuf)) #endif #endif -typedef int (gdbarch_use_struct_convention_ftype) PARAMS ((int gcc_p, struct type *value_type)); -extern int gdbarch_use_struct_convention PARAMS ((struct gdbarch *gdbarch, int gcc_p, struct type *value_type)); -extern void set_gdbarch_use_struct_convention PARAMS ((struct gdbarch *gdbarch, gdbarch_use_struct_convention_ftype *use_struct_convention)); +typedef int (gdbarch_use_struct_convention_ftype) (int gcc_p, struct type *value_type); +extern int gdbarch_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type); +extern void set_gdbarch_use_struct_convention (struct gdbarch *gdbarch, gdbarch_use_struct_convention_ftype *use_struct_convention); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (USE_STRUCT_CONVENTION) #define USE_STRUCT_CONVENTION(gcc_p, value_type) (gdbarch_use_struct_convention (current_gdbarch, gcc_p, value_type)) #endif #endif -typedef void (gdbarch_frame_init_saved_regs_ftype) PARAMS ((struct frame_info *frame)); -extern void gdbarch_frame_init_saved_regs PARAMS ((struct gdbarch *gdbarch, struct frame_info *frame)); -extern void set_gdbarch_frame_init_saved_regs PARAMS ((struct gdbarch *gdbarch, gdbarch_frame_init_saved_regs_ftype *frame_init_saved_regs)); +typedef void (gdbarch_frame_init_saved_regs_ftype) (struct frame_info *frame); +extern void gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, struct frame_info *frame); +extern void set_gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, gdbarch_frame_init_saved_regs_ftype *frame_init_saved_regs); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (FRAME_INIT_SAVED_REGS) #define FRAME_INIT_SAVED_REGS(frame) (gdbarch_frame_init_saved_regs (current_gdbarch, frame)) #endif #endif -typedef void (gdbarch_init_extra_frame_info_ftype) PARAMS ((int fromleaf, struct frame_info *frame)); -extern void gdbarch_init_extra_frame_info PARAMS ((struct gdbarch *gdbarch, int fromleaf, struct frame_info *frame)); -extern void set_gdbarch_init_extra_frame_info PARAMS ((struct gdbarch *gdbarch, gdbarch_init_extra_frame_info_ftype *init_extra_frame_info)); +typedef void (gdbarch_init_extra_frame_info_ftype) (int fromleaf, struct frame_info *frame); +extern void gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, int fromleaf, struct frame_info *frame); +extern void set_gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, gdbarch_init_extra_frame_info_ftype *init_extra_frame_info); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (INIT_EXTRA_FRAME_INFO) #define INIT_EXTRA_FRAME_INFO(fromleaf, frame) (gdbarch_init_extra_frame_info (current_gdbarch, fromleaf, frame)) #endif #endif -typedef CORE_ADDR (gdbarch_skip_prologue_ftype) PARAMS ((CORE_ADDR ip)); -extern CORE_ADDR gdbarch_skip_prologue PARAMS ((struct gdbarch *gdbarch, CORE_ADDR ip)); -extern void set_gdbarch_skip_prologue PARAMS ((struct gdbarch *gdbarch, gdbarch_skip_prologue_ftype *skip_prologue)); +typedef CORE_ADDR (gdbarch_skip_prologue_ftype) (CORE_ADDR ip); +extern CORE_ADDR gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip); +extern void set_gdbarch_skip_prologue (struct gdbarch *gdbarch, gdbarch_skip_prologue_ftype *skip_prologue); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (SKIP_PROLOGUE) #define SKIP_PROLOGUE(ip) (gdbarch_skip_prologue (current_gdbarch, ip)) #endif #endif -typedef int (gdbarch_inner_than_ftype) PARAMS ((CORE_ADDR lhs, CORE_ADDR rhs)); -extern int gdbarch_inner_than PARAMS ((struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs)); -extern void set_gdbarch_inner_than PARAMS ((struct gdbarch *gdbarch, gdbarch_inner_than_ftype *inner_than)); +typedef int (gdbarch_inner_than_ftype) (CORE_ADDR lhs, CORE_ADDR rhs); +extern int gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs); +extern void set_gdbarch_inner_than (struct gdbarch *gdbarch, gdbarch_inner_than_ftype *inner_than); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (INNER_THAN) #define INNER_THAN(lhs, rhs) (gdbarch_inner_than (current_gdbarch, lhs, rhs)) #endif #endif -typedef unsigned char * (gdbarch_breakpoint_from_pc_ftype) PARAMS ((CORE_ADDR *pcptr, int *lenptr)); -extern unsigned char * gdbarch_breakpoint_from_pc PARAMS ((struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)); -extern void set_gdbarch_breakpoint_from_pc PARAMS ((struct gdbarch *gdbarch, gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc)); +typedef unsigned char * (gdbarch_breakpoint_from_pc_ftype) (CORE_ADDR *pcptr, int *lenptr); +extern unsigned char * gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr); +extern void set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (BREAKPOINT_FROM_PC) #define BREAKPOINT_FROM_PC(pcptr, lenptr) (gdbarch_breakpoint_from_pc (current_gdbarch, pcptr, lenptr)) #endif #endif -extern CORE_ADDR gdbarch_decr_pc_after_break PARAMS ((struct gdbarch *gdbarch)); -extern void set_gdbarch_decr_pc_after_break PARAMS ((struct gdbarch *gdbarch, CORE_ADDR decr_pc_after_break)); +extern CORE_ADDR gdbarch_decr_pc_after_break (struct gdbarch *gdbarch); +extern void set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch, CORE_ADDR decr_pc_after_break); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (DECR_PC_AFTER_BREAK) #define DECR_PC_AFTER_BREAK (gdbarch_decr_pc_after_break (current_gdbarch)) #endif #endif -extern CORE_ADDR gdbarch_function_start_offset PARAMS ((struct gdbarch *gdbarch)); -extern void set_gdbarch_function_start_offset PARAMS ((struct gdbarch *gdbarch, CORE_ADDR function_start_offset)); +extern CORE_ADDR gdbarch_function_start_offset (struct gdbarch *gdbarch); +extern void set_gdbarch_function_start_offset (struct gdbarch *gdbarch, CORE_ADDR function_start_offset); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (FUNCTION_START_OFFSET) #define FUNCTION_START_OFFSET (gdbarch_function_start_offset (current_gdbarch)) #endif #endif -typedef void (gdbarch_remote_translate_xfer_address_ftype) PARAMS ((CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len)); -extern void gdbarch_remote_translate_xfer_address PARAMS ((struct gdbarch *gdbarch, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len)); -extern void set_gdbarch_remote_translate_xfer_address PARAMS ((struct gdbarch *gdbarch, gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address)); +typedef void (gdbarch_remote_translate_xfer_address_ftype) (CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len); +extern void gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len); +extern void set_gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (REMOTE_TRANSLATE_XFER_ADDRESS) #define REMOTE_TRANSLATE_XFER_ADDRESS(gdb_addr, gdb_len, rem_addr, rem_len) (gdbarch_remote_translate_xfer_address (current_gdbarch, gdb_addr, gdb_len, rem_addr, rem_len)) #endif #endif -extern CORE_ADDR gdbarch_frame_args_skip PARAMS ((struct gdbarch *gdbarch)); -extern void set_gdbarch_frame_args_skip PARAMS ((struct gdbarch *gdbarch, CORE_ADDR frame_args_skip)); +extern CORE_ADDR gdbarch_frame_args_skip (struct gdbarch *gdbarch); +extern void set_gdbarch_frame_args_skip (struct gdbarch *gdbarch, CORE_ADDR frame_args_skip); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (FRAME_ARGS_SKIP) #define FRAME_ARGS_SKIP (gdbarch_frame_args_skip (current_gdbarch)) #endif #endif -typedef int (gdbarch_frameless_function_invocation_ftype) PARAMS ((struct frame_info *fi)); -extern int gdbarch_frameless_function_invocation PARAMS ((struct gdbarch *gdbarch, struct frame_info *fi)); -extern void set_gdbarch_frameless_function_invocation PARAMS ((struct gdbarch *gdbarch, gdbarch_frameless_function_invocation_ftype *frameless_function_invocation)); +typedef int (gdbarch_frameless_function_invocation_ftype) (struct frame_info *fi); +extern int gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, struct frame_info *fi); +extern void set_gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, gdbarch_frameless_function_invocation_ftype *frameless_function_invocation); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (FRAMELESS_FUNCTION_INVOCATION) #define FRAMELESS_FUNCTION_INVOCATION(fi) (gdbarch_frameless_function_invocation (current_gdbarch, fi)) #endif #endif -typedef CORE_ADDR (gdbarch_frame_chain_ftype) PARAMS ((struct frame_info *frame)); -extern CORE_ADDR gdbarch_frame_chain PARAMS ((struct gdbarch *gdbarch, struct frame_info *frame)); -extern void set_gdbarch_frame_chain PARAMS ((struct gdbarch *gdbarch, gdbarch_frame_chain_ftype *frame_chain)); +typedef CORE_ADDR (gdbarch_frame_chain_ftype) (struct frame_info *frame); +extern CORE_ADDR gdbarch_frame_chain (struct gdbarch *gdbarch, struct frame_info *frame); +extern void set_gdbarch_frame_chain (struct gdbarch *gdbarch, gdbarch_frame_chain_ftype *frame_chain); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (FRAME_CHAIN) #define FRAME_CHAIN(frame) (gdbarch_frame_chain (current_gdbarch, frame)) #endif #endif -typedef int (gdbarch_frame_chain_valid_ftype) PARAMS ((CORE_ADDR chain, struct frame_info *thisframe)); -extern int gdbarch_frame_chain_valid PARAMS ((struct gdbarch *gdbarch, CORE_ADDR chain, struct frame_info *thisframe)); -extern void set_gdbarch_frame_chain_valid PARAMS ((struct gdbarch *gdbarch, gdbarch_frame_chain_valid_ftype *frame_chain_valid)); +typedef int (gdbarch_frame_chain_valid_ftype) (CORE_ADDR chain, struct frame_info *thisframe); +extern int gdbarch_frame_chain_valid (struct gdbarch *gdbarch, CORE_ADDR chain, struct frame_info *thisframe); +extern void set_gdbarch_frame_chain_valid (struct gdbarch *gdbarch, gdbarch_frame_chain_valid_ftype *frame_chain_valid); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (FRAME_CHAIN_VALID) #define FRAME_CHAIN_VALID(chain, thisframe) (gdbarch_frame_chain_valid (current_gdbarch, chain, thisframe)) #endif #endif -typedef CORE_ADDR (gdbarch_frame_saved_pc_ftype) PARAMS ((struct frame_info *fi)); -extern CORE_ADDR gdbarch_frame_saved_pc PARAMS ((struct gdbarch *gdbarch, struct frame_info *fi)); -extern void set_gdbarch_frame_saved_pc PARAMS ((struct gdbarch *gdbarch, gdbarch_frame_saved_pc_ftype *frame_saved_pc)); +typedef CORE_ADDR (gdbarch_frame_saved_pc_ftype) (struct frame_info *fi); +extern CORE_ADDR gdbarch_frame_saved_pc (struct gdbarch *gdbarch, struct frame_info *fi); +extern void set_gdbarch_frame_saved_pc (struct gdbarch *gdbarch, gdbarch_frame_saved_pc_ftype *frame_saved_pc); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (FRAME_SAVED_PC) #define FRAME_SAVED_PC(fi) (gdbarch_frame_saved_pc (current_gdbarch, fi)) #endif #endif -typedef CORE_ADDR (gdbarch_frame_args_address_ftype) PARAMS ((struct frame_info *fi)); -extern CORE_ADDR gdbarch_frame_args_address PARAMS ((struct gdbarch *gdbarch, struct frame_info *fi)); -extern void set_gdbarch_frame_args_address PARAMS ((struct gdbarch *gdbarch, gdbarch_frame_args_address_ftype *frame_args_address)); +typedef CORE_ADDR (gdbarch_frame_args_address_ftype) (struct frame_info *fi); +extern CORE_ADDR gdbarch_frame_args_address (struct gdbarch *gdbarch, struct frame_info *fi); +extern void set_gdbarch_frame_args_address (struct gdbarch *gdbarch, gdbarch_frame_args_address_ftype *frame_args_address); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (FRAME_ARGS_ADDRESS) #define FRAME_ARGS_ADDRESS(fi) (gdbarch_frame_args_address (current_gdbarch, fi)) #endif #endif -typedef CORE_ADDR (gdbarch_frame_locals_address_ftype) PARAMS ((struct frame_info *fi)); -extern CORE_ADDR gdbarch_frame_locals_address PARAMS ((struct gdbarch *gdbarch, struct frame_info *fi)); -extern void set_gdbarch_frame_locals_address PARAMS ((struct gdbarch *gdbarch, gdbarch_frame_locals_address_ftype *frame_locals_address)); +typedef CORE_ADDR (gdbarch_frame_locals_address_ftype) (struct frame_info *fi); +extern CORE_ADDR gdbarch_frame_locals_address (struct gdbarch *gdbarch, struct frame_info *fi); +extern void set_gdbarch_frame_locals_address (struct gdbarch *gdbarch, gdbarch_frame_locals_address_ftype *frame_locals_address); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (FRAME_LOCALS_ADDRESS) #define FRAME_LOCALS_ADDRESS(fi) (gdbarch_frame_locals_address (current_gdbarch, fi)) #endif #endif -typedef CORE_ADDR (gdbarch_saved_pc_after_call_ftype) PARAMS ((struct frame_info *frame)); -extern CORE_ADDR gdbarch_saved_pc_after_call PARAMS ((struct gdbarch *gdbarch, struct frame_info *frame)); -extern void set_gdbarch_saved_pc_after_call PARAMS ((struct gdbarch *gdbarch, gdbarch_saved_pc_after_call_ftype *saved_pc_after_call)); +typedef CORE_ADDR (gdbarch_saved_pc_after_call_ftype) (struct frame_info *frame); +extern CORE_ADDR gdbarch_saved_pc_after_call (struct gdbarch *gdbarch, struct frame_info *frame); +extern void set_gdbarch_saved_pc_after_call (struct gdbarch *gdbarch, gdbarch_saved_pc_after_call_ftype *saved_pc_after_call); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (SAVED_PC_AFTER_CALL) #define SAVED_PC_AFTER_CALL(frame) (gdbarch_saved_pc_after_call (current_gdbarch, frame)) #endif #endif -typedef int (gdbarch_frame_num_args_ftype) PARAMS ((struct frame_info *frame)); -extern int gdbarch_frame_num_args PARAMS ((struct gdbarch *gdbarch, struct frame_info *frame)); -extern void set_gdbarch_frame_num_args PARAMS ((struct gdbarch *gdbarch, gdbarch_frame_num_args_ftype *frame_num_args)); +typedef int (gdbarch_frame_num_args_ftype) (struct frame_info *frame); +extern int gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame); +extern void set_gdbarch_frame_num_args (struct gdbarch *gdbarch, gdbarch_frame_num_args_ftype *frame_num_args); #if GDB_MULTI_ARCH #if (GDB_MULTI_ARCH > 1) || !defined (FRAME_NUM_ARGS) #define FRAME_NUM_ARGS(frame) (gdbarch_frame_num_args (current_gdbarch, frame)) #endif #endif -extern struct gdbarch_tdep *gdbarch_tdep PARAMS ((struct gdbarch *gdbarch)); +extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch); /* Mechanism for co-ordinating the selection of a specific @@ -845,15 +855,15 @@ struct gdbarch_info struct gdbarch_tdep_info *tdep_info; }; -typedef struct gdbarch *(gdbarch_init_ftype) PARAMS ((struct gdbarch_info info, struct gdbarch_list *arches)); +typedef struct gdbarch *(gdbarch_init_ftype) (struct gdbarch_info info, struct gdbarch_list *arches); -extern void register_gdbarch_init PARAMS ((enum bfd_architecture architecture, gdbarch_init_ftype *)); +extern void register_gdbarch_init (enum bfd_architecture architecture, gdbarch_init_ftype *); /* Helper function. Search the list of ARCHES for a GDBARCH that matches the information provided by INFO. */ -extern struct gdbarch_list *gdbarch_list_lookup_by_info PARAMS ((struct gdbarch_list *arches, const struct gdbarch_info *info)); +extern struct gdbarch_list *gdbarch_list_lookup_by_info (struct gdbarch_list *arches, const struct gdbarch_info *info); /* Helper function. Create a preliminary ``struct gdbarch''. Perform @@ -861,7 +871,7 @@ extern struct gdbarch_list *gdbarch_list_lookup_by_info PARAMS ((struct gdbarch_ parameters. set_gdbarch_*() functions are called to complete the initialization of the object. */ -extern struct gdbarch *gdbarch_alloc PARAMS ((const struct gdbarch_info *info, struct gdbarch_tdep *tdep)); +extern struct gdbarch *gdbarch_alloc (const struct gdbarch_info *info, struct gdbarch_tdep *tdep); /* Helper function. Force an update of the current architecture. Used @@ -875,7 +885,7 @@ extern struct gdbarch *gdbarch_alloc PARAMS ((const struct gdbarch_info *info, s INFO.ABFD (if specified) before calling the corresponding architectures INIT function. */ -extern int gdbarch_update PARAMS ((struct gdbarch_info info)); +extern int gdbarch_update (struct gdbarch_info info); @@ -896,13 +906,13 @@ extern int gdbarch_update PARAMS ((struct gdbarch_info info)); Multiple registrarants for any architecture are allowed (and strongly encouraged). */ -typedef void *(gdbarch_data_ftype) PARAMS ((void)); -extern struct gdbarch_data *register_gdbarch_data PARAMS ((gdbarch_data_ftype *init)); +typedef void *(gdbarch_data_ftype) (void); +extern struct gdbarch_data *register_gdbarch_data (gdbarch_data_ftype *init); /* Return the value of the per-architecture data-pointer for the current architecture. */ -extern void *gdbarch_data PARAMS ((struct gdbarch_data*)); +extern void *gdbarch_data (struct gdbarch_data*); @@ -918,8 +928,8 @@ extern void *gdbarch_data PARAMS ((struct gdbarch_data*)); New code should use register_gdbarch_data(). */ -typedef void (gdbarch_swap_ftype) PARAMS ((void)); -extern void register_gdbarch_swap PARAMS ((void *data, unsigned long size, gdbarch_swap_ftype *init)); +typedef void (gdbarch_swap_ftype) (void); +extern void register_gdbarch_swap (void *data, unsigned long size, gdbarch_swap_ftype *init); @@ -979,7 +989,7 @@ extern const struct bfd_arch_info *target_architecture; architecture. A zero return status indicates that the target did not like the change. */ -extern int (*target_architecture_hook) PARAMS ((const struct bfd_arch_info *)); +extern int (*target_architecture_hook) (const struct bfd_arch_info *); @@ -987,16 +997,16 @@ extern int (*target_architecture_hook) PARAMS ((const struct bfd_arch_info *)); #include "dis-asm.h" /* Get defs for disassemble_info */ -extern int dis_asm_read_memory PARAMS ((bfd_vma memaddr, bfd_byte *myaddr, - int len, disassemble_info *info)); +extern int dis_asm_read_memory (bfd_vma memaddr, bfd_byte *myaddr, + int len, disassemble_info *info); -extern void dis_asm_memory_error PARAMS ((int status, bfd_vma memaddr, - disassemble_info *info)); +extern void dis_asm_memory_error (int status, bfd_vma memaddr, + disassemble_info *info); -extern void dis_asm_print_address PARAMS ((bfd_vma addr, - disassemble_info *info)); +extern void dis_asm_print_address (bfd_vma addr, + disassemble_info *info); -extern int (*tm_print_insn) PARAMS ((bfd_vma, disassemble_info*)); +extern int (*tm_print_insn) (bfd_vma, disassemble_info*); extern disassemble_info tm_print_insn_info; #ifndef TARGET_PRINT_INSN #define TARGET_PRINT_INSN(vma, info) (*tm_print_insn) (vma, info) @@ -1026,7 +1036,7 @@ extern disassemble_info tm_print_insn_info; /* Fallback definition of REGISTER_CONVERTIBLE etc */ -extern int generic_register_convertible_not PARAMS ((int reg_nr)); +extern int generic_register_convertible_not (int reg_nr); #ifndef REGISTER_CONVERTIBLE #define REGISTER_CONVERTIBLE(x) (0) #endif @@ -1060,24 +1070,24 @@ extern char *gdb_register_names[]; /* Set the dynamic target-system-dependant parameters (architecture, byte-order, ...) using information found in the BFD */ -extern void set_gdbarch_from_file PARAMS ((bfd *)); +extern void set_gdbarch_from_file (bfd *); /* Explicitly set the dynamic target-system-dependant parameters based on bfd_architecture and machine. */ -extern void set_architecture_from_arch_mach PARAMS ((enum bfd_architecture, unsigned long)); +extern void set_architecture_from_arch_mach (enum bfd_architecture, unsigned long); /* Helper function for targets that don't know how my arguments are being passed */ -extern int frame_num_args_unknown PARAMS ((struct frame_info *fi)); +extern int frame_num_args_unknown (struct frame_info *fi); /* gdbarch trace variable */ extern int gdbarch_debug; -extern void gdbarch_dump PARAMS ((void)); +extern void gdbarch_dump (void); #endif diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh new file mode 100755 index 0000000..5ad6b65 --- /dev/null +++ b/gdb/gdbarch.sh @@ -0,0 +1,1858 @@ +#!/usr/local/bin/bash + +# Architecture commands for GDB, the GNU debugger. +# Copyright 1998-1999 Free Software Foundation, Inc. +# +# This file is part of GDB. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +IFS=: + +read="class level macro returntype function formal actual attrib default init init_p fmt print print_p description" + +function_list () +{ + # category: + # # -> disable + # f -> function + # v -> variable + # i -> set from info + # macro-name + # return-type + # name + # formal argument list + # actual argument list + # attrib + # default exp + # init exp + # init_p exp + # print + # description + cat <<EOF | +i:2:TARGET_ARCHITECTURE:const struct bfd_arch_info *:bfd_arch_info::::&bfd_default_arch_struct:::%s:TARGET_ARCHITECTURE->printable_name:TARGET_ARCHITECTURE != NULL +# +i:2:TARGET_BYTE_ORDER:int:byte_order::::BIG_ENDIAN +# +v:1:TARGET_PTR_BIT:int:ptr_bit::::8 * sizeof (void*):0 +#v:1:TARGET_CHAR_BIT:int:char_bit::::8 * sizeof (char):0 +v:1:TARGET_SHORT_BIT:int:short_bit::::8 * sizeof (short):0 +v:1:TARGET_INT_BIT:int:int_bit::::8 * sizeof (int):0 +v:1:TARGET_LONG_BIT:int:long_bit::::8 * sizeof (long):0 +v:1:TARGET_LONG_LONG_BIT:int:long_long_bit::::8 * sizeof (LONGEST):0 +v:1:TARGET_FLOAT_BIT:int:float_bit::::8 * sizeof (float):0 +v:1:TARGET_DOUBLE_BIT:int:double_bit::::8 * sizeof (double):0 +v:1:TARGET_LONG_DOUBLE_BIT:int:long_double_bit::::8 * sizeof (long double):0 +# +f:1:TARGET_READ_PC:CORE_ADDR:read_pc:int pid:pid::0:0 +f:1:TARGET_WRITE_PC:void:write_pc:CORE_ADDR val, int pid:val, pid::0:0 +f:1:TARGET_READ_FP:CORE_ADDR:read_fp:void:::0:0 +f:1:TARGET_WRITE_FP:void:write_fp:CORE_ADDR val:val::0:0 +f:1:TARGET_READ_SP:CORE_ADDR:read_sp:void:::0:0 +f:1:TARGET_WRITE_SP:void:write_sp:CORE_ADDR val:val::0:0 +# +v:2:NUM_REGS:int:num_regs::::0:-1 +v:2:SP_REGNUM:int:sp_regnum::::0:-1 +v:2:FP_REGNUM:int:fp_regnum::::0:-1 +v:2:PC_REGNUM:int:pc_regnum::::0:-1 +f:2:REGISTER_NAME:char *:register_name:int regnr:regnr::0:0 +v:2:REGISTER_SIZE:int:register_size::::0:-1 +v:2:REGISTER_BYTES:int:register_bytes::::0:-1 +f:2:REGISTER_BYTE:int:register_byte:int reg_nr:reg_nr::0:0 +f:2:REGISTER_RAW_SIZE:int:register_raw_size:int reg_nr:reg_nr::0:0 +v:2:MAX_REGISTER_RAW_SIZE:int:max_register_raw_size::::0:-1 +f:2:REGISTER_VIRTUAL_SIZE:int:register_virtual_size:int reg_nr:reg_nr::0:0 +v:2:MAX_REGISTER_VIRTUAL_SIZE:int:max_register_virtual_size::::0:-1 +f:2:REGISTER_VIRTUAL_TYPE:struct type *:register_virtual_type:int reg_nr:reg_nr::0:0 +# +v:1:USE_GENERIC_DUMMY_FRAMES:int:use_generic_dummy_frames::::0:-1 +v:2:CALL_DUMMY_LOCATION:int:call_dummy_location::::0:0 +f:2:CALL_DUMMY_ADDRESS:CORE_ADDR:call_dummy_address:void:::0:0:gdbarch->call_dummy_location == AT_ENTRY_POINT && gdbarch->call_dummy_address == 0: +v:2:CALL_DUMMY_START_OFFSET:CORE_ADDR:call_dummy_start_offset::::0:-1::0x%08lx +v:2:CALL_DUMMY_BREAKPOINT_OFFSET:CORE_ADDR:call_dummy_breakpoint_offset::::0:-1::0x%08lx +v:1:CALL_DUMMY_BREAKPOINT_OFFSET_P:int:call_dummy_breakpoint_offset_p::::0:-1 +v:2:CALL_DUMMY_LENGTH:int:call_dummy_length::::0:-1::::CALL_DUMMY_LOCATION == BEFORE_TEXT_END || CALL_DUMMY_LOCATION == AFTER_TEXT_END +f:2:PC_IN_CALL_DUMMY:int:pc_in_call_dummy:CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address:pc, sp, frame_address::0:0 +v:1:CALL_DUMMY_P:int:call_dummy_p::::0:-1 +v:2:CALL_DUMMY_WORDS:LONGEST *:call_dummy_words::::0:::0x%08lx +v:2:SIZEOF_CALL_DUMMY_WORDS:int:sizeof_call_dummy_words::::0:::0x%08lx +v:1:CALL_DUMMY_STACK_ADJUST_P:int:call_dummy_stack_adjust_p::::0:-1::0x%08lx +v:2:CALL_DUMMY_STACK_ADJUST:int:call_dummy_stack_adjust::::0::gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0:0x%08lx::CALL_DUMMY_STACK_ADJUST_P +f:2:FIX_CALL_DUMMY:void:fix_call_dummy:char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p:dummy, pc, fun, nargs, args, type, gcc_p::0:0 +# +v:2:BELIEVE_PCC_PROMOTION:int:believe_pcc_promotion::::0:::::# +v:2:BELIEVE_PCC_PROMOTION_TYPE:int:believe_pcc_promotion_type::::0:::::# +f:1:GET_SAVED_REGISTER:void:get_saved_register:char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval:raw_buffer, optimized, addrp, frame, regnum, lval::generic_get_saved_register:0 +# +f:1:REGISTER_CONVERTIBLE:int:register_convertible:int nr:nr::0:0 +f:2:REGISTER_CONVERT_TO_VIRTUAL:void:register_convert_to_virtual:int regnum, struct type *type, char *from, char *to:regnum, type, from, to::0:0 +f:2:REGISTER_CONVERT_TO_RAW:void:register_convert_to_raw:struct type *type, int regnum, char *from, char *to:type, regnum, from, to::0:0 +# +f:2:EXTRACT_RETURN_VALUE:void:extract_return_value:struct type *type, char *regbuf, char *valbuf:type, regbuf, valbuf::0:0 +f:1:PUSH_ARGUMENTS:CORE_ADDR:push_arguments:int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr:nargs, args, sp, struct_return, struct_addr::0:0 +f:2:PUSH_DUMMY_FRAME:void:push_dummy_frame:void:-::0:0 +f:1:PUSH_RETURN_ADDRESS:CORE_ADDR:push_return_address:CORE_ADDR pc, CORE_ADDR sp:pc, sp::0:0 +f:2:POP_FRAME:void:pop_frame:void:-::0:0 +# +# I wish that these would just go away.... +f:2:D10V_MAKE_DADDR:CORE_ADDR:d10v_make_daddr:CORE_ADDR x:x::0:0 +f:2:D10V_MAKE_IADDR:CORE_ADDR:d10v_make_iaddr:CORE_ADDR x:x::0:0 +f:2:D10V_DADDR_P:int:d10v_daddr_p:CORE_ADDR x:x::0:0 +f:2:D10V_IADDR_P:int:d10v_iaddr_p:CORE_ADDR x:x::0:0 +f:2:D10V_CONVERT_DADDR_TO_RAW:CORE_ADDR:d10v_convert_daddr_to_raw:CORE_ADDR x:x::0:0 +f:2:D10V_CONVERT_IADDR_TO_RAW:CORE_ADDR:d10v_convert_iaddr_to_raw:CORE_ADDR x:x::0:0 +# +f:2:STORE_STRUCT_RETURN:void:store_struct_return:CORE_ADDR addr, CORE_ADDR sp:addr, sp::0:0 +f:2:STORE_RETURN_VALUE:void:store_return_value:struct type *type, char *valbuf:type, valbuf::0:0 +f:2:EXTRACT_STRUCT_VALUE_ADDRESS:CORE_ADDR:extract_struct_value_address:char *regbuf:regbuf::0:0 +f:2:USE_STRUCT_CONVENTION:int:use_struct_convention:int gcc_p, struct type *value_type:gcc_p, value_type::0:0 +# +f:2:FRAME_INIT_SAVED_REGS:void:frame_init_saved_regs:struct frame_info *frame:frame::0:0 +f:2:INIT_EXTRA_FRAME_INFO:void:init_extra_frame_info:int fromleaf, struct frame_info *frame:fromleaf, frame::0:0 +# +f:2:SKIP_PROLOGUE:CORE_ADDR:skip_prologue:CORE_ADDR ip:ip::0:0 +f:2:INNER_THAN:int:inner_than:CORE_ADDR lhs, CORE_ADDR rhs:lhs, rhs::0:0 +f:2:BREAKPOINT_FROM_PC:unsigned char *:breakpoint_from_pc:CORE_ADDR *pcptr, int *lenptr:pcptr, lenptr::0:0 +v:2:DECR_PC_AFTER_BREAK:CORE_ADDR:decr_pc_after_break::::0:-1 +v:2:FUNCTION_START_OFFSET:CORE_ADDR:function_start_offset::::0:-1 +# +f:2:REMOTE_TRANSLATE_XFER_ADDRESS:void:remote_translate_xfer_address:CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len:gdb_addr, gdb_len, rem_addr, rem_len::0:0 +# +v:2:FRAME_ARGS_SKIP:CORE_ADDR:frame_args_skip::::0:-1 +f:2:FRAMELESS_FUNCTION_INVOCATION:int:frameless_function_invocation:struct frame_info *fi:fi::0:0 +f:2:FRAME_CHAIN:CORE_ADDR:frame_chain:struct frame_info *frame:frame::0:0 +f:1:FRAME_CHAIN_VALID:int:frame_chain_valid:CORE_ADDR chain, struct frame_info *thisframe:chain, thisframe::0:0 +f:2:FRAME_SAVED_PC:CORE_ADDR:frame_saved_pc:struct frame_info *fi:fi::0:0 +f:2:FRAME_ARGS_ADDRESS:CORE_ADDR:frame_args_address:struct frame_info *fi:fi::0:0 +f:2:FRAME_LOCALS_ADDRESS:CORE_ADDR:frame_locals_address:struct frame_info *fi:fi::0:0 +f:2:SAVED_PC_AFTER_CALL:CORE_ADDR:saved_pc_after_call:struct frame_info *frame:frame::0:0 +f:2:FRAME_NUM_ARGS:int:frame_num_args:struct frame_info *frame:frame::0:0 +# +EOF + grep -v '^#' +} + + +# dump it out +if true +then + exec > new-gdbarch + function_list | while eval read $read + do + cat <<EOF +${class} ${macro}(${actual}) + ${returntype} ${function} ($formal)${attrib} + level=${level} + default=${default} + init=${init} + init_p=${init_p} + fmt=${fmt} + print=${print} + print_p=${print_p} + description=${description} +EOF + done + exec 1>&2 +fi + +copyright () +{ +cat <<EOF +/* Dynamic architecture support for GDB, the GNU debugger. + Copyright 1998-1999, Free Software Foundation, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* *INDENT-OFF* */ /* \`\`typedef (f)();'' confuses indent */ + +/* This file was created with the aid of \`\`gdbarch.sh''. + + The bourn shell script \`\`gdbarch.sh'' creates the files + \`\`new-gdbarch.c'' and \`\`new-gdbarch.h and then compares them + against the existing \`\`gdbarch.[hc]''. Any differences found + being reported. + + If editing this file, please also run gdbarch.sh and merge any + changes into that script. Conversely, when makeing sweeping changes + to this file, modifying gdbarch.sh and using its output may prove + easier. */ + +EOF +} + +# +# The .h file +# + +exec > new-gdbarch.h +copyright +cat <<EOF +#ifndef GDBARCH_H +#define GDBARCH_H + +struct frame_info; +struct value; + + +#ifndef GDB_MULTI_ARCH +#define GDB_MULTI_ARCH 0 +#endif + +extern struct gdbarch *current_gdbarch; + + +/* See gdb/doc/gdbint.texi for a discussion of the GDB_MULTI_ARCH + macro */ + + +/* If any of the following are defined, the target wasn't correctly + converted. */ + +#if GDB_MULTI_ARCH +#if defined (CALL_DUMMY) +#error "CALL_DUMMY: replaced by CALL_DUMMY_WORDS/SIZEOF_CALL_DUMMY_WORDS" +#endif +#endif + +#if GDB_MULTI_ARCH +#if defined (REGISTER_NAMES) +#error "REGISTER_NAMES: replaced by REGISTER_NAME" +#endif +#endif + +#if GDB_MULTI_ARCH +#if defined (EXTRA_FRAME_INFO) +#error "EXTRA_FRAME_INFO: replaced by struct frame_extra_info" +#endif +#endif + +#if GDB_MULTI_ARCH +#if defined (FRAME_FIND_SAVED_REGS) +#error "FRAME_FIND_SAVED_REGS: replaced by FRAME_INIT_SAVED_REGS" +#endif +#endif +EOF + +# function typedef's +echo "" +echo "" +echo "/* The following are pre-initialized by GDBARCH. */" +function_list | while eval read $read +do + case "${class}" in + "i" ) + echo "" + echo "extern ${returntype} gdbarch_${function} (struct gdbarch *gdbarch);" + echo "/* set_gdbarch_${function}() - not applicable - pre-initialized. */" + echo "#if GDB_MULTI_ARCH" + echo "#if (GDB_MULTI_ARCH > 1) || !defined (${macro})" + echo "#define ${macro} (gdbarch_${function} (current_gdbarch))" + echo "#endif" + echo "#endif" + ;; + esac +done + +# function typedef's +echo "" +echo "" +echo "/* The following are initialized by the target dependant code. */" +function_list | while eval read $read +do + case "${class}" in + "v" ) + echo "" + echo "extern ${returntype} gdbarch_${function} (struct gdbarch *gdbarch);" + echo "extern void set_gdbarch_${function} (struct gdbarch *gdbarch, ${returntype} ${function});" + echo "#if GDB_MULTI_ARCH" + echo "#if (GDB_MULTI_ARCH > 1) || !defined (${macro})" + echo "#define ${macro} (gdbarch_${function} (current_gdbarch))" + echo "#endif" + echo "#endif" + ;; + "f" ) + echo "" + echo "typedef ${returntype} (gdbarch_${function}_ftype) (${formal});" + if [ "${formal}" = "void" ] + then + echo "extern ${returntype} gdbarch_${function} (struct gdbarch *gdbarch);" + else + echo "extern ${returntype} gdbarch_${function} (struct gdbarch *gdbarch, ${formal});" + fi + echo "extern void set_gdbarch_${function} (struct gdbarch *gdbarch, gdbarch_${function}_ftype *${function});" + echo "#if GDB_MULTI_ARCH" + echo "#if (GDB_MULTI_ARCH > 1) || !defined (${macro})" + if [ "${actual}" = "" ] + then + echo "#define ${macro}() (gdbarch_${function} (current_gdbarch))" + elif [ "${actual}" = "-" ] + then + echo "#define ${macro} (gdbarch_${function} (current_gdbarch))" + else + echo "#define ${macro}(${actual}) (gdbarch_${function} (current_gdbarch, ${actual}))" + fi + echo "#endif" + echo "#endif" + ;; + esac +done + +# close it off +cat <<EOF + +extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch); + + +/* Mechanism for co-ordinating the selection of a specific + architecture. + + GDB targets (*-tdep.c) can register an interest in a specific + architecture. Other GDB components can register a need to maintain + per-architecture data. + + The mechanisms below ensures that there is only a loose connection + between the set-architecture command and the various GDB + components. Each component can independantly register their need + to maintain architecture specific data with gdbarch. + + Pragmatics: + + Previously, a single TARGET_ARCHITECTURE_HOOK was provided. It + didn't scale. + + The more traditional mega-struct containing architecture specific + data for all the various GDB components was also considered. Since + GDB is built from a variable number of (fairly independant) + components it was determined that the global aproach was not + applicable. */ + + +/* Register a new architectural family with GDB. + + Register support for the specified ARCHITECTURE with GDB. When + gdbarch determines that the specified architecture has been + selected, the corresponding INIT function is called. + + -- + + The INIT function takes two parameters: INFO which contains the + information available to gdbarch about the (possibly new) + architecture; ARCHES which is a list of the previously created + \`\`struct gdbarch'' for this architecture. + + The INIT function parameter INFO shall, as far as possible, be + pre-initialized with information obtained from INFO.ABFD or + previously selected architecture (if similar). INIT shall ensure + that the INFO.BYTE_ORDER is non-zero. + + The INIT function shall return any of: NULL - indicating that it + doesn't reconize the selected architecture; an existing \`\`struct + gdbarch'' from the ARCHES list - indicating that the new + architecture is just a synonym for an earlier architecture (see + gdbarch_list_lookup_by_info()); a newly created \`\`struct gdbarch'' + - that describes the selected architecture (see + gdbarch_alloc()). */ + +struct gdbarch_list +{ + struct gdbarch *gdbarch; + struct gdbarch_list *next; +}; + +struct gdbarch_info +{ + /* Use default: bfd_arch_unknown (ZERO). */ + enum bfd_architecture bfd_architecture; + + /* Use default: NULL (ZERO). */ + const struct bfd_arch_info *bfd_arch_info; + + /* Use default: 0 (ZERO). */ + int byte_order; + + /* Use default: NULL (ZERO). */ + bfd *abfd; + + /* Use default: NULL (ZERO). */ + struct gdbarch_tdep_info *tdep_info; +}; + +typedef struct gdbarch *(gdbarch_init_ftype) (struct gdbarch_info info, struct gdbarch_list *arches); + +extern void register_gdbarch_init (enum bfd_architecture architecture, gdbarch_init_ftype *); + + +/* Helper function. Search the list of ARCHES for a GDBARCH that + matches the information provided by INFO. */ + +extern struct gdbarch_list *gdbarch_list_lookup_by_info (struct gdbarch_list *arches, const struct gdbarch_info *info); + + +/* Helper function. Create a preliminary \`\`struct gdbarch''. Perform + basic initialization using values obtained from the INFO andTDEP + parameters. set_gdbarch_*() functions are called to complete the + initialization of the object. */ + +extern struct gdbarch *gdbarch_alloc (const struct gdbarch_info *info, struct gdbarch_tdep *tdep); + + +/* Helper function. Force an update of the current architecture. Used + by legacy targets that have added their own target specific + architecture manipulation commands. + + The INFO parameter shall be fully initialized (\`\`memset (&INFO, + sizeof (info), 0)'' set relevant fields) before gdbarch_update() is + called. gdbarch_update() shall initialize any \`\`default'' fields + using information obtained from the previous architecture or + INFO.ABFD (if specified) before calling the corresponding + architectures INIT function. */ + +extern int gdbarch_update (struct gdbarch_info info); + + + +/* Register per-architecture data-pointer. + + Reserve space for a per-architecture data-pointer. An identifier + for the reserved data-pointer is returned. That identifer should + be saved in a local static. + + When a new architecture is selected, INIT() is called. When a + previous architecture is re-selected, the per-architecture + data-pointer for that previous architecture is restored (INIT() is + not called). + + INIT() shall return the initial value for the per-architecture + data-pointer for the current architecture. + + Multiple registrarants for any architecture are allowed (and + strongly encouraged). */ + +typedef void *(gdbarch_data_ftype) (void); +extern struct gdbarch_data *register_gdbarch_data (gdbarch_data_ftype *init); + +/* Return the value of the per-architecture data-pointer for the + current architecture. */ + +extern void *gdbarch_data (struct gdbarch_data*); + + + +/* Register per-architecture memory region. + + Provide a memory-region swap mechanism. Per-architecture memory + region are created. These memory regions are swapped whenever the + architecture is changed. For a new architecture, the memory region + is initialized with zero (0) and the INIT function is called. + + Memory regions are swapped / initialized in the order that they are + registered. NULL DATA and/or INIT values can be specified. + + New code should use register_gdbarch_data(). */ + +typedef void (gdbarch_swap_ftype) (void); +extern void register_gdbarch_swap (void *data, unsigned long size, gdbarch_swap_ftype *init); + + + +/* The target-system-dependant byte order is dynamic */ + +/* TARGET_BYTE_ORDER_SELECTABLE_P determines if the target endianness + is selectable at runtime. The user can use the \`\`set endian'' + command to change it. TARGET_BYTE_ORDER_AUTO is nonzero when + target_byte_order should be auto-detected (from the program image + say). */ + +#if GDB_MULTI_ARCH +/* Multi-arch GDB is always bi-endian. */ +#define TARGET_BYTE_ORDER_SELECTABLE_P 1 +#endif + +#ifndef TARGET_BYTE_ORDER_SELECTABLE_P +/* compat - Catch old targets that define TARGET_BYTE_ORDER_SLECTABLE + when they should have defined TARGET_BYTE_ORDER_SELECTABLE_P 1 */ +#ifdef TARGET_BYTE_ORDER_SELECTABLE +#define TARGET_BYTE_ORDER_SELECTABLE_P 1 +#else +#define TARGET_BYTE_ORDER_SELECTABLE_P 0 +#endif +#endif + +extern int target_byte_order; +#ifdef TARGET_BYTE_ORDER_SELECTABLE +/* compat - Catch old targets that define TARGET_BYTE_ORDER_SELECTABLE + and expect defs.h to re-define TARGET_BYTE_ORDER. */ +#undef TARGET_BYTE_ORDER +#endif +#ifndef TARGET_BYTE_ORDER +#define TARGET_BYTE_ORDER (target_byte_order + 0) +#endif + +extern int target_byte_order_auto; +#ifndef TARGET_BYTE_ORDER_AUTO +#define TARGET_BYTE_ORDER_AUTO (target_byte_order_auto + 0) +#endif + + + +/* The target-system-dependant BFD architecture is dynamic */ + +extern int target_architecture_auto; +#ifndef TARGET_ARCHITECTURE_AUTO +#define TARGET_ARCHITECTURE_AUTO (target_architecture_auto + 0) +#endif + +extern const struct bfd_arch_info *target_architecture; +#ifndef TARGET_ARCHITECTURE +#define TARGET_ARCHITECTURE (target_architecture + 0) +#endif + +/* Notify the target dependant backend of a change to the selected + architecture. A zero return status indicates that the target did + not like the change. */ + +extern int (*target_architecture_hook) (const struct bfd_arch_info *); + + + +/* The target-system-dependant disassembler is semi-dynamic */ + +#include "dis-asm.h" /* Get defs for disassemble_info */ + +extern int dis_asm_read_memory (bfd_vma memaddr, bfd_byte *myaddr, + int len, disassemble_info *info); + +extern void dis_asm_memory_error (int status, bfd_vma memaddr, + disassemble_info *info); + +extern void dis_asm_print_address (bfd_vma addr, + disassemble_info *info); + +extern int (*tm_print_insn) (bfd_vma, disassemble_info*); +extern disassemble_info tm_print_insn_info; +#ifndef TARGET_PRINT_INSN +#define TARGET_PRINT_INSN(vma, info) (*tm_print_insn) (vma, info) +#endif +#ifndef TARGET_PRINT_INSN_INFO +#define TARGET_PRINT_INSN_INFO (&tm_print_insn_info) +#endif + + + +/* Explicit test for D10V architecture. + USE of these macro's is *STRONGLY* discouraged. */ + +#define GDB_TARGET_IS_D10V (TARGET_ARCHITECTURE->arch == bfd_arch_d10v) +#ifndef D10V_MAKE_DADDR +#define D10V_MAKE_DADDR(X) (internal_error ("gdbarch: D10V_MAKE_DADDR"), 0) +#endif +#ifndef D10V_MAKE_IADDR +#define D10V_MAKE_IADDR(X) (internal_error ("gdbarch: D10V_MAKE_IADDR"), 0) +#endif + + +/* Fallback definition of FRAMELESS_FUNCTION_INVOCATION */ +#ifndef FRAMELESS_FUNCTION_INVOCATION +#define FRAMELESS_FUNCTION_INVOCATION(FI) (0) +#endif + + +/* Fallback definition of REGISTER_CONVERTIBLE etc */ +extern int generic_register_convertible_not (int reg_nr); +#ifndef REGISTER_CONVERTIBLE +#define REGISTER_CONVERTIBLE(x) (0) +#endif +#ifndef REGISTER_CONVERT_TO_VIRTUAL +#define REGISTER_CONVERT_TO_VIRTUAL(x, y, z, a) +#endif +#ifndef REGISTER_CONVERT_TO_RAW +#define REGISTER_CONVERT_TO_RAW(x, y, z, a) +#endif + + +/* Fallback definition for EXTRACT_STRUCT_VALUE_ADDRESS */ +#ifndef EXTRACT_STRUCT_VALUE_ADDRESS +#define EXTRACT_STRUCT_VALUE_ADDRESS_P (0) +#define EXTRACT_STRUCT_VALUE_ADDRESS(X) (internal_error ("gdbarch: EXTRACT_STRUCT_VALUE_ADDRESS"), 0) +#else +#ifndef EXTRACT_STRUCT_VALUE_ADDRESS_P +#define EXTRACT_STRUCT_VALUE_ADDRESS_P (1) +#endif +#endif + + +/* Fallback definition for REGISTER_NAME for systems still defining + REGISTER_NAMES. */ +#ifndef REGISTER_NAME +extern char *gdb_register_names[]; +#define REGISTER_NAME(i) gdb_register_names[i] +#endif + + +/* Set the dynamic target-system-dependant parameters (architecture, + byte-order, ...) using information found in the BFD */ + +extern void set_gdbarch_from_file (bfd *); + + +/* Explicitly set the dynamic target-system-dependant parameters based + on bfd_architecture and machine. */ + +extern void set_architecture_from_arch_mach (enum bfd_architecture, unsigned long); + + +/* Helper function for targets that don't know how my arguments are + being passed */ + +extern int frame_num_args_unknown (struct frame_info *fi); + + +/* gdbarch trace variable */ +extern int gdbarch_debug; + +extern void gdbarch_dump (void); + +#endif +EOF +exec 1>&2 +#../move-if-change new-gdbarch.h gdbarch.h +if ! test -r gdbarch.h +then + echo "gdbarch.h missing? cp new-gdbarch.h gdbarch.h" 1>&2 +elif diff -c gdbarch.h new-gdbarch.h +then + echo "gdbarch.h unchanged" 1>&2 +else + echo "gdbarch.h has changed? cp new-gdbarch.h gdbarch.h" 1>&2 +fi + + +# +# C file +# + +exec > new-gdbarch.c +copyright +cat <<EOF + +#include "defs.h" + +#if GDB_MULTI_ARCH +#include "gdbcmd.h" +#include "inferior.h" /* enum CALL_DUMMY_LOCATION et.al. */ +#else +/* Just include everything in sight so that the every old definition + of macro is visible. */ +#include "gdb_string.h" +#include <ctype.h> +#include "symtab.h" +#include "frame.h" +#include "inferior.h" +#include "breakpoint.h" +#include "wait.h" +#include "gdbcore.h" +#include "gdbcmd.h" +#include "target.h" +#include "gdbthread.h" +#include "annotate.h" +#include "symfile.h" /* for overlay functions */ +#endif +#include "symcat.h" + + +/* Static function declarations */ + +static void verify_gdbarch (struct gdbarch *gdbarch); +static void init_gdbarch_data (struct gdbarch *); +static void init_gdbarch_swap (struct gdbarch *); +static void swapout_gdbarch_swap (struct gdbarch *); +static void swapin_gdbarch_swap (struct gdbarch *); + +/* Convenience macro for allocting typesafe memory. */ + +#ifndef XMALLOC +#define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE)) +#endif + + +/* Non-zero if we want to trace architecture code. */ + +#ifndef GDBARCH_DEBUG +#define GDBARCH_DEBUG 0 +#endif +int gdbarch_debug = GDBARCH_DEBUG; + +EOF + +# gdbarch open the gdbarch object +echo "" +echo "/* Maintain the struct gdbarch object */" +echo "" +echo "struct gdbarch" +echo "{" +echo " /* basic architectural information */" +function_list | while eval read $read +do + case "${class}" in + "i" ) echo " ${returntype} ${function};" ;; + esac +done +echo "" +echo " /* target specific vector. */" +echo " struct gdbarch_tdep *tdep;" +echo "" +echo " /* per-architecture data-pointers */" +echo " int nr_data;" +echo " void **data;" +echo "" +echo " /* per-architecture swap-regions */" +echo " struct gdbarch_swap *swap;" +echo "" +cat <<EOF + /* Multi-arch values. + + When extending this structure you must: + + Add the field below. + + Declare set/get functions and define the corresponding + macro in gdbarch.h. + + gdbarch_alloc(): If zero/NULL is not a suitable default, + initialize the new field. + + verify_gdbarch(): Confirm that the target updated the field + correctly. + + gdbarch_dump(): Add a fprintf_unfiltered call to so that the new + field is dumped out + + \`\`default_gdbarch()'': Append an initial value to the static + variable (base values on the host's c-type system). + + get_gdbarch(): Implement the set/get functions (probably using + the macro's as shortcuts). + + */ + +EOF +function_list | while eval read $read +do + case "${class}" in + "v" ) echo " ${returntype} ${function};" ;; + "f" ) echo " gdbarch_${function}_ftype *${function}${attrib};" ;; + esac +done +echo "};" + +# A pre-initialized vector +echo "" +echo "" +cat <<EOF +/* The default architecture uses host values (for want of a better + choice). */ +EOF +echo "" +echo "extern const struct bfd_arch_info bfd_default_arch_struct;" +echo "" +echo "struct gdbarch default_gdbarch = {" +echo " /* basic architecture information */" +function_list | while eval read $read +do + case "${class}" in + "i" ) echo " ${default}," ;; + esac +done +cat <<EOF + /* target specific vector */ + NULL, + /*per-architecture data-pointers and swap regions */ + 0, NULL, NULL, + /* Multi-arch values */ +EOF +function_list | while eval read $read +do + case "${class}" in + "f" | "v" ) echo " ${default}," ;; + esac +done +cat <<EOF + /* default_gdbarch() */ +}; +struct gdbarch *current_gdbarch = &default_gdbarch; +EOF + +# Create a new gdbarch struct +echo "" +echo "" +cat <<EOF +/* Create a new \`\`struct gdbarch'' based in information provided by + \`\`struct gdbarch_info''. */ +EOF +echo "" +cat <<EOF +struct gdbarch * +gdbarch_alloc (const struct gdbarch_info *info, + struct gdbarch_tdep *tdep) +{ + struct gdbarch *gdbarch = XMALLOC (struct gdbarch); + memset (gdbarch, 0, sizeof (*gdbarch)); + + gdbarch->tdep = tdep; +EOF +echo "" +function_list | while eval read $read +do + case "${class}" in + "i" ) echo " gdbarch->${function} = info->${function};" + esac +done +echo "" +echo " /* Force the explicit initialization of these. */" +function_list | while eval read $read +do + case "${class}" in + "f" | "v" ) + if [ "${init}" != "" -a "${init}" != "0" ] + then + echo " gdbarch->${function} = ${init};" + fi + ;; + esac +done +cat <<EOF + /* gdbarch_alloc() */ + + return gdbarch; +} +EOF + +# verify a new architecture +echo "" +echo "" +echo "/* Ensure that all values in a GDBARCH are reasonable. */" +echo "" +cat <<EOF +static void +verify_gdbarch (struct gdbarch *gdbarch) +{ + /* Only perform sanity checks on a multi-arch target. */ + if (GDB_MULTI_ARCH <= 0) + return; + /* fundamental */ + if (gdbarch->byte_order == 0) + internal_error ("verify_gdbarch: byte-order unset"); + if (gdbarch->bfd_arch_info == NULL) + internal_error ("verify_gdbarch: bfd_arch_info unset"); + /* Check those that need to be defined for the given multi-arch level. */ +EOF +function_list | while eval read $read +do + case "${class}" in + "f" | "v" ) + if [ "${init_p}" ] + then + echo " if ((GDB_MULTI_ARCH >= ${level})" + echo " && (${init_p}))" + echo " internal_error (\"gdbarch: verify_gdbarch: ${function} invalid\");" + elif [ "${init}" ] + then + echo " if ((GDB_MULTI_ARCH >= ${level})" + echo " && (gdbarch->${function} == ${init}))" + echo " internal_error (\"gdbarch: verify_gdbarch: ${function} invalid\");" + fi + ;; + esac +done +cat <<EOF +} +EOF + +# dump the structure +echo "" +echo "" +echo "/* Print out the details of the current architecture. */" +echo "" +cat <<EOF +void +gdbarch_dump (void) +{ +EOF +function_list | while eval read $read +do + case "${class}" in + "f" ) + echo " fprintf_unfiltered (gdb_stdlog," + echo " \"gdbarch_update: ${macro} = 0x%08lx\\n\"," + echo " (long) current_gdbarch->${function}" + echo " /*${macro} ()*/);" + ;; + * ) + test "${fmt}" || fmt="%ld" + test "${print}" || print="(long) ${macro}" + if [ "${print_p}" = "#" ] + then + echo "#ifdef ${macro}" + echo " fprintf_unfiltered (gdb_stdlog," + echo " \"gdbarch_update: ${macro} = ${fmt}\\n\"," + echo " ${print});" + echo "#endif" + elif [ "${print_p}" ] + then + echo " if (${print_p})" + echo " fprintf_unfiltered (gdb_stdlog," + echo " \"gdbarch_update: ${macro} = ${fmt}\\n\"," + echo " ${print});" + else + echo " fprintf_unfiltered (gdb_stdlog," + echo " \"gdbarch_update: ${macro} = ${fmt}\\n\"," + echo " ${print});" + fi + ;; + esac +done +echo "}" + + +# GET/SET +echo "" +cat <<EOF +struct gdbarch_tdep * +gdbarch_tdep (struct gdbarch *gdbarch) +{ + if (gdbarch_debug >= 2) + /* FIXME: gdb_std??? */ + fprintf_unfiltered (gdb_stdlog, "gdbarch_tdep called\n"); + return gdbarch->tdep; +} +EOF +echo "" +function_list | while eval read $read +do + case "${class}" in + "f" ) + echo "" + echo "${returntype}" + if [ "${formal}" = "void" ] + then + echo "gdbarch_${function} (struct gdbarch *gdbarch)" + else + echo "gdbarch_${function} (struct gdbarch *gdbarch, ${formal})" + fi + echo "{" + echo " if (gdbarch->${function} == 0)" + echo " internal_error (\"gdbarch: gdbarch_${function} invalid\");" + echo " if (gdbarch_debug >= 2)" + echo " /* FIXME: gdb_std??? */" + echo " fprintf_unfiltered (gdb_stdlog, \"gdbarch_${function} called\n\");" + test "${actual}" = "-" && actual="" + if [ "${returntype}" = "void" ] + then + echo " gdbarch->${function} (${actual});" + else + echo " return gdbarch->${function} (${actual});" + fi + echo "}" + echo "" + echo "void" + echo "set_gdbarch_${function} (struct gdbarch *gdbarch," + echo " `echo ${function} | tr '[0-9a-z_]' ' '` gdbarch_${function}_ftype ${function})" + echo "{" + echo " gdbarch->${function} = ${function};" + echo "}" + ;; + "v" ) + echo "" + echo "${returntype}" + echo "gdbarch_${function} (struct gdbarch *gdbarch)" + echo "{" + if [ "${init_p}" ] + then + echo " if (${init_p})" + echo " internal_error (\"gdbarch: gdbarch_${function} invalid\");" + elif [ "${init}" ] + then + echo " if (gdbarch->${function} == ${init})" + echo " internal_error (\"gdbarch: gdbarch_${function} invalid\");" + fi + echo " if (gdbarch_debug >= 2)" + echo " /* FIXME: gdb_std??? */" + echo " fprintf_unfiltered (gdb_stdlog, \"gdbarch_${function} called\n\");" + echo " return gdbarch->${function};" + echo "}" + echo "" + echo "void" + echo "set_gdbarch_${function} (struct gdbarch *gdbarch," + echo " `echo ${function} | tr '[0-9a-z_]' ' '` ${returntype} ${function})" + echo "{" + echo " gdbarch->${function} = ${function};" + echo "}" + ;; + "i" ) + echo "" + echo "${returntype}" + echo "gdbarch_${function} (struct gdbarch *gdbarch)" + echo "{" + echo " if (gdbarch_debug >= 2)" + echo " /* FIXME: gdb_std??? */" + echo " fprintf_unfiltered (gdb_stdlog, \"gdbarch_${function} called\n\");" + echo " return gdbarch->${function};" + echo "}" + ;; + esac +done + +# All the trailing guff +cat <<EOF + + +/* Keep a registrary of per-architecture data-pointers required by GDB + modules. */ + +struct gdbarch_data +{ + int index; +}; + +struct gdbarch_data_registration +{ + gdbarch_data_ftype *init; + struct gdbarch_data *data; + struct gdbarch_data_registration *next; +}; + +struct gdbarch_data_registrary +{ + int nr; + struct gdbarch_data_registration *registrations; +}; + +struct gdbarch_data_registrary gdbarch_data_registrary = +{ + 0, NULL, +}; + +struct gdbarch_data * +register_gdbarch_data (gdbarch_data_ftype *init) +{ + struct gdbarch_data_registration **curr; + for (curr = &gdbarch_data_registrary.registrations; + (*curr) != NULL; + curr = &(*curr)->next); + (*curr) = XMALLOC (struct gdbarch_data_registration); + (*curr)->next = NULL; + (*curr)->init = init; + (*curr)->data = XMALLOC (struct gdbarch_data); + (*curr)->data->index = gdbarch_data_registrary.nr++; + return (*curr)->data; +} + + +/* Walk through all the registered users initializing each in turn. */ + +static void +init_gdbarch_data (struct gdbarch *gdbarch) +{ + struct gdbarch_data_registration *rego; + gdbarch->nr_data = gdbarch_data_registrary.nr + 1; + gdbarch->data = xmalloc (sizeof (void*) * gdbarch->nr_data); + for (rego = gdbarch_data_registrary.registrations; + rego != NULL; + rego = rego->next) + { + if (rego->data->index < gdbarch->nr_data) + gdbarch->data[rego->data->index] = rego->init (); + } +} + + +/* Return the current value of the specified per-architecture + data-pointer. */ + +void * +gdbarch_data (data) + struct gdbarch_data *data; +{ + if (data->index >= current_gdbarch->nr_data) + internal_error ("gdbarch_data: request for non-existant data."); + return current_gdbarch->data[data->index]; +} + + + +/* Keep a registrary of swaped data required by GDB modules. */ + +struct gdbarch_swap +{ + void *swap; + struct gdbarch_swap_registration *source; + struct gdbarch_swap *next; +}; + +struct gdbarch_swap_registration +{ + void *data; + unsigned long sizeof_data; + gdbarch_swap_ftype *init; + struct gdbarch_swap_registration *next; +}; + +struct gdbarch_swap_registrary +{ + int nr; + struct gdbarch_swap_registration *registrations; +}; + +struct gdbarch_swap_registrary gdbarch_swap_registrary = +{ + 0, NULL, +}; + +void +register_gdbarch_swap (void *data, + unsigned long sizeof_data, + gdbarch_swap_ftype *init) +{ + struct gdbarch_swap_registration **rego; + for (rego = &gdbarch_swap_registrary.registrations; + (*rego) != NULL; + rego = &(*rego)->next); + (*rego) = XMALLOC (struct gdbarch_swap_registration); + (*rego)->next = NULL; + (*rego)->init = init; + (*rego)->data = data; + (*rego)->sizeof_data = sizeof_data; +} + + +static void +init_gdbarch_swap (struct gdbarch *gdbarch) +{ + struct gdbarch_swap_registration *rego; + struct gdbarch_swap **curr = &gdbarch->swap; + for (rego = gdbarch_swap_registrary.registrations; + rego != NULL; + rego = rego->next) + { + if (rego->data != NULL) + { + (*curr) = XMALLOC (struct gdbarch_swap); + (*curr)->source = rego; + (*curr)->swap = xmalloc (rego->sizeof_data); + (*curr)->next = NULL; + memset (rego->data, 0, rego->sizeof_data); + curr = &(*curr)->next; + } + if (rego->init != NULL) + rego->init (); + } +} + +static void +swapout_gdbarch_swap (struct gdbarch *gdbarch) +{ + struct gdbarch_swap *curr; + for (curr = gdbarch->swap; + curr != NULL; + curr = curr->next) + memcpy (curr->swap, curr->source->data, curr->source->sizeof_data); +} + +static void +swapin_gdbarch_swap (struct gdbarch *gdbarch) +{ + struct gdbarch_swap *curr; + for (curr = gdbarch->swap; + curr != NULL; + curr = curr->next) + memcpy (curr->source->data, curr->swap, curr->source->sizeof_data); +} + + +/* Keep a registrary of the architectures known by GDB. */ + +struct gdbarch_init_registration +{ + enum bfd_architecture bfd_architecture; + gdbarch_init_ftype *init; + struct gdbarch_list *arches; + struct gdbarch_init_registration *next; +}; + +static struct gdbarch_init_registration *gdbarch_init_registrary = NULL; + +void +register_gdbarch_init (enum bfd_architecture bfd_architecture, + gdbarch_init_ftype *init) +{ + struct gdbarch_init_registration **curr; + const struct bfd_arch_info *bfd_arch_info; + /* Check that BFD reconizes this architecture */ + bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0); + if (bfd_arch_info == NULL) + { + internal_error ("gdbarch: Attempt to register unknown architecture (%d)", bfd_architecture); + } + /* Check that we haven't seen this architecture before */ + for (curr = &gdbarch_init_registrary; + (*curr) != NULL; + curr = &(*curr)->next) + { + if (bfd_architecture == (*curr)->bfd_architecture) + internal_error ("gdbarch: Duplicate registraration of architecture (%s)", + bfd_arch_info->printable_name); + } + /* log it */ + if (gdbarch_debug) + fprintf_unfiltered (gdb_stdlog, "register_gdbarch_init (%s, 0x%08lx)\n", + bfd_arch_info->printable_name, + (long) init); + /* Append it */ + (*curr) = XMALLOC (struct gdbarch_init_registration); + (*curr)->bfd_architecture = bfd_architecture; + (*curr)->init = init; + (*curr)->arches = NULL; + (*curr)->next = NULL; +} + + + +/* Look for an architecture using gdbarch_info. Base search on only + BFD_ARCH_INFO and BYTE_ORDER. */ + +struct gdbarch_list * +gdbarch_list_lookup_by_info (struct gdbarch_list *arches, + const struct gdbarch_info *info) +{ + for (; arches != NULL; arches = arches->next) + { + if (info->bfd_arch_info != arches->gdbarch->bfd_arch_info) + continue; + if (info->byte_order != arches->gdbarch->byte_order) + continue; + return arches; + } + return NULL; +} + + +/* Update the current architecture. Return ZERO if the update request + failed. */ + +int +gdbarch_update (struct gdbarch_info info) +{ + struct gdbarch *new_gdbarch; + struct gdbarch_list **list; + struct gdbarch_init_registration *rego; + + /* Fill in any missing bits. Most important is the bfd_architecture + which is used to select the target architecture. */ + if (info.bfd_architecture == bfd_arch_unknown) + { + if (info.bfd_arch_info != NULL) + info.bfd_architecture = info.bfd_arch_info->arch; + else if (info.abfd != NULL) + info.bfd_architecture = bfd_get_arch (info.abfd); + /* FIXME - should query BFD for its default architecture. */ + else + info.bfd_architecture = current_gdbarch->bfd_arch_info->arch; + } + if (info.bfd_arch_info == NULL) + { + if (target_architecture_auto && info.abfd != NULL) + info.bfd_arch_info = bfd_get_arch_info (info.abfd); + else + info.bfd_arch_info = current_gdbarch->bfd_arch_info; + } + if (info.byte_order == 0) + { + if (target_byte_order_auto && info.abfd != NULL) + info.byte_order = (bfd_big_endian (info.abfd) ? BIG_ENDIAN + : bfd_little_endian (info.abfd) ? LITTLE_ENDIAN + : 0); + else + info.byte_order = current_gdbarch->byte_order; + /* FIXME - should query BFD for its default byte-order. */ + } + /* A default for abfd? */ + + /* Find the target that knows about this architecture. */ + for (rego = gdbarch_init_registrary; + rego != NULL && rego->bfd_architecture != info.bfd_architecture; + rego = rego->next); + if (rego == NULL) + { + if (gdbarch_debug) + fprintf_unfiltered (gdb_stdlog, "gdbarch_update: No matching architecture\n"); + return 0; + } + + if (gdbarch_debug) + { + fprintf_unfiltered (gdb_stdlog, + "gdbarch_update: info.bfd_architecture %d (%s)\n", + info.bfd_architecture, + bfd_lookup_arch (info.bfd_architecture, 0)->printable_name); + fprintf_unfiltered (gdb_stdlog, + "gdbarch_update: info.bfd_arch_info %s\n", + (info.bfd_arch_info != NULL + ? info.bfd_arch_info->printable_name + : "(null)")); + fprintf_unfiltered (gdb_stdlog, + "gdbarch_update: info.byte_order %d (%s)\n", + info.byte_order, + (info.byte_order == BIG_ENDIAN ? "big" + : info.byte_order == LITTLE_ENDIAN ? "little" + : "default")); + fprintf_unfiltered (gdb_stdlog, + "gdbarch_update: info.abfd 0x%lx\n", + (long) info.abfd); + fprintf_unfiltered (gdb_stdlog, + "gdbarch_update: info.tdep_info 0x%lx\n", + (long) info.tdep_info); + } + + /* Ask the target for a replacement architecture. */ + new_gdbarch = rego->init (info, rego->arches); + + /* Did the target like it? No. Reject the change. */ + if (new_gdbarch == NULL) + { + if (gdbarch_debug) + fprintf_unfiltered (gdb_stdlog, "gdbarch_update: Target rejected architecture\n"); + return 0; + } + + /* Did the architecture change? No. Do nothing. */ + if (current_gdbarch == new_gdbarch) + { + if (gdbarch_debug) + fprintf_unfiltered (gdb_stdlog, "gdbarch_update: Architecture 0x%08lx (%s) unchanged\n", + (long) new_gdbarch, + new_gdbarch->bfd_arch_info->printable_name); + return 1; + } + + /* Swap all data belonging to the old target out */ + swapout_gdbarch_swap (current_gdbarch); + + /* Is this a pre-existing architecture? Yes. Swap it in. */ + for (list = ®o->arches; + (*list) != NULL; + list = &(*list)->next) + { + if ((*list)->gdbarch == new_gdbarch) + { + if (gdbarch_debug) + fprintf_unfiltered (gdb_stdlog, "gdbarch_update: Previous architecture 0x%08lx (%s) selected\n", + (long) new_gdbarch, + new_gdbarch->bfd_arch_info->printable_name); + current_gdbarch = new_gdbarch; + swapin_gdbarch_swap (new_gdbarch); + return 1; + } + } + + /* Append this new architecture to this targets list. */ + (*list) = XMALLOC (struct gdbarch_list); + (*list)->next = NULL; + (*list)->gdbarch = new_gdbarch; + + /* Switch to this new architecture. Dump it out. */ + current_gdbarch = new_gdbarch; + if (gdbarch_debug) + { + fprintf_unfiltered (gdb_stdlog, + "gdbarch_update: New architecture 0x%08lx (%s) selected\n", + (long) new_gdbarch, + new_gdbarch->bfd_arch_info->printable_name); + gdbarch_dump (); + } + + /* Check that the newly installed architecture is valid. */ + verify_gdbarch (new_gdbarch); + + /* Initialize the per-architecture memory (swap) areas. + CURRENT_GDBARCH must be update before these modules are + called. */ + init_gdbarch_swap (new_gdbarch); + + /* Initialize the per-architecture data-pointer of all parties that + registered an interest in this architecture. CURRENT_GDBARCH + must be updated before these modules are called. */ + init_gdbarch_data (new_gdbarch); + + return 1; +} + + + +/* Functions to manipulate the endianness of the target. */ + +#ifdef TARGET_BYTE_ORDER_SELECTABLE +/* compat - Catch old targets that expect a selectable byte-order to + default to BIG_ENDIAN */ +#ifndef TARGET_BYTE_ORDER_DEFAULT +#define TARGET_BYTE_ORDER_DEFAULT BIG_ENDIAN +#endif +#endif +#if !TARGET_BYTE_ORDER_SELECTABLE_P +#ifndef TARGET_BYTE_ORDER_DEFAULT +/* compat - Catch old non byte-order selectable targets that do not + define TARGET_BYTE_ORDER_DEFAULT and instead expect + TARGET_BYTE_ORDER to be used as the default. For targets that + defined neither TARGET_BYTE_ORDER nor TARGET_BYTE_ORDER_DEFAULT the + below will get a strange compiler warning. */ +#define TARGET_BYTE_ORDER_DEFAULT TARGET_BYTE_ORDER +#endif +#endif +#ifndef TARGET_BYTE_ORDER_DEFAULT +#define TARGET_BYTE_ORDER_DEFAULT BIG_ENDIAN /* arbitrary */ +#endif +int target_byte_order = TARGET_BYTE_ORDER_DEFAULT; +int target_byte_order_auto = 1; + +/* Chain containing the \"set endian\" commands. */ +static struct cmd_list_element *endianlist = NULL; + +/* Called by \`\`show endian''. */ +static void +show_endian (char *args, int from_tty) +{ + char *msg = + (TARGET_BYTE_ORDER_AUTO + ? "The target endianness is set automatically (currently %s endian)\n" + : "The target is assumed to be %s endian\n"); + printf_unfiltered (msg, (TARGET_BYTE_ORDER == BIG_ENDIAN ? "big" : "little")); +} + +/* Called if the user enters \`\`set endian'' without an argument. */ +static void +set_endian (char *args, int from_tty) +{ + printf_unfiltered ("\"set endian\" must be followed by \"auto\", \"big\" or \"little\".\n"); + show_endian (args, from_tty); +} + +/* Called by \`\`set endian big''. */ +static void +set_endian_big (char *args, int from_tty) +{ + if (TARGET_BYTE_ORDER_SELECTABLE_P) + { + target_byte_order = BIG_ENDIAN; + target_byte_order_auto = 0; + if (GDB_MULTI_ARCH) + { + struct gdbarch_info info; + memset (&info, 0, sizeof info); + info.byte_order = BIG_ENDIAN; + gdbarch_update (info); + } + } + else + { + printf_unfiltered ("Byte order is not selectable."); + show_endian (args, from_tty); + } +} + +/* Called by \`\`set endian little''. */ +static void +set_endian_little (char *args, int from_tty) +{ + if (TARGET_BYTE_ORDER_SELECTABLE_P) + { + target_byte_order = LITTLE_ENDIAN; + target_byte_order_auto = 0; + if (GDB_MULTI_ARCH) + { + struct gdbarch_info info; + memset (&info, 0, sizeof info); + info.byte_order = LITTLE_ENDIAN; + gdbarch_update (info); + } + } + else + { + printf_unfiltered ("Byte order is not selectable."); + show_endian (args, from_tty); + } +} + +/* Called by \`\`set endian auto''. */ +static void +set_endian_auto (char *args, int from_tty) +{ + if (TARGET_BYTE_ORDER_SELECTABLE_P) + { + target_byte_order_auto = 1; + } + else + { + printf_unfiltered ("Byte order is not selectable."); + show_endian (args, from_tty); + } +} + +/* Set the endianness from a BFD. */ +static void +set_endian_from_file (bfd *abfd) +{ + if (TARGET_BYTE_ORDER_SELECTABLE_P) + { + int want; + + if (bfd_big_endian (abfd)) + want = BIG_ENDIAN; + else + want = LITTLE_ENDIAN; + if (TARGET_BYTE_ORDER_AUTO) + target_byte_order = want; + else if (TARGET_BYTE_ORDER != want) + warning ("%s endian file does not match %s endian target.", + want == BIG_ENDIAN ? "big" : "little", + TARGET_BYTE_ORDER == BIG_ENDIAN ? "big" : "little"); + } + else + { + if (bfd_big_endian (abfd) + ? TARGET_BYTE_ORDER != BIG_ENDIAN + : TARGET_BYTE_ORDER == BIG_ENDIAN) + warning ("%s endian file does not match %s endian target.", + bfd_big_endian (abfd) ? "big" : "little", + TARGET_BYTE_ORDER == BIG_ENDIAN ? "big" : "little"); + } +} + + + +/* Functions to manipulate the architecture of the target */ + +enum set_arch { set_arch_auto, set_arch_manual }; + +int target_architecture_auto = 1; +extern const struct bfd_arch_info bfd_default_arch_struct; +const struct bfd_arch_info *target_architecture = &bfd_default_arch_struct; +int (*target_architecture_hook) (const struct bfd_arch_info *ap); + +static void show_endian (char *, int); +static void set_endian (char *, int); +static void set_endian_big (char *, int); +static void set_endian_little (char *, int); +static void set_endian_auto (char *, int); +static void set_endian_from_file (bfd *); +static int arch_ok (const struct bfd_arch_info *arch); +static void set_arch (const struct bfd_arch_info *arch, enum set_arch type); +static void show_architecture (char *, int); +static void set_architecture (char *, int); +static void info_architecture (char *, int); +static void set_architecture_from_file (bfd *); + +/* Do the real work of changing the current architecture */ + +static int +arch_ok (const struct bfd_arch_info *arch) +{ + /* Should be performing the more basic check that the binary is + compatible with GDB. */ + /* Check with the target that the architecture is valid. */ + return (target_architecture_hook == NULL + || target_architecture_hook (arch)); +} + +static void +set_arch (const struct bfd_arch_info *arch, + enum set_arch type) +{ + switch (type) + { + case set_arch_auto: + if (!arch_ok (arch)) + warning ("Target may not support %s architecture", + arch->printable_name); + target_architecture = arch; + break; + case set_arch_manual: + if (!arch_ok (arch)) + { + printf_unfiltered ("Target does not support \`%s' architecture.\n", + arch->printable_name); + } + else + { + target_architecture_auto = 0; + target_architecture = arch; + } + break; + } + if (gdbarch_debug) + gdbarch_dump (); +} + +/* Called if the user enters \`\`show architecture'' without an argument. */ +static void +show_architecture (char *args, int from_tty) +{ + const char *arch; + arch = TARGET_ARCHITECTURE->printable_name; + if (target_architecture_auto) + printf_filtered ("The target architecture is set automatically (currently %s)\n", arch); + else + printf_filtered ("The target architecture is assumed to be %s\n", arch); +} + +/* Called if the user enters \`\`set architecture'' with or without an + argument. */ +static void +set_architecture (char *args, int from_tty) +{ + if (args == NULL) + { + printf_unfiltered ("\"set architecture\" must be followed by \"auto\" or an architecture name.\n"); + } + else if (strcmp (args, "auto") == 0) + { + target_architecture_auto = 1; + } + else if (GDB_MULTI_ARCH) + { + const struct bfd_arch_info *arch = bfd_scan_arch (args); + if (arch == NULL) + printf_unfiltered ("Architecture \`%s' not reconized.\n", args); + else + { + struct gdbarch_info info; + memset (&info, 0, sizeof info); + info.bfd_arch_info = arch; + if (gdbarch_update (info)) + target_architecture_auto = 0; + else + printf_unfiltered ("Architecture \`%s' not reconized.\n", args); + } + } + else + { + const struct bfd_arch_info *arch = bfd_scan_arch (args); + if (arch != NULL) + set_arch (arch, set_arch_manual); + else + printf_unfiltered ("Architecture \`%s' not reconized.\n", args); + } +} + +/* Called if the user enters \`\`info architecture'' without an argument. */ +static void +info_architecture (char *args, int from_tty) +{ + enum bfd_architecture a; + if (GDB_MULTI_ARCH) + { + if (gdbarch_init_registrary != NULL) + { + struct gdbarch_init_registration *rego; + printf_filtered ("Available architectures are:\n"); + for (rego = gdbarch_init_registrary; + rego != NULL; + rego = rego->next) + { + const struct bfd_arch_info *ap; + ap = bfd_lookup_arch (rego->bfd_architecture, 0); + if (ap != NULL) + { + do + { + printf_filtered (" %s", ap->printable_name); + ap = ap->next; + } + while (ap != NULL); + printf_filtered ("\n"); + } + } + } + else + { + printf_filtered ("There are no available architectures.\n"); + } + return; + } + printf_filtered ("Available architectures are:\n"); + for (a = bfd_arch_obscure + 1; a < bfd_arch_last; a++) + { + const struct bfd_arch_info *ap = bfd_lookup_arch (a, 0); + if (ap != NULL) + { + do + { + printf_filtered (" %s", ap->printable_name); + ap = ap->next; + } + while (ap != NULL); + printf_filtered ("\n"); + } + } +} + +/* Set the architecture from arch/machine */ +void +set_architecture_from_arch_mach (arch, mach) + enum bfd_architecture arch; + unsigned long mach; +{ + const struct bfd_arch_info *wanted = bfd_lookup_arch (arch, mach); + if (wanted != NULL) + set_arch (wanted, set_arch_manual); + else + internal_error ("gdbarch: hardwired architecture/machine not reconized"); +} + +/* Set the architecture from a BFD */ +static void +set_architecture_from_file (bfd *abfd) +{ + const struct bfd_arch_info *wanted = bfd_get_arch_info (abfd); + if (target_architecture_auto) + { + set_arch (wanted, set_arch_auto); + } + else if (wanted != target_architecture) + { + warning ("%s architecture file may be incompatible with %s target.", + wanted->printable_name, + target_architecture->printable_name); + } +} + + +/* Misc helper functions for targets. */ + +int +frame_num_args_unknown (fi) + struct frame_info *fi; +{ + return -1; +} + + +int +generic_register_convertible_not (num) + int num; +{ + return 0; +} + +/* Disassembler */ + +/* Pointer to the target-dependent disassembly function. */ +int (*tm_print_insn) (bfd_vma, disassemble_info *); +disassemble_info tm_print_insn_info; + + + +/* Set the dynamic target-system-dependant parameters (architecture, + byte-order) using information found in the BFD */ + +void +set_gdbarch_from_file (abfd) + bfd *abfd; +{ + if (GDB_MULTI_ARCH) + { + struct gdbarch_info info; + memset (&info, 0, sizeof info); + info.abfd = abfd; + gdbarch_update (info); + return; + } + set_architecture_from_file (abfd); + set_endian_from_file (abfd); +} + + +#if defined (CALL_DUMMY) +/* FIXME - this should go away */ +LONGEST call_dummy_words[] = CALL_DUMMY; +int sizeof_call_dummy_words = sizeof (call_dummy_words); +#endif + + +extern void _initialize_gdbarch (void); +void +_initialize_gdbarch () +{ + add_prefix_cmd ("endian", class_support, set_endian, + "Set endianness of target.", + &endianlist, "set endian ", 0, &setlist); + add_cmd ("big", class_support, set_endian_big, + "Set target as being big endian.", &endianlist); + add_cmd ("little", class_support, set_endian_little, + "Set target as being little endian.", &endianlist); + add_cmd ("auto", class_support, set_endian_auto, + "Select target endianness automatically.", &endianlist); + add_cmd ("endian", class_support, show_endian, + "Show endianness of target.", &showlist); + + add_cmd ("architecture", class_support, set_architecture, + "Set architecture of target.", &setlist); + add_alias_cmd ("processor", "architecture", class_support, 1, &setlist); + add_cmd ("architecture", class_support, show_architecture, + "Show architecture of target.", &showlist); + add_cmd ("architecture", class_support, info_architecture, + "List supported target architectures", &infolist); + + INIT_DISASSEMBLE_INFO_NO_ARCH (tm_print_insn_info, gdb_stdout, (fprintf_ftype)fprintf_filtered); + tm_print_insn_info.flavour = bfd_target_unknown_flavour; + tm_print_insn_info.read_memory_func = dis_asm_read_memory; + tm_print_insn_info.memory_error_func = dis_asm_memory_error; + tm_print_insn_info.print_address_func = dis_asm_print_address; + + add_show_from_set (add_set_cmd ("archdebug", + class_maintenance, + var_zinteger, + (char *)&gdbarch_debug, + "Set architecture debugging.\n\\ +When non-zero, architecture debugging is enabled.", &setlist), + &showlist); +} +EOF + +# close things off +exec 1>&2 +#../move-if-change new-gdbarch.c gdbarch.c +if ! test -r gdbarch.c +then + echo "gdbarch.c missing? cp new-gdbarch.c gdbarch.c" 1>&2 +elif diff -c gdbarch.c new-gdbarch.c +then + echo "gdbarch.c unchanged" 1>&2 +else + echo "gdbarch.c has changed? cp new-gdbarch.c gdbarch.c" 1>&2 +fi diff --git a/gdb/go32-nat.c b/gdb/go32-nat.c index 0c133bc..0601a0d 100644 --- a/gdb/go32-nat.c +++ b/gdb/go32-nat.c @@ -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> diff --git a/gdb/hp-psymtab-read.c b/gdb/hp-psymtab-read.c index 0d2b236..5f243c3 100644 --- a/gdb/hp-psymtab-read.c +++ b/gdb/hp-psymtab-read.c @@ -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 diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index 54fbf99..2fdff8a 100644 --- a/gdb/hppa-tdep.c +++ b/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. */ diff --git a/gdb/hpux-thread.c b/gdb/hpux-thread.c index 5064d68..8d70bd8 100644 --- a/gdb/hpux-thread.c +++ b/gdb/hpux-thread.c @@ -40,7 +40,6 @@ #include "target.h" #include "inferior.h" #include <fcntl.h> -#include <unistd.h> #include <sys/stat.h> #include "gdbcore.h" diff --git a/gdb/i386-stub.c b/gdb/i386-stub.c index b05170b..d453fca 100644 --- a/gdb/i386-stub.c +++ b/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; - - 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 (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]; + } + } } - } 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 diff --git a/gdb/inferior.h b/gdb/inferior.h index 7326f19..4f5daf4 100644 --- a/gdb/inferior.h +++ b/gdb/inferior.h @@ -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)); diff --git a/gdb/inflow.c b/gdb/inflow.c index da25bd4..02b5be2 100644 --- a/gdb/inflow.c +++ b/gdb/inflow.c @@ -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 diff --git a/gdb/infrun.c b/gdb/infrun.c index a227c7a..1527ed9 100644 --- a/gdb/infrun.c +++ b/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; + prepare_to_wait (ecs); + return; - /* 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. */ + } /* extra brace, to preserve old indentation */ - 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; - return; - } + 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 ()); +} - /* Former breaks in the main loop goto here. */ -wfi_break: +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 (); -stop_stepping: + 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. diff --git a/gdb/inftarg.c b/gdb/inftarg.c index 96fb3d9..0b7167d 100644 --- a/gdb/inftarg.c +++ b/gdb/inftarg.c @@ -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)); diff --git a/gdb/infttrace.c b/gdb/infttrace.c index 3e94e81..626d813 100644 --- a/gdb/infttrace.c +++ b/gdb/infttrace.c @@ -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; diff --git a/gdb/language.h b/gdb/language.h index 0ead9f8..9484e0b 100644 --- a/gdb/language.h +++ b/gdb/language.h @@ -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. */ diff --git a/gdb/m32r-stub.c b/gdb/m32r-stub.c index d4d8842..56ae5ef 100644 --- a/gdb/m32r-stub.c +++ b/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; + /* 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; - 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); - } + 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]; + } - 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[0]; + } } - } } - } while (checksum != xmitcsum); } /* send the packet in buffer. */ diff --git a/gdb/m68k-stub.c b/gdb/m68k-stub.c index a7187eb..97adaba 100644 --- a/gdb/m68k-stub.c +++ b/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. @@ -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 - } -} diff --git a/gdb/maint.c b/gdb/maint.c index 10cf6bb..c257613 100644 --- a/gdb/maint.c +++ b/gdb/maint.c @@ -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)); diff --git a/gdb/pa64solib.h b/gdb/pa64solib.h index 5dbc5a5..e0e44f1 100644 --- a/gdb/pa64solib.h +++ b/gdb/pa64solib.h @@ -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. */ diff --git a/gdb/procfs.c b/gdb/procfs.c index 5d03c8b..9abda2e 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -46,7 +46,6 @@ #include "gdb_string.h" #include <stropts.h> #include <poll.h> -#include <unistd.h> #include "gdb_stat.h" #include "inferior.h" diff --git a/gdb/remote-rdp.c b/gdb/remote-rdp.c index 6701f74..ef45ca3 100644 --- a/gdb/remote-rdp.c +++ b/gdb/remote-rdp.c @@ -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; diff --git a/gdb/remote.c b/gdb/remote.c index 5c8ca61..be285b6 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -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)); diff --git a/gdb/scm-lang.h b/gdb/scm-lang.h index 6056bcf..68ba2da 100644 --- a/gdb/scm-lang.h +++ b/gdb/scm-lang.h @@ -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)); diff --git a/gdb/ser-pipe.c b/gdb/ser-pipe.c index 4941845..04839f4 100644 --- a/gdb/ser-pipe.c +++ b/gdb/ser-pipe.c @@ -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" diff --git a/gdb/ser-tcp.c b/gdb/ser-tcp.c index 83a84fc..8e7da06 100644 --- a/gdb/ser-tcp.c +++ b/gdb/ser-tcp.c @@ -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> diff --git a/gdb/ser-unix.c b/gdb/ser-unix.c index c92567b..e477cd1 100644 --- a/gdb/ser-unix.c +++ b/gdb/ser-unix.c @@ -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 diff --git a/gdb/sh-stub.c b/gdb/sh-stub.c index d2b0e18..dc7ec33 100644 --- a/gdb/sh-stub.c +++ b/gdb/sh-stub.c @@ -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; diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c index a613549..6c9ec45 100644 --- a/gdb/sol-thread.c +++ b/gdb/sol-thread.c @@ -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" diff --git a/gdb/solib.c b/gdb/solib.c index cfb230d..7f2f8ca 100644 --- a/gdb/solib.c +++ b/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); diff --git a/gdb/solib.h b/gdb/solib.h index 9268b67..bb5f5fc 100644 --- a/gdb/solib.h +++ b/gdb/solib.h @@ -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. */ diff --git a/gdb/somsolib.h b/gdb/somsolib.h index 0784b86..843ad85 100644 --- a/gdb/somsolib.h +++ b/gdb/somsolib.h @@ -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. */ diff --git a/gdb/source.c b/gdb/source.c index 3e36b1d..7982529 100644 --- a/gdb/source.c +++ b/gdb/source.c @@ -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" diff --git a/gdb/sparc-stub.c b/gdb/sparc-stub.c index 5769b25..8e88e56 100644 --- a/gdb/sparc-stub.c +++ b/gdb/sparc-stub.c @@ -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"); diff --git a/gdb/sparcl-stub.c b/gdb/sparcl-stub.c index bc508b3..4f04b97 100644 --- a/gdb/sparcl-stub.c +++ b/gdb/sparcl-stub.c @@ -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"); diff --git a/gdb/sparcl-tdep.c b/gdb/sparcl-tdep.c index d6fa160..b6ea064 100644 --- a/gdb/sparcl-tdep.c +++ b/gdb/sparcl-tdep.c @@ -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> diff --git a/gdb/sparclet-stub.c b/gdb/sparclet-stub.c index effc67f..8415aa5 100644 --- a/gdb/sparclet-stub.c +++ b/gdb/sparclet-stub.c @@ -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"); diff --git a/gdb/symfile.c b/gdb/symfile.c index b5d2821..ce9a609 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -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 diff --git a/gdb/tahoe-tdep.c b/gdb/tahoe-tdep.c index bbbb7b5..32b5e6f 100644 --- a/gdb/tahoe-tdep.c +++ b/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 } */ diff --git a/gdb/target.c b/gdb/target.c index d0b9482..07df980 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -1885,9 +1885,9 @@ normal_pid_to_str (pid) static char buf[30]; if (STREQ (current_target.to_shortname, "remote")) - sprintf (buf, "thread %d\0", pid); + sprintf (buf, "thread %d", pid); else - sprintf (buf, "process %d\0", pid); + sprintf (buf, "process %d", pid); return buf; } @@ -2086,9 +2086,9 @@ debug_to_fetch_registers (regno) fprintf_unfiltered (gdb_stdlog, "target_fetch_registers (%s)", regno != -1 ? REGISTER_NAME (regno) : "-1"); if (regno != -1) - fprintf_unfiltered (gdb_stdlog, " = 0x%x %d", + fprintf_unfiltered (gdb_stdlog, " = 0x%lx %ld", (unsigned long) read_register (regno), - read_register (regno)); + (unsigned long) read_register (regno)); fprintf_unfiltered (gdb_stdlog, "\n"); } @@ -2099,7 +2099,7 @@ debug_to_store_registers (regno) debug_target.to_store_registers (regno); if (regno >= 0 && regno < NUM_REGS) - fprintf_unfiltered (gdb_stdlog, "target_store_registers (%s) = 0x%x %d\n", + fprintf_unfiltered (gdb_stdlog, "target_store_registers (%s) = 0x%lx %ld\n", REGISTER_NAME (regno), (unsigned long) read_register (regno), (unsigned long) read_register (regno)); @@ -2171,8 +2171,9 @@ debug_to_insert_breakpoint (addr, save) retval = debug_target.to_insert_breakpoint (addr, save); fprintf_unfiltered (gdb_stdlog, - "target_insert_breakpoint (0x%x, xxx) = %d\n", - (unsigned long) addr, retval); + "target_insert_breakpoint (0x%lx, xxx) = %ld\n", + (unsigned long) addr, + (unsigned long) retval); return retval; } @@ -2186,8 +2187,9 @@ debug_to_remove_breakpoint (addr, save) retval = debug_target.to_remove_breakpoint (addr, save); fprintf_unfiltered (gdb_stdlog, - "target_remove_breakpoint (0x%x, xxx) = %d\n", - (unsigned long) addr, retval); + "target_remove_breakpoint (0x%lx, xxx) = %ld\n", + (unsigned long) addr, + (unsigned long) retval); return retval; } diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 61f62aa..aa1d60b 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,44 @@ +1999-08-25 Stan Shebs <shebs@andros.cygnus.com> + + * gdb.base/ending-run.exp: Add Solaris case for what happens when + stepping out of main. + + * gdb.c++/derivation.exp: XFAIL inf fn calls for all configs, if + G++ used. + + * gdb.c++/local.exp: Expect ptype NestedInnerLocal to succeed + always, expect ptype InnerLocal::NestedInnerLocal to fail always. + + * gdb.c++/ovldbreak.exp: Update match string in test that + includes a warning of multiple breakpoints. + +1999-08-24 Stan Shebs <shebs@andros.cygnus.com> + + * gdb.base/display.exp: Improve precision of step-after-finish + added yesterday. + + * gdb.base/signals.exp: Add extra wildcard to "handle all print" + test. + + * gdb.c++/classes.exp: XFAIL HP-compiler-only tests for all + configs when using G++, not just hppa*. + +1999-08-24 Elena Zannoni <ezannoni@kwikemart.cygnus.com> + + * gdb.base/async.c: New file. + * gdb.base/async.exp: New file. + +Tue Aug 24 03:24:53 1999 Jeffrey A Law (law@cygnus.com) + + * gdb.base/break.exp: Tweak PA specific tests to properly handle + PA64. + Mon Aug 23 10:25:20 1999 Jeffrey A Law (law@cygnus.com) + * gdb.base/display.exp: "finish" can leave us mid-line on many + targets, deal with it. Add a small constant to main, instead of + 1000 since main+1000 may not be a valid address in the target. + * gdb.base/dollar.exp: Do not run for PA processors in wide mode on hpux11. diff --git a/gdb/testsuite/gdb.base/async.c b/gdb/testsuite/gdb.base/async.c new file mode 100644 index 0000000..0d9c875 --- /dev/null +++ b/gdb/testsuite/gdb.base/async.c @@ -0,0 +1,48 @@ + + +#ifdef PROTOTYPES +int +foo (void) +#else +int +foo () +#endif +{ + int x, y; + + x = 5; + y = 3; + + return x + y; +} + +#ifdef PROTOTYPES +int +main (void) +#else +int +main () +#endif +{ + int y, z; + + y = 2; + z = 9; + y = foo (); + z = y; + y = y + 2; + y = baz (); + return 0; +} + + +#ifdef PROTOTYPES +int +baz (void) +#else +int +baz () +#endif +{ + return 5; +} diff --git a/gdb/testsuite/gdb.base/async.exp b/gdb/testsuite/gdb.base/async.exp new file mode 100644 index 0000000..4a97f9c --- /dev/null +++ b/gdb/testsuite/gdb.base/async.exp @@ -0,0 +1,153 @@ +# Copyright (C) 1999 +# Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is 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. + +# Please email any bugs, comments, and/or additions to this file to: +# bug-gdb@prep.ai.mit.edu + + +if $tracelevel then { + strace $tracelevel +} + +# +# test running programs +# +set prms_id 0 +set bug_id 0 + +set testfile "async" +set srcfile ${testfile}.c +set binfile ${objdir}/${subdir}/${testfile} + +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } { + gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." +} + +if [get_compiler_info ${binfile}] { + return -1 +} + +######################################## +## +## Don't do any of these tests until we reach consensus on this file. +## +return 0 +######################################## + +set board [target_info name] +set current_target [target_info gdb_protocol] +if { $current_target == "remote" } { + unset_board_info "gdb_protocol" + set_board_info "gdb_protocol" "async" + } else { + return 0 + } + +gdb_exit +gdb_start +gdb_reinitialize_dir $srcdir/$subdir +gdb_load ${binfile} +if [target_info exists gdb_stub] { + gdb_step_for_stub; +} + +# +# set it up at a breakpoint so we can play with it +# +if ![runto_main] then { + perror "couldn't run to breakpoint" + continue +} + +gdb_test "break baz" "" "" + +# +# Make sure we get a 'completed' message when the target is done. +# +gdb_test "set display-exec-done on" "" "" + + +send_gdb "next&\n" +gdb_expect { + -re "^next&\r\n$gdb_prompt.*z = 9.*completed\.\r\n" { pass "next &" } + -re "$gdb_prompt.*completed\.$" { fail "next &" } + timeout { fail "(timeout) next &" } +} + +send_gdb "step&\n" +gdb_expect { + -re "^step&\r\n$gdb_prompt.*y = foo \\(\\).*completed\.\r\n" { pass "step &" } + -re "$gdb_prompt.*completed\.$" { fail "step &" } + timeout { fail "(timeout) step &" } +} + +send_gdb "step&\n" +gdb_expect { + -re "^step&\r\n$gdb_prompt foo \\(\\) at .*async.c.*x = 5.*completed\.\r\n" \ + { pass "step &" } + -re "$gdb_prompt.*completed\.$" { fail "step &" } + timeout { fail "(timeout) step &" } +} + +send_gdb "stepi&\n" +gdb_expect { + -re "^stepi&\r\n$gdb_prompt.*$hex.*x = 5.*completed\.\r\n" { pass "stepi &" } + -re "$gdb_prompt.*completed\.$" { fail "stepi &" } + timeout { fail "(timeout) stepi &" } +} + +send_gdb "nexti&\n" +gdb_expect { + -re "^nexti&\r\n$gdb_prompt.*y = 3.*completed\.\r\n" { pass "nexti &" } + -re "$gdb_prompt.*completed\.$" { fail "nexti &" } + timeout { fail "(timeout) nexti &" } +} + +send_gdb "finish&\n" +gdb_expect { + -re "^finish&\r\nRun till exit from #0 foo \\(\\) at.*async.c.*\r\n$gdb_prompt.*$hex in main \\(\\) at.*async.c.*y = foo \\(\\).*Value returned is.*= 8.*completed\.\r\n" \ + { pass "finish &" } + -re "$gdb_prompt.*completed\.$" { fail "finish &" } + timeout { fail "(timeout) finish &" } +} + +send_gdb "jump 33&\n" +gdb_expect { + -re "^jump 33&.*Continuing at $hex.*$gdb_prompt.*Breakpoint 2, baz \\(\\) at.*async.c.*return 5.*completed\.\r\n" \ + { pass "jump &" } + -re ".*$gdb_prompt.*completed\.$" { fail "jump &" } + timeout { fail "(timeout) jump &" } +} + +send_gdb "until 35&\n" +gdb_expect { + -re "^until 35&.*$gdb_prompt.*$hex in main \\(\\) at.*async.c.*y = baz \\(\\).*completed\.\r\n" \ + { pass "until &" } + -re "$gdb_prompt.*completed\.$" { fail "until &" } + timeout { fail "(timeout) until &" } +} + +gdb_test "set display-exec-done off" "" "" + +unset_board_info "gdb_protocol" +set_board_info "gdb_protocol" "remote" + + + + + + diff --git a/gdb/testsuite/gdb.base/break.exp b/gdb/testsuite/gdb.base/break.exp index 115cd80..454d08b 100644 --- a/gdb/testsuite/gdb.base/break.exp +++ b/gdb/testsuite/gdb.base/break.exp @@ -559,9 +559,10 @@ gdb_expect { if [istarget "hppa*-*-hpux*"] then { send_gdb "bt\n" gdb_expect { - -re "#0\[ \t\]*marker2.*:4\[49\]\r\n#1.*_sr4export.*$gdb_prompt $"\ + -re "#0\[ \t\]*0x\[0-9\]* in marker2.*:4\[49\]\r\n#1.*_sr4export.*$gdb_prompt $"\ {pass "backtrace while in called function"} - -re "#0\[ \t\]*marker2.*:4\[49\]\r\n#1.*function called from gdb.*$gdb_prompt $"\ + -re "#0\[ \t\]*0x\[0-9\]* in marker2.*:4\[49\]\r\n#1.*function called from gdb.*$gdb_prompt $"\ + {pass "backtrace while in called function"} -re "$gdb_prompt $"\ {fail "backtrace while in called function"} @@ -573,6 +574,8 @@ if [istarget "hppa*-*-hpux*"] then { {pass "finish from called function"} -re "Run till exit from .*marker2.* at .*4\[49\]\r\n.*function called from gdb.*$gdb_prompt $"\ {pass "finish from called function"} + -re "Run till exit from .*marker2.* at .*4\[49\]\r\n.*Value returned.*$gdb_prompt $"\ + {pass "finish from called function"} -re "$gdb_prompt $"\ {fail "finish from called function"} timeout {fail "(timeout) finish from called function"} diff --git a/gdb/testsuite/gdb.base/display.exp b/gdb/testsuite/gdb.base/display.exp index 98cd73c..7a3519e 100644 --- a/gdb/testsuite/gdb.base/display.exp +++ b/gdb/testsuite/gdb.base/display.exp @@ -130,7 +130,22 @@ gdb_test "c" ".*Breakpoint 4.*" "watch off" # Now the printf tests # -gdb_test "fin" ".*Run till exit.*Value returned is.*= 10.*" "finish" +# The "finish" command may leave us mid-line in the caller on some +# targets, including but not limited to the m68k, i386 & PA. So we +# have to arrange to step until we hit the line with the call to +# "do_vars". +send_gdb "finish\n" +gdb_expect { + -re ".*do_loops();.*$gdb_prompt $" { + send_gdb "step\n" + exp_continue + } + -re ".*do_vars.*$gdb_prompt $" { + pass "finish" + } + default { fail "finish" ; gdb_suppress_tests; } +} + gdb_test "s" ".*do_vars.*.*27.*" gdb_test "tb 37" ".*Breakpoint 5 a.*" gdb_test "c" ".*do_vars.*37.*37.*" @@ -165,7 +180,9 @@ gdb_test "p/0 j" ".*Item count other than 1 is meaningless.*" "p/0 j" gdb_test "p/s sum" ".*Format letter.*is meaningless.*" " no s" gdb_test "p/i sum" ".*Format letter.*is meaningless.*.*" "no i" gdb_test "p/a &sum" ".*= $hex.*<sum>.*" -gdb_test "p/a main+1000" ".*= $hex.*<.*>.*" +# If the constant below is larger than the length of main, then +# this test will (incorrectly) fail. So use a small number. +gdb_test "p/a main+4" ".*= $hex.*<.*>.*" gdb_test "p/a \$pc" ".*= $hex.*<do_vars+.*>.*" gdb_test "p/a &&j" ".*A parse error.*" diff --git a/gdb/testsuite/gdb.base/dollar.exp b/gdb/testsuite/gdb.base/dollar.exp index 1efb9c9..a7a977e 100644 --- a/gdb/testsuite/gdb.base/dollar.exp +++ b/gdb/testsuite/gdb.base/dollar.exp @@ -34,7 +34,7 @@ if ![ istarget "*-*-hpux*" ] then { # When we are in "wide" mode we do not necessary have $$dyncall as a symbol # name, which makes all these tests useless -if ![ istarget "hppa*w-*-hpux11*" ] then { +if [ istarget "hppa*w-*-hpux11*" ] then { return } diff --git a/gdb/testsuite/gdb.base/ending-run.exp b/gdb/testsuite/gdb.base/ending-run.exp index 790a98c..d67af48 100644 --- a/gdb/testsuite/gdb.base/ending-run.exp +++ b/gdb/testsuite/gdb.base/ending-run.exp @@ -141,6 +141,10 @@ gdb_expect { -re ".*in.*start.*$gdb_prompt $" { pass "step out of main" } + -re ".*in .nope ().*$gdb_prompt $" { + # This is what happens on Solaris currently -sts 1999-08-25 + pass "step out of main on Solaris" + } -re ".*in.*\\\$START\\\$.*from.*dld.sl.*$gdb_prompt $" { pass "step out of main" } diff --git a/gdb/testsuite/gdb.base/signals.exp b/gdb/testsuite/gdb.base/signals.exp index ad875cc..adbb95b 100644 --- a/gdb/testsuite/gdb.base/signals.exp +++ b/gdb/testsuite/gdb.base/signals.exp @@ -347,7 +347,7 @@ proc test_handle_all_print {} { || [istarget "*-*-mach*"] ) } { gdb_test "handle all print" "Signal\[ \]+Stop\[ \]+Print\[ \]+Pass to program\[ \]+Description\r\nSIGHUP\[ \]+Yes\[ \]+Yes\[ \]+Yes\[ \]+Hangup.*SIG63\[ \]+Yes\[ \]+Yes\[ \]+Yes\[ \]+Real-time event 63.*EXC_BREAKPOINT\[ \]+Yes\[ \]+Yes\[ \]+Yes\[ \]+Breakpoint" } else { - gdb_test "handle all print" "Signal\[ \]+Stop\[ \]+Print\[ \]+Pass to program\[ \]+Description\r\nSIGHUP\[ \]+Yes\[ \]+Yes\[ \]+Yes\[ \]+Hangup.*SIG63\[ \]+Yes\[ \]+Yes\[ \]+Yes\[ \]+Real-time event 63" + gdb_test "handle all print" "Signal\[ \]+Stop\[ \]+Print\[ \]+Pass to program\[ \]+Description\r\nSIGHUP\[ \]+Yes\[ \]+Yes\[ \]+Yes\[ \]+Hangup.*SIG63\[ \]+Yes\[ \]+Yes\[ \]+Yes\[ \]+Real-time event 63.*" } set timeout $oldtimeout verbose "Timeout restored to $timeout seconds" 2 diff --git a/gdb/testsuite/gdb.c++/classes.exp b/gdb/testsuite/gdb.c++/classes.exp index 445f2e6..cf6a2cd 100644 --- a/gdb/testsuite/gdb.c++/classes.exp +++ b/gdb/testsuite/gdb.c++/classes.exp @@ -844,7 +844,7 @@ gdb_expect { # ptype on the object # g++ is putting out the wrong debug info. This works with aCC -if {!$hp_aCC_compiler} {setup_xfail "hppa*-*-*"} +if {!$hp_aCC_compiler} {setup_xfail "*-*-*"} send_gdb "ptype obj_with_enum\n" gdb_expect { -re "type = class ClassWithEnum \\{\r\n\[ \t\]*public:\r\n\[ \t\]*(enum |)ClassWithEnum::PrivEnum priv_enum;\r\n\[ \t\]*int x;\r\n\\}\r\n$gdb_prompt $" { pass "ptype obj_with_enum" } @@ -853,7 +853,7 @@ gdb_expect { } # g++ is putting out the wrong debug info. This works with aCC -if {!$hp_aCC_compiler} {setup_xfail "hppa*-*-*"} +if {!$hp_aCC_compiler} {setup_xfail "*-*-*"} send_gdb "print (ClassWithEnum::PrivEnum) 42\n" gdb_expect { -re "\\$\[0-9\]* = yellow.*$gdb_prompt $" { pass "print (ClassWithEnum::PrivEnum) 42" } diff --git a/gdb/testsuite/gdb.c++/derivation.exp b/gdb/testsuite/gdb.c++/derivation.exp index 0ac4eca..31cdd6f 100644 --- a/gdb/testsuite/gdb.c++/derivation.exp +++ b/gdb/testsuite/gdb.c++/derivation.exp @@ -304,7 +304,10 @@ gdb_expect { timeout { fail "(timeout) print value of g_instance.c" } } -if { $gcc_compiled } { setup_xfail "hppa*-hp-hpux*" } +# The following cases always fail with g++ output, and should be fixed +# someday. -sts 1999-08-25 + +if { $gcc_compiled } { setup_xfail "*-*-*" } send_gdb "print g_instance.afoo()\n" gdb_expect { -re ".\[0-9\]* = 1.*$gdb_prompt $" { @@ -314,7 +317,7 @@ gdb_expect { timeout { fail "(timeout) print value of g_instance.afoo()" } } -if { $gcc_compiled } { setup_xfail "hppa*-hp-hpux*" } +if { $gcc_compiled } { setup_xfail "*-*-*" } send_gdb "print g_instance.bfoo()\n" gdb_expect { -re ".\[0-9\]* = 2.*$gdb_prompt $" { @@ -324,7 +327,7 @@ gdb_expect { timeout { fail "(timeout) print value of g_instance.bfoo()" } } -if { $gcc_compiled } { setup_xfail "hppa*-hp-hpux*" } +if { $gcc_compiled } { setup_xfail "*-*-*" } send_gdb "print g_instance.cfoo()\n" gdb_expect { -re ".\[0-9\]* = 3.*$gdb_prompt $" { diff --git a/gdb/testsuite/gdb.c++/local.exp b/gdb/testsuite/gdb.c++/local.exp index 0335796..66b6d63 100644 --- a/gdb/testsuite/gdb.c++/local.exp +++ b/gdb/testsuite/gdb.c++/local.exp @@ -116,11 +116,6 @@ gdb_expect { timeout { fail "(timeout) ptype InnerLocal" } } - -if {$gcc_compiled} then { -setup_xfail "*-*-*" -} - send_gdb "ptype NestedInnerLocal\n" gdb_expect { -re "type = class InnerLocal::NestedInnerLocal \{\r\n\[\t \]*public:\r\n\[\t \]*int nil;\r\n\r\n\[\t \]*.int nil_foo\\(int\\);\r\n\[\t \]*\}\[\t \]*\\(Local at.*local\\.cc:44\\).*$gdb_prompt $" { pass "ptype NestedInnerLocal" } @@ -135,7 +130,7 @@ gdb_expect { # gdb incorrectly interprets the NestedInnerLocal in # InnerLocal::NestedInnerLocal as field name instead of a type name; # See CLLbs14784. -setup_xfail hppa*-*-* CLLbs14784 +setup_xfail *-*-* CLLbs14784 send_gdb "ptype InnerLocal::NestedInnerLocal\n" gdb_expect { -re "type = class InnerLocal::NestedInnerLocal \{\r\n\[\t \]*public:\r\n\[\t \]*int nil;\r\n\r\n\[\t \]*.int nil_foo\\(int\\);\r\n\[\t \]*\}\[\t \]*\\(Local at.*local\\.cc:44\\).*$gdb_prompt $" { pass "ptype InnerLocal::NestedInnerLocal" } diff --git a/gdb/testsuite/gdb.c++/ovldbreak.exp b/gdb/testsuite/gdb.c++/ovldbreak.exp index 219182b..34f2404 100644 --- a/gdb/testsuite/gdb.c++/ovldbreak.exp +++ b/gdb/testsuite/gdb.c++/ovldbreak.exp @@ -521,7 +521,7 @@ gdb_expect { -re "\\\[0\\\] cancel\r\n\\\[1\\\] all\r\n\\\[2\\\] foo::overload1arg\\(double\\) at.*$srcfile:121\r\n\\\[3\\\] foo::overload1arg\\(float\\) at.*$srcfile:120\r\n\\\[4\\\] foo::overload1arg\\(unsigned long\\) at.*$srcfile:119\r\n\\\[5\\\] foo::overload1arg\\(long\\) at.*$srcfile:118\r\n\\\[6\\\] foo::overload1arg\\(unsigned int\\) at.*$srcfile:117\r\n\\\[7\\\] foo::overload1arg\\(int\\) at.*$srcfile:116\r\n\\\[8\\\] foo::overload1arg\\(unsigned short\\) at.*$srcfile:115\r\n\\\[9\\\] foo::overload1arg\\(short\\) at.*$srcfile:114\r\n\\\[10\\\] foo::overload1arg\\(unsigned char\\) at.*$srcfile:113\r\n\\\[11\\\] foo::overload1arg\\(signed char\\) at.*$srcfile:112\r\n\\\[12\\\] foo::overload1arg\\(char\\) at.*$srcfile:111\r\n\\\[13\\\] foo::overload1arg\\(void\\) at.*$srcfile:110\r\n> $" { send_gdb "1\n" gdb_expect { - -re "Breakpoint $decimal at $hex: file.*$srcfile, line 121.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 120.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 119.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 118.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 117.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 116.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 115.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 114.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 113.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 112.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 111.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 110.\r\nMultiple breakpoints were set.\r\nUse the .delete. command to delete unwanted breakpoints.\r\n$gdb_prompt $" { + -re "Breakpoint $decimal at $hex: file.*$srcfile, line 121.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 120.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 119.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 118.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 117.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 116.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 115.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 114.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 113.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 112.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 111.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 110.\r\nwarning: Multiple breakpoints were set.\r\nwarning: Use the .delete. command to delete unwanted breakpoints.\r\n$gdb_prompt $" { pass "set bp on all overload1arg()" } -re ".*$gdb_prompt $" { fail "set bp on all overload1arg() wrong bp reply" } @@ -43,9 +43,6 @@ #undef savestring #include <sys/types.h> -#ifdef HAVE_UNISTD_H -#include <unistd.h> -#endif #include "event-loop.h" #include "gdb_string.h" @@ -152,10 +149,10 @@ static void disconnect PARAMS ((int)); static void source_cleanup PARAMS ((FILE *)); -/* 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))) +/* Default command line prompt. This is overriden in some configs. */ + +#ifndef DEFAULT_PROMPT +#define DEFAULT_PROMPT "(gdb) " #endif /* Initialization file name for gdb. This is overridden in some configs. */ @@ -3804,11 +3801,7 @@ init_main () we initialize the prompts differently. */ if (!async_p) { -#ifdef DEFAULT_PROMPT gdb_prompt_string = savestring (DEFAULT_PROMPT, strlen (DEFAULT_PROMPT)); -#else - gdb_prompt_string = savestring ("(gdb) ", 6); -#endif } else { @@ -3816,11 +3809,7 @@ init_main () whatever the DEFAULT_PROMPT is. */ the_prompts.top = 0; PREFIX (0) = ""; -#ifdef DEFAULT_PROMPT PROMPT (0) = savestring (DEFAULT_PROMPT, strlen (DEFAULT_PROMPT)); -#else - PROMPT (0) = savestring ("(gdb) ", 6); -#endif SUFFIX (0) = ""; /* Set things up for annotation_level > 1, if the user ever decides to use it. */ @@ -4102,4 +4091,12 @@ from the target.", &setlist), add_show_from_set (c, &showlist); c->function.sfunc = set_async_annotation_level; } + if (async_p) + { + add_show_from_set + (add_set_cmd ("exec-done-display", class_support, var_boolean, (char *) &exec_done_display_p, + "Set notification of completion for asynchronous execution commands.\n\ +Use \"on\" to enable the notification, and \"off\" to disable it.", &setlist), + &showlist); + } } diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index f4b41f4..988cb12 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -21,7 +21,6 @@ #include "defs.h" #include "symtab.h" #include "frame.h" -#include "tracepoint.h" #include "gdbtypes.h" #include "expression.h" #include "gdbcmd.h" @@ -29,6 +28,8 @@ #include "target.h" #include "language.h" #include "gdb_string.h" +#include "inferior.h" +#include "tracepoint.h" #include "ax.h" #include "ax-gdb.h" @@ -62,6 +63,15 @@ extern void (*readline_end_hook) PARAMS ((void)); extern void x_command PARAMS ((char *, int)); extern int addressprint; /* Print machine addresses? */ +/* GDB commands implemented in other modules: + */ + +extern void output_command PARAMS ((char *, int)); +extern void registers_info PARAMS ((char *, int)); +extern void args_info PARAMS ((char *, int)); +extern void locals_info PARAMS ((char *, int)); + + /* If this definition isn't overridden by the header files, assume that isatty and fileno exist on this system. */ #ifndef ISATTY @@ -140,12 +150,11 @@ static void trace_dump_command PARAMS ((char *, int)); /* support routines */ static void trace_mention PARAMS ((struct tracepoint *)); -#if __STDC__ struct collection_list; -#endif static void add_aexpr PARAMS ((struct collection_list *, struct agent_expr *)); static unsigned char *mem2hex (unsigned char *, unsigned char *, int); -static void add_register PARAMS ((struct collection_list * collection, unsigned long regno)); +static void add_register PARAMS ((struct collection_list * collection, + unsigned int regno)); static void free_actions_list PARAMS ((char **actions_list)); static void free_actions_list_cleanup_wrapper PARAMS ((void *)); @@ -184,6 +193,13 @@ trace_error (buf) } } +/* Entry points into remote.c (FIXME: move this interface down to tgt vector) + */ + +extern int putpkt PARAMS ((char *)); +extern void getpkt PARAMS ((char *, int)); +extern void remote_console_output PARAMS ((char *)); + /* Utility: wait for reply from stub, while accepting "O" packets */ static char * remote_get_noisy_reply (buf) @@ -532,12 +548,12 @@ tracepoints_info (tpnum_exp, from_tty) */ enum tracepoint_opcode { - enable, - disable, - delete + enable_op, + disable_op, + delete_op }; -/* This function implements enable, disable and delete. */ +/* This function implements enable, disable and delete commands. */ static void tracepoint_operation (t, from_tty, opcode) struct tracepoint *t; @@ -548,17 +564,17 @@ tracepoint_operation (t, from_tty, opcode) switch (opcode) { - case enable: + case enable_op: t->enabled = enabled; if (modify_tracepoint_hook) modify_tracepoint_hook (t); break; - case disable: + case disable_op: t->enabled = disabled; if (modify_tracepoint_hook) modify_tracepoint_hook (t); break; - case delete: + case delete_op: if (tracepoint_chain == t) tracepoint_chain = t->next; @@ -605,7 +621,7 @@ get_tracepoint_by_number (arg) /* Make a copy of the name, so we can null-terminate it to pass to lookup_internalvar(). */ end = *arg + 1; - while (isalnum (*end) || *end == '_') + while (isalnum ((int) *end) || *end == '_') end++; copy = (char *) alloca (end - *arg); strncpy (copy, *arg + 1, (end - *arg - 1)); @@ -622,7 +638,7 @@ get_tracepoint_by_number (arg) { tpnum = strtol (*arg, arg, 0); if (tpnum == 0) /* possible strtol failure */ - while (**arg && !isspace (**arg)) + while (**arg && !isspace ((int) **arg)) (*arg)++; /* advance to next white space, if any */ } ALL_TRACEPOINTS (t) @@ -642,8 +658,6 @@ map_args_over_tracepoints (args, from_tty, opcode) enum tracepoint_opcode opcode; { struct tracepoint *t, *tmp; - int tpnum; - char *cp; if (args == 0 || *args == 0) /* do them all */ ALL_TRACEPOINTS_SAFE (t, tmp) @@ -667,7 +681,7 @@ enable_trace_command (args, from_tty) int from_tty; { dont_repeat (); - map_args_over_tracepoints (args, from_tty, enable); + map_args_over_tracepoints (args, from_tty, enable_op); } /* The 'disable trace' command enables tracepoints. Not supported by all targets. */ @@ -677,7 +691,7 @@ disable_trace_command (args, from_tty) int from_tty; { dont_repeat (); - map_args_over_tracepoints (args, from_tty, disable); + map_args_over_tracepoints (args, from_tty, disable_op); } /* Remove a tracepoint (or all if no argument) */ @@ -693,7 +707,7 @@ delete_trace_command (args, from_tty) if (!query ("Delete all tracepoints? ")) return; - map_args_over_tracepoints (args, from_tty, delete); + map_args_over_tracepoints (args, from_tty, delete_op); } /* Set passcount for tracepoint. @@ -708,14 +722,14 @@ trace_pass_command (args, from_tty) int from_tty; { struct tracepoint *t1 = (struct tracepoint *) -1, *t2; - unsigned long count; + unsigned int count; if (args == 0 || *args == 0) error ("PASS command requires an argument (count + optional TP num)"); count = strtoul (args, &args, 10); /* count comes first, then TP num */ - while (*args && isspace (*args)) + while (*args && isspace ((int) *args)) args++; if (*args && strncasecmp (args, "all", 3) == 0) @@ -745,11 +759,6 @@ trace_pass_command (args, from_tty) /* Prototypes for action-parsing utility commands */ static void read_actions PARAMS ((struct tracepoint *)); -static char *parse_and_eval_memrange PARAMS ((char *, - CORE_ADDR, - long *, - bfd_signed_vma *, - long *)); /* The three functions: collect_pseudocommand, @@ -791,7 +800,6 @@ trace_actions_command (args, from_tty) int from_tty; { struct tracepoint *t; - char *actions; char tmpbuf[128]; char *end_msg = "End with a line saying just \"end\"."; @@ -926,11 +934,10 @@ validate_actionline (line, t) { struct cmd_list_element *c; struct expression *exp = NULL; - value_ptr temp, temp2; struct cleanup *old_chain = NULL; char *p; - for (p = *line; isspace (*p);) + for (p = *line; isspace ((int) *p);) p++; /* symbol lookup etc. */ @@ -955,14 +962,11 @@ validate_actionline (line, t) do { /* repeat over a comma-separated list */ QUIT; /* allow user to bail out with ^C */ - while (isspace (*p)) + while (isspace ((int) *p)) p++; if (*p == '$') /* look for special pseudo-symbols */ { - long typecode, size; - bfd_signed_vma offset; - if ((0 == strncasecmp ("reg", p + 1, 3)) || (0 == strncasecmp ("arg", p + 1, 3)) || (0 == strncasecmp ("loc", p + 1, 3))) @@ -980,7 +984,7 @@ validate_actionline (line, t) { if (SYMBOL_CLASS (exp->elts[2].symbol) == LOC_CONST) { - warning ("%s is constant (value %d): will not be collected.", + warning ("constant %s (value %ld) will not be collected.", SYMBOL_NAME (exp->elts[2].symbol), SYMBOL_VALUE (exp->elts[2].symbol)); return BADLINE; @@ -1022,14 +1026,14 @@ validate_actionline (line, t) { char *steparg; /* in case warning is necessary */ - while (isspace (*p)) + while (isspace ((int) *p)) p++; steparg = p; if (*p == '\0' || (t->step_count = strtol (p, &p, 0)) == 0) { - warning ("bad step-count: command ignored.", *line); + warning ("'%s': bad step-count; command ignored.", *line); return BADLINE; } return STEPPING; @@ -1062,7 +1066,7 @@ free_actions (t) struct memrange { - int type; /* 0 for absolute memory range, else basereg number */ + int type; /* 0 for absolute memory range, else basereg number */ bfd_signed_vma start; bfd_signed_vma end; }; @@ -1148,7 +1152,7 @@ memrange_sortmerge (memranges) static void add_register (collection, regno) struct collection_list *collection; - unsigned long regno; + unsigned int regno; { if (info_verbose) printf_filtered ("collect register %d\n", regno); @@ -1167,7 +1171,12 @@ add_memrange (memranges, type, base, len) unsigned long len; { if (info_verbose) - printf_filtered ("(%d,0x%x,%d)\n", type, base, len); + { + printf_filtered ("(%d,", type); + printf_vma (base); + printf_filtered (",%ld)\n", len); + } + /* type: 0 == memory, n == basereg */ memranges->list[memranges->next_memrange].type = type; /* base: addr if memory, offset if reg relative. */ @@ -1195,7 +1204,7 @@ collect_symbol (collect, sym, frame_regno, frame_offset) long frame_offset; { unsigned long len; - unsigned long reg; + unsigned int reg; bfd_signed_vma offset; len = TYPE_LENGTH (check_typedef (SYMBOL_TYPE (sym))); @@ -1206,14 +1215,19 @@ collect_symbol (collect, sym, frame_regno, frame_offset) SYMBOL_NAME (sym), SYMBOL_CLASS (sym)); break; case LOC_CONST: - printf_filtered ("%s is constant, value is %d: will not be collected.\n", + printf_filtered ("constant %s (value %ld) will not be collected.\n", SYMBOL_NAME (sym), SYMBOL_VALUE (sym)); break; case LOC_STATIC: offset = SYMBOL_VALUE_ADDRESS (sym); if (info_verbose) - printf_filtered ("LOC_STATIC %s: collect %d bytes at 0x%08x\n", - SYMBOL_NAME (sym), len, offset); + { + char tmp[40]; + + sprintf_vma (tmp, offset); + printf_filtered ("LOC_STATIC %s: collect %ld bytes at %s.\n", + SYMBOL_NAME (sym), len, tmp /* address */); + } add_memrange (collect, -1, offset, len); /* 0 == memory */ break; case LOC_REGISTER: @@ -1238,9 +1252,10 @@ collect_symbol (collect, sym, frame_regno, frame_offset) offset = frame_offset + SYMBOL_VALUE (sym); if (info_verbose) { - printf_filtered ("LOC_LOCAL %s: Collect %d bytes at offset", + printf_filtered ("LOC_LOCAL %s: Collect %ld bytes at offset ", SYMBOL_NAME (sym), len); - printf_filtered (" %d from frame ptr reg %d\n", offset, reg); + printf_vma (offset); + printf_filtered (" from frame ptr reg %d\n", reg); } add_memrange (collect, reg, offset, len); break; @@ -1249,9 +1264,10 @@ collect_symbol (collect, sym, frame_regno, frame_offset) offset = 0; if (info_verbose) { - printf_filtered ("LOC_REGPARM_ADDR %s: Collect %d bytes at offset", + printf_filtered ("LOC_REGPARM_ADDR %s: Collect %ld bytes at offset ", SYMBOL_NAME (sym), len); - printf_filtered (" %d from reg %d\n", offset, reg); + printf_vma (offset); + printf_filtered (" from reg %d\n", reg); } add_memrange (collect, reg, offset, len); break; @@ -1261,9 +1277,10 @@ collect_symbol (collect, sym, frame_regno, frame_offset) offset = frame_offset + SYMBOL_VALUE (sym); if (info_verbose) { - printf_filtered ("LOC_LOCAL %s: Collect %d bytes at offset", + printf_filtered ("LOC_LOCAL %s: Collect %ld bytes at offset ", SYMBOL_NAME (sym), len); - printf_filtered (" %d from frame ptr reg %d\n", offset, reg); + printf_vma (offset); + printf_filtered (" from frame ptr reg %d\n", reg); } add_memrange (collect, reg, offset, len); break; @@ -1273,8 +1290,10 @@ collect_symbol (collect, sym, frame_regno, frame_offset) offset = SYMBOL_VALUE (sym); if (info_verbose) { - printf_filtered ("LOC_BASEREG %s: collect %d bytes at offset %d from basereg %d\n", - SYMBOL_NAME (sym), len, offset, reg); + printf_filtered ("LOC_BASEREG %s: collect %ld bytes at offset ", + SYMBOL_NAME (sym), len); + printf_vma (offset); + printf_filtered (" from basereg %d\n", reg); } add_memrange (collect, reg, offset, len); break; @@ -1311,6 +1330,9 @@ add_local_symbols (collect, pc, frame_regno, frame_offset, type) sym = BLOCK_SYM (block, i); switch (SYMBOL_CLASS (sym)) { + default: + warning ("don't know how to trace local symbol %s", + SYMBOL_NAME (sym)); case LOC_LOCAL: case LOC_STATIC: case LOC_REGISTER: @@ -1367,6 +1389,7 @@ stringify_collection_list (list, string) char *string; { char temp_buf[2048]; + char tmp2[40]; int count; int ndx = 0; char *(*str_list)[]; @@ -1403,11 +1426,14 @@ stringify_collection_list (list, string) for (i = 0, count = 0, end = temp_buf; i < list->next_memrange; i++) { QUIT; /* allow user to bail out with ^C */ + sprintf_vma (tmp2, list->list[i].start); if (info_verbose) - printf_filtered ("(%d, 0x%x, %d)\n", - list->list[i].type, - list->list[i].start, - list->list[i].end - list->list[i].start); + { + printf_filtered ("(%d, %s, %ld)\n", + list->list[i].type, + tmp2, + (long) (list->list[i].end - list->list[i].start)); + } if (count + 27 > MAX_AGENT_EXPR_LEN) { (*str_list)[ndx] = savestring (temp_buf, count); @@ -1415,12 +1441,14 @@ stringify_collection_list (list, string) count = 0; end = temp_buf; } - sprintf (end, "M%X,%X,%X", + + sprintf (end, "M%X,%s,%lX", list->list[i].type, - list->list[i].start, - list->list[i].end - list->list[i].start); + tmp2, + (long) (list->list[i].end - list->list[i].start)); + count += strlen (end); - end += strlen (end); + end += count; } for (i = 0; i < list->next_aexpr_elt; i++) @@ -1489,8 +1517,7 @@ encode_actions (t, tdp_actions, stepping_actions) char *action_exp; struct expression *exp = NULL; struct action_line *action; - bfd_signed_vma offset; - long i; + int i; value_ptr tempval; struct collection_list *collect; struct cmd_list_element *cmd; @@ -1511,7 +1538,7 @@ encode_actions (t, tdp_actions, stepping_actions) { QUIT; /* allow user to bail out with ^C */ action_exp = action->action; - while (isspace (*action_exp)) + while (isspace ((int) *action_exp)) action_exp++; if (*action_exp == '#') /* comment line */ @@ -1526,7 +1553,7 @@ encode_actions (t, tdp_actions, stepping_actions) do { /* repeat over a comma-separated list */ QUIT; /* allow user to bail out with ^C */ - while (isspace (*action_exp)) + while (isspace ((int) *action_exp)) action_exp++; if (0 == strncasecmp ("$reg", action_exp, 4)) @@ -1691,7 +1718,7 @@ remote_set_transparent_ranges (void) strcpy (target_buf, "QTro"); for (s = exec_bfd->sections; s; s = s->next) { - char tmp[40]; + char tmp1[40], tmp2[40]; if ((s->flags & SEC_LOAD) == 0 || /* (s->flags & SEC_CODE) == 0 || */ @@ -1701,8 +1728,10 @@ remote_set_transparent_ranges (void) anysecs = 1; lma = s->lma; size = bfd_get_section_size_before_reloc (s); - sprintf (tmp, ":%x,%x", lma, lma + size); - strcat (target_buf, tmp); + sprintf_vma (tmp1, lma); + sprintf_vma (tmp2, lma + size); + sprintf (target_buf + strlen (target_buf), + ":%s,%s", tmp1, tmp2); } if (anysecs) { @@ -1741,11 +1770,10 @@ trace_start_command (args, from_tty) ALL_TRACEPOINTS (t) { - int ss_count; /* if actions include singlestepping */ - int disable_mask; /* ??? */ - int enable_mask; /* ??? */ + char tmp[40]; - sprintf (buf, "QTDP:%x:%x:%c:%x:%x", t->number, t->address, + sprintf_vma (tmp, t->address); + sprintf (buf, "QTDP:%x:%s:%c:%x:%x", t->number, tmp, /* address */ t->enabled == enabled ? 'E' : 'D', t->step_count, t->pass_count); @@ -1770,8 +1798,8 @@ trace_start_command (args, from_tty) for (ndx = 0; tdp_actions[ndx]; ndx++) { QUIT; /* allow user to bail out with ^C */ - sprintf (buf, "QTDP:-%x:%x:%s%c", - t->number, t->address, + sprintf (buf, "QTDP:-%x:%s:%s%c", + t->number, tmp, /* address */ tdp_actions[ndx], ((tdp_actions[ndx + 1] || stepping_actions) ? '-' : 0)); @@ -1786,8 +1814,8 @@ trace_start_command (args, from_tty) for (ndx = 0; stepping_actions[ndx]; ndx++) { QUIT; /* allow user to bail out with ^C */ - sprintf (buf, "QTDP:-%x:%x:%s%s%s", - t->number, t->address, + sprintf (buf, "QTDP:-%x:%s:%s%s%s", + t->number, tmp, /* address */ ((ndx == 0) ? "S" : ""), stepping_actions[ndx], (stepping_actions[ndx + 1] ? "-" : "")); @@ -1994,7 +2022,6 @@ trace_find_command (args, from_tty) { /* STUB_COMM PART_IMPLEMENTED */ /* this should only be called with a numeric argument */ int frameno = -1; - char *tmp; if (target_is_remote ()) { @@ -2064,7 +2091,7 @@ trace_find_pc_command (args, from_tty) int from_tty; { /* STUB_COMM PART_IMPLEMENTED */ CORE_ADDR pc; - char *tmp; + char tmp[40]; if (target_is_remote ()) { @@ -2073,7 +2100,8 @@ trace_find_pc_command (args, from_tty) else pc = parse_and_eval_address (args); - sprintf (target_buf, "QTFrame:pc:%x", pc); + sprintf_vma (tmp, pc); + sprintf (target_buf, "QTFrame:pc:%s", tmp); finish_tfind_command (target_buf, from_tty); } else @@ -2087,7 +2115,6 @@ trace_find_tracepoint_command (args, from_tty) int from_tty; { /* STUB_COMM PART_IMPLEMENTED */ int tdp; - char buf[40], *tmp; if (target_is_remote ()) { @@ -2122,8 +2149,8 @@ trace_find_line_command (args, from_tty) static CORE_ADDR start_pc, end_pc; struct symtabs_and_lines sals; struct symtab_and_line sal; - char *tmp; struct cleanup *old_chain; + char startpc_str[40], endpc_str[40]; if (target_is_remote ()) { @@ -2190,10 +2217,12 @@ trace_find_line_command (args, from_tty) error ("Line number %d is out of range for \"%s\".\n", sal.line, sal.symtab->filename); + sprintf_vma (startpc_str, start_pc); + sprintf_vma (endpc_str, end_pc - 1); if (args && *args) /* find within range of stated line */ - sprintf (target_buf, "QTFrame:range:%x:%x", start_pc, end_pc - 1); + sprintf (target_buf, "QTFrame:range:%s:%s", startpc_str, endpc_str); else /* find OUTSIDE OF range of CURRENT line */ - sprintf (target_buf, "QTFrame:outside:%x:%x", start_pc, end_pc - 1); + sprintf (target_buf, "QTFrame:outside:%s:%s", startpc_str, endpc_str); finish_tfind_command (target_buf, from_tty); do_cleanups (old_chain); } @@ -2206,14 +2235,15 @@ static void trace_find_range_command (args, from_tty) char *args; int from_tty; -{ /* STUB_COMM PART_IMPLEMENTED */ +{ static CORE_ADDR start, stop; + char start_str[40], stop_str[40]; char *tmp; if (target_is_remote ()) { if (args == 0 || *args == 0) - { /* XXX FIXME: what should default behavior be? */ + { /* XXX FIXME: what should default behavior be? */ printf_filtered ("Usage: tfind range <startaddr>,<endaddr>\n"); return; } @@ -2221,7 +2251,7 @@ trace_find_range_command (args, from_tty) if (0 != (tmp = strchr (args, ','))) { *tmp++ = '\0'; /* terminate start address */ - while (isspace (*tmp)) + while (isspace ((int) *tmp)) tmp++; start = parse_and_eval_address (args); stop = parse_and_eval_address (tmp); @@ -2232,7 +2262,9 @@ trace_find_range_command (args, from_tty) stop = start + 1; /* ??? */ } - sprintf (target_buf, "QTFrame:range:%x:%x", start, stop); + sprintf_vma (start_str, start); + sprintf_vma (stop_str, stop); + sprintf (target_buf, "QTFrame:range:%s:%s", start_str, stop_str); finish_tfind_command (target_buf, from_tty); } else @@ -2244,14 +2276,15 @@ static void trace_find_outside_command (args, from_tty) char *args; int from_tty; -{ /* STUB_COMM PART_IMPLEMENTED */ +{ CORE_ADDR start, stop; + char start_str[40], stop_str[40]; char *tmp; if (target_is_remote ()) { if (args == 0 || *args == 0) - { /* XXX FIXME: what should default behavior be? */ + { /* XXX FIXME: what should default behavior be? */ printf_filtered ("Usage: tfind outside <startaddr>,<endaddr>\n"); return; } @@ -2259,7 +2292,7 @@ trace_find_outside_command (args, from_tty) if (0 != (tmp = strchr (args, ','))) { *tmp++ = '\0'; /* terminate start address */ - while (isspace (*tmp)) + while (isspace ((int) *tmp)) tmp++; start = parse_and_eval_address (args); stop = parse_and_eval_address (tmp); @@ -2270,7 +2303,9 @@ trace_find_outside_command (args, from_tty) stop = start + 1; /* ??? */ } - sprintf (target_buf, "QTFrame:outside:%x:%x", start, stop); + sprintf_vma (start_str, start); + sprintf_vma (stop_str, stop); + sprintf (target_buf, "QTFrame:outside:%s:%s", start_str, stop_str); finish_tfind_command (target_buf, from_tty); } else @@ -2288,6 +2323,7 @@ tracepoint_save_command (args, from_tty) FILE *fp; char *i1 = " ", *i2 = " "; char *indent, *actionline; + char tmp[40]; if (args == 0 || *args == 0) error ("Argument required (file name in which to save tracepoints"); @@ -2306,7 +2342,10 @@ tracepoint_save_command (args, from_tty) if (tp->addr_string) fprintf (fp, "trace %s\n", tp->addr_string); else - fprintf (fp, "trace *0x%x\n", tp->address); + { + sprintf_vma (tmp, tp->address); + fprintf (fp, "trace *0x%s\n", tmp); + } if (tp->pass_count) fprintf (fp, " passcount %d\n", tp->pass_count); @@ -2321,7 +2360,7 @@ tracepoint_save_command (args, from_tty) QUIT; /* allow user to bail out with ^C */ actionline = line->action; - while (isspace (*actionline)) + while (isspace ((int) *actionline)) actionline++; fprintf (fp, "%s%s\n", indent, actionline); @@ -2350,7 +2389,6 @@ scope_info (args, from_tty) char *args; int from_tty; { - struct symtab_and_line sal; struct symtabs_and_lines sals; struct symbol *sym; struct minimal_symbol *msym; @@ -2394,7 +2432,7 @@ scope_info (args, from_tty) count--; /* don't count this one */ continue; case LOC_CONST: - printf_filtered ("a constant with value %d (0x%x)", + printf_filtered ("a constant with value %ld (0x%lx)", SYMBOL_VALUE (sym), SYMBOL_VALUE (sym)); break; case LOC_CONST_BYTES: @@ -2446,12 +2484,12 @@ scope_info (args, from_tty) gdb_stdout); break; case LOC_BASEREG: - printf_filtered ("a variable at offset %d from register $%s", + printf_filtered ("a variable at offset %ld from register $%s", SYMBOL_VALUE (sym), REGISTER_NAME (SYMBOL_BASEREG (sym))); break; case LOC_BASEREG_ARG: - printf_filtered ("an argument at offset %d from register $%s", + printf_filtered ("an argument at offset %ld from register $%s", SYMBOL_VALUE (sym), REGISTER_NAME (SYMBOL_BASEREG (sym))); break; @@ -2542,7 +2580,7 @@ trace_dump_command (args, from_tty) QUIT; /* allow user to bail out with ^C */ action_exp = action->action; - while (isspace (*action_exp)) + while (isspace ((int) *action_exp)) action_exp++; /* The collection actions to be done while stepping are @@ -2573,7 +2611,7 @@ trace_dump_command (args, from_tty) QUIT; /* allow user to bail out with ^C */ if (*action_exp == ',') action_exp++; - while (isspace (*action_exp)) + while (isspace ((int) *action_exp)) action_exp++; next_comma = strchr (action_exp, ','); diff --git a/gdb/utils.c b/gdb/utils.c index 314a831..ccb4489 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -21,9 +21,7 @@ #include "defs.h" #include <ctype.h> #include "gdb_string.h" -#ifdef HAVE_UNISTD_H -#include <unistd.h> -#endif +#include "event-loop.h" #ifdef HAVE_CURSES_H #include <curses.h> @@ -74,12 +72,6 @@ set_width_command PARAMS ((char *, int, struct cmd_list_element *)); static void set_width PARAMS ((void)); -/* 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 - #ifndef GDB_FILE_ISATTY #define GDB_FILE_ISATTY(GDB_FILE_PTR) (gdb_file_isatty(GDB_FILE_PTR)) #endif @@ -1670,6 +1662,23 @@ stdio_fileopen (file) /* A ``struct gdb_file'' that is compatible with all the legacy code. */ +/* 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; +}; + static gdb_file_flush_ftype tui_file_flush; extern gdb_file_fputs_ftype tui_file_fputs; static gdb_file_isatty_ftype tui_file_isatty; @@ -1759,6 +1768,86 @@ tui_file_put (file, dest) } } +/* 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 + } +} + GDB_FILE * gdb_file_init_astring (n) int n; @@ -3111,14 +3200,14 @@ get_cell () */ -static int thirty_two = 32; /* eliminate warning from compiler on 32-bit systems */ +/* eliminate warning from compiler on 32-bit systems */ +static int thirty_two = 32; char * -paddr (addr) - t_addr addr; +paddr (CORE_ADDR addr) { char *paddr_str = get_cell (); - switch (sizeof (t_addr)) + switch (TARGET_PTR_BIT / 8) { case 8: sprintf (paddr_str, "%08lx%08lx", @@ -3137,34 +3226,10 @@ paddr (addr) } char * -preg (reg) - t_reg reg; -{ - char *preg_str = get_cell (); - switch (sizeof (t_reg)) - { - case 8: - sprintf (preg_str, "%08lx%08lx", - (unsigned long) (reg >> thirty_two), (unsigned long) (reg & 0xffffffff)); - break; - case 4: - sprintf (preg_str, "%08lx", (unsigned long) reg); - break; - case 2: - sprintf (preg_str, "%04x", (unsigned short) (reg & 0xffff)); - break; - default: - sprintf (preg_str, "%lx", (unsigned long) reg); - } - return preg_str; -} - -char * -paddr_nz (addr) - t_addr addr; +paddr_nz (CORE_ADDR addr) { char *paddr_str = get_cell (); - switch (sizeof (t_addr)) + switch (TARGET_PTR_BIT / 8) { case 8: { @@ -3188,6 +3253,81 @@ paddr_nz (addr) return paddr_str; } +static void +decimal2str (char *paddr_str, char *sign, ULONGEST addr) +{ + /* steal code from valprint.c:print_decimal(). Should this worry + about the real size of addr as the above does? */ + unsigned long temp[3]; + int i = 0; + do + { + temp[i] = addr % (1000 * 1000 * 1000); + addr /= (1000 * 1000 * 1000); + i++; + } + while (addr != 0 && i < (sizeof (temp) / sizeof (temp[0]))); + switch (i) + { + case 1: + sprintf (paddr_str, "%s%lu", + sign, temp[0]); + break; + case 2: + sprintf (paddr_str, "%s%lu%09lu", + sign, temp[1], temp[0]); + break; + case 3: + sprintf (paddr_str, "%s%lu%09lu%09lu", + sign, temp[2], temp[1], temp[0]); + break; + default: + abort (); + } +} + +char * +paddr_u (CORE_ADDR addr) +{ + char *paddr_str = get_cell (); + decimal2str (paddr_str, "", addr); + return paddr_str; +} + +char * +paddr_d (LONGEST addr) +{ + char *paddr_str = get_cell (); + if (addr < 0) + decimal2str (paddr_str, "-", -addr); + else + decimal2str (paddr_str, "", addr); + return paddr_str; +} + +char * +preg (reg) + t_reg reg; +{ + char *preg_str = get_cell (); + switch (sizeof (t_reg)) + { + case 8: + sprintf (preg_str, "%08lx%08lx", + (unsigned long) (reg >> thirty_two), (unsigned long) (reg & 0xffffffff)); + break; + case 4: + sprintf (preg_str, "%08lx", (unsigned long) reg); + break; + case 2: + sprintf (preg_str, "%04x", (unsigned short) (reg & 0xffff)); + break; + default: + sprintf (preg_str, "%lx", (unsigned long) reg); + } + return preg_str; +} + char * preg_nz (reg) t_reg reg; diff --git a/gdb/value.h b/gdb/value.h index 453e934..5a92882 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -238,10 +238,8 @@ struct internalvar #include "gdbtypes.h" #include "expression.h" -#ifdef __STDC__ struct frame_info; struct fn_field; -#endif extern void print_address_demangle PARAMS ((CORE_ADDR, GDB_FILE *, int)); diff --git a/gdb/win32-nat.c b/gdb/win32-nat.c index eaac180..2ea46c8 100644 --- a/gdb/win32-nat.c +++ b/gdb/win32-nat.c @@ -49,7 +49,6 @@ #include "gdbthread.h" #include "gdbcmd.h" #include <sys/param.h> -#include <unistd.h> /* The ui's event loop. */ extern int (*ui_loop_hook) PARAMS ((int signo)); |