aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog2234
-rw-r--r--gdb/MAINTAINERS16
-rw-r--r--gdb/Makefile.in103
-rw-r--r--gdb/NEWS50
-rw-r--r--gdb/PROBLEMS59
-rw-r--r--gdb/README121
-rw-r--r--gdb/a29k-tdep.c1015
-rw-r--r--gdb/acconfig.h3
-rw-r--r--gdb/acinclude.m4110
-rw-r--r--gdb/aclocal.m4106
-rw-r--r--gdb/alpha-linux-tdep.c120
-rw-r--r--gdb/alpha-nat.c52
-rw-r--r--gdb/alpha-osf1-tdep.c73
-rw-r--r--gdb/alpha-tdep.c819
-rw-r--r--gdb/alpha-tdep.h125
-rw-r--r--gdb/alphabsd-nat.c10
-rw-r--r--gdb/alphafbsd-tdep.c33
-rw-r--r--gdb/alphanbsd-nat.c136
-rw-r--r--gdb/alphanbsd-tdep.c157
-rw-r--r--gdb/arc-tdep.c8
-rw-r--r--gdb/arch-utils.c30
-rw-r--r--gdb/arch-utils.h6
-rw-r--r--gdb/arm-tdep.c414
-rw-r--r--gdb/arm-tdep.h39
-rw-r--r--gdb/avr-tdep.c1374
-rw-r--r--gdb/bcache.c9
-rw-r--r--gdb/blockframe.c112
-rw-r--r--gdb/breakpoint.c351
-rw-r--r--gdb/builtin-regs.c77
-rw-r--r--gdb/builtin-regs.h35
-rw-r--r--gdb/c-exp.y32
-rw-r--r--gdb/c-lang.c24
-rw-r--r--gdb/cli-out.c10
-rw-r--r--gdb/cli/cli-cmds.c24
-rw-r--r--gdb/cli/cli-decode.c136
-rw-r--r--gdb/cli/cli-decode.h81
-rw-r--r--gdb/cli/cli-dump.c823
-rw-r--r--gdb/cli/cli-dump.h40
-rw-r--r--gdb/cli/cli-script.c51
-rw-r--r--gdb/command.h191
-rw-r--r--gdb/completer.c2
-rw-r--r--gdb/config.in6
-rw-r--r--gdb/config/a29k/a29k-udi.mt5
-rw-r--r--gdb/config/a29k/a29k.mt5
-rw-r--r--gdb/config/a29k/tm-a29k.h722
-rw-r--r--gdb/config/a29k/tm-vx29k.h230
-rw-r--r--gdb/config/a29k/vx29k.mt4
-rw-r--r--gdb/config/alpha/alpha-linux.mt2
-rw-r--r--gdb/config/alpha/alpha-osf1.mt2
-rw-r--r--gdb/config/alpha/nbsd.mh4
-rw-r--r--gdb/config/alpha/nbsd.mt3
-rw-r--r--gdb/config/alpha/nm-linux.h13
-rw-r--r--gdb/config/alpha/nm-nbsd.h33
-rw-r--r--gdb/config/alpha/nm-osf.h13
-rw-r--r--gdb/config/alpha/tm-alpha.h405
-rw-r--r--gdb/config/alpha/tm-alphalinux.h40
-rw-r--r--gdb/config/alpha/tm-fbsd.h15
-rw-r--r--gdb/config/alpha/tm-nbsd.h32
-rw-r--r--gdb/config/arc/tm-arc.h9
-rw-r--r--gdb/config/avr/avr.mt12
-rw-r--r--gdb/config/djgpp/README15
-rw-r--r--gdb/config/h8500/tm-h8500.h2
-rw-r--r--gdb/config/i386/fbsd.mh2
-rw-r--r--gdb/config/i386/i386gnu.mh6
-rw-r--r--gdb/config/i386/i386lynx.mh3
-rw-r--r--gdb/config/i386/i386v42mp.mh4
-rw-r--r--gdb/config/i386/nbsd.mt2
-rw-r--r--gdb/config/i386/nbsdelf.mt2
-rw-r--r--gdb/config/i386/nm-fbsd.h3
-rw-r--r--gdb/config/i386/nm-x86-64.h7
-rw-r--r--gdb/config/i386/tm-linux.h1
-rw-r--r--gdb/config/i386/x86-64linux.mt2
-rw-r--r--gdb/config/i960/tm-i960.h27
-rw-r--r--gdb/config/m32r/m32r.mt3
-rw-r--r--gdb/config/m68k/m68klynx.mh3
-rw-r--r--gdb/config/m68k/nbsd.mt2
-rw-r--r--gdb/config/m68k/sun3os4.mh2
-rw-r--r--gdb/config/m68k/tm-nbsd.h2
-rw-r--r--gdb/config/mcore/tm-mcore.h8
-rw-r--r--gdb/config/mips/vr5000.mt3
-rw-r--r--gdb/config/mn10200/tm-mn10200.h6
-rw-r--r--gdb/config/ns32k/nbsd.mt2
-rw-r--r--gdb/config/pa/hppabsd.mh2
-rw-r--r--gdb/config/pa/hppaosf.mh3
-rw-r--r--gdb/config/pa/hpux1020.mh6
-rw-r--r--gdb/config/pa/hpux11.mh6
-rw-r--r--gdb/config/pa/hpux11w.mh6
-rw-r--r--gdb/config/pa/tm-hppa.h13
-rw-r--r--gdb/config/powerpc/nbsd.mt2
-rw-r--r--gdb/config/powerpc/tm-ppc-eabi.h6
-rw-r--r--gdb/config/rs6000/rs6000lynx.mh3
-rw-r--r--gdb/config/rs6000/tm-rs6000.h3
-rw-r--r--gdb/config/s390/s390.mh6
-rw-r--r--gdb/config/s390/s390.mt2
-rw-r--r--gdb/config/s390/s390x.mt2
-rw-r--r--gdb/config/sparc/linux.mh2
-rw-r--r--gdb/config/sparc/sparclynx.mh3
-rw-r--r--gdb/config/sparc/sun4os4.mh2
-rw-r--r--gdb/config/sparc/tm-linux.h2
-rw-r--r--gdb/config/sparc/tm-sp64.h2
-rw-r--r--gdb/config/sparc/tm-sp64linux.h2
-rw-r--r--gdb/config/sparc/tm-sparc.h26
-rw-r--r--gdb/config/v850/tm-v850.h8
-rw-r--r--gdb/config/vax/tm-vax.h274
-rwxr-xr-xgdb/configure871
-rw-r--r--gdb/configure.host1
-rw-r--r--gdb/configure.in4
-rw-r--r--gdb/configure.tgt15
-rw-r--r--gdb/core-sol2.c2
-rw-r--r--gdb/corefile.c2
-rw-r--r--gdb/corelow.c5
-rw-r--r--gdb/cp-valprint.c15
-rw-r--r--gdb/cris-tdep.c49
-rw-r--r--gdb/d10v-tdep.c43
-rw-r--r--gdb/d30v-tdep.c7
-rw-r--r--gdb/dbxread.c69
-rw-r--r--gdb/defs.h223
-rw-r--r--gdb/doc/ChangeLog93
-rw-r--r--gdb/doc/gdb.texinfo836
-rw-r--r--gdb/doc/gdbint.texinfo832
-rw-r--r--gdb/dwarf2cfi.c7
-rw-r--r--gdb/dwarf2read.c563
-rw-r--r--gdb/eval.c32
-rw-r--r--gdb/event-top.c25
-rw-r--r--gdb/exec.c4
-rw-r--r--gdb/f-exp.y7
-rw-r--r--gdb/f-lang.c6
-rw-r--r--gdb/fbsd-proc.c173
-rw-r--r--gdb/findvar.c26
-rw-r--r--gdb/frame.c91
-rw-r--r--gdb/frame.h41
-rw-r--r--gdb/gcore.c19
-rw-r--r--gdb/gdb-events.c6
-rw-r--r--gdb/gdb-events.h3
-rwxr-xr-xgdb/gdb-events.sh8
-rw-r--r--gdb/gdbarch.c347
-rw-r--r--gdb/gdbarch.h109
-rwxr-xr-xgdb/gdbarch.sh132
-rw-r--r--gdb/gdbserver/Makefile.in40
-rw-r--r--gdb/gdbserver/config.in3
-rwxr-xr-xgdb/gdbserver/configure6
-rw-r--r--gdb/gdbserver/configure.in9
-rw-r--r--gdb/gdbserver/gdbreplay.c15
-rw-r--r--gdb/gdbserver/inferiors.c105
-rw-r--r--gdb/gdbserver/linux-arm-low.c22
-rw-r--r--gdb/gdbserver/linux-i386-low.c58
-rw-r--r--gdb/gdbserver/linux-ia64-low.c18
-rw-r--r--gdb/gdbserver/linux-low.c198
-rw-r--r--gdb/gdbserver/linux-low.h26
-rw-r--r--gdb/gdbserver/linux-m68k-low.c23
-rw-r--r--gdb/gdbserver/linux-mips-low.c23
-rw-r--r--gdb/gdbserver/linux-ppc-low.c24
-rw-r--r--gdb/gdbserver/linux-s390-low.c23
-rw-r--r--gdb/gdbserver/linux-sh-low.c18
-rw-r--r--gdb/gdbserver/linux-x86-64-low.c25
-rw-r--r--gdb/gdbserver/mem-break.c280
-rw-r--r--gdb/gdbserver/mem-break.h71
-rw-r--r--gdb/gdbserver/regcache.c57
-rw-r--r--gdb/gdbserver/regcache.h18
-rw-r--r--gdb/gdbserver/remote-utils.c124
-rw-r--r--gdb/gdbserver/server.c52
-rw-r--r--gdb/gdbserver/server.h71
-rw-r--r--gdb/gdbserver/target.c47
-rw-r--r--gdb/gdbserver/target.h141
-rw-r--r--gdb/gdbserver/utils.c4
-rw-r--r--gdb/gdbtypes.c174
-rw-r--r--gdb/gdbtypes.h17
-rw-r--r--gdb/gnu-nat.c130
-rw-r--r--gdb/gnu-v3-abi.c21
-rw-r--r--gdb/go32-nat.c6
-rw-r--r--gdb/gregset.h13
-rw-r--r--gdb/h8300-tdep.c7
-rw-r--r--gdb/h8500-tdep.c13
-rw-r--r--gdb/hppa-tdep.c34
-rw-r--r--gdb/hpread.c54
-rw-r--r--gdb/i386-linux-tdep.c4
-rw-r--r--gdb/i386-tdep.c9
-rw-r--r--gdb/i386gnu-nat.c22
-rw-r--r--gdb/i387-nat.c25
-rw-r--r--gdb/i960-tdep.c155
-rw-r--r--gdb/ia64-tdep.c11
-rw-r--r--gdb/infcmd.c31
-rw-r--r--gdb/inferior.h29
-rw-r--r--gdb/inflow.c7
-rw-r--r--gdb/infrun.c42
-rw-r--r--gdb/jv-exp.y5
-rw-r--r--gdb/kod.c14
-rw-r--r--gdb/language.c4
-rw-r--r--gdb/lin-lwp.c10
-rw-r--r--gdb/linespec.c4
-rw-r--r--gdb/linux-proc.c20
-rw-r--r--gdb/m2-exp.y5
-rw-r--r--gdb/m3-nat.c2
-rw-r--r--gdb/m68hc11-tdep.c3
-rw-r--r--gdb/m68klinux-nat.c2
-rw-r--r--gdb/maint.c12
-rw-r--r--gdb/mcore-tdep.c4
-rw-r--r--gdb/mdebugread.c49
-rw-r--r--gdb/mem-break.c12
-rw-r--r--gdb/mi/ChangeLog51
-rw-r--r--gdb/mi/mi-cmd-break.c5
-rw-r--r--gdb/mi/mi-cmd-disas.c604
-rw-r--r--gdb/mi/mi-cmd-stack.c2
-rw-r--r--gdb/mi/mi-cmd-var.c9
-rw-r--r--gdb/mi/mi-console.c9
-rw-r--r--gdb/mi/mi-main.c13
-rw-r--r--gdb/mi/mi-out.c10
-rw-r--r--gdb/mi/mi-parse.c7
-rw-r--r--gdb/minsyms.c46
-rw-r--r--gdb/mips-tdep.c227
-rw-r--r--gdb/mn10300-tdep.c9
-rw-r--r--gdb/monitor.c2
-rw-r--r--gdb/ocd.c2
-rw-r--r--gdb/p-exp.y17
-rw-r--r--gdb/p-lang.c37
-rw-r--r--gdb/p-lang.h3
-rw-r--r--gdb/p-typeprint.c8
-rw-r--r--gdb/p-valprint.c6
-rw-r--r--gdb/parse.c97
-rw-r--r--gdb/parser-defs.h23
-rw-r--r--gdb/ppc-bdm.c5
-rw-r--r--gdb/ppc-linux-nat.c29
-rw-r--r--gdb/ppc-linux-tdep.c108
-rw-r--r--gdb/ppc-tdep.h6
-rw-r--r--gdb/printcmd.c14
-rw-r--r--gdb/proc-api.c2
-rw-r--r--gdb/regcache.c34
-rw-r--r--gdb/regformats/reg-ppc.dat2
-rw-r--r--gdb/regformats/reg-x86-64.dat8
-rw-r--r--gdb/remote-adapt.c1524
-rw-r--r--gdb/remote-array.c13
-rw-r--r--gdb/remote-e7000.c24
-rw-r--r--gdb/remote-eb.c1088
-rw-r--r--gdb/remote-es.c4
-rw-r--r--gdb/remote-mips.c4
-rw-r--r--gdb/remote-mm.c1848
-rw-r--r--gdb/remote-os9k.c16
-rw-r--r--gdb/remote-rdi.c135
-rw-r--r--gdb/remote-rdp.c2
-rw-r--r--gdb/remote-st.c12
-rw-r--r--gdb/remote-udi.c1722
-rw-r--r--gdb/remote-utils.c2
-rw-r--r--gdb/remote-vxsparc.c4
-rw-r--r--gdb/remote.c6
-rw-r--r--gdb/rs6000-nat.c36
-rw-r--r--gdb/rs6000-tdep.c405
-rw-r--r--gdb/s390-tdep.c14
-rw-r--r--gdb/scm-lang.c2
-rw-r--r--gdb/ser-unix.h6
-rw-r--r--gdb/serial.c7
-rw-r--r--gdb/sh-tdep.c12
-rw-r--r--gdb/signals.c837
-rw-r--r--gdb/solib-legacy.c1
-rw-r--r--gdb/solib-svr4.c1
-rw-r--r--gdb/solib.c4
-rw-r--r--gdb/somread.c33
-rw-r--r--gdb/source.c43
-rw-r--r--gdb/sparc-nat.c30
-rw-r--r--gdb/sparc-tdep.c161
-rw-r--r--gdb/stabsread.c228
-rw-r--r--gdb/stack.c93
-rw-r--r--gdb/std-regs.c150
-rw-r--r--gdb/symfile.c38
-rw-r--r--gdb/symfile.h2
-rw-r--r--gdb/symmisc.c4
-rw-r--r--gdb/symtab.c230
-rw-r--r--gdb/symtab.h85
-rw-r--r--gdb/target.c54
-rw-r--r--gdb/target.h3
-rw-r--r--gdb/testsuite/ChangeLog266
-rw-r--r--gdb/testsuite/config/sid.exp4
-rw-r--r--gdb/testsuite/gdb.asm/Makefile.in5
-rw-r--r--gdb/testsuite/gdb.asm/asm-source.exp28
-rwxr-xr-xgdb/testsuite/gdb.asm/configure85
-rw-r--r--gdb/testsuite/gdb.asm/configure.in14
-rw-r--r--gdb/testsuite/gdb.asm/powerpc.inc46
-rw-r--r--gdb/testsuite/gdb.asm/sparc64.inc34
-rw-r--r--gdb/testsuite/gdb.base/annota1.exp2
-rw-r--r--gdb/testsuite/gdb.base/attach.exp33
-rw-r--r--gdb/testsuite/gdb.base/bar.c2
-rw-r--r--gdb/testsuite/gdb.base/baz.c2
-rw-r--r--gdb/testsuite/gdb.base/completion.exp10
-rw-r--r--gdb/testsuite/gdb.base/cvexpr.c156
-rw-r--r--gdb/testsuite/gdb.base/dbx.exp28
-rw-r--r--gdb/testsuite/gdb.base/default.exp99
-rw-r--r--gdb/testsuite/gdb.base/dump.c44
-rw-r--r--gdb/testsuite/gdb.base/dump.exp442
-rw-r--r--gdb/testsuite/gdb.base/ending-run.exp4
-rw-r--r--gdb/testsuite/gdb.base/foo.c2
-rw-r--r--gdb/testsuite/gdb.base/funcargs.c2
-rw-r--r--gdb/testsuite/gdb.base/funcargs.exp29
-rw-r--r--gdb/testsuite/gdb.base/gcore.exp2
-rw-r--r--gdb/testsuite/gdb.base/grbx.c2
-rw-r--r--gdb/testsuite/gdb.base/help.exp536
-rw-r--r--gdb/testsuite/gdb.base/list.exp12
-rw-r--r--gdb/testsuite/gdb.base/long_long.exp5
-rw-r--r--gdb/testsuite/gdb.base/maint.exp2
-rw-r--r--gdb/testsuite/gdb.base/opaque.exp4
-rw-r--r--gdb/testsuite/gdb.base/overlays.exp36
-rw-r--r--gdb/testsuite/gdb.base/ovlymgr.c12
-rw-r--r--gdb/testsuite/gdb.base/printcmds.exp19
-rw-r--r--gdb/testsuite/gdb.base/ptype.exp10
-rw-r--r--gdb/testsuite/gdb.base/relocate.c17
-rw-r--r--gdb/testsuite/gdb.base/relocate.exp108
-rw-r--r--gdb/testsuite/gdb.base/scope.exp5
-rw-r--r--gdb/testsuite/gdb.base/shlib-call.exp17
-rw-r--r--gdb/testsuite/gdb.base/step-test.exp28
-rw-r--r--gdb/testsuite/gdb.base/watchpoint.exp1
-rw-r--r--gdb/testsuite/gdb.base/whatis.exp5
-rw-r--r--gdb/testsuite/gdb.c++/classes.exp2
-rw-r--r--gdb/testsuite/gdb.c++/cplusfuncs.exp9
-rw-r--r--gdb/testsuite/gdb.c++/hang.H12
-rw-r--r--gdb/testsuite/gdb.c++/hang.exp128
-rw-r--r--gdb/testsuite/gdb.c++/hang1.C3
-rw-r--r--gdb/testsuite/gdb.c++/hang2.C8
-rw-r--r--gdb/testsuite/gdb.c++/hang3.C4
-rw-r--r--gdb/testsuite/gdb.c++/local.cc8
-rw-r--r--gdb/testsuite/gdb.c++/local.exp150
-rw-r--r--gdb/testsuite/gdb.c++/method.exp180
-rw-r--r--gdb/testsuite/gdb.c++/misc.exp4
-rw-r--r--gdb/testsuite/gdb.c++/ovldbreak.exp76
-rw-r--r--gdb/testsuite/gdb.gdb/xfullpath.exp198
-rw-r--r--gdb/testsuite/gdb.hp/gdb.threads-hp/usrthbasic.c171
-rw-r--r--gdb/testsuite/gdb.hp/gdb.threads-hp/usrthbasic.exp110
-rw-r--r--gdb/testsuite/gdb.hp/gdb.threads-hp/usrthcore.c177
-rw-r--r--gdb/testsuite/gdb.hp/gdb.threads-hp/usrthcore.exp92
-rw-r--r--gdb/testsuite/gdb.hp/gdb.threads-hp/usrthfork.c17
-rw-r--r--gdb/testsuite/gdb.hp/gdb.threads-hp/usrthfork.exp75
-rw-r--r--gdb/testsuite/gdb.java/jmisc1.exp91
-rw-r--r--gdb/testsuite/gdb.java/jmisc2.exp91
-rw-r--r--gdb/testsuite/gdb.threads/linux-dp.exp3
-rw-r--r--gdb/testsuite/gdb.trace/gdb_c_test.c2
-rw-r--r--gdb/testsuite/lib/gdb.exp22
-rw-r--r--gdb/thread-db.c2
-rw-r--r--gdb/thread.c8
-rw-r--r--gdb/top.c25
-rw-r--r--gdb/tracepoint.c13
-rw-r--r--gdb/tui/ChangeLog4
-rw-r--r--gdb/tui/tui-out.c10
-rw-r--r--gdb/ui-file.c6
-rw-r--r--gdb/ui-out.c18
-rw-r--r--gdb/utils.c82
-rw-r--r--gdb/valarith.c57
-rw-r--r--gdb/valops.c23
-rw-r--r--gdb/valprint.c120
-rw-r--r--gdb/value.h18
-rw-r--r--gdb/varobj.c10
-rw-r--r--gdb/vax-tdep.c412
-rw-r--r--gdb/vax-tdep.h55
-rw-r--r--gdb/version.in2
-rw-r--r--gdb/win32-nat.c38
-rw-r--r--gdb/x86-64-linux-nat.c194
-rw-r--r--gdb/x86-64-tdep.c285
-rw-r--r--gdb/x86-64-tdep.h19
-rw-r--r--gdb/xcoffread.c6
-rw-r--r--gdb/xstormy16-tdep.c5
-rw-r--r--gdb/z8k-tdep.c23
357 files changed, 17388 insertions, 16487 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 68fd3d9..93a2353 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,4 +1,2015 @@
-2002-03-25 Alexandre Oliva <aoliva@redhat.com>
+2002-05-06 Jim Blandy <jimb@redhat.com>
+
+ Separate the job of reading the line number info statement program
+ header (...expialidocious) out into its own function.
+ * dwarf2read.c (struct line_head, struct filenames, struct
+ directories): Replace with...
+ (struct line_header): New structure, containing the full
+ contents of the statement program header, including the
+ include directory and file name tables.
+ (read_file_scope): If we have line number info, instead of just
+ calling dwarf_decode_lines to do all the work, call
+ dwarf_decode_line_header first to get a `struct line_header'
+ containing the data in the statement program header, and then
+ pass that to dwarf_decode_lines, which will pick up where that
+ left off. Be sure to clean up the `struct line_header' object.
+ (dwarf_decode_line_header, free_line_header, add_include_dir,
+ add_file_name): New functions.
+ (dwarf_decode_lines): Move all the code to read the statement
+ program header into dwarf_decode_line_header. Take the line
+ header it built as the first argument, instead of the offset to
+ the compilation unit's line number info. Use the new `struct
+ line_header' type instead of the old structures. No need to do
+ cleanups here now, since we don't allocate anything.
+ (dwarf2_statement_list_fits_in_line_number_section,
+ dwarf2_line_header_too_long): New complaints.
+
+2002-05-06 Elena Zannoni <ezannoni@redhat.com>
+
+ * gdbtypes.c (init_vector_type): New function.
+ (build_builtin_type_vec128): Simplify the representation of SIMD
+ registers.
+ (build_gdbtypes): Initialize new builtin vector types.
+ (_initialize_gdbtypes): Register new vector types with gdbarch.
+ (builtin_type_v4_float, builtin_type_v4_int32,
+ builtin_type_v8_int16, builtin_type_v16_int8,
+ builtin_type_v2_int32, builtin_type_v4_int16,
+ builtin_type_v8_int8): New (renamed) SIMD types.
+
+2002-05-06 Mark Kettenis <kettenis@gnu.org>
+
+ * i387-nat.c (i387_fill_fsave): Use regcache_collect.
+ (i387_fill_fxsave): Likewise.
+
+2002-05-05 Alexandre Oliva <aoliva@redhat.com>
+
+ * alpha-tdep.c (alpha_extract_return_value): Don't use
+ non-constant array size in prototype.
+
+2002-05-04 Andrew Cagney <ac131313@redhat.com>
+
+ From Brian Taylor <briant at model dot com>:
+ * ui-out.c (ui_out_field_core_addr): Use the function
+ longest_local_hex_string_custom'to format addresses > 32 bits
+ wide.
+
+ * ui-out.c (ui_out_field_core_addr): Update comment.
+
+2002-05-04 Andrew Cagney <ac131313@redhat.com>
+
+ * stack.c (select_and_print_frame): Make static. Delete the
+ parameter `level'.
+ (func_command): Update call.
+ (select_frame_command): Delete code computing the frame level.
+ * frame.h (select_and_print_frame): Delete declaration.
+
+2002-05-04 Andrew Cagney <ac131313@redhat.com>
+
+ * sparc-tdep.c (sparc_get_saved_register): Comment why
+ get_prev_frame call is safe.
+
+2002-05-04 Andrew Cagney <ac131313@redhat.com>
+
+ * frame.h (select_frame): Delete level parameter.
+ * stack.c (select_frame): Update. Use frame_relative_level to
+ obtain the frame's level.
+ (select_and_print_frame): Update call.
+ (select_frame_command): Ditto.
+ (up_silently_base): Ditto.
+ (down_silently_base): Ditto.
+ * ocd.c (ocd_start_remote): Ditto.
+ * remote-rdp.c (remote_rdp_open): Ditto.
+ * remote-mips.c (mips_initialize): Ditto.
+ (common_open): Ditto.
+ * remote-e7000.c (e7000_start_remote): Ditto.
+ * m3-nat.c (select_thread): Ditto.
+ * hppa-tdep.c (child_get_current_exception_event): Ditto.
+ (child_get_current_exception_event): Ditto.
+ * varobj.c (varobj_create): Ditto.
+ (varobj_update): Ditto.
+ (c_value_of_root): Ditto.
+ * tracepoint.c (finish_tfind_command): Ditto.
+ * corelow.c (core_open): Ditto.
+ * arch-utils.c (generic_prepare_to_proceed): Ditto.
+ * thread.c (info_threads_command): Ditto.
+ (switch_to_thread): Ditto.
+ * infrun.c (normal_stop): Ditto.
+ (restore_selected_frame): Ditto.
+ (restore_inferior_status): Ditto.
+ * breakpoint.c (insert_breakpoints): Ditto.
+ (watchpoint_check): Ditto.
+ (bpstat_stop_status): Ditto.
+ (do_enable_breakpoint): Ditto.
+ * blockframe.c (flush_cached_frames): Ditto.
+ (reinit_frame_cache): Ditto.
+
+2002-05-04 Andrew Cagney <ac131313@redhat.com>
+
+ * MAINTAINERS (Host/Native): Add Jason Thorpe as NetBSD
+ maintainer.
+
+2002-05-04 Jim Blandy <jimb@redhat.com>
+
+ * gdbtypes.c (replace_type): Doc fix.
+
+2002-05-04 Andrew Cagney <ac131313@redhat.com>
+
+ * valprint.c (strcat_longest): Delete commented out function.
+ Update copyright.
+
+2002-05-04 Andrew Cagney <ac131313@redhat.com>
+
+ * MAINTAINERS: Mark a29k as deleted.
+ * NEWS: Mention that a29k was removed. Add OBSOLETE section.
+ Move new configurations to the top.
+ * configure.tgt: Remove a29k.
+ * config/a29k/tm-vx29k.h: Delete.
+ * config/a29k/vx29k.mt: Delete.
+ * config/a29k/tm-a29k.h: Delete.
+ * config/a29k/a29k-udi.mt: Delete.
+ * config/a29k/a29k.mt: Delete.
+ * a29k-tdep.c: Delete.
+ * remote-udi.c: Delete.
+ * remote-mm.c: Delete.
+ * remote-eb.c: Delete.
+ * remote-adapt.c: Delete.
+ * Makefile.in: Remove obsolete code.
+ * gdbserver/Makefile.in: Ditto.
+ * config/s390/s390x.mt: Ditto.
+ * config/s390/s390.mt: Ditto.
+ * config/sparc/sparclynx.mh: Ditto.
+ * config/sparc/linux.mh: Ditto.
+ * config/pa/hppaosf.mh: Ditto.
+ * config/pa/hppabsd.mh: Ditto.
+ * config/ns32k/nbsd.mt: Ditto.
+ * config/mips/vr5000.mt: Ditto.
+ * config/m68k/sun3os4.mh: Ditto.
+ * config/m68k/nbsd.mt: Ditto.
+ * config/m68k/m68klynx.mh: Ditto.
+ * config/m32r/m32r.mt: Ditto.
+ * config/i386/x86-64linux.mt: Ditto.
+ * config/i386/nbsdelf.mt: Ditto.
+ * config/i386/nbsd.mt: Ditto.
+ * config/i386/i386lynx.mh: Ditto.
+
+2002-05-04 Andrew Cagney <ac131313@redhat.com>
+
+ * target.c (debug_print_register): New function. Handle oversize
+ registers.
+ (debug_to_fetch_registers): Call.
+ (debug_to_store_registers): Call.
+
+2002-05-03 Jim Blandy <jimb@redhat.com>
+
+ * stabsread.c (cleanup_undefined_types): Use replace_type, not memcpy.
+ (read_type): Doc fix.
+ * gdbtypes.c (replace_type): Doc fix.
+
+ * stabsread.c (multiply_defined_struct): New complaint.
+ (read_struct_type): If the type we were passed isn't empty, or
+ incomplete, don't read the new struct type into it; complain,
+ and return the original type unchanged. Take a new `type_code'
+ argument, which is the type code for the new type.
+ (read_type): Rather than storing the type's type code here, pass
+ it as an argument to read_struct_type, and let that take care of
+ storing it. That way, we don't overwrite the original type code,
+ so read_struct_type can use it to decide whether we're overwriting
+ something we shouldn't.
+ (complain_about_struct_wipeout): New function.
+
+2002-05-03 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.sh: Assert that gdbarch is non-NULL.
+ * gdbarch.c: Regenerate.
+
+2002-05-03 Jason Merrill <jason@redhat.com>
+
+ * gnu-v3-abi.c (gnuv3_rtti_type): If we get confused, just warn
+ and return NULL.
+
+2002-05-03 Michal Ludvig <mludvig@suse.cz>
+
+ * x86-64-tdep.c (x86_64_dwarf2gdb_regno_map),
+ (x86_64_dwarf2gdb_regno_map_length),
+ (x86_64_dwarf2_reg_to_regnum): Added.
+ (x86_64_gdbarch_init): Added registration of x86_64_dwarf2_reg_to_regnum.
+ (x86_64_gdbarch_init): Renamed from i386_gdbarch_init.
+ (_initialize_x86_64_tdep): Synced with the change above.
+ (x86_64_skip_prologue): Reformulated message.
+
+2002-05-03 Pierre Muller <muller@ics.u-strasbg.fr>
+
+ * f-exp.y: Also use new prev_lexptr variable
+ to improve error reporting. Based on Michael Snyder
+ 2002-04-24 dated patch to c-exp.y.
+ * jv-exp.y: Likewise.
+ * m2-exp.y: Likewise.
+
+2002-05-02 Elena Zannoni <ezannoni@redhat.com>
+
+ * valops.c (value_arg_coerce): Don't coerce arrays to pointers if
+ we are dealing with vectors.
+
+2002-05-02 Pierre Muller <muller@ics.u-strasbg.fr>
+
+ * config/m68k/tm-nbsd.h: Obvious fix,
+ correct machine name.
+
+2002-05-02 Pierre Muller <muller@ics.u-strasbg.fr>
+
+ * p-typeprint.c (pascal_type_print_base): Add support
+ for TYPE_CODE_STRING and TYPE_CODE_BITSTRING.
+
+2002-05-02 Pierre Muller <muller@ics.u-strasbg.fr>
+
+ * p-lang.c (pascal_create_fundamental_type): Use TYPE_CODE_CHAR
+ for fondamental pascal 'char' type.
+
+2002-05-02 Pierre Muller <muller@ics.u-strasbg.fr>
+
+ * p-lang.h (is_pascal_string_type): Declaration changed,
+ new sixth argument of type char ** added.
+ * p-lang.c (is_pascal_string_type): Implementation
+ changed. Args length_pos, length_size, string_pos, char_size
+ can now be NULL. New argument arrayname set to the field
+ name of the char array. Return value set to char array
+ field index plus one.
+ * p-valprint.c (pascal_val_print): Adapt to new declaration of
+ is_pascal_string_type function.
+
+2002-05-02 Andrew Cagney <cagney@redhat.com>
+
+ * gdbarch.sh (gdbarch_update_p): Revert 2002-05-02 Andrew Cagney
+ <cagney@redhat.com> change.
+ * gdbarch.c: Regenerate.
+
+2002-05-02 Andrew Cagney <cagney@redhat.com>
+
+ * gdbarch.sh (gdbarch_update_p): Swap out the old architecture
+ before probing for a new one. Detect errorenous gdbarch_init
+ functions.
+ * gdbarch.c: Regenerate.
+
+2002-05-01 Andrew Cagney <cagney@redhat.com>
+
+ * config/mn10200/tm-mn10200.h: Include "symfile.h" and "symtab.h".
+ * config/mcore/tm-mcore.h: Ditto. Update copyright.
+ * config/v850/tm-v850.h: Ditto. Update copyright.
+
+2002-04-30 Andrew Cagney <ac131313@redhat.com>
+
+ * cris-tdep.c (cris_gdbarch_init): Use arches instead of
+ current_gdbarch.
+
+2002-04-30 Michael Snyder <msnyder@redhat.com>
+
+ * arm-tdep.c: Whitespace clean-ups.
+ (arm_skip_prologue): Fix thinko; two lines
+ should have been removed as part of 4/24 change.
+
+2002-04-30 Kevin Buettner <kevinb@redhat.com>
+
+ * rs6000-tdep.c: Added comment describing how fpscr register
+ numbers were chosen.
+
+2002-04-30 Michael Snyder <msnyder@redhat.com>
+
+ * gnu-nat.c (gnu_find_memory_regions): Fix merge botch.
+
+2002-04-29 Elena Zannoni <ezannoni@redhat.com>
+
+ * hpread.c (DNTT_TYPE_VECTOR): Rename from TYPE_VECTOR.
+ (DNTT_TYPE_VECTOR_LENGTH): Rename from TYPE_VECTOR_LENGTH.
+ (hpread_symfile_init, hpread_lookup_type): Substitute throughout.
+
+2002-04-29 Kevin Buettner <kevinb@redhat.com>
+
+ From Louis Hamilton <hamilton@redhat.com>:
+ * rs6000-tdep.c (coff/xcoff.h, libxcoff.h): Include.
+ * xcoffread.c (coff/xcoff.h, libxcoff.h): Likewise.
+ * rs6000-tdep.c (rs6000_gdbarch_init): Use bfd_xcoff_is_xcoff64(),
+ not bfd-private xcoff data, to determine wordsize.
+ * xcoffread.c (read_xcoff_xymtab, read_symbol_lineno): Likewise.
+
+2002-04-29 Andrew Cagney <ac131313@redhat.com>
+
+ GDB 5.2 released from 5.2 branch.
+
+2002-04-29 Michal Ludvig <mludvig@suse.cz>
+
+ * x86-64-linux-nat.c (fill_gregset): Explicit cast to avoid warning.
+ * x86-64-tdep.c (i386_gdbarch_init): Ditto.
+ (x86_64_register_info_table): Added comments with register numbers.
+
+2002-04-29 Elena Zannoni <ezannoni@redhat.com>
+
+ * rs6000-tdep.c (rs6000_extract_return_value,
+ rs6000_store_return_value): Handle returning vectors.
+ (rs6000_gdbarch_init): Use
+ ppc_sysv_abi_broken_use_struct_convention for native sysv cases.
+ * ppc-linux-tdep.c (ppc_sysv_abi_broken_use_struct_convention):
+ New function.
+ (ppc_sysv_abi_use_struct_convention): Deal with functions returning
+ vectors.
+ (ppc_sysv_abi_push_arguments): Handle vector parameters.
+ * ppc-tdep.h (ppc_sysv_abi_broken_use_struct_convention): Export.
+
+2002-04-24 Pierre Muller <ics.u-strasbg.fr>
+
+ * hpread.c (hpread_psymtab_to_symtab_1,
+ hpread_psymtab_to_symtab): Replace fprintf (stderr,...)
+ with fprintf_unfiltered (gdb_stderr,...).
+
+2002-04-24 Pierre Muller <ics.u-strasbg.fr>
+
+ * remote-array.c (printf_monitor, write_monitor,
+ array_insert_breakpoint, array_remove_breakpoint ):
+ Replace fprintf (stderr,...
+ with fprintf_unfiltered (gdb_stderr,....
+ * remote-es.c: Likewise.
+ * remote-os9k.c: Likewise.
+ * remote-st.c: Likewise.
+
+2002-04-28 Andreas Schwab <schwab@suse.de>
+
+ * config/s390/s390.mh (NATDEPFILES): Remove solib.o, add
+ linux-proc.o and gcore.o.
+
+2002-04-26 Michal Ludvig <mludvig@suse.cz>
+
+ * x86-64-tdep.c (x86_64_skip_prologue): Print note when debugging
+ code without frame pointers.
+
+2002-04-26 Andrew Cagney <ac131313@redhat.com>
+
+ * sparc-tdep.c (sparc_gdbarch_init): Add comment explaining why
+ ON_STACK is needed.
+
+2002-04-26 Ben Elliston <bje@redhat.com>
+
+ * target.c (do_xfer_memory): Correct reference to the new option
+ "trust-readonly-sections".
+
+2002-04-26 Elena Zannoni <ezannoni@redhat.com>
+
+ * gdbtypes.h (TYPE_FLAG_VECTOR, TYPE_VECTOR): Define.
+ * gdbtypes.c (recursive_dump_type): Output the vector flag.
+ * dwarf2read.c (dwarf_attr_name): Handle new attribute for
+ vectors.
+ (read_array_type): Record the fact that this array type is really a
+ vector (i.e. are passed in by value).
+
+2002-04-26 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * alpha-tdep.h (gdbarch_tdep): Add sigcontext_addr member.
+ * alpha-tdep.c (alpha_sigcontext_addr): New function.
+ (alpha_find_saved_regs): Use alpha_sigcontext_addr.
+ (alpha_gdbarch_init): Initialize tdep->sigcontext_addr.
+ * alpha-linux-tdep.c: Include frame.h.
+ (alpha_linux_sigcontext_addr): New function.
+ (alpha_linux_init_abi): Set tdep->sigcontext_addr to
+ alpha_linux_sigcontext_addr.
+ * alpha-osf1-tdep.c: Include gdbcore.h.
+ (alpha_osf1_sigcontext_addr): New function.
+ (alpha_osf1_init_abi): Set tdep->sigcontext_addr to
+ alpha_osf1_sigcontext_addr.
+ * config/alpha/tm-alpha.h (SIGCONTEXT_ADDR): Remove.
+ * config/alpha/tm-alphalinux.h (SIGCONTEXT_ADDR): Remove.
+
+2002-04-26 Andrew Cagney <ac131313@redhat.com>
+
+ * stack.c (selected_frame_level):
+ (select_frame): Do not set selected_frame_level.
+ * frame.h (selected_frame_level): Delete declaration.
+
+2002-04-26 Andrew Cagney <ac131313@redhat.com>
+
+ * rs6000-tdep.c (rs6000_gdbarch_init): Only set
+ convert_from_func_ptr-addr when AIX / PowerOpen.
+
+2002-04-25 Andrew Cagney <ac131313@redhat.com>
+
+ * valops.c (hand_function_call): Call
+ generic_save_call_dummy_addr.
+ * frame.h (generic_save_call_dummy_addr): Declare.
+ * blockframe.c (struct dummy_frame): Add fields call_lo and
+ call_hi.
+ (generic_find_dummy_frame): Check for PC in range call_lo to
+ call_hi instead of entry_point_address.
+ (generic_pc_in_call_dummy): Search the dummy frames for a PC in
+ the call_lo to call_hi range. Allow for DECR_PC_AFTER_BREAK.
+ (generic_save_call_dummy_addr): New function.
+
+2002-04-24 David S. Miller <davem@redhat.com>
+
+ * sparc-tdep.c (sparc_gdbarch_skip_prologue): Kill, duplicates
+ sparc_skip_prologue.
+ (sparc_skip_prologue): Kill frameless_p arg, and use line number
+ information to find prologue when possible.
+ (sparc_prologue_frameless_p): Call examine_prologue directly.
+ (sparc_gdbarch_init): Update set_gdbarch_skip_prologue call.
+ * config/sparc/tm-sparc.h (sparc_skip_prologue): Update for killed
+ second argument.
+ (SKIP_PROLOGUE): Likewise.
+
+2002-04-25 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * alpha-tdep.c (alpha_skip_prologue_internal): Remove
+ GDB_TARGET_HAS_SHARED_LIBS #ifdef and update comment to
+ indicate that the condition it was testing is always true.
+ * config/alpha/nm-linux.h (GDB_TARGET_HAS_SHARED_LIBS): Remove.
+ * config/alpha/nm-nbsd.h (GDB_TARGET_HAS_SHARED_LIBS): Ditto.
+ * config/alpha/nm-osf.h (GDB_TARGET_HAS_SHARED_LIBS): Ditto.
+
+2002-04-25 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * alpha-tdep.h (gdbarch_tdep): Add jb_pc and jb_elt_size members.
+ * alpha-linux-tdep.c (alpha_linux_init_abi): Initialize
+ tdep->jb_pc and tdep->jb_elt_size.
+ * alpha-osf1-tdep.c (alpha_osf1_init_abi): Likewise.
+ * alphafbsd-tdep.c (alphafbsd_init_abi): Likewise.
+ * alphanbsd-tdep.c (alphanbsd_init_abi): Likewise.
+ * alpha-nat.c (get_longjmp_target): Remove.
+ (JB_ELEMENT_SIZE): Ditto.
+ (JB_PC): Ditto.
+ * alpha-tdep.c (alpha_get_longjmp_target): New function.
+ (alpha_gdbarch_init): Default tdep->jb_pc to -1. If the
+ OS ABI sets jb_pc to a valid value, set gdbarch_get_longjmp_target
+ to alpha_get_longjmp_target.
+ (alpha_dump_tdep): Report tdep->jb_pc and tdep->jb_elt_size.
+ * config/alpha/nm-linux.h (GET_LONGJMP_TARGET): Remove.
+ * config/alpha/nm-osf.h (GET_LONGJMP_TARGET): Remove.
+
+2002-04-25 Andrew Cagney <ac131313@redhat.com>
+
+ * README: Update to GDB 5.2.
+
+2002-04-25 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.sh (LC_ALL): Set to `c'.
+
+2002-04-25 Theodore A. Roth <troth@verinet.com>
+
+ * avr-tdep.c: Ran through gdb_indent.sh.
+
+2002-04-25 Theodore A. Roth <troth@verinet.com>
+
+ * MAINTAINERS: Add myself as AVR maintainer.
+ * NEWS: Note new target avr.
+
+2002-04-25 Theodore A. Roth <troth@verinet.com>
+
+ * Makefile.in: Add support for AVR target.
+ * configure.tgt: Add support for AVR target.
+ * avr-tdep.c: New file
+ * config/avr/avr.mt: New file.
+
+2002-04-25 Theodore A. Roth <troth@verinet.com>
+
+ * MAINTAINERS: Add myself to write-after-approval.
+
+2002-04-24 Pierre Muller <ics.u-strasbg.fr>
+
+ * f-lang.c (get_bf_for_fcn): Replace fprintf (stderr,...
+ with fprintf_unfiltered (gdb_stderr,....
+
+2002-04-25 Pierre Muller <muller@ics.u-strasbg.fr>
+
+ Fix PR gdb/508.
+ * symfile.c (add_filename_language): Fix wrong xrealloc size argument.
+
+2002-04-25 Pierre Muller <muller@ics.u-strasbg.fr>
+
+ * p-exp.y: Also use new prev_lexptr variable
+ to improve error reporting. Based on Michael Snyder
+ 2002-04-24 dated patch to c-exp.y.
+
+2002-04-25 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * alpha-tdep.c (alpha_breakpoint_from_pc): New function.
+ (alpha_gdbarch_init): Set gdbarch_breakpoint_from_pc to
+ alpha_breakpoint_from_pc. Set gdbarch_function_start_offset
+ to 0.
+ * config/alpha/tm-alpha.h: Remove forward decls of struct type
+ and struct value.
+ (FUNCTION_START_OFFSET): Remove.
+ (BREAKPOINT): Ditto.
+
+2002-04-25 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * MAINTAINERS: Reflect that multi-arch is enabled for VAX.
+ * NEWS: Ditto.
+
+2002-04-24 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * alpha-linux-tdep.c (alpha_linux_pc_in_sigtramp): New function.
+ (alpha_linux_init_abi): Set gdbarch_pc_in_sigtramp to
+ alpha_linux_pc_in_sigtramp.
+ * alpha-osf1-tdep.c (alpha_osf1_pc_in_sigtramp): New function.
+ (alpha_osf1_init_abi): Set gdbarch_pc_in_sigtramp to
+ alpha_osf1_pc_in_sigtramp.
+ * alpha-tdep.c (alpha_osf_in_sigtramp): Remove.
+ * alphafbsd-tdep.c (alphafbsd_pc_in_sigtramp): New function.
+ (alphafbsd_init_abi): Set gdbarch_pc_in_sigtramp to
+ alphafbsd_pc_in_sigtramp.
+ * alphanbsd-tdep.c (alphanbsd_pc_in_sigtramp): New function.
+ (alphanbsd_init_abi): Set gdbarch_pc_in_sigtramp to
+ alphanbsd_pc_in_sigtramp.
+ * config/alpha/tm-alpha.h (IN_SIGTRAMP): Remove.
+ * config/alpha/tm-alphalinux.h (IN_SIGTRAMP): Remove.
+
+2002-04-24 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * config/alpha/nbsd.mh (NATDEPFILES): Remove solib-legacy.o.
+
+2002-04-24 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * Makefile.in (ALLDEPFILES): Add alphanbsd-nat.c and
+ alphanbsd-tdep.c.
+ (alphanbsd-nat.o): New dependency list.
+ (alphanbsd-tdep.o): Ditto.
+ * NEWS: Note new native NetBSD/alpha configuration.
+ * alphanbsd-nat.c: New file.
+ * alphanbsd-tdep.c: Ditto.
+ * configure.host (alpha*-*-netbsd*): New host.
+ * configure.tgt (alpha*-*-netbsd*): New target.
+ * config/alpha/nbsd.mh: New file.
+ * config/alpha/nbsd.mt: Ditto.
+ * config/alpha/nm-nbsd.h: Ditto.
+ * config/alpha/tm-nbsd.h: Ditto.
+
+2002-04-24 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * Makefile.in (ALLDEPFILES): Add alpha-osf1-tdep.c.
+ (alpha-osf1-tdep.o): New dependency list.
+ * alpha-tdep.h (gdbarch_tdep): Add dynamic_sigtramp_offset
+ and skip_sigtramp_frame members.
+ * alpha-linux-tdep.c: Include gdbcore.h.
+ (alpha_linux_sigtramp_offset): Change return type to LONGEST.
+ (alpha_linux_init_abi): Initialize tdep->dynamic_sigtramp_offset.
+ * alpha-osf1-tdep.c: New file.
+ * alpha-tdep.c (alpha_osf_skip_sigtramp_frame): Moved to
+ alpha-osf1-dep.c.
+ (alpha_frame_past_sigtramp_frame): New function.
+ (alpha_dynamic_sigtramp_offset): Ditto.
+ (alpha_proc_desc_is_dyn_sigtramp): Ditto.
+ (alpha_set_proc_desc_is_dyn_sigtramp): Ditto.
+ (ALPHA_PROC_SIGTRAMP_MAGIC): Define.
+ (push_sigtramp_desc): Use alpha_set_proc_desc_is_dyn_sigtramp.
+ (after_prologue): Use alpha_proc_desc_is_dyn_sigtramp.
+ (find_proc_desc): Use alpha_dynamic_sigtramp_offset.
+ (alpha_frame_chain): Use alpha_frame_past_sigtramp_frame.
+ (alpha_init_extra_frame_info): Use alpha_proc_desc_is_dyn_sigtramp.
+ (alpha_pop_frame): Use alpha_proc_desc_is_dyn_sigtramp.
+ (alpha_gdbarch_init): Initialize tdep->dynamic_sigtramp_offset
+ and tdep->skip_sigtramp_frame. Set gdbarch_skip_trampoline_code
+ to find_solib_trampoline_target.
+ * config/alpha/alpha-osf1.mt (TDEPFILES): Add alpha-osf1-tdep.o.
+ * config/alpha/tm-alpha.h: Remove inclusion of regcache.h.
+ (SKIP_TRAMPOLINE_CODE): Remove.
+ (PROC_DESC_IS_DYN_SIGTRAMP): Ditto.
+ (SET_PROC_DESC_IS_DYN_SIGTRAMP): Ditto.
+ (DYNAMIC_SIGTRAMP_OFFSET): Ditto.
+ (FRAME_PAST_SIGTRAMP_FRAME): Ditto.
+ * config/alpha/tm-alphalinux.h (PROC_DESC_IS_DYN_SIGTRAMP): Remove.
+ (PROC_SIGTRAMP_MAGIC): Ditto.
+ (PROC_DESC_IS_DYN_SIGTRAMP): Ditto.
+ (SET_PROC_DESC_IS_DYN_SIGTRAMP): Ditto.
+ (SET_PROC_DESC_IS_DYN_SIGTRAMP): Ditto.
+ (DYNAMIC_SIGTRAMP_OFFSET): Ditto.
+ (FRAME_PAST_SIGTRAMP_FRAME): Ditto.
+
+2002-04-24 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * NEWS: Note that Alpha targets are now multi-arch.
+
+2002-04-24 Michael Snyder <msnyder@redhat.com>
+
+ * parser-defs.h (prev_lexptr): New external variable.
+ * parse.c (parse_exp_1): Set prev_lexptr to null before
+ calling the language-specific parser.
+ * c-exp.y (yylex): Set prev_lexptr to start of current token.
+ (yyerror): Use prev_lexptr in error reporting.
+
+2002-04-24 Daniel Jacobowitz <drow@mvista.com>
+
+ * config/i386/tm-linux.h: Define FILL_FPXREGSET.
+ * gregset.h: If FILL_FPXREGSET is defined, provide
+ gdb_fpxregset_t, supply_fpxregset, and fill_fpxregset.
+ * linux-proc.c (linux_do_thread_registers): If FILL_FPXREGSET
+ is defined, call fill_fpxregset.
+
+2002-04-24 Roland McGrath <roland@frob.com>
+
+ * config/i386/i386gnu.mh (NATDEPFILES): Add core-regset.o here.
+ * i386gnu-nat.c [HAVE_SYS_PROCFS_H]
+ (supply_gregset, supply_fpregset): New functions.
+
+ * gnu-nat.c (gnu_find_memory_regions): New function.
+ (init_gnu_ops): Set `to_find_memory_regions' hook to that.
+ (gnu_xfer_memory): Add a cast.
+
+2002-04-24 Michael Snyder <msnyder@redhat.com>
+
+ * arm-tdep.c (arm_scan_prologue): Move "mov ip, sp" into the
+ loop. Add handling for "str lr, [sp, #-4]!" and for saves
+ of argument regs ("str r(0123), [r11, #-nn"]).
+ (arm_skip_prologue): Better handling for frameless functions.
+ Treat "mov ip, sp" as optional. Recognize "str lr, [sp, #-4]".
+ (arm_skip_prologue): Recognize str r(0123), [r11, #-nn].
+
+Wed Apr 24 14:22:21 2002 Andrew Cagney <cagney@redhat.com>
+
+ * arm-tdep.c (arm_gdbarch_init): Add comment that NUM_REGS nor
+ NUM_PSEUDO_REGS can be used.
+
+2002-04-24 Andrew Cagney <ac131313@redhat.com>
+
+ * arch-utils.h: Update copyright.
+
+ * gdbarch.sh (PC_IN_SIGTRAMP): Add.
+ * gdbarch.h, gdbarch.c: Re-generate.
+
+ * inferior.h (IN_SIGTRAMP): Delete definition.
+ * arch-utils.c (legacy_pc_in_sigtramp): New function.
+ * arch-utils.h (legacy_pc_in_sigtramp): Declare.
+
+ * mips-tdep.c (mips_init_extra_frame_info): Use PC_IN_SIGTRAMP.
+ (mips_dump_tdep): Do not print value of IN_SIGTRAMP.
+ * hppa-tdep.c (pc_in_interrupt_handler): Use PC_IN_SIGTRAMP.
+ (find_proc_framesize): Ditto.
+ * alpha-tdep.c (alpha_osf_skip_sigtramp_frame): Ditto.
+ (alpha_init_extra_frame_info): Ditto.
+ * infrun.c (handle_inferior_event): Ditto.
+ (handle_inferior_event): Ditto.
+ (check_sigtramp2): Ditto.
+ * blockframe.c (create_new_frame): Ditto.
+ (get_prev_frame): Ditto.
+ * ppc-linux-tdep.c: Update comments.
+ * i386-linux-tdep.c: Update comments.
+ * breakpoint.c (bpstat_what): Update comment.
+
+2002-04-24 Michal Ludvig <mludvig@suse.cz>
+
+ * gdbserver/linux-low.c (regsets_fetch_inferior_registers),
+ (regsets_store_inferior_registers): Removed cast to int from
+ ptrace() calls.
+ * gdbserver/regcache.h: Added declaration of struct inferior_info.
+
+2002-04-24 David S. Miller <davem@redhat.com>
+
+ * i960-tdep.c (register_in_window_p): New function.
+ (i960_find_saved_register): Use it instead of
+ REGISTER_IN_WINDOW_P.
+ * config/i960/tm-i960.h (REGISTER_IN_WINDOW): Delete.
+
+ * symtab.h (find_stab_function_addr): Kill extern.
+ * minsyms.c (find_stab_function_addr): Remove from here...
+ * dbxread.c: ... to here, and mark it static.
+
+2002-04-20 David S. Miller <davem@redhat.com>
+
+ * sparc-tdep.c (sparc_pop_frame): Only need to allocate
+ SPARC_INTREG_SIZE * 16 bytes for reg_temp.
+
+2002-04-21 David S. Miller <davem@redhat.com>
+
+ * remote-vxsparc.c (vx_read_register): Fix typo, we want
+ REGISTER_RAW_SIZE of SP_REGNUM not CORE_ADDR.
+ (vx_write_register): Likewise.
+
+2002-04-23 J. Brobecker <brobecker@gnat.com>
+
+ * source.c (is_regular_file): New function.
+ (openp): Check wether file to open is a regular file
+ to avoid opening directories.
+
+2002-04-22 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * findvar.c (extract_signed_integer): Cast printf argument
+ to suppress format warning.
+ (extract_unsigned_integer): Likewise.
+ * infcmd.c (registers_info): Likewise.
+ * top.c (get_prompt_1): Likewise.
+ * valops.c (value_assign): Likewise.
+ * valprint.c (print_decimal): Likewise.
+
+2002-04-22 H.J. Lu (hjl@gnu.org)
+
+ * c-exp.y (typebase): Support
+
+ [long|long long|short] [signed|unsigned] [int|]
+
+ and
+
+ signed [long|long long|short] int
+
+2002-04-22 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * Makefile.in (vax-tdep.o): Add $(arch_utils_h), $(inferior_h),
+ and vax-tdep.h.
+ * vax-tdep.h: New file.
+ * vax-tdep.c: Include inferior.h, arch-utils.h, and vax-tdep.h.
+ Make several routines static.
+ (vax_get_saved_register): New function.
+ (vax_gdbarch_init): New function.
+ (_initialize_vax_tdep): Register vax_gdbarch_init.
+ * config/vax/tm-vax.h: Set GDB_MULTI_ARCH to GDB_MULTI_ARCH_PARTIAL.
+ Remove macros now under the control of gdbarch.
+
+2002-04-22 Michael Snyder <msnyder@redhat.com>
+
+ * arm-tdep.c (arm_skip_prologue): Recognize "sub sp, sp, #nn".
+ Some whitespace and coding standards tweaks.
+
+2002-04-22 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * vax-tdep.c: Include regcache.h.
+ (vax_call_dummy_words): New.
+ (sizeof_vax_call_dummy_words): New.
+ (vax_fix_call_dummy): New function.
+ (vax_saved_pc_after_call): Ditto.
+ * config/vax/tm-vax.h: Don't include regcache.h.
+ (SAVED_PC_AFTER_CALL): Use vax_saved_pc_after_call.
+ (CALL_DUMMY): Remove.
+ (CALL_DUMMY_WORDS): Define.
+ (SIZEOF_CALL_DUMMY_WORDS): Define.
+ (FIX_CALL_DUMMY): Use vax_fix_call_dummy.
+
+2002-04-18 Michael Snyder <msnyder@redhat.com>
+
+ * arm-tdep.h: Change regnum defines to enums for ease of debugging.
+
+2002-04-22 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * vax-tdep.c (vax_frame_chain): New function.
+ (vax_push_dummy_frame): Ditto.
+ (vax_pop_frame): Ditto.
+ * config/vax/tm-vax.h (FRAME_CHAIN): vax_frame_chain.
+ (FRAMELESS_FUNCTION_INVOCATION): Use
+ generic_frameless_function_invocation_not.
+ (PUSH_DUMMY_FRAME): Use vax_push_dummy_frame.
+ (POP_FRAME): Use vax_pop_frame.
+
+2002-04-22 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * vax-tdep.c (vax_store_struct_return): New function.
+ (vax_extract_return_value): Ditto.
+ (vax_store_return_value): Ditto.
+ (vax_extract_struct_value_address): Ditto.
+ * config/vax/tm-vax.h (STORE_STRUCT_RETURN): Use
+ vax_store_struct_return.
+ (EXTRACT_RETURN_VALUE): Use vax_extract_return_value.
+ (STORE_RETURN_VALUE): Use vax_store_return_value.
+ (EXTRACT_STRUCT_VALUE_ADDRESS): Use vax_extract_struct_value_address.
+
+2002-04-22 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * vax-tdep.c (vax_frame_saved_pc): New function.
+ (vax_frame_args_address_correct): Ditto.
+ (vax_frame_args_address): Ditto.
+ (vax_frame_locals_address): Ditto.
+ (vax_frame_num_args): Move code to be in proximity to
+ other frame-related functions.
+ * config/vax/tm-vax.h (INNER_THAN): Use core_addr_lessthan.
+ (FRAME_SAVED_PC): Use vax_frame_saved_pc.
+ (FRAME_ARGS_ADDRESS_CORRECT): Use vax_frame_args_address_correct.
+ (FRAME_ARGS_ADDRESS): Use vax_frame_args_address.
+ (FRAME_LOCALS_ADDRESS): Use vax_frame_locals_address.
+
+2002-04-22 H.J. Lu (hjl@gnu.org)
+
+ * Makefile.in (FLAGS_TO_PASS): Add libdir, mandir, datadir and
+ includedir.
+
+2002-04-22 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * vax-tdep.c (vax_frame_init_saved_regs): New function.
+ * config/vax/tm-vax.h (FRAME_FIND_SAVED_REGS): Remove.
+ (FRAME_INIT_SAVED_REGS): New macro.
+
+2002-04-22 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * MAINTAINERS: Reflect that the Alpha target has been multi-arch'd.
+
+2002-04-22 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * alpha-nat.c (get_longjmp_target): Use ALPHA_* constants
+ where needed.
+ (fetch_osf_core_registers): Likewise.
+ (supply_gregset): Likewise.
+
+2002-04-22 J. Brobecker <brobecker@gnat.com>
+
+ * symfile.h (get_section_index): Define.
+ * symfile.c (get_section_index): New function.
+ * mdebugread.c (SC_IS_SBSS): New macro.
+ (SC_IS_BSS): Return true for the scBss storage class only, as
+ the scSBss storage class refers to the .sbss section.
+ (parse_partial_symbols): Discard the symbols which associated
+ section does not exist.
+ Make sure to use the .sbss section index for symbols which
+ storage class is scBss, rather than using the .bss section index.
+
+2002-04-22 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * vax-tdep.c: Update copyright years.
+ (vax_register_name): New function.
+ (vax_register_byte): Ditto.
+ (vax_register_raw_size): Ditto.
+ (vax_register_virtual_size): Ditto.
+ (vax_register_virtual_type): Ditto.
+ * config/vax/tm-vax.h: Update copyright years.
+ (REGISTER_NAMES): Remove.
+ (REGISTER_NAME): Define.
+ (REGISTER_BYTE): Use vax_register_byte.
+ (REGISTER_RAW_SIZE): Use vax_register_raw_size.
+ (REGISTER_VIRTUAL_SIZE): Use vax_register_virtual_size.
+ (REGISTER_VIRTUAL_TYPE): Use vax_register_virtual_type.
+
+2002-04-21 Andrew Cagney <ac131313@redhat.com>
+
+ * config/sparc/tm-sparc.h (sparc_skip_prologue): Restore
+ declaration
+ * arc-tdep.c (arc_prologue_frameless_p): Fix syntax error.
+
+2002-04-21 David S. Miller <davem@redhat.com>
+
+ * arch-utils.c (generic_prologue_frameless_p): Kill
+ SKIP_PROLOGUE_FRAMELESS_P code.
+ * config/arc/tm-arc.h (SKIP_PROLOGUE_FRAMELESS_P): Delete
+ references.
+ (PROLOGUE_FRAMELESS_P, arc_prologue_frameless_p): New.
+ * arc-tdep.c (arc_prologue_frameless_p): Implement.
+ * config/arc/tm-sparc.h (SKIP_PROLOGUE_FRAMELESS_P): Delete
+ references.
+ (PROLOGUE_FRAMELESS_P, sparc_prologue_frameless_p): New.
+ * sparc-tdep.c (sparc_prologue_frameless_p): Implement.
+ (sparc_gdbarch_init): Pass it to
+ set_gdbarch_prologue_frameless_p.
+
+2002-04-21 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * Makefile.in (ALLDEPFILES): Add alphabsd-nat.c.
+ (alphabsd-nat.o): New dependency list.
+
+2002-04-21 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * Makefile.in (ALLDEPFILES): Add alpha-linux-tdep.c and
+ alphafbsd-tdep.c.
+ (alpha-linux-tdep.o): New dependency list.
+ (alphafbsd-tdep.o): Likewise.
+
+2002-04-21 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * alpha-linux-tdep.c: New file. Move alpha_linux_sigtramp_offset
+ to here...
+ * alpha-tdep.c: ...from here.
+ * config/alpha/alpha-linux.mt (TDEPFILES): Add alpha-linux-tdep.o.
+
+2002-04-21 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * config/alpha/tm-alpha.h: Move alpha_software_single_step
+ prototype from here...
+ * alpha-tdep.h: ...to here.
+
+2002-04-21 Andrew Cagney <ac131313@redhat.com>
+
+ * frame.h (selected_frame_level): Document as deprecated.
+ (frame_relative_level): Declare.
+ * stack.c (frame_relative_level): New function.
+ (selected_frame_level): Document as deprecated.
+ (select_frame): Do not set the selected_frame_level.
+
+ * stack.c (frame_info, record_selected_frame): Update.
+ (frame_command, current_frame_command): Update.
+ (up_silently_base, up_command, down_silently_base): Update.
+ (down_command): Update.
+ * inflow.c (kill_command): Update.
+ * tracepoint.c (finish_tfind_command): Update.
+ * corelow.c (core_open): Update.
+ * thread.c (info_threads_command): Update.
+ (do_captured_thread_select): Update.
+ * infcmd.c (finish_command): Update.
+ * breakpoint.c (insert_breakpoints, do_enable_breakpoint): Update.
+
+2002-04-21 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * config/alpha/tm-fbsd.h (FRAME_CHAIN_VALID): Remove.
+
+2002-04-21 Andrew Cagney <ac131313@redhat.com>
+
+ * arm-tdep.c (arm_breakpoint_from_pc): Make static. Make return
+ type const.
+
+2002-04-21 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * alphafbsd-tdep.c: Update copyright years. Include
+ alpha-tdep.h.
+ (alphafbsd_use_struct_convention): Make static.
+ (alphafbsd_init_abi): New function.
+ (_initialize_alphafbsd_tdep): New function.
+ * config/alpha/tm-fbsd.h: Update copyright years.
+ (USE_STRUCT_CONVENTION): Remove.
+
+2002-04-21 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * alpha-tdep.c (alpha_abi_handler): New structure to describe
+ an Alpha ABI variant.
+ (alpha_abi_handler_list): Declare.
+ (alpha_gdbarch_register_os_abi): New function.
+ (alpha_gdbarch_init): Give registered ABI variant handlers a
+ chance to tweak the gdbarch once we have set up defaults.
+ * alpha-tdep.h: Prototype alpha_gdbarch_register_os_abi.
+
+2002-04-21 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * alpha-tdep.c (alpha_gdbarch_init): Set coerce_float_to_double
+ to standard_coerce_float_to_double.
+ * config/alpha/tm-alpha.h (COERCE_FLOAT_TO_DOUBLE): Remove.
+
+2002-04-21 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * alpha-tdep.h (gdbarch_tdep): Add vm_min_address member.
+ * alpha-tdep.c (heuristic_proc_start): Use vm_min_address
+ from gdbarch_tdep rather than a constant.
+ (alpha_gdbarch_init): Initialize tdep->vm_min_address to
+ the default text address for all Alpha Unix ABIs.
+ (alpha_dump_tdep): Report the value of tdep->vm_min_address.
+ * config/alpha/tm-alpha.h (VM_MIN_ADDRESS): Delete.
+
+2002-04-21 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * alpha-tdep.h: New file. Includes several Alpha target constants
+ taken from...
+ * config/alpha/tm-alpha.h: ...here. Remove macros that we now
+ let gdbarch deal with.
+ (GDB_MULTI_ARCH): Define as GDB_MULTI_ARCH_PARTIAL.
+ * Makefile.in (alpha-nat.o): Add alpha-tdep.h and $(BFD_SRC)/elf-bfd
+ to dependency list.
+ * alpha-nat.c: Include alpha-tdep.h. Update for adjusted
+ Alpha target register names.
+ * alphabsd-nat.c: Likewise.
+ * alpha-tdep.c: Include alpha-tdep.h. Update for adjusted
+ Alpha target register names. Make serveral routines static.
+ (alpha_get_saved_register): New function.
+ (alpha_abi_names): New.
+ (process_note_abi_tag_sections): New function.
+ (get_elfosabi): New function.
+ (alpha_gdbarch_init): New function.
+ (alpha_dump_tdep): New function.
+ (_initialize_alpha_tdep): Register alpha_gdbarch_init.
+
+2002-04-21 Andrew Cagney <ac131313@redhat.com>
+
+ * frame.c (find_saved_register): Delete #ifdef
+ HAVE_REGISTER_WINDOWS code.
+ * config/sparc/tm-sparc.h: Update comments.
+ * config/i960/tm-i960.h (HAVE_REGISTER_WINDOWS): Delete macro.
+
+2002-04-21 Andrew Cagney <ac131313@redhat.com>
+
+ * i960-tdep.c (i960_find_saved_register): New function.
+ (i960_get_saved_register): New function.
+ * config/i960/tm-i960.h (GET_SAVED_REGISTER): Define.
+ (i960_get_saved_register): Declare.
+ * config/i960/tm-i960.h, i960-tdep.c: Update copyright.
+
+2002-04-20 David S. Miller <davem@redhat.com>
+
+ * sparc-nat.c (store-inferior_registers): Fix ambiguous else.
+
+2002-04-20 Andrew Cagney <ac131313@redhat.com>
+
+ * arm-tdep.c (arm_gdbarch_init): Use gdbarch_num_pseudo_regs
+ instead of NUM_PSEUDO_REGS.
+
+2002-04-20 David S. Miller <davem@redhat.com>
+
+ * config/sparc/tm-linux.h (GDB_MULTI_ARCH): Define to
+ GDB_MULTI_ARCH_PARTIAL
+ * config/sparc/tm-sp64linux.h (GDB_MULTI_ARCH): Do not
+ define, let tm-sp64.h do it.
+
+2002-04-20 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * frame.c (find_saved_register): Avoid a NULL pointer
+ dereference and actually walk the frame list.
+
+2002-04-20 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.sh (gdbarch_update_p): Keep the list of architectures
+ sorted in most most-recent-used order. Document.
+ * gdbarch.h, gdbarch.c: Regenerate.
+
+2002-04-20 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdbserver/inferiors.c (struct inferior_info): Add regcache_data.
+ (add_inferior): Call create_register_cache.
+ (clear_inferiors): Call free_register_cache.
+ (inferior_regcache_data, set_inferior_regcache_data): New functions.
+ * gdbserver/regcache.c (struct inferior_regcache_data): New.
+ (registers): Remove.
+ (get_regcache): New function.
+ (create_register_cache, free_register_cache): New functions.
+ (set_register_cache): Don't initialize the register cache here.
+ (registers_to_string, registers_from_string, register_data): Call
+ get_regcache.
+ * gdbserver/regcache.h: Add prototypes.
+ * gdbserver/server.h: Likewise.
+
+2002-04-20 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdbserver/mem-break.c: New file.
+ * gdbserver/mem-break.h: New file.
+ * gdbserver/Makefile.in: Add mem-break.o rule; update server.h
+ dependencies.
+ * gdbserver/inferiors.c (struct inferior_info): Add target_data
+ member.
+ (clear_inferiors): Free target_data member if set.
+ (inferior_target_data, set_inferior_target_data): New functions.
+ * gdbserver/linux-i386-low.c (i386_breakpoint, i386_breakpoint_len)
+ (i386_stop_pc, i386_set_pc): New. Add to the_low_target.
+ * gdbserver/linux-low.c (linux_bp_reinsert): New variable.
+ (struct inferior_linux_data): New.
+ (linux_create_inferior): Use set_inferior_target_data.
+ (linux_attach): Likewise. Call add_inferior.
+ (linux_wait_for_one_inferior): New function.
+ (linux_wait): Call it.
+ (linux_write_memory): Add const.
+ (initialize_low): Call set_breakpoint_data.
+ * gdbserver/linux-low.h (struct linux_target_ops): Add breakpoint
+ handling members.
+ * gdbserver/server.c (attach_inferior): Remove extra add_inferior
+ call.
+ * gdbserver/server.h: Include mem-break.h. Update inferior.c
+ prototypes.
+ * gdbserver/target.c (read_inferior_memory)
+ (write_inferior_memory): New functions.
+ * gdbserver/target.h (read_inferior_memory)
+ (write_inferior_memory): Change macros to prototypes.
+ (struct target_ops): Update comments. Add const to write_memory
+ definition.
+
+2002-04-19 Andrew Cagney <ac131313@redhat.com>
+
+ * sparc-tdep.c (sparc_get_saved_register): Use get_prev_frame
+ instead of ->prev.
+ * z8k-tdep.c (z8k_frame_chain): Do not use ->prev.
+ * s390-tdep.c (s390_frame_chain): Do not use ->prev.
+ * rs6000-tdep.c (frame_get_saved_regs): Use rs6000_frame_chain()
+ instead of ->prev.
+
+2002-04-19 Elena Zannoni <ezannoni@redhat.com>
+
+ Fix PR gdb/471.
+ * gdbtypes.c (init_simd_type): Rewrite using new functions.
+ (build_builtin_type_vec128): Ditto.
+ (append_composite_type_field): Fix calculation of type length in
+ union case.
+
+2002-04-19 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * config/djgpp/README: Update.
+
+ * go32-nat.c (store_register): Cast &a_tss to `char *' to avoid a
+ compiler warnings.
+
+2002-04-19 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * alpha-tdep.c (setup_arbitrary_frame): Rename...
+ (alpha_setup_arbitrary_frame): ...to this.
+ * config/alpha/tm-alpha.h (SETUP_ARBITRARY_FRAME): Update
+ for alpha_setup_arbitrary_frame.
+
+2002-04-18 Andrew Cagney <cagney@redhat.com>
+
+ * gdbarch.sh (BREAKPOINT_FROM_PC): Return a const buffer.
+ * gdbarch.h, gdbarch.c: Regenerate.
+
+ * defs.h (breakpoint_from_pc_fn): Delete type definition.
+ * target.h (memory_breakpoint_from_pc): Update declaration.
+ * config/mcore/tm-mcore.h (mcore_breakpoint_from_p): Ditto.
+
+ * arch-utils.c (legacy_breakpoint_from_pc): Update return type.
+ * mcore-tdep.c (mcore_breakpoint_from_pc): Ditto.
+ * mem-break.c (memory_breakpoint_from_pc): Ditto.
+ * rs6000-tdep.c (rs6000_breakpoint_from_pc): Ditto.
+ * s390-tdep.c (s390_breakpoint_from_pc): Ditto
+ * xstormy16-tdep.c (xstormy16_breakpoint_from_pc): Ditto.
+ * mn10300-tdep.c (mn10300_breakpoint_from_pc): Ditto.
+ * mips-tdep.c (mips_breakpoint_from_pc): Ditto.
+ * m68hc11-tdep.c (m68hc11_breakpoint_from_pc): Ditto.
+ * ia64-tdep.c (ia64_breakpoint_from_pc): Ditto.
+ * d10v-tdep.c (d10v_breakpoint_from_pc): Ditto.
+ * arch-utils.c (legacy_breakpoint_from_pc): Ditto..
+
+ * mem-break.c (default_memory_insert_breakpoint): Make `bp' a
+ const pointer.
+ * monitor.c (monitor_insert_breakpoint): Ditto.
+ * rs6000-tdep.c (rs6000_software_single_step): Ditto for `breakp'.
+
+ * config/mcore/tm-mcore.h: Update copyright.
+ * mem-break.c: Ditto.
+ * xstormy16-tdep.c: Ditto.
+
+2002-04-18 Pierre Muller <muller@ics.u-strasbg.fr>
+
+ * p-exp.y: Add precedence rule for '^' token.
+ This removes the shift/reduce conflicts.
+ Remove the comment concerning these shift/reduce conflicts.
+
+2002-04-18 Elena Zannoni <ezannoni@redhat.com>
+
+ * rs6000-tdep.c (COMMON_UISA_NOFP_REGS): New macro.
+ (registers_powerpc_nofp): New register set for processors
+ without floating point unit.
+
+2002-04-18 David S. Miller <davem@redhat.com>
+
+ * MAINTAINERS: Add myself to write-after-approval.
+
+2002-04-17 Michael Snyder <msnyder@redhat.com>
+
+ * MAINTAINERS: Add myself as co-maintainer of testsuite/gdb.asm.
+
+2002-04-17 Andrew Cagney <ac131313@redhat.com>
+
+ * rs6000-tdep.c (frame_initial_stack_address): Use
+ frame_register_read to read the alloca_reg.
+
+2002-04-17 Andrew Cagney <ac131313@redhat.com>
+
+ * frame.c (find_saved_register): Find saved registers in the next
+ not prev frame.
+ Fix PR gdb/365.
+
+2002-04-17 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.sh (LANG): Set to ``c''.
+
+2002-04-15 Andrew Cagney <ac131313@redhat.com>
+
+ * PROBLEMS: Mention hppa2.0-hp-hpux10.20 compile problems.
+
+2002-04-15 Andrew Cagney <ac131313@redhat.com>
+
+ * bcache.c: Include <stddef.h> and <stdlib.h> after "defs.h".
+ Update copyright.
+
+ * hpread.c (hpread_get_lntt): Add declaration.
+ Also fix PR gdb/391.
+
+2002-04-14 Andrew Cagney <ac131313@redhat.com>
+
+ * acinclude.m4 (AM_PROG_CC_STDC): Import from automake 1.6.
+ * aclocal.m4, configure: Re-generate.
+ Fix PR gdb/391.
+
+2002-04-14 Elena Zannoni <ezannoni@redhat.com>
+
+ * mi/mi-cmd-disas.c (dump_insns): Use TARGET_PRINT_INSN
+ instead of tm_print_insn.
+
+2002-04-14 Elena Zannoni <ezannoni@redhat.com>
+
+ * ppc-bdm.c (bdm_ppc_fetch_registers): Fix typo.
+
+2002-04-14 Andrew Cagney <ac131313@redhat.com>
+
+ * config/pa/tm-hppa.h (FRAME_CHAIN_COMBINE): Delete macro.
+ * blockframe.c (FRAME_CHAIN_COMBINE): Delete macro.
+ (get_prev_frame): Do not call FRAME_CHAIN_COMBINE.
+
+2002-04-12 Don Howard <dhoward@redhat.com>
+
+ * cli/cli-cmds.c (init_cli_cmds): Add new user settable value:
+ max_user_call_depth.
+ (init_cmd_lists): Initialize the new value;
+ * cli/cli-script.c (execute_user_command): Limit the call depth of
+ user defined commands. This avoids a core-dump when user commands
+ are infinitly recursive.
+
+2002-04-12 Kevin Buettner <kevinb@redhat.com>
+
+ * ppc-tdep.h (struct gdbarch_tdep): Add new member ``lr_frame_offset''.
+ * rs6000-tdep.c (rs6000_frame_saved_pc): Use ``lr_frame_offset''
+ from tdep struct instead of DEFAULT_LR_SAVE.
+ (rs6000_gdbarch_init): Initialize ``lr_frame_offset''.
+ * config/powerpc/tm-ppc-eabi.h (DEFAULT_LR_SAVE): Delete.
+ * config/rs6000/tm-rs6000.h (DEFAULT_LR_SAVE): Delete.
+
+2002-04-12 Michael Snyder <msnyder@redhat.com>
+
+ * Remote.c: Spelling fix.
+ * gcore.c (default_derive_heap_segment): Use bfd_section_name.
+ If no symbol found for "sbrk", try "_sbrk".
+ (make_output_phdrs): Use bfd_section_name.
+ (gcore_copy_callback): Use bfd_section_name.
+ * eval.c: Indentation fix-ups.
+ * d10v-tdep.c (d10v_make_iaddr): Make it idempotent,
+ in case it gets applied to an address that is already
+ in the instruction space.
+ * cli/cli-decode.c (help_list): Allow long lines to wrap.
+ * symfile.c: Fix indentation, long lines.
+ * source.c: White space fix-up.
+
+2002-04-12 Andrew Cagney <cagney@redhat.com>
+
+ * defs.h (read_relative_register_raw_bytes): Delete declaration.
+ * frame.c (frame_register_read): New function. Return non-zero on
+ success.
+ (read_relative_register_raw_bytes_for_frame): Delete.
+ (read_relative_register_raw_bytes): Delete.
+ * frame.h (frame_register_read): Declare.
+ * d30v-tdep.c: Update Copyright. Use frame_register_read.
+ * sh-tdep.c: Ditto.
+ * infcmd.c (do_registers_info): Ditto.
+ * hppa-tdep.c: Ditto.
+ * rs6000-tdep.c: Ditto.
+ * h8500-tdep.c: Ditto.
+ * mips-tdep.c: Ditto.
+ * h8300-tdep.c: Ditto.
+ * z8k-tdep.c: Ditto.
+
+2002-04-12 Kevin Buettner <kevinb@redhat.com>
+
+ From Jimi X <jimix@watson.ibm.com>:
+ * rs6000-tdep.c (rs6000_gdbarch_init): Use rs6000_* methods for
+ 64-bit SysV ABI.
+
+2002-04-12 Kevin Buettner <kevinb@redhat.com>
+
+ From Jimi X <jimix@watson.ibm.com>:
+ * rs6000-tdep.c (rs6000_gdbarch_init): Compute ``wordsize'' from
+ bfd info.
+
+2002-04-12 Kevin Buettner <kevinb@redhat.com>
+
+ From Jimi X <jimix@watson.ibm.com>:
+ * rs6000-tdep.c (powerpc64, 630, rs64ii, rs64iii): Define
+ register sets for these processor variants.
+
+2002-04-11 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdbserver/linux-low.c (usr_store_inferior_registers): Support
+ registers which are allowed to fail to store.
+ * gdbserver/linux-low.h (linux_target_ops): Likewise.
+ * gdbserver/linux-ppc-low.c (ppc_regmap): Support FPSCR.
+ (ppc_cannot_store_register): FPSCR may not be storable.
+ * regformats/reg-ppc.dat: Support FPSCR.
+
+2002-04-11 Kevin Buettner <kevinb@redhat.com>
+
+ * ppc-tdep.h (struct gdbarch_tdep): Add new field ``ppc_fpscr_regnum''.
+ * ppc-bdm.c (bdm_ppc_fetch_registers, bdm_ppc_store_registers):
+ Add fpscr as an invalid/unfetchable register.
+ * ppc-linux-nat.c (ppc_register_u_addr, store_register)
+ (fetch_ppc_registers, store_ppc_registers, supply_fpregset)
+ (fill_fpregset): Add support for register fpscr.
+ (fetch_ppc_registers, store_ppc_registers, supply_gregset)
+ (fill_gregset): Account for the fact that register ``mq'' might
+ not exist.
+ * rs6000-tdep.c (PPC_UISA_SPRS): Use (unused) slot 70 for fpscr.
+ (registers_power): Add fpscr to register set at slot 71.
+ (rs6000_gdbarch_init): Account for the fact that ``mq'' doesn't
+ exist on most PPC architectures. Initialize ppc_fpscr_regnum.
+
+2002-04-11 Michael Snyder <msnyder@redhat.com>
+
+ * configure.in: Autoconfiscate _SYSCALL32 define for solaris.
+ * configure: Regenerate.
+ * config.in: Regenerate.
+ * acconfig.h: Add define for _SYSCALL32.
+ * core-sol2.c: Remove #define _SYSCALL32.
+ * solib-legacy.c: Remove #define _SYSCALL32.
+
+2002-04-10 Andrew Cagney <ac131313@redhat.com>
+
+ * stack.c (select_frame): Cleanup internal error message, do not
+ use %p.
+
+2002-04-10 Andrew Cagney <ac131313@redhat.com>
+
+ * stack.c (select_frame): Check that selected_frame and the
+ specified level are as expected.
+ * blockframe.c (get_prev_frame): Set the `level' from next_frame.
+ Update copyright.
+ * frame.h (struct frame_info): Add field `level'. Update
+ copyright.
+ Work-in-progress PR gdb/464.
+
+2002-04-10 Andrew Cagney <ac131313@redhat.com>
+
+ * maint.c (maint_print_section_info): Rename print_section_info.
+ (print_bfd_section_info, print_objfile_section_info): Update.
+ * inferior.h (struct gdbarch): Add opaque declaration.
+ * gdbarch.sh: Add include of "inferior.h" to gdbarch.sh.
+ * gdbarch.h: Regenerate.
+
+2002-04-10 Michal Ludvig <mludvig@suse.cz>
+
+ * x86-64-linux-nat.c (child_resume, child_xfer_memory): Delete.
+ (PTRACE_XFER_TYPE): Moved to config/i386/nm-x86-64.h.
+ (kernel_u_size): Added.
+ * config/i386/nm-x86-64.h (CHILD_XFER_MEMORY, CHILD_RESUME): Delete.
+ (PTRACE_XFER_TYPE): Moved here from config/i386/nm-x86-64.h.
+
+2002-04-04 Jim Ingham <jingham@apple.com>
+
+ * valarith.c (find_size_for_pointer_math): New function, either returns
+ the size for a pointer's target, returns 1 for void *, or errors for
+ incomplete types.
+ (value_add, value_sub): use find_size_for_pointer_math.
+
+2002-04-09 Daniel Jacobowitz <drow@mvista.com>
+
+ * linux-low.c (linux_look_up_symbols): New hook.
+ (linux_target_ops): Add linux_look_up_symbols.
+ * remote-utils.c (decode_address): New function.
+ (look_up_one_symbol): New function.
+ * server.c (handle_query): Call target look_up_symbols hook.
+ * server.h (look_up_one_symbol): Add prototype.
+ * target.h (struct target_ops): Add look_up_symbols hook.
+
+2002-04-09 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdbserver/server.h: Include <string.h> if HAVE_STRING_H.
+ * ChangeLog: Correct paths in last ChangeLog entry.
+
+2002-04-09 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdbserver/linux-low.h: Remove obsolete prototypes.
+ (struct linux_target_ops): New.
+ (extern the_low_target): New.
+ * gdbserver/linux-low.c (num_regs, regmap): Remove declarations.
+ (register_addr): Use the_low_target explicitly.
+ (fetch_register): Likewise.
+ (usr_fetch_inferior_registers): Likewise.
+ (usr_store_inferior_registers): Likewise.
+ * gdbserver/linux-arm-low.c (num_regs): Remove.
+ (arm_num_regs): Define.
+ (arm_regmap): Renamed from regmap, made static.
+ (arm_cannot_fetch_register): Renamed from cannot_fetch_register,
+ made static.
+ (arm_cannot_store_register): Renamed from cannot_store_register,
+ made static.
+ (the_low_target): New.
+ * gdbserver/linux-i386-low.c (num_regs): Remove.
+ (i386_num_regs): Define.
+ (i386_regmap): Renamed from regmap, made static.
+ (i386_cannot_fetch_register): Renamed from cannot_fetch_register,
+ made static.
+ (i386_cannot_store_register): Renamed from cannot_store_register,
+ made static.
+ (the_low_target): New.
+ * gdbserver/linux-ia64-low.c (num_regs): Remove.
+ (ia64_num_regs): Define.
+ (ia64_regmap): Renamed from regmap, made static.
+ (ia64_cannot_fetch_register): Renamed from cannot_fetch_register,
+ made static.
+ (ia64_cannot_store_register): Renamed from cannot_store_register,
+ made static.
+ (the_low_target): New.
+ * gdbserver/linux-m68k-low.c (num_regs): Remove.
+ (m68k_num_regs): Define.
+ (m68k_regmap): Renamed from regmap, made static.
+ (m68k_cannot_fetch_register): Renamed from cannot_fetch_register,
+ made static.
+ (m68k_cannot_store_register): Renamed from cannot_store_register,
+ made static.
+ (the_low_target): New.
+ * gdbserver/linux-mips-low.c (num_regs): Remove.
+ (mips_num_regs): Define.
+ (mips_regmap): Renamed from regmap, made static.
+ (mips_cannot_fetch_register): Renamed from cannot_fetch_register,
+ made static.
+ (mips_cannot_store_register): Renamed from cannot_store_register,
+ made static.
+ (the_low_target): New.
+ * gdbserver/linux-ppc-low.c (num_regs): Remove.
+ (ppc_num_regs): Define.
+ (ppc_regmap): Renamed from regmap, made static.
+ (ppc_cannot_fetch_register): Renamed from cannot_fetch_register,
+ made static.
+ (ppc_cannot_store_register): Renamed from cannot_store_register,
+ made static.
+ (the_low_target): New.
+ * gdbserver/linux-s390-low.c (num_regs): Remove.
+ (s390_num_regs): Define.
+ (s390_regmap): Renamed from regmap, made static.
+ (s390_cannot_fetch_register): Renamed from cannot_fetch_register,
+ made static.
+ (s390_cannot_store_register): Renamed from cannot_store_register,
+ made static.
+ (the_low_target): New.
+ * gdbserver/linux-sh-low.c (num_regs): Remove.
+ (sh_num_regs): Define.
+ (sh_regmap): Renamed from regmap, made static.
+ (sh_cannot_fetch_register): Renamed from cannot_fetch_register,
+ made static.
+ (sh_cannot_store_register): Renamed from cannot_store_register,
+ made static.
+ (the_low_target): New.
+ * gdbserver/linux-x86-64-low.c (x86_64_regmap): Renamed from regmap.
+ (the_low_target): New.
+
+2002-04-09 Andrew Cagney <ac131313@redhat.com>
+
+ * frame.c (read_relative_register_raw_bytes_for_frame): Do not
+ override FP_REGNUM with frame->fp. Update copyright.
+ * parse.c (num_std_regs, std_regs): Delete.
+ (target_map_name_to_register): Do not search std_regs. Update
+ function description.
+ * parser-defs.h (num_std_regs, std_regs, struct std_regs): Delete
+ declarations. Update copyright.
+ Fix PR gdb/251.
+
+2002-04-09 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdbserver/Makefile.in: Add stamp-h target.
+ * gdbserver/configure.in: Create stamp-h.
+ * gdbserver/configure: Regenerated.
+
+2002-04-09 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdbserver/inferiors.c: New file.
+ * gdbserver/target.c: New file.
+ * gdbserver/target.h: New file.
+ * gdbserver/Makefile.in: Add target.o and inferiors.o. Update
+ dependencies.
+ * gdbserver/linux-low.c (inferior_pid): New static variable,
+ moved from server.c.
+ (linux_create_inferior): Renamed from create_inferior.
+ Call add_inferior. Return 0 on success instead of a PID.
+ (linux_attach): Renamed from myattach.
+ (linux_kill): Renamed from kill_inferior. Call clear_inferiors ().
+ (linux_thread_alive): Renamed from mythread_alive.
+ (linux_wait): Renamed from mywait. Call clear_inferiors () if the
+ child dies.
+ (linux_resume): Renamed from myresume. Add missing ``return 0''.
+ (regsets_store_inferior_registers): Correct error message.
+ Add missing ``return 0''.
+ (linux_fetch_registers): Renamed from fetch_inferior_registers.
+ (linux_store_registers): Renamed from store_inferior_registers.
+ (linux_read_memory): Renamed from read_inferior_memory.
+ (linux_write_memory): Renamed from write_inferior_memory.
+ (linux_target_ops): New structure.
+ (initialize_low): Call set_target_ops ().
+ * gdbserver/remote-utils.c (unhexify): New function.
+ (hexify): New function.
+ (input_interrupt): Send signals to ``signal_pid''.
+ * gdbserver/server.c (inferior_pid): Remove.
+ (start_inferior): Update create_inferior call.
+ (attach_inferior): Call add_inferior.
+ (handle_query): New function.
+ (main): Call handle_query for `q' packets.
+ * gdbserver/server.h: Include "target.h". Remove obsolete prototypes.
+ Add prototypes for "inferiors.c", "target.c", hexify, and unhexify.
+
+2002-04-09 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdbserver/Makefile.in: Add WARN_CFLAGS. Update configury
+ dependencies.
+ * gdbserver/configure.in: Check for <string.h>
+ * gdbserver/configure: Regenerate.
+ * gdbserver/config.in: Regenerate.
+ * gdbserver/gdbreplay.c: Include needed system headers.
+ (remote_open): Remove strchr prototype.
+ * gdbserver/linux-low.h: Correct #ifdef to HAVE_LINUX_USRREGS.
+ * gdbserver/regcache.c (supply_register): Change buf argument to const void *.
+ (supply_register_by_name): Likewise.
+ (collect_register): Change buf argument to void *.
+ (collect_register_by_name): Likewise.
+ * gdbserver/regcache.h: Add missing prototypes.
+ * gdbserver/remote-utils.c: Include <arpa/inet.h> for inet_ntoa.
+ * gdbserver/server.c (handle_query): New function.
+ (attached): New static variable, moved out of main.
+ (main): Quiet longjmp clobber warnings.
+ * gdbserver/server.h: Add ATTR_NORETURN and ATTR_FORMAT. Update prototypes.
+ * gdbserver/utils.c (error): Remove NORETURN.
+ (fatal): Likewise.
+
+2002-04-09 Daniel Jacobowitz <drow@mvista.com>
+
+ * symtab.h (ALL_BLOCK_SYMBOLS): Don't dereference the pointer
+ after the last symbol in a block.
+
+2002-04-09 Pierre Muller <muller@ics.u-strasbg.fr>
+
+ * p-exp.y (yylex): Handle also the fact that is_a_field_of_this
+ is non zero as a found symbol.
+
+2002-04-08 Andrew Cagney <ac131313@redhat.com>
+
+ * findvar.c: Include "builtin-regs.h".
+ (value_of_register): Call value_of_builtin_reg when applicable.
+ * parse.c: Include "builtin-regs.h" and "gdb_assert.h".
+ (target_map_name_to_register): Call
+ builtin_reg_map_name_to_regnum.
+ * Makefile.in (SFILES): Add builtin-regs.c and std-regs.c.
+ (COMMON_OBS): Add builtin-regs.o and std-regs.o.
+ (builtin_regs_h): Define.
+ (builtin-regs.o): New target.
+ (findvar.o): Add $(builtin_regs_h).
+ * builtin-regs.c, builtin-regs.h: New files.
+ * std-regs.c: New file.
+ Partial fix for PR gdb/251.
+
+2002-04-08 Kevin Buettner <kevinb@redhat.com>
+
+ * rs6000-tdep.c (rs6000_gdbarch_init): Don't set tm_print_insn;
+ it's no longer required.
+
+2002-04-08 Andrew Cagney <ac131313@redhat.com>
+
+ * Makefile.in (gdbtk-wrapper.o): Add missing dependencies.
+
+2002-04-08 Kevin Buettner <kevinb@redhat.com>
+
+ From Jimi X <jimix@watson.ibm.com>:
+ * rs6000-tdep.c (rs6000_software_single_step): Use
+ rs6000_breakpoint_from_pc() to fetch breakpoint instruction
+ and size. Use target_insert_breakpoint() and
+ target_remove_breakpoint() to insert and remove breakpoints
+ instead of explicit memory reads and writes.
+
+2002-04-08 Kevin Buettner <kevinb@redhat.com>
+
+ * config/powerpc/tm-ppc-eabi.h (ELF_OBJECT_FORMAT): Delete.
+ * rs6000-tdep.c (rs6000_push_arguments): Eliminate
+ ELF_OBJECT_FORMAT ifdef.
+
+2002-04-08 Kevin Buettner <kevinb@redhat.com>
+
+ From Jimi X <jimix@watson.ibm.com>:
+ * rs6000-tdep.c (rs6000_gdbarch_init): Use set_gdbarch_print_insn().
+
+2002-04-08 Kevin Buettner <kevinb@redhat.com>
+
+ From Jimi X <jimix@watson.ibm.com>:
+ * rs6000-tdep.c (rs6000_fix_call_dummy): Delete unused macro
+ definitions for TOC_ADDR_OFFSET and TARGET_ADDR_OFFSET.
+
+2002-04-07 Mark Kettenis <kettenis@gnu.org>
+
+ * fbsd-proc.c (child_pid_to_exec_file, fbsd_find_memory_regions):
+ s/asprintf/xasprintf/.
+ (fbsd_make_corefile_notes): s/strdup/xstrdup/.
+
+2002-04-07 Andrew Cagney <ac131313@redhat.com>
+
+ I believe Jeff Law denies responsability for this one:
+ * config/pa/hpux11w.mh (MH_CFLAGS): Add -Dvfork=fork.
+ * config/pa/hpux11.mh (MH_CFLAGS): Add -Dvfork=fork.
+ * config/pa/hpux1020.mh (MH_CFLAGS): Add -Dvfork=fork.
+ Work-around for PR gdb/366.
+
+2002-04-07 Elena Zannoni <ezannoni@redhat.com>
+
+ * remote-e7000.c (write_small, e7000_read_inferior_memory,
+ e7000_read_inferior_memory_large, e7000_insert_breakpoint,
+ e7000_remove_breakpoint): Use paddr_nz() to print addresses.
+
+2002-04-07 Elena Zannoni <ezannoni@redhat.com>
+
+ * sh-tdep.c (sh_fp_frame_init_saved_regs,
+ sh_nofp_frame_init_saved_regs): Use alloca() for 'where'
+ information.
+
+2002-04-07 Andrew Cagney <ac131313@redhat.com>
+
+ * MAINTAINERS (Misc): List Daniel Jacobowitz as the GDBSERVER
+ maintainer.
+
+2002-04-07 Andrew Cagney <ac131313@redhat.com>
+
+ * README (Reporting Bugs in GDB): Document the bug web page as the
+ prefered way of submitting bugs.
+ Fix PR gdb/402.
+
+2002-04-06 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.sh (FP_REGNUM, PC_REGNUM, SP_REGNUM): Allow default of
+ -1. Update comment.
+ * gdbarch.h, gdbarch.c: Re-generate.
+
+2002-04-07 Andreas Schwab <schwab@suse.de>
+
+ * m68klinux-nat.c (fill_fpregset): Properly pass address of
+ buffer to regcache_collect.
+
+2002-04-06 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.sh (PS_REGNUM): Add. Document. Default to -1.
+ * gdbarch.c, gdbarch.h: Re-generate.
+
+2002-04-06 Andrew Cagney <ac131313@redhat.com>
+
+ * symtab.c (lookup_symtab): Remove ``const'' from ``rp''
+ declaration. Fix -Werror.
+
+2002-04-05 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdbarch.sh (initialize_non_multiarch): Call init_gdbarch_swap.
+ * gdbarch.c: Regenerate.
+
+2002-04-05 Michael Snyder <msnyder@redhat.com>
+
+ * breakpoint.c (clear_command): Rewrite middle section to
+ combine two loops with identical control conditions.
+ Add a cleanup to eliminate a memory leak.
+ * cli/cli-dump.c (restore_section_callback): Use paddr_nz.
+
+2002-04-05 H.J. Lu (hjl@gnu.org)
+
+ * solib-svr4.c (bkpt_names): Add "__start".
+
+2002-04-04 Andrew Cagney <ac131313@redhat.com>
+
+ * sparc-tdep.c (sparc_push_dummy_frame): Use GDB_TARGET_IS_SPARC64
+ as test for 64 bit target.
+
+2002-04-05 Andrew Cagney <ac131313@redhat.com>
+
+ * h8500-tdep.c (h8500_write_fp): Delete function.
+ * dwarf2cfi.c (cfi_write_fp): Document as not used.
+ * mips-tdep.c (mips_gdbarch_init): Do not set write_fp.
+ * ia64-tdep.c (ia64_gdbarch_init): Do not set write_fp.
+ * m68hc11-tdep.c (m68hc11_gdbarch_init): Do not set write_fp.
+ * rs6000-tdep.c (rs6000_gdbarch_init): Do not set write_fp.
+ * s390-tdep.c (s390_gdbarch_init): Do not set write_fp.
+ (s390_write_fp):
+ * sh-tdep.c (sh_gdbarch_init): Do not set write_fp.
+ * x86-64-tdep.c (i386_gdbarch_init): Do not set write_fp.
+ * d10v-tdep.c (d10v_gdbarch_init): Do not set write_fp.
+ (d10v_write_fp): Delete function.
+ * inferior.h (write_fp, generic_target_write_fp): Delete
+ declarations.
+ * regcache.c (generic_target_write_fp): Delete function.
+ (write_fp): Delete function.
+ * gdbarch.sh (TARGET_WRITE_FP): Delete.
+ * gdbarch.h, gdbarch.c: Regenerate.
+ * config/v850/tm-v850.h (TARGET_WRITE_FP): Delete macro.
+ * config/sparc/tm-sp64.h (TARGET_WRITE_FP): Delete macro.
+ (sparc64_write_fp): Delete declaration.
+ * config/h8500/tm-h8500.h (TARGET_WRITE_FP): Delete macro.
+ (h8500_write_fp): Delete declaration.
+
+2002-04-04 Andrew Cagney <ac131313@redhat.com>
+
+ * sparc-tdep.c (sparc64_write_fp): Delete.
+ (sparc_push_dummy_frame): Replace write_fp call with code to store
+ the FP directly.
+ (sparc_gdbarch_init): Do not initialize write_fp.
+
+2002-04-05 Kevin Buettner <kevinb@redhat.com>
+
+ * rs6000-tdep.c (skip_prologue): Eliminate unused/unreachable
+ clause.
+
+2002-03-29 Jim Blandy <jimb@redhat.com>
+
+ * stack.c (get_selected_block): Add new argument `addr_in_block',
+ used to return the exact code address we used to select the block,
+ not just the block.
+ * blockframe.c (get_frame_block, get_current_block): Same.
+ * frame.h (get_frame_block, get_current_block,
+ get_selected_block): Update declarations.
+ * linespec.c, stack.c, blockframe.c, breakpoint.c, findvar.c,
+ linespec.c, varobj.c, printcmd.c, symtab.c: Callers changed.
+
+2002-04-05 Michael Snyder <msnyder@redhat.com>
+
+ * breakpoint.c (insert_breakpoints): Change 'hw' to 'hardware in
+ warning message.
+
+2002-04-05 J. Brobecker <brobecker@gnat.com>
+
+ * utils.c (xfullpath): New function.
+ * defs.h (xfullpath): Add declaration.
+ * source.c (openp): Use xfullpath in place of gdb_realpath to
+ avoid resolving the basename part of filenames when the
+ associated file is a symbolic link. This fixes a potential
+ inconsistency between the filenames known to GDB and the
+ filenames it prints in the annotations.
+ * symtab.c (lookup_symtab): Use the new xfullpath function, in order
+ to be able to match a filename with either the real filename, or
+ the name of any symbolic link to this file.
+ (lookup_partial_symtab): Ditto.
+
+2002-04-04 Michael Snyder <msnyder@redhat.com>
+
+ * breakpoint.c: Add support for hardware breakpoints in overlays.
+ (overlay_events_enabled): New state variable.
+ (insert_breakpoints): Use overlay_events_enabled to decide
+ whether to attempt to set a breakpoint at the overlay load addr.
+ Handle bp_hardware_breakpoint as well as bp_breakpoint.
+ (remove_breakpoint): Use overlay_events_enabled to decide
+ whether breakpoints need to be removed from overlay load addr.
+ Handle bp_hardware_breakpoint as well as bp_breakpoint.
+ (bpstat_stop_status): Handle bp_hardware_breakpoint in overlays.
+ (create_overlay_event_breakpoint, enable_overlay_breakpoints,
+ disable_overlay_breakpoints): Update overlay_events_enabled.
+
+2002-04-04 Daniel Jacobowitz <drow@mvista.com>
+
+ * dwarf2read.c (struct function_range): New.
+ (cu_first_fn, cu_last_fn, cu_cached_fn): New.
+ (check_cu_functions): New.
+ (read_file_scope): Initialize global function lists.
+ Call dwarf_decode_line after processing children.
+ (read_func_scope): Add to global function list.
+ (dwarf_decode_lines): Call check_cu_functions everywhere
+ record_line is called. Call record_line with a linenumber
+ of 0 to mark sequence ends.
+
+2002-04-04 Michal Ludvig <mludvig@suse.cz>
+
+ * x86-64-linux-nat.c (child_xfer_memory): x86-64 ptrace() ABI
+ change sync with glibc.
+
+2002-04-03 Jim Blandy <jimb@redhat.com>
+
+ * configure.in: Call AC_C_INLINE.
+ * configure: Regenerated.
+
+2002-04-01 Daniel Jacobowitz <drow@mvista.com>
+
+ * rs6000-tdep.c: Change #include of "bfd/libcoff.h"
+ and "bfd/libbfd.h" to "libcoff.h" and "libbfd.h".
+
+2002-03-31 Mark Kettenis <kettenis@gnu.org>
+
+ * NEWS: Mention gcore support on FreeBSD/i386.
+
+ * fbsd-proc.c: New file.
+ * config/i386/nm-fbsd.h (CHILD_PID_TO_EXEC_FILE): Define.
+ * config/i386/fbsd.mh (NATDEPFILES): Add gcore.o and fbsd-proc.o.
+
+ * lin-lwp.c (child_wait): Check SAVE_ERRNO instead of ERRNO in
+ while statement.
+
+2002-03-29 Jim Blandy <jimb@redhat.com>
+
+ * cli/cli-dump.c (_initialize_cli_dump): Older GCC's tolerate
+ unescaped newlines in string literals, but newer ones don't. So
+ escape them.
+
+2002-03-26 Michael Snyder <msnyder@redhat.com>
+ Andrew Cagney <cagney@redhat.com>
+
+ * cli/cli-dump.c: New file. Dump memory to file,
+ restore file to memory.
+ * cli/cli-dump.h: New file.
+ * Makefile.in: Add rules, dependencies for cli-dump.o.
+ * NEWS: Mention new commands.
+
+2002-03-28 Michael Snyder <msnyder@redhat.com>
+
+ * symfile.c (symbol_file_add): Move test for null symbols to later.
+
+2002-03-27 Andrew Cagney <ac131313@redhat.com>
+
+ From veksler at il.ibm.com:
+ * utils.c (gdb_realpath): If canonicalize_file_name fails, return
+ the xstrduped original path.
+ Fix PR gdb/417.
+
+2002-03-27 Michael Snyder <msnyder@redhat.com>
+
+ * breakpoint.c (_initialize_breakpoint): Clean up help string.
+ * infcmd.c (_initialize_infcmd): Ditto.
+ * language.c (_initialize_language): Ditto.
+ * symfile.c (_initialize_symfile): Ditto.
+ * top.c (_init_main): Ditto.
+ * cli/cli-cmds.c (init_cli_cmds): Ditto.
+
+2002-03-27 Elena Zannoni <ezannoni@redhat.com>
+
+ * rs6000-tdep.c (struct rs6000_framedata): Add fields for AltiVec
+ vector registers handling.
+ (skip_prologue): Handle new AltiVec instructions. Fill in new
+ fields of frame data.
+ (frame_get_saved_regs): Fill in information for AltiVec registers.
+
+2002-03-27 Jim Blandy <jimb@redhat.com>
+
+ * symtab.h (SYMBOL_INIT_MANGLED_NAME): Turn this macro's body into
+ a function; leave this macro here to invoke that function.
+ (symbol_init_mangled_name): Declaration for that function.
+ * symtab.c (symbol_init_mangled_name): New function.
+
+2002-03-27 Andrew Cagney <ac131313@redhat.com>
+
+ * valarith.c: Replace strerror with safe_strerror.
+ * tracepoint.c: Ditto.
+ * lin-lwp.c: Ditto.
+ * go32-nat.c: Ditto.
+ * inflow.c: Ditto.
+ * gnu-nat.c: Ditto.
+
+2002-03-27 Andreas Schwab <schwab@suse.de>
+
+ * event-top.c (command_line_handler): Remove useless if.
+
+2002-03-27 Andreas Jaeger <aj@suse.de>
+
+ * dwarf2cfi.c: Give credit to Daniel Berlin, reformat copyright
+ comment.
+
+2002-03-27 Michal Ludvig <mludvig@suse.cz>
+
+ * x86-64-tdep.h (X86_64_NUM_REGS, X86_64_NUM_GREGS): Delete #defines.
+ (x86_64_num_regs, x86_64_num_gregs): Added extern variables.
+ * x86-64-linux-nat.c (x86_64_regmap): Swapped RBX <> RDX, added DS, ES, FS, GS.
+ (x86_64_linux_dr_get_status, supply_gregset),
+ (fill_gregset): Changed X86_64_NUM_GREGS to x86_64_num_gregs.
+ * x86-64-tdep.c (x86_64_register_raw_size_table): Delete.
+ (x86_64_register_info_table): Add.
+ (X86_64_NUM_REGS, X86_64_NUM_GREGS): Add.
+ (x86_64_register_raw_size, x86_64_register_virtual_type),
+ (x86_64_register_name, _initialize_x86_64_tdep): Changed to reflect new
+ general x86_64_register_info_table.
+ (i386_gdbarch_init): gdbarch_register_bytes is now set
+ dynamicaly during initialization.
+ * regformats/reg-x86-64.dat: Synced with changes to registers above.
+ * gdbserver/linux-x86-64-low.c: Ditto.
+
+2002-03-27 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdbserver/server.c (main): Call target_signal_to_host_p
+ and target_signal_to_host on signals received from the remote.
+ * gdbserver/remote-utils.c (prepare_resume_reply): Call
+ target_signal_from_host on signals sent to the remote.
+ * gdbserver/server.h: Add prototypes. Include "gdb/signals.h".
+ * gdbserver/Makefile.in: Add signals.o. Add -I${INCLUDE_DIR}.
+
+2002-03-27 Daniel Jacobowitz <drow@mvista.com>
+
+ * signals/signals.c: Include "server.h" in gdbserver build.
+ (target_signal_from_name): Don't use STREQ.
+ (_initialize_signals): Likewise. Don't include function in
+ gdbserver build.
+
+2002-03-27 Daniel Jacobowitz <drow@mvista.com>
+
+ * signals.c: Moved to...
+ * signals/signals.c: Here.
+ * Makefile (signals.o): Update.
+
+2002-03-26 Jeff Law (law@redhat.com)
+
+ * somread.c (som_symtab_read): Remove some commented out code and
+ updated related comments. Do not set the minimal symbol table to
+ mst_solib_trampoline for ST_ENTRY symbols with SS_LOCAL scope
+ in a dynamic executable.
+ * hppa-tdep.c (find_proc_framesize): Sanely handle the case
+ where we are unable to find the minimal symbol for the given
+ PC value.
+
+2002-03-25 Jeff Law (law@redhat.com)
+
+ * linux-proc.c (read_mapping): Scan up to end of line for filename.
+
+2002-03-25 Michal Ludvig <mludvig@suse.cz>
+
+ * x86-64-tdep.c (x86_64_skip_prologue): Rewritten from scratch.
+
+2002-03-23 Andrew Cagney <ac131313@redhat.com>
+
+ * command.h: Update copyright.
+ (struct cmd_list_element): Replace definition with opaque
+ declaration.
+ (enum cmd_types): Document that it will eventually be moved to
+ cli/cli-decode.h
+ (CMD_DEPRECATED, DEPRECATED_WARN_USER): Delete macros.
+ (MALLOCED_REPLACEMENT): Delete macro.
+ * Makefile.in (cli_decode_h): Add $(command_h).
+ (top.o, completer.o, maint.o): Add dependency on $(cli_decode_h).
+ * top.c: Include "cli/cli-decode.h".
+ * completer.c: Include "cli/cli-decode.h".
+ * maint.c: Include "cli/cli-decode.h".
+ * cli/cli-decode.h: Include "command.h".
+ (enum command_class): Delete.
+ (enum cmd_types): Comment out.
+ (enum cmd_auto_boolean): Delete.
+ (enum var_types): Delete.
+
+2002-03-23 Andrew Cagney <ac131313@redhat.com>
+
+ * cli/cli-decode.c: Include "gdb_assert.h".
+ (add_set_or_show_cmd): New static function.
+ (add_set_cmd): Rewrite. Use add_set_or_show_cmd.
+ (add_show_from_set): Rewrite. Use add_set_or_show_cmd. Don't copy
+ all fields, such as func, from the set command.
+
+2002-03-23 Andrew Cagney <ac131313@redhat.com>
+
+ * MAINTAINERS (sh-elf): Change warning flag to -w.
+
+2002-03-23 Andrew Cagney <cagney@redhat.com>
+
+ * defs.h (error): Add printf format attribute.
+ * thread-db.c (thread_from_lwp): Fix error format string.
+ * stack.c (parse_frame_specification): Ditto.
+ * cli/cli-decode.c (undef_cmd_error): Ditto.
+ * scm-lang.c (scm_lookup_name): Ditto.
+ * tracepoint.c (trace_error): Ditto.
+ * remote-utils.c (usage): Ditto.
+ * remote.c (compare_sections_command): Ditto.
+ Fix PR gdb/328.
+
+2002-03-22 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbtypes.c (append_composite_type_field): New function.
+ (init_composite_type): New function.
+ * gdbtypes.h (append_composite_type_field): Declare.
+ (init_composite_type): Ditto.
+
+2002-03-22 Elena Zannoni <ezannoni@redhat.com>
+
+ * ppc-linux-tdep.c (ppc_sysv_abi_use_struct_convention): New
+ function.
+ * ppc-tdep.h (ppc_sysv_abi_use_struct_convention): Export.
+ * rs6000-tdep.c (rs6000_gdbarch_init): Use different
+ structure returning convention for SYSV ABI case, but not
+ for GNU/Linux, FreeBSD, or NetBSD.
+
+2002-03-22 Daniel Jacobowitz <drow@mvista.com>
+
+ * symtab.h (lookup_block_symbol): Add mangled_name argument
+ to prototype.
+
+ * symmisc.c (maintenance_check_symtabs): Call lookup_block_symbol
+ with new mangled_name argument.
+ * linespec.c (decode_line_1): Likewise.
+ * valops (value_of_this): Likewise.
+ * symtab.c (lookup_transparent_type): Likewise.
+ (lookup_symbol_aux): Likewise. Accept new mangled_name argument.
+ (lookup_symbol): If we are given a mangled name, pass it down
+ to lookup_symbol_aux.
+ (lookup_block_symbol): If we are given a mangled name to check
+ against, only return symbols which match it.
+
+2002-03-22 Christopher Faylor <cgf@redhat.com>
+
+ * win32-nat.c (child_create_inferior): Check for proper shell to use
+ here, in case the user changes it on the fly.
+ (_initialize_inftarg): Remove shell path considerations.
+
+2002-03-21 Elena Zannoni <ezannoni@redhat.com>
+
+ * rs6000-tdep.c (rs6000_gdbarch_init): Use correct max size value
+ for gdbarch_max_register_raw_size and max_register_virtual_size.
+ Adjust copyright year.
+
+2002-03-21 Daniel Jacobowitz <drow@mvista.com>
+
+ * dbxread.c (process_one_symbol): Extend the first N_SLINE
+ in a function to cover the entire beginning of the function
+ as well if it does not already.
+
+2002-03-21 Tom Rix <trix@redhat.com>
+
+ * rs6000-nat.c (rs6000_ptrace32): Renamed from ptrace32.
+ (rs6000_ptrace64): Renamed from ptrace64.
+
+2002-03-20 Martin M. Hunt <hunt@redhat.com>
+
+ * gdbserver/remote-utils.c (remote_open): Don't call
+ getprotobyname, we're all using TCP here so just use
+ IPPROTO_TCP.
+ * gdbserver/gdbreplay.c (remote_open): Ditto.
+
+2002-03-20 Martin M. Hunt <hunt@redhat.com>
+
+ * regcache.c (_initialize_regcache): No need to call
+ build_regcache() at this time; it gets called whenever
+ the gdbarch changes.
+
+2002-03-20 David O'Brien <obrien@FreeBSD.org>
+
+ * sparc-nat.c: Include sys/param.h where possible.
+
+2002-03-20 Daniel Jacobowitz <drow@mvista.com>
+
+ Fix PR gdb/422.
+ * c-lang.c (c_create_fundamental_type): Handle FT_COMPLEX,
+ FT_DBL_PREC_COMPLEX, and FT_EXT_PREC_COMPLEX.
+ * dwarf2read.c (read_base_type): Set TYPE_TARGET_TYPE for
+ complex types.
+ * stabsread.c (rs6000_builtin_type): Likewise.
+ (read_sun_floating_type): Likewise.
+
+2002-03-19 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ * stabsread.c (read_member_functions): Remove skip code for duplicate
+ constructor/destructor methods. Use standard parsing for these
+ methods and just do not chain them to the list of methods after
+ parsing.
+
+2002-03-19 Alexandre Oliva <aoliva@redhat.com>
* coffread.c: Remove redundant static declarations. Replace
occurrences of `PTR' with `void *'.
@@ -6,31 +2017,188 @@
* top.h (quit_cover): Likewise.
* defs.h (catch_errors): Likewise.
-2002-03-23 Andrew Cagney <ac131313@redhat.com>
+2002-03-18 Andrew Cagney <ac131313@redhat.com>
- * MAINTAINERS (sh-elf): Change warning flag to -w.
+ * defs.h (XMALLOC): Define.
+ * gdb-events.sh (XMALLOC): Delete macro.
+ * gdb-events.c, gdb-events.h: Regenerate.
+ * gdbarch.sh (XMALLOC): Delete macro.
+ * gdbarch.c: Regenerate.
+ * serial.c (XMALLOC): Delete macro.
+ * ui-file.c (XMALLOC): Ditto.
+ * ser-unix.h (XMALLOC): Ditto.
+ * sh-tdep.c (XMALLOC): Ditto.
+ * ui-out.c (XMALLOC): Ditto.
+ * utils.c (XMALLOC): Ditto.
+ * i386-tdep.c (XMALLOC): Ditto.
+ * gdb-events.c (XMALLOC): Ditto.
+ * d10v-tdep.c (XMALLOC): Ditto.
+ * cli-out.c (XMALLOC): Ditto.
+
+ * cli-out.c, d10v-tdep.c, gdb-events.c: Update copyright.
+ * gdb-events.sh, i386-tdep.c, ser-unix.h, serial.c: Ditto.
+ * ui-file.c, ui-out.c: Ditto.
+
+2002-03-18 Andrew Cagney <ac131313@redhat.com>
+
+ * command.h (struct cmd_list_element): Add field context.
+ (set_cmd_context, get_cmd_context): Declare.
+ * cli/cli-decode.h: Ditto.
+ * cli/cli-decode.c (get_cmd_context): New function.
+ (set_cmd_context): New function.
+ (add_cmd): Initialize context.
+ Part of fixing PR gdb/145 and PR gdb/146.
-2002-03-20 David O'Brien <obrien@FreeBSD.org>
+2002-03-17 Andrew Cagney <ac131313@redhat.com>
- * sparc-nat.c: Include sys/param.h where possible.
+ * cli/cli-decode.c (cmd_type): New function.
+ * command.h (cmd_type): Declare.
+ * infrun.c (set_schedlock_func): Call function cmd_type.
+ * kod.c (kod_set_os): Call cmd_type.
+ * cris-tdep.c (cris_version_update): Use function cmd_type.
+ (cris_mode_update, cris_abi_update): Ditto.
+
+ * command.h: (execute_cmd_post_hook): Declare.
+ (execute_cmd_pre_hook): Declare.
+ * cli/cli-script.c (clear_hook_in_cleanup): New function.
+ (execute_cmd_post_hook, execute_cmd_pre_hook): New
+ functions. Execute pre/post hook while ensuring that afterwords
+ hook_in is cleared.
+ * top.c (execute_command): Use execute_cmd_post_hook, and
+ execute_cmd_pre_hook to execute pre/post commands.
+ * infrun.c (normal_stop): Pass stop_command and not pre_hook to
+ hook_stop_stub.
+ (hook_stop_stub): Call execute_cmd_pre_hook.
+
+2002-03-17 Andrew Cagney <ac131313@redhat.com>
+
+ * kod.c (kod_set_os): Revert previous change. Is called by ``info
+ set'' and this leads to a core dump. Move xstrdup of
+ operating_system to after check that it is not NULL.
+
+2002-03-17 Andrew Cagney <ac131313@redhat.com>
+
+ * kod.c (kod_set_os): Remove unnecessary check that
+ ``command->type'' is set_cmd.
+
+ * valprint.c (set_input_radix): Use input_radix.
+ (set_output_radix): Use output_radix.
+ (set_input_radix_1, set_output_radix_1): Add FIXME - bad radix
+ isn't reverted.
+
+2002-03-16 Andrew Cagney <ac131313@redhat.com>
+
+ * value.h (struct value): Delete field ``substring_addr''. Change
+ aligner fields to force_doublest_align, force_longest_align,
+ force_core_addr_align and force_pointer_aligh.
+
+ * value.h (struct value): Fix typo in above change.
+
+2002-03-16 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ * ia64-tdep.c (ia64_gdbarch_init): Call set_gdbarch_frame_args_skip,
+ to fix internal_error from ``maintenance print architecture''.
+
+2002-03-16 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ * cp-valprint.c (cp_is_vtbl_ptr_type): Handle vtbl field type
+ for gcc versions after gcc-2.8.1.
+
+2002-03-16 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ * eval.c (evaluate_subexp_standard): Fix setup of ``this'' pointer
+ for method resolution. Restore adjustment of ``this'' pointer after
+ calling value_struct_elt, which was accidentally removed during the
+ HP merge.
+
+2002-03-15 Andrew Cagney <ac131313@redhat.com>
+
+ * eval.c (evaluate_subexp_standard): Pass ``selected_frame'' to
+ value_of_register.
+ * findvar.c (value_of_register): Add ``frame'' parameter. Pass to
+ get_saved_register.
+ * value.h (value_of_register): Update.
+
+2002-03-14 Richard Henderson <rth@redhat.com>
+
+ * configure.in: Detect declaration for canonicalize_file_name.
+ * utils.c (canonicalize_file_name): Declare, if needed.
+ (gdb_realpath): Prefer realpath if available and usable.
+ * config.in, configure: Rebuild.
+
+2002-03-14 Richard Henderson <rth@redhat.com>
+
+ * dwarf2read.c (read_array_type): Accept DW_FORM_data8 as
+ a constant array bound.
+
+ * MAINTAINERS: Add myself to write-after-approval.
+
+2002-03-14 Michael Snyder <msnyder@redhat.com>
+
+ * symfile.c (syms_from_objfile): Return immediately if no syms.
+ (symbol_file_add): Return immediately if no syms.
+ (find_sym_fns): Return immediately if no syms.
+
+2002-03-13 Michal Ludvig <mludvig@suse.cz>
+
+ * gdbserver/remote-util.c (remote_open): Print remote-side's
+ IP address when remote debugging over the network.
2002-03-12 David O'Brien <obrien@FreeBSD.org>
* config/sparc/fbsd.mh: Fix copyright.
* config/sparc/fbsd.mt: Likewise.
+2002-03-11 Richard Earnshaw <rearnsha@arm.com>
+
+ * MAINTAINERS: Fix typo in name of gdb warnings option.
+ (x86-64): Fix formating so that this can be parsed by awk.
+
+2002-03-10 Daniel Jacobowitz <drow@mvista.com>
+
+ * Makefile.in (defs_h): Add $(INCLUDE_DIR)/gdb/signals.h.
+ * defs.h: Include "gdb/signals.h".
+ (enum target_signal): Move to $(INCLUDE_DIR)/gdb/signals.h.
+
+2002-03-10 Michal Ludvig <mludvig@suse.cz>
+
+ * x86-64-tdep.h (sys/reg.h, x86_64_regmap): Moved to x86-64-linux-nat.c
+ * x86-64-linux-nat.c (sys/reg.h, x86_64_regmap): Moved here
+ from x86-64-tdep.h
+
+2002-03-10 Daniel Jacobowitz <drow@mvista.com>
+ Don Howard <dhoward@redhat.com>
+
+ * mips-tdep.c (ST0_FR): Define.
+ (mips2_fp_compat): New function, temporarily disabled.
+ (mips_read_fp_register_single): New function.
+ (mips_read_fp_register_double): New function.
+ (mips_print_register): Use them.
+ (do_fp_register_row): Likewise.
+
2002-03-09 Andrew Cagney <ac131313@redhat.com>
* MAINTAINERS: Add Jim Ingham and Klee Dienes to ``write after
approval''.
-2002-03-07 Daniel Jacobowitz <drow@mvista.com>
+2002-03-08 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
- * gdbserver/linux-low.c (PTRACE_XFER_TYPE): Change to long.
- (num_regs, regmap): Move inside HAVE_LINUX_USRREGS.
- (register_addr, REGISTER_RAW_SIZE): Likewise.
- (usr_store_inferior_registers): Use PTRACE_XFER_TYPE.
- * gdbserver/linux-x86-64-low.c: Remove extra #endif.
+ * stabsread.c (read_member_functions): Fix is_stub test for
+ static member functions, improve comment.
+
+2002-03-07 Richard Earnshaw <rearnsha@arm.com>
+
+ * remote-rdi.c (myprint): Replace 'PTR' with 'void *'.
+ (mywrite, mywritec, mypause, myreadc, mygets): Likewise.
+ (_initialize_remote_rdi): Use add_set_boolean_cmd to register
+ commands that set boolean values.
+ (arm_rdi_remove_breakpoint): Rewrite to avoid uninitialized warning.
+ (arm_rdi_resume): Always initialize PC.
+ (arm_rdi_open): Don't use rslt as a boolean.
+ (arm_rdi_create_inferior, arm_rdi_close, arm_rdi_resume)
+ (arm_rdi_fetch_registers, arm_rdi_store_registers)
+ (arm_rdi_xfer_memory, arm_rdi_files_info, arm_rdi_kill)
+ (arm_rdi_insert_breakpoint, arm_rdi_remove_breakpoint): Likewise.
2002-03-06 Alexandre Oliva <aoliva@redhat.com>
@@ -42,6 +2210,28 @@
* m68hc11-tdep.c (_initialize_m68hc11_tdep): Don't set tm_print_insn.
(m68hc11_gdbarch_init): But use set_gdbarch_print_insn instead.
+2002-03-06 Andrew Cagney <ac131313@redhat.com>
+
+ * cli/cli-decode.c (set_cmd_completer): New function.
+ * command.h (set_cmd_completer): Declare.
+ * cli/cli-decode.h (set_cmd_completer): Ditto.
+
+ * breakpoint.c (_initialize_breakpoint): Use set_cmd_completer.
+ * cli/cli-cmds.c (init_cli_cmds): Ditto.
+ * win32-nat.c (_initialize_inftarg): Ditto.
+ * remote-rdi.c (_initialize_remote_rdi): Ditto.
+ * proc-api.c (_initialize_proc_api): Ditto.
+ * hppa-tdep.c (_initialize_hppa_tdep): Ditto.
+ * source.c (_initialize_source): Ditto.
+ * exec.c (_initialize_exec): Ditto.
+ * solib.c (_initialize_solib): Ditto.
+ * top.c (init_main): Ditto.
+ * tracepoint.c (_initialize_tracepoint): Ditto.
+ * symfile.c (_initialize_symfile): Ditto.
+ * printcmd.c (_initialize_printcmd): Ditto.
+ * infcmd.c (_initialize_infcmd): Ditto.
+ * corefile.c (_initialize_core): Ditto.
+
2002-03-05 Andrew Cagney <ac131313@redhat.com>
* MAINTAINERS (Past Maintainers): Add Frank Ch. Eigler.
@@ -54,6 +2244,20 @@
* NEWS: Update headings, 5.2 has branched.
+2002-03-04 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdbserver/linux-low.c (PTRACE_XFER_TYPE): Change to long.
+ (num_regs, regmap): Move inside HAVE_LINUX_USRREGS.
+ (register_addr, REGISTER_RAW_SIZE): Likewise.
+ (usr_store_inferior_registers): Use PTRACE_XFER_TYPE.
+ * gdbserver/linux-x86-64-low.c: Remove extra #endif.
+
+2002-03-03 Michal Ludvig <mludvig@suse.cz>
+
+ * MAINTAINERS (x86-64): Add myself.
+ * x86-64-tdep.c (x86_64_push_arguments): Fixed typo naregs->nregs,
+ changed value_ptr -> struct value *
+
2002-03-01 David O'Brien <obrien@FreeBSD.org>
* configure.host (sparc64-*-freebsd): Add.
@@ -183,7 +2387,7 @@
* symfile.c (symfile_bfd_open): Ditto.
* solib.c (solib_map_sections): Ditto.
Fix PR gdb/354.
-
+
2002-02-26 Andrew Cagney <ac131313@redhat.com>
* remote.c (_initialize_remote): By default, disable ``e'' and
@@ -273,7 +2477,7 @@
* config/sparc/nm-linux.h, config/sparc/tm-linux.h: Ditto.
* config/sparc/tm-sp64linux.h, config/sparc/xm-linux.h: Ditto.
Fix PR gdb/378.
-
+
2002-02-23 Andrew Cagney <ac131313@redhat.com>
* lin-thread.c: Delete file.
@@ -310,7 +2514,7 @@
* config.in, configure: Regenerated.
* utils.c: (gdb_realpath) If HAVE_CANONICALIZE_FILE_NAME is
defined use canonicalize_file_name.
-
+
2002-02-23 Michael Chastain <mec@shout.net>
* MAINTAINERS: Remove Michael Chastain from "paper trail" list.
@@ -879,6 +3083,8 @@
2002-02-13 Michael Snyder <msnyder@redhat.com>
+ * config/i386/i386v42mp.mh: Add gcore.o to NATDEPFILES.
+
* gcore.c (gcore_command): Use gcore_default_target instead of NULL.
(default_gcore_mach): Just return 0, work around a problem in bfd.
(default_gcore_target): OK to return NULL if exec_bfd is null.
diff --git a/gdb/MAINTAINERS b/gdb/MAINTAINERS
index 1fa070d..fbfaa8b 100644
--- a/gdb/MAINTAINERS
+++ b/gdb/MAINTAINERS
@@ -54,11 +54,10 @@ variants. *-tdep.c. The Target/Architecture maintainer works with the
host maintainer when resolving build issues. The Target/Architecture
maintainer works with the native maintainer when resolving API issues.
- a29k OBSOLETE
+ a29k Deleted.
alpha --target=alpha-dec-osf4.0a -Werror
Maintenance only
- OBSOLETE candidate, not multi-arch
arc --target=arc-elf ,-Werror
Maintenance only
@@ -70,6 +69,9 @@ maintainer works with the native maintainer when resolving API issues.
Richard Earnshaw rearnsha@arm.com
Not multi-arch
+ avr --target=avr ,-Werror
+ Theodore A. Roth troth@verinet.com
+
cris --target=cris-elf -w
Orjan Friberg orjanf@axis.com
@@ -166,7 +168,6 @@ maintainer works with the native maintainer when resolving API issues.
vax --target=vax-dec-vms5.5 ,-Werror
Maintenance only
- OBSOLETE candidate, not multi-arch
w65 Deleted.
@@ -204,7 +205,7 @@ The GAWK segment:
}'
can be used to generate a full list of --target=
---enable-gdb-build-warning= pairs.
+--enable-gdb-build-warnings= pairs.
@@ -235,6 +236,7 @@ GNU/Linux m68k Andreas Schwab schwab@suse.de
FreeBSD native & host Mark Kettenis kettenis@gnu.org
David O'Brien obrien@freebsd.org
hurd native Mark Kettenis kettenis@gnu.org
+NetBSD native & host Jason Thorpe thorpej@wasabisystems.com
SCO/Unixware Robert Lipe rjl@sco.com
GNU/Linux ARM native Scott Bambrough scottb@netwinder.org
Solaris/x86 native & host (devolved)
@@ -324,6 +326,8 @@ tui (vacant)
Misc:
+gdb/gdbserver Daniel Jacobowitz dan@debian.org
+
Web pages. Jim Kingdon jkingdon@engr.sgi.com ++
(anyone can edit; kingdon is just lead maintainer)
@@ -356,6 +360,7 @@ Richard Earnshaw rearnsha@arm.com
Matthew Green mrg@eterna.com.au
Orjan Friberg orjanf@axis.com
Ben Harris bjh21@netbsd.org
+Richard Henderson rth@redhat.com
Paul Hilfinger hilfinger@gnat.com
Matt Hiller hiller@redhat.com
Kazu Hirata kazu@hxi.com
@@ -376,6 +381,7 @@ Jason Molenda jmolenda@apple.com
Pierre Muller muller@sources.redhat.com
Alexandre Oliva aoliva@redhat.com
Tom Rix trix@redhat.com
+Theodore A. Roth troth@verinet.com
Mark Salter msalter@redhat.com
Andreas Schwab schwab@suse.de
Keith Seitz keiths@redhat.com
@@ -389,6 +395,8 @@ Jason Thorpe thorpej@wasabisystems.com
Tom Tromey tromey@redhat.com
Corinna Vinschen vinschen@redhat.com
Keith Walker keith.walker@arm.com
+Michal Ludvig mludvig@suse.cz
+David S. Miller davem@redhat.com
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 9ae5582..de30f43 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -137,8 +137,10 @@ INTL_CFLAGS = -I$(INTL_DIR) -I$(INTL_SRC)
# CLI sub directory definitons
#
SUBDIR_CLI_OBS = \
+ cli-dump.o \
cli-decode.o cli-script.o cli-cmds.o cli-setshow.o cli-utils.o
SUBDIR_CLI_SRCS = \
+ cli/cli-dump.c \
cli/cli-decode.c cli/cli-script.c cli/cli-cmds.c cli/cli-setshow.c \
cli/cli-utils.c
SUBDIR_CLI_DEPS =
@@ -412,6 +414,10 @@ FLAGS_TO_PASS = \
"prefix=$(prefix)" \
"exec_prefix=$(exec_prefix)" \
"infodir=$(infodir)" \
+ "libdir=$(libdir)" \
+ "mandir=$(mandir)" \
+ "datadir=$(datadir)" \
+ "includedir=$(includedir)" \
"against=$(against)" \
"AR=$(AR)" \
"AR_FLAGS=$(AR_FLAGS)" \
@@ -534,7 +540,7 @@ SFILES = ax-general.c ax-gdb.c bcache.c blockframe.c breakpoint.c \
memattr.c mem-break.c minsyms.c mipsread.c nlmread.c objfiles.c \
p-exp.y p-lang.c p-typeprint.c p-valprint.c parse.c \
printcmd.c remote.c remote-nrom.c scm-exp.c scm-lang.c \
- scm-valprint.c signals.c source.c stabsread.c stack.c symfile.c \
+ scm-valprint.c source.c stabsread.c stack.c symfile.c \
symmisc.c symtab.c linespec.c target.c thread.c top.c tracepoint.c \
typeprint.c utils.c valarith.c valops.c valprint.c values.c \
serial.c ser-unix.c mdebugread.c os9kread.c \
@@ -548,6 +554,7 @@ SFILES = ax-general.c ax-gdb.c bcache.c blockframe.c breakpoint.c \
tui/tui-file.h tui/tui-file.c tui/tui-out.c tui/tui-hooks.c \
ui-file.h ui-file.c \
frame.c doublest.c \
+ builtin-regs.c std-regs.c \
gnu-v2-abi.c gnu-v3-abi.c hpacc-abi.c cp-abi.c
LINTFILES = $(SFILES) $(YYFILES) $(CONFIG_SRCS) init.c
@@ -587,12 +594,14 @@ annotate_h = annotate.h $(symtab_h) $(gdbtypes_h)
arch_utils_h = arch-utils.h
ax_h = ax.h $(doublest_h)
bcache_h = bcache.h
+builtin_regs_h = builtin-regs.h
breakpoint_h = breakpoint.h $(frame_h) $(value_h)
buildsym_h = buildsym.h
c_lang_h = c-lang.h $(value_h)
call_cmds_h = call-cmds.h
cli_cmds_h = $(srcdir)/cli/cli-cmds.h
-cli_decode_h = $(srcdir)/cli/cli-decode.h
+cli_decode_h = $(srcdir)/cli/cli-decode.h $(command_h)
+cli_dump_h = $(srcdir)/cli/cli-dump.h
cli_out_h = cli-out.h
cli_script_h = $(srcdir)/cli/cli-script.h
cli_setshow_h = $(srcdir)/cli/cli-setshow.h
@@ -603,7 +612,7 @@ completer_h = completer.h
cp_abi_h = cp-abi.h
dcache_h = dcache.h
defs_h = defs.h $(xm_h) $(tm_h) $(nm_h) config.status config.h \
- gdbarch.h ui-file.h
+ gdbarch.h ui-file.h $(INCLUDE_DIR)/gdb/signals.h
doublest_h = doublest.h $(floatformat_h)
dwarf2cfi_h = dwarf2cfi.h
event_loop_h = event-loop.h
@@ -705,6 +714,7 @@ COMMON_OBS = version.o blockframe.o breakpoint.o findvar.o regcache.o \
event-loop.o event-top.o inf-loop.o completer.o \
gdbarch.o arch-utils.o gdbtypes.o copying.o $(DEPFILES) \
memattr.o mem-break.o target.o parse.o language.o $(YYOBJ) buildsym.o \
+ builtin-regs.o std-regs.o \
signals.o \
kod.o kod-cisco.o \
gdb-events.o \
@@ -839,6 +849,7 @@ init.c: $(INIT_FILES)
-e '/^[a-z0-9A-Z_]*_[SU].o/d' \
-e '/[a-z0-9A-Z_]*-exp.tab.o/d' \
-e 's/\.o/.c/' \
+ -e 's,signals\.c,signals/signals\.c,' \
-e 's|\([^ ][^ ]*\)|$(srcdir)/\1|g' | \
while read f; do grep '^_initialize_[a-z_0-9A-Z]* *(' $$f 2>/dev/null; done | \
sed -e 's/^.*://' -e 's/^\([a-z_0-9A-Z]*\).*/\1/' > init.l-tmp
@@ -1166,9 +1177,13 @@ unexport CHILLFLAGS CHILL_LIB CHILL_FOR_TARGET :
ALLDEPFILES = 29k-share/udi/udip2soc.c 29k-share/udi/udr.c \
29k-share/udi/udi2go32.c \
- a29k-tdep.c a68v-nat.c alpha-nat.c alpha-tdep.c \
- arm-linux-nat.c arm-linux-tdep.c arm-tdep.c armnbsd-nat.c \
- armnbsd-tdep.c \
+ a29k-tdep.c a68v-nat.c \
+ alpha-nat.c alphabsd-nat.c alphanbsd-nat.c \
+ alpha-tdep.c alpha-linux-tdep.c alphanbsd-tdep.c alpha-osf1-tdep.c \
+ alphafbsd-tdep.c \
+ arm-linux-nat.c arm-linux-tdep.c arm-tdep.c \
+ armnbsd-nat.c armnbsd-tdep.c \
+ avr-tdep.c \
coff-solib.c \
core-sol2.c core-regset.c core-aout.c corelow.c \
dcache.c delta68-nat.c dpx2-nat.c dstread.c exec.c fork-child.c \
@@ -1224,18 +1239,30 @@ udi2go32.o: $(srcdir)/29k-share/udi/udi2go32.c $(udiheaders)
udr.o: $(srcdir)/29k-share/udi/udr.c $(udiheaders)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/29k-share/udi/udr.c
-# OBSOLETE a29k-tdep.o: a29k-tdep.c $(gdbcmd_h) $(gdbcore_h) $(inferior_h) $(defs_h) \
-# OBSOLETE $(regcache_h)
-
a68v-nat.o: a68v-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) \
$(regcache_h)
alpha-nat.o: alpha-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) $(target_h) \
- $(regcache_h)
+ $(regcache_h) alpha-tdep.h
+
+alphabsd-nat.o: alphabsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
+ alpha-tdep.h
+
+alphanbsd-nat.o: alphanbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
+ $(gdbcore_h) alpha-tdep.h
alpha-tdep.o: alpha-tdep.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) \
$(inferior_h) $(symtab_h) $(dis_asm_h) $(gdb_string_h) $(linespec_h) \
- $(regcache_h) $(doublest_h)
+ $(regcache_h) $(doublest_h) $(BFD_SRC)/elf-bfd.h alpha-tdep.h
+
+alpha-linux-tdep.o: alpha-linux-tdep.c $(defs_h) $(value_h) alpha-tdep.h
+
+alpha-osf1-tdep.o: alpha-osf1-tdep.c $(defs_h) $(value_h) alpha-tdep.h
+
+alphafbsd-tdep.o: alphafbsd-tdep.c $(defs_h) $(value_h) alpha-tdep.h
+
+alphanbsd-tdep.o: alphanbsd-tdep.c $(defs_h) $(gdbcore_h) $(value_h) \
+ alpha-tdep.h
annotate.o: annotate.c $(defs_h) $(annotate_h) $(value_h) $(target_h) $(gdbtypes_h)
@@ -1256,6 +1283,9 @@ armnbsd-nat.o: armnbsd-nat.c $(defs_h) arm-tdep.h $(inferior_h) $(regcache_h) \
armnbsd-tdep.o: armnbsd-tdep.c $(defs_h) arm-tdep.h
+avr-tdep.o: avr-tdep.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) $(inferior_h) \
+ $(symfile_h) $(regcache_h) $(arch_utils_h)
+
bcache.o: bcache.c $(bcache_h) $(defs_h)
blockframe.o: blockframe.c $(defs_h) $(gdbcore_h) $(inferior_h) \
@@ -1269,6 +1299,9 @@ breakpoint.o: breakpoint.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) \
buildsym.o: buildsym.c $(bfd_h) $(buildsym_h) $(complaints_h) $(defs_h) \
$(objfiles_h) $(symfile_h) $(symtab_h) $(gdb_string_h)
+builtin-regs.o: builtin-regs.c $(defs.h) $(builtin_regs_h) $(gdbtypes_h) \
+ $(gdb_string_h) $(value_h) $(frame_h)
+
c-lang.o: c-lang.c $(c_lang_h) $(defs_h) $(expression_h) $(gdbtypes_h) \
$(language_h) $(parser_defs_h) $(symtab_h)
@@ -1391,7 +1424,7 @@ event-loop.o: event-loop.c $(defs_h) $(top_h) $(event_loop_h) $(event_top_h)
event-top.o: event-top.c $(top_h) $(readline_headers) \
$(defs_h) $(inferior_h) $(event_loop_h) $(event_top_h) $(terminal_h) \
- $(gdbcmd_h) $(target_h)
+ $(gdbcmd_h) $(target_h) $(cli_decode_h)
inf-loop.o: inf-loop.c $(defs_h) $(inferior_h) $(inf_loop_h) $(event_loop_h) \
$(event_top_h)
@@ -1403,7 +1436,7 @@ expprint.o: expprint.c $(defs_h) $(expression_h) $(gdbtypes_h) \
$(language_h) $(parser_defs_h) $(symtab_h) $(value_h)
findvar.o: findvar.c $(defs_h) $(gdbcore_h) $(inferior_h) $(target_h) \
- $(gdb_string_h) $(regcache_h)
+ $(gdb_string_h) $(regcache_h) $(builtin_regs_h)
frame.o: frame.c $(defs_h) $(frame_h) $(target_h) $(value_h) $(inferior_h) \
$(regcache_h)
@@ -1494,7 +1527,8 @@ gdbtk-varobj.o: $(srcdir)/gdbtk/generic/gdbtk-varobj.c \
$(srcdir)/gdbtk/generic/gdbtk-varobj.c
gdbtk-wrapper.o: $(srcdir)/gdbtk/generic/gdbtk-wrapper.c \
- $(srcdir)/gdbtk/generic/gdbtk-wrapper.h
+ $(srcdir)/gdbtk/generic/gdbtk-wrapper.h \
+ $(defs_h) $(frame_h) $(value_h)
$(CC) -c $(INTERNAL_CFLAGS) $(IDE_CFLAGS) $(GDBTK_CFLAGS)\
$(srcdir)/gdbtk/generic/gdbtk-wrapper.c
@@ -1709,7 +1743,8 @@ main.o: main.c $(top_h) $(defs_h) $(gdb_string_h) $(event_loop_h) \
$(symfile_h) $(gdbcore_h) $(ui_out_h)
maint.o: maint.c $(defs_h) $(gdbcmd_h) $(gdbtypes_h) $(symtab_h) \
- $(language_h) $(expression_h) $(objfiles_h) $(symfile_h)
+ $(language_h) $(expression_h) $(objfiles_h) $(symfile_h) \
+ $(cli_decode_h)
mcore-tdep.o: mcore-tdep.c $(defs_h) $(frame_h) $(gdbcmd_h) $(value_h) \
$(symtab_h) $(symfile_h) $(gdbcore_h) $(inferior_h)
@@ -1798,6 +1833,9 @@ somread.o: somread.c $(bfd_h) $(buildsym_h) $(complaints_h) $(defs_h) \
somsolib.o: somsolib.c $(defs_h) $(regcache_h)
+std-regs.o: std-regs.c $(defs_h) $(builtin_regs_h) $(frame_h) \
+ $(gdbtypes_h) $(value_h)
+
pa64solib.o: pa64solib.c $(defs_h) $(regcache_h)
hpux-thread.o: hpux-thread.c $(defs_h) $(gdbthread_h) $(target_h) inferior.h \
@@ -1862,9 +1900,6 @@ lin-lwp.o: lin-lwp.c $(defs_h) gdb_assert.h gdb_wait.h $(gdbthread_h) \
proc-service.o: proc-service.c $(defs_h) $(inferior_h) gdb_proc_service.h \
$(symtab_h) $(target_h) gregset.h
-# OBSOLETE remote-adapt.o: remote-adapt.c $(defs_h) $(gdbcore_h) \
-# OBSOLETE $(inferior_h) $(target_h) $(terminal_h) $(gdb_string_h) $(regcache_h)
-
remote-array.o: remote-array.c $(defs_h) $(gdbcore_h) $(target_h) \
$(gdb_string_h) $(command_h) $(serial_h) $(monitor_h) $(remote_utils_h) \
$(version_h) $(regcache_h)
@@ -1892,10 +1927,6 @@ remote-bug.o: remote-bug.c $(defs_h) $(gdbcore_h) $(serial_h) \
remote-e7000.o: remote-e7000.c $(defs_h) $(gdbcore_h) $(target_h) \
$(serial_h) $(gdb_string_h) $(regcache_h)
-# OBSOLETE remote-eb.o: remote-eb.c $(srcdir)/config/a29k/tm-a29k.h \
-# OBSOLETE $(defs_h) $(gdbcore_h) $(inferior_h) $(symfile_h) $(target_h) \
-# OBSOLETE $(terminal_h) $(gdb_string_h) $(regcache_h)
-
remote-es.o: remote-es.c $(bfd_h) $(command_h) $(defs_h) \
$(inferior_h) $(remote_utils_h) $(terminal_h) $(gdb_string_h) \
$(symfile_h) $(regcache_h) $(value_h)
@@ -1910,9 +1941,6 @@ remote-mips.o: remote-mips.c $(defs_h) $(gdbcmd_h) \
$(gdbcore_h) $(inferior_h) $(serial_h) $(symfile_h) $(target_h) \
$(regcache_h)
-# OBSOLETE remote-mm.o: remote-mm.c $(bfd_h) $(defs_h) $(inferior_h) \
-# OBSOLETE minimon.h $(target_h) $(terminal_h) $(gdb_string_h) $(regcache_h)
-
remote-nindy.o: remote-nindy.c $(floatformat_h) $(command_h) \
$(defs_h) $(gdbcore_h) $(inferior_h) \
nindy-share/env.h nindy-share/stop.h $(remote_utils_h) \
@@ -1933,10 +1961,6 @@ remote-sim.o: remote-sim.c $(defs_h) $(gdbcore_h) \
remote-st.o: remote-st.c $(defs_h) $(gdbcore_h) $(serial_h) \
$(target_h) $(gdb_string_h) $(regcache_h)
-# OBSOLETE remote-udi.o: remote-udi.c $(bfd_h) $(defs_h) $(gdbcmd_h) \
-# OBSOLETE $(inferior_h) $(target_h) $(terminal_h) $(udiheaders) $(gdb_string_h) \
-# OBSOLETE $(regcache_h)
-
remote-vx.o: remote-vx.c $(complaints_h) $(defs_h) $(gdbcmd_h) \
$(gdbcore_h) $(inferior_h) $(target_h) vx-share/dbgRpcLib.h \
vx-share/ptrace.h vx-share/xdr_ld.h vx-share/xdr_ptrace.h \
@@ -2008,7 +2032,8 @@ sh3-rom.o: sh3-rom.c $(monitor_h) $(bfd_h) gdb_wait.h $(defs_h) $(gdbcmd_h) \
$(inferior_h) $(target_h) $(serial_h) $(terminal_h) $(arch_utils_h) \
$(regcache_h)
-signals.o: signals.c $(defs_h) $(target_h)
+signals.o: signals/signals.c $(defs_h) $(target_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $<
mon960-rom.o: mon960-rom.c $(monitor_h) $(bfd_h) gdb_wait.h $(defs_h) \
$(gdbcmd_h) $(inferior_h) $(target_h) $(serial_h) $(terminal_h)
@@ -2094,7 +2119,8 @@ thread.o: thread.c $(defs_h) $(gdbthread_h) $(gdbcmd_h) $(target_h) \
$(regcache_h) $(ui_out_h) $(gdb_h)
completer.o: completer.c $(completer_h) $(gdbtypes_h) $(symtab_h) \
- $(defs_h) $(gdbcmd_h) $(expression_h) $(readline_headers)
+ $(defs_h) $(gdbcmd_h) $(expression_h) $(readline_headers) \
+ $(cli_decode_h)
top.o: top.c $(top_h) $(bfd_h) $(getopt_h) $(readline_headers) $(call_cmds_h) \
$(cli_cmds_h) $(cli_script_h) $(cli_setshow_h) \
@@ -2126,7 +2152,8 @@ values.o: values.c $(defs_h) $(expression_h) $(frame_h) $(gdbcmd_h) \
$(gdbcore_h) $(gdbtypes_h) $(symtab_h) $(target_h) $(value_h) \
$(gdb_string_h) scm-lang.h $(doublest_h)
-vax-tdep.o: vax-tdep.c $(OP_INCLUDE)/vax.h $(defs_h) $(symtab_h)
+vax-tdep.o: vax-tdep.c $(OP_INCLUDE)/vax.h $(defs_h) $(symtab_h) \
+ $(arch_utils_h) $(inferior_h) vax-tdep.h
x86-64-linux-tdep.o : x86-64-linux-tdep.c $(defs_h) $(inferior_h) \
$(gdbcore_h) $(regcache_h) x86-64-tdep.h i386-tdep.h $(dwarf2cfi_h)
@@ -2208,15 +2235,19 @@ wrapper.o: wrapper.c $(defs_h) $(frame_h) $(value_h) $(wrapper_h)
# Need to explicitly specify the compile rule as make will do nothing
# or try to compile the object file into the cli directory.
+cli-cmds.o: $(srcdir)/cli/cli-cmds.c $(cli_cmds_h) $(cli_decode_h) \
+ $(cli_script_h) $(cli_setshow_h) $(top_h) $(completer_h) \
+ $(defs_h) $(target_h) gdb_wait.h gdb_regex.h $(ui_out_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-cmds.c
+
cli-decode.o: $(srcdir)/cli/cli-decode.c $(cli_decode_h) \
$(cli_cmds_h) $(defs_h) $(ui_out_h) \
$(symtab_h) gdb_regex.h
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-decode.c
-cli-cmds.o: $(srcdir)/cli/cli-cmds.c $(cli_cmds_h) $(cli_decode_h) \
- $(cli_script_h) $(cli_setshow_h) $(top_h) $(completer_h) \
- $(defs_h) $(target_h) gdb_wait.h gdb_regex.h $(ui_out_h)
- $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-cmds.c
+cli-dump.o: $(srcdir)/cli/cli-dump.c $(defs_h) $(gdb_string_h) $(command_h) \
+ $(value_h) $(gdbcmd_h) $(completer_h) $(cli_dump_h)
+ $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-dump.c
cli-setshow.o: $(srcdir)/cli/cli-setshow.c $(cli_setshow_h) \
$(cli_decode_h) $(cli_cmds_h) $(defs_h) \
diff --git a/gdb/NEWS b/gdb/NEWS
index 8e514d5..b4076f7 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -1,6 +1,56 @@
What has changed in GDB?
(Organized release by release)
+*** Changes since GDB 5.2:
+
+* New targets.
+
+Atmel AVR avr*-*-*
+
+* New native configurations
+
+Alpha NetBSD alpha*-*-netbsd*
+
+* OBSOLETE configurations and files
+
+Configurations that have been declared obsolete in this release have
+been commented out. Unless there is activity to revive these
+configurations, the next release of GDB will have their sources
+permanently REMOVED.
+
+* REMOVED configurations and files
+
+AMD 29k family via UDI a29k-amd-udi, udi29k
+A29K VxWorks a29k-*-vxworks
+AMD 29000 embedded, using EBMON a29k-none-none
+AMD 29000 embedded with COFF a29k-none-coff
+AMD 29000 embedded with a.out a29k-none-aout
+
+testsuite/gdb.hp/gdb.threads-hp/ directory
+
+* Changes in VAX configurations.
+
+Multi-arch support is enabled for all VAX configurations.
+
+* Changes in Alpha configurations.
+
+Multi-arch support is enabled for all Alpha configurations.
+
+* New command "set max-user-call-depth <nnn>"
+
+This command allows the user to limit the call depth of user-defined
+commands. The default is 1024.
+
+* Changes in FreeBSD/i386 native debugging.
+
+Support for the "generate-core-file" has been added.
+
+* New commands "dump", "append", and "restore".
+
+These commands allow data to be copied from target memory
+to a bfd-format or binary file (dump and append), and back
+from a file into memory (restore).
+
*** Changes in GDB 5.2:
* New command "set trust-readonly-sections on[off]".
diff --git a/gdb/PROBLEMS b/gdb/PROBLEMS
index 6b7d72a..09c62e1 100644
--- a/gdb/PROBLEMS
+++ b/gdb/PROBLEMS
@@ -1,59 +1,20 @@
- Known problems in GDB 5.1.1
+ Known problems in GDB 5.2
-See also the bug database http://www.gnu.org/software/gdb/bugs/
-
-
-Contrary to the GDB 5.1.1 announcement, the update did not contain
-fixes to a i386 floating point problem. The latest sources do contain
-the fix and it will be included in GDB 5.2.
-
-
- Known problems in GDB 5.1
+ See also: http://www.gnu.org/software/gdb/bugs/
hppa2.0-hp-hpux10.20
+--------------------
-Due to a problem (conflicting types) with libiberty/regex.c, GDB 5.1
-does not build on HP/UX 10.20 when using the HP supplied compiler.
-
-Due to bit rot, GDB 5.1 does not work on HP/UX 10.20 when built with
-GCC.
-
-
-hppa2.0w-hp-hpux11.00
-
-Due to a problem with ltconfig and long argument lines, GDB 5.1 does
-not configure on HP/UX 11.00.
-
-
-alpha-dec-osf5.1
-
-GDB 5.1 has a number of problems on this platform (Ref PR gdb/237). A
-GDB 5.1 built with ``CC="cc -DUSE_LDR_ROUTINES"'' is reported to work
-much better.
-
-
-alpha-dec-osf4.0e
-
-GDB 5.1 is known to have problems on this platform (encounters an
-internal error in the symbol table reader).
-
-
-sparcv9-sun-solaris2.8
-
-There are known problems with building GDB 5.1 using GCC 3.0.x for the
-64 bit SPARC target (bad code gen). You could try a development
-version of GCC.
-
-
-i586-sco-sysv5uw7.1.1
+gdb/487: The top level make files used to build GDB are not compatible
+with HP/UX make. As a workaround, use GNU make.
-There are known problems with GDB 5.1's thread support on this
-platform. Non-threaded programs should work.
+gdb/486: The HP/UX C compiler defaults to K&R mode but GDB only builds
+with an ISO C compiler. The top level configuration incorrectly sets
+CC to `cc' instead of `cc -Ae'. As a workaround, the correct compiler
+can be specified as part of the configuration vis:
+ $ 'CC=cc -Ae' ./configure
-*-*-*
-GDB 5.1 assumes that the host C compiler implemends alloca(). GCC is
-one such compiler. This problem should be fixed on the trunk.
diff --git a/gdb/README b/gdb/README
index 341f2cf..8af440f 100644
--- a/gdb/README
+++ b/gdb/README
@@ -1,13 +1,17 @@
- README for gdb-5.1.1 release
- Updated 23 January, 2002 by Andrew Cagney
+ README for gdb-5.2 release
+ Updated 17 April, 2002 by Andrew Cagney
This is GDB, the GNU source-level debugger.
-A summary of new features is in the file `NEWS'.
-See the GDB home page at http://www.gnu.org/software/gdb/ for up to
+A summary of new features is in the file `gdb/NEWS'.
+
+Check the GDB home page at http://www.gnu.org/software/gdb/ for up to
date release information, mailing list links and archives, etc.
-See the file PROBLEMS for late breaking news.
+The file `gdb/PROBLEMS' contains information on problems identified
+late in the release cycle. GDB's bug tracking data base at
+http://www.gnu.org/software/gdb/bugs/ contains a more complete list of
+bugs.
Unpacking and Installation -- quick overview
@@ -16,7 +20,7 @@ Unpacking and Installation -- quick overview
In this release, the GDB debugger sources, the generic GNU include
files, the BFD ("binary file description") library, the readline
library, and other libraries all have directories of their own
-underneath the gdb-5.1.1 directory. The idea is that a variety of GNU
+underneath the gdb-5.2 directory. The idea is that a variety of GNU
tools can share a common copy of these things. Be aware of variation
over time--for example don't try to build gdb with a copy of bfd from
a release other than the gdb release (such as a binutils release),
@@ -25,8 +29,8 @@ Configuration scripts and makefiles exist to cruise up and down this
directory tree and automatically build all the pieces in the right
order.
- When you unpack the gdb-5.1.1.tar.gz file, you'll find a directory
-called `gdb-5.1.1', which contains:
+ When you unpack the gdb-5.2.tar.gz file, you'll find a directory
+called `gdb-5.2', which contains:
COPYING config.sub intl missing opcodes
COPYING.LIB configure libiberty mkinstalldirs readline
@@ -40,7 +44,7 @@ called `gdb-5.1.1', which contains:
You can build GDB right in the source directory:
- cd gdb-5.1.1
+ cd gdb-5.2
./configure
make
cp gdb/gdb /usr/local/bin/gdb (or wherever you want)
@@ -54,12 +58,12 @@ You can build GDB in any empty build directory:
mkdir build
cd build
- <full path to your sources>/gdb-5.1.1/configure
+ <full path to your sources>/gdb-5.2/configure
make
cp gdb/gdb /usr/local/bin/gdb (or wherever you want)
(Building GDB with DJGPP tools for MS-DOS/MS-Windows is slightly
-different; see the file gdb-5.1.1/gdb/config/djgpp/README for details.)
+different; see the file gdb-5.2/gdb/config/djgpp/README for details.)
This will configure and build all the libraries as well as GDB. If
`configure' can't determine your system type, specify one as its
@@ -90,7 +94,7 @@ documentation and TeX (or `texi2roff') to typeset the printed version.
GDB includes an already formatted copy of the on-line Info version
of this manual in the `gdb/doc' subdirectory. The main Info file is
-`gdb-5.1.1/gdb/doc/gdb.info', and it refers to subordinate files
+`gdb-5.2/gdb/doc/gdb.info', and it refers to subordinate files
matching `gdb.info*' in the same directory. If necessary, you can
print out these files, or read them with any editor; but they are
easier to read using the `info' subsystem in GNU Emacs or the
@@ -102,7 +106,7 @@ Info formatting programs, such as `texinfo-format-buffer' or
`makeinfo'.
If you have `makeinfo' installed, and are in the top level GDB
-source directory (`gdb-5.1.1', in the case of version 5.1.1), you can make
+source directory (`gdb-5.2', in the case of version 5.2), you can make
the Info file by typing:
cd gdb/doc
@@ -111,7 +115,7 @@ the Info file by typing:
If you want to typeset and print copies of this manual, you need
TeX, a program to print its DVI output files, and `texinfo.tex', the
Texinfo definitions file. This file is included in the GDB
-distribution, in the directory `gdb-5.1.1/texinfo'.
+distribution, in the directory `gdb-5.2/texinfo'.
TeX is a typesetting program; it does not print files directly, but
produces output files called DVI files. To print a typeset document,
@@ -125,11 +129,11 @@ without any extension or a `.dvi' extension.
This file tells TeX how to typeset a document written in Texinfo
format. On its own, TeX cannot read, much less typeset a Texinfo file.
`texinfo.tex' is distributed with GDB and is located in the
-`gdb-5.1.1/texinfo' directory.
+`gdb-5.2/texinfo' directory.
If you have TeX and a DVI printer program installed, you can typeset
and print this manual. First switch to the the `gdb' subdirectory of
-the main source directory (for example, to `gdb-5.1.1/gdb') and then type:
+the main source directory (for example, to `gdb-5.2/gdb') and then type:
make doc/gdb.dvi
@@ -152,55 +156,55 @@ preparing GDB for installation; you can then use `make' to build the
a single directory, whose name is usually composed by appending the
version number to `gdb'.
- For example, the GDB version 5.1.1 distribution is in the `gdb-5.1.1'
+ For example, the GDB version 5.2 distribution is in the `gdb-5.2'
directory. That directory contains:
-`gdb-5.1.1/{COPYING,COPYING.LIB}'
+`gdb-5.2/{COPYING,COPYING.LIB}'
Standard GNU license files. Please read them.
-`gdb-5.1.1/bfd'
+`gdb-5.2/bfd'
source for the Binary File Descriptor library
-`gdb-5.1.1/config*'
+`gdb-5.2/config*'
script for configuring GDB, along with other support files
-`gdb-5.1.1/gdb'
+`gdb-5.2/gdb'
the source specific to GDB itself
-`gdb-5.1.1/include'
+`gdb-5.2/include'
GNU include files
-`gdb-5.1.1/libiberty'
+`gdb-5.2/libiberty'
source for the `-liberty' free software library
-`gdb-5.1.1/mmalloc'
+`gdb-5.2/mmalloc'
source for the GNU memory-mapped malloc package
-`gdb-5.1.1/opcodes'
+`gdb-5.2/opcodes'
source for the library of opcode tables and disassemblers
-`gdb-5.1.1/readline'
+`gdb-5.2/readline'
source for the GNU command-line interface
NOTE: The readline library is compiled for use by GDB, but will
not be installed on your system when "make install" is issued.
-`gdb-5.1.1/sim'
+`gdb-5.2/sim'
source for some simulators (ARM, D10V, SPARC, M32R, MIPS, PPC, V850, etc)
-`gdb-5.1.1/intl'
+`gdb-5.2/intl'
source for the GNU gettext library, for internationalization.
This is slightly modified from the standalone gettext
distribution you can get from GNU.
-`gdb-5.1.1/texinfo'
+`gdb-5.2/texinfo'
The `texinfo.tex' file, which you need in order to make a printed
manual using TeX.
-`gdb-5.1.1/etc'
+`gdb-5.2/etc'
Coding standards, useful files for editing GDB, and other
miscellanea.
-`gdb-5.1.1/utils'
+`gdb-5.2/utils'
A grab bag of random utilities.
Note: the following instructions are for building GDB on Unix or
@@ -209,14 +213,14 @@ MS-DOS/MS-Windows are in the file gdb/config/djgpp/README.
The simplest way to configure and build GDB is to run `configure'
from the `gdb-VERSION-NUMBER' source directory, which in this example
-is the `gdb-5.1.1' directory.
+is the `gdb-5.2' directory.
First switch to the `gdb-VERSION-NUMBER' source directory if you are
not already in it; then run `configure'.
For example:
- cd gdb-5.1.1
+ cd gdb-5.2
./configure
make
@@ -232,8 +236,8 @@ you may need to run `sh' on it explicitly:
sh configure
If you run `configure' from a directory that contains source
-directories for multiple libraries or programs, such as the `gdb-5.1.1'
-source directory for version 5.1.1, `configure' creates configuration
+directories for multiple libraries or programs, such as the `gdb-5.2'
+source directory for version 5.2, `configure' creates configuration
files for every directory level underneath (unless you tell it not to,
with the `--norecursion' option).
@@ -241,10 +245,10 @@ with the `--norecursion' option).
directories in the GDB distribution, if you only want to configure that
subdirectory; but be sure to specify a path to it.
- For example, with version 5.1.1, type the following to configure only
+ For example, with version 5.2, type the following to configure only
the `bfd' subdirectory:
- cd gdb-5.1.1/bfd
+ cd gdb-5.2/bfd
../configure
You can install `gdb' anywhere; it has no hardwired paths. However,
@@ -273,13 +277,13 @@ directory. If the path to `configure' would be the same as the
argument to `--srcdir', you can leave out the `--srcdir' option; it
will be assumed.)
- For example, with version 5.1.1, you can build GDB in a separate
+ For example, with version 5.2, you can build GDB in a separate
directory for a Sun 4 like this:
- cd gdb-5.1.1
+ cd gdb-5.2
mkdir ../gdb-sun4
cd ../gdb-sun4
- ../gdb-5.1.1/configure
+ ../gdb-5.2/configure
make
When `configure' builds a configuration using a remote source
@@ -300,8 +304,8 @@ called `configure' (or one of its subdirectories).
The `Makefile' that `configure' generates in each source directory
also runs recursively. If you type `make' in a source directory such
-as `gdb-5.1.1' (or in a separate configured directory configured with
-`--srcdir=PATH/gdb-5.1.1'), you will build all the required libraries,
+as `gdb-5.2' (or in a separate configured directory configured with
+`--srcdir=PATH/gdb-5.2'), you will build all the required libraries,
and then build GDB.
When you have multiple hosts or targets configured in separate
@@ -344,7 +348,7 @@ you can use it to test your guesses on abbreviations--for example:
Invalid configuration `i786v': machine `i786v' not recognized
`config.sub' is also distributed in the GDB source directory
-(`gdb-5.1.1', for version 5.1.1).
+(`gdb-5.2', for version 5.2).
`configure' options
@@ -480,22 +484,27 @@ not a complete solution. You will need something on the other end
that also speaks UDI.
-Reporting Bugs
-===============
+Reporting Bugs in GDB
+=====================
+
+ There are several ways of reporting bugs in GDB. The prefered
+method is to use the World Wide Web:
+
+ http://www.gnu.org/software/gdb/bugs/
+
+As an alternative, the bug report can be submitted, via e-mail, to the
+address "bug-gdb@gnu.org".
- The correct address for reporting bugs found in gdb is
-"bug-gdb@gnu.org". Please email all bugs, and all requests for help
-with GDB, to that address. Please include the GDB version number
-(e.g., gdb-5.1.1), and how you configured it (e.g., "sun4" or "mach386
-host, i586-intel-synopsys target"). Since GDB now supports so many
+ When submitting a bug, please include the GDB version number (e.g.,
+gdb-5.2), and how you configured it (e.g., "sun4" or "mach386 host,
+i586-intel-synopsys target"). Since GDB now supports so many
different configurations, it is important that you be precise about
this. If at all possible, you should include the actual banner that
GDB prints when it starts up, or failing that, the actual configure
command that you used when configuring GDB.
- For more information on how/whether to report bugs, see the GDB
-Bugs section of the GDB manual (gdb/doc/gdb.texinfo) or the
-gdb/CONTRIBUTE file.
+ For more information on how/whether to report bugs, see the
+Reporting Bugs chapter of the GDB manual (gdb/doc/gdb.texinfo).
Graphical interface to GDB -- X Windows, MS Windows
@@ -542,17 +551,17 @@ ftp://sources.redhat.com/pub/dejagnu/ will contain a recent snapshot.
Once DejaGNU is installed, you can run the tests in one of the
following ways:
- (1) cd gdb-5.1.1
+ (1) cd gdb-5.2
make check-gdb
or
- (2) cd gdb-5.1.1/gdb
+ (2) cd gdb-5.2/gdb
make check
or
- (3) cd gdb-5.1.1/gdb/testsuite
+ (3) cd gdb-5.2/gdb/testsuite
make site.exp (builds the site specific file)
runtest -tool gdb GDB=../gdb (or GDB=<somepath> as appropriate)
diff --git a/gdb/a29k-tdep.c b/gdb/a29k-tdep.c
deleted file mode 100644
index 4fcc0f2..0000000
--- a/gdb/a29k-tdep.c
+++ /dev/null
@@ -1,1015 +0,0 @@
-/* OBSOLETE /* Target-machine dependent code for the AMD 29000 */
-/* OBSOLETE Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, */
-/* OBSOLETE 2001 */
-/* OBSOLETE Free Software Foundation, Inc. */
-/* OBSOLETE Contributed by Cygnus Support. Written by Jim Kingdon. */
-/* 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. */ */
-/* OBSOLETE */
-/* OBSOLETE #include "defs.h" */
-/* OBSOLETE #include "gdbcore.h" */
-/* OBSOLETE #include "frame.h" */
-/* OBSOLETE #include "value.h" */
-/* OBSOLETE #include "symtab.h" */
-/* OBSOLETE #include "inferior.h" */
-/* OBSOLETE #include "gdbcmd.h" */
-/* OBSOLETE #include "regcache.h" */
-/* OBSOLETE */
-/* OBSOLETE /* If all these bits in an instruction word are zero, it is a "tag word" */
-/* OBSOLETE which precedes a function entry point and gives stack traceback info. */
-/* OBSOLETE This used to be defined as 0xff000000, but that treated 0x00000deb as */
-/* OBSOLETE a tag word, while it is really used as a breakpoint. */ */
-/* OBSOLETE #define TAGWORD_ZERO_MASK 0xff00f800 */
-/* OBSOLETE */
-/* OBSOLETE extern CORE_ADDR text_start; /* FIXME, kludge... */ */
-/* OBSOLETE */
-/* OBSOLETE /* The user-settable top of the register stack in virtual memory. We */
-/* OBSOLETE won't attempt to access any stored registers above this address, if set */
-/* OBSOLETE nonzero. */ */
-/* OBSOLETE */
-/* OBSOLETE static CORE_ADDR rstack_high_address = UINT_MAX; */
-/* OBSOLETE */
-/* OBSOLETE */
-/* OBSOLETE /* Should call_function allocate stack space for a struct return? */ */
-/* OBSOLETE /* On the a29k objects over 16 words require the caller to allocate space. */ */
-/* OBSOLETE int */
-/* OBSOLETE a29k_use_struct_convention (int gcc_p, struct type *type) */
-/* OBSOLETE { */
-/* OBSOLETE return (TYPE_LENGTH (type) > 16 * 4); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE */
-/* OBSOLETE /* Structure to hold cached info about function prologues. */ */
-/* OBSOLETE */
-/* OBSOLETE struct prologue_info */
-/* OBSOLETE { */
-/* OBSOLETE CORE_ADDR pc; /* First addr after fn prologue */ */
-/* OBSOLETE unsigned rsize, msize; /* register stack frame size, mem stack ditto */ */
-/* OBSOLETE unsigned mfp_used:1; /* memory frame pointer used */ */
-/* OBSOLETE unsigned rsize_valid:1; /* Validity bits for the above */ */
-/* OBSOLETE unsigned msize_valid:1; */
-/* OBSOLETE unsigned mfp_valid:1; */
-/* OBSOLETE }; */
-/* OBSOLETE */
-/* OBSOLETE /* Examine the prologue of a function which starts at PC. Return */
-/* OBSOLETE the first addess past the prologue. If MSIZE is non-NULL, then */
-/* OBSOLETE set *MSIZE to the memory stack frame size. If RSIZE is non-NULL, */
-/* OBSOLETE then set *RSIZE to the register stack frame size (not including */
-/* OBSOLETE incoming arguments and the return address & frame pointer stored */
-/* OBSOLETE with them). If no prologue is found, *RSIZE is set to zero. */
-/* OBSOLETE If no prologue is found, or a prologue which doesn't involve */
-/* OBSOLETE allocating a memory stack frame, then set *MSIZE to zero. */
-/* OBSOLETE */
-/* OBSOLETE Note that both msize and rsize are in bytes. This is not consistent */
-/* OBSOLETE with the _User's Manual_ with respect to rsize, but it is much more */
-/* OBSOLETE convenient. */
-/* OBSOLETE */
-/* OBSOLETE If MFP_USED is non-NULL, *MFP_USED is set to nonzero if a memory */
-/* OBSOLETE frame pointer is being used. */ */
-/* OBSOLETE */
-/* OBSOLETE CORE_ADDR */
-/* OBSOLETE examine_prologue (CORE_ADDR pc, unsigned *rsize, unsigned *msize, int *mfp_used) */
-/* OBSOLETE { */
-/* OBSOLETE long insn; */
-/* OBSOLETE CORE_ADDR p = pc; */
-/* OBSOLETE struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (pc); */
-/* OBSOLETE struct prologue_info *mi = 0; */
-/* OBSOLETE */
-/* OBSOLETE if (msymbol != NULL) */
-/* OBSOLETE mi = (struct prologue_info *) msymbol->info; */
-/* OBSOLETE */
-/* OBSOLETE if (mi != 0) */
-/* OBSOLETE { */
-/* OBSOLETE int valid = 1; */
-/* OBSOLETE if (rsize != NULL) */
-/* OBSOLETE { */
-/* OBSOLETE *rsize = mi->rsize; */
-/* OBSOLETE valid &= mi->rsize_valid; */
-/* OBSOLETE } */
-/* OBSOLETE if (msize != NULL) */
-/* OBSOLETE { */
-/* OBSOLETE *msize = mi->msize; */
-/* OBSOLETE valid &= mi->msize_valid; */
-/* OBSOLETE } */
-/* OBSOLETE if (mfp_used != NULL) */
-/* OBSOLETE { */
-/* OBSOLETE *mfp_used = mi->mfp_used; */
-/* OBSOLETE valid &= mi->mfp_valid; */
-/* OBSOLETE } */
-/* OBSOLETE if (valid) */
-/* OBSOLETE return mi->pc; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE if (rsize != NULL) */
-/* OBSOLETE *rsize = 0; */
-/* OBSOLETE if (msize != NULL) */
-/* OBSOLETE *msize = 0; */
-/* OBSOLETE if (mfp_used != NULL) */
-/* OBSOLETE *mfp_used = 0; */
-/* OBSOLETE */
-/* OBSOLETE /* Prologue must start with subtracting a constant from gr1. */
-/* OBSOLETE Normally this is sub gr1,gr1,<rsize * 4>. */ */
-/* OBSOLETE insn = read_memory_integer (p, 4); */
-/* OBSOLETE if ((insn & 0xffffff00) != 0x25010100) */
-/* OBSOLETE { */
-/* OBSOLETE /* If the frame is large, instead of a single instruction it */
-/* OBSOLETE might be a pair of instructions: */
-/* OBSOLETE const <reg>, <rsize * 4> */
-/* OBSOLETE sub gr1,gr1,<reg> */
-/* OBSOLETE */ */
-/* OBSOLETE int reg; */
-/* OBSOLETE /* Possible value for rsize. */ */
-/* OBSOLETE unsigned int rsize0; */
-/* OBSOLETE */
-/* OBSOLETE if ((insn & 0xff000000) != 0x03000000) */
-/* OBSOLETE { */
-/* OBSOLETE p = pc; */
-/* OBSOLETE goto done; */
-/* OBSOLETE } */
-/* OBSOLETE reg = (insn >> 8) & 0xff; */
-/* OBSOLETE rsize0 = (((insn >> 8) & 0xff00) | (insn & 0xff)); */
-/* OBSOLETE p += 4; */
-/* OBSOLETE insn = read_memory_integer (p, 4); */
-/* OBSOLETE if ((insn & 0xffffff00) != 0x24010100 */
-/* OBSOLETE || (insn & 0xff) != reg) */
-/* OBSOLETE { */
-/* OBSOLETE p = pc; */
-/* OBSOLETE goto done; */
-/* OBSOLETE } */
-/* OBSOLETE if (rsize != NULL) */
-/* OBSOLETE *rsize = rsize0; */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE { */
-/* OBSOLETE if (rsize != NULL) */
-/* OBSOLETE *rsize = (insn & 0xff); */
-/* OBSOLETE } */
-/* OBSOLETE p += 4; */
-/* OBSOLETE */
-/* OBSOLETE /* Next instruction ought to be asgeu V_SPILL,gr1,rab. */
-/* OBSOLETE * We don't check the vector number to allow for kernel debugging. The */
-/* OBSOLETE * kernel will use a different trap number. */
-/* OBSOLETE * If this insn is missing, we just keep going; Metaware R2.3u compiler */
-/* OBSOLETE * generates prologue that intermixes initializations and puts the asgeu */
-/* OBSOLETE * way down. */
-/* OBSOLETE */ */
-/* OBSOLETE insn = read_memory_integer (p, 4); */
-/* OBSOLETE if ((insn & 0xff00ffff) == (0x5e000100 | RAB_HW_REGNUM)) */
-/* OBSOLETE { */
-/* OBSOLETE p += 4; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Next instruction usually sets the frame pointer (lr1) by adding */
-/* OBSOLETE <size * 4> from gr1. However, this can (and high C does) be */
-/* OBSOLETE deferred until anytime before the first function call. So it is */
-/* OBSOLETE OK if we don't see anything which sets lr1. */
-/* OBSOLETE To allow for alternate register sets (gcc -mkernel-registers) the msp */
-/* OBSOLETE register number is a compile time constant. */ */
-/* OBSOLETE */
-/* OBSOLETE /* Normally this is just add lr1,gr1,<size * 4>. */ */
-/* OBSOLETE insn = read_memory_integer (p, 4); */
-/* OBSOLETE if ((insn & 0xffffff00) == 0x15810100) */
-/* OBSOLETE p += 4; */
-/* OBSOLETE else */
-/* OBSOLETE { */
-/* OBSOLETE /* However, for large frames it can be */
-/* OBSOLETE const <reg>, <size *4> */
-/* OBSOLETE add lr1,gr1,<reg> */
-/* OBSOLETE */ */
-/* OBSOLETE int reg; */
-/* OBSOLETE CORE_ADDR q; */
-/* OBSOLETE */
-/* OBSOLETE if ((insn & 0xff000000) == 0x03000000) */
-/* OBSOLETE { */
-/* OBSOLETE reg = (insn >> 8) & 0xff; */
-/* OBSOLETE q = p + 4; */
-/* OBSOLETE insn = read_memory_integer (q, 4); */
-/* OBSOLETE if ((insn & 0xffffff00) == 0x14810100 */
-/* OBSOLETE && (insn & 0xff) == reg) */
-/* OBSOLETE p = q; */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Next comes "add lr{<rsize-1>},msp,0", but only if a memory */
-/* OBSOLETE frame pointer is in use. We just check for add lr<anything>,msp,0; */
-/* OBSOLETE we don't check this rsize against the first instruction, and */
-/* OBSOLETE we don't check that the trace-back tag indicates a memory frame pointer */
-/* OBSOLETE is in use. */
-/* OBSOLETE To allow for alternate register sets (gcc -mkernel-registers) the msp */
-/* OBSOLETE register number is a compile time constant. */
-/* OBSOLETE */
-/* OBSOLETE The recommended instruction is actually "sll lr<whatever>,msp,0". */
-/* OBSOLETE We check for that, too. Originally Jim Kingdon's code seemed */
-/* OBSOLETE to be looking for a "sub" instruction here, but the mask was set */
-/* OBSOLETE up to lose all the time. */ */
-/* OBSOLETE insn = read_memory_integer (p, 4); */
-/* OBSOLETE if (((insn & 0xff80ffff) == (0x15800000 | (MSP_HW_REGNUM << 8))) /* add */ */
-/* OBSOLETE || ((insn & 0xff80ffff) == (0x81800000 | (MSP_HW_REGNUM << 8)))) /* sll */ */
-/* OBSOLETE { */
-/* OBSOLETE p += 4; */
-/* OBSOLETE if (mfp_used != NULL) */
-/* OBSOLETE *mfp_used = 1; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Next comes a subtraction from msp to allocate a memory frame, */
-/* OBSOLETE but only if a memory frame is */
-/* OBSOLETE being used. We don't check msize against the trace-back tag. */
-/* OBSOLETE */
-/* OBSOLETE To allow for alternate register sets (gcc -mkernel-registers) the msp */
-/* OBSOLETE register number is a compile time constant. */
-/* OBSOLETE */
-/* OBSOLETE Normally this is just */
-/* OBSOLETE sub msp,msp,<msize> */
-/* OBSOLETE */ */
-/* OBSOLETE insn = read_memory_integer (p, 4); */
-/* OBSOLETE if ((insn & 0xffffff00) == */
-/* OBSOLETE (0x25000000 | (MSP_HW_REGNUM << 16) | (MSP_HW_REGNUM << 8))) */
-/* OBSOLETE { */
-/* OBSOLETE p += 4; */
-/* OBSOLETE if (msize != NULL) */
-/* OBSOLETE *msize = insn & 0xff; */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE { */
-/* OBSOLETE /* For large frames, instead of a single instruction it might */
-/* OBSOLETE be */
-/* OBSOLETE */
-/* OBSOLETE const <reg>, <msize> */
-/* OBSOLETE consth <reg>, <msize> ; optional */
-/* OBSOLETE sub msp,msp,<reg> */
-/* OBSOLETE */ */
-/* OBSOLETE int reg; */
-/* OBSOLETE unsigned msize0; */
-/* OBSOLETE CORE_ADDR q = p; */
-/* OBSOLETE */
-/* OBSOLETE if ((insn & 0xff000000) == 0x03000000) */
-/* OBSOLETE { */
-/* OBSOLETE reg = (insn >> 8) & 0xff; */
-/* OBSOLETE msize0 = ((insn >> 8) & 0xff00) | (insn & 0xff); */
-/* OBSOLETE q += 4; */
-/* OBSOLETE insn = read_memory_integer (q, 4); */
-/* OBSOLETE /* Check for consth. */ */
-/* OBSOLETE if ((insn & 0xff000000) == 0x02000000 */
-/* OBSOLETE && (insn & 0x0000ff00) == reg) */
-/* OBSOLETE { */
-/* OBSOLETE msize0 |= (insn << 8) & 0xff000000; */
-/* OBSOLETE msize0 |= (insn << 16) & 0x00ff0000; */
-/* OBSOLETE q += 4; */
-/* OBSOLETE insn = read_memory_integer (q, 4); */
-/* OBSOLETE } */
-/* OBSOLETE /* Check for sub msp,msp,<reg>. */ */
-/* OBSOLETE if ((insn & 0xffffff00) == */
-/* OBSOLETE (0x24000000 | (MSP_HW_REGNUM << 16) | (MSP_HW_REGNUM << 8)) */
-/* OBSOLETE && (insn & 0xff) == reg) */
-/* OBSOLETE { */
-/* OBSOLETE p = q + 4; */
-/* OBSOLETE if (msize != NULL) */
-/* OBSOLETE *msize = msize0; */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Next instruction might be asgeu V_SPILL,gr1,rab. */
-/* OBSOLETE * We don't check the vector number to allow for kernel debugging. The */
-/* OBSOLETE * kernel will use a different trap number. */
-/* OBSOLETE * Metaware R2.3u compiler */
-/* OBSOLETE * generates prologue that intermixes initializations and puts the asgeu */
-/* OBSOLETE * way down after everything else. */
-/* OBSOLETE */ */
-/* OBSOLETE insn = read_memory_integer (p, 4); */
-/* OBSOLETE if ((insn & 0xff00ffff) == (0x5e000100 | RAB_HW_REGNUM)) */
-/* OBSOLETE { */
-/* OBSOLETE p += 4; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE done: */
-/* OBSOLETE if (msymbol != NULL) */
-/* OBSOLETE { */
-/* OBSOLETE if (mi == 0) */
-/* OBSOLETE { */
-/* OBSOLETE /* Add a new cache entry. */ */
-/* OBSOLETE mi = (struct prologue_info *) xmalloc (sizeof (struct prologue_info)); */
-/* OBSOLETE msymbol->info = (char *) mi; */
-/* OBSOLETE mi->rsize_valid = 0; */
-/* OBSOLETE mi->msize_valid = 0; */
-/* OBSOLETE mi->mfp_valid = 0; */
-/* OBSOLETE } */
-/* OBSOLETE /* else, cache entry exists, but info is incomplete. */ */
-/* OBSOLETE mi->pc = p; */
-/* OBSOLETE if (rsize != NULL) */
-/* OBSOLETE { */
-/* OBSOLETE mi->rsize = *rsize; */
-/* OBSOLETE mi->rsize_valid = 1; */
-/* OBSOLETE } */
-/* OBSOLETE if (msize != NULL) */
-/* OBSOLETE { */
-/* OBSOLETE mi->msize = *msize; */
-/* OBSOLETE mi->msize_valid = 1; */
-/* OBSOLETE } */
-/* OBSOLETE if (mfp_used != NULL) */
-/* OBSOLETE { */
-/* OBSOLETE mi->mfp_used = *mfp_used; */
-/* OBSOLETE mi->mfp_valid = 1; */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE return p; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Advance PC across any function entry prologue instructions */
-/* OBSOLETE to reach some "real" code. */ */
-/* OBSOLETE */
-/* OBSOLETE CORE_ADDR */
-/* OBSOLETE a29k_skip_prologue (CORE_ADDR pc) */
-/* OBSOLETE { */
-/* OBSOLETE return examine_prologue (pc, NULL, NULL, NULL); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* */
-/* OBSOLETE * Examine the one or two word tag at the beginning of a function. */
-/* OBSOLETE * The tag word is expect to be at 'p', if it is not there, we fail */
-/* OBSOLETE * by returning 0. The documentation for the tag word was taken from */
-/* OBSOLETE * page 7-15 of the 29050 User's Manual. We are assuming that the */
-/* OBSOLETE * m bit is in bit 22 of the tag word, which seems to be the agreed upon */
-/* OBSOLETE * convention today (1/15/92). */
-/* OBSOLETE * msize is return in bytes. */
-/* OBSOLETE */ */
-/* OBSOLETE */
-/* OBSOLETE static int /* 0/1 - failure/success of finding the tag word */ */
-/* OBSOLETE examine_tag (CORE_ADDR p, int *is_trans, int *argcount, unsigned *msize, */
-/* OBSOLETE int *mfp_used) */
-/* OBSOLETE { */
-/* OBSOLETE unsigned int tag1, tag2; */
-/* OBSOLETE */
-/* OBSOLETE tag1 = read_memory_integer (p, 4); */
-/* OBSOLETE if ((tag1 & TAGWORD_ZERO_MASK) != 0) /* Not a tag word */ */
-/* OBSOLETE return 0; */
-/* OBSOLETE if (tag1 & (1 << 23)) /* A two word tag */ */
-/* OBSOLETE { */
-/* OBSOLETE tag2 = read_memory_integer (p - 4, 4); */
-/* OBSOLETE if (msize) */
-/* OBSOLETE *msize = tag2 * 2; */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE /* A one word tag */ */
-/* OBSOLETE { */
-/* OBSOLETE if (msize) */
-/* OBSOLETE *msize = tag1 & 0x7ff; */
-/* OBSOLETE } */
-/* OBSOLETE if (is_trans) */
-/* OBSOLETE *is_trans = ((tag1 & (1 << 21)) ? 1 : 0); */
-/* OBSOLETE /* Note that this includes the frame pointer and the return address */
-/* OBSOLETE register, so the actual number of registers of arguments is two less. */
-/* OBSOLETE argcount can be zero, however, sometimes, for strange assembler */
-/* OBSOLETE routines. */ */
-/* OBSOLETE if (argcount) */
-/* OBSOLETE *argcount = (tag1 >> 16) & 0x1f; */
-/* OBSOLETE if (mfp_used) */
-/* OBSOLETE *mfp_used = ((tag1 & (1 << 22)) ? 1 : 0); */
-/* OBSOLETE return 1; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Initialize the frame. In addition to setting "extra" frame info, */
-/* OBSOLETE we also set ->frame because we use it in a nonstandard way, and ->pc */
-/* OBSOLETE because we need to know it to get the other stuff. See the diagram */
-/* OBSOLETE of stacks and the frame cache in tm-a29k.h for more detail. */ */
-/* OBSOLETE */
-/* OBSOLETE static void */
-/* OBSOLETE init_frame_info (int innermost_frame, struct frame_info *frame) */
-/* OBSOLETE { */
-/* OBSOLETE CORE_ADDR p; */
-/* OBSOLETE long insn; */
-/* OBSOLETE unsigned rsize; */
-/* OBSOLETE unsigned msize; */
-/* OBSOLETE int mfp_used, trans; */
-/* OBSOLETE struct symbol *func; */
-/* OBSOLETE */
-/* OBSOLETE p = frame->pc; */
-/* OBSOLETE */
-/* OBSOLETE if (innermost_frame) */
-/* OBSOLETE frame->frame = read_register (GR1_REGNUM); */
-/* OBSOLETE else */
-/* OBSOLETE frame->frame = frame->next->frame + frame->next->rsize; */
-/* OBSOLETE */
-/* OBSOLETE #if 0 /* CALL_DUMMY_LOCATION == ON_STACK */ */
-/* OBSOLETE This wont work; */
-/* OBSOLETE #else */
-/* OBSOLETE if (PC_IN_CALL_DUMMY (p, 0, 0)) */
-/* OBSOLETE #endif */
-/* OBSOLETE { */
-/* OBSOLETE frame->rsize = DUMMY_FRAME_RSIZE; */
-/* OBSOLETE /* This doesn't matter since we never try to get locals or args */
-/* OBSOLETE from a dummy frame. */ */
-/* OBSOLETE frame->msize = 0; */
-/* OBSOLETE /* Dummy frames always use a memory frame pointer. */ */
-/* OBSOLETE frame->saved_msp = */
-/* OBSOLETE read_register_stack_integer (frame->frame + DUMMY_FRAME_RSIZE - 4, 4); */
-/* OBSOLETE frame->flags |= (TRANSPARENT_FRAME | MFP_USED); */
-/* OBSOLETE return; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE func = find_pc_function (p); */
-/* OBSOLETE if (func != NULL) */
-/* OBSOLETE p = BLOCK_START (SYMBOL_BLOCK_VALUE (func)); */
-/* OBSOLETE else */
-/* OBSOLETE { */
-/* OBSOLETE /* Search backward to find the trace-back tag. However, */
-/* OBSOLETE do not trace back beyond the start of the text segment */
-/* OBSOLETE (just as a sanity check to avoid going into never-never land). */ */
-/* OBSOLETE #if 1 */
-/* OBSOLETE while (p >= text_start */
-/* OBSOLETE && ((insn = read_memory_integer (p, 4)) & TAGWORD_ZERO_MASK) != 0) */
-/* OBSOLETE p -= 4; */
-/* OBSOLETE #else /* 0 */ */
-/* OBSOLETE char pat[4] = */
-/* OBSOLETE {0, 0, 0, 0}; */
-/* OBSOLETE char mask[4]; */
-/* OBSOLETE char insn_raw[4]; */
-/* OBSOLETE store_unsigned_integer (mask, 4, TAGWORD_ZERO_MASK); */
-/* OBSOLETE /* Enable this once target_search is enabled and tested. */ */
-/* OBSOLETE target_search (4, pat, mask, p, -4, text_start, p + 1, &p, &insn_raw); */
-/* OBSOLETE insn = extract_unsigned_integer (insn_raw, 4); */
-/* OBSOLETE #endif /* 0 */ */
-/* OBSOLETE */
-/* OBSOLETE if (p < text_start) */
-/* OBSOLETE { */
-/* OBSOLETE /* Couldn't find the trace-back tag. */
-/* OBSOLETE Something strange is going on. */ */
-/* OBSOLETE frame->saved_msp = 0; */
-/* OBSOLETE frame->rsize = 0; */
-/* OBSOLETE frame->msize = 0; */
-/* OBSOLETE frame->flags = TRANSPARENT_FRAME; */
-/* OBSOLETE return; */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE /* Advance to the first word of the function, i.e. the word */
-/* OBSOLETE after the trace-back tag. */ */
-/* OBSOLETE p += 4; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* We've found the start of the function. */
-/* OBSOLETE Try looking for a tag word that indicates whether there is a */
-/* OBSOLETE memory frame pointer and what the memory stack allocation is. */
-/* OBSOLETE If one doesn't exist, try using a more exhaustive search of */
-/* OBSOLETE the prologue. */ */
-/* OBSOLETE */
-/* OBSOLETE if (examine_tag (p - 4, &trans, (int *) NULL, &msize, &mfp_used)) /* Found good tag */ */
-/* OBSOLETE examine_prologue (p, &rsize, 0, 0); */
-/* OBSOLETE else /* No tag try prologue */ */
-/* OBSOLETE examine_prologue (p, &rsize, &msize, &mfp_used); */
-/* OBSOLETE */
-/* OBSOLETE frame->rsize = rsize; */
-/* OBSOLETE frame->msize = msize; */
-/* OBSOLETE frame->flags = 0; */
-/* OBSOLETE if (mfp_used) */
-/* OBSOLETE frame->flags |= MFP_USED; */
-/* OBSOLETE if (trans) */
-/* OBSOLETE frame->flags |= TRANSPARENT_FRAME; */
-/* OBSOLETE if (innermost_frame) */
-/* OBSOLETE { */
-/* OBSOLETE frame->saved_msp = read_register (MSP_REGNUM) + msize; */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE { */
-/* OBSOLETE if (mfp_used) */
-/* OBSOLETE frame->saved_msp = */
-/* OBSOLETE read_register_stack_integer (frame->frame + rsize - 4, 4); */
-/* OBSOLETE else */
-/* OBSOLETE frame->saved_msp = frame->next->saved_msp + msize; */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE void */
-/* OBSOLETE init_extra_frame_info (struct frame_info *frame) */
-/* OBSOLETE { */
-/* OBSOLETE if (frame->next == 0) */
-/* OBSOLETE /* Assume innermost frame. May produce strange results for "info frame" */
-/* OBSOLETE but there isn't any way to tell the difference. */ */
-/* OBSOLETE init_frame_info (1, frame); */
-/* OBSOLETE else */
-/* OBSOLETE { */
-/* OBSOLETE /* We're in get_prev_frame. */
-/* OBSOLETE Take care of everything in init_frame_pc. */ */
-/* OBSOLETE ; */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE void */
-/* OBSOLETE init_frame_pc (int fromleaf, struct frame_info *frame) */
-/* OBSOLETE { */
-/* OBSOLETE frame->pc = (fromleaf ? SAVED_PC_AFTER_CALL (frame->next) : */
-/* OBSOLETE frame->next ? FRAME_SAVED_PC (frame->next) : read_pc ()); */
-/* OBSOLETE init_frame_info (fromleaf, frame); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Local variables (i.e. LOC_LOCAL) are on the memory stack, with their */
-/* OBSOLETE offsets being relative to the memory stack pointer (high C) or */
-/* OBSOLETE saved_msp (gcc). */ */
-/* OBSOLETE */
-/* OBSOLETE CORE_ADDR */
-/* OBSOLETE frame_locals_address (struct frame_info *fi) */
-/* OBSOLETE { */
-/* OBSOLETE if (fi->flags & MFP_USED) */
-/* OBSOLETE return fi->saved_msp; */
-/* OBSOLETE else */
-/* OBSOLETE return fi->saved_msp - fi->msize; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Routines for reading the register stack. The caller gets to treat */
-/* OBSOLETE the register stack as a uniform stack in memory, from address $gr1 */
-/* OBSOLETE straight through $rfb and beyond. */ */
-/* OBSOLETE */
-/* OBSOLETE /* Analogous to read_memory except the length is understood to be 4. */
-/* OBSOLETE Also, myaddr can be NULL (meaning don't bother to read), and */
-/* OBSOLETE if actual_mem_addr is non-NULL, store there the address that it */
-/* OBSOLETE was fetched from (or if from a register the offset within */
-/* OBSOLETE registers). Set *LVAL to lval_memory or lval_register, depending */
-/* OBSOLETE on where it came from. The contents written into MYADDR are in */
-/* OBSOLETE target format. */ */
-/* OBSOLETE void */
-/* OBSOLETE read_register_stack (CORE_ADDR memaddr, char *myaddr, */
-/* OBSOLETE CORE_ADDR *actual_mem_addr, enum lval_type *lval) */
-/* OBSOLETE { */
-/* OBSOLETE long rfb = read_register (RFB_REGNUM); */
-/* OBSOLETE long rsp = read_register (RSP_REGNUM); */
-/* OBSOLETE */
-/* OBSOLETE /* If we don't do this 'info register' stops in the middle. */ */
-/* OBSOLETE if (memaddr >= rstack_high_address) */
-/* OBSOLETE { */
-/* OBSOLETE /* a bogus value */ */
-/* OBSOLETE static char val[] = */
-/* OBSOLETE {~0, ~0, ~0, ~0}; */
-/* OBSOLETE /* It's in a local register, but off the end of the stack. */ */
-/* OBSOLETE int regnum = (memaddr - rsp) / 4 + LR0_REGNUM; */
-/* OBSOLETE if (myaddr != NULL) */
-/* OBSOLETE { */
-/* OBSOLETE /* Provide bogusness */ */
-/* OBSOLETE memcpy (myaddr, val, 4); */
-/* OBSOLETE } */
-/* OBSOLETE supply_register (regnum, val); /* More bogusness */ */
-/* OBSOLETE if (lval != NULL) */
-/* OBSOLETE *lval = lval_register; */
-/* OBSOLETE if (actual_mem_addr != NULL) */
-/* OBSOLETE *actual_mem_addr = REGISTER_BYTE (regnum); */
-/* OBSOLETE } */
-/* OBSOLETE /* If it's in the part of the register stack that's in real registers, */
-/* OBSOLETE get the value from the registers. If it's anywhere else in memory */
-/* OBSOLETE (e.g. in another thread's saved stack), skip this part and get */
-/* OBSOLETE it from real live memory. */ */
-/* OBSOLETE else if (memaddr < rfb && memaddr >= rsp) */
-/* OBSOLETE { */
-/* OBSOLETE /* It's in a register. */ */
-/* OBSOLETE int regnum = (memaddr - rsp) / 4 + LR0_REGNUM; */
-/* OBSOLETE if (regnum > LR0_REGNUM + 127) */
-/* OBSOLETE error ("Attempt to read register stack out of range."); */
-/* OBSOLETE if (myaddr != NULL) */
-/* OBSOLETE read_register_gen (regnum, myaddr); */
-/* OBSOLETE if (lval != NULL) */
-/* OBSOLETE *lval = lval_register; */
-/* OBSOLETE if (actual_mem_addr != NULL) */
-/* OBSOLETE *actual_mem_addr = REGISTER_BYTE (regnum); */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE { */
-/* OBSOLETE /* It's in the memory portion of the register stack. */ */
-/* OBSOLETE if (myaddr != NULL) */
-/* OBSOLETE read_memory (memaddr, myaddr, 4); */
-/* OBSOLETE if (lval != NULL) */
-/* OBSOLETE *lval = lval_memory; */
-/* OBSOLETE if (actual_mem_addr != NULL) */
-/* OBSOLETE *actual_mem_addr = memaddr; */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Analogous to read_memory_integer */
-/* OBSOLETE except the length is understood to be 4. */ */
-/* OBSOLETE long */
-/* OBSOLETE read_register_stack_integer (CORE_ADDR memaddr, int len) */
-/* OBSOLETE { */
-/* OBSOLETE char buf[4]; */
-/* OBSOLETE read_register_stack (memaddr, buf, NULL, NULL); */
-/* OBSOLETE return extract_signed_integer (buf, 4); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Copy 4 bytes from GDB memory at MYADDR into inferior memory */
-/* OBSOLETE at MEMADDR and put the actual address written into in */
-/* OBSOLETE *ACTUAL_MEM_ADDR. */ */
-/* OBSOLETE static void */
-/* OBSOLETE write_register_stack (CORE_ADDR memaddr, char *myaddr, */
-/* OBSOLETE CORE_ADDR *actual_mem_addr) */
-/* OBSOLETE { */
-/* OBSOLETE long rfb = read_register (RFB_REGNUM); */
-/* OBSOLETE long rsp = read_register (RSP_REGNUM); */
-/* OBSOLETE /* If we don't do this 'info register' stops in the middle. */ */
-/* OBSOLETE if (memaddr >= rstack_high_address) */
-/* OBSOLETE { */
-/* OBSOLETE /* It's in a register, but off the end of the stack. */ */
-/* OBSOLETE if (actual_mem_addr != NULL) */
-/* OBSOLETE *actual_mem_addr = 0; */
-/* OBSOLETE } */
-/* OBSOLETE else if (memaddr < rfb) */
-/* OBSOLETE { */
-/* OBSOLETE /* It's in a register. */ */
-/* OBSOLETE int regnum = (memaddr - rsp) / 4 + LR0_REGNUM; */
-/* OBSOLETE if (regnum < LR0_REGNUM || regnum > LR0_REGNUM + 127) */
-/* OBSOLETE error ("Attempt to read register stack out of range."); */
-/* OBSOLETE if (myaddr != NULL) */
-/* OBSOLETE write_register (regnum, *(long *) myaddr); */
-/* OBSOLETE if (actual_mem_addr != NULL) */
-/* OBSOLETE *actual_mem_addr = 0; */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE { */
-/* OBSOLETE /* It's in the memory portion of the register stack. */ */
-/* OBSOLETE if (myaddr != NULL) */
-/* OBSOLETE write_memory (memaddr, myaddr, 4); */
-/* OBSOLETE if (actual_mem_addr != NULL) */
-/* OBSOLETE *actual_mem_addr = memaddr; */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Find register number REGNUM relative to FRAME and put its */
-/* OBSOLETE (raw) contents in *RAW_BUFFER. Set *OPTIMIZED if the variable */
-/* OBSOLETE was optimized out (and thus can't be fetched). If the variable */
-/* OBSOLETE was fetched from memory, set *ADDRP to where it was fetched from, */
-/* OBSOLETE otherwise it was fetched from a register. */
-/* OBSOLETE */
-/* OBSOLETE The argument RAW_BUFFER must point to aligned memory. */ */
-/* OBSOLETE */
-/* OBSOLETE void */
-/* OBSOLETE a29k_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp, */
-/* OBSOLETE struct frame_info *frame, int regnum, */
-/* OBSOLETE enum lval_type *lvalp) */
-/* OBSOLETE { */
-/* OBSOLETE struct frame_info *fi; */
-/* OBSOLETE CORE_ADDR addr; */
-/* OBSOLETE enum lval_type lval; */
-/* OBSOLETE */
-/* OBSOLETE if (!target_has_registers) */
-/* OBSOLETE error ("No registers."); */
-/* OBSOLETE */
-/* OBSOLETE /* Probably now redundant with the target_has_registers check. */ */
-/* OBSOLETE if (frame == 0) */
-/* OBSOLETE return; */
-/* OBSOLETE */
-/* OBSOLETE /* Once something has a register number, it doesn't get optimized out. */ */
-/* OBSOLETE if (optimized != NULL) */
-/* OBSOLETE *optimized = 0; */
-/* OBSOLETE if (regnum == RSP_REGNUM) */
-/* OBSOLETE { */
-/* OBSOLETE if (raw_buffer != NULL) */
-/* OBSOLETE { */
-/* OBSOLETE store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), frame->frame); */
-/* OBSOLETE } */
-/* OBSOLETE if (lvalp != NULL) */
-/* OBSOLETE *lvalp = not_lval; */
-/* OBSOLETE return; */
-/* OBSOLETE } */
-/* OBSOLETE else if (regnum == PC_REGNUM && frame->next != NULL) */
-/* OBSOLETE { */
-/* OBSOLETE if (raw_buffer != NULL) */
-/* OBSOLETE { */
-/* OBSOLETE store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), frame->pc); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Not sure we have to do this. */ */
-/* OBSOLETE if (lvalp != NULL) */
-/* OBSOLETE *lvalp = not_lval; */
-/* OBSOLETE */
-/* OBSOLETE return; */
-/* OBSOLETE } */
-/* OBSOLETE else if (regnum == MSP_REGNUM) */
-/* OBSOLETE { */
-/* OBSOLETE if (raw_buffer != NULL) */
-/* OBSOLETE { */
-/* OBSOLETE if (frame->next != NULL) */
-/* OBSOLETE { */
-/* OBSOLETE store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), */
-/* OBSOLETE frame->next->saved_msp); */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE read_register_gen (MSP_REGNUM, raw_buffer); */
-/* OBSOLETE } */
-/* OBSOLETE /* The value may have been computed, not fetched. */ */
-/* OBSOLETE if (lvalp != NULL) */
-/* OBSOLETE *lvalp = not_lval; */
-/* OBSOLETE return; */
-/* OBSOLETE } */
-/* OBSOLETE else if (regnum < LR0_REGNUM || regnum >= LR0_REGNUM + 128) */
-/* OBSOLETE { */
-/* OBSOLETE /* These registers are not saved over procedure calls, */
-/* OBSOLETE so just print out the current values. */ */
-/* OBSOLETE if (raw_buffer != NULL) */
-/* OBSOLETE read_register_gen (regnum, raw_buffer); */
-/* OBSOLETE if (lvalp != NULL) */
-/* OBSOLETE *lvalp = lval_register; */
-/* OBSOLETE if (addrp != NULL) */
-/* OBSOLETE *addrp = REGISTER_BYTE (regnum); */
-/* OBSOLETE return; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE addr = frame->frame + (regnum - LR0_REGNUM) * 4; */
-/* OBSOLETE if (raw_buffer != NULL) */
-/* OBSOLETE read_register_stack (addr, raw_buffer, &addr, &lval); */
-/* OBSOLETE if (lvalp != NULL) */
-/* OBSOLETE *lvalp = lval; */
-/* OBSOLETE if (addrp != NULL) */
-/* OBSOLETE *addrp = addr; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE */
-/* OBSOLETE /* Discard from the stack the innermost frame, */
-/* OBSOLETE restoring all saved registers. */ */
-/* OBSOLETE */
-/* OBSOLETE void */
-/* OBSOLETE pop_frame (void) */
-/* OBSOLETE { */
-/* OBSOLETE struct frame_info *frame = get_current_frame (); */
-/* OBSOLETE CORE_ADDR rfb = read_register (RFB_REGNUM); */
-/* OBSOLETE CORE_ADDR gr1 = frame->frame + frame->rsize; */
-/* OBSOLETE CORE_ADDR lr1; */
-/* OBSOLETE CORE_ADDR original_lr0; */
-/* OBSOLETE int must_fix_lr0 = 0; */
-/* OBSOLETE int i; */
-/* OBSOLETE */
-/* OBSOLETE /* If popping a dummy frame, need to restore registers. */ */
-/* OBSOLETE if (PC_IN_CALL_DUMMY (read_register (PC_REGNUM), */
-/* OBSOLETE read_register (SP_REGNUM), */
-/* OBSOLETE FRAME_FP (frame))) */
-/* OBSOLETE { */
-/* OBSOLETE int lrnum = LR0_REGNUM + DUMMY_ARG / 4; */
-/* OBSOLETE for (i = 0; i < DUMMY_SAVE_SR128; ++i) */
-/* OBSOLETE write_register (SR_REGNUM (i + 128), read_register (lrnum++)); */
-/* OBSOLETE for (i = 0; i < DUMMY_SAVE_SR160; ++i) */
-/* OBSOLETE write_register (SR_REGNUM (i + 160), read_register (lrnum++)); */
-/* OBSOLETE for (i = 0; i < DUMMY_SAVE_GREGS; ++i) */
-/* OBSOLETE write_register (RETURN_REGNUM + i, read_register (lrnum++)); */
-/* OBSOLETE /* Restore the PCs and prepare to restore LR0. */ */
-/* OBSOLETE write_register (PC_REGNUM, read_register (lrnum++)); */
-/* OBSOLETE write_register (NPC_REGNUM, read_register (lrnum++)); */
-/* OBSOLETE write_register (PC2_REGNUM, read_register (lrnum++)); */
-/* OBSOLETE original_lr0 = read_register (lrnum++); */
-/* OBSOLETE must_fix_lr0 = 1; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Restore the memory stack pointer. */ */
-/* OBSOLETE write_register (MSP_REGNUM, frame->saved_msp); */
-/* OBSOLETE /* Restore the register stack pointer. */ */
-/* OBSOLETE write_register (GR1_REGNUM, gr1); */
-/* OBSOLETE */
-/* OBSOLETE /* If we popped a dummy frame, restore lr0 now that gr1 has been restored. */ */
-/* OBSOLETE if (must_fix_lr0) */
-/* OBSOLETE write_register (LR0_REGNUM, original_lr0); */
-/* OBSOLETE */
-/* OBSOLETE /* Check whether we need to fill registers. */ */
-/* OBSOLETE lr1 = read_register (LR0_REGNUM + 1); */
-/* OBSOLETE if (lr1 > rfb) */
-/* OBSOLETE { */
-/* OBSOLETE /* Fill. */ */
-/* OBSOLETE int num_bytes = lr1 - rfb; */
-/* OBSOLETE int i; */
-/* OBSOLETE long word; */
-/* OBSOLETE */
-/* OBSOLETE write_register (RAB_REGNUM, read_register (RAB_REGNUM) + num_bytes); */
-/* OBSOLETE write_register (RFB_REGNUM, lr1); */
-/* OBSOLETE for (i = 0; i < num_bytes; i += 4) */
-/* OBSOLETE { */
-/* OBSOLETE /* Note: word is in host byte order. */ */
-/* OBSOLETE word = read_memory_integer (rfb + i, 4); */
-/* OBSOLETE write_register (LR0_REGNUM + ((rfb - gr1) % 0x80) + i / 4, word); */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE flush_cached_frames (); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Push an empty stack frame, to record the current PC, etc. */ */
-/* OBSOLETE */
-/* OBSOLETE void */
-/* OBSOLETE push_dummy_frame (void) */
-/* OBSOLETE { */
-/* OBSOLETE long w; */
-/* OBSOLETE CORE_ADDR rab, gr1; */
-/* OBSOLETE CORE_ADDR msp = read_register (MSP_REGNUM); */
-/* OBSOLETE int lrnum, i; */
-/* OBSOLETE CORE_ADDR original_lr0; */
-/* OBSOLETE */
-/* OBSOLETE /* Read original lr0 before changing gr1. This order isn't really needed */
-/* OBSOLETE since GDB happens to have a snapshot of all the regs and doesn't toss */
-/* OBSOLETE it when gr1 is changed. But it's The Right Thing To Do. */ */
-/* OBSOLETE original_lr0 = read_register (LR0_REGNUM); */
-/* OBSOLETE */
-/* OBSOLETE /* Allocate the new frame. */ */
-/* OBSOLETE gr1 = read_register (GR1_REGNUM) - DUMMY_FRAME_RSIZE; */
-/* OBSOLETE write_register (GR1_REGNUM, gr1); */
-/* OBSOLETE */
-/* OBSOLETE #ifdef VXWORKS_TARGET */
-/* OBSOLETE /* We force re-reading all registers to get the new local registers set */
-/* OBSOLETE after gr1 has been modified. This fix is due to the lack of single */
-/* OBSOLETE register read/write operation in the RPC interface between VxGDB and */
-/* OBSOLETE VxWorks. This really must be changed ! */ */
-/* OBSOLETE */
-/* OBSOLETE vx_read_register (-1); */
-/* OBSOLETE */
-/* OBSOLETE #endif /* VXWORK_TARGET */ */
-/* OBSOLETE */
-/* OBSOLETE rab = read_register (RAB_REGNUM); */
-/* OBSOLETE if (gr1 < rab) */
-/* OBSOLETE { */
-/* OBSOLETE /* We need to spill registers. */ */
-/* OBSOLETE int num_bytes = rab - gr1; */
-/* OBSOLETE CORE_ADDR rfb = read_register (RFB_REGNUM); */
-/* OBSOLETE int i; */
-/* OBSOLETE long word; */
-/* OBSOLETE */
-/* OBSOLETE write_register (RFB_REGNUM, rfb - num_bytes); */
-/* OBSOLETE write_register (RAB_REGNUM, gr1); */
-/* OBSOLETE for (i = 0; i < num_bytes; i += 4) */
-/* OBSOLETE { */
-/* OBSOLETE /* Note: word is in target byte order. */ */
-/* OBSOLETE read_register_gen (LR0_REGNUM + i / 4, (char *) &word); */
-/* OBSOLETE write_memory (rfb - num_bytes + i, (char *) &word, 4); */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* There are no arguments in to the dummy frame, so we don't need */
-/* OBSOLETE more than rsize plus the return address and lr1. */ */
-/* OBSOLETE write_register (LR0_REGNUM + 1, gr1 + DUMMY_FRAME_RSIZE + 2 * 4); */
-/* OBSOLETE */
-/* OBSOLETE /* Set the memory frame pointer. */ */
-/* OBSOLETE write_register (LR0_REGNUM + DUMMY_FRAME_RSIZE / 4 - 1, msp); */
-/* OBSOLETE */
-/* OBSOLETE /* Allocate arg_slop. */ */
-/* OBSOLETE write_register (MSP_REGNUM, msp - 16 * 4); */
-/* OBSOLETE */
-/* OBSOLETE /* Save registers. */ */
-/* OBSOLETE lrnum = LR0_REGNUM + DUMMY_ARG / 4; */
-/* OBSOLETE for (i = 0; i < DUMMY_SAVE_SR128; ++i) */
-/* OBSOLETE write_register (lrnum++, read_register (SR_REGNUM (i + 128))); */
-/* OBSOLETE for (i = 0; i < DUMMY_SAVE_SR160; ++i) */
-/* OBSOLETE write_register (lrnum++, read_register (SR_REGNUM (i + 160))); */
-/* OBSOLETE for (i = 0; i < DUMMY_SAVE_GREGS; ++i) */
-/* OBSOLETE write_register (lrnum++, read_register (RETURN_REGNUM + i)); */
-/* OBSOLETE /* Save the PCs and LR0. */ */
-/* OBSOLETE write_register (lrnum++, read_register (PC_REGNUM)); */
-/* OBSOLETE write_register (lrnum++, read_register (NPC_REGNUM)); */
-/* OBSOLETE write_register (lrnum++, read_register (PC2_REGNUM)); */
-/* OBSOLETE */
-/* OBSOLETE /* Why are we saving LR0? What would clobber it? (the dummy frame should */
-/* OBSOLETE be below it on the register stack, no?). */ */
-/* OBSOLETE write_register (lrnum++, original_lr0); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE */
-/* OBSOLETE */
-/* OBSOLETE /* */
-/* OBSOLETE This routine takes three arguments and makes the cached frames look */
-/* OBSOLETE as if these arguments defined a frame on the cache. This allows the */
-/* OBSOLETE rest of `info frame' to extract the important arguments without much */
-/* OBSOLETE difficulty. Since an individual frame on the 29K is determined by */
-/* OBSOLETE three values (FP, PC, and MSP), we really need all three to do a */
-/* OBSOLETE good job. */ */
-/* OBSOLETE */
-/* OBSOLETE struct frame_info * */
-/* OBSOLETE setup_arbitrary_frame (int argc, CORE_ADDR *argv) */
-/* OBSOLETE { */
-/* OBSOLETE struct frame_info *frame; */
-/* OBSOLETE */
-/* OBSOLETE if (argc != 3) */
-/* OBSOLETE error ("AMD 29k frame specifications require three arguments: rsp pc msp"); */
-/* OBSOLETE */
-/* OBSOLETE frame = create_new_frame (argv[0], argv[1]); */
-/* OBSOLETE */
-/* OBSOLETE if (!frame) */
-/* OBSOLETE internal_error (__FILE__, __LINE__, */
-/* OBSOLETE "create_new_frame returned invalid frame id"); */
-/* OBSOLETE */
-/* OBSOLETE /* Creating a new frame munges the `frame' value from the current */
-/* OBSOLETE GR1, so we restore it again here. FIXME, untangle all this */
-/* OBSOLETE 29K frame stuff... */ */
-/* OBSOLETE frame->frame = argv[0]; */
-/* OBSOLETE */
-/* OBSOLETE /* Our MSP is in argv[2]. It'd be intelligent if we could just */
-/* OBSOLETE save this value in the FRAME. But the way it's set up (FIXME), */
-/* OBSOLETE we must save our caller's MSP. We compute that by adding our */
-/* OBSOLETE memory stack frame size to our MSP. */ */
-/* OBSOLETE frame->saved_msp = argv[2] + frame->msize; */
-/* OBSOLETE */
-/* OBSOLETE return frame; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE int */
-/* OBSOLETE gdb_print_insn_a29k (bfd_vma memaddr, disassemble_info *info) */
-/* OBSOLETE { */
-/* OBSOLETE if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) */
-/* OBSOLETE return print_insn_big_a29k (memaddr, info); */
-/* OBSOLETE else */
-/* OBSOLETE return print_insn_little_a29k (memaddr, info); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE enum a29k_processor_types processor_type = a29k_unknown; */
-/* OBSOLETE */
-/* OBSOLETE void */
-/* OBSOLETE a29k_get_processor_type (void) */
-/* OBSOLETE { */
-/* OBSOLETE unsigned int cfg_reg = (unsigned int) read_register (CFG_REGNUM); */
-/* OBSOLETE */
-/* OBSOLETE /* Most of these don't have freeze mode. */ */
-/* OBSOLETE processor_type = a29k_no_freeze_mode; */
-/* OBSOLETE */
-/* OBSOLETE switch ((cfg_reg >> 28) & 0xf) */
-/* OBSOLETE { */
-/* OBSOLETE case 0: */
-/* OBSOLETE fprintf_filtered (gdb_stderr, "Remote debugging an Am29000"); */
-/* OBSOLETE break; */
-/* OBSOLETE case 1: */
-/* OBSOLETE fprintf_filtered (gdb_stderr, "Remote debugging an Am29005"); */
-/* OBSOLETE break; */
-/* OBSOLETE case 2: */
-/* OBSOLETE fprintf_filtered (gdb_stderr, "Remote debugging an Am29050"); */
-/* OBSOLETE processor_type = a29k_freeze_mode; */
-/* OBSOLETE break; */
-/* OBSOLETE case 3: */
-/* OBSOLETE fprintf_filtered (gdb_stderr, "Remote debugging an Am29035"); */
-/* OBSOLETE break; */
-/* OBSOLETE case 4: */
-/* OBSOLETE fprintf_filtered (gdb_stderr, "Remote debugging an Am29030"); */
-/* OBSOLETE break; */
-/* OBSOLETE case 5: */
-/* OBSOLETE fprintf_filtered (gdb_stderr, "Remote debugging an Am2920*"); */
-/* OBSOLETE break; */
-/* OBSOLETE case 6: */
-/* OBSOLETE fprintf_filtered (gdb_stderr, "Remote debugging an Am2924*"); */
-/* OBSOLETE break; */
-/* OBSOLETE case 7: */
-/* OBSOLETE fprintf_filtered (gdb_stderr, "Remote debugging an Am29040"); */
-/* OBSOLETE break; */
-/* OBSOLETE default: */
-/* OBSOLETE fprintf_filtered (gdb_stderr, "Remote debugging an unknown Am29k\n"); */
-/* OBSOLETE /* Don't bother to print the revision. */ */
-/* OBSOLETE return; */
-/* OBSOLETE } */
-/* OBSOLETE fprintf_filtered (gdb_stderr, " revision %c\n", 'A' + ((cfg_reg >> 24) & 0x0f)); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE #ifdef GET_LONGJMP_TARGET */
-/* OBSOLETE /* Figure out where the longjmp will land. We expect that we have just entered */
-/* OBSOLETE longjmp and haven't yet setup the stack frame, so the args are still in the */
-/* OBSOLETE output regs. lr2 (LR2_REGNUM) points at the jmp_buf structure from which we */
-/* OBSOLETE extract the pc (JB_PC) that we will land at. The pc is copied into ADDR. */
-/* OBSOLETE This routine returns true on success */ */
-/* OBSOLETE */
-/* OBSOLETE int */
-/* OBSOLETE get_longjmp_target (CORE_ADDR *pc) */
-/* OBSOLETE { */
-/* OBSOLETE CORE_ADDR jb_addr; */
-/* OBSOLETE char buf[sizeof (CORE_ADDR)]; */
-/* OBSOLETE */
-/* OBSOLETE jb_addr = read_register (LR2_REGNUM); */
-/* OBSOLETE */
-/* OBSOLETE if (target_read_memory (jb_addr + JB_PC * JB_ELEMENT_SIZE, (char *) buf, */
-/* OBSOLETE sizeof (CORE_ADDR))) */
-/* OBSOLETE return 0; */
-/* OBSOLETE */
-/* OBSOLETE *pc = extract_address ((PTR) buf, sizeof (CORE_ADDR)); */
-/* OBSOLETE return 1; */
-/* OBSOLETE } */
-/* OBSOLETE #endif /* GET_LONGJMP_TARGET */ */
-/* OBSOLETE */
-/* OBSOLETE void */
-/* OBSOLETE _initialize_a29k_tdep (void) */
-/* OBSOLETE { */
-/* OBSOLETE extern CORE_ADDR text_end; */
-/* OBSOLETE */
-/* OBSOLETE tm_print_insn = gdb_print_insn_a29k; */
-/* OBSOLETE */
-/* OBSOLETE /* FIXME, there should be a way to make a CORE_ADDR variable settable. */ */
-/* OBSOLETE add_show_from_set */
-/* OBSOLETE (add_set_cmd ("rstack_high_address", class_support, var_uinteger, */
-/* OBSOLETE (char *) &rstack_high_address, */
-/* OBSOLETE "Set top address in memory of the register stack.\n\ */
-/* OBSOLETE Attempts to access registers saved above this address will be ignored\n\ */
-/* OBSOLETE or will produce the value -1.", &setlist), */
-/* OBSOLETE &showlist); */
-/* OBSOLETE */
-/* OBSOLETE /* FIXME, there should be a way to make a CORE_ADDR variable settable. */ */
-/* OBSOLETE add_show_from_set */
-/* OBSOLETE (add_set_cmd ("call_scratch_address", class_support, var_uinteger, */
-/* OBSOLETE (char *) &text_end, */
-/* OBSOLETE "Set address in memory where small amounts of RAM can be used\n\ */
-/* OBSOLETE when making function calls into the inferior.", &setlist), */
-/* OBSOLETE &showlist); */
-/* OBSOLETE } */
diff --git a/gdb/acconfig.h b/gdb/acconfig.h
index 664bbcf..619b0ae 100644
--- a/gdb/acconfig.h
+++ b/gdb/acconfig.h
@@ -65,6 +65,9 @@
/* Define if <sys/link.h> has struct link_map32 */
#undef HAVE_STRUCT_LINK_MAP32
+/* Define if <sys/link.h> has link_map32 (solaris sparc-64 target) */
+#undef _SYSCALL32
+
/* Define if the prfpregset_t type is broken. */
#undef PRFPREGSET_T_BROKEN
diff --git a/gdb/acinclude.m4 b/gdb/acinclude.m4
index a55e36f..12f4c48 100644
--- a/gdb/acinclude.m4
+++ b/gdb/acinclude.m4
@@ -866,3 +866,113 @@ dnl CY_GNU_GETTEXT into aclocal.m4.
ifelse(yes,no,[
AC_DEFUN([CY_GNU_GETTEXT],)
])
+
+## ----------------------------------------- ##
+## ANSIfy the C compiler whenever possible. ##
+## From Franc,ois Pinard ##
+## ----------------------------------------- ##
+
+# Copyright 1996, 1997, 1999, 2000, 2001 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, 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.
+
+# serial 1
+
+# @defmac AC_PROG_CC_STDC
+# @maindex PROG_CC_STDC
+# @ovindex CC
+# If the C compiler in not in ANSI C mode by default, try to add an option
+# to output variable @code{CC} to make it so. This macro tries various
+# options that select ANSI C on some system or another. It considers the
+# compiler to be in ANSI C mode if it handles function prototypes correctly.
+#
+# If you use this macro, you should check after calling it whether the C
+# compiler has been set to accept ANSI C; if not, the shell variable
+# @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
+# code in ANSI C, you can make an un-ANSIfied copy of it by using the
+# program @code{ansi2knr}, which comes with Ghostscript.
+# @end defmac
+
+AC_DEFUN([AM_PROG_CC_STDC],
+[AC_REQUIRE([AC_PROG_CC])
+AC_BEFORE([$0], [AC_C_INLINE])
+AC_BEFORE([$0], [AC_C_CONST])
+dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
+dnl a magic option to avoid problems with ANSI preprocessor commands
+dnl like #elif.
+dnl FIXME: can't do this because then AC_AIX won't work due to a
+dnl circular dependency.
+dnl AC_BEFORE([$0], [AC_PROG_CPP])
+AC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C])
+AC_CACHE_VAL(am_cv_prog_cc_stdc,
+[am_cv_prog_cc_stdc=no
+ac_save_CC="$CC"
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX -qlanglvl=ansi
+# Ultrix and OSF/1 -std1
+# HP-UX 10.20 and later -Ae
+# HP-UX older versions -Aa -D_HPUX_SOURCE
+# SVR4 -Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ AC_TRY_COMPILE(
+[#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+], [
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+],
+[am_cv_prog_cc_stdc="$ac_arg"; break])
+done
+CC="$ac_save_CC"
+])
+if test -z "$am_cv_prog_cc_stdc"; then
+ AC_MSG_RESULT([none needed])
+else
+ AC_MSG_RESULT([$am_cv_prog_cc_stdc])
+fi
+case "x$am_cv_prog_cc_stdc" in
+ x|xno) ;;
+ *) CC="$CC $am_cv_prog_cc_stdc" ;;
+esac
+])
diff --git a/gdb/aclocal.m4 b/gdb/aclocal.m4
index a64c339..5b9d643 100644
--- a/gdb/aclocal.m4
+++ b/gdb/aclocal.m4
@@ -1,4 +1,4 @@
-dnl aclocal.m4 generated automatically by aclocal 1.4-p4
+dnl aclocal.m4 generated automatically by aclocal 1.4
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
@@ -879,57 +879,23 @@ ifelse(yes,no,[
AC_DEFUN([CY_GNU_GETTEXT],)
])
-# Add --enable-maintainer-mode option to configure.
-# From Jim Meyering
-
-# serial 1
-
-AC_DEFUN(AM_MAINTAINER_MODE,
-[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
- dnl maintainer-mode is disabled by default
- AC_ARG_ENABLE(maintainer-mode,
-[ --enable-maintainer-mode enable make rules and dependencies not useful
- (and sometimes confusing) to the casual installer],
- USE_MAINTAINER_MODE=$enableval,
- USE_MAINTAINER_MODE=no)
- AC_MSG_RESULT($USE_MAINTAINER_MODE)
- AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
- MAINT=$MAINTAINER_MODE_TRUE
- AC_SUBST(MAINT)dnl
-]
-)
-# Define a conditional.
+# Copyright 1996, 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
-AC_DEFUN(AM_CONDITIONAL,
-[AC_SUBST($1_TRUE)
-AC_SUBST($1_FALSE)
-if $2; then
- $1_TRUE=
- $1_FALSE='#'
-else
- $1_TRUE='#'
- $1_FALSE=
-fi])
+# 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, or (at your option)
+# any later version.
-#serial 1
-# This test replaces the one in autoconf.
-# Currently this macro should have the same name as the autoconf macro
-# because gettext's gettext.m4 (distributed in the automake package)
-# still uses it. Otherwise, the use in gettext.m4 makes autoheader
-# give these diagnostics:
-# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
-# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
-
-undefine([AC_ISC_POSIX])
-
-AC_DEFUN([AC_ISC_POSIX],
- [
- dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
- AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
- ]
-)
+# 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.
# serial 1
@@ -948,7 +914,7 @@ AC_DEFUN([AC_ISC_POSIX],
# program @code{ansi2knr}, which comes with Ghostscript.
# @end defmac
-AC_DEFUN(AM_PROG_CC_STDC,
+AC_DEFUN([AM_PROG_CC_STDC],
[AC_REQUIRE([AC_PROG_CC])
AC_BEFORE([$0], [AC_C_INLINE])
AC_BEFORE([$0], [AC_C_CONST])
@@ -958,7 +924,7 @@ dnl like #elif.
dnl FIXME: can't do this because then AC_AIX won't work due to a
dnl circular dependency.
dnl AC_BEFORE([$0], [AC_PROG_CPP])
-AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
+AC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C])
AC_CACHE_VAL(am_cv_prog_cc_stdc,
[am_cv_prog_cc_stdc=no
ac_save_CC="$CC"
@@ -966,9 +932,10 @@ ac_save_CC="$CC"
# breaks some systems' header files.
# AIX -qlanglvl=ansi
# Ultrix and OSF/1 -std1
-# HP-UX -Aa -D_HPUX_SOURCE
+# HP-UX 10.20 and later -Ae
+# HP-UX older versions -Aa -D_HPUX_SOURCE
# SVR4 -Xc -D__EXTENSIONS__
-for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do
CC="$ac_save_CC $ac_arg"
AC_TRY_COMPILE(
@@ -1010,7 +977,7 @@ CC="$ac_save_CC"
if test -z "$am_cv_prog_cc_stdc"; then
AC_MSG_RESULT([none needed])
else
- AC_MSG_RESULT($am_cv_prog_cc_stdc)
+ AC_MSG_RESULT([$am_cv_prog_cc_stdc])
fi
case "x$am_cv_prog_cc_stdc" in
x|xno) ;;
@@ -1018,3 +985,36 @@ case "x$am_cv_prog_cc_stdc" in
esac
])
+# Add --enable-maintainer-mode option to configure.
+# From Jim Meyering
+
+# serial 1
+
+AC_DEFUN(AM_MAINTAINER_MODE,
+[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+ dnl maintainer-mode is disabled by default
+ AC_ARG_ENABLE(maintainer-mode,
+[ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer],
+ USE_MAINTAINER_MODE=$enableval,
+ USE_MAINTAINER_MODE=no)
+ AC_MSG_RESULT($USE_MAINTAINER_MODE)
+ AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
+ MAINT=$MAINTAINER_MODE_TRUE
+ AC_SUBST(MAINT)dnl
+]
+)
+
+# Define a conditional.
+
+AC_DEFUN(AM_CONDITIONAL,
+[AC_SUBST($1_TRUE)
+AC_SUBST($1_FALSE)
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi])
+
diff --git a/gdb/alpha-linux-tdep.c b/gdb/alpha-linux-tdep.c
new file mode 100644
index 0000000..d467840
--- /dev/null
+++ b/gdb/alpha-linux-tdep.c
@@ -0,0 +1,120 @@
+/* Target-dependent code for GNU/Linux on Alpha.
+ Copyright 2002 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "frame.h"
+#include "gdbcore.h"
+#include "value.h"
+
+#include "alpha-tdep.h"
+
+/* Under GNU/Linux, signal handler invocations can be identified by the
+ designated code sequence that is used to return from a signal
+ handler. In particular, the return address of a signal handler
+ points to the following sequence (the first instruction is quadword
+ aligned):
+
+ bis $30,$30,$16
+ addq $31,0x67,$0
+ call_pal callsys
+
+ Each instruction has a unique encoding, so we simply attempt to
+ match the instruction the pc is pointing to with any of the above
+ instructions. If there is a hit, we know the offset to the start
+ of the designated sequence and can then check whether we really are
+ executing in a designated sequence. If not, -1 is returned,
+ otherwise the offset from the start of the desingated sequence is
+ returned.
+
+ There is a slight chance of false hits: code could jump into the
+ middle of the designated sequence, in which case there is no
+ guarantee that we are in the middle of a sigreturn syscall. Don't
+ think this will be a problem in praxis, though. */
+LONGEST
+alpha_linux_sigtramp_offset (CORE_ADDR pc)
+{
+ unsigned int i[3], w;
+ long off;
+
+ if (read_memory_nobpt (pc, (char *) &w, 4) != 0)
+ return -1;
+
+ off = -1;
+ switch (w)
+ {
+ case 0x47de0410:
+ off = 0;
+ break; /* bis $30,$30,$16 */
+ case 0x43ecf400:
+ off = 4;
+ break; /* addq $31,0x67,$0 */
+ case 0x00000083:
+ off = 8;
+ break; /* call_pal callsys */
+ default:
+ return -1;
+ }
+ pc -= off;
+ if (pc & 0x7)
+ {
+ /* designated sequence is not quadword aligned */
+ return -1;
+ }
+ if (read_memory_nobpt (pc, (char *) i, sizeof (i)) != 0)
+ return -1;
+
+ if (i[0] == 0x47de0410 && i[1] == 0x43ecf400 && i[2] == 0x00000083)
+ return off;
+
+ return -1;
+}
+
+static int
+alpha_linux_pc_in_sigtramp (CORE_ADDR pc, char *func_name)
+{
+ return (alpha_linux_sigtramp_offset (pc) >= 0);
+}
+
+static CORE_ADDR
+alpha_linux_sigcontext_addr (struct frame_info *frame)
+{
+ return (frame->frame - 0x298); /* sizeof(struct sigcontext) */
+}
+
+static void
+alpha_linux_init_abi (struct gdbarch_info info,
+ struct gdbarch *gdbarch)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+ set_gdbarch_pc_in_sigtramp (gdbarch, alpha_linux_pc_in_sigtramp);
+
+ tdep->dynamic_sigtramp_offset = alpha_linux_sigtramp_offset;
+ tdep->sigcontext_addr = alpha_linux_sigcontext_addr;
+
+ tdep->jb_pc = 2;
+ tdep->jb_elt_size = 8;
+}
+
+void
+_initialize_alpha_linux_tdep (void)
+{
+ alpha_gdbarch_register_os_abi (ALPHA_ABI_LINUX, alpha_linux_init_abi);
+}
diff --git a/gdb/alpha-nat.c b/gdb/alpha-nat.c
index f7e565b..580dcc0 100644
--- a/gdb/alpha-nat.c
+++ b/gdb/alpha-nat.c
@@ -24,6 +24,9 @@
#include "gdbcore.h"
#include "target.h"
#include "regcache.h"
+
+#include "alpha-tdep.h"
+
#include <sys/ptrace.h>
#ifdef __linux__
#include <asm/reg.h>
@@ -38,40 +41,6 @@
static void fetch_osf_core_registers (char *, unsigned, int, CORE_ADDR);
static void fetch_elf_core_registers (char *, unsigned, int, CORE_ADDR);
-/* Size of elements in jmpbuf */
-
-#define JB_ELEMENT_SIZE 8
-
-/* The definition for JB_PC in machine/reg.h is wrong.
- And we can't get at the correct definition in setjmp.h as it is
- not always available (eg. if _POSIX_SOURCE is defined which is the
- default). As the defintion is unlikely to change (see comment
- in <setjmp.h>, define the correct value here. */
-
-#undef JB_PC
-#define JB_PC 2
-
-/* Figure out where the longjmp will land.
- We expect the first arg to be a pointer to the jmp_buf structure from which
- we extract the pc (JB_PC) that we will land at. The pc is copied into PC.
- This routine returns true on success. */
-
-int
-get_longjmp_target (CORE_ADDR *pc)
-{
- CORE_ADDR jb_addr;
- char raw_buffer[MAX_REGISTER_RAW_SIZE];
-
- jb_addr = read_register (A0_REGNUM);
-
- if (target_read_memory (jb_addr + JB_PC * JB_ELEMENT_SIZE, raw_buffer,
- sizeof (CORE_ADDR)))
- return 0;
-
- *pc = extract_address (raw_buffer, sizeof (CORE_ADDR));
- return 1;
-}
-
/* Extract the register values out of the core file and store
them where `read_register' will find them.
@@ -98,7 +67,7 @@ fetch_osf_core_registers (char *core_reg_sect, unsigned core_reg_size,
OSF/1.2 core files. OSF5 uses different names for the register
enum list, need to handle two cases. The actual values are the
same. */
- static int core_reg_mapping[NUM_REGS] =
+ static int core_reg_mapping[ALPHA_NUM_REGS] =
{
#ifdef NCF_REGS
#define EFL NCF_REGS
@@ -124,7 +93,7 @@ fetch_osf_core_registers (char *core_reg_sect, unsigned core_reg_size,
EF_PC, -1
#endif
};
- static char zerobuf[MAX_REGISTER_RAW_SIZE] =
+ static char zerobuf[ALPHA_MAX_REGISTER_RAW_SIZE] =
{0};
for (regno = 0; regno < NUM_REGS; regno++)
@@ -171,10 +140,11 @@ fetch_elf_core_registers (char *core_reg_sect, unsigned core_reg_size,
else
{
/* The General Registers. */
- memcpy (&registers[REGISTER_BYTE (V0_REGNUM)], core_reg_sect, 31 * 8);
+ memcpy (&registers[REGISTER_BYTE (ALPHA_V0_REGNUM)], core_reg_sect,
+ 31 * 8);
memcpy (&registers[REGISTER_BYTE (PC_REGNUM)], core_reg_sect + 31 * 8, 8);
- memset (&registers[REGISTER_BYTE (ZERO_REGNUM)], 0, 8);
- memset (&register_valid[V0_REGNUM], 1, 32);
+ memset (&registers[REGISTER_BYTE (ALPHA_ZERO_REGNUM)], 0, 8);
+ memset (&register_valid[ALPHA_V0_REGNUM], 1, 32);
register_valid[PC_REGNUM] = 1;
}
}
@@ -218,7 +188,7 @@ supply_gregset (gdb_gregset_t *gregsetp)
{
register int regi;
register long *regp = ALPHA_REGSET_BASE (gregsetp);
- static char zerobuf[MAX_REGISTER_RAW_SIZE] =
+ static char zerobuf[ALPHA_MAX_REGISTER_RAW_SIZE] =
{0};
for (regi = 0; regi < 31; regi++)
@@ -227,7 +197,7 @@ supply_gregset (gdb_gregset_t *gregsetp)
supply_register (PC_REGNUM, (char *) (regp + 31));
/* Fill inaccessible registers with zero. */
- supply_register (ZERO_REGNUM, zerobuf);
+ supply_register (ALPHA_ZERO_REGNUM, zerobuf);
supply_register (FP_REGNUM, zerobuf);
}
diff --git a/gdb/alpha-osf1-tdep.c b/gdb/alpha-osf1-tdep.c
new file mode 100644
index 0000000..67c56cf
--- /dev/null
+++ b/gdb/alpha-osf1-tdep.c
@@ -0,0 +1,73 @@
+/* Target-dependent code for OSF/1 on Alpha.
+ Copyright 2002 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "frame.h"
+#include "gdbcore.h"
+#include "value.h"
+
+#include "alpha-tdep.h"
+
+/* Under OSF/1, the __sigtramp routine is frameless and has a frame
+ size of zero, but we are able to backtrace through it. */
+static CORE_ADDR
+alpha_osf1_skip_sigtramp_frame (struct frame_info *frame, CORE_ADDR pc)
+{
+ char *name;
+
+ find_pc_partial_function (pc, &name, (CORE_ADDR *) NULL, (CORE_ADDR *) NULL);
+ if (PC_IN_SIGTRAMP (pc, name))
+ return frame->frame;
+ return 0;
+}
+
+static int
+alpha_osf1_pc_in_sigtramp (CORE_ADDR pc, char *func_name)
+{
+ return (func_name != NULL && STREQ ("__sigtramp", func_name));
+}
+
+static CORE_ADDR
+alpha_osf1_sigcontext_addr (struct frame_info *frame)
+{
+ return (read_memory_integer (frame->next ? frame->next->frame
+ : frame->frame, 8));
+}
+
+static void
+alpha_osf1_init_abi (struct gdbarch_info info,
+ struct gdbarch *gdbarch)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+ set_gdbarch_pc_in_sigtramp (gdbarch, alpha_osf1_pc_in_sigtramp);
+
+ tdep->skip_sigtramp_frame = alpha_osf1_skip_sigtramp_frame;
+ tdep->sigcontext_addr = alpha_osf1_sigcontext_addr;
+
+ tdep->jb_pc = 2;
+ tdep->jb_elt_size = 8;
+}
+
+void
+_initialize_alpha_osf1_tdep (void)
+{
+ alpha_gdbarch_register_os_abi (ALPHA_ABI_OSF1, alpha_osf1_init_abi);
+}
diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c
index 4ca6bcc..f354036 100644
--- a/gdb/alpha-tdep.c
+++ b/gdb/alpha-tdep.c
@@ -33,6 +33,52 @@
#include "linespec.h"
#include "regcache.h"
#include "doublest.h"
+#include "arch-utils.h"
+
+#include "elf-bfd.h"
+
+#include "alpha-tdep.h"
+
+static gdbarch_init_ftype alpha_gdbarch_init;
+
+static gdbarch_register_name_ftype alpha_register_name;
+static gdbarch_register_raw_size_ftype alpha_register_raw_size;
+static gdbarch_register_virtual_size_ftype alpha_register_virtual_size;
+static gdbarch_register_virtual_type_ftype alpha_register_virtual_type;
+static gdbarch_register_byte_ftype alpha_register_byte;
+static gdbarch_cannot_fetch_register_ftype alpha_cannot_fetch_register;
+static gdbarch_cannot_store_register_ftype alpha_cannot_store_register;
+static gdbarch_register_convertible_ftype alpha_register_convertible;
+static gdbarch_register_convert_to_virtual_ftype
+ alpha_register_convert_to_virtual;
+static gdbarch_register_convert_to_raw_ftype alpha_register_convert_to_raw;
+static gdbarch_store_struct_return_ftype alpha_store_struct_return;
+static gdbarch_extract_return_value_ftype alpha_extract_return_value;
+static gdbarch_store_return_value_ftype alpha_store_return_value;
+static gdbarch_extract_struct_value_address_ftype
+ alpha_extract_struct_value_address;
+static gdbarch_use_struct_convention_ftype alpha_use_struct_convention;
+
+static gdbarch_breakpoint_from_pc_ftype alpha_breakpoint_from_pc;
+
+static gdbarch_frame_args_address_ftype alpha_frame_args_address;
+static gdbarch_frame_locals_address_ftype alpha_frame_locals_address;
+
+static gdbarch_skip_prologue_ftype alpha_skip_prologue;
+static gdbarch_get_saved_register_ftype alpha_get_saved_register;
+static gdbarch_saved_pc_after_call_ftype alpha_saved_pc_after_call;
+static gdbarch_frame_chain_ftype alpha_frame_chain;
+static gdbarch_frame_saved_pc_ftype alpha_frame_saved_pc;
+static gdbarch_frame_init_saved_regs_ftype alpha_frame_init_saved_regs;
+
+static gdbarch_push_arguments_ftype alpha_push_arguments;
+static gdbarch_push_dummy_frame_ftype alpha_push_dummy_frame;
+static gdbarch_pop_frame_ftype alpha_pop_frame;
+static gdbarch_fix_call_dummy_ftype alpha_fix_call_dummy;
+static gdbarch_init_frame_pc_first_ftype alpha_init_frame_pc_first;
+static gdbarch_init_extra_frame_info_ftype alpha_init_extra_frame_info;
+
+static gdbarch_get_longjmp_target_ftype alpha_get_longjmp_target;
struct frame_extra_info
{
@@ -125,8 +171,6 @@ static unsigned int heuristic_fence_post = 0;
*/
/* *INDENT-ON* */
-
-
#define PROC_LOW_ADDR(proc) ((proc)->pdr.adr) /* least address */
/* These next two fields are kind of being hijacked. I wonder if
iline is too small for the values it needs to hold, if GDB is
@@ -153,95 +197,53 @@ struct linked_proc_info
}
*linked_proc_desc_table = NULL;
-int
-alpha_osf_in_sigtramp (CORE_ADDR pc, char *func_name)
+static CORE_ADDR
+alpha_frame_past_sigtramp_frame (struct frame_info *frame, CORE_ADDR pc)
{
- return (func_name != NULL && STREQ ("__sigtramp", func_name));
-}
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-/* Under GNU/Linux, signal handler invocations can be identified by the
- designated code sequence that is used to return from a signal
- handler. In particular, the return address of a signal handler
- points to the following sequence (the first instruction is quadword
- aligned):
-
- bis $30,$30,$16
- addq $31,0x67,$0
- call_pal callsys
-
- Each instruction has a unique encoding, so we simply attempt to
- match the instruction the pc is pointing to with any of the above
- instructions. If there is a hit, we know the offset to the start
- of the designated sequence and can then check whether we really are
- executing in a designated sequence. If not, -1 is returned,
- otherwise the offset from the start of the desingated sequence is
- returned.
-
- There is a slight chance of false hits: code could jump into the
- middle of the designated sequence, in which case there is no
- guarantee that we are in the middle of a sigreturn syscall. Don't
- think this will be a problem in praxis, though.
- */
+ if (tdep->skip_sigtramp_frame != NULL)
+ return (tdep->skip_sigtramp_frame (frame, pc));
-#ifndef TM_LINUXALPHA_H
-/* HACK: Provide a prototype when compiling this file for non
- linuxalpha targets. */
-long alpha_linux_sigtramp_offset (CORE_ADDR pc);
-#endif
-long
-alpha_linux_sigtramp_offset (CORE_ADDR pc)
+ return (0);
+}
+
+static LONGEST
+alpha_dynamic_sigtramp_offset (CORE_ADDR pc)
{
- unsigned int i[3], w;
- long off;
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
- if (read_memory_nobpt (pc, (char *) &w, 4) != 0)
- return -1;
+ /* Must be provided by OS/ABI variant code if supported. */
+ if (tdep->dynamic_sigtramp_offset != NULL)
+ return (tdep->dynamic_sigtramp_offset (pc));
- off = -1;
- switch (w)
- {
- case 0x47de0410:
- off = 0;
- break; /* bis $30,$30,$16 */
- case 0x43ecf400:
- off = 4;
- break; /* addq $31,0x67,$0 */
- case 0x00000083:
- off = 8;
- break; /* call_pal callsys */
- default:
- return -1;
- }
- pc -= off;
- if (pc & 0x7)
- {
- /* designated sequence is not quadword aligned */
- return -1;
- }
+ return (-1);
+}
- if (read_memory_nobpt (pc, (char *) i, sizeof (i)) != 0)
- return -1;
+#define ALPHA_PROC_SIGTRAMP_MAGIC 0x0e0f0f0f
- if (i[0] == 0x47de0410 && i[1] == 0x43ecf400 && i[2] == 0x00000083)
- return off;
+/* Return TRUE if the procedure descriptor PROC is a procedure
+ descriptor that refers to a dynamically generated signal
+ trampoline routine. */
+static int
+alpha_proc_desc_is_dyn_sigtramp (struct alpha_extra_func_info *proc)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ if (tdep->dynamic_sigtramp_offset != NULL)
+ return (proc->pdr.isym == ALPHA_PROC_SIGTRAMP_MAGIC);
- return -1;
+ return (0);
}
-
-/* Under OSF/1, the __sigtramp routine is frameless and has a frame
- size of zero, but we are able to backtrace through it. */
-CORE_ADDR
-alpha_osf_skip_sigtramp_frame (struct frame_info *frame, CORE_ADDR pc)
+static void
+alpha_set_proc_desc_is_dyn_sigtramp (struct alpha_extra_func_info *proc)
{
- char *name;
- find_pc_partial_function (pc, &name, (CORE_ADDR *) NULL, (CORE_ADDR *) NULL);
- if (IN_SIGTRAMP (pc, name))
- return frame->frame;
- else
- return 0;
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ if (tdep->dynamic_sigtramp_offset != NULL)
+ proc->pdr.isym = ALPHA_PROC_SIGTRAMP_MAGIC;
}
-
/* Dynamically create a signal-handler caller procedure descriptor for
the signal-handler return code starting at address LOW_ADDR. The
@@ -270,12 +272,12 @@ push_sigtramp_desc (CORE_ADDR low_addr)
PROC_FREG_MASK (proc_desc) = 0xffff;
PROC_PC_REG (proc_desc) = 26;
PROC_LOCALOFF (proc_desc) = 0;
- SET_PROC_DESC_IS_DYN_SIGTRAMP (proc_desc);
+ alpha_set_proc_desc_is_dyn_sigtramp (proc_desc);
return (proc_desc);
}
-char *
+static char *
alpha_register_name (int regno)
{
static char *register_names[] =
@@ -298,50 +300,61 @@ alpha_register_name (int regno)
return (register_names[regno]);
}
-int
+static int
alpha_cannot_fetch_register (int regno)
{
- return (regno == FP_REGNUM || regno == ZERO_REGNUM);
+ return (regno == FP_REGNUM || regno == ALPHA_ZERO_REGNUM);
}
-int
+static int
alpha_cannot_store_register (int regno)
{
- return (regno == FP_REGNUM || regno == ZERO_REGNUM);
+ return (regno == FP_REGNUM || regno == ALPHA_ZERO_REGNUM);
}
-int
+static int
alpha_register_convertible (int regno)
{
return (regno >= FP0_REGNUM && regno <= FP0_REGNUM + 31);
}
-struct type *
+static struct type *
alpha_register_virtual_type (int regno)
{
return ((regno >= FP0_REGNUM && regno < (FP0_REGNUM+31))
? builtin_type_double : builtin_type_long);
}
-int
+static int
alpha_register_byte (int regno)
{
return (regno * 8);
}
-int
+static int
alpha_register_raw_size (int regno)
{
return 8;
}
-int
+static int
alpha_register_virtual_size (int regno)
{
return 8;
}
+static CORE_ADDR
+alpha_sigcontext_addr (struct frame_info *fi)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ if (tdep->sigcontext_addr)
+ return (tdep->sigcontext_addr (fi));
+
+ return (0);
+}
+
/* Guaranteed to set frame->saved_regs to some values (it never leaves it
NULL). */
@@ -370,7 +383,12 @@ alpha_find_saved_regs (struct frame_info *frame)
{
CORE_ADDR sigcontext_addr;
- sigcontext_addr = SIGCONTEXT_ADDR (frame);
+ sigcontext_addr = alpha_sigcontext_addr (frame);
+ if (sigcontext_addr == 0)
+ {
+ /* Don't know where the sigcontext is; just bail. */
+ return;
+ }
for (ireg = 0; ireg < 32; ireg++)
{
reg_position = sigcontext_addr + SIGFRAME_REGSAVE_OFF + ireg * 8;
@@ -433,7 +451,7 @@ alpha_find_saved_regs (struct frame_info *frame)
frame->saved_regs[PC_REGNUM] = frame->saved_regs[returnreg];
}
-void
+static void
alpha_frame_init_saved_regs (struct frame_info *fi)
{
if (fi->saved_regs == NULL)
@@ -441,7 +459,7 @@ alpha_frame_init_saved_regs (struct frame_info *fi)
fi->saved_regs[SP_REGNUM] = fi->frame;
}
-void
+static void
alpha_init_frame_pc_first (int fromleaf, struct frame_info *prev)
{
prev->pc = (fromleaf ? SAVED_PC_AFTER_CALL (prev->next) :
@@ -468,7 +486,7 @@ read_next_frame_reg (struct frame_info *fi, int regno)
return read_register (regno);
}
-CORE_ADDR
+static CORE_ADDR
alpha_frame_saved_pc (struct frame_info *frame)
{
alpha_extra_func_info_t proc_desc = frame->extra_info->proc_desc;
@@ -483,7 +501,55 @@ alpha_frame_saved_pc (struct frame_info *frame)
return read_next_frame_reg (frame, pcreg);
}
-CORE_ADDR
+static void
+alpha_get_saved_register (char *raw_buffer,
+ int *optimized,
+ CORE_ADDR *addrp,
+ struct frame_info *frame,
+ int regnum,
+ enum lval_type *lval)
+{
+ CORE_ADDR addr;
+
+ if (!target_has_registers)
+ error ("No registers.");
+
+ /* Normal systems don't optimize out things with register numbers. */
+ if (optimized != NULL)
+ *optimized = 0;
+ addr = find_saved_register (frame, regnum);
+ if (addr != 0)
+ {
+ if (lval != NULL)
+ *lval = lval_memory;
+ if (regnum == SP_REGNUM)
+ {
+ if (raw_buffer != NULL)
+ {
+ /* Put it back in target format. */
+ store_address (raw_buffer, REGISTER_RAW_SIZE (regnum),
+ (LONGEST) addr);
+ }
+ if (addrp != NULL)
+ *addrp = 0;
+ return;
+ }
+ if (raw_buffer != NULL)
+ target_read_memory (addr, raw_buffer, REGISTER_RAW_SIZE (regnum));
+ }
+ else
+ {
+ if (lval != NULL)
+ *lval = lval_register;
+ addr = REGISTER_BYTE (regnum);
+ if (raw_buffer != NULL)
+ read_register_gen (regnum, raw_buffer);
+ }
+ if (addrp != NULL)
+ *addrp = addr;
+}
+
+static CORE_ADDR
alpha_saved_pc_after_call (struct frame_info *frame)
{
CORE_ADDR pc = frame->pc;
@@ -497,7 +563,7 @@ alpha_saved_pc_after_call (struct frame_info *frame)
pc = tmp;
proc_desc = find_proc_desc (pc, frame->next);
- pcreg = proc_desc ? PROC_PC_REG (proc_desc) : RA_REGNUM;
+ pcreg = proc_desc ? PROC_PC_REG (proc_desc) : ALPHA_RA_REGNUM;
if (frame->signal_handler_caller)
return alpha_frame_saved_pc (frame);
@@ -507,7 +573,7 @@ alpha_saved_pc_after_call (struct frame_info *frame)
static struct alpha_extra_func_info temp_proc_desc;
-static CORE_ADDR temp_saved_regs[NUM_REGS];
+static CORE_ADDR temp_saved_regs[ALPHA_NUM_REGS];
/* Nonzero if instruction at PC is a return instruction. "ret
$zero,($ra),1" on alpha. */
@@ -527,6 +593,7 @@ alpha_about_to_return (CORE_ADDR pc)
static CORE_ADDR
heuristic_proc_start (CORE_ADDR pc)
{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
CORE_ADDR start_pc = pc;
CORE_ADDR fence = start_pc - heuristic_fence_post;
@@ -534,8 +601,8 @@ heuristic_proc_start (CORE_ADDR pc)
return 0;
if (heuristic_fence_post == UINT_MAX
- || fence < VM_MIN_ADDRESS)
- fence = VM_MIN_ADDRESS;
+ || fence < tdep->vm_min_address)
+ fence = tdep->vm_min_address;
/* search back for previous return */
for (start_pc -= 4;; start_pc -= 4)
@@ -549,7 +616,7 @@ heuristic_proc_start (CORE_ADDR pc)
{
static int blurb_printed = 0;
- if (fence == VM_MIN_ADDRESS)
+ if (fence == tdep->vm_min_address)
warning ("Hit beginning of text section without finding");
else
warning ("Hit heuristic-fence-post without finding");
@@ -646,7 +713,8 @@ heuristic_proc_desc (CORE_ADDR start_pc, CORE_ADDR limit_pc,
e.g. via the minimal symbol table, might obviate this hack. */
if (pcreg == -1
&& cur_pc < (start_pc + 80)
- && (reg == T7_REGNUM || reg == T9_REGNUM || reg == RA_REGNUM))
+ && (reg == ALPHA_T7_REGNUM || reg == ALPHA_T9_REGNUM
+ || reg == ALPHA_RA_REGNUM))
pcreg = reg;
}
else if ((word & 0xffe0ffff) == 0x6be08001) /* ret zero,reg,1 */
@@ -672,7 +740,8 @@ heuristic_proc_desc (CORE_ADDR start_pc, CORE_ADDR limit_pc,
&& (word & 0xffff0000) != 0xb7fe0000) /* reg != $zero */
{
int reg = (word & 0x03e00000) >> 21;
- if (reg == T7_REGNUM || reg == T9_REGNUM || reg == RA_REGNUM)
+ if (reg == ALPHA_T7_REGNUM || reg == ALPHA_T9_REGNUM
+ || reg == ALPHA_RA_REGNUM)
{
pcreg = reg;
break;
@@ -687,12 +756,12 @@ heuristic_proc_desc (CORE_ADDR start_pc, CORE_ADDR limit_pc,
}
if (has_frame_reg)
- PROC_FRAME_REG (&temp_proc_desc) = GCC_FP_REGNUM;
+ PROC_FRAME_REG (&temp_proc_desc) = ALPHA_GCC_FP_REGNUM;
else
PROC_FRAME_REG (&temp_proc_desc) = SP_REGNUM;
PROC_FRAME_OFFSET (&temp_proc_desc) = frame_size;
PROC_REG_MASK (&temp_proc_desc) = reg_mask;
- PROC_PC_REG (&temp_proc_desc) = (pcreg == -1) ? RA_REGNUM : pcreg;
+ PROC_PC_REG (&temp_proc_desc) = (pcreg == -1) ? ALPHA_RA_REGNUM : pcreg;
PROC_LOCALOFF (&temp_proc_desc) = 0; /* XXX - bogus */
return &temp_proc_desc;
}
@@ -711,7 +780,7 @@ after_prologue (CORE_ADDR pc, alpha_extra_func_info_t proc_desc)
if (proc_desc)
{
- if (PROC_DESC_IS_DYN_SIGTRAMP (proc_desc))
+ if (alpha_proc_desc_is_dyn_sigtramp (proc_desc))
return PROC_LOW_ADDR (proc_desc); /* "prologue" is in kernel */
/* If function is frameless, then we need to do it the hard way. I
@@ -853,7 +922,7 @@ find_proc_desc (CORE_ADDR pc, struct frame_info *next_frame)
/* If PC is inside a dynamically generated sigtramp handler,
create and push a procedure descriptor for that code: */
- offset = DYNAMIC_SIGTRAMP_OFFSET (pc);
+ offset = alpha_dynamic_sigtramp_offset (pc);
if (offset >= 0)
return push_sigtramp_desc (pc - offset);
@@ -874,7 +943,7 @@ find_proc_desc (CORE_ADDR pc, struct frame_info *next_frame)
alpha_extra_func_info_t cached_proc_desc;
-CORE_ADDR
+static CORE_ADDR
alpha_frame_chain (struct frame_info *frame)
{
alpha_extra_func_info_t proc_desc;
@@ -902,7 +971,7 @@ alpha_frame_chain (struct frame_info *frame)
/* The previous frame from a sigtramp frame might be frameless
and have frame size zero. */
&& !frame->signal_handler_caller)
- return FRAME_PAST_SIGTRAMP_FRAME (frame, saved_pc);
+ return alpha_frame_past_sigtramp_frame (frame, saved_pc);
else
return read_next_frame_reg (frame, PROC_FRAME_REG (proc_desc))
+ PROC_FRAME_OFFSET (proc_desc);
@@ -920,7 +989,7 @@ alpha_print_extra_frame_info (struct frame_info *fi)
paddr_d (fi->extra_info->proc_desc->pdr.frameoffset));
}
-void
+static void
alpha_init_extra_frame_info (int fromleaf, struct frame_info *frame)
{
/* Use proc_desc calculated in frame_chain */
@@ -932,7 +1001,7 @@ alpha_init_extra_frame_info (int fromleaf, struct frame_info *frame)
frame->saved_regs = NULL;
frame->extra_info->localoff = 0;
- frame->extra_info->pc_reg = RA_REGNUM;
+ frame->extra_info->pc_reg = ALPHA_RA_REGNUM;
frame->extra_info->proc_desc = proc_desc == &temp_proc_desc ? 0 : proc_desc;
if (proc_desc)
{
@@ -953,7 +1022,7 @@ alpha_init_extra_frame_info (int fromleaf, struct frame_info *frame)
Get the value of the frame relative sp, procedure might have been
interrupted by a signal at it's very start. */
else if (frame->pc == PROC_LOW_ADDR (proc_desc)
- && !PROC_DESC_IS_DYN_SIGTRAMP (proc_desc))
+ && !alpha_proc_desc_is_dyn_sigtramp (proc_desc))
frame->frame = read_next_frame_reg (frame->next, SP_REGNUM);
else
frame->frame = read_next_frame_reg (frame->next, PROC_FRAME_REG (proc_desc))
@@ -968,26 +1037,26 @@ alpha_init_extra_frame_info (int fromleaf, struct frame_info *frame)
We can't use frame->signal_handler_caller, it is not yet set. */
find_pc_partial_function (frame->pc, &name,
(CORE_ADDR *) NULL, (CORE_ADDR *) NULL);
- if (!IN_SIGTRAMP (frame->pc, name))
+ if (!PC_IN_SIGTRAMP (frame->pc, name))
{
frame->saved_regs = (CORE_ADDR *)
frame_obstack_alloc (SIZEOF_FRAME_SAVED_REGS);
memcpy (frame->saved_regs, temp_saved_regs,
SIZEOF_FRAME_SAVED_REGS);
frame->saved_regs[PC_REGNUM]
- = frame->saved_regs[RA_REGNUM];
+ = frame->saved_regs[ALPHA_RA_REGNUM];
}
}
}
}
-CORE_ADDR
+static CORE_ADDR
alpha_frame_locals_address (struct frame_info *fi)
{
return (fi->frame - fi->extra_info->localoff);
}
-CORE_ADDR
+static CORE_ADDR
alpha_frame_args_address (struct frame_info *fi)
{
return (fi->frame - (ALPHA_NUM_ARG_REGS * 8));
@@ -1009,7 +1078,7 @@ alpha_frame_args_address (struct frame_info *fi)
arguments without difficulty. */
struct frame_info *
-setup_arbitrary_frame (int argc, CORE_ADDR *argv)
+alpha_setup_arbitrary_frame (int argc, CORE_ADDR *argv)
{
if (argc != 2)
error ("ALPHA frame specifications require two arguments: sp and pc");
@@ -1027,7 +1096,7 @@ setup_arbitrary_frame (int argc, CORE_ADDR *argv)
If the called function is returning a structure, the address of the
structure to be returned is passed as a hidden first argument. */
-CORE_ADDR
+static CORE_ADDR
alpha_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
int struct_return, CORE_ADDR struct_addr)
{
@@ -1102,14 +1171,14 @@ alpha_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
LONGEST val;
val = read_memory_integer (sp + i * 8, 8);
- write_register (A0_REGNUM + i, val);
- write_register (FPA0_REGNUM + i, val);
+ write_register (ALPHA_A0_REGNUM + i, val);
+ write_register (ALPHA_FPA0_REGNUM + i, val);
}
return sp + arg_regs_size;
}
-void
+static void
alpha_push_dummy_frame (void)
{
int ireg;
@@ -1117,7 +1186,7 @@ alpha_push_dummy_frame (void)
alpha_extra_func_info_t proc_desc;
CORE_ADDR sp = read_register (SP_REGNUM);
CORE_ADDR save_address;
- char raw_buffer[MAX_REGISTER_RAW_SIZE];
+ char raw_buffer[ALPHA_MAX_REGISTER_RAW_SIZE];
unsigned long mask;
link = (struct linked_proc_info *) xmalloc (sizeof (struct linked_proc_info));
@@ -1172,14 +1241,14 @@ alpha_push_dummy_frame (void)
registers follow in ascending order.
The PC is saved immediately below the SP. */
save_address = sp + PROC_REG_OFFSET (proc_desc);
- store_address (raw_buffer, 8, read_register (RA_REGNUM));
+ store_address (raw_buffer, 8, read_register (ALPHA_RA_REGNUM));
write_memory (save_address, raw_buffer, 8);
save_address += 8;
mask = PROC_REG_MASK (proc_desc) & 0xffffffffL;
for (ireg = 0; mask; ireg++, mask >>= 1)
if (mask & 1)
{
- if (ireg == RA_REGNUM)
+ if (ireg == ALPHA_RA_REGNUM)
continue;
store_address (raw_buffer, 8, read_register (ireg));
write_memory (save_address, raw_buffer, 8);
@@ -1222,10 +1291,10 @@ alpha_push_dummy_frame (void)
PROC_HIGH_ADDR (proc_desc) = PROC_LOW_ADDR (proc_desc) + 4;
SET_PROC_DESC_IS_DUMMY (proc_desc);
- PROC_PC_REG (proc_desc) = RA_REGNUM;
+ PROC_PC_REG (proc_desc) = ALPHA_RA_REGNUM;
}
-void
+static void
alpha_pop_frame (void)
{
register int regnum;
@@ -1262,7 +1331,7 @@ alpha_pop_frame (void)
flush_cached_frames ();
if (proc_desc && (PROC_DESC_IS_DUMMY (proc_desc)
- || PROC_DESC_IS_DYN_SIGTRAMP (proc_desc)))
+ || alpha_proc_desc_is_dyn_sigtramp (proc_desc)))
{
struct linked_proc_info *pi_ptr, *prev_ptr;
@@ -1303,16 +1372,15 @@ alpha_skip_prologue_internal (CORE_ADDR pc, int lenient)
CORE_ADDR post_prologue_pc;
char buf[4];
-#ifdef GDB_TARGET_HAS_SHARED_LIBS
/* Silently return the unaltered pc upon memory errors.
This could happen on OSF/1 if decode_line_1 tries to skip the
prologue for quickstarted shared library functions when the
shared library is not yet mapped in.
Reading target memory is slow over serial lines, so we perform
- this check only if the target has shared libraries. */
+ this check only if the target has shared libraries (which all
+ Alpha targets do). */
if (target_read_memory (pc, buf, 4))
return pc;
-#endif
/* See if we can determine the end of the prologue via the symbol table.
If so, then return either PC, or the PC after the prologue, whichever
@@ -1368,7 +1436,7 @@ alpha_skip_prologue_internal (CORE_ADDR pc, int lenient)
return pc + offset;
}
-CORE_ADDR
+static CORE_ADDR
alpha_skip_prologue (CORE_ADDR addr)
{
return (alpha_skip_prologue_internal (addr, 0));
@@ -1392,7 +1460,7 @@ alpha_in_lenient_prologue (CORE_ADDR startaddr, CORE_ADDR pc)
or
memory format is an integer with 4 bytes or less, as the representation
of integers in floating point registers is different. */
-void
+static void
alpha_register_convert_to_virtual (int regnum, struct type *valtype,
char *raw_buffer, char *virtual_buffer)
{
@@ -1418,7 +1486,7 @@ alpha_register_convert_to_virtual (int regnum, struct type *valtype,
error ("Cannot retrieve value from floating point register");
}
-void
+static void
alpha_register_convert_to_raw (struct type *valtype, int regnum,
char *virtual_buffer, char *raw_buffer)
{
@@ -1447,29 +1515,40 @@ alpha_register_convert_to_raw (struct type *valtype, int regnum,
error ("Cannot store value in floating point register");
}
+static const unsigned char *
+alpha_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
+{
+ static const unsigned char alpha_breakpoint[] =
+ { 0x80, 0, 0, 0 }; /* call_pal bpt */
+
+ *lenptr = sizeof(alpha_breakpoint);
+ return (alpha_breakpoint);
+}
+
/* Given a return value in `regbuf' with a type `valtype',
extract and copy its value into `valbuf'. */
-void
+static void
alpha_extract_return_value (struct type *valtype,
- char regbuf[REGISTER_BYTES], char *valbuf)
+ char regbuf[ALPHA_REGISTER_BYTES], char *valbuf)
{
if (TYPE_CODE (valtype) == TYPE_CODE_FLT)
alpha_register_convert_to_virtual (FP0_REGNUM, valtype,
regbuf + REGISTER_BYTE (FP0_REGNUM),
valbuf);
else
- memcpy (valbuf, regbuf + REGISTER_BYTE (V0_REGNUM), TYPE_LENGTH (valtype));
+ memcpy (valbuf, regbuf + REGISTER_BYTE (ALPHA_V0_REGNUM),
+ TYPE_LENGTH (valtype));
}
/* Given a return value in `regbuf' with a type `valtype',
write its value into the appropriate register. */
-void
+static void
alpha_store_return_value (struct type *valtype, char *valbuf)
{
- char raw_buffer[MAX_REGISTER_RAW_SIZE];
- int regnum = V0_REGNUM;
+ char raw_buffer[ALPHA_MAX_REGISTER_RAW_SIZE];
+ int regnum = ALPHA_V0_REGNUM;
int length = TYPE_LENGTH (valtype);
if (TYPE_CODE (valtype) == TYPE_CODE_FLT)
@@ -1517,7 +1596,7 @@ alpha_call_dummy_address (void)
return SYMBOL_VALUE_ADDRESS (sym) + 4;
}
-void
+static void
alpha_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs,
struct value **args, struct type *type, int gcc_p)
{
@@ -1525,8 +1604,8 @@ alpha_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs,
if (bp_address == 0)
error ("no place to put call");
- write_register (RA_REGNUM, bp_address);
- write_register (T12_REGNUM, fun);
+ write_register (ALPHA_RA_REGNUM, bp_address);
+ write_register (ALPHA_T12_REGNUM, fun);
}
/* On the Alpha, the call dummy code is nevery copied to user space
@@ -1534,25 +1613,47 @@ alpha_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs,
matter. */
LONGEST alpha_call_dummy_words[] = { 0 };
-int
+static int
alpha_use_struct_convention (int gcc_p, struct type *type)
{
/* Structures are returned by ref in extra arg0. */
return 1;
}
-void
+static void
alpha_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
{
/* Store the address of the place in which to copy the structure the
subroutine will return. Handled by alpha_push_arguments. */
}
-CORE_ADDR
+static CORE_ADDR
alpha_extract_struct_value_address (char *regbuf)
{
- return (extract_address (regbuf + REGISTER_BYTE (V0_REGNUM),
- REGISTER_RAW_SIZE (V0_REGNUM)));
+ return (extract_address (regbuf + REGISTER_BYTE (ALPHA_V0_REGNUM),
+ REGISTER_RAW_SIZE (ALPHA_V0_REGNUM)));
+}
+
+/* Figure out where the longjmp will land.
+ We expect the first arg to be a pointer to the jmp_buf structure from
+ which we extract the PC (JB_PC) that we will land at. The PC is copied
+ into the "pc". This routine returns true on success. */
+
+static int
+alpha_get_longjmp_target (CORE_ADDR *pc)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+ CORE_ADDR jb_addr;
+ char raw_buffer[ALPHA_MAX_REGISTER_RAW_SIZE];
+
+ jb_addr = read_register (ALPHA_A0_REGNUM);
+
+ if (target_read_memory (jb_addr + (tdep->jb_pc * tdep->jb_elt_size),
+ raw_buffer, tdep->jb_elt_size))
+ return 0;
+
+ *pc = extract_address (raw_buffer, tdep->jb_elt_size);
+ return 1;
}
/* alpha_software_single_step() is called just before we want to resume
@@ -1664,11 +1765,439 @@ alpha_software_single_step (enum target_signal sig, int insert_breakpoints_p)
}
}
+
+/* This table matches the indices assigned to enum alpha_abi. Keep
+ them in sync. */
+static const char * const alpha_abi_names[] =
+{
+ "<unknown>",
+ "OSF/1",
+ "GNU/Linux",
+ "FreeBSD",
+ "NetBSD",
+ NULL
+};
+
+static void
+process_note_abi_tag_sections (bfd *abfd, asection *sect, void *obj)
+{
+ enum alpha_abi *os_ident_ptr = obj;
+ const char *name;
+ unsigned int sectsize;
+
+ name = bfd_get_section_name (abfd, sect);
+ sectsize = bfd_section_size (abfd, sect);
+
+ if (strcmp (name, ".note.ABI-tag") == 0 && sectsize > 0)
+ {
+ unsigned int name_length, data_length, note_type;
+ char *note;
+
+ /* If the section is larger than this, it's probably not what we are
+ looking for. */
+ if (sectsize > 128)
+ sectsize = 128;
+
+ note = alloca (sectsize);
+
+ bfd_get_section_contents (abfd, sect, note,
+ (file_ptr) 0, (bfd_size_type) sectsize);
+
+ name_length = bfd_h_get_32 (abfd, note);
+ data_length = bfd_h_get_32 (abfd, note + 4);
+ note_type = bfd_h_get_32 (abfd, note + 8);
+
+ if (name_length == 4 && data_length == 16 && note_type == 1
+ && strcmp (note + 12, "GNU") == 0)
+ {
+ int os_number = bfd_h_get_32 (abfd, note + 16);
+
+ /* The case numbers are from abi-tags in glibc. */
+ switch (os_number)
+ {
+ case 0 :
+ *os_ident_ptr = ALPHA_ABI_LINUX;
+ break;
+
+ case 1 :
+ internal_error
+ (__FILE__, __LINE__,
+ "process_note_abi_sections: Hurd objects not supported");
+ break;
+
+ case 2 :
+ internal_error
+ (__FILE__, __LINE__,
+ "process_note_abi_sections: Solaris objects not supported");
+ break;
+
+ default :
+ internal_error
+ (__FILE__, __LINE__,
+ "process_note_abi_sections: unknown OS number %d",
+ os_number);
+ break;
+ }
+ }
+ }
+ /* NetBSD uses a similar trick. */
+ else if (strcmp (name, ".note.netbsd.ident") == 0 && sectsize > 0)
+ {
+ unsigned int name_length, desc_length, note_type;
+ char *note;
+
+ /* If the section is larger than this, it's probably not what we are
+ looking for. */
+ if (sectsize > 128)
+ sectsize = 128;
+
+ note = alloca (sectsize);
+
+ bfd_get_section_contents (abfd, sect, note,
+ (file_ptr) 0, (bfd_size_type) sectsize);
+
+ name_length = bfd_h_get_32 (abfd, note);
+ desc_length = bfd_h_get_32 (abfd, note + 4);
+ note_type = bfd_h_get_32 (abfd, note + 8);
+
+ if (name_length == 7 && desc_length == 4 && note_type == 1
+ && strcmp (note + 12, "NetBSD") == 0)
+ /* XXX Should we check the version here?
+ Probably not necessary yet. */
+ *os_ident_ptr = ALPHA_ABI_NETBSD;
+ }
+}
+
+static int
+get_elfosabi (bfd *abfd)
+{
+ int elfosabi;
+ enum alpha_abi alpha_abi = ALPHA_ABI_UNKNOWN;
+
+ elfosabi = elf_elfheader (abfd)->e_ident[EI_OSABI];
+
+ /* When elfosabi is 0 (ELFOSABI_NONE), this is supposed to indicate
+ what we're on a SYSV system. However, GNU/Linux uses a note section
+ to record OS/ABI info, but leaves e_ident[EI_OSABI] zero. So we
+ have to check the note sections too. */
+ if (elfosabi == 0)
+ {
+ bfd_map_over_sections (abfd,
+ process_note_abi_tag_sections,
+ &alpha_abi);
+ }
+
+ if (alpha_abi != ALPHA_ABI_UNKNOWN)
+ return alpha_abi;
+
+ switch (elfosabi)
+ {
+ case ELFOSABI_NONE:
+ /* Leave it as unknown. */
+ break;
+
+ case ELFOSABI_NETBSD:
+ return ALPHA_ABI_NETBSD;
+
+ case ELFOSABI_FREEBSD:
+ return ALPHA_ABI_FREEBSD;
+
+ case ELFOSABI_LINUX:
+ return ALPHA_ABI_LINUX;
+ }
+
+ return ALPHA_ABI_UNKNOWN;
+}
+
+struct alpha_abi_handler
+{
+ struct alpha_abi_handler *next;
+ enum alpha_abi abi;
+ void (*init_abi)(struct gdbarch_info, struct gdbarch *);
+};
+
+struct alpha_abi_handler *alpha_abi_handler_list = NULL;
+
+void
+alpha_gdbarch_register_os_abi (enum alpha_abi abi,
+ void (*init_abi)(struct gdbarch_info,
+ struct gdbarch *))
+{
+ struct alpha_abi_handler **handler_p;
+
+ for (handler_p = &alpha_abi_handler_list; *handler_p != NULL;
+ handler_p = &(*handler_p)->next)
+ {
+ if ((*handler_p)->abi == abi)
+ {
+ internal_error
+ (__FILE__, __LINE__,
+ "alpha_gdbarch_register_os_abi: A handler for this ABI variant "
+ "(%d) has already been registered", (int) abi);
+ /* If user wants to continue, override previous definition. */
+ (*handler_p)->init_abi = init_abi;
+ return;
+ }
+ }
+
+ (*handler_p)
+ = (struct alpha_abi_handler *) xmalloc (sizeof (struct alpha_abi_handler));
+ (*handler_p)->next = NULL;
+ (*handler_p)->abi = abi;
+ (*handler_p)->init_abi = init_abi;
+}
+
+/* Initialize the current architecture based on INFO. If possible, re-use an
+ architecture from ARCHES, which is a list of architectures already created
+ during this debugging session.
+
+ Called e.g. at program startup, when reading a core file, and when reading
+ a binary file. */
+
+static struct gdbarch *
+alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
+{
+ struct gdbarch_tdep *tdep;
+ struct gdbarch *gdbarch;
+ enum alpha_abi alpha_abi = ALPHA_ABI_UNKNOWN;
+ struct alpha_abi_handler *abi_handler;
+
+ /* Try to determine the ABI of the object we are loading. */
+
+ if (info.abfd != NULL)
+ {
+ switch (bfd_get_flavour (info.abfd))
+ {
+ case bfd_target_elf_flavour:
+ alpha_abi = get_elfosabi (info.abfd);
+ break;
+
+ case bfd_target_ecoff_flavour:
+ /* Assume it's OSF/1. */
+ alpha_abi = ALPHA_ABI_OSF1;
+ break;
+
+ default:
+ /* Not sure what to do here, leave the ABI as unknown. */
+ break;
+ }
+ }
+
+ /* Find a candidate among extant architectures. */
+ for (arches = gdbarch_list_lookup_by_info (arches, &info);
+ arches != NULL;
+ arches = gdbarch_list_lookup_by_info (arches->next, &info))
+ {
+ /* Make sure the ABI selection matches. */
+ tdep = gdbarch_tdep (arches->gdbarch);
+ if (tdep && tdep->alpha_abi == alpha_abi)
+ return arches->gdbarch;
+ }
+
+ tdep = xmalloc (sizeof (struct gdbarch_tdep));
+ gdbarch = gdbarch_alloc (&info, tdep);
+
+ tdep->alpha_abi = alpha_abi;
+ if (alpha_abi < ALPHA_ABI_INVALID)
+ tdep->abi_name = alpha_abi_names[alpha_abi];
+ else
+ {
+ internal_error (__FILE__, __LINE__, "Invalid setting of alpha_abi %d",
+ (int) alpha_abi);
+ tdep->abi_name = "<invalid>";
+ }
+
+ /* Lowest text address. This is used by heuristic_proc_start() to
+ decide when to stop looking. */
+ tdep->vm_min_address = (CORE_ADDR) 0x120000000;
+
+ tdep->dynamic_sigtramp_offset = NULL;
+ tdep->skip_sigtramp_frame = NULL;
+ tdep->sigcontext_addr = NULL;
+
+ tdep->jb_pc = -1; /* longjmp support not enabled by default */
+
+ /* Type sizes */
+ set_gdbarch_short_bit (gdbarch, 16);
+ set_gdbarch_int_bit (gdbarch, 32);
+ set_gdbarch_long_bit (gdbarch, 64);
+ set_gdbarch_long_long_bit (gdbarch, 64);
+ set_gdbarch_float_bit (gdbarch, 32);
+ set_gdbarch_double_bit (gdbarch, 64);
+ set_gdbarch_long_double_bit (gdbarch, 64);
+ set_gdbarch_ptr_bit (gdbarch, 64);
+
+ /* Register info */
+ set_gdbarch_num_regs (gdbarch, ALPHA_NUM_REGS);
+ set_gdbarch_sp_regnum (gdbarch, ALPHA_SP_REGNUM);
+ set_gdbarch_fp_regnum (gdbarch, ALPHA_FP_REGNUM);
+ set_gdbarch_pc_regnum (gdbarch, ALPHA_PC_REGNUM);
+ set_gdbarch_fp0_regnum (gdbarch, ALPHA_FP0_REGNUM);
+
+ set_gdbarch_register_name (gdbarch, alpha_register_name);
+ set_gdbarch_register_size (gdbarch, ALPHA_REGISTER_SIZE);
+ set_gdbarch_register_bytes (gdbarch, ALPHA_REGISTER_BYTES);
+ set_gdbarch_register_byte (gdbarch, alpha_register_byte);
+ set_gdbarch_register_raw_size (gdbarch, alpha_register_raw_size);
+ set_gdbarch_max_register_raw_size (gdbarch, ALPHA_MAX_REGISTER_RAW_SIZE);
+ set_gdbarch_register_virtual_size (gdbarch, alpha_register_virtual_size);
+ set_gdbarch_max_register_virtual_size (gdbarch,
+ ALPHA_MAX_REGISTER_VIRTUAL_SIZE);
+ set_gdbarch_register_virtual_type (gdbarch, alpha_register_virtual_type);
+
+ set_gdbarch_cannot_fetch_register (gdbarch, alpha_cannot_fetch_register);
+ set_gdbarch_cannot_store_register (gdbarch, alpha_cannot_store_register);
+
+ set_gdbarch_register_convertible (gdbarch, alpha_register_convertible);
+ set_gdbarch_register_convert_to_virtual (gdbarch,
+ alpha_register_convert_to_virtual);
+ set_gdbarch_register_convert_to_raw (gdbarch, alpha_register_convert_to_raw);
+
+ set_gdbarch_skip_prologue (gdbarch, alpha_skip_prologue);
+
+ set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);
+ set_gdbarch_frameless_function_invocation (gdbarch,
+ generic_frameless_function_invocation_not);
+
+ set_gdbarch_saved_pc_after_call (gdbarch, alpha_saved_pc_after_call);
+
+ set_gdbarch_frame_chain (gdbarch, alpha_frame_chain);
+ set_gdbarch_frame_chain_valid (gdbarch, func_frame_chain_valid);
+ set_gdbarch_frame_saved_pc (gdbarch, alpha_frame_saved_pc);
+
+ set_gdbarch_frame_init_saved_regs (gdbarch, alpha_frame_init_saved_regs);
+ set_gdbarch_get_saved_register (gdbarch, alpha_get_saved_register);
+
+ set_gdbarch_use_struct_convention (gdbarch, alpha_use_struct_convention);
+ set_gdbarch_extract_return_value (gdbarch, alpha_extract_return_value);
+
+ set_gdbarch_store_struct_return (gdbarch, alpha_store_struct_return);
+ set_gdbarch_store_return_value (gdbarch, alpha_store_return_value);
+ set_gdbarch_extract_struct_value_address (gdbarch,
+ alpha_extract_struct_value_address);
+
+ /* Settings for calling functions in the inferior. */
+ set_gdbarch_use_generic_dummy_frames (gdbarch, 0);
+ set_gdbarch_call_dummy_length (gdbarch, 0);
+ set_gdbarch_push_arguments (gdbarch, alpha_push_arguments);
+ set_gdbarch_pop_frame (gdbarch, alpha_pop_frame);
+
+ /* On the Alpha, the call dummy code is never copied to user space,
+ stopping the user call is achieved via a bp_call_dummy breakpoint.
+ But we need a fake CALL_DUMMY definition to enable the proper
+ call_function_by_hand and to avoid zero length array warnings. */
+ set_gdbarch_call_dummy_p (gdbarch, 1);
+ set_gdbarch_call_dummy_words (gdbarch, alpha_call_dummy_words);
+ set_gdbarch_sizeof_call_dummy_words (gdbarch, 0);
+ set_gdbarch_frame_args_address (gdbarch, alpha_frame_args_address);
+ set_gdbarch_frame_locals_address (gdbarch, alpha_frame_locals_address);
+ set_gdbarch_init_extra_frame_info (gdbarch, alpha_init_extra_frame_info);
+
+ /* Alpha OSF/1 inhibits execution of code on the stack. But there is
+ no need for a dummy on the Alpha. PUSH_ARGUMENTS takes care of all
+ argument handling and bp_call_dummy takes care of stopping the dummy. */
+ set_gdbarch_call_dummy_location (gdbarch, AT_ENTRY_POINT);
+ set_gdbarch_call_dummy_address (gdbarch, alpha_call_dummy_address);
+ set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1);
+ set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0);
+ set_gdbarch_call_dummy_start_offset (gdbarch, 0);
+ set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy_at_entry_point);
+ set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0);
+ set_gdbarch_push_dummy_frame (gdbarch, alpha_push_dummy_frame);
+ set_gdbarch_fix_call_dummy (gdbarch, alpha_fix_call_dummy);
+ set_gdbarch_init_frame_pc (gdbarch, init_frame_pc_noop);
+ set_gdbarch_init_frame_pc_first (gdbarch, alpha_init_frame_pc_first);
+
+ set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
+ set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target);
+
+ /* Floats are always passed as doubles. */
+ set_gdbarch_coerce_float_to_double (gdbarch,
+ standard_coerce_float_to_double);
+
+ set_gdbarch_breakpoint_from_pc (gdbarch, alpha_breakpoint_from_pc);
+ set_gdbarch_decr_pc_after_break (gdbarch, 4);
+
+ set_gdbarch_function_start_offset (gdbarch, 0);
+ set_gdbarch_frame_args_skip (gdbarch, 0);
+
+ /* Hook in ABI-specific overrides, if they have been registered. */
+ if (alpha_abi == ALPHA_ABI_UNKNOWN)
+ {
+ /* Don't complain about not knowing the ABI variant if we don't
+ have an inferior. */
+ if (info.abfd)
+ fprintf_filtered
+ (gdb_stderr, "GDB doesn't recognize the ABI of the inferior. "
+ "Attempting to continue with the default Alpha settings");
+ }
+ else
+ {
+ for (abi_handler = alpha_abi_handler_list; abi_handler != NULL;
+ abi_handler = abi_handler->next)
+ if (abi_handler->abi == alpha_abi)
+ break;
+
+ if (abi_handler)
+ abi_handler->init_abi (info, gdbarch);
+ else
+ {
+ /* We assume that if GDB_MULTI_ARCH is less than
+ GDB_MULTI_ARCH_TM that an ABI variant can be supported by
+ overriding definitions in this file. */
+ if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
+ fprintf_filtered
+ (gdb_stderr,
+ "A handler for the ABI variant \"%s\" is not built into this "
+ "configuration of GDB. "
+ "Attempting to continue with the default Alpha settings",
+ alpha_abi_names[alpha_abi]);
+ }
+ }
+
+ /* Now that we have tuned the configuration, set a few final things
+ based on what the OS ABI has told us. */
+
+ if (tdep->jb_pc >= 0)
+ set_gdbarch_get_longjmp_target (gdbarch, alpha_get_longjmp_target);
+
+ return gdbarch;
+}
+
+static void
+alpha_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ if (tdep == NULL)
+ return;
+
+ if (tdep->abi_name != NULL)
+ fprintf_unfiltered (file, "alpha_dump_tdep: ABI = %s\n", tdep->abi_name);
+ else
+ internal_error (__FILE__, __LINE__,
+ "alpha_dump_tdep: illegal setting of tdep->alpha_abi (%d)",
+ (int) tdep->alpha_abi);
+
+ fprintf_unfiltered (file,
+ "alpha_dump_tdep: vm_min_address = 0x%lx\n",
+ (long) tdep->vm_min_address);
+
+ fprintf_unfiltered (file,
+ "alpha_dump_tdep: jb_pc = %d\n",
+ tdep->jb_pc);
+ fprintf_unfiltered (file,
+ "alpha_dump_tdep: jb_elt_size = %ld\n",
+ (long) tdep->jb_elt_size);
+}
+
void
_initialize_alpha_tdep (void)
{
struct cmd_list_element *c;
+ gdbarch_register (bfd_arch_alpha, alpha_gdbarch_init, alpha_dump_tdep);
+
tm_print_insn = print_insn_alpha;
/* Let the user set the fence post for heuristic_proc_start. */
diff --git a/gdb/alpha-tdep.h b/gdb/alpha-tdep.h
new file mode 100644
index 0000000..c3ee007
--- /dev/null
+++ b/gdb/alpha-tdep.h
@@ -0,0 +1,125 @@
+/* Common target dependent code for GDB on Alpha systems.
+ Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2002 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. */
+
+#ifndef ALPHA_TDEP_H
+#define ALPHA_TDEP_H
+
+/* 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 ALPHA_REGISTER_SIZE 8
+
+/* Number of machine registers. */
+#define ALPHA_NUM_REGS 66
+
+/* Total amount of space needed to store our copies of the machine's
+ register state. */
+#define ALPHA_REGISTER_BYTES (ALPHA_NUM_REGS * 8)
+
+/* Largest value REGISTER_RAW_SIZE can have. */
+#define ALPHA_MAX_REGISTER_RAW_SIZE 8
+
+/* Largest value REGISTER_VIRTUAL_SIZE can have. */
+#define ALPHA_MAX_REGISTER_VIRTUAL_SIZE 8
+
+/* Register numbers of various important registers.
+ Note that most of these values are "real" register numbers,
+ and correspond to the general registers of the machine,
+ and FP_REGNUM is a "phony" register number which is too large
+ to be an actual register number as far as the user is concerned
+ but serves to get the desired value when passed to read_register. */
+
+#define ALPHA_V0_REGNUM 0 /* Function integer return value */
+#define ALPHA_T7_REGNUM 8 /* Return address register for OSF/1 __add* */
+#define ALPHA_GCC_FP_REGNUM 15 /* Used by gcc as frame register */
+#define ALPHA_A0_REGNUM 16 /* Loc of first arg during a subr call */
+#define ALPHA_T9_REGNUM 23 /* Return address register for OSF/1 __div* */
+#define ALPHA_T12_REGNUM 27 /* Contains start addr of current proc */
+#define ALPHA_SP_REGNUM 30 /* Contains address of top of stack */
+#define ALPHA_RA_REGNUM 26 /* Contains return address value */
+#define ALPHA_ZERO_REGNUM 31 /* Read-only register, always 0 */
+#define ALPHA_FP0_REGNUM 32 /* Floating point register 0 */
+#define ALPHA_FPA0_REGNUM 48 /* First float arg during a subr call */
+#define ALPHA_FPCR_REGNUM 63 /* Floating point control register */
+#define ALPHA_PC_REGNUM 64 /* Contains program counter */
+#define ALPHA_FP_REGNUM 65 /* Virtual frame pointer */
+
+/* The alpha has two different virtual pointers for arguments and locals.
+
+ The virtual argument pointer is pointing to the bottom of the argument
+ transfer area, which is located immediately below the virtual frame
+ pointer. Its size is fixed for the native compiler, it is either zero
+ (for the no arguments case) or large enough to hold all argument registers.
+ gcc uses a variable sized argument transfer area. As it has
+ to stay compatible with the native debugging tools it has to use the same
+ virtual argument pointer and adjust the argument offsets accordingly.
+
+ The virtual local pointer is localoff bytes below the virtual frame
+ pointer, the value of localoff is obtained from the PDR. */
+#define ALPHA_NUM_ARG_REGS 6
+
+/* ABI variants that we know about. If you add to this enum, please
+ update the table of names in alpha-tdep.c. */
+enum alpha_abi
+{
+ ALPHA_ABI_UNKNOWN = 0,
+ ALPHA_ABI_OSF1,
+ ALPHA_ABI_LINUX,
+ ALPHA_ABI_FREEBSD,
+ ALPHA_ABI_NETBSD,
+
+ ALPHA_ABI_INVALID /* Keep this last. */
+};
+
+/* Target-dependent structure in gdbarch. */
+struct gdbarch_tdep
+{
+ enum alpha_abi alpha_abi; /* OS/ABI of inferior. */
+ const char *abi_name; /* Name of the above. */
+
+ CORE_ADDR vm_min_address; /* used by heuristic_proc_start */
+
+ /* If PC is inside a dynamically-generated signal trampoline function
+ (i.e. one copied onto the user stack at run-time), return how many
+ bytes PC is beyond the start of that function. Otherwise, return -1. */
+ LONGEST (*dynamic_sigtramp_offset) (CORE_ADDR);
+
+ /* If FRAME refers to a sigtramp frame, return the address of the next
+ frame. */
+ CORE_ADDR (*skip_sigtramp_frame) (struct frame_info *, CORE_ADDR);
+
+ /* Translate a signal handler frame into the address of the sigcontext
+ structure for that signal handler. */
+ CORE_ADDR (*sigcontext_addr) (struct frame_info *);
+
+ int jb_pc; /* Offset to PC value in jump buffer.
+ If htis is negative, longjmp support
+ will be disabled. */
+ size_t jb_elt_size; /* And the size of each entry in the buf. */
+};
+
+void alpha_software_single_step (enum target_signal, int);
+
+void alpha_gdbarch_register_os_abi (enum alpha_abi,
+ void (*init_abi)(struct gdbarch_info,
+ struct gdbarch *));
+
+#endif /* ALPHA_TDEP_H */
diff --git a/gdb/alphabsd-nat.c b/gdb/alphabsd-nat.c
index d7ad3a7..92b0fc2 100644
--- a/gdb/alphabsd-nat.c
+++ b/gdb/alphabsd-nat.c
@@ -22,6 +22,8 @@
#include "inferior.h"
#include "regcache.h"
+#include "alpha-tdep.h"
+
#include <sys/types.h>
#include <sys/ptrace.h>
#include <machine/reg.h>
@@ -103,7 +105,7 @@ supply_fpregset (fpregset_t *fpregsetp)
supply_register (i, (char *) &fpregsetp->fpr_regs[i - FP0_REGNUM]);
}
- supply_register (FPCR_REGNUM, (char *) &fpregsetp->fpr_cr);
+ supply_register (ALPHA_FPCR_REGNUM, (char *) &fpregsetp->fpr_cr);
}
/* Fill register REGNO (if it is a floating-point register) in
@@ -119,8 +121,8 @@ fill_fpregset (fpregset_t *fpregsetp, int regno)
if ((regno == -1 || regno == i) && ! CANNOT_STORE_REGISTER (i))
regcache_collect (i, (char *) &fpregsetp->fpr_regs[i - FP0_REGNUM]);
- if (regno == -1 || regno == FPCR_REGNUM)
- regcache_collect (FPCR_REGNUM, (char *) &fpregsetp->fpr_cr);
+ if (regno == -1 || regno == ALPHA_FPCR_REGNUM)
+ regcache_collect (ALPHA_FPCR_REGNUM, (char *) &fpregsetp->fpr_cr);
}
@@ -130,7 +132,7 @@ static int
getregs_supplies (int regno)
{
- return ((regno >= V0_REGNUM && regno <= ZERO_REGNUM)
+ return ((regno >= ALPHA_V0_REGNUM && regno <= ALPHA_ZERO_REGNUM)
|| regno >= PC_REGNUM);
}
diff --git a/gdb/alphafbsd-tdep.c b/gdb/alphafbsd-tdep.c
index e2d4749..3c1e64d 100644
--- a/gdb/alphafbsd-tdep.c
+++ b/gdb/alphafbsd-tdep.c
@@ -1,5 +1,5 @@
/* Target-dependent code for FreeBSD/Alpha.
- Copyright 2001 Free Software Foundation, Inc.
+ Copyright 2001, 2002 Free Software Foundation, Inc.
This file is part of GDB.
@@ -21,7 +21,9 @@
#include "defs.h"
#include "value.h"
-int
+#include "alpha-tdep.h"
+
+static int
alphafbsd_use_struct_convention (int gcc_p, struct type *type)
{
enum type_code code;
@@ -51,3 +53,30 @@ alphafbsd_use_struct_convention (int gcc_p, struct type *type)
return 0;
}
+
+static int
+alphafbsd_pc_in_sigtramp (CORE_ADDR pc, char *func_name)
+{
+ /* FIXME */
+ return 0;
+}
+
+static void
+alphafbsd_init_abi (struct gdbarch_info info,
+ struct gdbarch *gdbarch)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+ set_gdbarch_pc_in_sigtramp (gdbarch, alphafbsd_pc_in_sigtramp);
+
+ set_gdbarch_use_struct_convention (gdbarch, alphafbsd_use_struct_convention);
+
+ tdep->jb_pc = 2;
+ tdep->jb_elt_size = 8;
+}
+
+void
+_initialize_alphafbsd_tdep (void)
+{
+ alpha_gdbarch_register_os_abi (ALPHA_ABI_FREEBSD, alphafbsd_init_abi);
+}
diff --git a/gdb/alphanbsd-nat.c b/gdb/alphanbsd-nat.c
new file mode 100644
index 0000000..ed90de3
--- /dev/null
+++ b/gdb/alphanbsd-nat.c
@@ -0,0 +1,136 @@
+/* Native-dependent code for Alpha NetBSD.
+ Copyright 2002 Free Software Foundation, Inc.
+ Contributed by Wasabi Systems, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include <sys/types.h>
+#include <machine/reg.h>
+#include <machine/frame.h>
+#include <machine/pcb.h>
+#include "gdbcore.h"
+#include "regcache.h"
+
+#include "alpha-tdep.h"
+
+#ifndef HAVE_GREGSET_T
+typedef struct reg gregset_t;
+#endif
+
+#ifndef HAVE_FPREGSET_T
+typedef struct fpreg fpregset_t;
+#endif
+
+#include "gregset.h"
+
+static void
+fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which,
+ CORE_ADDR ignore)
+{
+ struct md_coredump *core_reg;
+ char *regs;
+ int regno;
+
+ /* Table to map a gdb register number to a trapframe register index. */
+ static const int regmap[] =
+ {
+ FRAME_V0, FRAME_T0, FRAME_T1, FRAME_T2,
+ FRAME_T3, FRAME_T4, FRAME_T5, FRAME_T6,
+ FRAME_T7, FRAME_S0, FRAME_S1, FRAME_S2,
+ FRAME_S3, FRAME_S4, FRAME_S5, FRAME_S6,
+ FRAME_A0, FRAME_A1, FRAME_A2, FRAME_A3,
+ FRAME_A4, FRAME_A5, FRAME_T8, FRAME_T9,
+ FRAME_T10, FRAME_T11, FRAME_RA, FRAME_T12,
+ FRAME_AT, FRAME_GP, FRAME_SP
+ };
+
+ /* We get everything from one section. */
+ if (which != 0)
+ return;
+
+ core_reg = (struct md_coredump *) core_reg_sect;
+ regs = (char *) &core_reg->md_tf;
+
+ if (core_reg_size < sizeof (*core_reg))
+ {
+ warning ("Wrong size register set in core file.");
+ return;
+ }
+
+ /* Integer registers. */
+ for (regno = 0; regno < ALPHA_ZERO_REGNUM; regno++)
+ supply_register (regno, regs + (regmap[regno] * 8));
+ supply_register (ALPHA_ZERO_REGNUM, NULL);
+ supply_register (FP_REGNUM, NULL);
+ supply_register (PC_REGNUM, regs + (FRAME_PC * 8));
+
+ /* Floating point registers. */
+ supply_fpregset (&core_reg->md_fpstate);
+}
+
+static void
+fetch_elfcore_registers (char *core_reg_sect, unsigned core_reg_size, int which,
+ CORE_ADDR ignore)
+{
+ switch (which)
+ {
+ case 0: /* Integer registers. */
+ if (core_reg_size != sizeof (struct reg))
+ warning ("Wrong size register set in core file.");
+ else
+ supply_gregset ((gregset_t *) core_reg_sect);
+ break;
+
+ case 2: /* Floating point registers. */
+ if (core_reg_size != sizeof (struct fpreg))
+ warning ("Wrong size FP register set in core file.");
+ else
+ supply_fpregset ((fpregset_t *) core_reg_sect);
+ break;
+
+ default:
+ /* Don't know what kind of register request this is; just ignore it. */
+ break;
+ }
+}
+
+static struct core_fns alphanbsd_core_fns =
+{
+ bfd_target_unknown_flavour, /* core_flavour */
+ default_check_format, /* check_format */
+ default_core_sniffer, /* core_sniffer */
+ fetch_core_registers, /* core_read_registers */
+ NULL /* next */
+};
+
+static struct core_fns alphanbsd_elfcore_fns =
+{
+ bfd_target_elf_flavour, /* core_flavour */
+ default_check_format, /* check_format */
+ default_core_sniffer, /* core_sniffer */
+ fetch_elfcore_registers, /* core_read_registers */
+ NULL /* next */
+};
+
+void
+_initialize_alphanbsd_nat (void)
+{
+ add_core_fns (&alphanbsd_core_fns);
+ add_core_fns (&alphanbsd_elfcore_fns);
+}
diff --git a/gdb/alphanbsd-tdep.c b/gdb/alphanbsd-tdep.c
new file mode 100644
index 0000000..33c3cd7
--- /dev/null
+++ b/gdb/alphanbsd-tdep.c
@@ -0,0 +1,157 @@
+/* Target-dependent code for NetBSD/Alpha.
+ Copyright 2002 Free Software Foundation, Inc.
+ Contributed by Wasabi Systems, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "gdbcore.h"
+#include "value.h"
+#include "solib-svr4.h"
+
+#include "alpha-tdep.h"
+
+/* Fetch (and possibly build) an appropriate link_map_offsets
+ structure for NetBSD/alpha targets using the struct offsets
+ defined in <link.h> (but without actual reference to that file).
+
+ This makes it possible to access NetBSD/alpha shared libraries
+ from a GDB that was not built on a NetBSD/alpha host (for cross
+ debugging). */
+
+static struct link_map_offsets *
+alphanbsd_solib_svr4_fetch_link_map_offsets (void)
+{
+ static struct link_map_offsets lmo;
+ static struct link_map_offsets *lmp = NULL;
+
+ if (lmp == NULL)
+ {
+ lmp = &lmo;
+
+ lmo.r_debug_size = 32;
+
+ lmo.r_map_offset = 8;
+ lmo.r_map_size = 8;
+
+ lmo.link_map_size = 40;
+
+ lmo.l_addr_offset = 0;
+ lmo.l_addr_size = 8;
+
+ lmo.l_name_offset = 8;
+ lmo.l_name_size = 8;
+
+ lmo.l_next_offset = 24;
+ lmo.l_next_size = 8;
+
+ lmo.l_prev_offset = 32;
+ lmo.l_prev_size = 8;
+ }
+
+ return lmp;
+}
+
+/* Under NetBSD/alpha, signal handler invocations can be identified by the
+ designated code sequence that is used to return from a signal handler.
+ In particular, the return address of a signal handler points to the
+ following code sequence:
+
+ ldq a0, 0(sp)
+ lda sp, 16(sp)
+ lda v0, 295(zero) # __sigreturn14
+ call_pal callsys
+
+ Each instruction has a unique encoding, so we simply attempt to match
+ the instruction the PC is pointing to with any of the above instructions.
+ If there is a hit, we know the offset to the start of the designated
+ sequence and can then check whether we really are executing in the
+ signal trampoline. If not, -1 is returned, otherwise the offset from the
+ start of the return sequence is returned. */
+static const unsigned int sigtramp_retcode[] =
+{
+ 0xa61e0000, /* ldq a0, 0(sp) */
+ 0x23de0010, /* lda sp, 16(sp) */
+ 0x201f0127, /* lda v0, 295(zero) */
+ 0x00000083, /* call_pal callsys */
+};
+#define RETCODE_NWORDS \
+ (sizeof (sigtramp_retcode) / sizeof (sigtramp_retcode[0]))
+
+LONGEST
+alphanbsd_sigtramp_offset (CORE_ADDR pc)
+{
+ unsigned int ret[4], w;
+ LONGEST off;
+ int i;
+
+ if (read_memory_nobpt (pc, (char *) &w, 4) != 0)
+ return -1;
+
+ for (i = 0; i < RETCODE_NWORDS; i++)
+ {
+ if (w == sigtramp_retcode[i])
+ break;
+ }
+ if (i == RETCODE_NWORDS)
+ return (-1);
+
+ off = i * 4;
+ pc -= off;
+
+ if (read_memory_nobpt (pc, (char *) ret, sizeof (ret)) != 0)
+ return -1;
+
+ if (memcmp (ret, sigtramp_retcode, sizeof (sigtramp_retcode)) == 0)
+ return off;
+
+ return -1;
+}
+
+static int
+alphanbsd_pc_in_sigtramp (CORE_ADDR pc, char *func_name)
+{
+ return (alphanbsd_sigtramp_offset (pc) >= 0);
+}
+
+static void
+alphanbsd_init_abi (struct gdbarch_info info,
+ struct gdbarch *gdbarch)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+ set_gdbarch_pc_in_sigtramp (gdbarch, alphanbsd_pc_in_sigtramp);
+
+ /* NetBSD/alpha does not provide single step support via ptrace(2); we
+ must use software single-stepping. */
+ set_gdbarch_software_single_step (gdbarch, alpha_software_single_step);
+
+ set_solib_svr4_fetch_link_map_offsets (gdbarch,
+ alphanbsd_solib_svr4_fetch_link_map_offsets);
+
+ tdep->dynamic_sigtramp_offset = alphanbsd_sigtramp_offset;
+
+ tdep->jb_pc = 2;
+ tdep->jb_elt_size = 8;
+}
+
+void
+_initialize_alphanbsd_tdep (void)
+{
+ alpha_gdbarch_register_os_abi (ALPHA_ABI_NETBSD, alphanbsd_init_abi);
+}
diff --git a/gdb/arc-tdep.c b/gdb/arc-tdep.c
index ffa538f..cab7721 100644
--- a/gdb/arc-tdep.c
+++ b/gdb/arc-tdep.c
@@ -296,6 +296,14 @@ arc_skip_prologue (CORE_ADDR pc, int frameless_p)
return codestream_tell ();
}
+/* Is the prologue at PC frameless? */
+
+int
+arc_prologue_frameless_p (CORE_ADDR pc)
+{
+ return (pc == arc_skip_prologue (pc, 1));
+}
+
/* Return the return address for a frame.
This is used to implement FRAME_SAVED_PC.
This is taken from frameless_look_for_prologue. */
diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c
index 5612ddf..154438a 100644
--- a/gdb/arch-utils.c
+++ b/gdb/arch-utils.c
@@ -1,5 +1,7 @@
/* Dynamic architecture support for GDB, the GNU debugger.
- Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+ Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation,
+ Inc.
This file is part of GDB.
@@ -55,7 +57,7 @@
and optionally adjust the pc to point to the correct memory location
for inserting the breakpoint. */
-unsigned char *
+const unsigned char *
legacy_breakpoint_from_pc (CORE_ADDR * pcptr, int *lenptr)
{
/* {BIG_,LITTLE_}BREAKPOINT is the sequence of bytes we insert for a
@@ -152,11 +154,7 @@ generic_remote_translate_xfer_address (CORE_ADDR gdb_addr, int gdb_len,
int
generic_prologue_frameless_p (CORE_ADDR ip)
{
-#ifdef SKIP_PROLOGUE_FRAMELESS_P
- return ip == SKIP_PROLOGUE_FRAMELESS_P (ip);
-#else
return ip == SKIP_PROLOGUE (ip);
-#endif
}
/* New/multi-arched targets should use the correct gdbarch field
@@ -340,7 +338,7 @@ generic_prepare_to_proceed (int select_it)
flush_cached_frames ();
registers_changed ();
stop_pc = wait_pc;
- select_frame (get_current_frame (), 0);
+ select_frame (get_current_frame ());
}
/* We return 1 to indicate that there is a breakpoint here,
so we need to step over it before continuing to avoid
@@ -421,6 +419,24 @@ generic_register_virtual_size (int regnum)
return TYPE_LENGTH (REGISTER_VIRTUAL_TYPE (regnum));
}
+#if !defined (IN_SIGTRAMP)
+#if defined (SIGTRAMP_START)
+#define IN_SIGTRAMP(pc, name) \
+ ((pc) >= SIGTRAMP_START(pc) \
+ && (pc) < SIGTRAMP_END(pc) \
+ )
+#else
+#define IN_SIGTRAMP(pc, name) \
+ (name && STREQ ("_sigtramp", name))
+#endif
+#endif
+
+int
+legacy_pc_in_sigtramp (CORE_ADDR pc, char *name)
+{
+ return IN_SIGTRAMP(pc, name);
+}
+
/* Functions to manipulate the endianness of the target. */
diff --git a/gdb/arch-utils.h b/gdb/arch-utils.h
index 96d1b8b..7220062 100644
--- a/gdb/arch-utils.h
+++ b/gdb/arch-utils.h
@@ -1,5 +1,6 @@
/* Dynamic architecture support for GDB, the GNU debugger.
- Copyright 1998, 1999, 2000 Free Software Foundation, Inc.
+
+ Copyright 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
This file is part of GDB.
@@ -156,6 +157,9 @@ extern int generic_register_raw_size (int regnum);
extern int generic_register_virtual_size (int regnum);
+/* Prop up old targets that use various IN_SIGTRAMP() macros. */
+extern int legacy_pc_in_sigtramp (CORE_ADDR pc, char *name);
+
/* Initialize a ``struct info''. Can't use memset(0) since some
default values are not zero. */
extern void gdbarch_info_init (struct gdbarch_info *info);
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index b164f8e..fa0b365 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -93,8 +93,8 @@
#define MSYMBOL_SIZE(msym) \
((long) MSYMBOL_INFO (msym) & 0x7fffffff)
-/* This table matches the indicees assigned to enum arm_abi. Keep
- them in sync. */
+/* This table matches the indicees assigned to enum arm_abi.
+ Keep them in sync. */
static const char * const arm_abi_names[] =
{
@@ -110,15 +110,15 @@ static const char * const arm_abi_names[] =
NULL
};
-/* Number of different reg name sets (options). */
+/* Number of different reg name sets (options). */
static int num_flavor_options;
/* We have more registers than the disassembler as gdb can print the value
of special registers as well.
The general register names are overwritten by whatever is being used by
- the disassembler at the moment. We also adjust the case of cpsr and fps. */
+ the disassembler at the moment. We also adjust the case of cpsr and fps. */
-/* Initial value: Register names used in ARM's ISA documentation. */
+/* Initial value: Register names used in ARM's ISA documentation. */
static char * arm_register_name_strings[] =
{"r0", "r1", "r2", "r3", /* 0 1 2 3 */
"r4", "r5", "r6", "r7", /* 4 5 6 7 */
@@ -126,15 +126,16 @@ static char * arm_register_name_strings[] =
"r12", "sp", "lr", "pc", /* 12 13 14 15 */
"f0", "f1", "f2", "f3", /* 16 17 18 19 */
"f4", "f5", "f6", "f7", /* 20 21 22 23 */
- "fps", "cpsr" }; /* 24 25 */
+ "fps", "cpsr" }; /* 24 25 */
static char **arm_register_names = arm_register_name_strings;
/* Valid register name flavors. */
static const char **valid_flavors;
-/* Disassembly flavor to use. Default to "std" register names. */
+/* Disassembly flavor to use. Default to "std" register names. */
static const char *disassembly_flavor;
-static int current_option; /* Index to that option in the opcodes table. */
+/* Index to that option in the opcodes table. */
+static int current_option;
/* This is used to keep the bfd arch_info in sync with the disassembly
flavor. */
@@ -148,7 +149,7 @@ static void convert_from_extended (void *ptr, void *dbl);
all saved registers, 'cause we need 'em a lot! We also keep the
current size of the stack frame, and the offset of the frame
pointer from the stack pointer (for frameless functions, and when
- we're still in the prologue of a function with a frame) */
+ we're still in the prologue of a function with a frame). */
struct frame_extra_info
{
@@ -169,7 +170,7 @@ arm_frame_chain_valid (CORE_ADDR chain, struct frame_info *thisframe)
return (chain != 0 && (FRAME_SAVED_PC (thisframe) >= LOWEST_PC));
}
-/* Set to true if the 32-bit mode is in use. */
+/* Set to true if the 32-bit mode is in use. */
int arm_apcs_32 = 1;
@@ -225,7 +226,7 @@ arm_pc_is_thumb_dummy (CORE_ADDR memaddr)
We hope the current stack pointer is not so far alway from the dummy
frame location (true if we have not pushed large data structures or
gone too many levels deep) and that our 1024 is not enough to consider
- code regions as part of the stack (true for most practical purposes) */
+ code regions as part of the stack (true for most practical purposes). */
if (PC_IN_CALL_DUMMY (memaddr, sp, sp + 1024))
return caller_is_thumb;
else
@@ -288,7 +289,7 @@ arm_frameless_function_invocation (struct frame_info *fi)
/* There are some frameless functions whose first two instructions
follow the standard APCS form, in which case after_prologue will
- be func_start + 8. */
+ be func_start + 8. */
frameless = (after_prologue < func_start + 12);
return frameless;
@@ -348,49 +349,56 @@ static CORE_ADDR
thumb_skip_prologue (CORE_ADDR pc, CORE_ADDR func_end)
{
CORE_ADDR current_pc;
- int findmask = 0; /* findmask:
- bit 0 - push { rlist }
- bit 1 - mov r7, sp OR add r7, sp, #imm (setting of r7)
- bit 2 - sub sp, #simm OR add sp, #simm (adjusting of sp)
- */
-
- for (current_pc = pc; current_pc + 2 < func_end && current_pc < pc + 40; current_pc += 2)
+ /* findmask:
+ bit 0 - push { rlist }
+ bit 1 - mov r7, sp OR add r7, sp, #imm (setting of r7)
+ bit 2 - sub sp, #simm OR add sp, #simm (adjusting of sp)
+ */
+ int findmask = 0;
+
+ for (current_pc = pc;
+ current_pc + 2 < func_end && current_pc < pc + 40;
+ current_pc += 2)
{
unsigned short insn = read_memory_unsigned_integer (current_pc, 2);
- if ((insn & 0xfe00) == 0xb400) /* push { rlist } */
+ if ((insn & 0xfe00) == 0xb400) /* push { rlist } */
{
- findmask |= 1; /* push found */
+ findmask |= 1; /* push found */
}
- else if ((insn & 0xff00) == 0xb000) /* add sp, #simm OR sub sp, #simm */
+ else if ((insn & 0xff00) == 0xb000) /* add sp, #simm OR
+ sub sp, #simm */
{
- if ((findmask & 1) == 0) /* before push ? */
+ if ((findmask & 1) == 0) /* before push ? */
continue;
else
- findmask |= 4; /* add/sub sp found */
+ findmask |= 4; /* add/sub sp found */
}
else if ((insn & 0xff00) == 0xaf00) /* add r7, sp, #imm */
{
- findmask |= 2; /* setting of r7 found */
+ findmask |= 2; /* setting of r7 found */
}
else if (insn == 0x466f) /* mov r7, sp */
{
- findmask |= 2; /* setting of r7 found */
+ findmask |= 2; /* setting of r7 found */
}
else if (findmask == (4+2+1))
{
- break; /* We have found one of each type of prologue instruction */
+ /* We have found one of each type of prologue instruction */
+ break;
}
else
- continue; /* something in the prolog that we don't care about or some
- instruction from outside the prolog scheduled here for optimization */
+ /* Something in the prolog that we don't care about or some
+ instruction from outside the prolog scheduled here for
+ optimization. */
+ continue;
}
return current_pc;
}
-/* Advance the PC across any function entry prologue instructions to reach
- some "real" code.
+/* Advance the PC across any function entry prologue instructions to
+ reach some "real" code.
The APCS (ARM Procedure Call Standard) defines the following
prologue:
@@ -423,7 +431,7 @@ arm_skip_prologue (CORE_ADDR pc)
sym = lookup_symbol (func_name, NULL, VAR_NAMESPACE, NULL, NULL);
if (sym && SYMBOL_LANGUAGE (sym) != language_asm)
{
- /* Don't use this trick for assembly source files. */
+ /* Don't use this trick for assembly source files. */
sal = find_pc_line (func_addr, 0);
if ((sal.line != 0) && (sal.end < func_end))
return sal.end;
@@ -435,29 +443,38 @@ arm_skip_prologue (CORE_ADDR pc)
return thumb_skip_prologue (pc, func_end);
/* Can't find the prologue end in the symbol table, try it the hard way
- by disassembling the instructions. */
+ by disassembling the instructions. */
skip_pc = pc;
inst = read_memory_integer (skip_pc, 4);
- if (inst != 0xe1a0c00d) /* mov ip, sp */
- return pc;
+ /* "mov ip, sp" is no longer a required part of the prologue. */
+ if (inst == 0xe1a0c00d) /* mov ip, sp */
+ {
+ skip_pc += 4;
+ inst = read_memory_integer (skip_pc, 4);
+ }
- skip_pc += 4;
- inst = read_memory_integer (skip_pc, 4);
- if ((inst & 0xfffffff0) == 0xe92d0000) /* stmfd sp!,{a1,a2,a3,a4} */
+ /* Some prologues begin with "str lr, [sp, #-4]!". */
+ if (inst == 0xe52de004) /* str lr, [sp, #-4]! */
{
skip_pc += 4;
inst = read_memory_integer (skip_pc, 4);
}
- if ((inst & 0xfffff800) != 0xe92dd800) /* stmfd sp!,{...,fp,ip,lr,pc} */
- return pc;
+ if ((inst & 0xfffffff0) == 0xe92d0000) /* stmfd sp!,{a1,a2,a3,a4} */
+ {
+ skip_pc += 4;
+ inst = read_memory_integer (skip_pc, 4);
+ }
- skip_pc += 4;
- inst = read_memory_integer (skip_pc, 4);
+ if ((inst & 0xfffff800) == 0xe92dd800) /* stmfd sp!,{fp,ip,lr,pc} */
+ {
+ skip_pc += 4;
+ inst = read_memory_integer (skip_pc, 4);
+ }
/* Any insns after this point may float into the code, if it makes
for better instruction scheduling, so we skip them only if we
- find them, but still consdier the function to be frame-ful. */
+ find them, but still consider the function to be frame-ful. */
/* We may have either one sfmfd instruction here, or several stfe
insns, depending on the version of floating point code we
@@ -469,7 +486,7 @@ arm_skip_prologue (CORE_ADDR pc)
}
else
{
- while ((inst & 0xffff8fff) == 0xed6d0103) /* stfe fn, [sp, #-12]! */
+ while ((inst & 0xffff8fff) == 0xed6d0103) /* stfe fn, [sp, #-12]! */
{
skip_pc += 4;
inst = read_memory_integer (skip_pc, 4);
@@ -477,10 +494,26 @@ arm_skip_prologue (CORE_ADDR pc)
}
if ((inst & 0xfffff000) == 0xe24cb000) /* sub fp, ip, #nn */
- skip_pc += 4;
+ {
+ skip_pc += 4;
+ inst = read_memory_integer (skip_pc, 4);
+ }
+
+ if ((inst & 0xfffff000) == 0xe24dd000) /* sub sp, sp, #nn */
+ {
+ skip_pc += 4;
+ inst = read_memory_integer (skip_pc, 4);
+ }
+
+ while ((inst & 0xffffcfc0) == 0xe50b0000) /* str r(0123), [r11, #-nn] */
+ {
+ skip_pc += 4;
+ inst = read_memory_integer (skip_pc, 4);
+ }
return skip_pc;
}
+
/* *INDENT-OFF* */
/* Function: thumb_scan_prologue (helper function for arm_scan_prologue)
This function decodes a Thumb function prologue to determine:
@@ -500,8 +533,8 @@ arm_skip_prologue (CORE_ADDR pc)
The frame size would thus be 36 bytes, and the frame offset would be
12 bytes. The frame register is R7.
- The comments for thumb_skip_prolog() describe the algorithm we use to detect
- the end of the prolog */
+ The comments for thumb_skip_prolog() describe the algorithm we use
+ to detect the end of the prolog. */
/* *INDENT-ON* */
static void
@@ -510,26 +543,29 @@ thumb_scan_prologue (struct frame_info *fi)
CORE_ADDR prologue_start;
CORE_ADDR prologue_end;
CORE_ADDR current_pc;
- int saved_reg[16]; /* which register has been copied to register n? */
- int findmask = 0; /* findmask:
- bit 0 - push { rlist }
- bit 1 - mov r7, sp OR add r7, sp, #imm (setting of r7)
- bit 2 - sub sp, #simm OR add sp, #simm (adjusting of sp)
- */
+ /* Which register has been copied to register n? */
+ int saved_reg[16];
+ /* findmask:
+ bit 0 - push { rlist }
+ bit 1 - mov r7, sp OR add r7, sp, #imm (setting of r7)
+ bit 2 - sub sp, #simm OR add sp, #simm (adjusting of sp)
+ */
+ int findmask = 0;
int i;
if (find_pc_partial_function (fi->pc, NULL, &prologue_start, &prologue_end))
{
struct symtab_and_line sal = find_pc_line (prologue_start, 0);
- if (sal.line == 0) /* no line info, use current PC */
+ if (sal.line == 0) /* no line info, use current PC */
prologue_end = fi->pc;
else if (sal.end < prologue_end) /* next line begins after fn end */
- prologue_end = sal.end; /* (probably means no prologue) */
+ prologue_end = sal.end; /* (probably means no prologue) */
}
else
- prologue_end = prologue_start + 40; /* We're in the boondocks: allow for */
- /* 16 pushes, an add, and "mv fp,sp" */
+ /* We're in the boondocks: allow for
+ 16 pushes, an add, and "mv fp,sp". */
+ prologue_end = prologue_start + 40;
prologue_end = min (prologue_end, fi->pc);
@@ -556,7 +592,7 @@ thumb_scan_prologue (struct frame_info *fi)
if ((insn & 0xfe00) == 0xb400) /* push { rlist } */
{
int mask;
- findmask |= 1; /* push found */
+ findmask |= 1; /* push found */
/* Bits 0-7 contain a mask for registers R0-R7. Bit 8 says
whether to save LR (R14). */
mask = (insn & 0xff) | ((insn & 0x100) << 6);
@@ -568,18 +604,20 @@ thumb_scan_prologue (struct frame_info *fi)
fi->extra_info->framesize += 4;
fi->saved_regs[saved_reg[regno]] =
-(fi->extra_info->framesize);
- saved_reg[regno] = regno; /* reset saved register map */
+ /* Reset saved register map. */
+ saved_reg[regno] = regno;
}
}
- else if ((insn & 0xff00) == 0xb000) /* add sp, #simm OR sub sp, #simm */
+ else if ((insn & 0xff00) == 0xb000) /* add sp, #simm OR
+ sub sp, #simm */
{
- if ((findmask & 1) == 0) /* before push ? */
+ if ((findmask & 1) == 0) /* before push? */
continue;
else
- findmask |= 4; /* add/sub sp found */
+ findmask |= 4; /* add/sub sp found */
- offset = (insn & 0x7f) << 2; /* get scaled offset */
- if (insn & 0x80) /* is it signed? (==subtracting) */
+ offset = (insn & 0x7f) << 2; /* get scaled offset */
+ if (insn & 0x80) /* is it signed? (==subtracting) */
{
fi->extra_info->frameoffset += offset;
offset = -offset;
@@ -588,27 +626,29 @@ thumb_scan_prologue (struct frame_info *fi)
}
else if ((insn & 0xff00) == 0xaf00) /* add r7, sp, #imm */
{
- findmask |= 2; /* setting of r7 found */
+ findmask |= 2; /* setting of r7 found */
fi->extra_info->framereg = THUMB_FP_REGNUM;
/* get scaled offset */
fi->extra_info->frameoffset = (insn & 0xff) << 2;
}
else if (insn == 0x466f) /* mov r7, sp */
{
- findmask |= 2; /* setting of r7 found */
+ findmask |= 2; /* setting of r7 found */
fi->extra_info->framereg = THUMB_FP_REGNUM;
fi->extra_info->frameoffset = 0;
saved_reg[THUMB_FP_REGNUM] = ARM_SP_REGNUM;
}
else if ((insn & 0xffc0) == 0x4640) /* mov r0-r7, r8-r15 */
{
- int lo_reg = insn & 7; /* dest. register (r0-r7) */
+ int lo_reg = insn & 7; /* dest. register (r0-r7) */
int hi_reg = ((insn >> 3) & 7) + 8; /* source register (r8-15) */
- saved_reg[lo_reg] = hi_reg; /* remember hi reg was saved */
+ saved_reg[lo_reg] = hi_reg; /* remember hi reg was saved */
}
else
- continue; /* something in the prolog that we don't care about or some
- instruction from outside the prolog scheduled here for optimization */
+ /* Something in the prolog that we don't care about or some
+ instruction from outside the prolog scheduled here for
+ optimization. */
+ continue;
}
}
@@ -740,7 +780,7 @@ arm_scan_prologue (struct frame_info *fi)
LONGEST return_value;
CORE_ADDR prologue_start, prologue_end, current_pc;
- /* Check if this function is already in the cache of frame information. */
+ /* Check if this function is already in the cache of frame information. */
if (check_prologue_cache (fi))
return;
@@ -791,23 +831,23 @@ arm_scan_prologue (struct frame_info *fi)
is a suitable endpoint since it accounts for the largest
possible prologue plus up to five instructions inserted by
- the scheduler. */
+ the scheduler. */
if (prologue_end > prologue_start + 64)
{
- prologue_end = prologue_start + 64; /* See above. */
+ prologue_end = prologue_start + 64; /* See above. */
}
}
else
{
- /* Get address of the stmfd in the prologue of the callee; the saved
- PC is the address of the stmfd + 8. */
+ /* Get address of the stmfd in the prologue of the callee;
+ the saved PC is the address of the stmfd + 8. */
if (!safe_read_memory_integer (fi->frame, 4, &return_value))
return;
else
{
prologue_start = ADDR_BITS_REMOVE (return_value) - 8;
- prologue_end = prologue_start + 64; /* See above. */
+ prologue_end = prologue_start + 64; /* See above. */
}
}
@@ -822,30 +862,41 @@ arm_scan_prologue (struct frame_info *fi)
traceback.
In the APCS, the prologue should start with "mov ip, sp" so
- if we don't see this as the first insn, we will stop. [Note:
- This doesn't seem to be true any longer, so it's now an optional
- part of the prologue. - Kevin Buettner, 2001-11-20] */
+ if we don't see this as the first insn, we will stop.
- sp_offset = fp_offset = 0;
+ [Note: This doesn't seem to be true any longer, so it's now an
+ optional part of the prologue. - Kevin Buettner, 2001-11-20]
- if (read_memory_unsigned_integer (prologue_start, 4)
- == 0xe1a0c00d) /* mov ip, sp */
- current_pc = prologue_start + 4;
- else
- current_pc = prologue_start;
+ [Note further: The "mov ip,sp" only seems to be missing in
+ frameless functions at optimization level "-O2" or above,
+ in which case it is often (but not always) replaced by
+ "str lr, [sp, #-4]!". - Michael Snyder, 2002-04-23] */
- for (; current_pc < prologue_end; current_pc += 4)
+ sp_offset = fp_offset = 0;
+
+ for (current_pc = prologue_start;
+ current_pc < prologue_end;
+ current_pc += 4)
{
unsigned int insn = read_memory_unsigned_integer (current_pc, 4);
- if ((insn & 0xffff0000) == 0xe92d0000)
+ if (insn == 0xe1a0c00d) /* mov ip, sp */
+ {
+ continue;
+ }
+ else if (insn == 0xe52de004) /* str lr, [sp, #-4]! */
+ {
+ /* Function is frameless: extra_info defaults OK? */
+ continue;
+ }
+ else if ((insn & 0xffff0000) == 0xe92d0000)
/* stmfd sp!, {..., fp, ip, lr, pc}
or
stmfd sp!, {a1, a2, a3, a4} */
{
int mask = insn & 0xffff;
- /* Calculate offsets of saved registers. */
+ /* Calculate offsets of saved registers. */
for (regno = ARM_PC_REGNUM; regno >= 0; regno--)
if (mask & (1 << regno))
{
@@ -853,18 +904,23 @@ arm_scan_prologue (struct frame_info *fi)
fi->saved_regs[regno] = sp_offset;
}
}
+ else if ((insn & 0xffffcfc0) == 0xe50b0000) /* str rx, [r11, -n] */
+ {
+ /* No need to add this to saved_regs -- it's just an arg reg. */
+ continue;
+ }
else if ((insn & 0xfffff000) == 0xe24cb000) /* sub fp, ip #n */
{
- unsigned imm = insn & 0xff; /* immediate value */
- unsigned rot = (insn & 0xf00) >> 7; /* rotate amount */
+ unsigned imm = insn & 0xff; /* immediate value */
+ unsigned rot = (insn & 0xf00) >> 7; /* rotate amount */
imm = (imm >> rot) | (imm << (32 - rot));
fp_offset = -imm;
fi->extra_info->framereg = ARM_FP_REGNUM;
}
else if ((insn & 0xfffff000) == 0xe24dd000) /* sub sp, sp #n */
{
- unsigned imm = insn & 0xff; /* immediate value */
- unsigned rot = (insn & 0xf00) >> 7; /* rotate amount */
+ unsigned imm = insn & 0xff; /* immediate value */
+ unsigned rot = (insn & 0xf00) >> 7; /* rotate amount */
imm = (imm >> rot) | (imm << (32 - rot));
sp_offset -= imm;
}
@@ -879,7 +935,7 @@ arm_scan_prologue (struct frame_info *fi)
int n_saved_fp_regs;
unsigned int fp_start_reg, fp_bound_reg;
- if ((insn & 0x800) == 0x800) /* N0 is set */
+ if ((insn & 0x800) == 0x800) /* N0 is set */
{
if ((insn & 0x40000) == 0x40000) /* N1 is set */
n_saved_fp_regs = 3;
@@ -903,18 +959,18 @@ arm_scan_prologue (struct frame_info *fi)
}
}
else if ((insn & 0xf0000000) != 0xe0000000)
- break; /* Condition not true, exit early */
+ break; /* Condition not true, exit early */
else if ((insn & 0xfe200000) == 0xe8200000) /* ldm? */
- break; /* Don't scan past a block load */
+ break; /* Don't scan past a block load */
else
/* The optimizer might shove anything into the prologue,
- so we just skip what we don't recognize. */
+ so we just skip what we don't recognize. */
continue;
}
- /* The frame size is just the negative of the offset (from the original SP)
- of the last thing thing we pushed on the stack. The frame offset is
- [new FP] - [new SP]. */
+ /* The frame size is just the negative of the offset (from the
+ original SP) of the last thing thing we pushed on the stack.
+ The frame offset is [new FP] - [new SP]. */
fi->extra_info->framesize = -sp_offset;
if (fi->extra_info->framereg == ARM_FP_REGNUM)
fi->extra_info->frameoffset = fp_offset - sp_offset;
@@ -936,7 +992,7 @@ arm_find_callers_reg (struct frame_info *fi, int regnum)
{
for (; fi; fi = fi->next)
-#if 0 /* FIXME: enable this code if we convert to new call dummy scheme. */
+#if 0 /* FIXME: enable this code if we convert to new call dummy scheme. */
if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
return generic_read_register_dummy (fi->pc, fi->frame, regnum);
else
@@ -955,18 +1011,18 @@ arm_find_callers_reg (struct frame_info *fi, int regnum)
static CORE_ADDR
arm_frame_chain (struct frame_info *fi)
{
-#if 0 /* FIXME: enable this code if we convert to new call dummy scheme. */
+#if 0 /* FIXME: enable this code if we convert to new call dummy scheme. */
CORE_ADDR fn_start, callers_pc, fp;
- /* is this a dummy frame? */
+ /* Is this a dummy frame? */
if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
return fi->frame; /* dummy frame same as caller's frame */
- /* is caller-of-this a dummy frame? */
+ /* Is caller-of-this a dummy frame? */
callers_pc = FRAME_SAVED_PC (fi); /* find out who called us: */
fp = arm_find_callers_reg (fi, ARM_FP_REGNUM);
if (PC_IN_CALL_DUMMY (callers_pc, fp, fp))
- return fp; /* dummy frame's frame may bear no relation to ours */
+ return fp; /* dummy frame's frame may bear no relation to ours */
if (find_pc_partial_function (fi->pc, 0, &fn_start, 0))
if (fn_start == entry_point_address ())
@@ -987,7 +1043,7 @@ arm_frame_chain (struct frame_info *fi)
/* If the caller is Thumb and the caller is ARM, or vice versa,
the frame register of the caller is different from ours.
So we must scan the prologue of the caller to determine its
- frame register number. */
+ frame register number. */
/* XXX Fixme, we should try to do this without creating a temporary
caller_fi. */
if (arm_pc_is_thumb (caller_pc) != arm_pc_is_thumb (fi->pc))
@@ -1053,11 +1109,11 @@ arm_init_extra_frame_info (int fromleaf, struct frame_info *fi)
memset (fi->saved_regs, '\000', sizeof fi->saved_regs);
-#if 0 /* FIXME: enable this code if we convert to new call dummy scheme. */
+#if 0 /* FIXME: enable this code if we convert to new call dummy scheme. */
if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
{
- /* We need to setup fi->frame here because run_stack_dummy gets it wrong
- by assuming it's always FP. */
+ /* We need to setup fi->frame here because run_stack_dummy gets
+ it wrong by assuming it's always FP. */
fi->frame = generic_read_register_dummy (fi->pc, fi->frame,
ARM_SP_REGNUM);
fi->extra_info->framesize = 0;
@@ -1067,33 +1123,33 @@ arm_init_extra_frame_info (int fromleaf, struct frame_info *fi)
else
#endif
- /* Compute stack pointer for this frame. We use this value for both the
- sigtramp and call dummy cases. */
+ /* Compute stack pointer for this frame. We use this value for both
+ the sigtramp and call dummy cases. */
if (!fi->next)
sp = read_sp();
else
sp = (fi->next->frame - fi->next->extra_info->frameoffset
+ fi->next->extra_info->framesize);
- /* Determine whether or not we're in a sigtramp frame.
+ /* Determine whether or not we're in a sigtramp frame.
Unfortunately, it isn't sufficient to test
fi->signal_handler_caller because this value is sometimes set
after invoking INIT_EXTRA_FRAME_INFO. So we test *both*
- fi->signal_handler_caller and IN_SIGTRAMP to determine if we need
- to use the sigcontext addresses for the saved registers.
+ fi->signal_handler_caller and PC_IN_SIGTRAMP to determine if we
+ need to use the sigcontext addresses for the saved registers.
- Note: If an ARM IN_SIGTRAMP method ever needs to compare against
- the name of the function, the code below will have to be changed
- to first fetch the name of the function and then pass this name
- to IN_SIGTRAMP. */
+ Note: If an ARM PC_IN_SIGTRAMP method ever needs to compare
+ against the name of the function, the code below will have to be
+ changed to first fetch the name of the function and then pass
+ this name to PC_IN_SIGTRAMP. */
if (SIGCONTEXT_REGISTER_ADDRESS_P ()
- && (fi->signal_handler_caller || IN_SIGTRAMP (fi->pc, (char *)0)))
+ && (fi->signal_handler_caller || PC_IN_SIGTRAMP (fi->pc, (char *)0)))
{
for (reg = 0; reg < NUM_REGS; reg++)
fi->saved_regs[reg] = SIGCONTEXT_REGISTER_ADDRESS (sp, fi->pc, reg);
- /* FIXME: What about thumb mode? */
+ /* FIXME: What about thumb mode? */
fi->extra_info->framereg = ARM_SP_REGNUM;
fi->frame =
read_memory_integer (fi->saved_regs[fi->extra_info->framereg],
@@ -1130,20 +1186,20 @@ arm_init_extra_frame_info (int fromleaf, struct frame_info *fi)
arm_scan_prologue (fi);
if (!fi->next)
- /* this is the innermost frame? */
+ /* This is the innermost frame? */
fi->frame = read_register (fi->extra_info->framereg);
else if (fi->extra_info->framereg == ARM_FP_REGNUM
|| fi->extra_info->framereg == THUMB_FP_REGNUM)
{
/* not the innermost frame */
- /* If we have an FP, the callee saved it. */
+ /* If we have an FP, the callee saved it. */
if (fi->next->saved_regs[fi->extra_info->framereg] != 0)
fi->frame =
read_memory_integer (fi->next
->saved_regs[fi->extra_info->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... */
+ still in the frame pointer register on the board... */
fi->frame = read_fp ();
}
@@ -1168,7 +1224,7 @@ arm_init_extra_frame_info (int fromleaf, struct frame_info *fi)
static CORE_ADDR
arm_frame_saved_pc (struct frame_info *fi)
{
-#if 0 /* FIXME: enable this code if we convert to new call dummy scheme. */
+#if 0 /* FIXME: enable this code if we convert to new call dummy scheme. */
if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
return generic_read_register_dummy (fi->pc, fi->frame, ARM_PC_REGNUM);
else
@@ -1309,7 +1365,7 @@ arm_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs,
};
static unsigned long arm_bx_r4 = 0xe12fff14; /* bx r4 instruction */
- /* Set flag indicating whether the current PC is in a Thumb function. */
+ /* Set flag indicating whether the current PC is in a Thumb function. */
caller_is_thumb = arm_pc_is_thumb (read_pc ());
arm_set_call_dummy_breakpoint_offset ();
@@ -1342,7 +1398,7 @@ arm_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs,
}
/* Put the target address in r4; the call dummy will copy this to
- the PC. */
+ the PC. */
write_register (4, fun);
}
@@ -1363,7 +1419,7 @@ arm_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
stack is required. Need to take care here as structs may be
passed on the stack, and we have to to push them. */
nstack_size = -4 * REGISTER_SIZE; /* Some arguments go into A1-A4. */
- if (struct_return) /* The struct address goes in A1. */
+ if (struct_return) /* The struct address goes in A1. */
nstack_size += REGISTER_SIZE;
/* Walk through the arguments and add their size to nstack_size. */
@@ -1415,7 +1471,7 @@ arm_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
#if 1
/* I don't know why this code was disable. The only logical use
for a function pointer is to call that function, so setting
- the mode bit is perfectly fine. FN */
+ the mode bit is perfectly fine. FN */
/* If the argument is a pointer to a function, and it is a Thumb
function, set the low bit of the pointer. */
if (TYPE_CODE_PTR == typecode
@@ -1456,10 +1512,10 @@ arm_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
return sp;
}
-/* Pop the current frame. So long as the frame info has been initialized
- properly (see arm_init_extra_frame_info), this code works for dummy frames
- as well as regular frames. I.e, there's no need to have a special case
- for dummy frames. */
+/* Pop the current frame. So long as the frame info has been
+ initialized properly (see arm_init_extra_frame_info), this code
+ works for dummy frames as well as regular frames. I.e, there's no
+ need to have a special case for dummy frames. */
static void
arm_pop_frame (void)
{
@@ -1724,7 +1780,7 @@ thumb_get_next_pc (CORE_ADDR pc)
{
unsigned long pc_val = ((unsigned long) pc) + 4; /* PC after prefetch */
unsigned short inst1 = read_memory_integer (pc, 2);
- CORE_ADDR nextpc = pc + 2; /* default is next instruction */
+ CORE_ADDR nextpc = pc + 2; /* default is next instruction */
unsigned long offset;
if ((inst1 & 0xff00) == 0xbd00) /* pop {rlist, pc} */
@@ -1744,7 +1800,7 @@ thumb_get_next_pc (CORE_ADDR pc)
{
unsigned long status = read_register (ARM_PS_REGNUM);
unsigned long cond = bits (inst1, 8, 11);
- if (cond != 0x0f && condition_true (cond, status)) /* 0x0f = SWI */
+ if (cond != 0x0f && condition_true (cond, status)) /* 0x0f = SWI */
nextpc = pc_val + (sbits (inst1, 0, 7) << 1);
}
else if ((inst1 & 0xf800) == 0xe000) /* unconditional branch */
@@ -1782,7 +1838,7 @@ arm_get_next_pc (CORE_ADDR pc)
switch (bits (this_instr, 24, 27))
{
case 0x0:
- case 0x1: /* data processing */
+ case 0x1: /* data processing */
case 0x2:
case 0x3:
{
@@ -1988,13 +2044,13 @@ arm_get_next_pc (CORE_ADDR pc)
single-step support. We find the target of the coming instruction
and breakpoint it.
- single_step is also called just after the inferior stops. If we had
- set up a simulated single-step, we undo our damage. */
+ single_step() is also called just after the inferior stops. If we
+ had set up a simulated single-step, we undo our damage. */
static void
arm_software_single_step (enum target_signal sig, int insert_bpt)
{
- static int next_pc; /* State between setting and unsetting. */
+ static int next_pc; /* State between setting and unsetting. */
static char break_mem[BREAKPOINT_MAX]; /* Temporary storage for mem@bpt */
if (insert_bpt)
@@ -2022,10 +2078,11 @@ gdb_print_insn_arm (bfd_vma memaddr, disassemble_info *info)
if (csym.native == NULL)
{
- /* Create a fake symbol vector containing a Thumb symbol. This is
- solely so that the code in print_insn_little_arm() and
- print_insn_big_arm() in opcodes/arm-dis.c will detect the presence
- of a Thumb symbol and switch to decoding Thumb instructions. */
+ /* Create a fake symbol vector containing a Thumb symbol.
+ This is solely so that the code in print_insn_little_arm()
+ and print_insn_big_arm() in opcodes/arm-dis.c will detect
+ the presence of a Thumb symbol and switch to decoding
+ Thumb instructions. */
fake_target.flavour = bfd_target_coff_flavour;
fake_bfd.xvec = &fake_target;
@@ -2109,9 +2166,9 @@ static const char arm_default_thumb_be_breakpoint[] = THUMB_BE_BREAKPOINT;
/* XXX ??? from old tm-arm.h: if we're using RDP, then we're inserting
breakpoints and storing their handles instread of what was in
memory. It is nice that this is the same size as a handle -
- otherwise remote-rdp will have to change. */
+ otherwise remote-rdp will have to change. */
-unsigned char *
+static const unsigned char *
arm_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
@@ -2307,7 +2364,7 @@ arm_store_return_value (struct type *type, char *valbuf)
}
/* Store the address of the place in which to copy the structure the
- subroutine will return. This is called from call_function. */
+ subroutine will return. This is called from call_function. */
static void
arm_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
@@ -2341,7 +2398,8 @@ arm_in_call_stub (CORE_ADDR pc, char *name)
/* Find the starting address of the function containing the PC. If
the caller didn't give us a name, look it up at the same time. */
- if (find_pc_partial_function (pc, name ? NULL : &name, &start_addr, NULL) == 0)
+ if (0 == find_pc_partial_function (pc, name ? NULL : &name,
+ &start_addr, NULL))
return 0;
return strncmp (name, "_call_via_r", 11) == 0;
@@ -2381,10 +2439,10 @@ arm_skip_stub (CORE_ADDR pc)
return 0; /* not a stub */
}
-/* If the user changes the register disassembly flavor used for info register
- and other commands, we have to also switch the flavor used in opcodes
- for disassembly output.
- This function is run in the set disassembly_flavor command, and does that. */
+/* If the user changes the register disassembly flavor used for info
+ register and other commands, we have to also switch the flavor used
+ in opcodes for disassembly output. This function is run in the set
+ disassembly_flavor command, and does that. */
static void
set_disassembly_flavor_sfunc (char *args, int from_tty,
@@ -2406,7 +2464,7 @@ set_disassembly_flavor (void)
const char *setname, *setdesc, **regnames;
int numregs, j;
- /* Find the flavor that the user wants in the opcodes table. */
+ /* Find the flavor that the user wants in the opcodes table. */
int current = 0;
numregs = get_arm_regnames (current, &setname, &setdesc, &regnames);
while ((disassembly_flavor != setname)
@@ -2414,11 +2472,11 @@ set_disassembly_flavor (void)
get_arm_regnames (++current, &setname, &setdesc, &regnames);
current_option = current;
- /* Fill our copy. */
+ /* Fill our copy. */
for (j = 0; j < numregs; j++)
arm_register_names[j] = (char *) regnames[j];
- /* Adjust case. */
+ /* Adjust case. */
if (isupper (*regnames[ARM_PC_REGNUM]))
{
arm_register_names[ARM_FPS_REGNUM] = "FPS";
@@ -2430,23 +2488,23 @@ set_disassembly_flavor (void)
arm_register_names[ARM_PS_REGNUM] = "cpsr";
}
- /* Synchronize the disassembler. */
+ /* Synchronize the disassembler. */
set_arm_regname_option (current);
}
/* arm_othernames implements the "othernames" command. This is kind
of hacky, and I prefer the set-show disassembly-flavor which is
also used for the x86 gdb. I will keep this around, however, in
- case anyone is actually using it. */
+ case anyone is actually using it. */
static void
arm_othernames (char *names, int n)
{
- /* Circle through the various flavors. */
+ /* Circle through the various flavors. */
current_option = (current_option + 1) % num_flavor_options;
disassembly_flavor = valid_flavors[current_option];
- set_disassembly_flavor ();
+ set_disassembly_flavor ();
}
/* Fetch, and possibly build, an appropriate link_map_offsets structure
@@ -2455,7 +2513,7 @@ arm_othernames (char *names, int n)
Instead, the relevant structs offsets were obtained from examining
link.h. (We can't refer to link.h from this file because the host
system won't necessarily have it, or if it does, the structs which
- it defines will refer to the host system, not the target.) */
+ it defines will refer to the host system, not the target). */
struct link_map_offsets *
arm_linux_svr4_fetch_link_map_offsets (void)
@@ -2468,13 +2526,13 @@ arm_linux_svr4_fetch_link_map_offsets (void)
lmp = &lmo;
lmo.r_debug_size = 8; /* Actual size is 20, but this is all we
- need. */
+ need. */
lmo.r_map_offset = 4;
lmo.r_map_size = 4;
lmo.link_map_size = 20; /* Actual size is 552, but this is all we
- need. */
+ need. */
lmo.l_addr_offset = 0;
lmo.l_addr_size = 4;
@@ -2732,12 +2790,12 @@ arm_gdbarch_register_os_abi (enum arm_abi abi,
(*handler_p)->init_abi = init_abi;
}
-/* Initialize the current architecture based on INFO. If possible, re-use an
- architecture from ARCHES, which is a list of architectures already created
- during this debugging session.
+/* Initialize the current architecture based on INFO. If possible,
+ re-use an architecture from ARCHES, which is a list of
+ architectures already created during this debugging session.
- Called e.g. at program startup, when reading a core file, and when reading
- a binary file. */
+ Called e.g. at program startup, when reading a core file, and when
+ reading a binary file. */
static struct gdbarch *
arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
@@ -2833,7 +2891,7 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* This should be low enough for everything. */
tdep->lowest_pc = 0x20;
- tdep->jb_pc = -1; /* Longjump support not enabled by default. */
+ tdep->jb_pc = -1; /* Longjump support not enabled by default. */
set_gdbarch_use_generic_dummy_frames (gdbarch, 0);
@@ -2898,7 +2956,7 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* Information about registers, etc. */
set_gdbarch_print_float_info (gdbarch, arm_print_float_info);
- set_gdbarch_fp_regnum (gdbarch, ARM_FP_REGNUM); /* ??? */
+ set_gdbarch_fp_regnum (gdbarch, ARM_FP_REGNUM); /* ??? */
set_gdbarch_sp_regnum (gdbarch, ARM_SP_REGNUM);
set_gdbarch_pc_regnum (gdbarch, ARM_PC_REGNUM);
set_gdbarch_register_byte (gdbarch, arm_register_byte);
@@ -3013,9 +3071,13 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
if (prologue_cache.saved_regs != NULL)
xfree (prologue_cache.saved_regs);
+ /* We can't use NUM_REGS nor NUM_PSEUDO_REGS here, since that still
+ references the old architecture vector, not the one we are
+ building here. */
prologue_cache.saved_regs = (CORE_ADDR *)
xcalloc (1, (sizeof (CORE_ADDR)
- * (gdbarch_num_regs (gdbarch) + NUM_PSEUDO_REGS)));
+ * (gdbarch_num_regs (gdbarch)
+ + gdbarch_num_pseudo_regs (gdbarch))));
return gdbarch;
}
@@ -3082,18 +3144,18 @@ _initialize_arm_tdep (void)
tm_print_insn = gdb_print_insn_arm;
- /* Get the number of possible sets of register names defined in opcodes. */
+ /* Get the number of possible sets of register names defined in opcodes. */
num_flavor_options = get_arm_regname_num_options ();
- /* Sync the opcode insn printer with our register viewer: */
+ /* Sync the opcode insn printer with our register viewer. */
parse_arm_disassembler_option ("reg-names-std");
- /* Begin creating the help text. */
+ /* Begin creating the help text. */
stb = mem_fileopen ();
fprintf_unfiltered (stb, "Set the disassembly flavor.\n\
The valid values are:\n");
- /* Initialize the array that will be passed to add_set_enum_cmd(). */
+ /* Initialize the array that will be passed to add_set_enum_cmd(). */
valid_flavors = xmalloc ((num_flavor_options + 1) * sizeof (char *));
for (i = 0; i < num_flavor_options; i++)
{
@@ -3101,7 +3163,7 @@ The valid values are:\n");
valid_flavors[i] = setname;
fprintf_unfiltered (stb, "%s - %s\n", setname,
setdesc);
- /* Copy the default names (if found) and synchronize disassembler. */
+ /* Copy the default names (if found) and synchronize disassembler. */
if (!strcmp (setname, "std"))
{
disassembly_flavor = setname;
@@ -3111,15 +3173,15 @@ The valid values are:\n");
set_arm_regname_option (i);
}
}
- /* Mark the end of valid options. */
+ /* Mark the end of valid options. */
valid_flavors[num_flavor_options] = NULL;
- /* Finish the creation of the help text. */
+ /* Finish the creation of the help text. */
fprintf_unfiltered (stb, "The default is \"std\".");
helptext = ui_file_xstrdup (stb, &length);
ui_file_delete (stb);
- /* Add the disassembly-flavor command */
+ /* Add the disassembly-flavor command. */
new_cmd = add_set_enum_cmd ("disassembly-flavor", no_class,
valid_flavors,
&disassembly_flavor,
@@ -3134,7 +3196,7 @@ The valid values are:\n");
"Set usage of ARM 32-bit mode.\n", &setlist),
&showlist);
- /* Add the deprecated "othernames" command */
+ /* Add the deprecated "othernames" command. */
add_com ("othernames", class_obscure, arm_othernames,
"Switch to the next set of register names.");
diff --git a/gdb/arm-tdep.h b/gdb/arm-tdep.h
index a4c52dc..0fad4fd 100644
--- a/gdb/arm-tdep.h
+++ b/gdb/arm-tdep.h
@@ -25,25 +25,26 @@
the user is concerned but do serve to get the desired values when
passed to read_register. */
-#define ARM_A1_REGNUM 0 /* first integer-like argument */
-#define ARM_A4_REGNUM 3 /* last integer-like argument */
-#define ARM_AP_REGNUM 11
-#define ARM_SP_REGNUM 13 /* Contains address of top of stack */
-#define ARM_LR_REGNUM 14 /* address to return to from a function call */
-#define ARM_PC_REGNUM 15 /* Contains program counter */
-#define ARM_F0_REGNUM 16 /* first floating point register */
-#define ARM_F3_REGNUM 19 /* last floating point argument register */
-#define ARM_F7_REGNUM 23 /* last floating point register */
-#define ARM_FPS_REGNUM 24 /* floating point status register */
-#define ARM_PS_REGNUM 25 /* Contains processor status */
-
-#define ARM_FP_REGNUM 11 /* Frame register in ARM code, if used. */
-#define THUMB_FP_REGNUM 7 /* Frame register in Thumb code, if used. */
-
-#define ARM_NUM_ARG_REGS 4
-#define ARM_LAST_ARG_REGNUM ARM_A4_REGNUM
-#define ARM_NUM_FP_ARG_REGS 4
-#define ARM_LAST_FP_ARG_REGNUM ARM_F3_REGNUM
+enum gdb_regnum {
+ ARM_A1_REGNUM = 0, /* first integer-like argument */
+ ARM_A4_REGNUM = 3, /* last integer-like argument */
+ ARM_AP_REGNUM = 11,
+ ARM_SP_REGNUM = 13, /* Contains address of top of stack */
+ ARM_LR_REGNUM = 14, /* address to return to from a function call */
+ ARM_PC_REGNUM = 15, /* Contains program counter */
+ ARM_F0_REGNUM = 16, /* first floating point register */
+ ARM_F3_REGNUM = 19, /* last floating point argument register */
+ ARM_F7_REGNUM = 23, /* last floating point register */
+ ARM_FPS_REGNUM = 24, /* floating point status register */
+ ARM_PS_REGNUM = 25, /* Contains processor status */
+ ARM_FP_REGNUM = 11, /* Frame register in ARM code, if used. */
+ THUMB_FP_REGNUM = 7, /* Frame register in Thumb code, if used. */
+ ARM_NUM_ARG_REGS = 4,
+ ARM_LAST_ARG_REGNUM = ARM_A4_REGNUM,
+ ARM_NUM_FP_ARG_REGS = 4,
+ ARM_LAST_FP_ARG_REGNUM = ARM_F3_REGNUM
+};
+
/* Size of integer registers. */
#define INT_REGISTER_RAW_SIZE 4
diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c
new file mode 100644
index 0000000..71c7796
--- /dev/null
+++ b/gdb/avr-tdep.c
@@ -0,0 +1,1374 @@
+/* Target-dependent code for Atmel AVR, for GDB.
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
+ 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. */
+
+/* Contributed by Theodore A. Roth, troth@verinet.com */
+
+/* Portions of this file were taken from the original gdb-4.18 patch developed
+ by Denis Chertykov, denisc@overta.ru */
+
+#include "defs.h"
+#include "gdbcmd.h"
+#include "gdbcore.h"
+#include "inferior.h"
+#include "symfile.h"
+#include "arch-utils.h"
+#include "regcache.h"
+
+/* AVR Background:
+
+ (AVR micros are pure Harvard Architecture processors.)
+
+ The AVR family of microcontrollers have three distinctly different memory
+ spaces: flash, sram and eeprom. The flash is 16 bits wide and is used for
+ the most part to store program instructions. The sram is 8 bits wide and is
+ used for the stack and the heap. Some devices lack sram and some can have
+ an additional external sram added on as a peripheral.
+
+ The eeprom is 8 bits wide and is used to store data when the device is
+ powered down. Eeprom is not directly accessible, it can only be accessed
+ via io-registers using a special algorithm. Accessing eeprom via gdb's
+ remote serial protocol ('m' or 'M' packets) looks difficult to do and is
+ not included at this time.
+
+ [The eeprom could be read manually via ``x/b <eaddr + AVR_EMEM_START>'' or
+ written using ``set {unsigned char}<eaddr + AVR_EMEM_START>''. For this to
+ work, the remote target must be able to handle eeprom accesses and perform
+ the address translation.]
+
+ All three memory spaces have physical addresses beginning at 0x0. In
+ addition, the flash is addressed by gcc/binutils/gdb with respect to 8 bit
+ bytes instead of the 16 bit wide words used by the real device for the
+ Program Counter.
+
+ In order for remote targets to work correctly, extra bits must be added to
+ addresses before they are send to the target or received from the target
+ via the remote serial protocol. The extra bits are the MSBs and are used to
+ decode which memory space the address is referring to. */
+
+#undef XMALLOC
+#define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
+
+#undef EXTRACT_INSN
+#define EXTRACT_INSN(addr) extract_unsigned_integer(addr,2)
+
+/* Constants: prefixed with AVR_ to avoid name space clashes */
+
+enum
+{
+ AVR_REG_W = 24,
+ AVR_REG_X = 26,
+ AVR_REG_Y = 28,
+ AVR_FP_REGNUM = 28,
+ AVR_REG_Z = 30,
+
+ AVR_SREG_REGNUM = 32,
+ AVR_SP_REGNUM = 33,
+ AVR_PC_REGNUM = 34,
+
+ AVR_NUM_REGS = 32 + 1 /*SREG*/ + 1 /*SP*/ + 1 /*PC*/,
+ AVR_NUM_REG_BYTES = 32 + 1 /*SREG*/ + 2 /*SP*/ + 4 /*PC*/,
+
+ AVR_PC_REG_INDEX = 35, /* index into array of registers */
+
+ AVR_MAX_PROLOGUE_SIZE = 56, /* bytes */
+
+ /* Count of pushed registers. From r2 to r17 (inclusively), r28, r29 */
+ AVR_MAX_PUSHES = 18,
+
+ /* Number of the last pushed register. r17 for current avr-gcc */
+ AVR_LAST_PUSHED_REGNUM = 17,
+
+ /* FIXME: TRoth/2002-01-??: Can we shift all these memory masks left 8
+ bits? Do these have to match the bfd vma values?. It sure would make
+ things easier in the future if they didn't need to match.
+
+ Note: I chose these values so as to be consistent with bfd vma
+ addresses.
+
+ TRoth/2002-04-08: There is already a conflict with very large programs
+ in the mega128. The mega128 has 128K instruction bytes (64K words),
+ thus the Most Significant Bit is 0x10000 which gets masked off my
+ AVR_MEM_MASK.
+
+ The problem manifests itself when trying to set a breakpoint in a
+ function which resides in the upper half of the instruction space and
+ thus requires a 17-bit address.
+
+ For now, I've just removed the EEPROM mask and changed AVR_MEM_MASK
+ from 0x00ff0000 to 0x00f00000. Eeprom is not accessible from gdb yet,
+ but could be for some remote targets by just adding the correct offset
+ to the address and letting the remote target handle the low-level
+ details of actually accessing the eeprom. */
+
+ AVR_IMEM_START = 0x00000000, /* INSN memory */
+ AVR_SMEM_START = 0x00800000, /* SRAM memory */
+#if 1
+ /* No eeprom mask defined */
+ AVR_MEM_MASK = 0x00f00000, /* mask to determine memory space */
+#else
+ AVR_EMEM_START = 0x00810000, /* EEPROM memory */
+ AVR_MEM_MASK = 0x00ff0000, /* mask to determine memory space */
+#endif
+};
+
+/* Any function with a frame looks like this
+ ....... <-SP POINTS HERE
+ LOCALS1 <-FP POINTS HERE
+ LOCALS0
+ SAVED FP
+ SAVED R3
+ SAVED R2
+ RET PC
+ FIRST ARG
+ SECOND ARG */
+
+struct frame_extra_info
+{
+ CORE_ADDR return_pc;
+ CORE_ADDR args_pointer;
+ int locals_size;
+ int framereg;
+ int framesize;
+ int is_main;
+};
+
+struct gdbarch_tdep
+{
+ /* FIXME: TRoth: is there anything to put here? */
+ int foo;
+};
+
+/* Lookup the name of a register given it's number. */
+
+static char *
+avr_register_name (int regnum)
+{
+ static char *register_names[] = {
+ "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
+ "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
+ "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",
+ "r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31",
+ "SREG", "SP", "PC"
+ };
+ if (regnum < 0)
+ return NULL;
+ if (regnum >= (sizeof (register_names) / sizeof (*register_names)))
+ return NULL;
+ return register_names[regnum];
+}
+
+/* Index within `registers' of the first byte of the space for
+ register REGNUM. */
+
+static int
+avr_register_byte (int regnum)
+{
+ if (regnum < AVR_PC_REGNUM)
+ return regnum;
+ else
+ return AVR_PC_REG_INDEX;
+}
+
+/* Number of bytes of storage in the actual machine representation for
+ register REGNUM. */
+
+static int
+avr_register_raw_size (int regnum)
+{
+ switch (regnum)
+ {
+ case AVR_PC_REGNUM:
+ return 4;
+ case AVR_SP_REGNUM:
+ case AVR_FP_REGNUM:
+ return 2;
+ default:
+ return 1;
+ }
+}
+
+/* Number of bytes of storage in the program's representation
+ for register N. */
+
+static int
+avr_register_virtual_size (int regnum)
+{
+ return TYPE_LENGTH (REGISTER_VIRTUAL_TYPE (regnum));
+}
+
+/* Return the GDB type object for the "standard" data type
+ of data in register N. */
+
+static struct type *
+avr_register_virtual_type (int regnum)
+{
+ switch (regnum)
+ {
+ case AVR_PC_REGNUM:
+ return builtin_type_unsigned_long;
+ case AVR_SP_REGNUM:
+ return builtin_type_unsigned_short;
+ default:
+ return builtin_type_unsigned_char;
+ }
+}
+
+/* Instruction address checks and convertions. */
+
+static CORE_ADDR
+avr_make_iaddr (CORE_ADDR x)
+{
+ return ((x) | AVR_IMEM_START);
+}
+
+static int
+avr_iaddr_p (CORE_ADDR x)
+{
+ return (((x) & AVR_MEM_MASK) == AVR_IMEM_START);
+}
+
+/* FIXME: TRoth: Really need to use a larger mask for instructions. Some
+ devices are already up to 128KBytes of flash space.
+
+ TRoth/2002-04-8: See comment above where AVR_IMEM_START is defined. */
+
+static CORE_ADDR
+avr_convert_iaddr_to_raw (CORE_ADDR x)
+{
+ return ((x) & 0xffffffff);
+}
+
+/* SRAM address checks and convertions. */
+
+static CORE_ADDR
+avr_make_saddr (CORE_ADDR x)
+{
+ return ((x) | AVR_SMEM_START);
+}
+
+static int
+avr_saddr_p (CORE_ADDR x)
+{
+ return (((x) & AVR_MEM_MASK) == AVR_SMEM_START);
+}
+
+static CORE_ADDR
+avr_convert_saddr_to_raw (CORE_ADDR x)
+{
+ return ((x) & 0xffffffff);
+}
+
+/* EEPROM address checks and convertions. I don't know if these will ever
+ actually be used, but I've added them just the same. TRoth */
+
+/* TRoth/2002-04-08: Commented out for now to allow fix for problem with large
+ programs in the mega128. */
+
+/* static CORE_ADDR */
+/* avr_make_eaddr (CORE_ADDR x) */
+/* { */
+/* return ((x) | AVR_EMEM_START); */
+/* } */
+
+/* static int */
+/* avr_eaddr_p (CORE_ADDR x) */
+/* { */
+/* return (((x) & AVR_MEM_MASK) == AVR_EMEM_START); */
+/* } */
+
+/* static CORE_ADDR */
+/* avr_convert_eaddr_to_raw (CORE_ADDR x) */
+/* { */
+/* return ((x) & 0xffffffff); */
+/* } */
+
+/* Convert from address to pointer and vice-versa. */
+
+static void
+avr_address_to_pointer (struct type *type, void *buf, CORE_ADDR addr)
+{
+ /* Is it a code address? */
+ if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_FUNC
+ || TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_METHOD)
+ {
+ store_unsigned_integer (buf, TYPE_LENGTH (type),
+ avr_convert_iaddr_to_raw (addr));
+ }
+ else
+ {
+ /* Strip off any upper segment bits. */
+ store_unsigned_integer (buf, TYPE_LENGTH (type),
+ avr_convert_saddr_to_raw (addr));
+ }
+}
+
+static CORE_ADDR
+avr_pointer_to_address (struct type *type, void *buf)
+{
+ CORE_ADDR addr = extract_address (buf, TYPE_LENGTH (type));
+
+ if (TYPE_CODE_SPACE (TYPE_TARGET_TYPE (type)))
+ {
+ fprintf_unfiltered (gdb_stderr, "CODE_SPACE ---->> ptr->addr: 0x%lx\n",
+ addr);
+ fprintf_unfiltered (gdb_stderr,
+ "+++ If you see this, please send me an email <troth@verinet.com>\n");
+ }
+
+ /* Is it a code address? */
+ if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_FUNC
+ || TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_METHOD
+ || TYPE_CODE_SPACE (TYPE_TARGET_TYPE (type)))
+ return avr_make_iaddr (addr);
+ else
+ return avr_make_saddr (addr);
+}
+
+static CORE_ADDR
+avr_read_pc (ptid_t ptid)
+{
+ ptid_t save_ptid;
+ CORE_ADDR pc;
+ CORE_ADDR retval;
+
+ save_ptid = inferior_ptid;
+ inferior_ptid = ptid;
+ pc = (int) read_register (AVR_PC_REGNUM);
+ inferior_ptid = save_ptid;
+ retval = avr_make_iaddr (pc);
+ return retval;
+}
+
+static void
+avr_write_pc (CORE_ADDR val, ptid_t ptid)
+{
+ ptid_t save_ptid;
+
+ save_ptid = inferior_ptid;
+ inferior_ptid = ptid;
+ write_register (AVR_PC_REGNUM, avr_convert_iaddr_to_raw (val));
+ inferior_ptid = save_ptid;
+}
+
+static CORE_ADDR
+avr_read_sp (void)
+{
+ return (avr_make_saddr (read_register (AVR_SP_REGNUM)));
+}
+
+static void
+avr_write_sp (CORE_ADDR val)
+{
+ write_register (AVR_SP_REGNUM, avr_convert_saddr_to_raw (val));
+}
+
+static CORE_ADDR
+avr_read_fp (void)
+{
+ return (avr_make_saddr (read_register (AVR_FP_REGNUM)));
+}
+
+/* Translate a GDB virtual ADDR/LEN into a format the remote target
+ understands. Returns number of bytes that can be transfered
+ starting at TARG_ADDR. Return ZERO if no bytes can be transfered
+ (segmentation fault).
+
+ TRoth/2002-04-08: Could this be used to check for dereferencing an invalid
+ pointer? */
+
+static void
+avr_remote_translate_xfer_address (CORE_ADDR memaddr, int nr_bytes,
+ CORE_ADDR *targ_addr, int *targ_len)
+{
+ long out_addr;
+ long out_len;
+
+ /* FIXME: TRoth: Do nothing for now. Will need to examine memaddr at this
+ point and see if the high bit are set with the masks that we want. */
+
+ *targ_addr = memaddr;
+ *targ_len = nr_bytes;
+}
+
+/* Function pointers obtained from the target are half of what gdb expects so
+ multiply by 2. */
+
+static CORE_ADDR
+avr_convert_from_func_ptr_addr (CORE_ADDR addr)
+{
+ return addr * 2;
+}
+
+/* avr_scan_prologue is also used as the frame_init_saved_regs().
+
+ Put here the code to store, into fi->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. */
+
+/* Function: avr_scan_prologue (helper function for avr_init_extra_frame_info)
+ This function decodes a AVR function prologue to determine:
+ 1) the size of the stack frame
+ 2) which registers are saved on it
+ 3) the offsets of saved regs
+ This information is stored in the "extra_info" field of the frame_info.
+
+ A typical AVR function prologue might look like this:
+ push rXX
+ push r28
+ push r29
+ in r28,__SP_L__
+ in r29,__SP_H__
+ sbiw r28,<LOCALS_SIZE>
+ in __tmp_reg__,__SREG__
+ cli
+ out __SP_L__,r28
+ out __SREG__,__tmp_reg__
+ out __SP_H__,r29
+
+ A `-mcall-prologues' prologue look like this:
+ ldi r26,<LOCALS_SIZE>
+ ldi r27,<LOCALS_SIZE>/265
+ ldi r30,pm_lo8(.L_foo_body)
+ ldi r31,pm_hi8(.L_foo_body)
+ rjmp __prologue_saves__+RRR
+ .L_foo_body: */
+
+static void
+avr_scan_prologue (struct frame_info *fi)
+{
+ CORE_ADDR prologue_start;
+ CORE_ADDR prologue_end;
+ int i;
+ unsigned short insn;
+ int regno;
+ int scan_stage = 0;
+ char *name;
+ struct minimal_symbol *msymbol;
+ int prologue_len;
+ unsigned char prologue[AVR_MAX_PROLOGUE_SIZE];
+ int vpc = 0;
+
+ fi->extra_info->framereg = AVR_SP_REGNUM;
+
+ if (find_pc_partial_function
+ (fi->pc, &name, &prologue_start, &prologue_end))
+ {
+ struct symtab_and_line sal = find_pc_line (prologue_start, 0);
+
+ if (sal.line == 0) /* no line info, use current PC */
+ prologue_end = fi->pc;
+ else if (sal.end < prologue_end) /* next line begins after fn end */
+ prologue_end = sal.end; /* (probably means no prologue) */
+ }
+ else
+ /* We're in the boondocks: allow for */
+ /* 19 pushes, an add, and "mv fp,sp" */
+ prologue_end = prologue_start + AVR_MAX_PROLOGUE_SIZE;
+
+ prologue_end = min (prologue_end, fi->pc);
+
+ /* Search the prologue looking for instructions that set up the
+ frame pointer, adjust the stack pointer, and save registers. */
+
+ fi->extra_info->framesize = 0;
+ prologue_len = prologue_end - prologue_start;
+ read_memory (prologue_start, prologue, prologue_len);
+
+ /* Scanning main()'s prologue
+ ldi r28,lo8(<RAM_ADDR> - <LOCALS_SIZE>)
+ ldi r29,hi8(<RAM_ADDR> - <LOCALS_SIZE>)
+ out __SP_H__,r29
+ out __SP_L__,r28 */
+
+ if (name && strcmp ("main", name) == 0 && prologue_len == 8)
+ {
+ CORE_ADDR locals;
+ unsigned char img[] = {
+ 0xde, 0xbf, /* out __SP_H__,r29 */
+ 0xcd, 0xbf /* out __SP_L__,r28 */
+ };
+
+ fi->extra_info->framereg = AVR_FP_REGNUM;
+ insn = EXTRACT_INSN (&prologue[vpc]);
+ /* ldi r28,lo8(<RAM_ADDR> - <LOCALS_SIZE>) */
+ if ((insn & 0xf0f0) == 0xe0c0)
+ {
+ locals = (insn & 0xf) | ((insn & 0x0f00) >> 4);
+ insn = EXTRACT_INSN (&prologue[vpc + 2]);
+ /* ldi r29,hi8(<RAM_ADDR> - <LOCALS_SIZE>) */
+ if ((insn & 0xf0f0) == 0xe0d0)
+ {
+ locals |= ((insn & 0xf) | ((insn & 0x0f00) >> 4)) << 8;
+ if (memcmp (prologue + vpc + 4, img, sizeof (img)) == 0)
+ {
+ fi->frame = locals;
+
+ /* TRoth: Does -1 mean we're in main? */
+ fi->extra_info->is_main = 1;
+ return;
+ }
+ }
+ }
+ }
+
+ /* Scanning `-mcall-prologues' prologue
+ FIXME: mega prologue have a 12 bytes long */
+
+ while (prologue_len <= 12) /* I'm use while to avoit many goto's */
+ {
+ int loc_size;
+ int body_addr;
+ unsigned num_pushes;
+
+ insn = EXTRACT_INSN (&prologue[vpc]);
+ /* ldi r26,<LOCALS_SIZE> */
+ if ((insn & 0xf0f0) != 0xe0a0)
+ break;
+ loc_size = (insn & 0xf) | ((insn & 0x0f00) >> 4);
+
+ insn = EXTRACT_INSN (&prologue[vpc + 2]);
+ /* ldi r27,<LOCALS_SIZE> / 256 */
+ if ((insn & 0xf0f0) != 0xe0b0)
+ break;
+ loc_size |= ((insn & 0xf) | ((insn & 0x0f00) >> 4)) << 8;
+
+ insn = EXTRACT_INSN (&prologue[vpc + 4]);
+ /* ldi r30,pm_lo8(.L_foo_body) */
+ if ((insn & 0xf0f0) != 0xe0e0)
+ break;
+ body_addr = (insn & 0xf) | ((insn & 0x0f00) >> 4);
+
+ insn = EXTRACT_INSN (&prologue[vpc + 6]);
+ /* ldi r31,pm_hi8(.L_foo_body) */
+ if ((insn & 0xf0f0) != 0xe0f0)
+ break;
+ body_addr |= ((insn & 0xf) | ((insn & 0x0f00) >> 4)) << 8;
+
+ if (body_addr != (prologue_start + 10) / 2)
+ break;
+
+ msymbol = lookup_minimal_symbol ("__prologue_saves__", NULL, NULL);
+ if (!msymbol)
+ break;
+
+ /* FIXME: prologue for mega have a JMP instead of RJMP */
+ insn = EXTRACT_INSN (&prologue[vpc + 8]);
+ /* rjmp __prologue_saves__+RRR */
+ if ((insn & 0xf000) != 0xc000)
+ break;
+
+ /* Extract PC relative offset from RJMP */
+ i = (insn & 0xfff) | (insn & 0x800 ? (-1 ^ 0xfff) : 0);
+ /* Convert offset to byte addressable mode */
+ i *= 2;
+ /* Destination address */
+ i += vpc + prologue_start + 10;
+ /* Resovle offset (in words) from __prologue_saves__ symbol.
+ Which is a pushes count in `-mcall-prologues' mode */
+ num_pushes = AVR_MAX_PUSHES - (i - SYMBOL_VALUE_ADDRESS (msymbol)) / 2;
+
+ if (num_pushes > AVR_MAX_PUSHES)
+ num_pushes = 0;
+
+ if (num_pushes)
+ {
+ int from;
+ fi->saved_regs[AVR_FP_REGNUM + 1] = num_pushes;
+ if (num_pushes >= 2)
+ fi->saved_regs[AVR_FP_REGNUM] = num_pushes - 1;
+ i = 0;
+ for (from = AVR_LAST_PUSHED_REGNUM + 1 - (num_pushes - 2);
+ from <= AVR_LAST_PUSHED_REGNUM; ++from)
+ fi->saved_regs[from] = ++i;
+ }
+ fi->extra_info->locals_size = loc_size;
+ fi->extra_info->framesize = loc_size + num_pushes;
+ fi->extra_info->framereg = AVR_FP_REGNUM;
+ return;
+ }
+
+ /* Scan interrupt or signal function */
+
+ if (prologue_len >= 12)
+ {
+ unsigned char img[] = {
+ 0x78, 0x94, /* sei */
+ 0x1f, 0x92, /* push r1 */
+ 0x0f, 0x92, /* push r0 */
+ 0x0f, 0xb6, /* in r0,0x3f SREG */
+ 0x0f, 0x92, /* push r0 */
+ 0x11, 0x24 /* clr r1 */
+ };
+ if (memcmp (prologue, img, sizeof (img)) == 0)
+ {
+ vpc += sizeof (img);
+ fi->saved_regs[0] = 2;
+ fi->saved_regs[1] = 1;
+ fi->extra_info->framesize += 3;
+ }
+ else if (memcmp (img + 1, prologue, sizeof (img) - 1) == 0)
+ {
+ vpc += sizeof (img) - 1;
+ fi->saved_regs[0] = 2;
+ fi->saved_regs[1] = 1;
+ fi->extra_info->framesize += 3;
+ }
+ }
+
+ /* First stage of the prologue scanning.
+ Scan pushes */
+
+ for (; vpc <= prologue_len; vpc += 2)
+ {
+ insn = EXTRACT_INSN (&prologue[vpc]);
+ if ((insn & 0xfe0f) == 0x920f) /* push rXX */
+ {
+ /* Bits 4-9 contain a mask for registers R0-R32. */
+ regno = (insn & 0x1f0) >> 4;
+ ++fi->extra_info->framesize;
+ fi->saved_regs[regno] = fi->extra_info->framesize;
+ scan_stage = 1;
+ }
+ else
+ break;
+ }
+
+ /* Second stage of the prologue scanning.
+ Scan:
+ in r28,__SP_L__
+ in r29,__SP_H__ */
+
+ if (scan_stage == 1 && vpc + 4 <= prologue_len)
+ {
+ unsigned char img[] = {
+ 0xcd, 0xb7, /* in r28,__SP_L__ */
+ 0xde, 0xb7 /* in r29,__SP_H__ */
+ };
+ unsigned short insn1;
+
+ if (memcmp (prologue + vpc, img, sizeof (img)) == 0)
+ {
+ vpc += 4;
+ fi->extra_info->framereg = AVR_FP_REGNUM;
+ scan_stage = 2;
+ }
+ }
+
+ /* Third stage of the prologue scanning. (Really two stages)
+ Scan for:
+ sbiw r28,XX or subi r28,lo8(XX)
+ sbci r29,hi8(XX)
+ in __tmp_reg__,__SREG__
+ cli
+ out __SP_L__,r28
+ out __SREG__,__tmp_reg__
+ out __SP_H__,r29 */
+
+ if (scan_stage == 2 && vpc + 12 <= prologue_len)
+ {
+ int locals_size = 0;
+ unsigned char img[] = {
+ 0x0f, 0xb6, /* in r0,0x3f */
+ 0xf8, 0x94, /* cli */
+ 0xcd, 0xbf, /* out 0x3d,r28 ; SPL */
+ 0x0f, 0xbe, /* out 0x3f,r0 ; SREG */
+ 0xde, 0xbf /* out 0x3e,r29 ; SPH */
+ };
+ unsigned char img_sig[] = {
+ 0xcd, 0xbf, /* out 0x3d,r28 ; SPL */
+ 0xde, 0xbf /* out 0x3e,r29 ; SPH */
+ };
+ unsigned char img_int[] = {
+ 0xf8, 0x94, /* cli */
+ 0xcd, 0xbf, /* out 0x3d,r28 ; SPL */
+ 0x78, 0x94, /* sei */
+ 0xde, 0xbf /* out 0x3e,r29 ; SPH */
+ };
+
+ insn = EXTRACT_INSN (&prologue[vpc]);
+ vpc += 2;
+ if ((insn & 0xff30) == 0x9720) /* sbiw r28,XXX */
+ locals_size = (insn & 0xf) | ((insn & 0xc0) >> 2);
+ else if ((insn & 0xf0f0) == 0x50c0) /* subi r28,lo8(XX) */
+ {
+ locals_size = (insn & 0xf) | ((insn & 0xf00) >> 4);
+ insn = EXTRACT_INSN (&prologue[vpc]);
+ vpc += 2;
+ locals_size += ((insn & 0xf) | ((insn & 0xf00) >> 4) << 8);
+ }
+ else
+ return;
+ fi->extra_info->locals_size = locals_size;
+ fi->extra_info->framesize += locals_size;
+ }
+}
+
+/* This function actually figures out the frame address for a given pc and
+ sp. This is tricky because we sometimes don't use an explicit
+ frame pointer, and the previous stack pointer isn't necessarily recorded
+ on the stack. The only reliable way to get this info is to
+ examine the prologue. */
+
+static void
+avr_init_extra_frame_info (int fromleaf, struct frame_info *fi)
+{
+ int reg;
+
+ if (fi->next)
+ fi->pc = FRAME_SAVED_PC (fi->next);
+
+ fi->extra_info = (struct frame_extra_info *)
+ frame_obstack_alloc (sizeof (struct frame_extra_info));
+ frame_saved_regs_zalloc (fi);
+
+ fi->extra_info->return_pc = 0;
+ fi->extra_info->args_pointer = 0;
+ fi->extra_info->locals_size = 0;
+ fi->extra_info->framereg = 0;
+ fi->extra_info->framesize = 0;
+ fi->extra_info->is_main = 0;
+
+ avr_scan_prologue (fi);
+
+ if (PC_IN_CALL_DUMMY (fi->pc, fi->frame, fi->frame))
+ {
+ /* We need to setup fi->frame here because run_stack_dummy gets it wrong
+ by assuming it's always FP. */
+ fi->frame = generic_read_register_dummy (fi->pc, fi->frame, fi->frame);
+ }
+ else if (!fi->next) /* this is the innermost frame? */
+ fi->frame = read_register (fi->extra_info->framereg);
+ else if (fi->extra_info->is_main != 1) /* not the innermost frame, not `main' */
+ /* If we have an next frame, the callee saved it. */
+ {
+ struct frame_info *next_fi = fi->next;
+ if (fi->extra_info->framereg == AVR_SP_REGNUM)
+ fi->frame =
+ next_fi->frame + 2 /* ret addr */ + next_fi->extra_info->framesize;
+ /* FIXME: I don't analyse va_args functions */
+ else
+ {
+ CORE_ADDR fp = 0;
+ CORE_ADDR fp1 = 0;
+ unsigned int fp_low, fp_high;
+
+ /* Scan all frames */
+ for (; next_fi; next_fi = next_fi->next)
+ {
+ /* look for saved AVR_FP_REGNUM */
+ if (next_fi->saved_regs[AVR_FP_REGNUM] && !fp)
+ fp = next_fi->saved_regs[AVR_FP_REGNUM];
+ /* look for saved AVR_FP_REGNUM + 1 */
+ if (next_fi->saved_regs[AVR_FP_REGNUM + 1] && !fp1)
+ fp1 = next_fi->saved_regs[AVR_FP_REGNUM + 1];
+ }
+ fp_low = (fp ? read_memory_unsigned_integer (avr_make_saddr (fp), 1)
+ : read_register (AVR_FP_REGNUM)) & 0xff;
+ fp_high =
+ (fp1 ? read_memory_unsigned_integer (avr_make_saddr (fp1), 1) :
+ read_register (AVR_FP_REGNUM + 1)) & 0xff;
+ fi->frame = fp_low | (fp_high << 8);
+ }
+ }
+
+ /* TRoth: Do we want to do this if we are in main? I don't think we should
+ since return_pc makes no sense when we are in main. */
+
+ if ((fi->pc) && (fi->extra_info->is_main == 0)) /* We are not in CALL_DUMMY */
+ {
+ CORE_ADDR addr;
+ int i;
+
+ addr = fi->frame + fi->extra_info->framesize + 1;
+
+ /* Return address in stack in different endianness */
+
+ fi->extra_info->return_pc =
+ read_memory_unsigned_integer (avr_make_saddr (addr), 1) << 8;
+ fi->extra_info->return_pc |=
+ read_memory_unsigned_integer (avr_make_saddr (addr + 1), 1);
+
+ /* This return address in words,
+ must be converted to the bytes address */
+ fi->extra_info->return_pc *= 2;
+
+ /* Resolve a pushed registers addresses */
+ for (i = 0; i < NUM_REGS; i++)
+ {
+ if (fi->saved_regs[i])
+ fi->saved_regs[i] = addr - fi->saved_regs[i];
+ }
+ }
+}
+
+/* Restore the machine to the state it had before the current frame was
+ created. Usually used either by the "RETURN" command, or by
+ call_function_by_hand after the dummy_frame is finished. */
+
+static void
+avr_pop_frame (void)
+{
+ unsigned regnum;
+ CORE_ADDR saddr;
+ struct frame_info *frame = get_current_frame ();
+
+ if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
+ {
+ generic_pop_dummy_frame ();
+ }
+ else
+ {
+ /* TRoth: Why only loop over 8 registers? */
+
+ for (regnum = 0; regnum < 8; regnum++)
+ {
+ /* Don't forget AVR_SP_REGNUM in a frame_saved_regs struct is the
+ actual value we want, not the address of the value we want. */
+ if (frame->saved_regs[regnum] && regnum != AVR_SP_REGNUM)
+ {
+ saddr = avr_make_saddr (frame->saved_regs[regnum]);
+ write_register (regnum,
+ read_memory_unsigned_integer (saddr, 1));
+ }
+ else if (frame->saved_regs[regnum] && regnum == AVR_SP_REGNUM)
+ write_register (regnum, frame->frame + 2);
+ }
+
+ /* Don't forget the update the PC too! */
+ write_pc (frame->extra_info->return_pc);
+ }
+ flush_cached_frames ();
+}
+
+/* Return the saved PC from this frame. */
+
+static CORE_ADDR
+avr_frame_saved_pc (struct frame_info *frame)
+{
+ if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
+ return generic_read_register_dummy (frame->pc, frame->frame,
+ AVR_PC_REGNUM);
+ else
+ return frame->extra_info->return_pc;
+}
+
+static CORE_ADDR
+avr_saved_pc_after_call (struct frame_info *frame)
+{
+ unsigned char m1, m2;
+ unsigned int sp = read_register (AVR_SP_REGNUM);
+ m1 = read_memory_unsigned_integer (avr_make_saddr (sp + 1), 1);
+ m2 = read_memory_unsigned_integer (avr_make_saddr (sp + 2), 1);
+ return (m2 | (m1 << 8)) * 2;
+}
+
+/* Figure out where in REGBUF the called function has left its return value.
+ Copy that into VALBUF. */
+
+static void
+avr_extract_return_value (struct type *type, char *regbuf, char *valbuf)
+{
+ int wordsize, len;
+
+ wordsize = 2;
+
+ len = TYPE_LENGTH (type);
+
+ switch (len)
+ {
+ case 1: /* (char) */
+ case 2: /* (short), (int) */
+ memcpy (valbuf, regbuf + REGISTER_BYTE (24), 2);
+ break;
+ case 4: /* (long), (float) */
+ memcpy (valbuf, regbuf + REGISTER_BYTE (22), 4);
+ break;
+ case 8: /* (double) (doesn't seem to happen, which is good,
+ because this almost certainly isn't right. */
+ error ("I don't know how a double is returned.");
+ break;
+ }
+}
+
+/* Returns the return address for a dummy. */
+
+static CORE_ADDR
+avr_call_dummy_address (void)
+{
+ return entry_point_address ();
+}
+
+/* Place the appropriate value in the appropriate registers.
+ Primarily used by the RETURN command. */
+
+static void
+avr_store_return_value (struct type *type, char *valbuf)
+{
+ int wordsize, len, regval;
+
+ wordsize = 2;
+
+ len = TYPE_LENGTH (type);
+ switch (len)
+ {
+ case 1: /* char */
+ case 2: /* short, int */
+ regval = extract_address (valbuf, len);
+ write_register (0, regval);
+ break;
+ case 4: /* long, float */
+ regval = extract_address (valbuf, len);
+ write_register (0, regval >> 16);
+ write_register (1, regval & 0xffff);
+ break;
+ case 8: /* presumeably double, but doesn't seem to happen */
+ error ("I don't know how to return a double.");
+ break;
+ }
+}
+
+/* Setup the return address for a dummy frame, as called by
+ call_function_by_hand. Only necessary when you are using an empty
+ CALL_DUMMY. */
+
+static CORE_ADDR
+avr_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
+{
+ unsigned char buf[2];
+ int wordsize = 2;
+ struct minimal_symbol *msymbol;
+ CORE_ADDR mon_brk;
+
+ fprintf_unfiltered (gdb_stderr, "avr_push_return_address() was called\n");
+
+ buf[0] = 0;
+ buf[1] = 0;
+ sp -= wordsize;
+ write_memory (sp + 1, buf, 2);
+
+#if 0
+ /* FIXME: TRoth/2002-02-18: This should probably be removed since it's a
+ left-over from Denis' original patch which used avr-mon for the target
+ instead of the generic remote target. */
+ if ((strcmp (target_shortname, "avr-mon") == 0)
+ && (msymbol = lookup_minimal_symbol ("gdb_break", NULL, NULL)))
+ {
+ mon_brk = SYMBOL_VALUE_ADDRESS (msymbol);
+ store_unsigned_integer (buf, wordsize, mon_brk / 2);
+ sp -= wordsize;
+ write_memory (sp + 1, buf + 1, 1);
+ write_memory (sp + 2, buf, 1);
+ }
+#endif
+ return sp;
+}
+
+static CORE_ADDR
+avr_skip_prologue (CORE_ADDR pc)
+{
+ CORE_ADDR func_addr, func_end;
+ struct symtab_and_line sal;
+
+ /* See what the symbol table says */
+
+ if (find_pc_partial_function (pc, NULL, &func_addr, &func_end))
+ {
+ sal = find_pc_line (func_addr, 0);
+
+ if (sal.line != 0 && sal.end < func_end)
+ return sal.end;
+ }
+
+/* Either we didn't find the start of this function (nothing we can do),
+ or there's no line info, or the line after the prologue is after
+ the end of the function (there probably isn't a prologue). */
+
+ return pc;
+}
+
+static CORE_ADDR
+avr_frame_address (struct frame_info *fi)
+{
+ return avr_make_saddr (fi->frame);
+}
+
+/* Given a GDB frame, determine the address of the calling function's frame.
+ This will be used to create a new GDB frame struct, and then
+ INIT_EXTRA_FRAME_INFO and INIT_FRAME_PC will be called for the new frame.
+
+ For us, the frame address is its stack pointer value, so we look up
+ the function prologue to determine the caller's sp value, and return it. */
+
+static CORE_ADDR
+avr_frame_chain (struct frame_info *frame)
+{
+ if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
+ {
+ /* initialize the return_pc now */
+ frame->extra_info->return_pc = generic_read_register_dummy (frame->pc,
+ frame->
+ frame,
+ AVR_PC_REGNUM);
+ return frame->frame;
+ }
+ return (frame->extra_info->is_main ? 0
+ : frame->frame + frame->extra_info->framesize + 2 /* ret addr */ );
+}
+
+/* Store the address of the place in which to copy the structure the
+ subroutine will return. This is called from call_function.
+
+ We store structs through a pointer passed in the first Argument
+ register. */
+
+static void
+avr_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
+{
+ write_register (0, addr);
+}
+
+/* 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). */
+
+static CORE_ADDR
+avr_extract_struct_value_address (char *regbuf)
+{
+ return (extract_address ((regbuf) + REGISTER_BYTE (0),
+ REGISTER_RAW_SIZE (0)) | AVR_SMEM_START);
+}
+
+/* Setup the function arguments for calling a function in the inferior.
+
+ On the AVR architecture, there are 18 registers (R25 to R8) which are
+ dedicated for passing function arguments. Up to the first 18 arguments
+ (depending on size) may go into these registers. The rest go on the stack.
+
+ Arguments that are larger than WORDSIZE bytes will be split between two or
+ more registers as available, but will NOT be split between a register and
+ the stack.
+
+ An exceptional case exists for struct arguments (and possibly other
+ aggregates such as arrays) -- if the size is larger than WORDSIZE bytes but
+ not a multiple of WORDSIZE bytes. In this case the argument is never split
+ between the registers and the stack, but instead is copied in its entirety
+ onto the stack, AND also copied into as many registers as there is room
+ for. In other words, space in registers permitting, two copies of the same
+ argument are passed in. As far as I can tell, only the one on the stack is
+ used, although that may be a function of the level of compiler
+ optimization. I suspect this is a compiler bug. Arguments of these odd
+ sizes are left-justified within the word (as opposed to arguments smaller
+ than WORDSIZE bytes, which are right-justified).
+
+ If the function is to return an aggregate type such as a struct, the caller
+ must allocate space into which the callee will copy the return value. In
+ this case, a pointer to the return value location is passed into the callee
+ in register R0, which displaces one of the other arguments passed in via
+ registers R0 to R2. */
+
+static CORE_ADDR
+avr_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
+ int struct_return, CORE_ADDR struct_addr)
+{
+ int stack_alloc, stack_offset;
+ int wordsize;
+ int argreg;
+ int argnum;
+ struct type *type;
+ CORE_ADDR regval;
+ char *val;
+ char valbuf[4];
+ int len;
+
+ wordsize = 1;
+#if 0
+ /* Now make sure there's space on the stack */
+ for (argnum = 0, stack_alloc = 0; argnum < nargs; argnum++)
+ stack_alloc += TYPE_LENGTH (VALUE_TYPE (args[argnum]));
+ sp -= stack_alloc; /* make room on stack for args */
+ /* we may over-allocate a little here, but that won't hurt anything */
+#endif
+ argreg = 25;
+ if (struct_return) /* "struct return" pointer takes up one argreg */
+ {
+ write_register (--argreg, struct_addr);
+ }
+
+ /* Now load as many as possible of the first arguments into registers, and
+ push the rest onto the stack. There are 3N bytes in three registers
+ available. Loop thru args from first to last. */
+
+ for (argnum = 0, stack_offset = 0; argnum < nargs; argnum++)
+ {
+ type = VALUE_TYPE (args[argnum]);
+ len = TYPE_LENGTH (type);
+ val = (char *) VALUE_CONTENTS (args[argnum]);
+
+ /* NOTE WELL!!!!! This is not an "else if" clause!!! That's because
+ some *&^%$ things get passed on the stack AND in the registers! */
+ while (len > 0)
+ { /* there's room in registers */
+ len -= wordsize;
+ regval = extract_address (val + len, wordsize);
+ write_register (argreg--, regval);
+ }
+ }
+ return sp;
+}
+
+/* Initialize the gdbarch structure for the AVR's. */
+
+static struct gdbarch *
+avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
+{
+ /* FIXME: TRoth/2002-02-18: I have no idea if avr_call_dummy_words[] should
+ be bigger or not. Initial testing seems to show that `call my_func()`
+ works and backtrace from a breakpoint within the call looks correct.
+ Admittedly, I haven't tested with more than a very simple program. */
+ static LONGEST avr_call_dummy_words[] = { 0 };
+
+ struct gdbarch *gdbarch;
+ struct gdbarch_tdep *tdep;
+
+ /* Find a candidate among the list of pre-declared architectures. */
+ arches = gdbarch_list_lookup_by_info (arches, &info);
+ if (arches != NULL)
+ return arches->gdbarch;
+
+ /* None found, create a new architecture from the information provided. */
+ tdep = XMALLOC (struct gdbarch_tdep);
+ gdbarch = gdbarch_alloc (&info, tdep);
+
+ /* If we ever need to differentiate the device types, do it here. */
+ switch (info.bfd_arch_info->mach)
+ {
+ case bfd_mach_avr1:
+ case bfd_mach_avr2:
+ case bfd_mach_avr3:
+ case bfd_mach_avr4:
+ case bfd_mach_avr5:
+ break;
+ }
+
+ set_gdbarch_short_bit (gdbarch, 2 * TARGET_CHAR_BIT);
+ set_gdbarch_int_bit (gdbarch, 2 * TARGET_CHAR_BIT);
+ set_gdbarch_long_bit (gdbarch, 4 * TARGET_CHAR_BIT);
+ set_gdbarch_long_long_bit (gdbarch, 8 * TARGET_CHAR_BIT);
+ set_gdbarch_ptr_bit (gdbarch, 2 * TARGET_CHAR_BIT);
+ set_gdbarch_addr_bit (gdbarch, 32);
+ set_gdbarch_bfd_vma_bit (gdbarch, 32); /* FIXME: TRoth/2002-02-18: Is this needed? */
+
+ set_gdbarch_float_bit (gdbarch, 4 * TARGET_CHAR_BIT);
+ set_gdbarch_double_bit (gdbarch, 4 * TARGET_CHAR_BIT);
+ set_gdbarch_long_double_bit (gdbarch, 4 * TARGET_CHAR_BIT);
+
+ set_gdbarch_float_format (gdbarch, &floatformat_ieee_single_little);
+ set_gdbarch_double_format (gdbarch, &floatformat_ieee_single_little);
+ set_gdbarch_long_double_format (gdbarch, &floatformat_ieee_single_little);
+
+ set_gdbarch_read_pc (gdbarch, avr_read_pc);
+ set_gdbarch_write_pc (gdbarch, avr_write_pc);
+ set_gdbarch_read_fp (gdbarch, avr_read_fp);
+ set_gdbarch_read_sp (gdbarch, avr_read_sp);
+ set_gdbarch_write_sp (gdbarch, avr_write_sp);
+
+ set_gdbarch_num_regs (gdbarch, AVR_NUM_REGS);
+
+ set_gdbarch_sp_regnum (gdbarch, AVR_SP_REGNUM);
+ set_gdbarch_fp_regnum (gdbarch, AVR_FP_REGNUM);
+ set_gdbarch_pc_regnum (gdbarch, AVR_PC_REGNUM);
+
+ set_gdbarch_register_name (gdbarch, avr_register_name);
+ set_gdbarch_register_size (gdbarch, 1);
+ set_gdbarch_register_bytes (gdbarch, AVR_NUM_REG_BYTES);
+ set_gdbarch_register_byte (gdbarch, avr_register_byte);
+ set_gdbarch_register_raw_size (gdbarch, avr_register_raw_size);
+ set_gdbarch_max_register_raw_size (gdbarch, 4);
+ set_gdbarch_register_virtual_size (gdbarch, avr_register_virtual_size);
+ set_gdbarch_max_register_virtual_size (gdbarch, 4);
+ set_gdbarch_register_virtual_type (gdbarch, avr_register_virtual_type);
+
+ /* We might need to define our own here or define FRAME_INIT_SAVED_REGS */
+ set_gdbarch_get_saved_register (gdbarch, generic_get_saved_register);
+
+ set_gdbarch_print_insn (gdbarch, print_insn_avr);
+
+ set_gdbarch_use_generic_dummy_frames (gdbarch, 1);
+ set_gdbarch_call_dummy_location (gdbarch, AT_ENTRY_POINT);
+ set_gdbarch_call_dummy_address (gdbarch, avr_call_dummy_address);
+ set_gdbarch_call_dummy_start_offset (gdbarch, 0);
+ set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1);
+ set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0);
+ set_gdbarch_call_dummy_length (gdbarch, 0);
+ set_gdbarch_pc_in_call_dummy (gdbarch, generic_pc_in_call_dummy);
+ set_gdbarch_call_dummy_p (gdbarch, 1);
+ set_gdbarch_call_dummy_words (gdbarch, avr_call_dummy_words);
+ set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0);
+ set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy);
+
+/* set_gdbarch_believe_pcc_promotion (gdbarch, 1); // TRoth: should this be set? */
+
+ set_gdbarch_address_to_pointer (gdbarch, avr_address_to_pointer);
+ set_gdbarch_pointer_to_address (gdbarch, avr_pointer_to_address);
+ set_gdbarch_extract_return_value (gdbarch, avr_extract_return_value);
+ set_gdbarch_push_arguments (gdbarch, avr_push_arguments);
+ set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame);
+/* set_gdbarch_push_return_address (gdbarch, avr_push_return_address); */
+ set_gdbarch_pop_frame (gdbarch, avr_pop_frame);
+
+ set_gdbarch_store_return_value (gdbarch, avr_store_return_value);
+
+ set_gdbarch_use_struct_convention (gdbarch, generic_use_struct_convention);
+ set_gdbarch_store_struct_return (gdbarch, avr_store_struct_return);
+ set_gdbarch_extract_struct_value_address (gdbarch,
+ avr_extract_struct_value_address);
+
+ set_gdbarch_frame_init_saved_regs (gdbarch, avr_scan_prologue);
+ set_gdbarch_init_extra_frame_info (gdbarch, avr_init_extra_frame_info);
+ set_gdbarch_skip_prologue (gdbarch, avr_skip_prologue);
+/* set_gdbarch_prologue_frameless_p (gdbarch, avr_prologue_frameless_p); */
+ set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
+
+ set_gdbarch_decr_pc_after_break (gdbarch, 0);
+
+ set_gdbarch_function_start_offset (gdbarch, 0);
+ set_gdbarch_remote_translate_xfer_address (gdbarch,
+ avr_remote_translate_xfer_address);
+ set_gdbarch_frame_args_skip (gdbarch, 0);
+ set_gdbarch_frameless_function_invocation (gdbarch, frameless_look_for_prologue); /* ??? */
+ set_gdbarch_frame_chain (gdbarch, avr_frame_chain);
+ set_gdbarch_frame_chain_valid (gdbarch, generic_func_frame_chain_valid);
+ set_gdbarch_frame_saved_pc (gdbarch, avr_frame_saved_pc);
+ set_gdbarch_frame_args_address (gdbarch, avr_frame_address);
+ set_gdbarch_frame_locals_address (gdbarch, avr_frame_address);
+ set_gdbarch_saved_pc_after_call (gdbarch, avr_saved_pc_after_call);
+ set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);
+
+ set_gdbarch_convert_from_func_ptr_addr (gdbarch,
+ avr_convert_from_func_ptr_addr);
+
+ return gdbarch;
+}
+
+/* Send a query request to the avr remote target asking for values of the io
+ registers. If args parameter is not NULL, then the user has requested info
+ on a specific io register [This still needs implemented and is ignored for
+ now]. The query string should be one of these forms:
+
+ "Ravr.io_reg" -> reply is "NN" number of io registers
+
+ "Ravr.io_reg:addr,len" where addr is first register and len is number of
+ registers to be read. The reply should be "<NAME>,VV;" for each io register
+ where, <NAME> is a string, and VV is the hex value of the register.
+
+ All io registers are 8-bit. */
+
+static void
+avr_io_reg_read_command (char *args, int from_tty)
+{
+ int bufsiz = 0;
+ char buf[400];
+ char query[400];
+ char *p;
+ unsigned int nreg = 0;
+ unsigned int val;
+ int i, j, k, step;
+
+/* fprintf_unfiltered (gdb_stderr, "DEBUG: avr_io_reg_read_command (\"%s\", %d)\n", */
+/* args, from_tty); */
+
+ if (!current_target.to_query)
+ {
+ fprintf_unfiltered (gdb_stderr,
+ "ERR: info io_registers NOT supported by current target\n");
+ return;
+ }
+
+ /* Just get the maximum buffer size. */
+ target_query ((int) 'R', 0, 0, &bufsiz);
+ if (bufsiz > sizeof (buf))
+ bufsiz = sizeof (buf);
+
+ /* Find out how many io registers the target has. */
+ strcpy (query, "avr.io_reg");
+ target_query ((int) 'R', query, buf, &bufsiz);
+
+ if (strncmp (buf, "", bufsiz) == 0)
+ {
+ fprintf_unfiltered (gdb_stderr,
+ "info io_registers NOT supported by target\n");
+ return;
+ }
+
+ if (sscanf (buf, "%x", &nreg) != 1)
+ {
+ fprintf_unfiltered (gdb_stderr,
+ "Error fetching number of io registers\n");
+ return;
+ }
+
+ reinitialize_more_filter ();
+
+ printf_unfiltered ("Target has %u io registers:\n\n", nreg);
+
+ /* only fetch up to 8 registers at a time to keep the buffer small */
+ step = 8;
+
+ for (i = 0; i < nreg; i += step)
+ {
+ j = step - (nreg % step); /* how many registers this round? */
+
+ snprintf (query, sizeof (query) - 1, "avr.io_reg:%x,%x", i, j);
+ target_query ((int) 'R', query, buf, &bufsiz);
+
+ p = buf;
+ for (k = i; k < (i + j); k++)
+ {
+ if (sscanf (p, "%[^,],%x;", query, &val) == 2)
+ {
+ printf_filtered ("[%02x] %-15s : %02x\n", k, query, val);
+ while ((*p != ';') && (*p != '\0'))
+ p++;
+ p++; /* skip over ';' */
+ if (*p == '\0')
+ break;
+ }
+ }
+ }
+}
+
+void
+_initialize_avr_tdep (void)
+{
+ register_gdbarch_init (bfd_arch_avr, avr_gdbarch_init);
+
+ /* Add a new command to allow the user to query the avr remote target for
+ the values of the io space registers in a saner way than just using
+ `x/NNNb ADDR`. */
+
+ /* FIXME: TRoth/2002-02-18: This should probably be changed to 'info avr
+ io_registers' to signify it is not available on other platforms. */
+
+ add_cmd ("io_registers", class_info, avr_io_reg_read_command,
+ "query remote avr target for io space register values", &infolist);
+}
diff --git a/gdb/bcache.c b/gdb/bcache.c
index 753a916..73b86e8 100644
--- a/gdb/bcache.c
+++ b/gdb/bcache.c
@@ -1,7 +1,8 @@
/* Implement a cached obstack.
Written by Fred Fish <fnf@cygnus.com>
Rewritten by Jim Blandy <jimb@cygnus.com>
- Copyright 1999, 2000 Free Software Foundation, Inc.
+
+ Copyright 1999, 2000, 2002 Free Software Foundation, Inc.
This file is part of GDB.
@@ -20,14 +21,14 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include <stddef.h>
-#include <stdlib.h>
-
#include "defs.h"
#include "obstack.h"
#include "bcache.h"
#include "gdb_string.h" /* For memcpy declaration */
+#include <stddef.h>
+#include <stdlib.h>
+
/* The old hash function was stolen from SDBM. This is what DB 3.0 uses now,
* and is better than the old one.
*/
diff --git a/gdb/blockframe.c b/gdb/blockframe.c
index 1f10381..706d028 100644
--- a/gdb/blockframe.c
+++ b/gdb/blockframe.c
@@ -1,7 +1,9 @@
-/* Get info from stack frames;
- convert between frames, blocks, functions and pc values.
- Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
- 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+/* Get info from stack frames; convert between frames, blocks,
+ functions and pc values.
+
+ Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
+ 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software
+ Foundation, Inc.
This file is part of GDB.
@@ -225,7 +227,7 @@ create_new_frame (CORE_ADDR addr, CORE_ADDR pc)
fi->frame = addr;
fi->pc = pc;
find_pc_partial_function (pc, &name, (CORE_ADDR *) NULL, (CORE_ADDR *) NULL);
- fi->signal_handler_caller = IN_SIGTRAMP (fi->pc, name);
+ fi->signal_handler_caller = PC_IN_SIGTRAMP (fi->pc, name);
if (INIT_EXTRA_FRAME_INFO_P ())
INIT_EXTRA_FRAME_INFO (0, fi);
@@ -252,7 +254,7 @@ flush_cached_frames (void)
obstack_init (&frame_cache_obstack);
current_frame = NULL; /* Invalidate cache */
- select_frame (NULL, -1);
+ select_frame (NULL);
annotate_frames_invalid ();
}
@@ -266,7 +268,7 @@ reinit_frame_cache (void)
/* FIXME: The inferior_ptid test is wrong if there is a corefile. */
if (PIDGET (inferior_ptid) != 0)
{
- select_frame (get_current_frame (), 0);
+ select_frame (get_current_frame ());
}
}
@@ -301,12 +303,6 @@ frameless_look_for_prologue (struct frame_info *frame)
return 0;
}
-/* Default a few macros that people seldom redefine. */
-
-#ifndef FRAME_CHAIN_COMBINE
-#define FRAME_CHAIN_COMBINE(chain, thisframe) (chain)
-#endif
-
/* Return a structure containing various interesting information
about the frame that called NEXT_FRAME. Returns NULL
if there is no such frame. */
@@ -377,7 +373,6 @@ get_prev_frame (struct frame_info *next_frame)
address = FRAME_CHAIN (next_frame);
if (!FRAME_CHAIN_VALID (address, next_frame))
return 0;
- address = FRAME_CHAIN_COMBINE (address, next_frame);
}
if (address == 0)
return 0;
@@ -393,6 +388,7 @@ get_prev_frame (struct frame_info *next_frame)
next_frame->prev = prev;
prev->next = next_frame;
prev->frame = address;
+ prev->level = next_frame->level + 1;
/* This change should not be needed, FIXME! We should
determine whether any targets *need* INIT_FRAME_PC to happen
@@ -462,7 +458,7 @@ get_prev_frame (struct frame_info *next_frame)
find_pc_partial_function (prev->pc, &name,
(CORE_ADDR *) NULL, (CORE_ADDR *) NULL);
- if (IN_SIGTRAMP (prev->pc, name))
+ if (PC_IN_SIGTRAMP (prev->pc, name))
prev->signal_handler_caller = 1;
return prev;
@@ -504,10 +500,23 @@ get_frame_saved_regs (struct frame_info *frame,
#endif
/* Return the innermost lexical block in execution
- in a specified stack frame. The frame address is assumed valid. */
+ in a specified stack frame. The frame address is assumed valid.
+
+ If ADDR_IN_BLOCK is non-zero, set *ADDR_IN_BLOCK to the exact code
+ address we used to choose the block. We use this to find a source
+ line, to decide which macro definitions are in scope.
+
+ The value returned in *ADDR_IN_BLOCK isn't necessarily the frame's
+ PC, and may not really be a valid PC at all. For example, in the
+ caller of a function declared to never return, the code at the
+ return address will never be reached, so the call instruction may
+ be the very last instruction in the block. So the address we use
+ to choose the block is actually one byte before the return address
+ --- hopefully pointing us at the call instruction, or its delay
+ slot instruction. */
struct block *
-get_frame_block (struct frame_info *frame)
+get_frame_block (struct frame_info *frame, CORE_ADDR *addr_in_block)
{
CORE_ADDR pc;
@@ -520,13 +529,22 @@ get_frame_block (struct frame_info *frame)
after the call insn, we probably want to make frame->pc point after
the call insn anyway. */
--pc;
+
+ if (addr_in_block)
+ *addr_in_block = pc;
+
return block_for_pc (pc);
}
struct block *
-get_current_block (void)
+get_current_block (CORE_ADDR *addr_in_block)
{
- return block_for_pc (read_pc ());
+ CORE_ADDR pc = read_pc ();
+
+ if (addr_in_block)
+ *addr_in_block = pc;
+
+ return block_for_pc (pc);
}
CORE_ADDR
@@ -559,7 +577,7 @@ get_pc_function_start (CORE_ADDR pc)
struct symbol *
get_frame_function (struct frame_info *frame)
{
- register struct block *bl = get_frame_block (frame);
+ register struct block *bl = get_frame_block (frame, 0);
if (bl == 0)
return 0;
return block_function (bl);
@@ -729,7 +747,7 @@ find_pc_sect_partial_function (CORE_ADDR pc, asection *section, char **name,
/* If sigtramp is in the u area, it counts as a function (especially
important for step_1). */
#if defined SIGTRAMP_START
- if (IN_SIGTRAMP (mapped_pc, (char *) NULL))
+ if (PC_IN_SIGTRAMP (mapped_pc, (char *) NULL))
{
cache_pc_function_low = SIGTRAMP_START (mapped_pc);
cache_pc_function_high = SIGTRAMP_END (mapped_pc);
@@ -1052,42 +1070,59 @@ struct dummy_frame
CORE_ADDR sp;
CORE_ADDR top;
char *registers;
+
+ /* Address range of the call dummy code. Look for PC in the range
+ [LO..HI) (after allowing for DECR_PC_AFTER_BREAK). */
+ CORE_ADDR call_lo;
+ CORE_ADDR call_hi;
};
static struct dummy_frame *dummy_frame_stack = NULL;
/* Function: find_dummy_frame(pc, fp, sp)
- Search the stack of dummy frames for one matching the given PC, FP and SP.
- This is the work-horse for pc_in_call_dummy and read_register_dummy */
+
+ Search the stack of dummy frames for one matching the given PC, FP
+ and SP. Unlike PC_IN_CALL_DUMMY, this function doesn't need to
+ adjust for DECR_PC_AFTER_BREAK. This is because it is only legal
+ to call this function after the PC has been adjusted. */
char *
generic_find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp)
{
struct dummy_frame *dummyframe;
- if (pc != entry_point_address ())
- return 0;
-
for (dummyframe = dummy_frame_stack; dummyframe != NULL;
dummyframe = dummyframe->next)
- if (fp == dummyframe->fp
- || fp == dummyframe->sp
- || fp == dummyframe->top)
+ if ((pc >= dummyframe->call_lo && pc < dummyframe->call_hi)
+ && (fp == dummyframe->fp
+ || fp == dummyframe->sp
+ || fp == dummyframe->top))
/* The frame in question lies between the saved fp and sp, inclusive */
return dummyframe->registers;
return 0;
}
-/* Function: pc_in_call_dummy (pc, fp)
- Return true if this is a dummy frame created by gdb for an inferior call */
+/* Function: pc_in_call_dummy (pc, sp, fp)
+
+ Return true if the PC falls in a dummy frame created by gdb for an
+ inferior call. The code below which allows DECR_PC_AFTER_BREAK is
+ for infrun.c, which may give the function a PC without that
+ subtracted out. */
int
generic_pc_in_call_dummy (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR fp)
{
- /* if find_dummy_frame succeeds, then PC is in a call dummy */
- /* Note: SP and not FP is passed on. */
- return (generic_find_dummy_frame (pc, sp) != 0);
+ struct dummy_frame *dummyframe;
+ for (dummyframe = dummy_frame_stack;
+ dummyframe != NULL;
+ dummyframe = dummyframe->next)
+ {
+ if ((pc >= dummyframe->call_lo)
+ && (pc < dummyframe->call_hi + DECR_PC_AFTER_BREAK))
+ return 1;
+ }
+ return 0;
}
/* Function: read_register_dummy
@@ -1152,6 +1187,15 @@ generic_save_dummy_frame_tos (CORE_ADDR sp)
dummy_frame_stack->top = sp;
}
+/* Record the upper/lower bounds on the address of the call dummy. */
+
+void
+generic_save_call_dummy_addr (CORE_ADDR lo, CORE_ADDR hi)
+{
+ dummy_frame_stack->call_lo = lo;
+ dummy_frame_stack->call_hi = hi;
+}
+
/* Restore the machine state from either the saved dummy stack or a
real stack frame. */
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 640505e..6f604f1 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -217,6 +217,9 @@ extern int addressprint; /* Print machine addresses? */
/* Are we executing breakpoint commands? */
static int executing_breakpoint_commands;
+/* Are overlay event breakpoints enabled? */
+static int overlay_events_enabled;
+
/* Walk the following statement or block through all breakpoints.
ALL_BREAKPOINTS_SAFE does so even if the statment deletes the current
breakpoint. */
@@ -735,33 +738,65 @@ insert_breakpoints (void)
&& !b->inserted
&& !b->duplicate)
{
- if (b->type == bp_hardware_breakpoint)
- val = target_insert_hw_breakpoint (b->address, b->shadow_contents);
+ /* "Normal" instruction breakpoint: either the standard
+ trap-instruction bp (bp_breakpoint), or a
+ bp_hardware_breakpoint. */
+
+ /* First check to see if we have to handle an overlay. */
+ if (overlay_debugging == ovly_off
+ || b->section == NULL
+ || !(section_is_overlay (b->section)))
+ {
+ /* No overlay handling: just set the breakpoint. */
+
+ if (b->type == bp_hardware_breakpoint)
+ val = target_insert_hw_breakpoint (b->address,
+ b->shadow_contents);
+ else
+ val = target_insert_breakpoint (b->address, b->shadow_contents);
+ }
else
{
- /* Check to see if breakpoint is in an overlay section;
- if so, we should set the breakpoint at the LMA address.
- Only if the section is currently mapped should we ALSO
- set a break at the VMA address. */
- if (overlay_debugging && b->section
- && section_is_overlay (b->section))
+ /* This breakpoint is in an overlay section.
+ Shall we set a breakpoint at the LMA? */
+ if (!overlay_events_enabled)
+ {
+ /* Yes -- overlay event support is not active,
+ so we must try to set a breakpoint at the LMA.
+ This will not work for a hardware breakpoint. */
+ if (b->type == bp_hardware_breakpoint)
+ warning ("hardware breakpoint %d not supported in overlay!\n",
+ b->number);
+ else
+ {
+ CORE_ADDR addr = overlay_unmapped_address (b->address,
+ b->section);
+ /* Set a software (trap) breakpoint at the LMA. */
+ val = target_insert_breakpoint (addr, b->shadow_contents);
+ if (val != 0)
+ warning ("overlay breakpoint %d failed: in ROM?",
+ b->number);
+ }
+ }
+ /* Shall we set a breakpoint at the VMA? */
+ if (section_is_mapped (b->section))
{
- CORE_ADDR addr;
-
- addr = overlay_unmapped_address (b->address, b->section);
- val = target_insert_breakpoint (addr, b->shadow_contents);
- /* This would be the time to check val, to see if the
- breakpoint write to the load address succeeded.
- However, this might be an ordinary occurrance, eg. if
- the unmapped overlay is in ROM. */
- val = 0; /* in case unmapped address failed */
- if (section_is_mapped (b->section))
+ /* Yes. This overlay section is mapped into memory. */
+ if (b->type == bp_hardware_breakpoint)
+ val = target_insert_hw_breakpoint (b->address,
+ b->shadow_contents);
+ else
val = target_insert_breakpoint (b->address,
b->shadow_contents);
}
- else /* ordinary (non-overlay) address */
- val = target_insert_breakpoint (b->address, b->shadow_contents);
+ else
+ {
+ /* No. This breakpoint will not be inserted.
+ No error, but do not mark the bp as 'inserted'. */
+ continue;
+ }
}
+
if (val)
{
/* Can't set the breakpoint. */
@@ -866,7 +901,7 @@ insert_breakpoints (void)
/* Save the current frame and level so we can restore it after
evaluating the watchpoint expression on its own frame. */
saved_frame = selected_frame;
- saved_level = selected_frame_level;
+ saved_level = frame_relative_level (selected_frame);
/* Determine if the watchpoint is within scope. */
if (b->exp_valid_block == NULL)
@@ -883,7 +918,7 @@ insert_breakpoints (void)
fi = find_frame_addr_in_frame_chain (b->watchpoint_frame);
within_current_scope = (fi != NULL);
if (within_current_scope)
- select_frame (fi, -1);
+ select_frame (fi);
}
if (within_current_scope)
@@ -967,8 +1002,8 @@ insert_breakpoints (void)
/* Restore the frame and level. */
if ((saved_frame != selected_frame) ||
- (saved_level != selected_frame_level))
- select_frame (saved_frame, saved_level);
+ (saved_level != frame_relative_level (selected_frame)))
+ select_frame (saved_frame);
if (val)
return_val = val; /* remember failure */
@@ -1266,32 +1301,61 @@ remove_breakpoint (struct breakpoint *b, insertion_state_t is)
&& b->type != bp_catch_catch
&& b->type != bp_catch_throw)
{
- if (b->type == bp_hardware_breakpoint)
- val = target_remove_hw_breakpoint (b->address, b->shadow_contents);
+ /* "Normal" instruction breakpoint: either the standard
+ trap-instruction bp (bp_breakpoint), or a
+ bp_hardware_breakpoint. */
+
+ /* First check to see if we have to handle an overlay. */
+ if (overlay_debugging == ovly_off
+ || b->section == NULL
+ || !(section_is_overlay (b->section)))
+ {
+ /* No overlay handling: just remove the breakpoint. */
+
+ if (b->type == bp_hardware_breakpoint)
+ val = target_remove_hw_breakpoint (b->address,
+ b->shadow_contents);
+ else
+ val = target_remove_breakpoint (b->address, b->shadow_contents);
+ }
else
{
- /* Check to see if breakpoint is in an overlay section;
- if so, we should remove the breakpoint at the LMA address.
- If that is not equal to the raw address, then we should
- presumably remove the breakpoint there as well. */
- if (overlay_debugging && b->section
- && section_is_overlay (b->section))
+ /* This breakpoint is in an overlay section.
+ Did we set a breakpoint at the LMA? */
+ if (!overlay_events_enabled)
+ {
+ /* Yes -- overlay event support is not active, so we
+ should have set a breakpoint at the LMA. Remove it.
+ */
+ CORE_ADDR addr = overlay_unmapped_address (b->address,
+ b->section);
+ /* Ignore any failures: if the LMA is in ROM, we will
+ have already warned when we failed to insert it. */
+ if (b->type != bp_hardware_breakpoint)
+ target_remove_hw_breakpoint (addr, b->shadow_contents);
+ else
+ target_remove_breakpoint (addr, b->shadow_contents);
+ }
+ /* Did we set a breakpoint at the VMA?
+ If so, we will have marked the breakpoint 'inserted'. */
+ if (b->inserted)
{
- CORE_ADDR addr;
-
- addr = overlay_unmapped_address (b->address, b->section);
- val = target_remove_breakpoint (addr, b->shadow_contents);
- /* This would be the time to check val, to see if the
- shadow breakpoint write to the load address succeeded.
- However, this might be an ordinary occurrance, eg. if
- the unmapped overlay is in ROM. */
- val = 0; /* in case unmapped address failed */
- if (section_is_mapped (b->section))
+ /* Yes -- remove it. Previously we did not bother to
+ remove the breakpoint if the section had been
+ unmapped, but let's not rely on that being safe. We
+ don't know what the overlay manager might do. */
+ if (b->type == bp_hardware_breakpoint)
+ val = target_remove_hw_breakpoint (b->address,
+ b->shadow_contents);
+ else
val = target_remove_breakpoint (b->address,
b->shadow_contents);
}
- else /* ordinary (non-overlay) address */
- val = target_remove_breakpoint (b->address, b->shadow_contents);
+ else
+ {
+ /* No -- not inserted, so no need to remove. No error. */
+ val = 0;
+ }
}
if (val)
return val;
@@ -2270,7 +2334,7 @@ watchpoint_check (PTR p)
/* If we end up stopping, the current frame will get selected
in normal_stop. So this call to select_frame won't affect
the user. */
- select_frame (fr, -1);
+ select_frame (fr);
}
if (within_current_scope)
@@ -2398,9 +2462,15 @@ bpstat_stop_status (CORE_ADDR *pc, int not_a_breakpoint)
continue;
}
- if (b->type == bp_hardware_breakpoint
- && b->address != (*pc - DECR_PC_AFTER_HW_BREAK))
- continue;
+ if (b->type == bp_hardware_breakpoint)
+ {
+ if (b->address != (*pc - DECR_PC_AFTER_HW_BREAK))
+ continue;
+ if (overlay_debugging /* unmapped overlay section */
+ && section_is_overlay (b->section)
+ && !section_is_mapped (b->section))
+ continue;
+ }
/* Is this a catchpoint of a load or unload? If so, did we
get a load or unload of the specified library? If not,
@@ -2595,7 +2665,7 @@ bpstat_stop_status (CORE_ADDR *pc, int not_a_breakpoint)
{
/* Need to select the frame, with all that implies
so that the conditions will have the right context. */
- select_frame (get_current_frame (), 0);
+ select_frame (get_current_frame ());
value_is_zero
= catch_errors (breakpoint_cond_eval, (b->cond),
"Error in testing breakpoint condition:\n",
@@ -2780,7 +2850,7 @@ bpstat_what (bpstat bs)
/* step_resume entries: a step resume breakpoint overrides another
breakpoint of signal handling (see comment in wait_for_inferior
- at first IN_SIGTRAMP where we set the step_resume breakpoint). */
+ at first PC_IN_SIGTRAMP where we set the step_resume breakpoint). */
/* We handle the through_sigtramp_breakpoint the same way; having both
one of those and a step_resume_breakpoint is probably very rare (?). */
@@ -3824,9 +3894,15 @@ create_overlay_event_breakpoint (char *func_name)
b->addr_string = xstrdup (func_name);
if (overlay_debugging == ovly_auto)
- b->enable_state = bp_enabled;
+ {
+ b->enable_state = bp_enabled;
+ overlay_events_enabled = 1;
+ }
else
- b->enable_state = bp_disabled;
+ {
+ b->enable_state = bp_disabled;
+ overlay_events_enabled = 0;
+ }
}
void
@@ -3839,6 +3915,7 @@ enable_overlay_breakpoints (void)
{
b->enable_state = bp_enabled;
check_duplicates (b);
+ overlay_events_enabled = 1;
}
}
@@ -3852,6 +3929,7 @@ disable_overlay_breakpoints (void)
{
b->enable_state = bp_disabled;
check_duplicates (b);
+ overlay_events_enabled = 0;
}
}
@@ -5621,7 +5699,7 @@ get_catch_sals (int this_level_only)
but it's better than a core dump. */
if (selected_frame == NULL)
error ("No selected frame.");
- block = get_frame_block (selected_frame);
+ block = get_frame_block (selected_frame, 0);
pc = selected_frame->pc;
sals.nelts = 0;
@@ -6364,15 +6442,15 @@ tcatch_command (char *arg, int from_tty)
catch_command_1 (arg, 1, from_tty);
}
+/* Delete breakpoints by address or line. */
static void
clear_command (char *arg, int from_tty)
{
- register struct breakpoint *b, *b1;
+ struct breakpoint *b, *tmp, *prev, *found;
int default_match;
struct symtabs_and_lines sals;
struct symtab_and_line sal;
- register struct breakpoint *found;
int i;
if (arg)
@@ -6384,6 +6462,7 @@ clear_command (char *arg, int from_tty)
{
sals.sals = (struct symtab_and_line *)
xmalloc (sizeof (struct symtab_and_line));
+ make_cleanup (xfree, sals.sals);
INIT_SAL (&sal); /* initialize to zeroes */
sal.line = default_breakpoint_line;
sal.symtab = default_breakpoint_symtab;
@@ -6398,13 +6477,11 @@ clear_command (char *arg, int from_tty)
}
/* For each line spec given, delete bps which correspond
- to it. We do this in two loops: the first loop looks at
- the initial bp(s) in the chain which should be deleted,
- the second goes down the rest of the chain looking ahead
- one so it can take those bps off the chain without messing
- up the chain. */
-
+ to it. Do it in two passes, solely to preserve the current
+ behavior that from_tty is forced true if we delete more than
+ one breakpoint. */
+ found = NULL;
for (i = 0; i < sals.nelts; i++)
{
/* If exact pc given, clear bpts at that pc.
@@ -6420,81 +6497,75 @@ clear_command (char *arg, int from_tty)
1 0 <can't happen> */
sal = sals.sals[i];
- found = (struct breakpoint *) 0;
-
-
- while (breakpoint_chain
- /* Why don't we check here that this is not
- a watchpoint, etc., as we do below?
- I can't make it fail, but don't know
- what's stopping the failure: a watchpoint
- of the same address as "sal.pc" should
- wind up being deleted. */
-
- && (((sal.pc && (breakpoint_chain->address == sal.pc))
- && (!overlay_debugging
- || breakpoint_chain->section == sal.section))
- || ((default_match || (0 == sal.pc))
- && breakpoint_chain->source_file != NULL
- && sal.symtab != NULL
- && STREQ (breakpoint_chain->source_file, sal.symtab->filename)
- && breakpoint_chain->line_number == sal.line)))
+ prev = NULL;
+ /* Find all matching breakpoints, remove them from the
+ breakpoint chain, and add them to the 'found' chain. */
+ ALL_BREAKPOINTS_SAFE (b, tmp)
{
- b1 = breakpoint_chain;
- breakpoint_chain = b1->next;
- b1->next = found;
- found = b1;
- }
-
- ALL_BREAKPOINTS (b)
- while (b->next
- && b->next->type != bp_none
- && b->next->type != bp_watchpoint
- && b->next->type != bp_hardware_watchpoint
- && b->next->type != bp_read_watchpoint
- && b->next->type != bp_access_watchpoint
- && (((sal.pc && (b->next->address == sal.pc))
- && (!overlay_debugging || b->next->section == sal.section))
- || ((default_match || (0 == sal.pc))
- && b->next->source_file != NULL
- && sal.symtab != NULL
- && STREQ (b->next->source_file, sal.symtab->filename)
- && b->next->line_number == sal.line)))
-
-
- {
- b1 = b->next;
- b->next = b1->next;
- b1->next = found;
- found = b1;
- }
-
- if (found == 0)
- {
- if (arg)
- error ("No breakpoint at %s.", arg);
+ /* Are we going to delete b? */
+ if (b->type != bp_none
+ && b->type != bp_watchpoint
+ && b->type != bp_hardware_watchpoint
+ && b->type != bp_read_watchpoint
+ && b->type != bp_access_watchpoint
+ /* Not if b is a watchpoint of any sort... */
+ && (((sal.pc && (b->address == sal.pc))
+ && (!section_is_overlay (b->section)
+ || b->section == sal.section))
+ /* Yes, if sal.pc matches b (modulo overlays). */
+ || ((default_match || (0 == sal.pc))
+ && b->source_file != NULL
+ && sal.symtab != NULL
+ && STREQ (b->source_file, sal.symtab->filename)
+ && b->line_number == sal.line)))
+ /* Yes, if sal source file and line matches b. */
+ {
+ /* Remove it from breakpoint_chain... */
+ if (b == breakpoint_chain)
+ {
+ /* b is at the head of the list */
+ breakpoint_chain = b->next;
+ }
+ else
+ {
+ prev->next = b->next;
+ }
+ /* And add it to 'found' chain. */
+ b->next = found;
+ found = b;
+ }
else
- error ("No breakpoint at this line.");
+ {
+ /* Keep b, and keep a pointer to it. */
+ prev = b;
+ }
}
+ }
+ /* Now go thru the 'found' chain and delete them. */
+ if (found == 0)
+ {
+ if (arg)
+ error ("No breakpoint at %s.", arg);
+ else
+ error ("No breakpoint at this line.");
+ }
- if (found->next)
- from_tty = 1; /* Always report if deleted more than one */
- if (from_tty)
- printf_unfiltered ("Deleted breakpoint%s ", found->next ? "s" : "");
- breakpoints_changed ();
- while (found)
- {
- if (from_tty)
- printf_unfiltered ("%d ", found->number);
- b1 = found->next;
- delete_breakpoint (found);
- found = b1;
- }
+ if (found->next)
+ from_tty = 1; /* Always report if deleted more than one */
+ if (from_tty)
+ printf_unfiltered ("Deleted breakpoint%s ", found->next ? "s" : "");
+ breakpoints_changed ();
+ while (found)
+ {
if (from_tty)
- putchar_unfiltered ('\n');
+ printf_unfiltered ("%d ", found->number);
+ tmp = found->next;
+ delete_breakpoint (found);
+ found = tmp;
}
- xfree (sals.sals);
+ if (from_tty)
+ putchar_unfiltered ('\n');
}
/* Delete breakpoint in BS if they are `delete' breakpoints and
@@ -7211,8 +7282,8 @@ is valid is not currently in scope.\n", bpt->number);
}
save_selected_frame = selected_frame;
- save_selected_frame_level = selected_frame_level;
- select_frame (fr, -1);
+ save_selected_frame_level = frame_relative_level (selected_frame);
+ select_frame (fr);
}
value_free (bpt->val);
@@ -7247,7 +7318,7 @@ have been allocated for other watchpoints.\n", bpt->number);
}
if (save_selected_frame_level >= 0)
- select_frame (save_selected_frame, save_selected_frame_level);
+ select_frame (save_selected_frame);
value_free_to_mark (mark);
}
if (modify_breakpoint_hook)
@@ -7374,26 +7445,26 @@ then no output is printed when it is hit, except what the commands print.");
add_com ("condition", class_breakpoint, condition_command,
"Specify breakpoint number N to break only if COND is true.\n\
Usage is `condition N COND', where N is an integer and COND is an\n\
-expression to be evaluated whenever breakpoint N is reached. ");
+expression to be evaluated whenever breakpoint N is reached.");
c = add_com ("tbreak", class_breakpoint, tbreak_command,
"Set a temporary breakpoint. Args like \"break\" command.\n\
Like \"break\" except the breakpoint is only temporary,\n\
so it will be deleted when hit. Equivalent to \"break\" followed\n\
by using \"enable delete\" on the breakpoint number.");
- c->completer = location_completer;
+ set_cmd_completer (c, location_completer);
c = add_com ("hbreak", class_breakpoint, hbreak_command,
"Set a hardware assisted breakpoint. Args like \"break\" command.\n\
Like \"break\" except the breakpoint requires hardware support,\n\
some target hardware may not have this support.");
- c->completer = location_completer;
+ set_cmd_completer (c, location_completer);
c = add_com ("thbreak", class_breakpoint, thbreak_command,
"Set a temporary hardware assisted breakpoint. Args like \"break\" command.\n\
Like \"hbreak\" except the breakpoint is only temporary,\n\
so it will be deleted when hit.");
- c->completer = location_completer;
+ set_cmd_completer (c, location_completer);
add_prefix_cmd ("enable", class_breakpoint, enable_command,
"Enable some breakpoints.\n\
@@ -7507,7 +7578,7 @@ This is useful for breaking on return to a stack frame.\n\
Multiple breakpoints at one place are permitted, and useful if conditional.\n\
\n\
Do \"help breakpoints\" for info on other commands dealing with breakpoints.", NULL));
- c->completer = location_completer;
+ set_cmd_completer (c, location_completer);
add_com_alias ("b", "break", class_run, 1);
add_com_alias ("br", "break", class_run, 1);
@@ -7638,19 +7709,19 @@ by using \"enable delete\" on the catchpoint number.");
"Set a watchpoint for an expression.\n\
A watchpoint stops execution of your program whenever the value of\n\
an expression changes.");
- c->completer = location_completer;
+ set_cmd_completer (c, location_completer);
c = add_com ("rwatch", class_breakpoint, rwatch_command,
"Set a read watchpoint for an expression.\n\
A watchpoint stops execution of your program whenever the value of\n\
an expression is read.");
- c->completer = location_completer;
+ set_cmd_completer (c, location_completer);
c = add_com ("awatch", class_breakpoint, awatch_command,
"Set a watchpoint for an expression.\n\
A watchpoint stops execution of your program whenever the value of\n\
an expression is either read or written.");
- c->completer = location_completer;
+ set_cmd_completer (c, location_completer);
add_info ("watchpoints", breakpoints_info,
"Synonym for ``info breakpoints''.");
diff --git a/gdb/builtin-regs.c b/gdb/builtin-regs.c
new file mode 100644
index 0000000..f9a6781
--- /dev/null
+++ b/gdb/builtin-regs.c
@@ -0,0 +1,77 @@
+/* Builtin registers, for GDB, the GNU debugger.
+
+ Copyright 2002 Free Software Foundation, Inc.
+
+ Contributed by Red Hat.
+
+ 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 "builtin-regs.h"
+#include "gdbtypes.h"
+#include "gdb_string.h"
+#include "gdb_assert.h"
+
+/* Implement builtin register types. Builtin registers have regnum's
+ that live above of the range [0 .. NUM_REGS + NUM_PSEUDO_REGS)
+ (which is controlled by the target). The target should never see a
+ builtin register's regnum value. */
+
+/* An array of builtin registers. Always append, never delete. By
+ doing this, the relative regnum (offset from NUM_REGS +
+ NUM_PSEUDO_REGS) assigned to each builtin register never changes. */
+
+struct builtin_reg
+{
+ const char *name;
+ struct value *(*value) (struct frame_info * frame);
+};
+
+static struct builtin_reg *builtin_regs;
+int nr_builtin_regs;
+
+void
+add_builtin_reg (const char *name, struct value *(*value) (struct frame_info * frame))
+{
+ nr_builtin_regs++;
+ builtin_regs = xrealloc (builtin_regs,
+ nr_builtin_regs * sizeof (builtin_regs[0]));
+ builtin_regs[nr_builtin_regs - 1].name = name;
+ builtin_regs[nr_builtin_regs - 1].value = value;
+}
+
+int
+builtin_reg_map_name_to_regnum (const char *name, int len)
+{
+ int reg;
+ for (reg = 0; reg < nr_builtin_regs; reg++)
+ {
+ if (len == strlen (builtin_regs[reg].name)
+ && strncmp (builtin_regs[reg].name, name, len) == 0)
+ return NUM_REGS + NUM_PSEUDO_REGS + reg;
+ }
+ return -1;
+}
+
+struct value *
+value_of_builtin_reg (int regnum, struct frame_info *frame)
+{
+ int reg = regnum - NUM_REGS + NUM_PSEUDO_REGS;
+ gdb_assert (reg >= 0 && reg < nr_builtin_regs);
+ return builtin_regs[reg].value (frame);
+}
diff --git a/gdb/builtin-regs.h b/gdb/builtin-regs.h
new file mode 100644
index 0000000..b35c4e9
--- /dev/null
+++ b/gdb/builtin-regs.h
@@ -0,0 +1,35 @@
+/* Builtin registers, for GDB, the GNU debugger.
+
+ Copyright 2002 Free Software Foundation, Inc.
+
+ Contributed by Red Hat.
+
+ 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. */
+
+#ifndef BUILTIN_REGS_H
+#define BUILTIN_REGS_H
+
+extern int builtin_reg_map_name_to_regnum (const char *str, int len);
+
+extern struct value *value_of_builtin_reg (int regnum,
+ struct frame_info *frame);
+
+extern void add_builtin_reg (const char *name,
+ struct value *(value) (struct frame_info * frame));
+
+#endif
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index 3d2d1aa..a15a445 100644
--- a/gdb/c-exp.y
+++ b/gdb/c-exp.y
@@ -807,24 +807,52 @@ typebase /* Implements (approximately): (type-qualifier)* type-specifier */
{ $$ = builtin_type_short; }
| LONG INT_KEYWORD
{ $$ = builtin_type_long; }
+ | LONG SIGNED_KEYWORD INT_KEYWORD
+ { $$ = builtin_type_long; }
+ | LONG SIGNED_KEYWORD
+ { $$ = builtin_type_long; }
+ | SIGNED_KEYWORD LONG INT_KEYWORD
+ { $$ = builtin_type_long; }
| UNSIGNED LONG INT_KEYWORD
{ $$ = builtin_type_unsigned_long; }
+ | LONG UNSIGNED INT_KEYWORD
+ { $$ = builtin_type_unsigned_long; }
+ | LONG UNSIGNED
+ { $$ = builtin_type_unsigned_long; }
| LONG LONG
{ $$ = builtin_type_long_long; }
| LONG LONG INT_KEYWORD
{ $$ = builtin_type_long_long; }
+ | LONG LONG SIGNED_KEYWORD INT_KEYWORD
+ { $$ = builtin_type_long_long; }
+ | LONG LONG SIGNED_KEYWORD
+ { $$ = builtin_type_long_long; }
+ | SIGNED_KEYWORD LONG LONG
+ { $$ = builtin_type_long_long; }
| UNSIGNED LONG LONG
{ $$ = builtin_type_unsigned_long_long; }
| UNSIGNED LONG LONG INT_KEYWORD
{ $$ = builtin_type_unsigned_long_long; }
+ | LONG LONG UNSIGNED
+ { $$ = builtin_type_unsigned_long_long; }
+ | LONG LONG UNSIGNED INT_KEYWORD
+ { $$ = builtin_type_unsigned_long_long; }
| SIGNED_KEYWORD LONG LONG
{ $$ = lookup_signed_typename ("long long"); }
| SIGNED_KEYWORD LONG LONG INT_KEYWORD
{ $$ = lookup_signed_typename ("long long"); }
| SHORT INT_KEYWORD
{ $$ = builtin_type_short; }
+ | SHORT SIGNED_KEYWORD INT_KEYWORD
+ { $$ = builtin_type_short; }
+ | SHORT SIGNED_KEYWORD
+ { $$ = builtin_type_short; }
| UNSIGNED SHORT INT_KEYWORD
{ $$ = builtin_type_unsigned_short; }
+ | SHORT UNSIGNED
+ { $$ = builtin_type_unsigned_short; }
+ | SHORT UNSIGNED INT_KEYWORD
+ { $$ = builtin_type_unsigned_short; }
| DOUBLE_KEYWORD
{ $$ = builtin_type_double; }
| LONG DOUBLE_KEYWORD
@@ -1218,6 +1246,7 @@ yylex ()
retry:
+ prev_lexptr = lexptr;
unquoted_expr = 1;
tokstart = lexptr;
@@ -1738,5 +1767,8 @@ void
yyerror (msg)
char *msg;
{
+ if (prev_lexptr)
+ lexptr = prev_lexptr;
+
error ("A %s in expression, near `%s'.", (msg ? msg : "error"), lexptr);
}
diff --git a/gdb/c-lang.c b/gdb/c-lang.c
index fa977cd..f98548a 100644
--- a/gdb/c-lang.c
+++ b/gdb/c-lang.c
@@ -338,6 +338,30 @@ c_create_fundamental_type (struct objfile *objfile, int typeid)
TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT,
0, "long double", objfile);
break;
+ case FT_COMPLEX:
+ type = init_type (TYPE_CODE_FLT,
+ 2 * TARGET_FLOAT_BIT / TARGET_CHAR_BIT,
+ 0, "complex float", objfile);
+ TYPE_TARGET_TYPE (type)
+ = init_type (TYPE_CODE_FLT, TARGET_FLOAT_BIT / TARGET_CHAR_BIT,
+ 0, "float", objfile);
+ break;
+ case FT_DBL_PREC_COMPLEX:
+ type = init_type (TYPE_CODE_FLT,
+ 2 * TARGET_DOUBLE_BIT / TARGET_CHAR_BIT,
+ 0, "complex double", objfile);
+ TYPE_TARGET_TYPE (type)
+ = init_type (TYPE_CODE_FLT, TARGET_DOUBLE_BIT / TARGET_CHAR_BIT,
+ 0, "double", objfile);
+ break;
+ case FT_EXT_PREC_COMPLEX:
+ type = init_type (TYPE_CODE_FLT,
+ 2 * TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT,
+ 0, "complex long double", objfile);
+ TYPE_TARGET_TYPE (type)
+ = init_type (TYPE_CODE_FLT, TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT,
+ 0, "long double", objfile);
+ break;
case FT_TEMPLATE_ARG:
type = init_type (TYPE_CODE_TEMPLATE_ARG,
0,
diff --git a/gdb/cli-out.c b/gdb/cli-out.c
index 9bcfa46..bd079f2 100644
--- a/gdb/cli-out.c
+++ b/gdb/cli-out.c
@@ -1,5 +1,7 @@
/* Output generating routines for GDB CLI.
- Copyright 1999, 2000 Free Software Foundation, Inc.
+
+ Copyright 1999, 2000, 2002 Free Software Foundation, Inc.
+
Contributed by Cygnus Solutions.
Written by Fernando Nasser for Cygnus.
@@ -26,12 +28,6 @@
#include "gdb_string.h"
#include "gdb_assert.h"
-/* Convenience macro for allocting typesafe memory. */
-
-#ifndef XMALLOC
-#define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE))
-#endif
-
struct ui_out_data
{
struct ui_file *stream;
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index 16cc989..bcd9a42 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -80,6 +80,9 @@ static void shell_escape (char *, int);
void apropos_command (char *, int);
+/* Limit the call depth of user-defined commands */
+int max_user_call_depth;
+
/* Define all cmd_list_elements. */
/* Chain containing all defined commands. */
@@ -606,6 +609,8 @@ show_debug (char *args, int from_tty)
void
init_cmd_lists (void)
{
+ max_user_call_depth = 1024;
+
cmdlist = NULL;
infolist = NULL;
enablelist = NULL;
@@ -673,7 +678,7 @@ The commands below can be used to select other frames by number or address.",
"Set working directory to DIR for debugger and program being debugged.\n\
The change does not take effect for the program being debugged\n\
until the next time it is started.", &cmdlist);
- c->completer = filename_completer;
+ set_cmd_completer (c, filename_completer);
add_com ("echo", class_support, echo_command,
"Print a constant string. Give string as argument.\n\
@@ -698,11 +703,11 @@ Commands defined in this way may have up to ten arguments.");
"Read commands from a file named FILE.\n\
Note that the file \"" GDBINIT_FILENAME "\" is read automatically in this way\n\
when gdb is started.", &cmdlist);
- c->completer = filename_completer;
+ set_cmd_completer (c, filename_completer);
add_com ("quit", class_support, quit_command, "Exit gdb.");
c = add_com ("help", class_support, help_command, "Print list of commands.");
- c->completer = command_completer;
+ set_cmd_completer (c, command_completer);
add_com_alias ("q", "quit", class_support, 1);
add_com_alias ("h", "help", class_support, 1);
@@ -802,9 +807,9 @@ from the target.", &setlist),
&showdebuglist, "show debug ", 0, &showlist);
c = add_com ("shell", class_support, shell_escape,
- "Execute the rest of the line as a shell command. \n\
+ "Execute the rest of the line as a shell command.\n\
With no arguments, run an inferior shell.");
- c->completer = filename_completer;
+ set_cmd_completer (c, filename_completer);
/* NOTE: cagney/2000-03-20: Being able to enter ``(gdb) !ls'' would
be a really useful feature. Unfortunately, the below wont do
@@ -817,10 +822,17 @@ With no arguments, run an inferior shell.");
c = add_com ("make", class_support, make_command,
"Run the ``make'' program using the rest of the line as arguments.");
- c->completer = filename_completer;
+ set_cmd_completer (c, filename_completer);
add_cmd ("user", no_class, show_user,
"Show definitions of user defined commands.\n\
Argument is the name of the user defined command.\n\
With no argument, show definitions of all user defined commands.", &showlist);
add_com ("apropos", class_support, apropos_command, "Search for commands matching a REGEXP");
+
+ add_show_from_set (
+ add_set_cmd ("max-user-call-depth", no_class, var_integer,
+ (char *) &max_user_call_depth,
+ "Set the max call depth for user-defined commands.\n",
+ &setlist),
+ &showlist);
}
diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c
index a13b7b8..3f510ac 100644
--- a/gdb/cli/cli-decode.c
+++ b/gdb/cli/cli-decode.c
@@ -28,6 +28,8 @@
#include "cli/cli-cmds.h"
#include "cli/cli-decode.h"
+#include "gdb_assert.h"
+
/* Prototypes for local functions */
static void undef_cmd_error (char *, char *);
@@ -86,6 +88,31 @@ cmd_cfunc_eq (struct cmd_list_element *cmd,
return cmd->func == do_cfunc && cmd->function.cfunc == cfunc;
}
+void
+set_cmd_context (struct cmd_list_element *cmd, void *context)
+{
+ cmd->context = context;
+}
+
+void *
+get_cmd_context (struct cmd_list_element *cmd)
+{
+ return cmd->context;
+}
+
+enum cmd_types
+cmd_type (struct cmd_list_element *cmd)
+{
+ return cmd->type;
+}
+
+void
+set_cmd_completer (struct cmd_list_element *cmd,
+ char **(*completer) (char *text, char *word))
+{
+ cmd->completer = completer; /* Ok. */
+}
+
/* Add element named NAME.
CLASS is the top level category into which commands are broken down
@@ -133,6 +160,7 @@ add_cmd (char *name, enum command_class class, void (*fun) (char *, int),
c->name = name;
c->class = class;
set_cmd_cfunc (c, fun);
+ set_cmd_context (c, NULL);
c->doc = doc;
c->flags = 0;
c->replacement = NULL;
@@ -144,7 +172,7 @@ add_cmd (char *name, enum command_class class, void (*fun) (char *, int),
c->prefixname = NULL;
c->allow_unknown = 0;
c->abbrev_flag = 0;
- c->completer = make_symbol_completion_list;
+ set_cmd_completer (c, make_symbol_completion_list);
c->type = not_set_cmd;
c->var = NULL;
c->var_type = var_boolean;
@@ -272,24 +300,26 @@ empty_sfunc (char *args, int from_tty, struct cmd_list_element *c)
{
}
-/* Add element named NAME to command list LIST (the list for set
+/* Add element named NAME to command list LIST (the list for set/show
or some sublist thereof).
+ TYPE is set_cmd or show_cmd.
CLASS is as in add_cmd.
VAR_TYPE is the kind of thing we are setting.
VAR is address of the variable being controlled by this command.
DOC is the documentation string. */
-struct cmd_list_element *
-add_set_cmd (char *name,
- enum command_class class,
- var_types var_type,
- void *var,
- char *doc,
- struct cmd_list_element **list)
+static struct cmd_list_element *
+add_set_or_show_cmd (char *name,
+ enum cmd_types type,
+ enum command_class class,
+ var_types var_type,
+ void *var,
+ char *doc,
+ struct cmd_list_element **list)
{
struct cmd_list_element *c = add_cmd (name, class, NULL, doc, list);
-
- c->type = set_cmd;
+ gdb_assert (type == set_cmd || type == show_cmd);
+ c->type = type;
c->var_type = var_type;
c->var = var;
/* This needs to be something besides NULL so that this isn't
@@ -298,6 +328,18 @@ add_set_cmd (char *name,
return c;
}
+
+struct cmd_list_element *
+add_set_cmd (char *name,
+ enum command_class class,
+ var_types var_type,
+ void *var,
+ char *doc,
+ struct cmd_list_element **list)
+{
+ return add_set_or_show_cmd (name, set_cmd, class, var_type, var, doc, list);
+}
+
/* Add element named NAME to command list LIST (the list for set
or some sublist thereof).
CLASS is as in add_cmd.
@@ -360,44 +402,30 @@ add_set_boolean_cmd (char *name,
}
/* Where SETCMD has already been added, add the corresponding show
- command to LIST and return a pointer to the added command (not
+ command to LIST and return a pointer to the added command (not
necessarily the head of LIST). */
+/* NOTE: cagney/2002-03-17: The original version of add_show_from_set
+ used memcpy() to clone `set' into `show'. This ment that in
+ addition to all the needed fields (var, name, et.al.) some
+ unnecessary fields were copied (namely the callback function). The
+ function explictly copies relevant fields. For a `set' and `show'
+ command to share the same callback, the caller must set both
+ explicitly. */
struct cmd_list_element *
add_show_from_set (struct cmd_list_element *setcmd,
struct cmd_list_element **list)
{
- struct cmd_list_element *showcmd =
- (struct cmd_list_element *) xmalloc (sizeof (struct cmd_list_element));
- struct cmd_list_element *p;
+ char *doc;
+ const static char setstring[] = "Set ";
- memcpy (showcmd, setcmd, sizeof (struct cmd_list_element));
- delete_cmd (showcmd->name, list);
- showcmd->type = show_cmd;
+ /* Create a doc string by replacing "Set " at the start of the
+ `set'' command's doco with "Show ". */
+ gdb_assert (strncmp (setcmd->doc, setstring, sizeof (setstring) - 1) == 0);
+ doc = concat ("Show ", setcmd->doc + sizeof (setstring) - 1, NULL);
- /* Replace "set " at start of docstring with "show ". */
- if (setcmd->doc[0] == 'S' && setcmd->doc[1] == 'e'
- && setcmd->doc[2] == 't' && setcmd->doc[3] == ' ')
- showcmd->doc = concat ("Show ", setcmd->doc + 4, NULL);
- else
- fprintf_unfiltered (gdb_stderr, "GDB internal error: Bad docstring for set command\n");
-
- if (*list == NULL || strcmp ((*list)->name, showcmd->name) >= 0)
- {
- showcmd->next = *list;
- *list = showcmd;
- }
- else
- {
- p = *list;
- while (p->next && strcmp (p->next->name, showcmd->name) <= 0)
- {
- p = p->next;
- }
- showcmd->next = p->next;
- p->next = showcmd;
- }
-
- return showcmd;
+ /* Insert the basic command. */
+ return add_set_or_show_cmd (setcmd->name, show_cmd, setcmd->class,
+ setcmd->var_type, setcmd->var, doc, list);
}
/* Remove the command named NAME from the command list. */
@@ -645,14 +673,24 @@ help_list (struct cmd_list_element *list, char *cmdtype,
help_cmd_list (list, class, cmdtype, (int) class >= 0, stream);
if (class == all_classes)
- fprintf_filtered (stream, "\n\
-Type \"help%s\" followed by a class name for a list of commands in that class.",
- cmdtype1);
+ {
+ fprintf_filtered (stream, "\n\
+Type \"help%s\" followed by a class name for a list of commands in ",
+ cmdtype1);
+ wrap_here ("");
+ fprintf_filtered (stream, "that class.");
+ }
- fprintf_filtered (stream, "\n\
-Type \"help%s\" followed by %scommand name for full documentation.\n\
-Command name abbreviations are allowed if unambiguous.\n",
+ fprintf_filtered (stream, "\nType \"help%s\" followed by %scommand name ",
cmdtype1, cmdtype2);
+ wrap_here ("");
+ fputs_filtered ("for ", stream);
+ wrap_here ("");
+ fputs_filtered ("full ", stream);
+ wrap_here ("");
+ fputs_filtered ("documentation.\n", stream);
+ fputs_filtered ("Command name abbreviations are allowed if unambiguous.\n",
+ stream);
}
static void
@@ -949,7 +987,7 @@ undef_cmd_error (char *cmdtype, char *q)
cmdtype,
q,
*cmdtype ? " " : "",
- strlen (cmdtype) - 1,
+ (int) strlen (cmdtype) - 1,
cmdtype);
}
diff --git a/gdb/cli/cli-decode.h b/gdb/cli/cli-decode.h
index e4b7c55..72436f0 100644
--- a/gdb/cli/cli-decode.h
+++ b/gdb/cli/cli-decode.h
@@ -20,24 +20,11 @@
#define CLI_DECODE_H 1
#include "gdb_regex.h" /* Needed by apropos_cmd. */
+#include "command.h"
-/* Command classes are top-level categories into which commands are broken
- down for "help" purposes.
- Notes on classes: class_alias is for alias commands which are not
- abbreviations of the original command. class-pseudo is for
- commands which are not really commands nor help topics ("stop"). */
-
-enum command_class
-{
- /* Special args to help_list */
- class_deprecated, all_classes = -2, all_commands = -1,
- /* Classes of commands */
- no_class = -1, class_run = 0, class_vars, class_stack,
- class_files, class_support, class_info, class_breakpoint, class_trace,
- class_alias, class_obscure, class_user, class_maintenance,
- class_pseudo, class_tui, class_xdb
-};
-
+#if 0
+/* FIXME: cagney/2002-03-17: Once cmd_type() has been removed, ``enum
+ cmd_types'' can be moved from "command.h" to "cli-decode.h". */
/* Not a set/show command. Note that some commands which begin with
"set" or "show" might be in this category, if their syntax does
not fall into one of the following categories. */
@@ -48,55 +35,7 @@ typedef enum cmd_types
show_cmd
}
cmd_types;
-
-/* Reasonable values for an AUTO_BOOLEAN variable. */
-enum cmd_auto_boolean
-{
- CMD_AUTO_BOOLEAN_TRUE,
- CMD_AUTO_BOOLEAN_FALSE,
- CMD_AUTO_BOOLEAN_AUTO
-};
-
-/* Types of "set" or "show" command. */
-typedef enum var_types
- {
- /* "on" or "off". *VAR is an integer which is nonzero for on,
- zero for off. */
- var_boolean,
-
- /* "on" / "true" / "enable" or "off" / "false" / "disable" or
- "auto. *VAR is an ``enum cmd_auto_boolean''. NOTE: In general
- a custom show command will need to be implemented - one that
- for "auto" prints both the "auto" and the current auto-selected
- value. */
- var_auto_boolean,
-
- /* Unsigned Integer. *VAR is an unsigned int. The user can type 0
- to mean "unlimited", which is stored in *VAR as UINT_MAX. */
- var_uinteger,
-
- /* Like var_uinteger but signed. *VAR is an int. The user can type 0
- to mean "unlimited", which is stored in *VAR as INT_MAX. */
- var_integer,
-
- /* String which the user enters with escapes (e.g. the user types \n and
- it is a real newline in the stored string).
- *VAR is a malloc'd string, or NULL if the string is empty. */
- var_string,
- /* String which stores what the user types verbatim.
- *VAR is a malloc'd string, or NULL if the string is empty. */
- var_string_noescape,
- /* String which stores a filename.
- *VAR is a malloc'd string, or NULL if the string is empty. */
- var_filename,
- /* ZeroableInteger. *VAR is an int. Like Unsigned Integer except
- that zero really means zero. */
- var_zinteger,
- /* Enumerated type. Can only have one of the specified values. *VAR is a
- char pointer to the name of the element that we find. */
- var_enum
- }
-var_types;
+#endif
/* This structure records one command'd definition. */
@@ -139,6 +78,9 @@ struct cmd_list_element
}
function;
+ /* Local state (context) for this command. This can be anything. */
+ void *context;
+
/* Documentation of this command (or help topic).
First line is brief documentation; remaining lines form, with it,
the full documentation. First line should end with a period.
@@ -286,11 +228,18 @@ extern void set_cmd_sfunc (struct cmd_list_element *cmd,
void (*sfunc) (char *args, int from_tty,
struct cmd_list_element * c));
+extern void set_cmd_completer (struct cmd_list_element *cmd,
+ char **(*completer) (char *text, char *word));
+
/* HACK: cagney/2002-02-23: Code, mostly in tracepoints.c, grubs
around in cmd objects to test the value of the commands sfunc(). */
extern int cmd_cfunc_eq (struct cmd_list_element *cmd,
void (*cfunc) (char *args, int from_tty));
+/* Access to the command's local context. */
+extern void set_cmd_context (struct cmd_list_element *cmd, void *context);
+extern void *get_cmd_context (struct cmd_list_element *cmd);
+
extern struct cmd_list_element *lookup_cmd (char **,
struct cmd_list_element *, char *,
int, int);
diff --git a/gdb/cli/cli-dump.c b/gdb/cli/cli-dump.c
new file mode 100644
index 0000000..1edcfe2
--- /dev/null
+++ b/gdb/cli/cli-dump.c
@@ -0,0 +1,823 @@
+/* Dump-to-file commands, for GDB, the GNU debugger.
+
+ Copyright 2002 Free Software Foundation, Inc.
+
+ Contributed by Red Hat.
+
+ 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 "gdb_string.h"
+#include "cli/cli-decode.h"
+#include "cli/cli-cmds.h"
+#include "value.h"
+#include "completer.h"
+#include "cli/cli-dump.h"
+#include "gdb_assert.h"
+#include <ctype.h>
+#include "target.h"
+
+#define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
+
+
+char *
+skip_spaces (char *chp)
+{
+ if (chp == NULL)
+ return NULL;
+ while (isspace (*chp))
+ chp++;
+ return chp;
+}
+
+char *
+scan_expression_with_cleanup (char **cmd, const char *def)
+{
+ if ((*cmd) == NULL || (**cmd) == '\0')
+ {
+ char *exp = xstrdup (def);
+ make_cleanup (xfree, exp);
+ return exp;
+ }
+ else
+ {
+ char *exp;
+ char *end;
+
+ end = (*cmd) + strcspn (*cmd, " \t");
+ exp = savestring ((*cmd), end - (*cmd));
+ make_cleanup (xfree, exp);
+ (*cmd) = skip_spaces (end);
+ return exp;
+ }
+}
+
+
+static void
+do_fclose_cleanup (void *arg)
+{
+ FILE *file = arg;
+ fclose (arg);
+}
+
+static struct cleanup *
+make_cleanup_fclose (FILE *file)
+{
+ return make_cleanup (do_fclose_cleanup, file);
+}
+
+char *
+scan_filename_with_cleanup (char **cmd, const char *defname)
+{
+ char *filename;
+ char *fullname;
+
+ /* FIXME: Need to get the ``/a(ppend)'' flag from somewhere. */
+
+ /* File. */
+ if ((*cmd) == NULL)
+ {
+ if (defname == NULL)
+ error ("Missing filename.");
+ filename = xstrdup (defname);
+ make_cleanup (xfree, filename);
+ }
+ else
+ {
+ /* FIXME: should parse a possibly quoted string. */
+ char *end;
+
+ (*cmd) = skip_spaces (*cmd);
+ end = *cmd + strcspn (*cmd, " \t");
+ filename = savestring ((*cmd), end - (*cmd));
+ make_cleanup (xfree, filename);
+ (*cmd) = skip_spaces (end);
+ }
+ gdb_assert (filename != NULL);
+
+ fullname = tilde_expand (filename);
+ make_cleanup (xfree, fullname);
+
+ return fullname;
+}
+
+FILE *
+fopen_with_cleanup (char *filename, const char *mode)
+{
+ FILE *file = fopen (filename, mode);
+ if (file == NULL)
+ perror_with_name (filename);
+ make_cleanup_fclose (file);
+ return file;
+}
+
+static bfd *
+bfd_openr_with_cleanup (const char *filename, const char *target)
+{
+ bfd *ibfd;
+
+ if ((ibfd = bfd_openr (filename, target)) == NULL)
+ error ("Failed to open %s: %s.", filename,
+ bfd_errmsg (bfd_get_error ()));
+
+ make_cleanup_bfd_close (ibfd);
+ if (!bfd_check_format (ibfd, bfd_object))
+ error ("'%s' is not a recognized file format.", filename);
+
+ return ibfd;
+}
+
+static bfd *
+bfd_openw_with_cleanup (char *filename, const char *target, char *mode)
+{
+ bfd *obfd;
+
+ if (*mode == 'w') /* Write: create new file */
+ {
+ if ((obfd = bfd_openw (filename, target)) == NULL)
+ error ("Failed to open %s: %s.", filename,
+ bfd_errmsg (bfd_get_error ()));
+ make_cleanup_bfd_close (obfd);
+ if (!bfd_set_format (obfd, bfd_object))
+ error ("bfd_openw_with_cleanup: %s.", bfd_errmsg (bfd_get_error ()));
+ }
+ else if (*mode == 'a') /* Append to existing file */
+ { /* FIXME -- doesn't work... */
+ error ("bfd_openw does not work with append.");
+ }
+ else
+ error ("bfd_openw_with_cleanup: unknown mode %s.", mode);
+
+ return obfd;
+}
+
+struct cmd_list_element *dump_cmdlist;
+struct cmd_list_element *append_cmdlist;
+struct cmd_list_element *srec_cmdlist;
+struct cmd_list_element *ihex_cmdlist;
+struct cmd_list_element *tekhex_cmdlist;
+struct cmd_list_element *binary_dump_cmdlist;
+struct cmd_list_element *binary_append_cmdlist;
+
+static void
+dump_command (char *cmd, int from_tty)
+{
+ printf_unfiltered ("\"dump\" must be followed by a subcommand.\n\n");
+ help_list (dump_cmdlist, "dump ", -1, gdb_stdout);
+}
+
+static void
+append_command (char *cmd, int from_tty)
+{
+ printf_unfiltered ("\"append\" must be followed by a subcommand.\n\n");
+ help_list (dump_cmdlist, "append ", -1, gdb_stdout);
+}
+
+static void
+dump_binary_file (char *filename, char *mode,
+ char *buf, int len)
+{
+ FILE *file;
+ int status;
+
+ file = fopen_with_cleanup (filename, mode);
+ status = fwrite (buf, len, 1, file);
+ if (status != 1)
+ perror_with_name (filename);
+}
+
+static void
+dump_bfd_file (char *filename, char *mode,
+ char *target, CORE_ADDR vaddr,
+ char *buf, int len)
+{
+ bfd *obfd;
+ asection *osection;
+
+ obfd = bfd_openw_with_cleanup (filename, target, mode);
+ osection = bfd_make_section_anyway (obfd, ".newsec");
+ bfd_set_section_size (obfd, osection, len);
+ bfd_set_section_vma (obfd, osection, vaddr);
+ bfd_set_section_alignment (obfd, osection, 0);
+ bfd_set_section_flags (obfd, osection, 0x203);
+ osection->entsize = 0;
+ bfd_set_section_contents (obfd, osection, buf, 0, len);
+}
+
+static void
+dump_memory_to_file (char *cmd, char *mode, char *file_format)
+{
+ struct cleanup *old_cleanups = make_cleanup (null_cleanup, NULL);
+ CORE_ADDR lo;
+ CORE_ADDR hi;
+ ULONGEST count;
+ char *filename;
+ void *buf;
+ char *lo_exp;
+ char *hi_exp;
+ int len;
+
+ /* Open the file. */
+ filename = scan_filename_with_cleanup (&cmd, NULL);
+
+ /* Find the low address. */
+ if (cmd == NULL || *cmd == '\0')
+ error ("Missing start address.");
+ lo_exp = scan_expression_with_cleanup (&cmd, NULL);
+
+ /* Find the second address - rest of line. */
+ if (cmd == NULL || *cmd == '\0')
+ error ("Missing stop address.");
+ hi_exp = cmd;
+
+ lo = parse_and_eval_address (lo_exp);
+ hi = parse_and_eval_address (hi_exp);
+ if (hi <= lo)
+ error ("Invalid memory address range (start >= end).");
+ count = hi - lo;
+
+ /* FIXME: Should use read_memory_partial() and a magic blocking
+ value. */
+ buf = xmalloc (count);
+ make_cleanup (xfree, buf);
+ target_read_memory (lo, buf, count);
+
+ /* Have everything. Open/write the data. */
+ if (file_format == NULL || strcmp (file_format, "binary") == 0)
+ {
+ dump_binary_file (filename, mode, buf, count);
+ }
+ else
+ {
+ dump_bfd_file (filename, mode, file_format, lo, buf, count);
+ }
+
+ do_cleanups (old_cleanups);
+}
+
+static void
+dump_memory_command (char *cmd, char *mode)
+{
+ dump_memory_to_file (cmd, mode, "binary");
+}
+
+static void
+dump_value_to_file (char *cmd, char *mode, char *file_format)
+{
+ struct cleanup *old_cleanups = make_cleanup (null_cleanup, NULL);
+ struct value *val;
+ char *filename;
+
+ /* Open the file. */
+ filename = scan_filename_with_cleanup (&cmd, NULL);
+
+ /* Find the value. */
+ if (cmd == NULL || *cmd == '\0')
+ error ("No value to %s.", *mode == 'a' ? "append" : "dump");
+ val = parse_and_eval (cmd);
+ if (val == NULL)
+ error ("Invalid expression.");
+
+ /* Have everything. Open/write the data. */
+ if (file_format == NULL || strcmp (file_format, "binary") == 0)
+ {
+ dump_binary_file (filename, mode, VALUE_CONTENTS (val),
+ TYPE_LENGTH (VALUE_TYPE (val)));
+ }
+ else
+ {
+ CORE_ADDR vaddr;
+
+ if (VALUE_LVAL (val))
+ {
+ vaddr = VALUE_ADDRESS (val);
+ }
+ else
+ {
+ vaddr = 0;
+ warning ("value is not an lval: address assumed to be zero");
+ }
+
+ dump_bfd_file (filename, mode, file_format, vaddr,
+ VALUE_CONTENTS (val),
+ TYPE_LENGTH (VALUE_TYPE (val)));
+ }
+
+ do_cleanups (old_cleanups);
+}
+
+static void
+dump_value_command (char *cmd, char *mode)
+{
+ dump_value_to_file (cmd, mode, "binary");
+}
+
+static void
+dump_filetype (char *cmd, char *mode, char *filetype)
+{
+ char *suffix = cmd;
+
+ if (cmd == NULL || *cmd == '\0')
+ error ("Missing subcommand: try 'help %s %s'.",
+ mode[0] == 'a' ? "append" : "dump",
+ filetype);
+
+ suffix += strcspn (cmd, " \t");
+
+ if (suffix != cmd)
+ {
+ if (strncmp ("memory", cmd, suffix - cmd) == 0)
+ {
+ dump_memory_to_file (suffix, mode, filetype);
+ return;
+ }
+ else if (strncmp ("value", cmd, suffix - cmd) == 0)
+ {
+ dump_value_to_file (suffix, mode, filetype);
+ return;
+ }
+ }
+
+ error ("dump %s: unknown subcommand '%s' -- try 'value' or 'memory'.",
+ filetype, cmd);
+}
+
+static void
+dump_srec_memory (char *args, int from_tty)
+{
+ dump_memory_to_file (args, "w", "srec");
+}
+
+static void
+dump_srec_value (char *args, int from_tty)
+{
+ dump_value_to_file (args, "w", "srec");
+}
+
+static void
+dump_ihex_memory (char *args, int from_tty)
+{
+ dump_memory_to_file (args, "w", "ihex");
+}
+
+static void
+dump_ihex_value (char *args, int from_tty)
+{
+ dump_value_to_file (args, "w", "ihex");
+}
+
+static void
+dump_tekhex_memory (char *args, int from_tty)
+{
+ dump_memory_to_file (args, "w", "tekhex");
+}
+
+static void
+dump_tekhex_value (char *args, int from_tty)
+{
+ dump_value_to_file (args, "w", "tekhex");
+}
+
+static void
+dump_binary_memory (char *args, int from_tty)
+{
+ dump_memory_to_file (args, "w", "binary");
+}
+
+static void
+dump_binary_value (char *args, int from_tty)
+{
+ dump_value_to_file (args, "w", "binary");
+}
+
+static void
+append_binary_memory (char *args, int from_tty)
+{
+ dump_memory_to_file (args, "a", "binary");
+}
+
+static void
+append_binary_value (char *args, int from_tty)
+{
+ dump_value_to_file (args, "a", "binary");
+}
+
+struct dump_context
+{
+ void (*func) (char *cmd, char *mode);
+ char *mode;
+};
+
+static void
+call_dump_func (struct cmd_list_element *c, char *args, int from_tty)
+{
+ struct dump_context *d = get_cmd_context (c);
+ d->func (args, d->mode);
+}
+
+void
+add_dump_command (char *name, void (*func) (char *args, char *mode),
+ char *descr)
+
+{
+ struct cmd_list_element *c;
+ struct dump_context *d;
+
+ c = add_cmd (name, all_commands, NULL, descr, &dump_cmdlist);
+ c->completer = filename_completer;
+ d = XMALLOC (struct dump_context);
+ d->func = func;
+ d->mode = "w";
+ set_cmd_context (c, d);
+ c->func = call_dump_func;
+
+ c = add_cmd (name, all_commands, NULL, descr, &append_cmdlist);
+ c->completer = filename_completer;
+ d = XMALLOC (struct dump_context);
+ d->func = func;
+ d->mode = "a";
+ set_cmd_context (c, d);
+ c->func = call_dump_func;
+
+ /* Replace "Dump " at start of docstring with "Append "
+ (borrowed from add_show_from_set). */
+ if ( c->doc[0] == 'W'
+ && c->doc[1] == 'r'
+ && c->doc[2] == 'i'
+ && c->doc[3] == 't'
+ && c->doc[4] == 'e'
+ && c->doc[5] == ' ')
+ c->doc = concat ("Append ", c->doc + 6, NULL);
+}
+
+/* Opaque data for restore_section_callback. */
+struct callback_data {
+ unsigned long load_offset;
+ CORE_ADDR load_start;
+ CORE_ADDR load_end;
+};
+
+/* Function: restore_section_callback.
+
+ Callback function for bfd_map_over_sections.
+ Selectively loads the sections into memory. */
+
+static void
+restore_section_callback (bfd *ibfd, asection *isec, void *args)
+{
+ struct callback_data *data = args;
+ bfd_vma sec_start = bfd_section_vma (ibfd, isec);
+ bfd_size_type size = bfd_section_size (ibfd, isec);
+ bfd_vma sec_end = sec_start + size;
+ bfd_size_type sec_offset = 0;
+ bfd_size_type sec_load_count = size;
+ struct cleanup *old_chain;
+ char *buf;
+ int ret;
+
+ /* Ignore non-loadable sections, eg. from elf files. */
+ if (!(bfd_get_section_flags (ibfd, isec) & SEC_LOAD))
+ return;
+
+ /* Does the section overlap with the desired restore range? */
+ if (sec_end <= data->load_start
+ || (data->load_end > 0 && sec_start >= data->load_end))
+ {
+ /* No, no useable data in this section. */
+ printf_filtered ("skipping section %s...\n",
+ bfd_section_name (ibfd, isec));
+ return;
+ }
+
+ /* Compare section address range with user-requested
+ address range (if any). Compute where the actual
+ transfer should start and end. */
+ if (sec_start < data->load_start)
+ sec_offset = data->load_start - sec_start;
+ /* Size of a partial transfer: */
+ sec_load_count -= sec_offset;
+ if (data->load_end > 0 && sec_end > data->load_end)
+ sec_load_count -= sec_end - data->load_end;
+
+ /* Get the data. */
+ buf = xmalloc (size);
+ old_chain = make_cleanup (xfree, buf);
+ if (!bfd_get_section_contents (ibfd, isec, buf, 0, size))
+ error ("Failed to read bfd file %s: '%s'.", bfd_get_filename (ibfd),
+ bfd_errmsg (bfd_get_error ()));
+
+ printf_filtered ("Restoring section %s (0x%lx to 0x%lx)",
+ bfd_section_name (ibfd, isec),
+ (unsigned long) sec_start,
+ (unsigned long) sec_end);
+
+ if (data->load_offset != 0 || data->load_start != 0 || data->load_end != 0)
+ printf_filtered (" into memory (0x%s to 0x%s)\n",
+ paddr_nz ((unsigned long) sec_start
+ + sec_offset + data->load_offset),
+ paddr_nz ((unsigned long) sec_start + sec_offset
+ + data->load_offset + sec_load_count));
+ else
+ puts_filtered ("\n");
+
+ /* Write the data. */
+ ret = target_write_memory (sec_start + sec_offset + data->load_offset,
+ buf + sec_offset, sec_load_count);
+ if (ret != 0)
+ warning ("restore: memory write failed (%s).", safe_strerror (ret));
+ do_cleanups (old_chain);
+ return;
+}
+
+static void
+restore_binary_file (char *filename, struct callback_data *data)
+{
+ FILE *file = fopen_with_cleanup (filename, "r");
+ int status;
+ char *buf;
+ long len;
+
+ /* Get the file size for reading. */
+ if (fseek (file, 0, SEEK_END) == 0)
+ len = ftell (file);
+ else
+ perror_with_name (filename);
+
+ if (len <= data->load_start)
+ error ("Start address is greater than length of binary file %s.",
+ filename);
+
+ /* Chop off "len" if it exceeds the requested load_end addr. */
+ if (data->load_end != 0 && data->load_end < len)
+ len = data->load_end;
+ /* Chop off "len" if the requested load_start addr skips some bytes. */
+ if (data->load_start > 0)
+ len -= data->load_start;
+
+ printf_filtered
+ ("Restoring binary file %s into memory (0x%lx to 0x%lx)\n",
+ filename,
+ (unsigned long) data->load_start + data->load_offset,
+ (unsigned long) data->load_start + data->load_offset + len);
+
+ /* Now set the file pos to the requested load start pos. */
+ if (fseek (file, data->load_start, SEEK_SET) != 0)
+ perror_with_name (filename);
+
+ /* Now allocate a buffer and read the file contents. */
+ buf = xmalloc (len);
+ make_cleanup (xfree, buf);
+ if (fread (buf, 1, len, file) != len)
+ perror_with_name (filename);
+
+ /* Now write the buffer into target memory. */
+ len = target_write_memory (data->load_start + data->load_offset, buf, len);
+ if (len != 0)
+ warning ("restore: memory write failed (%s).", safe_strerror (len));
+ return;
+}
+
+static void
+restore_command (char *args, int from_tty)
+{
+ char *filename;
+ struct callback_data data;
+ bfd *ibfd;
+ int binary_flag = 0;
+
+ if (!target_has_execution)
+ noprocess ();
+
+ data.load_offset = 0;
+ data.load_start = 0;
+ data.load_end = 0;
+
+ /* Parse the input arguments. First is filename (required). */
+ filename = scan_filename_with_cleanup (&args, NULL);
+ if (args != NULL && *args != '\0')
+ {
+ char *binary_string = "binary";
+
+ /* Look for optional "binary" flag. */
+ if (strncmp (args, binary_string, strlen (binary_string)) == 0)
+ {
+ binary_flag = 1;
+ args += strlen (binary_string);
+ args = skip_spaces (args);
+ }
+ /* Parse offset (optional). */
+ if (args != NULL && *args != '\0')
+ data.load_offset =
+ parse_and_eval_address (scan_expression_with_cleanup (&args,
+ NULL));
+ if (args != NULL && *args != '\0')
+ {
+ /* Parse start address (optional). */
+ data.load_start =
+ parse_and_eval_address (scan_expression_with_cleanup (&args,
+ NULL));
+ if (args != NULL && *args != '\0')
+ {
+ /* Parse end address (optional). */
+ data.load_end = parse_and_eval_address (args);
+ if (data.load_end <= data.load_start)
+ error ("Start must be less than end.");
+ }
+ }
+ }
+
+ if (info_verbose)
+ printf_filtered ("Restore file %s offset 0x%lx start 0x%lx end 0x%lx\n",
+ filename, (unsigned long) data.load_offset,
+ (unsigned long) data.load_start,
+ (unsigned long) data.load_end);
+
+ if (binary_flag)
+ {
+ restore_binary_file (filename, &data);
+ }
+ else
+ {
+ /* Open the file for loading. */
+ ibfd = bfd_openr_with_cleanup (filename, NULL);
+
+ /* Process the sections. */
+ bfd_map_over_sections (ibfd, restore_section_callback, &data);
+ }
+ return;
+}
+
+static void
+srec_dump_command (char *cmd, int from_tty)
+{
+ printf_unfiltered ("\"dump srec\" must be followed by a subcommand.\n");
+ help_list (srec_cmdlist, "dump srec ", -1, gdb_stdout);
+}
+
+static void
+ihex_dump_command (char *cmd, int from_tty)
+{
+ printf_unfiltered ("\"dump ihex\" must be followed by a subcommand.\n");
+ help_list (ihex_cmdlist, "dump ihex ", -1, gdb_stdout);
+}
+
+static void
+tekhex_dump_command (char *cmd, int from_tty)
+{
+ printf_unfiltered ("\"dump tekhex\" must be followed by a subcommand.\n");
+ help_list (tekhex_cmdlist, "dump tekhex ", -1, gdb_stdout);
+}
+
+static void
+binary_dump_command (char *cmd, int from_tty)
+{
+ printf_unfiltered ("\"dump binary\" must be followed by a subcommand.\n");
+ help_list (binary_dump_cmdlist, "dump binary ", -1, gdb_stdout);
+}
+
+static void
+binary_append_command (char *cmd, int from_tty)
+{
+ printf_unfiltered ("\"append binary\" must be followed by a subcommand.\n");
+ help_list (binary_append_cmdlist, "append binary ", -1, gdb_stdout);
+}
+
+void
+_initialize_cli_dump (void)
+{
+ struct cmd_list_element *c;
+ add_prefix_cmd ("dump", class_vars, dump_command, "\
+Dump target code/data to a local file.",
+ &dump_cmdlist, "dump ",
+ 0/*allow-unknown*/,
+ &cmdlist);
+ add_prefix_cmd ("append", class_vars, append_command, "\
+Append target code/data to a local file.",
+ &append_cmdlist, "append ",
+ 0/*allow-unknown*/,
+ &cmdlist);
+
+ add_dump_command ("memory", dump_memory_command, "\
+Write contents of memory to a raw binary file.\n\
+Arguments are FILE START STOP. Writes the contents of memory within the\n\
+range [START .. STOP) to the specifed FILE in raw target ordered bytes.");
+
+ add_dump_command ("value", dump_value_command, "\
+Write the value of an expression to a raw binary file.\n\
+Arguments are FILE EXPRESSION. Writes the value of EXPRESSION to\n\
+the specified FILE in raw target ordered bytes.");
+
+ add_prefix_cmd ("srec", all_commands, srec_dump_command, "\
+Write target code/data to an srec file.",
+ &srec_cmdlist, "dump srec ",
+ 0 /*allow-unknown*/,
+ &dump_cmdlist);
+
+ add_prefix_cmd ("ihex", all_commands, ihex_dump_command, "\
+Write target code/data to an intel hex file.",
+ &ihex_cmdlist, "dump ihex ",
+ 0 /*allow-unknown*/,
+ &dump_cmdlist);
+
+ add_prefix_cmd ("tekhex", all_commands, tekhex_dump_command, "\
+Write target code/data to a tekhex file.",
+ &tekhex_cmdlist, "dump tekhex ",
+ 0 /*allow-unknown*/,
+ &dump_cmdlist);
+
+ add_prefix_cmd ("binary", all_commands, binary_dump_command, "\
+Write target code/data to a raw binary file.",
+ &binary_dump_cmdlist, "dump binary ",
+ 0 /*allow-unknown*/,
+ &dump_cmdlist);
+
+ add_prefix_cmd ("binary", all_commands, binary_append_command, "\
+Append target code/data to a raw binary file.",
+ &binary_append_cmdlist, "append binary ",
+ 0 /*allow-unknown*/,
+ &append_cmdlist);
+
+ add_cmd ("memory", all_commands, dump_srec_memory, "\
+Write contents of memory to an srec file.\n\
+Arguments are FILE START STOP. Writes the contents of memory\n\
+within the range [START .. STOP) to the specifed FILE in srec format.",
+ &srec_cmdlist);
+
+ add_cmd ("value", all_commands, dump_srec_value, "\
+Write the value of an expression to an srec file.\n\
+Arguments are FILE EXPRESSION. Writes the value of EXPRESSION\n\
+to the specified FILE in srec format.",
+ &srec_cmdlist);
+
+ add_cmd ("memory", all_commands, dump_ihex_memory, "\
+Write contents of memory to an ihex file.\n\
+Arguments are FILE START STOP. Writes the contents of memory within\n\
+the range [START .. STOP) to the specifed FILE in intel hex format.",
+ &ihex_cmdlist);
+
+ add_cmd ("value", all_commands, dump_ihex_value, "\
+Write the value of an expression to an ihex file.\n\
+Arguments are FILE EXPRESSION. Writes the value of EXPRESSION\n\
+to the specified FILE in intel hex format.",
+ &ihex_cmdlist);
+
+ add_cmd ("memory", all_commands, dump_tekhex_memory, "\
+Write contents of memory to a tekhex file.\n\
+Arguments are FILE START STOP. Writes the contents of memory\n\
+within the range [START .. STOP) to the specifed FILE in tekhex format.",
+ &tekhex_cmdlist);
+
+ add_cmd ("value", all_commands, dump_tekhex_value, "\
+Write the value of an expression to a tekhex file.\n\
+Arguments are FILE EXPRESSION. Writes the value of EXPRESSION\n\
+to the specified FILE in tekhex format.",
+ &tekhex_cmdlist);
+
+ add_cmd ("memory", all_commands, dump_binary_memory, "\
+Write contents of memory to a raw binary file.\n\
+Arguments are FILE START STOP. Writes the contents of memory\n\
+within the range [START .. STOP) to the specifed FILE in binary format.",
+ &binary_dump_cmdlist);
+
+ add_cmd ("value", all_commands, dump_binary_value, "\
+Write the value of an expression to a raw binary file.\n\
+Arguments are FILE EXPRESSION. Writes the value of EXPRESSION\n\
+to the specified FILE in raw target ordered bytes.",
+ &binary_dump_cmdlist);
+
+ add_cmd ("memory", all_commands, append_binary_memory, "\
+Append contents of memory to a raw binary file.\n\
+Arguments are FILE START STOP. Writes the contents of memory within the\n\
+range [START .. STOP) to the specifed FILE in raw target ordered bytes.",
+ &binary_append_cmdlist);
+
+ add_cmd ("value", all_commands, append_binary_value, "\
+Append the value of an expression to a raw binary file.\n\
+Arguments are FILE EXPRESSION. Writes the value of EXPRESSION\n\
+to the specified FILE in raw target ordered bytes.",
+ &binary_append_cmdlist);
+
+ c = add_com ("restore", class_vars, restore_command,
+ "Restore the contents of FILE to target memory.\n\
+Arguments are FILE OFFSET START END where all except FILE are optional.\n\
+OFFSET will be added to the base address of the file (default zero).\n\
+If START and END are given, only the file contents within that range\n\
+(file relative) will be restored to target memory.");
+ c->completer = filename_completer;
+ /* FIXME: completers for other commands. */
+}
diff --git a/gdb/cli/cli-dump.h b/gdb/cli/cli-dump.h
new file mode 100644
index 0000000..187e0e0
--- /dev/null
+++ b/gdb/cli/cli-dump.h
@@ -0,0 +1,40 @@
+/* Dump-to-file commands, for GDB, the GNU debugger.
+
+ Copyright 2001 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. */
+
+#ifndef CLI_DUMP_H
+#define CLI_DUMP_H
+
+extern void add_dump_command (char *name,
+ void (*func) (char *args, char *mode),
+ char *descr);
+
+/* Utilities for doing the dump. */
+extern char *scan_filename_with_cleanup (char **cmd, const char *defname);
+
+extern char *scan_expression_with_cleanup (char **cmd, const char *defname);
+
+extern FILE *fopen_with_cleanup (char *filename, const char *mode);
+
+extern char *skip_spaces (char *inp);
+
+extern struct value *parse_and_eval_with_error (char *exp, const char *fmt, ...) ATTR_FORMAT (printf, 2, 3);
+
+#endif
diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c
index 4545117..fc3261c 100644
--- a/gdb/cli/cli-script.c
+++ b/gdb/cli/cli-script.c
@@ -213,7 +213,49 @@ print_command_lines (struct ui_out *uiout, struct command_line *cmd,
} /* while (list) */
}
+/* Handle pre-post hooks. */
+
+void
+clear_hook_in_cleanup (void *data)
+{
+ struct cmd_list_element *c = data;
+ c->hook_in = 0; /* Allow hook to work again once it is complete */
+}
+
+void
+execute_cmd_pre_hook (struct cmd_list_element *c)
+{
+ if ((c->hook_pre) && (!c->hook_in))
+ {
+ struct cleanup *cleanups = make_cleanup (clear_hook_in_cleanup, c);
+ c->hook_in = 1; /* Prevent recursive hooking */
+ execute_user_command (c->hook_pre, (char *) 0);
+ do_cleanups (cleanups);
+ }
+}
+
+void
+execute_cmd_post_hook (struct cmd_list_element *c)
+{
+ if ((c->hook_post) && (!c->hook_in))
+ {
+ struct cleanup *cleanups = make_cleanup (clear_hook_in_cleanup, c);
+ c->hook_in = 1; /* Prevent recursive hooking */
+ execute_user_command (c->hook_post, (char *) 0);
+ do_cleanups (cleanups);
+ }
+}
+
/* Execute the command in CMD. */
+void
+do_restore_user_call_depth (void * call_depth)
+{
+ int * depth = call_depth;
+ /* We will be returning_to_top_level() at this point, so we want to
+ reset our depth. */
+ (*depth) = 0;
+}
+
void
execute_user_command (struct cmd_list_element *c, char *args)
@@ -221,6 +263,8 @@ execute_user_command (struct cmd_list_element *c, char *args)
register struct command_line *cmdlines;
struct cleanup *old_chain;
enum command_control_type ret;
+ static int user_call_depth = 0;
+ extern int max_user_call_depth;
old_chain = setup_user_args (args);
@@ -229,6 +273,11 @@ execute_user_command (struct cmd_list_element *c, char *args)
/* Null command */
return;
+ if (++user_call_depth > max_user_call_depth)
+ error ("Max user call depth exceeded -- command aborted\n");
+
+ old_chain = make_cleanup (do_restore_user_call_depth, &user_call_depth);
+
/* Set the instream to 0, indicating execution of a
user-defined function. */
old_chain = make_cleanup (do_restore_instream_cleanup, instream);
@@ -244,6 +293,8 @@ execute_user_command (struct cmd_list_element *c, char *args)
cmdlines = cmdlines->next;
}
do_cleanups (old_chain);
+
+ user_call_depth--;
}
enum command_control_type
diff --git a/gdb/command.h b/gdb/command.h
index 7c20a42..db7a740 100644
--- a/gdb/command.h
+++ b/gdb/command.h
@@ -1,13 +1,7 @@
-/* ***DEPRECATED*** The gdblib files must not be calling/using things in any
- of the possible command languages. If necessary, a hook (that may be
- present or not) must be used and set to the appropriate routine by any
- command language that cares about it. If you are having to include this
- file you are possibly doing things the old way. This file will disapear.
- 2000-12-01 fnasser@redhat.com */
-
/* Header file for command-reading library command.c.
- Copyright 1986, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1999, 2000
- Free Software Foundation, Inc.
+
+ Copyright 1986, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1999,
+ 2000, 2002 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
@@ -44,6 +38,8 @@ enum command_class
class_pseudo, class_tui, class_xdb
};
+/* FIXME: cagney/2002-03-17: Once cmd_type() has been removed, ``enum
+ cmd_types'' can be moved from "command.h" to "cli-decode.h". */
/* Not a set/show command. Note that some commands which begin with
"set" or "show" might be in this category, if their syntax does
not fall into one of the following categories. */
@@ -105,156 +101,7 @@ typedef enum var_types
var_types;
/* This structure records one command'd definition. */
-
-
-/* This flag is used by the code executing commands to warn the user
- the first time a deprecated command is used, see the 'flags' field in
- the following struct.
-*/
-#define CMD_DEPRECATED 0x1
-#define DEPRECATED_WARN_USER 0x2
-#define MALLOCED_REPLACEMENT 0x4
-
-struct cmd_list_element
- {
- /* Points to next command in this list. */
- struct cmd_list_element *next;
-
- /* Name of this command. */
- char *name;
-
- /* Command class; class values are chosen by application program. */
- enum command_class class;
-
- /* Function definition of this command. NULL for command class
- names and for help topics that are not really commands. NOTE:
- cagney/2002-02-02: This function signature is evolving. For
- the moment suggest sticking with either set_cmd_cfunc() or
- set_cmd_sfunc(). */
- void (*func) (struct cmd_list_element *c, char *args, int from_tty);
- /* The command's real callback. At present func() bounces through
- to one of the below. */
- union
- {
- /* If type is not_set_cmd, call it like this: */
- void (*cfunc) (char *args, int from_tty);
-
- /* If type is set_cmd or show_cmd, first set the variables, and
- then call this. */
- void (*sfunc) (char *args, int from_tty, struct cmd_list_element * c);
- }
- function;
-
- /* Documentation of this command (or help topic).
- First line is brief documentation; remaining lines form, with it,
- the full documentation. First line should end with a period.
- Entire string should also end with a period, not a newline. */
- char *doc;
-
- /* flags : a bitfield
-
- bit 0: (LSB) CMD_DEPRECATED, when 1 indicated that this command
- is deprecated. It may be removed from gdb's command set in the
- future.
-
- bit 1: DEPRECATED_WARN_USER, the user needs to be warned that
- this is a deprecated command. The user should only be warned
- the first time a command is used.
-
- bit 2: MALLOCED_REPLACEMENT, when functions are deprecated at
- compile time (this is the way it should, in general, be done)
- the memory containing the replacement string is statically
- allocated. In some cases it makes sense to deprecate commands
- at runtime (the testsuite is one example). In this case the
- memory for replacement is malloc'ed. When a command is
- undeprecated or re-deprecated at runtime we don't want to risk
- calling free on statically allocated memory, so we check this
- flag.
- */
- int flags;
-
- /* if this command is deprecated, this is the replacement name */
- char *replacement;
-
- /* If this command represents a show command, then this function
- is called before the variable's value is examined. */
- void (*pre_show_hook) (struct cmd_list_element *c);
-
- /* Hook for another command to be executed before this command. */
- struct cmd_list_element *hook_pre;
-
- /* Hook for another command to be executed after this command. */
- struct cmd_list_element *hook_post;
-
- /* Flag that specifies if this command is already running it's hook. */
- /* Prevents the possibility of hook recursion. */
- int hook_in;
-
- /* Nonzero identifies a prefix command. For them, the address
- of the variable containing the list of subcommands. */
- struct cmd_list_element **prefixlist;
-
- /* For prefix commands only:
- String containing prefix commands to get here: this one
- plus any others needed to get to it. Should end in a space.
- It is used before the word "command" in describing the
- commands reached through this prefix. */
- char *prefixname;
-
- /* For prefix commands only:
- nonzero means do not get an error if subcommand is not
- recognized; call the prefix's own function in that case. */
- char allow_unknown;
-
- /* Nonzero says this is an abbreviation, and should not
- be mentioned in lists of commands.
- This allows "br<tab>" to complete to "break", which it
- otherwise wouldn't. */
- char abbrev_flag;
-
- /* Completion routine for this command. TEXT is the text beyond
- what was matched for the command itself (leading whitespace is
- skipped). It stops where we are supposed to stop completing
- (rl_point) and is '\0' terminated.
-
- Return value is a malloc'd vector of pointers to possible completions
- terminated with NULL. If there are no completions, returning a pointer
- to a NULL would work but returning NULL itself is also valid.
- WORD points in the same buffer as TEXT, and completions should be
- returned relative to this position. For example, suppose TEXT is "foo"
- and we want to complete to "foobar". If WORD is "oo", return
- "oobar"; if WORD is "baz/foo", return "baz/foobar". */
- char **(*completer) (char *text, char *word);
-
- /* Type of "set" or "show" command (or SET_NOT_SET if not "set"
- or "show"). */
- cmd_types type;
-
- /* Pointer to variable affected by "set" and "show". Doesn't matter
- if type is not_set. */
- void *var;
-
- /* What kind of variable is *VAR? */
- var_types var_type;
-
- /* Pointer to NULL terminated list of enumerated values (like argv). */
- const char **enums;
-
- /* Pointer to command strings of user-defined commands */
- struct command_line *user_commands;
-
- /* Pointer to command that is hooked by this one, (by hook_pre)
- so the hook can be removed when this one is deleted. */
- struct cmd_list_element *hookee_pre;
-
- /* Pointer to command that is hooked by this one, (by hook_post)
- so the hook can be removed when this one is deleted. */
- struct cmd_list_element *hookee_post;
-
- /* Pointer to command that is aliased by this one, so the
- aliased command can be located in case it has been hooked. */
- struct cmd_list_element *cmd_pointer;
- };
+struct cmd_list_element;
/* Forward-declarations of the entry-points of cli/cli-decode.c. */
@@ -292,11 +139,37 @@ extern void set_cmd_sfunc (struct cmd_list_element *cmd,
void (*sfunc) (char *args, int from_tty,
struct cmd_list_element * c));
+extern void set_cmd_completer (struct cmd_list_element *cmd,
+ char **(*completer) (char *text, char *word));
+
/* HACK: cagney/2002-02-23: Code, mostly in tracepoints.c, grubs
around in cmd objects to test the value of the commands sfunc(). */
extern int cmd_cfunc_eq (struct cmd_list_element *cmd,
void (*cfunc) (char *args, int from_tty));
+/* Each command object has a local context attached to it. . */
+extern void set_cmd_context (struct cmd_list_element *cmd, void *context);
+extern void *get_cmd_context (struct cmd_list_element *cmd);
+
+
+/* Execute CMD's pre/post hook. Throw an error if the command fails.
+ If already executing this pre/post hook, or there is no pre/post
+ hook, the call is silently ignored. */
+extern void execute_cmd_pre_hook (struct cmd_list_element *cmd);
+extern void execute_cmd_post_hook (struct cmd_list_element *cmd);
+
+/* Return the type of the command. */
+/* NOTE: cagney/2002-03-17: The add_show_from_set() function clones
+ the set command passed as a parameter. The clone operation will
+ include (BUG?) any ``set'' command callback, if present. Commands
+ like ``info set'' call all the ``show'' command callbacks.
+ Unfortunatly, for ``show'' commands cloned from ``set'', this
+ includes callbacks belonging to ``set'' commands. Making this
+ worse, this only occures if add_show_from_set() is called after
+ add_cmd_sfunc() (BUG?). */
+extern enum cmd_types cmd_type (struct cmd_list_element *cmd);
+
+
extern struct cmd_list_element *lookup_cmd (char **,
struct cmd_list_element *, char *,
int, int);
diff --git a/gdb/completer.c b/gdb/completer.c
index 30a84d6..67ea300 100644
--- a/gdb/completer.c
+++ b/gdb/completer.c
@@ -24,6 +24,8 @@
#include "expression.h"
#include "filenames.h" /* for DOSish file names */
+#include "cli/cli-decode.h"
+
/* FIXME: This is needed because of lookup_cmd_1().
We should be calling a hook instead so we eliminate the CLI dependency. */
#include "gdbcmd.h"
diff --git a/gdb/config.in b/gdb/config.in
index f2bab55..750a8ae 100644
--- a/gdb/config.in
+++ b/gdb/config.in
@@ -93,6 +93,9 @@
/* Define if <sys/link.h> has struct link_map32 */
#undef HAVE_STRUCT_LINK_MAP32
+/* Define if <sys/link.h> has link_map32 (solaris sparc-64 target) */
+#undef _SYSCALL32
+
/* Define if the prfpregset_t type is broken. */
#undef PRFPREGSET_T_BROKEN
@@ -457,6 +460,9 @@
/* Define if strstr is not declared in system header files. */
#undef NEED_DECLARATION_STRSTR
+/* Define if canonicalize_file_name is not declared in system header files. */
+#undef NEED_DECLARATION_CANONICALIZE_FILE_NAME
+
/* Define if <sys/procfs.h> has pstatus_t. */
#undef HAVE_PSTATUS_T
diff --git a/gdb/config/a29k/a29k-udi.mt b/gdb/config/a29k/a29k-udi.mt
deleted file mode 100644
index 6fe45b0..0000000
--- a/gdb/config/a29k/a29k-udi.mt
+++ /dev/null
@@ -1,5 +0,0 @@
-# OBSOLETE # Target: AMD 29000 on EB29K board over a serial line
-# OBSOLETE TDEPFILES= a29k-tdep.o remote-udi.o udip2soc.o udr.o udi2go32.o
-# OBSOLETE TM_FILE= tm-a29k.h
-# OBSOLETE
-# OBSOLETE MT_CFLAGS = $(HOST_IPC)
diff --git a/gdb/config/a29k/a29k.mt b/gdb/config/a29k/a29k.mt
deleted file mode 100644
index b235c05..0000000
--- a/gdb/config/a29k/a29k.mt
+++ /dev/null
@@ -1,5 +0,0 @@
-# OBSOLETE # Target: AMD 29000
-# OBSOLETE TDEPFILES= a29k-tdep.o remote-eb.o remote-adapt.o
-# OBSOLETE TM_FILE= tm-a29k.h
-# OBSOLETE
-# OBSOLETE MT_CFLAGS = -DNO_HIF_SUPPORT
diff --git a/gdb/config/a29k/tm-a29k.h b/gdb/config/a29k/tm-a29k.h
deleted file mode 100644
index c296f59..0000000
--- a/gdb/config/a29k/tm-a29k.h
+++ /dev/null
@@ -1,722 +0,0 @@
-/* OBSOLETE /* Parameters for target machine AMD 29000, for GDB, the GNU debugger. */
-/* OBSOLETE Copyright 1990, 1991, 1993, 1994, 1995, 1996, 1998, 1999, 2000, */
-/* OBSOLETE 2001 Free Software Foundation, Inc. */
-/* OBSOLETE Contributed by Cygnus Support. Written by Jim Kingdon. */
-/* 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. */ */
-/* OBSOLETE */
-/* OBSOLETE #include "regcache.h" */
-/* OBSOLETE */
-/* OBSOLETE /* Parameters for an EB29K (a board which plugs into a PC and is */
-/* OBSOLETE accessed through EBMON software running on the PC, which we */
-/* OBSOLETE use as we'd use a remote stub (see remote-eb.c). */
-/* OBSOLETE */
-/* OBSOLETE If gdb is ported to other a29k machines/systems, the */
-/* OBSOLETE machine/system-specific parts should be removed from this file (a */
-/* OBSOLETE la tm-m68k.h). */ */
-/* OBSOLETE */
-/* OBSOLETE /* Byte order is configurable, but this machine runs big-endian. */ */
-/* OBSOLETE #define TARGET_BYTE_ORDER BFD_ENDIAN_BIG */
-/* OBSOLETE */
-/* OBSOLETE /* Floating point uses IEEE representations. */ */
-/* OBSOLETE #define IEEE_FLOAT (1) */
-/* OBSOLETE */
-/* OBSOLETE /* Recognize our magic number. */ */
-/* OBSOLETE #define BADMAG(x) ((x).f_magic != 0572) */
-/* OBSOLETE */
-/* OBSOLETE /* Offset from address of function to start of its code. */
-/* OBSOLETE Zero on most machines. */ */
-/* OBSOLETE */
-/* OBSOLETE #define FUNCTION_START_OFFSET 0 */
-/* OBSOLETE */
-/* OBSOLETE /* Advance PC across any function entry prologue instructions */
-/* OBSOLETE to reach some "real" code. */ */
-/* OBSOLETE */
-/* OBSOLETE #define SKIP_PROLOGUE(pc) (a29k_skip_prologue (pc)) */
-/* OBSOLETE CORE_ADDR a29k_skip_prologue (); */
-/* OBSOLETE */
-/* OBSOLETE /* Immediately after a function call, return the saved pc. */
-/* OBSOLETE Can't 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. */ */
-/* OBSOLETE */
-/* OBSOLETE #define SAVED_PC_AFTER_CALL(frame) ((frame->flags & TRANSPARENT_FRAME) \ */
-/* OBSOLETE ? read_register (TPC_REGNUM) \ */
-/* OBSOLETE : read_register (LR0_REGNUM)) */
-/* OBSOLETE */
-/* OBSOLETE /* Stack grows downward. */ */
-/* OBSOLETE */
-/* OBSOLETE #define INNER_THAN(lhs,rhs) ((lhs) < (rhs)) */
-/* OBSOLETE */
-/* OBSOLETE /* Stack must be aligned on 32-bit boundaries when synthesizing */
-/* OBSOLETE function calls. */ */
-/* OBSOLETE */
-/* OBSOLETE #define STACK_ALIGN(ADDR) (((ADDR) + 3) & ~3) */
-/* OBSOLETE */
-/* OBSOLETE /* Sequence of bytes for breakpoint instruction. */ */
-/* OBSOLETE /* ASNEQ 0x50, gr1, gr1 */
-/* OBSOLETE The trap number 0x50 is chosen arbitrarily. */
-/* OBSOLETE We let the command line (or previously included files) override this */
-/* OBSOLETE setting. */ */
-/* OBSOLETE #ifndef BREAKPOINT */
-/* OBSOLETE #if TARGET_BYTE_ORDER == BFD_ENDIAN_BIG */
-/* OBSOLETE #define BREAKPOINT {0x72, 0x50, 0x01, 0x01} */
-/* OBSOLETE #else /* Target is little-endian. */ */
-/* OBSOLETE #define BREAKPOINT {0x01, 0x01, 0x50, 0x72} */
-/* OBSOLETE #endif /* Target is little-endian. */ */
-/* OBSOLETE #endif /* BREAKPOINT */ */
-/* 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. */ */
-/* OBSOLETE */
-/* OBSOLETE #define DECR_PC_AFTER_BREAK 0 */
-/* OBSOLETE */
-/* OBSOLETE /* Say how long (ordinary) registers are. This is a piece of bogosity */
-/* OBSOLETE used in push_word and a few other places; REGISTER_RAW_SIZE is the */
-/* OBSOLETE real way to know how big a register is. */ */
-/* OBSOLETE */
-/* OBSOLETE #define REGISTER_SIZE 4 */
-/* OBSOLETE */
-/* OBSOLETE /* Allow the register declarations here to be overridden for remote */
-/* OBSOLETE kernel debugging. */ */
-/* OBSOLETE #if !defined (REGISTER_NAMES) */
-/* OBSOLETE */
-/* OBSOLETE /* Number of machine registers */ */
-/* OBSOLETE */
-/* OBSOLETE #define NUM_REGS 205 */
-/* OBSOLETE */
-/* OBSOLETE /* Initializer for an array of names of registers. */
-/* OBSOLETE There should be NUM_REGS strings in this initializer. */
-/* OBSOLETE */
-/* OBSOLETE FIXME, add floating point registers and support here. */
-/* OBSOLETE */
-/* OBSOLETE Also note that this list does not attempt to deal with kernel */
-/* OBSOLETE debugging (in which the first 32 registers are gr64-gr95). */ */
-/* OBSOLETE */
-/* OBSOLETE #define REGISTER_NAMES \ */
-/* OBSOLETE {"gr96", "gr97", "gr98", "gr99", "gr100", "gr101", "gr102", "gr103", "gr104", \ */
-/* OBSOLETE "gr105", "gr106", "gr107", "gr108", "gr109", "gr110", "gr111", "gr112", \ */
-/* OBSOLETE "gr113", "gr114", "gr115", "gr116", "gr117", "gr118", "gr119", "gr120", \ */
-/* OBSOLETE "gr121", "gr122", "gr123", "gr124", "gr125", "gr126", "gr127", \ */
-/* OBSOLETE "lr0", "lr1", "lr2", "lr3", "lr4", "lr5", "lr6", "lr7", "lr8", "lr9", \ */
-/* OBSOLETE "lr10", "lr11", "lr12", "lr13", "lr14", "lr15", "lr16", "lr17", "lr18", \ */
-/* OBSOLETE "lr19", "lr20", "lr21", "lr22", "lr23", "lr24", "lr25", "lr26", "lr27", \ */
-/* OBSOLETE "lr28", "lr29", "lr30", "lr31", "lr32", "lr33", "lr34", "lr35", "lr36", \ */
-/* OBSOLETE "lr37", "lr38", "lr39", "lr40", "lr41", "lr42", "lr43", "lr44", "lr45", \ */
-/* OBSOLETE "lr46", "lr47", "lr48", "lr49", "lr50", "lr51", "lr52", "lr53", "lr54", \ */
-/* OBSOLETE "lr55", "lr56", "lr57", "lr58", "lr59", "lr60", "lr61", "lr62", "lr63", \ */
-/* OBSOLETE "lr64", "lr65", "lr66", "lr67", "lr68", "lr69", "lr70", "lr71", "lr72", \ */
-/* OBSOLETE "lr73", "lr74", "lr75", "lr76", "lr77", "lr78", "lr79", "lr80", "lr81", \ */
-/* OBSOLETE "lr82", "lr83", "lr84", "lr85", "lr86", "lr87", "lr88", "lr89", "lr90", \ */
-/* OBSOLETE "lr91", "lr92", "lr93", "lr94", "lr95", "lr96", "lr97", "lr98", "lr99", \ */
-/* OBSOLETE "lr100", "lr101", "lr102", "lr103", "lr104", "lr105", "lr106", "lr107", \ */
-/* OBSOLETE "lr108", "lr109", "lr110", "lr111", "lr112", "lr113", "lr114", "lr115", \ */
-/* OBSOLETE "lr116", "lr117", "lr118", "lr119", "lr120", "lr121", "lr122", "lr123", \ */
-/* OBSOLETE "lr124", "lr125", "lr126", "lr127", \ */
-/* OBSOLETE "AI0", "AI1", "AI2", "AI3", "AI4", "AI5", "AI6", "AI7", "AI8", "AI9", \ */
-/* OBSOLETE "AI10", "AI11", "AI12", "AI13", "AI14", "AI15", "FP", \ */
-/* OBSOLETE "bp", "fc", "cr", "q", \ */
-/* OBSOLETE "vab", "ops", "cps", "cfg", "cha", "chd", "chc", "rbp", "tmc", "tmr", \ */
-/* OBSOLETE "pc0", "pc1", "pc2", "mmu", "lru", "fpe", "inte", "fps", "exo", "gr1", \ */
-/* OBSOLETE "alu", "ipc", "ipa", "ipb" } */
-/* OBSOLETE */
-/* OBSOLETE /* */
-/* OBSOLETE * Converts an sdb register number to an internal gdb register number. */
-/* OBSOLETE * Currently under epi, gr96->0...gr127->31...lr0->32...lr127->159, or... */
-/* OBSOLETE * gr64->0...gr95->31, lr0->32...lr127->159. */
-/* OBSOLETE */ */
-/* OBSOLETE #define SDB_REG_TO_REGNUM(value) \ */
-/* OBSOLETE (((value) >= 96 && (value) <= 127) ? ((value) - 96) : \ */
-/* OBSOLETE ((value) >= 128 && (value) <= 255) ? ((value) - 128 + LR0_REGNUM) : \ */
-/* OBSOLETE (value)) */
-/* OBSOLETE */
-/* OBSOLETE /* */
-/* OBSOLETE * Provide the processor register numbers of some registers that are */
-/* OBSOLETE * expected/written in instructions that might change under different */
-/* OBSOLETE * register sets. Namely, gcc can compile (-mkernel-registers) so that */
-/* OBSOLETE * it uses gr64-gr95 in stead of gr96-gr127. */
-/* OBSOLETE */ */
-/* OBSOLETE #define MSP_HW_REGNUM 125 /* gr125 */ */
-/* OBSOLETE #define RAB_HW_REGNUM 126 /* gr126 */ */
-/* OBSOLETE */
-/* OBSOLETE /* Convert Processor Special register #x to REGISTER_NAMES register # */ */
-/* OBSOLETE #define SR_REGNUM(x) \ */
-/* OBSOLETE ((x) < 15 ? VAB_REGNUM + (x) \ */
-/* OBSOLETE : (x) >= 128 && (x) < 131 ? IPC_REGNUM + (x) - 128 \ */
-/* OBSOLETE : (x) == 131 ? Q_REGNUM \ */
-/* OBSOLETE : (x) == 132 ? ALU_REGNUM \ */
-/* OBSOLETE : (x) >= 133 && (x) < 136 ? BP_REGNUM + (x) - 133 \ */
-/* OBSOLETE : (x) >= 160 && (x) < 163 ? FPE_REGNUM + (x) - 160 \ */
-/* OBSOLETE : (x) == 164 ? EXO_REGNUM \ */
-/* OBSOLETE : (error ("Internal error in SR_REGNUM"), 0)) */
-/* OBSOLETE #define GR96_REGNUM 0 */
-/* OBSOLETE */
-/* OBSOLETE /* Define the return register separately, so it can be overridden for */
-/* OBSOLETE kernel procedure calling conventions. */ */
-/* OBSOLETE #define RETURN_REGNUM GR96_REGNUM */
-/* OBSOLETE #define GR1_REGNUM 200 */
-/* OBSOLETE /* This needs to be the memory stack pointer, not the register stack pointer, */
-/* OBSOLETE to make call_function work right. */ */
-/* OBSOLETE #define SP_REGNUM MSP_REGNUM */
-/* OBSOLETE #define FP_REGNUM 33 /* lr1 */ */
-/* OBSOLETE */
-/* OBSOLETE /* Return register for transparent calling convention (gr122). */ */
-/* OBSOLETE #define TPC_REGNUM (122 - 96 + GR96_REGNUM) */
-/* OBSOLETE */
-/* OBSOLETE /* Large Return Pointer (gr123). */ */
-/* OBSOLETE #define LRP_REGNUM (123 - 96 + GR96_REGNUM) */
-/* OBSOLETE */
-/* OBSOLETE /* Static link pointer (gr124). */ */
-/* OBSOLETE #define SLP_REGNUM (124 - 96 + GR96_REGNUM) */
-/* OBSOLETE */
-/* OBSOLETE /* Memory Stack Pointer (gr125). */ */
-/* OBSOLETE #define MSP_REGNUM (125 - 96 + GR96_REGNUM) */
-/* OBSOLETE */
-/* OBSOLETE /* Register allocate bound (gr126). */ */
-/* OBSOLETE #define RAB_REGNUM (126 - 96 + GR96_REGNUM) */
-/* OBSOLETE */
-/* OBSOLETE /* Register Free Bound (gr127). */ */
-/* OBSOLETE #define RFB_REGNUM (127 - 96 + GR96_REGNUM) */
-/* OBSOLETE */
-/* OBSOLETE /* Register Stack Pointer. */ */
-/* OBSOLETE #define RSP_REGNUM GR1_REGNUM */
-/* OBSOLETE #define LR0_REGNUM 32 */
-/* OBSOLETE #define BP_REGNUM 177 */
-/* OBSOLETE #define FC_REGNUM 178 */
-/* OBSOLETE #define CR_REGNUM 179 */
-/* OBSOLETE #define Q_REGNUM 180 */
-/* OBSOLETE #define VAB_REGNUM 181 */
-/* OBSOLETE #define OPS_REGNUM (VAB_REGNUM + 1) */
-/* OBSOLETE #define CPS_REGNUM (VAB_REGNUM + 2) */
-/* OBSOLETE #define CFG_REGNUM (VAB_REGNUM + 3) */
-/* OBSOLETE #define CHA_REGNUM (VAB_REGNUM + 4) */
-/* OBSOLETE #define CHD_REGNUM (VAB_REGNUM + 5) */
-/* OBSOLETE #define CHC_REGNUM (VAB_REGNUM + 6) */
-/* OBSOLETE #define RBP_REGNUM (VAB_REGNUM + 7) */
-/* OBSOLETE #define TMC_REGNUM (VAB_REGNUM + 8) */
-/* OBSOLETE #define TMR_REGNUM (VAB_REGNUM + 9) */
-/* OBSOLETE #define NPC_REGNUM (VAB_REGNUM + 10) /* pc0 */ */
-/* OBSOLETE #define PC_REGNUM (VAB_REGNUM + 11) /* pc1 */ */
-/* OBSOLETE #define PC2_REGNUM (VAB_REGNUM + 12) */
-/* OBSOLETE #define MMU_REGNUM (VAB_REGNUM + 13) */
-/* OBSOLETE #define LRU_REGNUM (VAB_REGNUM + 14) */
-/* OBSOLETE #define FPE_REGNUM (VAB_REGNUM + 15) */
-/* OBSOLETE #define INTE_REGNUM (VAB_REGNUM + 16) */
-/* OBSOLETE #define FPS_REGNUM (VAB_REGNUM + 17) */
-/* OBSOLETE #define EXO_REGNUM (VAB_REGNUM + 18) */
-/* OBSOLETE /* gr1 is defined above as 200 = VAB_REGNUM + 19 */ */
-/* OBSOLETE #define ALU_REGNUM (VAB_REGNUM + 20) */
-/* OBSOLETE #define PS_REGNUM ALU_REGNUM */
-/* OBSOLETE #define IPC_REGNUM (VAB_REGNUM + 21) */
-/* OBSOLETE #define IPA_REGNUM (VAB_REGNUM + 22) */
-/* OBSOLETE #define IPB_REGNUM (VAB_REGNUM + 23) */
-/* OBSOLETE */
-/* OBSOLETE #endif /* !defined(REGISTER_NAMES) */ */
-/* OBSOLETE */
-/* OBSOLETE /* Total amount of space needed to store our copies of the machine's */
-/* OBSOLETE register state, the array `registers'. */ */
-/* OBSOLETE #define REGISTER_BYTES (NUM_REGS * 4) */
-/* OBSOLETE */
-/* OBSOLETE /* Index within `registers' of the first byte of the space for */
-/* OBSOLETE register N. */ */
-/* OBSOLETE #define REGISTER_BYTE(N) ((N)*4) */
-/* OBSOLETE */
-/* OBSOLETE /* Number of bytes of storage in the actual machine representation */
-/* OBSOLETE for register N. */ */
-/* OBSOLETE */
-/* OBSOLETE /* All regs are 4 bytes. */ */
-/* OBSOLETE */
-/* OBSOLETE #define REGISTER_RAW_SIZE(N) (4) */
-/* OBSOLETE */
-/* OBSOLETE /* Number of bytes of storage in the program's representation */
-/* OBSOLETE for register N. */ */
-/* OBSOLETE */
-/* OBSOLETE /* All regs are 4 bytes. */ */
-/* OBSOLETE */
-/* OBSOLETE #define REGISTER_VIRTUAL_SIZE(N) (4) */
-/* OBSOLETE */
-/* OBSOLETE /* Largest value REGISTER_RAW_SIZE can have. */ */
-/* OBSOLETE */
-/* OBSOLETE #define MAX_REGISTER_RAW_SIZE (4) */
-/* OBSOLETE */
-/* OBSOLETE /* Largest value REGISTER_VIRTUAL_SIZE can have. */ */
-/* 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. */ */
-/* OBSOLETE */
-/* OBSOLETE #define REGISTER_VIRTUAL_TYPE(N) \ */
-/* OBSOLETE (((N) == PC_REGNUM || (N) == LRP_REGNUM || (N) == SLP_REGNUM \ */
-/* OBSOLETE || (N) == MSP_REGNUM || (N) == RAB_REGNUM || (N) == RFB_REGNUM \ */
-/* OBSOLETE || (N) == GR1_REGNUM || (N) == FP_REGNUM || (N) == LR0_REGNUM \ */
-/* OBSOLETE || (N) == NPC_REGNUM || (N) == PC2_REGNUM) \ */
-/* OBSOLETE ? lookup_pointer_type (builtin_type_void) : 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. */ */
-/* OBSOLETE /* On the a29k the LRP points to the part of the structure beyond the first */
-/* OBSOLETE 16 words. */ */
-/* OBSOLETE #define STORE_STRUCT_RETURN(ADDR, SP) \ */
-/* OBSOLETE write_register (LRP_REGNUM, (ADDR) + 16 * 4); */
-/* OBSOLETE */
-/* OBSOLETE /* Should call_function allocate stack space for a struct return? */ */
-/* OBSOLETE /* On the a29k objects over 16 words require the caller to allocate space. */ */
-/* OBSOLETE extern use_struct_convention_fn a29k_use_struct_convention; */
-/* OBSOLETE #define USE_STRUCT_CONVENTION(gcc_p, type) a29k_use_struct_convention (gcc_p, type) */
-/* 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. */ */
-/* OBSOLETE */
-/* OBSOLETE #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ */
-/* OBSOLETE { \ */
-/* OBSOLETE int reg_length = TYPE_LENGTH (TYPE); \ */
-/* OBSOLETE if (reg_length > 16 * 4) \ */
-/* OBSOLETE { \ */
-/* OBSOLETE reg_length = 16 * 4; \ */
-/* OBSOLETE read_memory (*((int *)(REGBUF) + LRP_REGNUM), (VALBUF) + 16 * 4, \ */
-/* OBSOLETE TYPE_LENGTH (TYPE) - 16 * 4); \ */
-/* OBSOLETE } \ */
-/* OBSOLETE memcpy ((VALBUF), ((int *)(REGBUF))+RETURN_REGNUM, reg_length); \ */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Write into appropriate registers a function return value */
-/* OBSOLETE of type TYPE, given in virtual format. */ */
-/* OBSOLETE */
-/* OBSOLETE #define STORE_RETURN_VALUE(TYPE,VALBUF) \ */
-/* OBSOLETE { \ */
-/* OBSOLETE int reg_length = TYPE_LENGTH (TYPE); \ */
-/* OBSOLETE if (reg_length > 16 * 4) \ */
-/* OBSOLETE { \ */
-/* OBSOLETE reg_length = 16 * 4; \ */
-/* OBSOLETE write_memory (read_register (LRP_REGNUM), \ */
-/* OBSOLETE (char *)(VALBUF) + 16 * 4, \ */
-/* OBSOLETE TYPE_LENGTH (TYPE) - 16 * 4); \ */
-/* OBSOLETE } \ */
-/* OBSOLETE write_register_bytes (REGISTER_BYTE (RETURN_REGNUM), (char *)(VALBUF), \ */
-/* OBSOLETE TYPE_LENGTH (TYPE)); \ */
-/* OBSOLETE } */
-/* OBSOLETE /* *INDENT-OFF* */ */
-/* OBSOLETE /* The a29k user's guide documents well what the stacks look like. */
-/* OBSOLETE But what isn't so clear there is how this interracts with the */
-/* OBSOLETE symbols, or with GDB. */
-/* OBSOLETE In the following saved_msp, saved memory stack pointer (which functions */
-/* OBSOLETE as a memory frame pointer), means either */
-/* OBSOLETE a register containing the memory frame pointer or, in the case of */
-/* OBSOLETE functions with fixed size memory frames (i.e. those who don't use */
-/* OBSOLETE alloca()), the result of the calculation msp + msize. */
-/* OBSOLETE */
-/* OBSOLETE LOC_ARG, LOC_LOCAL - For GCC, these are relative to saved_msp. */
-/* OBSOLETE For high C, these are relative to msp (making alloca impossible). */
-/* OBSOLETE LOC_REGISTER, LOC_REGPARM - The register number is the number at the */
-/* OBSOLETE time the function is running (after the prologue), or in the case */
-/* OBSOLETE of LOC_REGPARM, may be a register number in the range 160-175. */
-/* OBSOLETE */
-/* OBSOLETE The compilers do things like store an argument into memory, and then put out */
-/* OBSOLETE a LOC_ARG for it, or put it into global registers and put out a */
-/* OBSOLETE LOC_REGPARM. Thus is it important to execute the first line of */
-/* OBSOLETE code (i.e. the line of the open brace, i.e. the prologue) of a function */
-/* OBSOLETE before trying to print arguments or anything. */
-/* OBSOLETE */
-/* OBSOLETE The following diagram attempts to depict what is going on in memory */
-/* OBSOLETE (see also the _a29k user's guide_) and also how that interacts with */
-/* OBSOLETE GDB frames. We arbitrarily pick fci->frame to point the same place */
-/* OBSOLETE as the register stack pointer; since we set it ourself in */
-/* OBSOLETE INIT_EXTRA_FRAME_INFO, and access it only through the FRAME_* */
-/* OBSOLETE macros, it doesn't really matter exactly how we */
-/* OBSOLETE do it. However, note that FRAME_FP is used in two ways in GDB: */
-/* OBSOLETE (1) as a "magic cookie" which uniquely identifies frames (even over */
-/* OBSOLETE calls to the inferior), (2) (in PC_IN_CALL_DUMMY [ON_STACK]) */
-/* OBSOLETE as the value of SP_REGNUM before the dummy frame was pushed. These */
-/* OBSOLETE two meanings would be incompatible for the a29k if we defined */
-/* OBSOLETE CALL_DUMMY_LOCATION == ON_STACK (but we don't, so don't worry about it). */
-/* OBSOLETE Also note that "lr1" below, while called a frame pointer */
-/* OBSOLETE in the user's guide, has only one function: To determine whether */
-/* OBSOLETE registers need to be filled in the function epilogue. */
-/* OBSOLETE */
-/* OBSOLETE Consider the code: */
-/* OBSOLETE < call bar> */
-/* OBSOLETE loc1: . . . */
-/* OBSOLETE bar: sub gr1,gr1,rsize_b */
-/* OBSOLETE . . . */
-/* OBSOLETE add mfp,msp,0 */
-/* OBSOLETE sub msp,msp,msize_b */
-/* OBSOLETE . . . */
-/* OBSOLETE < call foo > */
-/* OBSOLETE loc2: . . . */
-/* OBSOLETE foo: sub gr1,gr1,rsize_f */
-/* OBSOLETE . . . */
-/* OBSOLETE add mfp,msp,0 */
-/* OBSOLETE sub msp,msp,msize_f */
-/* OBSOLETE . . . */
-/* OBSOLETE loc3: < suppose the inferior stops here > */
-/* OBSOLETE */
-/* OBSOLETE memory stack register stack */
-/* OBSOLETE | | |____________| */
-/* OBSOLETE | | |____loc1____| */
-/* OBSOLETE +------->|___________| | | ^ */
-/* OBSOLETE | | ^ | | locals_b | | */
-/* OBSOLETE | | | | |____________| | */
-/* OBSOLETE | | | | | | | rsize_b */
-/* OBSOLETE | | | msize_b | | args_to_f | | */
-/* OBSOLETE | | | | |____________| | */
-/* OBSOLETE | | | | |____lr1_____| V */
-/* OBSOLETE | | V | |____loc2____|<----------------+ */
-/* OBSOLETE | +--->|___________|<---------mfp | ^ | */
-/* OBSOLETE | | | ^ | | locals_f | | | */
-/* OBSOLETE | | | | msize_f | |____________| | | */
-/* OBSOLETE | | | | | | | | rsize_f | */
-/* OBSOLETE | | | V | | args | | | */
-/* OBSOLETE | | |___________|<msp |____________| | | */
-/* OBSOLETE | | |_____lr1____| V | */
-/* OBSOLETE | | |___garbage__| <- gr1 <----+ | */
-/* OBSOLETE | | | | */
-/* OBSOLETE | | | | */
-/* OBSOLETE | | pc=loc3 | | */
-/* OBSOLETE | | | | */
-/* OBSOLETE | | | | */
-/* OBSOLETE | | frame cache | | */
-/* OBSOLETE | | |_________________| | | */
-/* OBSOLETE | | |rsize=rsize_b | | | */
-/* OBSOLETE | | |msize=msize_b | | | */
-/* OBSOLETE +---|--------saved_msp | | | */
-/* OBSOLETE | |frame------------------------------------|---+ */
-/* OBSOLETE | |pc=loc2 | | */
-/* OBSOLETE | |_________________| | */
-/* OBSOLETE | |rsize=rsize_f | | */
-/* OBSOLETE | |msize=msize_f | | */
-/* OBSOLETE +--------saved_msp | | */
-/* OBSOLETE |frame------------------------------------+ */
-/* OBSOLETE |pc=loc3 | */
-/* OBSOLETE |_________________| */
-/* OBSOLETE */
-/* OBSOLETE So, is that sufficiently confusing? Welcome to the 29000. */
-/* OBSOLETE Notes: */
-/* OBSOLETE * The frame for foo uses a memory frame pointer but the frame for */
-/* OBSOLETE bar does not. In the latter case the saved_msp is */
-/* OBSOLETE computed by adding msize to the saved_msp of the */
-/* OBSOLETE next frame. */
-/* OBSOLETE * msize is in the frame cache only for high C's sake. */ */
-/* OBSOLETE /* *INDENT-ON* */ */
-/* OBSOLETE */
-/* OBSOLETE */
-/* OBSOLETE void read_register_stack (); */
-/* OBSOLETE long read_register_stack_integer (); */
-/* OBSOLETE */
-/* OBSOLETE #define FRAME_INIT_SAVED_REGS(fi) /*no-op */ */
-/* OBSOLETE */
-/* OBSOLETE #define EXTRA_FRAME_INFO \ */
-/* OBSOLETE CORE_ADDR saved_msp; \ */
-/* OBSOLETE unsigned int rsize; \ */
-/* OBSOLETE unsigned int msize; \ */
-/* OBSOLETE unsigned char flags; */
-/* OBSOLETE */
-/* OBSOLETE /* Bits for flags in EXTRA_FRAME_INFO */ */
-/* OBSOLETE #define TRANSPARENT_FRAME 0x1 /* This is a transparent frame */ */
-/* OBSOLETE #define MFP_USED 0x2 /* A memory frame pointer is used */ */
-/* OBSOLETE */
-/* OBSOLETE /* Because INIT_FRAME_PC gets passed fromleaf, that's where we init */
-/* OBSOLETE not only ->pc and ->frame, but all the extra stuff, when called from */
-/* OBSOLETE get_prev_frame, that is. */ */
-/* OBSOLETE #define INIT_EXTRA_FRAME_INFO(fromleaf, fci) init_extra_frame_info(fci) */
-/* OBSOLETE void init_extra_frame_info (); */
-/* OBSOLETE */
-/* OBSOLETE #define INIT_FRAME_PC(fromleaf, fci) init_frame_pc(fromleaf, fci) */
-/* OBSOLETE void init_frame_pc (); */
-/* OBSOLETE */
-/* OBSOLETE */
-/* OBSOLETE /* FRAME_CHAIN takes a FRAME */
-/* OBSOLETE and produces the frame's chain-pointer. */
-/* OBSOLETE */
-/* OBSOLETE However, if FRAME_CHAIN_VALID returns zero, */
-/* OBSOLETE it means the given frame is the outermost one and has no caller. */ */
-/* OBSOLETE */
-/* OBSOLETE /* On the a29k, the nominal address of a frame is the address on the */
-/* OBSOLETE register stack of the return address (the one next to the incoming */
-/* OBSOLETE arguments, not down at the bottom so nominal address == stack pointer). */
-/* OBSOLETE */
-/* OBSOLETE GDB expects "nominal address" to equal contents of FP_REGNUM, */
-/* OBSOLETE at least when it comes time to create the innermost frame. */
-/* OBSOLETE However, that doesn't work for us, so when creating the innermost */
-/* OBSOLETE frame we set ->frame ourselves in INIT_EXTRA_FRAME_INFO. */ */
-/* OBSOLETE */
-/* OBSOLETE /* These are mostly dummies for the a29k because INIT_FRAME_PC */
-/* OBSOLETE sets prev->frame instead. */ */
-/* OBSOLETE /* If rsize is zero, we must be at end of stack (or otherwise hosed). */
-/* OBSOLETE If we don't check rsize, we loop forever if we see rsize == 0. */ */
-/* OBSOLETE #define FRAME_CHAIN(thisframe) \ */
-/* OBSOLETE ((thisframe)->rsize == 0 \ */
-/* OBSOLETE ? 0 \ */
-/* OBSOLETE : (thisframe)->frame + (thisframe)->rsize) */
-/* OBSOLETE */
-/* OBSOLETE /* Determine if the frame has a 'previous' and back-traceable frame. */ */
-/* OBSOLETE #define FRAME_IS_UNCHAINED(frame) ((frame)->flags & TRANSPARENT_FRAME) */
-/* OBSOLETE */
-/* OBSOLETE /* Find the previous frame of a transparent routine. */
-/* OBSOLETE * For now lets not try and trace through a transparent routine (we might */
-/* OBSOLETE * have to assume that all transparent routines are traps). */
-/* OBSOLETE */ */
-/* OBSOLETE #define FIND_PREV_UNCHAINED_FRAME(frame) 0 */
-/* OBSOLETE */
-/* OBSOLETE /* Define other aspects of the stack frame. */ */
-/* OBSOLETE */
-/* OBSOLETE /* An expression that tells us whether the function invocation represented */
-/* OBSOLETE by FI does not have a frame on the stack associated with it. */ */
-/* OBSOLETE #define FRAMELESS_FUNCTION_INVOCATION(FI) \ */
-/* OBSOLETE (frameless_look_for_prologue (FI)) */
-/* OBSOLETE */
-/* OBSOLETE /* Saved pc (i.e. return address). */ */
-/* OBSOLETE #define FRAME_SAVED_PC(fraim) \ */
-/* OBSOLETE (read_register_stack_integer ((fraim)->frame + (fraim)->rsize, 4)) */
-/* OBSOLETE */
-/* OBSOLETE /* Local variables (i.e. LOC_LOCAL) are on the memory stack, with their */
-/* OBSOLETE offsets being relative to the memory stack pointer (high C) or */
-/* OBSOLETE saved_msp (gcc). */ */
-/* OBSOLETE */
-/* OBSOLETE #define FRAME_LOCALS_ADDRESS(fi) frame_locals_address (fi) */
-/* OBSOLETE extern CORE_ADDR frame_locals_address (); */
-/* OBSOLETE */
-/* OBSOLETE /* Return number of args passed to a frame. */
-/* OBSOLETE Can return -1, meaning no way to tell. */ */
-/* OBSOLETE /* We tried going to the effort of finding the tags word and getting */
-/* OBSOLETE the argcount field from it, to support debugging assembler code. */
-/* OBSOLETE Problem was, the "argcount" field never did hold the argument */
-/* OBSOLETE count. */ */
-/* OBSOLETE #define FRAME_NUM_ARGS(fi) (-1) */
-/* OBSOLETE */
-/* OBSOLETE #define FRAME_ARGS_ADDRESS(fi) FRAME_LOCALS_ADDRESS (fi) */
-/* OBSOLETE */
-/* OBSOLETE /* Return number of bytes at start of arglist that are not really args. */ */
-/* OBSOLETE */
-/* OBSOLETE #define FRAME_ARGS_SKIP 0 */
-/* OBSOLETE */
-/* OBSOLETE /* Provide our own get_saved_register. HAVE_REGISTER_WINDOWS is insufficient */
-/* OBSOLETE because registers get renumbered on the a29k without getting saved. */ */
-/* OBSOLETE */
-/* OBSOLETE struct frame_info; */
-/* OBSOLETE void a29k_get_saved_register (char *raw_buffer, int *optimized, */
-/* OBSOLETE CORE_ADDR * addrp, struct frame_info *frame, */
-/* OBSOLETE int regnum, enum lval_type *lvalp); */
-/* OBSOLETE #define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) \ */
-/* OBSOLETE a29k_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval) */
-/* OBSOLETE */
-/* OBSOLETE /* Call function stuff. */ */
-/* OBSOLETE /* *INDENT-OFF* */ */
-/* OBSOLETE /* The dummy frame looks like this (see also the general frame picture */
-/* OBSOLETE above): */
-/* OBSOLETE */
-/* OBSOLETE register stack */
-/* OBSOLETE */
-/* OBSOLETE | | frame for function */
-/* OBSOLETE | locals_sproc | executing at time */
-/* OBSOLETE |________________| of call_function. */
-/* OBSOLETE | | We must not disturb */
-/* OBSOLETE | args_out_sproc | it. */
-/* OBSOLETE memory stack |________________| */
-/* OBSOLETE |____lr1_sproc___|<-+ */
-/* OBSOLETE | | |__retaddr_sproc_| | <-- gr1 (at start) */
-/* OBSOLETE |____________|<-msp 0 <-----------mfp_dummy_____| | */
-/* OBSOLETE | | (at start) | save regs | | */
-/* OBSOLETE | arg_slop | | pc0,pc1 | | */
-/* OBSOLETE | | | pc2,lr0 sproc | | */
-/* OBSOLETE | (16 words) | | gr96-gr124 | | */
-/* OBSOLETE |____________|<-msp 1--after | sr160-sr162 | | */
-/* OBSOLETE | | PUSH_DUMMY_FRAME| sr128-sr135 | | */
-/* OBSOLETE | struct ret | |________________| | */
-/* OBSOLETE | 17+ | | | | */
-/* OBSOLETE |____________|<- lrp | args_out_dummy | | */
-/* OBSOLETE | struct ret | | (16 words) | | */
-/* OBSOLETE | 16 | |________________| | */
-/* OBSOLETE | (16 words) | |____lr1_dummy___|--+ */
-/* OBSOLETE |____________|<- msp 2--after |_retaddr_dummy__|<- gr1 after */
-/* OBSOLETE | | struct ret | | PUSH_DUMMY_FRAME */
-/* OBSOLETE | margs17+ | area allocated | locals_inf | */
-/* OBSOLETE | | |________________| called */
-/* OBSOLETE |____________|<- msp 4--when | | function's */
-/* OBSOLETE | | inf called | args_out_inf | frame (set up */
-/* OBSOLETE | margs16 | |________________| by called */
-/* OBSOLETE | (16 words) | |_____lr1_inf____| function). */
-/* OBSOLETE |____________|<- msp 3--after | . | */
-/* OBSOLETE | | args pushed | . | */
-/* OBSOLETE | | | . | */
-/* OBSOLETE | | */
-/* OBSOLETE */
-/* OBSOLETE arg_slop: This area is so that when the call dummy adds 16 words to */
-/* OBSOLETE the msp, it won't end up larger than mfp_dummy (it is needed in the */
-/* OBSOLETE case where margs and struct_ret do not add up to at least 16 words). */
-/* OBSOLETE struct ret: This area is allocated by GDB if the return value is more */
-/* OBSOLETE than 16 words. struct ret_16 is not used on the a29k. */
-/* OBSOLETE margs: Pushed by GDB. The call dummy copies the first 16 words to */
-/* OBSOLETE args_out_dummy. */
-/* OBSOLETE retaddr_sproc: Contains the PC at the time we call the function. */
-/* OBSOLETE set by PUSH_DUMMY_FRAME and read by POP_FRAME. */
-/* OBSOLETE retaddr_dummy: This points to a breakpoint instruction in the dummy. */ */
-/* OBSOLETE /* *INDENT-ON* */ */
-/* OBSOLETE */
-/* OBSOLETE */
-/* OBSOLETE */
-/* OBSOLETE /* Rsize for dummy frame, in bytes. */ */
-/* OBSOLETE */
-/* OBSOLETE /* Bytes for outgoing args, lr1, and retaddr. */ */
-/* OBSOLETE #define DUMMY_ARG (2 * 4 + 16 * 4) */
-/* OBSOLETE */
-/* OBSOLETE /* Number of special registers (sr128-) to save. */ */
-/* OBSOLETE #define DUMMY_SAVE_SR128 8 */
-/* OBSOLETE /* Number of special registers (sr160-) to save. */ */
-/* OBSOLETE #define DUMMY_SAVE_SR160 3 */
-/* OBSOLETE /* Number of general (gr96- or gr64-) registers to save. */ */
-/* OBSOLETE #define DUMMY_SAVE_GREGS 29 */
-/* OBSOLETE */
-/* OBSOLETE #define DUMMY_FRAME_RSIZE \ */
-/* OBSOLETE (4 /* mfp_dummy */ \ */
-/* OBSOLETE + 4 * 4 /* pc0, pc1, pc2, lr0 */ \ */
-/* OBSOLETE + DUMMY_SAVE_GREGS * 4 \ */
-/* OBSOLETE + DUMMY_SAVE_SR160 * 4 \ */
-/* OBSOLETE + DUMMY_SAVE_SR128 * 4 \ */
-/* OBSOLETE + DUMMY_ARG \ */
-/* OBSOLETE + 4 /* pad to doubleword */ ) */
-/* OBSOLETE */
-/* OBSOLETE /* Push an empty stack frame, to record the current PC, etc. */ */
-/* OBSOLETE */
-/* OBSOLETE #define PUSH_DUMMY_FRAME push_dummy_frame() */
-/* OBSOLETE extern void push_dummy_frame (); */
-/* OBSOLETE */
-/* OBSOLETE /* Discard from the stack the innermost frame, */
-/* OBSOLETE restoring all saved registers. */ */
-/* OBSOLETE */
-/* OBSOLETE #define POP_FRAME pop_frame() */
-/* OBSOLETE extern void pop_frame (); */
-/* OBSOLETE */
-/* OBSOLETE /* This sequence of words is the instructions */
-/* OBSOLETE mtsrim cr, 15 */
-/* OBSOLETE loadm 0, 0, lr2, msp ; load first 16 words of arguments into registers */
-/* OBSOLETE add msp, msp, 16 * 4 ; point to the remaining arguments */
-/* OBSOLETE CONST_INSN: */
-/* OBSOLETE const lr0,inf ; (replaced by half of target addr) */
-/* OBSOLETE consth lr0,inf ; (replaced by other half of target addr) */
-/* OBSOLETE calli lr0, lr0 */
-/* OBSOLETE aseq 0x40,gr1,gr1 ; nop */
-/* OBSOLETE BREAKPT_INSN: */
-/* OBSOLETE asneq 0x50,gr1,gr1 ; breakpoint (replaced by local breakpoint insn) */
-/* OBSOLETE */ */
-/* OBSOLETE */
-/* OBSOLETE #error "This file is broken. GDB does not define HOST_BYTE_ORDER." */
-/* OBSOLETE #if TARGET_BYTE_ORDER == HOST_BYTE_ORDER */
-/* OBSOLETE #define BS(const) const */
-/* OBSOLETE #else */
-/* OBSOLETE #define BS(const) (((const) & 0xff) << 24) | \ */
-/* OBSOLETE (((const) & 0xff00) << 8) | \ */
-/* OBSOLETE (((const) & 0xff0000) >> 8) | \ */
-/* OBSOLETE (((const) & 0xff000000) >> 24) */
-/* OBSOLETE #endif */
-/* OBSOLETE */
-/* OBSOLETE /* Position of the "const" and blkt instructions within CALL_DUMMY in bytes. */ */
-/* OBSOLETE #define CONST_INSN (3 * 4) */
-/* OBSOLETE #define BREAKPT_INSN (7 * 4) */
-/* OBSOLETE #define CALL_DUMMY { \ */
-/* OBSOLETE BS(0x0400870f),\ */
-/* OBSOLETE BS(0x36008200|(MSP_HW_REGNUM)), \ */
-/* OBSOLETE BS(0x15000040|(MSP_HW_REGNUM<<8)|(MSP_HW_REGNUM<<16)), \ */
-/* OBSOLETE BS(0x03ff80ff), \ */
-/* OBSOLETE BS(0x02ff80ff), \ */
-/* OBSOLETE BS(0xc8008080), \ */
-/* OBSOLETE BS(0x70400101), \ */
-/* OBSOLETE BS(0x72500101)} */
-/* OBSOLETE #define CALL_DUMMY_LENGTH (8 * 4) */
-/* OBSOLETE */
-/* OBSOLETE #define CALL_DUMMY_START_OFFSET 0 /* Start execution at beginning of dummy */ */
-/* OBSOLETE */
-/* OBSOLETE /* Helper macro for FIX_CALL_DUMMY. WORDP is a long * which points to a */
-/* OBSOLETE word in target byte order; bits 0-7 and 16-23 of *WORDP are replaced with */
-/* OBSOLETE bits 0-7 and 8-15 of DATA (which is in host byte order). */ */
-/* OBSOLETE */
-/* OBSOLETE #if TARGET_BYTE_ORDER == BFD_ENDIAN_BIG */
-/* OBSOLETE #define STUFF_I16(WORDP, DATA) \ */
-/* OBSOLETE { \ */
-/* OBSOLETE *((char *)(WORDP) + 3) = ((DATA) & 0xff);\ */
-/* OBSOLETE *((char *)(WORDP) + 1) = (((DATA) >> 8) & 0xff);\ */
-/* OBSOLETE } */
-/* OBSOLETE #else /* Target is little endian. */ */
-/* OBSOLETE #define STUFF_I16(WORDP, DATA) \ */
-/* OBSOLETE { */
-/* OBSOLETE *(char *) (WORDP) = ((DATA) & 0xff); */
-/* OBSOLETE *((char *) (WORDP) + 2) = (((DATA) >> 8) & 0xff); */
-/* OBSOLETE } */
-/* OBSOLETE #endif /* Target is little endian. */ */
-/* OBSOLETE */
-/* OBSOLETE /* Insert the specified number of args and function address */
-/* OBSOLETE into a call sequence of the above form stored at DUMMYNAME. */ */
-/* OBSOLETE */
-/* OBSOLETE /* Currently this stuffs in the address of the function that we are calling. */
-/* OBSOLETE Since different a29k systems use different breakpoint instructions, it */
-/* OBSOLETE also stuffs BREAKPOINT in the right place (to avoid having to */
-/* OBSOLETE duplicate CALL_DUMMY in each tm-*.h file). */ */
-/* OBSOLETE */
-/* OBSOLETE #define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \ */
-/* OBSOLETE {\ */
-/* OBSOLETE STUFF_I16((char *)dummyname + CONST_INSN, fun); \ */
-/* OBSOLETE STUFF_I16((char *)dummyname + CONST_INSN + 4, fun >> 16); \ */
-/* OBSOLETE /* FIXME memcpy ((char *)(dummyname) + BREAKPT_INSN, break_insn, 4); */ \ */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* a29k architecture has separate data & instruction memories -- wired to */
-/* OBSOLETE different pins on the chip -- and can't execute the data memory. */
-/* OBSOLETE Also, there should be space after text_end; */
-/* OBSOLETE we won't get a SIGSEGV or scribble on data space. */ */
-/* OBSOLETE */
-/* OBSOLETE #define CALL_DUMMY_LOCATION AFTER_TEXT_END */
-/* OBSOLETE */
-/* OBSOLETE /* Because of this, we need (as a kludge) to know the addresses of the */
-/* OBSOLETE text section. */ */
-/* OBSOLETE */
-/* OBSOLETE #define NEED_TEXT_START_END 1 */
-/* OBSOLETE */
-/* OBSOLETE /* How to translate register numbers in the .stab's into gdb's internal register */
-/* OBSOLETE numbers. We don't translate them, but we warn if an invalid register */
-/* OBSOLETE number is seen. Note that FIXME, we use the value "sym" as an implicit */
-/* OBSOLETE argument in printing the error message. It happens to be available where */
-/* OBSOLETE this macro is used. (This macro definition appeared in a late revision */
-/* OBSOLETE of gdb-3.91.6 and is not well tested. Also, it should be a "complaint".) */ */
-/* OBSOLETE */
-/* OBSOLETE #define STAB_REG_TO_REGNUM(num) \ */
-/* OBSOLETE (((num) > LR0_REGNUM + 127) \ */
-/* OBSOLETE ? fprintf(stderr, \ */
-/* OBSOLETE "Invalid register number %d in symbol table entry for %s\n", \ */
-/* OBSOLETE (num), SYMBOL_SOURCE_NAME (sym)), (num) \ */
-/* OBSOLETE : (num)) */
-/* OBSOLETE */
-/* OBSOLETE extern enum a29k_processor_types */
-/* OBSOLETE { */
-/* OBSOLETE a29k_unknown, */
-/* OBSOLETE */
-/* OBSOLETE /* Bit 0x400 of the CPS does *not* identify freeze mode, i.e. 29000, */
-/* OBSOLETE 29030, etc. */ */
-/* OBSOLETE a29k_no_freeze_mode, */
-/* OBSOLETE */
-/* OBSOLETE /* Bit 0x400 of the CPS does identify freeze mode, i.e. 29050. */ */
-/* OBSOLETE a29k_freeze_mode */
-/* OBSOLETE } */
-/* OBSOLETE processor_type; */
-/* OBSOLETE */
-/* OBSOLETE /* We need three arguments for a general frame specification for the */
-/* OBSOLETE "frame" or "info frame" command. */ */
-/* OBSOLETE */
-/* OBSOLETE #define SETUP_ARBITRARY_FRAME(argc, argv) setup_arbitrary_frame (argc, argv) */
-/* OBSOLETE extern struct frame_info *setup_arbitrary_frame (int, CORE_ADDR *); */
diff --git a/gdb/config/a29k/tm-vx29k.h b/gdb/config/a29k/tm-vx29k.h
deleted file mode 100644
index 40c6689..0000000
--- a/gdb/config/a29k/tm-vx29k.h
+++ /dev/null
@@ -1,230 +0,0 @@
-/* OBSOLETE /* Target machine description for VxWorks on the 29k, for GDB, the GNU debugger. */
-/* OBSOLETE Copyright 1994, 1995, 1998, 1999, 2000 Free Software Foundation, Inc. */
-/* OBSOLETE Contributed by Cygnus Support. */
-/* 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. */ */
-/* OBSOLETE */
-/* OBSOLETE #include "regcache.h" */
-/* OBSOLETE #include "value.h" */
-/* OBSOLETE #include "a29k/tm-a29k.h" */
-/* OBSOLETE #include "tm-vxworks.h" */
-/* OBSOLETE */
-/* OBSOLETE /* Number of registers in a ptrace_getregs call. */ */
-/* OBSOLETE */
-/* OBSOLETE #define VX_NUM_REGS (NUM_REGS) */
-/* OBSOLETE */
-/* OBSOLETE /* Number of registers in a ptrace_getfpregs call. */ */
-/* OBSOLETE */
-/* OBSOLETE /* #define VX_SIZE_FPREGS */ */
-/* OBSOLETE */
-/* OBSOLETE /* This is almost certainly the wrong place for this: */ */
-/* OBSOLETE #define LR2_REGNUM 34 */
-/* OBSOLETE */
-/* OBSOLETE */
-/* OBSOLETE /* Vxworks has its own CALL_DUMMY since it manages breakpoints in the kernel */ */
-/* OBSOLETE */
-/* OBSOLETE #undef CALL_DUMMY */
-/* OBSOLETE */
-/* OBSOLETE /* Replace the breakpoint instruction in the CALL_DUMMY with a nop. */
-/* OBSOLETE For Vxworks, the breakpoint is set and deleted by calls to */
-/* OBSOLETE CALL_DUMMY_BREAK_SET and CALL_DUMMY_BREAK_DELETE. */ */
-/* OBSOLETE */
-/* OBSOLETE #error "This file is broken. GDB does not define HOST_BYTE_ORDER." */
-/* OBSOLETE #if TARGET_BYTE_ORDER == HOST_BYTE_ORDER */
-/* OBSOLETE #define CALL_DUMMY {0x0400870f,\ */
-/* OBSOLETE 0x36008200|(MSP_HW_REGNUM), \ */
-/* OBSOLETE 0x15000040|(MSP_HW_REGNUM<<8)|(MSP_HW_REGNUM<<16), \ */
-/* OBSOLETE 0x03ff80ff, 0x02ff80ff, 0xc8008080, 0x70400101, 0x70400101} */
-/* OBSOLETE #else /* Byte order differs. */ */
-/* OBSOLETE #define CALL_DUMMY {0x0f870004,\ */
-/* OBSOLETE 0x00820036|(MSP_HW_REGNUM << 24), \ */
-/* OBSOLETE 0x40000015|(MSP_HW_REGNUM<<8)|(MSP_HW_REGNUM<<16), \ */
-/* OBSOLETE 0xff80ff03, 0xff80ff02, 0x808000c8, 0x01014070, 0x01014070} */
-/* OBSOLETE #endif /* Byte order differs. */ */
-/* OBSOLETE */
-/* OBSOLETE */
-/* OBSOLETE /* For the basic CALL_DUMMY definitions, see "tm-29k.h." We use the */
-/* OBSOLETE same CALL_DUMMY code, but define FIX_CALL_DUMMY (and related macros) */
-/* OBSOLETE locally to handle remote debugging of VxWorks targets. The difference */
-/* OBSOLETE is in the setting and clearing of the breakpoint at the end of the */
-/* OBSOLETE CALL_DUMMY code fragment; under VxWorks, we can't simply insert a */
-/* OBSOLETE breakpoint instruction into the code, since that would interfere with */
-/* OBSOLETE the breakpoint management mechanism on the target. */
-/* OBSOLETE Note that CALL_DUMMY is a piece of code that is used to call any C function */
-/* OBSOLETE thru VxGDB */ */
-/* OBSOLETE */
-/* OBSOLETE /* The offset of the instruction within the CALL_DUMMY code where we */
-/* OBSOLETE want the inferior to stop after the function call has completed. */
-/* OBSOLETE call_function_by_hand () sets a breakpoint here (via CALL_DUMMY_BREAK_SET), */
-/* OBSOLETE which POP_FRAME later deletes (via CALL_DUMMY_BREAK_DELETE). */ */
-/* OBSOLETE */
-/* OBSOLETE #define CALL_DUMMY_STOP_OFFSET (7 * 4) */
-/* OBSOLETE */
-/* OBSOLETE /* The offset of the first instruction of the CALL_DUMMY code fragment */
-/* OBSOLETE relative to the frame pointer for a dummy frame. This is equal to */
-/* OBSOLETE the size of the CALL_DUMMY plus the arg_slop area size (see the diagram */
-/* OBSOLETE in "tm-29k.h"). */ */
-/* OBSOLETE /* PAD : the arg_slop area size doesn't appear to me to be useful since, the */
-/* OBSOLETE call dummy code no longer modify the msp. See below. This must be checked. */ */
-/* OBSOLETE */
-/* OBSOLETE #define CALL_DUMMY_OFFSET_IN_FRAME (CALL_DUMMY_LENGTH + 16 * 4) */
-/* OBSOLETE */
-/* OBSOLETE /* Insert the specified number of args and function address */
-/* OBSOLETE into a CALL_DUMMY sequence stored at DUMMYNAME, replace the third */
-/* OBSOLETE instruction (add msp, msp, 16*4) with a nop, and leave the final nop. */
-/* OBSOLETE We can't keep using a CALL_DUMMY that modify the msp since, for VxWorks, */
-/* OBSOLETE CALL_DUMMY is stored in the Memory Stack. Adding 16 words to the msp */
-/* OBSOLETE would then make possible for the inferior to overwrite the CALL_DUMMY code, */
-/* OBSOLETE thus creating a lot of trouble when exiting the inferior to come back in */
-/* OBSOLETE a CALL_DUMMY code that no longer exists... Furthermore, ESF are also stored */
-/* OBSOLETE from the msp in the memory stack. If msp is set higher than the dummy code, */
-/* OBSOLETE an ESF may clobber this code. */ */
-/* OBSOLETE */
-/* OBSOLETE #if TARGET_BYTE_ORDER == BFD_ENDIAN_BIG */
-/* OBSOLETE #define NOP_INSTR 0x70400101 */
-/* OBSOLETE #else /* Target is little endian */ */
-/* OBSOLETE #define NOP_INSTR 0x01014070 */
-/* OBSOLETE #endif */
-/* OBSOLETE */
-/* OBSOLETE #undef FIX_CALL_DUMMY */
-/* OBSOLETE #define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \ */
-/* OBSOLETE { \ */
-/* OBSOLETE *(int *)((char *)dummyname + 8) = NOP_INSTR; \ */
-/* OBSOLETE STUFF_I16((char *)dummyname + CONST_INSN, fun); \ */
-/* OBSOLETE STUFF_I16((char *)dummyname + CONST_INSN + 4, fun >> 16); \ */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* For VxWorks, CALL_DUMMY must be stored in the stack of the task that is */
-/* OBSOLETE being debugged and executed "in the context of" this task */ */
-/* OBSOLETE */
-/* OBSOLETE #undef CALL_DUMMY_LOCATION */
-/* OBSOLETE #define CALL_DUMMY_LOCATION ON_STACK */
-/* OBSOLETE */
-/* OBSOLETE /* Set or delete a breakpoint at the location within a CALL_DUMMY code */
-/* OBSOLETE fragment where we want the target program to stop after the function */
-/* OBSOLETE call is complete. CALL_DUMMY_ADDR is the address of the first */
-/* OBSOLETE instruction in the CALL_DUMMY. DUMMY_FRAME_ADDR is the value of the */
-/* OBSOLETE frame pointer in the dummy frame. */
-/* OBSOLETE */
-/* OBSOLETE NOTE: in the both of the following definitions, we take advantage of */
-/* OBSOLETE knowledge of the implementation of the target breakpoint operation, */
-/* OBSOLETE in that we pass a null pointer as the second argument. It seems */
-/* OBSOLETE reasonable to assume that any target requiring the use of */
-/* OBSOLETE CALL_DUMMY_BREAK_{SET,DELETE} will not store the breakpoint */
-/* OBSOLETE shadow contents in GDB; in any case, this assumption is vaild */
-/* OBSOLETE for all VxWorks-related targets. */ */
-/* OBSOLETE */
-/* OBSOLETE #define CALL_DUMMY_BREAK_SET(call_dummy_addr) \ */
-/* OBSOLETE target_insert_breakpoint ((call_dummy_addr) + CALL_DUMMY_STOP_OFFSET, \ */
-/* OBSOLETE (char *) 0) */
-/* OBSOLETE */
-/* OBSOLETE #define CALL_DUMMY_BREAK_DELETE(dummy_frame_addr) \ */
-/* OBSOLETE target_remove_breakpoint ((dummy_frame_addr) - (CALL_DUMMY_OFFSET_IN_FRAME \ */
-/* OBSOLETE - CALL_DUMMY_STOP_OFFSET), \ */
-/* OBSOLETE (char *) 0) */
-/* OBSOLETE */
-/* OBSOLETE /* Return nonzero if the pc is executing within a CALL_DUMMY frame. */ */
-/* OBSOLETE */
-/* OBSOLETE #define PC_IN_CALL_DUMMY(pc, sp, frame_address) \ */
-/* OBSOLETE ((pc) >= (sp) \ */
-/* OBSOLETE && (pc) <= (sp) + CALL_DUMMY_OFFSET_IN_FRAME + CALL_DUMMY_LENGTH) */
-/* OBSOLETE */
-/* OBSOLETE /* Defining this prevents us from trying to pass a structure-valued argument */
-/* OBSOLETE to a function called via the CALL_DUMMY mechanism. This is not handled */
-/* OBSOLETE properly in call_function_by_hand (), and the fix might require re-writing */
-/* OBSOLETE the CALL_DUMMY handling for all targets (at least, a clean solution */
-/* OBSOLETE would probably require this). Arguably, this should go in "tm-29k.h" */
-/* OBSOLETE rather than here. */ */
-/* OBSOLETE */
-/* OBSOLETE #define STRUCT_VAL_ARGS_UNSUPPORTED */
-/* OBSOLETE */
-/* OBSOLETE #define BKPT_OFFSET (7 * 4) */
-/* OBSOLETE #define BKPT_INSTR 0x72500101 */
-/* OBSOLETE */
-/* OBSOLETE #undef FIX_CALL_DUMMY */
-/* OBSOLETE #define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \ */
-/* OBSOLETE {\ */
-/* OBSOLETE STUFF_I16((char *)dummyname + CONST_INSN, fun);\ */
-/* OBSOLETE STUFF_I16((char *)dummyname + CONST_INSN + 4, fun >> 16);\ */
-/* OBSOLETE *(int *)((char *)dummyname + BKPT_OFFSET) = BKPT_INSTR;\ */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE */
-/* OBSOLETE /* Offsets into jmp_buf. They are derived from VxWorks' REG_SET struct */
-/* OBSOLETE (see VxWorks' setjmp.h). Note that Sun2, Sun3 and SunOS4 and VxWorks have */
-/* OBSOLETE different REG_SET structs, hence different layouts for the jmp_buf struct. */
-/* OBSOLETE Only JB_PC is needed for getting the saved PC value. */ */
-/* OBSOLETE */
-/* OBSOLETE #define JB_ELEMENT_SIZE 4 /* size of each element in jmp_buf */ */
-/* OBSOLETE #define JB_PC 3 /* offset of pc (pc1) in jmp_buf */ */
-/* OBSOLETE */
-/* OBSOLETE /* Figure out where the longjmp will land. We expect that we have just entered */
-/* OBSOLETE longjmp and haven't yet setup the stack frame, so the args are still in the */
-/* OBSOLETE output regs. lr2 (LR2_REGNUM) points at the jmp_buf structure from which we */
-/* OBSOLETE extract the pc (JB_PC) that we will land at. The pc is copied into ADDR. */
-/* OBSOLETE This routine returns true on success */ */
-/* OBSOLETE */
-/* OBSOLETE #define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR) */
-/* OBSOLETE extern int get_longjmp_target (CORE_ADDR *); */
-/* OBSOLETE */
-/* OBSOLETE /* VxWorks adjusts the PC after a breakpoint has been hit. */ */
-/* OBSOLETE */
-/* OBSOLETE #undef DECR_PC_AFTER_BREAK */
-/* OBSOLETE #define DECR_PC_AFTER_BREAK 0 */
-/* OBSOLETE */
-/* OBSOLETE /* Do whatever promotions are appropriate on a value being returned */
-/* OBSOLETE from a function. VAL is the user-supplied value, and FUNC_TYPE */
-/* OBSOLETE is the return type of the function if known, else 0. */
-/* OBSOLETE */
-/* OBSOLETE For the Am29k, as far as I understand, if the function return type is known, */
-/* OBSOLETE cast the value to that type; otherwise, ensure that integer return values */
-/* OBSOLETE fill all of gr96. */
-/* OBSOLETE */
-/* OBSOLETE This definition really belongs in "tm-29k.h", since it applies */
-/* OBSOLETE to most Am29K-based systems; but once moved into that file, it might */
-/* OBSOLETE need to be redefined for all Am29K-based targets that also redefine */
-/* OBSOLETE STORE_RETURN_VALUE. For now, to be safe, we define it here. */ */
-/* OBSOLETE */
-/* OBSOLETE #define PROMOTE_RETURN_VALUE(val, func_type) \ */
-/* OBSOLETE do { \ */
-/* OBSOLETE if (func_type) \ */
-/* OBSOLETE val = value_cast (func_type, val); \ */
-/* OBSOLETE if ((TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_INT \ */
-/* OBSOLETE || TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_ENUM) \ */
-/* OBSOLETE && TYPE_LENGTH (VALUE_TYPE (val)) < REGISTER_RAW_SIZE (0)) \ */
-/* OBSOLETE val = value_cast (builtin_type_int, val); \ */
-/* OBSOLETE } while (0) */
-/* OBSOLETE */
-/* OBSOLETE extern int vx29k_frame_chain_valid (CORE_ADDR, struct frame_info *); */
-/* OBSOLETE #define FRAME_CHAIN_VALID(chain, thisframe) vx29k_frame_chain_valid (chain, thisframe) */
-/* OBSOLETE */
-/* OBSOLETE extern CORE_ADDR frame_saved_call_site (); */
-/* OBSOLETE */
-/* OBSOLETE #undef PREPARE_TO_INIT_FRAME_INFO */
-/* OBSOLETE #define PREPARE_TO_INIT_FRAME_INFO(fci) do { \ */
-/* OBSOLETE long current_msp = read_register (MSP_REGNUM); \ */
-/* OBSOLETE if (PC_IN_CALL_DUMMY (fci->pc, current_msp, 0)) \ */
-/* OBSOLETE { \ */
-/* OBSOLETE fci->rsize = DUMMY_FRAME_RSIZE; \ */
-/* OBSOLETE fci->msize = 0; \ */
-/* OBSOLETE fci->saved_msp = \ */
-/* OBSOLETE read_register_stack_integer (fci->frame + DUMMY_FRAME_RSIZE - 4, 4); \ */
-/* OBSOLETE fci->flags |= (TRANSPARENT|MFP_USED); \ */
-/* OBSOLETE return; \ */
-/* OBSOLETE } \ */
-/* OBSOLETE } while (0) */
diff --git a/gdb/config/a29k/vx29k.mt b/gdb/config/a29k/vx29k.mt
deleted file mode 100644
index 95a169e..0000000
--- a/gdb/config/a29k/vx29k.mt
+++ /dev/null
@@ -1,4 +0,0 @@
-# OBSOLETE # Target: AMD 29k running VxWorks
-# OBSOLETE TDEPFILES= a29k-tdep.o remote-vx.o remote-vx29k.o xdr_ld.o xdr_ptrace.o xdr_rdb.o
-# OBSOLETE TM_FILE= tm-vx29k.h
-# OBSOLETE MT_CFLAGS = -DNO_HIF_SUPPORT
diff --git a/gdb/config/alpha/alpha-linux.mt b/gdb/config/alpha/alpha-linux.mt
index dd1c8e2..25538b3 100644
--- a/gdb/config/alpha/alpha-linux.mt
+++ b/gdb/config/alpha/alpha-linux.mt
@@ -1,3 +1,3 @@
# Target: Little-endian Alpha
-TDEPFILES= alpha-tdep.o solib.o solib-svr4.o solib-legacy.o
+TDEPFILES= alpha-tdep.o alpha-linux-tdep.o solib.o solib-svr4.o solib-legacy.o
TM_FILE= tm-alphalinux.h
diff --git a/gdb/config/alpha/alpha-osf1.mt b/gdb/config/alpha/alpha-osf1.mt
index 98f87c1..29212c9 100644
--- a/gdb/config/alpha/alpha-osf1.mt
+++ b/gdb/config/alpha/alpha-osf1.mt
@@ -1,3 +1,3 @@
# Target: Little-endian Alpha
-TDEPFILES= alpha-tdep.o
+TDEPFILES= alpha-tdep.o alpha-osf1-tdep.o
TM_FILE= tm-alpha.h
diff --git a/gdb/config/alpha/nbsd.mh b/gdb/config/alpha/nbsd.mh
new file mode 100644
index 0000000..4d7664b
--- /dev/null
+++ b/gdb/config/alpha/nbsd.mh
@@ -0,0 +1,4 @@
+# Host: Alpha running NetBSD
+NAT_CLIBS=
+NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o alphabsd-nat.o alphanbsd-nat.o
+NAT_FILE= nm-nbsd.h
diff --git a/gdb/config/alpha/nbsd.mt b/gdb/config/alpha/nbsd.mt
new file mode 100644
index 0000000..f3a2ff1
--- /dev/null
+++ b/gdb/config/alpha/nbsd.mt
@@ -0,0 +1,3 @@
+# Target: Alpha running NetBSD
+TDEPFILES= alpha-tdep.o alphanbsd-tdep.o solib.o solib-svr4.o
+TM_FILE= tm-nbsd.h
diff --git a/gdb/config/alpha/nm-linux.h b/gdb/config/alpha/nm-linux.h
index 5d5e945..c59b88c 100644
--- a/gdb/config/alpha/nm-linux.h
+++ b/gdb/config/alpha/nm-linux.h
@@ -25,15 +25,6 @@
#include "nm-linux.h"
-/* Figure out where the longjmp will land. We expect that we have just entered
- longjmp and haven't yet setup the stack frame, so the args are still in the
- argument regs. A0_REGNUM points at the jmp_buf structure from which we
- extract the pc (JB_PC) that we will land at. The pc is copied into ADDR.
- This routine returns true on success */
-
-#define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR)
-extern int get_longjmp_target (CORE_ADDR *);
-
/* ptrace register ``addresses'' are absolute. */
#define U_REGS_OFFSET 0
@@ -50,10 +41,6 @@ extern int get_longjmp_target (CORE_ADDR *);
#define CANNOT_STEP_BREAKPOINT
-/* GNU/Linux has shared libraries. */
-
-#define GDB_TARGET_HAS_SHARED_LIBS
-
/* Given a pointer to either a gregset_t or fpregset_t, return a
pointer to the first register. */
#define ALPHA_REGSET_BASE(regsetp) ((long *) (regsetp))
diff --git a/gdb/config/alpha/nm-nbsd.h b/gdb/config/alpha/nm-nbsd.h
new file mode 100644
index 0000000..ef6ab31
--- /dev/null
+++ b/gdb/config/alpha/nm-nbsd.h
@@ -0,0 +1,33 @@
+/* Native-dependent definitions for Alpha running NetBSD, for GDB.
+ Copyright 2002 Free Software Foundation, Inc.
+ Contributed by Wasabi Systems, 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. */
+
+#ifndef NM_NBSD_H
+#define NM_NBSD_H
+
+#define SVR4_SHARED_LIBS
+
+/* Get generic NetBSD native definitions. */
+#include "config/nm-nbsd.h"
+
+/* The Alpha does not step over a breakpoint. */
+#define CANNOT_STEP_BREAKPOINT
+
+#endif /* NM_NBSD_H */
diff --git a/gdb/config/alpha/nm-osf.h b/gdb/config/alpha/nm-osf.h
index 5fc99e4..20b5ae4 100644
--- a/gdb/config/alpha/nm-osf.h
+++ b/gdb/config/alpha/nm-osf.h
@@ -18,15 +18,6 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* Figure out where the longjmp will land. We expect that we have just entered
- longjmp and haven't yet setup the stack frame, so the args are still in the
- argument regs. A0_REGNUM points at the jmp_buf structure from which we
- extract the pc (JB_PC) that we will land at. The pc is copied into ADDR.
- This routine returns true on success */
-
-#define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR)
-extern int get_longjmp_target (CORE_ADDR *);
-
/* ptrace register ``addresses'' are absolute. */
#define U_REGS_OFFSET 0
@@ -43,10 +34,6 @@ extern int get_longjmp_target (CORE_ADDR *);
#define CANNOT_STEP_BREAKPOINT
-/* OSF/1 has shared libraries. */
-
-#define GDB_TARGET_HAS_SHARED_LIBS
-
/* Support for shared libraries. */
#include "solib.h"
diff --git a/gdb/config/alpha/tm-alpha.h b/gdb/config/alpha/tm-alpha.h
index 58412d0..feb752a 100644
--- a/gdb/config/alpha/tm-alpha.h
+++ b/gdb/config/alpha/tm-alpha.h
@@ -24,353 +24,28 @@
#ifndef TM_ALPHA_H
#define TM_ALPHA_H
-#include "regcache.h"
+#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
+
#include "bfd.h"
#include "coff/sym.h" /* Needed for PDR below. */
#include "coff/symconst.h"
struct frame_info;
-struct type;
-struct value;
struct symbol;
-/* Redefine some target bit sizes from the default. */
-
-#define TARGET_LONG_BIT 64
-#define TARGET_LONG_LONG_BIT 64
-#define TARGET_PTR_BIT 64
-
-/* Number of traps that happen between exec'ing the shell
- * to run an inferior, and when we finally get to
- * the inferior code. This is 2 on most implementations.
- */
+/* Number of traps that happen between exec'ing the shell
+ to run an inferior, and when we finally get to
+ the inferior code. This is 2 on most implementations. */
#define START_INFERIOR_TRAPS_EXPECTED 3
-/* Offset from address of function to start of its code.
- Zero on most machines. */
-
-#define FUNCTION_START_OFFSET 0
-
-/* Advance PC across any function entry prologue instructions
- to reach some "real" code. */
-
-#define SKIP_PROLOGUE(pc) alpha_skip_prologue((pc))
-extern CORE_ADDR alpha_skip_prologue (CORE_ADDR addr);
-
-/* 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) alpha_saved_pc_after_call(frame)
-extern CORE_ADDR alpha_saved_pc_after_call (struct frame_info *);
-
-/* Are we currently handling a signal ? */
-
-#define IN_SIGTRAMP(pc, name) alpha_osf_in_sigtramp ((pc), (name))
-extern int alpha_osf_in_sigtramp (CORE_ADDR, char *);
-
-/* Stack grows downward. */
-
-#define INNER_THAN(lhs,rhs) core_addr_lessthan ((lhs), (rhs))
-
-#define BREAKPOINT {0x80, 0, 0, 0} /* call_pal bpt */
-
-/* Amount PC must be decremented by after a breakpoint.
- This is often the number of bytes in BREAKPOINT
- but not always. */
-
-#ifndef DECR_PC_AFTER_BREAK
-#define DECR_PC_AFTER_BREAK 4
-#endif
-
-/* Say how long (ordinary) registers are. This is a piece of bogosity
- used in push_word and a few other places; REGISTER_RAW_SIZE is the
- real way to know how big a register is. */
-
-#define REGISTER_SIZE 8
-
-/* Number of machine registers */
-
-#define NUM_REGS 66
-
-
-/* Return the name of register REGNO. */
-
-#define REGISTER_NAME(regno) alpha_register_name ((regno))
-extern char *alpha_register_name (int);
-
-
-/* Register numbers of various important registers.
- Note that most of these values are "real" register numbers,
- and correspond to the general registers of the machine,
- and FP_REGNUM is a "phony" register number which is too large
- to be an actual register number as far as the user is concerned
- but serves to get the desired value when passed to read_register. */
-
-#define V0_REGNUM 0 /* Function integer return value */
-#define T7_REGNUM 8 /* Return address register for OSF/1 __add* */
-#define GCC_FP_REGNUM 15 /* Used by gcc as frame register */
-#define A0_REGNUM 16 /* Loc of first arg during a subr call */
-#define T9_REGNUM 23 /* Return address register for OSF/1 __div* */
-#define T12_REGNUM 27 /* Contains start addr of current proc */
-#define SP_REGNUM 30 /* Contains address of top of stack */
-#define RA_REGNUM 26 /* Contains return address value */
-#define ZERO_REGNUM 31 /* Read-only register, always 0 */
-#define FP0_REGNUM 32 /* Floating point register 0 */
-#define FPA0_REGNUM 48 /* First float arg during a subr call */
-#define FPCR_REGNUM 63 /* Floating point control register */
-#define PC_REGNUM 64 /* Contains program counter */
-#define FP_REGNUM 65 /* Virtual frame pointer */
-
-#define CANNOT_FETCH_REGISTER(regno) \
- alpha_cannot_fetch_register ((regno))
-extern int alpha_cannot_fetch_register (int);
-
-#define CANNOT_STORE_REGISTER(regno) \
- alpha_cannot_store_register ((regno))
-extern int alpha_cannot_store_register (int);
-
-/* Total amount of space needed to store our copies of the machine's
- register state, the array `registers'. */
-#define REGISTER_BYTES (NUM_REGS * 8)
-
-/* Index within `registers' of the first byte of the space for
- register N. */
-
-#define REGISTER_BYTE(N) alpha_register_byte ((N))
-extern int alpha_register_byte (int);
-
-/* Number of bytes of storage in the actual machine representation
- for register N. On Alphas, all regs are 8 bytes. */
-
-#define REGISTER_RAW_SIZE(N) alpha_register_raw_size ((N))
-extern int alpha_register_raw_size (int);
-
-/* Number of bytes of storage in the program's representation
- for register N. On Alphas, all regs are 8 bytes. */
-
-#define REGISTER_VIRTUAL_SIZE(N) alpha_register_virtual_size ((N))
-extern int alpha_register_virtual_size (int);
-
-/* Largest value REGISTER_RAW_SIZE can have. */
-
-#define MAX_REGISTER_RAW_SIZE 8
-
-/* Largest value REGISTER_VIRTUAL_SIZE can have. */
-
-#define MAX_REGISTER_VIRTUAL_SIZE 8
-
-/* Nonzero if register N requires conversion
- from raw format to virtual format.
- The alpha needs a conversion between register and memory format if
- the register is a floating point register and
- memory format is float, as the register format must be double
- or
- memory format is an integer with 4 bytes or less, as the representation
- of integers in floating point registers is different. */
-
-#define REGISTER_CONVERTIBLE(N) alpha_register_convertible ((N))
-extern int alpha_register_convertible (int);
-
-/* Convert data from raw format for register REGNUM in buffer FROM
- to virtual format with type TYPE in buffer TO. */
-
-#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM, TYPE, FROM, TO) \
- alpha_register_convert_to_virtual (REGNUM, TYPE, FROM, TO)
-extern void
-alpha_register_convert_to_virtual (int, struct type *, char *, char *);
-
-/* Convert data from virtual format with type TYPE in buffer FROM
- to raw format for register REGNUM in buffer TO. */
-
-#define REGISTER_CONVERT_TO_RAW(TYPE, REGNUM, FROM, TO) \
- alpha_register_convert_to_raw (TYPE, REGNUM, FROM, TO)
-extern void
-alpha_register_convert_to_raw (struct type *, int, char *, char *);
-
-/* Return the GDB type object for the "standard" data type
- of data in register N. */
-
-#define REGISTER_VIRTUAL_TYPE(N) alpha_register_virtual_type ((N))
-extern struct type * alpha_register_virtual_type (int);
-
-/* Store the address of the place in which to copy the structure the
- subroutine will return. Handled by alpha_push_arguments. */
-
-#define STORE_STRUCT_RETURN(addr, sp) \
- alpha_store_struct_return ((addr), (sp))
-extern void alpha_store_struct_return (CORE_ADDR, CORE_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) \
- alpha_extract_return_value(TYPE, REGBUF, VALBUF)
-extern void alpha_extract_return_value (struct type *, char *, char *);
-
-/* Write into appropriate registers a function return value
- of type TYPE, given in virtual format. */
-
-#define STORE_RETURN_VALUE(TYPE,VALBUF) \
- alpha_store_return_value(TYPE, VALBUF)
-extern void alpha_store_return_value (struct type *, char *);
-
-/* 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). */
-/* The address is passed in a0 upon entry to the function, but when
- the function exits, the compiler has copied the value to v0. This
- convention is specified by the System V ABI, so I think we can rely
- on it. */
-
-#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
- alpha_extract_struct_value_address (REGBUF)
-extern CORE_ADDR alpha_extract_struct_value_address (char *);
-
-/* Structures are returned by ref in extra arg0 */
-#define USE_STRUCT_CONVENTION(gcc_p, type) \
- alpha_use_struct_convention ((gcc_p), (type))
-extern int alpha_use_struct_convention (int, struct type *);
-
-
-/* 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. */
-
-#define FRAME_CHAIN(thisframe) alpha_frame_chain (thisframe)
-extern CORE_ADDR alpha_frame_chain (struct frame_info *);
-
-/* Define other aspects of the stack frame. */
-
-
-/* An expression that tells us whether the function invocation represented
- by FI does not have a frame on the stack associated with it. */
-/* We handle this differently for alpha, and maybe we should not */
-
-#define FRAMELESS_FUNCTION_INVOCATION(FI) \
- generic_frameless_function_invocation_not ((FI))
-
-/* Saved Pc. */
-
-#define FRAME_SAVED_PC(FRAME) alpha_frame_saved_pc(FRAME)
-extern CORE_ADDR alpha_frame_saved_pc (struct frame_info *);
-
-/* The alpha has two different virtual pointers for arguments and locals.
-
- The virtual argument pointer is pointing to the bottom of the argument
- transfer area, which is located immediately below the virtual frame
- pointer. Its size is fixed for the native compiler, it is either zero
- (for the no arguments case) or large enough to hold all argument registers.
- gcc uses a variable sized argument transfer area. As it has
- to stay compatible with the native debugging tools it has to use the same
- virtual argument pointer and adjust the argument offsets accordingly.
-
- The virtual local pointer is localoff bytes below the virtual frame
- pointer, the value of localoff is obtained from the PDR. */
-
-#define ALPHA_NUM_ARG_REGS 6
-
-#define FRAME_ARGS_ADDRESS(fi) alpha_frame_args_address ((fi))
-extern CORE_ADDR alpha_frame_args_address (struct frame_info *);
-
-#define FRAME_LOCALS_ADDRESS(fi) alpha_frame_locals_address ((fi))
-extern CORE_ADDR alpha_frame_locals_address (struct frame_info *);
-
-/* Return number of args passed to a frame.
- Can return -1, meaning no way to tell. */
-
-#define FRAME_NUM_ARGS(fi) frame_num_args_unknown ((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_INIT_SAVED_REGS(frame_info) \
- alpha_frame_init_saved_regs (frame_info)
-extern void alpha_frame_init_saved_regs (struct frame_info *);
-
-
-/* Things needed for making the inferior call functions. */
-
-#define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \
- (alpha_push_arguments((nargs), (args), (sp), (struct_return), (struct_addr)))
-extern CORE_ADDR
-alpha_push_arguments (int, struct value **, CORE_ADDR, int, CORE_ADDR);
-
-/* Push an empty stack frame, to record the current PC, etc. */
-
-#define PUSH_DUMMY_FRAME alpha_push_dummy_frame()
-extern void alpha_push_dummy_frame (void);
-
-/* Discard from the stack the innermost frame, restoring all registers. */
-
-#define POP_FRAME alpha_pop_frame()
-extern void alpha_pop_frame (void);
-
-/* Alpha OSF/1 inhibits execution of code on the stack.
- But there is no need for a dummy on the alpha. PUSH_ARGUMENTS
- takes care of all argument handling and bp_call_dummy takes care
- of stopping the dummy. */
-
-#define CALL_DUMMY_LOCATION AT_ENTRY_POINT
-
-/* On the Alpha the call dummy code is never copied to user space,
- stopping the user call is achieved via a bp_call_dummy breakpoint.
- But we need a fake CALL_DUMMY definition to enable the proper
- call_function_by_hand and to avoid zero length array warnings
- in valops.c */
-
-#define CALL_DUMMY_P (1)
-
-#define CALL_DUMMY_WORDS alpha_call_dummy_words
-extern LONGEST alpha_call_dummy_words[];
-
-#define SIZEOF_CALL_DUMMY_WORDS 0
-
-#define CALL_DUMMY_START_OFFSET (0)
-
-#define CALL_DUMMY_BREAKPOINT_OFFSET (0)
-
-#define CALL_DUMMY_ADDRESS() alpha_call_dummy_address()
-extern CORE_ADDR alpha_call_dummy_address (void);
-
-/* Insert the specified number of args and function address
- into a call sequence of the above form stored at DUMMYNAME.
- We only have to set RA_REGNUM to the dummy breakpoint address
- and T12_REGNUM (the `procedure value register') to the function address. */
-
-#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
- alpha_fix_call_dummy ((dummyname), (pc), (fun), (nargs), (args), \
- (type), (gcc_p))
-extern void alpha_fix_call_dummy (char *, CORE_ADDR, CORE_ADDR, int,
- struct value **, struct type *, int);
-
-/* There's a mess in stack frame creation. See comments in blockframe.c
- near reference to INIT_FRAME_PC_FIRST. */
-
-#define INIT_FRAME_PC(fromleaf, prev) init_frame_pc_noop ((fromleaf), (prev))
-
-#define INIT_FRAME_PC_FIRST(fromleaf, prev) \
- alpha_init_frame_pc_first ((fromleaf), (prev))
-extern void alpha_init_frame_pc_first (int, struct frame_info *);
-
/* Special symbol found in blocks associated with routines. We can hang
alpha_extra_func_info_t's off of this. */
#define MIPS_EFI_SYMBOL_NAME "__GDB_EFI_INFO__"
extern void ecoff_relocate_efi (struct symbol *, CORE_ADDR);
+#define RA_REGNUM 26 /* XXXJRT needed by mdebugread.c */
+
/* Specific information about a procedure.
This overlays the ALPHA's PDR records,
alpharead.c (ab)uses this to save memory */
@@ -390,10 +65,6 @@ typedef struct alpha_extra_func_info
#define mips_extra_func_info_t alpha_extra_func_info_t
-#define INIT_EXTRA_FRAME_INFO(fromleaf, fci) \
- alpha_init_extra_frame_info(fromleaf, fci)
-extern void alpha_init_extra_frame_info (int, struct frame_info *);
-
#define PRINT_EXTRA_FRAME_INFO(fi) alpha_print_extra_frame_info ((fi))
extern void alpha_print_extra_frame_info (struct frame_info *);
@@ -408,64 +79,8 @@ extern void alpha_print_extra_frame_info (struct frame_info *);
up so that the primary value is the SP, and the PC is used to disambiguate
multiple functions with the same SP that are at different stack levels. */
-#define SETUP_ARBITRARY_FRAME(argc, argv) setup_arbitrary_frame (argc, argv)
-extern struct frame_info *setup_arbitrary_frame (int, CORE_ADDR *);
-
-/* This is used by heuristic_proc_start. It should be shot it the head. */
-#ifndef VM_MIN_ADDRESS
-#define VM_MIN_ADDRESS (CORE_ADDR)0x120000000
-#endif
-
-/* If PC is in a shared library trampoline code, return the PC
- where the function itself actually starts. If not, return 0. */
-#define SKIP_TRAMPOLINE_CODE(pc) find_solib_trampoline_target (pc)
-
-/* If the current gcc for for this target does not produce correct debugging
- information for float parameters, both prototyped and unprototyped, then
- define this macro. This forces gdb to always assume that floats are
- passed as doubles and then converted in the callee.
-
- For the alpha, it appears that the debug info marks the parameters as
- floats regardless of whether the function is prototyped, but the actual
- values are always passed in as doubles. Thus by setting this to 1, both
- types of calls will work. */
-
-#define COERCE_FLOAT_TO_DOUBLE(formal, actual) \
- standard_coerce_float_to_double ((formal), (actual))
-
-/* Return TRUE if procedure descriptor PROC is a procedure descriptor
- that refers to a dynamically generated sigtramp function.
-
- OSF/1 doesn't use dynamic sigtramp functions, so this is always
- FALSE. */
-
-#define PROC_DESC_IS_DYN_SIGTRAMP(proc) (0)
-#define SET_PROC_DESC_IS_DYN_SIGTRAMP(proc)
-
-/* If PC is inside a dynamically generated sigtramp function, return
- how many bytes the program counter is beyond the start of that
- function. Otherwise, return a negative value.
-
- OSF/1 doesn't use dynamic sigtramp functions, so this always
- returns -1. */
-
-#define DYNAMIC_SIGTRAMP_OFFSET(pc) (-1)
-
-/* Translate a signal handler frame into the address of the sigcontext
- structure. */
-
-#define SIGCONTEXT_ADDR(frame) \
- (read_memory_integer ((frame)->next ? frame->next->frame : frame->frame, 8))
-
-/* If FRAME refers to a sigtramp frame, return the address of the next
- frame. */
-
-#define FRAME_PAST_SIGTRAMP_FRAME(frame, pc) \
- (alpha_osf_skip_sigtramp_frame (frame, pc))
-extern CORE_ADDR alpha_osf_skip_sigtramp_frame (struct frame_info *,
- CORE_ADDR);
-
-/* Single step based on where the current instruction will take us. */
-extern void alpha_software_single_step (enum target_signal, int);
+#define SETUP_ARBITRARY_FRAME(argc, argv) \
+ alpha_setup_arbitrary_frame (argc, argv)
+extern struct frame_info *alpha_setup_arbitrary_frame (int, CORE_ADDR *);
#endif /* TM_ALPHA_H */
diff --git a/gdb/config/alpha/tm-alphalinux.h b/gdb/config/alpha/tm-alphalinux.h
index 23592aa..27ff457 100644
--- a/gdb/config/alpha/tm-alphalinux.h
+++ b/gdb/config/alpha/tm-alphalinux.h
@@ -27,14 +27,9 @@
#include "alpha/tm-alpha.h"
-/* Are we currently handling a signal ? */
-
-extern long alpha_linux_sigtramp_offset (CORE_ADDR);
-#undef IN_SIGTRAMP
-#define IN_SIGTRAMP(pc, name) (alpha_linux_sigtramp_offset (pc) >= 0)
-
/* Get start and end address of sigtramp handler. */
+extern LONGEST alpha_linux_sigtramp_offset (CORE_ADDR);
#define SIGTRAMP_START(pc) (pc - alpha_linux_sigtramp_offset (pc))
#define SIGTRAMP_END(pc) (SIGTRAMP_START(pc) + 3*4)
@@ -42,42 +37,9 @@ extern long alpha_linux_sigtramp_offset (CORE_ADDR);
/* Number of traps that happen between exec'ing the shell to run an
inferior, and when we finally get to the inferior code. This is 2
on GNU/Linux and most implementations. */
-
#undef START_INFERIOR_TRAPS_EXPECTED
#define START_INFERIOR_TRAPS_EXPECTED 2
-/* Return TRUE if procedure descriptor PROC is a procedure descriptor
- that refers to a dynamically generated sigtramp function. */
-
-#undef PROC_DESC_IS_DYN_SIGTRAMP
-#define PROC_SIGTRAMP_MAGIC 0x0e0f0f0f
-#define PROC_DESC_IS_DYN_SIGTRAMP(proc) ((proc)->pdr.isym \
- == PROC_SIGTRAMP_MAGIC)
-#undef SET_PROC_DESC_IS_DYN_SIGTRAMP
-#define SET_PROC_DESC_IS_DYN_SIGTRAMP(proc) ((proc)->pdr.isym \
- = PROC_SIGTRAMP_MAGIC)
-
-/* If PC is inside a dynamically generated sigtramp function, return
- how many bytes the program counter is beyond the start of that
- function. Otherwise, return a negative value. */
-
-#undef DYNAMIC_SIGTRAMP_OFFSET
-#define DYNAMIC_SIGTRAMP_OFFSET(pc) (alpha_linux_sigtramp_offset (pc))
-
-/* Translate a signal handler frame into the address of the sigcontext
- structure. */
-
-#undef SIGCONTEXT_ADDR
-#define SIGCONTEXT_ADDR(frame) ((frame)->frame - 0x298)
-
-/* If FRAME refers to a sigtramp frame, return the address of the next frame.
-
- Under GNU/Linux, sigtramp handlers have dynamically generated
- procedure descriptors that make this hack unnecessary. */
-
-#undef FRAME_PAST_SIGTRAMP_FRAME
-#define FRAME_PAST_SIGTRAMP_FRAME(frame, pc) (0)
-
#include "tm-linux.h"
#endif /* TM_LINUXALPHA_H */
diff --git a/gdb/config/alpha/tm-fbsd.h b/gdb/config/alpha/tm-fbsd.h
index 00d3c27..d1d5254 100644
--- a/gdb/config/alpha/tm-fbsd.h
+++ b/gdb/config/alpha/tm-fbsd.h
@@ -1,5 +1,5 @@
/* Target-dependent definitions for FreeBSD/Alpha.
- Copyright 2000, 2001 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of GDB.
@@ -23,19 +23,6 @@
#include "alpha/tm-alpha.h"
-/* FreeBSD uses the old gcc convention for struct returns. */
-
-#undef USE_STRUCT_CONVENTION
-#define USE_STRUCT_CONVENTION(gcc_p, type) \
- alphafbsd_use_struct_convention (gcc_p, type)
-
-/* FreeBSD doesn't mark the outermost frame. While some FreeBSD/Alpha
- releases include (a minimal amount of) debugging info in its
- startup code (crt1.o), the safest thing is to consider the user
- code entry point as the outermost frame. */
-#define FRAME_CHAIN_VALID(chain, thisframe) \
- func_frame_chain_valid(chain, thisframe)
-
/* Number of traps that happen between exec'ing the shell to run an
inferior, and when we finally get to the inferior code. The
default is right for FreeBSD. */
diff --git a/gdb/config/alpha/tm-nbsd.h b/gdb/config/alpha/tm-nbsd.h
new file mode 100644
index 0000000..9e92656
--- /dev/null
+++ b/gdb/config/alpha/tm-nbsd.h
@@ -0,0 +1,32 @@
+/* Target-dependent definitions for NetBSD/Alpha.
+ Copyright 2002 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. */
+
+#ifndef TM_NBSD_H
+#define TM_NBSD_H
+
+#include "alpha/tm-alpha.h"
+
+/* Number of traps that happen between exec'ing the shell to run an
+ inferior, and when we finally get to the inferior code. The
+ default is right for NetBSD. */
+
+#undef START_INFERIOR_TRAPS_EXPECTED
+
+#endif /* TM_NBSD_H */
diff --git a/gdb/config/arc/tm-arc.h b/gdb/config/arc/tm-arc.h
index cd94476..cbdcf41 100644
--- a/gdb/config/arc/tm-arc.h
+++ b/gdb/config/arc/tm-arc.h
@@ -29,15 +29,14 @@
#define FUNCTION_START_OFFSET 0
/* Advance PC across any function entry prologue instructions
- to reach some "real" code. SKIP_PROLOGUE_FRAMELESS_P advances
- the PC past some of the prologue, but stops as soon as it
- knows that the function has a frame. Its result is equal
- to its input PC if the function is frameless, unequal otherwise. */
+ to reach some "real" code. */
#define SKIP_PROLOGUE(pc) (arc_skip_prologue (pc, 0))
-#define SKIP_PROLOGUE_FRAMELESS_P(pc) (arc_skip_prologue (pc, 1))
extern CORE_ADDR arc_skip_prologue (CORE_ADDR, int);
+#define PROLOGUE_FRAMELESS_P(pc) arc_prologue_frameless_p(pc)
+extern int arc_prologue_frameless_p (CORE_ADDR);
+
/* Sequence of bytes for breakpoint instruction.
??? The current value is "sr -1,[-1]" and is for the simulator only.
The simulator watches for this and does the right thing.
diff --git a/gdb/config/avr/avr.mt b/gdb/config/avr/avr.mt
new file mode 100644
index 0000000..0354a42
--- /dev/null
+++ b/gdb/config/avr/avr.mt
@@ -0,0 +1,12 @@
+# Target: AVR
+TDEPFILES= avr-tdep.o
+
+#
+# There is no simulator provided with gdb (yet).
+#
+# See <http://savannah.gnu.org/projects/simulavr/> for the simulator
+# used during development of avr support for gdb.
+#
+# Simulator: AVR
+#SIM_OBS = remote-sim.o
+#SIM = ../sim/avr/libsim.a
diff --git a/gdb/config/djgpp/README b/gdb/config/djgpp/README
index 2427b64..805e1df 100644
--- a/gdb/config/djgpp/README
+++ b/gdb/config/djgpp/README
@@ -98,16 +98,17 @@ follows:
3. How to build
------------
-The source distribution available from DJGPP archives is already
-configured for DJGPP v2.x, so if you only want to compile it, just
-invoke Make:
+If the source distribution available from DJGPP archives is already
+configured for DJGPP v2.x (if it is, you will find files named
+`Makefile' in each subdirectory), then just invoke Make:
make
-To build a package downloaded from a GNU FTP site, you will need o
-configure it first. You will also need to configure it if you want to
-change the configuration options (e.g., compile without support for the
-GDBMI interface). To configure GDB, type this command:
+To build a package that is not yet configured, or if you downloaded
+GDB from a GNU FTP site, you will need to configure it first. You
+will also need to configure it if you want to change the configuration
+options (e.g., compile without support for the GDBMI interface). To
+configure GDB, type this command:
sh ./gdb/config/djgpp/djconfig.sh
diff --git a/gdb/config/h8500/tm-h8500.h b/gdb/config/h8500/tm-h8500.h
index f326165..fae6704 100644
--- a/gdb/config/h8500/tm-h8500.h
+++ b/gdb/config/h8500/tm-h8500.h
@@ -275,7 +275,6 @@ extern CORE_ADDR h8500_read_sp (void);
extern void h8500_write_sp (CORE_ADDR);
extern CORE_ADDR h8500_read_fp (void);
-extern void h8500_write_fp (CORE_ADDR);
extern CORE_ADDR h8500_read_pc (ptid_t);
extern void h8500_write_pc (CORE_ADDR, ptid_t);
@@ -287,4 +286,3 @@ extern void h8500_write_pc (CORE_ADDR, ptid_t);
#define TARGET_WRITE_PC(x,pid) h8500_write_pc(x,pid)
#define TARGET_READ_FP() h8500_read_fp()
-#define TARGET_WRITE_FP(x) h8500_write_fp(x)
diff --git a/gdb/config/i386/fbsd.mh b/gdb/config/i386/fbsd.mh
index 364dfa6..4509b9c 100644
--- a/gdb/config/i386/fbsd.mh
+++ b/gdb/config/i386/fbsd.mh
@@ -4,4 +4,4 @@ XM_FILE= xm-i386.h
NAT_FILE= nm-fbsd.h
# NOTE: Do not spread NATDEPFILES over several lines - it hurts BSD make.
-NATDEPFILES= fork-child.o infptrace.o inftarg.o solib.o solib-svr4.o solib-legacy.o corelow.o core-aout.o core-regset.o i386-nat.o i387-nat.o i386bsd-nat.o i386fbsd-nat.o
+NATDEPFILES= fork-child.o infptrace.o inftarg.o solib.o solib-svr4.o solib-legacy.o corelow.o core-aout.o core-regset.o i386-nat.o i387-nat.o i386bsd-nat.o i386fbsd-nat.o gcore.o fbsd-proc.o
diff --git a/gdb/config/i386/i386gnu.mh b/gdb/config/i386/i386gnu.mh
index 252b2e5..13feba5 100644
--- a/gdb/config/i386/i386gnu.mh
+++ b/gdb/config/i386/i386gnu.mh
@@ -1,5 +1,9 @@
# Host: Intel 386 running the GNU Hurd
-NATDEPFILES= i386gnu-nat.o i387-nat.o gnu-nat.o fork-child.o solib.o solib-svr4.o solib-legacy.o corelow.o notify_S.o process_reply_S.o msg_reply_S.o msg_U.o exc_request_U.o exc_request_S.o
+NATDEPFILES= i386gnu-nat.o i387-nat.o gnu-nat.o corelow.o core-regset.o \
+ fork-child.o solib.o solib-svr4.o solib-legacy.o \
+ notify_S.o process_reply_S.o msg_reply_S.o \
+ msg_U.o exc_request_U.o exc_request_S.o
+
XM_FILE= xm-i386gnu.h
NAT_FILE= nm-gnu.h
MH_CFLAGS = -D_GNU_SOURCE
diff --git a/gdb/config/i386/i386lynx.mh b/gdb/config/i386/i386lynx.mh
index 0552b4d..edfb1b0 100644
--- a/gdb/config/i386/i386lynx.mh
+++ b/gdb/config/i386/i386lynx.mh
@@ -4,6 +4,3 @@ XM_CLIBS= -lbsd
NAT_FILE= nm-i386lynx.h
NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o lynx-nat.o
-
-## OBSOLETE ## GDBSERVER_LIBS= -lbsd
-## OBSOLETE ## GDBSERVER_DEPFILES= low-lynx.o
diff --git a/gdb/config/i386/i386v42mp.mh b/gdb/config/i386/i386v42mp.mh
index 007a8bf..6479be3 100644
--- a/gdb/config/i386/i386v42mp.mh
+++ b/gdb/config/i386/i386v42mp.mh
@@ -14,5 +14,7 @@ NAT_FILE= nm-i386v42mp.h
# continuation character (backslash) to extend a commented line. As a
# consequence, make considers subsequent tab-indented lines to be
# some sort of error.
-NATDEPFILES= corelow.o core-regset.o fork-child.o i386v4-nat.o i387-nat.o solib.o solib-svr4.o solib-legacy.o procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o uw-thread.o
+NATDEPFILES= corelow.o core-regset.o fork-child.o i386v4-nat.o i387-nat.o \
+ gcore.o solib.o solib-svr4.o solib-legacy.o procfs.o proc-api.o \
+ proc-events.o proc-flags.o proc-why.o uw-thread.o
diff --git a/gdb/config/i386/nbsd.mt b/gdb/config/i386/nbsd.mt
index 8ab606e..b8fc668 100644
--- a/gdb/config/i386/nbsd.mt
+++ b/gdb/config/i386/nbsd.mt
@@ -1,5 +1,3 @@
# Target: Intel 386 running NetBSD
TDEPFILES= i386-tdep.o i387-tdep.o i386bsd-tdep.o i386nbsd-tdep.o
TM_FILE= tm-nbsd.h
-
-## OBSOLETE ## GDBSERVER_DEPFILES= low-nbsd.o
diff --git a/gdb/config/i386/nbsdelf.mt b/gdb/config/i386/nbsdelf.mt
index ab173d3..1bccd32 100644
--- a/gdb/config/i386/nbsdelf.mt
+++ b/gdb/config/i386/nbsdelf.mt
@@ -1,5 +1,3 @@
# Target: Intel 386 running NetBSD
TDEPFILES= i386-tdep.o i387-tdep.o i386bsd-tdep.o
TM_FILE= tm-nbsdelf.h
-
-## OBSOLETE ## GDBSERVER_DEPFILES= low-nbsd.o
diff --git a/gdb/config/i386/nm-fbsd.h b/gdb/config/i386/nm-fbsd.h
index 939b880..b791903 100644
--- a/gdb/config/i386/nm-fbsd.h
+++ b/gdb/config/i386/nm-fbsd.h
@@ -56,6 +56,9 @@ extern unsigned long i386bsd_dr_get_status (void);
/* Override child_resume in `infptrace.c' to work around a kernel bug. */
#define CHILD_RESUME
+/* Override child_pid_to_exec_file in 'inftarg.c'. */
+#define CHILD_PID_TO_EXEC_FILE
+
/* We can attach and detach. */
#define ATTACH_DETACH
diff --git a/gdb/config/i386/nm-x86-64.h b/gdb/config/i386/nm-x86-64.h
index 0d7048e..30e3731 100644
--- a/gdb/config/i386/nm-x86-64.h
+++ b/gdb/config/i386/nm-x86-64.h
@@ -65,10 +65,8 @@ extern int kernel_u_size (void);
to get the offset in the core file of the register values. */
#define KERNEL_U_ADDR 0x0
-/* FIXME use special child_xfer_memory. */
-#define CHILD_XFER_MEMORY
-
#define PTRACE_ARG3_TYPE void*
+#define PTRACE_XFER_TYPE unsigned long
/* We define this if link.h is available, because with ELF we use SVR4 style
@@ -82,9 +80,6 @@ extern int kernel_u_size (void);
/* Override copies of {fetch,store}_inferior_registers in `infptrace.c'. */
#define FETCH_INFERIOR_REGISTERS
-/* Override child_resume in `infptrace.c'. */
-#define CHILD_RESUME
-
#undef PREPARE_TO_PROCEED
#include <signal.h>
diff --git a/gdb/config/i386/tm-linux.h b/gdb/config/i386/tm-linux.h
index 5c549b9..60c4b1e 100644
--- a/gdb/config/i386/tm-linux.h
+++ b/gdb/config/i386/tm-linux.h
@@ -26,6 +26,7 @@
#define I386_GNULINUX_TARGET
#define HAVE_I387_REGS
#ifdef HAVE_PTRACE_GETFPXREGS
+#define FILL_FPXREGSET
#define HAVE_SSE_REGS
#endif
diff --git a/gdb/config/i386/x86-64linux.mt b/gdb/config/i386/x86-64linux.mt
index 1f3a796..85f1972 100644
--- a/gdb/config/i386/x86-64linux.mt
+++ b/gdb/config/i386/x86-64linux.mt
@@ -1,5 +1,3 @@
# Target: AMD x86-64 running GNU/Linux
TDEPFILES= x86-64-tdep.o x86-64-linux-tdep.o i387-tdep.o dwarf2cfi.o \
solib.o solib-svr4.o solib-legacy.o
-
-## OBSOLETE ## GDBSERVER_DEPFILES= low-linux.o
diff --git a/gdb/config/i960/tm-i960.h b/gdb/config/i960/tm-i960.h
index 2b24889..a62e35d 100644
--- a/gdb/config/i960/tm-i960.h
+++ b/gdb/config/i960/tm-i960.h
@@ -1,6 +1,8 @@
/* Parameters for target machine Intel 960, for GDB, the GNU debugger.
- Copyright 1990, 1991, 1993, 1994, 1996, 1998, 1999, 2000
- Free Software Foundation, Inc.
+
+ Copyright 1990, 1991, 1993, 1994, 1996, 1998, 1999, 2000, 2002 Free
+ Software Foundation, Inc.
+
Contributed by Intel Corporation.
This file is part of GDB.
@@ -114,21 +116,16 @@ extern CORE_ADDR saved_pc_after_call ();
/* The i960 has register windows, sort of. */
-#define HAVE_REGISTER_WINDOWS
-
-/* Is this register part of the register window system? A yes answer
- implies that 1) The name of this register will not be the same in
- other frames, and 2) This register is automatically "saved" upon
- subroutine calls and thus there is no need to search more than one
- stack frame for it.
+extern void i960_get_saved_register (char *raw_buffer,
+ int *optimized,
+ CORE_ADDR *addrp,
+ struct frame_info *frame,
+ int regnum,
+ enum lval_type *lval);
- On the i960, in fact, the name of this register in another frame is
- "mud" -- there is no overlap between the windows. Each window is
- simply saved into the stack (true for our purposes, after having been
- flushed; normally they reside on-chip and are restored from on-chip
- without ever going to memory). */
+#define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) \
+ i960_get_saved_register(raw_buffer, optimized, addrp, frame, regnum, lval)
-#define REGISTER_IN_WINDOW_P(regnum) ((regnum) <= R15_REGNUM)
/* Number of bytes of storage in the actual machine representation
for register N. On the i960, all regs are 4 bytes except for floating
diff --git a/gdb/config/m32r/m32r.mt b/gdb/config/m32r/m32r.mt
index 2be2649..a200853 100644
--- a/gdb/config/m32r/m32r.mt
+++ b/gdb/config/m32r/m32r.mt
@@ -3,6 +3,3 @@ TDEPFILES= m32r-tdep.o monitor.o m32r-rom.o dsrec.o
TM_FILE= tm-m32r.h
SIM_OBS = remote-sim.o
SIM = ../sim/m32r/libsim.a
-
-## OBSOLETE ## GDBSERVER_DEPFILES= low-sim.o
-## OBSOLETE ## GDBSERVER_LIBS = ../../sim/m32r/libsim.a ../../bfd/libbfd.a ../../libiberty/libiberty.a ../../opcodes/libopcodes.a ../../intl/libintl.a
diff --git a/gdb/config/m68k/m68klynx.mh b/gdb/config/m68k/m68klynx.mh
index 803dac3..3838012 100644
--- a/gdb/config/m68k/m68klynx.mh
+++ b/gdb/config/m68k/m68klynx.mh
@@ -4,6 +4,3 @@ XM_CLIBS= -lbsd
NAT_FILE= nm-m68klynx.h
NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o lynx-nat.o
-
-## OBSOLETE ## GDBSERVER_LIBS= -lbsd
-## OBSOLETE ## GDBSERVER_DEPFILES= low-lynx.o
diff --git a/gdb/config/m68k/nbsd.mt b/gdb/config/m68k/nbsd.mt
index d83d91d..b6ac5a0 100644
--- a/gdb/config/m68k/nbsd.mt
+++ b/gdb/config/m68k/nbsd.mt
@@ -1,5 +1,3 @@
# Target: Motorola m68k running NetBSD
TDEPFILES= m68k-tdep.o m68knbsd-tdep.o
TM_FILE= tm-nbsd.h
-
-## OBSOLETE ## GDBSERVER_DEPFILES= low-nbsd.o
diff --git a/gdb/config/m68k/sun3os4.mh b/gdb/config/m68k/sun3os4.mh
index 4ed46a2..18b1f08 100644
--- a/gdb/config/m68k/sun3os4.mh
+++ b/gdb/config/m68k/sun3os4.mh
@@ -2,5 +2,3 @@
XM_FILE= xm-sun3os4.h
NAT_FILE= nm-sun3.h
NATDEPFILES= fork-child.o inftarg.o infptrace.o corelow.o sun3-nat.o
-
-## OBSOLETE ## GDBSERVER_DEPFILES= low-sun3.o
diff --git a/gdb/config/m68k/tm-nbsd.h b/gdb/config/m68k/tm-nbsd.h
index 178bf56..354632a 100644
--- a/gdb/config/m68k/tm-nbsd.h
+++ b/gdb/config/m68k/tm-nbsd.h
@@ -1,4 +1,4 @@
-/* Macro definitions for i386 running under NetBSD.
+/* Macro definitions for m68k running under NetBSD.
Copyright 1994, 1996, 2001 Free Software Foundation, Inc.
This file is part of GDB.
diff --git a/gdb/config/mcore/tm-mcore.h b/gdb/config/mcore/tm-mcore.h
index 7ce6373..1da21b7 100644
--- a/gdb/config/mcore/tm-mcore.h
+++ b/gdb/config/mcore/tm-mcore.h
@@ -1,5 +1,6 @@
/* Parameters for execution on a Motorola MCore.
- Copyright 1995, 1999, 2000 Free Software Foundation, Inc.
+
+ Copyright 1995, 1999, 2000, 2002 Free Software Foundation, Inc.
This file is part of GDB.
@@ -19,6 +20,8 @@
Boston, MA 02111-1307, USA. */
#include "regcache.h"
+#include "symtab.h" /* For namespace_enum. */
+#include "symfile.h" /* For entry_point_address(). */
/* All registers are 32 bits */
#define REGISTER_SIZE 4
@@ -62,7 +65,8 @@ extern char *mcore_register_names[];
/* BREAKPOINT_FROM_PC uses the program counter value to determine
the breakpoint that should be used. */
-extern breakpoint_from_pc_fn mcore_breakpoint_from_pc;
+extern const unsigned char *mcore_breakpoint_from_pc (CORE_ADDR *pcptr,
+ int *lenptr);
#define BREAKPOINT_FROM_PC(PCPTR, LENPTR) mcore_breakpoint_from_pc (PCPTR, LENPTR)
#define INNER_THAN(LHS,RHS) ((LHS) < (RHS))
diff --git a/gdb/config/mips/vr5000.mt b/gdb/config/mips/vr5000.mt
index f9811d0..7a4a915 100644
--- a/gdb/config/mips/vr5000.mt
+++ b/gdb/config/mips/vr5000.mt
@@ -3,6 +3,3 @@ TDEPFILES= mips-tdep.o remote-mips.o
TM_FILE= tm-vr5000.h
SIM_OBS = remote-sim.o
SIM = ../sim/mips/libsim.a
-
-## OBSOLETE ## GDBSERVER_DEPFILES= low-sim.o
-## OBSOLETE ## GDBSERVER_LIBS = ../../sim/mips/libsim.a ../../bfd/libbfd.a ../../libiberty/libiberty.a -lm ../../intl/libintl.a
diff --git a/gdb/config/mn10200/tm-mn10200.h b/gdb/config/mn10200/tm-mn10200.h
index 66fb037..4402b78 100644
--- a/gdb/config/mn10200/tm-mn10200.h
+++ b/gdb/config/mn10200/tm-mn10200.h
@@ -1,5 +1,7 @@
/* Parameters for execution on a Matsushita mn10200 processor.
- Copyright 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+ Copyright 1997, 1998, 1999, 2000, 2001, 2002 Free Software
+ Foundation, Inc.
Contributed by Geoffrey Noer <noer@cygnus.com>
@@ -24,6 +26,8 @@
declared in "regcache.h". The ``correct fix'' is to convert those
macros into functions. */
#include "regcache.h"
+#include "symtab.h" /* For namespace_enum. */
+#include "symfile.h" /* For entry_point_address(). */
/* ints are only 16bits on the mn10200. */
#undef TARGET_INT_BIT
diff --git a/gdb/config/ns32k/nbsd.mt b/gdb/config/ns32k/nbsd.mt
index f677af1..14d37f9 100644
--- a/gdb/config/ns32k/nbsd.mt
+++ b/gdb/config/ns32k/nbsd.mt
@@ -1,5 +1,3 @@
# Target: PC532 running NetBSD
TDEPFILES= ns32k-tdep.o
TM_FILE= tm-nbsd.h
-
-## OBSOLETE ## GDBSERVER_DEPFILES= low-nbsd.o
diff --git a/gdb/config/pa/hppabsd.mh b/gdb/config/pa/hppabsd.mh
index 0f66bb6..d4a152d 100644
--- a/gdb/config/pa/hppabsd.mh
+++ b/gdb/config/pa/hppabsd.mh
@@ -2,5 +2,3 @@
XM_FILE= xm-hppab.h
NAT_FILE= nm-hppab.h
NATDEPFILES= hppab-nat.o corelow.o core-aout.o inftarg.o fork-child.o somread.o infptrace.o hpread.o somsolib.o
-
-## OBSOLETE ## GDBSERVER_DEPFILES= low-hppabsd.o
diff --git a/gdb/config/pa/hppaosf.mh b/gdb/config/pa/hppaosf.mh
index 95a689a..d6dd282 100644
--- a/gdb/config/pa/hppaosf.mh
+++ b/gdb/config/pa/hppaosf.mh
@@ -3,6 +3,3 @@ XM_FILE= xm-hppab.h
NAT_FILE= nm-hppao.h
NATDEPFILES= fork-child.o m3-nat.o hppam3-nat.o somread.o hpread.o somsolib.o
NAT_CLIBS= -lmachid -lnetname -lmach
-
-## OBSOLETE ## GDBSERVER_DEPFILES= low-hppabsd.o
-
diff --git a/gdb/config/pa/hpux1020.mh b/gdb/config/pa/hpux1020.mh
index e9c24ee..18f542e 100644
--- a/gdb/config/pa/hpux1020.mh
+++ b/gdb/config/pa/hpux1020.mh
@@ -1,6 +1,10 @@
# Host: Hewlett-Packard PA-RISC machine, running HPUX 10.20
-MH_CFLAGS = -D__HP_CURSES
+# FIXME: cagney/2002-04-07: gdb/366: The -Dvfork=fork hack below is
+# stop GDB hanging on HP/UX. For some reason vfork() hangs yet fork()
+# doesn't ....
+
+MH_CFLAGS = -D__HP_CURSES -Dvfork=fork
XM_FILE= xm-hppah.h
diff --git a/gdb/config/pa/hpux11.mh b/gdb/config/pa/hpux11.mh
index a9919c4..25504e0 100644
--- a/gdb/config/pa/hpux11.mh
+++ b/gdb/config/pa/hpux11.mh
@@ -1,6 +1,10 @@
# Host: Hewlett-Packard PA-RISC machine, running HPUX 11.00
-MH_CFLAGS = -D__HP_CURSES
+# FIXME: cagney/2002-04-07: gdb/366: The -Dvfork=fork hack below is
+# stop GDB hanging on HP/UX. For some reason vfork() hangs yet fork()
+# doesn't ....
+
+MH_CFLAGS = -D__HP_CURSES -Dvfork=fork
XM_FILE= xm-hppah.h
diff --git a/gdb/config/pa/hpux11w.mh b/gdb/config/pa/hpux11w.mh
index 279efa1..b784263 100644
--- a/gdb/config/pa/hpux11w.mh
+++ b/gdb/config/pa/hpux11w.mh
@@ -1,6 +1,10 @@
# Host: Hewlett-Packard PA-RISC machine, running HPUX 11.00
-MH_CFLAGS = -D__HP_CURSES
+# FIXME: cagney/2002-04-07: gdb/366: The -Dvfork=fork hack below is
+# stop GDB hanging on HP/UX. For some reason vfork() hangs yet fork()
+# doesn't ....
+
+MH_CFLAGS = -D__HP_CURSES -Dvfork=fork
XM_FILE= xm-hppah.h
diff --git a/gdb/config/pa/tm-hppa.h b/gdb/config/pa/tm-hppa.h
index 36e57bd..227108f 100644
--- a/gdb/config/pa/tm-hppa.h
+++ b/gdb/config/pa/tm-hppa.h
@@ -376,15 +376,8 @@ extern void init_extra_frame_info (int, struct frame_info *);
/* 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.
-
- FRAME_CHAIN_COMBINE takes the chain pointer and the frame's nominal address
- and produces the nominal address of the caller frame.
-
- However, if FRAME_CHAIN_VALID returns zero,
- it means the given frame is the outermost one and has no caller.
- In that case, FRAME_CHAIN_COMBINE is not used. */
+/* FRAME_CHAIN takes a frame's nominal address and produces the
+ frame's chain-pointer. */
/* In the case of the PA-RISC, the frame's nominal address
is the address of a 4-byte word containing the calling frame's
@@ -396,8 +389,6 @@ extern CORE_ADDR frame_chain (struct frame_info *);
extern int hppa_frame_chain_valid (CORE_ADDR, struct frame_info *);
#define FRAME_CHAIN_VALID(chain, thisframe) hppa_frame_chain_valid (chain, thisframe)
-#define FRAME_CHAIN_COMBINE(chain, thisframe) (chain)
-
/* Define other aspects of the stack frame. */
/* A macro that tells us whether the function invocation represented
diff --git a/gdb/config/powerpc/nbsd.mt b/gdb/config/powerpc/nbsd.mt
index 164abfe..40a2a99 100644
--- a/gdb/config/powerpc/nbsd.mt
+++ b/gdb/config/powerpc/nbsd.mt
@@ -2,7 +2,5 @@
TDEPFILES= rs6000-tdep.o ppc-linux-tdep.o solib.o solib-svr4.o
TM_FILE= tm-nbsd.h
-## OBSOLETE ## GDBSERVER_DEPFILES= low-nbsd.o
-
SIM_OBS = remote-sim.o
SIM = ../sim/ppc/libsim.a
diff --git a/gdb/config/powerpc/tm-ppc-eabi.h b/gdb/config/powerpc/tm-ppc-eabi.h
index 92e4127..e49b2bd 100644
--- a/gdb/config/powerpc/tm-ppc-eabi.h
+++ b/gdb/config/powerpc/tm-ppc-eabi.h
@@ -28,17 +28,11 @@
#undef SOFTWARE_SINGLE_STEP_P
#define SOFTWARE_SINGLE_STEP_P() 0
-#undef DEFAULT_LR_SAVE
-#define DEFAULT_LR_SAVE 4 /* eabi saves LR at 4 off of SP */
-
#undef PROCESS_LINENUMBER_HOOK
#undef TEXT_SEGMENT_BASE
#define TEXT_SEGMENT_BASE 1
-/* Say that we're using ELF, not XCOFF. */
-#define ELF_OBJECT_FORMAT 1
-
/* The value of symbols of type N_SO and N_FUN maybe null when
it shouldn't be. */
#define SOFUN_ADDRESS_MAYBE_MISSING
diff --git a/gdb/config/rs6000/rs6000lynx.mh b/gdb/config/rs6000/rs6000lynx.mh
index 2ae49c2..096473f 100644
--- a/gdb/config/rs6000/rs6000lynx.mh
+++ b/gdb/config/rs6000/rs6000lynx.mh
@@ -4,6 +4,3 @@ XM_CLIBS= -lbsd
NAT_FILE= nm-rs6000ly.h
NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o lynx-nat.o xcoffread.o
-
-## OBSOLETE ## GDBSERVER_LIBS= -lbsd
-## OBSOLETE ## GDBSERVER_DEPFILES= low-lynx.o
diff --git a/gdb/config/rs6000/tm-rs6000.h b/gdb/config/rs6000/tm-rs6000.h
index 015a592..202ac77 100644
--- a/gdb/config/rs6000/tm-rs6000.h
+++ b/gdb/config/rs6000/tm-rs6000.h
@@ -93,9 +93,6 @@ extern void aix_process_linenos (void);
prev->next ? FRAME_SAVED_PC (prev->next) : read_pc ());
#define INIT_FRAME_PC(fromleaf, prev) /* nothing */
-/* Default offset from SP where the LR is stored */
-#define DEFAULT_LR_SAVE 8
-
/* Flag for machine-specific stuff in shared files. FIXME */
#define IBM6000_TARGET
diff --git a/gdb/config/s390/s390.mh b/gdb/config/s390/s390.mh
index 28e2a1f..300a5e3 100644
--- a/gdb/config/s390/s390.mh
+++ b/gdb/config/s390/s390.mh
@@ -4,9 +4,9 @@ XM_FILE= xm-linux.h
XM_CLIBS=
NAT_FILE= nm-linux.h
-NATDEPFILES= infptrace.o solib.o inftarg.o fork-child.o corelow.o s390-nat.o core-aout.o core-regset.o
-# post 5.0 natdepfiles.
-NATDEPFILES+= thread-db.o lin-lwp.o proc-service.o
+NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o s390-nat.o \
+ core-aout.o core-regset.o linux-proc.o gcore.o thread-db.o lin-lwp.o \
+ proc-service.o
LOADLIBES = -ldl -rdynamic
diff --git a/gdb/config/s390/s390.mt b/gdb/config/s390/s390.mt
index 9095058..6b8d91f 100644
--- a/gdb/config/s390/s390.mt
+++ b/gdb/config/s390/s390.mt
@@ -4,5 +4,3 @@ TDEPFILES=s390-tdep.o solib.o
# Post 5.0 tdep-files
TDEPFILES+=solib-svr4.o solib-legacy.o
GDB_MULTI_ARCH=GDB_MULTI_ARCH_PARTIAL
-
-## OBSOLETE ## GDBSERVER_DEPFILES= low-linux.o s390-tdep.o s390-nat.o
diff --git a/gdb/config/s390/s390x.mt b/gdb/config/s390/s390x.mt
index 4df35a1..7b23cad 100644
--- a/gdb/config/s390/s390x.mt
+++ b/gdb/config/s390/s390x.mt
@@ -5,7 +5,5 @@ TDEPFILES=s390-tdep.o solib.o
TDEPFILES+=solib-svr4.o solib-legacy.o
GDB_MULTI_ARCH=GDB_MULTI_ARCH_PARTIAL
-## OBSOLETE ## GDBSERVER_DEPFILES= low-linux.o s390-tdep.o s390-nat.o
-
# needed for gdbserver.
MT_CFLAGS= -DCONFIG_ARCH_S390X
diff --git a/gdb/config/sparc/linux.mh b/gdb/config/sparc/linux.mh
index f2c26d5..4a2c41f 100644
--- a/gdb/config/sparc/linux.mh
+++ b/gdb/config/sparc/linux.mh
@@ -12,5 +12,3 @@ NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o sparc-nat.o \
LOADLIBES = -ldl -rdynamic
HOST_IPC=-DBSD_IPC
-
-## OBSOLETE ## GDBSERVER_DEPFILES= low-sparc.o
diff --git a/gdb/config/sparc/sparclynx.mh b/gdb/config/sparc/sparclynx.mh
index b938b2f..c573604 100644
--- a/gdb/config/sparc/sparclynx.mh
+++ b/gdb/config/sparc/sparclynx.mh
@@ -4,6 +4,3 @@ XM_CLIBS= -lbsd
NAT_FILE= nm-sparclynx.h
NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o lynx-nat.o
-
-## OBSOLETE ## GDBSERVER_LIBS= -lbsd
-## OBSOLETE ## GDBSERVER_DEPFILES= low-lynx.o
diff --git a/gdb/config/sparc/sun4os4.mh b/gdb/config/sparc/sun4os4.mh
index 516be36..4e664d7 100644
--- a/gdb/config/sparc/sun4os4.mh
+++ b/gdb/config/sparc/sun4os4.mh
@@ -3,8 +3,6 @@ NAT_FILE= nm-sun4os4.h
NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o sparc-nat.o
HOST_IPC=-DBSD_IPC
-## OBSOLETE ## GDBSERVER_DEPFILES= low-sparc.o
-
# Setting XM_CLIBS=-lresolv would let us use the DNS, but that would screw
# anyone who wants to use NIS, which includes at least one Cygnus customer
# (PR 3593). So leave it this way until/unless we find a resolver which can
diff --git a/gdb/config/sparc/tm-linux.h b/gdb/config/sparc/tm-linux.h
index c3a6f82..34d901f 100644
--- a/gdb/config/sparc/tm-linux.h
+++ b/gdb/config/sparc/tm-linux.h
@@ -23,6 +23,8 @@
#ifndef TM_SPARCLINUX_H
#define TM_SPARCLINUX_H
+#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
+
#include "sparc/tm-sparc.h"
#define SIGCONTEXT_PC_OFFSET 12
diff --git a/gdb/config/sparc/tm-sp64.h b/gdb/config/sparc/tm-sp64.h
index 55006c6..8486c86 100644
--- a/gdb/config/sparc/tm-sp64.h
+++ b/gdb/config/sparc/tm-sp64.h
@@ -268,12 +268,10 @@ CORE_ADDR sparc64_push_arguments (int,
extern CORE_ADDR sparc64_read_sp ();
extern CORE_ADDR sparc64_read_fp ();
extern void sparc64_write_sp (CORE_ADDR);
-extern void sparc64_write_fp (CORE_ADDR);
#define TARGET_READ_SP() (sparc64_read_sp ())
#define TARGET_READ_FP() (sparc64_read_fp ())
#define TARGET_WRITE_SP(X) (sparc64_write_sp (X))
-#define TARGET_WRITE_FP(X) (sparc64_write_fp (X))
#undef EXTRACT_RETURN_VALUE
#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
diff --git a/gdb/config/sparc/tm-sp64linux.h b/gdb/config/sparc/tm-sp64linux.h
index 2503ccb..56b5620 100644
--- a/gdb/config/sparc/tm-sp64linux.h
+++ b/gdb/config/sparc/tm-sp64linux.h
@@ -21,8 +21,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef TM_SPARC_LIN64_H
#define TM_SPARC_LIN64_H
-#define GDB_MULTI_ARCH 0
-
#include "sparc/tm-sp64.h"
#define SIGCONTEXT_PC_OFFSET 16 /* See asm-sparc64/sigcontext.h */
diff --git a/gdb/config/sparc/tm-sparc.h b/gdb/config/sparc/tm-sparc.h
index 4db7ab7..4a53580 100644
--- a/gdb/config/sparc/tm-sparc.h
+++ b/gdb/config/sparc/tm-sparc.h
@@ -248,12 +248,10 @@ extern int sparc_intreg_size (void);
#define BELIEVE_PCC_PROMOTION 1
/* Advance PC across any function entry prologue instructions
- to reach some "real" code. SKIP_PROLOGUE_FRAMELESS_P advances
- the PC past some of the prologue, but stops as soon as it
- knows that the function has a frame. Its result is equal
- to its input PC if the function is frameless, unequal otherwise. */
+ to reach some "real" code. */
-#define SKIP_PROLOGUE(PC) sparc_skip_prologue (PC, 0)
+extern CORE_ADDR sparc_skip_prologue (CORE_ADDR);
+#define SKIP_PROLOGUE(PC) sparc_skip_prologue (PC)
/* Immediately after a function call, return the saved pc.
Can't go through the frames for this because on some machines
@@ -312,6 +310,10 @@ extern CORE_ADDR sparc32_stack_align (CORE_ADDR addr);
sparc_reg_struct_has_addr (GCC_P, TYPE)
extern int sparc_reg_struct_has_addr (int, struct type *);
+/* Is the prologue at PC frameless? */
+#define PROLOGUE_FRAMELESS_P(PC) sparc_prologue_frameless_p (PC)
+extern int sparc_prologue_frameless_p (CORE_ADDR);
+
#endif /* GDB_MULTI_ARCH */
#if defined (GDB_MULTI_ARCH) && (GDB_MULTI_ARCH > 0)
@@ -333,15 +335,6 @@ extern int sparc_y_regnum (void);
#define PC_ADJUST(PC) sparc_pc_adjust (PC)
extern CORE_ADDR sparc_pc_adjust (CORE_ADDR);
-/* Advance PC across any function entry prologue instructions to reach
- some "real" code. SKIP_PROLOGUE_FRAMELESS_P advances the PC past
- some of the prologue, but stops as soon as it knows that the
- function has a frame. Its result is equal to its input PC if the
- function is frameless, unequal otherwise. */
-
-#define SKIP_PROLOGUE_FRAMELESS_P(PC) sparc_skip_prologue (PC, 1)
-extern CORE_ADDR sparc_skip_prologue (CORE_ADDR, int);
-
/* If an argument is declared "register", Sun cc will keep it in a register,
never saving it onto the stack. So we better not believe the "p" symbol
descriptor stab. */
@@ -468,9 +461,8 @@ extern CORE_ADDR sparc_skip_prologue (CORE_ADDR, int);
/* time of the register saves. */ \
int sp_offset;
-/* We need to override GET_SAVED_REGISTER so that we can deal with the way
- 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. */
+/* We need to override GET_SAVED_REGISTER so that we can deal with the
+ way outs change into ins in different frames. */
void sparc_get_saved_register (char *raw_buffer,
int *optimized,
diff --git a/gdb/config/v850/tm-v850.h b/gdb/config/v850/tm-v850.h
index 0636b98..c085cb5 100644
--- a/gdb/config/v850/tm-v850.h
+++ b/gdb/config/v850/tm-v850.h
@@ -1,6 +1,7 @@
/* Parameters for execution on an NEC V850 processor.
- Copyright 1996, 1997, 1998, 1999, 2000
- Free Software Foundation, Inc.
+
+ Copyright 1996, 1997, 1998, 1999, 2000, 2002 Free Software
+ Foundation, Inc.
This file is part of GDB.
@@ -20,6 +21,8 @@
Boston, MA 02111-1307, USA. */
#include "regcache.h"
+#include "symtab.h" /* For namespace_enum. */
+#include "symfile.h" /* For entry_point_address(). */
#define NUM_REGS 66
@@ -72,7 +75,6 @@ extern char **v850_register_names;
#define FP_RAW_REGNUM 29
#define TARGET_READ_FP() read_register (FP_RAW_REGNUM)
-#define TARGET_WRITE_FP(VAL) write_register (FP_REGNUM, (VAL))
#define REGISTER_VIRTUAL_TYPE(REG) builtin_type_int
diff --git a/gdb/config/vax/tm-vax.h b/gdb/config/vax/tm-vax.h
index bfa243c..204d155 100644
--- a/gdb/config/vax/tm-vax.h
+++ b/gdb/config/vax/tm-vax.h
@@ -1,5 +1,5 @@
/* Definitions to make GDB run on a vax under 4.2bsd.
- Copyright 1986, 1987, 1989, 1991, 1993, 1994, 1996, 1998, 1999, 2000
+ Copyright 1986, 1987, 1989, 1991, 1993, 1994, 1996, 1998, 1999, 2000, 2002
Free Software Foundation, Inc.
This file is part of GDB.
@@ -19,25 +19,7 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include "regcache.h"
-
-/* 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 vax_skip_prologue (CORE_ADDR);
-#define SKIP_PROLOGUE(pc) (vax_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)
+#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
#define TARGET_UPAGES 14
#define TARGET_NBPG 512
@@ -49,260 +31,18 @@ extern CORE_ADDR vax_skip_prologue (CORE_ADDR);
#define SIGTRAMP_START(pc) STACK_END_ADDR
#define SIGTRAMP_END(pc) 0x80000000
-/* Stack grows downward. */
-
-#define INNER_THAN(lhs,rhs) ((lhs) < (rhs))
-
/* Sequence of bytes for breakpoint instruction. */
-
#define BREAKPOINT {3}
-/* 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
-
-/* 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 17
-
-/* 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", "ap", "fp", "sp", "pc", "ps"}
-
-/* Register numbers of various important registers.
- Note that some of these values are "real" register numbers,
- and correspond to the general registers of the machine,
- and some are "phony" register numbers which are too large
- to be actual register numbers as far as the user is concerned
- but do serve to get the desired values when passed to read_register. */
-
-#define AP_REGNUM 12
-#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 */
-
-/* Total amount of space needed to store our copies of the machine's
- register state, the array `registers'. */
-#define REGISTER_BYTES (17*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 vax, 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 vax, 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 Vax, the frame's nominal address is the FP value,
- and 12 bytes later comes the saved previous FP value as a 4-byte word. */
-
-#define FRAME_CHAIN(thisframe) \
- (!inside_entry_file ((thisframe)->pc) ? \
- read_memory_integer ((thisframe)->frame + 12, 4) :\
- 0)
-
-/* Define other aspects of the stack frame. */
-
-/* A macro that tells us whether the function invocation represented
- by FI does not have a frame on the stack associated with it. If it
- does not, FRAMELESS is set to 1, else 0. */
-/* On the vax, all functions have frames. */
-#define FRAMELESS_FUNCTION_INVOCATION(FI) (0)
-
-/* Saved Pc. Get it from sigcontext if within sigtramp. */
+#define AP_REGNUM 12 /* XXXJRT */
/* Offset to saved PC in sigcontext, from <sys/signal.h>. */
+/* XXXJRT should go away */
#define SIGCONTEXT_PC_OFFSET 12
-#define FRAME_SAVED_PC(FRAME) \
- (((FRAME)->signal_handler_caller \
- ? sigtramp_saved_pc (FRAME) \
- : read_memory_integer ((FRAME)->frame + 16, 4)) \
- )
-
-/* Cannot find the AP register value directly from the FP value. Must
- find it saved in the frame called by this one, or in the AP
- register for the innermost frame. However, there is no way to tell
- the difference between the innermost frame and a frame for which we
- just don't know the frame that it called (e.g. "info frame
- 0x7ffec789"). For the sake of argument suppose that the stack is
- somewhat trashed (which is one reason that "info frame" exists).
- So return 0 (indicating we don't know the address of
- the arglist) if we don't know what frame this frame calls. */
-#define FRAME_ARGS_ADDRESS_CORRECT(fi) \
- (((fi)->next \
- ? read_memory_integer ((fi)->next->frame + 8, 4) \
- : /* read_register (AP_REGNUM) */ 0))
-
-/* In most of GDB, getting the args address is too important to
- just say "I don't know". This is sometimes wrong for functions
- that aren't on top of the stack, but c'est la vie. */
-#define FRAME_ARGS_ADDRESS(fi) \
- (((fi)->next \
- ? read_memory_integer ((fi)->next->frame + 8, 4) \
- : read_register (AP_REGNUM) /* 0 */))
-
-#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 vax_frame_num_args (struct frame_info *fi);
-#define FRAME_NUM_ARGS(fi) (vax_frame_num_args ((fi)))
-
-/* Return number of bytes at start of arglist that are not really args. */
-
-#define FRAME_ARGS_SKIP 4
-
-/* 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 regmask = 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 + 16; \
- /* Regmask's low bit is for register 0, \
- which is the first one that would be pushed. */ \
- for (regnum = 0; regnum < 12; regnum++, regmask >>= 1) \
- (frame_saved_regs).regs[regnum] = (regmask & 1) ? (next_addr += 4) : 0; \
- (frame_saved_regs).regs[SP_REGNUM] = next_addr + 4; \
- if (read_memory_integer ((frame_info)->frame + 4, 4) & 0x20000000) \
- (frame_saved_regs).regs[SP_REGNUM] += 4 + 4 * read_memory_integer (next_addr + 4, 4); \
- (frame_saved_regs).regs[PC_REGNUM] = (frame_info)->frame + 16; \
- (frame_saved_regs).regs[FP_REGNUM] = (frame_info)->frame + 12; \
- (frame_saved_regs).regs[AP_REGNUM] = (frame_info)->frame + 8; \
- (frame_saved_regs).regs[PS_REGNUM] = (frame_info)->frame + 4; \
-}
-
-/* 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; \
- sp = push_word (sp, 0); /* arglist */ \
- for (regnum = 11; regnum >= 0; regnum--) \
- sp = push_word (sp, read_register (regnum)); \
- sp = push_word (sp, read_register (PC_REGNUM)); \
- sp = push_word (sp, read_register (FP_REGNUM)); \
- sp = push_word (sp, read_register (AP_REGNUM)); \
- sp = push_word (sp, (read_register (PS_REGNUM) & 0xffef) \
- + 0x2fff0000); \
- sp = push_word (sp, 0); \
- write_register (SP_REGNUM, sp); \
- write_register (FP_REGNUM, sp); \
- write_register (AP_REGNUM, sp + 17 * sizeof (int)); }
-
-/* 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); \
- write_register (PS_REGNUM, \
- (regmask & 0xffff) \
- | (read_register (PS_REGNUM) & 0xffff0000)); \
- write_register (PC_REGNUM, read_memory_integer (fp + 16, 4)); \
- write_register (FP_REGNUM, read_memory_integer (fp + 12, 4)); \
- write_register (AP_REGNUM, read_memory_integer (fp + 8, 4)); \
- fp += 16; \
- for (regnum = 0; regnum < 12; regnum++) \
- if (regmask & (0x10000 << regnum)) \
- write_register (regnum, read_memory_integer (fp += 4, 4)); \
- fp = fp + 4 + ((regmask >> 30) & 3); \
- if (regmask & 0x20000000) \
- { regnum = read_memory_integer (fp, 4); \
- fp += (regnum + 1) * 4; } \
- write_register (SP_REGNUM, fp); \
- flush_cached_frames (); \
-}
-
-/* This sequence of words is the instructions
- calls #69, @#32323232
- bpt
- Note this is 8 bytes. */
-
-#define CALL_DUMMY {0x329f69fb, 0x03323232}
-
-#define CALL_DUMMY_START_OFFSET 0 /* Start execution at beginning of dummy */
-
-#define CALL_DUMMY_BREAKPOINT_OFFSET 7
-
-/* Insert the specified number of args and function address
- into a call sequence of the above form stored at DUMMYNAME. */
-
-#define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
-{ *((char *) dummyname + 1) = nargs; \
- *(int *)((char *) dummyname + 3) = fun; }
+/* XXXJRT not yet under gdbarch control */
+#define FRAME_ARGS_ADDRESS_CORRECT(fi) vax_frame_args_address_correct ((fi))
+extern CORE_ADDR vax_frame_args_address_correct (struct frame_info *);
/* If vax pcc says CHAR or SHORT, it provides the correct address. */
-
#define BELIEVE_PCC_PROMOTION 1
diff --git a/gdb/configure b/gdb/configure
index 20dbe8f..e192e4c 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -934,54 +934,32 @@ fi
rm -f conftest*
-
- echo $ac_n "checking for strerror in -lcposix""... $ac_c" 1>&6
-echo "configure:940: checking for strerror in -lcposix" >&5
-ac_lib_var=`echo cposix'_'strerror | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- ac_save_LIBS="$LIBS"
-LIBS="-lcposix $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 948 "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
- builtin and then its argument prototype would still apply. */
-char strerror();
-
-int main() {
-strerror()
-; return 0; }
+echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
+echo "configure:939: checking for POSIXized ISC" >&5
+if test -d /etc/conf/kconfig.d &&
+ grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
+then
+ echo "$ac_t""yes" 1>&6
+ ISC=yes # If later tests want to check for ISC.
+ cat >> confdefs.h <<\EOF
+#define _POSIX_SOURCE 1
EOF
-if { (eval echo configure:959: \"$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
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- LIBS="$LIBS -lcposix"
+ if test "$GCC" = yes; then
+ CC="$CC -posix"
+ else
+ CC="$CC -Xp"
+ fi
else
echo "$ac_t""no" 1>&6
+ ISC=
fi
-
-
echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
-echo "configure:985: checking for ${CC-cc} option to accept ANSI C" >&5
+echo "configure:963: checking for ${CC-cc} option to accept ANSI C" >&5
if eval "test \"`echo '$''{'am_cv_prog_cc_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -991,13 +969,14 @@ ac_save_CC="$CC"
# breaks some systems' header files.
# AIX -qlanglvl=ansi
# Ultrix and OSF/1 -std1
-# HP-UX -Aa -D_HPUX_SOURCE
+# HP-UX 10.20 and later -Ae
+# HP-UX older versions -Aa -D_HPUX_SOURCE
# SVR4 -Xc -D__EXTENSIONS__
-for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do
CC="$ac_save_CC $ac_arg"
cat > conftest.$ac_ext <<EOF
-#line 1001 "configure"
+#line 980 "configure"
#include "confdefs.h"
#include <stdarg.h>
#include <stdio.h>
@@ -1034,7 +1013,7 @@ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
; return 0; }
EOF
-if { (eval echo configure:1038: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1017: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
am_cv_prog_cc_stdc="$ac_arg"; break
else
@@ -1105,7 +1084,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:1109: checking host system type" >&5
+echo "configure:1088: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -1126,7 +1105,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$host" 1>&6
echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:1130: checking target system type" >&5
+echo "configure:1109: checking target system type" >&5
target_alias=$target
case "$target_alias" in
@@ -1144,7 +1123,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$target" 1>&6
echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:1148: checking build system type" >&5
+echo "configure:1127: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -1169,7 +1148,7 @@ test "$host_alias" != "$target_alias" &&
ALL_LINGUAS=
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1173: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:1152: checking whether ${MAKE-make} sets \${MAKE}" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1198,7 +1177,7 @@ fi
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1202: checking for $ac_word" >&5
+echo "configure:1181: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1226,12 +1205,12 @@ else
fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1230: checking for ANSI C header files" >&5
+echo "configure:1209: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1235 "configure"
+#line 1214 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -1239,7 +1218,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1243: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1222: \"$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*
@@ -1256,7 +1235,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 1260 "configure"
+#line 1239 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -1274,7 +1253,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 1278 "configure"
+#line 1257 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -1295,7 +1274,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 1299 "configure"
+#line 1278 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1306,7 +1285,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:1310: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1289: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -1330,12 +1309,12 @@ EOF
fi
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1334: checking for working const" >&5
+echo "configure:1313: 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 1339 "configure"
+#line 1318 "configure"
#include "confdefs.h"
int main() {
@@ -1384,7 +1363,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:1388: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1367: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -1405,21 +1384,21 @@ EOF
fi
echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:1409: checking for inline" >&5
+echo "configure:1388: checking for inline" >&5
if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
cat > conftest.$ac_ext <<EOF
-#line 1416 "configure"
+#line 1395 "configure"
#include "confdefs.h"
int main() {
} $ac_kw foo() {
; return 0; }
EOF
-if { (eval echo configure:1423: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1402: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_inline=$ac_kw; break
else
@@ -1445,12 +1424,12 @@ EOF
esac
echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:1449: checking for off_t" >&5
+echo "configure:1428: checking for off_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1454 "configure"
+#line 1433 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -1478,12 +1457,12 @@ EOF
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:1482: checking for size_t" >&5
+echo "configure:1461: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1487 "configure"
+#line 1466 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -1513,19 +1492,19 @@ fi
# 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:1517: checking for working alloca.h" >&5
+echo "configure:1496: 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 1522 "configure"
+#line 1501 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:1529: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1508: \"$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
@@ -1546,12 +1525,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:1550: checking for alloca" >&5
+echo "configure:1529: 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 1555 "configure"
+#line 1534 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -1579,7 +1558,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:1583: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1562: \"$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
@@ -1611,12 +1590,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:1615: checking whether alloca needs Cray hooks" >&5
+echo "configure:1594: 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 1620 "configure"
+#line 1599 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -1641,12 +1620,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:1645: checking for $ac_func" >&5
+echo "configure:1624: 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 1650 "configure"
+#line 1629 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1669,7 +1648,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1673: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1652: \"$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
@@ -1696,7 +1675,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:1700: checking stack direction for C alloca" >&5
+echo "configure:1679: 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
@@ -1704,7 +1683,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 1708 "configure"
+#line 1687 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -1723,7 +1702,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:1727: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1706: \"$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
@@ -1748,17 +1727,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:1752: checking for $ac_hdr" >&5
+echo "configure:1731: 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 1757 "configure"
+#line 1736 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1762: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1741: \"$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*
@@ -1787,12 +1766,12 @@ done
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1791: checking for $ac_func" >&5
+echo "configure:1770: 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 1796 "configure"
+#line 1775 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1815,7 +1794,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1819: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1798: \"$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
@@ -1840,7 +1819,7 @@ fi
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:1844: checking for working mmap" >&5
+echo "configure:1823: 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
@@ -1848,7 +1827,7 @@ else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
-#line 1852 "configure"
+#line 1831 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
@@ -1988,7 +1967,7 @@ main()
}
EOF
-if { (eval echo configure:1992: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1971: \"$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
@@ -2016,17 +1995,17 @@ unistd.h values.h sys/param.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2020: checking for $ac_hdr" >&5
+echo "configure:1999: 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 2025 "configure"
+#line 2004 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2030: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2009: \"$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*
@@ -2056,12 +2035,12 @@ done
__argz_count __argz_stringify __argz_next
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2060: checking for $ac_func" >&5
+echo "configure:2039: 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 2065 "configure"
+#line 2044 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2084,7 +2063,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2088: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2067: \"$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
@@ -2113,12 +2092,12 @@ done
for ac_func in stpcpy
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2117: checking for $ac_func" >&5
+echo "configure:2096: 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 2122 "configure"
+#line 2101 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2141,7 +2120,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2145: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2124: \"$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
@@ -2175,19 +2154,19 @@ EOF
if test $ac_cv_header_locale_h = yes; then
echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:2179: checking for LC_MESSAGES" >&5
+echo "configure:2158: checking for LC_MESSAGES" >&5
if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2184 "configure"
+#line 2163 "configure"
#include "confdefs.h"
#include <locale.h>
int main() {
return LC_MESSAGES
; return 0; }
EOF
-if { (eval echo configure:2191: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2170: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
am_cv_val_LC_MESSAGES=yes
else
@@ -2208,7 +2187,7 @@ EOF
fi
fi
echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
-echo "configure:2212: checking whether NLS is requested" >&5
+echo "configure:2191: checking whether NLS is requested" >&5
# Check whether --enable-nls or --disable-nls was given.
if test "${enable_nls+set}" = set; then
enableval="$enable_nls"
@@ -2228,7 +2207,7 @@ fi
EOF
echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
-echo "configure:2232: checking whether included gettext is requested" >&5
+echo "configure:2211: checking whether included gettext is requested" >&5
# Check whether --with-included-gettext or --without-included-gettext was given.
if test "${with_included_gettext+set}" = set; then
withval="$with_included_gettext"
@@ -2247,17 +2226,17 @@ fi
ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
-echo "configure:2251: checking for libintl.h" >&5
+echo "configure:2230: checking for libintl.h" >&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 2256 "configure"
+#line 2235 "configure"
#include "confdefs.h"
#include <libintl.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2261: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2240: \"$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*
@@ -2274,19 +2253,19 @@ fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6
-echo "configure:2278: checking for gettext in libc" >&5
+echo "configure:2257: checking for gettext in libc" >&5
if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2283 "configure"
+#line 2262 "configure"
#include "confdefs.h"
#include <libintl.h>
int main() {
return (int) gettext ("")
; return 0; }
EOF
-if { (eval echo configure:2290: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
gt_cv_func_gettext_libc=yes
else
@@ -2302,7 +2281,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6
if test "$gt_cv_func_gettext_libc" != "yes"; then
echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6
-echo "configure:2306: checking for bindtextdomain in -lintl" >&5
+echo "configure:2285: checking for bindtextdomain in -lintl" >&5
ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2310,7 +2289,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lintl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2314 "configure"
+#line 2293 "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
@@ -2321,7 +2300,7 @@ int main() {
bindtextdomain()
; return 0; }
EOF
-if { (eval echo configure:2325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2304: \"$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
@@ -2337,19 +2316,19 @@ fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6
-echo "configure:2341: checking for gettext in libintl" >&5
+echo "configure:2320: checking for gettext in libintl" >&5
if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2346 "configure"
+#line 2325 "configure"
#include "confdefs.h"
int main() {
return (int) gettext ("")
; return 0; }
EOF
-if { (eval echo configure:2353: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2332: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
gt_cv_func_gettext_libintl=yes
else
@@ -2377,7 +2356,7 @@ EOF
# Extract the first word of "msgfmt", so it can be a program name with args.
set dummy msgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2381: checking for $ac_word" >&5
+echo "configure:2360: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2411,12 +2390,12 @@ fi
for ac_func in dcgettext
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2415: checking for $ac_func" >&5
+echo "configure:2394: 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 2420 "configure"
+#line 2399 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2439,7 +2418,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2443: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2422: \"$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
@@ -2466,7 +2445,7 @@ done
# Extract the first word of "gmsgfmt", so it can be a program name with args.
set dummy gmsgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2470: checking for $ac_word" >&5
+echo "configure:2449: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2502,7 +2481,7 @@ fi
# Extract the first word of "xgettext", so it can be a program name with args.
set dummy xgettext; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2506: checking for $ac_word" >&5
+echo "configure:2485: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2534,7 +2513,7 @@ else
fi
cat > conftest.$ac_ext <<EOF
-#line 2538 "configure"
+#line 2517 "configure"
#include "confdefs.h"
int main() {
@@ -2542,7 +2521,7 @@ extern int _nl_msg_cat_cntr;
return _nl_msg_cat_cntr
; return 0; }
EOF
-if { (eval echo configure:2546: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2525: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
CATOBJEXT=.gmo
DATADIRNAME=share
@@ -2574,7 +2553,7 @@ fi
# Extract the first word of "msgfmt", so it can be a program name with args.
set dummy msgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2578: checking for $ac_word" >&5
+echo "configure:2557: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2608,7 +2587,7 @@ fi
# Extract the first word of "gmsgfmt", so it can be a program name with args.
set dummy gmsgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2612: checking for $ac_word" >&5
+echo "configure:2591: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2644,7 +2623,7 @@ fi
# Extract the first word of "xgettext", so it can be a program name with args.
set dummy xgettext; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2648: checking for $ac_word" >&5
+echo "configure:2627: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2734,7 +2713,7 @@ fi
LINGUAS=
else
echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
-echo "configure:2738: checking for catalogs to be installed" >&5
+echo "configure:2717: checking for catalogs to be installed" >&5
NEW_LINGUAS=
for lang in ${LINGUAS=$ALL_LINGUAS}; do
case "$ALL_LINGUAS" in
@@ -2762,17 +2741,17 @@ echo "configure:2738: checking for catalogs to be installed" >&5
if test "$CATOBJEXT" = ".cat"; then
ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6
-echo "configure:2766: checking for linux/version.h" >&5
+echo "configure:2745: checking for linux/version.h" >&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 2771 "configure"
+#line 2750 "configure"
#include "confdefs.h"
#include <linux/version.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2776: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2755: \"$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*
@@ -2895,7 +2874,7 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2899: checking for $ac_word" >&5
+echo "configure:2878: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2936,7 +2915,7 @@ done
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:2940: checking for a BSD compatible install" >&5
+echo "configure:2919: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2997,7 +2976,7 @@ fi
# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
set dummy ${ac_tool_prefix}ar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3001: checking for $ac_word" >&5
+echo "configure:2980: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3029,7 +3008,7 @@ fi
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3033: checking for $ac_word" >&5
+echo "configure:3012: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3061,7 +3040,7 @@ if test -n "$ac_tool_prefix"; then
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3065: checking for $ac_word" >&5
+echo "configure:3044: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3096,7 +3075,7 @@ fi
# Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
set dummy ${ac_tool_prefix}dlltool; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3100: checking for $ac_word" >&5
+echo "configure:3079: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3128,7 +3107,7 @@ fi
# Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args.
set dummy ${ac_tool_prefix}windres; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3132: checking for $ac_word" >&5
+echo "configure:3111: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3162,7 +3141,7 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3166: checking for $ac_word" >&5
+echo "configure:3145: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3196,7 +3175,7 @@ test -n "$YACC" || YACC="yacc"
# Extract the first word of "${ac_tool_prefix}mig", so it can be a program name with args.
set dummy ${ac_tool_prefix}mig; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3200: checking for $ac_word" >&5
+echo "configure:3179: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_MIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3247,12 +3226,12 @@ test "$program_transform_name" = "" && program_transform_name="s,x,x,"
echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:3251: checking return type of signal handlers" >&5
+echo "configure:3230: checking return type of signal handlers" >&5
if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3256 "configure"
+#line 3235 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
@@ -3269,7 +3248,7 @@ int main() {
int i;
; return 0; }
EOF
-if { (eval echo configure:3273: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3252: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_type_signal=void
else
@@ -3289,12 +3268,12 @@ EOF
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:3293: checking for ANSI C header files" >&5
+echo "configure:3272: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3298 "configure"
+#line 3277 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -3302,7 +3281,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3306: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3285: \"$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*
@@ -3319,7 +3298,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 3323 "configure"
+#line 3302 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -3337,7 +3316,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 3341 "configure"
+#line 3320 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -3358,7 +3337,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 3362 "configure"
+#line 3341 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -3369,7 +3348,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:3373: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3352: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -3413,17 +3392,17 @@ for ac_hdr in ctype.h nlist.h link.h thread_db.h proc_service.h \
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3417: checking for $ac_hdr" >&5
+echo "configure:3396: 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 3422 "configure"
+#line 3401 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3427: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3406: \"$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*
@@ -3450,12 +3429,12 @@ fi
done
echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6
-echo "configure:3454: checking whether stat file-mode macros are broken" >&5
+echo "configure:3433: 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 3459 "configure"
+#line 3438 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -3507,12 +3486,12 @@ fi
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:3511: checking for working const" >&5
+echo "configure:3490: 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 3516 "configure"
+#line 3495 "configure"
#include "confdefs.h"
int main() {
@@ -3561,7 +3540,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:3565: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3544: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -3581,17 +3560,57 @@ EOF
fi
+echo $ac_n "checking for inline""... $ac_c" 1>&6
+echo "configure:3565: checking for inline" >&5
+if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+ cat > conftest.$ac_ext <<EOF
+#line 3572 "configure"
+#include "confdefs.h"
+
+int main() {
+} $ac_kw foo() {
+; return 0; }
+EOF
+if { (eval echo configure:3579: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_c_inline=$ac_kw; break
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+done
+
+fi
+
+echo "$ac_t""$ac_cv_c_inline" 1>&6
+case "$ac_cv_c_inline" in
+ inline | yes) ;;
+ no) cat >> confdefs.h <<\EOF
+#define inline
+EOF
+ ;;
+ *) cat >> confdefs.h <<EOF
+#define inline $ac_cv_c_inline
+EOF
+ ;;
+esac
+
for ac_func in bcopy btowc bzero canonicalize_file_name isascii poll \
realpath sbrk setpgid setpgrp sigaction sigprocmask sigsetmask
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3590: checking for $ac_func" >&5
+echo "configure:3609: 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 3595 "configure"
+#line 3614 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3614,7 +3633,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3637: \"$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
@@ -3641,19 +3660,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:3645: checking for working alloca.h" >&5
+echo "configure:3664: 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 3650 "configure"
+#line 3669 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:3657: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3676: \"$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
@@ -3674,12 +3693,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:3678: checking for alloca" >&5
+echo "configure:3697: 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 3683 "configure"
+#line 3702 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -3707,7 +3726,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:3711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3730: \"$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
@@ -3739,12 +3758,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:3743: checking whether alloca needs Cray hooks" >&5
+echo "configure:3762: 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 3748 "configure"
+#line 3767 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -3769,12 +3788,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:3773: checking for $ac_func" >&5
+echo "configure:3792: 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 3778 "configure"
+#line 3797 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3797,7 +3816,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3801: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3820: \"$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
@@ -3824,7 +3843,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:3828: checking stack direction for C alloca" >&5
+echo "configure:3847: 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
@@ -3832,7 +3851,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 3836 "configure"
+#line 3855 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -3851,7 +3870,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:3855: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3874: \"$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
@@ -3873,12 +3892,12 @@ EOF
fi
echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:3877: checking for pid_t" >&5
+echo "configure:3896: checking for pid_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3882 "configure"
+#line 3901 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -3907,17 +3926,17 @@ fi
ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
-echo "configure:3911: checking for vfork.h" >&5
+echo "configure:3930: checking for vfork.h" >&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 3916 "configure"
+#line 3935 "configure"
#include "confdefs.h"
#include <vfork.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3921: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3940: \"$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*
@@ -3942,18 +3961,18 @@ else
fi
echo $ac_n "checking for working vfork""... $ac_c" 1>&6
-echo "configure:3946: checking for working vfork" >&5
+echo "configure:3965: checking for working vfork" >&5
if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "$cross_compiling" = yes; then
echo $ac_n "checking for vfork""... $ac_c" 1>&6
-echo "configure:3952: checking for vfork" >&5
+echo "configure:3971: checking for vfork" >&5
if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3957 "configure"
+#line 3976 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char vfork(); below. */
@@ -3976,7 +3995,7 @@ vfork();
; return 0; }
EOF
-if { (eval echo configure:3980: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_vfork=yes"
else
@@ -3998,7 +4017,7 @@ fi
ac_cv_func_vfork_works=$ac_cv_func_vfork
else
cat > conftest.$ac_ext <<EOF
-#line 4002 "configure"
+#line 4021 "configure"
#include "confdefs.h"
/* Thanks to Paul Eggert for this test. */
#include <stdio.h>
@@ -4093,7 +4112,7 @@ main() {
}
}
EOF
-if { (eval echo configure:4097: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4116: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_vfork_works=yes
else
@@ -4117,7 +4136,7 @@ fi
if test "$cross_compiling" = no; then
echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6
-echo "configure:4121: checking whether setpgrp takes no argument" >&5
+echo "configure:4140: checking whether setpgrp takes no argument" >&5
if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4125,7 +4144,7 @@ else
{ echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 4129 "configure"
+#line 4148 "configure"
#include "confdefs.h"
#ifdef HAVE_UNISTD_H
@@ -4145,7 +4164,7 @@ main()
}
EOF
-if { (eval echo configure:4149: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4168: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_setpgrp_void=no
else
@@ -4170,12 +4189,12 @@ fi
else
echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6
-echo "configure:4174: checking whether setpgrp takes no argument" >&5
+echo "configure:4193: checking whether setpgrp takes no argument" >&5
if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4179 "configure"
+#line 4198 "configure"
#include "confdefs.h"
#include <unistd.h>
@@ -4189,7 +4208,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:4193: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4212: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_func_setpgrp_void=no
else
@@ -4213,12 +4232,12 @@ fi
# Check if sigsetjmp is available. Using AC_CHECK_FUNCS won't do
# since sigsetjmp might only be defined as a macro.
echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6
-echo "configure:4217: checking for sigsetjmp" >&5
+echo "configure:4236: checking for sigsetjmp" >&5
if eval "test \"`echo '$''{'gdb_cv_func_sigsetjmp'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4222 "configure"
+#line 4241 "configure"
#include "confdefs.h"
#include <setjmp.h>
@@ -4227,7 +4246,7 @@ int main() {
sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);
; return 0; }
EOF
-if { (eval echo configure:4231: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4250: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_func_sigsetjmp=yes
else
@@ -4250,19 +4269,19 @@ fi
# See if <machine/reg.h> supports the %fs and %gs i386 segment registers.
# Older i386 BSD's don't have the r_fs and r_gs members of `struct reg'.
echo $ac_n "checking for r_fs in struct reg""... $ac_c" 1>&6
-echo "configure:4254: checking for r_fs in struct reg" >&5
+echo "configure:4273: checking for r_fs in struct reg" >&5
if eval "test \"`echo '$''{'gdb_cv_struct_reg_r_fs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4259 "configure"
+#line 4278 "configure"
#include "confdefs.h"
#include <machine/reg.h>
int main() {
struct reg r; r.r_fs;
; return 0; }
EOF
-if { (eval echo configure:4266: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4285: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_struct_reg_r_fs=yes
else
@@ -4282,19 +4301,19 @@ EOF
fi
echo $ac_n "checking for r_gs in struct reg""... $ac_c" 1>&6
-echo "configure:4286: checking for r_gs in struct reg" >&5
+echo "configure:4305: checking for r_gs in struct reg" >&5
if eval "test \"`echo '$''{'gdb_cv_struct_reg_r_gs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4291 "configure"
+#line 4310 "configure"
#include "confdefs.h"
#include <machine/reg.h>
int main() {
struct reg r; r.r_gs;
; return 0; }
EOF
-if { (eval echo configure:4298: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4317: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_struct_reg_r_gs=yes
else
@@ -4316,19 +4335,19 @@ fi
# See if <sys/ptrace.h> provides the PTRACE_GETREGS request.
echo $ac_n "checking for PTRACE_GETREGS""... $ac_c" 1>&6
-echo "configure:4320: checking for PTRACE_GETREGS" >&5
+echo "configure:4339: checking for PTRACE_GETREGS" >&5
if eval "test \"`echo '$''{'gdb_cv_have_ptrace_getregs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4325 "configure"
+#line 4344 "configure"
#include "confdefs.h"
#include <sys/ptrace.h>
int main() {
PTRACE_GETREGS;
; return 0; }
EOF
-if { (eval echo configure:4332: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4351: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_ptrace_getregs=yes
else
@@ -4350,19 +4369,19 @@ fi
# See if <sys/ptrace.h> provides the PTRACE_GETFPXREGS request.
echo $ac_n "checking for PTRACE_GETFPXREGS""... $ac_c" 1>&6
-echo "configure:4354: checking for PTRACE_GETFPXREGS" >&5
+echo "configure:4373: checking for PTRACE_GETFPXREGS" >&5
if eval "test \"`echo '$''{'gdb_cv_have_ptrace_getfpxregs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4359 "configure"
+#line 4378 "configure"
#include "confdefs.h"
#include <sys/ptrace.h>
int main() {
PTRACE_GETFPXREGS;
; return 0; }
EOF
-if { (eval echo configure:4366: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4385: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_ptrace_getfpxregs=yes
else
@@ -4384,12 +4403,12 @@ fi
# See if <sys/ptrace.h> provides the PT_GETDBREGS request.
echo $ac_n "checking for PT_GETDBREGS""... $ac_c" 1>&6
-echo "configure:4388: checking for PT_GETDBREGS" >&5
+echo "configure:4407: checking for PT_GETDBREGS" >&5
if eval "test \"`echo '$''{'gdb_cv_have_pt_getdbregs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4393 "configure"
+#line 4412 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/ptrace.h>
@@ -4397,7 +4416,7 @@ int main() {
PT_GETDBREGS;
; return 0; }
EOF
-if { (eval echo configure:4401: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4420: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_pt_getdbregs=yes
else
@@ -4419,12 +4438,12 @@ fi
# See if <sys/ptrace.h> provides the PT_GETXMMREGS request.
echo $ac_n "checking for PT_GETXMMREGS""... $ac_c" 1>&6
-echo "configure:4423: checking for PT_GETXMMREGS" >&5
+echo "configure:4442: checking for PT_GETXMMREGS" >&5
if eval "test \"`echo '$''{'gdb_cv_have_pt_getxmmregs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4428 "configure"
+#line 4447 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/ptrace.h>
@@ -4432,7 +4451,7 @@ int main() {
PT_GETXMMREGS;
; return 0; }
EOF
-if { (eval echo configure:4436: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4455: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_pt_getxmmregs=yes
else
@@ -4454,7 +4473,7 @@ fi
echo $ac_n "checking for socketpair in -lsocket""... $ac_c" 1>&6
-echo "configure:4458: checking for socketpair in -lsocket" >&5
+echo "configure:4477: 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
@@ -4462,7 +4481,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4466 "configure"
+#line 4485 "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
@@ -4473,7 +4492,7 @@ int main() {
socketpair()
; return 0; }
EOF
-if { (eval echo configure:4477: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4496: \"$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
@@ -4503,12 +4522,12 @@ fi
for ac_func in socketpair
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4507: checking for $ac_func" >&5
+echo "configure:4526: 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 4512 "configure"
+#line 4531 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4531,7 +4550,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4535: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4554: \"$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
@@ -4558,12 +4577,12 @@ done
echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6
-echo "configure:4562: checking whether malloc must be declared" >&5
+echo "configure:4581: 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 4567 "configure"
+#line 4586 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4584,7 +4603,7 @@ int main() {
char *(*pfn) = (char *(*)) malloc
; return 0; }
EOF
-if { (eval echo configure:4588: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4607: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_malloc=no
else
@@ -4605,12 +4624,12 @@ EOF
fi
echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6
-echo "configure:4609: checking whether realloc must be declared" >&5
+echo "configure:4628: 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 4614 "configure"
+#line 4633 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4631,7 +4650,7 @@ int main() {
char *(*pfn) = (char *(*)) realloc
; return 0; }
EOF
-if { (eval echo configure:4635: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4654: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_realloc=no
else
@@ -4652,12 +4671,12 @@ EOF
fi
echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6
-echo "configure:4656: checking whether free must be declared" >&5
+echo "configure:4675: 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 4661 "configure"
+#line 4680 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4678,7 +4697,7 @@ int main() {
char *(*pfn) = (char *(*)) free
; return 0; }
EOF
-if { (eval echo configure:4682: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4701: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_free=no
else
@@ -4699,12 +4718,12 @@ EOF
fi
echo $ac_n "checking whether strerror must be declared""... $ac_c" 1>&6
-echo "configure:4703: checking whether strerror must be declared" >&5
+echo "configure:4722: 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 4708 "configure"
+#line 4727 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4725,7 +4744,7 @@ int main() {
char *(*pfn) = (char *(*)) strerror
; return 0; }
EOF
-if { (eval echo configure:4729: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4748: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_strerror=no
else
@@ -4746,12 +4765,12 @@ EOF
fi
echo $ac_n "checking whether strdup must be declared""... $ac_c" 1>&6
-echo "configure:4750: checking whether strdup must be declared" >&5
+echo "configure:4769: 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 4755 "configure"
+#line 4774 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4772,7 +4791,7 @@ int main() {
char *(*pfn) = (char *(*)) strdup
; return 0; }
EOF
-if { (eval echo configure:4776: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4795: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_strdup=no
else
@@ -4793,12 +4812,12 @@ EOF
fi
echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6
-echo "configure:4797: checking whether strstr must be declared" >&5
+echo "configure:4816: 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 4802 "configure"
+#line 4821 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4819,7 +4838,7 @@ int main() {
char *(*pfn) = (char *(*)) strstr
; return 0; }
EOF
-if { (eval echo configure:4823: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4842: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_strstr=no
else
@@ -4839,6 +4858,52 @@ EOF
fi
+echo $ac_n "checking whether canonicalize_file_name must be declared""... $ac_c" 1>&6
+echo "configure:4863: checking whether canonicalize_file_name must be declared" >&5
+if eval "test \"`echo '$''{'bfd_cv_decl_needed_canonicalize_file_name'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 4868 "configure"
+#include "confdefs.h"
+
+#include <stdio.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+int main() {
+char *(*pfn) = (char *(*)) canonicalize_file_name
+; return 0; }
+EOF
+if { (eval echo configure:4889: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ bfd_cv_decl_needed_canonicalize_file_name=no
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ bfd_cv_decl_needed_canonicalize_file_name=yes
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$bfd_cv_decl_needed_canonicalize_file_name" 1>&6
+if test $bfd_cv_decl_needed_canonicalize_file_name = yes; then
+ cat >> confdefs.h <<\EOF
+#define NEED_DECLARATION_CANONICALIZE_FILE_NAME 1
+EOF
+
+fi
# The following save_state_t checkery is only necessary for HPUX
@@ -4846,9 +4911,9 @@ fi
# could be expunged. --jsm 1999-03-22
echo $ac_n "checking for HPUX save_state structure""... $ac_c" 1>&6
-echo "configure:4850: checking for HPUX save_state structure" >&5
+echo "configure:4915: checking for HPUX save_state structure" >&5
cat > conftest.$ac_ext <<EOF
-#line 4852 "configure"
+#line 4917 "configure"
#include "confdefs.h"
#include <machine/save_state.h>
EOF
@@ -4863,7 +4928,7 @@ fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 4867 "configure"
+#line 4932 "configure"
#include "confdefs.h"
#include <machine/save_state.h>
EOF
@@ -4933,12 +4998,12 @@ 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:4937: checking for pstatus_t in sys/procfs.h" >&5
+echo "configure:5002: 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 4942 "configure"
+#line 5007 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -4947,7 +5012,7 @@ int main() {
pstatus_t avar
; return 0; }
EOF
-if { (eval echo configure:4951: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5016: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_pstatus_t=yes
else
@@ -4969,12 +5034,12 @@ 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:4973: checking for prrun_t in sys/procfs.h" >&5
+echo "configure:5038: 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 4978 "configure"
+#line 5043 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -4983,7 +5048,7 @@ int main() {
prrun_t avar
; return 0; }
EOF
-if { (eval echo configure:4987: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5052: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prrun_t=yes
else
@@ -5005,12 +5070,12 @@ 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:5009: checking for gregset_t in sys/procfs.h" >&5
+echo "configure:5074: 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 5014 "configure"
+#line 5079 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5019,7 +5084,7 @@ int main() {
gregset_t avar
; return 0; }
EOF
-if { (eval echo configure:5023: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5088: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_gregset_t=yes
else
@@ -5041,12 +5106,12 @@ 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:5045: checking for fpregset_t in sys/procfs.h" >&5
+echo "configure:5110: 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 5050 "configure"
+#line 5115 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5055,7 +5120,7 @@ int main() {
fpregset_t avar
; return 0; }
EOF
-if { (eval echo configure:5059: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5124: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_fpregset_t=yes
else
@@ -5077,12 +5142,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_fpregset_t" 1>&6
echo $ac_n "checking for prgregset_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5081: checking for prgregset_t in sys/procfs.h" >&5
+echo "configure:5146: checking for prgregset_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prgregset_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5086 "configure"
+#line 5151 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5091,7 +5156,7 @@ int main() {
prgregset_t avar
; return 0; }
EOF
-if { (eval echo configure:5095: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5160: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prgregset_t=yes
else
@@ -5113,12 +5178,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_prgregset_t" 1>&6
echo $ac_n "checking for prfpregset_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5117: checking for prfpregset_t in sys/procfs.h" >&5
+echo "configure:5182: checking for prfpregset_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prfpregset_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5122 "configure"
+#line 5187 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5127,7 +5192,7 @@ int main() {
prfpregset_t avar
; return 0; }
EOF
-if { (eval echo configure:5131: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5196: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prfpregset_t=yes
else
@@ -5149,12 +5214,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_prfpregset_t" 1>&6
echo $ac_n "checking for prgregset32_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5153: checking for prgregset32_t in sys/procfs.h" >&5
+echo "configure:5218: checking for prgregset32_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prgregset32_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5158 "configure"
+#line 5223 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5163,7 +5228,7 @@ int main() {
prgregset32_t avar
; return 0; }
EOF
-if { (eval echo configure:5167: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5232: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prgregset32_t=yes
else
@@ -5185,12 +5250,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_prgregset32_t" 1>&6
echo $ac_n "checking for prfpregset32_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5189: checking for prfpregset32_t in sys/procfs.h" >&5
+echo "configure:5254: checking for prfpregset32_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prfpregset32_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5194 "configure"
+#line 5259 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5199,7 +5264,7 @@ int main() {
prfpregset32_t avar
; return 0; }
EOF
-if { (eval echo configure:5203: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5268: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prfpregset32_t=yes
else
@@ -5221,12 +5286,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_prfpregset32_t" 1>&6
echo $ac_n "checking for lwpid_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5225: checking for lwpid_t in sys/procfs.h" >&5
+echo "configure:5290: checking for lwpid_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpid_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5230 "configure"
+#line 5295 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5235,7 +5300,7 @@ int main() {
lwpid_t avar
; return 0; }
EOF
-if { (eval echo configure:5239: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5304: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_lwpid_t=yes
else
@@ -5257,12 +5322,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpid_t" 1>&6
echo $ac_n "checking for psaddr_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5261: checking for psaddr_t in sys/procfs.h" >&5
+echo "configure:5326: checking for psaddr_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psaddr_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5266 "configure"
+#line 5331 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5271,7 +5336,7 @@ int main() {
psaddr_t avar
; return 0; }
EOF
-if { (eval echo configure:5275: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5340: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_psaddr_t=yes
else
@@ -5293,12 +5358,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_psaddr_t" 1>&6
echo $ac_n "checking for prsysent_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5297: checking for prsysent_t in sys/procfs.h" >&5
+echo "configure:5362: checking for prsysent_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prsysent_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5302 "configure"
+#line 5367 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5307,7 +5372,7 @@ int main() {
prsysent_t avar
; return 0; }
EOF
-if { (eval echo configure:5311: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5376: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prsysent_t=yes
else
@@ -5329,12 +5394,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_prsysent_t" 1>&6
echo $ac_n "checking for pr_sigset_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5333: checking for pr_sigset_t in sys/procfs.h" >&5
+echo "configure:5398: checking for pr_sigset_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pr_sigset_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5338 "configure"
+#line 5403 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5343,7 +5408,7 @@ int main() {
pr_sigset_t avar
; return 0; }
EOF
-if { (eval echo configure:5347: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5412: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_pr_sigset_t=yes
else
@@ -5365,12 +5430,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_pr_sigset_t" 1>&6
echo $ac_n "checking for pr_sigaction64_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5369: checking for pr_sigaction64_t in sys/procfs.h" >&5
+echo "configure:5434: checking for pr_sigaction64_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pr_sigaction64_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5374 "configure"
+#line 5439 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5379,7 +5444,7 @@ int main() {
pr_sigaction64_t avar
; return 0; }
EOF
-if { (eval echo configure:5383: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5448: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_pr_sigaction64_t=yes
else
@@ -5401,12 +5466,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_pr_sigaction64_t" 1>&6
echo $ac_n "checking for pr_siginfo64_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5405: checking for pr_siginfo64_t in sys/procfs.h" >&5
+echo "configure:5470: checking for pr_siginfo64_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pr_siginfo64_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5410 "configure"
+#line 5475 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5415,7 +5480,7 @@ int main() {
pr_siginfo64_t avar
; return 0; }
EOF
-if { (eval echo configure:5419: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5484: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_pr_siginfo64_t=yes
else
@@ -5442,7 +5507,7 @@ EOF
if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then
echo $ac_n "checking whether prfpregset_t type is broken""... $ac_c" 1>&6
-echo "configure:5446: checking whether prfpregset_t type is broken" >&5
+echo "configure:5511: checking whether prfpregset_t type is broken" >&5
if eval "test \"`echo '$''{'gdb_cv_prfpregset_t_broken'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -5450,7 +5515,7 @@ else
gdb_cv_prfpregset_t_broken=yes
else
cat > conftest.$ac_ext <<EOF
-#line 5454 "configure"
+#line 5519 "configure"
#include "confdefs.h"
#include <sys/procfs.h>
int main ()
@@ -5460,7 +5525,7 @@ else
return 0;
}
EOF
-if { (eval echo configure:5464: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5529: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
gdb_cv_prfpregset_t_broken=no
else
@@ -5485,12 +5550,12 @@ EOF
echo $ac_n "checking for PIOCSET ioctl entry in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5489: checking for PIOCSET ioctl entry in sys/procfs.h" >&5
+echo "configure:5554: 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 5494 "configure"
+#line 5559 "configure"
#include "confdefs.h"
#include <unistd.h>
#include <sys/types.h>
@@ -5503,7 +5568,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:5507: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5572: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_procfs_piocset=yes
else
@@ -5527,19 +5592,19 @@ fi
if test ${host} = ${target} ; then
echo $ac_n "checking for member l_addr in struct link_map""... $ac_c" 1>&6
-echo "configure:5531: checking for member l_addr in struct link_map" >&5
+echo "configure:5596: checking for member l_addr in struct link_map" >&5
if eval "test \"`echo '$''{'gdb_cv_have_struct_link_map_with_l_members'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5536 "configure"
+#line 5601 "configure"
#include "confdefs.h"
#include <link.h>
int main() {
struct link_map lm; (void) lm.l_addr;
; return 0; }
EOF
-if { (eval echo configure:5543: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5608: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_struct_link_map_with_l_members=yes
else
@@ -5561,12 +5626,12 @@ EOF
echo $ac_n "checking for member lm_addr in struct link_map""... $ac_c" 1>&6
-echo "configure:5565: checking for member lm_addr in struct link_map" >&5
+echo "configure:5630: checking for member lm_addr in struct link_map" >&5
if eval "test \"`echo '$''{'gdb_cv_have_struct_link_map_with_lm_members'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5570 "configure"
+#line 5635 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <link.h>
@@ -5574,7 +5639,7 @@ int main() {
struct link_map lm; (void) lm.lm_addr;
; return 0; }
EOF
-if { (eval echo configure:5578: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5643: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_struct_link_map_with_lm_members=yes
else
@@ -5596,12 +5661,12 @@ EOF
echo $ac_n "checking for member som_addr in struct so_map""... $ac_c" 1>&6
-echo "configure:5600: checking for member som_addr in struct so_map" >&5
+echo "configure:5665: checking for member som_addr in struct so_map" >&5
if eval "test \"`echo '$''{'gdb_cv_have_struct_so_map_with_som_members'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5605 "configure"
+#line 5670 "configure"
#include "confdefs.h"
#include <sys/types.h>
#ifdef HAVE_NLIST_H
@@ -5612,7 +5677,7 @@ int main() {
struct so_map lm; (void) lm.som_addr;
; return 0; }
EOF
-if { (eval echo configure:5616: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5681: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_struct_so_map_with_som_members=yes
else
@@ -5634,12 +5699,12 @@ EOF
echo $ac_n "checking for struct link_map32 in sys/link.h""... $ac_c" 1>&6
-echo "configure:5638: checking for struct link_map32 in sys/link.h" >&5
+echo "configure:5703: checking for struct link_map32 in sys/link.h" >&5
if eval "test \"`echo '$''{'gdb_cv_have_struct_link_map32'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5643 "configure"
+#line 5708 "configure"
#include "confdefs.h"
#define _SYSCALL32
#include <sys/link.h>
@@ -5647,7 +5712,7 @@ int main() {
struct link_map32 l;
; return 0; }
EOF
-if { (eval echo configure:5651: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5716: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_struct_link_map32=yes
else
@@ -5665,11 +5730,15 @@ fi
#define HAVE_STRUCT_LINK_MAP32 1
EOF
+ cat >> confdefs.h <<\EOF
+#define _SYSCALL32 1
+EOF
+
fi
fi
echo $ac_n "checking for main in -lm""... $ac_c" 1>&6
-echo "configure:5673: checking for main in -lm" >&5
+echo "configure:5742: 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
@@ -5677,14 +5746,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5681 "configure"
+#line 5750 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:5688: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5757: \"$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
@@ -5713,7 +5782,7 @@ fi
echo $ac_n "checking for wctype in -lc""... $ac_c" 1>&6
-echo "configure:5717: checking for wctype in -lc" >&5
+echo "configure:5786: 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
@@ -5721,7 +5790,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lc $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5725 "configure"
+#line 5794 "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
@@ -5732,7 +5801,7 @@ int main() {
wctype()
; return 0; }
EOF
-if { (eval echo configure:5736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5805: \"$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
@@ -5751,7 +5820,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:5755: checking for wctype in -lw" >&5
+echo "configure:5824: 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
@@ -5759,7 +5828,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lw $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5763 "configure"
+#line 5832 "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
@@ -5770,7 +5839,7 @@ int main() {
wctype()
; return 0; }
EOF
-if { (eval echo configure:5774: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5843: \"$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
@@ -5802,12 +5871,12 @@ fi
echo $ac_n "checking for long long support in compiler""... $ac_c" 1>&6
-echo "configure:5806: checking for long long support in compiler" >&5
+echo "configure:5875: 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 5811 "configure"
+#line 5880 "configure"
#include "confdefs.h"
int main() {
@@ -5817,7 +5886,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:5821: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5890: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_c_long_long=yes
else
@@ -5839,7 +5908,7 @@ fi
echo $ac_n "checking for long long support in printf""... $ac_c" 1>&6
-echo "configure:5843: checking for long long support in printf" >&5
+echo "configure:5912: 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
@@ -5847,7 +5916,7 @@ else
gdb_cv_printf_has_long_long=no
else
cat > conftest.$ac_ext <<EOF
-#line 5851 "configure"
+#line 5920 "configure"
#include "confdefs.h"
int main () {
@@ -5861,7 +5930,7 @@ int main () {
return (strcmp ("0x0123456789abcdef", buf));
}
EOF
-if { (eval echo configure:5865: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5934: \"$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
@@ -5885,19 +5954,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:5889: checking for long double support in compiler" >&5
+echo "configure:5958: 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 5894 "configure"
+#line 5963 "configure"
#include "confdefs.h"
int main() {
long double foo;
; return 0; }
EOF
-if { (eval echo configure:5901: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5970: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_long_double=yes
else
@@ -5919,7 +5988,7 @@ fi
echo $ac_n "checking for long double support in printf""... $ac_c" 1>&6
-echo "configure:5923: checking for long double support in printf" >&5
+echo "configure:5992: 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
@@ -5927,7 +5996,7 @@ else
gdb_cv_printf_has_long_double=no
else
cat > conftest.$ac_ext <<EOF
-#line 5931 "configure"
+#line 6000 "configure"
#include "confdefs.h"
int main () {
@@ -5937,7 +6006,7 @@ int main () {
return (strncmp ("3.14159", buf, 7));
}
EOF
-if { (eval echo configure:5941: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6010: \"$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
@@ -5961,7 +6030,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:5965: checking for long double support in scanf" >&5
+echo "configure:6034: 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
@@ -5969,7 +6038,7 @@ else
gdb_cv_scanf_has_long_double=no
else
cat > conftest.$ac_ext <<EOF
-#line 5973 "configure"
+#line 6042 "configure"
#include "confdefs.h"
int main () {
@@ -5979,7 +6048,7 @@ int main () {
return !(f > 3.14159 && f < 3.14160);
}
EOF
-if { (eval echo configure:5983: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6052: \"$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
@@ -6005,17 +6074,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:6009: checking for $ac_hdr" >&5
+echo "configure:6078: 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 6014 "configure"
+#line 6083 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6019: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6088: \"$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*
@@ -6044,12 +6113,12 @@ done
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6048: checking for $ac_func" >&5
+echo "configure:6117: 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 6053 "configure"
+#line 6122 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6072,7 +6141,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6145: \"$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
@@ -6097,7 +6166,7 @@ fi
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:6101: checking for working mmap" >&5
+echo "configure:6170: 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
@@ -6105,7 +6174,7 @@ else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
-#line 6109 "configure"
+#line 6178 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
@@ -6245,7 +6314,7 @@ main()
}
EOF
-if { (eval echo configure:6249: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6318: \"$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
@@ -6271,7 +6340,7 @@ fi
case ${host_os} in
aix*)
echo $ac_n "checking for -bbigtoc option""... $ac_c" 1>&6
-echo "configure:6275: checking for -bbigtoc option" >&5
+echo "configure:6344: checking for -bbigtoc option" >&5
if eval "test \"`echo '$''{'gdb_cv_bigtoc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6285,14 +6354,14 @@ else
LDFLAGS=$LDFLAGS\ $gdb_cv_bigtoc
cat > conftest.$ac_ext <<EOF
-#line 6289 "configure"
+#line 6358 "configure"
#include "confdefs.h"
int main() {
int i;
; return 0; }
EOF
-if { (eval echo configure:6296: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
:
else
echo "configure: failed program was:" >&5
@@ -6315,7 +6384,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:6319: checking for HPUX/OSF thread support" >&5
+echo "configure:6388: 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
@@ -6334,7 +6403,7 @@ EOF
;;
solaris*)
echo $ac_n "checking for Solaris thread debugging library""... $ac_c" 1>&6
-echo "configure:6338: checking for Solaris thread debugging library" >&5
+echo "configure:6407: 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
@@ -6344,7 +6413,7 @@ EOF
CONFIG_LIB_OBS="${CONFIG_LIB_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:6348: checking for dlopen in -ldl" >&5
+echo "configure:6417: 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
@@ -6352,7 +6421,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6356 "configure"
+#line 6425 "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
@@ -6363,7 +6432,7 @@ int main() {
dlopen()
; return 0; }
EOF
-if { (eval echo configure:6367: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6436: \"$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
@@ -6395,17 +6464,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:6399: checking for the ld -export-dynamic flag" >&5
+echo "configure:6468: checking for the ld -export-dynamic flag" >&5
LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
cat > conftest.$ac_ext <<EOF
-#line 6402 "configure"
+#line 6471 "configure"
#include "confdefs.h"
int main() {
int i;
; return 0; }
EOF
-if { (eval echo configure:6409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6478: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
found=yes
else
@@ -6424,13 +6493,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:6428: checking if <proc_service.h> is old" >&5
+echo "configure:6497: 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 6434 "configure"
+#line 6503 "configure"
#include "confdefs.h"
#include <proc_service.h>
@@ -6441,7 +6510,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:6445: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6514: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_proc_service_is_old=no
else
@@ -6660,7 +6729,7 @@ WERROR_CFLAGS=""
if test "x${build_warnings}" != x -a "x$GCC" = xyes
then
echo $ac_n "checking compiler warning flags""... $ac_c" 1>&6
-echo "configure:6664: checking compiler warning flags" >&5
+echo "configure:6733: checking compiler warning flags" >&5
# Separate out the -Werror flag as some files just cannot be
# compiled with it enabled.
for w in ${build_warnings}; do
@@ -6670,14 +6739,14 @@ echo "configure:6664: checking compiler warning flags" >&5
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $w"
cat > conftest.$ac_ext <<EOF
-#line 6674 "configure"
+#line 6743 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:6681: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6750: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
WARN_CFLAGS="${WARN_CFLAGS} $w"
else
@@ -6737,12 +6806,12 @@ fi
if test $want_included_regex = false; then
echo $ac_n "checking for GNU regex""... $ac_c" 1>&6
-echo "configure:6741: checking for GNU regex" >&5
+echo "configure:6810: checking for GNU regex" >&5
if eval "test \"`echo '$''{'gdb_cv_have_gnu_regex'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6746 "configure"
+#line 6815 "configure"
#include "confdefs.h"
#include <gnu-versions.h>
#include <sys/types.h>
@@ -6754,7 +6823,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:6758: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6827: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_gnu_regex=yes
else
@@ -6783,12 +6852,12 @@ fi
# In the Cygwin environment, we need some additional flags.
echo $ac_n "checking for cygwin""... $ac_c" 1>&6
-echo "configure:6787: checking for cygwin" >&5
+echo "configure:6856: 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 6792 "configure"
+#line 6861 "configure"
#include "confdefs.h"
#if defined (__CYGWIN__) || defined (__CYGWIN32__)
@@ -6826,7 +6895,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:6830: checking for tgetent in -lncurses" >&5
+echo "configure:6899: 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
@@ -6834,7 +6903,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lncurses $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6838 "configure"
+#line 6907 "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
@@ -6845,7 +6914,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:6849: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6918: \"$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
@@ -6864,7 +6933,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:6868: checking for tgetent in -lHcurses" >&5
+echo "configure:6937: 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
@@ -6872,7 +6941,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lHcurses $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6876 "configure"
+#line 6945 "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
@@ -6883,7 +6952,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:6887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6956: \"$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
@@ -6902,7 +6971,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:6906: checking for tgetent in -ltermlib" >&5
+echo "configure:6975: 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
@@ -6910,7 +6979,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ltermlib $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6914 "configure"
+#line 6983 "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
@@ -6921,7 +6990,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:6925: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6994: \"$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
@@ -6940,7 +7009,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:6944: checking for tgetent in -ltermcap" >&5
+echo "configure:7013: 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
@@ -6948,7 +7017,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ltermcap $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6952 "configure"
+#line 7021 "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
@@ -6959,7 +7028,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:6963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7032: \"$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
@@ -6978,7 +7047,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:6982: checking for tgetent in -lcurses" >&5
+echo "configure:7051: 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
@@ -6986,7 +7055,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lcurses $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6990 "configure"
+#line 7059 "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
@@ -6997,7 +7066,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:7001: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7070: \"$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
@@ -7016,7 +7085,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:7020: checking for tgetent in -lterminfo" >&5
+echo "configure:7089: 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
@@ -7024,7 +7093,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lterminfo $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7028 "configure"
+#line 7097 "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
@@ -7035,7 +7104,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:7039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7108: \"$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
@@ -7200,7 +7269,7 @@ if test "${with_tclconfig+set}" = set; then
fi
echo $ac_n "checking for Tcl configuration""... $ac_c" 1>&6
-echo "configure:7204: checking for Tcl configuration" >&5
+echo "configure:7273: checking for Tcl configuration" >&5
if eval "test \"`echo '$''{'ac_cv_c_tclconfig'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -7308,7 +7377,7 @@ if test "${with_tkconfig+set}" = set; then
fi
echo $ac_n "checking for Tk configuration""... $ac_c" 1>&6
-echo "configure:7312: checking for Tk configuration" >&5
+echo "configure:7381: checking for Tk configuration" >&5
if eval "test \"`echo '$''{'ac_cv_c_tkconfig'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -7417,7 +7486,7 @@ fi
no_tcl=true
echo $ac_n "checking for Tcl private headers. dir=${configdir}""... $ac_c" 1>&6
-echo "configure:7421: checking for Tcl private headers. dir=${configdir}" >&5
+echo "configure:7490: checking for Tcl private headers. dir=${configdir}" >&5
# Check whether --with-tclinclude or --without-tclinclude was given.
if test "${with_tclinclude+set}" = set; then
withval="$with_tclinclude"
@@ -7483,17 +7552,17 @@ fi
if test x"${ac_cv_c_tclh}" = x ; then
ac_safe=`echo "tclInt.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for tclInt.h""... $ac_c" 1>&6
-echo "configure:7487: checking for tclInt.h" >&5
+echo "configure:7556: checking for tclInt.h" >&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 7492 "configure"
+#line 7561 "configure"
#include "confdefs.h"
#include <tclInt.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7497: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7566: \"$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*
@@ -7553,7 +7622,7 @@ fi
#
no_tk=true
echo $ac_n "checking for Tk private headers""... $ac_c" 1>&6
-echo "configure:7557: checking for Tk private headers" >&5
+echo "configure:7626: checking for Tk private headers" >&5
# Check whether --with-tkinclude or --without-tkinclude was given.
if test "${with_tkinclude+set}" = set; then
withval="$with_tkinclude"
@@ -7619,17 +7688,17 @@ fi
if test x"${ac_cv_c_tkh}" = x ; then
ac_safe=`echo "tk.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for tk.h""... $ac_c" 1>&6
-echo "configure:7623: checking for tk.h" >&5
+echo "configure:7692: checking for tk.h" >&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 7628 "configure"
+#line 7697 "configure"
#include "confdefs.h"
#include <tk.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7633: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7702: \"$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*
@@ -7675,7 +7744,7 @@ fi
echo $ac_n "checking for Itcl private headers. srcdir=${srcdir}""... $ac_c" 1>&6
-echo "configure:7679: checking for Itcl private headers. srcdir=${srcdir}" >&5
+echo "configure:7748: checking for Itcl private headers. srcdir=${srcdir}" >&5
if test x"${ac_cv_c_itclh}" = x ; then
for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itcl; do
if test -f $i/generic/itcl.h ; then
@@ -7698,7 +7767,7 @@ fi
echo $ac_n "checking for Itk private headers. srcdir=${srcdir}""... $ac_c" 1>&6
-echo "configure:7702: checking for Itk private headers. srcdir=${srcdir}" >&5
+echo "configure:7771: checking for Itk private headers. srcdir=${srcdir}" >&5
if test x"${ac_cv_c_itkh}" = x ; then
for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itk; do
if test -f $i/generic/itk.h ; then
@@ -7721,7 +7790,7 @@ fi
echo $ac_n "checking for Tix private headers. srcdir=${srcdir}""... $ac_c" 1>&6
-echo "configure:7725: checking for Tix private headers. srcdir=${srcdir}" >&5
+echo "configure:7794: checking for Tix private headers. srcdir=${srcdir}" >&5
if test x"${ac_cv_c_tixh}" = x ; then
for i in ${srcdir}/../tix ${srcdir}/../../tix ${srcdir}/../../../tix ; do
if test -f $i/generic/tix.h ; then
@@ -7773,7 +7842,7 @@ if test "${with_itclconfig+set}" = set; then
fi
echo $ac_n "checking for Itcl configuration""... $ac_c" 1>&6
-echo "configure:7777: checking for Itcl configuration" >&5
+echo "configure:7846: checking for Itcl configuration" >&5
if eval "test \"`echo '$''{'ac_cv_c_itclconfig'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -7876,7 +7945,7 @@ if test "${with_itkconfig+set}" = set; then
fi
echo $ac_n "checking for Itk configuration""... $ac_c" 1>&6
-echo "configure:7880: checking for Itk configuration" >&5
+echo "configure:7949: checking for Itk configuration" >&5
if eval "test \"`echo '$''{'ac_cv_c_itkconfig'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -7979,7 +8048,7 @@ if test "${with_tixconfig+set}" = set; then
fi
echo $ac_n "checking for Tix configuration""... $ac_c" 1>&6
-echo "configure:7983: checking for Tix configuration" >&5
+echo "configure:8052: checking for Tix configuration" >&5
if eval "test \"`echo '$''{'ac_cv_c_tixconfig'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -8122,7 +8191,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:8126: checking for X" >&5
+echo "configure:8195: checking for X" >&5
# Check whether --with-x or --without-x was given.
if test "${with_x+set}" = set; then
@@ -8184,12 +8253,12 @@ if test "$ac_x_includes" = NO; then
# First, try using that file with no special directory specified.
cat > conftest.$ac_ext <<EOF
-#line 8188 "configure"
+#line 8257 "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:8193: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8262: \"$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*
@@ -8258,14 +8327,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 8262 "configure"
+#line 8331 "configure"
#include "confdefs.h"
int main() {
${x_direct_test_function}()
; return 0; }
EOF
-if { (eval echo configure:8269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8338: \"$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.
@@ -8558,7 +8627,7 @@ fi
# ``gdbserver'' can only be built in a native configuration.
if test x"${target}" = x"${host}"; then
echo $ac_n "checking whether gdbserver is supported on this host""... $ac_c" 1>&6
-echo "configure:8562: checking whether gdbserver is supported on this host" >&5
+echo "configure:8631: checking whether gdbserver is supported on this host" >&5
if test x"${build_gdbserver}" = xyes ; then
configdirs="${configdirs} gdbserver"
SUBDIRS="${SUBDIRS} gdbserver"
@@ -8620,7 +8689,7 @@ fi
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:8624: checking whether ln -s works" >&5
+echo "configure:8693: checking whether ln -s works" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -8644,12 +8713,12 @@ fi
echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:8648: checking for Cygwin environment" >&5
+echo "configure:8717: 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 8653 "configure"
+#line 8722 "configure"
#include "confdefs.h"
int main() {
@@ -8660,7 +8729,7 @@ int main() {
return __CYGWIN__;
; return 0; }
EOF
-if { (eval echo configure:8664: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8733: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_cygwin=yes
else
@@ -8677,19 +8746,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:8681: checking for mingw32 environment" >&5
+echo "configure:8750: 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 8686 "configure"
+#line 8755 "configure"
#include "confdefs.h"
int main() {
return __MINGW32__;
; return 0; }
EOF
-if { (eval echo configure:8693: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8762: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_mingw32=yes
else
@@ -8708,7 +8777,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:8712: checking for executable suffix" >&5
+echo "configure:8781: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -8718,7 +8787,7 @@ else
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_exeext=
- if { (eval echo configure:8722: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ if { (eval echo configure:8791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
*.c | *.o | *.obj | *.ilk | *.pdb) ;;
diff --git a/gdb/configure.host b/gdb/configure.host
index 4c69fff..0c26ac0 100644
--- a/gdb/configure.host
+++ b/gdb/configure.host
@@ -34,6 +34,7 @@ alpha*-*-osf2*) gdb_host=alpha-osf2 ;;
alpha*-*-osf[3456789]*) gdb_host=alpha-osf3 ;;
alpha*-*-linux*) gdb_host=alpha-linux ;;
alpha*-*-freebsd*) gdb_host=fbsd ;;
+alpha*-*-netbsd*) gdb_host=nbsd ;;
arm*-*-linux*) gdb_host=linux ;;
arm*-*-netbsd*) gdb_host=nbsd ;;
diff --git a/gdb/configure.in b/gdb/configure.in
index 48f7b1a..19976dd 100644
--- a/gdb/configure.in
+++ b/gdb/configure.in
@@ -130,6 +130,7 @@ AC_CHECK_HEADERS(ctype.h nlist.h link.h thread_db.h proc_service.h \
AC_HEADER_STAT
AC_C_CONST
+AC_C_INLINE
AC_CHECK_FUNCS(bcopy btowc bzero canonicalize_file_name isascii poll \
realpath sbrk setpgid setpgrp sigaction sigprocmask sigsetmask )
@@ -241,7 +242,7 @@ BFD_NEED_DECLARATION(free)
BFD_NEED_DECLARATION(strerror)
BFD_NEED_DECLARATION(strdup)
BFD_NEED_DECLARATION(strstr)
-
+BFD_NEED_DECLARATION(canonicalize_file_name)
# The following save_state_t checkery is only necessary for HPUX
# versions earlier than 10.20. When those fade from memory, this
@@ -408,6 +409,7 @@ if test ${host} = ${target} ; then
AC_MSG_RESULT($gdb_cv_have_struct_link_map32)
if test $gdb_cv_have_struct_link_map32 = yes; then
AC_DEFINE(HAVE_STRUCT_LINK_MAP32)
+ AC_DEFINE(_SYSCALL32)
fi
fi
diff --git a/gdb/configure.tgt b/gdb/configure.tgt
index 1ccdfed..9b35547 100644
--- a/gdb/configure.tgt
+++ b/gdb/configure.tgt
@@ -14,6 +14,7 @@ case "${target_cpu}" in
alpha*) gdb_target_cpu=alpha ;;
arm*) gdb_target_cpu=arm ;;
+avr*) gdb_target_cpu=avr ;;
hppa*) gdb_target_cpu=pa ;;
i[3456]86*) gdb_target_cpu=i386 ;;
m68hc11*|m6811*) gdb_target_cpu=m68hc11 ;;
@@ -36,18 +37,10 @@ esac
case "${target}" in
-# OBSOLETE a29k-*-aout*) gdb_target=a29k ;;
-# OBSOLETE a29k-*-coff*) gdb_target=a29k ;;
-# OBSOLETE a29k-*-elf*) gdb_target=a29k ;;
-# OBSOLETE a29k-*-ebmon*) gdb_target=a29k ;;
-# OBSOLETE a29k-*-kern*) gdb_target=a29k-kern ;;
-# OBSOLETE a29k-*-none*) gdb_target=a29k ;;
-# OBSOLETE a29k-*-udi*) gdb_target=a29k-udi ;;
-# OBSOLETE a29k-*-vxworks*) gdb_target=vx29k ;;
-
alpha*-*-osf*) gdb_target=alpha-osf1 ;;
alpha*-*-linux*) gdb_target=alpha-linux ;;
alpha*-*-freebsd*) gdb_target=fbsd ;;
+alpha*-*-netbsd*) gdb_target=nbsd ;;
arc-*-*) gdb_target=arc ;;
@@ -65,6 +58,10 @@ xscale-*-*) gdb_target=embed
configdirs="$configdirs rdi-share"
;;
+avr-*-*) gdb_target=avr
+ gdb_multi_arch=yes
+ ;;
+
cris*) gdb_target=cris ;;
d10v-*-*) gdb_target=d10v ;;
diff --git a/gdb/core-sol2.c b/gdb/core-sol2.c
index e72fc2a..0123cf4 100644
--- a/gdb/core-sol2.c
+++ b/gdb/core-sol2.c
@@ -27,8 +27,6 @@
This file combines the core register fetching from core-regset.c
and sparc-nat.c to be able to read both flavours. */
-/* for Sparc64 cross Sparc32 */
-#define _SYSCALL32
#include "defs.h"
#if defined (__sparcv9)
diff --git a/gdb/corefile.c b/gdb/corefile.c
index 7acbd6eb..29eeac8 100644
--- a/gdb/corefile.c
+++ b/gdb/corefile.c
@@ -441,7 +441,7 @@ _initialize_core (void)
"Use FILE as core dump for examining memory and registers.\n\
No arg means have no core file. This command has been superseded by the\n\
`target core' and `detach' commands.", &cmdlist);
- c->completer = filename_completer;
+ set_cmd_completer (c, filename_completer);
c = add_set_cmd ("gnutarget", class_files, var_string_noescape,
(char *) &gnutarget_string,
diff --git a/gdb/corelow.c b/gdb/corelow.c
index 68219c5..657cdc8 100644
--- a/gdb/corelow.c
+++ b/gdb/corelow.c
@@ -358,8 +358,9 @@ core_open (char *filename, int from_tty)
/* Now, set up the frame cache, and print the top of stack. */
flush_cached_frames ();
- select_frame (get_current_frame (), 0);
- print_stack_frame (selected_frame, selected_frame_level, 1);
+ select_frame (get_current_frame ());
+ print_stack_frame (selected_frame,
+ frame_relative_level (selected_frame), 1);
}
else
{
diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c
index 66920312..7ea9f3f 100644
--- a/gdb/cp-valprint.c
+++ b/gdb/cp-valprint.c
@@ -1,6 +1,6 @@
/* Support for printing C++ values for GDB, the GNU debugger.
Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
- 2000, 2001
+ 2000, 2001, 2002
Free Software Foundation, Inc.
This file is part of GDB.
@@ -201,6 +201,8 @@ cp_is_vtbl_ptr_type (struct type *type)
int
cp_is_vtbl_member (struct type *type)
{
+ /* With older versions of g++, the vtbl field pointed to an array
+ of structures. Nowadays it points directly to the structure. */
if (TYPE_CODE (type) == TYPE_CODE_PTR)
{
type = TYPE_TARGET_TYPE (type);
@@ -215,6 +217,17 @@ cp_is_vtbl_member (struct type *type)
return cp_is_vtbl_ptr_type (type);
}
}
+ else if (TYPE_CODE (type) == TYPE_CODE_STRUCT) /* if not using thunks */
+ {
+ return cp_is_vtbl_ptr_type (type);
+ }
+ else if (TYPE_CODE (type) == TYPE_CODE_PTR) /* if using thunks */
+ {
+ /* The type name of the thunk pointer is NULL when using dwarf2.
+ We could test for a pointer to a function, but there is
+ no type info for the virtual table either, so it wont help. */
+ return cp_is_vtbl_ptr_type (type);
+ }
}
return 0;
}
diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c
index 4662eba..e85ac12 100644
--- a/gdb/cris-tdep.c
+++ b/gdb/cris-tdep.c
@@ -3925,8 +3925,17 @@ cris_version_update (char *ignore_args, int from_tty,
{
struct gdbarch_info info;
+ /* NOTE: cagney/2002-03-17: The add_show_from_set() function clones
+ the set command passed as a parameter. The clone operation will
+ include (BUG?) any ``set'' command callback, if present.
+ Commands like ``info set'' call all the ``show'' command
+ callbacks. Unfortunatly, for ``show'' commands cloned from
+ ``set'', this includes callbacks belonging to ``set'' commands.
+ Making this worse, this only occures if add_show_from_set() is
+ called after add_cmd_sfunc() (BUG?). */
+
/* From here on, trust the user's CRIS version setting. */
- if (c->type == set_cmd)
+ if (cmd_type (c) == set_cmd)
{
usr_cmd_cris_version_valid = 1;
@@ -3943,8 +3952,17 @@ cris_mode_update (char *ignore_args, int from_tty,
{
struct gdbarch_info info;
+ /* NOTE: cagney/2002-03-17: The add_show_from_set() function clones
+ the set command passed as a parameter. The clone operation will
+ include (BUG?) any ``set'' command callback, if present.
+ Commands like ``info set'' call all the ``show'' command
+ callbacks. Unfortunatly, for ``show'' commands cloned from
+ ``set'', this includes callbacks belonging to ``set'' commands.
+ Making this worse, this only occures if add_show_from_set() is
+ called after add_cmd_sfunc() (BUG?). */
+
/* From here on, trust the user's CRIS mode setting. */
- if (c->type == set_cmd)
+ if (cmd_type (c) == set_cmd)
{
usr_cmd_cris_mode_valid = 1;
@@ -3961,8 +3979,17 @@ cris_abi_update (char *ignore_args, int from_tty,
{
struct gdbarch_info info;
+ /* NOTE: cagney/2002-03-17: The add_show_from_set() function clones
+ the set command passed as a parameter. The clone operation will
+ include (BUG?) any ``set'' command callback, if present.
+ Commands like ``info set'' call all the ``show'' command
+ callbacks. Unfortunatly, for ``show'' commands cloned from
+ ``set'', this includes callbacks belonging to ``set'' commands.
+ Making this worse, this only occures if add_show_from_set() is
+ called after add_cmd_sfunc() (BUG?). */
+
/* From here on, trust the user's CRIS ABI setting. */
- if (c->type == set_cmd)
+ if (cmd_type (c) == set_cmd)
{
usr_cmd_cris_abi_valid = 1;
@@ -4073,17 +4100,19 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
cris_abi = CRIS_ABI_V2;
}
}
- else if (gdbarch_tdep (current_gdbarch))
+ else if (arches != NULL)
{
- /* No bfd available. Stick with whatever ABI we're currently using.
- (This is to avoid changing the ABI when the user updates the
- architecture with the 'set cris-version' command.) */
- cris_abi = gdbarch_tdep (current_gdbarch)->cris_abi;
+ /* No bfd available. Stick with the ABI from the most recently
+ selected architecture of this same family (the head of arches
+ always points to this). (This is to avoid changing the ABI
+ when the user updates the architecture with the 'set
+ cris-version' command.) */
+ cris_abi = gdbarch_tdep (arches->gdbarch)->cris_abi;
}
else
{
- /* No bfd, and no current architecture available. Assume it's the
- new ABI. */
+ /* No bfd, and no previously selected architecture available.
+ Assume it's the new ABI. */
cris_abi = CRIS_ABI_V2;
}
diff --git a/gdb/d10v-tdep.c b/gdb/d10v-tdep.c
index d06a0b9..2060c93 100644
--- a/gdb/d10v-tdep.c
+++ b/gdb/d10v-tdep.c
@@ -1,6 +1,7 @@
/* Target-dependent code for Mitsubishi D10V, for GDB.
- Copyright 1996, 1997, 1998, 1999, 2000, 2001
- Free Software Foundation, Inc.
+
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software
+ Foundation, Inc.
This file is part of GDB.
@@ -41,9 +42,6 @@
#include "floatformat.h"
#include "sim-d10v.h"
-#undef XMALLOC
-#define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
-
struct frame_extra_info
{
CORE_ADDR return_pc;
@@ -152,7 +150,7 @@ d10v_use_struct_convention (int gcc_p, struct type *type)
}
-static unsigned char *
+static const unsigned char *
d10v_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
{
static unsigned char breakpoint[] =
@@ -358,18 +356,6 @@ d10v_register_virtual_type (int reg_nr)
return builtin_type_int16;
}
-static CORE_ADDR
-d10v_make_daddr (CORE_ADDR x)
-{
- return ((x) | DMEM_START);
-}
-
-static CORE_ADDR
-d10v_make_iaddr (CORE_ADDR x)
-{
- return (((x) << 2) | IMEM_START);
-}
-
static int
d10v_daddr_p (CORE_ADDR x)
{
@@ -382,6 +368,20 @@ d10v_iaddr_p (CORE_ADDR x)
return (((x) & 0x3000000) == IMEM_START);
}
+static CORE_ADDR
+d10v_make_daddr (CORE_ADDR x)
+{
+ return ((x) | DMEM_START);
+}
+
+static CORE_ADDR
+d10v_make_iaddr (CORE_ADDR x)
+{
+ if (d10v_iaddr_p (x))
+ return x; /* Idempotency -- x is already in the IMEM space. */
+ else
+ return (((x) << 2) | IMEM_START);
+}
static CORE_ADDR
d10v_convert_iaddr_to_raw (CORE_ADDR x)
@@ -968,12 +968,6 @@ d10v_write_sp (CORE_ADDR val)
write_register (SP_REGNUM, d10v_convert_daddr_to_raw (val));
}
-static void
-d10v_write_fp (CORE_ADDR val)
-{
- write_register (FP_REGNUM, d10v_convert_daddr_to_raw (val));
-}
-
static CORE_ADDR
d10v_read_fp (void)
{
@@ -1479,7 +1473,6 @@ d10v_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_read_pc (gdbarch, d10v_read_pc);
set_gdbarch_write_pc (gdbarch, d10v_write_pc);
set_gdbarch_read_fp (gdbarch, d10v_read_fp);
- set_gdbarch_write_fp (gdbarch, d10v_write_fp);
set_gdbarch_read_sp (gdbarch, d10v_read_sp);
set_gdbarch_write_sp (gdbarch, d10v_write_sp);
diff --git a/gdb/d30v-tdep.c b/gdb/d30v-tdep.c
index ede8dd8..b5d3a3b 100644
--- a/gdb/d30v-tdep.c
+++ b/gdb/d30v-tdep.c
@@ -1,6 +1,7 @@
/* Target-dependent code for Mitsubishi D30V, for GDB.
- Copyright 1996, 1997, 1998, 1999, 2000, 2001
- Free Software Foundation, Inc.
+
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software
+ Foundation, Inc.
This file is part of GDB.
@@ -725,7 +726,7 @@ d30v_print_register (int regnum, int tabular)
{
char regbuf[MAX_REGISTER_RAW_SIZE];
- read_relative_register_raw_bytes (regnum, regbuf);
+ frame_register_read (selected_frame, regnum, regbuf);
val_print (REGISTER_VIRTUAL_TYPE (regnum), regbuf, 0, 0,
gdb_stdout, 'x', 1, 0, Val_pretty_default);
diff --git a/gdb/dbxread.c b/gdb/dbxread.c
index 26be70c..9b2b73b 100644
--- a/gdb/dbxread.c
+++ b/gdb/dbxread.c
@@ -1230,6 +1230,52 @@ read_dbx_dynamic_symtab (struct objfile *objfile)
do_cleanups (back_to);
}
+#ifdef SOFUN_ADDRESS_MAYBE_MISSING
+CORE_ADDR
+find_stab_function_addr (char *namestring, char *filename,
+ struct objfile *objfile)
+{
+ struct minimal_symbol *msym;
+ char *p;
+ int n;
+
+ p = strchr (namestring, ':');
+ if (p == NULL)
+ p = namestring;
+ n = p - namestring;
+ p = alloca (n + 2);
+ strncpy (p, namestring, n);
+ p[n] = 0;
+
+ msym = lookup_minimal_symbol (p, filename, objfile);
+ if (msym == NULL)
+ {
+ /* Sun Fortran appends an underscore to the minimal symbol name,
+ try again with an appended underscore if the minimal symbol
+ was not found. */
+ p[n] = '_';
+ p[n + 1] = 0;
+ msym = lookup_minimal_symbol (p, filename, objfile);
+ }
+
+ if (msym == NULL && filename != NULL)
+ {
+ /* Try again without the filename. */
+ p[n] = 0;
+ msym = lookup_minimal_symbol (p, NULL, objfile);
+ }
+ if (msym == NULL && filename != NULL)
+ {
+ /* And try again for Sun Fortran, but without the filename. */
+ p[n] = '_';
+ p[n + 1] = 0;
+ msym = lookup_minimal_symbol (p, NULL, objfile);
+ }
+
+ return msym == NULL ? 0 : SYMBOL_VALUE_ADDRESS (msym);
+}
+#endif /* SOFUN_ADDRESS_MAYBE_MISSING */
+
/* Setup partial_symtab's describing each source file for which
debugging information is available. */
@@ -2707,6 +2753,15 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
used to relocate these symbol types rather than SECTION_OFFSETS. */
static CORE_ADDR function_start_offset;
+ /* This holds the address of the start of a function, without the system
+ peculiarities of function_start_offset. */
+ static CORE_ADDR last_function_start;
+
+ /* If this is nonzero, we've seen an N_SLINE since the start of the current
+ function. Initialized to nonzero to assure that last_function_start
+ is never used uninitialized. */
+ static int sline_found_in_function = 1;
+
/* If this is nonzero, we've seen a non-gcc N_OPT symbol for this source
file. Used to detect the SunPRO solaris compiler. */
static int n_opt_found;
@@ -2758,9 +2813,13 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
break;
}
+ sline_found_in_function = 0;
+
/* Relocate for dynamic loading */
valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
valu = SMASH_TEXT_ADDRESS (valu);
+ last_function_start = valu;
+
goto define_a_symbol;
case N_LBRAC:
@@ -2953,7 +3012,15 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
#ifdef SUN_FIXED_LBRAC_BUG
last_pc_address = valu; /* Save for SunOS bug circumcision */
#endif
- record_line (current_subfile, desc, valu);
+ /* If this is the first SLINE note in the function, record it at
+ the start of the function instead of at the listed location. */
+ if (within_function && sline_found_in_function == 0)
+ {
+ record_line (current_subfile, desc, last_function_start);
+ sline_found_in_function = 1;
+ }
+ else
+ record_line (current_subfile, desc, valu);
break;
case N_BCOMM:
diff --git a/gdb/defs.h b/gdb/defs.h
index b6e7953..ab66d73 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -39,6 +39,9 @@
#include <unistd.h>
#endif
+/* For ``enum target_signal''. */
+#include "gdb/signals.h"
+
/* Just in case they're not defined in stdio.h. */
#ifndef SEEK_SET
@@ -219,213 +222,6 @@ enum precision_type
unspecified_precision
};
-/* The numbering of these signals is chosen to match traditional unix
- signals (insofar as various unices use the same numbers, anyway).
- It is also the numbering of the GDB remote protocol. Other remote
- protocols, if they use a different numbering, should make sure to
- translate appropriately.
-
- Since these numbers have actually made it out into other software
- (stubs, etc.), you mustn't disturb the assigned numbering. If you
- need to add new signals here, add them to the end of the explicitly
- numbered signals.
-
- This is based strongly on Unix/POSIX signals for several reasons:
- (1) This set of signals represents a widely-accepted attempt to
- represent events of this sort in a portable fashion, (2) we want a
- signal to make it from wait to child_wait to the user intact, (3) many
- remote protocols use a similar encoding. However, it is
- recognized that this set of signals has limitations (such as not
- distinguishing between various kinds of SIGSEGV, or not
- distinguishing hitting a breakpoint from finishing a single step).
- So in the future we may get around this either by adding additional
- signals for breakpoint, single-step, etc., or by adding signal
- codes; the latter seems more in the spirit of what BSD, System V,
- etc. are doing to address these issues. */
-
-/* For an explanation of what each signal means, see
- target_signal_to_string. */
-
-enum target_signal
- {
- /* Used some places (e.g. stop_signal) to record the concept that
- there is no signal. */
- TARGET_SIGNAL_0 = 0,
- TARGET_SIGNAL_FIRST = 0,
- TARGET_SIGNAL_HUP = 1,
- TARGET_SIGNAL_INT = 2,
- TARGET_SIGNAL_QUIT = 3,
- TARGET_SIGNAL_ILL = 4,
- TARGET_SIGNAL_TRAP = 5,
- TARGET_SIGNAL_ABRT = 6,
- TARGET_SIGNAL_EMT = 7,
- TARGET_SIGNAL_FPE = 8,
- TARGET_SIGNAL_KILL = 9,
- TARGET_SIGNAL_BUS = 10,
- TARGET_SIGNAL_SEGV = 11,
- TARGET_SIGNAL_SYS = 12,
- TARGET_SIGNAL_PIPE = 13,
- TARGET_SIGNAL_ALRM = 14,
- TARGET_SIGNAL_TERM = 15,
- TARGET_SIGNAL_URG = 16,
- TARGET_SIGNAL_STOP = 17,
- TARGET_SIGNAL_TSTP = 18,
- TARGET_SIGNAL_CONT = 19,
- TARGET_SIGNAL_CHLD = 20,
- TARGET_SIGNAL_TTIN = 21,
- TARGET_SIGNAL_TTOU = 22,
- TARGET_SIGNAL_IO = 23,
- TARGET_SIGNAL_XCPU = 24,
- TARGET_SIGNAL_XFSZ = 25,
- TARGET_SIGNAL_VTALRM = 26,
- TARGET_SIGNAL_PROF = 27,
- TARGET_SIGNAL_WINCH = 28,
- TARGET_SIGNAL_LOST = 29,
- TARGET_SIGNAL_USR1 = 30,
- TARGET_SIGNAL_USR2 = 31,
- TARGET_SIGNAL_PWR = 32,
- /* Similar to SIGIO. Perhaps they should have the same number. */
- TARGET_SIGNAL_POLL = 33,
- TARGET_SIGNAL_WIND = 34,
- TARGET_SIGNAL_PHONE = 35,
- TARGET_SIGNAL_WAITING = 36,
- TARGET_SIGNAL_LWP = 37,
- TARGET_SIGNAL_DANGER = 38,
- TARGET_SIGNAL_GRANT = 39,
- TARGET_SIGNAL_RETRACT = 40,
- TARGET_SIGNAL_MSG = 41,
- TARGET_SIGNAL_SOUND = 42,
- TARGET_SIGNAL_SAK = 43,
- TARGET_SIGNAL_PRIO = 44,
- TARGET_SIGNAL_REALTIME_33 = 45,
- TARGET_SIGNAL_REALTIME_34 = 46,
- TARGET_SIGNAL_REALTIME_35 = 47,
- TARGET_SIGNAL_REALTIME_36 = 48,
- TARGET_SIGNAL_REALTIME_37 = 49,
- TARGET_SIGNAL_REALTIME_38 = 50,
- TARGET_SIGNAL_REALTIME_39 = 51,
- TARGET_SIGNAL_REALTIME_40 = 52,
- TARGET_SIGNAL_REALTIME_41 = 53,
- TARGET_SIGNAL_REALTIME_42 = 54,
- TARGET_SIGNAL_REALTIME_43 = 55,
- TARGET_SIGNAL_REALTIME_44 = 56,
- TARGET_SIGNAL_REALTIME_45 = 57,
- TARGET_SIGNAL_REALTIME_46 = 58,
- TARGET_SIGNAL_REALTIME_47 = 59,
- TARGET_SIGNAL_REALTIME_48 = 60,
- TARGET_SIGNAL_REALTIME_49 = 61,
- TARGET_SIGNAL_REALTIME_50 = 62,
- TARGET_SIGNAL_REALTIME_51 = 63,
- TARGET_SIGNAL_REALTIME_52 = 64,
- TARGET_SIGNAL_REALTIME_53 = 65,
- TARGET_SIGNAL_REALTIME_54 = 66,
- TARGET_SIGNAL_REALTIME_55 = 67,
- TARGET_SIGNAL_REALTIME_56 = 68,
- TARGET_SIGNAL_REALTIME_57 = 69,
- TARGET_SIGNAL_REALTIME_58 = 70,
- TARGET_SIGNAL_REALTIME_59 = 71,
- TARGET_SIGNAL_REALTIME_60 = 72,
- TARGET_SIGNAL_REALTIME_61 = 73,
- TARGET_SIGNAL_REALTIME_62 = 74,
- TARGET_SIGNAL_REALTIME_63 = 75,
-
- /* Used internally by Solaris threads. See signal(5) on Solaris. */
- TARGET_SIGNAL_CANCEL = 76,
-
- /* Yes, this pains me, too. But LynxOS didn't have SIG32, and now
- GNU/Linux does, and we can't disturb the numbering, since it's
- part of the remote protocol. Note that in some GDB's
- TARGET_SIGNAL_REALTIME_32 is number 76. */
- TARGET_SIGNAL_REALTIME_32,
- /* Yet another pain, IRIX 6 has SIG64. */
- TARGET_SIGNAL_REALTIME_64,
- /* Yet another pain, GNU/Linux MIPS might go up to 128. */
- TARGET_SIGNAL_REALTIME_65,
- TARGET_SIGNAL_REALTIME_66,
- TARGET_SIGNAL_REALTIME_67,
- TARGET_SIGNAL_REALTIME_68,
- TARGET_SIGNAL_REALTIME_69,
- TARGET_SIGNAL_REALTIME_70,
- TARGET_SIGNAL_REALTIME_71,
- TARGET_SIGNAL_REALTIME_72,
- TARGET_SIGNAL_REALTIME_73,
- TARGET_SIGNAL_REALTIME_74,
- TARGET_SIGNAL_REALTIME_75,
- TARGET_SIGNAL_REALTIME_76,
- TARGET_SIGNAL_REALTIME_77,
- TARGET_SIGNAL_REALTIME_78,
- TARGET_SIGNAL_REALTIME_79,
- TARGET_SIGNAL_REALTIME_80,
- TARGET_SIGNAL_REALTIME_81,
- TARGET_SIGNAL_REALTIME_82,
- TARGET_SIGNAL_REALTIME_83,
- TARGET_SIGNAL_REALTIME_84,
- TARGET_SIGNAL_REALTIME_85,
- TARGET_SIGNAL_REALTIME_86,
- TARGET_SIGNAL_REALTIME_87,
- TARGET_SIGNAL_REALTIME_88,
- TARGET_SIGNAL_REALTIME_89,
- TARGET_SIGNAL_REALTIME_90,
- TARGET_SIGNAL_REALTIME_91,
- TARGET_SIGNAL_REALTIME_92,
- TARGET_SIGNAL_REALTIME_93,
- TARGET_SIGNAL_REALTIME_94,
- TARGET_SIGNAL_REALTIME_95,
- TARGET_SIGNAL_REALTIME_96,
- TARGET_SIGNAL_REALTIME_97,
- TARGET_SIGNAL_REALTIME_98,
- TARGET_SIGNAL_REALTIME_99,
- TARGET_SIGNAL_REALTIME_100,
- TARGET_SIGNAL_REALTIME_101,
- TARGET_SIGNAL_REALTIME_102,
- TARGET_SIGNAL_REALTIME_103,
- TARGET_SIGNAL_REALTIME_104,
- TARGET_SIGNAL_REALTIME_105,
- TARGET_SIGNAL_REALTIME_106,
- TARGET_SIGNAL_REALTIME_107,
- TARGET_SIGNAL_REALTIME_108,
- TARGET_SIGNAL_REALTIME_109,
- TARGET_SIGNAL_REALTIME_110,
- TARGET_SIGNAL_REALTIME_111,
- TARGET_SIGNAL_REALTIME_112,
- TARGET_SIGNAL_REALTIME_113,
- TARGET_SIGNAL_REALTIME_114,
- TARGET_SIGNAL_REALTIME_115,
- TARGET_SIGNAL_REALTIME_116,
- TARGET_SIGNAL_REALTIME_117,
- TARGET_SIGNAL_REALTIME_118,
- TARGET_SIGNAL_REALTIME_119,
- TARGET_SIGNAL_REALTIME_120,
- TARGET_SIGNAL_REALTIME_121,
- TARGET_SIGNAL_REALTIME_122,
- TARGET_SIGNAL_REALTIME_123,
- TARGET_SIGNAL_REALTIME_124,
- TARGET_SIGNAL_REALTIME_125,
- TARGET_SIGNAL_REALTIME_126,
- TARGET_SIGNAL_REALTIME_127,
-
-#if defined(MACH) || defined(__MACH__)
- /* Mach exceptions */
- TARGET_EXC_BAD_ACCESS,
- TARGET_EXC_BAD_INSTRUCTION,
- TARGET_EXC_ARITHMETIC,
- TARGET_EXC_EMULATION,
- TARGET_EXC_SOFTWARE,
- TARGET_EXC_BREAKPOINT,
-#endif
- TARGET_SIGNAL_INFO,
-
- /* Some signal we don't know about. */
- TARGET_SIGNAL_UNKNOWN,
-
- /* Use whatever signal we use when one is not specifically specified
- (for passing to proceed and so on). */
- TARGET_SIGNAL_DEFAULT,
-
- /* Last and unused enum value, for sizing arrays, etc. */
- TARGET_SIGNAL_LAST
- };
-
/* the cleanup list records things that have to be undone
if an error happens (descriptors to be closed, memory to be freed, etc.)
Each link in the chain records a function to call and an
@@ -576,6 +372,7 @@ extern CORE_ADDR host_pointer_to_address (void *ptr);
extern void *address_to_host_pointer (CORE_ADDR addr);
extern char *gdb_realpath (const char *);
+extern char *xfullpath (const char *);
/* From demangle.c */
@@ -587,7 +384,6 @@ struct type;
typedef int (use_struct_convention_fn) (int gcc_p, struct type * value_type);
extern use_struct_convention_fn generic_use_struct_convention;
-typedef unsigned char *(breakpoint_from_pc_fn) (CORE_ADDR * pcptr, int *lenptr);
/* Annotation stuff. */
@@ -783,10 +579,6 @@ extern void exec_set_find_memory_regions (int (*) (int (*) (CORE_ADDR,
void *),
void *));
-/* From findvar.c */
-
-extern int read_relative_register_raw_bytes (int, char *);
-
/* Possible lvalue types. Like enum language, this should be in
value.h, but needs to be here for the same reason. */
@@ -1044,6 +836,11 @@ extern void xmfree (void *md, void *ptr);
"libiberty.h". */
extern void xfree (void *);
+/* Utility macro to allocate typed memory. Avoids errors like
+ ``struct foo *foo = xmalloc (sizeof bar)'' and ``struct foo *foo =
+ (struct foo *) xmalloc (sizeof bar)''. */
+#define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
+
/* Like asprintf/vasprintf but get an internal_error if the call
fails. */
extern void xasprintf (char **ret, const char *format, ...) ATTR_FORMAT (printf, 2, 3);
@@ -1065,7 +862,7 @@ extern char *warning_pre_print;
extern NORETURN void verror (const char *fmt, va_list ap) ATTR_NORETURN;
-extern NORETURN void error (const char *fmt, ...) ATTR_NORETURN;
+extern NORETURN void error (const char *fmt, ...) ATTR_NORETURN ATTR_FORMAT (printf, 1, 2);
extern NORETURN void error_stream (struct ui_file *) ATTR_NORETURN;
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index 346eaed..a431b1e 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,96 @@
+2002-05-04 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbint.texinfo (Releasing GDB): Revise `Create a Release'.
+
+2002-05-04 Andrew Cagney <ac131313@redhat.com>
+
+ * gdb.texinfo: Delete obsolete references to a29k.
+
+2002-04-24 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbint.texinfo (Target Architecture Definition): Replace
+ IN_SIGTRAMP with PC_IN_SIGTRAMP.
+
+2002-04-24 David S. Miller <davem@redhat.com>
+
+ * gdbint.texinfo (REGISTER_IN_WINDOW): Delete definition.
+
+2002-04-21 David S. Miller <davem@redhat.com>
+
+ * gdbint.texinfo (SKIP_PROLOGUE_FRAMELESS_P): Delete definition.
+
+2002-04-21 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbint.texinfo (Target Architecture Definition): Delete
+ definition of HAVE_REGISTER_WINDOWS.
+
+2002-04-19 Eli Zaretskii <eliz@is.elta.co.il>
+
+ * gdbint.texinfo (Releasing GDB, Coding): Fix typos. Reported by
+ "Theodore A. Roth" <troth@verinet.com>.
+
+2002-04-15 Don Howard <dhoward@redhat.com>
+
+ From Eli Zaretskii <eliz@is.elta.co.il>
+ * gdb.texinfo (show max-user-call-depth): Correct formatting.
+ Provide a better explaination of this feature.
+
+2002-04-14 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbint.texinfo (Target Architecture Definition): Remove
+ FRAME_CHAIN_COMBINE.
+
+2002-04-12 Michael Chastain <mec@shout.net>
+
+ * gdbint.texinfo (Obsolete Conditionals): Remove reference to
+ REG_STACK_SEGMENT.
+
+2002-04-09 Michael Chastain <mec@shout.net>
+
+ * gdbint.texinfo (Obsolete Conditionals): Remove references to
+ PYRAMID_* macros.
+
+2002-04-07 Andrew Cagney <ac131313@redhat.com>
+
+ * gdb.texinfo (Bug Reporting): Document that the web is the
+ prefered way of submitting bug reports.
+ (Bug Reporting): Delete the s-mail address as the last resort.
+
+2002-04-05 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbint.texinfo (Target Architecture Definition): Delete
+ references to TARGET_WRITE_FP and write_fp.
+
+2002-03-27 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.texinfo: Document new commands dump, append, and restore.
+
+2002-03-27 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbint.texinfo (Releasing GDB): Revise the section `Before the
+ Branch'.
+
+2002-03-18 Andrew Cagney <ac131313@redhat.com>
+
+ * gdb.texinfo: Change all examples to @smallexample.
+ * gdbint.texinfo: Ditto.
+
+2002-03-18 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbint.texinfo (Releasing GDB): Add section ``Versions and
+ Branches''.
+
+2002-03-18 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbint.texinfo (Releasing GDB): Add the section``Branch Commit
+ Policy''.
+
+2002-03-04 Fred Fish <fnf@redhat.com>
+
+ * gdbint.texinfo: Fix a bunch of typos (alsways, mirrorred,
+ expresson, suports, dependant, trhe, perhaphs, situtations,
+ explictily, taged, oportunity, unfortunatly).
+
2002-02-24 Andrew Cagney <ac131313@redhat.com>
* Makefile.in (gdb.info): Add explicit path to gdb.texinfo.
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index e7d20a2..f37e288 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -767,24 +767,24 @@ options may effectively be unavailable.
The most usual way to start @value{GDBN} is with one argument,
specifying an executable program:
-@example
+@smallexample
@value{GDBP} @var{program}
-@end example
+@end smallexample
@noindent
You can also start with both an executable program and a core file
specified:
-@example
+@smallexample
@value{GDBP} @var{program} @var{core}
-@end example
+@end smallexample
You can, instead, specify a process ID as a second argument, if you want
to debug a running process:
-@example
+@smallexample
@value{GDBP} @var{program} 1234
-@end example
+@end smallexample
@noindent
would attach @value{GDBN} to process @code{1234} (unless you also have a file
@@ -799,9 +799,9 @@ will warn you if it is unable to attach or to read core dumps.
You can optionally have @code{@value{GDBP}} pass any arguments after the
executable file to the inferior using @code{--args}. This option stops
option processing.
-@example
+@smallexample
gdb --args gcc -O2 -c foo.c
-@end example
+@end smallexample
This will cause @code{@value{GDBP}} to debug @code{gcc}, and to set
@code{gcc}'s command-line arguments (@pxref{Arguments}) to @samp{-O2 -c foo.c}.
@@ -819,9 +819,9 @@ options. @value{GDBN} itself can remind you of the options available.
@noindent
Type
-@example
+@smallexample
@value{GDBP} -help
-@end example
+@end smallexample
@noindent
to display all available options and briefly describe their use
@@ -950,9 +950,9 @@ information. (@xref{Files,,Commands to specify files}, for information
on @file{.syms} files.) A simple @value{GDBN} invocation to do nothing
but build a @file{.syms} file for future use is:
-@example
+@smallexample
gdb -batch -nx -mapped -readnow programname
-@end example
+@end smallexample
@node Mode Options
@subsection Choosing modes
@@ -991,9 +991,9 @@ Batch mode may be useful for running @value{GDBN} as a filter, for
example to download and run a program on another computer; in order to
make this more useful, the message
-@example
+@smallexample
Program exited normally.
-@end example
+@end smallexample
@noindent
(which is ordinarily issued whenever a program running under
@@ -1283,17 +1283,17 @@ enter it). For example, if you type
@c complete accuracy in these examples; space introduced for clarity.
@c If texinfo enhancements make it unnecessary, it would be nice to
@c replace " @key" by "@key" in the following...
-@example
+@smallexample
(@value{GDBP}) info bre @key{TAB}
-@end example
+@end smallexample
@noindent
@value{GDBN} fills in the rest of the word @samp{breakpoints}, since that is
the only @code{info} subcommand beginning with @samp{bre}:
-@example
+@smallexample
(@value{GDBP}) info breakpoints
-@end example
+@end smallexample
@noindent
You can either press @key{RET} at this point, to run the @code{info
@@ -1313,7 +1313,7 @@ just sounds the bell. Typing @key{TAB} again displays all the
function names in your program that begin with those characters, for
example:
-@example
+@smallexample
(@value{GDBP}) b make_ @key{TAB}
@exdent @value{GDBN} sounds bell; press @key{TAB} again, to see:
make_a_section_from_file make_environ
@@ -1322,7 +1322,7 @@ make_blockvector make_pointer_type
make_cleanup make_reference_type
make_command make_symbol_completion_list
(@value{GDBP}) b make_
-@end example
+@end smallexample
@noindent
After displaying the available possibilities, @value{GDBN} copies your
@@ -1355,22 +1355,22 @@ word-completion facilities in this situation, type a single quote
@value{GDBN} that it may need to consider more information than usual
when you press @key{TAB} or @kbd{M-?} to request word completion:
-@example
+@smallexample
(@value{GDBP}) b 'bubble( @kbd{M-?}
bubble(double,double) bubble(int,int)
(@value{GDBP}) b 'bubble(
-@end example
+@end smallexample
In some cases, @value{GDBN} can tell that completing a name requires using
quotes. When this happens, @value{GDBN} inserts the quote for you (while
completing as much as it can) if you do not type the quote in the first
place:
-@example
+@smallexample
(@value{GDBP}) b bub @key{TAB}
@exdent @value{GDBN} alters your input line to the following, and rings a bell:
(@value{GDBP}) b 'bubble(
-@end example
+@end smallexample
@noindent
In general, @value{GDBN} can tell that a quote is needed (and inserts it) if
@@ -1806,9 +1806,9 @@ null value.
For example, this command:
-@example
+@smallexample
set env USER = foo
-@end example
+@end smallexample
@noindent
tells the debugged program, when subsequently run, that its user is named
@@ -1879,9 +1879,9 @@ program is using.
You can redirect your program's input and/or output using shell
redirection with the @code{run} command. For example,
-@example
+@smallexample
run > outfile
-@end example
+@end smallexample
@noindent
starts your program, diverting its output to the file @file{outfile}.
@@ -1894,9 +1894,9 @@ argument, and causes this file to be the default for future @code{run}
commands. It also resets the controlling terminal for the child
process, for future @code{run} commands. For example,
-@example
+@smallexample
tty /dev/ttyb
-@end example
+@end smallexample
@noindent
directs that processes started with subsequent @code{run} commands
@@ -2055,9 +2055,9 @@ form @samp{[New @var{systag}]}. @var{systag} is a thread identifier
whose form varies depending on the particular system. For example, on
LynxOS, you might see
-@example
+@smallexample
[New process 35 thread 27]
-@end example
+@end smallexample
@noindent
when @value{GDBN} notices a new thread. In contrast, on an SGI system,
@@ -2126,9 +2126,9 @@ form @samp{[New @var{systag}]}. @var{systag} is a thread identifier
whose form varies depending on the particular system. For example, on
HP-UX, you see
-@example
+@smallexample
[New thread 2 (system thread 26594)]
-@end example
+@end smallexample
@noindent
when @value{GDBN} notices a new thread.
@@ -2155,7 +2155,7 @@ For example,
@end table
@c end table here to get a little more width for example
-@example
+@smallexample
(@value{GDBP}) info threads
* 3 system thread 26607 worker (wptr=0x7b09c318 "@@") \@*
at quicksort.c:137
@@ -2163,7 +2163,7 @@ For example,
from /usr/lib/libc.2
1 system thread 27905 0x7b003498 in _brk () \@*
from /usr/lib/libc.2
-@end example
+@end smallexample
@table @code
@kindex thread @var{threadno}
@@ -2639,9 +2639,9 @@ statement, not the instruction, after the change occurs.
When you issue the @code{watch} command, @value{GDBN} reports
-@example
+@smallexample
Hardware watchpoint @var{num}: @var{expr}
-@end example
+@end smallexample
@noindent
if it was able to set a hardware watchpoint.
@@ -2820,11 +2820,11 @@ knowledge of the implementation. In the case of @sc{gnu} C@t{++}, exceptions ar
raised by calling a library function named @code{__raise_exception}
which has the following ANSI C interface:
-@example
+@smallexample
/* @var{addr} is where the exception identifier is stored.
@var{id} is the exception identifier. */
void __raise_exception (void **addr, void *id);
-@end example
+@end smallexample
@noindent
To make the debugger catch all exceptions before any stack
@@ -3017,9 +3017,9 @@ referents in the context of your breakpoint. If @var{expression} uses
symbols not referenced in the context of the breakpoint, @value{GDBN}
prints an error message:
-@example
+@smallexample
No symbol "foo" in current context.
-@end example
+@end smallexample
@noindent
@value{GDBN} does
@@ -3128,14 +3128,14 @@ breakpoints. @xref{Output, ,Commands for controlled output}.
For example, here is how you could use breakpoint commands to print the
value of @code{x} at entry to @code{foo} whenever @code{x} is positive.
-@example
+@smallexample
break foo if x>0
commands
silent
printf "x is %d\n",x
cont
end
-@end example
+@end smallexample
One application for breakpoint commands is to compensate for one bug so
you can test for another. Put a breakpoint just after the erroneous line
@@ -3145,14 +3145,14 @@ to any variables that need them. End with the @code{continue} command
so that your program does not stop, and start with the @code{silent}
command so that no output is produced. Here is an example:
-@example
+@smallexample
break 403
commands
silent
set x = y + 4
cont
end
-@end example
+@end smallexample
@node Breakpoint Menus
@subsection Breakpoint menus
@@ -3211,10 +3211,10 @@ any other process is running that program. In this situation,
attempting to run or continue a program with a breakpoint causes
@value{GDBN} to print an error message:
-@example
+@smallexample
Cannot insert breakpoints.
The same program may be running in another process.
-@end example
+@end smallexample
When this happens, you have three ways to proceed:
@@ -3419,13 +3419,13 @@ example, in the following excerpt from a debugging session, the @code{f}
(@code{frame}) command shows that execution is stopped at line
@code{206}; yet when we use @code{until}, we get to line @code{195}:
-@example
+@smallexample
(@value{GDBP}) f
#0 main (argc=4, argv=0xf7fffae8) at m4.c:206
206 expand_input();
(@value{GDBP}) until
195 for ( ; argc > 0; NEXTARG) @{
-@end example
+@end smallexample
This happened because, for execution efficiency, the compiler had
generated code for the loop closure test at the end, rather than the
@@ -3747,9 +3747,9 @@ frames in @value{GDBN} commands.
@cindex frameless execution
Some compilers provide a way to compile functions so that they operate
without stack frames. (For example, the @value{GCC} option
-@example
+@smallexample
@samp{-fomit-frame-pointer}
-@end example
+@end smallexample
generates functions without a frame.)
This is occasionally done with heavily used library functions to save
the frame setup time. @value{GDBN} has limited facilities for dealing
@@ -4404,6 +4404,7 @@ Table}.
* Registers:: Registers
* Floating Point Hardware:: Floating point hardware
* Memory Region Attributes:: Memory region attributes
+* Dump/Restore Files:: Copy between memory and a file
@end menu
@node Expressions
@@ -4483,7 +4484,7 @@ programming language from the point of execution in that frame
@noindent This means that in the function
-@example
+@smallexample
foo (a)
int a;
@{
@@ -4493,7 +4494,7 @@ foo (a)
bar (b);
@}
@}
-@end example
+@end smallexample
@noindent
you can examine and use the variable @code{a} whenever your program is
@@ -4515,10 +4516,10 @@ using the colon-colon notation:
@c info cannot cope with a :: index entry, but why deprive hard copy readers?
@cindex @code{::}, context for variables/functions
@end iftex
-@example
+@smallexample
@var{file}::@var{variable}
@var{function}::@var{variable}
-@end example
+@end smallexample
@noindent
Here @var{file} or @var{function} is the name of the context for the
@@ -4526,9 +4527,9 @@ static @var{variable}. In the case of file names, you can use quotes to
make sure @value{GDBN} parses the file name as a single word---for example,
to print a global value of @code{x} defined in @file{f2.c}:
-@example
+@smallexample
(@value{GDBP}) p 'f2.c'::x
-@end example
+@end smallexample
@cindex C@t{++} scope resolution
This use of @samp{::} is very rarely in conflict with the very similar
@@ -4565,9 +4566,9 @@ offered by the debug info format used by the compiler, @value{GDBN}
might not be able to display values for such local variables. If that
happens, @value{GDBN} will print a message like this:
-@example
+@smallexample
No symbol "foo" in current context.
-@end example
+@end smallexample
To solve such problems, either recompile without optimizations, or use a
different debug info format, if the compiler supports several such
@@ -4600,16 +4601,16 @@ argument; the second element comes from bytes of memory immediately
following those that hold the first element, and so on. Here is an
example. If a program says
-@example
+@smallexample
int *array = (int *) malloc (len * sizeof (int));
-@end example
+@end smallexample
@noindent
you can print the contents of @code{array} with
-@example
+@smallexample
p *array@@len
-@end example
+@end smallexample
The left operand of @samp{@@} must reside in memory. Array values made
with @samp{@@} in this way behave just like other arrays in terms of
@@ -4620,18 +4621,18 @@ Artificial arrays most often appear in expressions via the value history
Another way to create an artificial array is to use a cast.
This re-interprets a value as if it were an array.
The value need not be in memory:
-@example
+@smallexample
(@value{GDBP}) p/x (short[2])0x12345678
$1 = @{0x1234, 0x5678@}
-@end example
+@end smallexample
As a convenience, if you leave the array length out (as in
@samp{(@var{type}[])@var{value}}) @value{GDBN} calculates the size to fill
the value (as @samp{sizeof(@var{value})/sizeof(@var{type})}:
-@example
+@smallexample
(@value{GDBP}) p/x (short[])0x12345678
$2 = @{0x1234, 0x5678@}
-@end example
+@end smallexample
Sometimes the artificial array mechanism is not quite enough; in
moderately complex data structures, the elements of interest may not
@@ -4644,13 +4645,13 @@ instance, suppose you have an array @code{dtab} of pointers to
structures, and you are interested in the values of a field @code{fv}
in each structure. Here is an example of what you might type:
-@example
+@smallexample
set $i = 0
p dtab[$i++]->fv
@key{RET}
@key{RET}
@dots{}
-@end example
+@end smallexample
@node Output Formats
@section Output formats
@@ -4695,10 +4696,10 @@ Print as an address, both absolute in hexadecimal and as an offset from
the nearest preceding symbol. You can use this format used to discover
where (in what function) an unknown address is located:
-@example
+@smallexample
(@value{GDBP}) p/a 0x54320
$3 = 0x54320 <_initialize_vx+396>
-@end example
+@end smallexample
@noindent
The command @code{info symbol 0x54320} yields similar results.
@@ -4714,9 +4715,9 @@ using typical floating point syntax.
For example, to print the program counter in hex (@pxref{Registers}), type
-@example
+@smallexample
p/x $pc
-@end example
+@end smallexample
@noindent
Note that no space is required before the slash; this is because command
@@ -4843,10 +4844,10 @@ Each expression added to the list is given a number to identify it;
to remove an expression from the list, you specify that number.
The automatic display looks like this:
-@example
+@smallexample
2: foo = 38
3: bar[5] = (struct hack *) 0x3804
-@end example
+@end smallexample
@noindent
This display shows item numbers, expressions and their current values. As with
@@ -5034,11 +5035,11 @@ and source file location of the variable where it points, using
For example, here @value{GDBN} shows that a variable @code{ptt} points
at another variable @code{t}, defined in @file{hi2.c}:
-@example
+@smallexample
(@value{GDBP}) set print symbol-filename on
(@value{GDBP}) p/a ptt
$4 = 0xe008 <t in hi2.c>
-@end example
+@end smallexample
@quotation
@emph{Warning:} For pointers that point to a local variable, @samp{p/a}
@@ -5320,16 +5321,16 @@ is the value just prior to @code{$$}, @code{$$1} is equivalent to
For example, suppose you have just printed a pointer to a structure and
want to see the contents of the structure. It suffices to type
-@example
+@smallexample
p *$
-@end example
+@end smallexample
If you have a chain of structures where the component @code{next} points
to the next one, you can print the contents of the next one with this:
-@example
+@smallexample
p *$.next
-@end example
+@end smallexample
@noindent
You can print successive links in the chain by repeating this
@@ -5338,10 +5339,10 @@ command---which you can do by just typing @key{RET}.
Note that the history records values, not expressions. If the value of
@code{x} is 4 and you type these commands:
-@example
+@smallexample
print x
set x=5
-@end example
+@end smallexample
@noindent
then the value recorded in the value history by the @code{print} command
@@ -5385,9 +5386,9 @@ You can save a value in a convenience variable with an assignment
expression, just as you would set a variable in your program.
For example:
-@example
+@smallexample
set $foo = *object_ptr
-@end example
+@end smallexample
@noindent
would save in @code{$foo} the value contained in the object pointed to by
@@ -5413,10 +5414,10 @@ One of the ways to use a convenience variable is as a counter to be
incremented or a pointer to be advanced. For example, to print
a field from successive elements of an array of structures:
-@example
+@smallexample
set $i = 0
print bar[$i++]->contents
-@end example
+@end smallexample
@noindent
Repeat that command by typing @key{RET}.
@@ -5488,16 +5489,16 @@ pointer to the current stack frame, and @code{$ps} is used for a
register that contains the processor status. For example,
you could print the program counter in hex with
-@example
+@smallexample
p/x $pc
-@end example
+@end smallexample
@noindent
or print the instruction to be executed next with
-@example
+@smallexample
x/i $pc
-@end example
+@end smallexample
@noindent
or add four to the stack pointer@footnote{This is a way of removing
@@ -5508,9 +5509,9 @@ stack frames are selected. To pop entire frames off the stack,
regardless of machine architecture, use @code{return};
see @ref{Returning, ,Returning from a function}.} with
-@example
+@smallexample
set $sp += 4
-@end example
+@end smallexample
Whenever possible, these four standard register names are available on
your machine even though the machine has different canonical mnemonics,
@@ -5567,7 +5568,7 @@ the ARM and x86 machines.
@end table
@node Memory Region Attributes
-@section Memory Region Attributes
+@section Memory region attributes
@cindex memory region attributes
@dfn{Memory region attributes} allow you to describe special handling
@@ -5697,6 +5698,82 @@ Disable @value{GDBN} from caching target memory. This is the default.
@c @item noverify (default)
@c @end table
+@node Dump/Restore Files
+@section Copy between memory and a file
+@cindex dump/restore files
+@cindex append data to a file
+@cindex dump data to a file
+@cindex restore data from a file
+@kindex dump
+@kindex append
+@kindex restore
+
+The commands @code{dump}, @code{append}, and @code{restore} are used
+for copying data between target memory and a file. Data is written
+into a file using @code{dump} or @code{append}, and restored from a
+file into memory by using @code{restore}. Files may be binary, srec,
+intel hex, or tekhex (but only binary files can be appended).
+
+@table @code
+@kindex dump binary
+@kindex append binary
+@item dump binary memory @var{filename} @var{start_addr} @var{end_addr}
+Dump contents of memory from @var{start_addr} to @var{end_addr} into
+raw binary format file @var{filename}.
+
+@item append binary memory @var{filename} @var{start_addr} @var{end_addr}
+Append contents of memory from @var{start_addr} to @var{end_addr} to
+raw binary format file @var{filename}.
+
+@item dump binary value @var{filename} @var{expression}
+Dump value of @var{expression} into raw binary format file @var{filename}.
+
+@item append binary memory @var{filename} @var{expression}
+Append value of @var{expression} to raw binary format file @var{filename}.
+
+@kindex dump ihex
+@item dump ihex memory @var{filename} @var{start_addr} @var{end_addr}
+Dump contents of memory from @var{start_addr} to @var{end_addr} into
+intel hex format file @var{filename}.
+
+@item dump ihex value @var{filename} @var{expression}
+Dump value of @var{expression} into intel hex format file @var{filename}.
+
+@kindex dump srec
+@item dump srec memory @var{filename} @var{start_addr} @var{end_addr}
+Dump contents of memory from @var{start_addr} to @var{end_addr} into
+srec format file @var{filename}.
+
+@item dump srec value @var{filename} @var{expression}
+Dump value of @var{expression} into srec format file @var{filename}.
+
+@kindex dump tekhex
+@item dump tekhex memory @var{filename} @var{start_addr} @var{end_addr}
+Dump contents of memory from @var{start_addr} to @var{end_addr} into
+tekhex format file @var{filename}.
+
+@item dump tekhex value @var{filename} @var{expression}
+Dump value of @var{expression} into tekhex format file @var{filename}.
+
+@item restore @var{filename} @var{[binary]} @var{bias} @var{start} @var{end}
+Restore the contents of file @var{filename} into memory. The @code{restore}
+command can automatically recognize any known bfd file format, except for
+raw binary. To restore a raw binary file you must use the optional argument
+@var{binary} after the filename.
+
+If @var{bias} is non-zero, its value will be added to the addresses
+contained in the file. Binary files always start at address zero, so
+they will be restored at address @var{bias}. Other bfd files have
+a built-in location; they will be restored at offset @var{bias}
+from that location.
+
+If @var{start} and/or @var{end} are non-zero, then only data between
+file offset @var{start} and file offset @var{end} will be restored.
+These offsets are relative to the addresses in the file, before
+the @var{bias} argument is applied.
+
+@end table
+
@node Tracepoints
@chapter Tracepoints
@c This chapter is based on the documentation written by Michael
@@ -6368,7 +6445,7 @@ there.
@c size of all overlays. This is intentional to remind the developer
@c that overlays don't necessarily need to be the same size.
-@example
+@smallexample
@group
Data Instruction Larger
Address Space Address Space Address Space
@@ -6396,7 +6473,7 @@ Address Space Address Space Address Space
@anchor{A code overlay}A code overlay
@end group
-@end example
+@end smallexample
The diagram (@pxref{A code overlay}) shows a system with separate data
and instruction address spaces. To map an overlay, the program copies
@@ -6553,33 +6630,33 @@ addresses, load addresses, and sizes.
Normally, when @value{GDBN} prints a code address, it includes the name
of the function the address falls in:
-@example
+@smallexample
(gdb) print main
$3 = @{int ()@} 0x11a0 <main>
-@end example
+@end smallexample
@noindent
When overlay debugging is enabled, @value{GDBN} recognizes code in
unmapped overlays, and prints the names of unmapped functions with
asterisks around them. For example, if @code{foo} is a function in an
unmapped overlay, @value{GDBN} prints it this way:
-@example
+@smallexample
(gdb) overlay list
No sections are mapped.
(gdb) print foo
$5 = @{int (int)@} 0x100000 <*foo*>
-@end example
+@end smallexample
@noindent
When @code{foo}'s overlay is mapped, @value{GDBN} prints the function's
name normally:
-@example
+@smallexample
(gdb) overlay list
Section .ov.foo.text, loaded at 0x100000 - 0x100034,
mapped at 0x1016 - 0x104a
(gdb) print foo
$6 = @{int (int)@} 0x1016 <foo>
-@end example
+@end smallexample
When overlay debugging is enabled, @value{GDBN} can find the correct
address for functions and variables in an overlay, whether or not the
@@ -6621,7 +6698,7 @@ Here are the variables your overlay manager must define to support
@item @code{_ovly_table}:
This variable must be an array of the following structures:
-@example
+@smallexample
struct
@{
/* The overlay's mapped address. */
@@ -6637,7 +6714,7 @@ struct
zero otherwise. */
unsigned long mapped;
@}
-@end example
+@end smallexample
@item @code{_novlys}:
This variable must be a four-byte signed integer, holding the total
@@ -6698,7 +6775,7 @@ and @code{m32r-elf} targets.
You can build the test program using the @code{d10v-elf} GCC
cross-compiler like this:
-@example
+@smallexample
$ d10v-elf-gcc -g -c overlays.c
$ d10v-elf-gcc -g -c ovlymgr.c
$ d10v-elf-gcc -g -c foo.c
@@ -6707,7 +6784,7 @@ $ d10v-elf-gcc -g -c baz.c
$ d10v-elf-gcc -g -c grbx.c
$ d10v-elf-gcc -g overlays.o ovlymgr.o foo.o bar.o \
baz.o grbx.o -Wl,-Td10v.ld -o overlays
-@end example
+@end smallexample
The build process is identical for any other architecture, except that
you must substitute the appropriate compiler and linker script for the
@@ -6836,9 +6913,9 @@ languages---but means different things. For instance, if the current
source file were written in C, and @value{GDBN} was parsing Modula-2, a
command such as:
-@example
+@smallexample
print a = b + c
-@end example
+@end smallexample
@noindent
might not have the effect you intended. In C, this means to add
@@ -7032,9 +7109,9 @@ error. In many implementations of C, mathematical overflow causes the
result to ``wrap around'' to lower values---for example, if @var{m} is
the largest integer value, and @var{s} is the smallest, then
-@example
+@smallexample
@var{m} + 1 @result{} @var{s}
-@end example
+@end smallexample
This, too, is specific to individual languages, and in some cases
specific to individual compilers or machines. @xref{Support, ,
@@ -7394,9 +7471,9 @@ support in @value{GDBN} does @emph{not} work.
@item
Member function calls are allowed; you can use expressions like
-@example
+@smallexample
count = aml->GetOriginal(x, y)
-@end example
+@end smallexample
@vindex this@r{, inside C@t{++} member functions}
@cindex namespace in C@t{++}
@@ -8014,11 +8091,11 @@ There are a few subtle differences between the Modula-2 scope operator
(@code{.}) and the @value{GDBN} scope operator (@code{::}). The two have
similar syntax:
-@example
+@smallexample
@var{module} . @var{id}
@var{scope} :: @var{id}
-@end example
+@end smallexample
@noindent
where @var{scope} is the name of a module or a procedure,
@@ -8580,9 +8657,9 @@ ordinarily parse a typical file name, like @file{foo.c}, as the three words
@samp{foo} @samp{.} @samp{c}. To allow @value{GDBN} to recognize
@samp{foo.c} as a single symbol, enclose it in single quotes; for example,
-@example
+@smallexample
p 'foo.c'::x
-@end example
+@end smallexample
@noindent
looks up the value of @code{x} in the scope of the file @file{foo.c}.
@@ -8607,10 +8684,10 @@ Print the name of a symbol which is stored at the address @var{addr}.
If no symbol is stored exactly at @var{addr}, @value{GDBN} prints the
nearest symbol and an offset from it:
-@example
+@smallexample
(@value{GDBP}) info symbol 0x54320
_initialize_vx + 396 in section .text
-@end example
+@end smallexample
@noindent
This is the opposite of the @code{info address} command. You can use
@@ -8641,14 +8718,14 @@ of just the name of the type.
For example, for this variable declaration:
-@example
+@smallexample
struct complex @{double real; double imag;@} v;
-@end example
+@end smallexample
@noindent
the two commands give this output:
-@example
+@smallexample
@group
(@value{GDBP}) whatis v
type = struct complex
@@ -8658,7 +8735,7 @@ type = struct complex @{
double imag;
@}
@end group
-@end example
+@end smallexample
@noindent
As with @code{whatis}, using @code{ptype} without an argument refers to
@@ -8854,9 +8931,9 @@ address, or even return prematurely from a function.
To alter the value of a variable, evaluate an assignment expression.
@xref{Expressions, ,Expressions}. For example,
-@example
+@smallexample
print x=4
-@end example
+@end smallexample
@noindent
stores the value 4 into the variable @code{x}, and then prints the
@@ -8880,22 +8957,22 @@ program has a variable @code{width}, you get an error if you try to set
a new value with just @samp{set width=13}, because @value{GDBN} has the
command @code{set width}:
-@example
+@smallexample
(@value{GDBP}) whatis width
type = double
(@value{GDBP}) p width
$4 = 13
(@value{GDBP}) set width=47
Invalid syntax in expression.
-@end example
+@end smallexample
@noindent
The invalid expression, of course, is @samp{=47}. In
order to actually set the program's variable @code{width}, use
-@example
+@smallexample
(@value{GDBP}) set var width=47
-@end example
+@end smallexample
Because the @code{set} command has many subcommands that can conflict
with the names of program variables, it is a good idea to use the
@@ -8904,7 +8981,7 @@ your program has a variable @code{g}, you run into problems if you try
to set a new value with just @samp{set g=4}, because @value{GDBN} has
the command @code{set gnutarget}, abbreviated @code{set g}:
-@example
+@smallexample
@group
(@value{GDBP}) whatis g
type = double
@@ -8922,16 +8999,16 @@ Starting program: /home/smith/cc_progs/a.out
(@value{GDBP}) show g
The current BFD target is "=4".
@end group
-@end example
+@end smallexample
@noindent
The program variable @code{g} did not change, and you silently set the
@code{gnutarget} to an invalid value. In order to set the variable
@code{g}, use
-@example
+@smallexample
(@value{GDBP}) set var g=4
-@end example
+@end smallexample
@value{GDBN} allows more implicit conversions in assignments than C; you can
freely store an integer value into a pointer variable or vice versa,
@@ -8946,9 +9023,9 @@ construct to generate a value of specified type at a specified address
to memory location @code{0x83040} as an integer (which implies a certain size
and representation in memory), and
-@example
+@smallexample
set @{int@}0x83040 = 4
-@end example
+@end smallexample
@noindent
stores the value 4 into that memory location.
@@ -8991,9 +9068,9 @@ difference is that this does not start your program running; it only
changes the address of where it @emph{will} run when you continue. For
example,
-@example
+@smallexample
set $pc = 0x485
-@end example
+@end smallexample
@noindent
makes the next @code{continue} command or stepping command execute at
@@ -9082,12 +9159,6 @@ execute a function from your program, but without cluttering the output
with @code{void} returned values. If the result is not void, it
is printed and saved in the value history.
-@c OBSOLETE For the A29K, a user-controlled variable @code{call_scratch_address},
-@c OBSOLETE specifies the location of a scratch area to be used when @value{GDBN}
-@c OBSOLETE calls a function in the target. This is necessary because the usual
-@c OBSOLETE method of putting the scratch area on the stack does not work in systems
-@c OBSOLETE that have separate instruction and data spaces.
-
@node Patching
@section Patching programs
@@ -9765,11 +9836,11 @@ it somewhere in memory where it won't get clobbered by the download.
@item target sim
Builtin CPU simulator. @value{GDBN} includes simulators for most architectures.
In general,
-@example
+@smallexample
target sim
load
run
-@end example
+@end smallexample
@noindent
works; however, you cannot assume that a specific memory map, device
drivers, or even basic I/O is available, although some simulators do
@@ -9891,21 +9962,21 @@ displayed is determined on a per-OS basis.
Use the @code{set os} command to set the operating system. This tells
@value{GDBN} which kernel object display module to initialize:
-@example
+@smallexample
(@value{GDBP}) set os cisco
-@end example
+@end smallexample
If @code{set os} succeeds, @value{GDBN} will display some information
about the operating system, and will create a new @code{info} command
which can be used to query the target. The @code{info} command is named
after the operating system:
-@example
+@smallexample
(@value{GDBP}) info cisco
List of Cisco Kernel Objects
Object Description
any Any and all objects
-@end example
+@end smallexample
Further subcommands can be used to query about particular objects known
by the kernel.
@@ -10359,18 +10430,18 @@ Make sure you have defined the supporting low-level routines
@item
Insert these lines near the top of your program:
-@example
+@smallexample
set_debug_traps();
breakpoint();
-@end example
+@end smallexample
@item
For the 680x0 stub only, you need to provide a variable called
@code{exceptionHook}. Normally you just use:
-@example
+@smallexample
void (*exceptionHook)() = 0;
-@end example
+@end smallexample
@noindent
but if before calling @code{set_debug_traps}, you set it to point to a
@@ -10408,27 +10479,27 @@ 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
+@smallexample
target remote /dev/ttyb
-@end example
+@end smallexample
@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
+@smallexample
target remote manyfarms:2828
-@end example
+@end smallexample
If your remote target is actually running on the same machine as
your debugger session (e.g.@: a simulator of your target running on
the same host), you can omit the hostname. For example, to connect
to port 1234 on your local machine:
-@example
+@smallexample
target remote :1234
-@end example
+@end smallexample
@noindent
Note that the colon is still required here.
@@ -10448,10 +10519,10 @@ 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
+@smallexample
Interrupted while waiting for the program.
Give up (and stop debugging it)? (y or n)
-@end example
+@end smallexample
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
@@ -10845,9 +10916,9 @@ run @value{GDBN}. From your Unix host, run @code{@value{GDBP}} (or
@value{GDBN} comes up showing the prompt:
-@example
+@smallexample
(vxgdb)
-@end example
+@end smallexample
@menu
* VxWorks Connection:: Connecting to VxWorks
@@ -10861,9 +10932,9 @@ run @value{GDBN}. From your Unix host, run @code{@value{GDBP}} (or
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
+@smallexample
(vxgdb) target vxworks tt
-@end example
+@end smallexample
@need 750
@value{GDBN} displays messages like these:
@@ -10880,9 +10951,9 @@ 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
+@smallexample
prog.o: No such file or directory.
-@end example
+@end smallexample
When this happens, add the appropriate directory to the search path with
the @value{GDBN} command @code{path}, and execute the @code{target}
@@ -10908,17 +10979,17 @@ the file by its name, without any path. For instance, a program
and in @file{@var{hostpath}/vw/demo/rdb} on the host. To load this
program, type this on VxWorks:
-@example
+@smallexample
-> cd "@var{vxpath}/vw/demo/rdb"
-@end example
+@end smallexample
@noindent
Then, in @value{GDBN}, type:
-@example
+@smallexample
(vxgdb) cd @var{hostpath}/vw/demo/rdb
(vxgdb) load prog.o
-@end example
+@end smallexample
@value{GDBN} displays a response similar to this:
@@ -10941,9 +11012,9 @@ table.)
You can also attach to an existing task using the @code{attach} command as
follows:
-@example
+@smallexample
(vxgdb) attach @var{task}
-@end example
+@end smallexample
@noindent
where @var{task} is the VxWorks hexadecimal task ID. The task can be running
@@ -10957,7 +11028,6 @@ This section goes into details specific to particular embedded
configurations.
-@c OBSOLETE * A29K Embedded:: AMD A29K Embedded
@menu
* ARM:: ARM
* H8/300:: Hitachi H8/300
@@ -10976,251 +11046,6 @@ configurations.
* Z8000:: Zilog Z8000
@end menu
-@c OBSOLETE @node A29K Embedded
-@c OBSOLETE @subsection AMD A29K Embedded
-@c OBSOLETE
-@c OBSOLETE @menu
-@c OBSOLETE * A29K UDI::
-@c OBSOLETE * A29K EB29K::
-@c OBSOLETE * Comms (EB29K):: Communications setup
-@c OBSOLETE * gdb-EB29K:: EB29K cross-debugging
-@c OBSOLETE * Remote Log:: Remote log
-@c OBSOLETE @end menu
-@c OBSOLETE
-@c OBSOLETE @table @code
-@c OBSOLETE
-@c OBSOLETE @kindex target adapt
-@c OBSOLETE @item target adapt @var{dev}
-@c OBSOLETE Adapt monitor for A29K.
-@c OBSOLETE
-@c OBSOLETE @kindex target amd-eb
-@c OBSOLETE @item target amd-eb @var{dev} @var{speed} @var{PROG}
-@c OBSOLETE @cindex AMD EB29K
-@c OBSOLETE Remote PC-resident AMD EB29K board, attached over serial lines.
-@c OBSOLETE @var{dev} is the serial device, as for @code{target remote};
-@c OBSOLETE @var{speed} allows you to specify the linespeed; and @var{PROG} is the
-@c OBSOLETE name of the program to be debugged, as it appears to DOS on the PC.
-@c OBSOLETE @xref{A29K EB29K, ,EBMON protocol for AMD29K}.
-@c OBSOLETE
-@c OBSOLETE @end table
-@c OBSOLETE
-@c OBSOLETE @node A29K UDI
-@c OBSOLETE @subsubsection A29K UDI
-@c OBSOLETE
-@c OBSOLETE @cindex UDI
-@c OBSOLETE @cindex AMD29K via UDI
-@c OBSOLETE
-@c OBSOLETE @value{GDBN} supports AMD's UDI (``Universal Debugger Interface'')
-@c OBSOLETE protocol for debugging the a29k processor family. To use this
-@c OBSOLETE configuration with AMD targets running the MiniMON monitor, you need the
-@c OBSOLETE program @code{MONTIP}, available from AMD at no charge. You can also
-@c OBSOLETE use @value{GDBN} with the UDI-conformant a29k simulator program
-@c OBSOLETE @code{ISSTIP}, also available from AMD.
-@c OBSOLETE
-@c OBSOLETE @table @code
-@c OBSOLETE @item target udi @var{keyword}
-@c OBSOLETE @kindex udi
-@c OBSOLETE Select the UDI interface to a remote a29k board or simulator, where
-@c OBSOLETE @var{keyword} is an entry in the AMD configuration file @file{udi_soc}.
-@c OBSOLETE This file contains keyword entries which specify parameters used to
-@c OBSOLETE connect to a29k targets. If the @file{udi_soc} file is not in your
-@c OBSOLETE working directory, you must set the environment variable @samp{UDICONF}
-@c OBSOLETE to its pathname.
-@c OBSOLETE @end table
-@c OBSOLETE
-@c OBSOLETE @node A29K EB29K
-@c OBSOLETE @subsubsection EBMON protocol for AMD29K
-@c OBSOLETE
-@c OBSOLETE @cindex EB29K board
-@c OBSOLETE @cindex running 29K programs
-@c OBSOLETE
-@c OBSOLETE AMD distributes a 29K development board meant to fit in a PC, together
-@c OBSOLETE with a DOS-hosted monitor program called @code{EBMON}. As a shorthand
-@c OBSOLETE term, this development system is called the ``EB29K''. To use
-@c OBSOLETE @value{GDBN} from a Unix system to run programs on the EB29K board, you
-@c OBSOLETE must first connect a serial cable between the PC (which hosts the EB29K
-@c OBSOLETE board) and a serial port on the Unix system. In the following, we
-@c OBSOLETE assume you've hooked the cable between the PC's @file{COM1} port and
-@c OBSOLETE @file{/dev/ttya} on the Unix system.
-@c OBSOLETE
-@c OBSOLETE @node Comms (EB29K)
-@c OBSOLETE @subsubsection Communications setup
-@c OBSOLETE
-@c OBSOLETE The next step is to set up the PC's port, by doing something like this
-@c OBSOLETE in DOS on the PC:
-@c OBSOLETE
-@c OBSOLETE @example
-@c OBSOLETE C:\> MODE com1:9600,n,8,1,none
-@c OBSOLETE @end example
-@c OBSOLETE
-@c OBSOLETE @noindent
-@c OBSOLETE This example---run on an MS DOS 4.0 system---sets the PC port to 9600
-@c OBSOLETE bps, no parity, eight data bits, one stop bit, and no ``retry'' action;
-@c OBSOLETE you must match the communications parameters when establishing the Unix
-@c OBSOLETE end of the connection as well.
-@c OBSOLETE @c FIXME: Who knows what this "no retry action" crud from the DOS manual may
-@c OBSOLETE @c mean? It's optional; leave it out? ---doc@cygnus.com, 25feb91
-@c OBSOLETE @c
-@c OBSOLETE @c It's optional, but it's unwise to omit it: who knows what is the
-@c OBSOLETE @c default value set when the DOS machines boots? "No retry" means that
-@c OBSOLETE @c the DOS serial device driver won't retry the operation if it fails;
-@c OBSOLETE @c I understand that this is needed because the GDB serial protocol
-@c OBSOLETE @c handles any errors and retransmissions itself. ---Eli Zaretskii, 3sep99
-@c OBSOLETE
-@c OBSOLETE To give control of the PC to the Unix side of the serial line, type
-@c OBSOLETE the following at the DOS console:
-@c OBSOLETE
-@c OBSOLETE @example
-@c OBSOLETE C:\> CTTY com1
-@c OBSOLETE @end example
-@c OBSOLETE
-@c OBSOLETE @noindent
-@c OBSOLETE (Later, if you wish to return control to the DOS console, you can use
-@c OBSOLETE the command @code{CTTY con}---but you must send it over the device that
-@c OBSOLETE had control, in our example over the @file{COM1} serial line.)
-@c OBSOLETE
-@c OBSOLETE From the Unix host, use a communications program such as @code{tip} or
-@c OBSOLETE @code{cu} to communicate with the PC; for example,
-@c OBSOLETE
-@c OBSOLETE @example
-@c OBSOLETE cu -s 9600 -l /dev/ttya
-@c OBSOLETE @end example
-@c OBSOLETE
-@c OBSOLETE @noindent
-@c OBSOLETE The @code{cu} options shown specify, respectively, the linespeed and the
-@c OBSOLETE serial port to use. If you use @code{tip} instead, your command line
-@c OBSOLETE may look something like the following:
-@c OBSOLETE
-@c OBSOLETE @example
-@c OBSOLETE tip -9600 /dev/ttya
-@c OBSOLETE @end example
-@c OBSOLETE
-@c OBSOLETE @noindent
-@c OBSOLETE Your system may require a different name where we show
-@c OBSOLETE @file{/dev/ttya} as the argument to @code{tip}. The communications
-@c OBSOLETE parameters, including which port to use, are associated with the
-@c OBSOLETE @code{tip} argument in the ``remote'' descriptions file---normally the
-@c OBSOLETE system table @file{/etc/remote}.
-@c OBSOLETE @c FIXME: What if anything needs doing to match the "n,8,1,none" part of
-@c OBSOLETE @c the DOS side's comms setup? cu can support -o (odd
-@c OBSOLETE @c parity), -e (even parity)---apparently no settings for no parity or
-@c OBSOLETE @c for character size. Taken from stty maybe...? John points out tip
-@c OBSOLETE @c can set these as internal variables, eg ~s parity=none; man stty
-@c OBSOLETE @c suggests that it *might* work to stty these options with stdin or
-@c OBSOLETE @c stdout redirected... ---doc@cygnus.com, 25feb91
-@c OBSOLETE @c
-@c OBSOLETE @c There's nothing to be done for the "none" part of the DOS MODE
-@c OBSOLETE @c command. The rest of the parameters should be matched by the
-@c OBSOLETE @c baudrate, bits, and parity used by the Unix side. ---Eli Zaretskii, 3Sep99
-@c OBSOLETE
-@c OBSOLETE @kindex EBMON
-@c OBSOLETE Using the @code{tip} or @code{cu} connection, change the DOS working
-@c OBSOLETE directory to the directory containing a copy of your 29K program, then
-@c OBSOLETE start the PC program @code{EBMON} (an EB29K control program supplied
-@c OBSOLETE with your board by AMD). You should see an initial display from
-@c OBSOLETE @code{EBMON} similar to the one that follows, ending with the
-@c OBSOLETE @code{EBMON} prompt @samp{#}---
-@c OBSOLETE
-@c OBSOLETE @example
-@c OBSOLETE C:\> G:
-@c OBSOLETE
-@c OBSOLETE G:\> CD \usr\joe\work29k
-@c OBSOLETE
-@c OBSOLETE G:\USR\JOE\WORK29K> EBMON
-@c OBSOLETE Am29000 PC Coprocessor Board Monitor, version 3.0-18
-@c OBSOLETE Copyright 1990 Advanced Micro Devices, Inc.
-@c OBSOLETE Written by Gibbons and Associates, Inc.
-@c OBSOLETE
-@c OBSOLETE Enter '?' or 'H' for help
-@c OBSOLETE
-@c OBSOLETE PC Coprocessor Type = EB29K
-@c OBSOLETE I/O Base = 0x208
-@c OBSOLETE Memory Base = 0xd0000
-@c OBSOLETE
-@c OBSOLETE Data Memory Size = 2048KB
-@c OBSOLETE Available I-RAM Range = 0x8000 to 0x1fffff
-@c OBSOLETE Available D-RAM Range = 0x80002000 to 0x801fffff
-@c OBSOLETE
-@c OBSOLETE PageSize = 0x400
-@c OBSOLETE Register Stack Size = 0x800
-@c OBSOLETE Memory Stack Size = 0x1800
-@c OBSOLETE
-@c OBSOLETE CPU PRL = 0x3
-@c OBSOLETE Am29027 Available = No
-@c OBSOLETE Byte Write Available = Yes
-@c OBSOLETE
-@c OBSOLETE # ~.
-@c OBSOLETE @end example
-@c OBSOLETE
-@c OBSOLETE Then exit the @code{cu} or @code{tip} program (done in the example by
-@c OBSOLETE typing @code{~.} at the @code{EBMON} prompt). @code{EBMON} keeps
-@c OBSOLETE running, ready for @value{GDBN} to take over.
-@c OBSOLETE
-@c OBSOLETE For this example, we've assumed what is probably the most convenient
-@c OBSOLETE way to make sure the same 29K program is on both the PC and the Unix
-@c OBSOLETE system: a PC/NFS connection that establishes ``drive @file{G:}'' on the
-@c OBSOLETE PC as a file system on the Unix host. If you do not have PC/NFS or
-@c OBSOLETE something similar connecting the two systems, you must arrange some
-@c OBSOLETE other way---perhaps floppy-disk transfer---of getting the 29K program
-@c OBSOLETE from the Unix system to the PC; @value{GDBN} does @emph{not} download it over the
-@c OBSOLETE serial line.
-@c OBSOLETE
-@c OBSOLETE @node gdb-EB29K
-@c OBSOLETE @subsubsection EB29K cross-debugging
-@c OBSOLETE
-@c OBSOLETE Finally, @code{cd} to the directory containing an image of your 29K
-@c OBSOLETE program on the Unix system, and start @value{GDBN}---specifying as argument the
-@c OBSOLETE name of your 29K program:
-@c OBSOLETE
-@c OBSOLETE @example
-@c OBSOLETE cd /usr/joe/work29k
-@c OBSOLETE @value{GDBP} myfoo
-@c OBSOLETE @end example
-@c OBSOLETE
-@c OBSOLETE @need 500
-@c OBSOLETE Now you can use the @code{target} command:
-@c OBSOLETE
-@c OBSOLETE @example
-@c OBSOLETE target amd-eb /dev/ttya 9600 MYFOO
-@c OBSOLETE @c FIXME: test above 'target amd-eb' as spelled, with caps! caps are meant to
-@c OBSOLETE @c emphasize that this is the name as seen by DOS (since I think DOS is
-@c OBSOLETE @c single-minded about case of letters). ---doc@cygnus.com, 25feb91
-@c OBSOLETE @end example
-@c OBSOLETE
-@c OBSOLETE @noindent
-@c OBSOLETE In this example, we've assumed your program is in a file called
-@c OBSOLETE @file{myfoo}. Note that the filename given as the last argument to
-@c OBSOLETE @code{target amd-eb} should be the name of the program as it appears to DOS.
-@c OBSOLETE In our example this is simply @code{MYFOO}, but in general it can include
-@c OBSOLETE a DOS path, and depending on your transfer mechanism may not resemble
-@c OBSOLETE the name on the Unix side.
-@c OBSOLETE
-@c OBSOLETE At this point, you can set any breakpoints you wish; when you are ready
-@c OBSOLETE to see your program run on the 29K board, use the @value{GDBN} command
-@c OBSOLETE @code{run}.
-@c OBSOLETE
-@c OBSOLETE To stop debugging the remote program, use the @value{GDBN} @code{detach}
-@c OBSOLETE command.
-@c OBSOLETE
-@c OBSOLETE To return control of the PC to its console, use @code{tip} or @code{cu}
-@c OBSOLETE once again, after your @value{GDBN} session has concluded, to attach to
-@c OBSOLETE @code{EBMON}. You can then type the command @code{q} to shut down
-@c OBSOLETE @code{EBMON}, returning control to the DOS command-line interpreter.
-@c OBSOLETE Type @kbd{CTTY con} to return command input to the main DOS console,
-@c OBSOLETE and type @kbd{~.} to leave @code{tip} or @code{cu}.
-@c OBSOLETE
-@c OBSOLETE @node Remote Log
-@c OBSOLETE @subsubsection Remote log
-@c OBSOLETE @cindex @file{eb.log}, a log file for EB29K
-@c OBSOLETE @cindex log file for EB29K
-@c OBSOLETE
-@c OBSOLETE The @code{target amd-eb} command creates a file @file{eb.log} in the
-@c OBSOLETE current working directory, to help debug problems with the connection.
-@c OBSOLETE @file{eb.log} records all the output from @code{EBMON}, including echoes
-@c OBSOLETE of the commands sent to it. Running @samp{tail -f} on this file in
-@c OBSOLETE another window often helps to understand trouble with @code{EBMON}, or
-@c OBSOLETE unexpected events on the PC side of the connection.
-
@node ARM
@subsection ARM
@@ -11335,7 +11160,7 @@ debugger, 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
+@smallexample
C:\H8300\TEST> asynctsr 2
C:\H8300\TEST> mode com2:9600,n,8,1,p
@@ -11343,7 +11168,7 @@ Resident portion of MODE loaded
COM2: 9600, n, 8, 1, p
-@end example
+@end smallexample
@quotation
@emph{Warning:} We have noticed a bug in PC-NFS that conflicts with
@@ -11516,9 +11341,9 @@ 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
+@smallexample
Attach /dev/ttyNN -- specify NN, or "quit" to quit:
-@end example
+@end smallexample
@noindent
Respond to the prompt with whatever suffix (after @samp{/dev/tty})
@@ -11681,13 +11506,13 @@ 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
+@smallexample
host$ @value{GDBP} @var{prog}
@value{GDBN} is free software and @dots{}
(@value{GDBP}) target mips /dev/ttyb
(@value{GDBP}) load @var{prog}
(@value{GDBP}) run
-@end example
+@end smallexample
@item target mips @var{hostname}:@var{portnumber}
On some @value{GDBN} host configurations, you can specify a TCP
@@ -11884,15 +11709,15 @@ information and @samp{-Ttext} to relocate the program to where you wish to
load it on the target. You may also want to add the options @samp{-n} or
@samp{-N} in order to reduce the size of the sections. Example:
-@example
+@smallexample
sparclet-aout-gcc prog.c -Ttext 0x12010000 -g -o prog -N
-@end example
+@end smallexample
You can use @code{objdump} to verify that the addresses are what you intended:
-@example
+@smallexample
sparclet-aout-objdump --headers --syms prog
-@end example
+@end smallexample
@cindex running, on Sparclet
Once you have set
@@ -11902,9 +11727,9 @@ run @value{GDBN}. From your Unix host, run @code{@value{GDBP}}
@value{GDBN} comes up showing the prompt:
-@example
+@smallexample
(gdbslet)
-@end example
+@end smallexample
@menu
* Sparclet File:: Setting the file to debug
@@ -11918,9 +11743,9 @@ run @value{GDBN}. From your Unix host, run @code{@value{GDBP}}
The @value{GDBN} command @code{file} lets you choose with program to debug.
-@example
+@smallexample
(gdbslet) file prog
-@end example
+@end smallexample
@need 1000
@value{GDBN} then attempts to read the symbol table of @file{prog}.
@@ -11935,9 +11760,9 @@ path (@pxref{Environment, ,Your program's environment}).
If it fails
to find a file, it displays a message such as:
-@example
+@smallexample
prog: No such file or directory.
-@end example
+@end smallexample
When this happens, add the appropriate directories to the search paths with
the @value{GDBN} commands @code{path} and @code{dir}, and execute the
@@ -11949,18 +11774,18 @@ the @value{GDBN} commands @code{path} and @code{dir}, and execute the
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
+@smallexample
(gdbslet) target sparclet /dev/ttya
Remote target sparclet connected to /dev/ttya
main () at ../prog.c:3
-@end example
+@end smallexample
@need 750
@value{GDBN} displays messages like these:
-@example
+@smallexample
Connected to ttya.
-@end example
+@end smallexample
@node Sparclet Download
@subsubsection Sparclet download
@@ -11979,10 +11804,10 @@ 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
+@smallexample
(gdbslet) load prog 0x12010000
Loading section .text, size 0xdb0 vma 0x12010000
-@end example
+@end smallexample
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
@@ -11996,7 +11821,7 @@ 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
+@smallexample
(gdbslet) b main
Breakpoint 1 at 0x12010000: file prog.c, line 3.
(gdbslet) run
@@ -12006,7 +11831,7 @@ Breakpoint 1, main (argc=1, argv=0xeffff21c) at prog.c:3
(gdbslet) step
4 char *execarg = "hello!";
(gdbslet)
-@end example
+@end smallexample
@node Sparclite
@subsection Fujitsu Sparclite
@@ -12031,9 +11856,9 @@ 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
+@smallexample
target st2000 @var{dev} @var{speed}
-@end example
+@end smallexample
@noindent
to establish it as your debugging environment. @var{dev} is normally
@@ -12509,11 +12334,11 @@ By default, @value{GDBN} is cautious, and asks what sometimes seems to be a
lot of stupid questions to confirm certain commands. For example, if
you try to run a program which is already running:
-@example
+@smallexample
(@value{GDBP}) run
The program being debugged has been started already.
Start it from the beginning? (y or n)
-@end example
+@end smallexample
If you are willing to unflinchingly face the consequences of your own
commands, you can disable this ``feature'':
@@ -12704,6 +12529,14 @@ Display the @value{GDBN} commands used to define @var{commandname} (but
not its documentation). If no @var{commandname} is given, display the
definitions for all user-defined commands.
+@kindex show max-user-call-depth
+@kindex set max-user-call-depth
+@item show max-user-call-depth
+@itemx set max-user-call-depth
+The value of @code{max-user-call-depth} controls how many recursion
+levels are allowed in user-defined commands before GDB suspects an
+infinite recursion and aborts the command.
+
@end table
When user-defined commands are executed, the
@@ -12753,7 +12586,7 @@ For example, to ignore @code{SIGALRM} signals while
single-stepping, but treat them normally during normal execution,
you could define:
-@example
+@smallexample
define hook-stop
handle SIGALRM nopass
end
@@ -12765,13 +12598,13 @@ end
define hook-continue
handle SIGLARM pass
end
-@end example
+@end smallexample
As a further example, to hook at the begining and end of the @code{echo}
command, and to add extra text to the beginning and end of the message,
you could define:
-@example
+@smallexample
define hook-echo
echo <<<---
end
@@ -12784,7 +12617,7 @@ end
<<<---Hello World--->>>
(@value{GDBP})
-@end example
+@end smallexample
You can define a hook for any single-word command in @value{GDBN}, but
not for command aliases; you should define a hook for the basic command
@@ -12882,9 +12715,9 @@ standard error. Errors in a command file supplied on standard input do
not terminate execution of the command file --- execution continues with
the next command.
-@example
+@smallexample
gdb < cmds > log 2>&1
-@end example
+@end smallexample
(The syntax above will vary depending on the shell used.) This example
will execute commands from the file @file{cmds}. All output and errors
@@ -12917,19 +12750,19 @@ To print @samp{@w{ }and foo =@w{ }}, use the command
A backslash at the end of @var{text} can be used, as in C, to continue
the command onto subsequent lines. For example,
-@example
+@smallexample
echo This is some text\n\
which is continued\n\
onto several lines.\n
-@end example
+@end smallexample
produces the same output as
-@example
+@smallexample
echo This is some text\n
echo which is continued\n
echo onto several lines.\n
-@end example
+@end smallexample
@kindex output
@item output @var{expression}
@@ -12955,9 +12788,9 @@ subroutine
@c Either this is a bug, or the manual should document what formats are
@c supported.
-@example
+@smallexample
printf (@var{string}, @var{expressions}@dots{});
-@end example
+@end smallexample
For example, you can print two values in hex like this:
@@ -13325,9 +13158,9 @@ you need to call @value{GDBN} by a different name (for example, if you keep
several configurations around, with different names) you can set the
Emacs variable @code{gdb-command-name}; for example,
-@example
+@smallexample
(setq gdb-command-name "mygdb")
-@end example
+@end smallexample
@noindent
(preceded by @kbd{M-:} or @kbd{ESC :}, or typed in the @code{*scratch*} buffer, or
@@ -13497,12 +13330,11 @@ individuals in the file @file{etc/SERVICE} in the @sc{gnu} Emacs
distribution.
@c should add a web page ref...
-In any event, we also recommend that you send bug reports for
-@value{GDBN} to this addresses:
-
-@example
-bug-gdb@@gnu.org
-@end example
+In any event, we also recommend that you submit bug reports for
+@value{GDBN}. The prefered method is to submit them directly using
+@uref{http://www.gnu.org/software/gdb/bugs/, @value{GDBN}'s Bugs web
+page}. Alternatively, the @email{bug-gdb@@gnu.org, e-mail gateway} can
+be used.
@strong{Do not send bug reports to @samp{info-gdb}, or to
@samp{help-gdb}, or to any newsgroups.} Most users of @value{GDBN} do
@@ -13518,16 +13350,6 @@ path back to the sender. Thus, if we need to ask for more information,
we may be unable to reach you. For this reason, it is better to send
bug reports to the mailing list.
-As a last resort, send bug reports on paper to:
-
-@example
-@sc{gnu} Debugger Bugs
-Free Software Foundation Inc.
-59 Temple Place - Suite 330
-Boston, MA 02111-1307
-USA
-@end example
-
The fundamental principle of reporting bugs usefully is this:
@strong{report all the facts}. If you are not sure whether to state a
fact or leave it out, state it!
@@ -13691,9 +13513,9 @@ you can print the reference card immediately with @file{refcard.ps}.
The release also includes the source for the reference card. You
can format it, using @TeX{}, by typing:
-@example
+@smallexample
make refcard.dvi
-@end example
+@end smallexample
The @value{GDBN} reference card is designed to print in @dfn{landscape}
mode on US ``letter'' size paper;
@@ -13727,10 +13549,10 @@ If you have @code{makeinfo} installed, and are in the top level
@value{GDBN} source directory (@file{gdb-@value{GDBVN}}, in the case of
version @value{GDBVN}), you can make the Info file by typing:
-@example
+@smallexample
cd gdb
make gdb.info
-@end example
+@end smallexample
If you want to typeset and print copies of this manual, you need @TeX{},
a program to print its @sc{dvi} output files, and @file{texinfo.tex}, the
@@ -13756,9 +13578,9 @@ typeset and print this manual. First switch to the the @file{gdb}
subdirectory of the main source directory (for example, to
@file{gdb-@value{GDBVN}/gdb}) and type:
-@example
+@smallexample
make gdb.dvi
-@end example
+@end smallexample
Then give @file{gdb.dvi} to your @sc{dvi} printing program.
@@ -13824,11 +13646,11 @@ argument.
For example:
-@example
+@smallexample
cd gdb-@value{GDBVN}
./configure @var{host}
make
-@end example
+@end smallexample
@noindent
where @var{host} is an identifier such as @samp{sun4} or
@@ -13846,9 +13668,9 @@ binaries, are left in the corresponding source directories.
system does not recognize this automatically when you run a different
shell, you may need to run @code{sh} on it explicitly:
-@example
+@smallexample
sh configure @var{host}
-@end example
+@end smallexample
If you run @code{configure} from a directory that contains source
directories for multiple libraries or programs, such as the
@@ -13863,12 +13685,12 @@ configure that subdirectory, but be sure to specify a path to it.
For example, with version @value{GDBVN}, type the following to configure only
the @code{bfd} subdirectory:
-@example
+@smallexample
@group
cd gdb-@value{GDBVN}/bfd
../configure @var{host}
@end group
-@end example
+@end smallexample
You can install @code{@value{GDBP}} anywhere; it has no hardwired paths.
However, you should make sure that the shell on your path (named by
@@ -13904,7 +13726,7 @@ the @samp{--srcdir} option; it is assumed.)
For example, with version @value{GDBVN}, you can build @value{GDBN} in a
separate directory for a Sun 4 like this:
-@example
+@smallexample
@group
cd gdb-@value{GDBVN}
mkdir ../gdb-sun4
@@ -13912,7 +13734,7 @@ cd ../gdb-sun4
../gdb-@value{GDBVN}/configure sun4
make
@end group
-@end example
+@end smallexample
When @code{configure} builds a configuration using a remote source
directory, it creates a tree for the binaries with the same structure
@@ -13951,9 +13773,9 @@ script are based on a three-part naming scheme, but some short predefined
aliases are also supported. The full naming scheme encodes three pieces
of information in the following pattern:
-@example
+@smallexample
@var{architecture}-@var{vendor}-@var{os}
-@end example
+@end smallexample
For example, you can use the alias @code{sun4} as a @var{host} argument,
or as the value for @var{target} in a @code{--target=@var{target}}
@@ -13993,7 +13815,7 @@ are most often useful for building @value{GDBN}. @code{configure} also has
several other options not listed here. @inforef{What Configure
Does,,configure.info}, for a full explanation of @code{configure}.
-@example
+@smallexample
configure @r{[}--help@r{]}
@r{[}--prefix=@var{dir}@r{]}
@r{[}--exec-prefix=@var{dir}@r{]}
@@ -14001,7 +13823,7 @@ configure @r{[}--help@r{]}
@r{[}--norecursion@r{]} @r{[}--rm@r{]}
@r{[}--target=@var{target}@r{]}
@var{host}
-@end example
+@end smallexample
@noindent
You may introduce options with a single @samp{-} rather than
@@ -14119,9 +13941,9 @@ sent as a @var{packet}. A @var{packet} is introduced with the character
@samp{$}, the actual @var{packet-data}, and the terminating character
@samp{#} followed by a two-digit @var{checksum}:
-@example
+@smallexample
@code{$}@var{packet-data}@code{#}@var{checksum}
-@end example
+@end smallexample
@noindent
@cindex checksum, for @value{GDBN} remote
@@ -14133,9 +13955,9 @@ eight bit unsigned checksum).
Implementors should note that prior to @value{GDBN} 5.0 the protocol
specification also included an optional two-digit @var{sequence-id}:
-@example
+@smallexample
@code{$}@var{sequence-id}@code{:}@var{packet-data}@code{#}@var{checksum}
-@end example
+@end smallexample
@cindex sequence-id, for @value{GDBN} remote
@noindent
@@ -14149,10 +13971,10 @@ response expected is an acknowledgment: either @samp{+} (to indicate
the package was received correctly) or @samp{-} (to request
retransmission):
-@example
+@smallexample
<- @code{$}@var{packet-data}@code{#}@var{checksum}
-> @code{+}
-@end example
+@end smallexample
@noindent
The host (@value{GDBN}) sends @var{command}s, and the target (the
@@ -14185,9 +14007,9 @@ loosely refered to as the cisco encoding. Following the @samp{*}
character are two hex digits that indicate the size of the packet.
So:
-@example
+@smallexample
"@code{0* }"
-@end example
+@end smallexample
@noindent
means the same as "0000".
@@ -14923,7 +14745,7 @@ as @code{MIPS32}.
Example sequence of a target being re-started. Notice how the restart
does not get any direct output:
-@example
+@smallexample
<- @code{R00}
-> @code{+}
@emph{target restarts}
@@ -14931,11 +14753,11 @@ does not get any direct output:
-> @code{+}
-> @code{T001:1234123412341234}
<- @code{+}
-@end example
+@end smallexample
Example sequence of a target being stepped by a single instruction:
-@example
+@smallexample
<- @code{G1445...}
-> @code{+}
<- @code{s}
@@ -14947,7 +14769,7 @@ Example sequence of a target being stepped by a single instruction:
-> @code{+}
-> @code{1455...}
<- @code{+}
-@end example
+@end smallexample
@include gpl.texi
diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo
index b046171..3387cdb 100644
--- a/gdb/doc/gdbint.texinfo
+++ b/gdb/doc/gdbint.texinfo
@@ -239,9 +239,9 @@ and called functions.
machine-independent part of @value{GDBN}, except that it is used when
setting up a new frame from scratch, as follows:
-@example
- create_new_frame (read_register (FP_REGNUM), read_pc ()));
-@end example
+@smallexample
+create_new_frame (read_register (FP_REGNUM), read_pc ()));
+@end smallexample
@cindex frame pointer register
Other than that, all the meaning imparted to @code{FP_REGNUM} is
@@ -291,7 +291,7 @@ for something to happen.
Since they depend on hardware resources, hardware breakpoints may be
limited in number; when the user asks for more, @value{GDBN} will
start trying to set software breakpoints. (On some architectures,
-notably the 32-bit x86 platforms, @value{GDBN} cannot alsways know
+notably the 32-bit x86 platforms, @value{GDBN} cannot always know
whether there's enough hardware resources to insert all the hardware
breakpoints and watchpoints. On those platforms, @value{GDBN} prints
an error message only when the program being debugged is continued.)
@@ -453,7 +453,7 @@ Insert or remove a hardware watchpoint starting at @var{addr}, for
possible values of the enumerated data type @code{target_hw_bp_type},
defined by @file{breakpoint.h} as follows:
-@example
+@smallexample
enum target_hw_bp_type
@{
hw_write = 0, /* Common (write) HW watchpoint */
@@ -461,7 +461,7 @@ defined by @file{breakpoint.h} as follows:
hw_access = 2, /* Access (read or write) HW watchpoint */
hw_execute = 3 /* Execute HW breakpoint */
@};
-@end example
+@end smallexample
@noindent
These two macros should return 0 for success, non-zero for failure.
@@ -628,8 +628,8 @@ looks for a debug register which is already set to watch the same
region for the same access types; if found, it just increments the
reference count of that debug register, thus implementing debug
register sharing between watchpoints. If no such register is found,
-the function looks for a vacant debug register, sets its mirrorred
-value to @var{addr}, sets the mirrorred value of DR7 Debug Control
+the function looks for a vacant debug register, sets its mirrored
+value to @var{addr}, sets the mirrored value of DR7 Debug Control
register as appropriate for the @var{len} and @var{type} parameters,
and then passes the new values of the debug register and DR7 to the
inferior by calling @code{I386_DR_LOW_SET_ADDR} and
@@ -638,8 +638,8 @@ required to cover the given region, the above process is repeated for
each debug register.
@code{i386_remove_watchpoint} does the opposite: it resets the address
-in the mirrorred value of the debug register and its read/write and
-length bits in the mirrorred value of DR7, then passes these new
+in the mirrored value of the debug register and its read/write and
+length bits in the mirrored value of DR7, then passes these new
values to the inferior via @code{I386_DR_LOW_RESET_ADDR} and
@code{I386_DR_LOW_SET_CONTROL}. If a register is shared by several
watchpoints, each time a @code{i386_remove_watchpoint} is called, it
@@ -863,7 +863,7 @@ maximum of five levels.
The overall structure of the table output code is something like this:
-@example
+@smallexample
ui_out_table_begin
ui_out_table_header
@dots{}
@@ -874,7 +874,7 @@ The overall structure of the table output code is something like this:
ui_out_tuple_end
@dots{}
ui_out_table_end
-@end example
+@end smallexample
Here is the description of table-, tuple- and list-related @code{ui_out}
functions:
@@ -1139,7 +1139,7 @@ produce a table.
The original code was:
-@example
+@smallexample
if (!found_a_breakpoint++)
@{
annotate_breakpoints_headers ();
@@ -1162,11 +1162,11 @@ The original code was:
annotate_breakpoints_table ();
@}
-@end example
+@end smallexample
Here's the new version:
-@example
+@smallexample
nr_printable_breakpoints = @dots{};
if (addressprint)
@@ -1203,13 +1203,13 @@ Here's the new version:
ui_out_table_body (uiout);
if (nr_printable_breakpoints > 0)
annotate_breakpoints_table ();
-@end example
+@end smallexample
This example, from the @code{print_one_breakpoint} function, shows how
to produce the actual data for the table whose structure was defined
in the above example. The original code was:
-@example
+@smallexample
annotate_record ();
annotate_field (0);
printf_filtered ("%-3d ", b->number);
@@ -1224,11 +1224,11 @@ in the above example. The original code was:
annotate_field (3);
printf_filtered ("%-3c ", bpenables[(int)b->enable]);
@dots{}
-@end example
+@end smallexample
This is the new version:
-@example
+@smallexample
annotate_record ();
ui_out_tuple_begin (uiout, "bkpt");
annotate_field (0);
@@ -1244,44 +1244,44 @@ This is the new version:
annotate_field (3);
ui_out_field_fmt (uiout, "enabled", "%c", bpenables[(int)b->enable]);
@dots{}
-@end example
+@end smallexample
This example, also from @code{print_one_breakpoint}, shows how to
produce a complicated output field using the @code{print_expression}
functions which requires a stream to be passed. It also shows how to
automate stream destruction with cleanups. The original code was:
-@example
+@smallexample
annotate_field (5);
print_expression (b->exp, gdb_stdout);
-@end example
+@end smallexample
The new version is:
-@example
+@smallexample
struct ui_stream *stb = ui_out_stream_new (uiout);
struct cleanup *old_chain = make_cleanup_ui_out_stream_delete (stb);
...
annotate_field (5);
print_expression (b->exp, stb->stream);
ui_out_field_stream (uiout, "what", local_stream);
-@end example
+@end smallexample
This example, also from @code{print_one_breakpoint}, shows how to use
@code{ui_out_text} and @code{ui_out_field_string}. The original code
was:
-@example
+@smallexample
annotate_field (5);
if (b->dll_pathname == NULL)
printf_filtered ("<any library> ");
else
printf_filtered ("library \"%s\" ", b->dll_pathname);
-@end example
+@end smallexample
It became:
-@example
+@smallexample
annotate_field (5);
if (b->dll_pathname == NULL)
@{
@@ -1294,21 +1294,21 @@ It became:
ui_out_field_string (uiout, "what", b->dll_pathname);
ui_out_text (uiout, "\" ");
@}
-@end example
+@end smallexample
The following example from @code{print_one_breakpoint} shows how to
use @code{ui_out_field_int} and @code{ui_out_spaces}. The original
code was:
-@example
+@smallexample
annotate_field (5);
if (b->forked_inferior_pid != 0)
printf_filtered ("process %d ", b->forked_inferior_pid);
-@end example
+@end smallexample
It became:
-@example
+@smallexample
annotate_field (5);
if (b->forked_inferior_pid != 0)
@{
@@ -1316,20 +1316,20 @@ It became:
ui_out_field_int (uiout, "what", b->forked_inferior_pid);
ui_out_spaces (uiout, 1);
@}
-@end example
+@end smallexample
Here's an example of using @code{ui_out_field_string}. The original
code was:
-@example
+@smallexample
annotate_field (5);
if (b->exec_pathname != NULL)
printf_filtered ("program \"%s\" ", b->exec_pathname);
-@end example
+@end smallexample
It became:
-@example
+@smallexample
annotate_field (5);
if (b->exec_pathname != NULL)
@{
@@ -1337,22 +1337,22 @@ It became:
ui_out_field_string (uiout, "what", b->exec_pathname);
ui_out_text (uiout, "\" ");
@}
-@end example
+@end smallexample
Finally, here's an example of printing an address. The original code:
-@example
+@smallexample
annotate_field (4);
printf_filtered ("%s ",
local_hex_string_custom ((unsigned long) b->address, "08l"));
-@end example
+@end smallexample
It became:
-@example
+@smallexample
annotate_field (4);
ui_out_field_core_addr (uiout, "Address", b->address);
-@end example
+@end smallexample
@section Console Printing
@@ -1904,7 +1904,7 @@ parsers that define a bunch of global names, the following lines
@strong{must} be included at the top of the YACC parser, to prevent the
various parsers from defining the same global names:
-@example
+@smallexample
#define yyparse @var{lang}_parse
#define yylex @var{lang}_lex
#define yyerror @var{lang}_error
@@ -1921,7 +1921,7 @@ various parsers from defining the same global names:
#define yyexca @var{lang}_exca
#define yyerrflag @var{lang}_errflag
#define yynerrs @var{lang}_nerrs
-@end example
+@end smallexample
At the bottom of your parser, define a @code{struct language_defn} and
initialize it with the right values for your language. Define an
@@ -2730,7 +2730,7 @@ reason.
@item CALL_DUMMY_P
@findex CALL_DUMMY_P
-A C expresson that is non-zero when the target suports inferior function
+A C expression that is non-zero when the target supports inferior function
calls.
@item CALL_DUMMY_WORDS
@@ -2918,8 +2918,8 @@ Deprecated in favor of @code{PRINT_FLOAT_INFO}.
If the virtual frame pointer is kept in a register, then define this
macro to be the number (greater than or equal to zero) of that register.
-This should only need to be defined if @code{TARGET_READ_FP} and
-@code{TARGET_WRITE_FP} are not defined.
+This should only need to be defined if @code{TARGET_READ_FP} is not
+defined.
@item FRAMELESS_FUNCTION_INVOCATION(@var{fi})
@findex FRAMELESS_FUNCTION_INVOCATION
@@ -2935,12 +2935,6 @@ See @file{stack.c}.
@findex FRAME_CHAIN
Given @var{frame}, return a pointer to the calling frame.
-@item FRAME_CHAIN_COMBINE(@var{chain}, @var{frame})
-@findex FRAME_CHAIN_COMBINE
-Define this to take the frame chain pointer and the frame's nominal
-address and produce the nominal address of the caller's frame.
-Presently only defined for HP PA.
-
@item FRAME_CHAIN_VALID(@var{chain}, @var{thisframe})
@findex FRAME_CHAIN_VALID
Define this to be an expression that returns zero if the given frame is
@@ -3018,12 +3012,12 @@ respectively. (Currently only defined for the Delta 68.)
@item @value{GDBN}_MULTI_ARCH
@findex @value{GDBN}_MULTI_ARCH
-If defined and non-zero, enables suport for multiple architectures
+If defined and non-zero, enables support for multiple architectures
within @value{GDBN}.
This support can be enabled at two levels. At level one, only
definitions for previously undefined macros are provided; at level two,
-a multi-arch definition of all architecture dependant macros will be
+a multi-arch definition of all architecture dependent macros will be
defined.
@item @value{GDBN}_TARGET_IS_HPPA
@@ -3037,7 +3031,7 @@ used instead.
@findex 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
-trhe header file @file{setjmp.h} is needed to define it.
+the header file @file{setjmp.h} is needed to define it.
This macro determines the target PC address that @code{longjmp} will jump to,
assuming that we have just stopped at a @code{longjmp} breakpoint. It takes a
@@ -3050,15 +3044,6 @@ pointer. It examines the current state of the machine as needed.
Define this if you need to supply your own definition for the function
@code{get_saved_register}.
-@item HAVE_REGISTER_WINDOWS
-@findex HAVE_REGISTER_WINDOWS
-Define this if the target has register windows.
-
-@item REGISTER_IN_WINDOW_P (@var{regnum})
-@findex REGISTER_IN_WINDOW_P
-Define this to be an expression that is 1 if the given register is in
-the window.
-
@item IBM6000_TARGET
@findex IBM6000_TARGET
Shows that we are configured for an IBM RS/6000 target. This
@@ -3105,11 +3090,6 @@ The epilogue of a function is defined as the part of a function where
the stack frame of the function already has been destroyed up to the
final `return from function call' instruction.
-@item IN_SIGTRAMP (@var{pc}, @var{name})
-@findex IN_SIGTRAMP
-Define this to return non-zero if the given @var{pc} and/or @var{name}
-indicates that the current function is a @code{sigtramp}.
-
@item SIGTRAMP_START (@var{pc})
@findex SIGTRAMP_START
@itemx SIGTRAMP_END (@var{pc})
@@ -3308,6 +3288,18 @@ them.
@findex PC_IN_CALL_DUMMY
See @file{inferior.h}.
+@item PC_IN_SIGTRAMP (@var{pc}, @var{name})
+@findex PC_IN_SIGTRAMP
+@cindex sigtramp
+The @dfn{sigtramp} is a routine that the kernel calls (which then calls
+the signal handler). On most machines it is a library routine that is
+linked into the executable.
+
+This function, given a program counter value in @var{pc} and the
+(possibly NULL) name of the function in which that @var{pc} resides,
+returns nonzero if the @var{pc} and/or @var{name} show that we are in
+sigtramp.
+
@item PC_LOAD_SEGMENT
@findex PC_LOAD_SEGMENT
If defined, print information about the load segment for the program
@@ -3425,12 +3417,6 @@ of a branch or jump.
A C expression that returns the address of the ``real'' code beyond the
function entry prologue found at @var{pc}.
-@item SKIP_PROLOGUE_FRAMELESS_P
-@findex SKIP_PROLOGUE_FRAMELESS_P
-A C expression that should behave similarly, but that can stop as soon
-as the function is known to have a frame. If not defined,
-@code{SKIP_PROLOGUE} will be used instead.
-
@item SKIP_TRAMPOLINE_CODE (@var{pc})
@findex SKIP_TRAMPOLINE_CODE
If the target machine has trampoline code that sits between callers and
@@ -3547,18 +3533,15 @@ Number of bits in a short integer; defaults to @code{2 * TARGET_CHAR_BIT}.
@findex TARGET_WRITE_SP
@itemx TARGET_READ_FP
@findex TARGET_READ_FP
-@itemx TARGET_WRITE_FP
-@findex TARGET_WRITE_FP
@findex read_pc
@findex write_pc
@findex read_sp
@findex write_sp
@findex read_fp
-@findex write_fp
These change the behavior of @code{read_pc}, @code{write_pc},
-@code{read_sp}, @code{write_sp}, @code{read_fp} and @code{write_fp}.
-For most targets, these may be left undefined. @value{GDBN} will call the read
-and write register functions with the relevant @code{_REGNUM} argument.
+@code{read_sp}, @code{write_sp} and @code{read_fp}. For most targets,
+these may be left undefined. @value{GDBN} will call the read and write
+register functions with the relevant @code{_REGNUM} argument.
These macros are useful when a target keeps one of these registers in a
hard to get at place; for example, part in a segment register and part
@@ -3770,7 +3753,7 @@ define @samp{NAT_CFLAGS}, @samp{NAT_ADD_FILES}, @samp{NAT_CLIBS},
@emph{Maintainer's note: The @file{.mh} suffix is because this file
originally contained @file{Makefile} fragments for hosting @value{GDBN}
on machine @var{xyz}. While the file is no longer used for this
-purpose, the @file{.mh} suffix remains. Perhaphs someone will
+purpose, the @file{.mh} suffix remains. Perhaps someone will
eventually rename these fragments so that they have a @file{.mn}
suffix.}
@@ -4185,7 +4168,7 @@ Cleanups are implemented as a chain. The handle returned by
later cleanups appended to the chain (but not yet discarded or
performed). E.g.:
-@example
+@smallexample
make_cleanup (a, 0);
@{
struct cleanup *old = make_cleanup (b, 0);
@@ -4193,7 +4176,7 @@ make_cleanup (a, 0);
...
do_cleanups (old);
@}
-@end example
+@end smallexample
@noindent
will call @code{c()} and @code{b()} but will not call @code{a()}. The
@@ -4212,13 +4195,13 @@ code-segment avoids a memory leak problem (even when @code{error} is
called and a forced stack unwind occurs) by ensuring that the
@code{xfree} will always be called:
-@example
+@smallexample
struct cleanup *old = make_cleanup (null_cleanup, 0);
data = xmalloc (sizeof blah);
make_cleanup (xfree, data);
... blah blah ...
do_cleanups (old);
-@end example
+@end smallexample
The second style is try/except. Before it exits, your code-block calls
@code{discard_cleanups} with the old cleanup chain and thus ensures that
@@ -4226,13 +4209,13 @@ any created cleanups are not performed. For instance, the following
code segment, ensures that the file will be closed but only if there is
an error:
-@example
+@smallexample
FILE *file = fopen ("afile", "r");
struct cleanup *old = make_cleanup (close_file, file);
... blah blah ...
discard_cleanups (old);
return file;
-@end example
+@end smallexample
Some functions, e.g. @code{fputs_filtered()} or @code{error()}, specify
that they ``should not be called when cleanups are not in place''. This
@@ -4389,7 +4372,7 @@ strictly.
A function declaration should not have its name in column zero. A
function definition should have its name in column zero.
-@example
+@smallexample
/* Declaration */
static void foo (void);
/* Definition */
@@ -4397,7 +4380,7 @@ void
foo (void)
@{
@}
-@end example
+@end smallexample
@emph{Pragmatics: This simplifies scripting. Function definitions can
be found using @samp{^function-name}.}
@@ -4415,17 +4398,17 @@ for @code{diff} and @code{patch} utilities.
Pointers are declared using the traditional K&R C style:
-@example
+@smallexample
void *foo;
-@end example
+@end smallexample
@noindent
and not:
-@example
+@smallexample
void * foo;
void* foo;
-@end example
+@end smallexample
@subsection Comments
@@ -4435,13 +4418,13 @@ The standard GNU requirements on comments must be followed strictly.
Block comments must appear in the following form, with no @code{/*}- or
@code{*/}-only lines, and no leading @code{*}:
-@example
+@smallexample
/* 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. When
this function actually returns it means the inferior should be left
stopped and @value{GDBN} should read more commands. */
-@end example
+@end smallexample
(Note that this format is encouraged by Emacs; tabbing for a multi-line
comment works correctly, and @kbd{M-q} fills the block consistently.)
@@ -4503,8 +4486,8 @@ During its execution, @value{GDBN} can encounter two types of errors.
User errors and internal errors. User errors include not only a user
entering an incorrect command but also problems arising from corrupt
object files and system errors when interacting with the target.
-Internal errors include situtations where @value{GDBN} has detected, at
-run time, a corrupt or erroneous situtation.
+Internal errors include situations where @value{GDBN} has detected, at
+run time, a corrupt or erroneous situation.
When reporting an internal error, @value{GDBN} uses
@code{internal_error} and @code{gdb_assert}.
@@ -4551,19 +4534,19 @@ declarations they refer to. They should not rely on files being
included indirectly.
With the exception of the global definitions supplied by @file{defs.h},
-a header file should explictily include the header declaring any
+a header file should explicitly include the header declaring any
@code{typedefs} et.al.@: it refers to.
@code{extern} declarations should never appear in @code{.c} files.
All include files should be wrapped in:
-@example
+@smallexample
#ifndef INCLUDE_FILE_NAME_H
#define INCLUDE_FILE_NAME_H
header body
#endif
-@end example
+@end smallexample
@subsection Clean Design and Portable Implementation
@@ -4631,7 +4614,7 @@ symbol to write conditional code which should only be compiled for
such hosts.
@findex IS_DIR_SEPARATOR
-@item IS_DIR_SEPARATOR (@var{c}
+@item IS_DIR_SEPARATOR (@var{c})
Evaluates to a non-zero value if @var{c} is a directory separator
character. On Unix and GNU/Linux systems, only a slash @file{/} is
such a character, but on Windows, both @file{/} and @file{\} will
@@ -4723,16 +4706,16 @@ vendors, and operating systems near the bottom of the file. Also, add
@code{@var{arch}-@var{xvend}-@var{xos}}. You can test your changes by
running
-@example
+@smallexample
./config.sub @var{xyz}
-@end example
+@end smallexample
@noindent
and
-@example
+@smallexample
./config.sub @code{@var{arch}-@var{xvend}-@var{xos}}
-@end example
+@end smallexample
@noindent
which should both respond with @code{@var{arch}-@var{xvend}-@var{xos}}
@@ -4769,9 +4752,9 @@ configuration.
From the top level directory (containing @file{gdb}, @file{bfd},
@file{libiberty}, and so on):
-@example
+@smallexample
make -f Makefile.in gdb.tar.gz
-@end example
+@end smallexample
@noindent
This will properly configure, clean, rebuild any files that are
@@ -4817,16 +4800,147 @@ files @file{gdb.info*} in the distribution. Note the plural;
@code{makeinfo} will split the document into one overall file and five
or so included files.
+
@node Releasing GDB
@chapter Releasing @value{GDBN}
@cindex making a new release of gdb
+@section Versions and Branches
+
+@subsection Version Identifiers
+
+@value{GDBN}'s version is determined by the file @file{gdb/version.in}.
+
+@value{GDBN}'s mainline uses ISO dates to differentiate between
+versions. The CVS repository uses @var{YYYY}-@var{MM}-@var{DD}-cvs
+while the corresponding snapshot uses @var{YYYYMMDD}.
+
+@value{GDBN}'s release branch uses a slightly more complicated scheme.
+When the branch is first cut, the mainline version identifier is
+prefixed with the @var{major}.@var{minor} from of the previous release
+series but with .90 appended. As draft releases are drawn from the
+branch, the minor minor number (.90) is incremented. Once the first
+release (@var{M}.@var{N}) has been made, the version prefix is updated
+to @var{M}.@var{N}.0.90 (dot zero, dot ninety). Follow on releases have
+an incremented minor minor version number (.0).
+
+Using 5.1 (previous) and 5.2 (current), the example below illustrates a
+typical sequence of version identifiers:
+
+@table @asis
+@item 5.1.1
+final release from previous branch
+@item 2002-03-03-cvs
+main-line the day the branch is cut
+@item 5.1.90-2002-03-03-cvs
+corresponding branch version
+@item 5.1.91
+first draft release candidate
+@item 5.1.91-2002-03-17-cvs
+updated branch version
+@item 5.1.92
+second draft release candidate
+@item 5.1.92-2002-03-31-cvs
+updated branch version
+@item 5.1.93
+final release candidate (see below)
+@item 5.2
+official release
+@item 5.2.0.90-2002-04-07-cvs
+updated CVS branch version
+@item 5.2.1
+second official release
+@end table
+
+Notes:
+
+@itemize @bullet
+@item
+Minor minor minor draft release candidates such as 5.2.0.91 have been
+omitted from the example. Such release candidates are, typically, never
+made.
+@item
+For 5.1.93 the bziped tar ball @file{gdb-5.1.93.tar.bz2} is just the
+official @file{gdb-5.2.tar} renamed and compressed.
+@end itemize
+
+To avoid version conflicts, vendors are expected to modify the file
+@file{gdb/version.in} to include a vendor unique alphabetic identifier
+(an official @value{GDBN} release never uses alphabetic characters in
+its version identifer).
+
+Since @value{GDBN} does not make minor minor minor releases (e.g.,
+5.1.0.1) the conflict between that and a minor minor draft release
+identifier (e.g., 5.1.0.90) is avoided.
+
+
+@subsection Branches
+
+@value{GDBN} draws a release series (5.2, 5.2.1, @dots{}) from a single
+release branch (gdb_5_2-branch). Since minor minor minor releases
+(5.1.0.1) are not made, the need to branch the release branch is avoided
+(it also turns out that the effort required for such a a branch and
+release is significantly greater than the effort needed to create a new
+release from the head of the release branch).
+
+Releases 5.0 and 5.1 used branch and release tags of the form:
+
+@smallexample
+gdb_N_M-YYYY-MM-DD-branchpoint
+gdb_N_M-YYYY-MM-DD-branch
+gdb_M_N-YYYY-MM-DD-release
+@end smallexample
+
+Release 5.2 is trialing the branch and release tags:
+
+@smallexample
+gdb_N_M-YYYY-MM-DD-branchpoint
+gdb_N_M-branch
+gdb_M_N-YYYY-MM-DD-release
+@end smallexample
+
+@emph{Pragmatics: The branchpoint and release tags need to identify when
+a branch and release are made. The branch tag, denoting the head of the
+branch, does not have this criteria.}
+
+
+@section Branch Commit Policy
+
+The branch commit policy is pretty slack. @value{GDBN} releases 5.0,
+5.1 and 5.2 all used the below:
+
+@itemize @bullet
+@item
+The @file{gdb/MAINTAINERS} file still holds.
+@item
+Don't fix something on the branch unless/until it is also fixed in the
+trunk. If this isn't possible, mentioning it in the @file{gdb/PROBLEMS}
+file is better than committing a hack.
+@item
+When considering a patch for the branch, suggested criteria include:
+Does it fix a build? Does it fix the sequence @kbd{break main; run}
+when debugging a static binary?
+@item
+The further a change is from the core of @value{GDBN}, the less likely
+the change will worry anyone (e.g., target specific code).
+@item
+Only post a proposal to change the core of @value{GDBN} after you've
+sent individual bribes to all the people listed in the
+@file{MAINTAINERS} file @t{;-)}
+@end itemize
+
+@emph{Pragmatics: Provided updates are restricted to non-core
+functionality there is little chance that a broken change will be fatal.
+This means that changes such as adding a new architectures or (within
+reason) support for a new host are considered acceptable.}
+
+
@section Obsolete any code
Before anything else, poke the other developers (and around the source
-code) to see there is anything that can be removed from @value{GDBN} (an
-old target, an unused file).
+code) to see if there is anything that can be removed from @value{GDBN}
+(an old target, an unused file).
Obsolete code is identified by adding an @code{OBSOLETE} prefix to every
line. Doing this means that it is easy to identify obsolete code when
@@ -4858,7 +4972,8 @@ no longer relevant or simply wrong. Secondly since it removes any
history associated with the file (effectively clearing the slate) the
developer has a much freer hand when it comes to fixing broken files.}
-@section Before the branch
+
+@section Before the Branch
The most important objective at this stage is to find and fix simple
changes that become a pain to track once the branch is created. For
@@ -4866,34 +4981,17 @@ instance, configuration problems that stop @value{GDBN} from even
building. If you can't get the problem fixed, document it in the
@file{gdb/PROBLEMS} file.
-@subheading Organize and announce the schedule.
+@subheading Prompt for @file{gdb/NEWS}
-The following is a possible schedule. It is based on the rule-of-thumb
-that everything on the Internet takes a week. You may want to even
-increase those times further since an analysis of the actual data
-strongly suggests that the below is far to aggressive.
+People always forget. Send a post reminding them but also if you know
+something interesting happened add it yourself. The @code{schedule}
+script will mention this in its e-mail.
-@itemize @bullet
-@item
-announce it
-@item
-wait a week
-@item
-announce branch date
-@item
-wait a week
-@item
-Cut the branch
-@item
-wait a week
-@item
-start enjoying all the fun
-@end itemize
+@subheading Review @file{gdb/README}
-As an aside, the branch tag name is probably regrettable vis:
-@example
-gdb_N_M-YYYY-MM-DD-@{branch,branchpoint@}
-@end example
+Grab one of the nightly snapshots and then walk through the
+@file{gdb/README} looking for anything that can be improved. The
+@code{schedule} script will mention this in its e-mail.
@subheading Refresh any imported files.
@@ -4903,27 +5001,28 @@ A number of files are taken from external repositories. They include:
@item
@file{texinfo/texinfo.tex}
@item
-@file{config.guess} et.@: al.@:
+@file{config.guess} et.@: al.@: (see the top-level @file{MAINTAINERS}
+file)
+@item
+@file{etc/standards.texi}, @file{etc/make-stds.texi}
@end itemize
-and should be refreshed.
+@subheading Check the ARI
-@subheading Prompt for @file{gdb/NEWS}
+@uref{http://sources.redhat.com/gdb/ari,,A.R.I.} is an @code{awk} script
+(Awk Regression Index ;-) that checks for a number of errors and coding
+conventions. The checks include things like using @code{malloc} instead
+of @code{xmalloc} and file naming problems. There shouldn't be any
+regressions.
-People always forget. Send a post reminding them but also if you know
-something interesting happened add it your self.
+@subsection Review the bug data base
-@subheading Review @file{gdb/README}
+Close anything obviously fixed.
-Grab one of the nightly snapshots and then walk through the
-@file{gdb/README} looking for anything that can be improved.
+@subsection Check all cross targets build
-@subheading Check the ARI
+The targets are listed in @file{gdb/MAINTAINERS}.
-ARI is an @code{awk} script (Awk Regression Indicator?) that checks for a
-number of errors and coding conventions. The checks include things like
-using @code{malloc} instead of @code{xmalloc} and file naming problems.
-There shouldn't be any regressions.
@section Cut the branch
@@ -4931,7 +5030,7 @@ There shouldn't be any regressions.
I think something like the below was used:
-@example
+@smallexample
$ d=`date -u +%Y-%m-%d`
$ echo $d
2002-01-24
@@ -4940,13 +5039,13 @@ gdb_5_1-$d-branchpoint insight+dejagnu
$ cvs -f -d /cvs/src rtag -b -r gdb_V_V-$d-branchpoint \
gdb_5_1-$d-branch insight+dejagnu
$
-@end example
+@end smallexample
@itemize @bullet
@item
the @kbd{-D YYYY-MM-DD-gmt} forces the branch to an exact date/time.
@item
-the trunk is first taged so that the branch point can easily be found
+the trunk is first tagged so that the branch point can easily be found
@item
Insight (which includes GDB) and dejagnu are tagged at the same time
@end itemize
@@ -4963,54 +5062,84 @@ Something goes here.
@section Create a Release
-This procedure can be followed when creating beta and final final
-releases. With a beta many of the steps can be skipped.
+The process of creating and then making available a release is broken
+down into a number of stages. The first part addresses the technical
+process of creating a releasable tar ball. The later stages address the
+process of releasing that tar ball.
+
+When making a release candidate just the first section is needed.
+
+@subsection Create a release candidate
+
+The objective at this stage is to create a set of tar balls that can be
+made available as a formal release (or as a less formal release
+candidate).
-@subheading Establish a few defaults.
+@subsubheading Freeze the branch
-@example
-$ b=gdb_5_1-2001-07-29-branch
-$ v=5.1.1
+Send out an e-mail notifying everyone that the branch is frozen to
+@email{gdb-patches@@sources.redhat.com}.
+
+@subsubheading Establish a few defaults.
+
+@smallexample
+$ b=gdb_5_2-branch
+$ v=5.2
$ t=/sourceware/snapshot-tmp/gdbadmin-tmp
$ echo $t/$b/$v
+/sourceware/snapshot-tmp/gdbadmin-tmp/gdb_5_2-branch/5.2
$ mkdir -p $t/$b/$v
$ cd $t/$b/$v
$ pwd
-/sourceware/snapshot-tmp/gdbadmin-tmp/gdb_5_1-2001-07-29-branch/5.1.1
+/sourceware/snapshot-tmp/gdbadmin-tmp/gdb_5_2-branch/5.2
$ which autoconf
/home/gdbadmin/bin/autoconf
$
-@end example
+@end smallexample
-NB: Check the autoconf version carefully. You want to be using the
-version taken from the binutils snapshot directory. It is most likely
-that your system's installed version (@file{/usr/bin}?) is probably
-correct.
+@noindent
+Notes:
+
+@itemize @bullet
+@item
+Check the @code{autoconf} version carefully. You want to be using the
+version taken from the @file{binutils} snapshot directory. It is very
+unlikely that a system installed version of @code{autoconf} (e.g.,
+@file{/usr/bin/autoconf}) is correct.
+@end itemize
-@subheading Check out the relevant modules:
+@subsubheading Check out the relevant modules:
-@example
+@smallexample
$ for m in gdb insight dejagnu
do
( mkdir -p $m && cd $m && cvs -q -f -d /cvs/src co -P -r $b $m )
done
$
-@end example
+@end smallexample
-NB: The reading of @file{.cvsrc} is disabled (@file{-f}) so that there
-isn't any confusion between what is written here and what your local CVS
-really does.
+@noindent
+Note:
-@subheading Update relevant files.
+@itemize @bullet
+@item
+The reading of @file{.cvsrc} is disabled (@file{-f}) so that there isn't
+any confusion between what is written here and what your local
+@code{cvs} really does.
+@end itemize
+
+@subsubheading Update relevant files.
-@subsubheading @file{gdb/NEWS}
+@table @file
+
+@item gdb/NEWS
Major releases get their comments added as part of the mainline. Minor
releases should probably mention any significant bugs that were fixed.
-Don't forget to update the ChangeLog.
+Don't forget to include the @file{ChangeLog} entry.
-@example
+@smallexample
$ emacs gdb/src/gdb/NEWS
...
c-x 4 a
@@ -5018,13 +5147,22 @@ c-x 4 a
c-x c-s c-x c-c
$ cp gdb/src/gdb/NEWS insight/src/gdb/NEWS
$ cp gdb/src/gdb/ChangeLog insight/src/gdb/ChangeLog
-@end example
+@end smallexample
-@subsubheading @file{gdb/README}
+@item gdb/README
-You'll need to update: the version, the update date, and who did it.
+You'll need to update:
-@example
+@itemize @bullet
+@item
+the version
+@item
+the update date
+@item
+who did it
+@end itemize
+
+@smallexample
$ emacs gdb/src/gdb/README
...
c-x 4 a
@@ -5032,192 +5170,278 @@ c-x 4 a
c-x c-s c-x c-c
$ cp gdb/src/gdb/README insight/src/gdb/README
$ cp gdb/src/gdb/ChangeLog insight/src/gdb/ChangeLog
-@end example
+@end smallexample
-@emph{Maintainer note: Hopefully the README file was reviewed before the
-initial branch was cut so just a simple substitute is needed to get it
-updated.}
+@emph{Maintainer note: Hopefully the @file{README} file was reviewed
+before the initial branch was cut so just a simple substitute is needed
+to get it updated.}
@emph{Maintainer note: Other projects generate @file{README} and
@file{INSTALL} from the core documentation. This might be worth
pursuing.}
-@subsubheading @file{gdb/version.in}
+@item gdb/version.in
-@example
+@smallexample
$ echo $v > gdb/src/gdb/version.in
+$ cat gdb/src/gdb/version.in
+5.2
$ emacs gdb/src/gdb/version.in
...
c-x 4 a
-...
+... Bump to version ...
c-x c-s c-x c-c
$ cp gdb/src/gdb/version.in insight/src/gdb/version.in
$ cp gdb/src/gdb/ChangeLog insight/src/gdb/ChangeLog
-@end example
+@end smallexample
-@subsubheading @file{dejagnu/src/dejagnu/configure.in}
+@item dejagnu/src/dejagnu/configure.in
Dejagnu is more complicated. The version number is a parameter to
-@var{AM_INIT_AUTOMAKE}. Tweak it to read something like
-@var{gdb-5.1.1}.
+@code{AM_INIT_AUTOMAKE}. Tweak it to read something like gdb-5.1.91.
-Re-generate configure.
+Don't forget to re-generate @file{configure}.
+
+Don't forget to include a @file{ChangeLog} entry.
+
+@smallexample
+$ emacs dejagnu/src/dejagnu/configure.in
+...
+c-x 4 a
+...
+c-x c-s c-x c-c
+$ ( cd dejagnu/src/dejagnu && autoconf )
+@end smallexample
-Add a ChangeLog.
+@end table
-@subheading Do the dirty work
+@subsubheading Do the dirty work
-This is identical to the process used when creating the daily snapshot.
+This is identical to the process used to create the daily snapshot.
-@example
-$ for m in gdb insight dejagnu
+@smallexample
+$ for m in gdb insight
do
-( cd $m/src && gmake -f Makefile.in $m.tar.bz2 )
+( cd $m/src && gmake -f Makefile.in $m.tar )
done
-@end example
+$ ( m=dejagnu; cd $m/src && gmake -f Makefile.in $m.tar.bz2 )
+@end smallexample
-@subheading Check the source files
+@subsubheading Check the source files
-You're looking for files that have mysteriously disappeared as the
+You're looking for files that have mysteriously disappeared.
@kbd{distclean} has the habit of deleting files it shouldn't. Watch out
for the @file{version.in} update @kbd{cronjob}.
-@example
+@smallexample
$ ( cd gdb/src && cvs -f -q -n update )
M djunpack.bat
+? gdb-5.1.91.tar
? proto-toplev
-? gdb-5.1.1.tar.bz2
+@dots{} lots of generated files @dots{}
M gdb/ChangeLog
M gdb/NEWS
M gdb/README
M gdb/version.in
-? gdb/p-exp.tab.c
-? gdb/doc/gdb.info-11
-? gdb/doc/gdb.info-12
-? gdb/doc/gdb.info-13
-? gdb/doc/gdb.info-14
-? gdb/doc/gdb.info-15
-? gdb/doc/gdbint.info-4
-? gdb/doc/gdbint.info-5
+@dots{} lots of generated files @dots{}
$
-@end example
+@end smallexample
+@noindent
@emph{Don't worry about the @file{gdb.info-??} or
@file{gdb/p-exp.tab.c}. They were generated (and yes @file{gdb.info-1}
was also generated only something strange with CVS means that they
didn't get supressed). Fixing it would be nice though.}
-@subheading Re-pack the release with @code{gzip}
+@subsubheading Create compressed versions of the release
-@example
-$ cp */*/*.bz2 .
-$ bunzip2 -k -v *.bz2
-$ gzip -9 -v *.tar
-@end example
+@smallexample
+$ cp */src/*.tar .
+$ cp */src/*.bz2 .
+$ ls -F
+dejagnu/ dejagnu-gdb-5.2.tar.bz2 gdb/ gdb-5.2.tar insight/ insight-5.2.tar
+$ for m in gdb insight
+do
+bzip2 -v -9 -c $m-$v.tar > $m-$v.tar.bz2
+gzip -v -9 -c $m-$v.tar > $m-$v.tar.gz
+done
+$
+@end smallexample
-NB: A pipe such as @kbd{bunzip2 < xxx.bz2 | gzip -9 > xxx.gz} shouldn't
-be used since, in that mode, gzip doesn't know the file name information
-and consequently can't include it. This is also why the release process
-runs @code{tar} and @code{bzip2} as separate passes.
+@noindent
+Note:
-@emph{Maintainer note: The release process could be changed to create
-@file{.tar} rather than @file{.tar.bz2} files.}
+@itemize @bullet
+@item
+A pipe such as @kbd{bunzip2 < xxx.bz2 | gzip -9 > xxx.gz} is not since,
+in that mode, @code{gzip} does not know the name of the file and, hence,
+can not include it in the compressed file. This is also why the release
+process runs @code{tar} and @code{bzip2} as separate passes.
+@end itemize
-@section Check the release
+@subsection Sanity check the tar ball
+
+Pick a popular machine (Solaris/PPC?) and try the build on that.
+
+@smallexample
+$ bunzip2 < gdb-5.2.tar.bz2 | tar xpf -
+$ cd gdb-5.2
+$ ./configure
+$ make
+@dots{}
+$ ./gdb/gdb ./gdb/gdb
+GNU gdb 5.2
+@dots{}
+(gdb) b main
+Breakpoint 1 at 0x80732bc: file main.c, line 734.
+(gdb) run
+Starting program: /tmp/gdb-5.2/gdb/gdb
+
+Breakpoint 1, main (argc=1, argv=0xbffff8b4) at main.c:734
+734 catch_errors (captured_main, &args, "", RETURN_MASK_ALL);
+(gdb) print args
+$1 = @{argc = 136426532, argv = 0x821b7f0@}
+(gdb)
+@end smallexample
-Grab the @file{gdb.tar.bz2}, copy it to your local machine and then try
-a simple build using it.
+@subsection Make a release candidate available
-If this is a pre-release just copy the @file{.bz2} files to the snapshot
-directory and skip the remaining steps.
+If this is a release candidate then the only remaining steps are:
-If it is a final release, also make it available under a bogus name so
-that others can download and check it.
+@enumerate
+@item
+Commit @file{version.in} and @file{ChangeLog}
+@item
+Tweak @file{version.in} (and @file{ChangeLog} to read
+@var{L}.@var{M}.@var{N}-0000-00-00-cvs so that the version update
+process can restart.
+@item
+Make the release candidate available in
+@uref{ftp://sources.redhat.com/pub/gdb/snapshots/branch}
+@item
+Notify the relevant mailing lists ( @email{gdb@@sources.redhat.com} and
+@email{gdb-testers@@sources.redhat.com} that the candidate is available.
+@end enumerate
-@emph{Maintainer note: This adds an extra day to the release process but
-is very much worth it. Other developers are given the oportunity to
-check that things like your @file{NEWS} entries are correct or that
-other changes actually work.}
+@subsection Make a formal release available
-@section Release the tar ball
+(And you thought all that was required was to post an e-mail.)
-This is where, unfortunatly, the notes just get vague.
+@subsubheading Install on sware
-@subheading Install on sware
+Copy the new files to both the release and the old release directory:
-@example
+@smallexample
+$ cp *.bz2 *.gz ~ftp/pub/gdb/old-releases/
$ cp *.bz2 *.gz ~ftp/pub/gdb/releases
-@end example
+@end smallexample
+
+@noindent
+Clean up the releases directory so that only the most recent releases
+are available (e.g. keep 5.2 and 5.2.1 but remove 5.1):
-@subheading Create and update the web pages.
+@smallexample
+$ cd ~ftp/pub/gdb/releases
+$ rm @dots{}
+@end smallexample
-Try the following:
+@noindent
+Update the file @file{README} and @file{.message} in the releases
+directory:
+@smallexample
+$ vi README
+@dots{}
+$ rm -f .message
+$ ln README .message
+@end smallexample
+
+@subsubheading Update the web pages.
+
+@table @file
+
+@item htdocs/download/ANNOUNCEMENT
+This file, which is posted as the official announcement, includes:
@itemize @bullet
@item
-create the directory @file{htdocs/@var{version}} (e.g., @file{htdocs/5.1.1}
+General announcement
@item
-copy @file{index.html} and @file{ANNOUNCE} from the previous release
-into the @file{htdocs/@var{version}} directory and edit for content.
-Things like the MD5 sums, @kbd{ls -l} output, the version number and so
-on will need updating. Add NEWS entries to the @file{ANNOUNCE}. This
-ensures that the previous announcement is kept somewhere handy.
+News. If making an @var{M}.@var{N}.1 release, retain the news from
+earlier @var{M}.@var{N} release.
@item
-copy the @file{NEWS} from the distro into the
-@file{htdocs/@var{version}} directory, trim down to just the most recent
-news items
-@item
-Add a short (identical) announcement to both @file{htdocs/index.html}
-and @file{htdocs/news/index.html}
+Errata
+@end itemize
+
+@item htdocs/index.html
+@itemx htdocs/news/index.html
+@itemx htdocs/download/index.html
+These files include:
+@itemize @bullet
@item
-edit the script @file{htdocs/index.sh} to link in the new release
-number. Run it across all @file{index.html} files vis @kbd{./index.sh
-index.html */index.html}.
+announcement of the most recent release
@item
-grep the @file{htdocs} tree for references to the previous release
-version (@file{htdocs/download/index.html})
+news entry (remember to update both the top level and the news directory).
@end itemize
+These pages also need to be regenerate using @code{index.sh}.
-@emph{Maintainer note: This step is too fragile --- it is too easy to
-mis one of the entries and forget to update it.}
-
-@subheading Generate online docs
-
+@item download/onlinedocs/
You need to find the magic command that is used to generate the online
docs from the @file{.tar.bz2}. The best way is to look in the output
-from one of the nightly cronjobs and then just edit accordingly.
+from one of the nightly @code{cron} jobs and then just edit accordingly.
Something like:
-@example
+@smallexample
$ ~/ss/update-web-docs \
- ~ftp/pub/gdb/releases/gdb-5.1.1.tar.bz2 \
+ ~ftp/pub/gdb/releases/gdb-5.2.tar.bz2 \
+ $PWD/www \
+ /www/sourceware/htdocs/gdb/download/onlinedocs \
+ gdb
+@end smallexample
+
+@item download/ari/
+Just like the online documentation. Something like:
+
+@smallexample
+$ /bin/sh ~/ss/update-web-ari \
+ ~ftp/pub/gdb/releases/gdb-5.2.tar.bz2 \
$PWD/www \
- /www/sourceware/htdocs/gdb/5.1.1/onlinedocs \
+ /www/sourceware/htdocs/gdb/download/ari \
gdb
-@end example
+@end smallexample
+
+@end table
+
+@subsubheading Shadow the pages onto gnu
+
+Something goes here.
-@subheading Something about @file{ANNOUNCEMENT}
-Send the @file{ANNOUNCEMENT} file you created above to:
+@subsubheading Install the @value{GDBN} tar ball on GNU
+
+At the time of writing, the GNU machine was @kbd{gnudist.gnu.org} in
+@file{~ftp/gnu/gdb}.
+
+@subsubheading Make the @file{ANNOUNCEMENT}
+
+Post the @file{ANNOUNCEMENT} file you created above to:
@itemize @bullet
@item
@email{gdb-announce@@sources.redhat.com, GDB Announcement mailing list}
@item
-The gnu announce list (but delay it a day or so to let things get out).
+@email{info-gnu@@gnu.org, General GNU Announcement list} (but delay it a
+day or so to let things get out)
+@item
+@email{bug-gdb@@gnu.org, GDB Bug Report mailing list}
@end itemize
-@subheading Install it on GNU
-
-At the time of writing, the GNU machine was @kbd{gnudist.gnu.org} in
-@file{~ftp/gnu/gdb} (I think, I'm still waiting for it to copy into my
-home directory).
+@subsection Cleanup
-@section Cleanup
+The release is out but you're still not finished.
-@subheading Commit outstanding changes
+@subsubheading Commit outstanding changes
-In particular you'll need to commit the changes to:
+In particular you'll need to commit any changes to:
@itemize @bullet
@item
@@ -5230,36 +5454,58 @@ In particular you'll need to commit the changes to:
@file{gdb/README}
@end itemize
-@subheading Tag the release
+@subsubheading Tag the release
Something like:
-@example
+@smallexample
$ d=`date -u +%Y-%m-%d`
$ echo $d
2002-01-24
$ ( cd insight/src/gdb && cvs -f -q update )
-$ ( cd insight/src && cvs -f -q tag gdb_5_1_1-$d-release )
-@end example
+$ ( cd insight/src && cvs -f -q tag gdb_5_2-$d-release )
+@end smallexample
+
+Insight is used since that contains more of the release than
+@value{GDBN} (@code{dejagnu} doesn't get tagged but I think we can live
+with that).
-Insight is used since that contains more of the release than GDB (yes
-dejagnu doesn't get tagged but I think we can live with that.).
+@subsubheading Mention the release on the trunk
-@subheading Restart @file{gdb/version.in}
+Just put something in the @file{ChangeLog} so that the trunk also
+indicates when the release was made.
+
+@subsubheading Restart @file{gdb/version.in}
If @file{gdb/version.in} does not contain an ISO date such as
@kbd{2002-01-24} then the daily @code{cronjob} won't update it. Having
committed all the release changes it can be set to
-@file{5.1.0_0000-00-00-cvs} which will restart things (yes the @kbd{_}
+@file{5.2.0_0000-00-00-cvs} which will restart things (yes the @kbd{_}
is important - it affects the snapshot process).
Don't forget the @file{ChangeLog}.
-@subheading Merge into trunk
+@subsubheading Merge into trunk
The files committed to the branch may also need changes merged into the
trunk.
+@subsubheading Revise the release schedule
+
+Post a revised release schedule to @email{gdb@@sources.redhat.com, GDB
+Discussion List} with an updated announcement. The schedule can be
+generated by running:
+
+@smallexample
+$ ~/ss/schedule `date +%s` schedule
+@end smallexample
+
+@noindent
+The first parameter is approximate date/time in seconds (from the epoch)
+of the most recent release.
+
+Also update the schedule @code{cronjob}.
+
@section Post release
Remove any @code{OBSOLETE} code.
@@ -5290,7 +5536,7 @@ the testsuite is running, you'll get mentions of which test file is in use,
and a mention of any unexpected passes or fails. When the testsuite is
finished, you'll get a summary that looks like this:
-@example
+@smallexample
=== gdb Summary ===
# of expected passes 6016
@@ -5299,7 +5545,7 @@ finished, you'll get a summary that looks like this:
# of expected failures 183
# of unresolved testcases 3
# of untested testcases 5
-@end example
+@end smallexample
The ideal test run consists of expected passes only; however, reality
conspires to keep us from this ideal. Unexpected failures indicate
@@ -5615,16 +5861,6 @@ and deleted from all of @value{GDBN}'s config files.
Any @file{@var{foo}-xdep.c} file that references STACK_END_ADDR
is so old that it has never been converted to use BFD. Now that's old!
-@item PYRAMID_CONTROL_FRAME_DEBUGGING
-pyr-xdep.c
-@item PYRAMID_CORE
-pyr-xdep.c
-@item PYRAMID_PTRACE
-pyr-xdep.c
-
-@item REG_STACK_SEGMENT
-exec.c
-
@end table
@include fdl.texi
diff --git a/gdb/dwarf2cfi.c b/gdb/dwarf2cfi.c
index 6c574bb..ffbeb5d 100644
--- a/gdb/dwarf2cfi.c
+++ b/gdb/dwarf2cfi.c
@@ -1,7 +1,7 @@
/* Stack unwinding code based on dwarf2 frame info for GDB, the GNU debugger.
- Copyright 2001
- Free Software Foundation, Inc.
+ Copyright 2001, 2002 Free Software Foundation, Inc.
Contributed by Jiri Smid, SuSE Labs.
+ Based on code written by Daniel Berlin (dan@dberlin.org).
This file is part of GDB.
@@ -1506,7 +1506,8 @@ cfi_read_fp ()
return cfa;
}
-/* Store the frame address. */
+/* Store the frame address. This function is not used. */
+
void
cfi_write_fp (CORE_ADDR val)
{
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 9dbcbde..5c06e9a 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -175,19 +175,49 @@ struct comp_unit_head
4 or 12 */
};
-/* The data in the .debug_line statement prologue looks like this. */
-struct line_head
+/* The line number information for a compilation unit (found in the
+ .debug_line section) begins with a "statement program header",
+ which contains the following information. */
+struct line_header
+{
+ unsigned int total_length;
+ unsigned short version;
+ unsigned int header_length;
+ unsigned char minimum_instruction_length;
+ unsigned char default_is_stmt;
+ int line_base;
+ unsigned char line_range;
+ unsigned char opcode_base;
+
+ /* standard_opcode_lengths[i] is the number of operands for the
+ standard opcode whose value is i. This means that
+ standard_opcode_lengths[0] is unused, and the last meaningful
+ element is standard_opcode_lengths[opcode_base - 1]. */
+ unsigned char *standard_opcode_lengths;
+
+ /* The include_directories table. NOTE! These strings are not
+ allocated with xmalloc; instead, they are pointers into
+ debug_line_buffer. If you try to free them, `free' will get
+ indigestion. */
+ unsigned int num_include_dirs, include_dirs_size;
+ char **include_dirs;
+
+ /* The file_names table. NOTE! These strings are not allocated
+ with xmalloc; instead, they are pointers into debug_line_buffer.
+ Don't try to free them directly. */
+ unsigned int num_file_names, file_names_size;
+ struct file_entry
{
- unsigned int total_length;
- unsigned short version;
- unsigned int prologue_length;
- unsigned char minimum_instruction_length;
- unsigned char default_is_stmt;
- int line_base;
- unsigned char line_range;
- unsigned char opcode_base;
- unsigned char *standard_opcode_lengths;
- };
+ char *name;
+ unsigned int dir_index;
+ unsigned int mod_time;
+ unsigned int length;
+ } *file_names;
+
+ /* The start and end of the statement program following this
+ header. These point into dwarf_line_buffer. */
+ char *statement_program_start, *statement_program_end;
+};
/* When we construct a partial symbol table entry we only
need this much information. */
@@ -256,6 +286,16 @@ struct attribute
u;
};
+struct function_range
+{
+ const char *name;
+ CORE_ADDR lowpc, highpc;
+ int seen_line;
+ struct function_range *next;
+};
+
+static struct function_range *cu_first_fn, *cu_last_fn, *cu_cached_fn;
+
/* Get at parts of an attribute structure */
#define DW_STRING(attr) ((attr)->u.str)
@@ -492,6 +532,10 @@ static struct complaint dwarf2_missing_line_number_section =
{
"missing .debug_line section", 0, 0
};
+static struct complaint dwarf2_statement_list_fits_in_line_number_section =
+{
+ "statement list doesn't fit in .debug_line section", 0, 0
+};
static struct complaint dwarf2_mangled_line_number_section =
{
"mangled .debug_line section", 0, 0
@@ -560,6 +604,14 @@ static struct complaint dwarf2_unsupported_const_value_attr =
{
"unsupported const value attribute form: '%s'", 0, 0
};
+static struct complaint dwarf2_misplaced_line_number =
+{
+ "misplaced first line number at 0x%lx for '%s'", 0, 0
+};
+static struct complaint dwarf2_line_header_too_long =
+{
+ "line number info header doesn't fit in `.debug_line' section", 0, 0
+};
/* local function prototypes */
@@ -639,7 +691,14 @@ static struct attribute *dwarf_attr (struct die_info *, unsigned int);
static int die_is_declaration (struct die_info *);
-static void dwarf_decode_lines (unsigned int, char *, bfd *,
+static void free_line_header (struct line_header *lh);
+
+static struct line_header *(dwarf_decode_line_header
+ (unsigned int offset,
+ bfd *abfd,
+ const struct comp_unit_head *cu_header));
+
+static void dwarf_decode_lines (struct line_header *, char *, bfd *,
const struct comp_unit_head *);
static void dwarf2_start_subfile (char *, char *);
@@ -794,6 +853,10 @@ static struct abbrev_info *dwarf_alloc_abbrev (void);
static struct die_info *dwarf_alloc_die (void);
+static void initialize_cu_func_list (void);
+
+static void add_to_cu_func_list (const char *, CORE_ADDR, CORE_ADDR);
+
/* Try to locate the sections we need for DWARF 2 debugging
information and return true if we have enough to do something. */
@@ -1542,10 +1605,16 @@ process_die (struct die_info *die, struct objfile *objfile,
}
static void
+initialize_cu_func_list (void)
+{
+ cu_first_fn = cu_last_fn = cu_cached_fn = NULL;
+}
+
+static void
read_file_scope (struct die_info *die, struct objfile *objfile,
const struct comp_unit_head *cu_header)
{
- unsigned int line_offset = 0;
+ struct cleanup *back_to = make_cleanup (null_cleanup, 0);
CORE_ADDR lowpc = ((CORE_ADDR) -1);
CORE_ADDR highpc = ((CORE_ADDR) 0);
struct attribute *attr;
@@ -1553,6 +1622,7 @@ read_file_scope (struct die_info *die, struct objfile *objfile,
char *comp_dir = NULL;
struct die_info *child_die;
bfd *abfd = objfile->obfd;
+ struct line_header *line_header = 0;
if (!dwarf2_get_pc_bounds (die, &lowpc, &highpc, objfile))
{
@@ -1633,13 +1703,7 @@ read_file_scope (struct die_info *die, struct objfile *objfile,
start_symtab (name, comp_dir, lowpc);
record_debugformat ("DWARF 2");
- /* Decode line number information if present. */
- attr = dwarf_attr (die, DW_AT_stmt_list);
- if (attr)
- {
- line_offset = DW_UNSND (attr);
- dwarf_decode_lines (line_offset, comp_dir, abfd, cu_header);
- }
+ initialize_cu_func_list ();
/* Process all dies in compilation unit. */
if (die->has_children)
@@ -1651,6 +1715,44 @@ read_file_scope (struct die_info *die, struct objfile *objfile,
child_die = sibling_die (child_die);
}
}
+
+ /* Decode line number information if present. */
+ attr = dwarf_attr (die, DW_AT_stmt_list);
+ if (attr)
+ {
+ unsigned int line_offset = DW_UNSND (attr);
+ line_header = dwarf_decode_line_header (line_offset,
+ abfd, cu_header);
+ if (line_header)
+ {
+ make_cleanup ((make_cleanup_ftype *) free_line_header,
+ (void *) line_header);
+ dwarf_decode_lines (line_header, comp_dir, abfd, cu_header);
+ }
+ }
+
+ do_cleanups (back_to);
+}
+
+static void
+add_to_cu_func_list (const char *name, CORE_ADDR lowpc, CORE_ADDR highpc)
+{
+ struct function_range *thisfn;
+
+ thisfn = (struct function_range *)
+ obstack_alloc (&dwarf2_tmp_obstack, sizeof (struct function_range));
+ thisfn->name = name;
+ thisfn->lowpc = lowpc;
+ thisfn->highpc = highpc;
+ thisfn->seen_line = 0;
+ thisfn->next = NULL;
+
+ if (cu_last_fn == NULL)
+ cu_first_fn = thisfn;
+ else
+ cu_last_fn->next = thisfn;
+
+ cu_last_fn = thisfn;
}
static void
@@ -1674,6 +1776,9 @@ read_func_scope (struct die_info *die, struct objfile *objfile,
lowpc += baseaddr;
highpc += baseaddr;
+ /* Record the function range for dwarf_decode_lines. */
+ add_to_cu_func_list (name, lowpc, highpc);
+
if (objfile->ei.entry_point >= lowpc &&
objfile->ei.entry_point < highpc)
{
@@ -2538,7 +2643,8 @@ read_array_type (struct die_info *die, struct objfile *objfile,
else if (attr->form == DW_FORM_udata
|| attr->form == DW_FORM_data1
|| attr->form == DW_FORM_data2
- || attr->form == DW_FORM_data4)
+ || attr->form == DW_FORM_data4
+ || attr->form == DW_FORM_data8)
{
low = DW_UNSND (attr);
}
@@ -2564,7 +2670,8 @@ read_array_type (struct die_info *die, struct objfile *objfile,
else if (attr->form == DW_FORM_udata
|| attr->form == DW_FORM_data1
|| attr->form == DW_FORM_data2
- || attr->form == DW_FORM_data4)
+ || attr->form == DW_FORM_data4
+ || attr->form == DW_FORM_data8)
{
high = DW_UNSND (attr);
}
@@ -2610,6 +2717,16 @@ read_array_type (struct die_info *die, struct objfile *objfile,
while (ndim-- > 0)
type = create_array_type (NULL, type, range_types[ndim]);
+ /* Understand Dwarf2 support for vector types (like they occur on
+ the PowerPC w/ AltiVec). Gcc just adds another attribute to the
+ array type. This is not part of the Dwarf2/3 standard yet, but a
+ custom vendor extension. The main difference between a regular
+ array and the vector variant is that vectors are passed by value
+ to functions. */
+ attr = dwarf_attr (die, DW_AT_GNU_vector);
+ if (attr)
+ TYPE_FLAGS (type) |= TYPE_FLAG_VECTOR;
+
do_cleanups (back_to);
/* Install the type in the die. */
@@ -2977,6 +3094,18 @@ read_base_type (struct die_info *die, struct objfile *objfile)
type = init_type (code, size, type_flags, DW_STRING (attr), objfile);
if (encoding == DW_ATE_address)
TYPE_TARGET_TYPE (type) = dwarf2_fundamental_type (objfile, FT_VOID);
+ else if (encoding == DW_ATE_complex_float)
+ {
+ if (size == 32)
+ TYPE_TARGET_TYPE (type)
+ = dwarf2_fundamental_type (objfile, FT_EXT_PREC_FLOAT);
+ else if (size == 16)
+ TYPE_TARGET_TYPE (type)
+ = dwarf2_fundamental_type (objfile, FT_DBL_PREC_FLOAT);
+ else if (size == 8)
+ TYPE_TARGET_TYPE (type)
+ = dwarf2_fundamental_type (objfile, FT_FLOAT);
+ }
}
else
{
@@ -3871,87 +4000,153 @@ die_is_declaration (struct die_info *die)
&& ! dwarf_attr (die, DW_AT_specification));
}
-/* Decode the line number information for the compilation unit whose
- line number info is at OFFSET in the .debug_line section.
- The compilation directory of the file is passed in COMP_DIR. */
-struct filenames
+/* Free the line_header structure *LH, and any arrays and strings it
+ refers to. */
+static void
+free_line_header (struct line_header *lh)
+{
+ if (lh->standard_opcode_lengths)
+ free (lh->standard_opcode_lengths);
+
+ /* Remember that all the lh->file_names[i].name pointers are
+ pointers into debug_line_buffer, and don't need to be freed. */
+ if (lh->file_names)
+ free (lh->file_names);
+
+ /* Similarly for the include directory names. */
+ if (lh->include_dirs)
+ free (lh->include_dirs);
+
+ free (lh);
+}
+
+
+/* Add an entry to LH's include directory table. */
+static void
+add_include_dir (struct line_header *lh, char *include_dir)
{
- unsigned int num_files;
- struct fileinfo
+ /* Grow the array if necessary. */
+ if (lh->include_dirs_size == 0)
{
- char *name;
- unsigned int dir;
- unsigned int time;
- unsigned int size;
+ lh->include_dirs_size = 1; /* for testing */
+ lh->include_dirs = xmalloc (lh->include_dirs_size
+ * sizeof (*lh->include_dirs));
+ }
+ else if (lh->num_include_dirs >= lh->include_dirs_size)
+ {
+ lh->include_dirs_size *= 2;
+ lh->include_dirs = xrealloc (lh->include_dirs,
+ (lh->include_dirs_size
+ * sizeof (*lh->include_dirs)));
}
- *files;
-};
-struct directories
- {
- unsigned int num_dirs;
- char **dirs;
- };
+ lh->include_dirs[lh->num_include_dirs++] = include_dir;
+}
+
+/* Add an entry to LH's file name table. */
static void
-dwarf_decode_lines (unsigned int offset, char *comp_dir, bfd *abfd,
- const struct comp_unit_head *cu_header)
+add_file_name (struct line_header *lh,
+ char *name,
+ unsigned int dir_index,
+ unsigned int mod_time,
+ unsigned int length)
{
- char *line_ptr;
- char *line_end;
- struct line_head lh;
- struct cleanup *back_to;
- unsigned int i, bytes_read;
- char *cur_file, *cur_dir;
- unsigned char op_code, extended_op, adj_opcode;
+ struct file_entry *fe;
-#define FILE_ALLOC_CHUNK 5
-#define DIR_ALLOC_CHUNK 5
+ /* Grow the array if necessary. */
+ if (lh->file_names_size == 0)
+ {
+ lh->file_names_size = 1; /* for testing */
+ lh->file_names = xmalloc (lh->file_names_size
+ * sizeof (*lh->file_names));
+ }
+ else if (lh->num_file_names >= lh->file_names_size)
+ {
+ lh->file_names_size *= 2;
+ lh->file_names = xrealloc (lh->file_names,
+ (lh->file_names_size
+ * sizeof (*lh->file_names)));
+ }
- struct filenames files;
- struct directories dirs;
+ fe = &lh->file_names[lh->num_file_names++];
+ fe->name = name;
+ fe->dir_index = dir_index;
+ fe->mod_time = mod_time;
+ fe->length = length;
+}
+
+
+/* Read the statement program header starting at OFFSET in
+ dwarf_line_buffer, according to the endianness of ABFD. Return a
+ pointer to a struct line_header, allocated using xmalloc.
+
+ NOTE: the strings in the include directory and file name tables of
+ the returned object point into debug_line_buffer, and must not be
+ freed. */
+static struct line_header *
+dwarf_decode_line_header (unsigned int offset, bfd *abfd,
+ const struct comp_unit_head *cu_header)
+{
+ struct cleanup *back_to;
+ struct line_header *lh;
+ char *line_ptr;
+ int bytes_read;
+ int i;
+ char *cur_dir, *cur_file;
if (dwarf_line_buffer == NULL)
{
complain (&dwarf2_missing_line_number_section);
- return;
+ return 0;
}
- files.num_files = 0;
- files.files = NULL;
+ /* Make sure that at least there's room for the total_length field. That
+ could be 12 bytes long, but we're just going to fudge that. */
+ if (offset + 4 >= dwarf_line_size)
+ {
+ complain (&dwarf2_statement_list_fits_in_line_number_section);
+ return 0;
+ }
- dirs.num_dirs = 0;
- dirs.dirs = NULL;
+ lh = xmalloc (sizeof (*lh));
+ memset (lh, 0, sizeof (*lh));
+ back_to = make_cleanup ((make_cleanup_ftype *) free_line_header,
+ (void *) lh);
line_ptr = dwarf_line_buffer + offset;
- /* read in the prologue */
- lh.total_length = read_initial_length (abfd, line_ptr, NULL, &bytes_read);
+ /* read in the header */
+ lh->total_length = read_initial_length (abfd, line_ptr, NULL, &bytes_read);
line_ptr += bytes_read;
- line_end = line_ptr + lh.total_length;
- lh.version = read_2_bytes (abfd, line_ptr);
+ if (line_ptr + lh->total_length > dwarf_line_buffer + dwarf_line_size)
+ {
+ complain (&dwarf2_statement_list_fits_in_line_number_section);
+ return 0;
+ }
+ lh->statement_program_end = line_ptr + lh->total_length;
+ lh->version = read_2_bytes (abfd, line_ptr);
line_ptr += 2;
- lh.prologue_length = read_offset (abfd, line_ptr, cu_header, &bytes_read);
+ lh->header_length = read_offset (abfd, line_ptr, cu_header, &bytes_read);
line_ptr += bytes_read;
- lh.minimum_instruction_length = read_1_byte (abfd, line_ptr);
+ lh->minimum_instruction_length = read_1_byte (abfd, line_ptr);
line_ptr += 1;
- lh.default_is_stmt = read_1_byte (abfd, line_ptr);
+ lh->default_is_stmt = read_1_byte (abfd, line_ptr);
line_ptr += 1;
- lh.line_base = read_1_signed_byte (abfd, line_ptr);
+ lh->line_base = read_1_signed_byte (abfd, line_ptr);
line_ptr += 1;
- lh.line_range = read_1_byte (abfd, line_ptr);
+ lh->line_range = read_1_byte (abfd, line_ptr);
line_ptr += 1;
- lh.opcode_base = read_1_byte (abfd, line_ptr);
+ lh->opcode_base = read_1_byte (abfd, line_ptr);
line_ptr += 1;
- lh.standard_opcode_lengths = (unsigned char *)
- xmalloc (lh.opcode_base * sizeof (unsigned char));
- back_to = make_cleanup (free_current_contents, &lh.standard_opcode_lengths);
+ lh->standard_opcode_lengths
+ = (unsigned char *) xmalloc (lh->opcode_base * sizeof (unsigned char));
- lh.standard_opcode_lengths[0] = 1;
- for (i = 1; i < lh.opcode_base; ++i)
+ lh->standard_opcode_lengths[0] = 1; /* This should never be used anyway. */
+ for (i = 1; i < lh->opcode_base; ++i)
{
- lh.standard_opcode_lengths[i] = read_1_byte (abfd, line_ptr);
+ lh->standard_opcode_lengths[i] = read_1_byte (abfd, line_ptr);
line_ptr += 1;
}
@@ -3959,44 +4154,96 @@ dwarf_decode_lines (unsigned int offset, char *comp_dir, bfd *abfd,
while ((cur_dir = read_string (abfd, line_ptr, &bytes_read)) != NULL)
{
line_ptr += bytes_read;
- if ((dirs.num_dirs % DIR_ALLOC_CHUNK) == 0)
- {
- dirs.dirs = (char **)
- xrealloc (dirs.dirs,
- (dirs.num_dirs + DIR_ALLOC_CHUNK) * sizeof (char *));
- if (dirs.num_dirs == 0)
- make_cleanup (free_current_contents, &dirs.dirs);
- }
- dirs.dirs[dirs.num_dirs++] = cur_dir;
+ add_include_dir (lh, cur_dir);
}
line_ptr += bytes_read;
/* Read file name table */
while ((cur_file = read_string (abfd, line_ptr, &bytes_read)) != NULL)
{
+ unsigned int dir_index, mod_time, length;
+
line_ptr += bytes_read;
- if ((files.num_files % FILE_ALLOC_CHUNK) == 0)
- {
- files.files = (struct fileinfo *)
- xrealloc (files.files,
- (files.num_files + FILE_ALLOC_CHUNK)
- * sizeof (struct fileinfo));
- if (files.num_files == 0)
- make_cleanup (free_current_contents, &files.files);
- }
- files.files[files.num_files].name = cur_file;
- files.files[files.num_files].dir =
- read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
+ dir_index = read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
line_ptr += bytes_read;
- files.files[files.num_files].time =
- read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
+ mod_time = read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
line_ptr += bytes_read;
- files.files[files.num_files].size =
- read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
+ length = read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
line_ptr += bytes_read;
- files.num_files++;
+
+ add_file_name (lh, cur_file, dir_index, mod_time, length);
}
line_ptr += bytes_read;
+ lh->statement_program_start = line_ptr;
+
+ if (line_ptr > dwarf_line_buffer + dwarf_line_size)
+ complain (&dwarf2_line_header_too_long);
+
+ discard_cleanups (back_to);
+ return lh;
+}
+
+/* This function exists to work around a bug in certain compilers
+ (particularly GCC 2.95), in which the first line number marker of a
+ function does not show up until after the prologue, right before
+ the second line number marker. This function shifts ADDRESS down
+ to the beginning of the function if necessary, and is called on
+ addresses passed to record_line. */
+
+static CORE_ADDR
+check_cu_functions (CORE_ADDR address)
+{
+ struct function_range *fn;
+
+ /* Find the function_range containing address. */
+ if (!cu_first_fn)
+ return address;
+
+ if (!cu_cached_fn)
+ cu_cached_fn = cu_first_fn;
+
+ fn = cu_cached_fn;
+ while (fn)
+ if (fn->lowpc <= address && fn->highpc > address)
+ goto found;
+ else
+ fn = fn->next;
+
+ fn = cu_first_fn;
+ while (fn && fn != cu_cached_fn)
+ if (fn->lowpc <= address && fn->highpc > address)
+ goto found;
+ else
+ fn = fn->next;
+
+ return address;
+
+ found:
+ if (fn->seen_line)
+ return address;
+ if (address != fn->lowpc)
+ complain (&dwarf2_misplaced_line_number,
+ (unsigned long) address, fn->name);
+ fn->seen_line = 1;
+ return fn->lowpc;
+}
+
+/* Decode the line number information for the compilation unit whose
+ line number info is at OFFSET in the .debug_line section.
+ The compilation directory of the file is passed in COMP_DIR. */
+
+static void
+dwarf_decode_lines (struct line_header *lh, char *comp_dir, bfd *abfd,
+ const struct comp_unit_head *cu_header)
+{
+ char *line_ptr;
+ char *line_end;
+ unsigned int i, bytes_read;
+ char *cur_dir;
+ unsigned char op_code, extended_op, adj_opcode;
+
+ line_ptr = lh->statement_program_start;
+ line_end = lh->statement_program_end;
/* Read the statement sequences until there's nothing left. */
while (line_ptr < line_end)
@@ -4006,19 +4253,23 @@ dwarf_decode_lines (unsigned int offset, char *comp_dir, bfd *abfd,
unsigned int file = 1;
unsigned int line = 1;
unsigned int column = 0;
- int is_stmt = lh.default_is_stmt;
+ int is_stmt = lh->default_is_stmt;
int basic_block = 0;
int end_sequence = 0;
/* Start a subfile for the current file of the state machine. */
- if (files.num_files >= file)
+ if (lh->num_file_names >= file)
{
- /* The file and directory tables are 0 based, the references
- are 1 based. */
- dwarf2_start_subfile (files.files[file - 1].name,
- (files.files[file - 1].dir
- ? dirs.dirs[files.files[file - 1].dir - 1]
- : comp_dir));
+ /* lh->include_dirs and lh->file_names are 0-based, but the
+ directory and file name numbers in the statement program
+ are 1-based. */
+ struct file_entry *fe = &lh->file_names[file - 1];
+ char *dir;
+ if (fe->dir_index)
+ dir = lh->include_dirs[fe->dir_index - 1];
+ else
+ dir = comp_dir;
+ dwarf2_start_subfile (fe->name, dir);
}
/* Decode the table. */
@@ -4027,13 +4278,14 @@ dwarf_decode_lines (unsigned int offset, char *comp_dir, bfd *abfd,
op_code = read_1_byte (abfd, line_ptr);
line_ptr += 1;
- if (op_code >= lh.opcode_base)
+ if (op_code >= lh->opcode_base)
{ /* Special operand. */
- adj_opcode = op_code - lh.opcode_base;
- address += (adj_opcode / lh.line_range)
- * lh.minimum_instruction_length;
- line += lh.line_base + (adj_opcode % lh.line_range);
+ adj_opcode = op_code - lh->opcode_base;
+ address += (adj_opcode / lh->line_range)
+ * lh->minimum_instruction_length;
+ line += lh->line_base + (adj_opcode % lh->line_range);
/* append row to matrix using current values */
+ address = check_cu_functions (address);
record_line (current_subfile, line, address);
basic_block = 1;
}
@@ -4047,12 +4299,7 @@ dwarf_decode_lines (unsigned int offset, char *comp_dir, bfd *abfd,
{
case DW_LNE_end_sequence:
end_sequence = 1;
- /* Don't call record_line here. The end_sequence
- instruction provides the address of the first byte
- *after* the last line in the sequence; it's not the
- address of any real source line. However, the GDB
- linetable structure only records the starts of lines,
- not the ends. This is a weakness of GDB. */
+ record_line (current_subfile, 0, address);
break;
case DW_LNE_set_address:
address = read_address (abfd, line_ptr, cu_header, &bytes_read);
@@ -4060,40 +4307,36 @@ dwarf_decode_lines (unsigned int offset, char *comp_dir, bfd *abfd,
address += baseaddr;
break;
case DW_LNE_define_file:
- cur_file = read_string (abfd, line_ptr, &bytes_read);
- line_ptr += bytes_read;
- if ((files.num_files % FILE_ALLOC_CHUNK) == 0)
- {
- files.files = (struct fileinfo *)
- xrealloc (files.files,
- (files.num_files + FILE_ALLOC_CHUNK)
- * sizeof (struct fileinfo));
- if (files.num_files == 0)
- make_cleanup (free_current_contents, &files.files);
- }
- files.files[files.num_files].name = cur_file;
- files.files[files.num_files].dir =
- read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
- line_ptr += bytes_read;
- files.files[files.num_files].time =
- read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
- line_ptr += bytes_read;
- files.files[files.num_files].size =
- read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
- line_ptr += bytes_read;
- files.num_files++;
+ {
+ char *cur_file;
+ unsigned int dir_index, mod_time, length;
+
+ cur_file = read_string (abfd, line_ptr, &bytes_read);
+ line_ptr += bytes_read;
+ dir_index =
+ read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
+ line_ptr += bytes_read;
+ mod_time =
+ read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
+ line_ptr += bytes_read;
+ length =
+ read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
+ line_ptr += bytes_read;
+ add_file_name (lh, cur_file, dir_index, mod_time, length);
+ }
break;
default:
complain (&dwarf2_mangled_line_number_section);
- goto done;
+ return;
}
break;
case DW_LNS_copy:
+ address = check_cu_functions (address);
record_line (current_subfile, line, address);
basic_block = 0;
break;
case DW_LNS_advance_pc:
- address += lh.minimum_instruction_length
+ address += lh->minimum_instruction_length
* read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
line_ptr += bytes_read;
break;
@@ -4102,15 +4345,21 @@ dwarf_decode_lines (unsigned int offset, char *comp_dir, bfd *abfd,
line_ptr += bytes_read;
break;
case DW_LNS_set_file:
- /* The file and directory tables are 0 based, the references
- are 1 based. */
- file = read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
- line_ptr += bytes_read;
- dwarf2_start_subfile
- (files.files[file - 1].name,
- (files.files[file - 1].dir
- ? dirs.dirs[files.files[file - 1].dir - 1]
- : comp_dir));
+ {
+ /* lh->include_dirs and lh->file_names are 0-based,
+ but the directory and file name numbers in the
+ statement program are 1-based. */
+ struct file_entry *fe;
+ char *dir;
+ file = read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
+ line_ptr += bytes_read;
+ fe = &lh->file_names[file - 1];
+ if (fe->dir_index)
+ dir = lh->include_dirs[fe->dir_index - 1];
+ else
+ dir = comp_dir;
+ dwarf2_start_subfile (fe->name, dir);
+ }
break;
case DW_LNS_set_column:
column = read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
@@ -4128,8 +4377,8 @@ dwarf_decode_lines (unsigned int offset, char *comp_dir, bfd *abfd,
length since special opcode 255 would have scaled the
the increment. */
case DW_LNS_const_add_pc:
- address += (lh.minimum_instruction_length
- * ((255 - lh.opcode_base) / lh.line_range));
+ address += (lh->minimum_instruction_length
+ * ((255 - lh->opcode_base) / lh->line_range));
break;
case DW_LNS_fixed_advance_pc:
address += read_2_bytes (abfd, line_ptr);
@@ -4138,7 +4387,7 @@ dwarf_decode_lines (unsigned int offset, char *comp_dir, bfd *abfd,
default:
{ /* Unknown standard opcode, ignore it. */
int i;
- for (i = 0; i < lh.standard_opcode_lengths[op_code]; i++)
+ for (i = 0; i < lh->standard_opcode_lengths[op_code]; i++)
{
(void) read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
line_ptr += bytes_read;
@@ -4147,8 +4396,6 @@ dwarf_decode_lines (unsigned int offset, char *comp_dir, bfd *abfd,
}
}
}
-done:
- do_cleanups (back_to);
}
/* Start a subfile for DWARF. FILENAME is the name of the file and
@@ -5161,6 +5408,8 @@ dwarf_attr_name (register unsigned attr)
return "DW_AT_body_begin";
case DW_AT_body_end:
return "DW_AT_body_end";
+ case DW_AT_GNU_vector:
+ return "DW_AT_GNU_vector";
default:
return "DW_AT_<unknown>";
}
diff --git a/gdb/eval.c b/gdb/eval.c
index 3f5aca3..4ff210b 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -1,6 +1,6 @@
/* Evaluate expressions for GDB.
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
- 1996, 1997, 1998, 1999, 2000, 2001
+ 1996, 1997, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
This file is part of GDB.
@@ -78,7 +78,7 @@ parse_and_eval_address (char *exp)
struct expression *expr = parse_expression (exp);
register CORE_ADDR addr;
register struct cleanup *old_chain =
- make_cleanup (free_current_contents, &expr);
+ make_cleanup (free_current_contents, &expr);
addr = value_as_address (evaluate_expression (expr));
do_cleanups (old_chain);
@@ -94,7 +94,7 @@ parse_and_eval_address_1 (char **expptr)
struct expression *expr = parse_exp_1 (expptr, (struct block *) 0, 0);
register CORE_ADDR addr;
register struct cleanup *old_chain =
- make_cleanup (free_current_contents, &expr);
+ make_cleanup (free_current_contents, &expr);
addr = value_as_address (evaluate_expression (expr));
do_cleanups (old_chain);
@@ -121,8 +121,8 @@ parse_and_eval (char *exp)
{
struct expression *expr = parse_expression (exp);
struct value *val;
- register struct cleanup *old_chain
- = make_cleanup (free_current_contents, &expr);
+ register struct cleanup *old_chain =
+ make_cleanup (free_current_contents, &expr);
val = evaluate_expression (expr);
do_cleanups (old_chain);
@@ -138,8 +138,8 @@ parse_to_comma_and_eval (char **expp)
{
struct expression *expr = parse_exp_1 (expp, (struct block *) 0, 1);
struct value *val;
- register struct cleanup *old_chain
- = make_cleanup (free_current_contents, &expr);
+ register struct cleanup *old_chain =
+ make_cleanup (free_current_contents, &expr);
val = evaluate_expression (expr);
do_cleanups (old_chain);
@@ -447,8 +447,7 @@ evaluate_subexp_standard (struct type *expect_type,
case OP_REGISTER:
{
int regno = longest_to_int (exp->elts[pc + 1].longconst);
- struct value *val = value_of_register (regno);
-
+ struct value *val = value_of_register (regno, selected_frame);
(*pos) += 2;
if (val == NULL)
error ("Value of register %s not available.", REGISTER_NAME (regno));
@@ -821,15 +820,10 @@ evaluate_subexp_standard (struct type *expect_type,
if (op == STRUCTOP_STRUCT || op == STRUCTOP_PTR)
{
int static_memfuncp;
- struct value *temp = arg2;
char tstr[256];
/* Method invocation : stuff "this" as first parameter */
- /* pai: this used to have lookup_pointer_type for some reason,
- * but temp is already a pointer to the object */
- argvec[1]
- = value_from_pointer (VALUE_TYPE (temp),
- VALUE_ADDRESS (temp) + VALUE_OFFSET (temp));
+ argvec[1] = arg2;
/* Name of method from expression */
strcpy (tstr, &exp->elts[pc2 + 2].string);
@@ -855,11 +849,17 @@ evaluate_subexp_standard (struct type *expect_type,
else
/* Non-C++ case -- or no overload resolution */
{
- temp = arg2;
+ struct value *temp = arg2;
argvec[0] = value_struct_elt (&temp, argvec + 1, tstr,
&static_memfuncp,
op == STRUCTOP_STRUCT
? "structure" : "structure pointer");
+ /* value_struct_elt updates temp with the correct value
+ of the ``this'' pointer if necessary, so modify argvec[1] to
+ reflect any ``this'' changes. */
+ arg2 = value_from_longest (lookup_pointer_type(VALUE_TYPE (temp)),
+ VALUE_ADDRESS (temp) + VALUE_OFFSET (temp)
+ + VALUE_EMBEDDED_OFFSET (temp));
argvec[1] = arg2; /* the ``this'' pointer */
}
diff --git a/gdb/event-top.c b/gdb/event-top.c
index 3bf9c34..b472694 100644
--- a/gdb/event-top.c
+++ b/gdb/event-top.c
@@ -685,20 +685,17 @@ command_line_handler (char *rl)
{
p--; /* Put on top of '\'. */
- if (*p == '\\')
- {
- readline_input_state.linebuffer = savestring (linebuffer,
- strlen (linebuffer));
- readline_input_state.linebuffer_ptr = p;
-
- /* We will not invoke a execute_command if there is more
- input expected to complete the command. So, we need to
- print an empty prompt here. */
- more_to_come = 1;
- push_prompt ("", "", "");
- display_gdb_prompt (0);
- return;
- }
+ readline_input_state.linebuffer = savestring (linebuffer,
+ strlen (linebuffer));
+ readline_input_state.linebuffer_ptr = p;
+
+ /* We will not invoke a execute_command if there is more
+ input expected to complete the command. So, we need to
+ print an empty prompt here. */
+ more_to_come = 1;
+ push_prompt ("", "", "");
+ display_gdb_prompt (0);
+ return;
}
#ifdef STOP_SIGNAL
diff --git a/gdb/exec.c b/gdb/exec.c
index b07175e..0228f41 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -742,7 +742,7 @@ and it is the program executed when you use the `run' command.\n\
If FILE cannot be found as specified, your execution directory path\n\
($PATH) is searched for a command of that name.\n\
No arg means to have no executable file and no symbols.", &cmdlist);
- c->completer = filename_completer;
+ set_cmd_completer (c, filename_completer);
}
c = add_cmd ("exec-file", class_files, exec_file_command,
@@ -750,7 +750,7 @@ No arg means to have no executable file and no symbols.", &cmdlist);
If FILE cannot be found as specified, your execution directory path\n\
is searched for a command of that name.\n\
No arg means have no executable file.", &cmdlist);
- c->completer = filename_completer;
+ set_cmd_completer (c, filename_completer);
add_com ("section", class_files, set_section_command,
"Change the base address of section SECTION of the exec file to ADDR.\n\
diff --git a/gdb/f-exp.y b/gdb/f-exp.y
index 7cbfd5a..e1168772 100644
--- a/gdb/f-exp.y
+++ b/gdb/f-exp.y
@@ -924,7 +924,9 @@ yylex ()
char *tokstart;
retry:
-
+
+ prev_lexptr = lexptr;
+
tokstart = lexptr;
/* First of all, let us make sure we are not dealing with the
@@ -1171,5 +1173,8 @@ void
yyerror (msg)
char *msg;
{
+ if (prev_lexptr)
+ lexptr = prev_lexptr;
+
error ("A %s in expression, near `%s'.", (msg ? msg : "error"), lexptr);
}
diff --git a/gdb/f-lang.c b/gdb/f-lang.c
index 1727bda..85866b3 100644
--- a/gdb/f-lang.c
+++ b/gdb/f-lang.c
@@ -904,7 +904,7 @@ get_bf_for_fcn (long the_function)
if (current_head_bf_list->symnum_fcn == the_function)
{
if (global_remote_debug)
- fprintf (stderr, "*");
+ fprintf_unfiltered (gdb_stderr, "*");
tmp = current_head_bf_list;
current_head_bf_list = current_head_bf_list->next;
@@ -916,7 +916,7 @@ get_bf_for_fcn (long the_function)
the ugly linear scan */
if (global_remote_debug)
- fprintf (stderr, "\ndefaulting to linear scan\n");
+ fprintf_unfiltered (gdb_stderr, "\ndefaulting to linear scan\n");
nprobes = 0;
tmp = saved_bf_list;
@@ -926,7 +926,7 @@ get_bf_for_fcn (long the_function)
if (tmp->symnum_fcn == the_function)
{
if (global_remote_debug)
- fprintf (stderr, "Found in %d probes\n", nprobes);
+ fprintf_unfiltered (gdb_stderr, "Found in %d probes\n", nprobes);
current_head_bf_list = tmp->next;
return (tmp->symnum_bf);
}
diff --git a/gdb/fbsd-proc.c b/gdb/fbsd-proc.c
new file mode 100644
index 0000000..c68238d
--- /dev/null
+++ b/gdb/fbsd-proc.c
@@ -0,0 +1,173 @@
+/* FreeBSD-specific methods for using the /proc file system.
+ Copyright 2002 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "gdbcore.h"
+#include "inferior.h"
+
+#include <sys/procfs.h>
+#include <sys/types.h>
+
+#include "elf-bfd.h"
+
+#include "gregset.h"
+
+char *
+child_pid_to_exec_file (int pid)
+{
+ char *path;
+ char *buf;
+
+ xasprintf (&path, "/proc/%d/file", pid);
+ buf = xcalloc (MAXPATHLEN, sizeof (char));
+ make_cleanup (xfree, path);
+ make_cleanup (xfree, buf);
+
+ if (readlink (path, buf, MAXPATHLEN) > 0)
+ return buf;
+
+ return NULL;
+}
+
+static int
+read_mapping (FILE *mapfile,
+ unsigned long *start,
+ unsigned long *end,
+ char *protection)
+{
+ int resident, privateresident;
+ unsigned long obj;
+ int ref_count, shadow_count;
+ unsigned flags;
+ char cow[5], access[4];
+ char type[8];
+ int ret;
+
+ /* The layout is described in /usr/src/miscfs/procfs/procfs_map.c. */
+ ret = fscanf (mapfile, "%lx %lx %d %d %lx %s %d %d %x %s %s %s\n",
+ start, end,
+ &resident, &privateresident, &obj,
+ protection,
+ &ref_count, &shadow_count, &flags, cow, access, type);
+
+ return (ret != 0 && ret != EOF);
+}
+
+static int
+fbsd_find_memory_regions (int (*func) (CORE_ADDR,
+ unsigned long,
+ int, int, int,
+ void *),
+ void *obfd)
+{
+ pid_t pid = ptid_get_pid (inferior_ptid);
+ char *mapfilename;
+ FILE *mapfile;
+ unsigned long start, end, size;
+ char protection[4];
+ int read, write, exec;
+
+ xasprintf (&mapfilename, "/proc/%ld/map", (long) pid);
+ mapfile = fopen (mapfilename, "r");
+ if (mapfile == NULL)
+ error ("Couldn't open %s\n", mapfilename);
+
+ if (info_verbose)
+ fprintf_filtered (gdb_stdout,
+ "Reading memory regions from %s\n", mapfilename);
+
+ /* Now iterate until end-of-file. */
+ while (read_mapping (mapfile, &start, &end, &protection[0]))
+ {
+ size = end - start;
+
+ read = (strchr (protection, 'r') != 0);
+ write = (strchr (protection, 'w') != 0);
+ exec = (strchr (protection, 'x') != 0);
+
+ if (info_verbose)
+ {
+ fprintf_filtered (gdb_stdout,
+ "Save segment, %ld bytes at 0x%s (%c%c%c)\n",
+ size, paddr_nz (start),
+ read ? 'r' : '-',
+ write ? 'w' : '-',
+ exec ? 'x' : '-');
+ }
+
+ /* Invoke the callback function to create the corefile segment. */
+ func (start, size, read, write, exec, obfd);
+ }
+
+ fclose (mapfile);
+ return 0;
+}
+
+static char *
+fbsd_make_corefile_notes (bfd *obfd, int *note_size)
+{
+ gregset_t gregs;
+ fpregset_t fpregs;
+ char *note_data = NULL;
+
+ fill_gregset (&gregs, -1);
+ note_data = (char *) elfcore_write_prstatus (obfd,
+ note_data,
+ note_size,
+ ptid_get_pid (inferior_ptid),
+ stop_signal,
+ &gregs);
+
+ fill_fpregset (&fpregs, -1);
+ note_data = (char *) elfcore_write_prfpreg (obfd,
+ note_data,
+ note_size,
+ &fpregs,
+ sizeof (fpregs));
+
+ if (get_exec_file (0))
+ {
+ char *fname = strrchr (get_exec_file (0), '/') + 1;
+ char *psargs = xstrdup (fname);
+
+ if (get_inferior_args ())
+ psargs = reconcat (psargs, psargs, " ", get_inferior_args (), NULL);
+
+ note_data = (char *) elfcore_write_prpsinfo (obfd,
+ note_data,
+ note_size,
+ fname,
+ psargs);
+ }
+
+ make_cleanup (xfree, note_data);
+ return note_data;
+}
+
+
+void
+_initialize_fbsd_proc (void)
+{
+ extern void inftarg_set_find_memory_regions ();
+ extern void inftarg_set_make_corefile_notes ();
+
+ inftarg_set_find_memory_regions (fbsd_find_memory_regions);
+ inftarg_set_make_corefile_notes (fbsd_make_corefile_notes);
+}
diff --git a/gdb/findvar.c b/gdb/findvar.c
index 3a160a3..0f116ed 100644
--- a/gdb/findvar.c
+++ b/gdb/findvar.c
@@ -33,6 +33,7 @@
#include "floatformat.h"
#include "symfile.h" /* for overlay functions */
#include "regcache.h"
+#include "builtin-regs.h"
/* Basic byte-swapping routines. GDB has needed these for a long time...
All extract a target-format integer at ADDR which is LEN bytes long. */
@@ -56,7 +57,7 @@ extract_signed_integer (void *addr, int len)
if (len > (int) sizeof (LONGEST))
error ("\
That operation is not available on integers of more than %d bytes.",
- sizeof (LONGEST));
+ (int) sizeof (LONGEST));
/* Start at the most significant end of the integer, and work towards
the least significant. */
@@ -90,7 +91,7 @@ extract_unsigned_integer (void *addr, int len)
if (len > (int) sizeof (ULONGEST))
error ("\
That operation is not available on integers of more than %d bytes.",
- sizeof (ULONGEST));
+ (int) sizeof (ULONGEST));
/* Start at the most significant end of the integer, and work towards
the least significant. */
@@ -283,15 +284,15 @@ store_typed_address (void *buf, struct type *type, CORE_ADDR addr)
-/* Return a `value' with the contents of register REGNUM
- in its virtual format, with the type specified by
- REGISTER_VIRTUAL_TYPE.
+/* Return a `value' with the contents of (virtual or cooked) register
+ REGNUM as found in the specified FRAME. The register's type is
+ determined by REGISTER_VIRTUAL_TYPE.
- NOTE: returns NULL if register value is not available.
- Caller will check return value or die! */
+ NOTE: returns NULL if register value is not available. Caller will
+ check return value or die! */
struct value *
-value_of_register (int regnum)
+value_of_register (int regnum, struct frame_info *frame)
{
CORE_ADDR addr;
int optim;
@@ -299,8 +300,13 @@ value_of_register (int regnum)
char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
enum lval_type lval;
+ /* Builtin registers lie completly outside of the range of normal
+ registers. Catch them early so that the target never sees them. */
+ if (regnum >= NUM_REGS + NUM_PSEUDO_REGS)
+ return value_of_builtin_reg (regnum, selected_frame);
+
get_saved_register (raw_buffer, &optim, &addr,
- selected_frame, regnum, &lval);
+ frame, regnum, &lval);
if (register_cached (regnum) < 0)
return NULL; /* register value not available */
@@ -551,7 +557,7 @@ addresses have not been bound by the dynamic loader. Try again when executable i
if (frame == NULL)
return 0;
- b = get_frame_block (frame);
+ b = get_frame_block (frame, 0);
if (SYMBOL_CLASS (var) == LOC_REGPARM_ADDR)
{
diff --git a/gdb/frame.c b/gdb/frame.c
index ea59eba..2753150 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -1,6 +1,7 @@
/* Cache and manage the values of registers for GDB, the GNU debugger.
- Copyright 1986, 1987, 1989, 1991, 1994, 1995, 1996, 1998, 2000, 2001
- Free Software Foundation, Inc.
+
+ Copyright 1986, 1987, 1989, 1991, 1994, 1995, 1996, 1998, 2000,
+ 2001, 2002 Free Software Foundation, Inc.
This file is part of GDB.
@@ -42,39 +43,6 @@ find_saved_register (struct frame_info *frame, int regnum)
if (frame == NULL) /* No regs saved if want current frame */
return 0;
-#ifdef HAVE_REGISTER_WINDOWS
- /* We assume that a register in a register window will only be saved
- in one place (since the name changes and/or disappears as you go
- towards inner frames), so we only call get_frame_saved_regs on
- the current frame. This is directly in contradiction to the
- usage below, which assumes that registers used in a frame must be
- saved in a lower (more interior) frame. This change is a result
- of working on a register window machine; get_frame_saved_regs
- always returns the registers saved within a frame, within the
- context (register namespace) of that frame. */
-
- /* However, note that we don't want this to return anything if
- nothing is saved (if there's a frame inside of this one). Also,
- callers to this routine asking for the stack pointer want the
- stack pointer saved for *this* frame; this is returned from the
- next frame. */
-
- if (REGISTER_IN_WINDOW_P (regnum))
- {
- frame1 = get_next_frame (frame);
- if (!frame1)
- return 0; /* Registers of this frame are active. */
-
- /* Get the SP from the next frame in; it will be this
- current frame. */
- if (regnum != SP_REGNUM)
- frame1 = frame;
-
- FRAME_INIT_SAVED_REGS (frame1);
- return frame1->saved_regs[regnum]; /* ... which might be zero */
- }
-#endif /* HAVE_REGISTER_WINDOWS */
-
/* Note that this next routine assumes that registers used in
frame x will be saved only in the frame that x calls and
frames interior to it. This is not true on the sparc, but the
@@ -82,9 +50,10 @@ find_saved_register (struct frame_info *frame, int regnum)
while (1)
{
QUIT;
- frame1 = get_prev_frame (frame1);
- if (frame1 == 0 || frame1 == frame)
+ frame1 = get_next_frame (frame);
+ if (frame1 == 0)
break;
+ frame = frame1;
FRAME_INIT_SAVED_REGS (frame1);
if (frame1->saved_regs[regnum])
addr = frame1->saved_regs[regnum];
@@ -174,52 +143,26 @@ get_saved_register (char *raw_buffer,
GET_SAVED_REGISTER (raw_buffer, optimized, addrp, frame, regnum, lval);
}
-/* READ_RELATIVE_REGISTER_RAW_BYTES_FOR_FRAME
+/* frame_register_read ()
- Copy the bytes of register REGNUM, relative to the input stack frame,
- into our memory at MYADDR, in target byte order.
+ Find and return the value of REGNUM for the specified stack frame.
The number of bytes copied is REGISTER_RAW_SIZE (REGNUM).
- Returns 1 if could not be read, 0 if could. */
+ Returns 0 if the register value could not be found. */
-/* FIXME: This function increases the confusion between FP_REGNUM
- and the virtual/pseudo-frame pointer. */
-
-static int
-read_relative_register_raw_bytes_for_frame (int regnum,
- char *myaddr,
- struct frame_info *frame)
+int
+frame_register_read (struct frame_info *frame, int regnum, void *myaddr)
{
int optim;
- if (regnum == FP_REGNUM && frame)
- {
- /* Put it back in target format. */
- store_address (myaddr, REGISTER_RAW_SIZE (FP_REGNUM),
- (LONGEST) FRAME_FP (frame));
-
- return 0;
- }
-
get_saved_register (myaddr, &optim, (CORE_ADDR *) NULL, frame,
regnum, (enum lval_type *) NULL);
+ /* FIXME: cagney/2002-04-10: This test is just bogus. It is no
+ indication of the validity of the register. The value could
+ easily be found (on the stack) even though the corresponding
+ register isn't available. */
if (register_cached (regnum) < 0)
- return 1; /* register value not available */
-
- return optim;
-}
-
-/* READ_RELATIVE_REGISTER_RAW_BYTES
+ return 0; /* register value not available */
- Copy the bytes of register REGNUM, relative to the current stack
- frame, into our memory at MYADDR, in target byte order.
- The number of bytes copied is REGISTER_RAW_SIZE (REGNUM).
-
- Returns 1 if could not be read, 0 if could. */
-
-int
-read_relative_register_raw_bytes (int regnum, char *myaddr)
-{
- return read_relative_register_raw_bytes_for_frame (regnum, myaddr,
- selected_frame);
+ return !optim;
}
diff --git a/gdb/frame.h b/gdb/frame.h
index b5f535a..f0631b0 100644
--- a/gdb/frame.h
+++ b/gdb/frame.h
@@ -1,6 +1,7 @@
/* Definitions for dealing with stack frames, for GDB, the GNU debugger.
- Copyright 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1996, 1997,
- 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+ Copyright 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1996,
+ 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of GDB.
@@ -63,6 +64,17 @@ struct frame_info
For other frames, it is a pc saved in the next frame. */
CORE_ADDR pc;
+ /* Level of this frame. The inner-most (youngest) frame is at
+ level 0. As you move towards the outer-most (oldest) frame,
+ the level increases. This is a cached value. It could just as
+ easily be computed by counting back from the selected frame to
+ the inner most frame. */
+ /* NOTE: cagney/2002-04-05: Perhaphs a level of ``-1'' should be
+ reserved to indicate a bogus frame - one that has been created
+ just to keep GDB happy (GDB always needs a frame). For the
+ moment leave this as speculation. */
+ int level;
+
/* Nonzero if this is a frame associated with calling a signal handler.
Set by machine-dependent code. On some machines, if
@@ -148,6 +160,11 @@ extern void frame_saved_regs_zalloc (struct frame_info *);
#define FRAME_FP(fi) ((fi)->frame)
+/* Level of the frame: 0 for innermost, 1 for its caller, ...; or -1
+ for an invalid frame. */
+
+extern int frame_relative_level (struct frame_info *fi);
+
/* Define a default FRAME_CHAIN_VALID, in the form that is suitable for most
targets. If FRAME_CHAIN_VALID returns zero it means that the given frame
is the outermost one and has no caller.
@@ -172,8 +189,6 @@ extern struct frame_info *selected_frame;
0 for innermost, 1 for its caller, ...
or -1 for frame specified by address with no defined level. */
-extern int selected_frame_level;
-
extern struct frame_info *create_new_frame (CORE_ADDR, CORE_ADDR);
extern void flush_cached_frames (void);
@@ -196,11 +211,12 @@ extern struct frame_info *get_current_frame (void);
extern struct frame_info *get_next_frame (struct frame_info *);
-extern struct block *get_frame_block (struct frame_info *);
+extern struct block *get_frame_block (struct frame_info *,
+ CORE_ADDR *addr_in_block);
-extern struct block *get_current_block (void);
+extern struct block *get_current_block (CORE_ADDR *addr_in_block);
-extern struct block *get_selected_block (void);
+extern struct block *get_selected_block (CORE_ADDR *addr_in_block);
extern struct symbol *get_frame_function (struct frame_info *);
@@ -228,12 +244,10 @@ extern void print_only_stack_frame (struct frame_info *, int, int);
extern void show_stack_frame (struct frame_info *);
-extern void select_frame (struct frame_info *, int);
+extern void select_frame (struct frame_info *);
extern void record_selected_frame (CORE_ADDR *, int *);
-extern void select_and_print_frame (struct frame_info *, int);
-
extern void print_frame_info (struct frame_info *, int, int, int);
extern void show_frame_info (struct frame_info *, int, int, int);
@@ -264,9 +278,16 @@ extern void generic_get_saved_register (char *, int *, CORE_ADDR *,
struct frame_info *, int,
enum lval_type *);
+extern void generic_save_call_dummy_addr (CORE_ADDR lo, CORE_ADDR hi);
+
extern void get_saved_register (char *raw_buffer, int *optimized,
CORE_ADDR * addrp,
struct frame_info *frame,
int regnum, enum lval_type *lval);
+/* Return the register as found on the FRAME. Return zero if the
+ register could not be found. */
+extern int frame_register_read (struct frame_info *frame, int regnum,
+ void *buf);
+
#endif /* !defined (FRAME_H) */
diff --git a/gdb/gcore.c b/gdb/gcore.c
index 494efad..25d1ed7 100644
--- a/gdb/gcore.c
+++ b/gdb/gcore.c
@@ -269,7 +269,7 @@ default_derive_heap_segment (bfd *abfd, bfd_vma *bottom, bfd_vma *top)
for (sec = abfd->sections; sec; sec = sec->next)
{
if (bfd_get_section_flags (abfd, sec) & SEC_DATA ||
- strcmp (".bss", bfd_get_section_name (abfd, sec)) == 0)
+ strcmp (".bss", bfd_section_name (abfd, sec)) == 0)
{
sec_vaddr = bfd_get_section_vma (abfd, sec);
sec_size = bfd_get_section_size_before_reloc (sec);
@@ -278,8 +278,19 @@ default_derive_heap_segment (bfd *abfd, bfd_vma *bottom, bfd_vma *top)
}
}
/* Now get the top-of-heap by calling sbrk in the inferior. */
- if ((sbrk = find_function_in_inferior ("sbrk")) == NULL)
+ if (lookup_minimal_symbol ("sbrk", NULL, NULL) != NULL)
+ {
+ if ((sbrk = find_function_in_inferior ("sbrk")) == NULL)
+ return 0;
+ }
+ else if (lookup_minimal_symbol ("_sbrk", NULL, NULL) != NULL)
+ {
+ if ((sbrk = find_function_in_inferior ("_sbrk")) == NULL)
+ return 0;
+ }
+ else
return 0;
+
if ((zero = value_from_longest (builtin_type_int, (LONGEST) 0)) == NULL)
return 0;
if ((sbrk = call_function_by_hand (sbrk, 1, &zero)) == NULL)
@@ -314,7 +325,7 @@ make_output_phdrs (bfd *obfd, asection *osec, void *ignored)
int p_type;
/* FIXME: these constants may only be applicable for ELF. */
- if (strncmp (osec->name, "load", 4) == 0)
+ if (strncmp (bfd_section_name (obfd, osec), "load", 4) == 0)
p_type = PT_LOAD;
else
p_type = PT_NOTE;
@@ -452,7 +463,7 @@ gcore_copy_callback (bfd *obfd, asection *osec, void *ignored)
if (size == 0)
return; /* Read-only sections are marked as zero-size.
We don't have to copy their contents. */
- if (strncmp ("load", bfd_get_section_name (obfd, osec), 4) != 0)
+ if (strncmp ("load", bfd_section_name (obfd, osec), 4) != 0)
return; /* Only interested in "load" sections. */
if ((memhunk = xmalloc (size)) == NULL)
diff --git a/gdb/gdb-events.c b/gdb/gdb-events.c
index 0fbb3ba..ada30a3 100644
--- a/gdb/gdb-events.c
+++ b/gdb/gdb-events.c
@@ -1,5 +1,6 @@
/* User Interface Events.
- Copyright 1999, 2001 Free Software Foundation, Inc.
+
+ Copyright 1999, 2001, 2002 Free Software Foundation, Inc.
Contributed by Cygnus Solutions.
@@ -38,9 +39,6 @@
#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;
diff --git a/gdb/gdb-events.h b/gdb/gdb-events.h
index 18a4a20..5f7fc6b 100644
--- a/gdb/gdb-events.h
+++ b/gdb/gdb-events.h
@@ -1,5 +1,6 @@
/* User Interface Events.
- Copyright 1999, 2001 Free Software Foundation, Inc.
+
+ Copyright 1999, 2001, 2002 Free Software Foundation, Inc.
Contributed by Cygnus Solutions.
diff --git a/gdb/gdb-events.sh b/gdb/gdb-events.sh
index eb73465..9965f05 100755
--- a/gdb/gdb-events.sh
+++ b/gdb/gdb-events.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# User Interface Events.
-# Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
+# Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
#
# Contributed by Cygnus Solutions.
#
@@ -113,7 +113,8 @@ copyright ()
{
cat <<EOF
/* User Interface Events.
- Copyright 1999, 2001 Free Software Foundation, Inc.
+
+ Copyright 1999, 2001, 2002 Free Software Foundation, Inc.
Contributed by Cygnus Solutions.
@@ -303,9 +304,6 @@ cat <<EOF
#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;
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 5aad461..ce4540d 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -74,13 +74,6 @@ 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
@@ -148,7 +141,6 @@ struct gdbarch
gdbarch_read_pc_ftype *read_pc;
gdbarch_write_pc_ftype *write_pc;
gdbarch_read_fp_ftype *read_fp;
- gdbarch_write_fp_ftype *write_fp;
gdbarch_read_sp_ftype *read_sp;
gdbarch_write_sp_ftype *write_sp;
gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer;
@@ -159,6 +151,7 @@ struct gdbarch
int sp_regnum;
int fp_regnum;
int pc_regnum;
+ int ps_regnum;
int fp0_regnum;
int npc_regnum;
int nnpc_regnum;
@@ -257,6 +250,7 @@ struct gdbarch
gdbarch_print_insn_ftype *print_insn;
gdbarch_skip_trampoline_code_ftype *skip_trampoline_code;
gdbarch_in_solib_call_trampoline_ftype *in_solib_call_trampoline;
+ gdbarch_pc_in_sigtramp_ftype *pc_in_sigtramp;
gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p;
gdbarch_construct_inferior_arguments_ftype *construct_inferior_arguments;
gdbarch_dwarf2_build_frame_info_ftype *dwarf2_build_frame_info;
@@ -301,10 +295,10 @@ struct gdbarch startup_gdbarch =
0,
0,
0,
- 0,
- 0,
- 0,
- 0,
+ -1,
+ -1,
+ -1,
+ -1,
0,
0,
0,
@@ -403,6 +397,7 @@ struct gdbarch startup_gdbarch =
0,
0,
0,
+ 0,
generic_in_function_epilogue_p,
construct_inferior_arguments,
0,
@@ -419,6 +414,7 @@ void
initialize_non_multiarch ()
{
alloc_gdbarch_data (&startup_gdbarch);
+ init_gdbarch_swap (&startup_gdbarch);
init_gdbarch_data (&startup_gdbarch);
}
@@ -460,7 +456,6 @@ gdbarch_alloc (const struct gdbarch_info *info,
current_gdbarch->read_pc = generic_target_read_pc;
current_gdbarch->write_pc = generic_target_write_pc;
current_gdbarch->read_fp = generic_target_read_fp;
- current_gdbarch->write_fp = generic_target_write_fp;
current_gdbarch->read_sp = generic_target_read_sp;
current_gdbarch->write_sp = generic_target_write_sp;
current_gdbarch->virtual_frame_pointer = legacy_virtual_frame_pointer;
@@ -468,6 +463,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
current_gdbarch->sp_regnum = -1;
current_gdbarch->fp_regnum = -1;
current_gdbarch->pc_regnum = -1;
+ current_gdbarch->ps_regnum = -1;
current_gdbarch->fp0_regnum = -1;
current_gdbarch->npc_regnum = -1;
current_gdbarch->nnpc_regnum = -1;
@@ -522,6 +518,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
current_gdbarch->print_insn = legacy_print_insn;
current_gdbarch->skip_trampoline_code = generic_skip_trampoline_code;
current_gdbarch->in_solib_call_trampoline = generic_in_solib_call_trampoline;
+ current_gdbarch->pc_in_sigtramp = legacy_pc_in_sigtramp;
current_gdbarch->in_function_epilogue_p = generic_in_function_epilogue_p;
current_gdbarch->construct_inferior_arguments = construct_inferior_arguments;
current_gdbarch->elf_make_msymbol_special = default_elf_make_msymbol_special;
@@ -583,7 +580,6 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* Skip verify of read_pc, invalid_p == 0 */
/* Skip verify of write_pc, invalid_p == 0 */
/* Skip verify of read_fp, invalid_p == 0 */
- /* Skip verify of write_fp, invalid_p == 0 */
/* Skip verify of read_sp, invalid_p == 0 */
/* Skip verify of write_sp, invalid_p == 0 */
/* Skip verify of virtual_frame_pointer, invalid_p == 0 */
@@ -593,15 +589,10 @@ verify_gdbarch (struct gdbarch *gdbarch)
&& (gdbarch->num_regs == -1))
fprintf_unfiltered (log, "\n\tnum_regs");
/* Skip verify of num_pseudo_regs, invalid_p == 0 */
- if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
- && (gdbarch->sp_regnum == -1))
- fprintf_unfiltered (log, "\n\tsp_regnum");
- if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
- && (gdbarch->fp_regnum == -1))
- fprintf_unfiltered (log, "\n\tfp_regnum");
- if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
- && (gdbarch->pc_regnum == -1))
- fprintf_unfiltered (log, "\n\tpc_regnum");
+ /* Skip verify of sp_regnum, invalid_p == 0 */
+ /* Skip verify of fp_regnum, invalid_p == 0 */
+ /* Skip verify of pc_regnum, invalid_p == 0 */
+ /* Skip verify of ps_regnum, invalid_p == 0 */
/* Skip verify of fp0_regnum, invalid_p == 0 */
/* Skip verify of npc_regnum, invalid_p == 0 */
/* Skip verify of nnpc_regnum, invalid_p == 0 */
@@ -776,6 +767,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* Skip verify of print_insn, invalid_p == 0 */
/* Skip verify of skip_trampoline_code, invalid_p == 0 */
/* Skip verify of in_solib_call_trampoline, invalid_p == 0 */
+ /* Skip verify of pc_in_sigtramp, invalid_p == 0 */
/* Skip verify of in_function_epilogue_p, invalid_p == 0 */
/* Skip verify of construct_inferior_arguments, invalid_p == 0 */
/* Skip verify of dwarf2_build_frame_info, has predicate */
@@ -1473,6 +1465,17 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->pc_in_call_dummy
/*PC_IN_CALL_DUMMY ()*/);
#endif
+#ifdef PC_IN_SIGTRAMP
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "PC_IN_SIGTRAMP(pc, name)",
+ XSTRING (PC_IN_SIGTRAMP (pc, name)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: PC_IN_SIGTRAMP = 0x%08lx\n",
+ (long) current_gdbarch->pc_in_sigtramp
+ /*PC_IN_SIGTRAMP ()*/);
+#endif
#ifdef PC_REGNUM
fprintf_unfiltered (file,
"gdbarch_dump: PC_REGNUM # %s\n",
@@ -1542,6 +1545,14 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->prologue_frameless_p
/*PROLOGUE_FRAMELESS_P ()*/);
#endif
+#ifdef PS_REGNUM
+ fprintf_unfiltered (file,
+ "gdbarch_dump: PS_REGNUM # %s\n",
+ XSTRING (PS_REGNUM));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: PS_REGNUM = %d\n",
+ PS_REGNUM);
+#endif
#ifdef PUSH_ARGUMENTS
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
@@ -2096,20 +2107,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->virtual_frame_pointer
/*TARGET_VIRTUAL_FRAME_POINTER ()*/);
#endif
-#ifdef TARGET_WRITE_FP
-#if GDB_MULTI_ARCH
- /* Macro might contain `[{}]' when not multi-arch */
- fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "TARGET_WRITE_FP(val)",
- XSTRING (TARGET_WRITE_FP (val)));
-#endif
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: TARGET_WRITE_FP = 0x%08lx\n",
- (long) current_gdbarch->write_fp
- /*TARGET_WRITE_FP ()*/);
-#endif
#ifdef TARGET_WRITE_PC
#if GDB_MULTI_ARCH
/* Macro might contain `[{}]' when not multi-arch */
@@ -2173,6 +2170,7 @@ gdbarch_tdep (struct gdbarch *gdbarch)
const struct bfd_arch_info *
gdbarch_bfd_arch_info (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_arch_info called\n");
return gdbarch->bfd_arch_info;
@@ -2181,6 +2179,7 @@ gdbarch_bfd_arch_info (struct gdbarch *gdbarch)
int
gdbarch_byte_order (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_byte_order called\n");
return gdbarch->byte_order;
@@ -2189,6 +2188,7 @@ gdbarch_byte_order (struct gdbarch *gdbarch)
int
gdbarch_short_bit (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
/* Skip verify of short_bit, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_short_bit called\n");
@@ -2205,6 +2205,7 @@ set_gdbarch_short_bit (struct gdbarch *gdbarch,
int
gdbarch_int_bit (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
/* Skip verify of int_bit, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_int_bit called\n");
@@ -2221,6 +2222,7 @@ set_gdbarch_int_bit (struct gdbarch *gdbarch,
int
gdbarch_long_bit (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
/* Skip verify of long_bit, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_long_bit called\n");
@@ -2237,6 +2239,7 @@ set_gdbarch_long_bit (struct gdbarch *gdbarch,
int
gdbarch_long_long_bit (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
/* Skip verify of long_long_bit, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_bit called\n");
@@ -2253,6 +2256,7 @@ set_gdbarch_long_long_bit (struct gdbarch *gdbarch,
int
gdbarch_float_bit (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
/* Skip verify of float_bit, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_float_bit called\n");
@@ -2269,6 +2273,7 @@ set_gdbarch_float_bit (struct gdbarch *gdbarch,
int
gdbarch_double_bit (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
/* Skip verify of double_bit, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_double_bit called\n");
@@ -2285,6 +2290,7 @@ set_gdbarch_double_bit (struct gdbarch *gdbarch,
int
gdbarch_long_double_bit (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
/* Skip verify of long_double_bit, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_bit called\n");
@@ -2301,6 +2307,7 @@ set_gdbarch_long_double_bit (struct gdbarch *gdbarch,
int
gdbarch_ptr_bit (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
/* Skip verify of ptr_bit, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_ptr_bit called\n");
@@ -2317,6 +2324,7 @@ set_gdbarch_ptr_bit (struct gdbarch *gdbarch,
int
gdbarch_addr_bit (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->addr_bit == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_addr_bit invalid");
@@ -2335,6 +2343,7 @@ set_gdbarch_addr_bit (struct gdbarch *gdbarch,
int
gdbarch_bfd_vma_bit (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
/* Skip verify of bfd_vma_bit, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_vma_bit called\n");
@@ -2351,6 +2360,7 @@ set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch,
int
gdbarch_char_signed (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->char_signed == -1)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_char_signed invalid");
@@ -2369,6 +2379,7 @@ set_gdbarch_char_signed (struct gdbarch *gdbarch,
CORE_ADDR
gdbarch_read_pc (struct gdbarch *gdbarch, ptid_t ptid)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->read_pc == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_read_pc invalid");
@@ -2387,6 +2398,7 @@ set_gdbarch_read_pc (struct gdbarch *gdbarch,
void
gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, ptid_t ptid)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->write_pc == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_write_pc invalid");
@@ -2405,6 +2417,7 @@ set_gdbarch_write_pc (struct gdbarch *gdbarch,
CORE_ADDR
gdbarch_read_fp (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->read_fp == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_read_fp invalid");
@@ -2420,27 +2433,10 @@ set_gdbarch_read_fp (struct gdbarch *gdbarch,
gdbarch->read_fp = read_fp;
}
-void
-gdbarch_write_fp (struct gdbarch *gdbarch, CORE_ADDR val)
-{
- if (gdbarch->write_fp == 0)
- internal_error (__FILE__, __LINE__,
- "gdbarch: gdbarch_write_fp invalid");
- if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_write_fp called\n");
- gdbarch->write_fp (val);
-}
-
-void
-set_gdbarch_write_fp (struct gdbarch *gdbarch,
- gdbarch_write_fp_ftype write_fp)
-{
- gdbarch->write_fp = write_fp;
-}
-
CORE_ADDR
gdbarch_read_sp (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->read_sp == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_read_sp invalid");
@@ -2459,6 +2455,7 @@ set_gdbarch_read_sp (struct gdbarch *gdbarch,
void
gdbarch_write_sp (struct gdbarch *gdbarch, CORE_ADDR val)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->write_sp == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_write_sp invalid");
@@ -2477,6 +2474,7 @@ set_gdbarch_write_sp (struct gdbarch *gdbarch,
void
gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->virtual_frame_pointer == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_virtual_frame_pointer invalid");
@@ -2495,12 +2493,14 @@ set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch,
int
gdbarch_register_read_p (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
return gdbarch->register_read != 0;
}
void
gdbarch_register_read (struct gdbarch *gdbarch, int regnum, char *buf)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->register_read == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_register_read invalid");
@@ -2519,12 +2519,14 @@ set_gdbarch_register_read (struct gdbarch *gdbarch,
int
gdbarch_register_write_p (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
return gdbarch->register_write != 0;
}
void
gdbarch_register_write (struct gdbarch *gdbarch, int regnum, char *buf)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->register_write == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_register_write invalid");
@@ -2543,6 +2545,7 @@ set_gdbarch_register_write (struct gdbarch *gdbarch,
int
gdbarch_num_regs (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->num_regs == -1)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_num_regs invalid");
@@ -2561,6 +2564,7 @@ set_gdbarch_num_regs (struct gdbarch *gdbarch,
int
gdbarch_num_pseudo_regs (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
/* Skip verify of num_pseudo_regs, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_num_pseudo_regs called\n");
@@ -2577,9 +2581,8 @@ set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch,
int
gdbarch_sp_regnum (struct gdbarch *gdbarch)
{
- if (gdbarch->sp_regnum == -1)
- internal_error (__FILE__, __LINE__,
- "gdbarch: gdbarch_sp_regnum invalid");
+ gdb_assert (gdbarch != NULL);
+ /* Skip verify of sp_regnum, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_sp_regnum called\n");
return gdbarch->sp_regnum;
@@ -2595,9 +2598,8 @@ set_gdbarch_sp_regnum (struct gdbarch *gdbarch,
int
gdbarch_fp_regnum (struct gdbarch *gdbarch)
{
- if (gdbarch->fp_regnum == -1)
- internal_error (__FILE__, __LINE__,
- "gdbarch: gdbarch_fp_regnum invalid");
+ gdb_assert (gdbarch != NULL);
+ /* Skip verify of fp_regnum, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_fp_regnum called\n");
return gdbarch->fp_regnum;
@@ -2613,9 +2615,8 @@ set_gdbarch_fp_regnum (struct gdbarch *gdbarch,
int
gdbarch_pc_regnum (struct gdbarch *gdbarch)
{
- if (gdbarch->pc_regnum == -1)
- internal_error (__FILE__, __LINE__,
- "gdbarch: gdbarch_pc_regnum invalid");
+ gdb_assert (gdbarch != NULL);
+ /* Skip verify of pc_regnum, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_regnum called\n");
return gdbarch->pc_regnum;
@@ -2629,8 +2630,26 @@ set_gdbarch_pc_regnum (struct gdbarch *gdbarch,
}
int
+gdbarch_ps_regnum (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ /* Skip verify of ps_regnum, invalid_p == 0 */
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_ps_regnum called\n");
+ return gdbarch->ps_regnum;
+}
+
+void
+set_gdbarch_ps_regnum (struct gdbarch *gdbarch,
+ int ps_regnum)
+{
+ gdbarch->ps_regnum = ps_regnum;
+}
+
+int
gdbarch_fp0_regnum (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
/* Skip verify of fp0_regnum, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_fp0_regnum called\n");
@@ -2647,6 +2666,7 @@ set_gdbarch_fp0_regnum (struct gdbarch *gdbarch,
int
gdbarch_npc_regnum (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
/* Skip verify of npc_regnum, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_npc_regnum called\n");
@@ -2663,6 +2683,7 @@ set_gdbarch_npc_regnum (struct gdbarch *gdbarch,
int
gdbarch_nnpc_regnum (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
/* Skip verify of nnpc_regnum, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_nnpc_regnum called\n");
@@ -2679,6 +2700,7 @@ set_gdbarch_nnpc_regnum (struct gdbarch *gdbarch,
int
gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->stab_reg_to_regnum == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_stab_reg_to_regnum invalid");
@@ -2697,6 +2719,7 @@ set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch,
int
gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->ecoff_reg_to_regnum == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_ecoff_reg_to_regnum invalid");
@@ -2715,6 +2738,7 @@ set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch,
int
gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dwarf_regnr)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->dwarf_reg_to_regnum == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_dwarf_reg_to_regnum invalid");
@@ -2733,6 +2757,7 @@ set_gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch,
int
gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->sdb_reg_to_regnum == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_sdb_reg_to_regnum invalid");
@@ -2751,6 +2776,7 @@ set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch,
int
gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->dwarf2_reg_to_regnum == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_dwarf2_reg_to_regnum invalid");
@@ -2769,6 +2795,7 @@ set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch,
char *
gdbarch_register_name (struct gdbarch *gdbarch, int regnr)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->register_name == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_register_name invalid");
@@ -2787,6 +2814,7 @@ set_gdbarch_register_name (struct gdbarch *gdbarch,
int
gdbarch_register_size (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->register_size == -1)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_register_size invalid");
@@ -2805,6 +2833,7 @@ set_gdbarch_register_size (struct gdbarch *gdbarch,
int
gdbarch_register_bytes (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->register_bytes == -1)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_register_bytes invalid");
@@ -2823,6 +2852,7 @@ set_gdbarch_register_bytes (struct gdbarch *gdbarch,
int
gdbarch_register_byte (struct gdbarch *gdbarch, int reg_nr)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->register_byte == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_register_byte invalid");
@@ -2841,6 +2871,7 @@ set_gdbarch_register_byte (struct gdbarch *gdbarch,
int
gdbarch_register_raw_size (struct gdbarch *gdbarch, int reg_nr)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->register_raw_size == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_register_raw_size invalid");
@@ -2859,6 +2890,7 @@ set_gdbarch_register_raw_size (struct gdbarch *gdbarch,
int
gdbarch_max_register_raw_size (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->max_register_raw_size == -1)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_max_register_raw_size invalid");
@@ -2877,6 +2909,7 @@ set_gdbarch_max_register_raw_size (struct gdbarch *gdbarch,
int
gdbarch_register_virtual_size (struct gdbarch *gdbarch, int reg_nr)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->register_virtual_size == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_register_virtual_size invalid");
@@ -2895,6 +2928,7 @@ set_gdbarch_register_virtual_size (struct gdbarch *gdbarch,
int
gdbarch_max_register_virtual_size (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->max_register_virtual_size == -1)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_max_register_virtual_size invalid");
@@ -2913,6 +2947,7 @@ set_gdbarch_max_register_virtual_size (struct gdbarch *gdbarch,
struct type *
gdbarch_register_virtual_type (struct gdbarch *gdbarch, int reg_nr)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->register_virtual_type == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_register_virtual_type invalid");
@@ -2931,6 +2966,7 @@ set_gdbarch_register_virtual_type (struct gdbarch *gdbarch,
void
gdbarch_do_registers_info (struct gdbarch *gdbarch, int reg_nr, int fpregs)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->do_registers_info == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_do_registers_info invalid");
@@ -2949,6 +2985,7 @@ set_gdbarch_do_registers_info (struct gdbarch *gdbarch,
void
gdbarch_print_float_info (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->print_float_info == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_print_float_info invalid");
@@ -2967,6 +3004,7 @@ set_gdbarch_print_float_info (struct gdbarch *gdbarch,
int
gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->register_sim_regno == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_register_sim_regno invalid");
@@ -2985,12 +3023,14 @@ set_gdbarch_register_sim_regno (struct gdbarch *gdbarch,
int
gdbarch_register_bytes_ok_p (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
return gdbarch->register_bytes_ok != 0;
}
int
gdbarch_register_bytes_ok (struct gdbarch *gdbarch, long nr_bytes)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->register_bytes_ok == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_register_bytes_ok invalid");
@@ -3009,6 +3049,7 @@ set_gdbarch_register_bytes_ok (struct gdbarch *gdbarch,
int
gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->cannot_fetch_register == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_cannot_fetch_register invalid");
@@ -3027,6 +3068,7 @@ set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch,
int
gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->cannot_store_register == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_cannot_store_register invalid");
@@ -3045,12 +3087,14 @@ set_gdbarch_cannot_store_register (struct gdbarch *gdbarch,
int
gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
return gdbarch->get_longjmp_target != 0;
}
int
gdbarch_get_longjmp_target (struct gdbarch *gdbarch, CORE_ADDR *pc)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->get_longjmp_target == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_get_longjmp_target invalid");
@@ -3069,6 +3113,7 @@ set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch,
int
gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->use_generic_dummy_frames == -1)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_use_generic_dummy_frames invalid");
@@ -3087,6 +3132,7 @@ set_gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch,
int
gdbarch_call_dummy_location (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->call_dummy_location == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_call_dummy_location invalid");
@@ -3105,6 +3151,7 @@ set_gdbarch_call_dummy_location (struct gdbarch *gdbarch,
CORE_ADDR
gdbarch_call_dummy_address (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->call_dummy_address == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_call_dummy_address invalid");
@@ -3123,6 +3170,7 @@ set_gdbarch_call_dummy_address (struct gdbarch *gdbarch,
CORE_ADDR
gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->call_dummy_start_offset == -1)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_call_dummy_start_offset invalid");
@@ -3141,6 +3189,7 @@ set_gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch,
CORE_ADDR
gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->call_dummy_breakpoint_offset_p && gdbarch->call_dummy_breakpoint_offset == -1)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_call_dummy_breakpoint_offset invalid");
@@ -3159,6 +3208,7 @@ set_gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch,
int
gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->call_dummy_breakpoint_offset_p == -1)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_call_dummy_breakpoint_offset_p invalid");
@@ -3177,6 +3227,7 @@ set_gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch,
int
gdbarch_call_dummy_length (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->call_dummy_length == -1)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_call_dummy_length invalid");
@@ -3195,6 +3246,7 @@ set_gdbarch_call_dummy_length (struct gdbarch *gdbarch,
int
gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->pc_in_call_dummy == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_pc_in_call_dummy invalid");
@@ -3213,6 +3265,7 @@ set_gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch,
int
gdbarch_call_dummy_p (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->call_dummy_p == -1)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_call_dummy_p invalid");
@@ -3231,6 +3284,7 @@ set_gdbarch_call_dummy_p (struct gdbarch *gdbarch,
LONGEST *
gdbarch_call_dummy_words (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
/* Skip verify of call_dummy_words, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_words called\n");
@@ -3247,6 +3301,7 @@ set_gdbarch_call_dummy_words (struct gdbarch *gdbarch,
int
gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
/* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_sizeof_call_dummy_words called\n");
@@ -3263,6 +3318,7 @@ set_gdbarch_sizeof_call_dummy_words (struct gdbarch *gdbarch,
int
gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->call_dummy_stack_adjust_p == -1)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_call_dummy_stack_adjust_p invalid");
@@ -3281,6 +3337,7 @@ set_gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch,
int
gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_call_dummy_stack_adjust invalid");
@@ -3299,6 +3356,7 @@ set_gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch,
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)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->fix_call_dummy == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_fix_call_dummy invalid");
@@ -3317,6 +3375,7 @@ set_gdbarch_fix_call_dummy (struct gdbarch *gdbarch,
void
gdbarch_init_frame_pc_first (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->init_frame_pc_first == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_init_frame_pc_first invalid");
@@ -3335,6 +3394,7 @@ set_gdbarch_init_frame_pc_first (struct gdbarch *gdbarch,
void
gdbarch_init_frame_pc (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->init_frame_pc == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_init_frame_pc invalid");
@@ -3353,6 +3413,7 @@ set_gdbarch_init_frame_pc (struct gdbarch *gdbarch,
int
gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion called\n");
return gdbarch->believe_pcc_promotion;
@@ -3368,6 +3429,7 @@ set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch,
int
gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion_type called\n");
return gdbarch->believe_pcc_promotion_type;
@@ -3383,6 +3445,7 @@ set_gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch,
int
gdbarch_coerce_float_to_double (struct gdbarch *gdbarch, struct type *formal, struct type *actual)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->coerce_float_to_double == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_coerce_float_to_double invalid");
@@ -3401,6 +3464,7 @@ set_gdbarch_coerce_float_to_double (struct gdbarch *gdbarch,
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)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->get_saved_register == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_get_saved_register invalid");
@@ -3419,6 +3483,7 @@ set_gdbarch_get_saved_register (struct gdbarch *gdbarch,
int
gdbarch_register_convertible (struct gdbarch *gdbarch, int nr)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->register_convertible == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_register_convertible invalid");
@@ -3437,6 +3502,7 @@ set_gdbarch_register_convertible (struct gdbarch *gdbarch,
void
gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->register_convert_to_virtual == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_register_convert_to_virtual invalid");
@@ -3455,6 +3521,7 @@ set_gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch,
void
gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, struct type *type, int regnum, char *from, char *to)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->register_convert_to_raw == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_register_convert_to_raw invalid");
@@ -3473,12 +3540,14 @@ set_gdbarch_register_convert_to_raw (struct gdbarch *gdbarch,
int
gdbarch_fetch_pseudo_register_p (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
return gdbarch->fetch_pseudo_register != 0;
}
void
gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch, int regnum)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->fetch_pseudo_register == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_fetch_pseudo_register invalid");
@@ -3497,12 +3566,14 @@ set_gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch,
int
gdbarch_store_pseudo_register_p (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
return gdbarch->store_pseudo_register != 0;
}
void
gdbarch_store_pseudo_register (struct gdbarch *gdbarch, int regnum)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->store_pseudo_register == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_store_pseudo_register invalid");
@@ -3521,6 +3592,7 @@ set_gdbarch_store_pseudo_register (struct gdbarch *gdbarch,
CORE_ADDR
gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->pointer_to_address == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_pointer_to_address invalid");
@@ -3539,6 +3611,7 @@ set_gdbarch_pointer_to_address (struct gdbarch *gdbarch,
void
gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, void *buf, CORE_ADDR addr)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->address_to_pointer == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_address_to_pointer invalid");
@@ -3557,12 +3630,14 @@ set_gdbarch_address_to_pointer (struct gdbarch *gdbarch,
int
gdbarch_integer_to_address_p (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
return gdbarch->integer_to_address != 0;
}
CORE_ADDR
gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->integer_to_address == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_integer_to_address invalid");
@@ -3581,6 +3656,7 @@ set_gdbarch_integer_to_address (struct gdbarch *gdbarch,
int
gdbarch_return_value_on_stack (struct gdbarch *gdbarch, struct type *type)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->return_value_on_stack == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_return_value_on_stack invalid");
@@ -3599,6 +3675,7 @@ set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch,
void
gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->extract_return_value == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_extract_return_value invalid");
@@ -3617,6 +3694,7 @@ set_gdbarch_extract_return_value (struct gdbarch *gdbarch,
CORE_ADDR
gdbarch_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->push_arguments == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_push_arguments invalid");
@@ -3635,6 +3713,7 @@ set_gdbarch_push_arguments (struct gdbarch *gdbarch,
void
gdbarch_push_dummy_frame (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->push_dummy_frame == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_push_dummy_frame invalid");
@@ -3653,12 +3732,14 @@ set_gdbarch_push_dummy_frame (struct gdbarch *gdbarch,
int
gdbarch_push_return_address_p (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
return gdbarch->push_return_address != 0;
}
CORE_ADDR
gdbarch_push_return_address (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->push_return_address == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_push_return_address invalid");
@@ -3677,6 +3758,7 @@ set_gdbarch_push_return_address (struct gdbarch *gdbarch,
void
gdbarch_pop_frame (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->pop_frame == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_pop_frame invalid");
@@ -3695,6 +3777,7 @@ set_gdbarch_pop_frame (struct gdbarch *gdbarch,
void
gdbarch_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->store_struct_return == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_store_struct_return invalid");
@@ -3713,6 +3796,7 @@ set_gdbarch_store_struct_return (struct gdbarch *gdbarch,
void
gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->store_return_value == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_store_return_value invalid");
@@ -3731,12 +3815,14 @@ set_gdbarch_store_return_value (struct gdbarch *gdbarch,
int
gdbarch_extract_struct_value_address_p (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
return gdbarch->extract_struct_value_address != 0;
}
CORE_ADDR
gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->extract_struct_value_address == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_extract_struct_value_address invalid");
@@ -3755,6 +3841,7 @@ set_gdbarch_extract_struct_value_address (struct gdbarch *gdbarch,
int
gdbarch_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->use_struct_convention == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_use_struct_convention invalid");
@@ -3773,6 +3860,7 @@ set_gdbarch_use_struct_convention (struct gdbarch *gdbarch,
void
gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, struct frame_info *frame)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->frame_init_saved_regs == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_frame_init_saved_regs invalid");
@@ -3791,12 +3879,14 @@ set_gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch,
int
gdbarch_init_extra_frame_info_p (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
return gdbarch->init_extra_frame_info != 0;
}
void
gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, int fromleaf, struct frame_info *frame)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->init_extra_frame_info == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_init_extra_frame_info invalid");
@@ -3815,6 +3905,7 @@ set_gdbarch_init_extra_frame_info (struct gdbarch *gdbarch,
CORE_ADDR
gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->skip_prologue == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_skip_prologue invalid");
@@ -3833,6 +3924,7 @@ set_gdbarch_skip_prologue (struct gdbarch *gdbarch,
int
gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, CORE_ADDR ip)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->prologue_frameless_p == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_prologue_frameless_p invalid");
@@ -3851,6 +3943,7 @@ set_gdbarch_prologue_frameless_p (struct gdbarch *gdbarch,
int
gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->inner_than == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_inner_than invalid");
@@ -3866,9 +3959,10 @@ set_gdbarch_inner_than (struct gdbarch *gdbarch,
gdbarch->inner_than = inner_than;
}
-unsigned char *
+const unsigned char *
gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->breakpoint_from_pc == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_breakpoint_from_pc invalid");
@@ -3887,6 +3981,7 @@ set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch,
int
gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->memory_insert_breakpoint == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_memory_insert_breakpoint invalid");
@@ -3905,6 +4000,7 @@ set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch,
int
gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->memory_remove_breakpoint == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_memory_remove_breakpoint invalid");
@@ -3923,6 +4019,7 @@ set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch,
CORE_ADDR
gdbarch_decr_pc_after_break (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->decr_pc_after_break == -1)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_decr_pc_after_break invalid");
@@ -3941,6 +4038,7 @@ set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch,
int
gdbarch_prepare_to_proceed (struct gdbarch *gdbarch, int select_it)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->prepare_to_proceed == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_prepare_to_proceed invalid");
@@ -3959,6 +4057,7 @@ set_gdbarch_prepare_to_proceed (struct gdbarch *gdbarch,
CORE_ADDR
gdbarch_function_start_offset (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->function_start_offset == -1)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_function_start_offset invalid");
@@ -3977,6 +4076,7 @@ set_gdbarch_function_start_offset (struct gdbarch *gdbarch,
void
gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->remote_translate_xfer_address == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_remote_translate_xfer_address invalid");
@@ -3995,6 +4095,7 @@ set_gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch,
CORE_ADDR
gdbarch_frame_args_skip (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->frame_args_skip == -1)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_frame_args_skip invalid");
@@ -4013,6 +4114,7 @@ set_gdbarch_frame_args_skip (struct gdbarch *gdbarch,
int
gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, struct frame_info *fi)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->frameless_function_invocation == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_frameless_function_invocation invalid");
@@ -4031,6 +4133,7 @@ set_gdbarch_frameless_function_invocation (struct gdbarch *gdbarch,
CORE_ADDR
gdbarch_frame_chain (struct gdbarch *gdbarch, struct frame_info *frame)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->frame_chain == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_frame_chain invalid");
@@ -4049,6 +4152,7 @@ set_gdbarch_frame_chain (struct gdbarch *gdbarch,
int
gdbarch_frame_chain_valid (struct gdbarch *gdbarch, CORE_ADDR chain, struct frame_info *thisframe)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->frame_chain_valid == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_frame_chain_valid invalid");
@@ -4067,6 +4171,7 @@ set_gdbarch_frame_chain_valid (struct gdbarch *gdbarch,
CORE_ADDR
gdbarch_frame_saved_pc (struct gdbarch *gdbarch, struct frame_info *fi)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->frame_saved_pc == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_frame_saved_pc invalid");
@@ -4085,6 +4190,7 @@ set_gdbarch_frame_saved_pc (struct gdbarch *gdbarch,
CORE_ADDR
gdbarch_frame_args_address (struct gdbarch *gdbarch, struct frame_info *fi)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->frame_args_address == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_frame_args_address invalid");
@@ -4103,6 +4209,7 @@ set_gdbarch_frame_args_address (struct gdbarch *gdbarch,
CORE_ADDR
gdbarch_frame_locals_address (struct gdbarch *gdbarch, struct frame_info *fi)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->frame_locals_address == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_frame_locals_address invalid");
@@ -4121,6 +4228,7 @@ set_gdbarch_frame_locals_address (struct gdbarch *gdbarch,
CORE_ADDR
gdbarch_saved_pc_after_call (struct gdbarch *gdbarch, struct frame_info *frame)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->saved_pc_after_call == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_saved_pc_after_call invalid");
@@ -4139,6 +4247,7 @@ set_gdbarch_saved_pc_after_call (struct gdbarch *gdbarch,
int
gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->frame_num_args == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_frame_num_args invalid");
@@ -4157,12 +4266,14 @@ set_gdbarch_frame_num_args (struct gdbarch *gdbarch,
int
gdbarch_stack_align_p (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
return gdbarch->stack_align != 0;
}
CORE_ADDR
gdbarch_stack_align (struct gdbarch *gdbarch, CORE_ADDR sp)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->stack_align == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_stack_align invalid");
@@ -4181,6 +4292,7 @@ set_gdbarch_stack_align (struct gdbarch *gdbarch,
int
gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
/* Skip verify of extra_stack_alignment_needed, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_extra_stack_alignment_needed called\n");
@@ -4197,12 +4309,14 @@ set_gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch,
int
gdbarch_reg_struct_has_addr_p (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
return gdbarch->reg_struct_has_addr != 0;
}
int
gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->reg_struct_has_addr == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_reg_struct_has_addr invalid");
@@ -4221,12 +4335,14 @@ set_gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch,
int
gdbarch_save_dummy_frame_tos_p (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
return gdbarch->save_dummy_frame_tos != 0;
}
void
gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, CORE_ADDR sp)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->save_dummy_frame_tos == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_save_dummy_frame_tos invalid");
@@ -4245,6 +4361,7 @@ set_gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch,
int
gdbarch_parm_boundary (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_parm_boundary called\n");
return gdbarch->parm_boundary;
@@ -4260,6 +4377,7 @@ set_gdbarch_parm_boundary (struct gdbarch *gdbarch,
const struct floatformat *
gdbarch_float_format (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_float_format called\n");
return gdbarch->float_format;
@@ -4275,6 +4393,7 @@ set_gdbarch_float_format (struct gdbarch *gdbarch,
const struct floatformat *
gdbarch_double_format (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_double_format called\n");
return gdbarch->double_format;
@@ -4290,6 +4409,7 @@ set_gdbarch_double_format (struct gdbarch *gdbarch,
const struct floatformat *
gdbarch_long_double_format (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_format called\n");
return gdbarch->long_double_format;
@@ -4305,6 +4425,7 @@ set_gdbarch_long_double_format (struct gdbarch *gdbarch,
CORE_ADDR
gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->convert_from_func_ptr_addr == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_convert_from_func_ptr_addr invalid");
@@ -4323,6 +4444,7 @@ set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
CORE_ADDR
gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->addr_bits_remove == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_addr_bits_remove invalid");
@@ -4341,6 +4463,7 @@ set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch,
CORE_ADDR
gdbarch_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->smash_text_address == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_smash_text_address invalid");
@@ -4359,12 +4482,14 @@ set_gdbarch_smash_text_address (struct gdbarch *gdbarch,
int
gdbarch_software_single_step_p (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
return gdbarch->software_single_step != 0;
}
void
gdbarch_software_single_step (struct gdbarch *gdbarch, enum target_signal sig, int insert_breakpoints_p)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->software_single_step == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_software_single_step invalid");
@@ -4383,6 +4508,7 @@ set_gdbarch_software_single_step (struct gdbarch *gdbarch,
int
gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, disassemble_info *info)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->print_insn == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_print_insn invalid");
@@ -4401,6 +4527,7 @@ set_gdbarch_print_insn (struct gdbarch *gdbarch,
CORE_ADDR
gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, CORE_ADDR pc)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->skip_trampoline_code == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_skip_trampoline_code invalid");
@@ -4419,6 +4546,7 @@ set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch,
int
gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->in_solib_call_trampoline == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_in_solib_call_trampoline invalid");
@@ -4435,8 +4563,28 @@ set_gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch,
}
int
+gdbarch_pc_in_sigtramp (struct gdbarch *gdbarch, CORE_ADDR pc, char *name)
+{
+ gdb_assert (gdbarch != NULL);
+ if (gdbarch->pc_in_sigtramp == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_pc_in_sigtramp invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_in_sigtramp called\n");
+ return gdbarch->pc_in_sigtramp (pc, name);
+}
+
+void
+set_gdbarch_pc_in_sigtramp (struct gdbarch *gdbarch,
+ gdbarch_pc_in_sigtramp_ftype pc_in_sigtramp)
+{
+ gdbarch->pc_in_sigtramp = pc_in_sigtramp;
+}
+
+int
gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR addr)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->in_function_epilogue_p == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_in_function_epilogue_p invalid");
@@ -4455,6 +4603,7 @@ set_gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch,
char *
gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, int argc, char **argv)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->construct_inferior_arguments == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_construct_inferior_arguments invalid");
@@ -4473,12 +4622,14 @@ set_gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch,
int
gdbarch_dwarf2_build_frame_info_p (struct gdbarch *gdbarch)
{
+ gdb_assert (gdbarch != NULL);
return gdbarch->dwarf2_build_frame_info != 0;
}
void
gdbarch_dwarf2_build_frame_info (struct gdbarch *gdbarch, struct objfile *objfile)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->dwarf2_build_frame_info == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_dwarf2_build_frame_info invalid");
@@ -4497,6 +4648,7 @@ set_gdbarch_dwarf2_build_frame_info (struct gdbarch *gdbarch,
void
gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, asymbol *sym, struct minimal_symbol *msym)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->elf_make_msymbol_special == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_elf_make_msymbol_special invalid");
@@ -4515,6 +4667,7 @@ set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch,
void
gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym)
{
+ gdb_assert (gdbarch != NULL);
if (gdbarch->coff_make_msymbol_special == 0)
internal_error (__FILE__, __LINE__,
"gdbarch: gdbarch_coff_make_msymbol_special invalid");
@@ -4880,7 +5033,6 @@ int
gdbarch_update_p (struct gdbarch_info info)
{
struct gdbarch *new_gdbarch;
- struct gdbarch_list **list;
struct gdbarch_registration *rego;
/* Fill in missing parts of the INFO struct using a number of
@@ -4973,29 +5125,46 @@ gdbarch_update_p (struct gdbarch_info info)
/* 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 = &rego->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);
- architecture_changed_event ();
- return 1;
- }
- }
-
- /* Append this new architecture to this targets list. */
- (*list) = XMALLOC (struct gdbarch_list);
- (*list)->next = NULL;
- (*list)->gdbarch = new_gdbarch;
+ /* Is this a pre-existing architecture? Yes. Move it to the front
+ of the list of architectures (keeping the list sorted Most
+ Recently Used) and then copy it in. */
+ {
+ struct gdbarch_list **list;
+ for (list = &rego->arches;
+ (*list) != NULL;
+ list = &(*list)->next)
+ {
+ if ((*list)->gdbarch == new_gdbarch)
+ {
+ struct gdbarch_list *this;
+ 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);
+ /* Unlink this. */
+ this = (*list);
+ (*list) = this->next;
+ /* Insert in the front. */
+ this->next = rego->arches;
+ rego->arches = this;
+ /* Copy the new architecture in. */
+ current_gdbarch = new_gdbarch;
+ swapin_gdbarch_swap (new_gdbarch);
+ architecture_changed_event ();
+ return 1;
+ }
+ }
+ }
+
+ /* Prepend this new architecture to the architecture list (keep the
+ list sorted Most Recently Used). */
+ {
+ struct gdbarch_list *this = XMALLOC (struct gdbarch_list);
+ this->next = rego->arches;
+ this->gdbarch = new_gdbarch;
+ rego->arches = this;
+ }
/* Switch to this new architecture. Dump it out. */
current_gdbarch = new_gdbarch;
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index 81f5174..0e334cf 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -37,7 +37,9 @@
#include "dis-asm.h" /* Get defs for disassemble_info, which unfortunately is a typedef. */
#if !GDB_MULTI_ARCH
+/* Pull in function declarations refered to, indirectly, via macros. */
#include "value.h" /* For default_coerce_float_to_double which is referenced by a macro. */
+#include "inferior.h" /* For unsigned_address_to_pointer(). */
#endif
struct frame_info;
@@ -358,23 +360,6 @@ extern void set_gdbarch_read_fp (struct gdbarch *gdbarch, gdbarch_read_fp_ftype
#endif
/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (TARGET_WRITE_FP)
-#define TARGET_WRITE_FP(val) (generic_target_write_fp (val))
-#endif
-
-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 > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_WRITE_FP)
-#error "Non multi-arch definition of TARGET_WRITE_FP"
-#endif
-#if GDB_MULTI_ARCH
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_WRITE_FP)
-#define TARGET_WRITE_FP(val) (gdbarch_write_fp (current_gdbarch, val))
-#endif
-#endif
-
-/* Default (function) for non- multi-arch platforms. */
#if (!GDB_MULTI_ARCH) && !defined (TARGET_READ_SP)
#define TARGET_READ_SP() (generic_target_read_sp ())
#endif
@@ -473,6 +458,15 @@ extern void set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch, int num_pseudo
#endif
#endif
+/* GDB's standard (or well known) register numbers. These can map onto
+ a real register or a pseudo (computed) register or not be defined at
+ all (-1). */
+
+/* Default (value) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (SP_REGNUM)
+#define SP_REGNUM (-1)
+#endif
+
extern int gdbarch_sp_regnum (struct gdbarch *gdbarch);
extern void set_gdbarch_sp_regnum (struct gdbarch *gdbarch, int sp_regnum);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SP_REGNUM)
@@ -484,6 +478,11 @@ extern void set_gdbarch_sp_regnum (struct gdbarch *gdbarch, int sp_regnum);
#endif
#endif
+/* Default (value) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (FP_REGNUM)
+#define FP_REGNUM (-1)
+#endif
+
extern int gdbarch_fp_regnum (struct gdbarch *gdbarch);
extern void set_gdbarch_fp_regnum (struct gdbarch *gdbarch, int fp_regnum);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FP_REGNUM)
@@ -495,6 +494,11 @@ extern void set_gdbarch_fp_regnum (struct gdbarch *gdbarch, int fp_regnum);
#endif
#endif
+/* Default (value) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (PC_REGNUM)
+#define PC_REGNUM (-1)
+#endif
+
extern int gdbarch_pc_regnum (struct gdbarch *gdbarch);
extern void set_gdbarch_pc_regnum (struct gdbarch *gdbarch, int pc_regnum);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PC_REGNUM)
@@ -507,6 +511,22 @@ extern void set_gdbarch_pc_regnum (struct gdbarch *gdbarch, int pc_regnum);
#endif
/* Default (value) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (PS_REGNUM)
+#define PS_REGNUM (-1)
+#endif
+
+extern int gdbarch_ps_regnum (struct gdbarch *gdbarch);
+extern void set_gdbarch_ps_regnum (struct gdbarch *gdbarch, int ps_regnum);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PS_REGNUM)
+#error "Non multi-arch definition of PS_REGNUM"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PS_REGNUM)
+#define PS_REGNUM (gdbarch_ps_regnum (current_gdbarch))
+#endif
+#endif
+
+/* Default (value) for non- multi-arch platforms. */
#if (!GDB_MULTI_ARCH) && !defined (FP0_REGNUM)
#define FP0_REGNUM (-1)
#endif
@@ -1670,8 +1690,8 @@ extern void set_gdbarch_inner_than (struct gdbarch *gdbarch, gdbarch_inner_than_
#define BREAKPOINT_FROM_PC(pcptr, lenptr) (legacy_breakpoint_from_pc (pcptr, lenptr))
#endif
-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);
+typedef const unsigned char * (gdbarch_breakpoint_from_pc_ftype) (CORE_ADDR *pcptr, int *lenptr);
+extern const 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 > GDB_MULTI_ARCH_PARTIAL) && defined (BREAKPOINT_FROM_PC)
#error "Non multi-arch definition of BREAKPOINT_FROM_PC"
@@ -2248,6 +2268,44 @@ extern void set_gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, gdbar
#endif
#endif
+/* Sigtramp is a routine that the kernel calls (which then calls the
+ signal handler). On most machines it is a library routine that is
+ linked into the executable.
+
+ This macro, given a program counter value and the name of the
+ function in which that PC resides (which can be null if the name is
+ not known), returns nonzero if the PC and name show that we are in
+ sigtramp.
+
+ On most machines just see if the name is sigtramp (and if we have
+ no name, assume we are not in sigtramp).
+
+ FIXME: cagney/2002-04-21: The function find_pc_partial_function
+ calls find_pc_sect_partial_function() which calls PC_IN_SIGTRAMP.
+ This means PC_IN_SIGTRAMP function can't be implemented by doing its
+ own local NAME lookup.
+
+ FIXME: cagney/2002-04-21: PC_IN_SIGTRAMP is something of a mess.
+ Some code also depends on SIGTRAMP_START and SIGTRAMP_END but other
+ does not. */
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (PC_IN_SIGTRAMP)
+#define PC_IN_SIGTRAMP(pc, name) (legacy_pc_in_sigtramp (pc, name))
+#endif
+
+typedef int (gdbarch_pc_in_sigtramp_ftype) (CORE_ADDR pc, char *name);
+extern int gdbarch_pc_in_sigtramp (struct gdbarch *gdbarch, CORE_ADDR pc, char *name);
+extern void set_gdbarch_pc_in_sigtramp (struct gdbarch *gdbarch, gdbarch_pc_in_sigtramp_ftype *pc_in_sigtramp);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PC_IN_SIGTRAMP)
+#error "Non multi-arch definition of PC_IN_SIGTRAMP"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (PC_IN_SIGTRAMP)
+#define PC_IN_SIGTRAMP(pc, name) (gdbarch_pc_in_sigtramp (current_gdbarch, pc, name))
+#endif
+#endif
+
/* A target might have problems with watchpoints as soon as the stack
frame of the current function has been destroyed. This mostly happens
as the first action in a funtion's epilogue. in_function_epilogue_p()
@@ -2386,9 +2444,16 @@ extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch);
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).
+ The INFO parameter is, as far as possible, be pre-initialized with
+ information obtained from INFO.ABFD or the previously selected
+ architecture.
+
+ The ARCHES parameter is a linked list (sorted most recently used)
+ of all the previously created architures for this architecture
+ family. The (possibly NULL) ARCHES->gdbarch can used to access
+ values from the previously selected architecture for this
+ architecture family. The global ``current_gdbarch'' shall not be
+ used.
The INIT function shall return any of: NULL - indicating that it
doesn't recognize the selected architecture; an existing ``struct
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index 310d3c4..1dd2990 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -19,6 +19,12 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Make certain that the script is running in an internationalized
+# environment.
+LANG=c ; export LANG
+LC_ALL=c ; export LC_ALL
+
+
compare_new ()
{
file=$1
@@ -415,7 +421,6 @@ v::TARGET_CHAR_SIGNED:int:char_signed::::1:-1:1::::
f::TARGET_READ_PC:CORE_ADDR:read_pc:ptid_t ptid:ptid::0:generic_target_read_pc::0
f::TARGET_WRITE_PC:void:write_pc:CORE_ADDR val, ptid_t ptid:val, ptid::0:generic_target_write_pc::0
f::TARGET_READ_FP:CORE_ADDR:read_fp:void:::0:generic_target_read_fp::0
-f::TARGET_WRITE_FP:void:write_fp:CORE_ADDR val:val::0:generic_target_write_fp::0
f::TARGET_READ_SP:CORE_ADDR:read_sp:void:::0:generic_target_read_sp::0
f::TARGET_WRITE_SP:void:write_sp:CORE_ADDR val:val::0:generic_target_write_sp::0
# Function for getting target's idea of a frame pointer. FIXME: GDB's
@@ -432,9 +437,14 @@ v:2:NUM_REGS:int:num_regs::::0:-1
# These pseudo-registers may be aliases for other registers,
# combinations of other registers, or they may be computed by GDB.
v:2:NUM_PSEUDO_REGS:int:num_pseudo_regs::::0:0::0:::
-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
+
+# GDB's standard (or well known) register numbers. These can map onto
+# a real register or a pseudo (computed) register or not be defined at
+# all (-1).
+v:2:SP_REGNUM:int:sp_regnum::::-1:-1::0
+v:2:FP_REGNUM:int:fp_regnum::::-1:-1::0
+v:2:PC_REGNUM:int:pc_regnum::::-1:-1::0
+v:2:PS_REGNUM:int:ps_regnum::::-1:-1::0
v:2:FP0_REGNUM:int:fp0_regnum::::0:-1::0
v:2:NPC_REGNUM:int:npc_regnum::::0:-1::0
v:2:NNPC_REGNUM:int:nnpc_regnum::::0:-1::0
@@ -535,7 +545,7 @@ F:2:INIT_EXTRA_FRAME_INFO:void:init_extra_frame_info:int fromleaf, struct frame_
f:2:SKIP_PROLOGUE:CORE_ADDR:skip_prologue:CORE_ADDR ip:ip::0:0
f:2:PROLOGUE_FRAMELESS_P:int:prologue_frameless_p:CORE_ADDR ip:ip::0:generic_prologue_frameless_p::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:::legacy_breakpoint_from_pc::0
+f:2:BREAKPOINT_FROM_PC:const unsigned char *:breakpoint_from_pc:CORE_ADDR *pcptr, int *lenptr:pcptr, lenptr:::legacy_breakpoint_from_pc::0
f:2:MEMORY_INSERT_BREAKPOINT:int:memory_insert_breakpoint:CORE_ADDR addr, char *contents_cache:addr, contents_cache::0:default_memory_insert_breakpoint::0
f:2:MEMORY_REMOVE_BREAKPOINT:int:memory_remove_breakpoint:CORE_ADDR addr, char *contents_cache:addr, contents_cache::0:default_memory_remove_breakpoint::0
v:2:DECR_PC_AFTER_BREAK:CORE_ADDR:decr_pc_after_break::::0:-1
@@ -599,6 +609,27 @@ f:2:SKIP_TRAMPOLINE_CODE:CORE_ADDR:skip_trampoline_code:CORE_ADDR pc:pc:::generi
# trampoline code in the ".plt" section. IN_SOLIB_CALL_TRAMPOLINE evaluates
# to nonzero if we are current stopped in one of these.
f:2:IN_SOLIB_CALL_TRAMPOLINE:int:in_solib_call_trampoline:CORE_ADDR pc, char *name:pc, name:::generic_in_solib_call_trampoline::0
+# Sigtramp is a routine that the kernel calls (which then calls the
+# signal handler). On most machines it is a library routine that is
+# linked into the executable.
+#
+# This macro, given a program counter value and the name of the
+# function in which that PC resides (which can be null if the name is
+# not known), returns nonzero if the PC and name show that we are in
+# sigtramp.
+#
+# On most machines just see if the name is sigtramp (and if we have
+# no name, assume we are not in sigtramp).
+#
+# FIXME: cagney/2002-04-21: The function find_pc_partial_function
+# calls find_pc_sect_partial_function() which calls PC_IN_SIGTRAMP.
+# This means PC_IN_SIGTRAMP function can't be implemented by doing its
+# own local NAME lookup.
+#
+# FIXME: cagney/2002-04-21: PC_IN_SIGTRAMP is something of a mess.
+# Some code also depends on SIGTRAMP_START and SIGTRAMP_END but other
+# does not.
+f:2:PC_IN_SIGTRAMP:int:pc_in_sigtramp:CORE_ADDR pc, char *name:pc, name:::legacy_pc_in_sigtramp::0
# A target might have problems with watchpoints as soon as the stack
# frame of the current function has been destroyed. This mostly happens
# as the first action in a funtion's epilogue. in_function_epilogue_p()
@@ -722,7 +753,9 @@ cat <<EOF
#include "dis-asm.h" /* Get defs for disassemble_info, which unfortunately is a typedef. */
#if !GDB_MULTI_ARCH
+/* Pull in function declarations refered to, indirectly, via macros. */
#include "value.h" /* For default_coerce_float_to_double which is referenced by a macro. */
+#include "inferior.h" /* For unsigned_address_to_pointer(). */
#endif
struct frame_info;
@@ -944,9 +977,16 @@ extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch);
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).
+ The INFO parameter is, as far as possible, be pre-initialized with
+ information obtained from INFO.ABFD or the previously selected
+ architecture.
+
+ The ARCHES parameter is a linked list (sorted most recently used)
+ of all the previously created architures for this architecture
+ family. The (possibly NULL) ARCHES->gdbarch can used to access
+ values from the previously selected architecture for this
+ architecture family. The global \`\`current_gdbarch'' shall not be
+ used.
The INIT function shall return any of: NULL - indicating that it
doesn't recognize the selected architecture; an existing \`\`struct
@@ -1212,13 +1252,6 @@ 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
@@ -1340,6 +1373,7 @@ void
initialize_non_multiarch ()
{
alloc_gdbarch_data (&startup_gdbarch);
+ init_gdbarch_swap (&startup_gdbarch);
init_gdbarch_data (&startup_gdbarch);
}
EOF
@@ -1594,6 +1628,7 @@ do
printf "int\n"
printf "gdbarch_${function}_p (struct gdbarch *gdbarch)\n"
printf "{\n"
+ printf " gdb_assert (gdbarch != NULL);\n"
if [ -n "${valid_p}" ]
then
printf " return ${valid_p};\n"
@@ -1613,6 +1648,7 @@ do
printf "gdbarch_${function} (struct gdbarch *gdbarch, ${formal})\n"
fi
printf "{\n"
+ printf " gdb_assert (gdbarch != NULL);\n"
printf " if (gdbarch->${function} == 0)\n"
printf " internal_error (__FILE__, __LINE__,\n"
printf " \"gdbarch: gdbarch_${function} invalid\");\n"
@@ -1654,6 +1690,7 @@ do
printf "${returntype}\n"
printf "gdbarch_${function} (struct gdbarch *gdbarch)\n"
printf "{\n"
+ printf " gdb_assert (gdbarch != NULL);\n"
if [ "x${invalid_p}" = "x0" ]
then
printf " /* Skip verify of ${function}, invalid_p == 0 */\n"
@@ -1685,6 +1722,7 @@ do
printf "${returntype}\n"
printf "gdbarch_${function} (struct gdbarch *gdbarch)\n"
printf "{\n"
+ printf " gdb_assert (gdbarch != NULL);\n"
printf " if (gdbarch_debug >= 2)\n"
printf " fprintf_unfiltered (gdb_stdlog, \"gdbarch_${function} called\\\\n\");\n"
printf " return gdbarch->${function};\n"
@@ -2045,7 +2083,6 @@ int
gdbarch_update_p (struct gdbarch_info info)
{
struct gdbarch *new_gdbarch;
- struct gdbarch_list **list;
struct gdbarch_registration *rego;
/* Fill in missing parts of the INFO struct using a number of
@@ -2138,29 +2175,46 @@ gdbarch_update_p (struct gdbarch_info info)
/* 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 = &rego->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);
- architecture_changed_event ();
- return 1;
- }
- }
-
- /* Append this new architecture to this targets list. */
- (*list) = XMALLOC (struct gdbarch_list);
- (*list)->next = NULL;
- (*list)->gdbarch = new_gdbarch;
+ /* Is this a pre-existing architecture? Yes. Move it to the front
+ of the list of architectures (keeping the list sorted Most
+ Recently Used) and then copy it in. */
+ {
+ struct gdbarch_list **list;
+ for (list = &rego->arches;
+ (*list) != NULL;
+ list = &(*list)->next)
+ {
+ if ((*list)->gdbarch == new_gdbarch)
+ {
+ struct gdbarch_list *this;
+ 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);
+ /* Unlink this. */
+ this = (*list);
+ (*list) = this->next;
+ /* Insert in the front. */
+ this->next = rego->arches;
+ rego->arches = this;
+ /* Copy the new architecture in. */
+ current_gdbarch = new_gdbarch;
+ swapin_gdbarch_swap (new_gdbarch);
+ architecture_changed_event ();
+ return 1;
+ }
+ }
+ }
+
+ /* Prepend this new architecture to the architecture list (keep the
+ list sorted Most Recently Used). */
+ {
+ struct gdbarch_list *this = XMALLOC (struct gdbarch_list);
+ this->next = rego->arches;
+ this->gdbarch = new_gdbarch;
+ rego->arches = this;
+ }
/* Switch to this new architecture. Dump it out. */
current_gdbarch = new_gdbarch;
diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
index 9ed226eb..2c8cd33 100644
--- a/gdb/gdbserver/Makefile.in
+++ b/gdb/gdbserver/Makefile.in
@@ -83,20 +83,22 @@ READLINE_DEP = $$(READLINE_DIR)
# -I. for config files.
# -I${srcdir} for our headers.
# -I$(srcdir)/../regformats for regdef.h.
-INCLUDE_CFLAGS = -I. -I${srcdir} -I$(srcdir)/../regformats
+INCLUDE_CFLAGS = -I. -I${srcdir} -I$(srcdir)/../regformats -I$(INCLUDE_DIR)
# M{H,T}_CFLAGS, if defined, has host- and target-dependent CFLAGS
# from the config/ directory.
GLOBAL_CFLAGS = ${MT_CFLAGS} ${MH_CFLAGS}
#PROFILE_CFLAGS = -pg
+WARN_CFLAGS = -Wall
+
# CFLAGS is specifically reserved for setting from the command line
# when running make. I.E. "make CFLAGS=-Wmissing-prototypes".
CFLAGS = @CFLAGS@
# INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros.
-INTERNAL_CFLAGS = ${CFLAGS} ${GLOBAL_CFLAGS} ${PROFILE_CFLAGS} \
- ${INCLUDE_CFLAGS} ${BFD_CFLAGS}
+INTERNAL_CFLAGS = $(WARN_CFLAGS) ${CFLAGS} ${GLOBAL_CFLAGS} \
+ ${PROFILE_CFLAGS} ${INCLUDE_CFLAGS} ${BFD_CFLAGS}
# LDFLAGS is specifically reserved for setting from the command line
# when running make.
@@ -120,7 +122,10 @@ DEPFILES = @GDBSERVER_DEPFILES@
SOURCES = $(SFILES)
TAGFILES = $(SOURCES) ${HFILES} ${ALLPARAM} ${POSSLIBS}
-OBS = utils.o $(DEPFILES) server.o remote-utils.o regcache.o
+OBS = inferiors.o regcache.o remote-utils.o server.o signals.o target.o \
+ utils.o \
+ mem-break.o \
+ $(DEPFILES)
# Prevent Sun make from putting in the machine type. Setting
# TARGET_ARCH to nothing works for SunOS 3, 4.0, but not for 4.1.
@@ -195,8 +200,12 @@ maintainer-clean realclean: clean
STAGESTUFF=${OBS} ${TSOBS} ${NTSOBS} ${ADD_FILES} init.c init.o version.c gdb
+config.h: stamp-h ; @true
+stamp-h: config.in config.status
+ CONFIG_FILES="" $(SHELL) ./config.status
+
Makefile: Makefile.in config.status
- $(SHELL) ./config.status
+ CONFIG_HEADERS="" $(SHELL) ./config.status
config.status: configure configure.srv
$(SHELL) ./config.status --recheck
@@ -225,12 +234,19 @@ unexport CHILLFLAGS CHILL_LIB CHILL_FOR_TARGET :
regdat_sh = $(srcdir)/../regformats/regdat.sh
regdef_h = $(srcdir)/../regformats/regdef.h
regcache_h = $(srcdir)/regcache.h
-server_h = $(srcdir)/server.h $(regcache_h) config.h
+server_h = $(srcdir)/server.h $(regcache_h) config.h $(srcdir)/target.h \
+ $(srcdir)/mem-break.h
-server.o: server.c $(server_h)
+inferiors.o: inferiors.c $(server_h)
+mem-break.o: mem-break.c $(server_h)
+regcache.o: regcache.c $(server_h) $(regdef_h)
remote-utils.o: remote-utils.c terminal.h $(server_h)
+server.o: server.c $(server_h)
+target.o: target.c $(server_h)
utils.o: utils.c $(server_h)
-regcache.o: regcache.c $(server_h) $(regdef_h)
+
+signals.o: ../signals/signals.c $(server_h)
+ $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER
i387-fp.o: i387-fp.c $(server_h)
@@ -246,14 +262,6 @@ linux-s390-low.o: linux-s390-low.c $(linux_low_h) $(server_h)
linux-sh-low.o: linux-sh-low.c $(linux_low_h) $(server_h)
linux-x86-64-low.o: linux-x86-64-low.c $(linux_low_h) $(server_h)
-# OBSOLETE TARGETS
-# OBSOLETE # low-lynx.o : ${srcdir}/low-lynx.c ${srcdir}/server.h
-# OBSOLETE # low-nbsd.o : ${srcdir}/low-nbsd.c ${srcdir}/server.h
-# OBSOLETE # low-sim.o : ${srcdir}/low-sim.c ${srcdir}/server.h
-# OBSOLETE # low-sparc.o : $(srcdir)/low-sparc.c $(srcdir)/server.h
-# OBSOLETE # low-sun3.o : $(srcdir)/low-sun3.c $(srcdir)/server.h
-# OBSOLETE # low-hppabsd.o : $(srcdir)/low-hppabsd.c $(srcdir)/server.h
-
reg-arm.o : reg-arm.c $(regdef_h)
reg-arm.c : $(srcdir)/../regformats/reg-arm.dat $(regdat_sh)
sh $(regdat_sh) $(srcdir)/../regformats/reg-arm.dat reg-arm.c
diff --git a/gdb/gdbserver/config.in b/gdb/gdbserver/config.in
index e77d5a7..9d553f2 100644
--- a/gdb/gdbserver/config.in
+++ b/gdb/gdbserver/config.in
@@ -16,6 +16,9 @@
/* Define if you have the <sgtty.h> header file. */
#undef HAVE_SGTTY_H
+/* Define if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
/* Define if you have the <sys/reg.h> header file. */
#undef HAVE_SYS_REG_H
diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure
index c08d5c2..758d483 100755
--- a/gdb/gdbserver/configure
+++ b/gdb/gdbserver/configure
@@ -1105,7 +1105,7 @@ EOF
fi
-for ac_hdr in sgtty.h termio.h termios.h sys/reg.h
+for ac_hdr in sgtty.h termio.h termios.h sys/reg.h string.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
@@ -1593,6 +1593,10 @@ cat >> $CONFIG_STATUS <<EOF
EOF
cat >> $CONFIG_STATUS <<\EOF
+case x$CONFIG_HEADERS in
+xconfig.h:config.in)
+echo > stamp-h ;;
+esac
exit 0
EOF
diff --git a/gdb/gdbserver/configure.in b/gdb/gdbserver/configure.in
index 744aac2..db7e301 100644
--- a/gdb/gdbserver/configure.in
+++ b/gdb/gdbserver/configure.in
@@ -30,7 +30,7 @@ AC_PROG_INSTALL
AC_HEADER_STDC
-AC_CHECK_HEADERS(sgtty.h termio.h termios.h sys/reg.h)
+AC_CHECK_HEADERS(sgtty.h termio.h termios.h sys/reg.h string.h)
. ${srcdir}/configure.srv
@@ -66,4 +66,9 @@ GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj"
AC_SUBST(GDBSERVER_DEPFILES)
-AC_OUTPUT(Makefile)
+AC_OUTPUT(Makefile,
+[case x$CONFIG_HEADERS in
+xconfig.h:config.in)
+echo > stamp-h ;;
+esac
+])
diff --git a/gdb/gdbserver/gdbreplay.c b/gdb/gdbserver/gdbreplay.c
index ca10a06..65831b1 100644
--- a/gdb/gdbserver/gdbreplay.c
+++ b/gdb/gdbserver/gdbreplay.c
@@ -30,6 +30,12 @@
#include <ctype.h>
#include <fcntl.h>
#include <errno.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
/* Sort of a hack... */
#define EOL (EOF - 1)
@@ -83,8 +89,6 @@ remote_close (void)
void
remote_open (char *name)
{
- extern char *strchr ();
-
if (!strchr (name, ':'))
{
fprintf (stderr, "%s: Must specify tcp connection as host:addr\n", name);
@@ -97,7 +101,6 @@ remote_open (char *name)
int port;
struct sockaddr_in sockaddr;
int tmp;
- struct protoent *protoent;
int tmp_desc;
port_str = strchr (name, ':');
@@ -126,10 +129,6 @@ remote_open (char *name)
if (remote_desc == -1)
perror_with_name ("Accept failed");
- protoent = getprotobyname ("tcp");
- if (!protoent)
- perror_with_name ("getprotobyname");
-
/* Enable TCP keep alive process. */
tmp = 1;
setsockopt (tmp_desc, SOL_SOCKET, SO_KEEPALIVE, (char *) &tmp, sizeof (tmp));
@@ -137,7 +136,7 @@ remote_open (char *name)
/* Tell TCP not to delay small packets. This greatly speeds up
interactive response. */
tmp = 1;
- setsockopt (remote_desc, protoent->p_proto, TCP_NODELAY,
+ setsockopt (remote_desc, IPPROTO_TCP, TCP_NODELAY,
(char *) &tmp, sizeof (tmp));
close (tmp_desc); /* No longer need this */
diff --git a/gdb/gdbserver/inferiors.c b/gdb/gdbserver/inferiors.c
new file mode 100644
index 0000000..774798d
--- /dev/null
+++ b/gdb/gdbserver/inferiors.c
@@ -0,0 +1,105 @@
+/* Inferior process information for the remote server for GDB.
+ Copyright 2002
+ Free Software Foundation, Inc.
+
+ Contributed by MontaVista Software.
+
+ 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 <stdlib.h>
+
+#include "server.h"
+
+struct inferior_info
+{
+ int pid;
+ void *target_data;
+ void *regcache_data;
+ struct inferior_info *next;
+};
+
+static struct inferior_info *inferiors;
+struct inferior_info *current_inferior;
+int signal_pid;
+
+void
+add_inferior (int pid)
+{
+ struct inferior_info *new_inferior
+ = (struct inferior_info *) malloc (sizeof (*new_inferior));
+
+ memset (new_inferior, 0, sizeof (*new_inferior));
+
+ new_inferior->pid = pid;
+
+ new_inferior->next = inferiors;
+ inferiors = new_inferior;
+
+ if (current_inferior == NULL)
+ current_inferior = inferiors;
+
+ create_register_cache (new_inferior);
+
+ if (signal_pid == 0)
+ signal_pid = pid;
+}
+
+void
+clear_inferiors (void)
+{
+ struct inferior_info *inf = inferiors, *next_inf;
+
+ while (inf)
+ {
+ next_inf = inf->next;
+
+ if (inf->target_data)
+ free (inf->target_data);
+ if (inf->regcache_data)
+ free_register_cache (inf);
+
+ free (inf);
+ inf = next_inf;
+ }
+
+ inferiors = NULL;
+}
+
+void *
+inferior_target_data (struct inferior_info *inferior)
+{
+ return inferior->target_data;
+}
+
+void
+set_inferior_target_data (struct inferior_info *inferior, void *data)
+{
+ inferior->target_data = data;
+}
+
+void *
+inferior_regcache_data (struct inferior_info *inferior)
+{
+ return inferior->regcache_data;
+}
+
+void
+set_inferior_regcache_data (struct inferior_info *inferior, void *data)
+{
+ inferior->regcache_data = data;
+}
diff --git a/gdb/gdbserver/linux-arm-low.c b/gdb/gdbserver/linux-arm-low.c
index f873b07..2958fdf 100644
--- a/gdb/gdbserver/linux-arm-low.c
+++ b/gdb/gdbserver/linux-arm-low.c
@@ -26,22 +26,28 @@
#include <sys/reg.h>
#endif
-int num_regs = 16;
+#define arm_num_regs 16
-int regmap[] = {
+static int arm_regmap[] = {
0, 4, 8, 12, 16, 20, 24, 28,
32, 36, 40, 44, 48, 52, 56, 60,
};
-int
-cannot_store_register (int regno)
+static int
+arm_cannot_store_register (int regno)
{
- return (regno >= num_regs);
+ return (regno >= arm_num_regs);
}
-int
-cannot_fetch_register (int regno)
+static int
+arm_cannot_fetch_register (int regno)
{
- return (regno >= num_regs);
+ return (regno >= arm_num_regs);
}
+struct linux_target_ops the_low_target = {
+ arm_num_regs,
+ arm_regmap,
+ arm_cannot_fetch_register,
+ arm_cannot_store_register,
+};
diff --git a/gdb/gdbserver/linux-i386-low.c b/gdb/gdbserver/linux-i386-low.c
index 2a66efa..7126432 100644
--- a/gdb/gdbserver/linux-i386-low.c
+++ b/gdb/gdbserver/linux-i386-low.c
@@ -29,13 +29,13 @@
/* This module only supports access to the general purpose registers. */
-int num_regs = 16;
+#define i386_num_regs 16
/* This stuff comes from i386-linux-nat.c. */
/* Mapping between the general-purpose registers in `struct user'
format and GDB's register array layout. */
-int regmap[] =
+static int i386_regmap[] =
{
EAX * 4, ECX * 4, EDX * 4, EBX * 4,
UESP * 4, EBP * 4, ESI * 4, EDI * 4,
@@ -43,16 +43,16 @@ int regmap[] =
DS * 4, ES * 4, FS * 4, GS * 4
};
-int
-cannot_store_register (int regno)
+static int
+i386_cannot_store_register (int regno)
{
- return (regno >= num_regs);
+ return (regno >= i386_num_regs);
}
-int
-cannot_fetch_register (int regno)
+static int
+i386_cannot_fetch_register (int regno)
{
- return (regno >= num_regs);
+ return (regno >= i386_num_regs);
}
@@ -65,8 +65,8 @@ i386_fill_gregset (void *buf)
{
int i;
- for (i = 0; i < num_regs; i++)
- collect_register (i, ((char *) buf) + regmap[i]);
+ for (i = 0; i < i386_num_regs; i++)
+ collect_register (i, ((char *) buf) + i386_regmap[i]);
collect_register_by_name ("orig_eax", ((char *) buf) + ORIG_EAX * 4);
}
@@ -76,8 +76,8 @@ i386_store_gregset (void *buf)
{
int i;
- for (i = 0; i < num_regs; i++)
- supply_register (i, ((char *) buf) + regmap[i]);
+ for (i = 0; i < i386_num_regs; i++)
+ supply_register (i, ((char *) buf) + i386_regmap[i]);
supply_register_by_name ("orig_eax", ((char *) buf) + ORIG_EAX * 4);
}
@@ -121,3 +121,37 @@ struct regset_info target_regsets[] = {
#endif /* HAVE_LINUX_REGSETS */
+static const char i386_breakpoint[] = { 0xCC };
+#define i386_breakpoint_len 1
+
+static CORE_ADDR
+i386_stop_pc ()
+{
+ unsigned long pc;
+
+ /* Overkill */
+ fetch_inferior_registers (0);
+
+ collect_register_by_name ("eip", &pc);
+ return pc - 1;
+}
+
+static void
+i386_set_pc (CORE_ADDR newpc)
+{
+ supply_register_by_name ("eip", &newpc);
+
+ /* Overkill */
+ store_inferior_registers (0);
+}
+
+struct linux_target_ops the_low_target = {
+ i386_num_regs,
+ i386_regmap,
+ i386_cannot_fetch_register,
+ i386_cannot_store_register,
+ i386_stop_pc,
+ i386_set_pc,
+ i386_breakpoint,
+ i386_breakpoint_len,
+};
diff --git a/gdb/gdbserver/linux-ia64-low.c b/gdb/gdbserver/linux-ia64-low.c
index f0f238f9..9407e6c 100644
--- a/gdb/gdbserver/linux-ia64-low.c
+++ b/gdb/gdbserver/linux-ia64-low.c
@@ -26,11 +26,11 @@
#include <sys/reg.h>
#endif
-int num_regs = 590;
+#define ia64_num_regs 590
#include <asm/ptrace_offsets.h>
-int regmap[] =
+static int ia64_regmap[] =
{
/* general registers */
-1, /* gr0 not available; i.e, it's always zero */
@@ -283,15 +283,21 @@ int regmap[] =
-1, -1, -1, -1, -1, -1, -1, -1,
};
-int
-cannot_store_register (int regno)
+static int
+ia64_cannot_store_register (int regno)
{
return 0;
}
-int
-cannot_fetch_register (int regno)
+static int
+ia64_cannot_fetch_register (int regno)
{
return 0;
}
+struct linux_target_ops the_low_target = {
+ ia64_num_regs,
+ ia64_regmap,
+ ia64_cannot_fetch_register,
+ ia64_cannot_store_register,
+};
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index 4e40d07..6cfe0d5 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -35,6 +35,10 @@
#include <stdlib.h>
#include <unistd.h>
+static CORE_ADDR linux_bp_reinsert;
+
+static void linux_resume (int step, int signal);
+
#define PTRACE_ARG3_TYPE long
#define PTRACE_XFER_TYPE long
@@ -44,17 +48,20 @@ static int use_regsets_p = 1;
extern int errno;
-#ifdef HAVE_LINUX_USRREGS
-extern int num_regs;
-extern int regmap[];
-#endif
+static int inferior_pid;
+
+struct inferior_linux_data
+{
+ int pid;
+};
/* Start an inferior process and returns its pid.
ALLARGS is a vector of program-name and args. */
-int
-create_inferior (char *program, char **allargs)
+static int
+linux_create_inferior (char *program, char **allargs)
{
+ struct inferior_linux_data *tdata;
int pid;
pid = fork ();
@@ -73,14 +80,23 @@ create_inferior (char *program, char **allargs)
_exit (0177);
}
- return pid;
+ add_inferior (pid);
+ tdata = (struct inferior_linux_data *) malloc (sizeof (*tdata));
+ tdata->pid = pid;
+ set_inferior_target_data (current_inferior, tdata);
+
+ /* FIXME remove */
+ inferior_pid = pid;
+ return 0;
}
/* Attach to an inferior process. */
-int
-myattach (int pid)
+static int
+linux_attach (int pid)
{
+ struct inferior_linux_data *tdata;
+
if (ptrace (PTRACE_ATTACH, pid, 0, 0) != 0)
{
fprintf (stderr, "Cannot attach to process %d: %s (%d)\n", pid,
@@ -90,50 +106,113 @@ myattach (int pid)
_exit (0177);
}
+ add_inferior (pid);
+ tdata = (struct inferior_linux_data *) malloc (sizeof (*tdata));
+ tdata->pid = pid;
+ set_inferior_target_data (current_inferior, tdata);
return 0;
}
/* Kill the inferior process. Make us have no inferior. */
-void
-kill_inferior (void)
+static void
+linux_kill (void)
{
if (inferior_pid == 0)
return;
ptrace (PTRACE_KILL, inferior_pid, 0, 0);
wait (0);
+ clear_inferiors ();
}
/* Return nonzero if the given thread is still alive. */
-int
-mythread_alive (int pid)
+static int
+linux_thread_alive (int pid)
{
return 1;
}
+static int
+linux_wait_for_one_inferior (struct inferior_info *child)
+{
+ struct inferior_linux_data *child_data = inferior_target_data (child);
+ int pid, wstat;
+
+ while (1)
+ {
+ pid = waitpid (child_data->pid, &wstat, 0);
+
+ if (pid != child_data->pid)
+ perror_with_name ("wait");
+
+ /* If this target supports breakpoints, see if we hit one. */
+ if (the_low_target.stop_pc != NULL
+ && WIFSTOPPED (wstat)
+ && WSTOPSIG (wstat) == SIGTRAP)
+ {
+ CORE_ADDR stop_pc;
+
+ if (linux_bp_reinsert != 0)
+ {
+ reinsert_breakpoint (linux_bp_reinsert);
+ linux_bp_reinsert = 0;
+ linux_resume (0, 0);
+ continue;
+ }
+
+ fetch_inferior_registers (0);
+ stop_pc = (*the_low_target.stop_pc) ();
+
+ if (check_breakpoints (stop_pc) != 0)
+ {
+ if (the_low_target.set_pc != NULL)
+ (*the_low_target.set_pc) (stop_pc);
+
+ if (the_low_target.breakpoint_reinsert_addr == NULL)
+ {
+ linux_bp_reinsert = stop_pc;
+ uninsert_breakpoint (stop_pc);
+ linux_resume (1, 0);
+ }
+ else
+ {
+ reinsert_breakpoint_by_bp
+ (stop_pc, (*the_low_target.breakpoint_reinsert_addr) ());
+ linux_resume (0, 0);
+ }
+
+ continue;
+ }
+ }
+
+ return wstat;
+ }
+ /* NOTREACHED */
+ return 0;
+}
+
/* Wait for process, returns status */
-unsigned char
-mywait (char *status)
+static unsigned char
+linux_wait (char *status)
{
- int pid;
int w;
enable_async_io ();
- pid = waitpid (inferior_pid, &w, 0);
+ w = linux_wait_for_one_inferior (current_inferior);
disable_async_io ();
- if (pid != inferior_pid)
- perror_with_name ("wait");
if (WIFEXITED (w))
{
fprintf (stderr, "\nChild exited with retcode = %x \n", WEXITSTATUS (w));
*status = 'W';
+ clear_inferiors ();
return ((unsigned char) WEXITSTATUS (w));
}
else if (!WIFSTOPPED (w))
{
fprintf (stderr, "\nChild terminated with signal = %x \n", WTERMSIG (w));
+ clear_inferiors ();
*status = 'X';
return ((unsigned char) WTERMSIG (w));
}
@@ -148,8 +227,8 @@ mywait (char *status)
If STEP is nonzero, single-step it.
If SIGNAL is nonzero, give it that signal. */
-void
-myresume (int step, int signal)
+static void
+linux_resume (int step, int signal)
{
errno = 0;
ptrace (step ? PTRACE_SINGLESTEP : PTRACE_CONT, inferior_pid, 1, signal);
@@ -167,10 +246,10 @@ register_addr (int regnum)
{
int addr;
- if (regnum < 0 || regnum >= num_regs)
+ if (regnum < 0 || regnum >= the_low_target.num_regs)
error ("Invalid register number %d.", regnum);
- addr = regmap[regnum];
+ addr = the_low_target.regmap[regnum];
if (addr == -1)
addr = 0;
@@ -184,9 +263,9 @@ fetch_register (int regno)
CORE_ADDR regaddr;
register int i;
- if (regno >= num_regs)
+ if (regno >= the_low_target.num_regs)
return;
- if (cannot_fetch_register (regno))
+ if ((*the_low_target.cannot_fetch_register) (regno))
return;
regaddr = register_addr (regno);
@@ -217,7 +296,7 @@ static void
usr_fetch_inferior_registers (int regno)
{
if (regno == -1 || regno == 0)
- for (regno = 0; regno < num_regs; regno++)
+ for (regno = 0; regno < the_low_target.num_regs; regno++)
fetch_register (regno);
else
fetch_register (regno);
@@ -234,10 +313,10 @@ usr_store_inferior_registers (int regno)
if (regno >= 0)
{
- if (regno >= num_regs)
+ if (regno >= the_low_target.num_regs)
return;
- if (cannot_store_register (regno))
+ if ((*the_low_target.cannot_store_register) (regno) == 1)
return;
regaddr = register_addr (regno);
@@ -251,20 +330,21 @@ usr_store_inferior_registers (int regno)
*(int *) (register_data (regno) + i));
if (errno != 0)
{
- /* Warning, not error, in case we are attached; sometimes the
- kernel doesn't let us at the registers. */
- char *err = strerror (errno);
- char *msg = alloca (strlen (err) + 128);
- sprintf (msg, "writing register %d: %s",
- regno, err);
- error (msg);
- return;
+ if ((*the_low_target.cannot_store_register) (regno) == 0)
+ {
+ char *err = strerror (errno);
+ char *msg = alloca (strlen (err) + 128);
+ sprintf (msg, "writing register %d: %s",
+ regno, err);
+ error (msg);
+ return;
+ }
}
regaddr += sizeof (int);
}
}
else
- for (regno = 0; regno < num_regs; regno++)
+ for (regno = 0; regno < the_low_target.num_regs; regno++)
store_inferior_registers (regno);
}
#endif /* HAVE_LINUX_USRREGS */
@@ -292,7 +372,7 @@ regsets_fetch_inferior_registers (void)
}
buf = malloc (regset->size);
- res = ptrace (regset->get_request, inferior_pid, 0, (int) buf);
+ res = ptrace (regset->get_request, inferior_pid, 0, buf);
if (res < 0)
{
if (errno == EIO)
@@ -318,6 +398,7 @@ regsets_fetch_inferior_registers (void)
regset->store_function (buf);
regset ++;
}
+ return 0;
}
static int
@@ -340,7 +421,7 @@ regsets_store_inferior_registers (void)
buf = malloc (regset->size);
regset->fill_function (buf);
- res = ptrace (regset->set_request, inferior_pid, 0, (int) buf);
+ res = ptrace (regset->set_request, inferior_pid, 0, buf);
if (res < 0)
{
if (errno == EIO)
@@ -360,18 +441,19 @@ regsets_store_inferior_registers (void)
}
else
{
- perror ("Warning: ptrace(regsets_fetch_inferior_registers)");
+ perror ("Warning: ptrace(regsets_store_inferior_registers)");
}
}
regset ++;
}
+ return 0;
}
#endif /* HAVE_LINUX_REGSETS */
void
-fetch_inferior_registers (int regno)
+linux_fetch_registers (int regno)
{
#ifdef HAVE_LINUX_REGSETS
if (use_regsets_p)
@@ -386,7 +468,7 @@ fetch_inferior_registers (int regno)
}
void
-store_inferior_registers (int regno)
+linux_store_registers (int regno)
{
#ifdef HAVE_LINUX_REGSETS
if (use_regsets_p)
@@ -404,8 +486,8 @@ store_inferior_registers (int regno)
/* Copy LEN bytes from inferior's memory starting at MEMADDR
to debugger memory starting at MYADDR. */
-void
-read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len)
+static void
+linux_read_memory (CORE_ADDR memaddr, char *myaddr, int len)
{
register int i;
/* Round starting address down to longword boundary. */
@@ -433,8 +515,8 @@ read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len)
On failure (cannot write the inferior)
returns the value of errno. */
-int
-write_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len)
+static int
+linux_write_memory (CORE_ADDR memaddr, const char *myaddr, int len)
{
register int i;
/* Round starting address down to longword boundary. */
@@ -476,9 +558,33 @@ write_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len)
return 0;
}
+
+static void
+linux_look_up_symbols (void)
+{
+ /* Don't need to look up any symbols yet. */
+}
+
+static struct target_ops linux_target_ops = {
+ linux_create_inferior,
+ linux_attach,
+ linux_kill,
+ linux_thread_alive,
+ linux_resume,
+ linux_wait,
+ linux_fetch_registers,
+ linux_store_registers,
+ linux_read_memory,
+ linux_write_memory,
+ linux_look_up_symbols,
+};
+
void
initialize_low (void)
{
+ set_target_ops (&linux_target_ops);
+ set_breakpoint_data (the_low_target.breakpoint,
+ the_low_target.breakpoint_len);
init_registers ();
}
diff --git a/gdb/gdbserver/linux-low.h b/gdb/gdbserver/linux-low.h
index 421fa22..b484982 100644
--- a/gdb/gdbserver/linux-low.h
+++ b/gdb/gdbserver/linux-low.h
@@ -18,13 +18,6 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#ifdef HAVE_LINUX_USR_REGISTERS
-extern int regmap[];
-extern int num_regs;
-int cannot_fetch_register (int regno);
-int cannot_store_register (int regno);
-#endif
-
#ifdef HAVE_LINUX_REGSETS
typedef void (*regset_func) (void *);
struct regset_info
@@ -35,3 +28,22 @@ struct regset_info
};
extern struct regset_info target_regsets[];
#endif
+
+struct linux_target_ops
+{
+ int num_regs;
+ int *regmap;
+ int (*cannot_fetch_register) (int);
+
+ /* Returns 0 if we can store the register, 1 if we can not
+ store the register, and 2 if failure to store the register
+ is acceptable. */
+ int (*cannot_store_register) (int);
+ CORE_ADDR (*stop_pc) (void);
+ void (*set_pc) (CORE_ADDR newpc);
+ const char *breakpoint;
+ int breakpoint_len;
+ CORE_ADDR (*breakpoint_reinsert_addr) (void);
+};
+
+extern struct linux_target_ops the_low_target;
diff --git a/gdb/gdbserver/linux-m68k-low.c b/gdb/gdbserver/linux-m68k-low.c
index 9e59fbd..760de6e 100644
--- a/gdb/gdbserver/linux-m68k-low.c
+++ b/gdb/gdbserver/linux-m68k-low.c
@@ -26,10 +26,10 @@
#include <sys/reg.h>
#endif
-int num_regs = 31;
+#define m68k_num_regs 31
/* This table must line up with REGISTER_NAMES in tm-m68k.h */
-int regmap[] =
+static int m68k_regmap[] =
{
#ifdef PT_D0
PT_D0 * 4, PT_D1 * 4, PT_D2 * 4, PT_D3 * 4,
@@ -52,14 +52,21 @@ int regmap[] =
#endif
};
-int
-cannot_store_register (int regno)
+static int
+m68k_cannot_store_register (int regno)
{
- return (regno >= num_regs);
+ return (regno >= m68k_num_regs);
}
-int
-cannot_fetch_register (int regno)
+static int
+m68k_cannot_fetch_register (int regno)
{
- return (regno >= num_regs);
+ return (regno >= m68k_num_regs);
}
+
+struct linux_target_ops the_low_target = {
+ m68k_num_regs,
+ m68k_regmap,
+ m68k_cannot_fetch_register,
+ m68k_cannot_store_register,
+};
diff --git a/gdb/gdbserver/linux-mips-low.c b/gdb/gdbserver/linux-mips-low.c
index a9114d3..f721ec9 100644
--- a/gdb/gdbserver/linux-mips-low.c
+++ b/gdb/gdbserver/linux-mips-low.c
@@ -26,14 +26,14 @@
#include <sys/reg.h>
#endif
-int num_regs = 90;
+#define mips_num_regs 90
#include <asm/ptrace.h>
/* Return the ptrace ``address'' of register REGNO. */
/* Matches mips_generic32_regs */
-int regmap[] = {
+static int mips_regmap[] = {
0, 1, 2, 3, 4, 5, 6, 7,
8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23,
@@ -63,10 +63,10 @@ int regmap[] = {
ZERO_REGNUM. We also can not set BADVADDR, CAUSE, or FCRIR via
ptrace(). */
-int
-cannot_fetch_register (int regno)
+static int
+mips_cannot_fetch_register (int regno)
{
- if (regmap[regno] == -1)
+ if (mips_regmap[regno] == -1)
return 1;
if (find_regno ("zero") == regno)
@@ -75,10 +75,10 @@ cannot_fetch_register (int regno)
return 0;
}
-int
-cannot_store_register (int regno)
+static int
+mips_cannot_store_register (int regno)
{
- if (regmap[regno] == -1)
+ if (mips_regmap[regno] == -1)
return 1;
if (find_regno ("zero") == regno)
@@ -95,3 +95,10 @@ cannot_store_register (int regno)
return 0;
}
+
+struct linux_target_ops the_low_target = {
+ mips_num_regs,
+ mips_regmap,
+ mips_cannot_fetch_register,
+ mips_cannot_store_register,
+};
diff --git a/gdb/gdbserver/linux-ppc-low.c b/gdb/gdbserver/linux-ppc-low.c
index dcefa59..7cb315a 100644
--- a/gdb/gdbserver/linux-ppc-low.c
+++ b/gdb/gdbserver/linux-ppc-low.c
@@ -25,10 +25,10 @@
#include <asm/ptrace.h>
-int num_regs = 71;
+#define ppc_num_regs 71
/* Currently, don't check/send MQ. */
-int regmap[] =
+static int ppc_regmap[] =
{PT_R0 * 4, PT_R1 * 4, PT_R2 * 4, PT_R3 * 4,
PT_R4 * 4, PT_R5 * 4, PT_R6 * 4, PT_R7 * 4,
PT_R8 * 4, PT_R9 * 4, PT_R10 * 4, PT_R11 * 4,
@@ -46,17 +46,27 @@ int regmap[] =
PT_FPR0*4+192, PT_FPR0*4+200, PT_FPR0*4+208, PT_FPR0*4+216,
PT_FPR0*4+224, PT_FPR0*4+232, PT_FPR0*4+240, PT_FPR0*4+248,
PT_NIP * 4, PT_MSR * 4, PT_CCR * 4, PT_LNK * 4,
- PT_CTR * 4, PT_XER * 4, -1, };
+ PT_CTR * 4, PT_XER * 4, PT_FPSCR * 4, };
-int
-cannot_store_register (int regno)
+static int
+ppc_cannot_store_register (int regno)
{
+ /* Some kernels do not allow us to store fpscr. */
+ if (regno == find_regno ("fpscr"))
+ return 2;
+
return 0;
}
-int
-cannot_fetch_register (int regno)
+static int
+ppc_cannot_fetch_register (int regno)
{
return 0;
}
+struct linux_target_ops the_low_target = {
+ ppc_num_regs,
+ ppc_regmap,
+ ppc_cannot_fetch_register,
+ ppc_cannot_store_register,
+};
diff --git a/gdb/gdbserver/linux-s390-low.c b/gdb/gdbserver/linux-s390-low.c
index 1920b9c..8d800ae 100644
--- a/gdb/gdbserver/linux-s390-low.c
+++ b/gdb/gdbserver/linux-s390-low.c
@@ -27,9 +27,9 @@
#include <asm/ptrace.h>
-int num_regs = 67;
+#define s390_num_regs 67
-int regmap[] = {
+static int s390_regmap[] = {
PT_PSWMASK, PT_PSWADDR,
PT_GPR0, PT_GPR1, PT_GPR2, PT_GPR3,
@@ -62,20 +62,27 @@ int regmap[] = {
#endif
};
-int
-cannot_fetch_register (int regno)
+static int
+s390_cannot_fetch_register (int regno)
{
- if (regmap[regno] == -1)
+ if (s390_regmap[regno] == -1)
return 1;
return 0;
}
-int
-cannot_store_register (int regno)
+static int
+s390_cannot_store_register (int regno)
{
- if (regmap[regno] == -1)
+ if (s390_regmap[regno] == -1)
return 1;
return 0;
}
+
+struct linux_target_ops the_low_target = {
+ s390_num_regs,
+ s390_regmap,
+ s390_cannot_fetch_register,
+ s390_cannot_store_register,
+};
diff --git a/gdb/gdbserver/linux-sh-low.c b/gdb/gdbserver/linux-sh-low.c
index f763339..cdc390d 100644
--- a/gdb/gdbserver/linux-sh-low.c
+++ b/gdb/gdbserver/linux-sh-low.c
@@ -28,10 +28,10 @@
#include <asm/ptrace.h>
-int num_regs = 41;
+#define sh_num_regs 41
/* Currently, don't check/send MQ. */
-int regmap[] = {
+static int sh_regmap[] = {
0, 4, 8, 12, 16, 20, 24, 28,
32, 36, 40, 44, 48, 52, 56, 60,
@@ -45,15 +45,21 @@ int regmap[] = {
REG_FPREG0+48, REG_FPREG0+52, REG_FPREG0+56, REG_FPREG0+60,
};
-int
-cannot_store_register (int regno)
+static int
+sh_cannot_store_register (int regno)
{
return 0;
}
-int
-cannot_fetch_register (int regno)
+static int
+sh_cannot_fetch_register (int regno)
{
return 0;
}
+struct linux_target_ops the_low_target = {
+ sh_num_regs,
+ sh_regmap,
+ sh_cannot_fetch_register,
+ sh_cannot_store_register,
+};
diff --git a/gdb/gdbserver/linux-x86-64-low.c b/gdb/gdbserver/linux-x86-64-low.c
index ffb0ce7..e124890 100644
--- a/gdb/gdbserver/linux-x86-64-low.c
+++ b/gdb/gdbserver/linux-x86-64-low.c
@@ -28,12 +28,15 @@
#include <sys/procfs.h>
#include <sys/ptrace.h>
-static int regmap[] = {
- RAX, RDX, RCX, RBX,
+#define X86_64_NUM_GREGS 22
+
+static int x86_64_regmap[X86_64_NUM_GREGS] = {
+ RAX, RBX, RCX, RDX,
RSI, RDI, RBP, RSP,
R8, R9, R10, R11,
R12, R13, R14, R15,
- RIP, EFLAGS
+ RIP, EFLAGS,
+ DS, ES, FS, GS
};
static void
@@ -41,8 +44,8 @@ x86_64_fill_gregset (void *buf)
{
int i;
- for (i = 0; i < 18; i++)
- collect_register (i, ((char *) buf) + regmap[i]);
+ for (i = 0; i < X86_64_NUM_GREGS; i++)
+ collect_register (i, ((char *) buf) + x86_64_regmap[i]);
}
static void
@@ -50,8 +53,8 @@ x86_64_store_gregset (void *buf)
{
int i;
- for (i = 0; i < 18; i++)
- supply_register (i, ((char *) buf) + regmap[i]);
+ for (i = 0; i < X86_64_NUM_GREGS; i++)
+ supply_register (i, ((char *) buf) + x86_64_regmap[i]);
}
static void
@@ -66,7 +69,6 @@ x86_64_store_fpregset (void *buf)
i387_fxsave_to_cache (buf);
}
-
struct regset_info target_regsets[] = {
{ PTRACE_GETREGS, PTRACE_SETREGS, sizeof (elf_gregset_t),
x86_64_fill_gregset, x86_64_store_gregset },
@@ -74,3 +76,10 @@ struct regset_info target_regsets[] = {
x86_64_fill_fpregset, x86_64_store_fpregset },
{ 0, 0, -1, NULL, NULL }
};
+
+struct linux_target_ops the_low_target = {
+ -1,
+ NULL,
+ NULL,
+ NULL,
+};
diff --git a/gdb/gdbserver/mem-break.c b/gdb/gdbserver/mem-break.c
new file mode 100644
index 0000000..91addf6
--- /dev/null
+++ b/gdb/gdbserver/mem-break.c
@@ -0,0 +1,280 @@
+/* Memory breakpoint operations for the remote server for GDB.
+ Copyright 2002
+ Free Software Foundation, Inc.
+
+ Contributed by MontaVista Software.
+
+ 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 "server.h"
+
+const char *breakpoint_data;
+int breakpoint_len;
+
+#define MAX_BREAKPOINT_LEN 8
+
+struct breakpoint
+{
+ struct breakpoint *next;
+ CORE_ADDR pc;
+ unsigned char old_data[MAX_BREAKPOINT_LEN];
+
+ /* Non-zero iff we are stepping over this breakpoint. */
+ int reinserting;
+
+ /* Non-NULL iff this breakpoint was inserted to step over
+ another one. Points to the other breakpoint (which is also
+ in the *next chain somewhere). */
+ struct breakpoint *breakpoint_to_reinsert;
+
+ /* Function to call when we hit this breakpoint. */
+ void (*handler) (CORE_ADDR);
+};
+
+struct breakpoint *breakpoints;
+
+void
+set_breakpoint_at (CORE_ADDR where, void (*handler) (CORE_ADDR))
+{
+ struct breakpoint *bp;
+
+ if (breakpoint_data == NULL)
+ error ("Target does not support breakpoints.");
+
+ bp = malloc (sizeof (struct breakpoint));
+ memset (bp, 0, sizeof (struct breakpoint));
+
+ (*the_target->read_memory) (where, bp->old_data,
+ breakpoint_len);
+ (*the_target->write_memory) (where, breakpoint_data,
+ breakpoint_len);
+
+ bp->pc = where;
+ bp->handler = handler;
+
+ bp->next = breakpoints;
+ breakpoints = bp;
+}
+
+static void
+delete_breakpoint (struct breakpoint *bp)
+{
+ struct breakpoint *cur;
+
+ if (breakpoints == bp)
+ {
+ breakpoints = bp->next;
+ (*the_target->write_memory) (bp->pc, bp->old_data,
+ breakpoint_len);
+ free (bp);
+ return;
+ }
+ cur = breakpoints;
+ while (cur->next)
+ {
+ if (cur->next == bp)
+ {
+ cur->next = bp->next;
+ (*the_target->write_memory) (bp->pc, bp->old_data,
+ breakpoint_len);
+ free (bp);
+ return;
+ }
+ }
+ warning ("Could not find breakpoint in list.");
+}
+
+static struct breakpoint *
+find_breakpoint_at (CORE_ADDR where)
+{
+ struct breakpoint *bp = breakpoints;
+
+ while (bp != NULL)
+ {
+ if (bp->pc == where)
+ return bp;
+ bp = bp->next;
+ }
+
+ return NULL;
+}
+
+static void
+reinsert_breakpoint_handler (CORE_ADDR stop_pc)
+{
+ struct breakpoint *stop_bp, *orig_bp;
+
+ stop_bp = find_breakpoint_at (stop_pc);
+ if (stop_bp == NULL)
+ error ("lost the stopping breakpoint.");
+
+ orig_bp = stop_bp->breakpoint_to_reinsert;
+ if (orig_bp == NULL)
+ error ("no breakpoint to reinsert");
+
+ (*the_target->write_memory) (orig_bp->pc, breakpoint_data,
+ breakpoint_len);
+ orig_bp->reinserting = 0;
+ delete_breakpoint (stop_bp);
+}
+
+void
+reinsert_breakpoint_by_bp (CORE_ADDR stop_pc, CORE_ADDR stop_at)
+{
+ struct breakpoint *bp, *orig_bp;
+
+ set_breakpoint_at (stop_at, reinsert_breakpoint_handler);
+
+ orig_bp = find_breakpoint_at (stop_at);
+ if (orig_bp == NULL)
+ error ("Could not find original breakpoint in list.");
+
+ bp = find_breakpoint_at (stop_at);
+ if (bp == NULL)
+ error ("Could not find breakpoint in list (reinserting by breakpoint).");
+ bp->breakpoint_to_reinsert = orig_bp;
+
+ (*the_target->write_memory) (orig_bp->pc, orig_bp->old_data,
+ breakpoint_len);
+ orig_bp->reinserting = 1;
+}
+
+void
+uninsert_breakpoint (CORE_ADDR stopped_at)
+{
+ struct breakpoint *bp;
+
+ bp = find_breakpoint_at (stopped_at);
+ if (bp == NULL)
+ error ("Could not find breakpoint in list (uninserting).");
+
+ (*the_target->write_memory) (bp->pc, bp->old_data,
+ breakpoint_len);
+ bp->reinserting = 1;
+}
+
+void
+reinsert_breakpoint (CORE_ADDR stopped_at)
+{
+ struct breakpoint *bp;
+
+ bp = find_breakpoint_at (stopped_at);
+ if (bp == NULL)
+ error ("Could not find breakpoint in list (uninserting).");
+ if (! bp->reinserting)
+ error ("Breakpoint already inserted at reinsert time.");
+
+ (*the_target->write_memory) (bp->pc, breakpoint_data,
+ breakpoint_len);
+ bp->reinserting = 0;
+}
+
+int
+check_breakpoints (CORE_ADDR stop_pc)
+{
+ struct breakpoint *bp;
+
+ bp = find_breakpoint_at (stop_pc);
+ if (bp == NULL)
+ return 0;
+ if (bp->reinserting)
+ {
+ warning ("Hit a removed breakpoint?");
+ return 0;
+ }
+
+ (*bp->handler) (bp->pc);
+ return 1;
+}
+
+void
+set_breakpoint_data (const char *bp_data, int bp_len)
+{
+ breakpoint_data = bp_data;
+ breakpoint_len = bp_len;
+}
+
+void
+check_mem_read (CORE_ADDR mem_addr, char *buf, int mem_len)
+{
+ struct breakpoint *bp = breakpoints;
+ CORE_ADDR mem_end = mem_addr + mem_len;
+
+ for (; bp != NULL; bp = bp->next)
+ {
+ CORE_ADDR bp_end = bp->pc + breakpoint_len;
+ CORE_ADDR start, end;
+ int copy_offset, copy_len, buf_offset;
+
+ if (mem_addr >= bp_end)
+ continue;
+ if (bp->pc >= mem_end)
+ continue;
+
+ start = bp->pc;
+ if (mem_addr > start)
+ start = mem_addr;
+
+ end = bp_end;
+ if (end > mem_end)
+ end = mem_end;
+
+ copy_len = end - start;
+ copy_offset = start - bp->pc;
+ buf_offset = start - mem_addr;
+
+ memcpy (buf + buf_offset, bp->old_data + copy_offset, copy_len);
+ }
+}
+
+void
+check_mem_write (CORE_ADDR mem_addr, char *buf, int mem_len)
+{
+ struct breakpoint *bp = breakpoints;
+ CORE_ADDR mem_end = mem_addr + mem_len;
+
+ for (; bp != NULL; bp = bp->next)
+ {
+ CORE_ADDR bp_end = bp->pc + breakpoint_len;
+ CORE_ADDR start, end;
+ int copy_offset, copy_len, buf_offset;
+
+ if (mem_addr >= bp_end)
+ continue;
+ if (bp->pc >= mem_end)
+ continue;
+
+ start = bp->pc;
+ if (mem_addr > start)
+ start = mem_addr;
+
+ end = bp_end;
+ if (end > mem_end)
+ end = mem_end;
+
+ copy_len = end - start;
+ copy_offset = start - bp->pc;
+ buf_offset = start - mem_addr;
+
+ memcpy (bp->old_data + copy_offset, buf + buf_offset, copy_len);
+ if (bp->reinserting == 0)
+ memcpy (buf + buf_offset, breakpoint_data + copy_offset, copy_len);
+ }
+}
+
+
diff --git a/gdb/gdbserver/mem-break.h b/gdb/gdbserver/mem-break.h
new file mode 100644
index 0000000..356e763
--- /dev/null
+++ b/gdb/gdbserver/mem-break.h
@@ -0,0 +1,71 @@
+/* Memory breakpoint interfaces for the remote server for GDB.
+ Copyright 2002
+ Free Software Foundation, Inc.
+
+ Contributed by MontaVista Software.
+
+ 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. */
+
+#ifndef MEM_BREAK_H
+#define MEM_BREAK_H
+
+/* Breakpoints are opaque. */
+
+/* Create a new breakpoint at WHERE, and call HANDLER when
+ it is hit. */
+
+void set_breakpoint_at (CORE_ADDR where,
+ void (*handler) (CORE_ADDR));
+
+/* Create a reinsertion breakpoint at STOP_AT for the breakpoint
+ currently at STOP_PC (and temporarily remove the breakpoint at
+ STOP_PC). */
+
+void reinsert_breakpoint_by_bp (CORE_ADDR stop_pc, CORE_ADDR stop_at);
+
+/* Change the status of the breakpoint at WHERE to inserted. */
+
+void reinsert_breakpoint (CORE_ADDR where);
+
+/* Change the status of the breakpoint at WHERE to uninserted. */
+
+void uninsert_breakpoint (CORE_ADDR where);
+
+/* See if any breakpoint claims ownership of STOP_PC. Call the handler for
+ the breakpoint, if found. */
+
+int check_breakpoints (CORE_ADDR stop_pc);
+
+/* See if any breakpoints shadow the target memory area from MEM_ADDR
+ to MEM_ADDR + MEM_LEN. Update the data already read from the target
+ (in BUF) if necessary. */
+
+void check_mem_read (CORE_ADDR mem_addr, char *buf, int mem_len);
+
+/* See if any breakpoints shadow the target memory area from MEM_ADDR
+ to MEM_ADDR + MEM_LEN. Update the data to be written to the target
+ (in BUF) if necessary, as well as the original data for any breakpoints. */
+
+void check_mem_write (CORE_ADDR mem_addr, char *buf, int mem_len);
+
+/* Set the byte pattern to insert for memory breakpoints. This function
+ must be called before any breakpoints are set. */
+
+void set_breakpoint_data (const char *bp_data, int bp_len);
+
+#endif /* MEM_BREAK_H */
diff --git a/gdb/gdbserver/regcache.c b/gdb/gdbserver/regcache.c
index bec20bb..701d092 100644
--- a/gdb/gdbserver/regcache.c
+++ b/gdb/gdbserver/regcache.c
@@ -25,7 +25,11 @@
#include <stdlib.h>
#include <string.h>
-static char *registers;
+struct inferior_regcache_data
+{
+ char *registers;
+};
+
static int register_bytes;
static struct reg *reg_defs;
@@ -33,6 +37,19 @@ static int num_registers;
const char **gdbserver_expedite_regs;
+static struct inferior_regcache_data *
+get_regcache (struct inferior_info *inf)
+{
+ struct inferior_regcache_data *regcache;
+
+ regcache = (struct inferior_regcache_data *) inferior_regcache_data (inf);
+
+ if (regcache == NULL)
+ fatal ("no register cache");
+
+ return regcache;
+}
+
int
registers_length (void)
{
@@ -40,6 +57,28 @@ registers_length (void)
}
void
+create_register_cache (struct inferior_info *inferior)
+{
+ struct inferior_regcache_data *regcache;
+
+ regcache = malloc (sizeof (*regcache));
+
+ regcache->registers = malloc (register_bytes);
+ if (regcache->registers == NULL)
+ fatal ("Could not allocate register cache.");
+
+ set_inferior_regcache_data (inferior, regcache);
+}
+
+void
+free_register_cache (struct inferior_info *inferior)
+{
+ free (get_regcache (current_inferior)->registers);
+ free (get_regcache (current_inferior));
+ set_inferior_regcache_data (inferior, NULL);
+}
+
+void
set_register_cache (struct reg *regs, int n)
{
int offset, i;
@@ -55,14 +94,13 @@ set_register_cache (struct reg *regs, int n)
}
register_bytes = offset / 8;
- registers = malloc (offset / 8);
- if (!registers)
- fatal ("Could not allocate register cache.");
}
void
registers_to_string (char *buf)
{
+ char *registers = get_regcache (current_inferior)->registers;
+
convert_int_to_ascii (registers, buf, register_bytes);
}
@@ -70,6 +108,7 @@ void
registers_from_string (char *buf)
{
int len = strlen (buf);
+ char *registers = get_regcache (current_inferior)->registers;
if (len != register_bytes * 2)
{
@@ -119,29 +158,31 @@ register_size (int n)
char *
register_data (int n)
{
+ char *registers = get_regcache (current_inferior)->registers;
+
return registers + (reg_defs[n].offset / 8);
}
void
-supply_register (int n, const char *buf)
+supply_register (int n, const void *buf)
{
memcpy (register_data (n), buf, register_size (n));
}
void
-supply_register_by_name (const char *name, const char *buf)
+supply_register_by_name (const char *name, const void *buf)
{
supply_register (find_regno (name), buf);
}
void
-collect_register (int n, char *buf)
+collect_register (int n, void *buf)
{
memcpy (buf, register_data (n), register_size (n));
}
void
-collect_register_by_name (const char *name, char *buf)
+collect_register_by_name (const char *name, void *buf)
{
collect_register (find_regno (name), buf);
}
diff --git a/gdb/gdbserver/regcache.h b/gdb/gdbserver/regcache.h
index 07195b3..362288e 100644
--- a/gdb/gdbserver/regcache.h
+++ b/gdb/gdbserver/regcache.h
@@ -21,6 +21,16 @@
#ifndef REGCACHE_H
#define REGCACHE_H
+struct inferior_info;
+
+/* Create a new register cache for INFERIOR. */
+
+void create_register_cache (struct inferior_info *inferior);
+
+/* Release all memory associated with the register cache for INFERIOR. */
+
+void free_register_cache (struct inferior_info *inferior);
+
/* Convert all registers to a string in the currently specified remote
format. */
@@ -46,4 +56,12 @@ int find_regno (const char *name);
extern const char **gdbserver_expedite_regs;
+void supply_register (int n, const void *buf);
+
+void supply_register_by_name (const char *name, const void *buf);
+
+void collect_register (int n, void *buf);
+
+void collect_register_by_name (const char *name, void *buf);
+
#endif /* REGCACHE_H */
diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c
index ff1718f..14734f1 100644
--- a/gdb/gdbserver/remote-utils.c
+++ b/gdb/gdbserver/remote-utils.c
@@ -35,6 +35,7 @@
#include <fcntl.h>
#include <sys/time.h>
#include <unistd.h>
+#include <arpa/inet.h>
int remote_debug = 0;
struct ui_file *gdb_stdlog;
@@ -48,7 +49,7 @@ void
remote_open (char *name)
{
int save_fcntl_flags;
-
+
if (!strchr (name, ':'))
{
remote_desc = open (name, O_RDWR);
@@ -99,7 +100,7 @@ remote_open (char *name)
}
#endif
-
+ fprintf (stderr, "Remote debugging using %s\n", name);
}
else
{
@@ -107,7 +108,6 @@ remote_open (char *name)
int port;
struct sockaddr_in sockaddr;
int tmp;
- struct protoent *protoent;
int tmp_desc;
port_str = strchr (name, ':');
@@ -136,10 +136,6 @@ remote_open (char *name)
if (remote_desc == -1)
perror_with_name ("Accept failed");
- protoent = getprotobyname ("tcp");
- if (!protoent)
- perror_with_name ("getprotobyname");
-
/* Enable TCP keep alive process. */
tmp = 1;
setsockopt (tmp_desc, SOL_SOCKET, SO_KEEPALIVE, (char *) &tmp, sizeof (tmp));
@@ -147,13 +143,17 @@ remote_open (char *name)
/* Tell TCP not to delay small packets. This greatly speeds up
interactive response. */
tmp = 1;
- setsockopt (remote_desc, protoent->p_proto, TCP_NODELAY,
+ setsockopt (remote_desc, IPPROTO_TCP, TCP_NODELAY,
(char *) &tmp, sizeof (tmp));
close (tmp_desc); /* No longer need this */
signal (SIGPIPE, SIG_IGN); /* If we don't do this, then gdbserver simply
exits when the remote side dies. */
+
+ /* Convert IP address to string. */
+ fprintf (stderr, "Remote debugging from host %s\n",
+ inet_ntoa (sockaddr.sin_addr));
}
#if defined(F_SETFL) && defined (FASYNC)
@@ -164,7 +164,6 @@ remote_open (char *name)
#endif
#endif
disable_async_io ();
- fprintf (stderr, "Remote debugging using %s\n", name);
}
void
@@ -187,6 +186,42 @@ fromhex (int a)
return 0;
}
+int
+unhexify (char *bin, const char *hex, int count)
+{
+ int i;
+
+ for (i = 0; i < count; i++)
+ {
+ if (hex[0] == 0 || hex[1] == 0)
+ {
+ /* Hex string is short, or of uneven length.
+ Return the count that has been converted so far. */
+ return i;
+ }
+ *bin++ = fromhex (hex[0]) * 16 + fromhex (hex[1]);
+ hex += 2;
+ }
+ return i;
+}
+
+static void
+decode_address (CORE_ADDR *addrp, const char *start, int len)
+{
+ CORE_ADDR addr;
+ char ch;
+ int i;
+
+ addr = 0;
+ for (i = 0; i < len; i++)
+ {
+ ch = start[i];
+ addr = addr << 4;
+ addr = addr | (fromhex (ch) & 0x0f);
+ }
+ *addrp = addr;
+}
+
/* Convert number NIB to a hex digit. */
static int
@@ -198,6 +233,24 @@ tohex (int nib)
return 'a' + nib - 10;
}
+int
+hexify (char *hex, const char *bin, int count)
+{
+ int i;
+
+ /* May use a length, or a nul-terminated string as input. */
+ if (count == 0)
+ count = strlen (bin);
+
+ for (i = 0; i < count; i++)
+ {
+ *hex++ = tohex ((*bin >> 4) & 0xf);
+ *hex++ = tohex (*bin++ & 0xf);
+ }
+ *hex = 0;
+ return i;
+}
+
/* Send a packet to the remote machine, with error checking.
The data of the packet is in BUF. Returns >= 0 on success, -1 otherwise. */
@@ -293,7 +346,7 @@ input_interrupt (int unused)
return;
}
- kill (inferior_pid, SIGINT);
+ kill (signal_pid, SIGINT);
}
}
@@ -465,17 +518,15 @@ outreg (int regno, char *buf)
void
prepare_resume_reply (char *buf, char status, unsigned char signo)
{
- int nib;
+ int nib, sig;
*buf++ = status;
- /* FIXME! Should be converting this signal number (numbered
- according to the signal numbering of the system we are running on)
- to the signal numbers used by the gdb protocol (see enum target_signal
- in gdb/target.h). */
- nib = ((signo & 0xf0) >> 4);
+ sig = (int)target_signal_from_host (signo);
+
+ nib = ((sig & 0xf0) >> 4);
*buf++ = tohex (nib);
- nib = signo & 0x0f;
+ nib = sig & 0x0f;
*buf++ = tohex (nib);
if (status == 'T')
@@ -547,3 +598,42 @@ decode_M_packet (char *from, CORE_ADDR *mem_addr_ptr, unsigned int *len_ptr,
convert_ascii_to_int (&from[i++], to, *len_ptr);
}
+
+int
+look_up_one_symbol (const char *name, CORE_ADDR *addrp)
+{
+ char own_buf[266], *p, *q;
+ int len;
+
+ /* Send the request. */
+ strcpy (own_buf, "qSymbol:");
+ hexify (own_buf + strlen ("qSymbol:"), name, strlen (name));
+ if (putpkt (own_buf) < 0)
+ return -1;
+
+ /* FIXME: Eventually add buffer overflow checking (to getpkt?) */
+ len = getpkt (own_buf);
+ if (len < 0)
+ return -1;
+
+ if (strncmp (own_buf, "qSymbol:", strlen ("qSymbol:")) != 0)
+ {
+ /* Malformed response. */
+ if (remote_debug)
+ fprintf (stderr, "Malformed response to qSymbol, ignoring.\n");
+ return -1;
+ }
+
+ p = own_buf + strlen ("qSymbol:");
+ q = p;
+ while (*q && *q != ':')
+ q++;
+
+ /* Make sure we found a value for the symbol. */
+ if (p == q || *q == '\0')
+ return 0;
+
+ decode_address (addrp, p, q - p);
+ return 1;
+}
+
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index d845422..ba85b59 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -27,13 +27,14 @@ int thread_from_wait;
int old_thread_from_wait;
int extended_protocol;
jmp_buf toplevel;
-int inferior_pid;
static unsigned char
start_inferior (char *argv[], char *statusptr)
{
- inferior_pid = create_inferior (argv[0], argv);
- fprintf (stderr, "Process %s created; pid = %d\n", argv[0], inferior_pid);
+ /* FIXME Check error? Or turn to void. */
+ create_inferior (argv[0], argv);
+ /* FIXME Print pid properly. */
+ fprintf (stderr, "Process %s created; pid = %d\n", argv[0], signal_pid);
/* Wait till we are at 1st instruction in program, return signal number. */
return mywait (statusptr);
@@ -47,8 +48,6 @@ attach_inferior (int pid, char *statusptr, unsigned char *sigptr)
if (myattach (pid) != 0)
return -1;
- inferior_pid = pid;
-
*sigptr = mywait (statusptr);
return 0;
@@ -56,6 +55,26 @@ attach_inferior (int pid, char *statusptr, unsigned char *sigptr)
extern int remote_debug;
+/* Handle all of the extended 'q' packets. */
+void
+handle_query (char *own_buf)
+{
+ if (strcmp ("qSymbol::", own_buf) == 0)
+ {
+ if (the_target->look_up_symbols != NULL)
+ (*the_target->look_up_symbols) ();
+
+ strcpy (own_buf, "OK");
+ return;
+ }
+
+ /* Otherwise we didn't know what packet it was. Say we didn't
+ understand it. */
+ own_buf[0] = 0;
+}
+
+static int attached;
+
int
main (int argc, char *argv[])
{
@@ -64,9 +83,8 @@ main (int argc, char *argv[])
unsigned char signal;
unsigned int len;
CORE_ADDR mem_addr;
- int bad_attach = 0;
- int pid = 0;
- int attached = 0;
+ int bad_attach;
+ int pid;
char *arg_end;
if (setjmp (toplevel))
@@ -75,6 +93,9 @@ main (int argc, char *argv[])
exit (1);
}
+ bad_attach = 0;
+ pid = 0;
+ attached = 0;
if (argc >= 3 && strcmp (argv[2], "--attach") == 0)
{
if (argc == 4
@@ -129,6 +150,9 @@ main (int argc, char *argv[])
ch = own_buf[i++];
switch (ch)
{
+ case 'q':
+ handle_query (own_buf);
+ break;
case 'd':
remote_debug = !remote_debug;
break;
@@ -190,13 +214,21 @@ main (int argc, char *argv[])
break;
case 'C':
convert_ascii_to_int (own_buf + 1, &sig, 1);
- myresume (0, sig);
+ if (target_signal_to_host_p (sig))
+ signal = target_signal_to_host (sig);
+ else
+ signal = 0;
+ myresume (0, signal);
signal = mywait (&status);
prepare_resume_reply (own_buf, status, signal);
break;
case 'S':
convert_ascii_to_int (own_buf + 1, &sig, 1);
- myresume (1, sig);
+ if (target_signal_to_host_p (sig))
+ signal = target_signal_to_host (sig);
+ else
+ signal = 0;
+ myresume (1, signal);
signal = mywait (&status);
prepare_resume_reply (own_buf, status, signal);
break;
diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h
index 6202b0f..32b90b5 100644
--- a/gdb/gdbserver/server.h
+++ b/gdb/gdbserver/server.h
@@ -23,38 +23,65 @@
#define SERVER_H
#include "config.h"
+
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
+#include <setjmp.h>
-
-/* FIXME: Both of these should be autoconf'd for. */
-#define NORETURN
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#ifndef ATTR_NORETURN
+#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7))
+#define ATTR_NORETURN __attribute__ ((noreturn))
+#else
+#define ATTR_NORETURN /* nothing */
+#endif
+#endif
+
+#ifndef ATTR_FORMAT
+#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 4))
+#define ATTR_FORMAT(type, x, y) __attribute__ ((format(type, x, y)))
+#else
+#define ATTR_FORMAT(type, x, y) /* nothing */
+#endif
+#endif
+
+/* FIXME: This should probably be autoconf'd for. It's an integer type at
+ least the size of a (void *). */
typedef long long CORE_ADDR;
+/* Opaque inferior process information. */
+struct inferior_info;
+
#include "regcache.h"
+#include "gdb/signals.h"
-#include <setjmp.h>
+#include "target.h"
+#include "mem-break.h"
/* Target-specific functions */
-int create_inferior (char *program, char **allargs);
-void kill_inferior (void);
-void fetch_inferior_registers (int regno);
-void store_inferior_registers (int regno);
-int mythread_alive (int pid);
-void myresume (int step, int signo);
-unsigned char mywait (char *status);
-void read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len);
-int write_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len);
-int create_inferior ();
void initialize_low ();
/* Target-specific variables */
extern char *registers;
+/* From inferiors.c. */
+
+extern struct inferior_info *current_inferior;
+extern int signal_pid;
+void add_inferior (int pid);
+void clear_inferiors (void);
+void *inferior_target_data (struct inferior_info *);
+void set_inferior_target_data (struct inferior_info *, void *);
+void *inferior_regcache_data (struct inferior_info *);
+void set_inferior_regcache_data (struct inferior_info *, void *);
+
/* Public variables in server.c */
extern int cont_thread;
@@ -63,7 +90,6 @@ extern int thread_from_wait;
extern int old_thread_from_wait;
extern jmp_buf toplevel;
-extern int inferior_pid;
/* Functions from remote-utils.c */
@@ -84,15 +110,26 @@ void decode_m_packet (char *from, CORE_ADDR * mem_addr_ptr,
void decode_M_packet (char *from, CORE_ADDR * mem_addr_ptr,
unsigned int *len_ptr, char *to);
+int unhexify (char *bin, const char *hex, int count);
+int hexify (char *hex, const char *bin, int count);
+
+int look_up_one_symbol (const char *name, CORE_ADDR *addrp);
+
+/* Functions from ``signals.c''. */
+enum target_signal target_signal_from_host (int hostsig);
+int target_signal_to_host_p (enum target_signal oursig);
+int target_signal_to_host (enum target_signal oursig);
/* Functions from utils.c */
void perror_with_name (char *string);
-void error (const char *string,...);
-void fatal (const char *string,...);
+void error (const char *string,...) ATTR_NORETURN;
+void fatal (const char *string,...) ATTR_NORETURN;
void warning (const char *string,...);
+/* Functions from the register cache definition. */
+void init_registers (void);
/* Maximum number of bytes to read/write at once. The value here
is chosen to fill up a packet (the headers account for the 32). */
diff --git a/gdb/gdbserver/target.c b/gdb/gdbserver/target.c
new file mode 100644
index 0000000..53a4c1e
--- /dev/null
+++ b/gdb/gdbserver/target.c
@@ -0,0 +1,47 @@
+/* Target operations for the remote server for GDB.
+ Copyright 2002
+ Free Software Foundation, Inc.
+
+ Contributed by MontaVista Software.
+
+ 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 "server.h"
+
+struct target_ops *the_target;
+
+void
+read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len)
+{
+ (*the_target->read_memory) (memaddr, myaddr, len);
+ check_mem_read (memaddr, myaddr, len);
+}
+
+int
+write_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len)
+{
+ check_mem_write (memaddr, myaddr, len);
+ return (*the_target->write_memory) (memaddr, myaddr, len);
+}
+
+void
+set_target_ops (struct target_ops *target)
+{
+ the_target = (struct target_ops *) malloc (sizeof (*the_target));
+ memcpy (the_target, target, sizeof (*the_target));
+}
diff --git a/gdb/gdbserver/target.h b/gdb/gdbserver/target.h
new file mode 100644
index 0000000..6d06b9f
--- /dev/null
+++ b/gdb/gdbserver/target.h
@@ -0,0 +1,141 @@
+/* Target operations for the remote server for GDB.
+ Copyright 2002
+ Free Software Foundation, Inc.
+
+ Contributed by MontaVista Software.
+
+ 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. */
+
+#ifndef TARGET_H
+#define TARGET_H
+
+struct target_ops
+{
+ /* Start a new process.
+
+ PROGRAM is a path to the program to execute.
+ ARGS is a standard NULL-terminated array of arguments,
+ to be passed to the inferior as ``argv''.
+
+ Returns 0 on success, -1 on failure. Registers the new
+ process with the process list. */
+
+ int (*create_inferior) (char *program, char **args);
+
+ /* Attach to a running process.
+
+ PID is the process ID to attach to, specified by the user
+ or a higher layer. */
+
+ int (*attach) (int pid);
+
+ /* Kill all inferiors. */
+
+ void (*kill) (void);
+
+ /* Return 1 iff the thread with process ID PID is alive. */
+
+ int (*thread_alive) (int pid);
+
+ /* Resume the inferior process.
+
+ If STEP is non-zero, we want to single-step.
+
+ If SIGNAL is nonzero, send the process that signal as we resume it.
+ */
+
+ void (*resume) (int step, int signo);
+
+ /* Wait for the inferior process to change state.
+
+ STATUSP will be filled in with a response code to send to GDB.
+
+ Returns the signal which caused the process to stop. */
+
+ unsigned char (*wait) (char *status);
+
+ /* Fetch registers from the inferior process.
+
+ If REGNO is -1, fetch all registers; otherwise, fetch at least REGNO. */
+
+ void (*fetch_registers) (int regno);
+
+ /* Store registers to the inferior process.
+
+ If REGNO is -1, store all registers; otherwise, store at least REGNO. */
+
+ void (*store_registers) (int regno);
+
+ /* Read memory from the inferior process. This should generally be
+ called through read_inferior_memory, which handles breakpoint shadowing.
+
+ Read LEN bytes at MEMADDR into a buffer at MYADDR. */
+
+ void (*read_memory) (CORE_ADDR memaddr, char *myaddr, int len);
+
+ /* Write memory to the inferior process. This should generally be
+ called through write_inferior_memory, which handles breakpoint shadowing.
+
+ Write LEN bytes from the buffer at MYADDR to MEMADDR.
+
+ Returns 0 on success and errno on failure. */
+
+ int (*write_memory) (CORE_ADDR memaddr, const char *myaddr, int len);
+
+ /* Query GDB for the values of any symbols we're interested in.
+ This function is called whenever we receive a "qSymbols::"
+ query, which corresponds to every time more symbols (might)
+ become available. NULL if we aren't interested in any
+ symbols. */
+
+ void (*look_up_symbols) (void);
+};
+
+extern struct target_ops *the_target;
+
+void set_target_ops (struct target_ops *);
+
+#define create_inferior(program, args) \
+ (*the_target->create_inferior) (program, args)
+
+#define myattach(pid) \
+ (*the_target->attach) (pid)
+
+#define kill_inferior() \
+ (*the_target->kill) ()
+
+#define mythread_alive(pid) \
+ (*the_target->thread_alive) (pid)
+
+#define myresume(step,signo) \
+ (*the_target->resume) (step, signo)
+
+#define mywait(statusp) \
+ (*the_target->wait) (statusp)
+
+#define fetch_inferior_registers(regno) \
+ (*the_target->fetch_registers) (regno)
+
+#define store_inferior_registers(regno) \
+ (*the_target->store_registers) (regno)
+
+void read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len);
+
+int write_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len);
+
+#endif /* TARGET_H */
diff --git a/gdb/gdbserver/utils.c b/gdb/gdbserver/utils.c
index a8ea9a1..e13eda8 100644
--- a/gdb/gdbserver/utils.c
+++ b/gdb/gdbserver/utils.c
@@ -57,7 +57,7 @@ perror_with_name (char *string)
STRING is the error message, used as a fprintf string,
and ARG is passed as an argument to it. */
-NORETURN void
+void
error (const char *string,...)
{
extern jmp_buf toplevel;
@@ -74,7 +74,7 @@ error (const char *string,...)
STRING and ARG are passed to fprintf. */
/* VARARGS */
-NORETURN void
+void
fatal (const char *string,...)
{
va_list args;
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index a13847e..ccff12f 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -71,6 +71,17 @@ struct type *builtin_type_uint64;
struct type *builtin_type_int128;
struct type *builtin_type_uint128;
struct type *builtin_type_bool;
+
+/* 128 bit long vector types */
+struct type *builtin_type_v4_float;
+struct type *builtin_type_v4_int32;
+struct type *builtin_type_v8_int16;
+struct type *builtin_type_v16_int8;
+/* 64 bit long vector types */
+struct type *builtin_type_v2_int32;
+struct type *builtin_type_v4_int16;
+struct type *builtin_type_v8_int8;
+
struct type *builtin_type_v4sf;
struct type *builtin_type_v4si;
struct type *builtin_type_v16qi;
@@ -521,10 +532,16 @@ finish_cv_type (struct type *type)
/* Replace the contents of ntype with the type *type.
- This function should not be necessary, but is due to quirks in the stabs
- reader. This should go away. It does not handle the replacement type
- being cv-qualified; it could be easily fixed to, but it should go away,
- remember? */
+ In order to build recursive types, it's inevitable that we'll need
+ to update types in place --- but this sort of indiscriminate
+ smashing is ugly, and needs to be replaced with something more
+ controlled. For example, Daniel Jacobowitz has suggested moving
+ the fields common to a set of c/v variants into their own object,
+ which the variants would share.
+
+ This function does not handle the replacement type being
+ cv-qualified; it could be easily fixed to, but it would be better
+ to just change the whole approach. */
void
replace_type (struct type *ntype, struct type *type)
{
@@ -777,7 +794,6 @@ create_set_type (struct type *result_type, struct type *domain_type)
return (result_type);
}
-
/* Construct and return a type of the form:
struct NAME { ELT_TYPE ELT_NAME[N]; }
We use these types for SIMD registers. For example, the type of
@@ -793,25 +809,27 @@ init_simd_type (char *name,
char *elt_name,
int n)
{
- struct type *t;
- struct field *f;
-
- /* Build the field structure. */
- f = xmalloc (sizeof (*f));
- memset (f, 0, sizeof (*f));
- f->loc.bitpos = 0;
- f->type = create_array_type (0, elt_type,
- create_range_type (0, builtin_type_int,
- 0, n-1));
- f->name = elt_name;
-
- /* Build a struct type with that field. */
- t = init_type (TYPE_CODE_STRUCT, n * TYPE_LENGTH (elt_type), 0, 0, 0);
- t->nfields = 1;
- t->fields = f;
- TYPE_TAG_NAME (t) = name;
+ struct type *simd_type;
+ struct type *array_type;
+
+ simd_type = init_composite_type (name, TYPE_CODE_STRUCT);
+ array_type = create_array_type (0, elt_type,
+ create_range_type (0, builtin_type_int,
+ 0, n-1));
+ append_composite_type_field (simd_type, elt_name, array_type);
+ return simd_type;
+}
- return t;
+static struct type *
+init_vector_type (struct type *elt_type, int n)
+{
+ struct type *array_type;
+
+ array_type = create_array_type (0, elt_type,
+ create_range_type (0, builtin_type_int,
+ 0, n-1));
+ TYPE_FLAGS (array_type) |= TYPE_FLAG_VECTOR;
+ return array_type;
}
static struct type *
@@ -820,41 +838,24 @@ build_builtin_type_vec128 (void)
/* Construct a type for the 128 bit registers. The type we're
building is this: */
#if 0
- union __gdb_builtin_type_vec128
+ union __gdb_builtin_type_vec128
{
- struct __builtin_v16qi v16qi;
- struct __builtin_v8hi v8hi;
- struct __builtin_v4si v4si;
- struct __builtin_v4sf v4sf;
- uint128_t uint128;
+ int128_t uint128;
+ float v4_float[4];
+ int32_t v4_int32[4];
+ int16_t v8_int16[8];
+ int8_t v16_int8[16];
};
#endif
struct type *t;
- struct field *f;
-
- f = (struct field *) xcalloc (5, sizeof (*f));
-
- FIELD_TYPE (f[0]) = builtin_type_int128;
- FIELD_NAME (f[0]) = "uint128";
-
- FIELD_TYPE (f[1]) = builtin_type_v4sf;
- FIELD_NAME (f[1]) = "v4sf";
-
- FIELD_TYPE (f[2]) = builtin_type_v4si;
- FIELD_NAME (f[2]) = "v4si";
- FIELD_TYPE (f[3]) = builtin_type_v8hi;
- FIELD_NAME (f[3]) = "v8hi";
-
- FIELD_TYPE (f[4]) = builtin_type_v16qi;
- FIELD_NAME (f[4]) = "v16qi";
-
- /* Build a union type with those fields. */
- t = init_type (TYPE_CODE_UNION, 16, 0, 0, 0);
- TYPE_NFIELDS (t) = 5;
- TYPE_FIELDS (t) = f;
- TYPE_TAG_NAME (t) = "__gdb_builtin_type_vec128";
+ t = init_composite_type ("__gdb_builtin_type_vec128", TYPE_CODE_UNION);
+ append_composite_type_field (t, "uint128", builtin_type_int128);
+ append_composite_type_field (t, "v4_float", builtin_type_v4_float);
+ append_composite_type_field (t, "v4_int32", builtin_type_v4_int32);
+ append_composite_type_field (t, "v8_int16", builtin_type_v8_int16);
+ append_composite_type_field (t, "v16_int8", builtin_type_v16_int8);
return t;
}
@@ -1753,6 +1754,48 @@ init_type (enum type_code code, int length, int flags, char *name,
return (type);
}
+/* Helper function. Create an empty composite type. */
+
+struct type *
+init_composite_type (char *name, enum type_code code)
+{
+ struct type *t;
+ gdb_assert (code == TYPE_CODE_STRUCT
+ || code == TYPE_CODE_UNION);
+ t = init_type (code, 0, 0, NULL, NULL);
+ TYPE_TAG_NAME (t) = name;
+ return t;
+}
+
+/* Helper function. Append a field to a composite type. */
+
+void
+append_composite_type_field (struct type *t, char *name, struct type *field)
+{
+ struct field *f;
+ TYPE_NFIELDS (t) = TYPE_NFIELDS (t) + 1;
+ TYPE_FIELDS (t) = xrealloc (TYPE_FIELDS (t),
+ sizeof (struct field) * TYPE_NFIELDS (t));
+ f = &(TYPE_FIELDS (t)[TYPE_NFIELDS (t) - 1]);
+ memset (f, 0, sizeof f[0]);
+ FIELD_TYPE (f[0]) = field;
+ FIELD_NAME (f[0]) = name;
+ if (TYPE_CODE (t) == TYPE_CODE_UNION)
+ {
+ if (TYPE_LENGTH (t) < TYPE_LENGTH (field))
+ TYPE_LENGTH (t) = TYPE_LENGTH (field);
+ }
+ else if (TYPE_CODE (t) == TYPE_CODE_STRUCT)
+ {
+ TYPE_LENGTH (t) = TYPE_LENGTH (t) + TYPE_LENGTH (field);
+ if (TYPE_NFIELDS (t) > 1)
+ {
+ FIELD_BITPOS (f[0]) = (FIELD_BITPOS (f[-1])
+ + TYPE_LENGTH (field) * TARGET_CHAR_BIT);
+ }
+ }
+}
+
/* Look up a fundamental type for the specified objfile.
May need to construct such a type if this is the first use.
@@ -3017,6 +3060,13 @@ recursive_dump_type (struct type *type, int spaces)
{
puts_filtered (" TYPE_FLAG_VARARGS");
}
+ /* This is used for things like AltiVec registers on ppc. Gcc emits
+ an attribute for the array type, which tells whether or not we
+ have a vector, instead of a regular array. */
+ if (TYPE_VECTOR (type))
+ {
+ puts_filtered (" TYPE_FLAG_VECTOR");
+ }
puts_filtered ("\n");
printfi_filtered (spaces, "nfields %d ", TYPE_NFIELDS (type));
gdb_print_host_address (TYPE_FIELDS (type), gdb_stdout);
@@ -3261,9 +3311,18 @@ build_gdbtypes (void)
builtin_type_v2si
= init_simd_type ("__builtin_v2si", builtin_type_int32, "f", 2);
+ /* 128 bit vectors. */
+ builtin_type_v4_float = init_vector_type (builtin_type_float, 4);
+ builtin_type_v4_int32 = init_vector_type (builtin_type_int32, 4);
+ builtin_type_v8_int16 = init_vector_type (builtin_type_int16, 8);
+ builtin_type_v16_int8 = init_vector_type (builtin_type_int8, 16);
+ /* 64 bit vectors. */
+ builtin_type_v2_int32 = init_vector_type (builtin_type_int32, 2);
+ builtin_type_v4_int16 = init_vector_type (builtin_type_int16, 4);
+ builtin_type_v8_int8 = init_vector_type (builtin_type_int8, 8);
+
/* Vector types. */
- builtin_type_vec128
- = build_builtin_type_vec128 ();
+ builtin_type_vec128 = build_builtin_type_vec128 ();
/* Pointer/Address types. */
@@ -3352,6 +3411,13 @@ _initialize_gdbtypes (void)
register_gdbarch_swap (&builtin_type_v8hi, sizeof (struct type *), NULL);
register_gdbarch_swap (&builtin_type_v4hi, sizeof (struct type *), NULL);
register_gdbarch_swap (&builtin_type_v2si, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_v4_float, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_v4_int32, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_v8_int16, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_v16_int8, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_v2_int32, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_v8_int8, sizeof (struct type *), NULL);
+ register_gdbarch_swap (&builtin_type_v4_int16, sizeof (struct type *), NULL);
register_gdbarch_swap (&builtin_type_vec128, sizeof (struct type *), NULL);
REGISTER_GDBARCH_SWAP (builtin_type_void_data_ptr);
REGISTER_GDBARCH_SWAP (builtin_type_void_func_ptr);
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index 74b521a..0411aaa 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -248,6 +248,13 @@ enum type_code
#define TYPE_FLAG_VARARGS (1 << 11)
#define TYPE_VARARGS(t) ((t)->flags & TYPE_FLAG_VARARGS)
+/* Identify a vector type. Gcc is handling this by adding an extra
+ attribute to the array type. We slurp that in as a new flag of a
+ type. This is used only in dwarf2read.c. */
+#define TYPE_FLAG_VECTOR (1 << 12)
+#define TYPE_VECTOR(t) ((t)->flags & TYPE_FLAG_VECTOR)
+
+
struct type
{
@@ -1054,6 +1061,16 @@ extern struct type *alloc_type (struct objfile *);
extern struct type *init_type (enum type_code, int, int, char *,
struct objfile *);
+/* Helper functions to construct a struct or record type. An
+ initially empty type is created using init_composite_type().
+ Fields are then added using append_struct_type_field(). A union
+ type has its size set to the largest field. A struct type has each
+ field packed against the previous. */
+
+extern struct type *init_composite_type (char *name, enum type_code code);
+extern void append_composite_type_field (struct type *t, char *name,
+ struct type *field);
+
extern struct type *lookup_reference_type (struct type *);
extern struct type *make_reference_type (struct type *, struct type **);
diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c
index e48b536..a4b8020 100644
--- a/gdb/gnu-nat.c
+++ b/gdb/gnu-nat.c
@@ -299,7 +299,7 @@ proc_update_sc (struct proc *proc)
proc_debug (proc, "is %s", err ? "dead" : running ? "running" : "suspended");
if (err)
- proc_debug (proc, "err = %s", strerror (err));
+ proc_debug (proc, "err = %s", safe_strerror (err));
if (running)
{
@@ -468,7 +468,7 @@ proc_steal_exc_port (struct proc *proc, mach_port_t exc_port)
proc->exc_port = exc_port;
else
warning ("Error setting exception port for %s: %s",
- proc_string (proc), strerror (err));
+ proc_string (proc), safe_strerror (err));
}
}
@@ -498,7 +498,7 @@ proc_restore_exc_port (struct proc *proc)
proc->exc_port = MACH_PORT_NULL;
else
warning ("Error setting exception port for %s: %s",
- proc_string (proc), strerror (err));
+ proc_string (proc), safe_strerror (err));
}
}
@@ -575,7 +575,7 @@ make_proc (struct inf *inf, mach_port_t port, int tid)
&prev_port);
if (err)
warning ("Couldn't request notification for port %d: %s",
- port, strerror (err));
+ port, safe_strerror (err));
else
{
proc_debug (proc, "notifications to: %d", inf->event_port);
@@ -724,7 +724,7 @@ inf_startup (struct inf *inf, int pid)
err = mach_port_allocate (mach_task_self (),
MACH_PORT_RIGHT_RECEIVE, &inf->event_port);
if (err)
- error ("Error allocating event port: %s", strerror (err));
+ error ("Error allocating event port: %s", safe_strerror (err));
/* Make a send right for it, so we can easily copy it for other people. */
mach_port_insert_right (mach_task_self (), inf->event_port,
@@ -748,7 +748,7 @@ inf_set_pid (struct inf *inf, pid_t pid)
{
error_t err = proc_pid2task (proc_server, pid, &task_port);
if (err)
- error ("Error getting task for pid %d: %s", pid, strerror (err));
+ error ("Error getting task for pid %d: %s", pid, safe_strerror (err));
}
inf_debug (inf, "setting task: %d", task_port);
@@ -890,7 +890,7 @@ inf_set_traced (struct inf *inf, int on)
}
else if (err)
warning ("Can't modify tracing state for pid %d: %s",
- inf->pid, strerror (err));
+ inf->pid, safe_strerror (err));
else
inf->traced = on;
}
@@ -1366,7 +1366,7 @@ inf_signal (struct inf *inf, enum target_signal sig)
/* Can't do too much... */
warning ("Can't deliver signal %s: No signal thread.", NAME);
else if (err)
- warning ("Delivering signal %s: %s", NAME, strerror (err));
+ warning ("Delivering signal %s: %s", NAME, safe_strerror (err));
#undef NAME
}
@@ -1397,7 +1397,7 @@ inf_continue (struct inf *inf)
}
if (err)
- warning ("Can't continue process: %s", strerror (err));
+ warning ("Can't continue process: %s", safe_strerror (err));
}
@@ -1460,7 +1460,7 @@ rewait:
err =
proc_wait_request (proc_server, inf->event_port, inf->pid, WUNTRACED);
if (err)
- warning ("wait request failed: %s", strerror (err));
+ warning ("wait request failed: %s", safe_strerror (err));
else
{
inf_debug (inf, "waits pending: %d", proc_waits_pending);
@@ -1496,7 +1496,7 @@ rewait:
if (err == EMACH_RCV_INTERRUPTED)
inf_debug (inf, "interrupted");
else if (err)
- error ("Couldn't wait for an event: %s", strerror (err));
+ error ("Couldn't wait for an event: %s", safe_strerror (err));
else
{
struct
@@ -1520,7 +1520,7 @@ rewait:
if (reply.err)
error ("Handling event, msgid = %d: %s",
- msg.hdr.msgh_id, strerror (reply.err));
+ msg.hdr.msgh_id, safe_strerror (reply.err));
}
if (inf->pending_execs)
@@ -1796,7 +1796,7 @@ S_proc_wait_reply (mach_port_t reply, error_t err,
struct inf *inf = waiting_inf;
inf_debug (inf, "err = %s, pid = %d, status = 0x%x, sigcode = %d",
- err ? strerror (err) : "0", pid, status, sigcode);
+ err ? safe_strerror (err) : "0", pid, status, sigcode);
if (err && proc_wait_pid && (!inf->task || !inf->task->port))
/* Ack. The task has died, but the task-died notification code didn't
@@ -1817,7 +1817,7 @@ S_proc_wait_reply (mach_port_t reply, error_t err,
{
if (err != EINTR)
{
- warning ("Can't wait for pid %d: %s", inf->pid, strerror (err));
+ warning ("Can't wait for pid %d: %s", inf->pid, safe_strerror (err));
inf->no_wait = 1;
/* Since we can't see the inferior's signals, don't trap them. */
@@ -1873,7 +1873,7 @@ S_msg_sig_post_untraced_reply (mach_port_t reply, error_t err)
inf->wait.status.value.sig = TARGET_SIGNAL_0;
}
else if (err)
- warning ("Signal delivery failed: %s", strerror (err));
+ warning ("Signal delivery failed: %s", safe_strerror (err));
if (err)
/* We only get this reply when we've posted a signal to a process which we
@@ -2259,13 +2259,13 @@ gnu_read_inferior (task_t task, CORE_ADDR addr, char *myaddr, int length)
err = hurd_safe_copyin (myaddr, (void *) addr - low_address + copied, length);
if (err)
{
- warning ("Read from inferior faulted: %s", strerror (err));
+ warning ("Read from inferior faulted: %s", safe_strerror (err));
length = 0;
}
err = vm_deallocate (mach_task_self (), copied, copy_count);
if (err)
- warning ("gnu_read_inferior vm_deallocate failed: %s", strerror (err));
+ warning ("gnu_read_inferior vm_deallocate failed: %s", safe_strerror (err));
return length;
}
@@ -2458,7 +2458,7 @@ gnu_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
else
{
inf_debug (current_inferior, "%s %p[%d] %s %p",
- write ? "writing" : "reading", memaddr, len,
+ write ? "writing" : "reading", (void *) memaddr, len,
write ? "<--" : "-->", myaddr);
if (write)
return gnu_write_inferior (task, memaddr, myaddr, len);
@@ -2467,6 +2467,87 @@ gnu_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
}
}
+/* Call FUNC on each memory region in the task. */
+static int
+gnu_find_memory_regions (int (*func) (CORE_ADDR,
+ unsigned long,
+ int, int, int,
+ void *),
+ void *data)
+{
+ error_t err;
+ task_t task;
+ vm_address_t region_address, last_region_address, last_region_end;
+ vm_prot_t last_protection;
+
+ if (current_inferior == 0 || current_inferior->task == 0)
+ return 0;
+ task = current_inferior->task->port;
+ if (task == MACH_PORT_NULL)
+ return 0;
+
+ region_address = last_region_address = last_region_end = VM_MIN_ADDRESS;
+ last_protection = VM_PROT_NONE;
+ while (region_address < VM_MAX_ADDRESS)
+ {
+ vm_prot_t protection;
+ vm_prot_t max_protection;
+ vm_inherit_t inheritance;
+ boolean_t shared;
+ mach_port_t object_name;
+ vm_offset_t offset;
+ vm_size_t region_length = VM_MAX_ADDRESS - region_address;
+ vm_address_t old_address = region_address;
+
+ err = vm_region (task,
+ &region_address,
+ &region_length,
+ &protection,
+ &max_protection,
+ &inheritance,
+ &shared,
+ &object_name,
+ &offset);
+ if (err == KERN_NO_SPACE)
+ break;
+ if (err != KERN_SUCCESS)
+ {
+ warning ("vm_region failed: %s", mach_error_string (err));
+ return -1;
+ }
+
+ if (protection == last_protection && region_address == last_region_end)
+ /* This region is contiguous with and indistinguishable from
+ the previous one, so we just extend that one. */
+ last_region_end = region_address += region_length;
+ else
+ {
+ /* This region is distinct from the last one we saw, so report
+ that previous one. */
+ if (last_protection != VM_PROT_NONE)
+ (*func) (last_region_address,
+ last_region_end - last_region_address,
+ last_protection & VM_PROT_READ,
+ last_protection & VM_PROT_WRITE,
+ last_protection & VM_PROT_EXECUTE,
+ data);
+ last_region_address = region_address;
+ last_region_end = region_address += region_length;
+ last_protection = protection;
+ }
+ }
+
+ /* Report the final region. */
+ if (last_region_end > last_region_address && last_protection != VM_PROT_NONE)
+ (*func) (last_region_address, last_region_end - last_region_address,
+ last_protection & VM_PROT_READ,
+ last_protection & VM_PROT_WRITE,
+ last_protection & VM_PROT_EXECUTE,
+ data);
+
+ return 0;
+}
+
/* Return printable description of proc. */
char *
@@ -2524,6 +2605,7 @@ init_gnu_ops (void)
gnu_ops.to_store_registers = gnu_store_registers; /* to_store_registers */
gnu_ops.to_prepare_to_store = gnu_prepare_to_store; /* to_prepare_to_store */
gnu_ops.to_xfer_memory = gnu_xfer_memory; /* to_xfer_memory */
+ gnu_ops.to_find_memory_regions = gnu_find_memory_regions;
gnu_ops.to_files_info = 0; /* to_files_info */
gnu_ops.to_insert_breakpoint = memory_insert_breakpoint;
gnu_ops.to_remove_breakpoint = memory_remove_breakpoint;
@@ -2781,7 +2863,7 @@ steal_exc_port (struct proc *proc, mach_port_t name)
&port, &port_type);
if (err)
error ("Couldn't extract send right %d from inferior: %s",
- name, strerror (err));
+ name, safe_strerror (err));
if (proc->saved_exc_port)
/* Get rid of our reference to the old one. */
@@ -2796,7 +2878,7 @@ steal_exc_port (struct proc *proc, mach_port_t name)
proc->exc_port = proc->inf->event_port;
err = proc_set_exception_port (proc, proc->exc_port);
error ("Can't set exception port for %s: %s",
- proc_string (proc), strerror (err));
+ proc_string (proc), safe_strerror (err));
}
}
@@ -2970,7 +3052,7 @@ info_port_rights (char *args, mach_port_type_t only)
print_port_info (right, 0, inf->task->port, PORTINFO_DETAILS,
stdout);
if (err)
- error ("%ld: %s.", right, strerror (err));
+ error ("%ld: %s.", right, safe_strerror (err));
}
}
else
@@ -2980,7 +3062,7 @@ info_port_rights (char *args, mach_port_type_t only)
print_task_ports_info (inf->task->port, only, PORTINFO_DETAILS,
stdout);
if (err)
- error ("%s.", strerror (err));
+ error ("%s.", safe_strerror (err));
}
value_free_to_mark (vmark);
@@ -3241,7 +3323,7 @@ thread_takeover_sc_cmd (char *args, int from_tty)
error_t err =
thread_info (thread->port, THREAD_BASIC_INFO, (int *) &info, &info_len);
if (err)
- error ("%s.", strerror (err));
+ error ("%s.", safe_strerror (err));
thread->sc = info->suspend_count;
if (from_tty)
printf_unfiltered ("Suspend count was %d.\n", thread->sc);
@@ -3352,6 +3434,6 @@ flush_inferior_icache (CORE_ADDR pc, int amount)
MATTR_CACHE,
&flush);
if (ret != KERN_SUCCESS)
- warning ("Error flushing inferior's cache : %s", strerror (ret));
+ warning ("Error flushing inferior's cache : %s", safe_strerror (ret));
}
#endif /* FLUSH_INFERIOR_CACHE */
diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c
index ae2104d..720364b 100644
--- a/gdb/gnu-v3-abi.c
+++ b/gdb/gnu-v3-abi.c
@@ -241,22 +241,33 @@ gnuv3_rtti_type (struct value *value,
vtable_symbol_name = SYMBOL_DEMANGLED_NAME (vtable_symbol);
if (vtable_symbol_name == NULL
|| strncmp (vtable_symbol_name, "vtable for ", 11))
- error ("can't find linker symbol for virtual table for `%s' value",
- TYPE_NAME (value_type));
+ {
+ warning ("can't find linker symbol for virtual table for `%s' value",
+ TYPE_NAME (value_type));
+ if (vtable_symbol_name)
+ warning (" found `%s' instead", vtable_symbol_name);
+ return NULL;
+ }
class_name = vtable_symbol_name + 11;
/* Try to look up the class name as a type name. */
class_symbol = lookup_symbol (class_name, 0, STRUCT_NAMESPACE, 0, 0);
if (! class_symbol)
- error ("can't find class named `%s', as given by C++ RTTI", class_name);
+ {
+ warning ("can't find class named `%s', as given by C++ RTTI", class_name);
+ return NULL;
+ }
/* Make sure the type symbol is sane. (An earlier version of this
code would find constructor functions, who have the same name as
the class.) */
if (SYMBOL_CLASS (class_symbol) != LOC_TYPEDEF
|| TYPE_CODE (SYMBOL_TYPE (class_symbol)) != TYPE_CODE_CLASS)
- error ("C++ RTTI gives a class name of `%s', but that isn't a type name",
- class_name);
+ {
+ warning ("C++ RTTI gives a class name of `%s', but that isn't a type name",
+ class_name);
+ return NULL;
+ }
/* This is the object's run-time type! */
run_time_type = SYMBOL_TYPE (class_symbol);
diff --git a/gdb/go32-nat.c b/gdb/go32-nat.c
index de5e586..7b64b17 100644
--- a/gdb/go32-nat.c
+++ b/gdb/go32-nat.c
@@ -491,7 +491,7 @@ static void
store_register (int regno)
{
if (regno < FP0_REGNUM)
- regcache_collect (regno, (void *) &a_tss + regno_mapping[regno].tss_ofs);
+ regcache_collect (regno, (char *) &a_tss + regno_mapping[regno].tss_ofs);
else if (FP_REGNUM_P (regno) || FPC_REGNUM_P (regno))
i387_fill_fsave ((char *) &npx, regno);
else
@@ -804,7 +804,7 @@ go32_terminal_inferior (void)
{
redir_to_debugger (&child_cmd);
error ("Cannot redirect standard handles for program: %s.",
- strerror (errno));
+ safe_strerror (errno));
}
/* set the console device of the inferior to whatever mode
(raw or cooked) we found it last time */
@@ -838,7 +838,7 @@ go32_terminal_ours (void)
{
redir_to_child (&child_cmd);
error ("Cannot redirect standard handles for debugger: %s.",
- strerror (errno));
+ safe_strerror (errno));
}
}
}
diff --git a/gdb/gregset.h b/gdb/gregset.h
index a3a1325..cb27517 100644
--- a/gdb/gregset.h
+++ b/gdb/gregset.h
@@ -52,5 +52,18 @@ extern void supply_fpregset (gdb_fpregset_t *fpregs);
extern void fill_gregset (gdb_gregset_t *gregs, int regno);
extern void fill_fpregset (gdb_fpregset_t *fpregs, int regno);
+#ifdef FILL_FPXREGSET
+/* Linux/i386: Copy register values between GDB's internal register cache
+ and the i386 extended floating point registers. */
+
+#ifndef GDB_FPXREGSET_T
+#define GDB_FPXREGSET_T elf_fpxregset_t
+#endif
+
+typedef GDB_FPXREGSET_T gdb_fpxregset_t;
+
+extern void supply_fpxregset (gdb_fpxregset_t *fpxregs);
+extern void fill_fpxregset (gdb_fpxregset_t *fpxregs, int regno);
+#endif
#endif
diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c
index e335fdb..93b9bbb 100644
--- a/gdb/h8300-tdep.c
+++ b/gdb/h8300-tdep.c
@@ -1,6 +1,7 @@
/* Target-machine dependent code for Hitachi H8/300, for GDB.
- Copyright 1988, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999,
- 2000, 2001 Free Software Foundation, Inc.
+
+ Copyright 1988, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998,
+ 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of GDB.
@@ -834,7 +835,7 @@ h8300_print_register_hook (int regno)
int C, Z, N, V;
unsigned char b[4];
unsigned char l;
- read_relative_register_raw_bytes (regno, b);
+ frame_register_read (selected_frame, regno, b);
l = b[REGISTER_VIRTUAL_SIZE (8) - 1];
printf_unfiltered ("\t");
printf_unfiltered ("I-%d - ", (l & 0x80) != 0);
diff --git a/gdb/h8500-tdep.c b/gdb/h8500-tdep.c
index d303246..04ba706 100644
--- a/gdb/h8500-tdep.c
+++ b/gdb/h8500-tdep.c
@@ -1,6 +1,7 @@
/* Target-dependent code for Hitachi H8/500, for GDB.
- Copyright 1993, 1994, 1995, 1998, 2000, 2001
- Free Software Foundation, Inc.
+
+ Copyright 1993, 1994, 1995, 1998, 2000, 2001, 2002 Free Software
+ Foundation, Inc.
This file is part of GDB.
@@ -186,7 +187,7 @@ print_register_hook (int regno)
unsigned char b[2];
unsigned char l;
- read_relative_register_raw_bytes (regno, b);
+ frame_register_read (selected_frame, regno, b);
l = b[1];
printf_unfiltered ("\t");
printf_unfiltered ("I-%d - ", (l & 0x80) != 0);
@@ -604,12 +605,6 @@ h8500_read_fp (void)
}
void
-h8500_write_fp (CORE_ADDR v)
-{
- write_register (PR6_REGNUM, v);
-}
-
-void
_initialize_h8500_tdep (void)
{
tm_print_insn = print_insn_h8500;
diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c
index 157fb8a..3890fc2 100644
--- a/gdb/hppa-tdep.c
+++ b/gdb/hppa-tdep.c
@@ -1,6 +1,7 @@
/* Target-dependent code for the HP PA architecture, for GDB.
- Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
- 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+ Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
+ 1996, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
Contributed by the Center for Software Science at the
University of Utah (pa-gdb-bugs@cs.utah.edu).
@@ -632,7 +633,8 @@ pc_in_interrupt_handler (CORE_ADDR pc)
its frame isn't a pure interrupt frame. Deal with this. */
msym_us = lookup_minimal_symbol_by_pc (pc);
- return u->HP_UX_interrupt_marker && !IN_SIGTRAMP (pc, SYMBOL_NAME (msym_us));
+ return (u->HP_UX_interrupt_marker
+ && !PC_IN_SIGTRAMP (pc, SYMBOL_NAME (msym_us)));
}
/* Called when no unwind descriptor was found for PC. Returns 1 if it
@@ -747,8 +749,10 @@ find_proc_framesize (CORE_ADDR pc)
/* If Save_SP is set, and we're not in an interrupt or signal caller,
then we have a frame pointer. Use it. */
- if (u->Save_SP && !pc_in_interrupt_handler (pc)
- && !IN_SIGTRAMP (pc, SYMBOL_NAME (msym_us)))
+ if (u->Save_SP
+ && !pc_in_interrupt_handler (pc)
+ && msym_us
+ && !PC_IN_SIGTRAMP (pc, SYMBOL_NAME (msym_us)))
return -1;
return u->Total_frame_size << 3;
@@ -2486,7 +2490,7 @@ pa_do_registers_info (int regnum, int fpregs)
/* Make a copy of gdb's save area (may cause actual
reads from the target). */
for (i = 0; i < NUM_REGS; i++)
- read_relative_register_raw_bytes (i, raw_regs + REGISTER_BYTE (i));
+ frame_register_read (selected_frame, i, raw_regs + REGISTER_BYTE (i));
if (regnum == -1)
pa_print_registers (raw_regs, regnum, fpregs);
@@ -2530,7 +2534,7 @@ pa_do_strcat_registers_info (int regnum, int fpregs, struct ui_file *stream,
/* Make a copy of gdb's save area (may cause actual
reads from the target). */
for (i = 0; i < NUM_REGS; i++)
- read_relative_register_raw_bytes (i, raw_regs + REGISTER_BYTE (i));
+ frame_register_read (selected_frame, i, raw_regs + REGISTER_BYTE (i));
if (regnum == -1)
pa_strcat_registers (raw_regs, regnum, fpregs, stream);
@@ -2782,7 +2786,7 @@ pa_print_fp_reg (int i)
char virtual_buffer[MAX_REGISTER_VIRTUAL_SIZE];
/* Get 32bits of data. */
- read_relative_register_raw_bytes (i, raw_buffer);
+ frame_register_read (selected_frame, i, raw_buffer);
/* Put it in the buffer. No conversions are ever necessary. */
memcpy (virtual_buffer, raw_buffer, REGISTER_RAW_SIZE (i));
@@ -2800,7 +2804,7 @@ pa_print_fp_reg (int i)
if ((i % 2) == 0)
{
/* Get the data in raw format for the 2nd half. */
- read_relative_register_raw_bytes (i + 1, raw_buffer);
+ frame_register_read (selected_frame, i + 1, raw_buffer);
/* Copy it into the appropriate part of the virtual buffer. */
memcpy (virtual_buffer + REGISTER_RAW_SIZE (i), raw_buffer,
@@ -2828,7 +2832,7 @@ pa_strcat_fp_reg (int i, struct ui_file *stream, enum precision_type precision)
print_spaces_filtered (8 - strlen (REGISTER_NAME (i)), stream);
/* Get 32bits of data. */
- read_relative_register_raw_bytes (i, raw_buffer);
+ frame_register_read (selected_frame, i, raw_buffer);
/* Put it in the buffer. No conversions are ever necessary. */
memcpy (virtual_buffer, raw_buffer, REGISTER_RAW_SIZE (i));
@@ -2839,7 +2843,7 @@ pa_strcat_fp_reg (int i, struct ui_file *stream, enum precision_type precision)
char raw_buf[MAX_REGISTER_RAW_SIZE];
/* Get the data in raw format for the 2nd half. */
- read_relative_register_raw_bytes (i + 1, raw_buf);
+ frame_register_read (selected_frame, i + 1, raw_buf);
/* Copy it into the appropriate part of the virtual buffer. */
memcpy (virtual_buffer + REGISTER_RAW_SIZE (i), raw_buf, REGISTER_RAW_SIZE (i));
@@ -4461,7 +4465,7 @@ child_get_current_exception_event (void)
if (level != 0)
return (struct exception_event_record *) NULL;
- select_frame (fi, -1);
+ select_frame (fi);
/* Read in the arguments */
/* __d_eh_notify_callback() is called with 3 arguments:
@@ -4487,11 +4491,11 @@ child_get_current_exception_event (void)
if (level != 0)
return (struct exception_event_record *) NULL;
- select_frame (fi, -1);
+ select_frame (fi);
throw_addr = fi->pc;
/* Go back to original (top) frame */
- select_frame (curr_frame, -1);
+ select_frame (curr_frame);
current_ex_event.kind = (enum exception_event_kind) event_kind;
current_ex_event.throw_sal = find_pc_line (throw_addr, 1);
@@ -4709,7 +4713,7 @@ Do \"help breakpoints\" for info on other commands dealing with breakpoints.", N
tbreak_at_finish_command,
"Set temporary breakpoint at procedure exit. Either there should\n\
be no argument or the argument must be a depth.\n"), NULL);
- c->completer = location_completer;
+ set_cmd_completer (c, location_completer);
if (xdb_commands)
deprecate_cmd (add_com ("bx", class_breakpoint,
diff --git a/gdb/hpread.c b/gdb/hpread.c
index b7f0fc5..ca153f9 100644
--- a/gdb/hpread.c
+++ b/gdb/hpread.c
@@ -56,8 +56,8 @@ struct hpread_symfile_info
unsigned int gntt_symcount;
/* To keep track of all the types we've processed. */
- struct type **type_vector;
- int type_vector_length;
+ struct type **dntt_type_vector;
+ int dntt_type_vector_length;
/* Keeps track of the beginning of a range of source lines. */
sltpointer sl_index;
@@ -80,8 +80,9 @@ struct hpread_symfile_info
#define VT_SIZE(o) (HPUX_SYMFILE_INFO(o)->vt_size)
#define LNTT_SYMCOUNT(o) (HPUX_SYMFILE_INFO(o)->lntt_symcount)
#define GNTT_SYMCOUNT(o) (HPUX_SYMFILE_INFO(o)->gntt_symcount)
-#define TYPE_VECTOR(o) (HPUX_SYMFILE_INFO(o)->type_vector)
-#define TYPE_VECTOR_LENGTH(o) (HPUX_SYMFILE_INFO(o)->type_vector_length)
+#define DNTT_TYPE_VECTOR(o) (HPUX_SYMFILE_INFO(o)->dntt_type_vector)
+#define DNTT_TYPE_VECTOR_LENGTH(o) \
+ (HPUX_SYMFILE_INFO(o)->dntt_type_vector_length)
#define SL_INDEX(o) (HPUX_SYMFILE_INFO(o)->sl_index)
#define WITHIN_FUNCTION(o) (HPUX_SYMFILE_INFO(o)->within_function)
#define CURRENT_FUNCTION_VALUE(o) (HPUX_SYMFILE_INFO(o)->current_function_value)
@@ -200,6 +201,9 @@ void hpread_symfile_finish (struct objfile *);
static union dnttentry *hpread_get_gntt (int, struct objfile *);
+static union dnttentry *hpread_get_lntt (int index, struct objfile *objfile);
+
+
static unsigned long hpread_get_textlow (int, int, struct objfile *, int);
static struct partial_symtab *hpread_start_psymtab
@@ -1691,7 +1695,7 @@ hpread_symfile_init (struct objfile *objfile)
memset (objfile->sym_private, 0, sizeof (struct hpread_symfile_info));
/* We haven't read in any types yet. */
- TYPE_VECTOR (objfile) = 0;
+ DNTT_TYPE_VECTOR (objfile) = 0;
/* Read in data from the $GNTT$ subspace. */
gntt_section = bfd_get_section_by_name (objfile->obfd, "$GNTT$");
@@ -2690,8 +2694,9 @@ hpread_psymtab_to_symtab_1 (struct partial_symtab *pst)
/* Complain if we've already read in this symbol table. */
if (pst->readin)
{
- fprintf (stderr, "Psymtab for %s already read in. Shouldn't happen.\n",
- pst->filename);
+ fprintf_unfiltered (gdb_stderr, "Psymtab for %s already read in."
+ " Shouldn't happen.\n",
+ pst->filename);
return;
}
@@ -2745,8 +2750,9 @@ hpread_psymtab_to_symtab (struct partial_symtab *pst)
/* Sanity check. */
if (pst->readin)
{
- fprintf (stderr, "Psymtab for %s already read in. Shouldn't happen.\n",
- pst->filename);
+ fprintf_unfiltered (gdb_stderr, "Psymtab for %s already read in."
+ " Shouldn't happen.\n",
+ pst->filename);
return;
}
@@ -3028,18 +3034,18 @@ hpread_lookup_type (dnttpointer hp_type, struct objfile *objfile)
if (index < LNTT_SYMCOUNT (objfile))
{
- if (index >= TYPE_VECTOR_LENGTH (objfile))
+ if (index >= DNTT_TYPE_VECTOR_LENGTH (objfile))
{
- old_len = TYPE_VECTOR_LENGTH (objfile);
+ old_len = DNTT_TYPE_VECTOR_LENGTH (objfile);
/* See if we need to allocate a type-vector. */
if (old_len == 0)
{
- TYPE_VECTOR_LENGTH (objfile) = LNTT_SYMCOUNT (objfile) + GNTT_SYMCOUNT (objfile);
- TYPE_VECTOR (objfile) = (struct type **)
- xmmalloc (objfile->md, TYPE_VECTOR_LENGTH (objfile) * sizeof (struct type *));
- memset (&TYPE_VECTOR (objfile)[old_len], 0,
- (TYPE_VECTOR_LENGTH (objfile) - old_len) *
+ DNTT_TYPE_VECTOR_LENGTH (objfile) = LNTT_SYMCOUNT (objfile) + GNTT_SYMCOUNT (objfile);
+ DNTT_TYPE_VECTOR (objfile) = (struct type **)
+ xmmalloc (objfile->md, DNTT_TYPE_VECTOR_LENGTH (objfile) * sizeof (struct type *));
+ memset (&DNTT_TYPE_VECTOR (objfile)[old_len], 0,
+ (DNTT_TYPE_VECTOR_LENGTH (objfile) - old_len) *
sizeof (struct type *));
}
@@ -3047,25 +3053,25 @@ hpread_lookup_type (dnttpointer hp_type, struct objfile *objfile)
* initially allocate a correct-size type-vector, this code
* should no longer trigger.
*/
- while (index >= TYPE_VECTOR_LENGTH (objfile))
+ while (index >= DNTT_TYPE_VECTOR_LENGTH (objfile))
{
- TYPE_VECTOR_LENGTH (objfile) *= 2;
+ DNTT_TYPE_VECTOR_LENGTH (objfile) *= 2;
size_changed = 1;
}
if (size_changed)
{
- TYPE_VECTOR (objfile) = (struct type **)
+ DNTT_TYPE_VECTOR (objfile) = (struct type **)
xmrealloc (objfile->md,
- (char *) TYPE_VECTOR (objfile),
- (TYPE_VECTOR_LENGTH (objfile) * sizeof (struct type *)));
+ (char *) DNTT_TYPE_VECTOR (objfile),
+ (DNTT_TYPE_VECTOR_LENGTH (objfile) * sizeof (struct type *)));
- memset (&TYPE_VECTOR (objfile)[old_len], 0,
- (TYPE_VECTOR_LENGTH (objfile) - old_len) *
+ memset (&DNTT_TYPE_VECTOR (objfile)[old_len], 0,
+ (DNTT_TYPE_VECTOR_LENGTH (objfile) - old_len) *
sizeof (struct type *));
}
}
- return &TYPE_VECTOR (objfile)[index];
+ return &DNTT_TYPE_VECTOR (objfile)[index];
}
else
return NULL;
diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c
index d67c01c..9592dec 100644
--- a/gdb/i386-linux-tdep.c
+++ b/gdb/i386-linux-tdep.c
@@ -92,7 +92,7 @@ i386_linux_register_raw_size (int reg)
It kind of sucks that we have to read memory from the process in
order to identify a signal trampoline, but there doesn't seem to be
- any other way. The IN_SIGTRAMP macro in tm-linux.h arranges to
+ any other way. The PC_IN_SIGTRAMP macro in tm-linux.h arranges to
only call us if no function name could be identified, which should
be the case since the code is on the stack.
@@ -317,7 +317,7 @@ i386_linux_sigtramp_saved_sp (struct frame_info *frame)
in progress when the signal trampoline was entered. GDB mostly
treats this frame pointer value as a magic cookie. We detect the
case of a signal trampoline by looking at the SIGNAL_HANDLER_CALLER
- field, which is set based on IN_SIGTRAMP.
+ field, which is set based on PC_IN_SIGTRAMP.
When a signal trampoline is invoked from a frameless function, we
essentially have two frameless functions in a row. In this case,
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index b2ddd28..4e3a15f 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -1,7 +1,7 @@
/* Intel 386 target-dependent stuff.
- Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
- 1998, 1999, 2000, 2001
- Free Software Foundation, Inc.
+
+ Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
+ 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of GDB.
@@ -40,9 +40,6 @@
#include "i386-tdep.h"
-#undef XMALLOC
-#define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
-
/* Names of the registers. The first 10 registers match the register
numbering scheme used by GCC for stabs and DWARF. */
static char *i386_register_names[] =
diff --git a/gdb/i386gnu-nat.c b/gdb/i386gnu-nat.c
index 9188ea4..e82fe0d 100644
--- a/gdb/i386gnu-nat.c
+++ b/gdb/i386gnu-nat.c
@@ -38,6 +38,10 @@
#include "gnu-nat.h"
#include "i387-nat.h"
+#ifdef HAVE_SYS_PROCFS_H
+# include <sys/procfs.h>
+# include "gregset.h"
+#endif
/* Offset to the thread_state_t location where REG is stored. */
#define REG_OFFSET(reg) offsetof (struct i386_thread_state, reg)
@@ -88,6 +92,24 @@ fetch_fpregs (struct proc *thread)
i387_supply_fsave (state.hw_state);
}
+#ifdef HAVE_SYS_PROCFS_H
+/* These two calls are used by the core-regset.c code for
+ reading ELF core files. */
+void
+supply_gregset (gdb_gregset_t *gregs)
+{
+ int i;
+ for (i = 0; i < NUM_GREGS; i++)
+ supply_register (i, REG_ADDR (gregs, i));
+}
+
+void
+supply_fpregset (gdb_fpregset_t *fpregs)
+{
+ i387_supply_fsave ((char *) fpregs);
+}
+#endif
+
/* Fetch register REGNO, or all regs if REGNO is -1. */
void
gnu_fetch_registers (int regno)
diff --git a/gdb/i387-nat.c b/gdb/i387-nat.c
index 62c26f8..163dcfd 100644
--- a/gdb/i387-nat.c
+++ b/gdb/i387-nat.c
@@ -116,23 +116,26 @@ i387_fill_fsave (char *fsave, int regnum)
if (i >= FPC_REGNUM
&& i != FIOFF_REGNUM && i != FOOFF_REGNUM)
{
+ char buf[4];
+
+ regcache_collect (i, buf);
+
if (i == FOP_REGNUM)
{
unsigned short oldval, newval;
/* The opcode occupies only 11 bits. */
oldval = (*(unsigned short *) (FSAVE_ADDR (fsave, i)));
- newval = *(unsigned short *) &registers[REGISTER_BYTE (i)];
+ newval = *(unsigned short *) buf;
newval &= ((1 << 11) - 1);
newval |= oldval & ~((1 << 11) - 1);
memcpy (FSAVE_ADDR (fsave, i), &newval, 2);
}
else
- memcpy (FSAVE_ADDR (fsave, i), &registers[REGISTER_BYTE (i)], 2);
+ memcpy (FSAVE_ADDR (fsave, i), buf, 2);
}
else
- memcpy (FSAVE_ADDR (fsave, i), &registers[REGISTER_BYTE (i)],
- REGISTER_RAW_SIZE (i));
+ regcache_collect (i, FSAVE_ADDR (fsave, i));
}
}
@@ -255,13 +258,17 @@ i387_fill_fxsave (char *fxsave, int regnum)
if (i >= FPC_REGNUM && i < XMM0_REGNUM
&& i != FIOFF_REGNUM && i != FDOFF_REGNUM)
{
+ char buf[4];
+
+ regcache_collect (i, buf);
+
if (i == FOP_REGNUM)
{
unsigned short oldval, newval;
/* The opcode occupies only 11 bits. */
oldval = (*(unsigned short *) (FXSAVE_ADDR (fxsave, i)));
- newval = *(unsigned short *) &registers[REGISTER_BYTE (i)];
+ newval = *(unsigned short *) buf;
newval &= ((1 << 11) - 1);
newval |= oldval & ~((1 << 11) - 1);
memcpy (FXSAVE_ADDR (fxsave, i), &newval, 2);
@@ -274,7 +281,7 @@ i387_fill_fxsave (char *fxsave, int regnum)
unsigned short ftag;
int fpreg;
- ftag = *(unsigned short *) &registers[REGISTER_BYTE (i)];
+ ftag = *(unsigned short *) buf;
for (fpreg = 7; fpreg >= 0; fpreg--)
{
@@ -287,12 +294,10 @@ i387_fill_fxsave (char *fxsave, int regnum)
memcpy (FXSAVE_ADDR (fxsave, i), &val, 2);
}
else
- memcpy (FXSAVE_ADDR (fxsave, i),
- &registers[REGISTER_BYTE (i)], 2);
+ memcpy (FXSAVE_ADDR (fxsave, i), buf, 2);
}
else
- memcpy (FXSAVE_ADDR (fxsave, i), &registers[REGISTER_BYTE (i)],
- REGISTER_RAW_SIZE (i));
+ regcache_collect (i, FXSAVE_ADDR (fxsave, i));
}
}
diff --git a/gdb/i960-tdep.c b/gdb/i960-tdep.c
index 053c7fa..98718a3 100644
--- a/gdb/i960-tdep.c
+++ b/gdb/i960-tdep.c
@@ -1,6 +1,8 @@
/* Target-machine dependent code for the Intel 960
- Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
- Free Software Foundation, Inc.
+
+ Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000,
+ 2001, 2002 Free Software Foundation, Inc.
+
Contributed by Intel Corporation.
examine_prologue and other parts contributed by Wind River Systems.
@@ -120,6 +122,155 @@ check_host (void)
}
}
+/* Is this register part of the register window system? A yes answer
+ implies that 1) The name of this register will not be the same in
+ other frames, and 2) This register is automatically "saved" upon
+ subroutine calls and thus there is no need to search more than one
+ stack frame for it.
+
+ On the i960, in fact, the name of this register in another frame is
+ "mud" -- there is no overlap between the windows. Each window is
+ simply saved into the stack (true for our purposes, after having been
+ flushed; normally they reside on-chip and are restored from on-chip
+ without ever going to memory). */
+
+static int
+register_in_window_p (int regnum)
+{
+ return regnum <= R15_REGNUM;
+}
+
+/* i960_find_saved_register ()
+
+ Return the address in which frame FRAME's value of register REGNUM
+ has been saved in memory. Or return zero if it has not been saved.
+ If REGNUM specifies the SP, the value we return is actually the SP
+ value, not an address where it was saved. */
+
+static CORE_ADDR
+i960_find_saved_register (struct frame_info *frame, int regnum)
+{
+ register struct frame_info *frame1 = NULL;
+ register CORE_ADDR addr = 0;
+
+ if (frame == NULL) /* No regs saved if want current frame */
+ return 0;
+
+ /* We assume that a register in a register window will only be saved
+ in one place (since the name changes and/or disappears as you go
+ towards inner frames), so we only call get_frame_saved_regs on
+ the current frame. This is directly in contradiction to the
+ usage below, which assumes that registers used in a frame must be
+ saved in a lower (more interior) frame. This change is a result
+ of working on a register window machine; get_frame_saved_regs
+ always returns the registers saved within a frame, within the
+ context (register namespace) of that frame. */
+
+ /* However, note that we don't want this to return anything if
+ nothing is saved (if there's a frame inside of this one). Also,
+ callers to this routine asking for the stack pointer want the
+ stack pointer saved for *this* frame; this is returned from the
+ next frame. */
+
+ if (register_in_window_p (regnum))
+ {
+ frame1 = get_next_frame (frame);
+ if (!frame1)
+ return 0; /* Registers of this frame are active. */
+
+ /* Get the SP from the next frame in; it will be this
+ current frame. */
+ if (regnum != SP_REGNUM)
+ frame1 = frame;
+
+ FRAME_INIT_SAVED_REGS (frame1);
+ return frame1->saved_regs[regnum]; /* ... which might be zero */
+ }
+
+ /* Note that this next routine assumes that registers used in
+ frame x will be saved only in the frame that x calls and
+ frames interior to it. This is not true on the sparc, but the
+ above macro takes care of it, so we should be all right. */
+ while (1)
+ {
+ QUIT;
+ frame1 = get_next_frame (frame);
+ if (frame1 == 0)
+ break;
+ frame = frame1;
+ FRAME_INIT_SAVED_REGS (frame1);
+ if (frame1->saved_regs[regnum])
+ addr = frame1->saved_regs[regnum];
+ }
+
+ return addr;
+}
+
+/* i960_get_saved_register ()
+
+ Find register number REGNUM relative to FRAME and put its (raw,
+ target format) contents in *RAW_BUFFER. Set *OPTIMIZED if the
+ variable was optimized out (and thus can't be fetched). Set *LVAL
+ to lval_memory, lval_register, or not_lval, depending on whether
+ the value was fetched from memory, from a register, or in a strange
+ and non-modifiable way (e.g. a frame pointer which was calculated
+ rather than fetched). Set *ADDRP to the address, either in memory
+ on as a REGISTER_BYTE offset into the registers array.
+
+ Note that this implementation never sets *LVAL to not_lval. But it
+ can be replaced by defining GET_SAVED_REGISTER and supplying your
+ own.
+
+ The argument RAW_BUFFER must point to aligned memory. */
+
+void
+i960_get_saved_register (char *raw_buffer,
+ int *optimized,
+ CORE_ADDR *addrp,
+ struct frame_info *frame,
+ int regnum,
+ enum lval_type *lval)
+{
+ CORE_ADDR addr;
+
+ if (!target_has_registers)
+ error ("No registers.");
+
+ /* Normal systems don't optimize out things with register numbers. */
+ if (optimized != NULL)
+ *optimized = 0;
+ addr = i960_find_saved_register (frame, regnum);
+ if (addr != 0)
+ {
+ if (lval != NULL)
+ *lval = lval_memory;
+ if (regnum == SP_REGNUM)
+ {
+ if (raw_buffer != NULL)
+ {
+ /* Put it back in target format. */
+ store_address (raw_buffer, REGISTER_RAW_SIZE (regnum),
+ (LONGEST) addr);
+ }
+ if (addrp != NULL)
+ *addrp = 0;
+ return;
+ }
+ if (raw_buffer != NULL)
+ target_read_memory (addr, raw_buffer, REGISTER_RAW_SIZE (regnum));
+ }
+ else
+ {
+ if (lval != NULL)
+ *lval = lval_register;
+ addr = REGISTER_BYTE (regnum);
+ if (raw_buffer != NULL)
+ read_register_gen (regnum, raw_buffer);
+ }
+ if (addrp != NULL)
+ *addrp = addr;
+}
+
/* Examine an i960 function prologue, recording the addresses at which
registers are saved explicitly by the prologue code, and returning
the address of the first instruction after the prologue (but not
diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c
index 7ca7fe7..4b14152 100644
--- a/gdb/ia64-tdep.c
+++ b/gdb/ia64-tdep.c
@@ -601,7 +601,7 @@ ia64_memory_remove_breakpoint (CORE_ADDR addr, char *contents_cache)
/* We don't really want to use this, but remote.c needs to call it in order
to figure out if Z-packets are supported or not. Oh, well. */
-unsigned char *
+const unsigned char *
ia64_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
{
static unsigned char breakpoint[] =
@@ -667,10 +667,9 @@ rse_address_add(CORE_ADDR addr, int nslots)
even really hard to compute the frame chain, but it can be
computationally expensive. So, instead of making life difficult
(and slow), we pick a more convenient representation of the frame
- chain, knowing that we'll have to make some small adjustments
- in other places. (E.g, note that read_fp() and write_fp() are
- actually read_sp() and write_sp() below in ia64_gdbarch_init()
- below.)
+ chain, knowing that we'll have to make some small adjustments in
+ other places. (E.g, note that read_fp() is actually read_sp() in
+ ia64_gdbarch_init() below.)
Okay, so what is the frame chain exactly? It'll be the SP value
at the time that the function in question was entered.
@@ -2204,7 +2203,6 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
is all read_fp() is used for), simply use the stack pointer value
instead. */
set_gdbarch_read_fp (gdbarch, generic_target_read_sp);
- set_gdbarch_write_fp (gdbarch, generic_target_write_sp);
/* Settings that should be unnecessary. */
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
@@ -2223,6 +2221,7 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_decr_pc_after_break (gdbarch, 0);
set_gdbarch_function_start_offset (gdbarch, 0);
+ set_gdbarch_frame_args_skip (gdbarch, 0);
set_gdbarch_remote_translate_xfer_address (
gdbarch, ia64_remote_translate_xfer_address);
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 0238448..400ac55 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -1289,7 +1289,8 @@ finish_command (char *arg, int from_tty)
if (from_tty)
{
printf_filtered ("Run till exit from ");
- print_stack_frame (selected_frame, selected_frame_level, 0);
+ print_stack_frame (selected_frame,
+ frame_relative_level (selected_frame), 0);
}
/* If running asynchronously and the target support asynchronous
@@ -1590,7 +1591,7 @@ do_registers_info (int regnum, int fpregs)
print_spaces_filtered (15 - strlen (REGISTER_NAME (i)), gdb_stdout);
/* Get the data in raw format. */
- if (read_relative_register_raw_bytes (i, raw_buffer))
+ if (! frame_register_read (selected_frame, i, raw_buffer))
{
printf_filtered ("*value not available*\n");
continue;
@@ -1680,7 +1681,7 @@ registers_info (char *addr_exp, int fpregs)
if (*addr_exp >= '0' && *addr_exp <= '9')
regnum = atoi (addr_exp); /* Take a number */
if (regnum >= numregs) /* Bad name, or bad number */
- error ("%.*s: invalid register", end - addr_exp, addr_exp);
+ error ("%.*s: invalid register", (int) (end - addr_exp), addr_exp);
found:
DO_REGISTERS_INFO (regnum, fpregs);
@@ -1865,14 +1866,14 @@ _initialize_infcmd (void)
c = add_com ("tty", class_run, tty_command,
"Set terminal for future runs of program being debugged.");
- c->completer = filename_completer;
+ set_cmd_completer (c, filename_completer);
c = add_set_cmd ("args", class_run, var_string_noescape,
(char *) &inferior_args,
"Set argument list to give program being debugged when it is started.\n\
Follow this command with any number of args, to be passed to the program.",
&setlist);
- c->completer = filename_completer;
+ set_cmd_completer (c, filename_completer);
set_cmd_sfunc (c, notice_args_set);
c = add_show_from_set (c, &showlist);
set_cmd_sfunc (c, notice_args_read);
@@ -1883,17 +1884,17 @@ Follow this command with any number of args, to be passed to the program.",
With an argument VAR, prints the value of environment variable VAR to\n\
give the program being debugged. With no arguments, prints the entire\n\
environment to be given to the program.", &showlist);
- c->completer = noop_completer;
+ set_cmd_completer (c, noop_completer);
add_prefix_cmd ("unset", no_class, unset_command,
- "Complement to certain \"set\" commands",
+ "Complement to certain \"set\" commands.",
&unsetlist, "unset ", 0, &cmdlist);
c = add_cmd ("environment", class_run, unset_environment_command,
"Cancel environment variable VAR for the program.\n\
This does not affect the program until the next \"run\" command.",
&unsetlist);
- c->completer = noop_completer;
+ set_cmd_completer (c, noop_completer);
c = add_cmd ("environment", class_run, set_environment_command,
"Set environment variable value to give the program.\n\
@@ -1901,7 +1902,7 @@ Arguments are VAR VALUE where VAR is variable name and VALUE is value.\n\
VALUES of environment variables are uninterpreted strings.\n\
This does not affect the program until the next \"run\" command.",
&setlist);
- c->completer = noop_completer;
+ set_cmd_completer (c, noop_completer);
c = add_com ("path", class_files, path_command,
"Add directory DIR(s) to beginning of search path for object files.\n\
@@ -1909,7 +1910,7 @@ $cwd in the path means the current working directory.\n\
This path is equivalent to the $PATH shell variable. It is a list of\n\
directories, separated by colons. These directories are searched to find\n\
fully linked executable files and separately compiled object files as needed.");
- c->completer = filename_completer;
+ set_cmd_completer (c, filename_completer);
c = add_cmd ("paths", no_class, path_info,
"Current search path for finding object files.\n\
@@ -1918,7 +1919,7 @@ This path is equivalent to the $PATH shell variable. It is a list of\n\
directories, separated by colons. These directories are searched to find\n\
fully linked executable files and separately compiled object files as needed.",
&showlist);
- c->completer = noop_completer;
+ set_cmd_completer (c, noop_completer);
add_com ("attach", class_run, attach_command,
"Attach to a process or file outside of GDB.\n\
@@ -1974,14 +1975,14 @@ Argument N means do this N times (or till program stops for another reason).");
"Execute until the program reaches a source line greater than the current\n\
or a specified line or address or function (same args as break command).\n\
Execution will also stop upon exit from the current stack frame.");
- c->completer = location_completer;
+ set_cmd_completer (c, location_completer);
add_com_alias ("u", "until", class_run, 1);
c = add_com ("jump", class_run, jump_command,
"Continue program being debugged at specified line or address.\n\
Give as argument either LINENUM or *ADDR, where ADDR is an expression\n\
for an address to start at.");
- c->completer = location_completer;
+ set_cmd_completer (c, location_completer);
if (xdb_commands)
{
@@ -1992,7 +1993,7 @@ address.\n\
Give as argument either LINENUM or *ADDR, where ADDR is an \n\
expression for an address to start at.\n\
This command is a combination of tbreak and jump.");
- c->completer = location_completer;
+ set_cmd_completer (c, location_completer);
}
if (xdb_commands)
@@ -2013,7 +2014,7 @@ Input and output redirection with \">\", \"<\", or \">>\" are also allowed.\n\n\
With no arguments, uses arguments last specified (with \"run\" or \"set args\").\n\
To cancel previous arguments and run with no arguments,\n\
use \"set args\" without arguments.");
- c->completer = filename_completer;
+ set_cmd_completer (c, filename_completer);
add_com_alias ("r", "run", class_run, 1);
if (xdb_commands)
add_com ("R", class_run, run_no_args_command,
diff --git a/gdb/inferior.h b/gdb/inferior.h
index 93c8d9b..2c05f35 100644
--- a/gdb/inferior.h
+++ b/gdb/inferior.h
@@ -23,6 +23,8 @@
#if !defined (INFERIOR_H)
#define INFERIOR_H 1
+struct gdbarch;
+
/* For bpstat. */
#include "breakpoint.h"
@@ -177,10 +179,6 @@ extern CORE_ADDR read_fp (void);
extern CORE_ADDR generic_target_read_fp (void);
-extern void write_fp (CORE_ADDR);
-
-extern void generic_target_write_fp (CORE_ADDR);
-
extern CORE_ADDR unsigned_pointer_to_address (struct type *type, void *buf);
extern void unsigned_address_to_pointer (struct type *type, void *buf,
@@ -405,29 +403,6 @@ extern char *stop_registers;
extern int attach_flag;
-/* Sigtramp is a routine that the kernel calls (which then calls the
- signal handler). On most machines it is a library routine that
- is linked into the executable.
-
- This macro, given a program counter value and the name of the
- function in which that PC resides (which can be null if the
- name is not known), returns nonzero if the PC and name show
- that we are in sigtramp.
-
- On most machines just see if the name is sigtramp (and if we have
- no name, assume we are not in sigtramp). */
-#if !defined (IN_SIGTRAMP)
-#if defined (SIGTRAMP_START)
-#define IN_SIGTRAMP(pc, name) \
- ((pc) >= SIGTRAMP_START(pc) \
- && (pc) < SIGTRAMP_END(pc) \
- )
-#else
-#define IN_SIGTRAMP(pc, name) \
- (name && STREQ ("_sigtramp", name))
-#endif
-#endif
-
/* Possible values for CALL_DUMMY_LOCATION. */
#define ON_STACK 1
#define BEFORE_TEXT_END 2
diff --git a/gdb/inflow.c b/gdb/inflow.c
index 66671f7..526acdf 100644
--- a/gdb/inflow.c
+++ b/gdb/inflow.c
@@ -171,7 +171,7 @@ gdb_has_a_terminal (void)
#define OOPSY(what) \
if (result == -1) \
fprintf_unfiltered(gdb_stderr, "[%s failed in terminal_inferior: %s]\n", \
- what, strerror (errno))
+ what, safe_strerror (errno))
static void terminal_ours_1 (int);
@@ -374,7 +374,7 @@ terminal_ours_1 (int output_only)
such situations as well. */
if (result == -1)
fprintf_unfiltered (gdb_stderr, "[tcsetpgrp failed in terminal_ours: %s]\n",
- strerror (errno));
+ safe_strerror (errno));
#endif
#endif /* termios */
@@ -594,7 +594,8 @@ kill_command (char *arg, int from_tty)
if (selected_frame == NULL)
fputs_filtered ("No selected stack frame.\n", gdb_stdout);
else
- print_stack_frame (selected_frame, selected_frame_level, 1);
+ print_stack_frame (selected_frame,
+ frame_relative_level (selected_frame), 1);
}
}
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 6ae8f7c..e9fea2a 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -749,7 +749,15 @@ static const char *scheduler_enums[] =
static void
set_schedlock_func (char *args, int from_tty, struct cmd_list_element *c)
{
- if (c->type == set_cmd)
+ /* NOTE: cagney/2002-03-17: The add_show_from_set() function clones
+ the set command passed as a parameter. The clone operation will
+ include (BUG?) any ``set'' command callback, if present.
+ Commands like ``info set'' call all the ``show'' command
+ callbacks. Unfortunatly, for ``show'' commands cloned from
+ ``set'', this includes callbacks belonging to ``set'' commands.
+ Making this worse, this only occures if add_show_from_set() is
+ called after add_cmd_sfunc() (BUG?). */
+ if (cmd_type (c) == set_cmd)
if (!target_can_lock_scheduler)
{
scheduler_mode = schedlock_off;
@@ -2632,8 +2640,8 @@ handle_inferior_event (struct execution_control_state *ecs)
ecs->update_step_sp = 1;
/* Did we just take a signal? */
- if (IN_SIGTRAMP (stop_pc, ecs->stop_func_name)
- && !IN_SIGTRAMP (prev_pc, prev_func_name)
+ if (PC_IN_SIGTRAMP (stop_pc, ecs->stop_func_name)
+ && !PC_IN_SIGTRAMP (prev_pc, prev_func_name)
&& INNER_THAN (read_sp (), step_sp))
{
/* We've just taken a signal; go until we are back to
@@ -2744,7 +2752,7 @@ handle_inferior_event (struct execution_control_state *ecs)
{
/* We're doing a "next". */
- if (IN_SIGTRAMP (stop_pc, ecs->stop_func_name)
+ if (PC_IN_SIGTRAMP (stop_pc, ecs->stop_func_name)
&& INNER_THAN (step_frame_address, read_sp()))
/* We stepped out of a signal handler, and into its
calling trampoline. This is misdetected as a
@@ -2953,8 +2961,8 @@ 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)
+ && PC_IN_SIGTRAMP (stop_pc, ecs->stop_func_name)
+ && !PC_IN_SIGTRAMP (prev_pc, prev_func_name)
&& INNER_THAN (read_sp (), step_sp))
{
/* What has happened here is that we have just stepped the
@@ -3414,13 +3422,11 @@ and/or watchpoints.\n");
target_terminal_ours ();
- /* Look up the hook_stop and run it if it exists. */
-
- if (stop_command && stop_command->hook_pre)
- {
- catch_errors (hook_stop_stub, stop_command->hook_pre,
- "Error while running hook_stop:\n", RETURN_MASK_ALL);
- }
+ /* Look up the hook_stop and run it (CLI internally handles problem
+ of stop_command's pre-hook not existing). */
+ if (stop_command)
+ catch_errors (hook_stop_stub, stop_command,
+ "Error while running hook_stop:\n", RETURN_MASK_ALL);
if (!target_has_stack)
{
@@ -3435,7 +3441,7 @@ and/or watchpoints.\n");
if (!stop_stack_dummy)
{
- select_frame (get_current_frame (), 0);
+ select_frame (get_current_frame ());
/* Print current location without a level number, if
we have changed functions or hit a breakpoint.
@@ -3511,7 +3517,7 @@ and/or watchpoints.\n");
Can't rely on restore_inferior_status because that only gets
called if we don't stop in the called function. */
stop_pc = read_pc ();
- select_frame (get_current_frame (), 0);
+ select_frame (get_current_frame ());
}
done:
@@ -3521,7 +3527,7 @@ done:
static int
hook_stop_stub (void *cmd)
{
- execute_user_command ((struct cmd_list_element *) cmd, 0);
+ execute_cmd_pre_hook ((struct cmd_list_element *) cmd);
return (0);
}
@@ -4018,7 +4024,7 @@ restore_selected_frame (void *args)
return 0;
}
- select_frame (frame, fr->level);
+ select_frame (frame);
return (1);
}
@@ -4073,7 +4079,7 @@ restore_inferior_status (struct inferior_status *inf_status)
frame. */
- select_frame (get_current_frame (), 0);
+ select_frame (get_current_frame ());
}
diff --git a/gdb/jv-exp.y b/gdb/jv-exp.y
index 1b80ab4..495bf3e 100644
--- a/gdb/jv-exp.y
+++ b/gdb/jv-exp.y
@@ -862,6 +862,8 @@ yylex ()
retry:
+ prev_lexptr = lexptr;
+
tokstart = lexptr;
/* See if it is a special token of length 3. */
for (i = 0; i < sizeof tokentab3 / sizeof tokentab3[0]; i++)
@@ -1207,6 +1209,9 @@ void
yyerror (msg)
char *msg;
{
+ if (prev_lexptr)
+ lexptr = prev_lexptr;
+
error ("A %s in expression, near `%s'.", (msg ? msg : "error"), lexptr);
}
diff --git a/gdb/kod.c b/gdb/kod.c
index 2641c38..8f565bb 100644
--- a/gdb/kod.c
+++ b/gdb/kod.c
@@ -132,7 +132,16 @@ kod_set_os (char *arg, int from_tty, struct cmd_list_element *command)
{
char *p;
- if (command->type != set_cmd)
+ /* NOTE: cagney/2002-03-17: The add_show_from_set() function clones
+ the set command passed as a parameter. The clone operation will
+ include (BUG?) any ``set'' command callback, if present.
+ Commands like ``info set'' call all the ``show'' command
+ callbacks. Unfortunatly, for ``show'' commands cloned from
+ ``set'', this includes callbacks belonging to ``set'' commands.
+ Making this worse, this only occures if add_show_from_set() is
+ called after add_cmd_sfunc() (BUG?). */
+
+ if (cmd_type (command) != set_cmd)
return;
/* If we had already had an open OS, close it. */
@@ -145,7 +154,6 @@ kod_set_os (char *arg, int from_tty, struct cmd_list_element *command)
delete_cmd (old_operating_system, &infolist);
xfree (old_operating_system);
}
- old_operating_system = xstrdup (operating_system);
if (! operating_system || ! *operating_system)
{
@@ -160,6 +168,8 @@ kod_set_os (char *arg, int from_tty, struct cmd_list_element *command)
{
char *kodlib;
+ old_operating_system = xstrdup (operating_system);
+
load_kod_library (operating_system);
kodlib = (*gdb_kod_open) (gdb_kod_display, gdb_kod_query);
diff --git a/gdb/language.c b/gdb/language.c
index 4c4036b..0b37a6f 100644
--- a/gdb/language.c
+++ b/gdb/language.c
@@ -1559,13 +1559,13 @@ _initialize_language (void)
set_cmd_cfunc (show, show_language_command);
add_prefix_cmd ("check", no_class, set_check,
- "Set the status of the type/range checker",
+ "Set the status of the type/range checker.",
&setchecklist, "set check ", 0, &setlist);
add_alias_cmd ("c", "check", no_class, 1, &setlist);
add_alias_cmd ("ch", "check", no_class, 1, &setlist);
add_prefix_cmd ("check", no_class, show_check,
- "Show the status of the type/range checker",
+ "Show the status of the type/range checker.",
&showchecklist, "show check ", 0, &showlist);
add_alias_cmd ("c", "check", no_class, 1, &showlist);
add_alias_cmd ("ch", "check", no_class, 1, &showlist);
diff --git a/gdb/lin-lwp.c b/gdb/lin-lwp.c
index e39e787..cb5b19f 100644
--- a/gdb/lin-lwp.c
+++ b/gdb/lin-lwp.c
@@ -376,7 +376,7 @@ lin_lwp_attach_lwp (ptid_t ptid, int verbose)
if (ptrace (PTRACE_ATTACH, GET_LWP (ptid), 0, 0) < 0)
error ("Can't attach %s: %s", target_pid_to_str (ptid),
- strerror (errno));
+ safe_strerror (errno));
pid = waitpid (GET_LWP (ptid), &status, 0);
if (pid == -1 && errno == ECHILD)
@@ -454,7 +454,7 @@ detach_callback (struct lwp_info *lp, void *data)
if (ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0,
WSTOPSIG (lp->status)) < 0)
error ("Can't continue %s: %s", target_pid_to_str (lp->ptid),
- strerror (errno));
+ safe_strerror (errno));
lp->stopped = 0;
lp->signalled = 0;
@@ -471,7 +471,7 @@ detach_callback (struct lwp_info *lp, void *data)
if (ptrace (PTRACE_DETACH, GET_LWP (lp->ptid), 0,
WSTOPSIG (lp->status)) < 0)
error ("Can't detach %s: %s", target_pid_to_str (lp->ptid),
- strerror (errno));
+ safe_strerror (errno));
delete_lwp (lp->ptid);
}
@@ -969,11 +969,11 @@ child_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
clear_sigio_trap ();
clear_sigint_trap ();
}
- while (pid == -1 && errno == EINTR);
+ while (pid == -1 && save_errno == EINTR);
if (pid == -1)
{
- warning ("Child process unexpectedly missing: %s", strerror (errno));
+ warning ("Child process unexpectedly missing: %s", safe_strerror (errno));
/* Claim it exited with unknown signal. */
ourstatus->kind = TARGET_WAITKIND_SIGNALLED;
diff --git a/gdb/linespec.c b/gdb/linespec.c
index ca9d01d..cbfafcf 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -1187,7 +1187,7 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab,
sym = lookup_symbol (copy,
(s ? BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK)
- : get_selected_block ()),
+ : get_selected_block (0)),
VAR_NAMESPACE, 0, &sym_symtab);
symbol_found: /* We also jump here from inside the C++ class/namespace
@@ -1213,7 +1213,7 @@ symbol_found: /* We also jump here from inside the C++ class/namespace
{
struct blockvector *bv = BLOCKVECTOR (sym_symtab);
struct block *b = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
- if (lookup_block_symbol (b, copy, VAR_NAMESPACE) != NULL)
+ if (lookup_block_symbol (b, copy, NULL, VAR_NAMESPACE) != NULL)
build_canonical_line_spec (values.sals, copy, canonical);
}
return values;
diff --git a/gdb/linux-proc.c b/gdb/linux-proc.c
index d6f88d3..aa3b571 100644
--- a/gdb/linux-proc.c
+++ b/gdb/linux-proc.c
@@ -77,7 +77,14 @@ read_mapping (FILE *mapfile,
if (ret > 0 && ret != EOF && *inode != 0)
{
- ret += fscanf (mapfile, "%s\n", filename);
+ /* Eat everything up to EOL for the filename. This will prevent
+ weird filenames (such as one with embedded whitespace) from
+ confusing this code. It also makes this code more robust
+ in respect to annotations the kernel may add after the
+ filename.
+
+ Note the filename is used for informational purposes only. */
+ ret += fscanf (mapfile, "%[^\n]\n", filename);
}
else
{
@@ -160,6 +167,9 @@ linux_do_thread_registers (bfd *obfd, ptid_t ptid,
{
gdb_gregset_t gregs;
gdb_fpregset_t fpregs;
+#ifdef FILL_FPXREGSET
+ gdb_fpxregset_t fpxregs;
+#endif
unsigned long merged_pid = ptid_get_tid (ptid) << 16 | ptid_get_pid (ptid);
fill_gregset (&gregs, -1);
@@ -176,6 +186,14 @@ linux_do_thread_registers (bfd *obfd, ptid_t ptid,
note_size,
&fpregs,
sizeof (fpregs));
+#ifdef FILL_FPXREGSET
+ fill_fpxregset (&fpxregs, -1);
+ note_data = (char *) elfcore_write_prxfpreg (obfd,
+ note_data,
+ note_size,
+ &fpxregs,
+ sizeof (fpxregs));
+#endif
return note_data;
}
diff --git a/gdb/m2-exp.y b/gdb/m2-exp.y
index eaaad5a..772c6b7 100644
--- a/gdb/m2-exp.y
+++ b/gdb/m2-exp.y
@@ -821,6 +821,8 @@ yylex ()
retry:
+ prev_lexptr = lexptr;
+
tokstart = lexptr;
@@ -1090,5 +1092,8 @@ void
yyerror (msg)
char *msg;
{
+ if (prev_lexptr)
+ lexptr = prev_lexptr;
+
error ("A %s in expression, near `%s'.", (msg ? msg : "error"), lexptr);
}
diff --git a/gdb/m3-nat.c b/gdb/m3-nat.c
index 320cbf8..c29101b 100644
--- a/gdb/m3-nat.c
+++ b/gdb/m3-nat.c
@@ -1101,7 +1101,7 @@ select_thread (mach_port_t task, int thread_id, int flag)
stop_pc = read_pc ();
flush_cached_frames ();
- select_frame (get_current_frame (), 0);
+ select_frame (get_current_frame ());
}
return KERN_SUCCESS;
diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c
index 630accf..6d00ab1 100644
--- a/gdb/m68hc11-tdep.c
+++ b/gdb/m68hc11-tdep.c
@@ -270,7 +270,7 @@ m68hc11_register_name (int reg_nr)
return m68hc11_register_names[reg_nr];
}
-static unsigned char *
+static const unsigned char *
m68hc11_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
{
static unsigned char breakpoint[] = {0x0};
@@ -1087,7 +1087,6 @@ m68hc11_gdbarch_init (struct gdbarch_info info,
set_gdbarch_read_pc (gdbarch, generic_target_read_pc);
set_gdbarch_write_pc (gdbarch, generic_target_write_pc);
set_gdbarch_read_fp (gdbarch, generic_target_read_fp);
- set_gdbarch_write_fp (gdbarch, generic_target_write_fp);
set_gdbarch_read_sp (gdbarch, generic_target_read_sp);
set_gdbarch_write_sp (gdbarch, generic_target_write_sp);
diff --git a/gdb/m68klinux-nat.c b/gdb/m68klinux-nat.c
index 10f4a19..82a6124 100644
--- a/gdb/m68klinux-nat.c
+++ b/gdb/m68klinux-nat.c
@@ -383,7 +383,7 @@ fill_fpregset (elf_fpregset_t *fpregsetp, int regno)
/* Fill in the floating-point control registers. */
for (i = FPC_REGNUM; i <= FPI_REGNUM; i++)
if (regno == -1 || regno == i)
- regcache_collect (regno, fpregsetp->fpcntl[regno - FPC_REGNUM]);
+ regcache_collect (regno, (char *) &fpregsetp->fpcntl[regno - FPC_REGNUM]);
}
#ifdef HAVE_PTRACE_GETREGS
diff --git a/gdb/maint.c b/gdb/maint.c
index 0d2be09..ddaa390 100644
--- a/gdb/maint.c
+++ b/gdb/maint.c
@@ -36,6 +36,8 @@
#include "objfiles.h"
#include "value.h"
+#include "cli/cli-decode.h"
+
extern void _initialize_maint_cmds (void);
static void maintenance_command (char *, int);
@@ -289,9 +291,9 @@ print_bfd_flags (flagword flags)
}
static void
-print_section_info (const char *name, flagword flags,
- CORE_ADDR addr, CORE_ADDR endaddr,
- unsigned long filepos)
+maint_print_section_info (const char *name, flagword flags,
+ CORE_ADDR addr, CORE_ADDR endaddr,
+ unsigned long filepos)
{
/* FIXME-32x64: Need print_address_numeric with field width. */
printf_filtered (" 0x%s", paddr (addr));
@@ -319,7 +321,7 @@ print_bfd_section_info (bfd *abfd,
addr = bfd_section_vma (abfd, asect);
endaddr = addr + bfd_section_size (abfd, asect);
- print_section_info (name, flags, addr, endaddr, asect->filepos);
+ maint_print_section_info (name, flags, addr, endaddr, asect->filepos);
}
}
@@ -335,7 +337,7 @@ print_objfile_section_info (bfd *abfd,
|| match_substring (string, name)
|| match_bfd_flags (string, flags))
{
- print_section_info (name, flags, asect->addr, asect->endaddr,
+ maint_print_section_info (name, flags, asect->addr, asect->endaddr,
asect->the_bfd_section->filepos);
}
}
diff --git a/gdb/mcore-tdep.c b/gdb/mcore-tdep.c
index 184f7b5..0e6ffc8 100644
--- a/gdb/mcore-tdep.c
+++ b/gdb/mcore-tdep.c
@@ -62,7 +62,7 @@ CORE_ADDR mcore_skip_prologue (CORE_ADDR pc);
CORE_ADDR mcore_frame_chain (struct frame_info *fi);
-unsigned char *mcore_breakpoint_from_pc (CORE_ADDR * bp_addr, int *bp_size);
+const unsigned char *mcore_breakpoint_from_pc (CORE_ADDR * bp_addr, int *bp_size);
int mcore_use_struct_convention (int gcc_p, struct type *type);
@@ -182,7 +182,7 @@ mcore_dump_insn (char *commnt, CORE_ADDR pc, int insn)
instructions are 16 bits, this is all we need, regardless of
address. bpkt = 0x0000 */
-unsigned char *
+const unsigned char *
mcore_breakpoint_from_pc (CORE_ADDR * bp_addr, int *bp_size)
{
static char breakpoint[] =
diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c
index 1bc9eef..c974c9e 100644
--- a/gdb/mdebugread.c
+++ b/gdb/mdebugread.c
@@ -143,7 +143,8 @@ struct symloc
|| (sc) == scPData \
|| (sc) == scXData)
#define SC_IS_COMMON(sc) ((sc) == scCommon || (sc) == scSCommon)
-#define SC_IS_BSS(sc) ((sc) == scBss || (sc) == scSBss)
+#define SC_IS_BSS(sc) ((sc) == scBss)
+#define SC_IS_SBSS(sc) ((sc) == scSBss)
#define SC_IS_UNDEF(sc) ((sc) == scUndefined || (sc) == scSUndefined)
/* Various complaints about symbol reading that don't abort the process */
@@ -2425,26 +2426,72 @@ parse_partial_symbols (struct objfile *objfile)
ms_type = mst_bss;
svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS (objfile));
}
+ else if (SC_IS_SBSS (ext_in->asym.sc))
+ {
+ ms_type = mst_bss;
+ svalue += ANOFFSET (objfile->section_offsets,
+ get_section_index (objfile, ".sbss"));
+ }
else
ms_type = mst_abs;
break;
case stLabel:
/* Label */
+
+ /* On certain platforms, some extra label symbols can be
+ generated by the linker. One possible usage for this kind
+ of symbols is to represent the address of the begining of a
+ given section. For instance, on Tru64 5.1, the address of
+ the _ftext label is the start address of the .text section.
+
+ The storage class of these symbols is usually directly
+ related to the section to which the symbol refers. For
+ instance, on Tru64 5.1, the storage class for the _fdata
+ label is scData, refering to the .data section.
+
+ It is actually possible that the section associated to the
+ storage class of the label does not exist. On True64 5.1
+ for instance, the libm.so shared library does not contain
+ any .data section, although it contains a _fpdata label
+ which storage class is scData... Since these symbols are
+ usually useless for the debugger user anyway, we just
+ discard these symbols.
+ */
+
if (SC_IS_TEXT (ext_in->asym.sc))
{
+ if (objfile->sect_index_text == -1)
+ continue;
+
ms_type = mst_file_text;
svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
}
else if (SC_IS_DATA (ext_in->asym.sc))
{
+ if (objfile->sect_index_data == -1)
+ continue;
+
ms_type = mst_file_data;
svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA (objfile));
}
else if (SC_IS_BSS (ext_in->asym.sc))
{
+ if (objfile->sect_index_bss == -1)
+ continue;
+
ms_type = mst_file_bss;
svalue += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS (objfile));
}
+ else if (SC_IS_SBSS (ext_in->asym.sc))
+ {
+ const int sbss_sect_index = get_section_index (objfile, ".sbss");
+
+ if (sbss_sect_index == -1)
+ continue;
+
+ ms_type = mst_file_bss;
+ svalue += ANOFFSET (objfile->section_offsets, sbss_sect_index);
+ }
else
ms_type = mst_abs;
break;
diff --git a/gdb/mem-break.c b/gdb/mem-break.c
index a67e2a5..9cf638e 100644
--- a/gdb/mem-break.c
+++ b/gdb/mem-break.c
@@ -1,6 +1,8 @@
/* Simulate breakpoints by patching locations in the target system, for GDB.
- Copyright 1990, 1991, 1992, 1993, 1995, 1997, 1998, 1999, 2000
- Free Software Foundation, Inc.
+
+ Copyright 1990, 1991, 1992, 1993, 1995, 1997, 1998, 1999, 2000,
+ 2002 Free Software Foundation, Inc.
+
Contributed by Cygnus Support. Written by John Gilmore.
This file is part of GDB.
@@ -40,7 +42,7 @@
and optionally adjust the pc to point to the correct memory location
for inserting the breakpoint. */
-unsigned char *
+const unsigned char *
memory_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
{
/* {BIG_,LITTLE_}BREAKPOINT is the sequence of bytes we insert for a
@@ -86,7 +88,7 @@ int
default_memory_insert_breakpoint (CORE_ADDR addr, char *contents_cache)
{
int val;
- unsigned char *bp;
+ const unsigned char *bp;
int bplen;
/* Determine appropriate breakpoint contents and size for this address. */
@@ -108,7 +110,7 @@ default_memory_insert_breakpoint (CORE_ADDR addr, char *contents_cache)
int
default_memory_remove_breakpoint (CORE_ADDR addr, char *contents_cache)
{
- unsigned char *bp;
+ const unsigned char *bp;
int bplen;
/* Determine appropriate breakpoint contents and size for this address. */
diff --git a/gdb/mi/ChangeLog b/gdb/mi/ChangeLog
index 7b71e8a..f2cc44a 100644
--- a/gdb/mi/ChangeLog
+++ b/gdb/mi/ChangeLog
@@ -1,3 +1,54 @@
+2002-04-14 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-main.c (mi_cmd_exec_return):
+
+2002-04-09 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-main.c (register_changed_p): Use frame_register_read instead
+ of read_relative_register_raw_bytes.
+ (get_register): Delete out-of-date comment.
+
+2002-04-07 Elena Zannoni <ezannoni@redhat.com>
+
+ * mi-cmd-disas.c: Run through indent.
+
+2002-04-07 Elena Zannoni <ezannoni@redhat.com>
+
+ * mi-cmd-disas.c (dump_insns): New function.
+ (do_mixed_source_and_assembly): New function.
+ (do_assembly_only): New function.
+ (do_disassembly): New function.
+ (mi_cmd_disassemble): Rewrite using smaller, more modular
+ functions.
+
+2002-04-05 Jim Blandy <jimb@redhat.com>
+
+ * mi-cmd-stack.c (list_args_or_locals): Pass new arg to
+ get_frame_block. (See entry in gdb/ChangeLog.)
+
+2002-04-05 Elena Zannoni <ezannoni@redhat.com>
+
+ * mi-cmd-disas.c (mi_cmd_disassemble): Use TARGET_PRINT_INSN
+ instead of tm_print_insn.
+ Update copyright year.
+
+2002-04-04 Daniel Jacobowitz <drow@mvista.com>
+
+ * mi-cmd-disas.c (mi_cmd_disassemble): Skip end-of-function
+ markers in the line table.
+
+2002-03-15 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-main.c (XMALLOC): Delete macro.
+ * mi-out.c (XMALLOC): Ditto.
+ * mi-parse.c (XMALLOC): Ditto.
+ * mi-console.c (XMALLOC): Ditto.
+ * mi-cmd-var.c (XMALLOC): Ditto.
+ * mi-cmd-break.c (XMALLOC): Ditto.
+
+ * mi/mi-cmd-var.c, mi/mi-console.c, mi/mi-out.c: Update copyright
+ * mi/mi-parse.c: Ditto.
+
2002-02-24 Andrew Cagney <ac131313@redhat.com>
From wiz at danbala:
diff --git a/gdb/mi/mi-cmd-break.c b/gdb/mi/mi-cmd-break.c
index 5061392..5d15aa9 100644
--- a/gdb/mi/mi-cmd-break.c
+++ b/gdb/mi/mi-cmd-break.c
@@ -29,11 +29,6 @@
#include "gdb-events.h"
#include "gdb.h"
-/* Convenience macro for allocting typesafe memory. */
-
-#undef XMALLOC
-#define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE))
-
enum
{
FROM_TTY = 0
diff --git a/gdb/mi/mi-cmd-disas.c b/gdb/mi/mi-cmd-disas.c
index afaf31c..70054c6 100644
--- a/gdb/mi/mi-cmd-disas.c
+++ b/gdb/mi/mi-cmd-disas.c
@@ -1,5 +1,5 @@
/* MI Command Set - disassemble commands.
- Copyright 2000, 2001 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
Contributed by Cygnus Solutions (a Red Hat company).
This file is part of GDB.
@@ -26,10 +26,6 @@
#include "mi-getopt.h"
#include "ui-out.h"
-static int gdb_dis_asm_read_memory (bfd_vma memaddr, bfd_byte * myaddr, unsigned int len,
- disassemble_info * info);
-static int compare_lines (const PTR mle1p, const PTR mle2p);
-
/* Disassemble functions. FIXME: these do not really belong here. We
should get rid of all the duplicate code in gdb that does the same
thing: disassemble_command() and the gdbtk variation. */
@@ -40,11 +36,11 @@ static int compare_lines (const PTR mle1p, const PTR mle2p);
reordering in this function. */
struct dis_line_entry
- {
- int line;
- CORE_ADDR start_pc;
- CORE_ADDR end_pc;
- };
+{
+ int line;
+ CORE_ADDR start_pc;
+ CORE_ADDR end_pc;
+};
/* This variable determines where memory used for disassembly is read from. */
int gdb_disassemble_from_exec = -1;
@@ -86,6 +82,290 @@ compare_lines (const PTR mle1p, const PTR mle2p)
return mle1->start_pc - mle2->start_pc;
}
+static int
+dump_insns (disassemble_info * di, CORE_ADDR low, CORE_ADDR high,
+ int how_many, struct ui_stream *stb)
+{
+ int num_displayed = 0;
+ CORE_ADDR pc;
+
+ /* parts of the symbolic representation of the address */
+ int unmapped;
+ char *filename = NULL;
+ char *name = NULL;
+ int offset;
+ int line;
+
+ for (pc = low; pc < high;)
+ {
+ QUIT;
+ if (how_many >= 0)
+ {
+ if (num_displayed >= how_many)
+ break;
+ else
+ num_displayed++;
+ }
+ ui_out_tuple_begin (uiout, NULL);
+ ui_out_field_core_addr (uiout, "address", pc);
+
+ if (!build_address_symbolic (pc, 0, &name, &offset, &filename,
+ &line, &unmapped))
+ {
+ /* We don't care now about line, filename and
+ unmapped. But we might in the future. */
+ ui_out_field_string (uiout, "func-name", name);
+ ui_out_field_int (uiout, "offset", offset);
+ }
+ if (filename != NULL)
+ xfree (filename);
+ if (name != NULL)
+ xfree (name);
+
+ ui_file_rewind (stb->stream);
+ pc += TARGET_PRINT_INSN (pc, di);
+ ui_out_field_stream (uiout, "inst", stb);
+ ui_file_rewind (stb->stream);
+ ui_out_tuple_end (uiout);
+ }
+ return num_displayed;
+}
+
+/* The idea here is to present a source-O-centric view of a
+ function to the user. This means that things are presented
+ in source order, with (possibly) out of order assembly
+ immediately following. */
+static void
+do_mixed_source_and_assembly (struct disassemble_info *di, int nlines,
+ struct linetable_entry *le,
+ CORE_ADDR low, CORE_ADDR high,
+ struct symtab *symtab,
+ int how_many, struct ui_stream *stb)
+{
+ int newlines = 0;
+ struct dis_line_entry *mle;
+ struct symtab_and_line sal;
+ int i;
+ int out_of_order = 0;
+ int next_line = 0;
+ CORE_ADDR pc;
+ int num_displayed = 0;
+
+ mle = (struct dis_line_entry *) alloca (nlines
+ * sizeof (struct dis_line_entry));
+
+ /* Copy linetable entries for this function into our data
+ structure, creating end_pc's and setting out_of_order as
+ appropriate. */
+
+ /* First, skip all the preceding functions. */
+
+ for (i = 0; i < nlines - 1 && le[i].pc < low; i++);
+
+ /* Now, copy all entries before the end of this function. */
+
+ for (; i < nlines - 1 && le[i].pc < high; i++)
+ {
+ if (le[i].line == le[i + 1].line && le[i].pc == le[i + 1].pc)
+ continue; /* Ignore duplicates */
+
+ /* Skip any end-of-function markers. */
+ if (le[i].line == 0)
+ continue;
+
+ mle[newlines].line = le[i].line;
+ if (le[i].line > le[i + 1].line)
+ out_of_order = 1;
+ mle[newlines].start_pc = le[i].pc;
+ mle[newlines].end_pc = le[i + 1].pc;
+ newlines++;
+ }
+
+ /* If we're on the last line, and it's part of the function,
+ then we need to get the end pc in a special way. */
+
+ if (i == nlines - 1 && le[i].pc < high)
+ {
+ mle[newlines].line = le[i].line;
+ mle[newlines].start_pc = le[i].pc;
+ sal = find_pc_line (le[i].pc, 0);
+ mle[newlines].end_pc = sal.end;
+ newlines++;
+ }
+
+ /* Now, sort mle by line #s (and, then by addresses within
+ lines). */
+
+ if (out_of_order)
+ qsort (mle, newlines, sizeof (struct dis_line_entry), compare_lines);
+
+ /* Now, for each line entry, emit the specified lines (unless
+ they have been emitted before), followed by the assembly code
+ for that line. */
+
+ ui_out_list_begin (uiout, "asm_insns");
+
+ for (i = 0; i < newlines; i++)
+ {
+ int close_list = 1;
+ /* Print out everything from next_line to the current line. */
+ if (mle[i].line >= next_line)
+ {
+ if (next_line != 0)
+ {
+ /* Just one line to print. */
+ if (next_line == mle[i].line)
+ {
+ ui_out_tuple_begin (uiout, "src_and_asm_line");
+ print_source_lines (symtab, next_line, mle[i].line + 1, 0);
+ }
+ else
+ {
+ /* Several source lines w/o asm instructions associated. */
+ for (; next_line < mle[i].line; next_line++)
+ {
+ ui_out_tuple_begin (uiout, "src_and_asm_line");
+ print_source_lines (symtab, next_line, next_line + 1,
+ 0);
+ ui_out_list_begin (uiout, "line_asm_insn");
+ ui_out_list_end (uiout);
+ ui_out_tuple_end (uiout);
+ }
+ /* Print the last line and leave list open for
+ asm instructions to be added. */
+ ui_out_tuple_begin (uiout, "src_and_asm_line");
+ print_source_lines (symtab, next_line, mle[i].line + 1, 0);
+ }
+ }
+ else
+ {
+ ui_out_tuple_begin (uiout, "src_and_asm_line");
+ print_source_lines (symtab, mle[i].line, mle[i].line + 1, 0);
+ }
+
+ next_line = mle[i].line + 1;
+ ui_out_list_begin (uiout, "line_asm_insn");
+ /* Don't close the list if the lines are not in order. */
+ if (i < (newlines - 1) && mle[i + 1].line <= mle[i].line)
+ close_list = 0;
+ }
+
+ num_displayed += dump_insns (di, mle[i].start_pc, mle[i].end_pc,
+ how_many, stb);
+ if (close_list)
+ {
+ ui_out_list_end (uiout);
+ ui_out_tuple_end (uiout);
+ close_list = 0;
+ }
+ if (how_many >= 0)
+ if (num_displayed >= how_many)
+ break;
+ }
+ ui_out_list_end (uiout);
+}
+
+
+static void
+do_assembly_only (disassemble_info * di, CORE_ADDR low,
+ CORE_ADDR high, int how_many, struct ui_stream *stb)
+{
+ int num_displayed = 0;
+
+ ui_out_list_begin (uiout, "asm_insns");
+
+ num_displayed = dump_insns (di, low, high, how_many, stb);
+
+ ui_out_list_end (uiout);
+}
+
+enum mi_cmd_result
+do_disassembly (char *file_string,
+ int line_num,
+ int mixed_source_and_assembly,
+ int how_many, CORE_ADDR low, CORE_ADDR high)
+{
+ static disassemble_info di;
+ static int di_initialized;
+ /* To collect the instruction outputted from opcodes. */
+ static struct ui_stream *stb = NULL;
+ struct symtab *symtab = NULL;
+ struct linetable_entry *le = NULL;
+ int nlines = -1;
+
+ if (!di_initialized)
+ {
+ /* We don't add a cleanup for this, because the allocation of
+ the stream is done once only for each gdb run, and we need to
+ keep it around until the end. Hopefully there won't be any
+ errors in the init code below, that make this function bail
+ out. */
+ stb = ui_out_stream_new (uiout);
+ INIT_DISASSEMBLE_INFO_NO_ARCH (di, stb->stream,
+ (fprintf_ftype) fprintf_unfiltered);
+ di.flavour = bfd_target_unknown_flavour;
+ di.memory_error_func = dis_asm_memory_error;
+ di.print_address_func = dis_asm_print_address;
+ di_initialized = 1;
+ }
+
+ di.mach = TARGET_PRINT_INSN_INFO->mach;
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+ di.endian = BFD_ENDIAN_BIG;
+ else
+ di.endian = BFD_ENDIAN_LITTLE;
+
+ /* If gdb_disassemble_from_exec == -1, then we use the following heuristic to
+ determine whether or not to do disassembly from target memory or from the
+ exec file:
+
+ If we're debugging a local process, read target memory, instead of the
+ exec file. This makes disassembly of functions in shared libs work
+ correctly. Also, read target memory if we are debugging native threads.
+
+ Else, we're debugging a remote process, and should disassemble from the
+ exec file for speed. However, this is no good if the target modifies its
+ code (for relocation, or whatever). */
+
+ if (gdb_disassemble_from_exec == -1)
+ {
+ if (strcmp (target_shortname, "child") == 0
+ || strcmp (target_shortname, "procfs") == 0
+ || strcmp (target_shortname, "vxprocess") == 0
+ || strstr (target_shortname, "-threads") != NULL)
+ gdb_disassemble_from_exec = 0; /* It's a child process, read inferior mem */
+ else
+ gdb_disassemble_from_exec = 1; /* It's remote, read the exec file */
+ }
+
+ if (gdb_disassemble_from_exec)
+ di.read_memory_func = gdb_dis_asm_read_memory;
+ else
+ di.read_memory_func = dis_asm_read_memory;
+
+ /* Assume symtab is valid for whole PC range */
+ symtab = find_pc_symtab (low);
+
+ if (symtab != NULL && symtab->linetable != NULL)
+ {
+ /* Convert the linetable to a bunch of my_line_entry's. */
+ le = symtab->linetable->item;
+ nlines = symtab->linetable->nitems;
+ }
+
+ if (!mixed_source_and_assembly || nlines <= 0
+ || symtab == NULL || symtab->linetable == NULL)
+ do_assembly_only (&di, low, high, how_many, stb);
+
+ else if (mixed_source_and_assembly)
+ do_mixed_source_and_assembly (&di, nlines, le, low,
+ high, symtab, how_many, stb);
+
+ gdb_flush (gdb_stdout);
+
+ return MI_CMD_DONE;
+}
+
/* The arguments to be passed on the command line and parsed here are:
either:
@@ -106,30 +386,15 @@ compare_lines (const PTR mle1p, const PTR mle2p)
MODE: 0 or 1 for disassembly only, or mixed source and disassembly,
respectively. */
-
enum mi_cmd_result
mi_cmd_disassemble (char *command, char **argv, int argc)
{
- CORE_ADDR pc;
+ enum mi_cmd_result retval;
CORE_ADDR start;
int mixed_source_and_assembly;
- int num_displayed;
- static disassemble_info di;
- static int di_initialized;
-
struct symtab *s;
- /* To collect the instruction outputted from opcodes. */
- static struct ui_stream *stb = NULL;
-
- /* parts of the symbolic representation of the address */
- int line;
- int offset;
- int unmapped;
- char *filename = NULL;
- char *name = NULL;
-
/* Which options have we processed ... */
int file_seen = 0;
int line_seen = 0;
@@ -148,11 +413,10 @@ mi_cmd_disassemble (char *command, char **argv, int argc)
int optind = 0;
char *optarg;
enum opt
- {
- FILE_OPT, LINE_OPT, NUM_OPT, START_OPT, END_OPT
- };
- static struct mi_opt opts[] =
{
+ FILE_OPT, LINE_OPT, NUM_OPT, START_OPT, END_OPT
+ };
+ static struct mi_opt opts[] = {
{"f", FILE_OPT, 1},
{"l", LINE_OPT, 1},
{"n", NUM_OPT, 1},
@@ -201,16 +465,19 @@ mi_cmd_disassemble (char *command, char **argv, int argc)
if (!((line_seen && file_seen && num_seen && !start_seen && !end_seen)
|| (line_seen && file_seen && !num_seen && !start_seen && !end_seen)
- || (!line_seen && !file_seen && !num_seen && start_seen && end_seen)))
- error ("mi_cmd_disassemble: Usage: ( [-f filename -l linenum [-n howmany]] | [-s startaddr -e endaddr]) [--] mixed_mode.");
+ || (!line_seen && !file_seen && !num_seen && start_seen && end_seen)))
+ error
+ ("mi_cmd_disassemble: Usage: ( [-f filename -l linenum [-n howmany]] | [-s startaddr -e endaddr]) [--] mixed_mode.");
if (argc != 1)
- error ("mi_cmd_disassemble: Usage: [-f filename -l linenum [-n howmany]] [-s startaddr -e endaddr] [--] mixed_mode.");
+ error
+ ("mi_cmd_disassemble: Usage: [-f filename -l linenum [-n howmany]] [-s startaddr -e endaddr] [--] mixed_mode.");
mixed_source_and_assembly = atoi (argv[0]);
if ((mixed_source_and_assembly != 0) && (mixed_source_and_assembly != 1))
error ("mi_cmd_disassemble: Mixed_mode argument must be 0 or 1.");
+
/* We must get the function beginning and end where line_num is
contained. */
@@ -225,271 +492,8 @@ mi_cmd_disassemble (char *command, char **argv, int argc)
error ("mi_cmd_disassemble: No function contains specified address");
}
- if (!di_initialized)
- {
- /* We don't add a cleanup for this, because the allocation of
- the stream is done once only for each gdb run, and we need to
- keep it around until the end. Hopefully there won't be any
- errors in the init code below, that make this function bail
- out. */
- stb = ui_out_stream_new (uiout);
- INIT_DISASSEMBLE_INFO_NO_ARCH (di, stb->stream,
- (fprintf_ftype) fprintf_unfiltered);
- di.flavour = bfd_target_unknown_flavour;
- di.memory_error_func = dis_asm_memory_error;
- di.print_address_func = dis_asm_print_address;
- di_initialized = 1;
- }
-
- di.mach = TARGET_PRINT_INSN_INFO->mach;
- if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
- di.endian = BFD_ENDIAN_BIG;
- else
- di.endian = BFD_ENDIAN_LITTLE;
-
- /* If gdb_disassemble_from_exec == -1, then we use the following heuristic to
- determine whether or not to do disassembly from target memory or from the
- exec file:
-
- If we're debugging a local process, read target memory, instead of the
- exec file. This makes disassembly of functions in shared libs work
- correctly. Also, read target memory if we are debugging native threads.
-
- Else, we're debugging a remote process, and should disassemble from the
- exec file for speed. However, this is no good if the target modifies its
- code (for relocation, or whatever).
- */
-
- if (gdb_disassemble_from_exec == -1)
- {
- if (strcmp (target_shortname, "child") == 0
- || strcmp (target_shortname, "procfs") == 0
- || strcmp (target_shortname, "vxprocess") == 0
- || strstr (target_shortname, "-threads") != NULL)
- gdb_disassemble_from_exec = 0; /* It's a child process, read inferior mem */
- else
- gdb_disassemble_from_exec = 1; /* It's remote, read the exec file */
- }
-
- if (gdb_disassemble_from_exec)
- di.read_memory_func = gdb_dis_asm_read_memory;
- else
- di.read_memory_func = dis_asm_read_memory;
-
- /* If just doing straight assembly, all we need to do is disassemble
- everything between low and high. If doing mixed source/assembly,
- we've got a totally different path to follow. */
-
- if (mixed_source_and_assembly)
- {
- /* Come here for mixed source/assembly */
- /* The idea here is to present a source-O-centric view of a
- function to the user. This means that things are presented
- in source order, with (possibly) out of order assembly
- immediately following. */
- struct symtab *symtab;
- struct linetable_entry *le;
- int nlines;
- int newlines;
- struct dis_line_entry *mle;
- struct symtab_and_line sal;
- int i;
- int out_of_order;
- int next_line;
-
- /* Assume symtab is valid for whole PC range */
- symtab = find_pc_symtab (low);
-
- if (!symtab || !symtab->linetable)
- goto assembly_only;
-
- /* First, convert the linetable to a bunch of my_line_entry's. */
-
- le = symtab->linetable->item;
- nlines = symtab->linetable->nitems;
-
- if (nlines <= 0)
- goto assembly_only;
-
- mle = (struct dis_line_entry *) alloca (nlines * sizeof (struct dis_line_entry));
-
- out_of_order = 0;
-
- /* Copy linetable entries for this function into our data
- structure, creating end_pc's and setting out_of_order as
- appropriate. */
-
- /* First, skip all the preceding functions. */
-
- for (i = 0; i < nlines - 1 && le[i].pc < low; i++);
-
- /* Now, copy all entries before the end of this function. */
-
- newlines = 0;
- for (; i < nlines - 1 && le[i].pc < high; i++)
- {
- if (le[i].line == le[i + 1].line
- && le[i].pc == le[i + 1].pc)
- continue; /* Ignore duplicates */
-
- mle[newlines].line = le[i].line;
- if (le[i].line > le[i + 1].line)
- out_of_order = 1;
- mle[newlines].start_pc = le[i].pc;
- mle[newlines].end_pc = le[i + 1].pc;
- newlines++;
- }
-
- /* If we're on the last line, and it's part of the function,
- then we need to get the end pc in a special way. */
-
- if (i == nlines - 1
- && le[i].pc < high)
- {
- mle[newlines].line = le[i].line;
- mle[newlines].start_pc = le[i].pc;
- sal = find_pc_line (le[i].pc, 0);
- mle[newlines].end_pc = sal.end;
- newlines++;
- }
-
- /* Now, sort mle by line #s (and, then by addresses within
- lines). */
-
- if (out_of_order)
- qsort (mle, newlines, sizeof (struct dis_line_entry), compare_lines);
-
- /* Now, for each line entry, emit the specified lines (unless
- they have been emitted before), followed by the assembly code
- for that line. */
-
- next_line = 0; /* Force out first line */
- ui_out_list_begin (uiout, "asm_insns");
- num_displayed = 0;
- for (i = 0; i < newlines; i++)
- {
- int close_list = 1;
- /* Print out everything from next_line to the current line. */
- if (mle[i].line >= next_line)
- {
- if (next_line != 0)
- {
- /* Just one line to print. */
- if (next_line == mle[i].line)
- {
- ui_out_tuple_begin (uiout, "src_and_asm_line");
- print_source_lines (symtab, next_line, mle[i].line + 1, 0);
- }
- else
- {
- /* Several source lines w/o asm instructions associated. */
- for (; next_line < mle[i].line; next_line++)
- {
- ui_out_tuple_begin (uiout, "src_and_asm_line");
- print_source_lines (symtab, next_line, mle[i].line + 1, 0);
- ui_out_list_begin (uiout, "line_asm_insn");
- ui_out_list_end (uiout);
- ui_out_tuple_end (uiout);
- }
- /* Print the last line and leave list open for
- asm instructions to be added. */
- ui_out_tuple_begin (uiout, "src_and_asm_line");
- print_source_lines (symtab, next_line, mle[i].line + 1, 0);
- }
- }
- else
- {
- ui_out_tuple_begin (uiout, "src_and_asm_line");
- print_source_lines (symtab, mle[i].line, mle[i].line + 1, 0);
- }
-
- next_line = mle[i].line + 1;
- ui_out_list_begin (uiout, "line_asm_insn");
- if (i + 1 < newlines && mle[i + 1].line <= mle[i].line)
- close_list = 0;
- }
- for (pc = mle[i].start_pc; pc < mle[i].end_pc;)
- {
- QUIT;
- if (how_many >= 0)
- {
- if (num_displayed >= how_many)
- break;
- else
- num_displayed++;
- }
- ui_out_tuple_begin (uiout, NULL);
- ui_out_field_core_addr (uiout, "address", pc);
-
- if (!build_address_symbolic (pc, 0, &name, &offset, &filename, &line, &unmapped))
- {
- /* We don't care now about line, filename and
- unmapped, but we might in the future. */
- ui_out_field_string (uiout, "func-name", name);
- ui_out_field_int (uiout, "offset", offset);
- }
- if (filename != NULL)
- xfree (filename);
- if (name != NULL)
- xfree (name);
-
- ui_file_rewind (stb->stream);
- pc += (*tm_print_insn) (pc, &di);
- ui_out_field_stream (uiout, "inst", stb);
- ui_file_rewind (stb->stream);
- ui_out_tuple_end (uiout);
- }
- if (close_list)
- {
- ui_out_list_end (uiout);
- ui_out_tuple_end (uiout);
- close_list = 0;
- }
- if (how_many >= 0)
- if (num_displayed >= how_many)
- break;
- }
- ui_out_list_end (uiout);
- }
- else
- {
- assembly_only:
- ui_out_list_begin (uiout, "asm_insns");
- num_displayed = 0;
- for (pc = low; pc < high;)
- {
- QUIT;
- if (how_many >= 0)
- {
- if (num_displayed >= how_many)
- break;
- else
- num_displayed++;
- }
- ui_out_tuple_begin (uiout, NULL);
- ui_out_field_core_addr (uiout, "address", pc);
-
- if (!build_address_symbolic (pc, 0, &name, &offset, &filename, &line, &unmapped))
- {
- /* We don't care now about line, filename and
- unmapped. But we might in the future. */
- ui_out_field_string (uiout, "func-name", name);
- ui_out_field_int (uiout, "offset", offset);
- }
- if (filename != NULL)
- xfree (filename);
- if (name != NULL)
- xfree (name);
-
- ui_file_rewind (stb->stream);
- pc += (*tm_print_insn) (pc, &di);
- ui_out_field_stream (uiout, "inst", stb);
- ui_file_rewind (stb->stream);
- ui_out_tuple_end (uiout);
- }
- ui_out_list_end (uiout);
- }
- gdb_flush (gdb_stdout);
-
- return MI_CMD_DONE;
+ retval = do_disassembly (file_string,
+ line_num,
+ mixed_source_and_assembly, how_many, low, high);
+ return retval;
}
diff --git a/gdb/mi/mi-cmd-stack.c b/gdb/mi/mi-cmd-stack.c
index 0e4bdf4..b4bae47 100644
--- a/gdb/mi/mi-cmd-stack.c
+++ b/gdb/mi/mi-cmd-stack.c
@@ -218,7 +218,7 @@ list_args_or_locals (int locals, int values, struct frame_info *fi)
stb = ui_out_stream_new (uiout);
- block = get_frame_block (fi);
+ block = get_frame_block (fi, 0);
ui_out_list_begin (uiout, locals ? "locals" : "args");
diff --git a/gdb/mi/mi-cmd-var.c b/gdb/mi/mi-cmd-var.c
index 0c84064..4848a4e 100644
--- a/gdb/mi/mi-cmd-var.c
+++ b/gdb/mi/mi-cmd-var.c
@@ -1,5 +1,7 @@
/* MI Command Set - varobj commands.
- Copyright 2000 Free Software Foundation, Inc.
+
+ Copyright 2000, 2002 Free Software Foundation, Inc.
+
Contributed by Cygnus Solutions (a Red Hat company).
This file is part of GDB.
@@ -27,11 +29,6 @@
#include "value.h"
#include <ctype.h>
-/* Convenience macro for allocting typesafe memory. */
-
-#undef XMALLOC
-#define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE))
-
extern int varobjdebug; /* defined in varobj.c */
static int varobj_update_one (struct varobj *var);
diff --git a/gdb/mi/mi-console.c b/gdb/mi/mi-console.c
index 5824f83..c1b6e9f 100644
--- a/gdb/mi/mi-console.c
+++ b/gdb/mi/mi-console.c
@@ -1,5 +1,7 @@
/* MI Console code.
- Copyright 2000, 2001 Free Software Foundation, Inc.
+
+ Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
+
Contributed by Cygnus Solutions (a Red Hat company).
This file is part of GDB.
@@ -23,11 +25,6 @@
#include "mi-console.h"
#include "gdb_string.h"
-/* Convenience macro for allocting typesafe memory. */
-
-#undef XMALLOC
-#define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE))
-
/* MI-console: send output to std-out but correcty encapsulated */
static ui_file_fputs_ftype mi_console_file_fputs;
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index 3a59fc8..ccb153f 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -42,11 +42,6 @@
#include <ctype.h>
#include <sys/time.h>
-/* Convenience macro for allocting typesafe memory. */
-
-#undef XMALLOC
-#define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE))
-
enum
{
FROM_TTY = 0
@@ -170,7 +165,7 @@ mi_cmd_exec_return (char *args, int from_tty)
/* Because we have called return_command with from_tty = 0, we need
to print the frame here. */
show_and_print_stack_frame (selected_frame,
- selected_frame_level,
+ frame_relative_level (selected_frame),
LOC_AND_ADDRESS);
return MI_CMD_DONE;
@@ -373,7 +368,7 @@ register_changed_p (int regnum)
{
char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
- if (read_relative_register_raw_bytes (regnum, raw_buffer))
+ if (! frame_register_read (selected_frame, regnum, raw_buffer))
return -1;
if (memcmp (&old_regs[REGISTER_BYTE (regnum)], raw_buffer,
@@ -486,10 +481,6 @@ get_register (int regnum, int format)
if (format == 'N')
format = 0;
- /* read_relative_register_raw_bytes returns a virtual frame pointer
- (FRAME_FP (selected_frame)) if regnum == FP_REGNUM instead
- of the real contents of the register. To get around this,
- use get_saved_register instead. */
get_saved_register (raw_buffer, &optim, (CORE_ADDR *) NULL, selected_frame,
regnum, (enum lval_type *) NULL);
if (optim)
diff --git a/gdb/mi/mi-out.c b/gdb/mi/mi-out.c
index a92ccbe..947720b 100644
--- a/gdb/mi/mi-out.c
+++ b/gdb/mi/mi-out.c
@@ -1,5 +1,7 @@
/* MI Command Set - output generating routines.
- Copyright 2000 Free Software Foundation, Inc.
+
+ Copyright 2000, 2002 Free Software Foundation, Inc.
+
Contributed by Cygnus Solutions (a Red Hat company).
This file is part of GDB.
@@ -23,12 +25,6 @@
#include "ui-out.h"
#include "mi-out.h"
-/* Convenience macro for allocting typesafe memory. */
-
-#ifndef XMALLOC
-#define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE))
-#endif
-
struct ui_out_data
{
int suppress_field_separator;
diff --git a/gdb/mi/mi-parse.c b/gdb/mi/mi-parse.c
index 2ed49b8..caefd59 100644
--- a/gdb/mi/mi-parse.c
+++ b/gdb/mi/mi-parse.c
@@ -1,5 +1,7 @@
/* MI Command Set - MI parser.
- Copyright 2000, 2001 Free Software Foundation, Inc.
+
+ Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
+
Contributed by Cygnus Solutions (a Red Hat company).
This file is part of GDB.
@@ -26,9 +28,6 @@
#include <ctype.h>
#include "gdb_string.h"
-#undef XMALLOC
-#define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
-
static void
mi_parse_argv (char *args, struct mi_parse *parse)
{
diff --git a/gdb/minsyms.c b/gdb/minsyms.c
index a4997bf..4fa1d91 100644
--- a/gdb/minsyms.c
+++ b/gdb/minsyms.c
@@ -504,52 +504,6 @@ lookup_minimal_symbol_by_pc (CORE_ADDR pc)
{
return lookup_minimal_symbol_by_pc_section (pc, find_pc_mapped_section (pc));
}
-
-#ifdef SOFUN_ADDRESS_MAYBE_MISSING
-CORE_ADDR
-find_stab_function_addr (char *namestring, char *filename,
- struct objfile *objfile)
-{
- struct minimal_symbol *msym;
- char *p;
- int n;
-
- p = strchr (namestring, ':');
- if (p == NULL)
- p = namestring;
- n = p - namestring;
- p = alloca (n + 2);
- strncpy (p, namestring, n);
- p[n] = 0;
-
- msym = lookup_minimal_symbol (p, filename, objfile);
- if (msym == NULL)
- {
- /* Sun Fortran appends an underscore to the minimal symbol name,
- try again with an appended underscore if the minimal symbol
- was not found. */
- p[n] = '_';
- p[n + 1] = 0;
- msym = lookup_minimal_symbol (p, filename, objfile);
- }
-
- if (msym == NULL && filename != NULL)
- {
- /* Try again without the filename. */
- p[n] = 0;
- msym = lookup_minimal_symbol (p, NULL, objfile);
- }
- if (msym == NULL && filename != NULL)
- {
- /* And try again for Sun Fortran, but without the filename. */
- p[n] = '_';
- p[n + 1] = 0;
- msym = lookup_minimal_symbol (p, NULL, objfile);
- }
-
- return msym == NULL ? 0 : SYMBOL_VALUE_ADDRESS (msym);
-}
-#endif /* SOFUN_ADDRESS_MAYBE_MISSING */
/* Return leading symbol character for a BFD. If BFD is NULL,
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index f0a27d9..3cee42e 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -1,7 +1,7 @@
/* Target-dependent code for the MIPS architecture, for GDB, the GNU Debugger.
- Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
- 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
+ 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
Contributed by Alessandro Forin(af@cs.cmu.edu) at CMU
and by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin.
@@ -44,6 +44,10 @@
#include "elf-bfd.h"
#include "symcat.h"
+/* A useful bit in the CP0 status register (PS_REGNUM). */
+/* This bit is set if we are emulating 32-bit FPRs on a 64-bit chip. */
+#define ST0_FR (1 << 26)
+
/* The sizes of floating point registers. */
enum
@@ -174,6 +178,31 @@ mips_saved_regsize (void)
return 4;
}
+/* Determine if a MIPS3 or later cpu is operating in MIPS{1,2} FPU
+ compatiblity mode. A return value of 1 means that we have
+ physical 64-bit registers, but should treat them as 32-bit registers. */
+
+static int
+mips2_fp_compat (void)
+{
+ /* MIPS1 and MIPS2 have only 32 bit FPRs, and the FR bit is not
+ meaningful. */
+ if (REGISTER_RAW_SIZE (FP0_REGNUM) == 4)
+ return 0;
+
+#if 0
+ /* FIXME drow 2002-03-10: This is disabled until we can do it consistently,
+ in all the places we deal with FP registers. PR gdb/413. */
+ /* Otherwise check the FR bit in the status register - it controls
+ the FP compatiblity mode. If it is clear we are in compatibility
+ mode. */
+ if ((read_register (PS_REGNUM) & ST0_FR) == 0)
+ return 1;
+#endif
+
+ return 0;
+}
+
/* Indicate that the ABI makes use of double-precision registers
provided by the FPU (rather than combining pairs of registers to
form double-precision values). Do not use "TARGET_IS_MIPS64" to
@@ -257,6 +286,9 @@ find_proc_desc (CORE_ADDR pc, struct frame_info *next_frame, int cur_frame);
static CORE_ADDR after_prologue (CORE_ADDR pc,
mips_extra_func_info_t proc_desc);
+static void mips_read_fp_register_single (int regno, char *rare_buffer);
+static void mips_read_fp_register_double (int regno, char *rare_buffer);
+
/* This value is the model of MIPS in use. It is derived from the value
of the PrID register. */
@@ -2076,7 +2108,7 @@ mips_init_extra_frame_info (int fromleaf, struct frame_info *fci)
We can't use fci->signal_handler_caller, it is not yet set. */
find_pc_partial_function (fci->pc, &name,
(CORE_ADDR *) NULL, (CORE_ADDR *) NULL);
- if (!IN_SIGTRAMP (fci->pc, name))
+ if (!PC_IN_SIGTRAMP (fci->pc, name))
{
frame_saved_regs_zalloc (fci);
memcpy (fci->saved_regs, temp_saved_regs, SIZEOF_FRAME_SAVED_REGS);
@@ -2676,34 +2708,133 @@ mips_pop_frame (void)
}
}
+/* Floating point register management.
+
+ Background: MIPS1 & 2 fp registers are 32 bits wide. To support
+ 64bit operations, these early MIPS cpus treat fp register pairs
+ (f0,f1) as a single register (d0). Later MIPS cpu's have 64 bit fp
+ registers and offer a compatibility mode that emulates the MIPS2 fp
+ model. When operating in MIPS2 fp compat mode, later cpu's split
+ double precision floats into two 32-bit chunks and store them in
+ consecutive fp regs. To display 64-bit floats stored in this
+ fashion, we have to combine 32 bits from f0 and 32 bits from f1.
+ Throw in user-configurable endianness and you have a real mess.
+
+ The way this works is:
+ - If we are in 32-bit mode or on a 32-bit processor, then a 64-bit
+ double-precision value will be split across two logical registers.
+ The lower-numbered logical register will hold the low-order bits,
+ regardless of the processor's endianness.
+ - If we are on a 64-bit processor, and we are looking for a
+ single-precision value, it will be in the low ordered bits
+ of a 64-bit GPR (after mfc1, for example) or a 64-bit register
+ save slot in memory.
+ - If we are in 64-bit mode, everything is straightforward.
+
+ Note that this code only deals with "live" registers at the top of the
+ stack. We will attempt to deal with saved registers later, when
+ the raw/cooked register interface is in place. (We need a general
+ interface that can deal with dynamic saved register sizes -- fp
+ regs could be 32 bits wide in one frame and 64 on the frame above
+ and below). */
+
+/* Copy a 32-bit single-precision value from the current frame
+ into rare_buffer. */
+
+static void
+mips_read_fp_register_single (int regno, char *rare_buffer)
+{
+ int raw_size = REGISTER_RAW_SIZE (regno);
+ char *raw_buffer = alloca (raw_size);
+
+ if (!frame_register_read (selected_frame, regno, raw_buffer))
+ error ("can't read register %d (%s)", regno, REGISTER_NAME (regno));
+ if (raw_size == 8)
+ {
+ /* We have a 64-bit value for this register. Find the low-order
+ 32 bits. */
+ int offset;
+
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+ offset = 4;
+ else
+ offset = 0;
+
+ memcpy (rare_buffer, raw_buffer + offset, 4);
+ }
+ else
+ {
+ memcpy (rare_buffer, raw_buffer, 4);
+ }
+}
+
+/* Copy a 64-bit double-precision value from the current frame into
+ rare_buffer. This may include getting half of it from the next
+ register. */
+
+static void
+mips_read_fp_register_double (int regno, char *rare_buffer)
+{
+ int raw_size = REGISTER_RAW_SIZE (regno);
+
+ if (raw_size == 8 && !mips2_fp_compat ())
+ {
+ /* We have a 64-bit value for this register, and we should use
+ all 64 bits. */
+ if (!frame_register_read (selected_frame, regno, rare_buffer))
+ error ("can't read register %d (%s)", regno, REGISTER_NAME (regno));
+ }
+ else
+ {
+ if ((regno - FP0_REGNUM) & 1)
+ internal_error (__FILE__, __LINE__,
+ "mips_read_fp_register_double: bad access to "
+ "odd-numbered FP register");
+
+ /* mips_read_fp_register_single will find the correct 32 bits from
+ each register. */
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+ {
+ mips_read_fp_register_single (regno, rare_buffer + 4);
+ mips_read_fp_register_single (regno + 1, rare_buffer);
+ }
+ else
+ {
+ mips_read_fp_register_single (regno, rare_buffer);
+ mips_read_fp_register_single (regno + 1, rare_buffer + 4);
+ }
+ }
+}
+
static void
mips_print_register (int regnum, int all)
{
char raw_buffer[MAX_REGISTER_RAW_SIZE];
/* Get the data in raw format. */
- if (read_relative_register_raw_bytes (regnum, raw_buffer))
+ if (!frame_register_read (selected_frame, regnum, raw_buffer))
{
printf_filtered ("%s: [Invalid]", REGISTER_NAME (regnum));
return;
}
- /* If an even floating point register, also print as double. */
+ /* If we have a actual 32-bit floating point register (or we are in
+ 32-bit compatibility mode), and the register is even-numbered,
+ also print it as a double (spanning two registers). */
if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (regnum)) == TYPE_CODE_FLT
+ && (REGISTER_RAW_SIZE (regnum) == 4
+ || mips2_fp_compat ())
&& !((regnum - FP0_REGNUM) & 1))
- if (REGISTER_RAW_SIZE (regnum) == 4) /* this would be silly on MIPS64 or N32 (Irix 6) */
- {
- char dbuffer[2 * MAX_REGISTER_RAW_SIZE];
+ {
+ char dbuffer[2 * MAX_REGISTER_RAW_SIZE];
- read_relative_register_raw_bytes (regnum, dbuffer);
- read_relative_register_raw_bytes (regnum + 1, dbuffer + MIPS_REGSIZE);
- REGISTER_CONVERT_TO_TYPE (regnum, builtin_type_double, dbuffer);
+ mips_read_fp_register_double (regnum, dbuffer);
- printf_filtered ("(d%d: ", regnum - FP0_REGNUM);
- val_print (builtin_type_double, dbuffer, 0, 0,
- gdb_stdout, 0, 1, 0, Val_pretty_default);
- printf_filtered ("); ");
- }
+ printf_filtered ("(d%d: ", regnum - FP0_REGNUM);
+ val_print (builtin_type_double, dbuffer, 0, 0,
+ gdb_stdout, 0, 1, 0, Val_pretty_default);
+ printf_filtered ("); ");
+ }
fputs_filtered (REGISTER_NAME (regnum), gdb_stdout);
/* The problem with printing numeric register names (r26, etc.) is that
@@ -2717,8 +2848,10 @@ mips_print_register (int regnum, int all)
/* If virtual format is floating, print it that way. */
if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (regnum)) == TYPE_CODE_FLT)
- if (FP_REGISTER_DOUBLE)
- { /* show 8-byte floats as float AND double: */
+ if (REGISTER_RAW_SIZE (regnum) == 8 && !mips2_fp_compat ())
+ {
+ /* We have a meaningful 64-bit value in this register. Show
+ it as a 32-bit float and a 64-bit double. */
int offset = 4 * (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG);
printf_filtered (" (float) ");
@@ -2753,35 +2886,25 @@ mips_print_register (int regnum, int all)
static int
do_fp_register_row (int regnum)
{ /* do values for FP (float) regs */
- char *raw_buffer[2];
- char *dbl_buffer;
- /* use HI and LO to control the order of combining two flt regs */
- int HI = (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG);
- int LO = (TARGET_BYTE_ORDER != BFD_ENDIAN_BIG);
+ char *raw_buffer;
double doub, flt1, flt2; /* doubles extracted from raw hex data */
int inv1, inv2, inv3;
- raw_buffer[0] = (char *) alloca (REGISTER_RAW_SIZE (FP0_REGNUM));
- raw_buffer[1] = (char *) alloca (REGISTER_RAW_SIZE (FP0_REGNUM));
- dbl_buffer = (char *) alloca (2 * REGISTER_RAW_SIZE (FP0_REGNUM));
+ raw_buffer = (char *) alloca (2 * REGISTER_RAW_SIZE (FP0_REGNUM));
- /* Get the data in raw format. */
- if (read_relative_register_raw_bytes (regnum, raw_buffer[HI]))
- error ("can't read register %d (%s)", regnum, REGISTER_NAME (regnum));
- if (REGISTER_RAW_SIZE (regnum) == 4)
+ if (REGISTER_RAW_SIZE (regnum) == 4 || mips2_fp_compat ())
{
- /* 4-byte registers: we can fit two registers per row. */
- /* Also print every pair of 4-byte regs as an 8-byte double. */
- if (read_relative_register_raw_bytes (regnum + 1, raw_buffer[LO]))
- error ("can't read register %d (%s)",
- regnum + 1, REGISTER_NAME (regnum + 1));
-
- /* copy the two floats into one double, and unpack both */
- memcpy (dbl_buffer, raw_buffer, 2 * REGISTER_RAW_SIZE (FP0_REGNUM));
- flt1 = unpack_double (builtin_type_float, raw_buffer[HI], &inv1);
- flt2 = unpack_double (builtin_type_float, raw_buffer[LO], &inv2);
- doub = unpack_double (builtin_type_double, dbl_buffer, &inv3);
+ /* 4-byte registers: we can fit two registers per row. */
+ /* Also print every pair of 4-byte regs as an 8-byte double. */
+ mips_read_fp_register_single (regnum, raw_buffer);
+ flt1 = unpack_double (builtin_type_float, raw_buffer, &inv1);
+
+ mips_read_fp_register_single (regnum + 1, raw_buffer);
+ flt2 = unpack_double (builtin_type_float, raw_buffer, &inv2);
+ mips_read_fp_register_double (regnum, raw_buffer);
+ doub = unpack_double (builtin_type_double, raw_buffer, &inv3);
+
printf_filtered (" %-5s", REGISTER_NAME (regnum));
if (inv1)
printf_filtered (": <invalid float>");
@@ -2805,14 +2928,14 @@ do_fp_register_row (int regnum)
regnum += 2;
}
else
- { /* eight byte registers: print each one as float AND as double. */
- int offset = 4 * (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG);
-
- memcpy (dbl_buffer, raw_buffer[HI], 2 * REGISTER_RAW_SIZE (FP0_REGNUM));
- flt1 = unpack_double (builtin_type_float,
- &raw_buffer[HI][offset], &inv1);
- doub = unpack_double (builtin_type_double, dbl_buffer, &inv3);
+ {
+ /* Eight byte registers: print each one as float AND as double. */
+ mips_read_fp_register_single (regnum, raw_buffer);
+ flt1 = unpack_double (builtin_type_double, raw_buffer, &inv1);
+ mips_read_fp_register_double (regnum, raw_buffer);
+ doub = unpack_double (builtin_type_double, raw_buffer, &inv3);
+
printf_filtered (" %-5s: ", REGISTER_NAME (regnum));
if (inv1)
printf_filtered ("<invalid float>");
@@ -2869,7 +2992,7 @@ do_gp_register_row (int regnum)
if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (regnum)) == TYPE_CODE_FLT)
break; /* end row: reached FP register */
/* OK: get the data in raw format. */
- if (read_relative_register_raw_bytes (regnum, raw_buffer))
+ if (!frame_register_read (selected_frame, regnum, raw_buffer))
error ("can't read register %d (%s)", regnum, REGISTER_NAME (regnum));
/* pad small registers */
for (byte = 0; byte < (MIPS_REGSIZE - REGISTER_VIRTUAL_SIZE (regnum)); byte++)
@@ -3589,7 +3712,7 @@ gdb_print_insn_mips (bfd_vma memaddr, disassemble_info *info)
(if necessary) to point to the actual memory location where the
breakpoint should be inserted. */
-unsigned char *
+const unsigned char *
mips_breakpoint_from_pc (CORE_ADDR * pcptr, int *lenptr)
{
if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
@@ -4238,7 +4361,6 @@ mips_gdbarch_init (struct gdbarch_info info,
set_gdbarch_read_pc (gdbarch, mips_read_pc);
set_gdbarch_write_pc (gdbarch, generic_target_write_pc);
set_gdbarch_read_fp (gdbarch, generic_target_read_fp);
- set_gdbarch_write_fp (gdbarch, generic_target_write_fp);
set_gdbarch_read_sp (gdbarch, generic_target_read_sp);
set_gdbarch_write_sp (gdbarch, generic_target_write_sp);
@@ -4455,9 +4577,6 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
"mips_dump_tdep: IGNORE_HELPER_CALL # %s\n",
XSTRING (IGNORE_HELPER_CALL (PC)));
fprintf_unfiltered (file,
- "mips_dump_tdep: IN_SIGTRAMP # %s\n",
- XSTRING (IN_SIGTRAMP (PC, NAME)));
- fprintf_unfiltered (file,
"mips_dump_tdep: IN_SOLIB_CALL_TRAMPOLINE # %s\n",
XSTRING (IN_SOLIB_CALL_TRAMPOLINE (PC, NAME)));
fprintf_unfiltered (file,
diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c
index a618ca7..0a5704b 100644
--- a/gdb/mn10300-tdep.c
+++ b/gdb/mn10300-tdep.c
@@ -1,6 +1,7 @@
/* Target-dependent code for the Matsushita MN10300 for GDB, the GNU debugger.
- Copyright 1996, 1997, 1998, 1999, 2000, 2001
- Free Software Foundation, Inc.
+
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software
+ Foundation, Inc.
This file is part of GDB.
@@ -187,7 +188,7 @@ mn10300_use_struct_convention (int gcc_p, struct type *type)
so we need a single byte breakpoint. Matsushita hasn't defined
one, so we defined it ourselves. */
-static unsigned char *
+const static unsigned char *
mn10300_breakpoint_from_pc (CORE_ADDR *bp_addr, int *bp_size)
{
static char breakpoint[] =
@@ -1010,7 +1011,7 @@ mn10300_print_register (const char *name, int regnum, int reg_width)
printf_filtered ("%s: ", name);
/* Get the data */
- if (read_relative_register_raw_bytes (regnum, raw_buffer))
+ if (!frame_register_read (selected_frame, regnum, raw_buffer))
{
printf_filtered ("[invalid]");
return;
diff --git a/gdb/monitor.c b/gdb/monitor.c
index e760d43..81340d4 100644
--- a/gdb/monitor.c
+++ b/gdb/monitor.c
@@ -2078,7 +2078,7 @@ static int
monitor_insert_breakpoint (CORE_ADDR addr, char *shadow)
{
int i;
- unsigned char *bp;
+ const unsigned char *bp;
int bplen;
monitor_debug ("MON inst bkpt %s\n", paddr (addr));
diff --git a/gdb/ocd.c b/gdb/ocd.c
index 6834eea..9dd90e9 100644
--- a/gdb/ocd.c
+++ b/gdb/ocd.c
@@ -255,7 +255,7 @@ ocd_start_remote (PTR dummy)
registers_changed ();
stop_pc = read_pc ();
set_current_frame (create_new_frame (read_fp (), stop_pc));
- select_frame (get_current_frame (), 0);
+ select_frame (get_current_frame ());
print_stack_frame (selected_frame, -1, 1);
buf[0] = OCD_LOG_FILE;
diff --git a/gdb/p-exp.y b/gdb/p-exp.y
index d1fcb1b..8efb450 100644
--- a/gdb/p-exp.y
+++ b/gdb/p-exp.y
@@ -37,8 +37,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
too messy, particularly when such includes can be inserted at random
times by the parser generator. */
-/* FIXME: there are still 21 shift/reduce conflicts
- Other known bugs or limitations:
+/* Known bugs or limitations:
- pascal string operations are not supported at all.
- there are some problems with boolean types.
- Pascal type hexadecimal constants are not supported
@@ -212,6 +211,7 @@ parse_number (char *, int, int, YYSTYPE *);
%left '*' '/'
%right UNARY INCREMENT DECREMENT
%right ARROW '.' '[' '('
+%left '^'
%token <ssym> BLOCKNAME
%type <bval> block
%left COLONCOLON
@@ -947,6 +947,8 @@ yylex ()
retry:
+ prev_lexptr = lexptr;
+
tokstart = lexptr;
explen = strlen (lexptr);
/* See if it is a special token of length 3. */
@@ -1300,7 +1302,7 @@ yylex ()
&is_a_field_of_this,
(struct symtab **) NULL);
/* second chance uppercased (as Free Pascal does). */
- if (!sym)
+ if (!sym && !is_a_field_of_this)
{
for (i = 0; i <= namelen; i++)
{
@@ -1311,7 +1313,7 @@ yylex ()
VAR_NAMESPACE,
&is_a_field_of_this,
(struct symtab **) NULL);
- if (sym)
+ if (sym || is_a_field_of_this)
for (i = 0; i <= namelen; i++)
{
if ((tokstart[i] >= 'a' && tokstart[i] <= 'z'))
@@ -1319,7 +1321,7 @@ yylex ()
}
}
/* Third chance Capitalized (as GPC does). */
- if (!sym)
+ if (!sym && !is_a_field_of_this)
{
for (i = 0; i <= namelen; i++)
{
@@ -1336,7 +1338,7 @@ yylex ()
VAR_NAMESPACE,
&is_a_field_of_this,
(struct symtab **) NULL);
- if (sym)
+ if (sym || is_a_field_of_this)
for (i = 0; i <= namelen; i++)
{
if (i == 0)
@@ -1481,5 +1483,8 @@ void
yyerror (msg)
char *msg;
{
+ if (prev_lexptr)
+ lexptr = prev_lexptr;
+
error ("A %s in expression, near `%s'.", (msg ? msg : "error"), lexptr);
}
diff --git a/gdb/p-lang.c b/gdb/p-lang.c
index 62c8a64..4796da5 100644
--- a/gdb/p-lang.c
+++ b/gdb/p-lang.c
@@ -44,7 +44,8 @@ extern void _initialize_pascal_language (void);
but this does not happen for Free Pascal nor for GPC. */
int
is_pascal_string_type (struct type *type,int *length_pos,
- int * length_size, int *string_pos, int *char_size)
+ int *length_size, int *string_pos, int *char_size,
+ char **arrayname)
{
if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
{
@@ -54,11 +55,17 @@ is_pascal_string_type (struct type *type,int *length_pos,
&& strcmp (TYPE_FIELDS (type)[0].name, "length") == 0
&& strcmp (TYPE_FIELDS (type)[1].name, "st") == 0)
{
- *length_pos = TYPE_FIELD_BITPOS (type, 0) / TARGET_CHAR_BIT;
- *length_size = TYPE_FIELD_TYPE (type, 0)->length;
- *string_pos = TYPE_FIELD_BITPOS (type, 1) / TARGET_CHAR_BIT;
- *char_size = 1;
- return 1;
+ if (length_pos)
+ *length_pos = TYPE_FIELD_BITPOS (type, 0) / TARGET_CHAR_BIT;
+ if (length_size)
+ *length_size = TYPE_FIELD_TYPE (type, 0)->length;
+ if (string_pos)
+ *string_pos = TYPE_FIELD_BITPOS (type, 1) / TARGET_CHAR_BIT;
+ if (char_size)
+ *char_size = 1;
+ if (arrayname)
+ *arrayname = TYPE_FIELDS (type)[1].name;
+ return 2;
};
/* GNU pascal strings. */
/* Three fields: Capacity, length and schema$ or _p_schema. */
@@ -66,12 +73,18 @@ is_pascal_string_type (struct type *type,int *length_pos,
&& strcmp (TYPE_FIELDS (type)[0].name, "Capacity") == 0
&& strcmp (TYPE_FIELDS (type)[1].name, "length") == 0)
{
- *length_pos = TYPE_FIELD_BITPOS (type, 1) / TARGET_CHAR_BIT;
- *length_size = TYPE_FIELD_TYPE (type, 1)->length;
- *string_pos = TYPE_FIELD_BITPOS (type, 2) / TARGET_CHAR_BIT;
+ if (length_pos)
+ *length_pos = TYPE_FIELD_BITPOS (type, 1) / TARGET_CHAR_BIT;
+ if (length_size)
+ *length_size = TYPE_FIELD_TYPE (type, 1)->length;
+ if (string_pos)
+ *string_pos = TYPE_FIELD_BITPOS (type, 2) / TARGET_CHAR_BIT;
/* FIXME: how can I detect wide chars in GPC ?? */
- *char_size = 1;
- return 1;
+ if (char_size)
+ *char_size = 1;
+ if (arrayname)
+ *arrayname = TYPE_FIELDS (type)[2].name;
+ return 3;
};
}
return 0;
@@ -280,7 +293,7 @@ pascal_create_fundamental_type (struct objfile *objfile, int typeid)
0, "void", objfile);
break;
case FT_CHAR:
- type = init_type (TYPE_CODE_INT,
+ type = init_type (TYPE_CODE_CHAR,
TARGET_CHAR_BIT / TARGET_CHAR_BIT,
0, "char", objfile);
break;
diff --git a/gdb/p-lang.h b/gdb/p-lang.h
index ca8a0a9..39eb043 100644
--- a/gdb/p-lang.h
+++ b/gdb/p-lang.h
@@ -38,7 +38,8 @@ extern void pascal_type_print_method_args (char *, char *,
/* These are in p-lang.c: */
-extern int is_pascal_string_type (struct type *, int *, int *, int *, int*);
+extern int
+ is_pascal_string_type (struct type *, int *, int *, int *, int *, char **);
extern void pascal_printchar (int, struct ui_file *);
diff --git a/gdb/p-typeprint.c b/gdb/p-typeprint.c
index f7fc389..e8de788 100644
--- a/gdb/p-typeprint.c
+++ b/gdb/p-typeprint.c
@@ -788,6 +788,14 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show,
show - 1, level);
break;
+ case TYPE_CODE_BITSTRING:
+ fputs_filtered ("BitString", stream);
+ break;
+
+ case TYPE_CODE_STRING:
+ fputs_filtered ("String", stream);
+ break;
+
default:
/* Handle types not explicitly handled by the other cases,
such as fundamental types. For these, just print whatever
diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c
index 0b89c72..c8060a2 100644
--- a/gdb/p-valprint.c
+++ b/gdb/p-valprint.c
@@ -190,8 +190,8 @@ pascal_val_print (struct type *type, char *valaddr, int embedded_offset,
as GDB does not recognize stabs pascal strings
Pascal strings are mapped to records
with lowercase names PM */
- if (is_pascal_string_type (elttype, &length_pos,
- &length_size, &string_pos, &char_size)
+ if (is_pascal_string_type (elttype, &length_pos, &length_size,
+ &string_pos, &char_size, NULL)
&& addr != 0)
{
ULONGEST string_length;
@@ -320,7 +320,7 @@ pascal_val_print (struct type *type, char *valaddr, int embedded_offset,
else
{
if (is_pascal_string_type (type, &length_pos, &length_size,
- &string_pos, &char_size))
+ &string_pos, &char_size, NULL))
{
len = extract_unsigned_integer (valaddr + embedded_offset + length_pos, length_size);
LA_PRINT_STRING (stream, valaddr + embedded_offset + string_pos, len, char_size, 0);
diff --git a/gdb/parse.c b/gdb/parse.c
index b3fbe19..9c1f3e1 100644
--- a/gdb/parse.c
+++ b/gdb/parse.c
@@ -47,6 +47,8 @@
#include "inferior.h" /* for NUM_PSEUDO_REGS. NOTE: replace
with "gdbarch.h" when appropriate. */
#include "doublest.h"
+#include "builtin-regs.h"
+#include "gdb_assert.h"
/* Symbols which architectures can redefine. */
@@ -74,6 +76,7 @@ int arglist_len;
union type_stack_elt *type_stack;
int type_stack_depth, type_stack_size;
char *lexptr;
+char *prev_lexptr;
char *namecopy;
int paren_depth;
int comma_terminates;
@@ -102,15 +105,9 @@ struct funcall
static struct funcall *funcall_chain;
-/* Assign machine-independent names to certain registers
- (unless overridden by the REGISTER_NAMES table) */
-
-unsigned num_std_regs = 0;
-struct std_regs *std_regs;
-
/* The generic method for targets to specify how their registers are
- named. The mapping can be derived from three sources:
- REGISTER_NAME; std_regs; or a target specific alias hook. */
+ named. The mapping can be derived from two sources: REGISTER_NAME;
+ or builtin regs. */
int
target_map_name_to_register (char *str, int len)
@@ -125,13 +122,21 @@ target_map_name_to_register (char *str, int len)
return i;
}
- /* Try standard aliases. */
- for (i = 0; i < num_std_regs; i++)
- if (std_regs[i].name && len == strlen (std_regs[i].name)
- && STREQN (str, std_regs[i].name, len))
- {
- return std_regs[i].regnum;
- }
+ /* Try builtin registers. */
+ i = builtin_reg_map_name_to_regnum (str, len);
+ if (i >= 0)
+ {
+ gdb_assert (i >= NUM_REGS + NUM_PSEUDO_REGS);
+ return i;
+ }
+
+ /* Try builtin registers. */
+ i = builtin_reg_map_name_to_regnum (str, len);
+ if (i >= 0)
+ {
+ gdb_assert (i >= NUM_REGS + NUM_PSEUDO_REGS);
+ return i;
+ }
return -1;
}
@@ -1122,6 +1127,7 @@ parse_exp_1 (char **stringptr, struct block *block, int comma)
struct cleanup *old_chain;
lexptr = *stringptr;
+ prev_lexptr = NULL;
paren_depth = 0;
type_stack_depth = 0;
@@ -1134,7 +1140,7 @@ parse_exp_1 (char **stringptr, struct block *block, int comma)
old_chain = make_cleanup (free_funcalls, 0 /*ignore*/);
funcall_chain = 0;
- expression_context_block = block ? block : get_selected_block ();
+ expression_context_block = block ? block : get_selected_block (0);
namecopy = (char *) alloca (strlen (lexptr) + 1);
expout_size = 10;
@@ -1351,63 +1357,6 @@ build_parse (void)
init_type (TYPE_CODE_INT, 1, 0,
"<variable (not text or data), no debug info>",
NULL);
-
- /* create the std_regs table */
-
- num_std_regs = 0;
-#ifdef PC_REGNUM
- if (PC_REGNUM >= 0)
- num_std_regs++;
-#endif
-#ifdef FP_REGNUM
- if (FP_REGNUM >= 0)
- num_std_regs++;
-#endif
-#ifdef SP_REGNUM
- if (SP_REGNUM >= 0)
- num_std_regs++;
-#endif
-#ifdef PS_REGNUM
- if (PS_REGNUM >= 0)
- num_std_regs++;
-#endif
- /* create an empty table */
- std_regs = xmalloc ((num_std_regs + 1) * sizeof *std_regs);
- i = 0;
- /* fill it in */
-#ifdef PC_REGNUM
- if (PC_REGNUM >= 0)
- {
- std_regs[i].name = "pc";
- std_regs[i].regnum = PC_REGNUM;
- i++;
- }
-#endif
-#ifdef FP_REGNUM
- if (FP_REGNUM >= 0)
- {
- std_regs[i].name = "fp";
- std_regs[i].regnum = FP_REGNUM;
- i++;
- }
-#endif
-#ifdef SP_REGNUM
- if (SP_REGNUM >= 0)
- {
- std_regs[i].name = "sp";
- std_regs[i].regnum = SP_REGNUM;
- i++;
- }
-#endif
-#ifdef PS_REGNUM
- if (PS_REGNUM >= 0)
- {
- std_regs[i].name = "ps";
- std_regs[i].regnum = PS_REGNUM;
- i++;
- }
-#endif
- memset (&std_regs[i], 0, sizeof (std_regs[i]));
}
void
@@ -1427,8 +1376,6 @@ _initialize_parse (void)
register_gdbarch_swap (&msym_data_symbol_type, sizeof (msym_data_symbol_type), NULL);
register_gdbarch_swap (&msym_unknown_symbol_type, sizeof (msym_unknown_symbol_type), NULL);
- register_gdbarch_swap (&num_std_regs, sizeof (std_regs), NULL);
- register_gdbarch_swap (&std_regs, sizeof (std_regs), NULL);
register_gdbarch_swap (NULL, 0, build_parse);
add_show_from_set (
diff --git a/gdb/parser-defs.h b/gdb/parser-defs.h
index 66e929f..ece2849 100644
--- a/gdb/parser-defs.h
+++ b/gdb/parser-defs.h
@@ -1,6 +1,8 @@
/* Parser definitions for GDB.
- Copyright 1986, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
- 1998, 1999, 2000 Free Software Foundation, Inc.
+
+ Copyright 1986, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
+ 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
+
Modified from expread.y by the Department of Computer Science at the
State University of New York at Buffalo.
@@ -26,15 +28,6 @@
#include "doublest.h"
-struct std_regs
- {
- char *name;
- int regnum;
- };
-
-extern struct std_regs *std_regs;
-extern unsigned num_std_regs;
-
extern struct expression *expout;
extern int expout_size;
extern int expout_ptr;
@@ -157,6 +150,10 @@ extern struct type *follow_types (struct type *);
extern char *lexptr;
+/* After a token has been recognized, this variable points to it.
+ Currently used only for error reporting. */
+extern char *prev_lexptr;
+
/* Tokens that refer to names do so with explicit pointer and length,
so they can share the storage that lexptr is parsing.
@@ -208,8 +205,8 @@ struct op_print
};
/* The generic method for targets to specify how their registers are
- named. The mapping can be derived from three sources:
- REGISTER_NAME; std_regs; or a target specific alias hook. */
+ named. The mapping can be derived from two sources: REGISTER_NAME;
+ and builtin regs. */
extern int target_map_name_to_register (char *, int);
diff --git a/gdb/ppc-bdm.c b/gdb/ppc-bdm.c
index b2287ea..0797e0d 100644
--- a/gdb/ppc-bdm.c
+++ b/gdb/ppc-bdm.c
@@ -201,6 +201,7 @@ bdm_ppc_fetch_registers (int regno)
/* if asking for an invalid register */
if ((first_regno == gdbarch_tdep (current_gdbarch)->ppc_mq_regnum)
+ || (first_regno == gdbarch_tdep (current_gdbarch)->ppc_fpscr_regnum)
|| ((first_regno >= FP0_REGNUM) && (first_regno <= FPLAST_REGNUM)))
{
/* printf("invalid reg request!\n"); */
@@ -289,7 +290,9 @@ bdm_ppc_store_registers (int regno)
/* only attempt to write if it's a valid ppc 8xx register */
/* (need to avoid FP regs and MQ reg) */
- if ((i != gdbarch_tdep (current_gdbarch)->ppc_mq_regnum) && ((i < FP0_REGNUM) || (i > FPLAST_REGNUM)))
+ if ((i != gdbarch_tdep (current_gdbarch)->ppc_mq_regnum)
+ && (i != gdbarch_tdep (current_gdbarch)->ppc_fpscr_regnum)
+ && ((i < FP0_REGNUM) || (i > FPLAST_REGNUM)))
{
/* printf("write valid reg %d\n", bdm_regno); */
ocd_write_bdm_registers (bdm_regno, registers + REGISTER_BYTE (i), 4);
diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c
index e4bb868..25616c0 100644
--- a/gdb/ppc-linux-nat.c
+++ b/gdb/ppc-linux-nat.c
@@ -149,6 +149,8 @@ ppc_register_u_addr (int regno)
u_addr = PT_MQ * 4;
if (regno == tdep->ppc_ps_regnum)
u_addr = PT_MSR * 4;
+ if (regno == tdep->ppc_fpscr_regnum)
+ u_addr = PT_FPSCR * 4;
return u_addr;
}
@@ -290,8 +292,10 @@ fetch_ppc_registers (int tid)
int i;
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
- for (i = 0; i <= tdep->ppc_mq_regnum; i++)
+ for (i = 0; i <= tdep->ppc_fpscr_regnum; i++)
fetch_register (tid, i);
+ if (tdep->ppc_mq_regnum != -1)
+ fetch_register (tid, tdep->ppc_mq_regnum);
if (have_ptrace_getvrregs)
if (tdep->ppc_vr0_regnum != -1 && tdep->ppc_vrsave_regnum != -1)
fetch_altivec_registers (tid);
@@ -376,6 +380,14 @@ store_register (int tid, int regno)
ptrace (PT_WRITE_U, tid, (PTRACE_ARG3_TYPE) regaddr,
*(PTRACE_XFER_TYPE *) & buf[i]);
regaddr += sizeof (PTRACE_XFER_TYPE);
+
+ if (errno == EIO
+ && regno == gdbarch_tdep (current_gdbarch)->ppc_fpscr_regnum)
+ {
+ /* Some older kernel versions don't allow fpscr to be written. */
+ continue;
+ }
+
if (errno != 0)
{
sprintf (mess, "writing register %s (#%d)",
@@ -435,8 +447,10 @@ store_ppc_registers (int tid)
int i;
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
- for (i = 0; i <= tdep->ppc_mq_regnum; i++)
+ for (i = 0; i <= tdep->ppc_fpscr_regnum; i++)
store_register (tid, i);
+ if (tdep->ppc_mq_regnum != -1)
+ store_register (tid, tdep->ppc_mq_regnum);
if (have_ptrace_getvrregs)
if (tdep->ppc_vr0_regnum != -1 && tdep->ppc_vrsave_regnum != -1)
store_altivec_registers (tid);
@@ -473,7 +487,8 @@ supply_gregset (gdb_gregset_t *gregsetp)
supply_register (tdep->ppc_cr_regnum, (char *) (regp + PT_CCR));
supply_register (tdep->ppc_xer_regnum, (char *) (regp + PT_XER));
supply_register (tdep->ppc_ctr_regnum, (char *) (regp + PT_CTR));
- supply_register (tdep->ppc_mq_regnum, (char *) (regp + PT_MQ));
+ if (tdep->ppc_mq_regnum != -1)
+ supply_register (tdep->ppc_mq_regnum, (char *) (regp + PT_MQ));
supply_register (tdep->ppc_ps_regnum, (char *) (regp + PT_MSR));
}
@@ -500,7 +515,8 @@ fill_gregset (gdb_gregset_t *gregsetp, int regno)
regcache_collect (tdep->ppc_xer_regnum, regp + PT_XER);
if ((regno == -1) || regno == tdep->ppc_ctr_regnum)
regcache_collect (tdep->ppc_ctr_regnum, regp + PT_CTR);
- if ((regno == -1) || regno == tdep->ppc_mq_regnum)
+ if (((regno == -1) || regno == tdep->ppc_mq_regnum)
+ && (tdep->ppc_mq_regnum != -1))
regcache_collect (tdep->ppc_mq_regnum, regp + PT_MQ);
if ((regno == -1) || regno == tdep->ppc_ps_regnum)
regcache_collect (tdep->ppc_ps_regnum, regp + PT_MSR);
@@ -510,9 +526,11 @@ void
supply_fpregset (gdb_fpregset_t * fpregsetp)
{
int regi;
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
for (regi = 0; regi < 32; regi++)
supply_register (FP0_REGNUM + regi, (char *) (*fpregsetp + regi));
+ supply_register (tdep->ppc_fpscr_regnum, (char *) (*fpregsetp + 32));
}
/* Given a pointer to a floating point register set in /proc format
@@ -523,10 +541,13 @@ void
fill_fpregset (gdb_fpregset_t *fpregsetp, int regno)
{
int regi;
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
for (regi = 0; regi < 32; regi++)
{
if ((regno == -1) || (regno == FP0_REGNUM + regi))
regcache_collect (FP0_REGNUM + regi, (char *) (*fpregsetp + regi));
}
+ if ((regno == -1) || regno == tdep->ppc_fpscr_regnum)
+ regcache_collect (tdep->ppc_fpscr_regnum, (char *) (*fpregsetp + regi));
}
diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c
index b12cffd..f358274 100644
--- a/gdb/ppc-linux-tdep.c
+++ b/gdb/ppc-linux-tdep.c
@@ -106,10 +106,11 @@ static int ppc_linux_at_sigtramp_return_path (CORE_ADDR pc);
/* Determine if pc is in a signal trampoline...
Ha! That's not what this does at all. wait_for_inferior in
- infrun.c calls IN_SIGTRAMP in order to detect entry into a signal
- trampoline just after delivery of a signal. But on GNU/Linux,
- signal trampolines are used for the return path only. The kernel
- sets things up so that the signal handler is called directly.
+ infrun.c calls PC_IN_SIGTRAMP in order to detect entry into a
+ signal trampoline just after delivery of a signal. But on
+ GNU/Linux, signal trampolines are used for the return path only.
+ The kernel sets things up so that the signal handler is called
+ directly.
If we use in_sigtramp2() in place of in_sigtramp() (see below)
we'll (often) end up with stop_pc in the trampoline and prev_pc in
@@ -141,11 +142,11 @@ static int ppc_linux_at_sigtramp_return_path (CORE_ADDR pc);
first instruction long after the fact, just in case the observed
behavior is ever fixed.)
- IN_SIGTRAMP is called from blockframe.c as well in order to set
+ PC_IN_SIGTRAMP is called from blockframe.c as well in order to set
the signal_handler_caller flag. Because of our strange definition
- of in_sigtramp below, we can't rely on signal_handler_caller getting
- set correctly from within blockframe.c. This is why we take pains
- to set it in init_extra_frame_info(). */
+ of in_sigtramp below, we can't rely on signal_handler_caller
+ getting set correctly from within blockframe.c. This is why we
+ take pains to set it in init_extra_frame_info(). */
int
ppc_linux_in_sigtramp (CORE_ADDR pc, char *func_name)
@@ -414,6 +415,32 @@ ppc_linux_frame_chain (struct frame_info *thisframe)
it may be used generically by ports which use either the SysV ABI or
the EABI */
+/* Until November 2001, gcc was not complying to the SYSV ABI for
+ returning structures less than or equal to 8 bytes in size. It was
+ returning everything in memory. When this was corrected, it wasn't
+ fixed for native platforms. */
+int
+ppc_sysv_abi_broken_use_struct_convention (int gcc_p, struct type *value_type)
+{
+ if (TYPE_LENGTH (value_type) == 16
+ && TYPE_VECTOR (value_type))
+ return 0;
+
+ return generic_use_struct_convention (gcc_p, value_type);
+}
+
+/* Structures 8 bytes or less long are returned in the r3 & r4
+ registers, according to the SYSV ABI. */
+int
+ppc_sysv_abi_use_struct_convention (int gcc_p, struct type *value_type)
+{
+ if (TYPE_LENGTH (value_type) == 16
+ && TYPE_VECTOR (value_type))
+ return 0;
+
+ return (TYPE_LENGTH (value_type) > 8);
+}
+
/* round2 rounds x up to the nearest multiple of s assuming that s is a
power of 2 */
@@ -436,7 +463,12 @@ ppc_sysv_abi_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
int struct_return, CORE_ADDR struct_addr)
{
int argno;
- int greg, freg;
+ /* Next available general register for non-float, non-vector arguments. */
+ int greg;
+ /* Next available floating point register for float arguments. */
+ int freg;
+ /* Next available vector register for vector arguments. */
+ int vreg;
int argstkspace;
int structstkspace;
int argoffset;
@@ -449,6 +481,7 @@ ppc_sysv_abi_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
greg = struct_return ? 4 : 3;
freg = 1;
+ vreg = 2;
argstkspace = 0;
structstkspace = 0;
@@ -491,21 +524,38 @@ ppc_sysv_abi_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
greg += 2;
}
}
- else
- {
+ else if (!TYPE_VECTOR (type))
+ {
if (len > 4
|| TYPE_CODE (type) == TYPE_CODE_STRUCT
|| TYPE_CODE (type) == TYPE_CODE_UNION)
{
/* Rounding to the nearest multiple of 8 may not be necessary,
- but it is safe. Particularly since we don't know the
- field types of the structure */
+ but it is safe. Particularly since we don't know the
+ field types of the structure */
structstkspace += round2 (len, 8);
}
if (greg <= 10)
greg++;
else
argstkspace += 4;
+ }
+ else
+ {
+ if (len == 16
+ && TYPE_CODE (type) == TYPE_CODE_ARRAY
+ && TYPE_VECTOR (type))
+ {
+ if (vreg <= 13)
+ vreg++;
+ else
+ {
+ /* Vector arguments must be aligned to 16 bytes on
+ the stack. */
+ argstkspace += round2 (argstkspace, 16);
+ argstkspace += 16;
+ }
+ }
}
}
@@ -531,6 +581,7 @@ ppc_sysv_abi_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
structoffset = argoffset + argstkspace;
freg = 1;
greg = 3;
+ vreg = 2;
/* Fill in r3 with the return structure, if any */
if (struct_return)
{
@@ -552,7 +603,7 @@ ppc_sysv_abi_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
{
if (len > 8)
printf_unfiltered (
- "Fatal Error: a floating point parameter #%d with a size > 8 is found!\n", argno);
+ "Fatal Error: a floating point parameter #%d with a size > 8 is found!\n", argno);
memcpy (&registers[REGISTER_BYTE (FP0_REGNUM + freg)],
VALUE_CONTENTS (arg), len);
freg++;
@@ -590,7 +641,7 @@ ppc_sysv_abi_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
greg += 2;
}
}
- else
+ else if (!TYPE_VECTOR (type))
{
char val_buf[4];
if (len > 4
@@ -608,7 +659,6 @@ ppc_sysv_abi_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
}
if (greg <= 10)
{
- *(int *) &registers[REGISTER_BYTE (greg)] = 0;
memcpy (&registers[REGISTER_BYTE (greg)], val_buf, 4);
greg++;
}
@@ -618,6 +668,30 @@ ppc_sysv_abi_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
argoffset += 4;
}
}
+ else
+ {
+ if (len == 16
+ && TYPE_CODE (type) == TYPE_CODE_ARRAY
+ && TYPE_VECTOR (type))
+ {
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+ char *v_val_buf = alloca (16);
+ memset (v_val_buf, 0, 16);
+ memcpy (v_val_buf, VALUE_CONTENTS (arg), len);
+ if (vreg <= 13)
+ {
+ memcpy (&registers[REGISTER_BYTE (tdep->ppc_vr0_regnum
+ + vreg)],
+ v_val_buf, 16);
+ vreg++;
+ }
+ else
+ {
+ write_memory (sp + argoffset, v_val_buf, 16);
+ argoffset += 16;
+ }
+ }
+ }
}
target_store_registers (-1);
@@ -751,7 +825,7 @@ ppc_sysv_abi_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
int
ppc_linux_memory_remove_breakpoint (CORE_ADDR addr, char *contents_cache)
{
- unsigned char *bp;
+ const unsigned char *bp;
int val;
int bplen;
char old_contents[BREAKPOINT_MAX];
diff --git a/gdb/ppc-tdep.h b/gdb/ppc-tdep.h
index 029f87c..3da66ad 100644
--- a/gdb/ppc-tdep.h
+++ b/gdb/ppc-tdep.h
@@ -31,6 +31,8 @@ void ppc_linux_init_extra_frame_info (int fromleaf, struct frame_info *);
int ppc_linux_frameless_function_invocation (struct frame_info *);
void ppc_linux_frame_init_saved_regs (struct frame_info *);
CORE_ADDR ppc_linux_frame_chain (struct frame_info *);
+int ppc_sysv_abi_use_struct_convention (int, struct type *);
+int ppc_sysv_abi_broken_use_struct_convention (int, struct type *);
CORE_ADDR ppc_sysv_abi_push_arguments (int, struct value **, CORE_ADDR, int,
CORE_ADDR);
int ppc_linux_memory_remove_breakpoint (CORE_ADDR addr, char *contents_cache);
@@ -61,9 +63,13 @@ struct gdbarch_tdep
int ppc_lr_regnum; /* Link register */
int ppc_ctr_regnum; /* Count register */
int ppc_xer_regnum; /* Integer exception register */
+ int ppc_fpscr_regnum; /* Floating point status and condition
+ register */
int ppc_mq_regnum; /* Multiply/Divide extension register */
int ppc_vr0_regnum; /* First AltiVec register */
int ppc_vrsave_regnum; /* Last AltiVec register */
+ int lr_frame_offset; /* Offset to ABI specific location where
+ link register is saved. */
};
#endif
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index 0315227..b74f558 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -1113,7 +1113,7 @@ address_info (char *exp, int from_tty)
if (exp == 0)
error ("Argument required.");
- sym = lookup_symbol (exp, get_selected_block (), VAR_NAMESPACE,
+ sym = lookup_symbol (exp, get_selected_block (0), VAR_NAMESPACE,
&is_a_field_of_this, (struct symtab **) NULL);
if (sym == NULL)
{
@@ -1549,7 +1549,7 @@ do_one_display (struct display *d)
return;
if (d->block)
- within_current_scope = contained_in (get_selected_block (), d->block);
+ within_current_scope = contained_in (get_selected_block (0), d->block);
else
within_current_scope = 1;
if (!within_current_scope)
@@ -1683,7 +1683,7 @@ Num Enb Expression\n");
else if (d->format.format)
printf_filtered ("/%c ", d->format.format);
print_expression (d->exp, gdb_stdout);
- if (d->block && !contained_in (get_selected_block (), d->block))
+ if (d->block && !contained_in (get_selected_block (0), d->block))
printf_filtered (" (cannot be evaluated in the current context)");
printf_filtered ("\n");
gdb_flush (gdb_stdout);
@@ -2436,7 +2436,7 @@ with this command or \"print\".", NULL));
Default is the function surrounding the pc of the selected frame.\n\
With a single argument, the function surrounding that address is dumped.\n\
Two arguments are taken as a range of memory to dump.");
- c->completer = location_completer;
+ set_cmd_completer (c, location_completer);
if (xdb_commands)
add_com_alias ("va", "disassemble", class_xdb, 0);
@@ -2519,7 +2519,7 @@ You can see these environment settings with the \"show\" command.", NULL));
The argument is the function name and arguments, in the notation of the\n\
current working language. The result is printed and saved in the value\n\
history, if it is not void.");
- c->completer = location_completer;
+ set_cmd_completer (c, location_completer);
add_cmd ("variable", class_vars, set_command,
"Evaluate expression EXP and assign result to variable VAR, using assignment\n\
@@ -2552,13 +2552,13 @@ resides in memory.\n",
"\n\
EXP may be preceded with /FMT, where FMT is a format letter\n\
but no count or size letter (see \"x\" command).", NULL));
- c->completer = location_completer;
+ set_cmd_completer (c, location_completer);
add_com_alias ("p", "print", class_vars, 1);
c = add_com ("inspect", class_vars, inspect_command,
"Same as \"print\" command, except that if you are running in the epoch\n\
environment, the value is printed in its own window.");
- c->completer = location_completer;
+ set_cmd_completer (c, location_completer);
add_show_from_set (
add_set_cmd ("max-symbolic-offset", no_class, var_uinteger,
diff --git a/gdb/proc-api.c b/gdb/proc-api.c
index 986691d..2d3ca9f 100644
--- a/gdb/proc-api.c
+++ b/gdb/proc-api.c
@@ -778,7 +778,7 @@ _initialize_proc_api (void)
add_show_from_set (c, &showlist);
set_cmd_sfunc (c, set_procfs_trace_cmd);
- c->completer = filename_completer;
+ set_cmd_completer (c, filename_completer);
c = add_set_cmd ("procfs-file", no_class, var_filename,
(char *) &procfs_filename,
diff --git a/gdb/regcache.c b/gdb/regcache.c
index 2885904..8c1a0aa 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -585,16 +585,16 @@ regcache_collect (int regnum, void *buf)
}
-/* read_pc, write_pc, read_sp, write_sp, read_fp, write_fp, etc.
- Special handling for registers PC, SP, and FP. */
+/* read_pc, write_pc, read_sp, write_sp, read_fp, etc. Special
+ handling for registers PC, SP, and FP. */
/* NOTE: cagney/2001-02-18: The functions generic_target_read_pc(),
read_pc_pid(), read_pc(), generic_target_write_pc(),
write_pc_pid(), write_pc(), generic_target_read_sp(), read_sp(),
- generic_target_write_sp(), write_sp(), generic_target_read_fp(),
- read_fp(), generic_target_write_fp(), write_fp will eventually be
- moved out of the reg-cache into either frame.[hc] or to the
- multi-arch framework. The are not part of the raw register cache. */
+ generic_target_write_sp(), write_sp(), generic_target_read_fp() and
+ read_fp(), will eventually be moved out of the reg-cache into
+ either frame.[hc] or to the multi-arch framework. The are not part
+ of the raw register cache. */
/* This routine is getting awfully cluttered with #if's. It's probably
time to turn this into READ_PC and define it in the tm.h file.
@@ -738,26 +738,6 @@ read_fp (void)
return TARGET_READ_FP ();
}
-void
-generic_target_write_fp (CORE_ADDR val)
-{
-#ifdef FP_REGNUM
- if (FP_REGNUM >= 0)
- {
- write_register (FP_REGNUM, val);
- return;
- }
-#endif
- internal_error (__FILE__, __LINE__,
- "generic_target_write_fp");
-}
-
-void
-write_fp (CORE_ADDR val)
-{
- TARGET_WRITE_FP (val);
-}
-
/* ARGSUSED */
static void
reg_flush_command (char *command, int from_tty)
@@ -802,8 +782,6 @@ build_regcache (void)
void
_initialize_regcache (void)
{
- build_regcache ();
-
register_gdbarch_swap (&registers, sizeof (registers), NULL);
register_gdbarch_swap (&register_valid, sizeof (register_valid), NULL);
register_gdbarch_swap (NULL, 0, build_regcache);
diff --git a/gdb/regformats/reg-ppc.dat b/gdb/regformats/reg-ppc.dat
index d915996..d7f9b88 100644
--- a/gdb/regformats/reg-ppc.dat
+++ b/gdb/regformats/reg-ppc.dat
@@ -73,4 +73,4 @@ expedite:r1,pc
32:lr
32:ctr
32:xer
-0:
+32:fpscr
diff --git a/gdb/regformats/reg-x86-64.dat b/gdb/regformats/reg-x86-64.dat
index a8a2e8c..59ebbf5 100644
--- a/gdb/regformats/reg-x86-64.dat
+++ b/gdb/regformats/reg-x86-64.dat
@@ -1,9 +1,9 @@
name:x86_64
expedite:rbp,rsp,rip
64:rax
-64:rdx
-64:rcx
64:rbx
+64:rcx
+64:rdx
64:rsi
64:rdi
64:rbp
@@ -18,6 +18,10 @@ expedite:rbp,rsp,rip
64:r15
64:rip
32:eflags
+32:ds
+32:es
+32:fs
+32:gs
80:st0
80:st1
80:st2
diff --git a/gdb/remote-adapt.c b/gdb/remote-adapt.c
deleted file mode 100644
index 7e87360..0000000
--- a/gdb/remote-adapt.c
+++ /dev/null
@@ -1,1524 +0,0 @@
-/* OBSOLETE /* Remote debugging interface for AMD 290*0 Adapt Monitor Version 2.1d18. */
-/* OBSOLETE Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, */
-/* OBSOLETE 2001 Free Software Foundation, Inc. */
-/* OBSOLETE Contributed by David Wood at New York University (wood@lab.ultra.nyu.edu). */
-/* OBSOLETE Adapted from work done at Cygnus Support in remote-eb.c. */
-/* 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. */ */
-/* OBSOLETE */
-/* OBSOLETE /* This is like remote.c but is for an esoteric situation-- */
-/* OBSOLETE having a 29k board attached to an Adapt inline monitor. */
-/* OBSOLETE The monitor is connected via serial line to a unix machine */
-/* OBSOLETE running gdb. */
-/* OBSOLETE */
-/* OBSOLETE 3/91 - developed on Sun3 OS 4.1, by David Wood */
-/* OBSOLETE o - I can't get binary coff to load. */
-/* OBSOLETE o - I can't get 19200 baud rate to work. */
-/* OBSOLETE 7/91 o - Freeze mode tracing can be done on a 29050. */ */
-/* OBSOLETE */
-/* OBSOLETE */
-/* OBSOLETE */
-/* OBSOLETE #include "defs.h" */
-/* OBSOLETE #include "gdb_string.h" */
-/* OBSOLETE #include "inferior.h" */
-/* OBSOLETE #include "value.h" */
-/* OBSOLETE #include <ctype.h> */
-/* OBSOLETE #include <fcntl.h> */
-/* OBSOLETE #include <signal.h> */
-/* OBSOLETE #include <errno.h> */
-/* OBSOLETE #include "terminal.h" */
-/* OBSOLETE #include "target.h" */
-/* OBSOLETE #include "gdbcore.h" */
-/* OBSOLETE #include "regcache.h" */
-/* OBSOLETE */
-/* OBSOLETE /* This processor is getting rusty but I am trying to keep it */
-/* OBSOLETE up to date at least with data structure changes. */
-/* OBSOLETE Activate this block to compile just this file. */
-/* OBSOLETE */ */
-/* OBSOLETE #define COMPILE_CHECK 0 */
-/* OBSOLETE #if COMPILE_CHECK */
-/* OBSOLETE #define Q_REGNUM 0 */
-/* OBSOLETE #define VAB_REGNUM 0 */
-/* OBSOLETE #define CPS_REGNUM 0 */
-/* OBSOLETE #define IPA_REGNUM 0 */
-/* OBSOLETE #define IPB_REGNUM 0 */
-/* OBSOLETE #define GR1_REGNUM 0 */
-/* OBSOLETE #define LR0_REGNUM 0 */
-/* OBSOLETE #define IPC_REGNUM 0 */
-/* OBSOLETE #define CR_REGNUM 0 */
-/* OBSOLETE #define BP_REGNUM 0 */
-/* OBSOLETE #define FC_REGNUM 0 */
-/* OBSOLETE #define INTE_REGNUM 0 */
-/* OBSOLETE #define EXO_REGNUM 0 */
-/* OBSOLETE #define GR96_REGNUM 0 */
-/* OBSOLETE #define NPC_REGNUM */
-/* OBSOLETE #define FPE_REGNUM 0 */
-/* OBSOLETE #define PC2_REGNUM 0 */
-/* OBSOLETE #define FPS_REGNUM 0 */
-/* OBSOLETE #define ALU_REGNUM 0 */
-/* OBSOLETE #define LRU_REGNUM 0 */
-/* OBSOLETE #define TERMINAL int */
-/* OBSOLETE #define RAW 1 */
-/* OBSOLETE #define ANYP 1 */
-/* OBSOLETE extern int a29k_freeze_mode; */
-/* OBSOLETE extern int processor_type; */
-/* OBSOLETE extern char *processor_name; */
-/* OBSOLETE #endif */
-/* OBSOLETE */
-/* OBSOLETE /* External data declarations */ */
-/* OBSOLETE extern int stop_soon_quietly; /* for wait_for_inferior */ */
-/* OBSOLETE */
-/* OBSOLETE /* Forward data declarations */ */
-/* OBSOLETE extern struct target_ops adapt_ops; /* Forward declaration */ */
-/* OBSOLETE */
-/* OBSOLETE /* Forward function declarations */ */
-/* OBSOLETE static void adapt_fetch_registers (); */
-/* OBSOLETE static void adapt_store_registers (); */
-/* OBSOLETE static void adapt_close (); */
-/* OBSOLETE static int adapt_clear_breakpoints (); */
-/* OBSOLETE */
-/* OBSOLETE #define FREEZE_MODE (read_register(CPS_REGNUM) && 0x400) */
-/* OBSOLETE #define USE_SHADOW_PC ((processor_type == a29k_freeze_mode) && FREEZE_MODE) */
-/* OBSOLETE */
-/* OBSOLETE /* Can't seem to get binary coff working */ */
-/* OBSOLETE #define ASCII_COFF /* Adapt will be downloaded with ascii coff */ */
-/* OBSOLETE */
-/* OBSOLETE /* FIXME: Replace with `set remotedebug'. */ */
-/* OBSOLETE #define LOG_FILE "adapt.log" */
-/* OBSOLETE #if defined (LOG_FILE) */
-/* OBSOLETE FILE *log_file = NULL; */
-/* OBSOLETE #endif */
-/* OBSOLETE */
-/* OBSOLETE static int timeout = 5; */
-/* OBSOLETE static char *dev_name; */
-/* OBSOLETE */
-/* OBSOLETE /* Descriptor for I/O to remote machine. Initialize it to -1 so that */
-/* OBSOLETE adapt_open knows that we don't have a file open when the program */
-/* OBSOLETE starts. */ */
-/* OBSOLETE int adapt_desc = -1; */
-/* OBSOLETE */
-/* OBSOLETE /* stream which is fdopen'd from adapt_desc. Only valid when */
-/* OBSOLETE adapt_desc != -1. */ */
-/* OBSOLETE FILE *adapt_stream; */
-/* OBSOLETE */
-/* OBSOLETE #define ON 1 */
-/* OBSOLETE #define OFF 0 */
-/* OBSOLETE static void */
-/* OBSOLETE rawmode (int desc, int turnon) */
-/* OBSOLETE { */
-/* OBSOLETE */
-/* OBSOLETE TERMINAL sg; */
-/* OBSOLETE */
-/* OBSOLETE if (desc < 0) */
-/* OBSOLETE return; */
-/* OBSOLETE */
-/* OBSOLETE ioctl (desc, TIOCGETP, &sg); */
-/* OBSOLETE */
-/* OBSOLETE if (turnon) */
-/* OBSOLETE { */
-/* OBSOLETE #ifdef HAVE_TERMIO */
-/* OBSOLETE sg.c_lflag &= ~(ICANON); */
-/* OBSOLETE #else */
-/* OBSOLETE sg.sg_flags |= RAW; */
-/* OBSOLETE #endif */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE { */
-/* OBSOLETE #ifdef HAVE_TERMIO */
-/* OBSOLETE sg.c_lflag |= ICANON; */
-/* OBSOLETE #else */
-/* OBSOLETE sg.sg_flags &= ~(RAW); */
-/* OBSOLETE #endif */
-/* OBSOLETE } */
-/* OBSOLETE ioctl (desc, TIOCSETP, &sg); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Suck up all the input from the adapt */ */
-/* OBSOLETE slurp_input (void) */
-/* OBSOLETE { */
-/* OBSOLETE char buf[8]; */
-/* OBSOLETE */
-/* OBSOLETE #ifdef HAVE_TERMIO */
-/* OBSOLETE /* termio does the timeout for us. */ */
-/* OBSOLETE while (read (adapt_desc, buf, 8) > 0); */
-/* OBSOLETE #else */
-/* OBSOLETE alarm (timeout); */
-/* OBSOLETE while (read (adapt_desc, buf, 8) > 0); */
-/* OBSOLETE alarm (0); */
-/* OBSOLETE #endif */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Read a character from the remote system, doing all the fancy */
-/* OBSOLETE timeout stuff. */ */
-/* OBSOLETE static int */
-/* OBSOLETE readchar (void) */
-/* OBSOLETE { */
-/* OBSOLETE char buf; */
-/* OBSOLETE */
-/* OBSOLETE buf = '\0'; */
-/* OBSOLETE #ifdef HAVE_TERMIO */
-/* OBSOLETE /* termio does the timeout for us. */ */
-/* OBSOLETE read (adapt_desc, &buf, 1); */
-/* OBSOLETE #else */
-/* OBSOLETE alarm (timeout); */
-/* OBSOLETE if (read (adapt_desc, &buf, 1) < 0) */
-/* OBSOLETE { */
-/* OBSOLETE if (errno == EINTR) */
-/* OBSOLETE error ("Timeout reading from remote system."); */
-/* OBSOLETE else */
-/* OBSOLETE perror_with_name ("remote"); */
-/* OBSOLETE } */
-/* OBSOLETE alarm (0); */
-/* OBSOLETE #endif */
-/* OBSOLETE */
-/* OBSOLETE if (buf == '\0') */
-/* OBSOLETE error ("Timeout reading from remote system."); */
-/* OBSOLETE #if defined (LOG_FILE) */
-/* OBSOLETE putc (buf & 0x7f, log_file); */
-/* OBSOLETE #endif */
-/* OBSOLETE return buf & 0x7f; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Keep discarding input from the remote system, until STRING is found. */
-/* OBSOLETE Let the user break out immediately. */ */
-/* OBSOLETE static void */
-/* OBSOLETE expect (char *string) */
-/* OBSOLETE { */
-/* OBSOLETE char *p = string; */
-/* OBSOLETE */
-/* OBSOLETE fflush (adapt_stream); */
-/* OBSOLETE immediate_quit++; */
-/* OBSOLETE while (1) */
-/* OBSOLETE { */
-/* OBSOLETE if (readchar () == *p) */
-/* OBSOLETE { */
-/* OBSOLETE p++; */
-/* OBSOLETE if (*p == '\0') */
-/* OBSOLETE { */
-/* OBSOLETE immediate_quit--; */
-/* OBSOLETE return; */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE p = string; */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Keep discarding input until we see the adapt prompt. */
-/* OBSOLETE */
-/* OBSOLETE The convention for dealing with the prompt is that you */
-/* OBSOLETE o give your command */
-/* OBSOLETE o *then* wait for the prompt. */
-/* OBSOLETE */
-/* OBSOLETE Thus the last thing that a procedure does with the serial line */
-/* OBSOLETE will be an expect_prompt(). Exception: adapt_resume does not */
-/* OBSOLETE wait for the prompt, because the terminal is being handed over */
-/* OBSOLETE to the inferior. However, the next thing which happens after that */
-/* OBSOLETE is a adapt_wait which does wait for the prompt. */
-/* OBSOLETE Note that this includes abnormal exit, e.g. error(). This is */
-/* OBSOLETE necessary to prevent getting into states from which we can't */
-/* OBSOLETE recover. */ */
-/* OBSOLETE static void */
-/* OBSOLETE expect_prompt (void) */
-/* OBSOLETE { */
-/* OBSOLETE #if defined (LOG_FILE) */
-/* OBSOLETE /* This is a convenient place to do this. The idea is to do it often */
-/* OBSOLETE enough that we never lose much data if we terminate abnormally. */ */
-/* OBSOLETE fflush (log_file); */
-/* OBSOLETE #endif */
-/* OBSOLETE fflush (adapt_stream); */
-/* OBSOLETE expect ("\n# "); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Get a hex digit from the remote system & return its value. */
-/* OBSOLETE If ignore_space is nonzero, ignore spaces (not newline, tab, etc). */ */
-/* OBSOLETE static int */
-/* OBSOLETE get_hex_digit (int ignore_space) */
-/* OBSOLETE { */
-/* OBSOLETE int ch; */
-/* OBSOLETE while (1) */
-/* OBSOLETE { */
-/* OBSOLETE ch = readchar (); */
-/* OBSOLETE if (ch >= '0' && ch <= '9') */
-/* OBSOLETE return ch - '0'; */
-/* OBSOLETE else if (ch >= 'A' && ch <= 'F') */
-/* OBSOLETE return ch - 'A' + 10; */
-/* OBSOLETE else if (ch >= 'a' && ch <= 'f') */
-/* OBSOLETE return ch - 'a' + 10; */
-/* OBSOLETE else if (ch == ' ' && ignore_space) */
-/* OBSOLETE ; */
-/* OBSOLETE else */
-/* OBSOLETE { */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE error ("Invalid hex digit from remote system."); */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Get a byte from adapt_desc and put it in *BYT. Accept any number */
-/* OBSOLETE leading spaces. */ */
-/* OBSOLETE static void */
-/* OBSOLETE get_hex_byte (char *byt) */
-/* OBSOLETE { */
-/* OBSOLETE int val; */
-/* OBSOLETE */
-/* OBSOLETE val = get_hex_digit (1) << 4; */
-/* OBSOLETE val |= get_hex_digit (0); */
-/* OBSOLETE *byt = val; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Read a 32-bit hex word from the adapt, preceded by a space */ */
-/* OBSOLETE static long */
-/* OBSOLETE get_hex_word (void) */
-/* OBSOLETE { */
-/* OBSOLETE long val; */
-/* OBSOLETE int j; */
-/* OBSOLETE */
-/* OBSOLETE val = 0; */
-/* OBSOLETE for (j = 0; j < 8; j++) */
-/* OBSOLETE val = (val << 4) + get_hex_digit (j == 0); */
-/* OBSOLETE return val; */
-/* OBSOLETE } */
-/* OBSOLETE /* Get N 32-bit hex words from remote, each preceded by a space */
-/* OBSOLETE and put them in registers starting at REGNO. */ */
-/* OBSOLETE static void */
-/* OBSOLETE get_hex_regs (int n, int regno) */
-/* OBSOLETE { */
-/* OBSOLETE long val; */
-/* OBSOLETE while (n--) */
-/* OBSOLETE { */
-/* OBSOLETE val = get_hex_word (); */
-/* OBSOLETE supply_register (regno++, (char *) &val); */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE /* Called when SIGALRM signal sent due to alarm() timeout. */ */
-/* OBSOLETE #ifndef HAVE_TERMIO */
-/* OBSOLETE */
-/* OBSOLETE volatile int n_alarms; */
-/* OBSOLETE */
-/* OBSOLETE void */
-/* OBSOLETE adapt_timer (void) */
-/* OBSOLETE { */
-/* OBSOLETE #if 0 */
-/* OBSOLETE if (kiodebug) */
-/* OBSOLETE printf ("adapt_timer called\n"); */
-/* OBSOLETE #endif */
-/* OBSOLETE n_alarms++; */
-/* OBSOLETE } */
-/* OBSOLETE #endif */
-/* OBSOLETE */
-/* OBSOLETE /* malloc'd name of the program on the remote system. */ */
-/* OBSOLETE static char *prog_name = NULL; */
-/* OBSOLETE */
-/* OBSOLETE /* Number of SIGTRAPs we need to simulate. That is, the next */
-/* OBSOLETE NEED_ARTIFICIAL_TRAP calls to adapt_wait should just return */
-/* OBSOLETE SIGTRAP without actually waiting for anything. */ */
-/* OBSOLETE */
-/* OBSOLETE static int need_artificial_trap = 0; */
-/* OBSOLETE */
-/* OBSOLETE void */
-/* OBSOLETE adapt_kill (char *arg, int from_tty) */
-/* OBSOLETE { */
-/* OBSOLETE fprintf (adapt_stream, "K"); */
-/* OBSOLETE fprintf (adapt_stream, "\r"); */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE } */
-/* OBSOLETE /* */
-/* OBSOLETE * Download a file specified in 'args', to the adapt. */
-/* OBSOLETE * FIXME: Assumes the file to download is a binary coff file. */
-/* OBSOLETE */ */
-/* OBSOLETE static void */
-/* OBSOLETE adapt_load (char *args, int fromtty) */
-/* OBSOLETE { */
-/* OBSOLETE FILE *fp; */
-/* OBSOLETE int n; */
-/* OBSOLETE char buffer[1024]; */
-/* OBSOLETE */
-/* OBSOLETE if (!adapt_stream) */
-/* OBSOLETE { */
-/* OBSOLETE printf_filtered ("Adapt not open. Use 'target' command to open adapt\n"); */
-/* OBSOLETE return; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* OK, now read in the file. Y=read, C=COFF, T=dTe port */
-/* OBSOLETE 0=start address. */ */
-/* OBSOLETE */
-/* OBSOLETE #ifdef ASCII_COFF /* Ascii coff */ */
-/* OBSOLETE fprintf (adapt_stream, "YA T,0\r"); */
-/* OBSOLETE fflush (adapt_stream); /* Just in case */ */
-/* OBSOLETE /* FIXME: should check args for only 1 argument */ */
-/* OBSOLETE sprintf (buffer, "cat %s | btoa > /tmp/#adapt-btoa", args); */
-/* OBSOLETE system (buffer); */
-/* OBSOLETE fp = fopen ("/tmp/#adapt-btoa", "r"); */
-/* OBSOLETE rawmode (adapt_desc, OFF); */
-/* OBSOLETE while (n = fread (buffer, 1, 1024, fp)) */
-/* OBSOLETE { */
-/* OBSOLETE do */
-/* OBSOLETE { */
-/* OBSOLETE n -= write (adapt_desc, buffer, n); */
-/* OBSOLETE } */
-/* OBSOLETE while (n > 0); */
-/* OBSOLETE if (n < 0) */
-/* OBSOLETE { */
-/* OBSOLETE perror ("writing ascii coff"); */
-/* OBSOLETE break; */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE fclose (fp); */
-/* OBSOLETE rawmode (adapt_desc, ON); */
-/* OBSOLETE system ("rm /tmp/#adapt-btoa"); */
-/* OBSOLETE #else /* Binary coff - can't get it to work . */ */
-/* OBSOLETE fprintf (adapt_stream, "YC T,0\r"); */
-/* OBSOLETE fflush (adapt_stream); /* Just in case */ */
-/* OBSOLETE if (!(fp = fopen (args, "r"))) */
-/* OBSOLETE { */
-/* OBSOLETE printf_filtered ("Can't open %s\n", args); */
-/* OBSOLETE return; */
-/* OBSOLETE } */
-/* OBSOLETE while (n = fread (buffer, 1, 512, fp)) */
-/* OBSOLETE { */
-/* OBSOLETE do */
-/* OBSOLETE { */
-/* OBSOLETE n -= write (adapt_desc, buffer, n); */
-/* OBSOLETE } */
-/* OBSOLETE while (n > 0); */
-/* OBSOLETE if (n < 0) */
-/* OBSOLETE { */
-/* OBSOLETE perror ("writing ascii coff"); */
-/* OBSOLETE break; */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE fclose (fp); */
-/* OBSOLETE #endif */
-/* OBSOLETE expect_prompt (); /* Skip garbage that comes out */ */
-/* OBSOLETE fprintf (adapt_stream, "\r"); */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* This is called not only when we first attach, but also when the */
-/* OBSOLETE user types "run" after having attached. */ */
-/* OBSOLETE void */
-/* OBSOLETE adapt_create_inferior (char *execfile, char *args, char **env) */
-/* OBSOLETE { */
-/* OBSOLETE int entry_pt; */
-/* OBSOLETE */
-/* OBSOLETE if (args && *args) */
-/* OBSOLETE error ("Can't pass arguments to remote adapt process."); */
-/* OBSOLETE */
-/* OBSOLETE if (execfile == 0 || exec_bfd == 0) */
-/* OBSOLETE error ("No executable file specified"); */
-/* OBSOLETE */
-/* OBSOLETE entry_pt = (int) bfd_get_start_address (exec_bfd); */
-/* OBSOLETE */
-/* OBSOLETE if (adapt_stream) */
-/* OBSOLETE { */
-/* OBSOLETE adapt_kill (NULL, NULL); */
-/* OBSOLETE adapt_clear_breakpoints (); */
-/* OBSOLETE init_wait_for_inferior (); */
-/* OBSOLETE /* Clear the input because what the adapt sends back is different */
-/* OBSOLETE * depending on whether it was running or not. */
-/* OBSOLETE */ */
-/* OBSOLETE slurp_input (); /* After this there should be a prompt */ */
-/* OBSOLETE fprintf (adapt_stream, "\r"); */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE printf_filtered ("Do you want to download '%s' (y/n)? [y] : ", prog_name); */
-/* OBSOLETE { */
-/* OBSOLETE char buffer[10]; */
-/* OBSOLETE gets (buffer); */
-/* OBSOLETE if (*buffer != 'n') */
-/* OBSOLETE { */
-/* OBSOLETE adapt_load (prog_name, 0); */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE #ifdef NOTDEF */
-/* OBSOLETE /* Set the PC and wait for a go/cont */ */
-/* OBSOLETE fprintf (adapt_stream, "G %x,N\r", entry_pt); */
-/* OBSOLETE printf_filtered ("Now use the 'continue' command to start.\n"); */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE #else */
-/* OBSOLETE insert_breakpoints (); /* Needed to get correct instruction in cache */ */
-/* OBSOLETE proceed (entry_pt, TARGET_SIGNAL_DEFAULT, 0); */
-/* OBSOLETE #endif */
-/* OBSOLETE */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE { */
-/* OBSOLETE printf_filtered ("Adapt not open yet.\n"); */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Translate baud rates from integers to damn B_codes. Unix should */
-/* OBSOLETE have outgrown this crap years ago, but even POSIX wouldn't buck it. */ */
-/* OBSOLETE */
-/* OBSOLETE #ifndef B19200 */
-/* OBSOLETE #define B19200 EXTA */
-/* OBSOLETE #endif */
-/* OBSOLETE #ifndef B38400 */
-/* OBSOLETE #define B38400 EXTB */
-/* OBSOLETE #endif */
-/* OBSOLETE */
-/* OBSOLETE static struct */
-/* OBSOLETE { */
-/* OBSOLETE int rate, damn_b; */
-/* OBSOLETE } */
-/* OBSOLETE baudtab[] = */
-/* OBSOLETE { */
-/* OBSOLETE { */
-/* OBSOLETE 0, B0 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE 50, B50 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE 75, B75 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE 110, B110 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE 134, B134 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE 150, B150 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE 200, B200 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE 300, B300 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE 600, B600 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE 1200, B1200 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE 1800, B1800 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE 2400, B2400 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE 4800, B4800 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE 9600, B9600 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE 19200, B19200 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE 38400, B38400 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE -1, -1 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE }; */
-/* OBSOLETE */
-/* OBSOLETE static int */
-/* OBSOLETE damn_b (int rate) */
-/* OBSOLETE { */
-/* OBSOLETE int i; */
-/* OBSOLETE */
-/* OBSOLETE for (i = 0; baudtab[i].rate != -1; i++) */
-/* OBSOLETE if (rate == baudtab[i].rate) */
-/* OBSOLETE return baudtab[i].damn_b; */
-/* OBSOLETE return B38400; /* Random */ */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE */
-/* OBSOLETE /* Open a connection to a remote debugger. */
-/* OBSOLETE NAME is the filename used for communication, then a space, */
-/* OBSOLETE then the baud rate. */
-/* OBSOLETE */ */
-/* OBSOLETE */
-/* OBSOLETE static int baudrate = 9600; */
-/* OBSOLETE static void */
-/* OBSOLETE adapt_open (char *name, int from_tty) */
-/* OBSOLETE { */
-/* OBSOLETE TERMINAL sg; */
-/* OBSOLETE unsigned int prl; */
-/* OBSOLETE char *p; */
-/* OBSOLETE */
-/* OBSOLETE /* Find the first whitespace character, it separates dev_name from */
-/* OBSOLETE prog_name. */ */
-/* OBSOLETE if (name == 0) */
-/* OBSOLETE goto erroid; */
-/* OBSOLETE */
-/* OBSOLETE for (p = name; */
-/* OBSOLETE *p != '\0' && !isspace (*p); p++) */
-/* OBSOLETE ; */
-/* OBSOLETE if (*p == '\0') */
-/* OBSOLETE erroid: */
-/* OBSOLETE error ("\ */
-/* OBSOLETE Please include the name of the device for the serial port,\n\ */
-/* OBSOLETE the baud rate, and the name of the program to run on the remote system."); */
-/* OBSOLETE dev_name = (char *) xmalloc (p - name + 1); */
-/* OBSOLETE strncpy (dev_name, name, p - name); */
-/* OBSOLETE dev_name[p - name] = '\0'; */
-/* OBSOLETE */
-/* OBSOLETE /* Skip over the whitespace after dev_name */ */
-/* OBSOLETE for (; isspace (*p); p++) */
-/* OBSOLETE /*EMPTY */ ; */
-/* OBSOLETE */
-/* OBSOLETE if (1 != sscanf (p, "%d ", &baudrate)) */
-/* OBSOLETE goto erroid; */
-/* OBSOLETE */
-/* OBSOLETE /* Skip the number and then the spaces */ */
-/* OBSOLETE for (; isdigit (*p); p++) */
-/* OBSOLETE /*EMPTY */ ; */
-/* OBSOLETE for (; isspace (*p); p++) */
-/* OBSOLETE /*EMPTY */ ; */
-/* OBSOLETE */
-/* OBSOLETE if (prog_name != NULL) */
-/* OBSOLETE xfree (prog_name); */
-/* OBSOLETE prog_name = savestring (p, strlen (p)); */
-/* OBSOLETE */
-/* OBSOLETE adapt_close (0); */
-/* OBSOLETE */
-/* OBSOLETE adapt_desc = open (dev_name, O_RDWR); */
-/* OBSOLETE if (adapt_desc < 0) */
-/* OBSOLETE perror_with_name (dev_name); */
-/* OBSOLETE ioctl (adapt_desc, TIOCGETP, &sg); */
-/* OBSOLETE #if ! defined(COMPILE_CHECK) */
-/* OBSOLETE #ifdef HAVE_TERMIO */
-/* OBSOLETE sg.c_cc[VMIN] = 0; /* read with timeout. */ */
-/* OBSOLETE sg.c_cc[VTIME] = timeout * 10; */
-/* OBSOLETE sg.c_lflag &= ~(ICANON | ECHO); */
-/* OBSOLETE sg.c_cflag = (sg.c_cflag & ~CBAUD) | damn_b (baudrate); */
-/* OBSOLETE #else */
-/* OBSOLETE sg.sg_ispeed = damn_b (baudrate); */
-/* OBSOLETE sg.sg_ospeed = damn_b (baudrate); */
-/* OBSOLETE sg.sg_flags |= RAW | ANYP; */
-/* OBSOLETE sg.sg_flags &= ~ECHO; */
-/* OBSOLETE #endif */
-/* OBSOLETE */
-/* OBSOLETE ioctl (adapt_desc, TIOCSETP, &sg); */
-/* OBSOLETE adapt_stream = fdopen (adapt_desc, "r+"); */
-/* OBSOLETE #endif /* compile_check */ */
-/* OBSOLETE push_target (&adapt_ops); */
-/* OBSOLETE */
-/* OBSOLETE #ifndef HAVE_TERMIO */
-/* OBSOLETE #ifndef NO_SIGINTERRUPT */
-/* OBSOLETE /* Cause SIGALRM's to make reads fail with EINTR instead of resuming */
-/* OBSOLETE the read. */ */
-/* OBSOLETE if (siginterrupt (SIGALRM, 1) != 0) */
-/* OBSOLETE perror ("adapt_open: error in siginterrupt"); */
-/* OBSOLETE #endif */
-/* OBSOLETE */
-/* OBSOLETE /* Set up read timeout timer. */ */
-/* OBSOLETE if ((void (*)) signal (SIGALRM, adapt_timer) == (void (*)) -1) */
-/* OBSOLETE perror ("adapt_open: error in signal"); */
-/* OBSOLETE #endif */
-/* OBSOLETE */
-/* OBSOLETE #if defined (LOG_FILE) */
-/* OBSOLETE log_file = fopen (LOG_FILE, "w"); */
-/* OBSOLETE if (log_file == NULL) */
-/* OBSOLETE perror_with_name (LOG_FILE); */
-/* OBSOLETE #endif */
-/* OBSOLETE */
-/* OBSOLETE /* Put this port into NORMAL mode, send the 'normal' character */ */
-/* OBSOLETE write (adapt_desc, "", 1); /* Control A */ */
-/* OBSOLETE write (adapt_desc, "\r", 1); */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE */
-/* OBSOLETE /* Hello? Are you there? */ */
-/* OBSOLETE write (adapt_desc, "\r", 1); */
-/* OBSOLETE */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE */
-/* OBSOLETE /* Clear any break points */ */
-/* OBSOLETE adapt_clear_breakpoints (); */
-/* OBSOLETE */
-/* OBSOLETE /* Print out some stuff, letting the user now what's going on */ */
-/* OBSOLETE printf_filtered ("Connected to an Adapt via %s.\n", dev_name); */
-/* OBSOLETE /* FIXME: can this restriction be removed? */ */
-/* OBSOLETE printf_filtered ("Remote debugging using virtual addresses works only\n"); */
-/* OBSOLETE printf_filtered ("\twhen virtual addresses map 1:1 to physical addresses.\n"); */
-/* OBSOLETE if (processor_type != a29k_freeze_mode) */
-/* OBSOLETE { */
-/* OBSOLETE fprintf_filtered (gdb_stderr, */
-/* OBSOLETE "Freeze-mode debugging not available, and can only be done on an A29050.\n"); */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Close out all files and local state before this target loses control. */ */
-/* OBSOLETE */
-/* OBSOLETE static void */
-/* OBSOLETE adapt_close (int quitting) */
-/* OBSOLETE { */
-/* OBSOLETE */
-/* OBSOLETE /* Clear any break points */ */
-/* OBSOLETE adapt_clear_breakpoints (); */
-/* OBSOLETE */
-/* OBSOLETE /* Put this port back into REMOTE mode */ */
-/* OBSOLETE if (adapt_stream) */
-/* OBSOLETE { */
-/* OBSOLETE fflush (adapt_stream); */
-/* OBSOLETE sleep (1); /* Let any output make it all the way back */ */
-/* OBSOLETE write (adapt_desc, "R\r", 2); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Due to a bug in Unix, fclose closes not only the stdio stream, */
-/* OBSOLETE but also the file descriptor. So we don't actually close */
-/* OBSOLETE adapt_desc. */ */
-/* OBSOLETE if (adapt_stream) */
-/* OBSOLETE fclose (adapt_stream); /* This also closes adapt_desc */ */
-/* OBSOLETE if (adapt_desc >= 0) */
-/* OBSOLETE /* close (adapt_desc); */ */
-/* OBSOLETE */
-/* OBSOLETE /* Do not try to close adapt_desc again, later in the program. */ */
-/* OBSOLETE adapt_stream = NULL; */
-/* OBSOLETE adapt_desc = -1; */
-/* OBSOLETE */
-/* OBSOLETE #if defined (LOG_FILE) */
-/* OBSOLETE if (log_file) */
-/* OBSOLETE { */
-/* OBSOLETE if (ferror (log_file)) */
-/* OBSOLETE printf_filtered ("Error writing log file.\n"); */
-/* OBSOLETE if (fclose (log_file) != 0) */
-/* OBSOLETE printf_filtered ("Error closing log file.\n"); */
-/* OBSOLETE log_file = NULL; */
-/* OBSOLETE } */
-/* OBSOLETE #endif */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Attach to the target that is already loaded and possibly running */ */
-/* OBSOLETE static void */
-/* OBSOLETE adapt_attach (char *args, int from_tty) */
-/* OBSOLETE { */
-/* OBSOLETE */
-/* OBSOLETE if (from_tty) */
-/* OBSOLETE printf_filtered ("Attaching to remote program %s.\n", prog_name); */
-/* OBSOLETE */
-/* OBSOLETE /* Send the adapt a kill. It is ok if it is not already running */ */
-/* OBSOLETE fprintf (adapt_stream, "K\r"); */
-/* OBSOLETE fflush (adapt_stream); */
-/* OBSOLETE expect_prompt (); /* Slurp the echo */ */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE */
-/* OBSOLETE /* Terminate the open connection to the remote debugger. */
-/* OBSOLETE Use this when you want to detach and do something else */
-/* OBSOLETE with your gdb. */ */
-/* OBSOLETE void */
-/* OBSOLETE adapt_detach (char *args, int from_tty) */
-/* OBSOLETE { */
-/* OBSOLETE */
-/* OBSOLETE if (adapt_stream) */
-/* OBSOLETE { /* Send it on its way (tell it to continue) */ */
-/* OBSOLETE adapt_clear_breakpoints (); */
-/* OBSOLETE fprintf (adapt_stream, "G\r"); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE pop_target (); /* calls adapt_close to do the real work */ */
-/* OBSOLETE if (from_tty) */
-/* OBSOLETE printf_filtered ("Ending remote %s debugging\n", target_shortname); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Tell the remote machine to resume. */ */
-/* OBSOLETE */
-/* OBSOLETE void */
-/* OBSOLETE adapt_resume (ptid_t ptid, int step, enum target_signal sig) */
-/* OBSOLETE { */
-/* OBSOLETE if (step) */
-/* OBSOLETE { */
-/* OBSOLETE write (adapt_desc, "t 1,s\r", 6); */
-/* OBSOLETE /* Wait for the echo. */ */
-/* OBSOLETE expect ("t 1,s\r\n"); */
-/* OBSOLETE /* Then comes a line containing the instruction we stepped to. */ */
-/* OBSOLETE expect ("@"); */
-/* OBSOLETE /* Then we get the prompt. */ */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE */
-/* OBSOLETE /* Force the next adapt_wait to return a trap. Not doing anything */
-/* OBSOLETE about I/O from the target means that the user has to type */
-/* OBSOLETE "continue" to see any. FIXME, this should be fixed. */ */
-/* OBSOLETE need_artificial_trap = 1; */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE { */
-/* OBSOLETE write (adapt_desc, "G\r", 2); */
-/* OBSOLETE /* Swallow the echo. */ */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Wait until the remote machine stops, then return, */
-/* OBSOLETE storing status in STATUS just as `wait' would. */ */
-/* OBSOLETE */
-/* OBSOLETE ptid_t */
-/* OBSOLETE adapt_wait (ptid_t ptid, struct target_waitstatus *status) */
-/* OBSOLETE { */
-/* OBSOLETE /* Strings to look for. '?' means match any single character. */
-/* OBSOLETE Note that with the algorithm we use, the initial character */
-/* OBSOLETE of the string cannot recur in the string, or we will not */
-/* OBSOLETE find some cases of the string in the input. */ */
-/* OBSOLETE */
-/* OBSOLETE static char bpt[] = "@"; */
-/* OBSOLETE /* It would be tempting to look for "\n[__exit + 0x8]\n" */
-/* OBSOLETE but that requires loading symbols with "yc i" and even if */
-/* OBSOLETE we did do that we don't know that the file has symbols. */ */
-/* OBSOLETE static char exitmsg[] = "@????????I JMPTI GR121,LR0"; */
-/* OBSOLETE char *bp = bpt; */
-/* OBSOLETE char *ep = exitmsg; */
-/* OBSOLETE */
-/* OBSOLETE /* Large enough for either sizeof (bpt) or sizeof (exitmsg) chars. */ */
-/* OBSOLETE char swallowed[50]; */
-/* OBSOLETE /* Current position in swallowed. */ */
-/* OBSOLETE char *swallowed_p = swallowed; */
-/* OBSOLETE */
-/* OBSOLETE int ch; */
-/* OBSOLETE int ch_handled; */
-/* OBSOLETE int old_timeout = timeout; */
-/* OBSOLETE int old_immediate_quit = immediate_quit; */
-/* OBSOLETE */
-/* OBSOLETE status->kind = TARGET_WAITKIND_EXITED; */
-/* OBSOLETE status->value.integer = 0; */
-/* OBSOLETE */
-/* OBSOLETE if (need_artificial_trap != 0) */
-/* OBSOLETE { */
-/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */
-/* OBSOLETE status->value.sig = TARGET_SIGNAL_TRAP; */
-/* OBSOLETE need_artificial_trap--; */
-/* OBSOLETE return inferior_ptid; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE timeout = 0; /* Don't time out -- user program is running. */ */
-/* OBSOLETE immediate_quit = 1; /* Helps ability to QUIT */ */
-/* OBSOLETE while (1) */
-/* OBSOLETE { */
-/* OBSOLETE QUIT; /* Let user quit and leave process running */ */
-/* OBSOLETE ch_handled = 0; */
-/* OBSOLETE ch = readchar (); */
-/* OBSOLETE if (ch == *bp) */
-/* OBSOLETE { */
-/* OBSOLETE bp++; */
-/* OBSOLETE if (*bp == '\0') */
-/* OBSOLETE break; */
-/* OBSOLETE ch_handled = 1; */
-/* OBSOLETE */
-/* OBSOLETE *swallowed_p++ = ch; */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE bp = bpt; */
-/* OBSOLETE if (ch == *ep || *ep == '?') */
-/* OBSOLETE { */
-/* OBSOLETE ep++; */
-/* OBSOLETE if (*ep == '\0') */
-/* OBSOLETE break; */
-/* OBSOLETE */
-/* OBSOLETE if (!ch_handled) */
-/* OBSOLETE *swallowed_p++ = ch; */
-/* OBSOLETE ch_handled = 1; */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE ep = exitmsg; */
-/* OBSOLETE if (!ch_handled) */
-/* OBSOLETE { */
-/* OBSOLETE char *p; */
-/* OBSOLETE /* Print out any characters which have been swallowed. */ */
-/* OBSOLETE for (p = swallowed; p < swallowed_p; ++p) */
-/* OBSOLETE putc (*p, stdout); */
-/* OBSOLETE swallowed_p = swallowed; */
-/* OBSOLETE putc (ch, stdout); */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE if (*bp == '\0') */
-/* OBSOLETE { */
-/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */
-/* OBSOLETE status->value.sig = TARGET_SIGNAL_TRAP; */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE { */
-/* OBSOLETE status->kind = TARGET_WAITKIND_EXITED; */
-/* OBSOLETE status->value.integer = 0; */
-/* OBSOLETE } */
-/* OBSOLETE timeout = old_timeout; */
-/* OBSOLETE immediate_quit = old_immediate_quit; */
-/* OBSOLETE return inferior_ptid; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Return the name of register number REGNO */
-/* OBSOLETE in the form input and output by adapt. */
-/* OBSOLETE */
-/* OBSOLETE Returns a pointer to a static buffer containing the answer. */ */
-/* OBSOLETE static char * */
-/* OBSOLETE get_reg_name (int regno) */
-/* OBSOLETE { */
-/* OBSOLETE static char buf[80]; */
-/* OBSOLETE if (regno >= GR96_REGNUM && regno < GR96_REGNUM + 32) */
-/* OBSOLETE sprintf (buf, "GR%03d", regno - GR96_REGNUM + 96); */
-/* OBSOLETE #if defined(GR64_REGNUM) */
-/* OBSOLETE else if (regno >= GR64_REGNUM && regno < GR64_REGNUM + 32) */
-/* OBSOLETE sprintf (buf, "GR%03d", regno - GR64_REGNUM + 64); */
-/* OBSOLETE #endif */
-/* OBSOLETE else if (regno >= LR0_REGNUM && regno < LR0_REGNUM + 128) */
-/* OBSOLETE sprintf (buf, "LR%03d", regno - LR0_REGNUM); */
-/* OBSOLETE else if (regno == Q_REGNUM) */
-/* OBSOLETE strcpy (buf, "SR131"); */
-/* OBSOLETE else if (regno >= BP_REGNUM && regno <= CR_REGNUM) */
-/* OBSOLETE sprintf (buf, "SR%03d", regno - BP_REGNUM + 133); */
-/* OBSOLETE else if (regno == ALU_REGNUM) */
-/* OBSOLETE strcpy (buf, "SR132"); */
-/* OBSOLETE else if (regno >= IPC_REGNUM && regno <= IPB_REGNUM) */
-/* OBSOLETE sprintf (buf, "SR%03d", regno - IPC_REGNUM + 128); */
-/* OBSOLETE else if (regno >= VAB_REGNUM && regno <= LRU_REGNUM) */
-/* OBSOLETE { */
-/* OBSOLETE /* When a 29050 is in freeze-mode, read shadow pcs instead */ */
-/* OBSOLETE if ((regno >= NPC_REGNUM && regno <= PC2_REGNUM) && USE_SHADOW_PC) */
-/* OBSOLETE sprintf (buf, "SR%03d", regno - NPC_REGNUM + 20); */
-/* OBSOLETE else */
-/* OBSOLETE sprintf (buf, "SR%03d", regno - VAB_REGNUM); */
-/* OBSOLETE } */
-/* OBSOLETE else if (regno == GR1_REGNUM) */
-/* OBSOLETE strcpy (buf, "GR001"); */
-/* OBSOLETE return buf; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Read the remote registers. */ */
-/* OBSOLETE */
-/* OBSOLETE static void */
-/* OBSOLETE adapt_fetch_registers (void) */
-/* OBSOLETE { */
-/* OBSOLETE int reg_index; */
-/* OBSOLETE int regnum_index; */
-/* OBSOLETE char tempbuf[10]; */
-/* OBSOLETE int sreg_buf[16]; */
-/* OBSOLETE int i, j; */
-/* OBSOLETE */
-/* OBSOLETE /* */
-/* OBSOLETE * Global registers */
-/* OBSOLETE */ */
-/* OBSOLETE #if defined(GR64_REGNUM) */
-/* OBSOLETE write (adapt_desc, "dw gr64,gr95\r", 13); */
-/* OBSOLETE for (reg_index = 64, regnum_index = GR64_REGNUM; */
-/* OBSOLETE reg_index < 96; */
-/* OBSOLETE reg_index += 4, regnum_index += 4) */
-/* OBSOLETE { */
-/* OBSOLETE sprintf (tempbuf, "GR%03d ", reg_index); */
-/* OBSOLETE expect (tempbuf); */
-/* OBSOLETE get_hex_regs (4, regnum_index); */
-/* OBSOLETE expect ("\n"); */
-/* OBSOLETE } */
-/* OBSOLETE #endif */
-/* OBSOLETE write (adapt_desc, "dw gr96,gr127\r", 14); */
-/* OBSOLETE for (reg_index = 96, regnum_index = GR96_REGNUM; */
-/* OBSOLETE reg_index < 128; */
-/* OBSOLETE reg_index += 4, regnum_index += 4) */
-/* OBSOLETE { */
-/* OBSOLETE sprintf (tempbuf, "GR%03d ", reg_index); */
-/* OBSOLETE expect (tempbuf); */
-/* OBSOLETE get_hex_regs (4, regnum_index); */
-/* OBSOLETE expect ("\n"); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* */
-/* OBSOLETE * Local registers */
-/* OBSOLETE */ */
-/* OBSOLETE for (i = 0; i < 128; i += 32) */
-/* OBSOLETE { */
-/* OBSOLETE /* The PC has a tendency to hang if we get these */
-/* OBSOLETE all in one fell swoop ("dw lr0,lr127"). */ */
-/* OBSOLETE sprintf (tempbuf, "dw lr%d\r", i); */
-/* OBSOLETE write (adapt_desc, tempbuf, strlen (tempbuf)); */
-/* OBSOLETE for (reg_index = i, regnum_index = LR0_REGNUM + i; */
-/* OBSOLETE reg_index < i + 32; */
-/* OBSOLETE reg_index += 4, regnum_index += 4) */
-/* OBSOLETE { */
-/* OBSOLETE sprintf (tempbuf, "LR%03d ", reg_index); */
-/* OBSOLETE expect (tempbuf); */
-/* OBSOLETE get_hex_regs (4, regnum_index); */
-/* OBSOLETE expect ("\n"); */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* */
-/* OBSOLETE * Special registers */
-/* OBSOLETE */ */
-/* OBSOLETE sprintf (tempbuf, "dw sr0\r"); */
-/* OBSOLETE write (adapt_desc, tempbuf, strlen (tempbuf)); */
-/* OBSOLETE for (i = 0; i < 4; i++) */
-/* OBSOLETE { /* SR0 - SR14 */ */
-/* OBSOLETE sprintf (tempbuf, "SR%3d", i * 4); */
-/* OBSOLETE expect (tempbuf); */
-/* OBSOLETE for (j = 0; j < (i == 3 ? 3 : 4); j++) */
-/* OBSOLETE sreg_buf[i * 4 + j] = get_hex_word (); */
-/* OBSOLETE } */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE /* */
-/* OBSOLETE * Read the pcs individually if we are in freeze mode. */
-/* OBSOLETE * See get_reg_name(), it translates the register names for the pcs to */
-/* OBSOLETE * the names of the shadow pcs. */
-/* OBSOLETE */ */
-/* OBSOLETE if (USE_SHADOW_PC) */
-/* OBSOLETE { */
-/* OBSOLETE sreg_buf[10] = read_register (NPC_REGNUM); /* pc0 */ */
-/* OBSOLETE sreg_buf[11] = read_register (PC_REGNUM); /* pc1 */ */
-/* OBSOLETE sreg_buf[12] = read_register (PC2_REGNUM); /* pc2 */ */
-/* OBSOLETE } */
-/* OBSOLETE for (i = 0; i < 14; i++) /* Supply vab -> lru */ */
-/* OBSOLETE supply_register (VAB_REGNUM + i, (char *) &sreg_buf[i]); */
-/* OBSOLETE sprintf (tempbuf, "dw sr128\r"); */
-/* OBSOLETE write (adapt_desc, tempbuf, strlen (tempbuf)); */
-/* OBSOLETE for (i = 0; i < 2; i++) */
-/* OBSOLETE { /* SR128 - SR135 */ */
-/* OBSOLETE sprintf (tempbuf, "SR%3d", 128 + i * 4); */
-/* OBSOLETE expect (tempbuf); */
-/* OBSOLETE for (j = 0; j < 4; j++) */
-/* OBSOLETE sreg_buf[i * 4 + j] = get_hex_word (); */
-/* OBSOLETE } */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE supply_register (IPC_REGNUM, (char *) &sreg_buf[0]); */
-/* OBSOLETE supply_register (IPA_REGNUM, (char *) &sreg_buf[1]); */
-/* OBSOLETE supply_register (IPB_REGNUM, (char *) &sreg_buf[2]); */
-/* OBSOLETE supply_register (Q_REGNUM, (char *) &sreg_buf[3]); */
-/* OBSOLETE /* Skip ALU */ */
-/* OBSOLETE supply_register (BP_REGNUM, (char *) &sreg_buf[5]); */
-/* OBSOLETE supply_register (FC_REGNUM, (char *) &sreg_buf[6]); */
-/* OBSOLETE supply_register (CR_REGNUM, (char *) &sreg_buf[7]); */
-/* OBSOLETE */
-/* OBSOLETE /* There doesn't seem to be any way to get these. */ */
-/* OBSOLETE { */
-/* OBSOLETE int val = -1; */
-/* OBSOLETE supply_register (FPE_REGNUM, (char *) &val); */
-/* OBSOLETE supply_register (INTE_REGNUM, (char *) &val); */
-/* OBSOLETE supply_register (FPS_REGNUM, (char *) &val); */
-/* OBSOLETE supply_register (EXO_REGNUM, (char *) &val); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE write (adapt_desc, "dw gr1,gr1\r", 11); */
-/* OBSOLETE expect ("GR001 "); */
-/* OBSOLETE get_hex_regs (1, GR1_REGNUM); */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Fetch register REGNO, or all registers if REGNO is -1. */
-/* OBSOLETE */ */
-/* OBSOLETE static void */
-/* OBSOLETE adapt_fetch_register (int regno) */
-/* OBSOLETE { */
-/* OBSOLETE if (regno == -1) */
-/* OBSOLETE adapt_fetch_registers (); */
-/* OBSOLETE else */
-/* OBSOLETE { */
-/* OBSOLETE char *name = get_reg_name (regno); */
-/* OBSOLETE fprintf (adapt_stream, "dw %s,%s\r", name, name); */
-/* OBSOLETE expect (name); */
-/* OBSOLETE expect (" "); */
-/* OBSOLETE get_hex_regs (1, regno); */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Store the remote registers from the contents of the block REGS. */ */
-/* OBSOLETE */
-/* OBSOLETE static void */
-/* OBSOLETE adapt_store_registers (void) */
-/* OBSOLETE { */
-/* OBSOLETE int i, j; */
-/* OBSOLETE */
-/* OBSOLETE fprintf (adapt_stream, "s gr1,%x\r", read_register (GR1_REGNUM)); */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE */
-/* OBSOLETE #if defined(GR64_REGNUM) */
-/* OBSOLETE for (j = 0; j < 32; j += 16) */
-/* OBSOLETE { */
-/* OBSOLETE fprintf (adapt_stream, "s gr%d,", j + 64); */
-/* OBSOLETE for (i = 0; i < 15; ++i) */
-/* OBSOLETE fprintf (adapt_stream, "%x,", read_register (GR64_REGNUM + j + i)); */
-/* OBSOLETE fprintf (adapt_stream, "%x\r", read_register (GR64_REGNUM + j + 15)); */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE } */
-/* OBSOLETE #endif */
-/* OBSOLETE for (j = 0; j < 32; j += 16) */
-/* OBSOLETE { */
-/* OBSOLETE fprintf (adapt_stream, "s gr%d,", j + 96); */
-/* OBSOLETE for (i = 0; i < 15; ++i) */
-/* OBSOLETE fprintf (adapt_stream, "%x,", read_register (GR96_REGNUM + j + i)); */
-/* OBSOLETE fprintf (adapt_stream, "%x\r", read_register (GR96_REGNUM + j + 15)); */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE for (j = 0; j < 128; j += 16) */
-/* OBSOLETE { */
-/* OBSOLETE fprintf (adapt_stream, "s lr%d,", j); */
-/* OBSOLETE for (i = 0; i < 15; ++i) */
-/* OBSOLETE fprintf (adapt_stream, "%x,", read_register (LR0_REGNUM + j + i)); */
-/* OBSOLETE fprintf (adapt_stream, "%x\r", read_register (LR0_REGNUM + j + 15)); */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE fprintf (adapt_stream, "s sr128,%x,%x,%x\r", read_register (IPC_REGNUM), */
-/* OBSOLETE read_register (IPA_REGNUM), read_register (IPB_REGNUM)); */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE fprintf (adapt_stream, "s sr133,%x,%x,%x\r", read_register (BP_REGNUM), */
-/* OBSOLETE read_register (FC_REGNUM), read_register (CR_REGNUM)); */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE fprintf (adapt_stream, "s sr131,%x\r", read_register (Q_REGNUM)); */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE fprintf (adapt_stream, "s sr0,"); */
-/* OBSOLETE for (i = 0; i < 7; ++i) */
-/* OBSOLETE fprintf (adapt_stream, "%x,", read_register (VAB_REGNUM + i)); */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE fprintf (adapt_stream, "s sr7,"); */
-/* OBSOLETE for (i = 7; i < 14; ++i) */
-/* OBSOLETE fprintf (adapt_stream, "%x,", read_register (VAB_REGNUM + i)); */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Store register REGNO, or all if REGNO == -1. */
-/* OBSOLETE Return errno value. */ */
-/* OBSOLETE void */
-/* OBSOLETE adapt_store_register (int regno) */
-/* OBSOLETE { */
-/* OBSOLETE /* printf("adapt_store_register() called.\n"); fflush(stdout); /* */ */
-/* OBSOLETE if (regno == -1) */
-/* OBSOLETE adapt_store_registers (); */
-/* OBSOLETE else */
-/* OBSOLETE { */
-/* OBSOLETE char *name = get_reg_name (regno); */
-/* OBSOLETE fprintf (adapt_stream, "s %s,%x\r", name, read_register (regno)); */
-/* OBSOLETE /* Setting GR1 changes the numbers of all the locals, so */
-/* OBSOLETE invalidate the register cache. Do this *after* calling */
-/* OBSOLETE read_register, because we want read_register to return the */
-/* OBSOLETE value that write_register has just stuffed into the registers */
-/* OBSOLETE array, not the value of the register fetched from the */
-/* OBSOLETE inferior. */ */
-/* OBSOLETE if (regno == GR1_REGNUM) */
-/* OBSOLETE registers_changed (); */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Get ready to modify the registers array. On machines which store */
-/* OBSOLETE individual registers, this doesn't need to do anything. On machines */
-/* OBSOLETE which store all the registers in one fell swoop, this makes sure */
-/* OBSOLETE that registers contains all the registers from the program being */
-/* OBSOLETE debugged. */ */
-/* OBSOLETE */
-/* OBSOLETE void */
-/* OBSOLETE adapt_prepare_to_store (void) */
-/* OBSOLETE { */
-/* OBSOLETE /* Do nothing, since we can store individual regs */ */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE static CORE_ADDR */
-/* OBSOLETE translate_addr (CORE_ADDR addr) */
-/* OBSOLETE { */
-/* OBSOLETE #if defined(KERNEL_DEBUGGING) */
-/* OBSOLETE /* Check for a virtual address in the kernel */ */
-/* OBSOLETE /* Assume physical address of ublock is in paddr_u register */ */
-/* OBSOLETE if (addr >= UVADDR) */
-/* OBSOLETE { */
-/* OBSOLETE /* PADDR_U register holds the physical address of the ublock */ */
-/* OBSOLETE CORE_ADDR i = (CORE_ADDR) read_register (PADDR_U_REGNUM); */
-/* OBSOLETE return (i + addr - (CORE_ADDR) UVADDR); */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE { */
-/* OBSOLETE return (addr); */
-/* OBSOLETE } */
-/* OBSOLETE #else */
-/* OBSOLETE return (addr); */
-/* OBSOLETE #endif */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE */
-/* OBSOLETE /* FIXME! Merge these two. */ */
-/* OBSOLETE int */
-/* OBSOLETE adapt_xfer_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len, int write, */
-/* OBSOLETE struct mem_attrib *attrib ATTRIBUTE_UNUSED, */
-/* OBSOLETE struct target_ops *target ATTRIBUTE_UNUSED) */
-/* OBSOLETE { */
-/* OBSOLETE */
-/* OBSOLETE memaddr = translate_addr (memaddr); */
-/* OBSOLETE */
-/* OBSOLETE if (write) */
-/* OBSOLETE return adapt_write_inferior_memory (memaddr, myaddr, len); */
-/* OBSOLETE else */
-/* OBSOLETE return adapt_read_inferior_memory (memaddr, myaddr, len); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE void */
-/* OBSOLETE adapt_files_info (void) */
-/* OBSOLETE { */
-/* OBSOLETE printf_filtered ("\tAttached to %s at %d baud and running program %s\n", */
-/* OBSOLETE dev_name, baudrate, prog_name); */
-/* OBSOLETE printf_filtered ("\ton an %s processor.\n", processor_name[processor_type]); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Copy LEN bytes of data from debugger memory at MYADDR */
-/* OBSOLETE to inferior's memory at MEMADDR. Returns errno value. */
-/* OBSOLETE * sb/sh instructions don't work on unaligned addresses, when TU=1. */
-/* OBSOLETE */ */
-/* OBSOLETE int */
-/* OBSOLETE adapt_write_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len) */
-/* OBSOLETE { */
-/* OBSOLETE int i; */
-/* OBSOLETE unsigned int cps; */
-/* OBSOLETE */
-/* OBSOLETE /* Turn TU bit off so we can do 'sb' commands */ */
-/* OBSOLETE cps = read_register (CPS_REGNUM); */
-/* OBSOLETE if (cps & 0x00000800) */
-/* OBSOLETE write_register (CPS_REGNUM, cps & ~(0x00000800)); */
-/* OBSOLETE */
-/* OBSOLETE for (i = 0; i < len; i++) */
-/* OBSOLETE { */
-/* OBSOLETE if ((i % 16) == 0) */
-/* OBSOLETE fprintf (adapt_stream, "sb %x,", memaddr + i); */
-/* OBSOLETE if ((i % 16) == 15 || i == len - 1) */
-/* OBSOLETE { */
-/* OBSOLETE fprintf (adapt_stream, "%x\r", ((unsigned char *) myaddr)[i]); */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE fprintf (adapt_stream, "%x,", ((unsigned char *) myaddr)[i]); */
-/* OBSOLETE } */
-/* OBSOLETE /* Restore the old value of cps if the TU bit was on */ */
-/* OBSOLETE if (cps & 0x00000800) */
-/* OBSOLETE write_register (CPS_REGNUM, cps); */
-/* OBSOLETE return len; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Read LEN bytes from inferior memory at MEMADDR. Put the result */
-/* OBSOLETE at debugger address MYADDR. Returns errno value. */ */
-/* OBSOLETE int */
-/* OBSOLETE adapt_read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len) */
-/* OBSOLETE { */
-/* OBSOLETE int i; */
-/* OBSOLETE */
-/* OBSOLETE /* Number of bytes read so far. */ */
-/* OBSOLETE int count; */
-/* OBSOLETE */
-/* OBSOLETE /* Starting address of this pass. */ */
-/* OBSOLETE unsigned long startaddr; */
-/* OBSOLETE */
-/* OBSOLETE /* Number of bytes to read in this pass. */ */
-/* OBSOLETE int len_this_pass; */
-/* OBSOLETE */
-/* OBSOLETE /* Note that this code works correctly if startaddr is just less */
-/* OBSOLETE than UINT_MAX (well, really CORE_ADDR_MAX if there was such a */
-/* OBSOLETE thing). That is, something like */
-/* OBSOLETE adapt_read_bytes (CORE_ADDR_MAX - 4, foo, 4) */
-/* OBSOLETE works--it never adds len to memaddr and gets 0. */ */
-/* OBSOLETE /* However, something like */
-/* OBSOLETE adapt_read_bytes (CORE_ADDR_MAX - 3, foo, 4) */
-/* OBSOLETE doesn't need to work. Detect it and give up if there's an attempt */
-/* OBSOLETE to do that. */ */
-/* OBSOLETE */
-/* OBSOLETE if (((memaddr - 1) + len) < memaddr) */
-/* OBSOLETE return EIO; */
-/* OBSOLETE */
-/* OBSOLETE startaddr = memaddr; */
-/* OBSOLETE count = 0; */
-/* OBSOLETE while (count < len) */
-/* OBSOLETE { */
-/* OBSOLETE len_this_pass = 16; */
-/* OBSOLETE if ((startaddr % 16) != 0) */
-/* OBSOLETE len_this_pass -= startaddr % 16; */
-/* OBSOLETE if (len_this_pass > (len - count)) */
-/* OBSOLETE len_this_pass = (len - count); */
-/* OBSOLETE */
-/* OBSOLETE fprintf (adapt_stream, "db %x,%x\r", startaddr, */
-/* OBSOLETE (startaddr - 1) + len_this_pass); */
-/* OBSOLETE */
-/* OBSOLETE #ifdef NOTDEF /* Why do this */ */
-/* OBSOLETE expect ("\n"); */
-/* OBSOLETE /* Look for 8 hex digits. */ */
-/* OBSOLETE i = 0; */
-/* OBSOLETE while (1) */
-/* OBSOLETE { */
-/* OBSOLETE if (isxdigit (readchar ())) */
-/* OBSOLETE ++i; */
-/* OBSOLETE else */
-/* OBSOLETE { */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE error ("Hex digit expected from remote system."); */
-/* OBSOLETE } */
-/* OBSOLETE if (i >= 8) */
-/* OBSOLETE break; */
-/* OBSOLETE } */
-/* OBSOLETE #endif /* NOTDEF */ */
-/* OBSOLETE */
-/* OBSOLETE expect (" "); */
-/* OBSOLETE */
-/* OBSOLETE for (i = 0; i < len_this_pass; i++) */
-/* OBSOLETE get_hex_byte (&myaddr[count++]); */
-/* OBSOLETE */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE */
-/* OBSOLETE startaddr += len_this_pass; */
-/* OBSOLETE } */
-/* OBSOLETE return count; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE #define MAX_BREAKS 8 */
-/* OBSOLETE static int num_brkpts = 0; */
-/* OBSOLETE */
-/* OBSOLETE /* Insert a breakpoint at ADDR. SAVE is normally the address of the */
-/* OBSOLETE pattern buffer where the instruction that the breakpoint overwrites */
-/* OBSOLETE is saved. It is unused here since the Adapt Monitor is responsible */
-/* OBSOLETE for saving/restoring the original instruction. */ */
-/* OBSOLETE */
-/* OBSOLETE static int */
-/* OBSOLETE adapt_insert_breakpoint (CORE_ADDR addr, char *save) */
-/* OBSOLETE { */
-/* OBSOLETE if (num_brkpts < MAX_BREAKS) */
-/* OBSOLETE { */
-/* OBSOLETE num_brkpts++; */
-/* OBSOLETE fprintf (adapt_stream, "B %x", addr); */
-/* OBSOLETE fprintf (adapt_stream, "\r"); */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE return (0); /* Success */ */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE { */
-/* OBSOLETE fprintf_filtered (gdb_stderr, */
-/* OBSOLETE "Too many break points, break point not installed\n"); */
-/* OBSOLETE return (1); /* Failure */ */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Remove a breakpoint at ADDR. SAVE is normally the previously */
-/* OBSOLETE saved pattern, but is unused here as the Adapt Monitor is */
-/* OBSOLETE responsible for saving/restoring instructions. */ */
-/* OBSOLETE */
-/* OBSOLETE static int */
-/* OBSOLETE adapt_remove_breakpoint (CORE_ADDR addr, char *save) */
-/* OBSOLETE { */
-/* OBSOLETE if (num_brkpts > 0) */
-/* OBSOLETE { */
-/* OBSOLETE num_brkpts--; */
-/* OBSOLETE fprintf (adapt_stream, "BR %x", addr); */
-/* OBSOLETE fprintf (adapt_stream, "\r"); */
-/* OBSOLETE fflush (adapt_stream); */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE } */
-/* OBSOLETE return (0); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Clear the adapts notion of what the break points are */ */
-/* OBSOLETE static int */
-/* OBSOLETE adapt_clear_breakpoints (void) */
-/* OBSOLETE { */
-/* OBSOLETE if (adapt_stream) */
-/* OBSOLETE { */
-/* OBSOLETE fprintf (adapt_stream, "BR"); /* Clear all break points */ */
-/* OBSOLETE fprintf (adapt_stream, "\r"); */
-/* OBSOLETE fflush (adapt_stream); */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE } */
-/* OBSOLETE num_brkpts = 0; */
-/* OBSOLETE } */
-/* OBSOLETE static void */
-/* OBSOLETE adapt_mourn (void) */
-/* OBSOLETE { */
-/* OBSOLETE adapt_clear_breakpoints (); */
-/* OBSOLETE pop_target (); /* Pop back to no-child state */ */
-/* OBSOLETE generic_mourn_inferior (); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Display everthing we read in from the adapt until we match/see the */
-/* OBSOLETE * specified string */
-/* OBSOLETE */ */
-/* OBSOLETE static int */
-/* OBSOLETE display_until (char *str) */
-/* OBSOLETE { */
-/* OBSOLETE int i = 0, j, c; */
-/* OBSOLETE */
-/* OBSOLETE while (c = readchar ()) */
-/* OBSOLETE { */
-/* OBSOLETE if (c == str[i]) */
-/* OBSOLETE { */
-/* OBSOLETE i++; */
-/* OBSOLETE if (i == strlen (str)) */
-/* OBSOLETE return; */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE { */
-/* OBSOLETE if (i) */
-/* OBSOLETE { */
-/* OBSOLETE for (j = 0; j < i; j++) /* Put everthing we matched */ */
-/* OBSOLETE putchar (str[j]); */
-/* OBSOLETE i = 0; */
-/* OBSOLETE } */
-/* OBSOLETE putchar (c); */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE */
-/* OBSOLETE /* Put a command string, in args, out to the adapt. The adapt is assumed to */
-/* OBSOLETE be in raw mode, all writing/reading done through adapt_desc. */
-/* OBSOLETE Ouput from the adapt is placed on the users terminal until the */
-/* OBSOLETE prompt from the adapt is seen. */
-/* OBSOLETE FIXME: Can't handle commands that take input. */ */
-/* OBSOLETE */
-/* OBSOLETE void */
-/* OBSOLETE adapt_com (char *args, int fromtty) */
-/* OBSOLETE { */
-/* OBSOLETE if (!adapt_stream) */
-/* OBSOLETE { */
-/* OBSOLETE printf_filtered ("Adapt not open. Use the 'target' command to open.\n"); */
-/* OBSOLETE return; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Clear all input so only command relative output is displayed */ */
-/* OBSOLETE slurp_input (); */
-/* OBSOLETE */
-/* OBSOLETE switch (islower (args[0]) ? toupper (args[0]) : args[0]) */
-/* OBSOLETE { */
-/* OBSOLETE default: */
-/* OBSOLETE printf_filtered ("Unknown/Unimplemented adapt command '%s'\n", args); */
-/* OBSOLETE break; */
-/* OBSOLETE case 'G': /* Go, begin execution */ */
-/* OBSOLETE write (adapt_desc, args, strlen (args)); */
-/* OBSOLETE write (adapt_desc, "\r", 1); */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE break; */
-/* OBSOLETE case 'B': /* Break points, B or BR */ */
-/* OBSOLETE case 'C': /* Check current 29k status (running/halted) */ */
-/* OBSOLETE case 'D': /* Display data/registers */ */
-/* OBSOLETE case 'I': /* Input from i/o space */ */
-/* OBSOLETE case 'J': /* Jam an instruction */ */
-/* OBSOLETE case 'K': /* Kill, stop execution */ */
-/* OBSOLETE case 'L': /* Disassemble */ */
-/* OBSOLETE case 'O': /* Output to i/o space */ */
-/* OBSOLETE case 'T': /* Trace */ */
-/* OBSOLETE case 'P': /* Pulse an input line */ */
-/* OBSOLETE case 'X': /* Examine special purpose registers */ */
-/* OBSOLETE case 'Z': /* Display trace buffer */ */
-/* OBSOLETE write (adapt_desc, args, strlen (args)); */
-/* OBSOLETE write (adapt_desc, "\r", 1); */
-/* OBSOLETE expect (args); /* Don't display the command */ */
-/* OBSOLETE display_until ("# "); */
-/* OBSOLETE break; */
-/* OBSOLETE /* Begin commands that take input in the form 'c x,y[,z...]' */ */
-/* OBSOLETE case 'S': /* Set memory or register */ */
-/* OBSOLETE if (strchr (args, ',')) */
-/* OBSOLETE { /* Assume it is properly formatted */ */
-/* OBSOLETE write (adapt_desc, args, strlen (args)); */
-/* OBSOLETE write (adapt_desc, "\r", 1); */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE } */
-/* OBSOLETE break; */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Define the target subroutine names */ */
-/* OBSOLETE */
-/* OBSOLETE struct target_ops adapt_ops; */
-/* OBSOLETE */
-/* OBSOLETE static void */
-/* OBSOLETE init_adapt_ops (void) */
-/* OBSOLETE { */
-/* OBSOLETE adapt_ops.to_shortname = "adapt"; */
-/* OBSOLETE adapt_ops.to_longname = "Remote AMD `Adapt' target"; */
-/* OBSOLETE adapt_ops.to_doc = "Remote debug an AMD 290*0 using an `Adapt' monitor via RS232"; */
-/* OBSOLETE adapt_ops.to_open = adapt_open; */
-/* OBSOLETE adapt_ops.to_close = adapt_close; */
-/* OBSOLETE adapt_ops.to_attach = adapt_attach; */
-/* OBSOLETE adapt_ops.to_post_attach = NULL; */
-/* OBSOLETE adapt_ops.to_require_attach = NULL; */
-/* OBSOLETE adapt_ops.to_detach = adapt_detach; */
-/* OBSOLETE adapt_ops.to_require_detach = NULL; */
-/* OBSOLETE adapt_ops.to_resume = adapt_resume; */
-/* OBSOLETE adapt_ops.to_wait = adapt_wait; */
-/* OBSOLETE adapt_ops.to_post_wait = NULL; */
-/* OBSOLETE adapt_ops.to_fetch_registers = adapt_fetch_register; */
-/* OBSOLETE adapt_ops.to_store_registers = adapt_store_register; */
-/* OBSOLETE adapt_ops.to_prepare_to_store = adapt_prepare_to_store; */
-/* OBSOLETE adapt_ops.to_xfer_memory = adapt_xfer_inferior_memory; */
-/* OBSOLETE adapt_ops.to_files_info = adapt_files_info; */
-/* OBSOLETE adapt_ops.to_insert_breakpoint = adapt_insert_breakpoint; */
-/* OBSOLETE adapt_ops.to_remove_breakpoint = adapt_remove_breakpoint; */
-/* OBSOLETE adapt_ops.to_terminal_init = 0; */
-/* OBSOLETE adapt_ops.to_terminal_inferior = 0; */
-/* OBSOLETE adapt_ops.to_terminal_ours_for_output = 0; */
-/* OBSOLETE adapt_ops.to_terminal_ours = 0; */
-/* OBSOLETE adapt_ops.to_terminal_info = 0; */
-/* OBSOLETE adapt_ops.to_kill = adapt_kill; */
-/* OBSOLETE adapt_ops.to_load = adapt_load; */
-/* OBSOLETE adapt_ops.to_lookup_symbol = 0; */
-/* OBSOLETE adapt_ops.to_create_inferior = adapt_create_inferior; */
-/* OBSOLETE adapt_ops.to_post_startup_inferior = NULL; */
-/* OBSOLETE adapt_ops.to_acknowledge_created_inferior = NULL; */
-/* OBSOLETE adapt_ops.to_clone_and_follow_inferior = NULL; */
-/* OBSOLETE adapt_ops.to_post_follow_inferior_by_clone = NULL; */
-/* OBSOLETE adapt_ops.to_insert_fork_catchpoint = NULL; */
-/* OBSOLETE adapt_ops.to_remove_fork_catchpoint = NULL; */
-/* OBSOLETE adapt_ops.to_insert_vfork_catchpoint = NULL; */
-/* OBSOLETE adapt_ops.to_remove_vfork_catchpoint = NULL; */
-/* OBSOLETE adapt_ops.to_has_forked = NULL; */
-/* OBSOLETE adapt_ops.to_has_vforked = NULL; */
-/* OBSOLETE adapt_ops.to_can_follow_vfork_prior_to_exec = NULL; */
-/* OBSOLETE adapt_ops.to_post_follow_vfork = NULL; */
-/* OBSOLETE adapt_ops.to_insert_exec_catchpoint = NULL; */
-/* OBSOLETE adapt_ops.to_remove_exec_catchpoint = NULL; */
-/* OBSOLETE adapt_ops.to_has_execd = NULL; */
-/* OBSOLETE adapt_ops.to_reported_exec_events_per_exec_call = NULL; */
-/* OBSOLETE adapt_ops.to_has_exited = NULL; */
-/* OBSOLETE adapt_ops.to_mourn_inferior = adapt_mourn; */
-/* OBSOLETE adapt_ops.to_can_run = 0; */
-/* OBSOLETE adapt_ops.to_notice_signals = 0; */
-/* OBSOLETE adapt_ops.to_thread_alive = 0; */
-/* OBSOLETE adapt_ops.to_stop = 0; /* process_stratum; */ */
-/* OBSOLETE adapt_ops.to_pid_to_exec_file = NULL; */
-/* OBSOLETE adapt_ops.to_stratum = 0; */
-/* OBSOLETE adapt_ops.DONT_USE = 0; */
-/* OBSOLETE adapt_ops.to_has_all_memory = 1; */
-/* OBSOLETE adapt_ops.to_has_memory = 1; */
-/* OBSOLETE adapt_ops.to_has_stack = 1; */
-/* OBSOLETE adapt_ops.to_has_registers = 1; */
-/* OBSOLETE adapt_ops.to_has_execution = 0; */
-/* OBSOLETE adapt_ops.to_sections = 0; */
-/* OBSOLETE adapt_ops.to_sections_end = 0; */
-/* OBSOLETE adapt_ops.to_magic = OPS_MAGIC; */
-/* OBSOLETE } /* init_adapt_ops */ */
-/* OBSOLETE */
-/* OBSOLETE void */
-/* OBSOLETE _initialize_remote_adapt (void) */
-/* OBSOLETE { */
-/* OBSOLETE init_adapt_ops (); */
-/* OBSOLETE add_target (&adapt_ops); */
-/* OBSOLETE add_com ("adapt <command>", class_obscure, adapt_com, */
-/* OBSOLETE "Send a command to the AMD Adapt remote monitor."); */
-/* OBSOLETE } */
diff --git a/gdb/remote-array.c b/gdb/remote-array.c
index 204aaed..ed0c40e 100644
--- a/gdb/remote-array.c
+++ b/gdb/remote-array.c
@@ -193,7 +193,8 @@ printf_monitor (char *pattern,...)
if (strlen (buf) > PBUFSIZ)
error ("printf_monitor(): string too long");
if (serial_write (array_desc, buf, strlen (buf)))
- fprintf (stderr, "serial_write failed: %s\n", safe_strerror (errno));
+ fprintf_unfiltered (gdb_stderr, "serial_write failed: %s\n",
+ safe_strerror (errno));
}
/*
* write_monitor -- send raw data to monitor.
@@ -202,7 +203,8 @@ static void
write_monitor (char data[], int len)
{
if (serial_write (array_desc, data, len))
- fprintf (stderr, "serial_write failed: %s\n", safe_strerror (errno));
+ fprintf_unfiltered (gdb_stderr, "serial_write failed: %s\n",
+ safe_strerror (errno));
*(data + len + 1) = '\0';
debuglogs (1, "write_monitor(), Sending: \"%s\".", data);
@@ -1053,7 +1055,7 @@ array_insert_breakpoint (CORE_ADDR addr, char *shadow)
}
}
- fprintf (stderr, "Too many breakpoints (> 16) for monitor\n");
+ fprintf_unfiltered (gdb_stderr, "Too many breakpoints (> 16) for monitor\n");
return 1;
}
@@ -1078,8 +1080,9 @@ array_remove_breakpoint (CORE_ADDR addr, char *shadow)
return 0;
}
}
- fprintf (stderr, "Can't find breakpoint associated with 0x%s\n",
- paddr_nz (addr));
+ fprintf_unfiltered (gdb_stderr,
+ "Can't find breakpoint associated with 0x%s\n",
+ paddr_nz (addr));
return 1;
}
diff --git a/gdb/remote-e7000.c b/gdb/remote-e7000.c
index e13401f..d9cf5e8 100644
--- a/gdb/remote-e7000.c
+++ b/gdb/remote-e7000.c
@@ -630,7 +630,7 @@ e7000_start_remote (void *dummy)
registers_changed ();
stop_pc = read_pc ();
set_current_frame (create_new_frame (read_fp (), stop_pc));
- select_frame (get_current_frame (), 0);
+ select_frame (get_current_frame ());
print_stack_frame (selected_frame, -1, 1);
return 1;
@@ -1083,15 +1083,15 @@ write_small (CORE_ADDR memaddr, unsigned char *myaddr, int len)
if (((memaddr + i) & 3) == 0 && (i + 3 < len))
{
/* Can be done with a long word */
- sprintf (buf, "m %lx %x%02x%02x%02x;l\r",
- memaddr + i,
+ sprintf (buf, "m %s %x%02x%02x%02x;l\r",
+ paddr_nz (memaddr + i),
myaddr[i], myaddr[i + 1], myaddr[i + 2], myaddr[i + 3]);
puts_e7000debug (buf);
i += 3;
}
else
{
- sprintf (buf, "m %lx %x\r", memaddr + i, myaddr[i]);
+ sprintf (buf, "m %s %x\r", paddr_nz (memaddr + i), myaddr[i]);
puts_e7000debug (buf);
}
}
@@ -1244,7 +1244,7 @@ e7000_read_inferior_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len)
return 0;
}
- sprintf (buf, "m %lx;l\r", memaddr);
+ sprintf (buf, "m %s;l\r", paddr_nz (memaddr));
puts_e7000debug (buf);
for (count = 0; count < len; count += 4)
@@ -1323,7 +1323,7 @@ e7000_read_inferior_memory_large (CORE_ADDR memaddr, unsigned char *myaddr,
return 0;
}
- sprintf (buf, "d %lx %lx\r", memaddr, memaddr + len - 1);
+ sprintf (buf, "d %s %s\r", paddr_nz (memaddr), paddr_nz (memaddr + len - 1));
puts_e7000debug (buf);
count = 0;
@@ -1705,12 +1705,12 @@ e7000_insert_breakpoint (CORE_ADDR addr, char *shadow)
#ifdef HARD_BREAKPOINTS
if (BC_BREAKPOINTS)
{
- sprintf (buf, "BC%d A=%lx\r", i + 1, addr);
+ sprintf (buf, "BC%d A=%s\r", i + 1, paddr_nz (addr));
puts_e7000debug (buf);
}
else
{
- sprintf (buf, "B %lx\r", addr);
+ sprintf (buf, "B %s\r", paddr_nz (addr));
puts_e7000debug (buf);
}
#else
@@ -1749,12 +1749,12 @@ e7000_remove_breakpoint (CORE_ADDR addr, char *shadow)
}
else
{
- sprintf (buf, "B - %lx\r", addr);
+ sprintf (buf, "B - %s\r", paddr_nz (addr));
puts_e7000debug (buf);
}
expect_prompt ();
#else
- sprintf (buf, "B - %lx\r", addr);
+ sprintf (buf, "B - %s\r", paddr_nz (addr));
puts_e7000debug (buf);
expect_prompt ();
@@ -1766,8 +1766,8 @@ e7000_remove_breakpoint (CORE_ADDR addr, char *shadow)
return 0;
}
-
- warning ("Can't find breakpoint associated with 0x%lx\n", addr);
+
+ warning ("Can't find breakpoint associated with 0x%s\n", paddr_nz (addr));
return 1;
}
diff --git a/gdb/remote-eb.c b/gdb/remote-eb.c
deleted file mode 100644
index dcee345..0000000
--- a/gdb/remote-eb.c
+++ /dev/null
@@ -1,1088 +0,0 @@
-/* OBSOLETE /* Remote debugging interface for AMD 29000 EBMON on IBM PC, for GDB. */
-/* OBSOLETE Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001 */
-/* OBSOLETE Free Software Foundation, Inc. */
-/* OBSOLETE Contributed by Cygnus Support. Written by Jim Kingdon for Cygnus. */
-/* 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. */ */
-/* OBSOLETE */
-/* OBSOLETE /* This is like remote.c but is for an esoteric situation-- */
-/* OBSOLETE having a a29k board in a PC hooked up to a unix machine with */
-/* OBSOLETE a serial line, and running ctty com1 on the PC, through which */
-/* OBSOLETE the unix machine can run ebmon. Not to mention that the PC */
-/* OBSOLETE has PC/NFS, so it can access the same executables that gdb can, */
-/* OBSOLETE over the net in real time. */ */
-/* OBSOLETE */
-/* OBSOLETE #include "defs.h" */
-/* OBSOLETE #include "gdb_string.h" */
-/* OBSOLETE #include "regcache.h" */
-/* OBSOLETE */
-/* OBSOLETE #include "inferior.h" */
-/* OBSOLETE #include "bfd.h" */
-/* OBSOLETE #include "symfile.h" */
-/* OBSOLETE #include "value.h" */
-/* OBSOLETE #include <ctype.h> */
-/* OBSOLETE #include <fcntl.h> */
-/* OBSOLETE #include <signal.h> */
-/* OBSOLETE #include <errno.h> */
-/* OBSOLETE #include "terminal.h" */
-/* OBSOLETE #include "target.h" */
-/* OBSOLETE #include "gdbcore.h" */
-/* OBSOLETE */
-/* OBSOLETE extern struct target_ops eb_ops; /* Forward declaration */ */
-/* OBSOLETE */
-/* OBSOLETE static void eb_close (); */
-/* OBSOLETE */
-/* OBSOLETE #define LOG_FILE "eb.log" */
-/* OBSOLETE #if defined (LOG_FILE) */
-/* OBSOLETE FILE *log_file; */
-/* OBSOLETE #endif */
-/* OBSOLETE */
-/* OBSOLETE static int timeout = 24; */
-/* OBSOLETE */
-/* OBSOLETE /* Descriptor for I/O to remote machine. Initialize it to -1 so that */
-/* OBSOLETE eb_open knows that we don't have a file open when the program */
-/* OBSOLETE starts. */ */
-/* OBSOLETE int eb_desc = -1; */
-/* OBSOLETE */
-/* OBSOLETE /* stream which is fdopen'd from eb_desc. Only valid when */
-/* OBSOLETE eb_desc != -1. */ */
-/* OBSOLETE FILE *eb_stream; */
-/* OBSOLETE */
-/* OBSOLETE /* Read a character from the remote system, doing all the fancy */
-/* OBSOLETE timeout stuff. */ */
-/* OBSOLETE static int */
-/* OBSOLETE readchar (void) */
-/* OBSOLETE { */
-/* OBSOLETE char buf; */
-/* OBSOLETE */
-/* OBSOLETE buf = '\0'; */
-/* OBSOLETE #ifdef HAVE_TERMIO */
-/* OBSOLETE /* termio does the timeout for us. */ */
-/* OBSOLETE read (eb_desc, &buf, 1); */
-/* OBSOLETE #else */
-/* OBSOLETE alarm (timeout); */
-/* OBSOLETE if (read (eb_desc, &buf, 1) < 0) */
-/* OBSOLETE { */
-/* OBSOLETE if (errno == EINTR) */
-/* OBSOLETE error ("Timeout reading from remote system."); */
-/* OBSOLETE else */
-/* OBSOLETE perror_with_name ("remote"); */
-/* OBSOLETE } */
-/* OBSOLETE alarm (0); */
-/* OBSOLETE #endif */
-/* OBSOLETE */
-/* OBSOLETE if (buf == '\0') */
-/* OBSOLETE error ("Timeout reading from remote system."); */
-/* OBSOLETE #if defined (LOG_FILE) */
-/* OBSOLETE putc (buf & 0x7f, log_file); */
-/* OBSOLETE #endif */
-/* OBSOLETE return buf & 0x7f; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Keep discarding input from the remote system, until STRING is found. */
-/* OBSOLETE Let the user break out immediately. */ */
-/* OBSOLETE static void */
-/* OBSOLETE expect (char *string) */
-/* OBSOLETE { */
-/* OBSOLETE char *p = string; */
-/* OBSOLETE */
-/* OBSOLETE immediate_quit++; */
-/* OBSOLETE while (1) */
-/* OBSOLETE { */
-/* OBSOLETE if (readchar () == *p) */
-/* OBSOLETE { */
-/* OBSOLETE p++; */
-/* OBSOLETE if (*p == '\0') */
-/* OBSOLETE { */
-/* OBSOLETE immediate_quit--; */
-/* OBSOLETE return; */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE p = string; */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Keep discarding input until we see the ebmon prompt. */
-/* OBSOLETE */
-/* OBSOLETE The convention for dealing with the prompt is that you */
-/* OBSOLETE o give your command */
-/* OBSOLETE o *then* wait for the prompt. */
-/* OBSOLETE */
-/* OBSOLETE Thus the last thing that a procedure does with the serial line */
-/* OBSOLETE will be an expect_prompt(). Exception: eb_resume does not */
-/* OBSOLETE wait for the prompt, because the terminal is being handed over */
-/* OBSOLETE to the inferior. However, the next thing which happens after that */
-/* OBSOLETE is a eb_wait which does wait for the prompt. */
-/* OBSOLETE Note that this includes abnormal exit, e.g. error(). This is */
-/* OBSOLETE necessary to prevent getting into states from which we can't */
-/* OBSOLETE recover. */ */
-/* OBSOLETE static void */
-/* OBSOLETE expect_prompt (void) */
-/* OBSOLETE { */
-/* OBSOLETE #if defined (LOG_FILE) */
-/* OBSOLETE /* This is a convenient place to do this. The idea is to do it often */
-/* OBSOLETE enough that we never lose much data if we terminate abnormally. */ */
-/* OBSOLETE fflush (log_file); */
-/* OBSOLETE #endif */
-/* OBSOLETE expect ("\n# "); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Get a hex digit from the remote system & return its value. */
-/* OBSOLETE If ignore_space is nonzero, ignore spaces (not newline, tab, etc). */ */
-/* OBSOLETE static int */
-/* OBSOLETE get_hex_digit (int ignore_space) */
-/* OBSOLETE { */
-/* OBSOLETE int ch; */
-/* OBSOLETE while (1) */
-/* OBSOLETE { */
-/* OBSOLETE ch = readchar (); */
-/* OBSOLETE if (ch >= '0' && ch <= '9') */
-/* OBSOLETE return ch - '0'; */
-/* OBSOLETE else if (ch >= 'A' && ch <= 'F') */
-/* OBSOLETE return ch - 'A' + 10; */
-/* OBSOLETE else if (ch >= 'a' && ch <= 'f') */
-/* OBSOLETE return ch - 'a' + 10; */
-/* OBSOLETE else if (ch == ' ' && ignore_space) */
-/* OBSOLETE ; */
-/* OBSOLETE else */
-/* OBSOLETE { */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE error ("Invalid hex digit from remote system."); */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Get a byte from eb_desc and put it in *BYT. Accept any number */
-/* OBSOLETE leading spaces. */ */
-/* OBSOLETE static void */
-/* OBSOLETE get_hex_byte (char *byt) */
-/* OBSOLETE { */
-/* OBSOLETE int val; */
-/* OBSOLETE */
-/* OBSOLETE val = get_hex_digit (1) << 4; */
-/* OBSOLETE val |= get_hex_digit (0); */
-/* OBSOLETE *byt = val; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Get N 32-bit words from remote, each preceded by a space, */
-/* OBSOLETE and put them in registers starting at REGNO. */ */
-/* OBSOLETE static void */
-/* OBSOLETE get_hex_regs (int n, int regno) */
-/* OBSOLETE { */
-/* OBSOLETE long val; */
-/* OBSOLETE int i; */
-/* OBSOLETE */
-/* OBSOLETE for (i = 0; i < n; i++) */
-/* OBSOLETE { */
-/* OBSOLETE int j; */
-/* OBSOLETE */
-/* OBSOLETE val = 0; */
-/* OBSOLETE for (j = 0; j < 8; j++) */
-/* OBSOLETE val = (val << 4) + get_hex_digit (j == 0); */
-/* OBSOLETE supply_register (regno++, (char *) &val); */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Called when SIGALRM signal sent due to alarm() timeout. */ */
-/* OBSOLETE #ifndef HAVE_TERMIO */
-/* OBSOLETE */
-/* OBSOLETE volatile int n_alarms; */
-/* OBSOLETE */
-/* OBSOLETE void */
-/* OBSOLETE eb_timer (void) */
-/* OBSOLETE { */
-/* OBSOLETE #if 0 */
-/* OBSOLETE if (kiodebug) */
-/* OBSOLETE printf ("eb_timer called\n"); */
-/* OBSOLETE #endif */
-/* OBSOLETE n_alarms++; */
-/* OBSOLETE } */
-/* OBSOLETE #endif */
-/* OBSOLETE */
-/* OBSOLETE /* malloc'd name of the program on the remote system. */ */
-/* OBSOLETE static char *prog_name = NULL; */
-/* OBSOLETE */
-/* OBSOLETE /* Nonzero if we have loaded the file ("yc") and not yet issued a "gi" */
-/* OBSOLETE command. "gi" is supposed to happen exactly once for each "yc". */ */
-/* OBSOLETE static int need_gi = 0; */
-/* OBSOLETE */
-/* OBSOLETE /* Number of SIGTRAPs we need to simulate. That is, the next */
-/* OBSOLETE NEED_ARTIFICIAL_TRAP calls to eb_wait should just return */
-/* OBSOLETE SIGTRAP without actually waiting for anything. */ */
-/* OBSOLETE */
-/* OBSOLETE static int need_artificial_trap = 0; */
-/* OBSOLETE */
-/* OBSOLETE /* This is called not only when we first attach, but also when the */
-/* OBSOLETE user types "run" after having attached. */ */
-/* OBSOLETE static void */
-/* OBSOLETE eb_create_inferior (char *execfile, char *args, char **env) */
-/* OBSOLETE { */
-/* OBSOLETE int entry_pt; */
-/* OBSOLETE */
-/* OBSOLETE if (args && *args) */
-/* OBSOLETE error ("Can't pass arguments to remote EBMON process"); */
-/* OBSOLETE */
-/* OBSOLETE if (execfile == 0 || exec_bfd == 0) */
-/* OBSOLETE error ("No executable file specified"); */
-/* OBSOLETE */
-/* OBSOLETE entry_pt = (int) bfd_get_start_address (exec_bfd); */
-/* OBSOLETE */
-/* OBSOLETE { */
-/* OBSOLETE /* OK, now read in the file. Y=read, C=COFF, D=no symbols */
-/* OBSOLETE 0=start address, %s=filename. */ */
-/* OBSOLETE */
-/* OBSOLETE fprintf (eb_stream, "YC D,0:%s", prog_name); */
-/* OBSOLETE */
-/* OBSOLETE if (args != NULL) */
-/* OBSOLETE fprintf (eb_stream, " %s", args); */
-/* OBSOLETE */
-/* OBSOLETE fprintf (eb_stream, "\n"); */
-/* OBSOLETE fflush (eb_stream); */
-/* OBSOLETE */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE */
-/* OBSOLETE need_gi = 1; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* The "process" (board) is already stopped awaiting our commands, and */
-/* OBSOLETE the program is already downloaded. We just set its PC and go. */ */
-/* OBSOLETE */
-/* OBSOLETE clear_proceed_status (); */
-/* OBSOLETE */
-/* OBSOLETE /* Tell wait_for_inferior that we've started a new process. */ */
-/* OBSOLETE init_wait_for_inferior (); */
-/* OBSOLETE */
-/* OBSOLETE /* Set up the "saved terminal modes" of the inferior */
-/* OBSOLETE based on what modes we are starting it with. */ */
-/* OBSOLETE target_terminal_init (); */
-/* OBSOLETE */
-/* OBSOLETE /* Install inferior's terminal modes. */ */
-/* OBSOLETE target_terminal_inferior (); */
-/* OBSOLETE */
-/* OBSOLETE /* insert_step_breakpoint (); FIXME, do we need this? */ */
-/* OBSOLETE proceed ((CORE_ADDR) entry_pt, TARGET_SIGNAL_DEFAULT, 0); /* Let 'er rip... */ */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Translate baud rates from integers to damn B_codes. Unix should */
-/* OBSOLETE have outgrown this crap years ago, but even POSIX wouldn't buck it. */ */
-/* OBSOLETE */
-/* OBSOLETE #ifndef B19200 */
-/* OBSOLETE #define B19200 EXTA */
-/* OBSOLETE #endif */
-/* OBSOLETE #ifndef B38400 */
-/* OBSOLETE #define B38400 EXTB */
-/* OBSOLETE #endif */
-/* OBSOLETE */
-/* OBSOLETE struct */
-/* OBSOLETE { */
-/* OBSOLETE int rate, damn_b; */
-/* OBSOLETE } */
-/* OBSOLETE baudtab[] = */
-/* OBSOLETE { */
-/* OBSOLETE { */
-/* OBSOLETE 0, B0 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE 50, B50 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE 75, B75 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE 110, B110 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE 134, B134 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE 150, B150 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE 200, B200 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE 300, B300 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE 600, B600 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE 1200, B1200 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE 1800, B1800 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE 2400, B2400 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE 4800, B4800 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE 9600, B9600 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE 19200, B19200 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE 38400, B38400 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE -1, -1 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE }; */
-/* OBSOLETE */
-/* OBSOLETE int */
-/* OBSOLETE damn_b (int rate) */
-/* OBSOLETE { */
-/* OBSOLETE int i; */
-/* OBSOLETE */
-/* OBSOLETE for (i = 0; baudtab[i].rate != -1; i++) */
-/* OBSOLETE if (rate == baudtab[i].rate) */
-/* OBSOLETE return baudtab[i].damn_b; */
-/* OBSOLETE return B38400; /* Random */ */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE */
-/* OBSOLETE /* Open a connection to a remote debugger. */
-/* OBSOLETE NAME is the filename used for communication, then a space, */
-/* OBSOLETE then the name of the program as we should name it to EBMON. */ */
-/* OBSOLETE */
-/* OBSOLETE static int baudrate = 9600; */
-/* OBSOLETE static char *dev_name; */
-/* OBSOLETE void */
-/* OBSOLETE eb_open (char *name, int from_tty) */
-/* OBSOLETE { */
-/* OBSOLETE TERMINAL sg; */
-/* OBSOLETE */
-/* OBSOLETE char *p; */
-/* OBSOLETE */
-/* OBSOLETE target_preopen (from_tty); */
-/* OBSOLETE */
-/* OBSOLETE /* Find the first whitespace character, it separates dev_name from */
-/* OBSOLETE prog_name. */ */
-/* OBSOLETE if (name == 0) */
-/* OBSOLETE goto erroid; */
-/* OBSOLETE */
-/* OBSOLETE for (p = name; */
-/* OBSOLETE *p != '\0' && !isspace (*p); p++) */
-/* OBSOLETE ; */
-/* OBSOLETE if (*p == '\0') */
-/* OBSOLETE erroid: */
-/* OBSOLETE error ("\ */
-/* OBSOLETE Please include the name of the device for the serial port,\n\ */
-/* OBSOLETE the baud rate, and the name of the program to run on the remote system."); */
-/* OBSOLETE dev_name = alloca (p - name + 1); */
-/* OBSOLETE strncpy (dev_name, name, p - name); */
-/* OBSOLETE dev_name[p - name] = '\0'; */
-/* OBSOLETE */
-/* OBSOLETE /* Skip over the whitespace after dev_name */ */
-/* OBSOLETE for (; isspace (*p); p++) */
-/* OBSOLETE /*EMPTY */ ; */
-/* OBSOLETE */
-/* OBSOLETE if (1 != sscanf (p, "%d ", &baudrate)) */
-/* OBSOLETE goto erroid; */
-/* OBSOLETE */
-/* OBSOLETE /* Skip the number and then the spaces */ */
-/* OBSOLETE for (; isdigit (*p); p++) */
-/* OBSOLETE /*EMPTY */ ; */
-/* OBSOLETE for (; isspace (*p); p++) */
-/* OBSOLETE /*EMPTY */ ; */
-/* OBSOLETE */
-/* OBSOLETE if (prog_name != NULL) */
-/* OBSOLETE xfree (prog_name); */
-/* OBSOLETE prog_name = savestring (p, strlen (p)); */
-/* OBSOLETE */
-/* OBSOLETE eb_close (0); */
-/* OBSOLETE */
-/* OBSOLETE eb_desc = open (dev_name, O_RDWR); */
-/* OBSOLETE if (eb_desc < 0) */
-/* OBSOLETE perror_with_name (dev_name); */
-/* OBSOLETE ioctl (eb_desc, TIOCGETP, &sg); */
-/* OBSOLETE #ifdef HAVE_TERMIO */
-/* OBSOLETE sg.c_cc[VMIN] = 0; /* read with timeout. */ */
-/* OBSOLETE sg.c_cc[VTIME] = timeout * 10; */
-/* OBSOLETE sg.c_lflag &= ~(ICANON | ECHO); */
-/* OBSOLETE sg.c_cflag = (sg.c_cflag & ~CBAUD) | damn_b (baudrate); */
-/* OBSOLETE #else */
-/* OBSOLETE sg.sg_ispeed = damn_b (baudrate); */
-/* OBSOLETE sg.sg_ospeed = damn_b (baudrate); */
-/* OBSOLETE sg.sg_flags |= RAW | ANYP; */
-/* OBSOLETE sg.sg_flags &= ~ECHO; */
-/* OBSOLETE #endif */
-/* OBSOLETE */
-/* OBSOLETE ioctl (eb_desc, TIOCSETP, &sg); */
-/* OBSOLETE eb_stream = fdopen (eb_desc, "r+"); */
-/* OBSOLETE */
-/* OBSOLETE push_target (&eb_ops); */
-/* OBSOLETE if (from_tty) */
-/* OBSOLETE printf ("Remote %s debugging %s using %s\n", target_shortname, */
-/* OBSOLETE prog_name, dev_name); */
-/* OBSOLETE */
-/* OBSOLETE #ifndef HAVE_TERMIO */
-/* OBSOLETE #ifndef NO_SIGINTERRUPT */
-/* OBSOLETE /* Cause SIGALRM's to make reads fail with EINTR instead of resuming */
-/* OBSOLETE the read. */ */
-/* OBSOLETE if (siginterrupt (SIGALRM, 1) != 0) */
-/* OBSOLETE perror ("eb_open: error in siginterrupt"); */
-/* OBSOLETE #endif */
-/* OBSOLETE */
-/* OBSOLETE /* Set up read timeout timer. */ */
-/* OBSOLETE if ((void (*)) signal (SIGALRM, eb_timer) == (void (*)) -1) */
-/* OBSOLETE perror ("eb_open: error in signal"); */
-/* OBSOLETE #endif */
-/* OBSOLETE */
-/* OBSOLETE #if defined (LOG_FILE) */
-/* OBSOLETE log_file = fopen (LOG_FILE, "w"); */
-/* OBSOLETE if (log_file == NULL) */
-/* OBSOLETE perror_with_name (LOG_FILE); */
-/* OBSOLETE #endif */
-/* OBSOLETE */
-/* OBSOLETE /* Hello? Are you there? */ */
-/* OBSOLETE write (eb_desc, "\n", 1); */
-/* OBSOLETE */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Close out all files and local state before this target loses control. */ */
-/* OBSOLETE */
-/* OBSOLETE static void */
-/* OBSOLETE eb_close (int quitting) */
-/* OBSOLETE { */
-/* OBSOLETE */
-/* OBSOLETE /* Due to a bug in Unix, fclose closes not only the stdio stream, */
-/* OBSOLETE but also the file descriptor. So we don't actually close */
-/* OBSOLETE eb_desc. */ */
-/* OBSOLETE if (eb_stream) */
-/* OBSOLETE fclose (eb_stream); /* This also closes eb_desc */ */
-/* OBSOLETE if (eb_desc >= 0) */
-/* OBSOLETE /* close (eb_desc); */ */
-/* OBSOLETE */
-/* OBSOLETE /* Do not try to close eb_desc again, later in the program. */ */
-/* OBSOLETE eb_stream = NULL; */
-/* OBSOLETE eb_desc = -1; */
-/* OBSOLETE */
-/* OBSOLETE #if defined (LOG_FILE) */
-/* OBSOLETE if (log_file) */
-/* OBSOLETE { */
-/* OBSOLETE if (ferror (log_file)) */
-/* OBSOLETE printf ("Error writing log file.\n"); */
-/* OBSOLETE if (fclose (log_file) != 0) */
-/* OBSOLETE printf ("Error closing log file.\n"); */
-/* OBSOLETE } */
-/* OBSOLETE #endif */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Terminate the open connection to the remote debugger. */
-/* OBSOLETE Use this when you want to detach and do something else */
-/* OBSOLETE with your gdb. */ */
-/* OBSOLETE void */
-/* OBSOLETE eb_detach (int from_tty) */
-/* OBSOLETE { */
-/* OBSOLETE pop_target (); /* calls eb_close to do the real work */ */
-/* OBSOLETE if (from_tty) */
-/* OBSOLETE printf ("Ending remote %s debugging\n", target_shortname); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Tell the remote machine to resume. */ */
-/* OBSOLETE */
-/* OBSOLETE void */
-/* OBSOLETE eb_resume (ptid_t ptid, int step, enum target_signal sig) */
-/* OBSOLETE { */
-/* OBSOLETE if (step) */
-/* OBSOLETE { */
-/* OBSOLETE write (eb_desc, "t 1,s\n", 6); */
-/* OBSOLETE /* Wait for the echo. */ */
-/* OBSOLETE expect ("t 1,s\r"); */
-/* OBSOLETE /* Then comes a line containing the instruction we stepped to. */ */
-/* OBSOLETE expect ("\n@"); */
-/* OBSOLETE /* Then we get the prompt. */ */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE */
-/* OBSOLETE /* Force the next eb_wait to return a trap. Not doing anything */
-/* OBSOLETE about I/O from the target means that the user has to type */
-/* OBSOLETE "continue" to see any. This should be fixed. */ */
-/* OBSOLETE need_artificial_trap = 1; */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE { */
-/* OBSOLETE if (need_gi) */
-/* OBSOLETE { */
-/* OBSOLETE need_gi = 0; */
-/* OBSOLETE write (eb_desc, "gi\n", 3); */
-/* OBSOLETE */
-/* OBSOLETE /* Swallow the echo of "gi". */ */
-/* OBSOLETE expect ("gi\r"); */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE { */
-/* OBSOLETE write (eb_desc, "GR\n", 3); */
-/* OBSOLETE /* Swallow the echo. */ */
-/* OBSOLETE expect ("GR\r"); */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Wait until the remote machine stops, then return, */
-/* OBSOLETE storing status in STATUS just as `wait' would. */ */
-/* OBSOLETE */
-/* OBSOLETE ptid_t */
-/* OBSOLETE eb_wait (ptid_t ptid, struct target_waitstatus *status) */
-/* OBSOLETE { */
-/* OBSOLETE /* Strings to look for. '?' means match any single character. */
-/* OBSOLETE Note that with the algorithm we use, the initial character */
-/* OBSOLETE of the string cannot recur in the string, or we will not */
-/* OBSOLETE find some cases of the string in the input. */ */
-/* OBSOLETE */
-/* OBSOLETE static char bpt[] = "Invalid interrupt taken - #0x50 - "; */
-/* OBSOLETE /* It would be tempting to look for "\n[__exit + 0x8]\n" */
-/* OBSOLETE but that requires loading symbols with "yc i" and even if */
-/* OBSOLETE we did do that we don't know that the file has symbols. */ */
-/* OBSOLETE static char exitmsg[] = "\n@????????I JMPTI GR121,LR0"; */
-/* OBSOLETE char *bp = bpt; */
-/* OBSOLETE char *ep = exitmsg; */
-/* OBSOLETE */
-/* OBSOLETE /* Large enough for either sizeof (bpt) or sizeof (exitmsg) chars. */ */
-/* OBSOLETE char swallowed[50]; */
-/* OBSOLETE /* Current position in swallowed. */ */
-/* OBSOLETE char *swallowed_p = swallowed; */
-/* OBSOLETE */
-/* OBSOLETE int ch; */
-/* OBSOLETE int ch_handled; */
-/* OBSOLETE */
-/* OBSOLETE int old_timeout = timeout; */
-/* OBSOLETE */
-/* OBSOLETE status->kind = TARGET_WAITKIND_EXITED; */
-/* OBSOLETE status->value.integer = 0; */
-/* OBSOLETE */
-/* OBSOLETE if (need_artificial_trap != 0) */
-/* OBSOLETE { */
-/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */
-/* OBSOLETE status->value.sig = TARGET_SIGNAL_TRAP; */
-/* OBSOLETE need_artificial_trap--; */
-/* OBSOLETE return 0; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE timeout = 0; /* Don't time out -- user program is running. */ */
-/* OBSOLETE while (1) */
-/* OBSOLETE { */
-/* OBSOLETE ch_handled = 0; */
-/* OBSOLETE ch = readchar (); */
-/* OBSOLETE if (ch == *bp) */
-/* OBSOLETE { */
-/* OBSOLETE bp++; */
-/* OBSOLETE if (*bp == '\0') */
-/* OBSOLETE break; */
-/* OBSOLETE ch_handled = 1; */
-/* OBSOLETE */
-/* OBSOLETE *swallowed_p++ = ch; */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE bp = bpt; */
-/* OBSOLETE */
-/* OBSOLETE if (ch == *ep || *ep == '?') */
-/* OBSOLETE { */
-/* OBSOLETE ep++; */
-/* OBSOLETE if (*ep == '\0') */
-/* OBSOLETE break; */
-/* OBSOLETE */
-/* OBSOLETE if (!ch_handled) */
-/* OBSOLETE *swallowed_p++ = ch; */
-/* OBSOLETE ch_handled = 1; */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE ep = exitmsg; */
-/* OBSOLETE */
-/* OBSOLETE if (!ch_handled) */
-/* OBSOLETE { */
-/* OBSOLETE char *p; */
-/* OBSOLETE */
-/* OBSOLETE /* Print out any characters which have been swallowed. */ */
-/* OBSOLETE for (p = swallowed; p < swallowed_p; ++p) */
-/* OBSOLETE putc (*p, stdout); */
-/* OBSOLETE swallowed_p = swallowed; */
-/* OBSOLETE */
-/* OBSOLETE putc (ch, stdout); */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE if (*bp == '\0') */
-/* OBSOLETE { */
-/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */
-/* OBSOLETE status->value.sig = TARGET_SIGNAL_TRAP; */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE { */
-/* OBSOLETE status->kind = TARGET_WAITKIND_EXITED; */
-/* OBSOLETE status->value.integer = 0; */
-/* OBSOLETE } */
-/* OBSOLETE timeout = old_timeout; */
-/* OBSOLETE */
-/* OBSOLETE return 0; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Return the name of register number REGNO */
-/* OBSOLETE in the form input and output by EBMON. */
-/* OBSOLETE */
-/* OBSOLETE Returns a pointer to a static buffer containing the answer. */ */
-/* OBSOLETE static char * */
-/* OBSOLETE get_reg_name (int regno) */
-/* OBSOLETE { */
-/* OBSOLETE static char buf[80]; */
-/* OBSOLETE if (regno >= GR96_REGNUM && regno < GR96_REGNUM + 32) */
-/* OBSOLETE sprintf (buf, "GR%03d", regno - GR96_REGNUM + 96); */
-/* OBSOLETE else if (regno >= LR0_REGNUM && regno < LR0_REGNUM + 128) */
-/* OBSOLETE sprintf (buf, "LR%03d", regno - LR0_REGNUM); */
-/* OBSOLETE else if (regno == Q_REGNUM) */
-/* OBSOLETE strcpy (buf, "SR131"); */
-/* OBSOLETE else if (regno >= BP_REGNUM && regno <= CR_REGNUM) */
-/* OBSOLETE sprintf (buf, "SR%03d", regno - BP_REGNUM + 133); */
-/* OBSOLETE else if (regno == ALU_REGNUM) */
-/* OBSOLETE strcpy (buf, "SR132"); */
-/* OBSOLETE else if (regno >= IPC_REGNUM && regno <= IPB_REGNUM) */
-/* OBSOLETE sprintf (buf, "SR%03d", regno - IPC_REGNUM + 128); */
-/* OBSOLETE else if (regno >= VAB_REGNUM && regno <= LRU_REGNUM) */
-/* OBSOLETE sprintf (buf, "SR%03d", regno - VAB_REGNUM); */
-/* OBSOLETE else if (regno == GR1_REGNUM) */
-/* OBSOLETE strcpy (buf, "GR001"); */
-/* OBSOLETE return buf; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Read the remote registers into the block REGS. */ */
-/* OBSOLETE */
-/* OBSOLETE static void */
-/* OBSOLETE eb_fetch_registers (void) */
-/* OBSOLETE { */
-/* OBSOLETE int reg_index; */
-/* OBSOLETE int regnum_index; */
-/* OBSOLETE char tempbuf[10]; */
-/* OBSOLETE int i; */
-/* OBSOLETE */
-/* OBSOLETE #if 0 */
-/* OBSOLETE /* This should not be necessary, because one is supposed to read the */
-/* OBSOLETE registers only when the inferior is stopped (at least with */
-/* OBSOLETE ptrace() and why not make it the same for remote?). */ */
-/* OBSOLETE /* ^A is the "normal character" used to make sure we are talking to EBMON */
-/* OBSOLETE and not to the program being debugged. */ */
-/* OBSOLETE write (eb_desc, "\001\n"); */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE #endif */
-/* OBSOLETE */
-/* OBSOLETE write (eb_desc, "dw gr96,gr127\n", 14); */
-/* OBSOLETE for (reg_index = 96, regnum_index = GR96_REGNUM; */
-/* OBSOLETE reg_index < 128; */
-/* OBSOLETE reg_index += 4, regnum_index += 4) */
-/* OBSOLETE { */
-/* OBSOLETE sprintf (tempbuf, "GR%03d ", reg_index); */
-/* OBSOLETE expect (tempbuf); */
-/* OBSOLETE get_hex_regs (4, regnum_index); */
-/* OBSOLETE expect ("\n"); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE for (i = 0; i < 128; i += 32) */
-/* OBSOLETE { */
-/* OBSOLETE /* The PC has a tendency to hang if we get these */
-/* OBSOLETE all in one fell swoop ("dw lr0,lr127"). */ */
-/* OBSOLETE sprintf (tempbuf, "dw lr%d\n", i); */
-/* OBSOLETE write (eb_desc, tempbuf, strlen (tempbuf)); */
-/* OBSOLETE for (reg_index = i, regnum_index = LR0_REGNUM + i; */
-/* OBSOLETE reg_index < i + 32; */
-/* OBSOLETE reg_index += 4, regnum_index += 4) */
-/* OBSOLETE { */
-/* OBSOLETE sprintf (tempbuf, "LR%03d ", reg_index); */
-/* OBSOLETE expect (tempbuf); */
-/* OBSOLETE get_hex_regs (4, regnum_index); */
-/* OBSOLETE expect ("\n"); */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE write (eb_desc, "dw sr133,sr133\n", 15); */
-/* OBSOLETE expect ("SR133 "); */
-/* OBSOLETE get_hex_regs (1, BP_REGNUM); */
-/* OBSOLETE expect ("\n"); */
-/* OBSOLETE */
-/* OBSOLETE write (eb_desc, "dw sr134,sr134\n", 15); */
-/* OBSOLETE expect ("SR134 "); */
-/* OBSOLETE get_hex_regs (1, FC_REGNUM); */
-/* OBSOLETE expect ("\n"); */
-/* OBSOLETE */
-/* OBSOLETE write (eb_desc, "dw sr135,sr135\n", 15); */
-/* OBSOLETE expect ("SR135 "); */
-/* OBSOLETE get_hex_regs (1, CR_REGNUM); */
-/* OBSOLETE expect ("\n"); */
-/* OBSOLETE */
-/* OBSOLETE write (eb_desc, "dw sr131,sr131\n", 15); */
-/* OBSOLETE expect ("SR131 "); */
-/* OBSOLETE get_hex_regs (1, Q_REGNUM); */
-/* OBSOLETE expect ("\n"); */
-/* OBSOLETE */
-/* OBSOLETE write (eb_desc, "dw sr0,sr14\n", 12); */
-/* OBSOLETE for (reg_index = 0, regnum_index = VAB_REGNUM; */
-/* OBSOLETE regnum_index <= LRU_REGNUM; */
-/* OBSOLETE regnum_index += 4, reg_index += 4) */
-/* OBSOLETE { */
-/* OBSOLETE sprintf (tempbuf, "SR%03d ", reg_index); */
-/* OBSOLETE expect (tempbuf); */
-/* OBSOLETE get_hex_regs (reg_index == 12 ? 3 : 4, regnum_index); */
-/* OBSOLETE expect ("\n"); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* There doesn't seem to be any way to get these. */ */
-/* OBSOLETE { */
-/* OBSOLETE int val = -1; */
-/* OBSOLETE supply_register (FPE_REGNUM, (char *) &val); */
-/* OBSOLETE supply_register (INTE_REGNUM, (char *) &val); */
-/* OBSOLETE supply_register (FPS_REGNUM, (char *) &val); */
-/* OBSOLETE supply_register (EXO_REGNUM, (char *) &val); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE write (eb_desc, "dw gr1,gr1\n", 11); */
-/* OBSOLETE expect ("GR001 "); */
-/* OBSOLETE get_hex_regs (1, GR1_REGNUM); */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Fetch register REGNO, or all registers if REGNO is -1. */
-/* OBSOLETE Returns errno value. */ */
-/* OBSOLETE void */
-/* OBSOLETE eb_fetch_register (int regno) */
-/* OBSOLETE { */
-/* OBSOLETE if (regno == -1) */
-/* OBSOLETE eb_fetch_registers (); */
-/* OBSOLETE else */
-/* OBSOLETE { */
-/* OBSOLETE char *name = get_reg_name (regno); */
-/* OBSOLETE fprintf (eb_stream, "dw %s,%s\n", name, name); */
-/* OBSOLETE expect (name); */
-/* OBSOLETE expect (" "); */
-/* OBSOLETE get_hex_regs (1, regno); */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE } */
-/* OBSOLETE return; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Store the remote registers from the contents of the block REGS. */ */
-/* OBSOLETE */
-/* OBSOLETE static void */
-/* OBSOLETE eb_store_registers (void) */
-/* OBSOLETE { */
-/* OBSOLETE int i, j; */
-/* OBSOLETE fprintf (eb_stream, "s gr1,%x\n", read_register (GR1_REGNUM)); */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE */
-/* OBSOLETE for (j = 0; j < 32; j += 16) */
-/* OBSOLETE { */
-/* OBSOLETE fprintf (eb_stream, "s gr%d,", j + 96); */
-/* OBSOLETE for (i = 0; i < 15; ++i) */
-/* OBSOLETE fprintf (eb_stream, "%x,", read_register (GR96_REGNUM + j + i)); */
-/* OBSOLETE fprintf (eb_stream, "%x\n", read_register (GR96_REGNUM + j + 15)); */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE for (j = 0; j < 128; j += 16) */
-/* OBSOLETE { */
-/* OBSOLETE fprintf (eb_stream, "s lr%d,", j); */
-/* OBSOLETE for (i = 0; i < 15; ++i) */
-/* OBSOLETE fprintf (eb_stream, "%x,", read_register (LR0_REGNUM + j + i)); */
-/* OBSOLETE fprintf (eb_stream, "%x\n", read_register (LR0_REGNUM + j + 15)); */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE fprintf (eb_stream, "s sr133,%x,%x,%x\n", read_register (BP_REGNUM), */
-/* OBSOLETE read_register (FC_REGNUM), read_register (CR_REGNUM)); */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE fprintf (eb_stream, "s sr131,%x\n", read_register (Q_REGNUM)); */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE fprintf (eb_stream, "s sr0,"); */
-/* OBSOLETE for (i = 0; i < 11; ++i) */
-/* OBSOLETE fprintf (eb_stream, "%x,", read_register (VAB_REGNUM + i)); */
-/* OBSOLETE fprintf (eb_stream, "%x\n", read_register (VAB_REGNUM + 11)); */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Store register REGNO, or all if REGNO == 0. */
-/* OBSOLETE Return errno value. */ */
-/* OBSOLETE void */
-/* OBSOLETE eb_store_register (int regno) */
-/* OBSOLETE { */
-/* OBSOLETE if (regno == -1) */
-/* OBSOLETE eb_store_registers (); */
-/* OBSOLETE else */
-/* OBSOLETE { */
-/* OBSOLETE char *name = get_reg_name (regno); */
-/* OBSOLETE fprintf (eb_stream, "s %s,%x\n", name, read_register (regno)); */
-/* OBSOLETE /* Setting GR1 changes the numbers of all the locals, so */
-/* OBSOLETE invalidate the register cache. Do this *after* calling */
-/* OBSOLETE read_register, because we want read_register to return the */
-/* OBSOLETE value that write_register has just stuffed into the registers */
-/* OBSOLETE array, not the value of the register fetched from the */
-/* OBSOLETE inferior. */ */
-/* OBSOLETE if (regno == GR1_REGNUM) */
-/* OBSOLETE registers_changed (); */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Get ready to modify the registers array. On machines which store */
-/* OBSOLETE individual registers, this doesn't need to do anything. On machines */
-/* OBSOLETE which store all the registers in one fell swoop, this makes sure */
-/* OBSOLETE that registers contains all the registers from the program being */
-/* OBSOLETE debugged. */ */
-/* OBSOLETE */
-/* OBSOLETE void */
-/* OBSOLETE eb_prepare_to_store (void) */
-/* OBSOLETE { */
-/* OBSOLETE /* Do nothing, since we can store individual regs */ */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Transfer LEN bytes between GDB address MYADDR and target address */
-/* OBSOLETE MEMADDR. If WRITE is non-zero, transfer them to the target, */
-/* OBSOLETE otherwise transfer them from the target. TARGET is unused. */
-/* OBSOLETE */
-/* OBSOLETE Returns the number of bytes transferred. */ */
-/* OBSOLETE */
-/* OBSOLETE int */
-/* OBSOLETE eb_xfer_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len, int write, */
-/* OBSOLETE struct mem_attrib *attrib ATTRIBUTE_UNUSED, */
-/* OBSOLETE struct target_ops *target ATTRIBUTE_UNUSED) */
-/* OBSOLETE { */
-/* OBSOLETE if (write) */
-/* OBSOLETE return eb_write_inferior_memory (memaddr, myaddr, len); */
-/* OBSOLETE else */
-/* OBSOLETE return eb_read_inferior_memory (memaddr, myaddr, len); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE void */
-/* OBSOLETE eb_files_info (void) */
-/* OBSOLETE { */
-/* OBSOLETE printf ("\tAttached to %s at %d baud and running program %s.\n", */
-/* OBSOLETE dev_name, baudrate, prog_name); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Copy LEN bytes of data from debugger memory at MYADDR */
-/* OBSOLETE to inferior's memory at MEMADDR. Returns length moved. */ */
-/* OBSOLETE int */
-/* OBSOLETE eb_write_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len) */
-/* OBSOLETE { */
-/* OBSOLETE int i; */
-/* OBSOLETE */
-/* OBSOLETE for (i = 0; i < len; i++) */
-/* OBSOLETE { */
-/* OBSOLETE if ((i % 16) == 0) */
-/* OBSOLETE fprintf (eb_stream, "sb %x,", memaddr + i); */
-/* OBSOLETE if ((i % 16) == 15 || i == len - 1) */
-/* OBSOLETE { */
-/* OBSOLETE fprintf (eb_stream, "%x\n", ((unsigned char *) myaddr)[i]); */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE fprintf (eb_stream, "%x,", ((unsigned char *) myaddr)[i]); */
-/* OBSOLETE } */
-/* OBSOLETE return len; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Read LEN bytes from inferior memory at MEMADDR. Put the result */
-/* OBSOLETE at debugger address MYADDR. Returns length moved. */ */
-/* OBSOLETE int */
-/* OBSOLETE eb_read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len) */
-/* OBSOLETE { */
-/* OBSOLETE int i; */
-/* OBSOLETE */
-/* OBSOLETE /* Number of bytes read so far. */ */
-/* OBSOLETE int count; */
-/* OBSOLETE */
-/* OBSOLETE /* Starting address of this pass. */ */
-/* OBSOLETE unsigned long startaddr; */
-/* OBSOLETE */
-/* OBSOLETE /* Number of bytes to read in this pass. */ */
-/* OBSOLETE int len_this_pass; */
-/* OBSOLETE */
-/* OBSOLETE /* Note that this code works correctly if startaddr is just less */
-/* OBSOLETE than UINT_MAX (well, really CORE_ADDR_MAX if there was such a */
-/* OBSOLETE thing). That is, something like */
-/* OBSOLETE eb_read_bytes (CORE_ADDR_MAX - 4, foo, 4) */
-/* OBSOLETE works--it never adds len to memaddr and gets 0. */ */
-/* OBSOLETE /* However, something like */
-/* OBSOLETE eb_read_bytes (CORE_ADDR_MAX - 3, foo, 4) */
-/* OBSOLETE doesn't need to work. Detect it and give up if there's an attempt */
-/* OBSOLETE to do that. */ */
-/* OBSOLETE if (((memaddr - 1) + len) < memaddr) */
-/* OBSOLETE { */
-/* OBSOLETE errno = EIO; */
-/* OBSOLETE return 0; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE startaddr = memaddr; */
-/* OBSOLETE count = 0; */
-/* OBSOLETE while (count < len) */
-/* OBSOLETE { */
-/* OBSOLETE len_this_pass = 16; */
-/* OBSOLETE if ((startaddr % 16) != 0) */
-/* OBSOLETE len_this_pass -= startaddr % 16; */
-/* OBSOLETE if (len_this_pass > (len - count)) */
-/* OBSOLETE len_this_pass = (len - count); */
-/* OBSOLETE */
-/* OBSOLETE fprintf (eb_stream, "db %x,%x\n", startaddr, */
-/* OBSOLETE (startaddr - 1) + len_this_pass); */
-/* OBSOLETE expect ("\n"); */
-/* OBSOLETE */
-/* OBSOLETE /* Look for 8 hex digits. */ */
-/* OBSOLETE i = 0; */
-/* OBSOLETE while (1) */
-/* OBSOLETE { */
-/* OBSOLETE if (isxdigit (readchar ())) */
-/* OBSOLETE ++i; */
-/* OBSOLETE else */
-/* OBSOLETE { */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE error ("Hex digit expected from remote system."); */
-/* OBSOLETE } */
-/* OBSOLETE if (i >= 8) */
-/* OBSOLETE break; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE expect (" "); */
-/* OBSOLETE */
-/* OBSOLETE for (i = 0; i < len_this_pass; i++) */
-/* OBSOLETE get_hex_byte (&myaddr[count++]); */
-/* OBSOLETE */
-/* OBSOLETE expect_prompt (); */
-/* OBSOLETE */
-/* OBSOLETE startaddr += len_this_pass; */
-/* OBSOLETE } */
-/* OBSOLETE return len; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE static void */
-/* OBSOLETE eb_kill (char *args, int from_tty) */
-/* OBSOLETE { */
-/* OBSOLETE return; /* Ignore attempts to kill target system */ */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Clean up when a program exits. */
-/* OBSOLETE */
-/* OBSOLETE The program actually lives on in the remote processor's RAM, and may be */
-/* OBSOLETE run again without a download. Don't leave it full of breakpoint */
-/* OBSOLETE instructions. */ */
-/* OBSOLETE */
-/* OBSOLETE void */
-/* OBSOLETE eb_mourn_inferior (void) */
-/* OBSOLETE { */
-/* OBSOLETE remove_breakpoints (); */
-/* OBSOLETE unpush_target (&eb_ops); */
-/* OBSOLETE generic_mourn_inferior (); /* Do all the proper things now */ */
-/* OBSOLETE } */
-/* OBSOLETE /* Define the target subroutine names */ */
-/* OBSOLETE */
-/* OBSOLETE struct target_ops eb_ops; */
-/* OBSOLETE */
-/* OBSOLETE static void */
-/* OBSOLETE init_eb_ops (void) */
-/* OBSOLETE { */
-/* OBSOLETE eb_ops.to_shortname = "amd-eb"; */
-/* OBSOLETE eb_ops.to_longname = "Remote serial AMD EBMON target"; */
-/* OBSOLETE eb_ops.to_doc = "Use a remote computer running EBMON connected by a serial line.\n\ */
-/* OBSOLETE Arguments are the name of the device for the serial line,\n\ */
-/* OBSOLETE the speed to connect at in bits per second, and the filename of the\n\ */
-/* OBSOLETE executable as it exists on the remote computer. For example,\n\ */
-/* OBSOLETE target amd-eb /dev/ttya 9600 demo", */
-/* OBSOLETE eb_ops.to_open = eb_open; */
-/* OBSOLETE eb_ops.to_close = eb_close; */
-/* OBSOLETE eb_ops.to_attach = 0; */
-/* OBSOLETE eb_ops.to_post_attach = NULL; */
-/* OBSOLETE eb_ops.to_require_attach = NULL; */
-/* OBSOLETE eb_ops.to_detach = eb_detach; */
-/* OBSOLETE eb_ops.to_require_detach = NULL; */
-/* OBSOLETE eb_ops.to_resume = eb_resume; */
-/* OBSOLETE eb_ops.to_wait = eb_wait; */
-/* OBSOLETE eb_ops.to_post_wait = NULL; */
-/* OBSOLETE eb_ops.to_fetch_registers = eb_fetch_register; */
-/* OBSOLETE eb_ops.to_store_registers = eb_store_register; */
-/* OBSOLETE eb_ops.to_prepare_to_store = eb_prepare_to_store; */
-/* OBSOLETE eb_ops.to_xfer_memory = eb_xfer_inferior_memory; */
-/* OBSOLETE eb_ops.to_files_info = eb_files_info; */
-/* OBSOLETE eb_ops.to_insert_breakpoint = 0; */
-/* OBSOLETE eb_ops.to_remove_breakpoint = 0; /* Breakpoints */ */
-/* OBSOLETE eb_ops.to_terminal_init = 0; */
-/* OBSOLETE eb_ops.to_terminal_inferior = 0; */
-/* OBSOLETE eb_ops.to_terminal_ours_for_output = 0; */
-/* OBSOLETE eb_ops.to_terminal_ours = 0; */
-/* OBSOLETE eb_ops.to_terminal_info = 0; /* Terminal handling */ */
-/* OBSOLETE eb_ops.to_kill = eb_kill; */
-/* OBSOLETE eb_ops.to_load = generic_load; /* load */ */
-/* OBSOLETE eb_ops.to_lookup_symbol = 0; /* lookup_symbol */ */
-/* OBSOLETE eb_ops.to_create_inferior = eb_create_inferior; */
-/* OBSOLETE eb_ops.to_post_startup_inferior = NULL; */
-/* OBSOLETE eb_ops.to_acknowledge_created_inferior = NULL; */
-/* OBSOLETE eb_ops.to_clone_and_follow_inferior = NULL; */
-/* OBSOLETE eb_ops.to_post_follow_inferior_by_clone = NULL; */
-/* OBSOLETE eb_ops.to_insert_fork_catchpoint = NULL; */
-/* OBSOLETE eb_ops.to_remove_fork_catchpoint = NULL; */
-/* OBSOLETE eb_ops.to_insert_vfork_catchpoint = NULL; */
-/* OBSOLETE eb_ops.to_remove_vfork_catchpoint = NULL; */
-/* OBSOLETE eb_ops.to_has_forked = NULL; */
-/* OBSOLETE eb_ops.to_has_vforked = NULL; */
-/* OBSOLETE eb_ops.to_can_follow_vfork_prior_to_exec = NULL; */
-/* OBSOLETE eb_ops.to_post_follow_vfork = NULL; */
-/* OBSOLETE eb_ops.to_insert_exec_catchpoint = NULL; */
-/* OBSOLETE eb_ops.to_remove_exec_catchpoint = NULL; */
-/* OBSOLETE eb_ops.to_has_execd = NULL; */
-/* OBSOLETE eb_ops.to_reported_exec_events_per_exec_call = NULL; */
-/* OBSOLETE eb_ops.to_has_exited = NULL; */
-/* OBSOLETE eb_ops.to_mourn_inferior = eb_mourn_inferior; */
-/* OBSOLETE eb_ops.to_can_run = 0; /* can_run */ */
-/* OBSOLETE eb_ops.to_notice_signals = 0; /* notice_signals */ */
-/* OBSOLETE eb_ops.to_thread_alive = 0; /* thread-alive */ */
-/* OBSOLETE eb_ops.to_stop = 0; /* to_stop */ */
-/* OBSOLETE eb_ops.to_pid_to_exec_file = NULL; */
-/* OBSOLETE eb_ops.to_stratum = process_stratum; */
-/* OBSOLETE eb_ops.DONT_USE = 0; /* next */ */
-/* OBSOLETE eb_ops.to_has_all_memory = 1; */
-/* OBSOLETE eb_ops.to_has_memory = 1; */
-/* OBSOLETE eb_ops.to_has_stack = 1; */
-/* OBSOLETE eb_ops.to_has_registers = 1; */
-/* OBSOLETE eb_ops.to_has_execution = 1; /* all mem, mem, stack, regs, exec */ */
-/* OBSOLETE eb_ops.to_sections = 0; /* sections */ */
-/* OBSOLETE eb_ops.to_sections_end = 0; /* sections end */ */
-/* OBSOLETE eb_ops.to_magic = OPS_MAGIC; /* Always the last thing */ */
-/* OBSOLETE }; */
-/* OBSOLETE */
-/* OBSOLETE void */
-/* OBSOLETE _initialize_remote_eb (void) */
-/* OBSOLETE { */
-/* OBSOLETE init_eb_ops (); */
-/* OBSOLETE add_target (&eb_ops); */
-/* OBSOLETE } */
diff --git a/gdb/remote-es.c b/gdb/remote-es.c
index dabbcd8..e489254 100644
--- a/gdb/remote-es.c
+++ b/gdb/remote-es.c
@@ -1616,7 +1616,7 @@ send (char *string)
{
if (kiodebug)
{
- fprintf (stderr, "Sending: %s\n", string);
+ fprintf_unfiltered (gdb_stderr, "Sending: %s\n", string);
}
serial_write (es1800_desc, string, strlen (string));
}
@@ -1663,7 +1663,7 @@ getmessage (char *buf, int len)
if (kiodebug)
{
- fprintf (stderr, "message received :%s\n", buf);
+ fprintf_unfiltered (gdb_stderr, "message received :%s\n", buf);
}
}
diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c
index 385b69a..a1df0eb 100644
--- a/gdb/remote-mips.c
+++ b/gdb/remote-mips.c
@@ -1495,7 +1495,7 @@ mips_initialize (void)
mips_request ('r', 0, 0, &err, mips_receive_wait, NULL);
set_current_frame (create_new_frame (read_fp (), read_pc ()));
- select_frame (get_current_frame (), 0);
+ select_frame (get_current_frame ());
}
/* Open a connection to the remote board. */
@@ -1621,7 +1621,7 @@ device is attached to the target board (e.g., /dev/ttya).\n"
registers_changed ();
stop_pc = read_pc ();
set_current_frame (create_new_frame (read_fp (), stop_pc));
- select_frame (get_current_frame (), 0);
+ select_frame (get_current_frame ());
print_stack_frame (selected_frame, -1, 1);
xfree (serial_port_name);
}
diff --git a/gdb/remote-mm.c b/gdb/remote-mm.c
deleted file mode 100644
index 1cd630e..0000000
--- a/gdb/remote-mm.c
+++ /dev/null
@@ -1,1848 +0,0 @@
-/* OBSOLETE /* Remote debugging interface for Am290*0 running MiniMON monitor, for GDB. */
-/* OBSOLETE Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, */
-/* OBSOLETE 2001 Free Software Foundation, Inc. */
-/* OBSOLETE Originally written by Daniel Mann at AMD. */
-/* 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. */ */
-/* OBSOLETE */
-/* OBSOLETE /* This is like remote.c but ecpects MiniMON to be running on the Am29000 */
-/* OBSOLETE target hardware. */
-/* OBSOLETE - David Wood (wood@lab.ultra.nyu.edu) at New York University adapted this */
-/* OBSOLETE file to gdb 3.95. I was unable to get this working on sun3os4 */
-/* OBSOLETE with termio, only with sgtty. Because we are only attempting to */
-/* OBSOLETE use this module to debug our kernel, which is already loaded when */
-/* OBSOLETE gdb is started up, I did not code up the file downloading facilities. */
-/* OBSOLETE As a result this module has only the stubs to download files. */
-/* OBSOLETE You should get tagged at compile time if you need to make any */
-/* OBSOLETE changes/additions. */ */
-/* OBSOLETE */
-/* OBSOLETE #include "defs.h" */
-/* OBSOLETE #include "inferior.h" */
-/* OBSOLETE #include "value.h" */
-/* OBSOLETE #include <ctype.h> */
-/* OBSOLETE #include <fcntl.h> */
-/* OBSOLETE #include <signal.h> */
-/* OBSOLETE #include <errno.h> */
-/* OBSOLETE #include "gdb_string.h" */
-/* OBSOLETE #include "terminal.h" */
-/* OBSOLETE #include "minimon.h" */
-/* OBSOLETE #include "target.h" */
-/* OBSOLETE #include "regcache.h" */
-/* OBSOLETE */
-/* OBSOLETE /* Offset of member MEMBER in a struct of type TYPE. */ */
-/* OBSOLETE #define offsetof(TYPE, MEMBER) ((int) &((TYPE *)0)->MEMBER) */
-/* OBSOLETE */
-/* OBSOLETE #define DRAIN_INPUT() (msg_recv_serial((union msg_t*)0)) */
-/* OBSOLETE */
-/* OBSOLETE extern int stop_soon_quietly; /* for wait_for_inferior */ */
-/* OBSOLETE */
-/* OBSOLETE static void mm_resume (ptid_t ptid, int step, enum target_signal sig) */
-/* OBSOLETE static void mm_fetch_registers (); */
-/* OBSOLETE static int fetch_register (); */
-/* OBSOLETE static void mm_store_registers (); */
-/* OBSOLETE static int store_register (); */
-/* OBSOLETE static int regnum_to_srnum (); */
-/* OBSOLETE static void mm_close (); */
-/* OBSOLETE static char *msg_str (); */
-/* OBSOLETE static char *error_msg_str (); */
-/* OBSOLETE static int expect_msg (); */
-/* OBSOLETE static void init_target_mm (); */
-/* OBSOLETE static int mm_memory_space (); */
-/* OBSOLETE */
-/* OBSOLETE #define FREEZE_MODE (read_register(CPS_REGNUM) && 0x400) */
-/* OBSOLETE #define USE_SHADOW_PC ((processor_type == a29k_freeze_mode) && FREEZE_MODE) */
-/* OBSOLETE */
-/* OBSOLETE /* FIXME: Replace with `set remotedebug'. */ */
-/* OBSOLETE #define LLOG_FILE "minimon.log" */
-/* OBSOLETE #if defined (LOG_FILE) */
-/* OBSOLETE FILE *log_file; */
-/* OBSOLETE #endif */
-/* OBSOLETE */
-/* OBSOLETE /* */
-/* OBSOLETE * Size of message buffers. I couldn't get memory reads to work when */
-/* OBSOLETE * the byte_count was larger than 512 (it may be a baud rate problem). */
-/* OBSOLETE */ */
-/* OBSOLETE #define BUFER_SIZE 512 */
-/* OBSOLETE /* */
-/* OBSOLETE * Size of data area in message buffer on the TARGET (remote system). */
-/* OBSOLETE */ */
-/* OBSOLETE #define MAXDATA_T (target_config.max_msg_size - \ */
-/* OBSOLETE offsetof(struct write_r_msg_t,data[0])) */
-/* OBSOLETE /* */
-/* OBSOLETE * Size of data area in message buffer on the HOST (gdb). */
-/* OBSOLETE */ */
-/* OBSOLETE #define MAXDATA_H (BUFER_SIZE - offsetof(struct write_r_msg_t,data[0])) */
-/* OBSOLETE /* */
-/* OBSOLETE * Defined as the minimum size of data areas of the two message buffers */
-/* OBSOLETE */ */
-/* OBSOLETE #define MAXDATA (MAXDATA_H < MAXDATA_T ? MAXDATA_H : MAXDATA_T) */
-/* OBSOLETE */
-/* OBSOLETE static char out_buf[BUFER_SIZE]; */
-/* OBSOLETE static char in_buf[BUFER_SIZE]; */
-/* OBSOLETE */
-/* OBSOLETE int msg_recv_serial (); */
-/* OBSOLETE int msg_send_serial (); */
-/* OBSOLETE */
-/* OBSOLETE #define MAX_RETRIES 5000 */
-/* OBSOLETE extern struct target_ops mm_ops; /* Forward declaration */ */
-/* OBSOLETE struct config_msg_t target_config; /* HIF needs this */ */
-/* OBSOLETE union msg_t *out_msg_buf = (union msg_t *) out_buf; */
-/* OBSOLETE union msg_t *in_msg_buf = (union msg_t *) in_buf; */
-/* OBSOLETE */
-/* OBSOLETE static int timeout = 5; */
-/* OBSOLETE */
-/* OBSOLETE /* Descriptor for I/O to remote machine. Initialize it to -1 so that */
-/* OBSOLETE mm_open knows that we don't have a file open when the program */
-/* OBSOLETE starts. */ */
-/* OBSOLETE int mm_desc = -1; */
-/* OBSOLETE */
-/* OBSOLETE /* stream which is fdopen'd from mm_desc. Only valid when */
-/* OBSOLETE mm_desc != -1. */ */
-/* OBSOLETE FILE *mm_stream; */
-/* OBSOLETE */
-/* OBSOLETE /* Called when SIGALRM signal sent due to alarm() timeout. */ */
-/* OBSOLETE #ifndef HAVE_TERMIO */
-/* OBSOLETE */
-/* OBSOLETE volatile int n_alarms; */
-/* OBSOLETE */
-/* OBSOLETE static void */
-/* OBSOLETE mm_timer (void) */
-/* OBSOLETE { */
-/* OBSOLETE #if 0 */
-/* OBSOLETE if (kiodebug) */
-/* OBSOLETE printf ("mm_timer called\n"); */
-/* OBSOLETE #endif */
-/* OBSOLETE n_alarms++; */
-/* OBSOLETE } */
-/* OBSOLETE #endif /* HAVE_TERMIO */ */
-/* OBSOLETE */
-/* OBSOLETE /* malloc'd name of the program on the remote system. */ */
-/* OBSOLETE static char *prog_name = NULL; */
-/* OBSOLETE */
-/* OBSOLETE */
-/* OBSOLETE /* Number of SIGTRAPs we need to simulate. That is, the next */
-/* OBSOLETE NEED_ARTIFICIAL_TRAP calls to mm_wait should just return */
-/* OBSOLETE SIGTRAP without actually waiting for anything. */ */
-/* OBSOLETE */
-/* OBSOLETE /**************************************************** REMOTE_CREATE_INFERIOR */ */
-/* OBSOLETE /* This is called not only when we first attach, but also when the */
-/* OBSOLETE user types "run" after having attached. */ */
-/* OBSOLETE static void */
-/* OBSOLETE mm_create_inferior (char *execfile, char *args, char **env) */
-/* OBSOLETE { */
-/* OBSOLETE #define MAX_TOKENS 25 */
-/* OBSOLETE #define BUFFER_SIZE 256 */
-/* OBSOLETE int token_count; */
-/* OBSOLETE int result; */
-/* OBSOLETE char *token[MAX_TOKENS]; */
-/* OBSOLETE char cmd_line[BUFFER_SIZE]; */
-/* OBSOLETE */
-/* OBSOLETE if (args && *args) */
-/* OBSOLETE error ("Can't pass arguments to remote mm process (yet)."); */
-/* OBSOLETE */
-/* OBSOLETE if (execfile == 0 /* || exec_bfd == 0 */ ) */
-/* OBSOLETE error ("No executable file specified"); */
-/* OBSOLETE */
-/* OBSOLETE if (!mm_stream) */
-/* OBSOLETE { */
-/* OBSOLETE printf ("Minimon not open yet.\n"); */
-/* OBSOLETE return; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* On ultra3 (NYU) we assume the kernel is already running so there is */
-/* OBSOLETE no file to download. */
-/* OBSOLETE FIXME: Fixed required here -> load your program, possibly with mm_load(). */
-/* OBSOLETE */ */
-/* OBSOLETE printf_filtered ("\n\ */
-/* OBSOLETE Assuming you are at NYU debuging a kernel, i.e., no need to download.\n\n"); */
-/* OBSOLETE */
-/* OBSOLETE /* We will get a task spawn event immediately. */ */
-/* OBSOLETE init_wait_for_inferior (); */
-/* OBSOLETE clear_proceed_status (); */
-/* OBSOLETE stop_soon_quietly = 1; */
-/* OBSOLETE proceed (-1, TARGET_SIGNAL_DEFAULT, 0); */
-/* OBSOLETE normal_stop (); */
-/* OBSOLETE } */
-/* OBSOLETE /**************************************************** REMOTE_MOURN_INFERIOR */ */
-/* OBSOLETE static void */
-/* OBSOLETE mm_mourn (void) */
-/* OBSOLETE { */
-/* OBSOLETE pop_target (); /* Pop back to no-child state */ */
-/* OBSOLETE generic_mourn_inferior (); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /********************************************************************** damn_b */
-/* OBSOLETE */ */
-/* OBSOLETE /* Translate baud rates from integers to damn B_codes. Unix should */
-/* OBSOLETE have outgrown this crap years ago, but even POSIX wouldn't buck it. */ */
-/* OBSOLETE */
-/* OBSOLETE #ifndef B19200 */
-/* OBSOLETE #define B19200 EXTA */
-/* OBSOLETE #endif */
-/* OBSOLETE #ifndef B38400 */
-/* OBSOLETE #define B38400 EXTB */
-/* OBSOLETE #endif */
-/* OBSOLETE */
-/* OBSOLETE static struct */
-/* OBSOLETE { */
-/* OBSOLETE int rate, damn_b; */
-/* OBSOLETE } */
-/* OBSOLETE baudtab[] = */
-/* OBSOLETE { */
-/* OBSOLETE { */
-/* OBSOLETE 0, B0 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE 50, B50 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE 75, B75 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE 110, B110 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE 134, B134 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE 150, B150 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE 200, B200 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE 300, B300 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE 600, B600 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE 1200, B1200 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE 1800, B1800 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE 2400, B2400 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE 4800, B4800 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE 9600, B9600 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE 19200, B19200 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE 38400, B38400 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE { */
-/* OBSOLETE -1, -1 */
-/* OBSOLETE } */
-/* OBSOLETE , */
-/* OBSOLETE }; */
-/* OBSOLETE */
-/* OBSOLETE static int */
-/* OBSOLETE damn_b (int rate) */
-/* OBSOLETE { */
-/* OBSOLETE int i; */
-/* OBSOLETE */
-/* OBSOLETE for (i = 0; baudtab[i].rate != -1; i++) */
-/* OBSOLETE if (rate == baudtab[i].rate) */
-/* OBSOLETE return baudtab[i].damn_b; */
-/* OBSOLETE return B38400; /* Random */ */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE */
-/* OBSOLETE /***************************************************************** REMOTE_OPEN */
-/* OBSOLETE ** Open a connection to remote minimon. */
-/* OBSOLETE NAME is the filename used for communication, then a space, */
-/* OBSOLETE then the baud rate. */
-/* OBSOLETE 'target adapt /dev/ttya 9600 [prognam]' for example. */
-/* OBSOLETE */ */
-/* OBSOLETE */
-/* OBSOLETE static char *dev_name; */
-/* OBSOLETE int baudrate = 9600; */
-/* OBSOLETE static void */
-/* OBSOLETE mm_open (char *name, int from_tty) */
-/* OBSOLETE { */
-/* OBSOLETE TERMINAL sg; */
-/* OBSOLETE unsigned int prl; */
-/* OBSOLETE char *p; */
-/* OBSOLETE */
-/* OBSOLETE /* Find the first whitespace character, it separates dev_name from */
-/* OBSOLETE prog_name. */ */
-/* OBSOLETE for (p = name; */
-/* OBSOLETE p && *p && !isspace (*p); p++) */
-/* OBSOLETE ; */
-/* OBSOLETE if (p == 0 || *p == '\0') */
-/* OBSOLETE erroid: */
-/* OBSOLETE error ("Usage : <command> <serial-device> <baud-rate> [progname]"); */
-/* OBSOLETE dev_name = (char *) xmalloc (p - name + 1); */
-/* OBSOLETE strncpy (dev_name, name, p - name); */
-/* OBSOLETE dev_name[p - name] = '\0'; */
-/* OBSOLETE */
-/* OBSOLETE /* Skip over the whitespace after dev_name */ */
-/* OBSOLETE for (; isspace (*p); p++) */
-/* OBSOLETE /*EMPTY */ ; */
-/* OBSOLETE */
-/* OBSOLETE if (1 != sscanf (p, "%d ", &baudrate)) */
-/* OBSOLETE goto erroid; */
-/* OBSOLETE */
-/* OBSOLETE /* Skip the number and then the spaces */ */
-/* OBSOLETE for (; isdigit (*p); p++) */
-/* OBSOLETE /*EMPTY */ ; */
-/* OBSOLETE for (; isspace (*p); p++) */
-/* OBSOLETE /*EMPTY */ ; */
-/* OBSOLETE */
-/* OBSOLETE if (prog_name != NULL) */
-/* OBSOLETE xfree (prog_name); */
-/* OBSOLETE prog_name = savestring (p, strlen (p)); */
-/* OBSOLETE */
-/* OBSOLETE */
-/* OBSOLETE if (mm_desc >= 0) */
-/* OBSOLETE close (mm_desc); */
-/* OBSOLETE */
-/* OBSOLETE mm_desc = open (dev_name, O_RDWR); */
-/* OBSOLETE if (mm_desc < 0) */
-/* OBSOLETE perror_with_name (dev_name); */
-/* OBSOLETE ioctl (mm_desc, TIOCGETP, &sg); */
-/* OBSOLETE #ifdef HAVE_TERMIO */
-/* OBSOLETE sg.c_cc[VMIN] = 0; /* read with timeout. */ */
-/* OBSOLETE sg.c_cc[VTIME] = timeout * 10; */
-/* OBSOLETE sg.c_lflag &= ~(ICANON | ECHO); */
-/* OBSOLETE sg.c_cflag = (sg.c_cflag & ~CBAUD) | damn_b (baudrate); */
-/* OBSOLETE #else */
-/* OBSOLETE sg.sg_ispeed = damn_b (baudrate); */
-/* OBSOLETE sg.sg_ospeed = damn_b (baudrate); */
-/* OBSOLETE sg.sg_flags |= RAW; */
-/* OBSOLETE sg.sg_flags |= ANYP; */
-/* OBSOLETE sg.sg_flags &= ~ECHO; */
-/* OBSOLETE #endif */
-/* OBSOLETE */
-/* OBSOLETE */
-/* OBSOLETE ioctl (mm_desc, TIOCSETP, &sg); */
-/* OBSOLETE mm_stream = fdopen (mm_desc, "r+"); */
-/* OBSOLETE */
-/* OBSOLETE push_target (&mm_ops); */
-/* OBSOLETE */
-/* OBSOLETE #ifndef HAVE_TERMIO */
-/* OBSOLETE #ifndef NO_SIGINTERRUPT */
-/* OBSOLETE /* Cause SIGALRM's to make reads fail with EINTR instead of resuming */
-/* OBSOLETE the read. */ */
-/* OBSOLETE if (siginterrupt (SIGALRM, 1) != 0) */
-/* OBSOLETE perror ("mm_open: error in siginterrupt"); */
-/* OBSOLETE #endif */
-/* OBSOLETE */
-/* OBSOLETE /* Set up read timeout timer. */ */
-/* OBSOLETE if ((void (*)) signal (SIGALRM, mm_timer) == (void (*)) -1) */
-/* OBSOLETE perror ("mm_open: error in signal"); */
-/* OBSOLETE #endif */
-/* OBSOLETE */
-/* OBSOLETE #if defined (LOG_FILE) */
-/* OBSOLETE log_file = fopen (LOG_FILE, "w"); */
-/* OBSOLETE if (log_file == NULL) */
-/* OBSOLETE perror_with_name (LOG_FILE); */
-/* OBSOLETE #endif */
-/* OBSOLETE /* */
-/* OBSOLETE ** Initialize target configuration structure (global) */
-/* OBSOLETE */ */
-/* OBSOLETE DRAIN_INPUT (); */
-/* OBSOLETE out_msg_buf->config_req_msg.code = CONFIG_REQ; */
-/* OBSOLETE out_msg_buf->config_req_msg.length = 4 * 0; */
-/* OBSOLETE msg_send_serial (out_msg_buf); /* send config request message */ */
-/* OBSOLETE */
-/* OBSOLETE expect_msg (CONFIG, in_msg_buf, 1); */
-/* OBSOLETE */
-/* OBSOLETE a29k_get_processor_type (); */
-/* OBSOLETE */
-/* OBSOLETE /* Print out some stuff, letting the user now what's going on */ */
-/* OBSOLETE printf_filtered ("Connected to MiniMon via %s.\n", dev_name); */
-/* OBSOLETE /* FIXME: can this restriction be removed? */ */
-/* OBSOLETE printf_filtered ("Remote debugging using virtual addresses works only\n"); */
-/* OBSOLETE printf_filtered ("\twhen virtual addresses map 1:1 to physical addresses.\n") */
-/* OBSOLETE ; */
-/* OBSOLETE if (processor_type != a29k_freeze_mode) */
-/* OBSOLETE { */
-/* OBSOLETE fprintf_filtered (gdb_stderr, */
-/* OBSOLETE "Freeze-mode debugging not available, and can only be done on an A29050.\n"); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE target_config.code = CONFIG; */
-/* OBSOLETE target_config.length = 0; */
-/* OBSOLETE target_config.processor_id = in_msg_buf->config_msg.processor_id; */
-/* OBSOLETE target_config.version = in_msg_buf->config_msg.version; */
-/* OBSOLETE target_config.I_mem_start = in_msg_buf->config_msg.I_mem_start; */
-/* OBSOLETE target_config.I_mem_size = in_msg_buf->config_msg.I_mem_size; */
-/* OBSOLETE target_config.D_mem_start = in_msg_buf->config_msg.D_mem_start; */
-/* OBSOLETE target_config.D_mem_size = in_msg_buf->config_msg.D_mem_size; */
-/* OBSOLETE target_config.ROM_start = in_msg_buf->config_msg.ROM_start; */
-/* OBSOLETE target_config.ROM_size = in_msg_buf->config_msg.ROM_size; */
-/* OBSOLETE target_config.max_msg_size = in_msg_buf->config_msg.max_msg_size; */
-/* OBSOLETE target_config.max_bkpts = in_msg_buf->config_msg.max_bkpts; */
-/* OBSOLETE target_config.coprocessor = in_msg_buf->config_msg.coprocessor; */
-/* OBSOLETE target_config.reserved = in_msg_buf->config_msg.reserved; */
-/* OBSOLETE if (from_tty) */
-/* OBSOLETE { */
-/* OBSOLETE printf ("Connected to MiniMON :\n"); */
-/* OBSOLETE printf (" Debugcore version %d.%d\n", */
-/* OBSOLETE 0x0f & (target_config.version >> 4), */
-/* OBSOLETE 0x0f & (target_config.version)); */
-/* OBSOLETE printf (" Configuration version %d.%d\n", */
-/* OBSOLETE 0x0f & (target_config.version >> 12), */
-/* OBSOLETE 0x0f & (target_config.version >> 8)); */
-/* OBSOLETE printf (" Message system version %d.%d\n", */
-/* OBSOLETE 0x0f & (target_config.version >> 20), */
-/* OBSOLETE 0x0f & (target_config.version >> 16)); */
-/* OBSOLETE printf (" Communication driver version %d.%d\n", */
-/* OBSOLETE 0x0f & (target_config.version >> 28), */
-/* OBSOLETE 0x0f & (target_config.version >> 24)); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Leave the target running... */
-/* OBSOLETE * The above message stopped the target in the dbg core (MiniMon), */
-/* OBSOLETE * so restart the target out of MiniMon, */
-/* OBSOLETE */ */
-/* OBSOLETE out_msg_buf->go_msg.code = GO; */
-/* OBSOLETE out_msg_buf->go_msg.length = 0; */
-/* OBSOLETE msg_send_serial (out_msg_buf); */
-/* OBSOLETE /* No message to expect after a GO */ */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /**************************************************************** REMOTE_CLOSE */
-/* OBSOLETE ** Close the open connection to the minimon debugger. */
-/* OBSOLETE Use this when you want to detach and do something else */
-/* OBSOLETE with your gdb. */ */
-/* OBSOLETE static void */
-/* OBSOLETE mm_close ( /*FIXME: how is quitting used */ */
-/* OBSOLETE int quitting) */
-/* OBSOLETE { */
-/* OBSOLETE if (mm_desc < 0) */
-/* OBSOLETE error ("Can't close remote connection: not debugging remotely."); */
-/* OBSOLETE */
-/* OBSOLETE /* We should never get here if there isn't something valid in */
-/* OBSOLETE mm_desc and mm_stream. */
-/* OBSOLETE */
-/* OBSOLETE Due to a bug in Unix, fclose closes not only the stdio stream, */
-/* OBSOLETE but also the file descriptor. So we don't actually close */
-/* OBSOLETE mm_desc. */ */
-/* OBSOLETE DRAIN_INPUT (); */
-/* OBSOLETE fclose (mm_stream); */
-/* OBSOLETE /* close (mm_desc); */ */
-/* OBSOLETE */
-/* OBSOLETE /* Do not try to close mm_desc again, later in the program. */ */
-/* OBSOLETE mm_stream = NULL; */
-/* OBSOLETE mm_desc = -1; */
-/* OBSOLETE */
-/* OBSOLETE #if defined (LOG_FILE) */
-/* OBSOLETE if (ferror (log_file)) */
-/* OBSOLETE printf ("Error writing log file.\n"); */
-/* OBSOLETE if (fclose (log_file) != 0) */
-/* OBSOLETE printf ("Error closing log file.\n"); */
-/* OBSOLETE #endif */
-/* OBSOLETE */
-/* OBSOLETE printf ("Ending remote debugging\n"); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /************************************************************* REMOTE_ATACH */ */
-/* OBSOLETE /* Attach to a program that is already loaded and running */
-/* OBSOLETE * Upon exiting the process's execution is stopped. */
-/* OBSOLETE */ */
-/* OBSOLETE static void */
-/* OBSOLETE mm_attach (char *args, int from_tty) */
-/* OBSOLETE { */
-/* OBSOLETE */
-/* OBSOLETE if (!mm_stream) */
-/* OBSOLETE error ("MiniMon not opened yet, use the 'target minimon' command.\n"); */
-/* OBSOLETE */
-/* OBSOLETE if (from_tty) */
-/* OBSOLETE printf ("Attaching to remote program %s...\n", prog_name); */
-/* OBSOLETE */
-/* OBSOLETE /* Make sure the target is currently running, it is supposed to be. */ */
-/* OBSOLETE /* FIXME: is it ok to send MiniMon a BREAK if it is already stopped in */
-/* OBSOLETE * the dbg core. If so, we don't need to send this GO. */
-/* OBSOLETE */ */
-/* OBSOLETE out_msg_buf->go_msg.code = GO; */
-/* OBSOLETE out_msg_buf->go_msg.length = 0; */
-/* OBSOLETE msg_send_serial (out_msg_buf); */
-/* OBSOLETE sleep (2); /* At the worst it will stop, receive a message, continue */ */
-/* OBSOLETE */
-/* OBSOLETE /* Send the mm a break. */ */
-/* OBSOLETE out_msg_buf->break_msg.code = BREAK; */
-/* OBSOLETE out_msg_buf->break_msg.length = 0; */
-/* OBSOLETE msg_send_serial (out_msg_buf); */
-/* OBSOLETE } */
-/* OBSOLETE /********************************************************** REMOTE_DETACH */ */
-/* OBSOLETE /* Terminate the open connection to the remote debugger. */
-/* OBSOLETE Use this when you want to detach and do something else */
-/* OBSOLETE with your gdb. Leave remote process running (with no breakpoints set). */ */
-/* OBSOLETE static void */
-/* OBSOLETE mm_detach (char *args, int from_tty) */
-/* OBSOLETE { */
-/* OBSOLETE remove_breakpoints (); /* Just in case there were any left in */ */
-/* OBSOLETE out_msg_buf->go_msg.code = GO; */
-/* OBSOLETE out_msg_buf->go_msg.length = 0; */
-/* OBSOLETE msg_send_serial (out_msg_buf); */
-/* OBSOLETE pop_target (); /* calls mm_close to do the real work */ */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE */
-/* OBSOLETE /*************************************************************** REMOTE_RESUME */
-/* OBSOLETE ** Tell the remote machine to resume. */ */
-/* OBSOLETE */
-/* OBSOLETE static void */
-/* OBSOLETE mm_resume (ptid_t ptid, int step, enum target_signal sig) */
-/* OBSOLETE { */
-/* OBSOLETE if (sig != TARGET_SIGNAL_0) */
-/* OBSOLETE warning ("Can't send signals to a remote MiniMon system."); */
-/* OBSOLETE */
-/* OBSOLETE if (step) */
-/* OBSOLETE { */
-/* OBSOLETE out_msg_buf->step_msg.code = STEP; */
-/* OBSOLETE out_msg_buf->step_msg.length = 1 * 4; */
-/* OBSOLETE out_msg_buf->step_msg.count = 1; /* step 1 instruction */ */
-/* OBSOLETE msg_send_serial (out_msg_buf); */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE { */
-/* OBSOLETE out_msg_buf->go_msg.code = GO; */
-/* OBSOLETE out_msg_buf->go_msg.length = 0; */
-/* OBSOLETE msg_send_serial (out_msg_buf); */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /***************************************************************** REMOTE_WAIT */
-/* OBSOLETE ** Wait until the remote machine stops, then return, */
-/* OBSOLETE storing status in STATUS just as `wait' would. */ */
-/* OBSOLETE */
-/* OBSOLETE static ptid_t */
-/* OBSOLETE mm_wait (ptid_t ptid, struct target_waitstatus *status) */
-/* OBSOLETE { */
-/* OBSOLETE int i, result; */
-/* OBSOLETE int old_timeout = timeout; */
-/* OBSOLETE int old_immediate_quit = immediate_quit; */
-/* OBSOLETE */
-/* OBSOLETE status->kind = TARGET_WAITKIND_EXITED; */
-/* OBSOLETE status->value.integer = 0; */
-/* OBSOLETE */
-/* OBSOLETE /* wait for message to arrive. It should be: */
-/* OBSOLETE - A HIF service request. */
-/* OBSOLETE - A HIF exit service request. */
-/* OBSOLETE - A CHANNEL0_ACK. */
-/* OBSOLETE - A CHANNEL1 request. */
-/* OBSOLETE - a debugcore HALT message. */
-/* OBSOLETE HIF services must be responded too, and while-looping continued. */
-/* OBSOLETE If the target stops executing, mm_wait() should return. */
-/* OBSOLETE */ */
-/* OBSOLETE timeout = 0; /* Wait indefinetly for a message */ */
-/* OBSOLETE immediate_quit = 1; /* Helps ability to QUIT */ */
-/* OBSOLETE while (1) */
-/* OBSOLETE { */
-/* OBSOLETE while (msg_recv_serial (in_msg_buf)) */
-/* OBSOLETE { */
-/* OBSOLETE QUIT; /* Let user quit if they want */ */
-/* OBSOLETE } */
-/* OBSOLETE switch (in_msg_buf->halt_msg.code) */
-/* OBSOLETE { */
-/* OBSOLETE case HIF_CALL: */
-/* OBSOLETE i = in_msg_buf->hif_call_rtn_msg.service_number; */
-/* OBSOLETE result = service_HIF (in_msg_buf); */
-/* OBSOLETE if (i == 1) /* EXIT */ */
-/* OBSOLETE goto exit; */
-/* OBSOLETE if (result) */
-/* OBSOLETE printf ("Warning: failure during HIF service %d\n", i); */
-/* OBSOLETE break; */
-/* OBSOLETE case CHANNEL0_ACK: */
-/* OBSOLETE service_HIF (in_msg_buf); */
-/* OBSOLETE break; */
-/* OBSOLETE case CHANNEL1: */
-/* OBSOLETE i = in_msg_buf->channel1_msg.length; */
-/* OBSOLETE in_msg_buf->channel1_msg.data[i] = '\0'; */
-/* OBSOLETE printf ("%s", in_msg_buf->channel1_msg.data); */
-/* OBSOLETE gdb_flush (gdb_stdout); */
-/* OBSOLETE /* Send CHANNEL1_ACK message */ */
-/* OBSOLETE out_msg_buf->channel1_ack_msg.code = CHANNEL1_ACK; */
-/* OBSOLETE out_msg_buf->channel1_ack_msg.length = 0; */
-/* OBSOLETE result = msg_send_serial (out_msg_buf); */
-/* OBSOLETE break; */
-/* OBSOLETE case HALT: */
-/* OBSOLETE goto halted; */
-/* OBSOLETE default: */
-/* OBSOLETE goto halted; */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE halted: */
-/* OBSOLETE /* FIXME, these printfs should not be here. This is a source level */
-/* OBSOLETE debugger, guys! */ */
-/* OBSOLETE if (in_msg_buf->halt_msg.trap_number == 0) */
-/* OBSOLETE { */
-/* OBSOLETE printf ("Am290*0 received vector number %d (break point)\n", */
-/* OBSOLETE in_msg_buf->halt_msg.trap_number); */
-/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */
-/* OBSOLETE status->value.sig = TARGET_SIGNAL_TRAP; */
-/* OBSOLETE } */
-/* OBSOLETE else if (in_msg_buf->halt_msg.trap_number == 1) */
-/* OBSOLETE { */
-/* OBSOLETE printf ("Am290*0 received vector number %d\n", */
-/* OBSOLETE in_msg_buf->halt_msg.trap_number); */
-/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */
-/* OBSOLETE status->value.sig = TARGET_SIGNAL_BUS; */
-/* OBSOLETE } */
-/* OBSOLETE else if (in_msg_buf->halt_msg.trap_number == 3 */
-/* OBSOLETE || in_msg_buf->halt_msg.trap_number == 4) */
-/* OBSOLETE { */
-/* OBSOLETE printf ("Am290*0 received vector number %d\n", */
-/* OBSOLETE in_msg_buf->halt_msg.trap_number); */
-/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */
-/* OBSOLETE status->value.sig = TARGET_SIGNAL_FPE; */
-/* OBSOLETE } */
-/* OBSOLETE else if (in_msg_buf->halt_msg.trap_number == 5) */
-/* OBSOLETE { */
-/* OBSOLETE printf ("Am290*0 received vector number %d\n", */
-/* OBSOLETE in_msg_buf->halt_msg.trap_number); */
-/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */
-/* OBSOLETE status->value.sig = TARGET_SIGNAL_ILL; */
-/* OBSOLETE } */
-/* OBSOLETE else if (in_msg_buf->halt_msg.trap_number >= 6 */
-/* OBSOLETE && in_msg_buf->halt_msg.trap_number <= 11) */
-/* OBSOLETE { */
-/* OBSOLETE printf ("Am290*0 received vector number %d\n", */
-/* OBSOLETE in_msg_buf->halt_msg.trap_number); */
-/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */
-/* OBSOLETE status->value.sig = TARGET_SIGNAL_SEGV; */
-/* OBSOLETE } */
-/* OBSOLETE else if (in_msg_buf->halt_msg.trap_number == 12 */
-/* OBSOLETE || in_msg_buf->halt_msg.trap_number == 13) */
-/* OBSOLETE { */
-/* OBSOLETE printf ("Am290*0 received vector number %d\n", */
-/* OBSOLETE in_msg_buf->halt_msg.trap_number); */
-/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */
-/* OBSOLETE status->value.sig = TARGET_SIGNAL_ILL; */
-/* OBSOLETE } */
-/* OBSOLETE else if (in_msg_buf->halt_msg.trap_number == 14) */
-/* OBSOLETE { */
-/* OBSOLETE printf ("Am290*0 received vector number %d\n", */
-/* OBSOLETE in_msg_buf->halt_msg.trap_number); */
-/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */
-/* OBSOLETE status->value.sig = TARGET_SIGNAL_ALRM; */
-/* OBSOLETE } */
-/* OBSOLETE else if (in_msg_buf->halt_msg.trap_number == 15) */
-/* OBSOLETE { */
-/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */
-/* OBSOLETE status->value.sig = TARGET_SIGNAL_TRAP; */
-/* OBSOLETE } */
-/* OBSOLETE else if (in_msg_buf->halt_msg.trap_number >= 16 */
-/* OBSOLETE && in_msg_buf->halt_msg.trap_number <= 21) */
-/* OBSOLETE { */
-/* OBSOLETE printf ("Am290*0 received vector number %d\n", */
-/* OBSOLETE in_msg_buf->halt_msg.trap_number); */
-/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */
-/* OBSOLETE status->value.sig = TARGET_SIGNAL_INT; */
-/* OBSOLETE } */
-/* OBSOLETE else if (in_msg_buf->halt_msg.trap_number == 22) */
-/* OBSOLETE { */
-/* OBSOLETE printf ("Am290*0 received vector number %d\n", */
-/* OBSOLETE in_msg_buf->halt_msg.trap_number); */
-/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */
-/* OBSOLETE status->value.sig = TARGET_SIGNAL_ILL; */
-/* OBSOLETE } /* BREAK message was sent */ */
-/* OBSOLETE else if (in_msg_buf->halt_msg.trap_number == 75) */
-/* OBSOLETE { */
-/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */
-/* OBSOLETE status->value.sig = TARGET_SIGNAL_TRAP; */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE exit: */
-/* OBSOLETE { */
-/* OBSOLETE status->kind = TARGET_WAITKIND_EXITED; */
-/* OBSOLETE status->value.integer = 0; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE timeout = old_timeout; /* Restore original timeout value */ */
-/* OBSOLETE immediate_quit = old_immediate_quit; */
-/* OBSOLETE return inferior_ptid; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /******************************************************* REMOTE_FETCH_REGISTERS */
-/* OBSOLETE * Read a remote register 'regno'. */
-/* OBSOLETE * If regno==-1 then read all the registers. */
-/* OBSOLETE */ */
-/* OBSOLETE static void */
-/* OBSOLETE mm_fetch_registers (int regno) */
-/* OBSOLETE { */
-/* OBSOLETE INT32 *data_p; */
-/* OBSOLETE */
-/* OBSOLETE if (regno >= 0) */
-/* OBSOLETE { */
-/* OBSOLETE fetch_register (regno); */
-/* OBSOLETE return; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Gr1/rsp */ */
-/* OBSOLETE out_msg_buf->read_req_msg.byte_count = 4 * 1; */
-/* OBSOLETE out_msg_buf->read_req_msg.memory_space = GLOBAL_REG; */
-/* OBSOLETE out_msg_buf->read_req_msg.address = 1; */
-/* OBSOLETE msg_send_serial (out_msg_buf); */
-/* OBSOLETE expect_msg (READ_ACK, in_msg_buf, 1); */
-/* OBSOLETE data_p = &(in_msg_buf->read_r_ack_msg.data[0]); */
-/* OBSOLETE supply_register (GR1_REGNUM, data_p); */
-/* OBSOLETE */
-/* OBSOLETE #if defined(GR64_REGNUM) /* Read gr64-127 */ */
-/* OBSOLETE /* Global Registers gr64-gr95 */ */
-/* OBSOLETE out_msg_buf->read_req_msg.code = READ_REQ; */
-/* OBSOLETE out_msg_buf->read_req_msg.length = 4 * 3; */
-/* OBSOLETE out_msg_buf->read_req_msg.byte_count = 4 * 32; */
-/* OBSOLETE out_msg_buf->read_req_msg.memory_space = GLOBAL_REG; */
-/* OBSOLETE out_msg_buf->read_req_msg.address = 64; */
-/* OBSOLETE msg_send_serial (out_msg_buf); */
-/* OBSOLETE expect_msg (READ_ACK, in_msg_buf, 1); */
-/* OBSOLETE data_p = &(in_msg_buf->read_r_ack_msg.data[0]); */
-/* OBSOLETE */
-/* OBSOLETE for (regno = GR64_REGNUM; regno < GR64_REGNUM + 32; regno++) */
-/* OBSOLETE { */
-/* OBSOLETE supply_register (regno, data_p++); */
-/* OBSOLETE } */
-/* OBSOLETE #endif /* GR64_REGNUM */ */
-/* OBSOLETE */
-/* OBSOLETE /* Global Registers gr96-gr127 */ */
-/* OBSOLETE out_msg_buf->read_req_msg.code = READ_REQ; */
-/* OBSOLETE out_msg_buf->read_req_msg.length = 4 * 3; */
-/* OBSOLETE out_msg_buf->read_req_msg.byte_count = 4 * 32; */
-/* OBSOLETE out_msg_buf->read_req_msg.memory_space = GLOBAL_REG; */
-/* OBSOLETE out_msg_buf->read_req_msg.address = 96; */
-/* OBSOLETE msg_send_serial (out_msg_buf); */
-/* OBSOLETE expect_msg (READ_ACK, in_msg_buf, 1); */
-/* OBSOLETE data_p = &(in_msg_buf->read_r_ack_msg.data[0]); */
-/* OBSOLETE */
-/* OBSOLETE for (regno = GR96_REGNUM; regno < GR96_REGNUM + 32; regno++) */
-/* OBSOLETE { */
-/* OBSOLETE supply_register (regno, data_p++); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Local Registers */ */
-/* OBSOLETE out_msg_buf->read_req_msg.byte_count = 4 * (128); */
-/* OBSOLETE out_msg_buf->read_req_msg.memory_space = LOCAL_REG; */
-/* OBSOLETE out_msg_buf->read_req_msg.address = 0; */
-/* OBSOLETE msg_send_serial (out_msg_buf); */
-/* OBSOLETE expect_msg (READ_ACK, in_msg_buf, 1); */
-/* OBSOLETE data_p = &(in_msg_buf->read_r_ack_msg.data[0]); */
-/* OBSOLETE */
-/* OBSOLETE for (regno = LR0_REGNUM; regno < LR0_REGNUM + 128; regno++) */
-/* OBSOLETE { */
-/* OBSOLETE supply_register (regno, data_p++); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Protected Special Registers */ */
-/* OBSOLETE out_msg_buf->read_req_msg.byte_count = 4 * 15; */
-/* OBSOLETE out_msg_buf->read_req_msg.memory_space = SPECIAL_REG; */
-/* OBSOLETE out_msg_buf->read_req_msg.address = 0; */
-/* OBSOLETE msg_send_serial (out_msg_buf); */
-/* OBSOLETE expect_msg (READ_ACK, in_msg_buf, 1); */
-/* OBSOLETE data_p = &(in_msg_buf->read_r_ack_msg.data[0]); */
-/* OBSOLETE */
-/* OBSOLETE for (regno = 0; regno <= 14; regno++) */
-/* OBSOLETE { */
-/* OBSOLETE supply_register (SR_REGNUM (regno), data_p++); */
-/* OBSOLETE } */
-/* OBSOLETE if (USE_SHADOW_PC) */
-/* OBSOLETE { /* Let regno_to_srnum() handle the register number */ */
-/* OBSOLETE fetch_register (NPC_REGNUM); */
-/* OBSOLETE fetch_register (PC_REGNUM); */
-/* OBSOLETE fetch_register (PC2_REGNUM); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Unprotected Special Registers */ */
-/* OBSOLETE out_msg_buf->read_req_msg.byte_count = 4 * 8; */
-/* OBSOLETE out_msg_buf->read_req_msg.memory_space = SPECIAL_REG; */
-/* OBSOLETE out_msg_buf->read_req_msg.address = 128; */
-/* OBSOLETE msg_send_serial (out_msg_buf); */
-/* OBSOLETE expect_msg (READ_ACK, in_msg_buf, 1); */
-/* OBSOLETE data_p = &(in_msg_buf->read_r_ack_msg.data[0]); */
-/* OBSOLETE */
-/* OBSOLETE for (regno = 128; regno <= 135; regno++) */
-/* OBSOLETE { */
-/* OBSOLETE supply_register (SR_REGNUM (regno), data_p++); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* There doesn't seem to be any way to get these. */ */
-/* OBSOLETE { */
-/* OBSOLETE int val = -1; */
-/* OBSOLETE supply_register (FPE_REGNUM, &val); */
-/* OBSOLETE supply_register (INTE_REGNUM, &val); */
-/* OBSOLETE supply_register (FPS_REGNUM, &val); */
-/* OBSOLETE supply_register (EXO_REGNUM, &val); */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE */
-/* OBSOLETE /****************************************************** REMOTE_STORE_REGISTERS */
-/* OBSOLETE * Store register regno into the target. */
-/* OBSOLETE * If regno==-1 then store all the registers. */
-/* OBSOLETE * Result is 0 for success, -1 for failure. */
-/* OBSOLETE */ */
-/* OBSOLETE */
-/* OBSOLETE static void */
-/* OBSOLETE mm_store_registers (int regno) */
-/* OBSOLETE { */
-/* OBSOLETE int result; */
-/* OBSOLETE */
-/* OBSOLETE if (regno >= 0) */
-/* OBSOLETE { */
-/* OBSOLETE store_register (regno); */
-/* OBSOLETE return; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE result = 0; */
-/* OBSOLETE */
-/* OBSOLETE out_msg_buf->write_r_msg.code = WRITE_REQ; */
-/* OBSOLETE */
-/* OBSOLETE /* Gr1/rsp */ */
-/* OBSOLETE out_msg_buf->write_r_msg.byte_count = 4 * 1; */
-/* OBSOLETE out_msg_buf->write_r_msg.length = 3 * 4 + out_msg_buf->write_r_msg.byte_count; */
-/* OBSOLETE out_msg_buf->write_r_msg.memory_space = GLOBAL_REG; */
-/* OBSOLETE out_msg_buf->write_r_msg.address = 1; */
-/* OBSOLETE out_msg_buf->write_r_msg.data[0] = read_register (GR1_REGNUM); */
-/* OBSOLETE */
-/* OBSOLETE msg_send_serial (out_msg_buf); */
-/* OBSOLETE if (!expect_msg (WRITE_ACK, in_msg_buf, 1)) */
-/* OBSOLETE { */
-/* OBSOLETE result = -1; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE #if defined(GR64_REGNUM) */
-/* OBSOLETE /* Global registers gr64-gr95 */ */
-/* OBSOLETE out_msg_buf->write_r_msg.byte_count = 4 * (32); */
-/* OBSOLETE out_msg_buf->write_r_msg.length = 3 * 4 + out_msg_buf->write_r_msg.byte_count; */
-/* OBSOLETE out_msg_buf->write_r_msg.address = 64; */
-/* OBSOLETE */
-/* OBSOLETE for (regno = GR64_REGNUM; regno < GR64_REGNUM + 32; regno++) */
-/* OBSOLETE { */
-/* OBSOLETE out_msg_buf->write_r_msg.data[regno - GR64_REGNUM] = read_register (regno); */
-/* OBSOLETE } */
-/* OBSOLETE msg_send_serial (out_msg_buf); */
-/* OBSOLETE if (!expect_msg (WRITE_ACK, in_msg_buf, 1)) */
-/* OBSOLETE { */
-/* OBSOLETE result = -1; */
-/* OBSOLETE } */
-/* OBSOLETE #endif /* GR64_REGNUM */ */
-/* OBSOLETE */
-/* OBSOLETE /* Global registers gr96-gr127 */ */
-/* OBSOLETE out_msg_buf->write_r_msg.byte_count = 4 * (32); */
-/* OBSOLETE out_msg_buf->write_r_msg.length = 3 * 4 + out_msg_buf->write_r_msg.byte_count; */
-/* OBSOLETE out_msg_buf->write_r_msg.address = 96; */
-/* OBSOLETE for (regno = GR96_REGNUM; regno < GR96_REGNUM + 32; regno++) */
-/* OBSOLETE { */
-/* OBSOLETE out_msg_buf->write_r_msg.data[regno - GR96_REGNUM] = read_register (regno); */
-/* OBSOLETE } */
-/* OBSOLETE msg_send_serial (out_msg_buf); */
-/* OBSOLETE if (!expect_msg (WRITE_ACK, in_msg_buf, 1)) */
-/* OBSOLETE { */
-/* OBSOLETE result = -1; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Local Registers */ */
-/* OBSOLETE out_msg_buf->write_r_msg.memory_space = LOCAL_REG; */
-/* OBSOLETE out_msg_buf->write_r_msg.byte_count = 4 * 128; */
-/* OBSOLETE out_msg_buf->write_r_msg.length = 3 * 4 + out_msg_buf->write_r_msg.byte_count; */
-/* OBSOLETE out_msg_buf->write_r_msg.address = 0; */
-/* OBSOLETE */
-/* OBSOLETE for (regno = LR0_REGNUM; regno < LR0_REGNUM + 128; regno++) */
-/* OBSOLETE { */
-/* OBSOLETE out_msg_buf->write_r_msg.data[regno - LR0_REGNUM] = read_register (regno); */
-/* OBSOLETE } */
-/* OBSOLETE msg_send_serial (out_msg_buf); */
-/* OBSOLETE if (!expect_msg (WRITE_ACK, in_msg_buf, 1)) */
-/* OBSOLETE { */
-/* OBSOLETE result = -1; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Protected Special Registers */ */
-/* OBSOLETE /* VAB through TMR */ */
-/* OBSOLETE out_msg_buf->write_r_msg.memory_space = SPECIAL_REG; */
-/* OBSOLETE out_msg_buf->write_r_msg.byte_count = 4 * 10; */
-/* OBSOLETE out_msg_buf->write_r_msg.length = 3 * 4 + out_msg_buf->write_r_msg.byte_count; */
-/* OBSOLETE out_msg_buf->write_r_msg.address = 0; */
-/* OBSOLETE for (regno = 0; regno <= 9; regno++) /* VAB through TMR */ */
-/* OBSOLETE out_msg_buf->write_r_msg.data[regno] = read_register (SR_REGNUM (regno)); */
-/* OBSOLETE msg_send_serial (out_msg_buf); */
-/* OBSOLETE if (!expect_msg (WRITE_ACK, in_msg_buf, 1)) */
-/* OBSOLETE { */
-/* OBSOLETE result = -1; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* PC0, PC1, PC2 possibly as shadow registers */ */
-/* OBSOLETE out_msg_buf->write_r_msg.byte_count = 4 * 3; */
-/* OBSOLETE out_msg_buf->write_r_msg.length = 3 * 4 + out_msg_buf->write_r_msg.byte_count; */
-/* OBSOLETE for (regno = 10; regno <= 12; regno++) /* LRU and MMU */ */
-/* OBSOLETE out_msg_buf->write_r_msg.data[regno - 10] = read_register (SR_REGNUM (regno)); */
-/* OBSOLETE if (USE_SHADOW_PC) */
-/* OBSOLETE out_msg_buf->write_r_msg.address = 20; /* SPC0 */ */
-/* OBSOLETE else */
-/* OBSOLETE out_msg_buf->write_r_msg.address = 10; /* PC0 */ */
-/* OBSOLETE msg_send_serial (out_msg_buf); */
-/* OBSOLETE if (!expect_msg (WRITE_ACK, in_msg_buf, 1)) */
-/* OBSOLETE { */
-/* OBSOLETE result = -1; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* LRU and MMU */ */
-/* OBSOLETE out_msg_buf->write_r_msg.byte_count = 4 * 2; */
-/* OBSOLETE out_msg_buf->write_r_msg.length = 3 * 4 + out_msg_buf->write_r_msg.byte_count; */
-/* OBSOLETE out_msg_buf->write_r_msg.address = 13; */
-/* OBSOLETE for (regno = 13; regno <= 14; regno++) /* LRU and MMU */ */
-/* OBSOLETE out_msg_buf->write_r_msg.data[regno - 13] = read_register (SR_REGNUM (regno)); */
-/* OBSOLETE msg_send_serial (out_msg_buf); */
-/* OBSOLETE if (!expect_msg (WRITE_ACK, in_msg_buf, 1)) */
-/* OBSOLETE { */
-/* OBSOLETE result = -1; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Unprotected Special Registers */ */
-/* OBSOLETE out_msg_buf->write_r_msg.byte_count = 4 * 8; */
-/* OBSOLETE out_msg_buf->write_r_msg.length = 3 * 4 + out_msg_buf->write_r_msg.byte_count; */
-/* OBSOLETE out_msg_buf->write_r_msg.address = 128; */
-/* OBSOLETE for (regno = 128; regno <= 135; regno++) */
-/* OBSOLETE out_msg_buf->write_r_msg.data[regno - 128] = read_register (SR_REGNUM (regno)); */
-/* OBSOLETE msg_send_serial (out_msg_buf); */
-/* OBSOLETE if (!expect_msg (WRITE_ACK, in_msg_buf, 1)) */
-/* OBSOLETE { */
-/* OBSOLETE result = -1; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE registers_changed (); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /*************************************************** REMOTE_PREPARE_TO_STORE */ */
-/* OBSOLETE /* Get ready to modify the registers array. On machines which store */
-/* OBSOLETE individual registers, this doesn't need to do anything. On machines */
-/* OBSOLETE which store all the registers in one fell swoop, this makes sure */
-/* OBSOLETE that registers contains all the registers from the program being */
-/* OBSOLETE debugged. */ */
-/* OBSOLETE */
-/* OBSOLETE static void */
-/* OBSOLETE mm_prepare_to_store (void) */
-/* OBSOLETE { */
-/* OBSOLETE /* Do nothing, since we can store individual regs */ */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /******************************************************* REMOTE_XFER_MEMORY */ */
-/* OBSOLETE static CORE_ADDR */
-/* OBSOLETE translate_addr (CORE_ADDR addr) */
-/* OBSOLETE { */
-/* OBSOLETE #if defined(KERNEL_DEBUGGING) */
-/* OBSOLETE /* Check for a virtual address in the kernel */ */
-/* OBSOLETE /* Assume physical address of ublock is in paddr_u register */ */
-/* OBSOLETE /* FIXME: doesn't work for user virtual addresses */ */
-/* OBSOLETE if (addr >= UVADDR) */
-/* OBSOLETE { */
-/* OBSOLETE /* PADDR_U register holds the physical address of the ublock */ */
-/* OBSOLETE CORE_ADDR i = (CORE_ADDR) read_register (PADDR_U_REGNUM); */
-/* OBSOLETE return (i + addr - (CORE_ADDR) UVADDR); */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE { */
-/* OBSOLETE return (addr); */
-/* OBSOLETE } */
-/* OBSOLETE #else */
-/* OBSOLETE return (addr); */
-/* OBSOLETE #endif */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /******************************************************* REMOTE_FILES_INFO */ */
-/* OBSOLETE static void */
-/* OBSOLETE mm_files_info (void) */
-/* OBSOLETE { */
-/* OBSOLETE printf ("\tAttached to %s at %d baud and running program %s.\n", */
-/* OBSOLETE dev_name, baudrate, prog_name); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /************************************************* REMOTE_INSERT_BREAKPOINT */ */
-/* OBSOLETE static int */
-/* OBSOLETE mm_insert_breakpoint (CORE_ADDR addr, char *contents_cache) */
-/* OBSOLETE { */
-/* OBSOLETE out_msg_buf->bkpt_set_msg.code = BKPT_SET; */
-/* OBSOLETE out_msg_buf->bkpt_set_msg.length = 4 * 4; */
-/* OBSOLETE out_msg_buf->bkpt_set_msg.memory_space = I_MEM; */
-/* OBSOLETE out_msg_buf->bkpt_set_msg.bkpt_addr = (ADDR32) addr; */
-/* OBSOLETE out_msg_buf->bkpt_set_msg.pass_count = 1; */
-/* OBSOLETE out_msg_buf->bkpt_set_msg.bkpt_type = -1; /* use illop for 29000 */ */
-/* OBSOLETE msg_send_serial (out_msg_buf); */
-/* OBSOLETE if (expect_msg (BKPT_SET_ACK, in_msg_buf, 1)) */
-/* OBSOLETE { */
-/* OBSOLETE return 0; /* Success */ */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE { */
-/* OBSOLETE return 1; /* Failure */ */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /************************************************* REMOTE_DELETE_BREAKPOINT */ */
-/* OBSOLETE static int */
-/* OBSOLETE mm_remove_breakpoint (CORE_ADDR addr, char *contents_cache) */
-/* OBSOLETE { */
-/* OBSOLETE out_msg_buf->bkpt_rm_msg.code = BKPT_RM; */
-/* OBSOLETE out_msg_buf->bkpt_rm_msg.length = 4 * 3; */
-/* OBSOLETE out_msg_buf->bkpt_rm_msg.memory_space = I_MEM; */
-/* OBSOLETE out_msg_buf->bkpt_rm_msg.bkpt_addr = (ADDR32) addr; */
-/* OBSOLETE msg_send_serial (out_msg_buf); */
-/* OBSOLETE if (expect_msg (BKPT_RM_ACK, in_msg_buf, 1)) */
-/* OBSOLETE { */
-/* OBSOLETE return 0; /* Success */ */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE { */
-/* OBSOLETE return 1; /* Failure */ */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE */
-/* OBSOLETE /******************************************************* REMOTE_KILL */ */
-/* OBSOLETE static void */
-/* OBSOLETE mm_kill (char *arg, int from_tty) */
-/* OBSOLETE { */
-/* OBSOLETE char buf[4]; */
-/* OBSOLETE */
-/* OBSOLETE #if defined(KERNEL_DEBUGGING) */
-/* OBSOLETE /* We don't ever kill the kernel */ */
-/* OBSOLETE if (from_tty) */
-/* OBSOLETE { */
-/* OBSOLETE printf ("Kernel not killed, but left in current state.\n"); */
-/* OBSOLETE printf ("Use detach to leave kernel running.\n"); */
-/* OBSOLETE } */
-/* OBSOLETE #else */
-/* OBSOLETE out_msg_buf->break_msg.code = BREAK; */
-/* OBSOLETE out_msg_buf->bkpt_set_msg.length = 4 * 0; */
-/* OBSOLETE expect_msg (HALT, in_msg_buf, from_tty); */
-/* OBSOLETE if (from_tty) */
-/* OBSOLETE { */
-/* OBSOLETE printf ("Target has been stopped."); */
-/* OBSOLETE printf ("Would you like to do a hardware reset (y/n) [n] "); */
-/* OBSOLETE fgets (buf, 3, stdin); */
-/* OBSOLETE if (buf[0] == 'y') */
-/* OBSOLETE { */
-/* OBSOLETE out_msg_buf->reset_msg.code = RESET; */
-/* OBSOLETE out_msg_buf->bkpt_set_msg.length = 4 * 0; */
-/* OBSOLETE expect_msg (RESET_ACK, in_msg_buf, from_tty); */
-/* OBSOLETE printf ("Target has been reset."); */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE pop_target (); */
-/* OBSOLETE #endif */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE */
-/* OBSOLETE */
-/* OBSOLETE /***************************************************************************/ */
-/* OBSOLETE /* */
-/* OBSOLETE * Load a program into the target. */
-/* OBSOLETE */ */
-/* OBSOLETE static void */
-/* OBSOLETE mm_load (char *arg_string, int from_tty) */
-/* OBSOLETE { */
-/* OBSOLETE dont_repeat (); */
-/* OBSOLETE */
-/* OBSOLETE #if defined(KERNEL_DEBUGGING) */
-/* OBSOLETE printf ("The kernel had better be loaded already! Loading not done.\n"); */
-/* OBSOLETE #else */
-/* OBSOLETE if (arg_string == 0) */
-/* OBSOLETE error ("The load command takes a file name"); */
-/* OBSOLETE */
-/* OBSOLETE arg_string = tilde_expand (arg_string); */
-/* OBSOLETE make_cleanup (xfree, arg_string); */
-/* OBSOLETE QUIT; */
-/* OBSOLETE immediate_quit++; */
-/* OBSOLETE error ("File loading is not yet supported for MiniMon."); */
-/* OBSOLETE /* FIXME, code to load your file here... */ */
-/* OBSOLETE /* You may need to do an init_target_mm() */ */
-/* OBSOLETE /* init_target_mm(?,?,?,?,?,?,?,?); */ */
-/* OBSOLETE immediate_quit--; */
-/* OBSOLETE /* symbol_file_add (arg_string, from_tty, text_addr, 0, 0); */ */
-/* OBSOLETE #endif */
-/* OBSOLETE */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /************************************************ REMOTE_WRITE_INFERIOR_MEMORY */
-/* OBSOLETE ** Copy LEN bytes of data from debugger memory at MYADDR */
-/* OBSOLETE to inferior's memory at MEMADDR. Returns number of bytes written. */ */
-/* OBSOLETE static int */
-/* OBSOLETE mm_write_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len) */
-/* OBSOLETE { */
-/* OBSOLETE int i, nwritten; */
-/* OBSOLETE */
-/* OBSOLETE out_msg_buf->write_req_msg.code = WRITE_REQ; */
-/* OBSOLETE out_msg_buf->write_req_msg.memory_space = mm_memory_space (memaddr); */
-/* OBSOLETE */
-/* OBSOLETE nwritten = 0; */
-/* OBSOLETE while (nwritten < len) */
-/* OBSOLETE { */
-/* OBSOLETE int num_to_write = len - nwritten; */
-/* OBSOLETE if (num_to_write > MAXDATA) */
-/* OBSOLETE num_to_write = MAXDATA; */
-/* OBSOLETE for (i = 0; i < num_to_write; i++) */
-/* OBSOLETE out_msg_buf->write_req_msg.data[i] = myaddr[i + nwritten]; */
-/* OBSOLETE out_msg_buf->write_req_msg.byte_count = num_to_write; */
-/* OBSOLETE out_msg_buf->write_req_msg.length = 3 * 4 + num_to_write; */
-/* OBSOLETE out_msg_buf->write_req_msg.address = memaddr + nwritten; */
-/* OBSOLETE msg_send_serial (out_msg_buf); */
-/* OBSOLETE */
-/* OBSOLETE if (expect_msg (WRITE_ACK, in_msg_buf, 1)) */
-/* OBSOLETE { */
-/* OBSOLETE nwritten += in_msg_buf->write_ack_msg.byte_count; */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE { */
-/* OBSOLETE break; */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE return (nwritten); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /************************************************* REMOTE_READ_INFERIOR_MEMORY */
-/* OBSOLETE ** Read LEN bytes from inferior memory at MEMADDR. Put the result */
-/* OBSOLETE at debugger address MYADDR. Returns number of bytes read. */ */
-/* OBSOLETE static int */
-/* OBSOLETE mm_read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len) */
-/* OBSOLETE { */
-/* OBSOLETE int i, nread; */
-/* OBSOLETE */
-/* OBSOLETE out_msg_buf->read_req_msg.code = READ_REQ; */
-/* OBSOLETE out_msg_buf->read_req_msg.memory_space = mm_memory_space (memaddr); */
-/* OBSOLETE */
-/* OBSOLETE nread = 0; */
-/* OBSOLETE while (nread < len) */
-/* OBSOLETE { */
-/* OBSOLETE int num_to_read = (len - nread); */
-/* OBSOLETE if (num_to_read > MAXDATA) */
-/* OBSOLETE num_to_read = MAXDATA; */
-/* OBSOLETE out_msg_buf->read_req_msg.byte_count = num_to_read; */
-/* OBSOLETE out_msg_buf->read_req_msg.length = 3 * 4 + num_to_read; */
-/* OBSOLETE out_msg_buf->read_req_msg.address = memaddr + nread; */
-/* OBSOLETE msg_send_serial (out_msg_buf); */
-/* OBSOLETE */
-/* OBSOLETE if (expect_msg (READ_ACK, in_msg_buf, 1)) */
-/* OBSOLETE { */
-/* OBSOLETE for (i = 0; i < in_msg_buf->read_ack_msg.byte_count; i++) */
-/* OBSOLETE myaddr[i + nread] = in_msg_buf->read_ack_msg.data[i]; */
-/* OBSOLETE nread += in_msg_buf->read_ack_msg.byte_count; */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE { */
-/* OBSOLETE break; */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE return (nread); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* FIXME! Merge these two. */ */
-/* OBSOLETE static int */
-/* OBSOLETE mm_xfer_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len, int write, */
-/* OBSOLETE struct mem_attrib *attrib ATTRIBUTE_UNUSED, */
-/* OBSOLETE struct target_ops *target ATTRIBUTE_UNUSED) */
-/* OBSOLETE { */
-/* OBSOLETE */
-/* OBSOLETE memaddr = translate_addr (memaddr); */
-/* OBSOLETE */
-/* OBSOLETE if (write) */
-/* OBSOLETE return mm_write_inferior_memory (memaddr, myaddr, len); */
-/* OBSOLETE else */
-/* OBSOLETE return mm_read_inferior_memory (memaddr, myaddr, len); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE */
-/* OBSOLETE /********************************************************** MSG_SEND_SERIAL */
-/* OBSOLETE ** This function is used to send a message over the */
-/* OBSOLETE ** serial line. */
-/* OBSOLETE ** */
-/* OBSOLETE ** If the message is successfully sent, a zero is */
-/* OBSOLETE ** returned. If the message was not sendable, a -1 */
-/* OBSOLETE ** is returned. This function blocks. That is, it */
-/* OBSOLETE ** does not return until the message is completely */
-/* OBSOLETE ** sent, or until an error is encountered. */
-/* OBSOLETE ** */
-/* OBSOLETE */ */
-/* OBSOLETE */
-/* OBSOLETE int */
-/* OBSOLETE msg_send_serial (union msg_t *msg_ptr) */
-/* OBSOLETE { */
-/* OBSOLETE INT32 message_size; */
-/* OBSOLETE int byte_count; */
-/* OBSOLETE int result; */
-/* OBSOLETE char c; */
-/* OBSOLETE */
-/* OBSOLETE /* Send message header */ */
-/* OBSOLETE byte_count = 0; */
-/* OBSOLETE message_size = msg_ptr->generic_msg.length + (2 * sizeof (INT32)); */
-/* OBSOLETE do */
-/* OBSOLETE { */
-/* OBSOLETE c = *((char *) msg_ptr + byte_count); */
-/* OBSOLETE result = write (mm_desc, &c, 1); */
-/* OBSOLETE if (result == 1) */
-/* OBSOLETE { */
-/* OBSOLETE byte_count = byte_count + 1; */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE while ((byte_count < message_size)); */
-/* OBSOLETE */
-/* OBSOLETE return (0); */
-/* OBSOLETE } /* end msg_send_serial() */ */
-/* OBSOLETE */
-/* OBSOLETE /********************************************************** MSG_RECV_SERIAL */
-/* OBSOLETE ** This function is used to receive a message over a */
-/* OBSOLETE ** serial line. */
-/* OBSOLETE ** */
-/* OBSOLETE ** If the message is waiting in the buffer, a zero is */
-/* OBSOLETE ** returned and the buffer pointed to by msg_ptr is filled */
-/* OBSOLETE ** in. If no message was available, a -1 is returned. */
-/* OBSOLETE ** If timeout==0, wait indefinetly for a character. */
-/* OBSOLETE ** */
-/* OBSOLETE */ */
-/* OBSOLETE */
-/* OBSOLETE int */
-/* OBSOLETE msg_recv_serial (union msg_t *msg_ptr) */
-/* OBSOLETE { */
-/* OBSOLETE static INT32 length = 0; */
-/* OBSOLETE static INT32 byte_count = 0; */
-/* OBSOLETE int result; */
-/* OBSOLETE char c; */
-/* OBSOLETE if (msg_ptr == 0) /* re-sync request */ */
-/* OBSOLETE { */
-/* OBSOLETE length = 0; */
-/* OBSOLETE byte_count = 0; */
-/* OBSOLETE #ifdef HAVE_TERMIO */
-/* OBSOLETE /* The timeout here is the prevailing timeout set with VTIME */ */
-/* OBSOLETE ->"timeout==0 semantics not supported" */
-/* OBSOLETE read (mm_desc, in_buf, BUFER_SIZE); */
-/* OBSOLETE #else */
-/* OBSOLETE alarm (1); */
-/* OBSOLETE read (mm_desc, in_buf, BUFER_SIZE); */
-/* OBSOLETE alarm (0); */
-/* OBSOLETE #endif */
-/* OBSOLETE return (0); */
-/* OBSOLETE } */
-/* OBSOLETE /* Receive message */ */
-/* OBSOLETE #ifdef HAVE_TERMIO */
-/* OBSOLETE /* Timeout==0, help support the mm_wait() routine */ */
-/* OBSOLETE ->"timeout==0 semantics not supported (and its nice if they are)" */
-/* OBSOLETE result = read (mm_desc, &c, 1); */
-/* OBSOLETE #else */
-/* OBSOLETE alarm (timeout); */
-/* OBSOLETE result = read (mm_desc, &c, 1); */
-/* OBSOLETE alarm (0); */
-/* OBSOLETE #endif */
-/* OBSOLETE if (result < 0) */
-/* OBSOLETE { */
-/* OBSOLETE if (errno == EINTR) */
-/* OBSOLETE { */
-/* OBSOLETE error ("Timeout reading from remote system."); */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE perror_with_name ("remote"); */
-/* OBSOLETE } */
-/* OBSOLETE else if (result == 1) */
-/* OBSOLETE { */
-/* OBSOLETE *((char *) msg_ptr + byte_count) = c; */
-/* OBSOLETE byte_count = byte_count + 1; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Message header received. Save message length. */ */
-/* OBSOLETE if (byte_count == (2 * sizeof (INT32))) */
-/* OBSOLETE length = msg_ptr->generic_msg.length; */
-/* OBSOLETE */
-/* OBSOLETE if (byte_count >= (length + (2 * sizeof (INT32)))) */
-/* OBSOLETE { */
-/* OBSOLETE /* Message received */ */
-/* OBSOLETE byte_count = 0; */
-/* OBSOLETE return (0); */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE return (-1); */
-/* OBSOLETE */
-/* OBSOLETE } /* end msg_recv_serial() */ */
-/* OBSOLETE */
-/* OBSOLETE /********************************************************************* KBD_RAW */
-/* OBSOLETE ** This function is used to put the keyboard in "raw" */
-/* OBSOLETE ** mode for BSD Unix. The original status is saved */
-/* OBSOLETE ** so that it may be restored later. */
-/* OBSOLETE */ */
-/* OBSOLETE TERMINAL kbd_tbuf; */
-/* OBSOLETE */
-/* OBSOLETE int */
-/* OBSOLETE kbd_raw (void) */
-/* OBSOLETE { */
-/* OBSOLETE int result; */
-/* OBSOLETE TERMINAL tbuf; */
-/* OBSOLETE */
-/* OBSOLETE /* Get keyboard termio (to save to restore original modes) */ */
-/* OBSOLETE #ifdef HAVE_TERMIO */
-/* OBSOLETE result = ioctl (0, TCGETA, &kbd_tbuf); */
-/* OBSOLETE #else */
-/* OBSOLETE result = ioctl (0, TIOCGETP, &kbd_tbuf); */
-/* OBSOLETE #endif */
-/* OBSOLETE if (result == -1) */
-/* OBSOLETE return (errno); */
-/* OBSOLETE */
-/* OBSOLETE /* Get keyboard TERMINAL (for modification) */ */
-/* OBSOLETE #ifdef HAVE_TERMIO */
-/* OBSOLETE result = ioctl (0, TCGETA, &tbuf); */
-/* OBSOLETE #else */
-/* OBSOLETE result = ioctl (0, TIOCGETP, &tbuf); */
-/* OBSOLETE #endif */
-/* OBSOLETE if (result == -1) */
-/* OBSOLETE return (errno); */
-/* OBSOLETE */
-/* OBSOLETE /* Set up new parameters */ */
-/* OBSOLETE #ifdef HAVE_TERMIO */
-/* OBSOLETE tbuf.c_iflag = tbuf.c_iflag & */
-/* OBSOLETE ~(INLCR | ICRNL | IUCLC | ISTRIP | IXON | BRKINT); */
-/* OBSOLETE tbuf.c_lflag = tbuf.c_lflag & ~(ICANON | ISIG | ECHO); */
-/* OBSOLETE tbuf.c_cc[4] = 0; /* MIN */ */
-/* OBSOLETE tbuf.c_cc[5] = 0; /* TIME */ */
-/* OBSOLETE #else */
-/* OBSOLETE /* FIXME: not sure if this is correct (matches HAVE_TERMIO). */ */
-/* OBSOLETE tbuf.sg_flags |= RAW; */
-/* OBSOLETE tbuf.sg_flags |= ANYP; */
-/* OBSOLETE tbuf.sg_flags &= ~ECHO; */
-/* OBSOLETE #endif */
-/* OBSOLETE */
-/* OBSOLETE /* Set keyboard termio to new mode (RAW) */ */
-/* OBSOLETE #ifdef HAVE_TERMIO */
-/* OBSOLETE result = ioctl (0, TCSETAF, &tbuf); */
-/* OBSOLETE #else */
-/* OBSOLETE result = ioctl (0, TIOCSETP, &tbuf); */
-/* OBSOLETE #endif */
-/* OBSOLETE if (result == -1) */
-/* OBSOLETE return (errno); */
-/* OBSOLETE */
-/* OBSOLETE return (0); */
-/* OBSOLETE } /* end kbd_raw() */ */
-/* OBSOLETE */
-/* OBSOLETE */
-/* OBSOLETE */
-/* OBSOLETE /***************************************************************** KBD_RESTORE */
-/* OBSOLETE ** This function is used to put the keyboard back in the */
-/* OBSOLETE ** mode it was in before kbk_raw was called. Note that */
-/* OBSOLETE ** kbk_raw() must have been called at least once before */
-/* OBSOLETE ** kbd_restore() is called. */
-/* OBSOLETE */ */
-/* OBSOLETE */
-/* OBSOLETE int */
-/* OBSOLETE kbd_restore (void) */
-/* OBSOLETE { */
-/* OBSOLETE int result; */
-/* OBSOLETE */
-/* OBSOLETE /* Set keyboard termio to original mode */ */
-/* OBSOLETE #ifdef HAVE_TERMIO */
-/* OBSOLETE result = ioctl (0, TCSETAF, &kbd_tbuf); */
-/* OBSOLETE #else */
-/* OBSOLETE result = ioctl (0, TIOCGETP, &kbd_tbuf); */
-/* OBSOLETE #endif */
-/* OBSOLETE */
-/* OBSOLETE if (result == -1) */
-/* OBSOLETE return (errno); */
-/* OBSOLETE */
-/* OBSOLETE return (0); */
-/* OBSOLETE } /* end kbd_cooked() */ */
-/* OBSOLETE */
-/* OBSOLETE */
-/* OBSOLETE /*****************************************************************************/ */
-/* OBSOLETE /* Fetch a single register indicatated by 'regno'. */
-/* OBSOLETE * Returns 0/-1 on success/failure. */
-/* OBSOLETE */ */
-/* OBSOLETE static int */
-/* OBSOLETE fetch_register (int regno) */
-/* OBSOLETE { */
-/* OBSOLETE int result; */
-/* OBSOLETE out_msg_buf->read_req_msg.code = READ_REQ; */
-/* OBSOLETE out_msg_buf->read_req_msg.length = 4 * 3; */
-/* OBSOLETE out_msg_buf->read_req_msg.byte_count = 4; */
-/* OBSOLETE */
-/* OBSOLETE if (regno == GR1_REGNUM) */
-/* OBSOLETE { */
-/* OBSOLETE out_msg_buf->read_req_msg.memory_space = GLOBAL_REG; */
-/* OBSOLETE out_msg_buf->read_req_msg.address = 1; */
-/* OBSOLETE } */
-/* OBSOLETE else if (regno >= GR96_REGNUM && regno < GR96_REGNUM + 32) */
-/* OBSOLETE { */
-/* OBSOLETE out_msg_buf->read_req_msg.memory_space = GLOBAL_REG; */
-/* OBSOLETE out_msg_buf->read_req_msg.address = (regno - GR96_REGNUM) + 96; */
-/* OBSOLETE } */
-/* OBSOLETE #if defined(GR64_REGNUM) */
-/* OBSOLETE else if (regno >= GR64_REGNUM && regno < GR64_REGNUM + 32) */
-/* OBSOLETE { */
-/* OBSOLETE out_msg_buf->read_req_msg.memory_space = GLOBAL_REG; */
-/* OBSOLETE out_msg_buf->read_req_msg.address = (regno - GR64_REGNUM) + 64; */
-/* OBSOLETE } */
-/* OBSOLETE #endif /* GR64_REGNUM */ */
-/* OBSOLETE else if (regno >= LR0_REGNUM && regno < LR0_REGNUM + 128) */
-/* OBSOLETE { */
-/* OBSOLETE out_msg_buf->read_req_msg.memory_space = LOCAL_REG; */
-/* OBSOLETE out_msg_buf->read_req_msg.address = (regno - LR0_REGNUM); */
-/* OBSOLETE } */
-/* OBSOLETE else if (regno >= FPE_REGNUM && regno <= EXO_REGNUM) */
-/* OBSOLETE { */
-/* OBSOLETE int val = -1; */
-/* OBSOLETE supply_register (160 + (regno - FPE_REGNUM), &val); */
-/* OBSOLETE return 0; /* Pretend Success */ */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE { */
-/* OBSOLETE out_msg_buf->read_req_msg.memory_space = SPECIAL_REG; */
-/* OBSOLETE out_msg_buf->read_req_msg.address = regnum_to_srnum (regno); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE msg_send_serial (out_msg_buf); */
-/* OBSOLETE */
-/* OBSOLETE if (expect_msg (READ_ACK, in_msg_buf, 1)) */
-/* OBSOLETE { */
-/* OBSOLETE supply_register (regno, &(in_msg_buf->read_r_ack_msg.data[0])); */
-/* OBSOLETE result = 0; */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE { */
-/* OBSOLETE result = -1; */
-/* OBSOLETE } */
-/* OBSOLETE return result; */
-/* OBSOLETE } */
-/* OBSOLETE /*****************************************************************************/ */
-/* OBSOLETE /* Store a single register indicated by 'regno'. */
-/* OBSOLETE * Returns 0/-1 on success/failure. */
-/* OBSOLETE */ */
-/* OBSOLETE static int */
-/* OBSOLETE store_register (int regno) */
-/* OBSOLETE { */
-/* OBSOLETE int result; */
-/* OBSOLETE */
-/* OBSOLETE out_msg_buf->write_req_msg.code = WRITE_REQ; */
-/* OBSOLETE out_msg_buf->write_req_msg.length = 4 * 4; */
-/* OBSOLETE out_msg_buf->write_req_msg.byte_count = 4; */
-/* OBSOLETE out_msg_buf->write_r_msg.data[0] = read_register (regno); */
-/* OBSOLETE */
-/* OBSOLETE if (regno == GR1_REGNUM) */
-/* OBSOLETE { */
-/* OBSOLETE out_msg_buf->write_req_msg.memory_space = GLOBAL_REG; */
-/* OBSOLETE out_msg_buf->write_req_msg.address = 1; */
-/* OBSOLETE /* Setting GR1 changes the numbers of all the locals, so invalidate the */
-/* OBSOLETE * register cache. Do this *after* calling read_register, because we want */
-/* OBSOLETE * read_register to return the value that write_register has just stuffed */
-/* OBSOLETE * into the registers array, not the value of the register fetched from */
-/* OBSOLETE * the inferior. */
-/* OBSOLETE */ */
-/* OBSOLETE registers_changed (); */
-/* OBSOLETE } */
-/* OBSOLETE #if defined(GR64_REGNUM) */
-/* OBSOLETE else if (regno >= GR64_REGNUM && regno < GR64_REGNUM + 32) */
-/* OBSOLETE { */
-/* OBSOLETE out_msg_buf->write_req_msg.memory_space = GLOBAL_REG; */
-/* OBSOLETE out_msg_buf->write_req_msg.address = (regno - GR64_REGNUM) + 64; */
-/* OBSOLETE } */
-/* OBSOLETE #endif /* GR64_REGNUM */ */
-/* OBSOLETE else if (regno >= GR96_REGNUM && regno < GR96_REGNUM + 32) */
-/* OBSOLETE { */
-/* OBSOLETE out_msg_buf->write_req_msg.memory_space = GLOBAL_REG; */
-/* OBSOLETE out_msg_buf->write_req_msg.address = (regno - GR96_REGNUM) + 96; */
-/* OBSOLETE } */
-/* OBSOLETE else if (regno >= LR0_REGNUM && regno < LR0_REGNUM + 128) */
-/* OBSOLETE { */
-/* OBSOLETE out_msg_buf->write_req_msg.memory_space = LOCAL_REG; */
-/* OBSOLETE out_msg_buf->write_req_msg.address = (regno - LR0_REGNUM); */
-/* OBSOLETE } */
-/* OBSOLETE else if (regno >= FPE_REGNUM && regno <= EXO_REGNUM) */
-/* OBSOLETE { */
-/* OBSOLETE return 0; /* Pretend Success */ */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE /* An unprotected or protected special register */ */
-/* OBSOLETE { */
-/* OBSOLETE out_msg_buf->write_req_msg.memory_space = SPECIAL_REG; */
-/* OBSOLETE out_msg_buf->write_req_msg.address = regnum_to_srnum (regno); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE msg_send_serial (out_msg_buf); */
-/* OBSOLETE */
-/* OBSOLETE if (expect_msg (WRITE_ACK, in_msg_buf, 1)) */
-/* OBSOLETE { */
-/* OBSOLETE result = 0; */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE { */
-/* OBSOLETE result = -1; */
-/* OBSOLETE } */
-/* OBSOLETE return result; */
-/* OBSOLETE } */
-/* OBSOLETE /****************************************************************************/ */
-/* OBSOLETE /* */
-/* OBSOLETE * Convert a gdb special register number to a 29000 special register number. */
-/* OBSOLETE */ */
-/* OBSOLETE static int */
-/* OBSOLETE regnum_to_srnum (int regno) */
-/* OBSOLETE { */
-/* OBSOLETE switch (regno) */
-/* OBSOLETE { */
-/* OBSOLETE case VAB_REGNUM: */
-/* OBSOLETE return (0); */
-/* OBSOLETE case OPS_REGNUM: */
-/* OBSOLETE return (1); */
-/* OBSOLETE case CPS_REGNUM: */
-/* OBSOLETE return (2); */
-/* OBSOLETE case CFG_REGNUM: */
-/* OBSOLETE return (3); */
-/* OBSOLETE case CHA_REGNUM: */
-/* OBSOLETE return (4); */
-/* OBSOLETE case CHD_REGNUM: */
-/* OBSOLETE return (5); */
-/* OBSOLETE case CHC_REGNUM: */
-/* OBSOLETE return (6); */
-/* OBSOLETE case RBP_REGNUM: */
-/* OBSOLETE return (7); */
-/* OBSOLETE case TMC_REGNUM: */
-/* OBSOLETE return (8); */
-/* OBSOLETE case TMR_REGNUM: */
-/* OBSOLETE return (9); */
-/* OBSOLETE case NPC_REGNUM: */
-/* OBSOLETE return (USE_SHADOW_PC ? (20) : (10)); */
-/* OBSOLETE case PC_REGNUM: */
-/* OBSOLETE return (USE_SHADOW_PC ? (21) : (11)); */
-/* OBSOLETE case PC2_REGNUM: */
-/* OBSOLETE return (USE_SHADOW_PC ? (22) : (12)); */
-/* OBSOLETE case MMU_REGNUM: */
-/* OBSOLETE return (13); */
-/* OBSOLETE case LRU_REGNUM: */
-/* OBSOLETE return (14); */
-/* OBSOLETE case IPC_REGNUM: */
-/* OBSOLETE return (128); */
-/* OBSOLETE case IPA_REGNUM: */
-/* OBSOLETE return (129); */
-/* OBSOLETE case IPB_REGNUM: */
-/* OBSOLETE return (130); */
-/* OBSOLETE case Q_REGNUM: */
-/* OBSOLETE return (131); */
-/* OBSOLETE case ALU_REGNUM: */
-/* OBSOLETE return (132); */
-/* OBSOLETE case BP_REGNUM: */
-/* OBSOLETE return (133); */
-/* OBSOLETE case FC_REGNUM: */
-/* OBSOLETE return (134); */
-/* OBSOLETE case CR_REGNUM: */
-/* OBSOLETE return (135); */
-/* OBSOLETE case FPE_REGNUM: */
-/* OBSOLETE return (160); */
-/* OBSOLETE case INTE_REGNUM: */
-/* OBSOLETE return (161); */
-/* OBSOLETE case FPS_REGNUM: */
-/* OBSOLETE return (162); */
-/* OBSOLETE case EXO_REGNUM: */
-/* OBSOLETE return (164); */
-/* OBSOLETE default: */
-/* OBSOLETE return (255); /* Failure ? */ */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE /****************************************************************************/ */
-/* OBSOLETE /* */
-/* OBSOLETE * Initialize the target debugger (minimon only). */
-/* OBSOLETE */ */
-/* OBSOLETE static void */
-/* OBSOLETE init_target_mm (ADDR32 tstart, ADDR32 tend, ADDR32 dstart, ADDR32 dend, */
-/* OBSOLETE ADDR32 entry, INT32 ms_size, INT32 rs_size, ADDR32 arg_start) */
-/* OBSOLETE { */
-/* OBSOLETE out_msg_buf->init_msg.code = INIT; */
-/* OBSOLETE out_msg_buf->init_msg.length = sizeof (struct init_msg_t) - 2 * sizeof (INT32); */
-/* OBSOLETE out_msg_buf->init_msg.text_start = tstart; */
-/* OBSOLETE out_msg_buf->init_msg.text_end = tend; */
-/* OBSOLETE out_msg_buf->init_msg.data_start = dstart; */
-/* OBSOLETE out_msg_buf->init_msg.data_end = dend; */
-/* OBSOLETE out_msg_buf->init_msg.entry_point = entry; */
-/* OBSOLETE out_msg_buf->init_msg.mem_stack_size = ms_size; */
-/* OBSOLETE out_msg_buf->init_msg.reg_stack_size = rs_size; */
-/* OBSOLETE out_msg_buf->init_msg.arg_start = arg_start; */
-/* OBSOLETE msg_send_serial (out_msg_buf); */
-/* OBSOLETE expect_msg (INIT_ACK, in_msg_buf, 1); */
-/* OBSOLETE } */
-/* OBSOLETE /****************************************************************************/ */
-/* OBSOLETE /* */
-/* OBSOLETE * Return a pointer to a string representing the given message code. */
-/* OBSOLETE * Not all messages are represented here, only the ones that we expect */
-/* OBSOLETE * to be called with. */
-/* OBSOLETE */ */
-/* OBSOLETE static char * */
-/* OBSOLETE msg_str (INT32 code) */
-/* OBSOLETE { */
-/* OBSOLETE static char cbuf[32]; */
-/* OBSOLETE */
-/* OBSOLETE switch (code) */
-/* OBSOLETE { */
-/* OBSOLETE case BKPT_SET_ACK: */
-/* OBSOLETE sprintf (cbuf, "%s (%d)", "BKPT_SET_ACK", code); */
-/* OBSOLETE break; */
-/* OBSOLETE case BKPT_RM_ACK: */
-/* OBSOLETE sprintf (cbuf, "%s (%d)", "BKPT_RM_ACK", code); */
-/* OBSOLETE break; */
-/* OBSOLETE case INIT_ACK: */
-/* OBSOLETE sprintf (cbuf, "%s (%d)", "INIT_ACK", code); */
-/* OBSOLETE break; */
-/* OBSOLETE case READ_ACK: */
-/* OBSOLETE sprintf (cbuf, "%s (%d)", "READ_ACK", code); */
-/* OBSOLETE break; */
-/* OBSOLETE case WRITE_ACK: */
-/* OBSOLETE sprintf (cbuf, "%s (%d)", "WRITE_ACK", code); */
-/* OBSOLETE break; */
-/* OBSOLETE case ERROR: */
-/* OBSOLETE sprintf (cbuf, "%s (%d)", "ERROR", code); */
-/* OBSOLETE break; */
-/* OBSOLETE case HALT: */
-/* OBSOLETE sprintf (cbuf, "%s (%d)", "HALT", code); */
-/* OBSOLETE break; */
-/* OBSOLETE default: */
-/* OBSOLETE sprintf (cbuf, "UNKNOWN (%d)", code); */
-/* OBSOLETE break; */
-/* OBSOLETE } */
-/* OBSOLETE return (cbuf); */
-/* OBSOLETE } */
-/* OBSOLETE /****************************************************************************/ */
-/* OBSOLETE /* */
-/* OBSOLETE * Selected (not all of them) error codes that we might get. */
-/* OBSOLETE */ */
-/* OBSOLETE static char * */
-/* OBSOLETE error_msg_str (INT32 code) */
-/* OBSOLETE { */
-/* OBSOLETE static char cbuf[50]; */
-/* OBSOLETE */
-/* OBSOLETE switch (code) */
-/* OBSOLETE { */
-/* OBSOLETE case EMFAIL: */
-/* OBSOLETE return ("EMFAIL: unrecoverable error"); */
-/* OBSOLETE case EMBADADDR: */
-/* OBSOLETE return ("EMBADADDR: Illegal address"); */
-/* OBSOLETE case EMBADREG: */
-/* OBSOLETE return ("EMBADREG: Illegal register "); */
-/* OBSOLETE case EMACCESS: */
-/* OBSOLETE return ("EMACCESS: Could not access memory"); */
-/* OBSOLETE case EMBADMSG: */
-/* OBSOLETE return ("EMBADMSG: Unknown message type"); */
-/* OBSOLETE case EMMSG2BIG: */
-/* OBSOLETE return ("EMMSG2BIG: Message to large"); */
-/* OBSOLETE case EMNOSEND: */
-/* OBSOLETE return ("EMNOSEND: Could not send message"); */
-/* OBSOLETE case EMNORECV: */
-/* OBSOLETE return ("EMNORECV: Could not recv message"); */
-/* OBSOLETE case EMRESET: */
-/* OBSOLETE return ("EMRESET: Could not RESET target"); */
-/* OBSOLETE case EMCONFIG: */
-/* OBSOLETE return ("EMCONFIG: Could not get target CONFIG"); */
-/* OBSOLETE case EMSTATUS: */
-/* OBSOLETE return ("EMSTATUS: Could not get target STATUS"); */
-/* OBSOLETE case EMREAD: */
-/* OBSOLETE return ("EMREAD: Could not READ target memory"); */
-/* OBSOLETE case EMWRITE: */
-/* OBSOLETE return ("EMWRITE: Could not WRITE target memory"); */
-/* OBSOLETE case EMBKPTSET: */
-/* OBSOLETE return ("EMBKPTSET: Could not set breakpoint"); */
-/* OBSOLETE case EMBKPTRM: */
-/* OBSOLETE return ("EMBKPTRM: Could not remove breakpoint"); */
-/* OBSOLETE case EMBKPTSTAT: */
-/* OBSOLETE return ("EMBKPTSTAT: Could not get breakpoint status"); */
-/* OBSOLETE case EMBKPTNONE: */
-/* OBSOLETE return ("EMBKPTNONE: All breakpoints in use"); */
-/* OBSOLETE case EMBKPTUSED: */
-/* OBSOLETE return ("EMBKPTUSED: Breakpoints already in use"); */
-/* OBSOLETE case EMINIT: */
-/* OBSOLETE return ("EMINIT: Could not init target memory"); */
-/* OBSOLETE case EMGO: */
-/* OBSOLETE return ("EMGO: Could not start execution"); */
-/* OBSOLETE case EMSTEP: */
-/* OBSOLETE return ("EMSTEP: Could not single step"); */
-/* OBSOLETE case EMBREAK: */
-/* OBSOLETE return ("EMBREAK: Could not BREAK"); */
-/* OBSOLETE case EMCOMMERR: */
-/* OBSOLETE return ("EMCOMMERR: Communication error"); */
-/* OBSOLETE default: */
-/* OBSOLETE sprintf (cbuf, "error number %d", code); */
-/* OBSOLETE break; */
-/* OBSOLETE } /* end switch */ */
-/* OBSOLETE */
-/* OBSOLETE return (cbuf); */
-/* OBSOLETE } */
-/* OBSOLETE /****************************************************************************/ */
-/* OBSOLETE */
-/* OBSOLETE /* Receive a message, placing it in MSG_BUF, and expect it to be of */
-/* OBSOLETE type MSGCODE. If an error occurs, a non-zero FROM_TTY indicates */
-/* OBSOLETE that the message should be printed. */
-/* OBSOLETE */
-/* OBSOLETE Return 0 for failure, 1 for success. */ */
-/* OBSOLETE */
-/* OBSOLETE static int */
-/* OBSOLETE expect_msg (INT32 msgcode, union msg_t *msg_buf, int from_tty) */
-/* OBSOLETE { */
-/* OBSOLETE int retries = 0; */
-/* OBSOLETE while (msg_recv_serial (msg_buf) && (retries++ < MAX_RETRIES)); */
-/* OBSOLETE if (retries >= MAX_RETRIES) */
-/* OBSOLETE { */
-/* OBSOLETE printf ("Expected msg %s, ", msg_str (msgcode)); */
-/* OBSOLETE printf ("no message received!\n"); */
-/* OBSOLETE return (0); /* Failure */ */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE if (msg_buf->generic_msg.code != msgcode) */
-/* OBSOLETE { */
-/* OBSOLETE if (from_tty) */
-/* OBSOLETE { */
-/* OBSOLETE printf ("Expected msg %s, ", msg_str (msgcode)); */
-/* OBSOLETE printf ("got msg %s\n", msg_str (msg_buf->generic_msg.code)); */
-/* OBSOLETE if (msg_buf->generic_msg.code == ERROR) */
-/* OBSOLETE printf ("%s\n", error_msg_str (msg_buf->error_msg.error_code)); */
-/* OBSOLETE } */
-/* OBSOLETE return (0); /* Failure */ */
-/* OBSOLETE } */
-/* OBSOLETE return (1); /* Success */ */
-/* OBSOLETE } */
-/* OBSOLETE /****************************************************************************/ */
-/* OBSOLETE /* */
-/* OBSOLETE * Determine the MiniMon memory space qualifier based on the addr. */
-/* OBSOLETE * FIXME: Can't distinguis I_ROM/D_ROM. */
-/* OBSOLETE * FIXME: Doesn't know anything about I_CACHE/D_CACHE. */
-/* OBSOLETE */ */
-/* OBSOLETE static int */
-/* OBSOLETE mm_memory_space (CORE_ADDR *addr) */
-/* OBSOLETE { */
-/* OBSOLETE ADDR32 tstart = target_config.I_mem_start; */
-/* OBSOLETE ADDR32 tend = tstart + target_config.I_mem_size; */
-/* OBSOLETE ADDR32 dstart = target_config.D_mem_start; */
-/* OBSOLETE ADDR32 dend = tstart + target_config.D_mem_size; */
-/* OBSOLETE ADDR32 rstart = target_config.ROM_start; */
-/* OBSOLETE ADDR32 rend = tstart + target_config.ROM_size; */
-/* OBSOLETE */
-/* OBSOLETE if (((ADDR32) addr >= tstart) && ((ADDR32) addr < tend)) */
-/* OBSOLETE { */
-/* OBSOLETE return I_MEM; */
-/* OBSOLETE } */
-/* OBSOLETE else if (((ADDR32) addr >= dstart) && ((ADDR32) addr < dend)) */
-/* OBSOLETE { */
-/* OBSOLETE return D_MEM; */
-/* OBSOLETE } */
-/* OBSOLETE else if (((ADDR32) addr >= rstart) && ((ADDR32) addr < rend)) */
-/* OBSOLETE { */
-/* OBSOLETE /* FIXME: how do we determine between D_ROM and I_ROM */ */
-/* OBSOLETE return D_ROM; */
-/* OBSOLETE } */
-/* OBSOLETE else /* FIXME: what do me do now? */ */
-/* OBSOLETE return D_MEM; /* Hmmm! */ */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /****************************************************************************/ */
-/* OBSOLETE /* */
-/* OBSOLETE * Define the target subroutine names */
-/* OBSOLETE */ */
-/* OBSOLETE struct target_ops mm_ops; */
-/* OBSOLETE */
-/* OBSOLETE static void */
-/* OBSOLETE init_mm_ops (void) */
-/* OBSOLETE { */
-/* OBSOLETE mm_ops.to_shortname = "minimon"; */
-/* OBSOLETE mm_ops.to_longname = "Remote AMD/Minimon target"; */
-/* OBSOLETE mm_ops.to_doc = "Remote debug an AMD 290*0 using the MiniMon dbg core on the target"; */
-/* OBSOLETE mm_ops.to_open = mm_open; */
-/* OBSOLETE mm_ops.to_close = mm_close; */
-/* OBSOLETE mm_ops.to_attach = mm_attach; */
-/* OBSOLETE mm_ops.to_post_attach = NULL; */
-/* OBSOLETE mm_ops.to_require_attach = NULL; */
-/* OBSOLETE mm_ops.to_detach = mm_detach; */
-/* OBSOLETE mm_ops.to_require_detach = NULL; */
-/* OBSOLETE mm_ops.to_resume = mm_resume; */
-/* OBSOLETE mm_ops.to_wait = mm_wait; */
-/* OBSOLETE mm_ops.to_post_wait = NULL; */
-/* OBSOLETE mm_ops.to_fetch_registers = mm_fetch_registers; */
-/* OBSOLETE mm_ops.to_store_registers = mm_store_registers; */
-/* OBSOLETE mm_ops.to_prepare_to_store = mm_prepare_to_store; */
-/* OBSOLETE mm_ops.to_xfer_memory = mm_xfer_inferior_memory; */
-/* OBSOLETE mm_ops.to_files_info = mm_files_info; */
-/* OBSOLETE mm_ops.to_insert_breakpoint = mm_insert_breakpoint; */
-/* OBSOLETE mm_ops.to_remove_breakpoint = mm_remove_breakpoint; */
-/* OBSOLETE mm_ops.to_terminal_init = 0; */
-/* OBSOLETE mm_ops.to_terminal_inferior = 0; */
-/* OBSOLETE mm_ops.to_terminal_ours_for_output = 0; */
-/* OBSOLETE mm_ops.to_terminal_ours = 0; */
-/* OBSOLETE mm_ops.to_terminal_info = 0; */
-/* OBSOLETE mm_ops.to_kill = mm_kill; */
-/* OBSOLETE mm_ops.to_load = mm_load; */
-/* OBSOLETE mm_ops.to_lookup_symbol = 0; */
-/* OBSOLETE mm_ops.to_create_inferior = mm_create_inferior; */
-/* OBSOLETE mm_ops.to_post_startup_inferior = NULL; */
-/* OBSOLETE mm_ops.to_acknowledge_created_inferior = NULL; */
-/* OBSOLETE mm_ops.to_clone_and_follow_inferior = NULL; */
-/* OBSOLETE mm_ops.to_post_follow_inferior_by_clone = NULL; */
-/* OBSOLETE mm_ops.to_insert_fork_catchpoint = NULL; */
-/* OBSOLETE mm_ops.to_remove_fork_catchpoint = NULL; */
-/* OBSOLETE mm_ops.to_insert_vfork_catchpoint = NULL; */
-/* OBSOLETE mm_ops.to_remove_vfork_catchpoint = NULL; */
-/* OBSOLETE mm_ops.to_has_forked = NULL; */
-/* OBSOLETE mm_ops.to_has_vforked = NULL; */
-/* OBSOLETE mm_ops.to_can_follow_vfork_prior_to_exec = NULL; */
-/* OBSOLETE mm_ops.to_post_follow_vfork = NULL; */
-/* OBSOLETE mm_ops.to_insert_exec_catchpoint = NULL; */
-/* OBSOLETE mm_ops.to_remove_exec_catchpoint = NULL; */
-/* OBSOLETE mm_ops.to_has_execd = NULL; */
-/* OBSOLETE mm_ops.to_reported_exec_events_per_exec_call = NULL; */
-/* OBSOLETE mm_ops.to_has_exited = NULL; */
-/* OBSOLETE mm_ops.to_mourn_inferior = mm_mourn; */
-/* OBSOLETE mm_ops.to_can_run = 0; */
-/* OBSOLETE mm_ops.to_notice_signals = 0; */
-/* OBSOLETE mm_ops.to_thread_alive = 0; */
-/* OBSOLETE mm_ops.to_stop = 0; */
-/* OBSOLETE mm_ops.to_pid_to_exec_file = NULL; */
-/* OBSOLETE mm_ops.to_stratum = process_stratum; */
-/* OBSOLETE mm_ops.DONT_USE = 0; */
-/* OBSOLETE mm_ops.to_has_all_memory = 1; */
-/* OBSOLETE mm_ops.to_has_memory = 1; */
-/* OBSOLETE mm_ops.to_has_stack = 1; */
-/* OBSOLETE mm_ops.to_has_registers = 1; */
-/* OBSOLETE mm_ops.to_has_execution = 1; */
-/* OBSOLETE mm_ops.to_sections = 0; */
-/* OBSOLETE mm_ops.to_sections_end = 0; */
-/* OBSOLETE mm_ops.to_magic = OPS_MAGIC; */
-/* OBSOLETE }; */
-/* OBSOLETE */
-/* OBSOLETE void */
-/* OBSOLETE _initialize_remote_mm (void) */
-/* OBSOLETE { */
-/* OBSOLETE init_mm_ops (); */
-/* OBSOLETE add_target (&mm_ops); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE #ifdef NO_HIF_SUPPORT */
-/* OBSOLETE service_HIF (union msg_t *msg) */
-/* OBSOLETE { */
-/* OBSOLETE return (0); /* Emulate a failure */ */
-/* OBSOLETE } */
-/* OBSOLETE #endif */
diff --git a/gdb/remote-os9k.c b/gdb/remote-os9k.c
index 2cedfb0..0a703eb 100644
--- a/gdb/remote-os9k.c
+++ b/gdb/remote-os9k.c
@@ -101,7 +101,8 @@ printf_monitor (char *pattern,...)
va_end (args);
if (serial_write (monitor_desc, buf, strlen (buf)))
- fprintf (stderr, "serial_write failed: %s\n", safe_strerror (errno));
+ fprintf_unfiltered (gdb_stderr, "serial_write failed: %s\n",
+ safe_strerror (errno));
}
/* Read a character from the remote system, doing all the fancy timeout stuff */
@@ -380,9 +381,9 @@ rombug_close (int quitting)
if (log_file)
{
if (ferror (log_file))
- fprintf (stderr, "Error writing log file.\n");
+ fprintf_unfiltered (gdb_stderr, "Error writing log file.\n");
if (fclose (log_file) != 0)
- fprintf (stderr, "Error closing log file.\n");
+ fprintf_unfiltered (gdb_stderr, "Error closing log file.\n");
log_file = 0;
}
}
@@ -883,7 +884,7 @@ rombug_insert_breakpoint (CORE_ADDR addr, char *shadow)
return 0;
}
- fprintf (stderr, "Too many breakpoints (> 16) for monitor\n");
+ fprintf_unfiltered (gdb_stderr, "Too many breakpoints (> 16) for monitor\n");
return 1;
}
@@ -908,7 +909,8 @@ rombug_remove_breakpoint (CORE_ADDR addr, char *shadow)
return 0;
}
- fprintf (stderr, "Can't find breakpoint associated with 0x%x\n", addr);
+ fprintf_unfiltered (gdb_stderr,
+ "Can't find breakpoint associated with 0x%x\n", addr);
return 1;
}
@@ -949,7 +951,9 @@ rombug_load (char *arg)
if (serial_write (monitor_desc, buf, bytes_read))
{
- fprintf (stderr, "serial_write failed: (while downloading) %s\n", safe_strerror (errno));
+ fprintf_unfiltered (gdb_stderr,
+ "serial_write failed: (while downloading) %s\n",
+ safe_strerror (errno));
break;
}
i = 0;
diff --git a/gdb/remote-rdi.c b/gdb/remote-rdi.c
index db51dcb..695a302 100644
--- a/gdb/remote-rdi.c
+++ b/gdb/remote-rdi.c
@@ -153,20 +153,20 @@ voiddummy (void *dummy)
}
static void
-myprint (PTR arg, const char *format, va_list ap)
+myprint (void *arg, const char *format, va_list ap)
{
vfprintf_unfiltered (gdb_stdout, format, ap);
}
static void
-mywritec (PTR arg, int c)
+mywritec (void *arg, int c)
{
if (isascii (c))
fputc_unfiltered (c, gdb_stdout);
}
static int
-mywrite (PTR arg, char const *buffer, int len)
+mywrite (void *arg, char const *buffer, int len)
{
int i;
char *e;
@@ -185,7 +185,7 @@ mywrite (PTR arg, char const *buffer, int len)
}
static void
-mypause (PTR arg)
+mypause (void *arg)
{
}
@@ -193,13 +193,13 @@ mypause (PTR arg)
being interrupted more carefully */
static int
-myreadc (PTR arg)
+myreadc (void *arg)
{
return fgetc (stdin);
}
static char *
-mygets (PTR arg, char *buffer, int len)
+mygets (void *arg, char *buffer, int len)
{
return fgets (buffer, len, stdin);
}
@@ -265,7 +265,7 @@ device is attached to the remote system (e.g. /dev/ttya).");
rslt = angel_RDI_open (10, &gdb_config, &gdb_hostif, NULL);
if (rslt == RDIError_BigEndian || rslt == RDIError_LittleEndian)
; /* do nothing, this is the expected return */
- else if (rslt)
+ else if (rslt != RDIError_NoError)
{
printf_filtered ("RDI_open: %s\n", rdi_error_message (rslt));
Adp_CloseDevice ();
@@ -273,33 +273,33 @@ device is attached to the remote system (e.g. /dev/ttya).");
}
rslt = angel_RDI_info (RDIInfo_Target, &arg1, &arg2);
- if (rslt)
+ if (rslt != RDIError_NoError)
{
printf_filtered ("RDI_info: %s\n", rdi_error_message (rslt));
}
rslt = angel_RDI_info (RDIInfo_Points, &arg1, &arg2);
- if (rslt)
+ if (rslt != RDIError_NoError)
{
printf_filtered ("RDI_info: %s\n", rdi_error_message (rslt));
}
rslt = angel_RDI_info (RDIInfo_Step, &arg1, &arg2);
- if (rslt)
+ if (rslt != RDIError_NoError)
{
printf_filtered ("RDI_info: %s\n", rdi_error_message (rslt));
}
rslt = angel_RDI_info (RDIInfo_CoPro, &arg1, &arg2);
- if (rslt)
+ if (rslt != RDIError_NoError)
{
printf_filtered ("RDI_info: %s\n", rdi_error_message (rslt));
}
rslt = angel_RDI_info (RDIInfo_SemiHosting, &arg1, &arg2);
- if (rslt)
+ if (rslt != RDIError_NoError)
{
printf_filtered ("RDI_info: %s\n", rdi_error_message (rslt));
}
rslt = angel_RDI_info (RDIInfo_GetLoadSize, &arg1, &arg2);
- if (rslt)
+ if (rslt != RDIError_NoError)
{
printf_filtered ("RDI_info: %s\n", rdi_error_message (rslt));
}
@@ -310,7 +310,7 @@ device is attached to the remote system (e.g. /dev/ttya).");
target_fetch_registers (-1);
rslt = angel_RDI_open (1, &gdb_config, NULL, NULL);
- if (rslt)
+ if (rslt != RDIError_NoError)
{
printf_filtered ("RDI_open: %s\n", rdi_error_message (rslt));
}
@@ -318,14 +318,14 @@ device is attached to the remote system (e.g. /dev/ttya).");
arg1 = rom_at_zero ? 0x0 : 0x13b;
rslt = angel_RDI_info (RDIVector_Catch, &arg1, &arg2);
- if (rslt)
+ if (rslt != RDIError_NoError)
{
printf_filtered ("RDI_info: %s\n", rdi_error_message (rslt));
}
arg1 = (unsigned long) "";
rslt = angel_RDI_info (RDISet_Cmdline, &arg1, &arg2);
- if (rslt)
+ if (rslt != RDIError_NoError)
{
printf_filtered ("RDI_info: %s\n", rdi_error_message (rslt));
}
@@ -397,7 +397,7 @@ arm_rdi_create_inferior (char *exec_file, char *args, char **env)
top_of_memory);
rslt = angel_RDI_info (RDIInfo_SetTopMem, &top_of_memory, &arg2);
- if (rslt)
+ if (rslt != RDIError_NoError)
{
printf_filtered ("RDI_info: %s\n", rdi_error_message (rslt));
}
@@ -408,7 +408,7 @@ arm_rdi_create_inferior (char *exec_file, char *args, char **env)
arg1 = (unsigned long) arg_buf;
rslt = angel_RDI_info (RDISet_Cmdline, /* &arg1 */ (unsigned long *) arg_buf, &arg2);
- if (rslt)
+ if (rslt != RDIError_NoError)
{
printf_filtered ("RDI_info: %s\n", rdi_error_message (rslt));
}
@@ -437,7 +437,7 @@ arm_rdi_close (int quitting)
if (!closed_already)
{
rslt = angel_RDI_close ();
- if (rslt)
+ if (rslt != RDIError_NoError)
{
printf_filtered ("RDI_close: %s\n", rdi_error_message (rslt));
}
@@ -459,15 +459,13 @@ arm_rdi_resume (ptid_t ptid, int step, enum target_signal siggnal)
if (0 /* turn on when hardware supports single-stepping */ )
{
rslt = angel_RDI_step (1, &point);
- if (rslt)
- {
- printf_filtered ("RDI_step: %s\n", rdi_error_message (rslt));
- }
+ if (rslt != RDIError_NoError)
+ printf_filtered ("RDI_step: %s\n", rdi_error_message (rslt));
}
else
{
char handle[4];
- CORE_ADDR pc;
+ CORE_ADDR pc = 0;
if (step)
{
@@ -475,17 +473,13 @@ arm_rdi_resume (ptid_t ptid, int step, enum target_signal siggnal)
pc = arm_get_next_pc (pc);
arm_rdi_insert_breakpoint (pc, handle);
}
+
execute_status = rslt = angel_RDI_execute (&point);
- if (rslt == RDIError_BreakpointReached)
- ;
- else if (rslt)
- {
- printf_filtered ("RDI_execute: %s\n", rdi_error_message (rslt));
- }
+ if (rslt != RDIError_NoError && rslt != RDIError_BreakpointReached)
+ printf_filtered ("RDI_execute: %s\n", rdi_error_message (rslt));
+
if (step)
- {
- arm_rdi_remove_breakpoint (pc, handle);
- }
+ arm_rdi_remove_breakpoint (pc, handle);
}
}
@@ -541,7 +535,7 @@ arm_rdi_fetch_registers (int regno)
if (regno == -1)
{
rslt = angel_RDI_CPUread (255, 0x27fff, rawregs);
- if (rslt)
+ if (rslt != RDIError_NoError)
{
printf_filtered ("RDI_CPUread: %s\n", rdi_error_message (rslt));
}
@@ -571,7 +565,7 @@ arm_rdi_fetch_registers (int regno)
rdi_regmask = 1 << regno;
rslt = angel_RDI_CPUread (255, rdi_regmask, &rawreg);
- if (rslt)
+ if (rslt != RDIError_NoError)
{
printf_filtered ("RDI_CPUread: %s\n", rdi_error_message (rslt));
}
@@ -618,7 +612,7 @@ arm_rdi_store_registers (int regno)
rdi_regmask = 1 << regno;
rslt = angel_RDI_CPUwrite (255, rdi_regmask, rawerreg);
- if (rslt)
+ if (rslt != RDIError_NoError)
{
printf_filtered ("RDI_CPUwrite: %s\n", rdi_error_message (rslt));
}
@@ -641,7 +635,7 @@ arm_rdi_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len,
if (should_write)
{
rslt = angel_RDI_write (myaddr, memaddr, &len);
- if (rslt)
+ if (rslt != RDIError_NoError)
{
printf_filtered ("RDI_write: %s\n", rdi_error_message (rslt));
}
@@ -649,7 +643,7 @@ arm_rdi_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len,
else
{
rslt = angel_RDI_read (memaddr, myaddr, &len);
- if (rslt)
+ if (rslt != RDIError_NoError)
{
printf_filtered ("RDI_read: %s\n", rdi_error_message (rslt));
len = 0;
@@ -668,7 +662,7 @@ arm_rdi_files_info (struct target_ops *ignore)
unsigned long arg1, arg2;
rslt = angel_RDI_info (RDIInfo_Target, &arg1, &arg2);
- if (rslt)
+ if (rslt != RDIError_NoError)
{
printf_filtered ("RDI_info: %s\n", rdi_error_message (rslt));
}
@@ -680,14 +674,14 @@ arm_rdi_files_info (struct target_ops *ignore)
printf_filtered ("Target is real hardware.\n");
rslt = angel_RDI_info (RDIInfo_Step, &arg1, &arg2);
- if (rslt)
+ if (rslt != RDIError_NoError)
{
printf_filtered ("RDI_info: %s\n", rdi_error_message (rslt));
}
printf_filtered ("Target can%s single-step.\n", (arg1 & 0x4 ? "" : "not"));
rslt = angel_RDI_info (RDIInfo_Icebreaker, &arg1, &arg2);
- if (rslt)
+ if (rslt != RDIError_NoError)
{
printf_filtered ("RDI_info: %s\n", rdi_error_message (rslt));
}
@@ -701,7 +695,7 @@ arm_rdi_kill (void)
int rslt;
rslt = angel_RDI_open (1, &gdb_config, NULL, NULL);
- if (rslt)
+ if (rslt != RDIError_NoError)
{
printf_filtered ("RDI_open: %s\n", rdi_error_message (rslt));
}
@@ -736,7 +730,7 @@ arm_rdi_insert_breakpoint (CORE_ADDR addr, char *contents_cache)
if (arm_pc_is_thumb (addr) || arm_pc_is_thumb_dummy (addr))
type |= RDIPoint_16Bit;
rslt = angel_RDI_setbreak (addr, type, 0, &point);
- if (rslt)
+ if (rslt != RDIError_NoError)
{
printf_filtered ("RDI_setbreak: %s\n", rdi_error_message (rslt));
}
@@ -754,36 +748,27 @@ arm_rdi_remove_breakpoint (CORE_ADDR addr, char *contents_cache)
{
int rslt;
PointHandle point;
- struct local_bp_list_entry *entry, *preventry;
+ struct local_bp_list_entry **entryp, *dead;
- for (entry = local_bp_list; entry != NULL; entry = entry->next)
- {
- if (entry->addr == addr)
- {
- break;
- }
- preventry = entry;
- }
- if (entry)
+ for (entryp = &local_bp_list; *entryp != NULL; entryp = &(*entryp)->next)
+ if ((*entryp)->addr == addr)
+ break;
+
+ if (*entryp)
{
- rslt = angel_RDI_clearbreak (entry->point);
- if (rslt)
- {
- printf_filtered ("RDI_clearbreak: %s\n", rdi_error_message (rslt));
- }
+ dead = *entryp;
+ rslt = angel_RDI_clearbreak (dead->point);
+ if (rslt != RDIError_NoError)
+ printf_filtered ("RDI_clearbreak: %s\n", rdi_error_message (rslt));
+
/* Delete the breakpoint entry locally. */
- if (entry == local_bp_list)
- {
- local_bp_list = entry->next;
- }
- else
- {
- preventry->next = entry->next;
- }
- xfree (entry);
+ *entryp = dead->next;
+ xfree (dead);
}
+
return 0;
}
+
static char *
rdi_error_message (int err)
@@ -1044,7 +1029,7 @@ With a single argument, sets the logfile name to that value.\n\
Without an argument, shows the current logfile name.\n\
See also: rdilogenable\n",
&maintenancelist);
- c->completer = filename_completer;
+ set_cmd_completer (c, filename_completer);
add_cmd ("rdilogenable", class_maintenance,
rdilogenable_command,
@@ -1057,22 +1042,20 @@ Withough an argument, it will display current state.\n",
&maintenancelist);
add_show_from_set
- (add_set_cmd ("rdiromatzero", no_class,
- var_boolean, (char *) &rom_at_zero,
- "Set target has ROM at addr 0.\n\
+ (add_set_boolean_cmd ("rdiromatzero", no_class, &rom_at_zero,
+ "Set target has ROM at addr 0.\n\
A true value disables vector catching, false enables vector catching.\n\
This is evaluated at the time the 'target rdi' command is executed\n",
- &setlist),
+ &setlist),
&showlist);
add_show_from_set
- (add_set_cmd ("rdiheartbeat", no_class,
- var_boolean, (char *) &rdi_heartbeat,
- "Set enable for ADP heartbeat packets.\n\
+ (add_set_boolean_cmd ("rdiheartbeat", no_class, &rdi_heartbeat,
+ "Set enable for ADP heartbeat packets.\n\
I don't know why you would want this. If you enable them,\n\
it will confuse ARM and EPI JTAG interface boxes as well\n\
as the Angel Monitor.\n",
- &setlist),
+ &setlist),
&showlist);
}
diff --git a/gdb/remote-rdp.c b/gdb/remote-rdp.c
index 2f9183a..f6ccf1e 100644
--- a/gdb/remote-rdp.c
+++ b/gdb/remote-rdp.c
@@ -1164,7 +1164,7 @@ remote_rdp_open (char *args, int from_tty)
registers_changed ();
stop_pc = read_pc ();
set_current_frame (create_new_frame (read_fp (), stop_pc));
- select_frame (get_current_frame (), 0);
+ select_frame (get_current_frame ());
print_stack_frame (selected_frame, -1, 1);
}
diff --git a/gdb/remote-st.c b/gdb/remote-st.c
index 46d8eab..c27ddeb 100644
--- a/gdb/remote-st.c
+++ b/gdb/remote-st.c
@@ -79,7 +79,8 @@ printf_stdebug (char *pattern,...)
va_end (args);
if (serial_write (st2000_desc, buf, strlen (buf)))
- fprintf (stderr, "serial_write failed: %s\n", safe_strerror (errno));
+ fprintf_unfiltered (gdb_stderr, "serial_write failed: %s\n",
+ safe_strerror (errno));
}
/* Read a character from the remote system, doing all the fancy timeout
@@ -324,9 +325,9 @@ st2000_close (int quitting)
if (log_file)
{
if (ferror (log_file))
- fprintf (stderr, "Error writing log file.\n");
+ fprintf_unfiltered (gdb_stderr, "Error writing log file.\n");
if (fclose (log_file) != 0)
- fprintf (stderr, "Error closing log file.\n");
+ fprintf_unfiltered (gdb_stderr, "Error closing log file.\n");
}
#endif
}
@@ -616,7 +617,7 @@ st2000_insert_breakpoint (CORE_ADDR addr, char *shadow)
return 0;
}
- fprintf (stderr, "Too many breakpoints (> 16) for STDBUG\n");
+ fprintf_unfiltered (gdb_stderr, "Too many breakpoints (> 16) for STDBUG\n");
return 1;
}
@@ -635,7 +636,8 @@ st2000_remove_breakpoint (CORE_ADDR addr, char *shadow)
return 0;
}
- fprintf (stderr, "Can't find breakpoint associated with 0x%x\n", addr);
+ fprintf_unfiltered (gdb_stderr,
+ "Can't find breakpoint associated with 0x%x\n", addr);
return 1;
}
diff --git a/gdb/remote-udi.c b/gdb/remote-udi.c
deleted file mode 100644
index f7863a8..0000000
--- a/gdb/remote-udi.c
+++ /dev/null
@@ -1,1722 +0,0 @@
-/* OBSOLETE /* Remote debugging interface for AMD 29k interfaced via UDI, for GDB. */
-/* OBSOLETE Copyright 1990, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 */
-/* OBSOLETE Free Software Foundation, Inc. */
-/* OBSOLETE Written by Daniel Mann. Contributed by AMD. */
-/* 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. */ */
-/* OBSOLETE */
-/* OBSOLETE /* This is like remote.c but uses the Universal Debug Interface (UDI) to */
-/* OBSOLETE talk to the target hardware (or simulator). UDI is a TCP/IP based */
-/* OBSOLETE protocol; for hardware that doesn't run TCP, an interface adapter */
-/* OBSOLETE daemon talks UDI on one side, and talks to the hardware (typically */
-/* OBSOLETE over a serial port) on the other side. */
-/* OBSOLETE */
-/* OBSOLETE - Originally written by Daniel Mann at AMD for MiniMON and gdb 3.91.6. */
-/* OBSOLETE - David Wood (wood@lab.ultra.nyu.edu) at New York University adapted this */
-/* OBSOLETE file to gdb 3.95. I was unable to get this working on sun3os4 */
-/* OBSOLETE with termio, only with sgtty. */
-/* OBSOLETE - Daniel Mann at AMD took the 3.95 adaptions above and replaced */
-/* OBSOLETE MiniMON interface with UDI-p interface. */ */
-/* OBSOLETE */
-/* OBSOLETE #include "defs.h" */
-/* OBSOLETE #include "frame.h" */
-/* OBSOLETE #include "inferior.h" */
-/* OBSOLETE #include "value.h" */
-/* OBSOLETE #include <ctype.h> */
-/* OBSOLETE #include <fcntl.h> */
-/* OBSOLETE #include <errno.h> */
-/* OBSOLETE #include "gdb_string.h" */
-/* OBSOLETE #include "terminal.h" */
-/* OBSOLETE #include "target.h" */
-/* OBSOLETE #include "29k-share/udi/udiproc.h" */
-/* OBSOLETE #include "gdbcmd.h" */
-/* OBSOLETE #include "bfd.h" */
-/* OBSOLETE #include "gdbcore.h" /* For download function */ */
-/* OBSOLETE #include "regcache.h" */
-/* OBSOLETE */
-/* OBSOLETE /* access the register store directly, without going through */
-/* OBSOLETE the normal handler functions. This avoids an extra data copy. */ */
-/* OBSOLETE */
-/* OBSOLETE extern int stop_soon_quietly; /* for wait_for_inferior */ */
-/* OBSOLETE extern struct value *call_function_by_hand (); */
-/* OBSOLETE static void udi_resume (ptid_t ptid, int step, enum target_signal sig); */
-/* OBSOLETE static void udi_fetch_registers (int regno); */
-/* OBSOLETE static void udi_load (char *args, int from_tty); */
-/* OBSOLETE static void fetch_register (int regno); */
-/* OBSOLETE static void udi_store_registers (int regno); */
-/* OBSOLETE static int store_register (int regno); */
-/* OBSOLETE static int regnum_to_srnum (int regno); */
-/* OBSOLETE static void udi_close (int quitting); */
-/* OBSOLETE static CPUSpace udi_memory_space (CORE_ADDR addr); */
-/* OBSOLETE static int udi_write_inferior_memory (CORE_ADDR memaddr, char *myaddr, */
-/* OBSOLETE int len); */
-/* OBSOLETE static int udi_read_inferior_memory (CORE_ADDR memaddr, char *myaddr, */
-/* OBSOLETE int len); */
-/* OBSOLETE static void download (char *load_arg_string, int from_tty); */
-/* OBSOLETE char CoffFileName[100] = ""; */
-/* OBSOLETE */
-/* OBSOLETE #define FREEZE_MODE (read_register(CPS_REGNUM) & 0x400) */
-/* OBSOLETE #define USE_SHADOW_PC ((processor_type == a29k_freeze_mode) && FREEZE_MODE) */
-/* OBSOLETE */
-/* OBSOLETE static int timeout = 5; */
-/* OBSOLETE extern struct target_ops udi_ops; /* Forward declaration */ */
-/* OBSOLETE */
-/* OBSOLETE /* Special register enumeration. */
-/* OBSOLETE */ */
-/* OBSOLETE */
-/* OBSOLETE /******************************************************************* UDI DATA*/ */
-/* OBSOLETE #define MAXDATA 2*1024 /* max UDI[read/write] byte size */ */
-/* OBSOLETE /* Descriptor for I/O to remote machine. Initialize it to -1 so that */
-/* OBSOLETE udi_open knows that we don't have a file open when the program */
-/* OBSOLETE starts. */ */
-/* OBSOLETE */
-/* OBSOLETE UDISessionId udi_session_id = -1; */
-/* OBSOLETE static char *udi_config_id; */
-/* OBSOLETE */
-/* OBSOLETE CPUOffset IMemStart = 0; */
-/* OBSOLETE CPUSizeT IMemSize = 0; */
-/* OBSOLETE CPUOffset DMemStart = 0; */
-/* OBSOLETE CPUSizeT DMemSize = 0; */
-/* OBSOLETE CPUOffset RMemStart = 0; */
-/* OBSOLETE CPUSizeT RMemSize = 0; */
-/* OBSOLETE UDIUInt32 CPUPRL; */
-/* OBSOLETE UDIUInt32 CoProcPRL; */
-/* OBSOLETE */
-/* OBSOLETE UDIMemoryRange address_ranges[2]; /* Text and data */ */
-/* OBSOLETE UDIResource entry = */
-/* OBSOLETE {0, 0}; /* Entry point */ */
-/* OBSOLETE CPUSizeT stack_sizes[2]; /* Regular and memory stacks */ */
-/* OBSOLETE */
-/* OBSOLETE #define SBUF_MAX 1024 /* maximum size of string handling buffer */ */
-/* OBSOLETE char sbuf[SBUF_MAX]; */
-/* OBSOLETE */
-/* OBSOLETE typedef struct bkpt_entry_str */
-/* OBSOLETE { */
-/* OBSOLETE UDIResource Addr; */
-/* OBSOLETE UDIUInt32 PassCount; */
-/* OBSOLETE UDIBreakType Type; */
-/* OBSOLETE unsigned int BreakId; */
-/* OBSOLETE } */
-/* OBSOLETE bkpt_entry_t; */
-/* OBSOLETE #define BKPT_TABLE_SIZE 40 */
-/* OBSOLETE static bkpt_entry_t bkpt_table[BKPT_TABLE_SIZE]; */
-/* OBSOLETE extern char dfe_errmsg[]; /* error string */ */
-/* OBSOLETE */
-/* OBSOLETE /* malloc'd name of the program on the remote system. */ */
-/* OBSOLETE static char *prog_name = NULL; */
-/* OBSOLETE */
-/* OBSOLETE /* This is called not only when we first attach, but also when the */
-/* OBSOLETE user types "run" after having attached. */ */
-/* OBSOLETE */
-/* OBSOLETE static void */
-/* OBSOLETE udi_create_inferior (char *execfile, char *args, char **env) */
-/* OBSOLETE { */
-/* OBSOLETE char *args1; */
-/* OBSOLETE */
-/* OBSOLETE if (execfile) */
-/* OBSOLETE { */
-/* OBSOLETE if (prog_name != NULL) */
-/* OBSOLETE xfree (prog_name); */
-/* OBSOLETE prog_name = savestring (execfile, strlen (execfile)); */
-/* OBSOLETE } */
-/* OBSOLETE else if (entry.Offset) */
-/* OBSOLETE execfile = ""; */
-/* OBSOLETE else */
-/* OBSOLETE error ("No image loaded into target."); */
-/* OBSOLETE */
-/* OBSOLETE if (udi_session_id < 0) */
-/* OBSOLETE { */
-/* OBSOLETE /* If the TIP is not open, open it. */ */
-/* OBSOLETE if (UDIConnect (udi_config_id, &udi_session_id)) */
-/* OBSOLETE error ("UDIConnect() failed: %s\n", dfe_errmsg); */
-/* OBSOLETE /* We will need to download the program. */ */
-/* OBSOLETE entry.Offset = 0; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE inferior_ptid = pid_to_ptid (40000); */
-/* OBSOLETE */
-/* OBSOLETE if (!entry.Offset) */
-/* OBSOLETE download (execfile, 0); */
-/* OBSOLETE */
-/* OBSOLETE args1 = alloca (strlen (execfile) + strlen (args) + 2); */
-/* OBSOLETE */
-/* OBSOLETE if (execfile[0] == '\0') */
-/* OBSOLETE */
-/* OBSOLETE /* It is empty. We need to quote it somehow, or else the target */
-/* OBSOLETE will think there is no argument being passed here. According */
-/* OBSOLETE to the UDI spec it is quoted "according to TIP OS rules" which */
-/* OBSOLETE I guess means quoting it like the Unix shell should work */
-/* OBSOLETE (sounds pretty bogus to me...). In fact it doesn't work (with */
-/* OBSOLETE isstip anyway), but passing in two quotes as the argument seems */
-/* OBSOLETE like a reasonable enough behavior anyway (I guess). */ */
-/* OBSOLETE */
-/* OBSOLETE strcpy (args1, "''"); */
-/* OBSOLETE else */
-/* OBSOLETE strcpy (args1, execfile); */
-/* OBSOLETE strcat (args1, " "); */
-/* OBSOLETE strcat (args1, args); */
-/* OBSOLETE */
-/* OBSOLETE UDIInitializeProcess (address_ranges, /* ProcessMemory[] */ */
-/* OBSOLETE (UDIInt) 2, /* NumberOfRanges */ */
-/* OBSOLETE entry, /* EntryPoint */ */
-/* OBSOLETE stack_sizes, /* *StackSizes */ */
-/* OBSOLETE (UDIInt) 2, /* NumberOfStacks */ */
-/* OBSOLETE args1); /* ArgString */ */
-/* OBSOLETE */
-/* OBSOLETE init_wait_for_inferior (); */
-/* OBSOLETE clear_proceed_status (); */
-/* OBSOLETE proceed (-1, TARGET_SIGNAL_DEFAULT, 0); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE static void */
-/* OBSOLETE udi_mourn (void) */
-/* OBSOLETE { */
-/* OBSOLETE #if 0 */
-/* OBSOLETE /* Requiring "target udi" each time you run is a major pain. I suspect */
-/* OBSOLETE this was just blindy copied from remote.c, in which "target" and */
-/* OBSOLETE "run" are combined. Having a udi target without an inferior seems */
-/* OBSOLETE to work between "target udi" and "run", so why not now? */ */
-/* OBSOLETE pop_target (); /* Pop back to no-child state */ */
-/* OBSOLETE #endif */
-/* OBSOLETE /* But if we're going to want to run it again, we better remove the */
-/* OBSOLETE breakpoints... */ */
-/* OBSOLETE remove_breakpoints (); */
-/* OBSOLETE generic_mourn_inferior (); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /******************************************************************** UDI_OPEN */
-/* OBSOLETE ** Open a connection to remote TIP. */
-/* OBSOLETE NAME is the socket domain used for communication with the TIP, */
-/* OBSOLETE then a space and the socket name or TIP-host name. */
-/* OBSOLETE '<udi_udi_config_id>' for example. */
-/* OBSOLETE */ */
-/* OBSOLETE */
-/* OBSOLETE /* XXX - need cleanups for udiconnect for various failures!!! */ */
-/* OBSOLETE */
-/* OBSOLETE static void */
-/* OBSOLETE udi_open (char *name, int from_tty) */
-/* OBSOLETE { */
-/* OBSOLETE unsigned int prl; */
-/* OBSOLETE char *p; */
-/* OBSOLETE int cnt; */
-/* OBSOLETE UDIMemoryRange KnownMemory[10]; */
-/* OBSOLETE UDIUInt32 ChipVersions[10]; */
-/* OBSOLETE UDIInt NumberOfRanges = 10; */
-/* OBSOLETE UDIInt NumberOfChips = 10; */
-/* OBSOLETE UDIPId PId; */
-/* OBSOLETE UDIUInt32 TIPId, TargetId, DFEId, DFE, TIP, DFEIPCId, TIPIPCId; */
-/* OBSOLETE */
-/* OBSOLETE target_preopen (from_tty); */
-/* OBSOLETE */
-/* OBSOLETE entry.Offset = 0; */
-/* OBSOLETE */
-/* OBSOLETE for (cnt = 0; cnt < BKPT_TABLE_SIZE; cnt++) */
-/* OBSOLETE bkpt_table[cnt].Type = 0; */
-/* OBSOLETE */
-/* OBSOLETE if (udi_config_id) */
-/* OBSOLETE xfree (udi_config_id); */
-/* OBSOLETE */
-/* OBSOLETE if (!name) */
-/* OBSOLETE error ("Usage: target udi config_id, where config_id appears in udi_soc file"); */
-/* OBSOLETE */
-/* OBSOLETE udi_config_id = xstrdup (strtok (name, " \t")); */
-/* OBSOLETE */
-/* OBSOLETE if (UDIConnect (udi_config_id, &udi_session_id)) */
-/* OBSOLETE /* FIXME: Should set udi_session_id to -1 here. */ */
-/* OBSOLETE error ("UDIConnect() failed: %s\n", dfe_errmsg); */
-/* OBSOLETE */
-/* OBSOLETE push_target (&udi_ops); */
-/* OBSOLETE */
-/* OBSOLETE /* */
-/* OBSOLETE ** Initialize target configuration structure (global) */
-/* OBSOLETE */ */
-/* OBSOLETE if (UDIGetTargetConfig (KnownMemory, &NumberOfRanges, */
-/* OBSOLETE ChipVersions, &NumberOfChips)) */
-/* OBSOLETE error ("UDIGetTargetConfig() failed"); */
-/* OBSOLETE if (NumberOfChips > 2) */
-/* OBSOLETE fprintf_unfiltered (gdb_stderr, "Target has more than one processor\n"); */
-/* OBSOLETE for (cnt = 0; cnt < NumberOfRanges; cnt++) */
-/* OBSOLETE { */
-/* OBSOLETE switch (KnownMemory[cnt].Space) */
-/* OBSOLETE { */
-/* OBSOLETE default: */
-/* OBSOLETE fprintf_unfiltered (gdb_stderr, "UDIGetTargetConfig() unknown memory space\n"); */
-/* OBSOLETE break; */
-/* OBSOLETE case UDI29KCP_S: */
-/* OBSOLETE break; */
-/* OBSOLETE case UDI29KIROMSpace: */
-/* OBSOLETE RMemStart = KnownMemory[cnt].Offset; */
-/* OBSOLETE RMemSize = KnownMemory[cnt].Size; */
-/* OBSOLETE break; */
-/* OBSOLETE case UDI29KIRAMSpace: */
-/* OBSOLETE IMemStart = KnownMemory[cnt].Offset; */
-/* OBSOLETE IMemSize = KnownMemory[cnt].Size; */
-/* OBSOLETE break; */
-/* OBSOLETE case UDI29KDRAMSpace: */
-/* OBSOLETE DMemStart = KnownMemory[cnt].Offset; */
-/* OBSOLETE DMemSize = KnownMemory[cnt].Size; */
-/* OBSOLETE break; */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE a29k_get_processor_type (); */
-/* OBSOLETE */
-/* OBSOLETE if (UDICreateProcess (&PId)) */
-/* OBSOLETE fprintf_unfiltered (gdb_stderr, "UDICreateProcess() failed\n"); */
-/* OBSOLETE */
-/* OBSOLETE /* Print out some stuff, letting the user now what's going on */ */
-/* OBSOLETE if (UDICapabilities (&TIPId, &TargetId, DFEId, DFE, &TIP, &DFEIPCId, */
-/* OBSOLETE &TIPIPCId, sbuf)) */
-/* OBSOLETE error ("UDICapabilities() failed"); */
-/* OBSOLETE if (from_tty) */
-/* OBSOLETE { */
-/* OBSOLETE printf_filtered ("Connected via UDI socket,\n\ */
-/* OBSOLETE DFE-IPC version %x.%x.%x TIP-IPC version %x.%x.%x TIP version %x.%x.%x\n %s\n", */
-/* OBSOLETE (DFEIPCId >> 8) & 0xf, (DFEIPCId >> 4) & 0xf, DFEIPCId & 0xf, */
-/* OBSOLETE (TIPIPCId >> 8) & 0xf, (TIPIPCId >> 4) & 0xf, TIPIPCId & 0xf, */
-/* OBSOLETE (TargetId >> 8) & 0xf, (TargetId >> 4) & 0xf, TargetId & 0xf, */
-/* OBSOLETE sbuf); */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /******************************************************************* UDI_CLOSE */
-/* OBSOLETE Close the open connection to the TIP process. */
-/* OBSOLETE Use this when you want to detach and do something else */
-/* OBSOLETE with your gdb. */ */
-/* OBSOLETE static void */
-/* OBSOLETE udi_close ( /*FIXME: how is quitting used */ */
-/* OBSOLETE int quitting) */
-/* OBSOLETE { */
-/* OBSOLETE if (udi_session_id < 0) */
-/* OBSOLETE return; */
-/* OBSOLETE */
-/* OBSOLETE /* We should never get here if there isn't something valid in */
-/* OBSOLETE udi_session_id. */ */
-/* OBSOLETE */
-/* OBSOLETE if (UDIDisconnect (udi_session_id, UDITerminateSession)) */
-/* OBSOLETE { */
-/* OBSOLETE if (quitting) */
-/* OBSOLETE warning ("UDIDisconnect() failed in udi_close"); */
-/* OBSOLETE else */
-/* OBSOLETE error ("UDIDisconnect() failed in udi_close"); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Do not try to close udi_session_id again, later in the program. */ */
-/* OBSOLETE udi_session_id = -1; */
-/* OBSOLETE inferior_ptid = null_ptid; */
-/* OBSOLETE */
-/* OBSOLETE printf_filtered (" Ending remote debugging\n"); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /**************************************************************** UDI_ATACH */ */
-/* OBSOLETE /* Attach to a program that is already loaded and running */
-/* OBSOLETE * Upon exiting the process's execution is stopped. */
-/* OBSOLETE */ */
-/* OBSOLETE static void */
-/* OBSOLETE udi_attach (char *args, int from_tty) */
-/* OBSOLETE { */
-/* OBSOLETE UDIResource From; */
-/* OBSOLETE UDIInt32 PC_adds; */
-/* OBSOLETE UDICount Count = 1; */
-/* OBSOLETE UDISizeT Size = 4; */
-/* OBSOLETE UDICount CountDone; */
-/* OBSOLETE UDIBool HostEndian = 0; */
-/* OBSOLETE UDIError err; */
-/* OBSOLETE */
-/* OBSOLETE if (args == NULL) */
-/* OBSOLETE error_no_arg ("program to attach"); */
-/* OBSOLETE */
-/* OBSOLETE if (udi_session_id < 0) */
-/* OBSOLETE error ("UDI connection not opened yet, use the 'target udi' command.\n"); */
-/* OBSOLETE */
-/* OBSOLETE if (from_tty) */
-/* OBSOLETE printf_unfiltered ("Attaching to remote program %s...\n", prog_name); */
-/* OBSOLETE */
-/* OBSOLETE UDIStop (); */
-/* OBSOLETE From.Space = UDI29KSpecialRegs; */
-/* OBSOLETE From.Offset = 11; */
-/* OBSOLETE if (err = UDIRead (From, &PC_adds, Count, Size, &CountDone, HostEndian)) */
-/* OBSOLETE error ("UDIRead failed in udi_attach"); */
-/* OBSOLETE printf_unfiltered ("Remote process is now halted, pc1 = 0x%x.\n", PC_adds); */
-/* OBSOLETE } */
-/* OBSOLETE /************************************************************* UDI_DETACH */ */
-/* OBSOLETE /* Terminate the open connection to the TIP process. */
-/* OBSOLETE Use this when you want to detach and do something else */
-/* OBSOLETE with your gdb. Leave remote process running (with no breakpoints set). */ */
-/* OBSOLETE static void */
-/* OBSOLETE udi_detach (char *args, int from_tty) */
-/* OBSOLETE { */
-/* OBSOLETE */
-/* OBSOLETE remove_breakpoints (); /* Just in case there were any left in */ */
-/* OBSOLETE */
-/* OBSOLETE if (UDIDisconnect (udi_session_id, UDIContinueSession)) */
-/* OBSOLETE error ("UDIDisconnect() failed in udi_detach"); */
-/* OBSOLETE */
-/* OBSOLETE /* Don't try to UDIDisconnect it again in udi_close, which is called from */
-/* OBSOLETE pop_target. */ */
-/* OBSOLETE udi_session_id = -1; */
-/* OBSOLETE inferior_ptid = null_ptid; */
-/* OBSOLETE */
-/* OBSOLETE pop_target (); */
-/* OBSOLETE */
-/* OBSOLETE if (from_tty) */
-/* OBSOLETE printf_unfiltered ("Detaching from TIP\n"); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE */
-/* OBSOLETE /****************************************************************** UDI_RESUME */
-/* OBSOLETE ** Tell the remote machine to resume. */ */
-/* OBSOLETE */
-/* OBSOLETE static void */
-/* OBSOLETE udi_resume (ptid_t ptid, int step, enum target_signal sig) */
-/* OBSOLETE { */
-/* OBSOLETE UDIError tip_error; */
-/* OBSOLETE UDIUInt32 Steps = 1; */
-/* OBSOLETE UDIStepType StepType = UDIStepNatural; */
-/* OBSOLETE UDIRange Range; */
-/* OBSOLETE */
-/* OBSOLETE if (step) /* step 1 instruction */ */
-/* OBSOLETE { */
-/* OBSOLETE tip_error = UDIStep (Steps, StepType, Range); */
-/* OBSOLETE if (!tip_error) */
-/* OBSOLETE return; */
-/* OBSOLETE */
-/* OBSOLETE fprintf_unfiltered (gdb_stderr, "UDIStep() error = %d\n", tip_error); */
-/* OBSOLETE error ("failed in udi_resume"); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE if (UDIExecute ()) */
-/* OBSOLETE error ("UDIExecute() failed in udi_resume"); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /******************************************************************** UDI_WAIT */
-/* OBSOLETE ** Wait until the remote machine stops, then return, */
-/* OBSOLETE storing status in STATUS just as `wait' would. */ */
-/* OBSOLETE */
-/* OBSOLETE static ptid_t */
-/* OBSOLETE udi_wait (ptid_t ptid, struct target_waitstatus *status) */
-/* OBSOLETE { */
-/* OBSOLETE UDIInt32 MaxTime; */
-/* OBSOLETE UDIPId PId; */
-/* OBSOLETE UDIInt32 StopReason; */
-/* OBSOLETE UDISizeT CountDone; */
-/* OBSOLETE int old_timeout = timeout; */
-/* OBSOLETE int old_immediate_quit = immediate_quit; */
-/* OBSOLETE int i; */
-/* OBSOLETE */
-/* OBSOLETE status->kind = TARGET_WAITKIND_EXITED; */
-/* OBSOLETE status->value.integer = 0; */
-/* OBSOLETE */
-/* OBSOLETE /* wait for message to arrive. It should be: */
-/* OBSOLETE If the target stops executing, udi_wait() should return. */
-/* OBSOLETE */ */
-/* OBSOLETE timeout = 0; /* Wait indefinetly for a message */ */
-/* OBSOLETE immediate_quit = 1; /* Helps ability to QUIT */ */
-/* OBSOLETE */
-/* OBSOLETE while (1) */
-/* OBSOLETE { */
-/* OBSOLETE i = 0; */
-/* OBSOLETE MaxTime = UDIWaitForever; */
-/* OBSOLETE UDIWait (MaxTime, &PId, &StopReason); */
-/* OBSOLETE QUIT; /* Let user quit if they want */ */
-/* OBSOLETE */
-/* OBSOLETE switch (StopReason & UDIGrossState) */
-/* OBSOLETE { */
-/* OBSOLETE case UDIStdoutReady: */
-/* OBSOLETE if (UDIGetStdout (sbuf, (UDISizeT) SBUF_MAX, &CountDone)) */
-/* OBSOLETE /* This is said to happen if the program tries to output */
-/* OBSOLETE a whole bunch of output (more than SBUF_MAX, I would */
-/* OBSOLETE guess). It doesn't seem to happen with the simulator. */ */
-/* OBSOLETE warning ("UDIGetStdout() failed in udi_wait"); */
-/* OBSOLETE fwrite (sbuf, 1, CountDone, stdout); */
-/* OBSOLETE gdb_flush (gdb_stdout); */
-/* OBSOLETE continue; */
-/* OBSOLETE */
-/* OBSOLETE case UDIStderrReady: */
-/* OBSOLETE UDIGetStderr (sbuf, (UDISizeT) SBUF_MAX, &CountDone); */
-/* OBSOLETE fwrite (sbuf, 1, CountDone, stderr); */
-/* OBSOLETE gdb_flush (gdb_stderr); */
-/* OBSOLETE continue; */
-/* OBSOLETE */
-/* OBSOLETE case UDIStdinNeeded: */
-/* OBSOLETE { */
-/* OBSOLETE int ch; */
-/* OBSOLETE i = 0; */
-/* OBSOLETE do */
-/* OBSOLETE { */
-/* OBSOLETE ch = getchar (); */
-/* OBSOLETE if (ch == EOF) */
-/* OBSOLETE break; */
-/* OBSOLETE sbuf[i++] = ch; */
-/* OBSOLETE } */
-/* OBSOLETE while (i < SBUF_MAX && ch != '\n'); */
-/* OBSOLETE UDIPutStdin (sbuf, (UDISizeT) i, &CountDone); */
-/* OBSOLETE continue; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE case UDIRunning: */
-/* OBSOLETE /* In spite of the fact that we told UDIWait to wait forever, it will */
-/* OBSOLETE return spuriously sometimes. */ */
-/* OBSOLETE case UDIStdinModeX: */
-/* OBSOLETE continue; */
-/* OBSOLETE default: */
-/* OBSOLETE break; */
-/* OBSOLETE } */
-/* OBSOLETE break; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE switch (StopReason & UDIGrossState) */
-/* OBSOLETE { */
-/* OBSOLETE case UDITrapped: */
-/* OBSOLETE printf_unfiltered ("Am290*0 received vector number %d\n", StopReason >> 24); */
-/* OBSOLETE */
-/* OBSOLETE switch ((StopReason >> 8) & 0xff) */
-/* OBSOLETE { */
-/* OBSOLETE case 0: /* Illegal opcode */ */
-/* OBSOLETE printf_unfiltered (" (break point)\n"); */
-/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */
-/* OBSOLETE status->value.sig = TARGET_SIGNAL_TRAP; */
-/* OBSOLETE break; */
-/* OBSOLETE case 1: /* Unaligned Access */ */
-/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */
-/* OBSOLETE status->value.sig = TARGET_SIGNAL_BUS; */
-/* OBSOLETE break; */
-/* OBSOLETE case 3: */
-/* OBSOLETE case 4: */
-/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */
-/* OBSOLETE status->value.sig = TARGET_SIGNAL_FPE; */
-/* OBSOLETE break; */
-/* OBSOLETE case 5: /* Protection Violation */ */
-/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */
-/* OBSOLETE /* Why not SEGV? What is a Protection Violation? */ */
-/* OBSOLETE status->value.sig = TARGET_SIGNAL_ILL; */
-/* OBSOLETE break; */
-/* OBSOLETE case 6: */
-/* OBSOLETE case 7: */
-/* OBSOLETE case 8: /* User Instruction Mapping Miss */ */
-/* OBSOLETE case 9: /* User Data Mapping Miss */ */
-/* OBSOLETE case 10: /* Supervisor Instruction Mapping Miss */ */
-/* OBSOLETE case 11: /* Supervisor Data Mapping Miss */ */
-/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */
-/* OBSOLETE status->value.sig = TARGET_SIGNAL_SEGV; */
-/* OBSOLETE break; */
-/* OBSOLETE case 12: */
-/* OBSOLETE case 13: */
-/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */
-/* OBSOLETE status->value.sig = TARGET_SIGNAL_ILL; */
-/* OBSOLETE break; */
-/* OBSOLETE case 14: /* Timer */ */
-/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */
-/* OBSOLETE status->value.sig = TARGET_SIGNAL_ALRM; */
-/* OBSOLETE break; */
-/* OBSOLETE case 15: /* Trace */ */
-/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */
-/* OBSOLETE status->value.sig = TARGET_SIGNAL_TRAP; */
-/* OBSOLETE break; */
-/* OBSOLETE case 16: /* INTR0 */ */
-/* OBSOLETE case 17: /* INTR1 */ */
-/* OBSOLETE case 18: /* INTR2 */ */
-/* OBSOLETE case 19: /* INTR3/Internal */ */
-/* OBSOLETE case 20: /* TRAP0 */ */
-/* OBSOLETE case 21: /* TRAP1 */ */
-/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */
-/* OBSOLETE status->value.sig = TARGET_SIGNAL_INT; */
-/* OBSOLETE break; */
-/* OBSOLETE case 22: /* Floating-Point Exception */ */
-/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */
-/* OBSOLETE /* Why not FPE? */ */
-/* OBSOLETE status->value.sig = TARGET_SIGNAL_ILL; */
-/* OBSOLETE break; */
-/* OBSOLETE case 77: /* assert 77 */ */
-/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */
-/* OBSOLETE status->value.sig = TARGET_SIGNAL_TRAP; */
-/* OBSOLETE break; */
-/* OBSOLETE default: */
-/* OBSOLETE status->kind = TARGET_WAITKIND_EXITED; */
-/* OBSOLETE status->value.integer = 0; */
-/* OBSOLETE } */
-/* OBSOLETE break; */
-/* OBSOLETE case UDINotExecuting: */
-/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */
-/* OBSOLETE status->value.sig = TARGET_SIGNAL_TERM; */
-/* OBSOLETE break; */
-/* OBSOLETE case UDIStopped: */
-/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */
-/* OBSOLETE status->value.sig = TARGET_SIGNAL_TSTP; */
-/* OBSOLETE break; */
-/* OBSOLETE case UDIWarned: */
-/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */
-/* OBSOLETE status->value.sig = TARGET_SIGNAL_URG; */
-/* OBSOLETE break; */
-/* OBSOLETE case UDIStepped: */
-/* OBSOLETE case UDIBreak: */
-/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */
-/* OBSOLETE status->value.sig = TARGET_SIGNAL_TRAP; */
-/* OBSOLETE break; */
-/* OBSOLETE case UDIWaiting: */
-/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */
-/* OBSOLETE status->value.sig = TARGET_SIGNAL_STOP; */
-/* OBSOLETE break; */
-/* OBSOLETE case UDIHalted: */
-/* OBSOLETE status->kind = TARGET_WAITKIND_STOPPED; */
-/* OBSOLETE status->value.sig = TARGET_SIGNAL_KILL; */
-/* OBSOLETE break; */
-/* OBSOLETE case UDIExited: */
-/* OBSOLETE default: */
-/* OBSOLETE status->kind = TARGET_WAITKIND_EXITED; */
-/* OBSOLETE status->value.integer = 0; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE timeout = old_timeout; /* Restore original timeout value */ */
-/* OBSOLETE immediate_quit = old_immediate_quit; */
-/* OBSOLETE return inferior_ptid; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE #if 0 */
-/* OBSOLETE /* Handy for debugging */ */
-/* OBSOLETE udi_pc (void) */
-/* OBSOLETE { */
-/* OBSOLETE UDIResource From; */
-/* OBSOLETE UDIUInt32 *To; */
-/* OBSOLETE UDICount Count; */
-/* OBSOLETE UDISizeT Size = 4; */
-/* OBSOLETE UDICount CountDone; */
-/* OBSOLETE UDIBool HostEndian = 0; */
-/* OBSOLETE UDIError err; */
-/* OBSOLETE int pc[2]; */
-/* OBSOLETE unsigned long myregs[256]; */
-/* OBSOLETE int i; */
-/* OBSOLETE */
-/* OBSOLETE From.Space = UDI29KPC; */
-/* OBSOLETE From.Offset = 0; */
-/* OBSOLETE To = (UDIUInt32 *) pc; */
-/* OBSOLETE Count = 2; */
-/* OBSOLETE */
-/* OBSOLETE err = UDIRead (From, To, Count, Size, &CountDone, HostEndian); */
-/* OBSOLETE */
-/* OBSOLETE printf_unfiltered ("err = %d, CountDone = %d, pc[0] = 0x%x, pc[1] = 0x%x\n", */
-/* OBSOLETE err, CountDone, pc[0], pc[1]); */
-/* OBSOLETE */
-/* OBSOLETE udi_fetch_registers (-1); */
-/* OBSOLETE */
-/* OBSOLETE printf_unfiltered ("other pc1 = 0x%x, pc0 = 0x%x\n", *(int *) &registers[4 * PC_REGNUM], */
-/* OBSOLETE *(int *) &registers[4 * NPC_REGNUM]); */
-/* OBSOLETE */
-/* OBSOLETE /* Now, read all the registers globally */ */
-/* OBSOLETE */
-/* OBSOLETE From.Space = UDI29KGlobalRegs; */
-/* OBSOLETE From.Offset = 0; */
-/* OBSOLETE err = UDIRead (From, myregs, 256, 4, &CountDone, HostEndian); */
-/* OBSOLETE */
-/* OBSOLETE printf ("err = %d, CountDone = %d\n", err, CountDone); */
-/* OBSOLETE */
-/* OBSOLETE printf ("\n"); */
-/* OBSOLETE */
-/* OBSOLETE for (i = 0; i < 256; i += 2) */
-/* OBSOLETE printf ("%d:\t%#10x\t%11d\t%#10x\t%11d\n", i, myregs[i], myregs[i], */
-/* OBSOLETE myregs[i + 1], myregs[i + 1]); */
-/* OBSOLETE printf ("\n"); */
-/* OBSOLETE */
-/* OBSOLETE return pc[0]; */
-/* OBSOLETE } */
-/* OBSOLETE #endif */
-/* OBSOLETE */
-/* OBSOLETE /********************************************************** UDI_FETCH_REGISTERS */
-/* OBSOLETE * Read a remote register 'regno'. */
-/* OBSOLETE * If regno==-1 then read all the registers. */
-/* OBSOLETE */ */
-/* OBSOLETE static void */
-/* OBSOLETE udi_fetch_registers (int regno) */
-/* OBSOLETE { */
-/* OBSOLETE UDIResource From; */
-/* OBSOLETE UDIUInt32 *To; */
-/* OBSOLETE UDICount Count; */
-/* OBSOLETE UDISizeT Size = 4; */
-/* OBSOLETE UDICount CountDone; */
-/* OBSOLETE UDIBool HostEndian = 0; */
-/* OBSOLETE UDIError err; */
-/* OBSOLETE int i; */
-/* OBSOLETE */
-/* OBSOLETE if (regno >= 0) */
-/* OBSOLETE { */
-/* OBSOLETE fetch_register (regno); */
-/* OBSOLETE return; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Gr1/rsp */ */
-/* OBSOLETE */
-/* OBSOLETE From.Space = UDI29KGlobalRegs; */
-/* OBSOLETE From.Offset = 1; */
-/* OBSOLETE To = (UDIUInt32 *) & registers[4 * GR1_REGNUM]; */
-/* OBSOLETE Count = 1; */
-/* OBSOLETE if (err = UDIRead (From, To, Count, Size, &CountDone, HostEndian)) */
-/* OBSOLETE error ("UDIRead() failed in udi_fetch_registers"); */
-/* OBSOLETE */
-/* OBSOLETE register_valid[GR1_REGNUM] = 1; */
-/* OBSOLETE */
-/* OBSOLETE #if defined(GR64_REGNUM) /* Read gr64-127 */ */
-/* OBSOLETE */
-/* OBSOLETE /* Global Registers gr64-gr95 */ */
-/* OBSOLETE */
-/* OBSOLETE From.Space = UDI29KGlobalRegs; */
-/* OBSOLETE From.Offset = 64; */
-/* OBSOLETE To = (UDIUInt32 *) & registers[4 * GR64_REGNUM]; */
-/* OBSOLETE Count = 32; */
-/* OBSOLETE if (err = UDIRead (From, To, Count, Size, &CountDone, HostEndian)) */
-/* OBSOLETE error ("UDIRead() failed in udi_fetch_registers"); */
-/* OBSOLETE */
-/* OBSOLETE for (i = GR64_REGNUM; i < GR64_REGNUM + 32; i++) */
-/* OBSOLETE register_valid[i] = 1; */
-/* OBSOLETE */
-/* OBSOLETE #endif /* GR64_REGNUM */ */
-/* OBSOLETE */
-/* OBSOLETE /* Global Registers gr96-gr127 */ */
-/* OBSOLETE */
-/* OBSOLETE From.Space = UDI29KGlobalRegs; */
-/* OBSOLETE From.Offset = 96; */
-/* OBSOLETE To = (UDIUInt32 *) & registers[4 * GR96_REGNUM]; */
-/* OBSOLETE Count = 32; */
-/* OBSOLETE if (err = UDIRead (From, To, Count, Size, &CountDone, HostEndian)) */
-/* OBSOLETE error ("UDIRead() failed in udi_fetch_registers"); */
-/* OBSOLETE */
-/* OBSOLETE for (i = GR96_REGNUM; i < GR96_REGNUM + 32; i++) */
-/* OBSOLETE register_valid[i] = 1; */
-/* OBSOLETE */
-/* OBSOLETE /* Local Registers */ */
-/* OBSOLETE */
-/* OBSOLETE From.Space = UDI29KLocalRegs; */
-/* OBSOLETE From.Offset = 0; */
-/* OBSOLETE To = (UDIUInt32 *) & registers[4 * LR0_REGNUM]; */
-/* OBSOLETE Count = 128; */
-/* OBSOLETE if (err = UDIRead (From, To, Count, Size, &CountDone, HostEndian)) */
-/* OBSOLETE error ("UDIRead() failed in udi_fetch_registers"); */
-/* OBSOLETE */
-/* OBSOLETE for (i = LR0_REGNUM; i < LR0_REGNUM + 128; i++) */
-/* OBSOLETE register_valid[i] = 1; */
-/* OBSOLETE */
-/* OBSOLETE /* Protected Special Registers */ */
-/* OBSOLETE */
-/* OBSOLETE From.Space = UDI29KSpecialRegs; */
-/* OBSOLETE From.Offset = 0; */
-/* OBSOLETE To = (UDIUInt32 *) & registers[4 * SR_REGNUM (0)]; */
-/* OBSOLETE Count = 15; */
-/* OBSOLETE if (err = UDIRead (From, To, Count, Size, &CountDone, HostEndian)) */
-/* OBSOLETE error ("UDIRead() failed in udi_fetch_registers"); */
-/* OBSOLETE */
-/* OBSOLETE for (i = SR_REGNUM (0); i < SR_REGNUM (0) + 15; i++) */
-/* OBSOLETE register_valid[i] = 1; */
-/* OBSOLETE */
-/* OBSOLETE if (USE_SHADOW_PC) */
-/* OBSOLETE { /* Let regno_to_srnum() handle the register number */ */
-/* OBSOLETE fetch_register (NPC_REGNUM); */
-/* OBSOLETE fetch_register (PC_REGNUM); */
-/* OBSOLETE fetch_register (PC2_REGNUM); */
-/* OBSOLETE */
-/* OBSOLETE /* Unprotected Special Registers sr128-sr135 */ */
-/* OBSOLETE */
-/* OBSOLETE From.Space = UDI29KSpecialRegs; */
-/* OBSOLETE From.Offset = 128; */
-/* OBSOLETE To = (UDIUInt32 *) & registers[4 * SR_REGNUM (128)]; */
-/* OBSOLETE Count = 135 - 128 + 1; */
-/* OBSOLETE if (err = UDIRead (From, To, Count, Size, &CountDone, HostEndian)) */
-/* OBSOLETE error ("UDIRead() failed in udi_fetch_registers"); */
-/* OBSOLETE */
-/* OBSOLETE for (i = SR_REGNUM (128); i < SR_REGNUM (128) + 135 - 128 + 1; i++) */
-/* OBSOLETE register_valid[i] = 1; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE if (remote_debug) */
-/* OBSOLETE { */
-/* OBSOLETE fprintf_unfiltered (gdb_stdlog, "Fetching all registers\n"); */
-/* OBSOLETE fprintf_unfiltered (gdb_stdlog, */
-/* OBSOLETE "Fetching PC0 = 0x%x, PC1 = 0x%x, PC2 = 0x%x\n", */
-/* OBSOLETE read_register (NPC_REGNUM), */
-/* OBSOLETE read_register (PC_REGNUM), */
-/* OBSOLETE read_register (PC2_REGNUM)); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* There doesn't seem to be any way to get these. */ */
-/* OBSOLETE { */
-/* OBSOLETE int val = -1; */
-/* OBSOLETE supply_register (FPE_REGNUM, (char *) &val); */
-/* OBSOLETE supply_register (INTE_REGNUM, (char *) &val); */
-/* OBSOLETE supply_register (FPS_REGNUM, (char *) &val); */
-/* OBSOLETE supply_register (EXO_REGNUM, (char *) &val); */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE */
-/* OBSOLETE /********************************************************* UDI_STORE_REGISTERS */
-/* OBSOLETE ** Store register regno into the target. */
-/* OBSOLETE * If regno==-1 then store all the registers. */
-/* OBSOLETE */ */
-/* OBSOLETE */
-/* OBSOLETE static void */
-/* OBSOLETE udi_store_registers (int regno) */
-/* OBSOLETE { */
-/* OBSOLETE UDIUInt32 *From; */
-/* OBSOLETE UDIResource To; */
-/* OBSOLETE UDICount Count; */
-/* OBSOLETE UDISizeT Size = 4; */
-/* OBSOLETE UDICount CountDone; */
-/* OBSOLETE UDIBool HostEndian = 0; */
-/* OBSOLETE */
-/* OBSOLETE if (regno >= 0) */
-/* OBSOLETE { */
-/* OBSOLETE store_register (regno); */
-/* OBSOLETE return; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE if (remote_debug) */
-/* OBSOLETE { */
-/* OBSOLETE fprintf_unfiltered (gdb_stdlog, "Storing all registers\n"); */
-/* OBSOLETE fprintf_unfiltered (gdb_stdlog, */
-/* OBSOLETE "PC0 = 0x%x, PC1 = 0x%x, PC2 = 0x%x\n", */
-/* OBSOLETE read_register (NPC_REGNUM), */
-/* OBSOLETE read_register (PC_REGNUM), */
-/* OBSOLETE read_register (PC2_REGNUM)); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Gr1/rsp */ */
-/* OBSOLETE */
-/* OBSOLETE From = (UDIUInt32 *) & registers[4 * GR1_REGNUM]; */
-/* OBSOLETE To.Space = UDI29KGlobalRegs; */
-/* OBSOLETE To.Offset = 1; */
-/* OBSOLETE Count = 1; */
-/* OBSOLETE if (UDIWrite (From, To, Count, Size, &CountDone, HostEndian)) */
-/* OBSOLETE error ("UDIWrite() failed in udi_store_regisetrs"); */
-/* OBSOLETE */
-/* OBSOLETE #if defined(GR64_REGNUM) */
-/* OBSOLETE */
-/* OBSOLETE /* Global registers gr64-gr95 */ */
-/* OBSOLETE */
-/* OBSOLETE From = (UDIUInt32 *) & registers[4 * GR64_REGNUM]; */
-/* OBSOLETE To.Space = UDI29KGlobalRegs; */
-/* OBSOLETE To.Offset = 64; */
-/* OBSOLETE Count = 32; */
-/* OBSOLETE if (UDIWrite (From, To, Count, Size, &CountDone, HostEndian)) */
-/* OBSOLETE error ("UDIWrite() failed in udi_store_regisetrs"); */
-/* OBSOLETE */
-/* OBSOLETE #endif /* GR64_REGNUM */ */
-/* OBSOLETE */
-/* OBSOLETE /* Global registers gr96-gr127 */ */
-/* OBSOLETE */
-/* OBSOLETE From = (UDIUInt32 *) & registers[4 * GR96_REGNUM]; */
-/* OBSOLETE To.Space = UDI29KGlobalRegs; */
-/* OBSOLETE To.Offset = 96; */
-/* OBSOLETE Count = 32; */
-/* OBSOLETE if (UDIWrite (From, To, Count, Size, &CountDone, HostEndian)) */
-/* OBSOLETE error ("UDIWrite() failed in udi_store_regisetrs"); */
-/* OBSOLETE */
-/* OBSOLETE /* Local Registers */ */
-/* OBSOLETE */
-/* OBSOLETE From = (UDIUInt32 *) & registers[4 * LR0_REGNUM]; */
-/* OBSOLETE To.Space = UDI29KLocalRegs; */
-/* OBSOLETE To.Offset = 0; */
-/* OBSOLETE Count = 128; */
-/* OBSOLETE if (UDIWrite (From, To, Count, Size, &CountDone, HostEndian)) */
-/* OBSOLETE error ("UDIWrite() failed in udi_store_regisetrs"); */
-/* OBSOLETE */
-/* OBSOLETE */
-/* OBSOLETE /* Protected Special Registers *//* VAB through TMR */ */
-/* OBSOLETE */
-/* OBSOLETE From = (UDIUInt32 *) & registers[4 * SR_REGNUM (0)]; */
-/* OBSOLETE To.Space = UDI29KSpecialRegs; */
-/* OBSOLETE To.Offset = 0; */
-/* OBSOLETE Count = 10; */
-/* OBSOLETE if (UDIWrite (From, To, Count, Size, &CountDone, HostEndian)) */
-/* OBSOLETE error ("UDIWrite() failed in udi_store_regisetrs"); */
-/* OBSOLETE */
-/* OBSOLETE /* PC0, PC1, PC2 possibly as shadow registers */ */
-/* OBSOLETE */
-/* OBSOLETE From = (UDIUInt32 *) & registers[4 * SR_REGNUM (10)]; */
-/* OBSOLETE To.Space = UDI29KSpecialRegs; */
-/* OBSOLETE Count = 3; */
-/* OBSOLETE if (USE_SHADOW_PC) */
-/* OBSOLETE To.Offset = 20; /* SPC0 */ */
-/* OBSOLETE else */
-/* OBSOLETE To.Offset = 10; /* PC0 */ */
-/* OBSOLETE if (UDIWrite (From, To, Count, Size, &CountDone, HostEndian)) */
-/* OBSOLETE error ("UDIWrite() failed in udi_store_regisetrs"); */
-/* OBSOLETE */
-/* OBSOLETE /* PC1 via UDI29KPC */ */
-/* OBSOLETE */
-/* OBSOLETE From = (UDIUInt32 *) & registers[4 * PC_REGNUM]; */
-/* OBSOLETE To.Space = UDI29KPC; */
-/* OBSOLETE To.Offset = 0; /* PC1 */ */
-/* OBSOLETE Count = 1; */
-/* OBSOLETE if (UDIWrite (From, To, Count, Size, &CountDone, HostEndian)) */
-/* OBSOLETE error ("UDIWrite() failed in udi_store_regisetrs"); */
-/* OBSOLETE */
-/* OBSOLETE /* LRU and MMU */ */
-/* OBSOLETE */
-/* OBSOLETE From = (UDIUInt32 *) & registers[4 * SR_REGNUM (13)]; */
-/* OBSOLETE To.Space = UDI29KSpecialRegs; */
-/* OBSOLETE To.Offset = 13; */
-/* OBSOLETE Count = 2; */
-/* OBSOLETE if (UDIWrite (From, To, Count, Size, &CountDone, HostEndian)) */
-/* OBSOLETE error ("UDIWrite() failed in udi_store_regisetrs"); */
-/* OBSOLETE */
-/* OBSOLETE /* Unprotected Special Registers */ */
-/* OBSOLETE */
-/* OBSOLETE From = (UDIUInt32 *) & registers[4 * SR_REGNUM (128)]; */
-/* OBSOLETE To.Space = UDI29KSpecialRegs; */
-/* OBSOLETE To.Offset = 128; */
-/* OBSOLETE Count = 135 - 128 + 1; */
-/* OBSOLETE if (UDIWrite (From, To, Count, Size, &CountDone, HostEndian)) */
-/* OBSOLETE error ("UDIWrite() failed in udi_store_regisetrs"); */
-/* OBSOLETE */
-/* OBSOLETE registers_changed (); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /****************************************************** UDI_PREPARE_TO_STORE */ */
-/* OBSOLETE /* Get ready to modify the registers array. On machines which store */
-/* OBSOLETE individual registers, this doesn't need to do anything. On machines */
-/* OBSOLETE which store all the registers in one fell swoop, this makes sure */
-/* OBSOLETE that registers contains all the registers from the program being */
-/* OBSOLETE debugged. */ */
-/* OBSOLETE */
-/* OBSOLETE static void */
-/* OBSOLETE udi_prepare_to_store (void) */
-/* OBSOLETE { */
-/* OBSOLETE /* Do nothing, since we can store individual regs */ */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /********************************************************** TRANSLATE_ADDR */ */
-/* OBSOLETE static CORE_ADDR */
-/* OBSOLETE translate_addr (CORE_ADDR addr) */
-/* OBSOLETE { */
-/* OBSOLETE #if defined(ULTRA3) && defined(KERNEL_DEBUGGING) */
-/* OBSOLETE /* Check for a virtual address in the kernel */ */
-/* OBSOLETE /* Assume physical address of ublock is in paddr_u register */ */
-/* OBSOLETE /* FIXME: doesn't work for user virtual addresses */ */
-/* OBSOLETE if (addr >= UVADDR) */
-/* OBSOLETE { */
-/* OBSOLETE /* PADDR_U register holds the physical address of the ublock */ */
-/* OBSOLETE CORE_ADDR i = (CORE_ADDR) read_register (PADDR_U_REGNUM); */
-/* OBSOLETE return (i + addr - (CORE_ADDR) UVADDR); */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE { */
-/* OBSOLETE return (addr); */
-/* OBSOLETE } */
-/* OBSOLETE #else */
-/* OBSOLETE return (addr); */
-/* OBSOLETE #endif */
-/* OBSOLETE } */
-/* OBSOLETE /************************************************* UDI_XFER_INFERIOR_MEMORY */ */
-/* OBSOLETE /* FIXME! Merge these two. */ */
-/* OBSOLETE static int */
-/* OBSOLETE udi_xfer_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len, int write, */
-/* OBSOLETE struct mem_attrib *attrib ATTRIBUTE_UNUSED, */
-/* OBSOLETE struct target_ops *target ATTRIBUTE_UNUSED) */
-/* OBSOLETE { */
-/* OBSOLETE */
-/* OBSOLETE memaddr = translate_addr (memaddr); */
-/* OBSOLETE */
-/* OBSOLETE if (write) */
-/* OBSOLETE return udi_write_inferior_memory (memaddr, myaddr, len); */
-/* OBSOLETE else */
-/* OBSOLETE return udi_read_inferior_memory (memaddr, myaddr, len); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /********************************************************** UDI_FILES_INFO */ */
-/* OBSOLETE static void */
-/* OBSOLETE udi_files_info (struct target_ops *target) */
-/* OBSOLETE { */
-/* OBSOLETE printf_unfiltered ("\tAttached to UDI socket to %s", udi_config_id); */
-/* OBSOLETE if (prog_name != NULL) */
-/* OBSOLETE printf_unfiltered ("and running program %s", prog_name); */
-/* OBSOLETE printf_unfiltered (".\n"); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /**************************************************** UDI_INSERT_BREAKPOINT */ */
-/* OBSOLETE static int */
-/* OBSOLETE udi_insert_breakpoint (CORE_ADDR addr, char *contents_cache) */
-/* OBSOLETE { */
-/* OBSOLETE int cnt; */
-/* OBSOLETE UDIError err; */
-/* OBSOLETE */
-/* OBSOLETE for (cnt = 0; cnt < BKPT_TABLE_SIZE; cnt++) */
-/* OBSOLETE if (bkpt_table[cnt].Type == 0) /* Find first free slot */ */
-/* OBSOLETE break; */
-/* OBSOLETE */
-/* OBSOLETE if (cnt >= BKPT_TABLE_SIZE) */
-/* OBSOLETE error ("Too many breakpoints set"); */
-/* OBSOLETE */
-/* OBSOLETE bkpt_table[cnt].Addr.Offset = addr; */
-/* OBSOLETE bkpt_table[cnt].Addr.Space = UDI29KIRAMSpace; */
-/* OBSOLETE bkpt_table[cnt].PassCount = 1; */
-/* OBSOLETE bkpt_table[cnt].Type = UDIBreakFlagExecute; */
-/* OBSOLETE */
-/* OBSOLETE err = UDISetBreakpoint (bkpt_table[cnt].Addr, */
-/* OBSOLETE bkpt_table[cnt].PassCount, */
-/* OBSOLETE bkpt_table[cnt].Type, */
-/* OBSOLETE &bkpt_table[cnt].BreakId); */
-/* OBSOLETE */
-/* OBSOLETE if (err == 0) */
-/* OBSOLETE return 0; /* Success */ */
-/* OBSOLETE */
-/* OBSOLETE bkpt_table[cnt].Type = 0; */
-/* OBSOLETE error ("UDISetBreakpoint returned error code %d\n", err); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /**************************************************** UDI_REMOVE_BREAKPOINT */ */
-/* OBSOLETE static int */
-/* OBSOLETE udi_remove_breakpoint (CORE_ADDR addr, char *contents_cache) */
-/* OBSOLETE { */
-/* OBSOLETE int cnt; */
-/* OBSOLETE UDIError err; */
-/* OBSOLETE */
-/* OBSOLETE for (cnt = 0; cnt < BKPT_TABLE_SIZE; cnt++) */
-/* OBSOLETE if (bkpt_table[cnt].Addr.Offset == addr) /* Find matching breakpoint */ */
-/* OBSOLETE break; */
-/* OBSOLETE */
-/* OBSOLETE if (cnt >= BKPT_TABLE_SIZE) */
-/* OBSOLETE error ("Can't find breakpoint in table"); */
-/* OBSOLETE */
-/* OBSOLETE bkpt_table[cnt].Type = 0; */
-/* OBSOLETE */
-/* OBSOLETE err = UDIClearBreakpoint (bkpt_table[cnt].BreakId); */
-/* OBSOLETE if (err == 0) */
-/* OBSOLETE return 0; /* Success */ */
-/* OBSOLETE */
-/* OBSOLETE error ("UDIClearBreakpoint returned error code %d\n", err); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE static void */
-/* OBSOLETE udi_kill (void) */
-/* OBSOLETE { */
-/* OBSOLETE */
-/* OBSOLETE #if 0 */
-/* OBSOLETE /* */
-/* OBSOLETE UDIStop does not really work as advertised. It causes the TIP to close it's */
-/* OBSOLETE connection, which usually results in GDB dying with a SIGPIPE. For now, we */
-/* OBSOLETE just invoke udi_close, which seems to get things right. */
-/* OBSOLETE */ */
-/* OBSOLETE UDIStop (); */
-/* OBSOLETE */
-/* OBSOLETE udi_session_id = -1; */
-/* OBSOLETE inferior_ptid = null_ptid; */
-/* OBSOLETE */
-/* OBSOLETE if (from_tty) */
-/* OBSOLETE printf_unfiltered ("Target has been stopped."); */
-/* OBSOLETE #endif /* 0 */ */
-/* OBSOLETE #if 0 */
-/* OBSOLETE udi_close (0); */
-/* OBSOLETE pop_target (); */
-/* OBSOLETE #endif /* 0 */ */
-/* OBSOLETE */
-/* OBSOLETE /* Keep the target around, e.g. so "run" can do the right thing when */
-/* OBSOLETE we are already debugging something. */ */
-/* OBSOLETE */
-/* OBSOLETE if (UDIDisconnect (udi_session_id, UDITerminateSession)) */
-/* OBSOLETE { */
-/* OBSOLETE warning ("UDIDisconnect() failed"); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Do not try to close udi_session_id again, later in the program. */ */
-/* OBSOLETE udi_session_id = -1; */
-/* OBSOLETE inferior_ptid = null_ptid; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* */
-/* OBSOLETE Load a program into the target. Args are: `program {options}'. The options */
-/* OBSOLETE are used to control loading of the program, and are NOT passed onto the */
-/* OBSOLETE loaded code as arguments. (You need to use the `run' command to do that.) */
-/* OBSOLETE */
-/* OBSOLETE The options are: */
-/* OBSOLETE -ms %d Set mem stack size to %d */
-/* OBSOLETE -rs %d Set regular stack size to %d */
-/* OBSOLETE -i send init info (default) */
-/* OBSOLETE -noi don't send init info */
-/* OBSOLETE -[tT] Load Text section */
-/* OBSOLETE -[dD] Load Data section */
-/* OBSOLETE -[bB] Load BSS section */
-/* OBSOLETE -[lL] Load Lit section */
-/* OBSOLETE */ */
-/* OBSOLETE */
-/* OBSOLETE static void */
-/* OBSOLETE download (char *load_arg_string, int from_tty) */
-/* OBSOLETE { */
-/* OBSOLETE #define DEFAULT_MEM_STACK_SIZE 0x6000 */
-/* OBSOLETE #define DEFAULT_REG_STACK_SIZE 0x2000 */
-/* OBSOLETE */
-/* OBSOLETE char *token; */
-/* OBSOLETE char *filename; */
-/* OBSOLETE asection *section; */
-/* OBSOLETE bfd *pbfd; */
-/* OBSOLETE UDIError err; */
-/* OBSOLETE int load_text = 1, load_data = 1, load_bss = 1, load_lit = 1; */
-/* OBSOLETE */
-/* OBSOLETE address_ranges[0].Space = UDI29KIRAMSpace; */
-/* OBSOLETE address_ranges[0].Offset = 0xffffffff; */
-/* OBSOLETE address_ranges[0].Size = 0; */
-/* OBSOLETE */
-/* OBSOLETE address_ranges[1].Space = UDI29KDRAMSpace; */
-/* OBSOLETE address_ranges[1].Offset = 0xffffffff; */
-/* OBSOLETE address_ranges[1].Size = 0; */
-/* OBSOLETE */
-/* OBSOLETE stack_sizes[0] = DEFAULT_REG_STACK_SIZE; */
-/* OBSOLETE stack_sizes[1] = DEFAULT_MEM_STACK_SIZE; */
-/* OBSOLETE */
-/* OBSOLETE dont_repeat (); */
-/* OBSOLETE */
-/* OBSOLETE filename = strtok (load_arg_string, " \t"); */
-/* OBSOLETE if (!filename) */
-/* OBSOLETE error ("Must specify at least a file name with the load command"); */
-/* OBSOLETE */
-/* OBSOLETE filename = tilde_expand (filename); */
-/* OBSOLETE make_cleanup (xfree, filename); */
-/* OBSOLETE */
-/* OBSOLETE while (token = strtok (NULL, " \t")) */
-/* OBSOLETE { */
-/* OBSOLETE if (token[0] == '-') */
-/* OBSOLETE { */
-/* OBSOLETE token++; */
-/* OBSOLETE */
-/* OBSOLETE if (STREQ (token, "ms")) */
-/* OBSOLETE stack_sizes[1] = atol (strtok (NULL, " \t")); */
-/* OBSOLETE else if (STREQ (token, "rs")) */
-/* OBSOLETE stack_sizes[0] = atol (strtok (NULL, " \t")); */
-/* OBSOLETE else */
-/* OBSOLETE { */
-/* OBSOLETE load_text = load_data = load_bss = load_lit = 0; */
-/* OBSOLETE */
-/* OBSOLETE while (*token) */
-/* OBSOLETE { */
-/* OBSOLETE switch (*token++) */
-/* OBSOLETE { */
-/* OBSOLETE case 't': */
-/* OBSOLETE case 'T': */
-/* OBSOLETE load_text = 1; */
-/* OBSOLETE break; */
-/* OBSOLETE case 'd': */
-/* OBSOLETE case 'D': */
-/* OBSOLETE load_data = 1; */
-/* OBSOLETE break; */
-/* OBSOLETE case 'b': */
-/* OBSOLETE case 'B': */
-/* OBSOLETE load_bss = 1; */
-/* OBSOLETE break; */
-/* OBSOLETE case 'l': */
-/* OBSOLETE case 'L': */
-/* OBSOLETE load_lit = 1; */
-/* OBSOLETE break; */
-/* OBSOLETE default: */
-/* OBSOLETE error ("Unknown UDI load option -%s", token - 1); */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE pbfd = bfd_openr (filename, gnutarget); */
-/* OBSOLETE */
-/* OBSOLETE if (!pbfd) */
-/* OBSOLETE /* FIXME: should be using bfd_errmsg, not assuming it was */
-/* OBSOLETE bfd_error_system_call. */ */
-/* OBSOLETE perror_with_name (filename); */
-/* OBSOLETE */
-/* OBSOLETE /* FIXME: should be checking for errors from bfd_close (for one thing, */
-/* OBSOLETE on error it does not free all the storage associated with the */
-/* OBSOLETE bfd). */ */
-/* OBSOLETE make_cleanup_bfd_close (pbfd); */
-/* OBSOLETE */
-/* OBSOLETE QUIT; */
-/* OBSOLETE immediate_quit++; */
-/* OBSOLETE */
-/* OBSOLETE if (!bfd_check_format (pbfd, bfd_object)) */
-/* OBSOLETE error ("It doesn't seem to be an object file"); */
-/* OBSOLETE */
-/* OBSOLETE for (section = pbfd->sections; section; section = section->next) */
-/* OBSOLETE { */
-/* OBSOLETE if (bfd_get_section_flags (pbfd, section) & SEC_ALLOC) */
-/* OBSOLETE { */
-/* OBSOLETE UDIResource To; */
-/* OBSOLETE UDICount Count; */
-/* OBSOLETE unsigned long section_size, section_end; */
-/* OBSOLETE const char *section_name; */
-/* OBSOLETE */
-/* OBSOLETE section_name = bfd_get_section_name (pbfd, section); */
-/* OBSOLETE if (STREQ (section_name, ".text") && !load_text) */
-/* OBSOLETE continue; */
-/* OBSOLETE else if (STREQ (section_name, ".data") && !load_data) */
-/* OBSOLETE continue; */
-/* OBSOLETE else if (STREQ (section_name, ".bss") && !load_bss) */
-/* OBSOLETE continue; */
-/* OBSOLETE else if (STREQ (section_name, ".lit") && !load_lit) */
-/* OBSOLETE continue; */
-/* OBSOLETE */
-/* OBSOLETE To.Offset = bfd_get_section_vma (pbfd, section); */
-/* OBSOLETE section_size = bfd_section_size (pbfd, section); */
-/* OBSOLETE section_end = To.Offset + section_size; */
-/* OBSOLETE */
-/* OBSOLETE if (section_size == 0) */
-/* OBSOLETE /* This is needed at least in the BSS case, where the code */
-/* OBSOLETE below starts writing before it even checks the size. */ */
-/* OBSOLETE continue; */
-/* OBSOLETE */
-/* OBSOLETE printf_unfiltered ("[Loading section %s at %x (%d bytes)]\n", */
-/* OBSOLETE section_name, */
-/* OBSOLETE To.Offset, */
-/* OBSOLETE section_size); */
-/* OBSOLETE */
-/* OBSOLETE if (bfd_get_section_flags (pbfd, section) & SEC_CODE) */
-/* OBSOLETE { */
-/* OBSOLETE To.Space = UDI29KIRAMSpace; */
-/* OBSOLETE */
-/* OBSOLETE address_ranges[0].Offset = min (address_ranges[0].Offset, */
-/* OBSOLETE To.Offset); */
-/* OBSOLETE address_ranges[0].Size = max (address_ranges[0].Size, */
-/* OBSOLETE section_end */
-/* OBSOLETE - address_ranges[0].Offset); */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE { */
-/* OBSOLETE To.Space = UDI29KDRAMSpace; */
-/* OBSOLETE */
-/* OBSOLETE address_ranges[1].Offset = min (address_ranges[1].Offset, */
-/* OBSOLETE To.Offset); */
-/* OBSOLETE address_ranges[1].Size = max (address_ranges[1].Size, */
-/* OBSOLETE section_end */
-/* OBSOLETE - address_ranges[1].Offset); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE if (bfd_get_section_flags (pbfd, section) & SEC_LOAD) /* Text, data or lit */ */
-/* OBSOLETE { */
-/* OBSOLETE file_ptr fptr; */
-/* OBSOLETE */
-/* OBSOLETE fptr = 0; */
-/* OBSOLETE */
-/* OBSOLETE while (section_size > 0) */
-/* OBSOLETE { */
-/* OBSOLETE char buffer[1024]; */
-/* OBSOLETE */
-/* OBSOLETE Count = min (section_size, 1024); */
-/* OBSOLETE */
-/* OBSOLETE bfd_get_section_contents (pbfd, section, buffer, fptr, */
-/* OBSOLETE Count); */
-/* OBSOLETE */
-/* OBSOLETE err = UDIWrite ((UDIHostMemPtr) buffer, /* From */ */
-/* OBSOLETE To, /* To */ */
-/* OBSOLETE Count, /* Count */ */
-/* OBSOLETE (UDISizeT) 1, /* Size */ */
-/* OBSOLETE &Count, /* CountDone */ */
-/* OBSOLETE (UDIBool) 0); /* HostEndian */ */
-/* OBSOLETE if (err) */
-/* OBSOLETE error ("UDIWrite failed, error = %d", err); */
-/* OBSOLETE */
-/* OBSOLETE To.Offset += Count; */
-/* OBSOLETE fptr += Count; */
-/* OBSOLETE section_size -= Count; */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE /* BSS */ */
-/* OBSOLETE { */
-/* OBSOLETE UDIResource From; */
-/* OBSOLETE unsigned long zero = 0; */
-/* OBSOLETE */
-/* OBSOLETE /* Write a zero byte at the vma */ */
-/* OBSOLETE /* FIXME: Broken for sections of 1-3 bytes (we test for */
-/* OBSOLETE zero above). */ */
-/* OBSOLETE err = UDIWrite ((UDIHostMemPtr) & zero, /* From */ */
-/* OBSOLETE To, /* To */ */
-/* OBSOLETE (UDICount) 1, /* Count */ */
-/* OBSOLETE (UDISizeT) 4, /* Size */ */
-/* OBSOLETE &Count, /* CountDone */ */
-/* OBSOLETE (UDIBool) 0); /* HostEndian */ */
-/* OBSOLETE if (err) */
-/* OBSOLETE error ("UDIWrite failed, error = %d", err); */
-/* OBSOLETE */
-/* OBSOLETE From = To; */
-/* OBSOLETE To.Offset += 4; */
-/* OBSOLETE */
-/* OBSOLETE /* Now, duplicate it for the length of the BSS */ */
-/* OBSOLETE err = UDICopy (From, /* From */ */
-/* OBSOLETE To, /* To */ */
-/* OBSOLETE (UDICount) (section_size / 4 - 1), /* Count */ */
-/* OBSOLETE (UDISizeT) 4, /* Size */ */
-/* OBSOLETE &Count, /* CountDone */ */
-/* OBSOLETE (UDIBool) 1); /* Direction */ */
-/* OBSOLETE if (err) */
-/* OBSOLETE { */
-/* OBSOLETE char message[100]; */
-/* OBSOLETE int xerr; */
-/* OBSOLETE */
-/* OBSOLETE xerr = UDIGetErrorMsg (err, 100, message, &Count); */
-/* OBSOLETE if (!xerr) */
-/* OBSOLETE fprintf_unfiltered (gdb_stderr, "Error is %s\n", message); */
-/* OBSOLETE else */
-/* OBSOLETE fprintf_unfiltered (gdb_stderr, "xerr is %d\n", xerr); */
-/* OBSOLETE error ("UDICopy failed, error = %d", err); */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE entry.Space = UDI29KIRAMSpace; */
-/* OBSOLETE entry.Offset = bfd_get_start_address (pbfd); */
-/* OBSOLETE */
-/* OBSOLETE immediate_quit--; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /* Function to download an image into the remote target. */ */
-/* OBSOLETE */
-/* OBSOLETE static void */
-/* OBSOLETE udi_load (char *args, int from_tty) */
-/* OBSOLETE { */
-/* OBSOLETE download (args, from_tty); */
-/* OBSOLETE */
-/* OBSOLETE /* As a convenience, pick up any symbol info that is in the program */
-/* OBSOLETE being loaded. Note that we assume that the program is the``mainline''; */
-/* OBSOLETE if this is not always true, then this code will need to be augmented. */ */
-/* OBSOLETE symbol_file_add (strtok (args, " \t"), from_tty, NULL, 1, 0); */
-/* OBSOLETE */
-/* OBSOLETE /* Getting new symbols may change our opinion about what is */
-/* OBSOLETE frameless. */ */
-/* OBSOLETE reinit_frame_cache (); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /*************************************************** UDI_WRITE_INFERIOR_MEMORY */
-/* OBSOLETE ** Copy LEN bytes of data from debugger memory at MYADDR */
-/* OBSOLETE to inferior's memory at MEMADDR. Returns number of bytes written. */ */
-/* OBSOLETE static int */
-/* OBSOLETE udi_write_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len) */
-/* OBSOLETE { */
-/* OBSOLETE int nwritten = 0; */
-/* OBSOLETE UDIUInt32 *From; */
-/* OBSOLETE UDIResource To; */
-/* OBSOLETE UDICount Count; */
-/* OBSOLETE UDISizeT Size = 1; */
-/* OBSOLETE UDICount CountDone = 0; */
-/* OBSOLETE UDIBool HostEndian = 0; */
-/* OBSOLETE */
-/* OBSOLETE To.Space = udi_memory_space (memaddr); */
-/* OBSOLETE From = (UDIUInt32 *) myaddr; */
-/* OBSOLETE */
-/* OBSOLETE while (nwritten < len) */
-/* OBSOLETE { */
-/* OBSOLETE Count = len - nwritten; */
-/* OBSOLETE if (Count > MAXDATA) */
-/* OBSOLETE Count = MAXDATA; */
-/* OBSOLETE To.Offset = memaddr + nwritten; */
-/* OBSOLETE if (UDIWrite (From, To, Count, Size, &CountDone, HostEndian)) */
-/* OBSOLETE { */
-/* OBSOLETE error ("UDIWrite() failed in udi_write_inferior_memory"); */
-/* OBSOLETE break; */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE { */
-/* OBSOLETE nwritten += CountDone; */
-/* OBSOLETE From += CountDone; */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE return (nwritten); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /**************************************************** UDI_READ_INFERIOR_MEMORY */
-/* OBSOLETE ** Read LEN bytes from inferior memory at MEMADDR. Put the result */
-/* OBSOLETE at debugger address MYADDR. Returns number of bytes read. */ */
-/* OBSOLETE static int */
-/* OBSOLETE udi_read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len) */
-/* OBSOLETE { */
-/* OBSOLETE int nread = 0; */
-/* OBSOLETE UDIResource From; */
-/* OBSOLETE UDIUInt32 *To; */
-/* OBSOLETE UDICount Count; */
-/* OBSOLETE UDISizeT Size = 1; */
-/* OBSOLETE UDICount CountDone = 0; */
-/* OBSOLETE UDIBool HostEndian = 0; */
-/* OBSOLETE UDIError err; */
-/* OBSOLETE */
-/* OBSOLETE From.Space = udi_memory_space (memaddr); */
-/* OBSOLETE To = (UDIUInt32 *) myaddr; */
-/* OBSOLETE */
-/* OBSOLETE while (nread < len) */
-/* OBSOLETE { */
-/* OBSOLETE Count = len - nread; */
-/* OBSOLETE if (Count > MAXDATA) */
-/* OBSOLETE Count = MAXDATA; */
-/* OBSOLETE From.Offset = memaddr + nread; */
-/* OBSOLETE if (err = UDIRead (From, To, Count, Size, &CountDone, HostEndian)) */
-/* OBSOLETE { */
-/* OBSOLETE error ("UDIRead() failed in udi_read_inferior_memory"); */
-/* OBSOLETE break; */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE { */
-/* OBSOLETE nread += CountDone; */
-/* OBSOLETE To += CountDone; */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE return (nread); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE /********************************************************************* WARNING */
-/* OBSOLETE */ */
-/* OBSOLETE udi_warning (int num) */
-/* OBSOLETE { */
-/* OBSOLETE error ("ERROR while loading program into remote TIP: $d\n", num); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE */
-/* OBSOLETE /*****************************************************************************/ */
-/* OBSOLETE /* Fetch a single register indicatated by 'regno'. */
-/* OBSOLETE * Returns 0/-1 on success/failure. */
-/* OBSOLETE */ */
-/* OBSOLETE static void */
-/* OBSOLETE fetch_register (int regno) */
-/* OBSOLETE { */
-/* OBSOLETE UDIResource From; */
-/* OBSOLETE UDIUInt32 To; */
-/* OBSOLETE UDICount Count = 1; */
-/* OBSOLETE UDISizeT Size = 4; */
-/* OBSOLETE UDICount CountDone; */
-/* OBSOLETE UDIBool HostEndian = 0; */
-/* OBSOLETE UDIError err; */
-/* OBSOLETE int result; */
-/* OBSOLETE */
-/* OBSOLETE if (regno == GR1_REGNUM) */
-/* OBSOLETE { */
-/* OBSOLETE From.Space = UDI29KGlobalRegs; */
-/* OBSOLETE From.Offset = 1; */
-/* OBSOLETE } */
-/* OBSOLETE else if (regno >= GR96_REGNUM && regno < GR96_REGNUM + 32) */
-/* OBSOLETE { */
-/* OBSOLETE From.Space = UDI29KGlobalRegs; */
-/* OBSOLETE From.Offset = (regno - GR96_REGNUM) + 96;; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE #if defined(GR64_REGNUM) */
-/* OBSOLETE */
-/* OBSOLETE else if (regno >= GR64_REGNUM && regno < GR64_REGNUM + 32) */
-/* OBSOLETE { */
-/* OBSOLETE From.Space = UDI29KGlobalRegs; */
-/* OBSOLETE From.Offset = (regno - GR64_REGNUM) + 64; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE #endif /* GR64_REGNUM */ */
-/* OBSOLETE */
-/* OBSOLETE else if (regno >= LR0_REGNUM && regno < LR0_REGNUM + 128) */
-/* OBSOLETE { */
-/* OBSOLETE From.Space = UDI29KLocalRegs; */
-/* OBSOLETE From.Offset = (regno - LR0_REGNUM); */
-/* OBSOLETE } */
-/* OBSOLETE else if (regno >= FPE_REGNUM && regno <= EXO_REGNUM) */
-/* OBSOLETE { */
-/* OBSOLETE int val = -1; */
-/* OBSOLETE /*supply_register(160 + (regno - FPE_REGNUM),(char *) &val); */ */
-/* OBSOLETE supply_register (regno, (char *) &val); */
-/* OBSOLETE return; /* Pretend Success */ */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE { */
-/* OBSOLETE From.Space = UDI29KSpecialRegs; */
-/* OBSOLETE From.Offset = regnum_to_srnum (regno); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE if (err = UDIRead (From, &To, Count, Size, &CountDone, HostEndian)) */
-/* OBSOLETE error ("UDIRead() failed in udi_fetch_registers"); */
-/* OBSOLETE */
-/* OBSOLETE supply_register (regno, (char *) &To); */
-/* OBSOLETE */
-/* OBSOLETE if (remote_debug) */
-/* OBSOLETE fprintf_unfiltered (gdb_stdlog, "Fetching register %s = 0x%x\n", */
-/* OBSOLETE REGISTER_NAME (regno), To); */
-/* OBSOLETE } */
-/* OBSOLETE /*****************************************************************************/ */
-/* OBSOLETE /* Store a single register indicated by 'regno'. */
-/* OBSOLETE * Returns 0/-1 on success/failure. */
-/* OBSOLETE */ */
-/* OBSOLETE static int */
-/* OBSOLETE store_register (int regno) */
-/* OBSOLETE { */
-/* OBSOLETE int result; */
-/* OBSOLETE UDIUInt32 From; */
-/* OBSOLETE UDIResource To; */
-/* OBSOLETE UDICount Count = 1; */
-/* OBSOLETE UDISizeT Size = 4; */
-/* OBSOLETE UDICount CountDone; */
-/* OBSOLETE UDIBool HostEndian = 0; */
-/* OBSOLETE */
-/* OBSOLETE From = read_register (regno); /* get data value */ */
-/* OBSOLETE */
-/* OBSOLETE if (remote_debug) */
-/* OBSOLETE fprintf_unfiltered (gdb_stdlog, "Storing register %s = 0x%x\n", */
-/* OBSOLETE REGISTER_NAME (regno), From); */
-/* OBSOLETE */
-/* OBSOLETE if (regno == GR1_REGNUM) */
-/* OBSOLETE { */
-/* OBSOLETE To.Space = UDI29KGlobalRegs; */
-/* OBSOLETE To.Offset = 1; */
-/* OBSOLETE result = UDIWrite (&From, To, Count, Size, &CountDone, HostEndian); */
-/* OBSOLETE /* Setting GR1 changes the numbers of all the locals, so invalidate the */
-/* OBSOLETE * register cache. Do this *after* calling read_register, because we want */
-/* OBSOLETE * read_register to return the value that write_register has just stuffed */
-/* OBSOLETE * into the registers array, not the value of the register fetched from */
-/* OBSOLETE * the inferior. */
-/* OBSOLETE */ */
-/* OBSOLETE registers_changed (); */
-/* OBSOLETE } */
-/* OBSOLETE #if defined(GR64_REGNUM) */
-/* OBSOLETE else if (regno >= GR64_REGNUM && regno < GR64_REGNUM + 32) */
-/* OBSOLETE { */
-/* OBSOLETE To.Space = UDI29KGlobalRegs; */
-/* OBSOLETE To.Offset = (regno - GR64_REGNUM) + 64; */
-/* OBSOLETE result = UDIWrite (&From, To, Count, Size, &CountDone, HostEndian); */
-/* OBSOLETE } */
-/* OBSOLETE #endif /* GR64_REGNUM */ */
-/* OBSOLETE else if (regno >= GR96_REGNUM && regno < GR96_REGNUM + 32) */
-/* OBSOLETE { */
-/* OBSOLETE To.Space = UDI29KGlobalRegs; */
-/* OBSOLETE To.Offset = (regno - GR96_REGNUM) + 96; */
-/* OBSOLETE result = UDIWrite (&From, To, Count, Size, &CountDone, HostEndian); */
-/* OBSOLETE } */
-/* OBSOLETE else if (regno >= LR0_REGNUM && regno < LR0_REGNUM + 128) */
-/* OBSOLETE { */
-/* OBSOLETE To.Space = UDI29KLocalRegs; */
-/* OBSOLETE To.Offset = (regno - LR0_REGNUM); */
-/* OBSOLETE result = UDIWrite (&From, To, Count, Size, &CountDone, HostEndian); */
-/* OBSOLETE } */
-/* OBSOLETE else if (regno >= FPE_REGNUM && regno <= EXO_REGNUM) */
-/* OBSOLETE return 0; /* Pretend Success */ */
-/* OBSOLETE else if (regno == PC_REGNUM) */
-/* OBSOLETE { */
-/* OBSOLETE /* PC1 via UDI29KPC */ */
-/* OBSOLETE */
-/* OBSOLETE To.Space = UDI29KPC; */
-/* OBSOLETE To.Offset = 0; /* PC1 */ */
-/* OBSOLETE result = UDIWrite (&From, To, Count, Size, &CountDone, HostEndian); */
-/* OBSOLETE */
-/* OBSOLETE /* Writing to this loc actually changes the values of pc0 & pc1 */ */
-/* OBSOLETE */
-/* OBSOLETE register_valid[PC_REGNUM] = 0; /* pc1 */ */
-/* OBSOLETE register_valid[NPC_REGNUM] = 0; /* pc0 */ */
-/* OBSOLETE } */
-/* OBSOLETE else */
-/* OBSOLETE /* An unprotected or protected special register */ */
-/* OBSOLETE { */
-/* OBSOLETE To.Space = UDI29KSpecialRegs; */
-/* OBSOLETE To.Offset = regnum_to_srnum (regno); */
-/* OBSOLETE result = UDIWrite (&From, To, Count, Size, &CountDone, HostEndian); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE if (result != 0) */
-/* OBSOLETE error ("UDIWrite() failed in store_registers"); */
-/* OBSOLETE */
-/* OBSOLETE return 0; */
-/* OBSOLETE } */
-/* OBSOLETE /********************************************************** REGNUM_TO_SRNUM */ */
-/* OBSOLETE /* */
-/* OBSOLETE * Convert a gdb special register number to a 29000 special register number. */
-/* OBSOLETE */ */
-/* OBSOLETE static int */
-/* OBSOLETE regnum_to_srnum (int regno) */
-/* OBSOLETE { */
-/* OBSOLETE switch (regno) */
-/* OBSOLETE { */
-/* OBSOLETE case VAB_REGNUM: */
-/* OBSOLETE return (0); */
-/* OBSOLETE case OPS_REGNUM: */
-/* OBSOLETE return (1); */
-/* OBSOLETE case CPS_REGNUM: */
-/* OBSOLETE return (2); */
-/* OBSOLETE case CFG_REGNUM: */
-/* OBSOLETE return (3); */
-/* OBSOLETE case CHA_REGNUM: */
-/* OBSOLETE return (4); */
-/* OBSOLETE case CHD_REGNUM: */
-/* OBSOLETE return (5); */
-/* OBSOLETE case CHC_REGNUM: */
-/* OBSOLETE return (6); */
-/* OBSOLETE case RBP_REGNUM: */
-/* OBSOLETE return (7); */
-/* OBSOLETE case TMC_REGNUM: */
-/* OBSOLETE return (8); */
-/* OBSOLETE case TMR_REGNUM: */
-/* OBSOLETE return (9); */
-/* OBSOLETE case NPC_REGNUM: */
-/* OBSOLETE return (USE_SHADOW_PC ? (20) : (10)); */
-/* OBSOLETE case PC_REGNUM: */
-/* OBSOLETE return (USE_SHADOW_PC ? (21) : (11)); */
-/* OBSOLETE case PC2_REGNUM: */
-/* OBSOLETE return (USE_SHADOW_PC ? (22) : (12)); */
-/* OBSOLETE case MMU_REGNUM: */
-/* OBSOLETE return (13); */
-/* OBSOLETE case LRU_REGNUM: */
-/* OBSOLETE return (14); */
-/* OBSOLETE case IPC_REGNUM: */
-/* OBSOLETE return (128); */
-/* OBSOLETE case IPA_REGNUM: */
-/* OBSOLETE return (129); */
-/* OBSOLETE case IPB_REGNUM: */
-/* OBSOLETE return (130); */
-/* OBSOLETE case Q_REGNUM: */
-/* OBSOLETE return (131); */
-/* OBSOLETE case ALU_REGNUM: */
-/* OBSOLETE return (132); */
-/* OBSOLETE case BP_REGNUM: */
-/* OBSOLETE return (133); */
-/* OBSOLETE case FC_REGNUM: */
-/* OBSOLETE return (134); */
-/* OBSOLETE case CR_REGNUM: */
-/* OBSOLETE return (135); */
-/* OBSOLETE case FPE_REGNUM: */
-/* OBSOLETE return (160); */
-/* OBSOLETE case INTE_REGNUM: */
-/* OBSOLETE return (161); */
-/* OBSOLETE case FPS_REGNUM: */
-/* OBSOLETE return (162); */
-/* OBSOLETE case EXO_REGNUM: */
-/* OBSOLETE return (164); */
-/* OBSOLETE default: */
-/* OBSOLETE return (255); /* Failure ? */ */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE /****************************************************************************/ */
-/* OBSOLETE /* */
-/* OBSOLETE * Determine the Target memory space qualifier based on the addr. */
-/* OBSOLETE * FIXME: Can't distinguis I_ROM/D_ROM. */
-/* OBSOLETE * FIXME: Doesn't know anything about I_CACHE/D_CACHE. */
-/* OBSOLETE */ */
-/* OBSOLETE static CPUSpace */
-/* OBSOLETE udi_memory_space (CORE_ADDR addr) */
-/* OBSOLETE { */
-/* OBSOLETE UDIUInt32 tstart = IMemStart; */
-/* OBSOLETE UDIUInt32 tend = tstart + IMemSize; */
-/* OBSOLETE UDIUInt32 dstart = DMemStart; */
-/* OBSOLETE UDIUInt32 dend = tstart + DMemSize; */
-/* OBSOLETE UDIUInt32 rstart = RMemStart; */
-/* OBSOLETE UDIUInt32 rend = tstart + RMemSize; */
-/* OBSOLETE */
-/* OBSOLETE if (((UDIUInt32) addr >= tstart) && ((UDIUInt32) addr < tend)) */
-/* OBSOLETE { */
-/* OBSOLETE return UDI29KIRAMSpace; */
-/* OBSOLETE } */
-/* OBSOLETE else if (((UDIUInt32) addr >= dstart) && ((UDIUInt32) addr < dend)) */
-/* OBSOLETE { */
-/* OBSOLETE return UDI29KDRAMSpace; */
-/* OBSOLETE } */
-/* OBSOLETE else if (((UDIUInt32) addr >= rstart) && ((UDIUInt32) addr < rend)) */
-/* OBSOLETE { */
-/* OBSOLETE /* FIXME: how do we determine between D_ROM and I_ROM */ */
-/* OBSOLETE return UDI29KIROMSpace; */
-/* OBSOLETE } */
-/* OBSOLETE else /* FIXME: what do me do now? */ */
-/* OBSOLETE return UDI29KDRAMSpace; /* Hmmm! */ */
-/* OBSOLETE } */
-/* OBSOLETE /*********************************************************************** STUBS */
-/* OBSOLETE */ */
-/* OBSOLETE */
-/* OBSOLETE void */
-/* OBSOLETE convert16 (void) */
-/* OBSOLETE {; */
-/* OBSOLETE } */
-/* OBSOLETE void */
-/* OBSOLETE convert32 (void) */
-/* OBSOLETE {; */
-/* OBSOLETE } */
-/* OBSOLETE struct ui_file *EchoFile = 0; /* used for debugging */ */
-/* OBSOLETE int QuietMode = 0; /* used for debugging */ */
-/* OBSOLETE */
-/* OBSOLETE #ifdef NO_HIF_SUPPORT */
-/* OBSOLETE service_HIF (union msg_t *msg) */
-/* OBSOLETE { */
-/* OBSOLETE return (0); /* Emulate a failure */ */
-/* OBSOLETE } */
-/* OBSOLETE #endif */
-/* OBSOLETE */
-/* OBSOLETE /* Target_ops vector. Not static because there does not seem to be */
-/* OBSOLETE any portable way to do a forward declaration of a static variable. */
-/* OBSOLETE The RS/6000 doesn't like "extern" followed by "static"; SunOS */
-/* OBSOLETE /bin/cc doesn't like "static" twice. */ */
-/* OBSOLETE */
-/* OBSOLETE struct target_ops udi_ops; */
-/* OBSOLETE */
-/* OBSOLETE static void */
-/* OBSOLETE init_udi_ops (void) */
-/* OBSOLETE { */
-/* OBSOLETE udi_ops.to_shortname = "udi"; */
-/* OBSOLETE udi_ops.to_longname = "Remote UDI connected TIP"; */
-/* OBSOLETE udi_ops.to_doc = "Remote debug an AMD 29k using UDI socket connection to TIP process.\n\ */
-/* OBSOLETE Arguments are\n\ */
-/* OBSOLETE `configuration-id AF_INET hostname port-number'\n\ */
-/* OBSOLETE To connect via the network, where hostname and port-number specify the\n\ */
-/* OBSOLETE host and port where you can connect via UDI.\n\ */
-/* OBSOLETE configuration-id is unused.\n\ */
-/* OBSOLETE \n\ */
-/* OBSOLETE `configuration-id AF_UNIX socket-name tip-program'\n\ */
-/* OBSOLETE To connect using a local connection to the \"tip.exe\" program which is\n\ */
-/* OBSOLETE supplied by AMD. If socket-name specifies an AF_UNIX socket then the\n\ */
-/* OBSOLETE tip program must already be started; connect to it using that socket.\n\ */
-/* OBSOLETE If not, start up tip-program, which should be the name of the tip\n\ */
-/* OBSOLETE program. If appropriate, the PATH environment variable is searched.\n\ */
-/* OBSOLETE configuration-id is unused.\n\ */
-/* OBSOLETE \n\ */
-/* OBSOLETE `configuration-id'\n\ */
-/* OBSOLETE Look up the configuration in ./udi_soc or /etc/udi_soc, which\n\ */
-/* OBSOLETE are files containing lines in the above formats. configuration-id is\n\ */
-/* OBSOLETE used to pick which line of the file to use."; */
-/* OBSOLETE udi_ops.to_open = udi_open; */
-/* OBSOLETE udi_ops.to_close = udi_close; */
-/* OBSOLETE udi_ops.to_attach = udi_attach; */
-/* OBSOLETE udi_ops.to_detach = udi_detach; */
-/* OBSOLETE udi_ops.to_resume = udi_resume; */
-/* OBSOLETE udi_ops.to_wait = udi_wait; */
-/* OBSOLETE udi_ops.to_fetch_registers = udi_fetch_registers; */
-/* OBSOLETE udi_ops.to_store_registers = udi_store_registers; */
-/* OBSOLETE udi_ops.to_prepare_to_store = udi_prepare_to_store; */
-/* OBSOLETE udi_ops.to_xfer_memory = udi_xfer_inferior_memory; */
-/* OBSOLETE udi_ops.to_files_info = udi_files_info; */
-/* OBSOLETE udi_ops.to_insert_breakpoint = udi_insert_breakpoint; */
-/* OBSOLETE udi_ops.to_remove_breakpoint = udi_remove_breakpoint; */
-/* OBSOLETE udi_ops.to_terminal_init = 0; */
-/* OBSOLETE udi_ops.to_terminal_inferior = 0; */
-/* OBSOLETE udi_ops.to_terminal_ours_for_output = 0; */
-/* OBSOLETE udi_ops.to_terminal_ours = 0; */
-/* OBSOLETE udi_ops.to_terminal_info = 0; */
-/* OBSOLETE udi_ops.to_kill = udi_kill; */
-/* OBSOLETE udi_ops.to_load = udi_load; */
-/* OBSOLETE udi_ops.to_lookup_symbol = 0; */
-/* OBSOLETE udi_ops.to_create_inferior = udi_create_inferior; */
-/* OBSOLETE udi_ops.to_mourn_inferior = udi_mourn; */
-/* OBSOLETE udi_ops.to_can_run = 0; */
-/* OBSOLETE udi_ops.to_notice_signals = 0; */
-/* OBSOLETE udi_ops.to_thread_alive = 0; */
-/* OBSOLETE udi_ops.to_stop = 0; */
-/* OBSOLETE udi_ops.to_stratum = process_stratum; */
-/* OBSOLETE udi_ops.DONT_USE = 0; */
-/* OBSOLETE udi_ops.to_has_all_memory = 1; */
-/* OBSOLETE udi_ops.to_has_memory = 1; */
-/* OBSOLETE udi_ops.to_has_stack = 1; */
-/* OBSOLETE udi_ops.to_has_registers = 1; */
-/* OBSOLETE udi_ops.to_has_execution = 1; */
-/* OBSOLETE udi_ops.to_sections = 0; */
-/* OBSOLETE udi_ops.to_sections_end = 0; */
-/* OBSOLETE udi_ops.to_magic = OPS_MAGIC; */
-/* OBSOLETE }; */
-/* OBSOLETE */
-/* OBSOLETE void */
-/* OBSOLETE _initialize_remote_udi (void) */
-/* OBSOLETE { */
-/* OBSOLETE init_udi_ops (); */
-/* OBSOLETE add_target (&udi_ops); */
-/* OBSOLETE } */
diff --git a/gdb/remote-utils.c b/gdb/remote-utils.c
index e703f3d..ba150e3 100644
--- a/gdb/remote-utils.c
+++ b/gdb/remote-utils.c
@@ -86,7 +86,7 @@ usage (char *proto, char *junk)
fprintf_unfiltered (gdb_stderr, "Unrecognized arguments: `%s'.\n", junk);
error ("Usage: target %s [DEVICE [SPEED [DEBUG]]]\n\
-where DEVICE is the name of a device or HOST:PORT", proto, proto);
+where DEVICE is the name of a device or HOST:PORT", proto);
return;
}
diff --git a/gdb/remote-vxsparc.c b/gdb/remote-vxsparc.c
index 014f1d4..294e940 100644
--- a/gdb/remote-vxsparc.c
+++ b/gdb/remote-vxsparc.c
@@ -102,7 +102,7 @@ vx_read_register (int regno)
(FRAME_FIND_SAVED_REGS, in particular, depends on this). */
sp = extract_address (&registers[REGISTER_BYTE (SP_REGNUM)],
- REGISTER_RAW_SIZE (CORE_ADDR));
+ REGISTER_RAW_SIZE (SP_REGNUM));
write_memory (sp, &registers[REGISTER_BYTE (L0_REGNUM)],
16 * REGISTER_RAW_SIZE (L0_REGNUM));
@@ -173,7 +173,7 @@ vx_write_register (int regno)
if (regno < 0 || (L0_REGNUM <= regno && regno <= I7_REGNUM))
{
sp = extract_address (&registers[REGISTER_BYTE (SP_REGNUM)],
- REGISTER_RAW_SIZE (CORE_ADDR));
+ REGISTER_RAW_SIZE (SP_REGNUM));
write_memory (sp, &registers[REGISTER_BYTE (L0_REGNUM)],
16 * REGISTER_RAW_SIZE (L0_REGNUM));
}
diff --git a/gdb/remote.c b/gdb/remote.c
index 2d70baf..a773680 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -211,7 +211,7 @@ void open_remote_target (char *, int, struct target_ops *, int);
void _initialize_remote (void);
-/* Description of the remote protocol. Strictly speeking, when the
+/* Description of the remote protocol. Strictly speaking, when the
target is open()ed, remote.c should create a per-target description
of the remote protocol using that target's architecture.
Unfortunatly, the target stack doesn't include local state. For
@@ -5013,8 +5013,8 @@ compare_sections_command (char *args, int from_tty)
getpkt (buf, (rs->remote_packet_size), 0);
if (buf[0] == 'E')
- error ("target memory fault, section %s, range 0x%08x -- 0x%08x",
- sectname, lma, lma + size);
+ error ("target memory fault, section %s, range 0x%s -- 0x%s",
+ sectname, paddr (lma), paddr (lma + size));
if (buf[0] != 'C')
error ("remote target does not support this operation");
diff --git a/gdb/rs6000-nat.c b/gdb/rs6000-nat.c
index c2b1dd9..8fb2fec 100644
--- a/gdb/rs6000-nat.c
+++ b/gdb/rs6000-nat.c
@@ -160,11 +160,11 @@ static int special_regs[] =
/* Call ptrace(REQ, ID, ADDR, DATA, BUF). */
static int
-ptrace32 (int req, int id, int *addr, int data, int *buf)
+rs6000_ptrace32 (int req, int id, int *addr, int data, int *buf)
{
int ret = ptrace (req, id, (int *)addr, data, buf);
#if 0
- printf ("ptrace32 (%d, %d, 0x%x, %08x, 0x%x) = 0x%x\n",
+ printf ("rs6000_ptrace32 (%d, %d, 0x%x, %08x, 0x%x) = 0x%x\n",
req, id, (unsigned int)addr, data, (unsigned int)buf, ret);
#endif
return ret;
@@ -173,7 +173,7 @@ ptrace32 (int req, int id, int *addr, int data, int *buf)
/* Call ptracex(REQ, ID, ADDR, DATA, BUF). */
static int
-ptrace64 (int req, int id, long long addr, int data, int *buf)
+rs6000_ptrace64 (int req, int id, long long addr, int data, int *buf)
{
#ifdef ARCH3264
int ret = ptracex (req, id, addr, data, buf);
@@ -181,7 +181,7 @@ ptrace64 (int req, int id, long long addr, int data, int *buf)
int ret = 0;
#endif
#if 0
- printf ("ptrace64 (%d, %d, 0x%llx, %08x, 0x%x) = 0x%x\n",
+ printf ("rs6000_ptrace64 (%d, %d, 0x%llx, %08x, 0x%x) = 0x%x\n",
req, id, addr, data, (unsigned int)buf, ret);
#endif
return ret;
@@ -202,7 +202,7 @@ fetch_register (int regno)
if (regno >= FP0_REGNUM && regno <= FPLAST_REGNUM)
{
nr = regno - FP0_REGNUM + FPR0;
- ptrace32 (PT_READ_FPR, PIDGET (inferior_ptid), addr, nr, 0);
+ rs6000_ptrace32 (PT_READ_FPR, PIDGET (inferior_ptid), addr, nr, 0);
}
/* Bogus register number. */
@@ -223,13 +223,13 @@ fetch_register (int regno)
nr = regno;
if (!ARCH64 ())
- *addr = ptrace32 (PT_READ_GPR, PIDGET (inferior_ptid), (int *)nr, 0, 0);
+ *addr = rs6000_ptrace32 (PT_READ_GPR, PIDGET (inferior_ptid), (int *)nr, 0, 0);
else
{
/* PT_READ_GPR requires the buffer parameter to point to long long,
even if the register is really only 32 bits. */
long long buf;
- ptrace64 (PT_READ_GPR, PIDGET (inferior_ptid), nr, 0, (int *)&buf);
+ rs6000_ptrace64 (PT_READ_GPR, PIDGET (inferior_ptid), nr, 0, (int *)&buf);
if (REGISTER_RAW_SIZE (regno) == 8)
memcpy (addr, &buf, 8);
else
@@ -264,7 +264,7 @@ store_register (int regno)
if (regno >= FP0_REGNUM && regno <= FPLAST_REGNUM)
{
nr = regno - FP0_REGNUM + FPR0;
- ptrace32 (PT_WRITE_FPR, PIDGET (inferior_ptid), addr, nr, 0);
+ rs6000_ptrace32 (PT_WRITE_FPR, PIDGET (inferior_ptid), addr, nr, 0);
}
/* Bogus register number. */
@@ -293,7 +293,7 @@ store_register (int regno)
nr = regno;
if (!ARCH64 ())
- ptrace32 (PT_WRITE_GPR, PIDGET (inferior_ptid), (int *)nr, *addr, 0);
+ rs6000_ptrace32 (PT_WRITE_GPR, PIDGET (inferior_ptid), (int *)nr, *addr, 0);
else
{
/* PT_WRITE_GPR requires the buffer parameter to point to an 8-byte
@@ -303,7 +303,7 @@ store_register (int regno)
memcpy (&buf, addr, 8);
else
buf = *addr;
- ptrace64 (PT_WRITE_GPR, PIDGET (inferior_ptid), nr, 0, (int *)&buf);
+ rs6000_ptrace64 (PT_WRITE_GPR, PIDGET (inferior_ptid), nr, 0, (int *)&buf);
}
}
@@ -377,9 +377,9 @@ read_word (CORE_ADDR from, int *to, int arch64)
errno = 0;
if (arch64)
- *to = ptrace64 (PT_READ_I, PIDGET (inferior_ptid), from, 0, NULL);
+ *to = rs6000_ptrace64 (PT_READ_I, PIDGET (inferior_ptid), from, 0, NULL);
else
- *to = ptrace32 (PT_READ_I, PIDGET (inferior_ptid), (int *)(long) from,
+ *to = rs6000_ptrace32 (PT_READ_I, PIDGET (inferior_ptid), (int *)(long) from,
0, NULL);
return !errno;
@@ -449,9 +449,9 @@ child_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len,
for (i = 0, errno = 0; i < count; i++, addr += sizeof (int))
{
if (arch64)
- ptrace64 (PT_WRITE_D, PIDGET (inferior_ptid), addr, buf[i], NULL);
+ rs6000_ptrace64 (PT_WRITE_D, PIDGET (inferior_ptid), addr, buf[i], NULL);
else
- ptrace32 (PT_WRITE_D, PIDGET (inferior_ptid), (int *)(long) addr,
+ rs6000_ptrace32 (PT_WRITE_D, PIDGET (inferior_ptid), (int *)(long) addr,
buf[i], NULL);
if (errno)
@@ -490,9 +490,9 @@ exec_one_dummy_insn (void)
prev_pc = read_pc ();
write_pc (DUMMY_INSN_ADDR);
if (ARCH64 ())
- ret = ptrace64 (PT_CONTINUE, PIDGET (inferior_ptid), 1, 0, NULL);
+ ret = rs6000_ptrace64 (PT_CONTINUE, PIDGET (inferior_ptid), 1, 0, NULL);
else
- ret = ptrace32 (PT_CONTINUE, PIDGET (inferior_ptid), (int *)1, 0, NULL);
+ ret = rs6000_ptrace32 (PT_CONTINUE, PIDGET (inferior_ptid), (int *)1, 0, NULL);
if (ret != 0)
perror ("pt_continue");
@@ -987,9 +987,9 @@ xcoff_relocate_symtab (unsigned int pid)
#endif
if (arch64)
- rc = ptrace64 (PT_LDINFO, pid, (unsigned long) ldi, size, NULL);
+ rc = rs6000_ptrace64 (PT_LDINFO, pid, (unsigned long) ldi, size, NULL);
else
- rc = ptrace32 (PT_LDINFO, pid, (int *) ldi, size, NULL);
+ rc = rs6000_ptrace32 (PT_LDINFO, pid, (int *) ldi, size, NULL);
if (rc == -1)
{
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index 2105727..74285a3 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -1,6 +1,6 @@
/* Target-dependent code for GDB, the GNU debugger.
Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
- 1998, 1999, 2000, 2001
+ 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
This file is part of GDB.
@@ -35,9 +35,11 @@
#include "value.h"
#include "parser-defs.h"
-#include "bfd/libbfd.h" /* for bfd_default_set_arch_mach */
+#include "libbfd.h" /* for bfd_default_set_arch_mach */
#include "coff/internal.h" /* for libcoff.h */
-#include "bfd/libcoff.h" /* for xcoff_data */
+#include "libcoff.h" /* for xcoff_data */
+#include "coff/xcoff.h"
+#include "libxcoff.h"
#include "elf-bfd.h"
@@ -64,13 +66,16 @@ struct rs6000_framedata
the frame */
int saved_gpr; /* smallest # of saved gpr */
int saved_fpr; /* smallest # of saved fpr */
+ int saved_vr; /* smallest # of saved vr */
int alloca_reg; /* alloca register number (frame ptr) */
char frameless; /* true if frameless functions. */
char nosavedpc; /* true if pc not saved. */
int gpr_offset; /* offset of saved gprs from prev sp */
int fpr_offset; /* offset of saved fprs from prev sp */
+ int vr_offset; /* offset of saved vrs from prev sp */
int lr_offset; /* offset of saved lr */
int cr_offset; /* offset of saved cr */
+ int vrsave_offset; /* offset of saved vrsave register */
};
/* Description of a single register. */
@@ -277,7 +282,7 @@ branch_dest (int opcode, int instr, CORE_ADDR pc, CORE_ADDR safety)
#define BIG_BREAKPOINT { 0x7d, 0x82, 0x10, 0x08 }
#define LITTLE_BREAKPOINT { 0x08, 0x10, 0x82, 0x7d }
-static unsigned char *
+const static unsigned char *
rs6000_breakpoint_from_pc (CORE_ADDR *bp_addr, int *bp_size)
{
static unsigned char big_breakpoint[] = BIG_BREAKPOINT;
@@ -296,11 +301,9 @@ void
rs6000_software_single_step (enum target_signal signal,
int insert_breakpoints_p)
{
-#define INSNLEN(OPCODE) 4
-
- static char le_breakp[] = LITTLE_BREAKPOINT;
- static char be_breakp[] = BIG_BREAKPOINT;
- char *breakp = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? be_breakp : le_breakp;
+ CORE_ADDR dummy;
+ int breakp_sz;
+ const char *breakp = rs6000_breakpoint_from_pc (&dummy, &breakp_sz);
int ii, insn;
CORE_ADDR loc;
CORE_ADDR breaks[2];
@@ -313,7 +316,7 @@ rs6000_software_single_step (enum target_signal signal,
insn = read_memory_integer (loc, 4);
- breaks[0] = loc + INSNLEN (insn);
+ breaks[0] = loc + breakp_sz;
opcode = insn >> 26;
breaks[1] = branch_dest (opcode, insn, loc, breaks[0]);
@@ -329,10 +332,7 @@ rs6000_software_single_step (enum target_signal signal,
/* ignore invalid breakpoint. */
if (breaks[ii] == -1)
continue;
-
- read_memory (breaks[ii], stepBreaks[ii].data, 4);
-
- write_memory (breaks[ii], breakp, 4);
+ target_insert_breakpoint (breaks[ii], stepBreaks[ii].data);
stepBreaks[ii].address = breaks[ii];
}
@@ -343,9 +343,8 @@ rs6000_software_single_step (enum target_signal signal,
/* remove step breakpoints. */
for (ii = 0; ii < 2; ++ii)
if (stepBreaks[ii].address != 0)
- write_memory
- (stepBreaks[ii].address, stepBreaks[ii].data, 4);
-
+ target_remove_breakpoint (stepBreaks[ii].address,
+ stepBreaks[ii].data);
}
errno = 0; /* FIXME, don't ignore errors! */
/* What errors? {read,write}_memory call error(). */
@@ -362,12 +361,15 @@ rs6000_software_single_step (enum target_signal signal,
which we decrement the sp to allocate the frame.
- saved_gpr is the number of the first saved gpr.
- saved_fpr is the number of the first saved fpr.
+ - saved_vr is the number of the first saved vr.
- alloca_reg is the number of the register used for alloca() handling.
Otherwise -1.
- gpr_offset is the offset of the first saved gpr from the previous frame.
- fpr_offset is the offset of the first saved fpr from the previous frame.
+ - vr_offset is the offset of the first saved vr from the previous frame.
- lr_offset is the offset of the saved lr
- cr_offset is the offset of the saved cr
+ - vrsave_offset is the offset of the saved vrsave register
*/
#define SIGNED_SHORT(x) \
@@ -434,11 +436,15 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata)
{
CORE_ADDR orig_pc = pc;
CORE_ADDR last_prologue_pc = pc;
+ CORE_ADDR li_found_pc = 0;
char buf[4];
unsigned long op;
long offset = 0;
+ long vr_saved_offset = 0;
int lr_reg = -1;
int cr_reg = -1;
+ int vr_reg = -1;
+ int vrsave_reg = -1;
int reg;
int framep = 0;
int minimal_toc_loaded = 0;
@@ -463,6 +469,7 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata)
memset (fdata, 0, sizeof (struct rs6000_framedata));
fdata->saved_gpr = -1;
fdata->saved_fpr = -1;
+ fdata->saved_vr = -1;
fdata->alloca_reg = -1;
fdata->frameless = 1;
fdata->nosavedpc = 1;
@@ -581,17 +588,8 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata)
break;
}
- else if (((op & 0xffff0000) == 0x801e0000 || /* lwz 0,NUM(r30), used
- in V.4 -mrelocatable */
- op == 0x7fc0f214) && /* add r30,r0,r30, used
- in V.4 -mrelocatable */
- lr_reg == 0x901e0000)
- {
- continue;
-
- }
- else if ((op & 0xffff0000) == 0x3fc00000 || /* addis 30,0,foo@ha, used
- in V.4 -mminimal-toc */
+ else if ((op & 0xffff0000) == 0x3fc00000 || /* addis 30,0,foo@ha, used
+ in V.4 -mminimal-toc */
(op & 0xffff0000) == 0x3bde0000)
{ /* addi 30,30,foo@l */
continue;
@@ -602,17 +600,17 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata)
to save fprs??? */
fdata->frameless = 0;
- /* Don't skip over the subroutine call if it is not within the first
- three instructions of the prologue. */
+ /* Don't skip over the subroutine call if it is not within
+ the first three instructions of the prologue. */
if ((pc - orig_pc) > 8)
break;
op = read_memory_integer (pc + 4, 4);
- /* At this point, make sure this is not a trampoline function
- (a function that simply calls another functions, and nothing else).
- If the next is not a nop, this branch was part of the function
- prologue. */
+ /* At this point, make sure this is not a trampoline
+ function (a function that simply calls another functions,
+ and nothing else). If the next is not a nop, this branch
+ was part of the function prologue. */
if (op == 0x4def7b82 || op == 0) /* crorc 15, 15, 15 */
break; /* don't skip over
@@ -658,8 +656,7 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata)
/* store parameters in stack */
}
- else if ((op & 0xfc1f0000) == 0x90010000 || /* st rx,NUM(r1) */
- (op & 0xfc1f0003) == 0xf8010000 || /* std rx,NUM(r1) */
+ else if ((op & 0xfc1f0003) == 0xf8010000 || /* std rx,NUM(r1) */
(op & 0xfc1f0000) == 0xd8010000 || /* stfd Rx,NUM(r1) */
(op & 0xfc1f0000) == 0xfc010000) /* frsp, fp?,NUM(r1) */
{
@@ -692,8 +689,74 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata)
framep = 1;
fdata->alloca_reg = (op & ~0x38010000) >> 21;
continue;
-
}
+ /* AltiVec related instructions. */
+ /* Store the vrsave register (spr 256) in another register for
+ later manipulation, or load a register into the vrsave
+ register. 2 instructions are used: mfvrsave and
+ mtvrsave. They are shorthand notation for mfspr Rn, SPR256
+ and mtspr SPR256, Rn. */
+ /* mfspr Rn SPR256 == 011111 nnnnn 0000001000 01010100110
+ mtspr SPR256 Rn == 011111 nnnnn 0000001000 01110100110 */
+ else if ((op & 0xfc1fffff) == 0x7c0042a6) /* mfvrsave Rn */
+ {
+ vrsave_reg = GET_SRC_REG (op);
+ continue;
+ }
+ else if ((op & 0xfc1fffff) == 0x7c0043a6) /* mtvrsave Rn */
+ {
+ continue;
+ }
+ /* Store the register where vrsave was saved to onto the stack:
+ rS is the register where vrsave was stored in a previous
+ instruction. */
+ /* 100100 sssss 00001 dddddddd dddddddd */
+ else if ((op & 0xfc1f0000) == 0x90010000) /* stw rS, d(r1) */
+ {
+ if (vrsave_reg == GET_SRC_REG (op))
+ {
+ fdata->vrsave_offset = SIGNED_SHORT (op) + offset;
+ vrsave_reg = -1;
+ }
+ continue;
+ }
+ /* Compute the new value of vrsave, by modifying the register
+ where vrsave was saved to. */
+ else if (((op & 0xfc000000) == 0x64000000) /* oris Ra, Rs, UIMM */
+ || ((op & 0xfc000000) == 0x60000000))/* ori Ra, Rs, UIMM */
+ {
+ continue;
+ }
+ /* li r0, SIMM (short for addi r0, 0, SIMM). This is the first
+ in a pair of insns to save the vector registers on the
+ stack. */
+ /* 001110 00000 00000 iiii iiii iiii iiii */
+ else if ((op & 0xffff0000) == 0x38000000) /* li r0, SIMM */
+ {
+ li_found_pc = pc;
+ vr_saved_offset = SIGNED_SHORT (op);
+ }
+ /* Store vector register S at (r31+r0) aligned to 16 bytes. */
+ /* 011111 sssss 11111 00000 00111001110 */
+ else if ((op & 0xfc1fffff) == 0x7c1f01ce) /* stvx Vs, R31, R0 */
+ {
+ if (pc == (li_found_pc + 4))
+ {
+ vr_reg = GET_SRC_REG (op);
+ /* If this is the first vector reg to be saved, or if
+ it has a lower number than others previously seen,
+ reupdate the frame info. */
+ if (fdata->saved_vr == -1 || fdata->saved_vr > vr_reg)
+ {
+ fdata->saved_vr = vr_reg;
+ fdata->vr_offset = vr_saved_offset + offset;
+ }
+ vr_saved_offset = -1;
+ vr_reg = -1;
+ li_found_pc = 0;
+ }
+ }
+ /* End AltiVec related instructions. */
else
{
/* Not a recognized prologue instruction.
@@ -842,9 +905,6 @@ rs6000_fix_call_dummy (char *dummyname, CORE_ADDR pc, CORE_ADDR fun,
int nargs, struct value **args, struct type *type,
int gcc_p)
{
-#define TOC_ADDR_OFFSET 20
-#define TARGET_ADDR_OFFSET 28
-
int ii;
CORE_ADDR target_addr;
@@ -975,7 +1035,7 @@ rs6000_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
ran_out_of_registers_for_arguments:
saved_sp = read_sp ();
-#ifndef ELF_OBJECT_FORMAT
+
/* location for 8 parameters are always reserved. */
sp -= wordsize * 8;
@@ -984,7 +1044,6 @@ ran_out_of_registers_for_arguments:
/* stack pointer must be quadword aligned */
sp &= -16;
-#endif
/* if there are more arguments, allocate space for them in
the stack, then push them starting from the ninth one. */
@@ -1087,6 +1146,7 @@ static void
rs6000_extract_return_value (struct type *valtype, char *regbuf, char *valbuf)
{
int offset = 0;
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
if (TYPE_CODE (valtype) == TYPE_CODE_FLT)
{
@@ -1108,6 +1168,13 @@ rs6000_extract_return_value (struct type *valtype, char *regbuf, char *valbuf)
memcpy (valbuf, &ff, sizeof (float));
}
}
+ else if (TYPE_CODE (valtype) == TYPE_CODE_ARRAY
+ && TYPE_LENGTH (valtype) == 16
+ && TYPE_VECTOR (valtype))
+ {
+ memcpy (valbuf, regbuf + REGISTER_BYTE (tdep->ppc_vr0_regnum + 2),
+ TYPE_LENGTH (valtype));
+ }
else
{
/* return value is copied starting from r3. */
@@ -1262,7 +1329,8 @@ rs6000_frame_saved_pc (struct frame_info *fi)
{
CORE_ADDR func_start;
struct rs6000_framedata fdata;
- int wordsize = TDEP->wordsize;
+ struct gdbarch_tdep *tdep = TDEP;
+ int wordsize = tdep->wordsize;
if (fi->signal_handler_caller)
return read_memory_addr (fi->frame + SIG_FRAME_PC_OFFSET, wordsize);
@@ -1285,7 +1353,7 @@ rs6000_frame_saved_pc (struct frame_info *fi)
return read_memory_addr (fi->next->frame + SIG_FRAME_LR_OFFSET,
wordsize);
else
- return read_memory_addr (FRAME_CHAIN (fi) + DEFAULT_LR_SAVE,
+ return read_memory_addr (FRAME_CHAIN (fi) + tdep->lr_frame_offset,
wordsize);
}
@@ -1304,7 +1372,8 @@ frame_get_saved_regs (struct frame_info *fi, struct rs6000_framedata *fdatap)
{
CORE_ADDR frame_addr;
struct rs6000_framedata work_fdata;
- int wordsize = TDEP->wordsize;
+ struct gdbarch_tdep * tdep = gdbarch_tdep (current_gdbarch);
+ int wordsize = tdep->wordsize;
if (fi->saved_regs)
return;
@@ -1322,13 +1391,20 @@ frame_get_saved_regs (struct frame_info *fi, struct rs6000_framedata *fdatap)
/* The following is true only if the frame doesn't have a call to
alloca(), FIXME. */
- if (fdatap->saved_fpr == 0 && fdatap->saved_gpr == 0
- && fdatap->lr_offset == 0 && fdatap->cr_offset == 0)
+ if (fdatap->saved_fpr == 0
+ && fdatap->saved_gpr == 0
+ && fdatap->saved_vr == 0
+ && fdatap->lr_offset == 0
+ && fdatap->cr_offset == 0
+ && fdatap->vr_offset == 0)
frame_addr = 0;
- else if (fi->prev && fi->prev->frame)
- frame_addr = fi->prev->frame;
else
- frame_addr = read_memory_addr (fi->frame, wordsize);
+ /* NOTE: cagney/2002-04-14: The ->frame points to the inner-most
+ address of the current frame. Things might be easier if the
+ ->frame pointed to the outer-most address of the frame. In the
+ mean time, the address of the prev frame is used as the base
+ address of this frame. */
+ frame_addr = FRAME_CHAIN (fi);
/* if != -1, fdatap->saved_fpr is the smallest number of saved_fpr.
All fpr's from saved_fpr to fp31 are saved. */
@@ -1358,17 +1434,36 @@ frame_get_saved_regs (struct frame_info *fi, struct rs6000_framedata *fdatap)
}
}
+ /* if != -1, fdatap->saved_vr is the smallest number of saved_vr.
+ All vr's from saved_vr to vr31 are saved. */
+ if (tdep->ppc_vr0_regnum != -1 && tdep->ppc_vrsave_regnum != -1)
+ {
+ if (fdatap->saved_vr >= 0)
+ {
+ int i;
+ CORE_ADDR vr_addr = frame_addr + fdatap->vr_offset;
+ for (i = fdatap->saved_vr; i < 32; i++)
+ {
+ fi->saved_regs[tdep->ppc_vr0_regnum + i] = vr_addr;
+ vr_addr += REGISTER_RAW_SIZE (tdep->ppc_vr0_regnum);
+ }
+ }
+ }
+
/* If != 0, fdatap->cr_offset is the offset from the frame that holds
the CR. */
if (fdatap->cr_offset != 0)
- fi->saved_regs[gdbarch_tdep (current_gdbarch)->ppc_cr_regnum] =
- frame_addr + fdatap->cr_offset;
+ fi->saved_regs[tdep->ppc_cr_regnum] = frame_addr + fdatap->cr_offset;
/* If != 0, fdatap->lr_offset is the offset from the frame that holds
the LR. */
if (fdatap->lr_offset != 0)
- fi->saved_regs[gdbarch_tdep (current_gdbarch)->ppc_lr_regnum] =
- frame_addr + fdatap->lr_offset;
+ fi->saved_regs[tdep->ppc_lr_regnum] = frame_addr + fdatap->lr_offset;
+
+ /* If != 0, fdatap->vrsave_offset is the offset from the frame that holds
+ the VRSAVE. */
+ if (fdatap->vrsave_offset != 0)
+ fi->saved_regs[tdep->ppc_vrsave_regnum] = frame_addr + fdatap->vrsave_offset;
}
/* Return the address of a frame. This is the inital %sp value when the frame
@@ -1406,41 +1501,22 @@ frame_initial_stack_address (struct frame_info *fi)
return fi->extra_info->initial_sp;
}
- /* This function has an alloca register. If this is the top-most frame
- (with the lowest address), the value in alloca register is good. */
-
- if (!fi->next)
- return fi->extra_info->initial_sp = read_register (fdata.alloca_reg);
-
- /* Otherwise, this is a caller frame. Callee has usually already saved
- registers, but there are exceptions (such as when the callee
- has no parameters). Find the address in which caller's alloca
- register is saved. */
-
- for (callee_fi = fi->next; callee_fi; callee_fi = callee_fi->next)
- {
-
- if (!callee_fi->saved_regs)
- frame_get_saved_regs (callee_fi, NULL);
-
- /* this is the address in which alloca register is saved. */
-
- tmpaddr = callee_fi->saved_regs[fdata.alloca_reg];
- if (tmpaddr)
- {
- fi->extra_info->initial_sp =
- read_memory_addr (tmpaddr, TDEP->wordsize);
- return fi->extra_info->initial_sp;
- }
-
- /* Go look into deeper levels of the frame chain to see if any one of
- the callees has saved alloca register. */
- }
-
- /* If alloca register was not saved, by the callee (or any of its callees)
- then the value in the register is still good. */
-
- fi->extra_info->initial_sp = read_register (fdata.alloca_reg);
+ /* There is an alloca register, use its value, in the current frame,
+ as the initial stack pointer. */
+ {
+ char *tmpbuf = alloca (MAX_REGISTER_RAW_SIZE);
+ if (frame_register_read (fi, fdata.alloca_reg, tmpbuf))
+ {
+ fi->extra_info->initial_sp
+ = extract_unsigned_integer (tmpbuf,
+ REGISTER_RAW_SIZE (fdata.alloca_reg));
+ }
+ else
+ /* NOTE: cagney/2002-04-17: At present the only time
+ frame_register_read will fail is when the register isn't
+ available. If that does happen, use the frame. */
+ fi->extra_info->initial_sp = fi->frame;
+ }
return fi->extra_info->initial_sp;
}
@@ -1648,7 +1724,7 @@ rs6000_do_altivec_registers (int regnum)
print_spaces_filtered (15 - strlen (REGISTER_NAME (i)), gdb_stdout);
/* Get the data in raw format. */
- if (read_relative_register_raw_bytes (i, raw_buffer))
+ if (!frame_register_read (selected_frame, i, raw_buffer))
{
printf_filtered ("*value not available*\n");
continue;
@@ -1745,7 +1821,7 @@ rs6000_do_registers_info (int regnum, int fpregs)
print_spaces_filtered (15 - strlen (REGISTER_NAME (i)), gdb_stdout);
/* Get the data in raw format. */
- if (read_relative_register_raw_bytes (i, raw_buffer))
+ if (!frame_register_read (selected_frame, i, raw_buffer))
{
printf_filtered ("*value not available*\n");
continue;
@@ -1843,6 +1919,8 @@ rs6000_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
static void
rs6000_store_return_value (struct type *type, char *valbuf)
{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
if (TYPE_CODE (type) == TYPE_CODE_FLT)
/* Floating point values are returned starting from FPR1 and up.
@@ -1851,6 +1929,13 @@ rs6000_store_return_value (struct type *type, char *valbuf)
write_register_bytes (REGISTER_BYTE (FP0_REGNUM + 1), valbuf,
TYPE_LENGTH (type));
+ else if (TYPE_CODE (type) == TYPE_CODE_ARRAY)
+ {
+ if (TYPE_LENGTH (type) == 16
+ && TYPE_VECTOR (type))
+ write_register_bytes (REGISTER_BYTE (tdep->ppc_vr0_regnum + 2),
+ valbuf, TYPE_LENGTH (type));
+ }
else
/* Everything else is returned in GPR3 and up. */
write_register_bytes (REGISTER_BYTE (gdbarch_tdep (current_gdbarch)->ppc_gp0_regnum + 3),
@@ -1941,7 +2026,21 @@ rs6000_convert_from_func_ptr_addr (CORE_ADDR addr)
Most of these register groups aren't anything formal. I arrived at
them by looking at the registers that occurred in more than one
- processor. */
+ processor.
+
+ Note: kevinb/2002-04-30: Support for the fpscr register was added
+ during April, 2002. Slot 70 is being used for PowerPC and slot 71
+ for Power. For PowerPC, slot 70 was unused and was already in the
+ PPC_UISA_SPRS which is ideally where fpscr should go. For Power,
+ slot 70 was being used for "mq", so the next available slot (71)
+ was chosen. It would have been nice to be able to make the
+ register numbers the same across processor cores, but this wasn't
+ possible without either 1) renumbering some registers for some
+ processors or 2) assigning fpscr to a really high slot that's
+ larger than any current register number. Doing (1) is bad because
+ existing stubs would break. Doing (2) is undesirable because it
+ would introduce a really large gap between fpscr and the rest of
+ the registers for most processors. */
/* Convenience macros for populating register arrays. */
@@ -1992,9 +2091,20 @@ rs6000_convert_from_func_ptr_addr (CORE_ADDR addr)
/* 56 */ F(f24),F(f25),F(f26),F(f27),F(f28),F(f29),F(f30),F(f31), \
/* 64 */ R(pc), R(ps)
+#define COMMON_UISA_NOFP_REGS \
+ /* 0 */ R(r0), R(r1), R(r2), R(r3), R(r4), R(r5), R(r6), R(r7), \
+ /* 8 */ R(r8), R(r9), R(r10),R(r11),R(r12),R(r13),R(r14),R(r15), \
+ /* 16 */ R(r16),R(r17),R(r18),R(r19),R(r20),R(r21),R(r22),R(r23), \
+ /* 24 */ R(r24),R(r25),R(r26),R(r27),R(r28),R(r29),R(r30),R(r31), \
+ /* 32 */ R0, R0, R0, R0, R0, R0, R0, R0, \
+ /* 40 */ R0, R0, R0, R0, R0, R0, R0, R0, \
+ /* 48 */ R0, R0, R0, R0, R0, R0, R0, R0, \
+ /* 56 */ R0, R0, R0, R0, R0, R0, R0, R0, \
+ /* 64 */ R(pc), R(ps)
+
/* UISA-level SPRs for PowerPC. */
#define PPC_UISA_SPRS \
- /* 66 */ R4(cr), R(lr), R(ctr), R4(xer), R0
+ /* 66 */ R4(cr), R(lr), R(ctr), R4(xer), R4(fpscr)
/* Segment registers, for PowerPC. */
#define PPC_SEGMENT_REGS \
@@ -2028,7 +2138,8 @@ rs6000_convert_from_func_ptr_addr (CORE_ADDR addr)
static const struct reg registers_power[] =
{
COMMON_UISA_REGS,
- /* 66 */ R4(cnd), R(lr), R(cnt), R4(xer), R4(mq)
+ /* 66 */ R4(cnd), R(lr), R(cnt), R4(xer), R4(mq),
+ /* 71 */ R4(fpscr)
};
/* PowerPC UISA - a PPC processor as viewed by user-level code. A UISA-only
@@ -2040,6 +2151,14 @@ static const struct reg registers_powerpc[] =
PPC_ALTIVEC_REGS
};
+/* PowerPC UISA - a PPC processor as viewed by user-level
+ code, but without floating point registers. */
+static const struct reg registers_powerpc_nofp[] =
+{
+ COMMON_UISA_NOFP_REGS,
+ PPC_UISA_SPRS
+};
+
/* IBM PowerPC 403. */
static const struct reg registers_403[] =
{
@@ -2245,11 +2364,21 @@ static const struct variant variants[] =
{"7400", "Motorola/IBM PowerPC 7400 (G4)", bfd_arch_powerpc,
bfd_mach_ppc_7400, num_registers (registers_7400), registers_7400},
- /* FIXME: I haven't checked the register sets of the following. */
+ /* 64-bit */
+ {"powerpc64", "PowerPC 64-bit user-level", bfd_arch_powerpc,
+ bfd_mach_ppc64, num_registers (registers_powerpc), registers_powerpc},
{"620", "Motorola PowerPC 620", bfd_arch_powerpc,
bfd_mach_ppc_620, num_registers (registers_powerpc), registers_powerpc},
+ {"630", "Motorola PowerPC 630", bfd_arch_powerpc,
+ bfd_mach_ppc_630, num_registers (registers_powerpc), registers_powerpc},
{"a35", "PowerPC A35", bfd_arch_powerpc,
bfd_mach_ppc_a35, num_registers (registers_powerpc), registers_powerpc},
+ {"rs64ii", "PowerPC rs64ii", bfd_arch_powerpc,
+ bfd_mach_ppc_rs64ii, num_registers (registers_powerpc), registers_powerpc},
+ {"rs64iii", "PowerPC rs64iii", bfd_arch_powerpc,
+ bfd_mach_ppc_rs64iii, num_registers (registers_powerpc), registers_powerpc},
+
+ /* FIXME: I haven't checked the register sets of the following. */
{"rs1", "IBM POWER RS1", bfd_arch_rs6000,
bfd_mach_rs6k_rs1, num_registers (registers_power), registers_power},
{"rsc", "IBM POWER RSC", bfd_arch_rs6000,
@@ -2377,6 +2506,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
unsigned long mach;
bfd abfd;
int osabi, sysv_abi;
+ gdbarch_print_insn_ftype *print_insn;
from_xcoff_exec = info.abfd && info.abfd->format == bfd_object &&
bfd_get_flavour (info.abfd) == bfd_target_xcoff_flavour;
@@ -2392,7 +2522,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
that, else choose a likely default. */
if (from_xcoff_exec)
{
- if (xcoff_data (info.abfd)->xcoff64)
+ if (bfd_xcoff_is_xcoff64 (info.abfd))
wordsize = 8;
else
wordsize = 4;
@@ -2406,7 +2536,11 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
}
else
{
- wordsize = 4;
+ if (info.bfd_arch_info != NULL && info.bfd_arch_info->bits_per_word != 0)
+ wordsize = info.bfd_arch_info->bits_per_word /
+ info.bfd_arch_info->bits_per_byte;
+ else
+ wordsize = 4;
}
/* Find a candidate among extant architectures. */
@@ -2448,11 +2582,6 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
gdbarch = gdbarch_alloc (&info, tdep);
power = arch == bfd_arch_rs6000;
- /* Select instruction printer. */
- tm_print_insn = arch == power ? print_insn_rs6000 :
- info.byte_order == BFD_ENDIAN_BIG ? print_insn_big_powerpc :
- print_insn_little_powerpc;
-
/* Choose variant. */
v = find_variant_by_arch (arch, mach);
if (!v)
@@ -2470,8 +2599,11 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
tdep->ppc_xer_regnum = 69;
if (v->mach == bfd_mach_ppc_601)
tdep->ppc_mq_regnum = 124;
- else
+ else if (power)
tdep->ppc_mq_regnum = 70;
+ else
+ tdep->ppc_mq_regnum = -1;
+ tdep->ppc_fpscr_regnum = power ? 71 : 70;
if (v->arch == bfd_arch_powerpc)
switch (v->mach)
@@ -2490,7 +2622,15 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
break;
}
- /* Calculate byte offsets in raw register array. */
+ /* Set lr_frame_offset. */
+ if (wordsize == 8)
+ tdep->lr_frame_offset = 16;
+ else if (sysv_abi)
+ tdep->lr_frame_offset = 4;
+ else
+ tdep->lr_frame_offset = 8;
+
+ /* Calculate byte offsets in raw register array. */
tdep->regoff = xmalloc (v->nregs * sizeof (int));
for (i = off = 0; i < v->nregs; i++)
{
@@ -2498,10 +2638,18 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
off += regsize (v->regs + i, wordsize);
}
+ /* Select instruction printer. */
+ if (arch == power)
+ print_insn = print_insn_rs6000;
+ else if (info.byte_order == BFD_ENDIAN_BIG)
+ print_insn = print_insn_big_powerpc;
+ else
+ print_insn = print_insn_little_powerpc;
+ set_gdbarch_print_insn (gdbarch, print_insn);
+
set_gdbarch_read_pc (gdbarch, generic_target_read_pc);
set_gdbarch_write_pc (gdbarch, generic_target_write_pc);
set_gdbarch_read_fp (gdbarch, generic_target_read_fp);
- set_gdbarch_write_fp (gdbarch, generic_target_write_fp);
set_gdbarch_read_sp (gdbarch, generic_target_read_sp);
set_gdbarch_write_sp (gdbarch, generic_target_write_sp);
@@ -2514,9 +2662,9 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_register_bytes (gdbarch, off);
set_gdbarch_register_byte (gdbarch, rs6000_register_byte);
set_gdbarch_register_raw_size (gdbarch, rs6000_register_raw_size);
- set_gdbarch_max_register_raw_size (gdbarch, 8);
+ set_gdbarch_max_register_raw_size (gdbarch, 16);
set_gdbarch_register_virtual_size (gdbarch, generic_register_virtual_size);
- set_gdbarch_max_register_virtual_size (gdbarch, 8);
+ set_gdbarch_max_register_virtual_size (gdbarch, 16);
set_gdbarch_register_virtual_type (gdbarch, rs6000_register_virtual_type);
set_gdbarch_do_registers_info (gdbarch, rs6000_do_registers_info);
@@ -2555,7 +2703,14 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_extract_return_value (gdbarch, rs6000_extract_return_value);
- if (sysv_abi)
+ /* Note: kevinb/2002-04-12: I'm not convinced that rs6000_push_arguments()
+ is correct for the SysV ABI when the wordsize is 8, but I'm also
+ fairly certain that ppc_sysv_abi_push_arguments() will give even
+ worse results since it only works for 32-bit code. So, for the moment,
+ we're better off calling rs6000_push_arguments() since it works for
+ 64-bit code. At some point in the future, this matter needs to be
+ revisited. */
+ if (sysv_abi && wordsize == 4)
set_gdbarch_push_arguments (gdbarch, ppc_sysv_abi_push_arguments);
else
set_gdbarch_push_arguments (gdbarch, rs6000_push_arguments);
@@ -2563,8 +2718,6 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_store_struct_return (gdbarch, rs6000_store_struct_return);
set_gdbarch_store_return_value (gdbarch, rs6000_store_return_value);
set_gdbarch_extract_struct_value_address (gdbarch, rs6000_extract_struct_value_address);
- set_gdbarch_use_struct_convention (gdbarch, generic_use_struct_convention);
-
set_gdbarch_pop_frame (gdbarch, rs6000_pop_frame);
set_gdbarch_skip_prologue (gdbarch, rs6000_skip_prologue);
@@ -2576,8 +2729,31 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* Not sure on this. FIXMEmgo */
set_gdbarch_frame_args_skip (gdbarch, 8);
+ /* Until November 2001, gcc was not complying to the SYSV ABI for
+ returning structures less than or equal to 8 bytes in size. It was
+ returning everything in memory. When this was corrected, it wasn't
+ fixed for native platforms. */
+ if (sysv_abi)
+ {
+ if (osabi == ELFOSABI_LINUX
+ || osabi == ELFOSABI_NETBSD
+ || osabi == ELFOSABI_FREEBSD)
+ set_gdbarch_use_struct_convention (gdbarch,
+ ppc_sysv_abi_broken_use_struct_convention);
+ else
+ set_gdbarch_use_struct_convention (gdbarch,
+ ppc_sysv_abi_use_struct_convention);
+ }
+ else
+ {
+ set_gdbarch_use_struct_convention (gdbarch,
+ generic_use_struct_convention);
+ }
+
set_gdbarch_frame_chain_valid (gdbarch, file_frame_chain_valid);
- if (osabi == ELFOSABI_LINUX)
+ /* Note: kevinb/2002-04-12: See note above regarding *_push_arguments().
+ The same remarks hold for the methods below. */
+ if (osabi == ELFOSABI_LINUX && wordsize == 4)
{
set_gdbarch_frameless_function_invocation (gdbarch,
ppc_linux_frameless_function_invocation);
@@ -2603,8 +2779,11 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_frame_init_saved_regs (gdbarch, rs6000_frame_init_saved_regs);
set_gdbarch_init_extra_frame_info (gdbarch, rs6000_init_extra_frame_info);
-
- /* Handle RS/6000 function pointers. */
+ }
+ if (!sysv_abi)
+ {
+ /* Handle RS/6000 function pointers (which are really function
+ descriptors). */
set_gdbarch_convert_from_func_ptr_addr (gdbarch,
rs6000_convert_from_func_ptr_addr);
}
diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c
index 3f02e2a..c69aca6 100644
--- a/gdb/s390-tdep.c
+++ b/gdb/s390-tdep.c
@@ -1009,9 +1009,7 @@ s390_frame_chain (struct frame_info *thisframe)
{
CORE_ADDR prev_fp = 0;
- if (thisframe->prev && thisframe->prev->frame)
- prev_fp = thisframe->prev->frame;
- else if (generic_find_dummy_frame (thisframe->pc, thisframe->frame))
+ if (generic_find_dummy_frame (thisframe->pc, thisframe->frame))
return generic_read_register_dummy (thisframe->pc, thisframe->frame,
S390_SP_REGNUM);
else
@@ -1212,13 +1210,6 @@ s390_read_fp ()
}
-void
-s390_write_fp (CORE_ADDR val)
-{
- write_register (s390_fp_regnum (), val);
-}
-
-
static void
s390_pop_frame_regular (struct frame_info *frame)
{
@@ -1707,7 +1698,7 @@ s390_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
-static unsigned char *
+const static unsigned char *
s390_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
{
static unsigned char breakpoint[] = { 0x0, 0x1 };
@@ -1801,7 +1792,6 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_init_extra_frame_info (gdbarch, s390_init_extra_frame_info);
set_gdbarch_init_frame_pc_first (gdbarch, s390_init_frame_pc_first);
set_gdbarch_read_fp (gdbarch, s390_read_fp);
- set_gdbarch_write_fp (gdbarch, s390_write_fp);
/* This function that tells us whether the function invocation represented
by FI does not have a frame on the stack associated with it. If it
does not, FRAMELESS is set to 1, else 0. */
diff --git a/gdb/scm-lang.c b/gdb/scm-lang.c
index 30ca763..00d6797 100644
--- a/gdb/scm-lang.c
+++ b/gdb/scm-lang.c
@@ -180,7 +180,7 @@ scm_lookup_name (char *str)
(struct symtab **) NULL);
if (sym)
return value_of_variable (sym, NULL);
- error ("No symbol \"%s\" in current context.");
+ error ("No symbol \"%s\" in current context.", str);
}
struct value *
diff --git a/gdb/ser-unix.h b/gdb/ser-unix.h
index 861694f..f7be059 100644
--- a/gdb/ser-unix.h
+++ b/gdb/ser-unix.h
@@ -1,5 +1,6 @@
/* Serial interface for UN*X file-descriptor based connection.
- Copyright 1999, 2000 Free Software Foundation, Inc.
+
+ Copyright 1999, 2000, 2002 Free Software Foundation, Inc.
This file is part of GDB.
@@ -21,9 +22,6 @@
#ifndef SER_UNIX_H
#define SER_UNIX_H
-#undef XMALLOC
-#define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE))
-
/* Generic UNIX/FD functions */
extern int ser_unix_nop_flush_output (struct serial *scb);
diff --git a/gdb/serial.c b/gdb/serial.c
index 22964eb..ada5631 100644
--- a/gdb/serial.c
+++ b/gdb/serial.c
@@ -1,7 +1,7 @@
/* Generic serial interface routines
- Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
- Free Software Foundation, Inc.
+ Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+ 2001, 2002 Free Software Foundation, Inc.
This file is part of GDB.
@@ -58,9 +58,6 @@ static const char logbase_ascii[] = "ascii";
static const char *logbase_enums[] =
{logbase_hex, logbase_octal, logbase_ascii, NULL};
static const char *serial_logbase = logbase_ascii;
-
-#undef XMALLOC
-#define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
static int serial_current_type = 0;
diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c
index 3f7bc6a..996e611 100644
--- a/gdb/sh-tdep.c
+++ b/gdb/sh-tdep.c
@@ -43,9 +43,6 @@
#include "solib-svr4.h"
-#undef XMALLOC
-#define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
-
void (*sh_show_regs) (void);
CORE_ADDR (*skip_prologue_hard_way) (CORE_ADDR);
void (*do_pseudo_register) (int);
@@ -484,7 +481,7 @@ sh_find_callers_reg (struct frame_info *fi, int regnum)
static void
sh_nofp_frame_init_saved_regs (struct frame_info *fi)
{
- int where[NUM_REGS + NUM_PSEUDO_REGS];
+ int *where = (int *) alloca (NUM_REGS + NUM_PSEUDO_REGS);
int rn;
int have_fp = 0;
int depth;
@@ -626,7 +623,7 @@ dr_reg_base_num (int dr_regnum)
static void
sh_fp_frame_init_saved_regs (struct frame_info *fi)
{
- int where[NUM_REGS + NUM_PSEUDO_REGS];
+ int *where = (int *) alloca (NUM_REGS + NUM_PSEUDO_REGS);
int rn;
int have_fp = 0;
int depth;
@@ -1735,7 +1732,7 @@ sh_do_fp_register (int regnum)
raw_buffer = (char *) alloca (REGISTER_RAW_SIZE (FP0_REGNUM));
/* Get the data in raw format. */
- if (read_relative_register_raw_bytes (regnum, raw_buffer))
+ if (!frame_register_read (selected_frame, regnum, raw_buffer))
error ("can't read register %d (%s)", regnum, REGISTER_NAME (regnum));
/* Get the register as a number */
@@ -1772,7 +1769,7 @@ sh_do_register (int regnum)
print_spaces_filtered (15 - strlen (REGISTER_NAME (regnum)), gdb_stdout);
/* Get the data in raw format. */
- if (read_relative_register_raw_bytes (regnum, raw_buffer))
+ if (!frame_register_read (selected_frame, regnum, raw_buffer))
printf_filtered ("*value not available*\n");
val_print (REGISTER_VIRTUAL_TYPE (regnum), raw_buffer, 0, 0,
@@ -2122,7 +2119,6 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_read_pc (gdbarch, generic_target_read_pc);
set_gdbarch_write_pc (gdbarch, generic_target_write_pc);
set_gdbarch_read_fp (gdbarch, generic_target_read_fp);
- set_gdbarch_write_fp (gdbarch, generic_target_write_fp);
set_gdbarch_read_sp (gdbarch, generic_target_read_sp);
set_gdbarch_write_sp (gdbarch, generic_target_write_sp);
diff --git a/gdb/signals.c b/gdb/signals.c
deleted file mode 100644
index d37ec06..0000000
--- a/gdb/signals.c
+++ /dev/null
@@ -1,837 +0,0 @@
-/* Target signal translation functions for GDB.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001 Free Software Foundation, Inc.
- Contributed by Cygnus Support.
-
- 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 "target.h"
-#include <signal.h>
-
-/* This table must match in order and size the signals in enum target_signal
- in target.h. */
-/* *INDENT-OFF* */
-static struct {
- char *name;
- char *string;
- } signals [] =
-{
- {"0", "Signal 0"},
- {"SIGHUP", "Hangup"},
- {"SIGINT", "Interrupt"},
- {"SIGQUIT", "Quit"},
- {"SIGILL", "Illegal instruction"},
- {"SIGTRAP", "Trace/breakpoint trap"},
- {"SIGABRT", "Aborted"},
- {"SIGEMT", "Emulation trap"},
- {"SIGFPE", "Arithmetic exception"},
- {"SIGKILL", "Killed"},
- {"SIGBUS", "Bus error"},
- {"SIGSEGV", "Segmentation fault"},
- {"SIGSYS", "Bad system call"},
- {"SIGPIPE", "Broken pipe"},
- {"SIGALRM", "Alarm clock"},
- {"SIGTERM", "Terminated"},
- {"SIGURG", "Urgent I/O condition"},
- {"SIGSTOP", "Stopped (signal)"},
- {"SIGTSTP", "Stopped (user)"},
- {"SIGCONT", "Continued"},
- {"SIGCHLD", "Child status changed"},
- {"SIGTTIN", "Stopped (tty input)"},
- {"SIGTTOU", "Stopped (tty output)"},
- {"SIGIO", "I/O possible"},
- {"SIGXCPU", "CPU time limit exceeded"},
- {"SIGXFSZ", "File size limit exceeded"},
- {"SIGVTALRM", "Virtual timer expired"},
- {"SIGPROF", "Profiling timer expired"},
- {"SIGWINCH", "Window size changed"},
- {"SIGLOST", "Resource lost"},
- {"SIGUSR1", "User defined signal 1"},
- {"SIGUSR2", "User defined signal 2"},
- {"SIGPWR", "Power fail/restart"},
- {"SIGPOLL", "Pollable event occurred"},
- {"SIGWIND", "SIGWIND"},
- {"SIGPHONE", "SIGPHONE"},
- {"SIGWAITING", "Process's LWPs are blocked"},
- {"SIGLWP", "Signal LWP"},
- {"SIGDANGER", "Swap space dangerously low"},
- {"SIGGRANT", "Monitor mode granted"},
- {"SIGRETRACT", "Need to relinquish monitor mode"},
- {"SIGMSG", "Monitor mode data available"},
- {"SIGSOUND", "Sound completed"},
- {"SIGSAK", "Secure attention"},
- {"SIGPRIO", "SIGPRIO"},
- {"SIG33", "Real-time event 33"},
- {"SIG34", "Real-time event 34"},
- {"SIG35", "Real-time event 35"},
- {"SIG36", "Real-time event 36"},
- {"SIG37", "Real-time event 37"},
- {"SIG38", "Real-time event 38"},
- {"SIG39", "Real-time event 39"},
- {"SIG40", "Real-time event 40"},
- {"SIG41", "Real-time event 41"},
- {"SIG42", "Real-time event 42"},
- {"SIG43", "Real-time event 43"},
- {"SIG44", "Real-time event 44"},
- {"SIG45", "Real-time event 45"},
- {"SIG46", "Real-time event 46"},
- {"SIG47", "Real-time event 47"},
- {"SIG48", "Real-time event 48"},
- {"SIG49", "Real-time event 49"},
- {"SIG50", "Real-time event 50"},
- {"SIG51", "Real-time event 51"},
- {"SIG52", "Real-time event 52"},
- {"SIG53", "Real-time event 53"},
- {"SIG54", "Real-time event 54"},
- {"SIG55", "Real-time event 55"},
- {"SIG56", "Real-time event 56"},
- {"SIG57", "Real-time event 57"},
- {"SIG58", "Real-time event 58"},
- {"SIG59", "Real-time event 59"},
- {"SIG60", "Real-time event 60"},
- {"SIG61", "Real-time event 61"},
- {"SIG62", "Real-time event 62"},
- {"SIG63", "Real-time event 63"},
- {"SIGCANCEL", "LWP internal signal"},
- {"SIG32", "Real-time event 32"},
- {"SIG64", "Real-time event 64"},
- {"SIG65", "Real-time event 65"},
- {"SIG66", "Real-time event 66"},
- {"SIG67", "Real-time event 67"},
- {"SIG68", "Real-time event 68"},
- {"SIG69", "Real-time event 69"},
- {"SIG70", "Real-time event 70"},
- {"SIG71", "Real-time event 71"},
- {"SIG72", "Real-time event 72"},
- {"SIG73", "Real-time event 73"},
- {"SIG74", "Real-time event 74"},
- {"SIG75", "Real-time event 75"},
- {"SIG76", "Real-time event 76"},
- {"SIG77", "Real-time event 77"},
- {"SIG78", "Real-time event 78"},
- {"SIG79", "Real-time event 79"},
- {"SIG80", "Real-time event 80"},
- {"SIG81", "Real-time event 81"},
- {"SIG82", "Real-time event 82"},
- {"SIG83", "Real-time event 83"},
- {"SIG84", "Real-time event 84"},
- {"SIG85", "Real-time event 85"},
- {"SIG86", "Real-time event 86"},
- {"SIG87", "Real-time event 87"},
- {"SIG88", "Real-time event 88"},
- {"SIG89", "Real-time event 89"},
- {"SIG90", "Real-time event 90"},
- {"SIG91", "Real-time event 91"},
- {"SIG92", "Real-time event 92"},
- {"SIG93", "Real-time event 93"},
- {"SIG94", "Real-time event 94"},
- {"SIG95", "Real-time event 95"},
- {"SIG96", "Real-time event 96"},
- {"SIG97", "Real-time event 97"},
- {"SIG98", "Real-time event 98"},
- {"SIG99", "Real-time event 99"},
- {"SIG100", "Real-time event 100"},
- {"SIG101", "Real-time event 101"},
- {"SIG102", "Real-time event 102"},
- {"SIG103", "Real-time event 103"},
- {"SIG104", "Real-time event 104"},
- {"SIG105", "Real-time event 105"},
- {"SIG106", "Real-time event 106"},
- {"SIG107", "Real-time event 107"},
- {"SIG108", "Real-time event 108"},
- {"SIG109", "Real-time event 109"},
- {"SIG110", "Real-time event 110"},
- {"SIG111", "Real-time event 111"},
- {"SIG112", "Real-time event 112"},
- {"SIG113", "Real-time event 113"},
- {"SIG114", "Real-time event 114"},
- {"SIG115", "Real-time event 115"},
- {"SIG116", "Real-time event 116"},
- {"SIG117", "Real-time event 117"},
- {"SIG118", "Real-time event 118"},
- {"SIG119", "Real-time event 119"},
- {"SIG120", "Real-time event 120"},
- {"SIG121", "Real-time event 121"},
- {"SIG122", "Real-time event 122"},
- {"SIG123", "Real-time event 123"},
- {"SIG124", "Real-time event 124"},
- {"SIG125", "Real-time event 125"},
- {"SIG126", "Real-time event 126"},
- {"SIG127", "Real-time event 127"},
-
-#if defined(MACH) || defined(__MACH__)
- /* Mach exceptions */
- {"EXC_BAD_ACCESS", "Could not access memory"},
- {"EXC_BAD_INSTRUCTION", "Illegal instruction/operand"},
- {"EXC_ARITHMETIC", "Arithmetic exception"},
- {"EXC_EMULATION", "Emulation instruction"},
- {"EXC_SOFTWARE", "Software generated exception"},
- {"EXC_BREAKPOINT", "Breakpoint"},
-#endif
- {"SIGINFO", "Information request"},
-
- {NULL, "Unknown signal"},
- {NULL, "Internal error: printing TARGET_SIGNAL_DEFAULT"},
-
- /* Last entry, used to check whether the table is the right size. */
- {NULL, "TARGET_SIGNAL_MAGIC"}
-};
-/* *INDENT-ON* */
-
-
-
-/* Return the string for a signal. */
-char *
-target_signal_to_string (enum target_signal sig)
-{
- if ((sig >= TARGET_SIGNAL_FIRST) && (sig <= TARGET_SIGNAL_LAST))
- return signals[sig].string;
- else
- return signals[TARGET_SIGNAL_UNKNOWN].string;
-}
-
-/* Return the name for a signal. */
-char *
-target_signal_to_name (enum target_signal sig)
-{
- if ((sig >= TARGET_SIGNAL_FIRST) && (sig <= TARGET_SIGNAL_LAST)
- && signals[sig].name != NULL)
- return signals[sig].name;
- else
- /* I think the code which prints this will always print it along
- with the string, so no need to be verbose (very old comment). */
- return "?";
-}
-
-/* Given a name, return its signal. */
-enum target_signal
-target_signal_from_name (char *name)
-{
- enum target_signal sig;
-
- /* It's possible we also should allow "SIGCLD" as well as "SIGCHLD"
- for TARGET_SIGNAL_SIGCHLD. SIGIOT, on the other hand, is more
- questionable; seems like by now people should call it SIGABRT
- instead. */
-
- /* This ugly cast brought to you by the native VAX compiler. */
- for (sig = TARGET_SIGNAL_HUP;
- signals[sig].name != NULL;
- sig = (enum target_signal) ((int) sig + 1))
- if (STREQ (name, signals[sig].name))
- return sig;
- return TARGET_SIGNAL_UNKNOWN;
-}
-
-/* The following functions are to help certain targets deal
- with the signal/waitstatus stuff. They could just as well be in
- a file called native-utils.c or unixwaitstatus-utils.c or whatever. */
-
-/* Convert host signal to our signals. */
-enum target_signal
-target_signal_from_host (int hostsig)
-{
- /* A switch statement would make sense but would require special kludges
- to deal with the cases where more than one signal has the same number. */
-
- if (hostsig == 0)
- return TARGET_SIGNAL_0;
-
-#if defined (SIGHUP)
- if (hostsig == SIGHUP)
- return TARGET_SIGNAL_HUP;
-#endif
-#if defined (SIGINT)
- if (hostsig == SIGINT)
- return TARGET_SIGNAL_INT;
-#endif
-#if defined (SIGQUIT)
- if (hostsig == SIGQUIT)
- return TARGET_SIGNAL_QUIT;
-#endif
-#if defined (SIGILL)
- if (hostsig == SIGILL)
- return TARGET_SIGNAL_ILL;
-#endif
-#if defined (SIGTRAP)
- if (hostsig == SIGTRAP)
- return TARGET_SIGNAL_TRAP;
-#endif
-#if defined (SIGABRT)
- if (hostsig == SIGABRT)
- return TARGET_SIGNAL_ABRT;
-#endif
-#if defined (SIGEMT)
- if (hostsig == SIGEMT)
- return TARGET_SIGNAL_EMT;
-#endif
-#if defined (SIGFPE)
- if (hostsig == SIGFPE)
- return TARGET_SIGNAL_FPE;
-#endif
-#if defined (SIGKILL)
- if (hostsig == SIGKILL)
- return TARGET_SIGNAL_KILL;
-#endif
-#if defined (SIGBUS)
- if (hostsig == SIGBUS)
- return TARGET_SIGNAL_BUS;
-#endif
-#if defined (SIGSEGV)
- if (hostsig == SIGSEGV)
- return TARGET_SIGNAL_SEGV;
-#endif
-#if defined (SIGSYS)
- if (hostsig == SIGSYS)
- return TARGET_SIGNAL_SYS;
-#endif
-#if defined (SIGPIPE)
- if (hostsig == SIGPIPE)
- return TARGET_SIGNAL_PIPE;
-#endif
-#if defined (SIGALRM)
- if (hostsig == SIGALRM)
- return TARGET_SIGNAL_ALRM;
-#endif
-#if defined (SIGTERM)
- if (hostsig == SIGTERM)
- return TARGET_SIGNAL_TERM;
-#endif
-#if defined (SIGUSR1)
- if (hostsig == SIGUSR1)
- return TARGET_SIGNAL_USR1;
-#endif
-#if defined (SIGUSR2)
- if (hostsig == SIGUSR2)
- return TARGET_SIGNAL_USR2;
-#endif
-#if defined (SIGCLD)
- if (hostsig == SIGCLD)
- return TARGET_SIGNAL_CHLD;
-#endif
-#if defined (SIGCHLD)
- if (hostsig == SIGCHLD)
- return TARGET_SIGNAL_CHLD;
-#endif
-#if defined (SIGPWR)
- if (hostsig == SIGPWR)
- return TARGET_SIGNAL_PWR;
-#endif
-#if defined (SIGWINCH)
- if (hostsig == SIGWINCH)
- return TARGET_SIGNAL_WINCH;
-#endif
-#if defined (SIGURG)
- if (hostsig == SIGURG)
- return TARGET_SIGNAL_URG;
-#endif
-#if defined (SIGIO)
- if (hostsig == SIGIO)
- return TARGET_SIGNAL_IO;
-#endif
-#if defined (SIGPOLL)
- if (hostsig == SIGPOLL)
- return TARGET_SIGNAL_POLL;
-#endif
-#if defined (SIGSTOP)
- if (hostsig == SIGSTOP)
- return TARGET_SIGNAL_STOP;
-#endif
-#if defined (SIGTSTP)
- if (hostsig == SIGTSTP)
- return TARGET_SIGNAL_TSTP;
-#endif
-#if defined (SIGCONT)
- if (hostsig == SIGCONT)
- return TARGET_SIGNAL_CONT;
-#endif
-#if defined (SIGTTIN)
- if (hostsig == SIGTTIN)
- return TARGET_SIGNAL_TTIN;
-#endif
-#if defined (SIGTTOU)
- if (hostsig == SIGTTOU)
- return TARGET_SIGNAL_TTOU;
-#endif
-#if defined (SIGVTALRM)
- if (hostsig == SIGVTALRM)
- return TARGET_SIGNAL_VTALRM;
-#endif
-#if defined (SIGPROF)
- if (hostsig == SIGPROF)
- return TARGET_SIGNAL_PROF;
-#endif
-#if defined (SIGXCPU)
- if (hostsig == SIGXCPU)
- return TARGET_SIGNAL_XCPU;
-#endif
-#if defined (SIGXFSZ)
- if (hostsig == SIGXFSZ)
- return TARGET_SIGNAL_XFSZ;
-#endif
-#if defined (SIGWIND)
- if (hostsig == SIGWIND)
- return TARGET_SIGNAL_WIND;
-#endif
-#if defined (SIGPHONE)
- if (hostsig == SIGPHONE)
- return TARGET_SIGNAL_PHONE;
-#endif
-#if defined (SIGLOST)
- if (hostsig == SIGLOST)
- return TARGET_SIGNAL_LOST;
-#endif
-#if defined (SIGWAITING)
- if (hostsig == SIGWAITING)
- return TARGET_SIGNAL_WAITING;
-#endif
-#if defined (SIGCANCEL)
- if (hostsig == SIGCANCEL)
- return TARGET_SIGNAL_CANCEL;
-#endif
-#if defined (SIGLWP)
- if (hostsig == SIGLWP)
- return TARGET_SIGNAL_LWP;
-#endif
-#if defined (SIGDANGER)
- if (hostsig == SIGDANGER)
- return TARGET_SIGNAL_DANGER;
-#endif
-#if defined (SIGGRANT)
- if (hostsig == SIGGRANT)
- return TARGET_SIGNAL_GRANT;
-#endif
-#if defined (SIGRETRACT)
- if (hostsig == SIGRETRACT)
- return TARGET_SIGNAL_RETRACT;
-#endif
-#if defined (SIGMSG)
- if (hostsig == SIGMSG)
- return TARGET_SIGNAL_MSG;
-#endif
-#if defined (SIGSOUND)
- if (hostsig == SIGSOUND)
- return TARGET_SIGNAL_SOUND;
-#endif
-#if defined (SIGSAK)
- if (hostsig == SIGSAK)
- return TARGET_SIGNAL_SAK;
-#endif
-#if defined (SIGPRIO)
- if (hostsig == SIGPRIO)
- return TARGET_SIGNAL_PRIO;
-#endif
-
- /* Mach exceptions. Assumes that the values for EXC_ are positive! */
-#if defined (EXC_BAD_ACCESS) && defined (_NSIG)
- if (hostsig == _NSIG + EXC_BAD_ACCESS)
- return TARGET_EXC_BAD_ACCESS;
-#endif
-#if defined (EXC_BAD_INSTRUCTION) && defined (_NSIG)
- if (hostsig == _NSIG + EXC_BAD_INSTRUCTION)
- return TARGET_EXC_BAD_INSTRUCTION;
-#endif
-#if defined (EXC_ARITHMETIC) && defined (_NSIG)
- if (hostsig == _NSIG + EXC_ARITHMETIC)
- return TARGET_EXC_ARITHMETIC;
-#endif
-#if defined (EXC_EMULATION) && defined (_NSIG)
- if (hostsig == _NSIG + EXC_EMULATION)
- return TARGET_EXC_EMULATION;
-#endif
-#if defined (EXC_SOFTWARE) && defined (_NSIG)
- if (hostsig == _NSIG + EXC_SOFTWARE)
- return TARGET_EXC_SOFTWARE;
-#endif
-#if defined (EXC_BREAKPOINT) && defined (_NSIG)
- if (hostsig == _NSIG + EXC_BREAKPOINT)
- return TARGET_EXC_BREAKPOINT;
-#endif
-
-#if defined (SIGINFO)
- if (hostsig == SIGINFO)
- return TARGET_SIGNAL_INFO;
-#endif
-
-#if defined (REALTIME_LO)
- if (hostsig >= REALTIME_LO && hostsig < REALTIME_HI)
- {
- /* This block of TARGET_SIGNAL_REALTIME value is in order. */
- if (33 <= hostsig && hostsig <= 63)
- return (enum target_signal)
- (hostsig - 33 + (int) TARGET_SIGNAL_REALTIME_33);
- else if (hostsig == 32)
- return TARGET_SIGNAL_REALTIME_32;
- else if (64 <= hostsig && hostsig <= 127)
- return (enum target_signal)
- (hostsig - 64 + (int) TARGET_SIGNAL_REALTIME_64);
- else
- error ("GDB bug: target.c (target_signal_from_host): unrecognized real-time signal");
- }
-#endif
-
-#if defined (SIGRTMIN)
- if (hostsig >= SIGRTMIN && hostsig <= SIGRTMAX)
- {
- /* This block of TARGET_SIGNAL_REALTIME value is in order. */
- if (33 <= hostsig && hostsig <= 63)
- return (enum target_signal)
- (hostsig - 33 + (int) TARGET_SIGNAL_REALTIME_33);
- else if (hostsig == 64)
- return TARGET_SIGNAL_REALTIME_64;
- else
- error ("GDB bug: target.c (target_signal_from_host): unrecognized real-time signal");
- }
-#endif
- return TARGET_SIGNAL_UNKNOWN;
-}
-
-/* Convert a OURSIG (an enum target_signal) to the form used by the
- target operating system (refered to as the ``host'') or zero if the
- equivalent host signal is not available. Set/clear OURSIG_OK
- accordingly. */
-
-static int
-do_target_signal_to_host (enum target_signal oursig,
- int *oursig_ok)
-{
- *oursig_ok = 1;
- switch (oursig)
- {
- case TARGET_SIGNAL_0:
- return 0;
-
-#if defined (SIGHUP)
- case TARGET_SIGNAL_HUP:
- return SIGHUP;
-#endif
-#if defined (SIGINT)
- case TARGET_SIGNAL_INT:
- return SIGINT;
-#endif
-#if defined (SIGQUIT)
- case TARGET_SIGNAL_QUIT:
- return SIGQUIT;
-#endif
-#if defined (SIGILL)
- case TARGET_SIGNAL_ILL:
- return SIGILL;
-#endif
-#if defined (SIGTRAP)
- case TARGET_SIGNAL_TRAP:
- return SIGTRAP;
-#endif
-#if defined (SIGABRT)
- case TARGET_SIGNAL_ABRT:
- return SIGABRT;
-#endif
-#if defined (SIGEMT)
- case TARGET_SIGNAL_EMT:
- return SIGEMT;
-#endif
-#if defined (SIGFPE)
- case TARGET_SIGNAL_FPE:
- return SIGFPE;
-#endif
-#if defined (SIGKILL)
- case TARGET_SIGNAL_KILL:
- return SIGKILL;
-#endif
-#if defined (SIGBUS)
- case TARGET_SIGNAL_BUS:
- return SIGBUS;
-#endif
-#if defined (SIGSEGV)
- case TARGET_SIGNAL_SEGV:
- return SIGSEGV;
-#endif
-#if defined (SIGSYS)
- case TARGET_SIGNAL_SYS:
- return SIGSYS;
-#endif
-#if defined (SIGPIPE)
- case TARGET_SIGNAL_PIPE:
- return SIGPIPE;
-#endif
-#if defined (SIGALRM)
- case TARGET_SIGNAL_ALRM:
- return SIGALRM;
-#endif
-#if defined (SIGTERM)
- case TARGET_SIGNAL_TERM:
- return SIGTERM;
-#endif
-#if defined (SIGUSR1)
- case TARGET_SIGNAL_USR1:
- return SIGUSR1;
-#endif
-#if defined (SIGUSR2)
- case TARGET_SIGNAL_USR2:
- return SIGUSR2;
-#endif
-#if defined (SIGCHLD) || defined (SIGCLD)
- case TARGET_SIGNAL_CHLD:
-#if defined (SIGCHLD)
- return SIGCHLD;
-#else
- return SIGCLD;
-#endif
-#endif /* SIGCLD or SIGCHLD */
-#if defined (SIGPWR)
- case TARGET_SIGNAL_PWR:
- return SIGPWR;
-#endif
-#if defined (SIGWINCH)
- case TARGET_SIGNAL_WINCH:
- return SIGWINCH;
-#endif
-#if defined (SIGURG)
- case TARGET_SIGNAL_URG:
- return SIGURG;
-#endif
-#if defined (SIGIO)
- case TARGET_SIGNAL_IO:
- return SIGIO;
-#endif
-#if defined (SIGPOLL)
- case TARGET_SIGNAL_POLL:
- return SIGPOLL;
-#endif
-#if defined (SIGSTOP)
- case TARGET_SIGNAL_STOP:
- return SIGSTOP;
-#endif
-#if defined (SIGTSTP)
- case TARGET_SIGNAL_TSTP:
- return SIGTSTP;
-#endif
-#if defined (SIGCONT)
- case TARGET_SIGNAL_CONT:
- return SIGCONT;
-#endif
-#if defined (SIGTTIN)
- case TARGET_SIGNAL_TTIN:
- return SIGTTIN;
-#endif
-#if defined (SIGTTOU)
- case TARGET_SIGNAL_TTOU:
- return SIGTTOU;
-#endif
-#if defined (SIGVTALRM)
- case TARGET_SIGNAL_VTALRM:
- return SIGVTALRM;
-#endif
-#if defined (SIGPROF)
- case TARGET_SIGNAL_PROF:
- return SIGPROF;
-#endif
-#if defined (SIGXCPU)
- case TARGET_SIGNAL_XCPU:
- return SIGXCPU;
-#endif
-#if defined (SIGXFSZ)
- case TARGET_SIGNAL_XFSZ:
- return SIGXFSZ;
-#endif
-#if defined (SIGWIND)
- case TARGET_SIGNAL_WIND:
- return SIGWIND;
-#endif
-#if defined (SIGPHONE)
- case TARGET_SIGNAL_PHONE:
- return SIGPHONE;
-#endif
-#if defined (SIGLOST)
- case TARGET_SIGNAL_LOST:
- return SIGLOST;
-#endif
-#if defined (SIGWAITING)
- case TARGET_SIGNAL_WAITING:
- return SIGWAITING;
-#endif
-#if defined (SIGCANCEL)
- case TARGET_SIGNAL_CANCEL:
- return SIGCANCEL;
-#endif
-#if defined (SIGLWP)
- case TARGET_SIGNAL_LWP:
- return SIGLWP;
-#endif
-#if defined (SIGDANGER)
- case TARGET_SIGNAL_DANGER:
- return SIGDANGER;
-#endif
-#if defined (SIGGRANT)
- case TARGET_SIGNAL_GRANT:
- return SIGGRANT;
-#endif
-#if defined (SIGRETRACT)
- case TARGET_SIGNAL_RETRACT:
- return SIGRETRACT;
-#endif
-#if defined (SIGMSG)
- case TARGET_SIGNAL_MSG:
- return SIGMSG;
-#endif
-#if defined (SIGSOUND)
- case TARGET_SIGNAL_SOUND:
- return SIGSOUND;
-#endif
-#if defined (SIGSAK)
- case TARGET_SIGNAL_SAK:
- return SIGSAK;
-#endif
-#if defined (SIGPRIO)
- case TARGET_SIGNAL_PRIO:
- return SIGPRIO;
-#endif
-
- /* Mach exceptions. Assumes that the values for EXC_ are positive! */
-#if defined (EXC_BAD_ACCESS) && defined (_NSIG)
- case TARGET_EXC_BAD_ACCESS:
- return _NSIG + EXC_BAD_ACCESS;
-#endif
-#if defined (EXC_BAD_INSTRUCTION) && defined (_NSIG)
- case TARGET_EXC_BAD_INSTRUCTION:
- return _NSIG + EXC_BAD_INSTRUCTION;
-#endif
-#if defined (EXC_ARITHMETIC) && defined (_NSIG)
- case TARGET_EXC_ARITHMETIC:
- return _NSIG + EXC_ARITHMETIC;
-#endif
-#if defined (EXC_EMULATION) && defined (_NSIG)
- case TARGET_EXC_EMULATION:
- return _NSIG + EXC_EMULATION;
-#endif
-#if defined (EXC_SOFTWARE) && defined (_NSIG)
- case TARGET_EXC_SOFTWARE:
- return _NSIG + EXC_SOFTWARE;
-#endif
-#if defined (EXC_BREAKPOINT) && defined (_NSIG)
- case TARGET_EXC_BREAKPOINT:
- return _NSIG + EXC_BREAKPOINT;
-#endif
-
-#if defined (SIGINFO)
- case TARGET_SIGNAL_INFO:
- return SIGINFO;
-#endif
-
- default:
-#if defined (REALTIME_LO)
- if (oursig >= TARGET_SIGNAL_REALTIME_33
- && oursig <= TARGET_SIGNAL_REALTIME_63)
- {
- /* This block of signals is continuous, and
- TARGET_SIGNAL_REALTIME_33 is 33 by definition. */
- int retsig =
- (int) oursig - (int) TARGET_SIGNAL_REALTIME_33 + 33;
- if (retsig >= REALTIME_LO && retsig < REALTIME_HI)
- return retsig;
- }
-#if (REALTIME_LO < 33)
- else if (oursig == TARGET_SIGNAL_REALTIME_32)
- {
- /* TARGET_SIGNAL_REALTIME_32 isn't contiguous with
- TARGET_SIGNAL_REALTIME_33. It is 32 by definition. */
- return 32;
- }
-#endif
-#if (REALTIME_HI > 64)
- if (oursig >= TARGET_SIGNAL_REALTIME_64
- && oursig <= TARGET_SIGNAL_REALTIME_127)
- {
- /* This block of signals is continuous, and
- TARGET_SIGNAL_REALTIME_64 is 64 by definition. */
- int retsig =
- (int) oursig - (int) TARGET_SIGNAL_REALTIME_64 + 64;
- if (retsig >= REALTIME_LO && retsig < REALTIME_HI)
- return retsig;
- }
-
-#endif
-#endif
-
-#if defined (SIGRTMIN)
- if (oursig >= TARGET_SIGNAL_REALTIME_33
- && oursig <= TARGET_SIGNAL_REALTIME_63)
- {
- /* This block of signals is continuous, and
- TARGET_SIGNAL_REALTIME_33 is 33 by definition. */
- int retsig =
- (int) oursig - (int) TARGET_SIGNAL_REALTIME_33 + 33;
- if (retsig >= SIGRTMIN && retsig <= SIGRTMAX)
- return retsig;
- }
- else if (oursig == TARGET_SIGNAL_REALTIME_64)
- return 64;
-#endif
- *oursig_ok = 0;
- return 0;
- }
-}
-
-int
-target_signal_to_host_p (enum target_signal oursig)
-{
- int oursig_ok;
- do_target_signal_to_host (oursig, &oursig_ok);
- return oursig_ok;
-}
-
-int
-target_signal_to_host (enum target_signal oursig)
-{
- int oursig_ok;
- int targ_signo = do_target_signal_to_host (oursig, &oursig_ok);
- if (!oursig_ok)
- {
- /* The user might be trying to do "signal SIGSAK" where this system
- doesn't have SIGSAK. */
- warning ("Signal %s does not exist on this system.\n",
- target_signal_to_name (oursig));
- return 0;
- }
- else
- return targ_signo;
-}
-
-/* In some circumstances we allow a command to specify a numeric
- signal. The idea is to keep these circumstances limited so that
- users (and scripts) develop portable habits. For comparison,
- POSIX.2 `kill' requires that 1,2,3,6,9,14, and 15 work (and using a
- numeric signal at all is obsolescent. We are slightly more
- lenient and allow 1-15 which should match host signal numbers on
- most systems. Use of symbolic signal names is strongly encouraged. */
-
-enum target_signal
-target_signal_from_command (int num)
-{
- if (num >= 1 && num <= 15)
- return (enum target_signal) num;
- error ("Only signals 1-15 are valid as numeric signals.\n\
-Use \"info signals\" for a list of symbolic signals.");
-}
-
-void
-_initialize_signals (void)
-{
- if (!STREQ (signals[TARGET_SIGNAL_LAST].string, "TARGET_SIGNAL_MAGIC"))
- internal_error (__FILE__, __LINE__, "failed internal consistency check");
-}
diff --git a/gdb/solib-legacy.c b/gdb/solib-legacy.c
index ca730c4..2dd9fa5 100644
--- a/gdb/solib-legacy.c
+++ b/gdb/solib-legacy.c
@@ -19,7 +19,6 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define _SYSCALL32 /* for Sparc64 cross Sparc32 */
#include "defs.h"
#include "gdbcore.h"
#include "solib-svr4.h"
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
index 9c71509..1a7ffbf 100644
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -92,6 +92,7 @@ static char *bkpt_names[] =
SOLIB_BKPT_NAME, /* Prefer configured name if it exists. */
#endif
"_start",
+ "__start",
"main",
NULL
};
diff --git a/gdb/solib.c b/gdb/solib.c
index c47c438..0c7eaba 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -872,7 +872,7 @@ inferior. Otherwise, symbols must be loaded manually, using `sharedlibrary'.",
For other (relative) files, you can add values using `set solib-search-path'.",
&setlist);
add_show_from_set (c, &showlist);
- c->completer = filename_completer;
+ set_cmd_completer (c, filename_completer);
c = add_set_cmd ("solib-search-path", class_support, var_string,
(char *) &solib_search_path,
@@ -880,5 +880,5 @@ For other (relative) files, you can add values using `set solib-search-path'.",
This takes precedence over the environment variables PATH and LD_LIBRARY_PATH.",
&setlist);
add_show_from_set (c, &showlist);
- c->completer = filename_completer;
+ set_cmd_completer (c, filename_completer);
}
diff --git a/gdb/somread.c b/gdb/somread.c
index e4fec18..38e35b2 100644
--- a/gdb/somread.c
+++ b/gdb/somread.c
@@ -117,20 +117,13 @@ som_symtab_read (bfd *abfd, struct objfile *objfile,
can do the right thing for ST_ENTRY vs ST_CODE symbols).
There's nothing in the header which easily allows us to do
- this. The only reliable way I know of is to check for the
- existence of a $SHLIB_INFO$ section with a non-zero size. */
- /* The code below is not a reliable way to check whether an
- * executable is dynamic, so I commented it out - RT
- * shlib_info = bfd_get_section_by_name (objfile->obfd, "$SHLIB_INFO$");
- * if (shlib_info)
- * dynamic = (bfd_section_size (objfile->obfd, shlib_info) != 0);
- * else
- * dynamic = 0;
- */
- /* I replaced the code with a simple check for text offset not being
- * zero. Still not 100% reliable, but a more reliable way of asking
- * "is this a dynamic executable?" than the above. RT
- */
+ this.
+
+ This code used to rely upon the existence of a $SHLIB_INFO$
+ section to make this determination. HP claims that it is
+ more accurate to check for a nonzero text offset, but they
+ have not provided any information about why that test is
+ more accurate. */
dynamic = (text_offset != 0);
endbufp = buf + number_of_symbols;
@@ -240,13 +233,11 @@ som_symtab_read (bfd *abfd, struct objfile *objfile,
case ST_ENTRY:
symname = bufp->name.n_strx + stringtab;
- /* For a dynamic executable, ST_ENTRY symbols are
- the stubs, while the ST_CODE symbol is the real
- function. */
- if (dynamic)
- ms_type = mst_solib_trampoline;
- else
- ms_type = mst_file_text;
+ /* SS_LOCAL symbols in a shared library do not have
+ export stubs, so we do not have to worry about
+ using mst_file_text vs mst_solib_trampoline here like
+ we do for SS_UNIVERSAL and SS_EXTERNAL symbols above. */
+ ms_type = mst_file_text;
bufp->symbol_value += text_offset;
bufp->symbol_value = SMASH_TEXT_ADDRESS (bufp->symbol_value);
break;
diff --git a/gdb/source.c b/gdb/source.c
index ee4998d..ac74372 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -503,6 +503,23 @@ source_info (char *ignore, int from_tty)
}
+/* Return True if the file NAME exists and is a regular file */
+static int
+is_regular_file (const char *name)
+{
+ struct stat st;
+ const int status = stat (name, &st);
+
+ /* Stat should never fail except when the file does not exist.
+ If stat fails, analyze the source of error and return True
+ unless the file does not exist, to avoid returning false results
+ on obscure systems where stat does not work as expected.
+ */
+ if (status != 0)
+ return (errno != ENOENT);
+
+ return S_ISREG (st.st_mode);
+}
/* Open a file named STRING, searching path PATH (dir names sep by some char)
using mode MODE and protection bits PROT in the calls to open.
@@ -514,7 +531,7 @@ source_info (char *ignore, int from_tty)
get that particular version of foo or an error message).
If FILENAME_OPENED is non-null, set it to a newly allocated string naming
- the actual file opened (this string will always start with a "/". We
+ the actual file opened (this string will always start with a "/"). We
have to take special pains to avoid doubling the "/" between the directory
and the file, sigh! Emacs gets confuzzed by this when we print the
source file name!!!
@@ -523,7 +540,7 @@ source_info (char *ignore, int from_tty)
Otherwise, return -1, with errno set for the last name we tried to open. */
/* >>>> This should only allow files of certain types,
- >>>> eg executable, non-directory */
+ >>>> eg executable, non-directory */
int
openp (const char *path, int try_cwd_first, const char *string,
int mode, int prot,
@@ -543,7 +560,7 @@ openp (const char *path, int try_cwd_first, const char *string,
mode |= O_BINARY;
#endif
- if (try_cwd_first || IS_ABSOLUTE_PATH (string))
+ if ((try_cwd_first || IS_ABSOLUTE_PATH (string)) && is_regular_file (string))
{
int i;
filename = alloca (strlen (string) + 1);
@@ -601,18 +618,26 @@ openp (const char *path, int try_cwd_first, const char *string,
strcat (filename + len, SLASH_STRING);
strcat (filename, string);
- fd = open (filename, mode);
- if (fd >= 0)
- break;
+ if (is_regular_file (filename))
+ {
+ fd = open (filename, mode);
+ if (fd >= 0)
+ break;
+ }
}
done:
if (filename_opened)
{
+ /* If a file was opened, canonicalize its filename. Use xfullpath
+ rather than gdb_realpath to avoid resolving the basename part
+ of filenames when the associated file is a symbolic link. This
+ fixes a potential inconsistency between the filenames known to
+ GDB and the filenames it prints in the annotations. */
if (fd < 0)
*filename_opened = NULL;
else if (IS_ABSOLUTE_PATH (filename))
- *filename_opened = gdb_realpath (filename);
+ *filename_opened = xfullpath (filename);
else
{
/* Beware the // my son, the Emacs barfs, the botch that catch... */
@@ -621,7 +646,7 @@ done:
IS_DIR_SEPARATOR (current_directory[strlen (current_directory) - 1])
? "" : SLASH_STRING,
filename, NULL);
- *filename_opened = gdb_realpath (f);
+ *filename_opened = xfullpath (f);
xfree (f);
}
}
@@ -1586,7 +1611,7 @@ With no argument, reset the search path to $cdir:$cwd, the default.",
if (dbx_commands)
add_com_alias ("use", "directory", class_files, 0);
- c->completer = filename_completer;
+ set_cmd_completer (c, filename_completer);
add_cmd ("directories", no_class, show_directories,
"Current search path for finding source files.\n\
diff --git a/gdb/sparc-nat.c b/gdb/sparc-nat.c
index 7069c3a..e892fe8 100644
--- a/gdb/sparc-nat.c
+++ b/gdb/sparc-nat.c
@@ -155,21 +155,23 @@ store_inferior_registers (int regno)
/* First decide which pieces of machine-state we need to modify.
Default for regno == -1 case is all pieces. */
if (regno >= 0)
- if (FP0_REGNUM <= regno && regno < FP0_REGNUM + 32)
- {
- wanna_store = FP_REGS;
- }
- else
- {
- if (regno == SP_REGNUM)
- wanna_store = INT_REGS + STACK_REGS;
- else if (regno < L0_REGNUM || regno > I7_REGNUM)
- wanna_store = INT_REGS;
- else if (regno == FPS_REGNUM)
+ {
+ if (FP0_REGNUM <= regno && regno < FP0_REGNUM + 32)
+ {
wanna_store = FP_REGS;
- else
- wanna_store = STACK_REGS;
- }
+ }
+ else
+ {
+ if (regno == SP_REGNUM)
+ wanna_store = INT_REGS + STACK_REGS;
+ else if (regno < L0_REGNUM || regno > I7_REGNUM)
+ wanna_store = INT_REGS;
+ else if (regno == FPS_REGNUM)
+ wanna_store = FP_REGS;
+ else
+ wanna_store = STACK_REGS;
+ }
+ }
/* See if we're forcing the stores to happen now, or deferring. */
if (regno == -2)
diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c
index b2380b4..6461ca0 100644
--- a/gdb/sparc-tdep.c
+++ b/gdb/sparc-tdep.c
@@ -1,6 +1,8 @@
/* Target-dependent code for the SPARC for GDB, the GNU debugger.
- Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
- 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+ Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
+ 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation,
+ Inc.
This file is part of GDB.
@@ -683,10 +685,36 @@ examine_prologue (CORE_ADDR start_pc, int frameless_p, struct frame_info *fi,
return pc;
}
+/* Advance PC across any function entry prologue instructions to reach
+ some "real" code. */
+
CORE_ADDR
-sparc_skip_prologue (CORE_ADDR start_pc, int frameless_p)
+sparc_skip_prologue (CORE_ADDR start_pc)
{
- return examine_prologue (start_pc, frameless_p, NULL, NULL);
+ struct symtab_and_line sal;
+ CORE_ADDR func_start, func_end;
+
+ /* This is the preferred method, find the end of the prologue by
+ using the debugging information. */
+ if (find_pc_partial_function (start_pc, NULL, &func_start, &func_end))
+ {
+ sal = find_pc_line (func_start, 0);
+
+ if (sal.end < func_end
+ && start_pc <= sal.end)
+ return sal.end;
+ }
+
+ /* Oh well, examine the code by hand. */
+ return examine_prologue (start_pc, 0, NULL, NULL);
+}
+
+/* Is the prologue at IP frameless? */
+
+int
+sparc_prologue_frameless_p (CORE_ADDR ip)
+{
+ return ip == examine_prologue (ip, 1, NULL, NULL);
}
/* Check instruction at ADDR to see if it is a branch.
@@ -827,11 +855,21 @@ sparc_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp,
addr = frame1->frame + (regnum - G0_REGNUM) * SPARC_INTREG_SIZE
- (FP_REGISTER_BYTES + 8 * SPARC_INTREG_SIZE);
else if (regnum >= I0_REGNUM && regnum < I0_REGNUM + 8)
- addr = (frame1->prev->extra_info->bottom
+ /* NOTE: cagney/2002-05-04: The call to get_prev_frame()
+ is safe/cheap - there will always be a prev frame.
+ This is because frame1 is initialized to frame->next
+ (frame1->prev == frame) and is then advanced towards
+ the innermost (next) frame. */
+ addr = (get_prev_frame (frame1)->extra_info->bottom
+ (regnum - I0_REGNUM) * SPARC_INTREG_SIZE
+ FRAME_SAVED_I0);
else if (regnum >= L0_REGNUM && regnum < L0_REGNUM + 8)
- addr = (frame1->prev->extra_info->bottom
+ /* NOTE: cagney/2002-05-04: The call to get_prev_frame()
+ is safe/cheap - there will always be a prev frame.
+ This is because frame1 is initialized to frame->next
+ (frame1->prev == frame) and is then advanced towards
+ the innermost (next) frame. */
+ addr = (get_prev_frame (frame1)->extra_info->bottom
+ (regnum - L0_REGNUM) * SPARC_INTREG_SIZE
+ FRAME_SAVED_L0);
else if (regnum >= O0_REGNUM && regnum < O0_REGNUM + 8)
@@ -873,11 +911,11 @@ sparc_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp,
{
/* Normal frame. Local and In registers are saved on stack. */
if (regnum >= I0_REGNUM && regnum < I0_REGNUM + 8)
- addr = (frame1->prev->extra_info->bottom
+ addr = (get_prev_frame (frame1)->extra_info->bottom
+ (regnum - I0_REGNUM) * SPARC_INTREG_SIZE
+ FRAME_SAVED_I0);
else if (regnum >= L0_REGNUM && regnum < L0_REGNUM + 8)
- addr = (frame1->prev->extra_info->bottom
+ addr = (get_prev_frame (frame1)->extra_info->bottom
+ (regnum - L0_REGNUM) * SPARC_INTREG_SIZE
+ FRAME_SAVED_L0);
else if (regnum >= O0_REGNUM && regnum < O0_REGNUM + 8)
@@ -986,8 +1024,26 @@ sparc_push_dummy_frame (void)
if (strcmp (target_shortname, "sim") != 0)
{
- write_fp (old_sp);
-
+ /* NOTE: cagney/2002-04-04: The code below originally contained
+ GDB's _only_ call to write_fp(). That call was eliminated by
+ inlining the corresponding code. For the 64 bit case, the
+ old function (sparc64_write_fp) did the below although I'm
+ not clear why. The same goes for why this is only done when
+ the underlying target is a simulator. */
+ if (GDB_TARGET_IS_SPARC64)
+ {
+ /* Target is a 64 bit SPARC. */
+ CORE_ADDR oldfp = read_register (FP_REGNUM);
+ if (oldfp & 1)
+ write_register (FP_REGNUM, old_sp - 2047);
+ else
+ write_register (FP_REGNUM, old_sp);
+ }
+ else
+ {
+ /* Target is a 32 bit SPARC. */
+ write_register (FP_REGNUM, old_sp);
+ }
/* Set return address register for the call dummy to the current PC. */
write_register (I7_REGNUM, read_pc () - 8);
}
@@ -1234,7 +1290,7 @@ sparc_pop_frame (void)
char *reg_temp;
- reg_temp = alloca (REGISTER_BYTES);
+ reg_temp = alloca (SPARC_INTREG_SIZE * 16);
read_memory (fsr[I0_REGNUM], raw_buffer, 8 * SPARC_INTREG_SIZE);
@@ -1811,8 +1867,8 @@ sparc_print_register_hook (int regno)
{
char value[16];
- if (!read_relative_register_raw_bytes (regno, value)
- && !read_relative_register_raw_bytes (regno + 1, value + 4))
+ if (frame_register_read (selected_frame, regno, value)
+ && frame_register_read (selected_frame, regno + 1, value + 4))
{
printf_unfiltered ("\t");
print_floating (value, builtin_type_double, gdb_stdout);
@@ -1820,8 +1876,8 @@ sparc_print_register_hook (int regno)
#if 0 /* FIXME: gdb doesn't handle long doubles */
if ((regno & 3) == 0)
{
- if (!read_relative_register_raw_bytes (regno + 2, value + 8)
- && !read_relative_register_raw_bytes (regno + 3, value + 12))
+ if (frame_register_read (selected_frame, regno + 2, value + 8)
+ && frame_register_read (selected_frame, regno + 3, value + 12))
{
printf_unfiltered ("\t");
print_floating (value, builtin_type_long_double, gdb_stdout);
@@ -1840,8 +1896,8 @@ sparc_print_register_hook (int regno)
{
char value[16];
- if (!read_relative_register_raw_bytes (regno, value)
- && !read_relative_register_raw_bytes (regno + 1, value + 8))
+ if (frame_register_read (selected_frame, regno, value)
+ && frame_register_read (selected_frame, regno + 1, value + 8))
{
printf_unfiltered ("\t");
print_floating (value, builtin_type_long_double, gdb_stdout);
@@ -2261,16 +2317,6 @@ sparc64_write_sp (CORE_ADDR val)
write_register (SP_REGNUM, val);
}
-void
-sparc64_write_fp (CORE_ADDR val)
-{
- CORE_ADDR oldfp = read_register (FP_REGNUM);
- if (oldfp & 1)
- write_register (FP_REGNUM, val - 2047);
- else
- write_register (FP_REGNUM, val);
-}
-
/* The SPARC 64 ABI passes floating-point arguments in FP0 to FP31,
and all other arguments in O0 to O5. They are also copied onto
the stack in the correct places. Apparently (empirically),
@@ -2766,18 +2812,6 @@ sparc64_register_byte (int regno)
return 64 * 8 + (regno - 80) * 8;
}
-/* Advance PC across any function entry prologue instructions to reach
- some "real" code. SKIP_PROLOGUE_FRAMELESS_P advances the PC past
- some of the prologue, but stops as soon as it knows that the
- function has a frame. Its result is equal to its input PC if the
- function is frameless, unequal otherwise. */
-
-static CORE_ADDR
-sparc_gdbarch_skip_prologue (CORE_ADDR ip)
-{
- return examine_prologue (ip, 0, NULL, NULL);
-}
-
/* Immediately after a function call, return the saved pc.
Can't go through the frames for this because on some machines
the new frame is not set up until the new function executes
@@ -2976,8 +3010,9 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_reg_struct_has_addr (gdbarch, sparc_reg_struct_has_addr);
set_gdbarch_return_value_on_stack (gdbarch, sparc_return_value_on_stack);
set_gdbarch_saved_pc_after_call (gdbarch, sparc_saved_pc_after_call);
+ set_gdbarch_prologue_frameless_p (gdbarch, sparc_prologue_frameless_p);
set_gdbarch_short_bit (gdbarch, 2 * TARGET_CHAR_BIT);
- set_gdbarch_skip_prologue (gdbarch, sparc_gdbarch_skip_prologue);
+ set_gdbarch_skip_prologue (gdbarch, sparc_skip_prologue);
set_gdbarch_sp_regnum (gdbarch, SPARC_SP_REGNUM);
set_gdbarch_use_generic_dummy_frames (gdbarch, 0);
set_gdbarch_write_pc (gdbarch, generic_target_write_pc);
@@ -3001,6 +3036,50 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_call_dummy_address (gdbarch, sparc_call_dummy_address);
set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0x30);
set_gdbarch_call_dummy_length (gdbarch, 0x38);
+
+ /* NOTE: cagney/2002-04-26: Based from info posted by Peter
+ Schauer around Oct '99. Briefly, due to aspects of the SPARC
+ ABI, it isn't possible to use ON_STACK with a strictly
+ compliant compiler.
+
+ Peter Schauer writes ...
+
+ No, any call from GDB to a user function returning a
+ struct/union will fail miserably. Try this:
+
+ *NOINDENT*
+ struct x
+ {
+ int a[4];
+ };
+
+ struct x gx;
+
+ struct x
+ sret ()
+ {
+ return gx;
+ }
+
+ main ()
+ {
+ int i;
+ for (i = 0; i < 4; i++)
+ gx.a[i] = i + 1;
+ gx = sret ();
+ }
+ *INDENT*
+
+ Set a breakpoint at the gx = sret () statement, run to it and
+ issue a `print sret()'. It will not succed with your
+ approach, and I doubt that continuing the program will work
+ as well.
+
+ For details of the ABI see the Sparc Architecture Manual. I
+ have Version 8 (Prentice Hall ISBN 0-13-825001-4) and the
+ calling conventions for functions returning aggregate values
+ are explained in Appendix D.3. */
+
set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
set_gdbarch_call_dummy_words (gdbarch, call_dummy_32);
#else
@@ -3038,7 +3117,6 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_store_struct_return (gdbarch, sparc32_store_struct_return);
set_gdbarch_use_struct_convention (gdbarch,
generic_use_struct_convention);
- set_gdbarch_write_fp (gdbarch, generic_target_write_fp);
set_gdbarch_write_sp (gdbarch, generic_target_write_sp);
tdep->y_regnum = SPARC32_Y_REGNUM;
tdep->fp_max_regnum = SPARC_FP0_REGNUM + 32;
@@ -3097,7 +3175,6 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_store_struct_return (gdbarch, sparc64_store_struct_return);
set_gdbarch_use_struct_convention (gdbarch,
sparc64_use_struct_convention);
- set_gdbarch_write_fp (gdbarch, sparc64_write_fp);
set_gdbarch_write_sp (gdbarch, sparc64_write_sp);
tdep->y_regnum = SPARC64_Y_REGNUM;
tdep->fp_max_regnum = SPARC_FP0_REGNUM + 48;
diff --git a/gdb/stabsread.c b/gdb/stabsread.c
index 5b11546..7065b7b 100644
--- a/gdb/stabsread.c
+++ b/gdb/stabsread.c
@@ -136,6 +136,7 @@ static int
attach_fields_to_type (struct field_info *, struct type *, struct objfile *);
static struct type *read_struct_type (char **, struct type *,
+ enum type_code,
struct objfile *);
static struct type *read_array_type (char **, struct type *,
@@ -2536,7 +2537,24 @@ again:
the related problems with unnecessarily stubbed types;
someone motivated should attempt to clean up the issue
here as well. Once a type pointed to has been created it
- should not be modified. */
+ should not be modified.
+
+ Well, it's not *absolutely* wrong. Constructing recursive
+ types (trees, linked lists) necessarily entails modifying
+ types after creating them. Constructing any loop structure
+ entails side effects. The Dwarf 2 reader does handle this
+ more gracefully (it never constructs more than once
+ instance of a type object, so it doesn't have to copy type
+ objects wholesale), but it still mutates type objects after
+ other folks have references to them.
+
+ Keep in mind that this circularity/mutation issue shows up
+ at the source language level, too: C's "incomplete types",
+ for example. So the proper cleanup, I think, would be to
+ limit GDB's type smashing to match exactly those required
+ by the source language. So GDB could have a
+ "complete_this_type" function, but never create unnecessary
+ copies of a type otherwise. */
replace_type (type, xtype);
TYPE_NAME (type) = NULL;
TYPE_TAG_NAME (type) = NULL;
@@ -2801,18 +2819,21 @@ again:
case 's': /* Struct type */
case 'u': /* Union type */
- type = dbx_alloc_type (typenums, objfile);
- switch (type_descriptor)
- {
- case 's':
- TYPE_CODE (type) = TYPE_CODE_STRUCT;
- break;
- case 'u':
- TYPE_CODE (type) = TYPE_CODE_UNION;
- break;
- }
- type = read_struct_type (pp, type, objfile);
- break;
+ {
+ enum type_code type_code = TYPE_CODE_UNDEF;
+ type = dbx_alloc_type (typenums, objfile);
+ switch (type_descriptor)
+ {
+ case 's':
+ type_code = TYPE_CODE_STRUCT;
+ break;
+ case 'u':
+ type_code = TYPE_CODE_UNION;
+ break;
+ }
+ type = read_struct_type (pp, type, type_code, objfile);
+ break;
+ }
case 'a': /* Array type */
if (**pp != 'r')
@@ -2978,10 +2999,14 @@ rs6000_builtin_type (int typenum)
case 25:
/* Complex type consisting of two IEEE single precision values. */
rettype = init_type (TYPE_CODE_COMPLEX, 8, 0, "complex", NULL);
+ TYPE_TARGET_TYPE (rettype) = init_type (TYPE_CODE_FLT, 4, 0, "float",
+ NULL);
break;
case 26:
/* Complex type consisting of two IEEE double precision values. */
rettype = init_type (TYPE_CODE_COMPLEX, 16, 0, "double complex", NULL);
+ TYPE_TARGET_TYPE (rettype) = init_type (TYPE_CODE_FLT, 8, 0, "double",
+ NULL);
break;
case 27:
rettype = init_type (TYPE_CODE_INT, 1, 0, "integer*1", NULL);
@@ -3037,7 +3062,6 @@ read_member_functions (struct field_info *fip, char **pp, struct type *type,
{
int nfn_fields = 0;
int length = 0;
- int skip_method;
/* Total number of member functions defined in this class. If the class
defines two `f' functions, and one `g' function, then this will have
the value 3. */
@@ -3077,36 +3101,6 @@ read_member_functions (struct field_info *fip, char **pp, struct type *type,
look_ahead_type = NULL;
length = 0;
- skip_method = 0;
- if (p - *pp == strlen ("__base_ctor")
- && strncmp (*pp, "__base_ctor", strlen ("__base_ctor")) == 0)
- skip_method = 1;
- else if (p - *pp == strlen ("__base_dtor")
- && strncmp (*pp, "__base_dtor", strlen ("__base_dtor")) == 0)
- skip_method = 1;
- else if (p - *pp == strlen ("__deleting_dtor")
- && strncmp (*pp, "__deleting_dtor",
- strlen ("__deleting_dtor")) == 0)
- skip_method = 1;
-
- if (skip_method)
- {
- /* Skip past '::'. */
- *pp = p + 2;
- /* Read the type. */
- read_type (pp, objfile);
- /* Skip past the colon, mangled name, semicolon, flags, and final
- semicolon. */
- while (**pp != ';')
- (*pp) ++;
- (*pp) ++;
- while (**pp != ';')
- (*pp) ++;
- (*pp) ++;
-
- continue;
- }
-
new_fnlist = (struct next_fnfieldlist *)
xmalloc (sizeof (struct next_fnfieldlist));
make_cleanup (xfree, new_fnlist);
@@ -3287,13 +3281,30 @@ read_member_functions (struct field_info *fip, char **pp, struct type *type,
}
case '?':
/* static member function. */
- new_sublist->fn_field.voffset = VOFFSET_STATIC;
- if (strncmp (new_sublist->fn_field.physname,
- main_fn_name, strlen (main_fn_name)))
- {
- new_sublist->fn_field.is_stub = 1;
- }
- break;
+ {
+ int slen = strlen (main_fn_name);
+
+ new_sublist->fn_field.voffset = VOFFSET_STATIC;
+
+ /* For static member functions, we can't tell if they
+ are stubbed, as they are put out as functions, and not as
+ methods.
+ GCC v2 emits the fully mangled name if
+ dbxout.c:flag_minimal_debug is not set, so we have to
+ detect a fully mangled physname here and set is_stub
+ accordingly. Fully mangled physnames in v2 start with
+ the member function name, followed by two underscores.
+ GCC v3 currently always emits stubbed member functions,
+ but with fully mangled physnames, which start with _Z. */
+ if (!(strncmp (new_sublist->fn_field.physname,
+ main_fn_name, slen) == 0
+ && new_sublist->fn_field.physname[slen] == '_'
+ && new_sublist->fn_field.physname[slen + 1] == '_'))
+ {
+ new_sublist->fn_field.is_stub = 1;
+ }
+ break;
+ }
default:
/* error */
@@ -3315,23 +3326,34 @@ read_member_functions (struct field_info *fip, char **pp, struct type *type,
while (**pp != ';' && **pp != '\0');
(*pp)++;
+ STABS_CONTINUE (pp, objfile);
- new_fnlist->fn_fieldlist.fn_fields = (struct fn_field *)
- obstack_alloc (&objfile->type_obstack,
- sizeof (struct fn_field) * length);
- memset (new_fnlist->fn_fieldlist.fn_fields, 0,
- sizeof (struct fn_field) * length);
- for (i = length; (i--, sublist); sublist = sublist->next)
+ /* Skip GCC 3.X member functions which are duplicates of the callable
+ constructor/destructor. */
+ if (strcmp (main_fn_name, "__base_ctor") == 0
+ || strcmp (main_fn_name, "__base_dtor") == 0
+ || strcmp (main_fn_name, "__deleting_dtor") == 0)
{
- new_fnlist->fn_fieldlist.fn_fields[i] = sublist->fn_field;
+ xfree (main_fn_name);
}
+ else
+ {
+ new_fnlist->fn_fieldlist.fn_fields = (struct fn_field *)
+ obstack_alloc (&objfile->type_obstack,
+ sizeof (struct fn_field) * length);
+ memset (new_fnlist->fn_fieldlist.fn_fields, 0,
+ sizeof (struct fn_field) * length);
+ for (i = length; (i--, sublist); sublist = sublist->next)
+ {
+ new_fnlist->fn_fieldlist.fn_fields[i] = sublist->fn_field;
+ }
- new_fnlist->fn_fieldlist.length = length;
- new_fnlist->next = fip->fnlist;
- fip->fnlist = new_fnlist;
- nfn_fields++;
- total_length += length;
- STABS_CONTINUE (pp, objfile);
+ new_fnlist->fn_fieldlist.length = length;
+ new_fnlist->next = fip->fnlist;
+ fip->fnlist = new_fnlist;
+ nfn_fields++;
+ total_length += length;
+ }
}
if (nfn_fields)
@@ -4155,6 +4177,45 @@ attach_fields_to_type (struct field_info *fip, register struct type *type,
return 1;
}
+
+static struct complaint multiply_defined_struct =
+{"struct/union type gets multiply defined: %s%s", 0, 0};
+
+
+/* Complain that the compiler has emitted more than one definition for the
+ structure type TYPE. */
+static void
+complain_about_struct_wipeout (struct type *type)
+{
+ char *name = "";
+ char *kind = "";
+
+ if (TYPE_TAG_NAME (type))
+ {
+ name = TYPE_TAG_NAME (type);
+ switch (TYPE_CODE (type))
+ {
+ case TYPE_CODE_STRUCT: kind = "struct "; break;
+ case TYPE_CODE_UNION: kind = "union "; break;
+ case TYPE_CODE_ENUM: kind = "enum "; break;
+ default: kind = "";
+ }
+ }
+ else if (TYPE_NAME (type))
+ {
+ name = TYPE_NAME (type);
+ kind = "";
+ }
+ else
+ {
+ name = "<unknown>";
+ kind = "";
+ }
+
+ complain (&multiply_defined_struct, kind, name);
+}
+
+
/* Read the description of a structure (or union type) and return an object
describing the type.
@@ -4170,7 +4231,8 @@ attach_fields_to_type (struct field_info *fip, register struct type *type,
*/
static struct type *
-read_struct_type (char **pp, struct type *type, struct objfile *objfile)
+read_struct_type (char **pp, struct type *type, enum type_code type_code,
+ struct objfile *objfile)
{
struct cleanup *back_to;
struct field_info fi;
@@ -4178,9 +4240,30 @@ read_struct_type (char **pp, struct type *type, struct objfile *objfile)
fi.list = NULL;
fi.fnlist = NULL;
+ /* When describing struct/union/class types in stabs, G++ always drops
+ all qualifications from the name. So if you've got:
+ struct A { ... struct B { ... }; ... };
+ then G++ will emit stabs for `struct A::B' that call it simply
+ `struct B'. Obviously, if you've got a real top-level definition for
+ `struct B', or other nested definitions, this is going to cause
+ problems.
+
+ Obviously, GDB can't fix this by itself, but it can at least avoid
+ scribbling on existing structure type objects when new definitions
+ appear. */
+ if (! (TYPE_CODE (type) == TYPE_CODE_UNDEF
+ || TYPE_STUB (type)))
+ {
+ complain_about_struct_wipeout (type);
+
+ /* It's probably best to return the type unchanged. */
+ return type;
+ }
+
back_to = make_cleanup (null_cleanup, 0);
INIT_CPLUS_SPECIFIC (type);
+ TYPE_CODE (type) = type_code;
TYPE_FLAGS (type) &= ~TYPE_FLAG_STUB;
/* First comes the total size in bytes. */
@@ -4494,6 +4577,7 @@ read_sun_floating_type (char **pp, int typenums[2], struct objfile *objfile)
int nbits;
int details;
int nbytes;
+ struct type *rettype;
/* The first number has more details about the type, for example
FN_COMPLEX. */
@@ -4508,9 +4592,12 @@ read_sun_floating_type (char **pp, int typenums[2], struct objfile *objfile)
if (details == NF_COMPLEX || details == NF_COMPLEX16
|| details == NF_COMPLEX32)
- /* This is a type we can't handle, but we do know the size.
- We also will be able to give it a name. */
- return init_type (TYPE_CODE_COMPLEX, nbytes, 0, NULL, objfile);
+ {
+ rettype = init_type (TYPE_CODE_COMPLEX, nbytes, 0, NULL, objfile);
+ TYPE_TARGET_TYPE (rettype)
+ = init_type (TYPE_CODE_FLT, nbytes / 2, 0, NULL, objfile);
+ return rettype;
+ }
return init_type (TYPE_CODE_FLT, nbytes, 0, NULL, objfile);
}
@@ -5052,10 +5139,7 @@ cleanup_undefined_types (void)
&& (TYPE_CODE (SYMBOL_TYPE (sym)) ==
TYPE_CODE (*type))
&& STREQ (SYMBOL_NAME (sym), typename))
- {
- memcpy (*type, SYMBOL_TYPE (sym),
- sizeof (struct type));
- }
+ replace_type (*type, SYMBOL_TYPE (sym));
}
}
}
diff --git a/gdb/stack.c b/gdb/stack.c
index 68f16b6..2dab0de 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -119,7 +119,17 @@ struct frame_info *selected_frame;
0 for innermost, 1 for its caller, ...
or -1 for frame specified by address with no defined level. */
-int selected_frame_level;
+/* Level of the selected frame: 0 for innermost, 1 for its caller, ...
+ or -1 for NULL frame. */
+
+int
+frame_relative_level (struct frame_info *fi)
+{
+ if (fi == NULL)
+ return -1;
+ else
+ return fi->level;
+}
/* Zero means do things normally; we are interacting directly with the
user. One means print the full filename and linenumber when a
@@ -704,7 +714,7 @@ parse_frame_specification (char *frame_exp)
really should be used instead of spaces to delimit; using spaces
normally works in an expression). */
#ifdef SETUP_ARBITRARY_FRAME
- error ("No frame %d", args[0]);
+ error ("No frame %s", paddr_d (args[0]));
#endif
/* If (s)he specifies the frame with an address, he deserves what
@@ -817,9 +827,10 @@ frame_info (char *addr_exp, int from_tty)
}
calling_frame_info = get_prev_frame (fi);
- if (!addr_exp && selected_frame_level >= 0)
+ if (!addr_exp && frame_relative_level (selected_frame) >= 0)
{
- printf_filtered ("Stack level %d, frame at ", selected_frame_level);
+ printf_filtered ("Stack level %d, frame at ",
+ frame_relative_level (selected_frame));
print_address_numeric (fi->frame, 1, gdb_stdout);
printf_filtered (":\n");
}
@@ -1238,7 +1249,7 @@ static void
print_frame_local_vars (register struct frame_info *fi, register int num_tabs,
register struct ui_file *stream)
{
- register struct block *block = get_frame_block (fi);
+ register struct block *block = get_frame_block (fi, 0);
register int values_printed = 0;
if (block == 0)
@@ -1272,7 +1283,7 @@ print_frame_label_vars (register struct frame_info *fi, int this_level_only,
register struct ui_file *stream)
{
register struct blockvector *bl;
- register struct block *block = get_frame_block (fi);
+ register struct block *block = get_frame_block (fi, 0);
register int values_printed = 0;
int index, have_default = 0;
char *blocks_printed;
@@ -1448,18 +1459,18 @@ args_plus_locals_info (char *ignore, int from_tty)
}
-/* Select frame FI, and note that its stack level is LEVEL.
- LEVEL may be -1 if an actual level number is not known. */
+/* Select frame FI (or NULL - to invalidate the current frame). */
void
-select_frame (struct frame_info *fi, int level)
+select_frame (struct frame_info *fi)
{
register struct symtab *s;
selected_frame = fi;
- selected_frame_level = level;
+ /* NOTE: cagney/2002-05-04: FI can be NULL. This occures when the
+ frame is being invalidated. */
if (selected_frame_level_changed_hook)
- selected_frame_level_changed_hook (level);
+ selected_frame_level_changed_hook (frame_relative_level (fi));
/* Ensure that symbols for this frame are read in. Also, determine the
source language of this frame, and switch to it if desired. */
@@ -1477,15 +1488,15 @@ select_frame (struct frame_info *fi, int level)
}
-/* Select frame FI, noting that its stack level is LEVEL. Also print
- the stack frame and show the source if this is the tui version. */
-void
-select_and_print_frame (struct frame_info *fi, int level)
+/* Select frame FI. Also print the stack frame and show the source if
+ this is the tui version. */
+static void
+select_and_print_frame (struct frame_info *fi)
{
- select_frame (fi, level);
+ select_frame (fi);
if (fi)
{
- print_stack_frame (fi, level, 1);
+ print_stack_frame (fi, frame_relative_level (fi), 1);
}
}
@@ -1497,21 +1508,25 @@ void
record_selected_frame (CORE_ADDR *frameaddrp, int *levelp)
{
*frameaddrp = selected_frame ? selected_frame->frame : 0;
- *levelp = selected_frame_level;
+ *levelp = frame_relative_level (selected_frame);
}
/* Return the symbol-block in which the selected frame is executing.
- Can return zero under various legitimate circumstances. */
+ Can return zero under various legitimate circumstances.
+
+ If ADDR_IN_BLOCK is non-zero, set *ADDR_IN_BLOCK to the relevant
+ code address within the block returned. We use this to decide
+ which macros are in scope. */
struct block *
-get_selected_block (void)
+get_selected_block (CORE_ADDR *addr_in_block)
{
if (!target_has_stack)
return 0;
if (!selected_frame)
- return get_current_block ();
- return get_frame_block (selected_frame);
+ return get_current_block (addr_in_block);
+ return get_frame_block (selected_frame, addr_in_block);
}
/* Find a frame a certain number of levels away from FRAME.
@@ -1579,21 +1594,7 @@ select_frame_command (char *level_exp, int from_tty)
frame = parse_frame_specification (level_exp);
- /* Try to figure out what level this frame is. But if there is
- no current stack, don't error out -- let the user set one. */
- frame1 = 0;
- if (get_current_frame ())
- {
- for (frame1 = get_prev_frame (0);
- frame1 && frame1 != frame;
- frame1 = get_prev_frame (frame1))
- level++;
- }
-
- if (!frame1)
- level = 0;
-
- select_frame (frame, level);
+ select_frame (frame);
}
/* The "frame" command. With no arg, print selected frame briefly.
@@ -1604,7 +1605,8 @@ void
frame_command (char *level_exp, int from_tty)
{
select_frame_command (level_exp, from_tty);
- show_and_print_stack_frame (selected_frame, selected_frame_level, 1);
+ show_and_print_stack_frame (selected_frame,
+ frame_relative_level (selected_frame), 1);
}
/* The XDB Compatibility command to print the current frame. */
@@ -1614,7 +1616,8 @@ current_frame_command (char *level_exp, int from_tty)
{
if (target_has_stack == 0 || selected_frame == 0)
error ("No stack.");
- print_only_stack_frame (selected_frame, selected_frame_level, 1);
+ print_only_stack_frame (selected_frame,
+ frame_relative_level (selected_frame), 1);
}
/* Select the frame up one or COUNT stack levels
@@ -1636,7 +1639,7 @@ up_silently_base (char *count_exp)
fi = find_relative_frame (selected_frame, &count1);
if (count1 != 0 && count_exp == 0)
error ("Initial frame selected; you cannot go up.");
- select_frame (fi, selected_frame_level + count - count1);
+ select_frame (fi);
}
static void
@@ -1649,7 +1652,8 @@ static void
up_command (char *count_exp, int from_tty)
{
up_silently_base (count_exp);
- show_and_print_stack_frame (selected_frame, selected_frame_level, 1);
+ show_and_print_stack_frame (selected_frame,
+ frame_relative_level (selected_frame), 1);
}
/* Select the frame down one or COUNT stack levels
@@ -1680,7 +1684,7 @@ down_silently_base (char *count_exp)
error ("Bottom (i.e., innermost) frame selected; you cannot go down.");
}
- select_frame (frame, selected_frame_level + count - count1);
+ select_frame (frame);
}
/* ARGSUSED */
@@ -1694,7 +1698,8 @@ static void
down_command (char *count_exp, int from_tty)
{
down_silently_base (count_exp);
- show_and_print_stack_frame (selected_frame, selected_frame_level, 1);
+ show_and_print_stack_frame (selected_frame,
+ frame_relative_level (selected_frame), 1);
}
void
@@ -1846,7 +1851,7 @@ func_command (char *arg, int from_tty)
if (!found)
printf_filtered ("'%s' not within current stack frame.\n", arg);
else if (fp != selected_frame)
- select_and_print_frame (fp, level);
+ select_and_print_frame (fp);
}
/* Gets the language of the current frame. */
diff --git a/gdb/std-regs.c b/gdb/std-regs.c
new file mode 100644
index 0000000..b96c901
--- /dev/null
+++ b/gdb/std-regs.c
@@ -0,0 +1,150 @@
+/* Builtin frame register, for GDB, the GNU debugger.
+
+ Copyright 2002 Free Software Foundation, Inc.
+
+ Contributed by Red Hat.
+
+ 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 "builtin-regs.h"
+#include "frame.h"
+#include "gdbtypes.h"
+#include "value.h"
+
+/* Types that describe the various builtin registers. */
+
+static struct type *builtin_type_frame_reg;
+
+/* Constructors for those types. */
+
+static void
+build_builtin_type_frame_reg (void)
+{
+ /* $frame. */
+ if (builtin_type_frame_reg == NULL)
+ {
+#if 0
+ struct frame
+ {
+ void *base;
+ };
+#endif
+ builtin_type_frame_reg = init_composite_type ("frame", TYPE_CODE_STRUCT);
+ append_composite_type_field (builtin_type_frame_reg, "base",
+ builtin_type_void_data_ptr);
+ }
+}
+
+static struct value *
+value_of_builtin_frame_reg (struct frame_info *frame)
+{
+ struct value *val;
+ char *buf;
+ build_builtin_type_frame_reg ();
+ val = allocate_value (builtin_type_frame_reg);
+ VALUE_LVAL (val) = not_lval;
+ buf = VALUE_CONTENTS_RAW (val);
+ memset (buf, TYPE_LENGTH (VALUE_TYPE (val)), 0);
+ /* frame.base. */
+ if (frame != NULL)
+ ADDRESS_TO_POINTER (builtin_type_void_data_ptr, buf, frame->frame);
+ buf += TYPE_LENGTH (builtin_type_void_data_ptr);
+ /* frame.XXX. */
+ return val;
+}
+
+static struct value *
+value_of_builtin_frame_fp_reg (struct frame_info *frame)
+{
+#ifdef FP_REGNUM
+ if (FP_REGNUM >= 0)
+ return value_of_register (FP_REGNUM, frame);
+#endif
+ {
+ struct value *val = allocate_value (builtin_type_void_data_ptr);
+ char *buf = VALUE_CONTENTS_RAW (val);
+ if (frame == NULL)
+ memset (buf, TYPE_LENGTH (VALUE_TYPE (val)), 0);
+ else
+ ADDRESS_TO_POINTER (builtin_type_void_data_ptr, buf, frame->frame);
+ return val;
+ }
+}
+
+static struct value *
+value_of_builtin_frame_pc_reg (struct frame_info *frame)
+{
+#ifdef PC_REGNUM
+ if (PC_REGNUM >= 0)
+ return value_of_register (PC_REGNUM, frame);
+#endif
+ {
+ struct value *val = allocate_value (builtin_type_void_data_ptr);
+ char *buf = VALUE_CONTENTS_RAW (val);
+ if (frame == NULL)
+ memset (buf, TYPE_LENGTH (VALUE_TYPE (val)), 0);
+ else
+ ADDRESS_TO_POINTER (builtin_type_void_data_ptr, buf, frame->pc);
+ return val;
+ }
+}
+
+static struct value *
+value_of_builtin_frame_sp_reg (struct frame_info *frame)
+{
+#ifdef SP_REGNUM
+ if (SP_REGNUM >= 0)
+ return value_of_register (SP_REGNUM, frame);
+#endif
+ error ("Standard register ``$sp'' is not available for this target");
+}
+
+static struct value *
+value_of_builtin_frame_ps_reg (struct frame_info *frame)
+{
+#ifdef PS_REGNUM
+ if (PS_REGNUM >= 0)
+ return value_of_register (PS_REGNUM, frame);
+#endif
+ error ("Standard register ``$ps'' is not available for this target");
+}
+
+void
+_initialize_frame_reg (void)
+{
+ /* FIXME: cagney/2002-02-08: At present the local builtin types
+ can't be initialized using _initialize*() or gdbarch. Due mainly
+ to non-multi-arch targets, GDB initializes things piece meal and,
+ as a consequence can leave these types NULL. */
+ REGISTER_GDBARCH_SWAP (builtin_type_frame_reg);
+
+ /* Frame based $fp, $pc, $sp and $ps. These only come into play
+ when the target does not define its own version of these
+ registers. */
+ add_builtin_reg ("fp", value_of_builtin_frame_fp_reg);
+ add_builtin_reg ("pc", value_of_builtin_frame_pc_reg);
+ add_builtin_reg ("sp", value_of_builtin_frame_sp_reg);
+ add_builtin_reg ("ps", value_of_builtin_frame_ps_reg);
+
+ /* NOTE: cagney/2002-04-05: For moment leave the $frame / $gdbframe
+ / $gdb.frame disabled. It isn't yet clear which of the many
+ options is the best. */
+ if (0)
+ add_builtin_reg ("frame", value_of_builtin_frame_reg);
+}
diff --git a/gdb/symfile.c b/gdb/symfile.c
index feca03b..7c7141d 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -120,6 +120,8 @@ static void cashier_psymtab (struct partial_symtab *);
bfd *symfile_bfd_open (char *);
+int get_section_index (struct objfile *, char *);
+
static void find_sym_fns (struct objfile *);
static void decrement_reading_symtab (void *);
@@ -577,6 +579,9 @@ syms_from_objfile (struct objfile *objfile, struct section_addr_info *addrs,
init_entry_point_info (objfile);
find_sym_fns (objfile);
+ if (objfile->sf == NULL)
+ return; /* No symbols. */
+
/* Make sure that partially constructed symbol tables will be cleaned up
if an error occurs during symbol reading. */
old_chain = make_cleanup_free_objfile (objfile);
@@ -891,6 +896,9 @@ symbol_file_add (char *name, int from_tty, struct section_addr_info *addrs,
}
}
+ if (objfile->sf == NULL)
+ return objfile; /* No symbols. */
+
new_symfile_objfile (objfile, mainline, from_tty);
if (target_new_objfile_hook)
@@ -1109,6 +1117,18 @@ symfile_bfd_open (char *name)
return (sym_bfd);
}
+/* Return the section index for the given section name. Return -1 if
+ the section was not found. */
+int
+get_section_index (struct objfile *objfile, char *section_name)
+{
+ asection *sect = bfd_get_section_by_name (objfile->obfd, section_name);
+ if (sect)
+ return sect->index;
+ else
+ return -1;
+}
+
/* Link a new symtab_fns into the global symtab_fns list. Called on gdb
startup by the _initialize routine in each object file format reader,
to register information about each format the the reader is prepared
@@ -1134,6 +1154,11 @@ find_sym_fns (struct objfile *objfile)
enum bfd_flavour our_flavour = bfd_get_flavour (objfile->obfd);
char *our_target = bfd_get_target (objfile->obfd);
+ if (our_flavour == bfd_target_srec_flavour
+ || our_flavour == bfd_target_ihex_flavour
+ || our_flavour == bfd_target_tekhex_flavour)
+ return; /* No symbols. */
+
/* Special kludge for apollo. See dstread.c. */
if (STREQN (our_target, "apollo", 6))
our_flavour = (enum bfd_flavour) -2;
@@ -1806,8 +1831,9 @@ add_filename_language (char *ext, enum language lang)
if (fl_table_next >= fl_table_size)
{
fl_table_size += 10;
- filename_language_table = xrealloc (filename_language_table,
- fl_table_size);
+ filename_language_table =
+ xrealloc (filename_language_table,
+ fl_table_size * sizeof (*filename_language_table));
}
filename_language_table[fl_table_next].ext = xstrdup (ext);
@@ -3214,7 +3240,7 @@ _initialize_symfile (void)
"Load symbol table from executable file FILE.\n\
The `file' command can also load symbol tables, as well as setting the file\n\
to execute.", &cmdlist);
- c->completer = filename_completer;
+ set_cmd_completer (c, filename_completer);
c = add_cmd ("add-symbol-file", class_files, add_symbol_file_command,
"Usage: add-symbol-file FILE ADDR [-s <SECT> <SECT_ADDR> -s <SECT> <SECT_ADDR> ...]\n\
@@ -3222,9 +3248,9 @@ Load the symbols from FILE, assuming FILE has been dynamically loaded.\n\
ADDR is the starting address of the file's text.\n\
The optional arguments are section-name section-address pairs and\n\
should be specified if the data and bss segments are not contiguous\n\
-with the text. SECT is a section name to be loaded at SECT_ADDR.",
+with the text. SECT is a section name to be loaded at SECT_ADDR.",
&cmdlist);
- c->completer = filename_completer;
+ set_cmd_completer (c, filename_completer);
c = add_cmd ("add-shared-symbol-files", class_files,
add_shared_symbol_files_command,
@@ -3236,7 +3262,7 @@ with the text. SECT is a section name to be loaded at SECT_ADDR.",
c = add_cmd ("load", class_files, load_command,
"Dynamically load FILE into the running program, and record its symbols\n\
for access from GDB.", &cmdlist);
- c->completer = filename_completer;
+ set_cmd_completer (c, filename_completer);
add_show_from_set
(add_set_cmd ("symbol-reloading", class_support, var_boolean,
diff --git a/gdb/symfile.h b/gdb/symfile.h
index 9ab8068..39eb308 100644
--- a/gdb/symfile.h
+++ b/gdb/symfile.h
@@ -252,6 +252,8 @@ extern void find_lowest_section (bfd *, asection *, PTR);
extern bfd *symfile_bfd_open (char *);
+extern int get_section_index (struct objfile *, char *);
+
/* Utility functions for overlay sections: */
extern enum overlay_debugging_state {
ovly_off,
diff --git a/gdb/symmisc.c b/gdb/symmisc.c
index 3c12988..2f1bb72 100644
--- a/gdb/symmisc.c
+++ b/gdb/symmisc.c
@@ -959,7 +959,7 @@ maintenance_check_symtabs (char *ignore, int from_tty)
while (length--)
{
sym = lookup_block_symbol (b, SYMBOL_NAME (*psym),
- SYMBOL_NAMESPACE (*psym));
+ NULL, SYMBOL_NAMESPACE (*psym));
if (!sym)
{
printf_filtered ("Static symbol `");
@@ -976,7 +976,7 @@ maintenance_check_symtabs (char *ignore, int from_tty)
while (length--)
{
sym = lookup_block_symbol (b, SYMBOL_NAME (*psym),
- SYMBOL_NAMESPACE (*psym));
+ NULL, SYMBOL_NAMESPACE (*psym));
if (!sym)
{
printf_filtered ("Global symbol `");
diff --git a/gdb/symtab.c b/gdb/symtab.c
index e464b0b..3a42867 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -80,11 +80,12 @@ static struct partial_symbol *lookup_partial_symbol (struct partial_symtab *,
const char *, int,
namespace_enum);
-static struct symbol *lookup_symbol_aux (const char *name, const
- struct block *block, const
- namespace_enum namespace, int
- *is_a_field_of_this, struct
- symtab **symtab);
+static struct symbol *lookup_symbol_aux (const char *name,
+ const char *mangled_name,
+ const struct block *block,
+ const namespace_enum namespace,
+ int *is_a_field_of_this,
+ struct symtab **symtab);
static struct symbol *find_active_alias (struct symbol *sym, CORE_ADDR addr);
@@ -143,11 +144,17 @@ lookup_symtab (const char *name)
register struct partial_symtab *ps;
register struct objfile *objfile;
char *real_path = NULL;
+ char *full_path = NULL;
/* Here we are interested in canonicalizing an absolute path, not
absolutizing a relative path. */
if (IS_ABSOLUTE_PATH (name))
- real_path = gdb_realpath (name);
+ {
+ full_path = xfullpath (name);
+ make_cleanup (xfree, full_path);
+ real_path = gdb_realpath (name);
+ make_cleanup (xfree, real_path);
+ }
got_symtab:
@@ -157,24 +164,32 @@ got_symtab:
{
if (FILENAME_CMP (name, s->filename) == 0)
{
- xfree (real_path);
return s;
}
+
/* If the user gave us an absolute path, try to find the file in
this symtab and use its absolute path. */
+
+ if (full_path != NULL)
+ {
+ const char *fp = symtab_to_filename (s);
+ if (FILENAME_CMP (full_path, fp) == 0)
+ {
+ return s;
+ }
+ }
+
if (real_path != NULL)
{
- char *rp = symtab_to_filename (s);
+ char *rp = gdb_realpath (symtab_to_filename (s));
+ make_cleanup (xfree, rp);
if (FILENAME_CMP (real_path, rp) == 0)
{
- xfree (real_path);
return s;
}
}
}
- xfree (real_path);
-
/* Now, search for a matching tail (only if name doesn't have any dirs) */
if (lbasename (name) == name)
@@ -220,36 +235,55 @@ lookup_partial_symtab (const char *name)
{
register struct partial_symtab *pst;
register struct objfile *objfile;
+ char *full_path = NULL;
char *real_path = NULL;
/* Here we are interested in canonicalizing an absolute path, not
absolutizing a relative path. */
if (IS_ABSOLUTE_PATH (name))
- real_path = gdb_realpath (name);
+ {
+ full_path = xfullpath (name);
+ make_cleanup (xfree, full_path);
+ real_path = gdb_realpath (name);
+ make_cleanup (xfree, real_path);
+ }
ALL_PSYMTABS (objfile, pst)
{
if (FILENAME_CMP (name, pst->filename) == 0)
{
- xfree (real_path);
return (pst);
}
+
/* If the user gave us an absolute path, try to find the file in
this symtab and use its absolute path. */
- if (real_path != NULL)
+ if (full_path != NULL)
{
if (pst->fullname == NULL)
source_full_path_of (pst->filename, &pst->fullname);
if (pst->fullname != NULL
- && FILENAME_CMP (real_path, pst->fullname) == 0)
+ && FILENAME_CMP (full_path, pst->fullname) == 0)
{
- xfree (real_path);
return pst;
}
}
- }
- xfree (real_path);
+ if (real_path != NULL)
+ {
+ char *rp = NULL;
+ if (pst->fullname == NULL)
+ source_full_path_of (pst->filename, &pst->fullname);
+ if (pst->fullname != NULL)
+ {
+ rp = gdb_realpath (pst->fullname);
+ make_cleanup (xfree, rp);
+ }
+ if (rp != NULL && FILENAME_CMP (real_path, rp) == 0)
+ {
+ return pst;
+ }
+ }
+ }
/* Now, search for a matching tail (only if name doesn't have any dirs) */
@@ -348,6 +382,83 @@ gdb_mangle_name (struct type *type, int method_id, int signature_id)
strcat (mangled_name, physname);
return (mangled_name);
}
+
+
+/* Initialize a symbol's mangled name. */
+
+/* Try to initialize the demangled name for a symbol, based on the
+ language of that symbol. If the language is set to language_auto,
+ it will attempt to find any demangling algorithm that works and
+ then set the language appropriately. If no demangling of any kind
+ is found, the language is set back to language_unknown, so we can
+ avoid doing this work again the next time we encounter the symbol.
+ Any required space to store the name is obtained from the specified
+ obstack. */
+
+void
+symbol_init_demangled_name (struct general_symbol_info *gsymbol,
+ struct obstack *obstack)
+{
+ char *mangled = gsymbol->name;
+ char *demangled = NULL;
+
+ if (gsymbol->language == language_unknown)
+ gsymbol->language = language_auto;
+ if (gsymbol->language == language_cplus
+ || gsymbol->language == language_auto)
+ {
+ demangled =
+ cplus_demangle (gsymbol->name, DMGL_PARAMS | DMGL_ANSI);
+ if (demangled != NULL)
+ {
+ gsymbol->language = language_cplus;
+ gsymbol->language_specific.cplus_specific.demangled_name =
+ obsavestring (demangled, strlen (demangled), obstack);
+ xfree (demangled);
+ }
+ else
+ {
+ gsymbol->language_specific.cplus_specific.demangled_name = NULL;
+ }
+ }
+ if (gsymbol->language == language_java)
+ {
+ demangled =
+ cplus_demangle (gsymbol->name,
+ DMGL_PARAMS | DMGL_ANSI | DMGL_JAVA);
+ if (demangled != NULL)
+ {
+ gsymbol->language = language_java;
+ gsymbol->language_specific.cplus_specific.demangled_name =
+ obsavestring (demangled, strlen (demangled), obstack);
+ xfree (demangled);
+ }
+ else
+ {
+ gsymbol->language_specific.cplus_specific.demangled_name = NULL;
+ }
+ }
+ if (demangled == NULL
+ && (gsymbol->language == language_chill
+ || gsymbol->language == language_auto))
+ {
+ demangled =
+ chill_demangle (gsymbol->name);
+ if (demangled != NULL)
+ {
+ gsymbol->language = language_chill;
+ gsymbol->language_specific.chill_specific.demangled_name =
+ obsavestring (demangled, strlen (demangled), obstack);
+ xfree (demangled);
+ }
+ else
+ {
+ gsymbol->language_specific.chill_specific.demangled_name = NULL;
+ }
+ }
+}
+
+
@@ -570,6 +681,7 @@ lookup_symbol (const char *name, const struct block *block,
{
char *modified_name = NULL;
char *modified_name2 = NULL;
+ const char *mangled_name = NULL;
int needtofreename = 0;
struct symbol *returnval;
@@ -595,13 +707,14 @@ lookup_symbol (const char *name, const struct block *block,
modified_name2 = cplus_demangle (modified_name, DMGL_ANSI | DMGL_PARAMS);
if (modified_name2)
{
+ mangled_name = name;
modified_name = modified_name2;
needtofreename = 1;
}
}
- returnval = lookup_symbol_aux (modified_name, block, namespace,
- is_a_field_of_this, symtab);
+ returnval = lookup_symbol_aux (modified_name, mangled_name, block,
+ namespace, is_a_field_of_this, symtab);
if (needtofreename)
xfree (modified_name2);
@@ -609,9 +722,9 @@ lookup_symbol (const char *name, const struct block *block,
}
static struct symbol *
-lookup_symbol_aux (const char *name, const struct block *block,
- const namespace_enum namespace, int *is_a_field_of_this,
- struct symtab **symtab)
+lookup_symbol_aux (const char *name, const char *mangled_name,
+ const struct block *block, const namespace_enum namespace,
+ int *is_a_field_of_this, struct symtab **symtab)
{
register struct symbol *sym;
register struct symtab *s = NULL;
@@ -626,7 +739,7 @@ lookup_symbol_aux (const char *name, const struct block *block,
while (block != 0)
{
- sym = lookup_block_symbol (block, name, namespace);
+ sym = lookup_block_symbol (block, name, mangled_name, namespace);
if (sym)
{
block_found = block;
@@ -679,7 +792,7 @@ lookup_symbol_aux (const char *name, const struct block *block,
if (BLOCK_START (b) <= BLOCK_START (block)
&& BLOCK_END (b) > BLOCK_START (block))
{
- sym = lookup_block_symbol (b, name, VAR_NAMESPACE);
+ sym = lookup_block_symbol (b, name, mangled_name, VAR_NAMESPACE);
if (sym)
{
block_found = b;
@@ -717,7 +830,7 @@ lookup_symbol_aux (const char *name, const struct block *block,
{
bv = BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
- sym = lookup_block_symbol (block, name, namespace);
+ sym = lookup_block_symbol (block, name, mangled_name, namespace);
if (sym)
{
block_found = block;
@@ -746,14 +859,14 @@ lookup_symbol_aux (const char *name, const struct block *block,
bv = BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
sym = lookup_block_symbol (block, SYMBOL_NAME (msymbol),
- namespace);
+ mangled_name, namespace);
/* We kept static functions in minimal symbol table as well as
in static scope. We want to find them in the symbol table. */
if (!sym)
{
block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
sym = lookup_block_symbol (block, SYMBOL_NAME (msymbol),
- namespace);
+ mangled_name, namespace);
}
/* sym == 0 if symbol was found in the minimal symbol table
@@ -779,7 +892,7 @@ lookup_symbol_aux (const char *name, const struct block *block,
{
/* This is a mangled variable, look it up by its
mangled name. */
- return lookup_symbol_aux (SYMBOL_NAME (msymbol), block,
+ return lookup_symbol_aux (SYMBOL_NAME (msymbol), mangled_name, block,
namespace, is_a_field_of_this, symtab);
}
/* There are no debug symbols for this file, or we are looking
@@ -797,7 +910,7 @@ lookup_symbol_aux (const char *name, const struct block *block,
s = PSYMTAB_TO_SYMTAB (ps);
bv = BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
- sym = lookup_block_symbol (block, name, namespace);
+ sym = lookup_block_symbol (block, name, mangled_name, namespace);
if (!sym)
{
/* This shouldn't be necessary, but as a last resort
@@ -806,7 +919,7 @@ lookup_symbol_aux (const char *name, const struct block *block,
* the psymtab gets it wrong in some cases.
*/
block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
- sym = lookup_block_symbol (block, name, namespace);
+ sym = lookup_block_symbol (block, name, mangled_name, namespace);
if (!sym)
error ("Internal: global symbol `%s' found in %s psymtab but not in symtab.\n\
%s may be an inlined function, or may be a template function\n\
@@ -830,7 +943,7 @@ lookup_symbol_aux (const char *name, const struct block *block,
{
bv = BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
- sym = lookup_block_symbol (block, name, namespace);
+ sym = lookup_block_symbol (block, name, mangled_name, namespace);
if (sym)
{
block_found = block;
@@ -847,7 +960,7 @@ lookup_symbol_aux (const char *name, const struct block *block,
s = PSYMTAB_TO_SYMTAB (ps);
bv = BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
- sym = lookup_block_symbol (block, name, namespace);
+ sym = lookup_block_symbol (block, name, mangled_name, namespace);
if (!sym)
{
/* This shouldn't be necessary, but as a last resort
@@ -856,7 +969,7 @@ lookup_symbol_aux (const char *name, const struct block *block,
* the psymtab gets it wrong in some cases.
*/
block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
- sym = lookup_block_symbol (block, name, namespace);
+ sym = lookup_block_symbol (block, name, mangled_name, namespace);
if (!sym)
error ("Internal: static symbol `%s' found in %s psymtab but not in symtab.\n\
%s may be an inlined function, or may be a template function\n\
@@ -913,14 +1026,14 @@ lookup_symbol_aux (const char *name, const struct block *block,
bv = BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
sym = lookup_block_symbol (block, SYMBOL_NAME (msymbol),
- namespace);
+ mangled_name, namespace);
/* We kept static functions in minimal symbol table as well as
in static scope. We want to find them in the symbol table. */
if (!sym)
{
block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
sym = lookup_block_symbol (block, SYMBOL_NAME (msymbol),
- namespace);
+ mangled_name, namespace);
}
/* If we found one, return it */
if (sym)
@@ -957,8 +1070,9 @@ lookup_symbol_aux (const char *name, const struct block *block,
&& MSYMBOL_TYPE (msymbol) != mst_file_text
&& !STREQ (name, SYMBOL_NAME (msymbol)))
{
- return lookup_symbol_aux (SYMBOL_NAME (msymbol), block,
- namespace, is_a_field_of_this, symtab);
+ return lookup_symbol_aux (SYMBOL_NAME (msymbol), mangled_name,
+ block, namespace, is_a_field_of_this,
+ symtab);
}
}
}
@@ -1084,7 +1198,7 @@ lookup_transparent_type (const char *name)
{
bv = BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
- sym = lookup_block_symbol (block, name, STRUCT_NAMESPACE);
+ sym = lookup_block_symbol (block, name, NULL, STRUCT_NAMESPACE);
if (sym && !TYPE_IS_OPAQUE (SYMBOL_TYPE (sym)))
{
return SYMBOL_TYPE (sym);
@@ -1098,7 +1212,7 @@ lookup_transparent_type (const char *name)
s = PSYMTAB_TO_SYMTAB (ps);
bv = BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
- sym = lookup_block_symbol (block, name, STRUCT_NAMESPACE);
+ sym = lookup_block_symbol (block, name, NULL, STRUCT_NAMESPACE);
if (!sym)
{
/* This shouldn't be necessary, but as a last resort
@@ -1107,7 +1221,7 @@ lookup_transparent_type (const char *name)
* the psymtab gets it wrong in some cases.
*/
block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
- sym = lookup_block_symbol (block, name, STRUCT_NAMESPACE);
+ sym = lookup_block_symbol (block, name, NULL, STRUCT_NAMESPACE);
if (!sym)
error ("Internal: global symbol `%s' found in %s psymtab but not in symtab.\n\
%s may be an inlined function, or may be a template function\n\
@@ -1131,7 +1245,7 @@ lookup_transparent_type (const char *name)
{
bv = BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
- sym = lookup_block_symbol (block, name, STRUCT_NAMESPACE);
+ sym = lookup_block_symbol (block, name, NULL, STRUCT_NAMESPACE);
if (sym && !TYPE_IS_OPAQUE (SYMBOL_TYPE (sym)))
{
return SYMBOL_TYPE (sym);
@@ -1145,7 +1259,7 @@ lookup_transparent_type (const char *name)
s = PSYMTAB_TO_SYMTAB (ps);
bv = BLOCKVECTOR (s);
block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
- sym = lookup_block_symbol (block, name, STRUCT_NAMESPACE);
+ sym = lookup_block_symbol (block, name, NULL, STRUCT_NAMESPACE);
if (!sym)
{
/* This shouldn't be necessary, but as a last resort
@@ -1154,7 +1268,7 @@ lookup_transparent_type (const char *name)
* the psymtab gets it wrong in some cases.
*/
block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
- sym = lookup_block_symbol (block, name, STRUCT_NAMESPACE);
+ sym = lookup_block_symbol (block, name, NULL, STRUCT_NAMESPACE);
if (!sym)
error ("Internal: static symbol `%s' found in %s psymtab but not in symtab.\n\
%s may be an inlined function, or may be a template function\n\
@@ -1198,10 +1312,15 @@ find_main_psymtab (void)
binary search terminates, we drop through and do a straight linear
search on the symbols. Each symbol which is marked as being a C++
symbol (language_cplus set) has both the encoded and non-encoded names
- tested for a match. */
+ tested for a match.
+
+ If MANGLED_NAME is non-NULL, verify that any symbol we find has this
+ particular mangled name.
+*/
struct symbol *
lookup_block_symbol (register const struct block *block, const char *name,
+ const char *mangled_name,
const namespace_enum namespace)
{
register int bot, top, inc;
@@ -1261,14 +1380,19 @@ lookup_block_symbol (register const struct block *block, const char *name,
return the first one; I believe it is now impossible for us
to encounter two symbols with the same name and namespace
here, because blocks containing argument symbols are no
- longer sorted. */
+ longer sorted. The exception is for C++, where multiple functions
+ (cloned constructors / destructors, in particular) can have
+ the same demangled name. So if we have a particular
+ mangled name to match, try to do so. */
top = BLOCK_NSYMS (block);
while (bot < top)
{
sym = BLOCK_SYM (block, bot);
- if (SYMBOL_NAMESPACE (sym) == namespace &&
- SYMBOL_MATCHES_NAME (sym, name))
+ if (SYMBOL_NAMESPACE (sym) == namespace
+ && (mangled_name
+ ? strcmp (SYMBOL_NAME (sym), mangled_name) == 0
+ : SYMBOL_MATCHES_NAME (sym, name)))
{
return sym;
}
@@ -1300,8 +1424,10 @@ lookup_block_symbol (register const struct block *block, const char *name,
while (bot < top)
{
sym = BLOCK_SYM (block, bot);
- if (SYMBOL_NAMESPACE (sym) == namespace &&
- SYMBOL_MATCHES_NAME (sym, name))
+ if (SYMBOL_NAMESPACE (sym) == namespace
+ && (mangled_name
+ ? strcmp (SYMBOL_NAME (sym), mangled_name) == 0
+ : SYMBOL_MATCHES_NAME (sym, name)))
{
/* If SYM has aliases, then use any alias that is active
at the current PC. If no alias is active at the current
@@ -3186,7 +3312,7 @@ make_symbol_completion_list (char *text, char *word)
/* Search upwards from currently selected frame (so that we can
complete on local vars. */
- for (b = get_selected_block (); b != NULL; b = BLOCK_SUPERBLOCK (b))
+ for (b = get_selected_block (0); b != NULL; b = BLOCK_SUPERBLOCK (b))
{
if (!BLOCK_SUPERBLOCK (b))
{
@@ -3719,7 +3845,7 @@ make_symbol_overload_list (struct symbol *fsym)
/* Search upwards from currently selected frame (so that we can
complete on local vars. */
- for (b = get_selected_block (); b != NULL; b = BLOCK_SUPERBLOCK (b))
+ for (b = get_selected_block (0); b != NULL; b = BLOCK_SUPERBLOCK (b))
{
if (!BLOCK_SUPERBLOCK (b))
{
diff --git a/gdb/symtab.h b/gdb/symtab.h
index 75470e6..231364e 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -159,74 +159,12 @@ extern CORE_ADDR symbol_overlayed_address (CORE_ADDR, asection *);
} \
} while (0)
-/* Macro that attempts to initialize the demangled name for a symbol,
- based on the language of that symbol. If the language is set to
- language_auto, it will attempt to find any demangling algorithm
- that works and then set the language appropriately. If no demangling
- of any kind is found, the language is set back to language_unknown,
- so we can avoid doing this work again the next time we encounter
- the symbol. Any required space to store the name is obtained from the
- specified obstack. */
-
-#define SYMBOL_INIT_DEMANGLED_NAME(symbol,obstack) \
- do { \
- char *demangled = NULL; \
- if (SYMBOL_LANGUAGE (symbol) == language_unknown) \
- SYMBOL_LANGUAGE (symbol) = language_auto; \
- if (SYMBOL_LANGUAGE (symbol) == language_cplus \
- || SYMBOL_LANGUAGE (symbol) == language_auto) \
- { \
- demangled = \
- cplus_demangle (SYMBOL_NAME (symbol), DMGL_PARAMS | DMGL_ANSI);\
- if (demangled != NULL) \
- { \
- SYMBOL_LANGUAGE (symbol) = language_cplus; \
- SYMBOL_CPLUS_DEMANGLED_NAME (symbol) = \
- obsavestring (demangled, strlen (demangled), (obstack)); \
- xfree (demangled); \
- } \
- else \
- { \
- SYMBOL_CPLUS_DEMANGLED_NAME (symbol) = NULL; \
- } \
- } \
- if (SYMBOL_LANGUAGE (symbol) == language_java) \
- { \
- demangled = \
- cplus_demangle (SYMBOL_NAME (symbol), \
- DMGL_PARAMS | DMGL_ANSI | DMGL_JAVA); \
- if (demangled != NULL) \
- { \
- SYMBOL_LANGUAGE (symbol) = language_java; \
- SYMBOL_CPLUS_DEMANGLED_NAME (symbol) = \
- obsavestring (demangled, strlen (demangled), (obstack)); \
- xfree (demangled); \
- } \
- else \
- { \
- SYMBOL_CPLUS_DEMANGLED_NAME (symbol) = NULL; \
- } \
- } \
- if (demangled == NULL \
- && (SYMBOL_LANGUAGE (symbol) == language_chill \
- || SYMBOL_LANGUAGE (symbol) == language_auto)) \
- { \
- demangled = \
- chill_demangle (SYMBOL_NAME (symbol)); \
- if (demangled != NULL) \
- { \
- SYMBOL_LANGUAGE (symbol) = language_chill; \
- SYMBOL_CHILL_DEMANGLED_NAME (symbol) = \
- obsavestring (demangled, strlen (demangled), (obstack)); \
- xfree (demangled); \
- } \
- else \
- { \
- SYMBOL_CHILL_DEMANGLED_NAME (symbol) = NULL; \
- } \
- } \
- } while (0)
+#define SYMBOL_INIT_DEMANGLED_NAME(symbol,obstack) \
+ (symbol_init_demangled_name (&symbol->ginfo, (obstack)))
+extern void symbol_init_demangled_name (struct general_symbol_info *symbol,
+ struct obstack *obstack);
+
/* Macro that returns the demangled name for a symbol based on the language
for that symbol. If no demangled name exists, returns NULL. */
@@ -469,11 +407,15 @@ struct block
/* Macro to loop through all symbols in a block BL.
i counts which symbol we are looking at, and sym points to the current
- symbol. */
+ symbol.
+ The contortion at the end is to avoid reading past the last valid
+ BLOCK_SYM. */
#define ALL_BLOCK_SYMBOLS(bl, i, sym) \
for ((i) = 0, (sym) = BLOCK_SYM ((bl), (i)); \
(i) < BLOCK_NSYMS ((bl)); \
- ++(i), (sym) = BLOCK_SYM ((bl), (i)))
+ ++(i), (sym) = ((i) < BLOCK_NSYMS ((bl))) \
+ ? BLOCK_SYM ((bl), (i)) \
+ : NULL)
/* Nonzero if symbols of block BL should be sorted alphabetically.
Don't sort a block which corresponds to a function. If we did the
@@ -1098,6 +1040,7 @@ extern struct symbol *lookup_symbol (const char *, const struct block *,
/* lookup a symbol by name, within a specified block */
extern struct symbol *lookup_block_symbol (const struct block *, const char *,
+ const char *,
const namespace_enum);
/* lookup a [struct, union, enum] by name, within a specified block */
@@ -1196,10 +1139,6 @@ extern struct minimal_symbol *prim_record_minimal_symbol_and_info
enum minimal_symbol_type,
char *info, int section, asection * bfd_section, struct objfile *);
-#ifdef SOFUN_ADDRESS_MAYBE_MISSING
-extern CORE_ADDR find_stab_function_addr (char *, char *, struct objfile *);
-#endif
-
extern unsigned int msymbol_hash_iw (const char *);
extern unsigned int msymbol_hash (const char *);
diff --git a/gdb/target.c b/gdb/target.c
index d5f205f..2cd4928 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -861,9 +861,9 @@ do_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
if (!write && trust_readonly)
{
- /* User-settable option, "trust-readonly". If true, then
- memory from any SEC_READONLY bfd section may be read
- directly from the bfd file. */
+ /* User-settable option, "trust-readonly-sections". If true,
+ then memory from any SEC_READONLY bfd section may be read
+ directly from the bfd file. */
struct section_table *secp;
@@ -1653,31 +1653,47 @@ debug_to_post_wait (ptid_t ptid, int status)
}
static void
+debug_print_register (const char * func, int regno)
+{
+ fprintf_unfiltered (gdb_stdlog, "%s ", func);
+ if (regno >= 0 && regno < NUM_REGS + NUM_PSEUDO_REGS
+ && REGISTER_NAME (regno) != NULL && REGISTER_NAME (regno)[0] != '\0')
+ fprintf_unfiltered (gdb_stdlog, "(%s)", REGISTER_NAME (regno));
+ else
+ fprintf_unfiltered (gdb_stdlog, "(%d)", regno);
+ if (regno >= 0)
+ {
+ int i;
+ unsigned char *buf = alloca (MAX_REGISTER_RAW_SIZE);
+ read_register_gen (regno, buf);
+ fprintf_unfiltered (gdb_stdlog, " = ");
+ for (i = 0; i < REGISTER_RAW_SIZE (regno); i++)
+ {
+ fprintf_unfiltered (gdb_stdlog, "%02x", buf[i]);
+ }
+ if (REGISTER_RAW_SIZE (regno) <= sizeof (LONGEST))
+ {
+ fprintf_unfiltered (gdb_stdlog, " 0x%s %s",
+ paddr_nz (read_register (regno)),
+ paddr_d (read_register (regno)));
+ }
+ }
+ fprintf_unfiltered (gdb_stdlog, "\n");
+}
+
+static void
debug_to_fetch_registers (int regno)
{
debug_target.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%lx %ld",
- (unsigned long) read_register (regno),
- (unsigned long) read_register (regno));
- fprintf_unfiltered (gdb_stdlog, "\n");
+ debug_print_register ("target_fetch_registers", regno);
}
static void
debug_to_store_registers (int regno)
{
debug_target.to_store_registers (regno);
-
- if (regno >= 0 && regno < NUM_REGS)
- 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));
- else
- fprintf_unfiltered (gdb_stdlog, "target_store_registers (%d)\n", regno);
+ debug_print_register ("target_store_registers", regno);
+ fprintf_unfiltered (gdb_stdlog, "\n");
}
static void
diff --git a/gdb/target.h b/gdb/target.h
index b5d036b..1797fc1 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -1184,7 +1184,8 @@ extern int default_memory_remove_breakpoint (CORE_ADDR, char *);
extern int default_memory_insert_breakpoint (CORE_ADDR, char *);
-extern breakpoint_from_pc_fn memory_breakpoint_from_pc;
+extern const unsigned char *memory_breakpoint_from_pc (CORE_ADDR *pcptr,
+ int *lenptr);
/* From target.c */
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 2b75520..6c35655 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,265 @@
+2002-05-06 Ben Elliston <bje@redhat.com>
+From Graydon Hoare <graydon@redhat.com>
+
+ * config/sid.exp: Include support for "rawsid" protocol.
+
+2002-05-03 Jim Blandy <jimb@redhat.com>
+
+ * gdb.c++/hang.exp: Check for corruption of the cv_type chain.
+ * gdb.c++/hang3.C: New file.
+
+2002-05-04 Andrew Cagney <ac131313@redhat.com>
+
+ * gdb.base/default.exp: Remove obsolete code.
+ * gdb.c++/misc.exp: Ditto. Update copyright.
+ * gdb.c++/cplusfuncs.exp: Ditto. Update copyright.
+ * gdb.base/whatis.exp: Ditto. Update copyright.
+ * gdb.base/scope.exp: Ditto. Update copyright.
+ * gdb.base/ptype.exp: Ditto. Update copyright.
+ * gdb.base/printcmds.exp: Ditto. Update copyright.
+ * gdb.base/opaque.exp: Ditto. Update copyright.
+ * gdb.base/list.exp: Ditto.
+ * gdb.base/funcargs.exp: Ditto. Update copyright.
+ * gdb.hp/gdb.threads-hp/usrthbasic.c: Delete.
+ * gdb.hp/gdb.threads-hp/usrthbasic.exp: Delete.
+ * gdb.hp/gdb.threads-hp/usrthcore.c: Delete.
+ * gdb.hp/gdb.threads-hp/usrthcore.exp: Delete.
+ * gdb.hp/gdb.threads-hp/usrthfork.c: Delete.
+ * gdb.hp/gdb.threads-hp/usrthfork.exp: Delete.
+
+2002-05-02 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.base/watchpoint.exp: Add xscale target.
+ * gdb.base/long_long.exp: Add xscale target.
+ * gdb.base/default.exp: Add xscale target.
+
+2002-05-01 Jim Blandy <jimb@redhat.com>
+
+ * gdb.c++/hang1.C, gdb.c++/hang2.C, gdb.c++/hang.H,
+ gdb.c++/hang.exp: New test.
+
+2002-05-01 Fred Fish <fnf@redhat.com>
+
+ * gdb.base/completion.exp: Handle completions of "./Make" for
+ more than one completion possibility, as is the case when we
+ build and test in the source tree.
+
+2002-04-29 Anthony Green <green@redhat.com>
+
+ * gdb.java/jmisc1.exp: New file.
+ * gdb.java/jmisc2.exp: New file.
+
+2002-04-24 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.threads/linux-dp.exp: Use 'unset' instead of 'array unset'.
+
+2002-04-23 Elena Zannoni <ezannoni@redhat.com>
+
+ * gdb.base/help.exp: Change 'help status' to allow for target
+ dependent output differences.
+
+2002-04-22 Michael Chastain <mec@shout.net>
+
+ * gdb.c++/local.exp: Add PR numbers: gdb/482, gdb/483.
+
+2002-04-22 Michael Chastain <mec@shout.net>
+
+ * gdb.c++/method.exp: Fix syntax of reference to gdb/277.
+
+2002-04-17 David S. Miller <davem@redhat.com>
+
+ * gdb.asm/sparc64.inc: New file.
+ * gdb.asm/asm-source.exp: Handle sparc64-*-*.
+
+2002-04-19 Elena Zannoni <ezannoni@redhat.com>
+
+ * gdb.asm/asm-source.exp: Don't use a symlink, just copy the
+ instruction file directly into the build tree. Clean up at end of
+ test.
+
+2002-04-18 David S. Miller <davem@redhat.com>
+
+ * gdb.base/annota1.exp: Expect addresses as $hex + whitespace to
+ handle 64-bit platforms correctly.
+ * gdb.base/maint.exp: Likewise.
+
+2002-04-18 Kevin Buettner <kevinb@redhat.com>
+
+ * gdb.base/shlib-call.exp (additional_flags): AIX doesn't need
+ ``-fpic'' when compiling files comprising a shared library, but
+ it does need additional linker flags in order to find shared
+ libraries at run time.
+
+2002-04-18 Kevin Buettner <kevinb@redhat.com>
+
+ * gdb.base/cvexpr.c (use): New function.
+ (main): Invoke use() on all global variables to prevent
+ some linkers from deleting these otherwise unused symbols.
+
+2002-04-17 Michael Chastain <mec@shout.net>
+From David S. Miller <davem@redhat.com>
+
+ * gdb.c++/ovldbreak.exp: Expect addresses as $hex + whitespace to
+ handle 64-bit platforms correctly.
+
+2002-04-12 Michael Snyder <msnyder@redhat.com>
+From Jim Blandy <jimb@redhat.com>
+ * gdb.base/foo.c (foox): Remove section attribute; the linker
+ script can handle this instead.
+ * gdb.base/bar.c (barx): Same.
+ * gdb.base/baz.c (bazx): Same.
+ * gdb.base/grbx.c (grbxx): Same.
+
+ * gdb.base/overlays.exp: New test: check that GDB's manual overlay
+ manager doesn't automatically unmap overlays unnecessarily.
+
+2002-04-10 Martin M. Hunt <hunt@redhat.com>
+
+ * gdb.base/ending-run.exp: Fix pattern for Mips targets
+ stepping out of main.
+
+2002-04-09 Michael Chastain <mec@shout.net>
+
+ * gdb.c++/local.cc (main): Move call to marker1() inside nested
+ scope so that the nested scope tests will make sense.
+ * gdb.c++/local.exp: Write patterns that actually work with gcc
+ (the HP patterns "were never known to work with gcc").
+ Keep the old aCC patterns too.
+
+2002-04-09 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.base/attach.exp: Correct target board test.
+
+2002-04-08 Michael Chastain <mec@shout.net>
+
+ * gdb.c++/method.exp: Require "const ... A * ..." for "ptype this"
+ in a const method. Add some xfail and fail cases for configurations
+ that do not emit the "const ...".
+
+2002-04-07 Michael Chastain <mec@shout.net>
+
+ * gdb.c++/method.exp: Use gdb_test instead of send_gdb/gdb_expect.
+ Accept "A * const" and "const A * const" as type of "this".
+ Fix spelling of getFunky throughout. Make messages uniform.
+
+2002-04-07 Elena Zannoni <ezannoni@redhat.com>
+
+ Work around for PR gdb/285:
+ * gdb.asm/asm-source.exp: Bail out if multilibs are detected.
+
+2002-04-07 Elena Zannoni <ezannoni@redhat.com>
+
+ * gdb.asm/asm-source.exp: Build symbolic link to arch specific
+ instructions file at run time instead of configure time.
+ Sometimes we run the test in a directory that is not the one we
+ configured in.
+ * gdb.asm/configure.in: Delete creation of symlink.
+ * gdb.asm/configure: Regenerate.
+
+2002-04-05 J. Brobecker <brobecker@gnat.com>
+
+ * gdb.gdb/xfullpath.exp: New test, to exercise the new
+ xfullpath () function.
+
+2002-04-04 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.asm/Makefile.in: Correct dependencies.
+
+ * gdb.asm/powerpc.inc: New file.
+ * gdb.asm/asm-source.exp: Add PowerPC.
+ * gdb.asm/configure.in: Likewise.
+ * gdb.asm/configure: Regenerated.
+
+2002-04-04 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.base/relocate.exp: New file.
+ * gdb.base/relocate.c: New file.
+
+2002-04-04 Fred Fish <fnf@redhat.com>
+
+ * gdb.base/step-test.exp: Update comment regarding stopping in
+ memcpy/bcopy calls inserted as part of the compiler runtime.
+
+2002-04-04 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.base/ovlymgr.c: Add overlay event breakpoint support.
+
+2002-04-03 Daniel Jacobowitz <drow@mvista.com>
+
+ * lib/gdb.exp (gdb_test): Move -notransfer inside of gdb_expect.
+ (gdb_expect): Remove $notransfer hack.
+
+2002-04-02 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.c++/classes.exp ("calling method for small class"): Match
+ updated register output.
+
+2002-03-30 Daniel Jacobowitz <drow@mvista.com>
+
+ Fix PR gdb/452
+ * gdb.base/dbx.exp: Restore old definition of gdb_file_cmd
+ when finished. Make gdb_file_cmd send "exec-file" when
+ appropriate.
+
+2002-03-30 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.base/attach.exp: Remove extra setup_xfail.
+
+2002-03-26 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.base/default.exp: Add tests for dump, append, and restore.
+ * gdb.base/help.exp: Add tests for dump, append, and restore.
+ * gdb.base/dump.exp: New file, test dump, append and restore.
+ * gdb.base/dump.c: New file.
+
+2002-03-27 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.base/help.exp: Modify expect strings to reflect
+ clean-ups in help messages.
+
+2002-03-26 Fred Fish <fnf@redhat.com>
+
+ * gdb.base/step-test.exp: Accept stopping in memcpy/bcopy when we
+ have debugging info for those functions and the compiler uses them
+ internally to copy structs around.
+
+2002-03-26 Fred Fish <fnf@redhat.com>
+
+ * gdb.base/list.exp: Revert the change made yesterday and add note
+ about why we don't list the default lines for remote targets.
+
+2002-03-25 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.base/help.exp: Clean up unnecessary wild cards in regexps.
+
+2002-03-25 Fred Fish <fnf@redhat.com>
+
+ * gdb.base/list.exp: This test works on remote targets so remove
+ the short circuit for remote targets. Update copyright.
+
+2002-03-25 Fred Fish <fnf@redhat.com>
+
+ * gdb.base/attach.exp: Fix logic error that was suppressing this
+ test for all non hppa*-*-hpux* targets, instead of the hp target.
+ Move comments closer to the suppression point. Also now need to
+ check that we are running natively.
+
+2002-03-22 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.base/default.exp: Add test for gcore. Update copyright.
+ * gdb.base/help.exp: Add test for gcore. Update copyright.
+
+2002-03-06 Fred Fish <fnf@redhat.com>
+
+ * gdb.base/funcargs.c: Remove extraneous ';' character.
+ * gdb.trace/gdb_c_test.c: Remove extraneous ';' character.
+
+2002-03-04 Michael Chastain <mec@shout.net>
+
+ * gdb.mi/mi-var-cmd.exp: In test "create local variable func",
+ accommodate gcc v3 function signature.
+ * gdb.mi/mi0-var-cmd-exp: Ditto.
+
2002-02-24 Andrew Cagney <ac131313@redhat.com>
* testsuite/gdb.base/huge.c: Replace ``Linux'' with either
@@ -58,6 +320,10 @@
* gdb.c++/userdef.exp: Test overloaded operators properly.
Remove xfails.
+2002-02-14 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.base/gcore.exp: Relax recognition of function breakpoint.
+
2002-02-14 Daniel Jacobowitz <drow@mvista.com>
* gdb.base/a2-run.exp: Check for a remote target properly.
diff --git a/gdb/testsuite/config/sid.exp b/gdb/testsuite/config/sid.exp
index 07a684f..987c9be 100644
--- a/gdb/testsuite/config/sid.exp
+++ b/gdb/testsuite/config/sid.exp
@@ -53,6 +53,8 @@ proc sid_start {} {
}
if { [board_info target sim,protocol] == "sid" } {
set spawncmd "[target_info sim] [target_info sim,options] $sidendian2 -e \"set cpu-gdb-socket sockaddr-local 0.0.0.0:$port\""
+ } elseif { [board_info target sim,protocol] == "rawsid" } {
+ set spawncmd "[target_info sim] [target_info sim,options] -$sidendian --gdb=$port"
} else {
set spawncmd "../../sid/bsp/[target_info sim] $sidendian --gdb=$port [target_info sim,options]"
}
@@ -67,6 +69,8 @@ proc sid_start {} {
# FIXME: sim,options may be from the build tree, should find
# it in the install tree.
set spawncmd "sid [target_info sim,options] $sidendian2 -e \"set cpu-gdb-socket sockaddr-local 0.0.0.0:$port\""
+ } elseif { [board_info target sim,protocol] == "rawsid" } {
+ set spawncmd "[target_info sim] [target_info sim,options] -$sidendian --gdb=$port"
} else {
set spawncmd "[target_info sim] $sidendian --gdb=$port [target_info sim,options]"
}
diff --git a/gdb/testsuite/gdb.asm/Makefile.in b/gdb/testsuite/gdb.asm/Makefile.in
index ce169b5..05ed656 100644
--- a/gdb/testsuite/gdb.asm/Makefile.in
+++ b/gdb/testsuite/gdb.asm/Makefile.in
@@ -29,5 +29,8 @@ distclean maintainer-clean realclean: clean
-rm -f *-init.exp
-rm -fr *.log summary detail *.plog *.sum *.psum site.*
-Makefile : $(srcdir)/Makefile.in $(srcdir)/configure.in
+Makefile : $(srcdir)/Makefile.in config.status
+ $(SHELL) ./config.status
+
+config.status: $(srcdir)/configure
$(SHELL) ./config.status --recheck
diff --git a/gdb/testsuite/gdb.asm/asm-source.exp b/gdb/testsuite/gdb.asm/asm-source.exp
index 471b31a..298ba2e 100644
--- a/gdb/testsuite/gdb.asm/asm-source.exp
+++ b/gdb/testsuite/gdb.asm/asm-source.exp
@@ -1,4 +1,4 @@
-# Copyright 1998, 2000 Free Software Foundation, Inc.
+# Copyright 1998, 2000, 2002 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
@@ -53,9 +53,16 @@ if [istarget "i\[3456\]86-*-*"] then {
if [istarget "m32r*-*"] then {
set asm-arch m32r
}
+if [istarget "powerpc*-*"] then {
+ set asm-arch powerpc
+}
if [istarget "sparc-*-*"] then {
set asm-arch sparc
}
+if [istarget "sparc64-*-*"] then {
+ set asm-arch sparc64
+ set asm-flags "-xarch=v9 -gstabs -I${srcdir}/${subdir} -I${objdir}/${subdir}"
+}
if [istarget "xstormy16-*-*"] then {
set asm-arch xstormy16
set asm-flags "-gdwarf2 -I${srcdir}/${subdir} -I${objdir}/${subdir}"
@@ -64,11 +71,29 @@ if { "${asm-arch}" == "" } {
gdb_suppress_entire_file "Assembly source test -- not implemented for this target."
}
+# Watch out, we are invoking the assembler, but the testsuite sets multilib
+# switches according to compiler syntax. If we pass these options straight
+# to the assembler, they won't always make sense. If we don't pass them to
+# the assembler, the final link will complain that the object files were
+# built with different defaults. So no matter what we do, we lose. We may as
+# well get out of this test sooner rather than later.
+set dest [target_info name]
+if [board_info $dest exists multilib_flags] {
+ set multilib_flags [board_info $dest multilib_flags]
+ if { "${multilib_flags}" != "" } {
+ gdb_suppress_entire_file "Assembly source test -- multilibs not supported by this test."
+ return;
+ }
+}
+
set testfile "asm-source"
set binfile ${objdir}/${subdir}/${testfile}
set src1 ${srcdir}/${subdir}/asmsrc1.s
set src2 ${srcdir}/${subdir}/asmsrc2.s
+remote_exec build "rm -f ${subdir}/arch.inc"
+remote_download host ${srcdir}/${subdir}/${asm-arch}.inc ${subdir}/arch.inc
+
if { "${asm-flags}" == "" } {
#set asm-flags "-Wa,-gstabs,-I${srcdir}/${subdir},-I${objdir}/${subdir}"
set asm-flags "-gstabs -I${srcdir}/${subdir} -I${objdir}/${subdir}"
@@ -256,3 +281,4 @@ gdb_test "print staticvar" ".* = 5" "look at static variable"
gdb_test "disassem foostatic" ".*<foostatic>:.*End of assembler dump." \
"look at static function"
+remote_exec build "rm -f ${subdir}/arch.inc"
diff --git a/gdb/testsuite/gdb.asm/configure b/gdb/testsuite/gdb.asm/configure
index 72945d2..1dd8138 100755
--- a/gdb/testsuite/gdb.asm/configure
+++ b/gdb/testsuite/gdb.asm/configure
@@ -28,6 +28,7 @@ program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
+sitefile=
srcdir=
target=NONE
verbose=
@@ -142,6 +143,7 @@ Configuration:
--help print this message
--no-create do not create output files
--quiet, --silent do not print \`checking...' messages
+ --site-file=FILE use FILE as the site file
--version print the version of autoconf that created configure
Directory and file names:
--prefix=PREFIX install architecture-independent files in PREFIX
@@ -312,6 +314,11 @@ EOF
-site=* | --site=* | --sit=*)
site="$ac_optarg" ;;
+ -site-file | --site-file | --site-fil | --site-fi | --site-f)
+ ac_prev=sitefile ;;
+ -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
+ sitefile="$ac_optarg" ;;
+
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
@@ -477,12 +484,16 @@ fi
srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
# Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+if test -z "$sitefile"; then
+ if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
fi
+else
+ CONFIG_SITE="$sitefile"
fi
for ac_site_file in $CONFIG_SITE; do
if test -r "$ac_site_file"; then
@@ -571,7 +582,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:575: checking host system type" >&5
+echo "configure:586: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -592,7 +603,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$host" 1>&6
echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:596: checking target system type" >&5
+echo "configure:607: checking target system type" >&5
target_alias=$target
case "$target_alias" in
@@ -610,7 +621,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$target" 1>&6
echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:614: checking build system type" >&5
+echo "configure:625: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -633,19 +644,6 @@ test "$host_alias" != "$target_alias" &&
program_prefix=${target_alias}-
-archinc=common.inc
-case ${target} in
-*arm-*-*) archinc=arm.inc ;;
-xscale-*-*) archinc=arm.inc ;;
-d10v-*-*) archinc=d10v.inc ;;
-s390-*-*) archinc=s390.inc ;;
-i[3456]86*) archinc=i386.inc ;;
-m32r*-*) archinc=m32r.inc ;;
-sparc-*-*) archinc=sparc.inc ;;
-xstormy16-*-*) archinc=xstormy16.inc ;;
-esac
-
-
trap '' 1 2 15
cat > confcache <<\EOF
# This file is a shell script that caches the results of configure
@@ -902,51 +900,6 @@ fi; done
rm -f conftest.s*
EOF
-
-cat >> $CONFIG_STATUS <<EOF
-ac_sources="$archinc"
-ac_dests="arch.inc"
-EOF
-
-cat >> $CONFIG_STATUS <<\EOF
-srcdir=$ac_given_srcdir
-while test -n "$ac_sources"; do
- set $ac_dests; ac_dest=$1; shift; ac_dests=$*
- set $ac_sources; ac_source=$1; shift; ac_sources=$*
-
- echo "linking $srcdir/$ac_source to $ac_dest"
-
- if test ! -r $srcdir/$ac_source; then
- { echo "configure: error: $srcdir/$ac_source: File not found" 1>&2; exit 1; }
- fi
- rm -f $ac_dest
-
- # Make relative symlinks.
- # Remove last slash and all that follows it. Not all systems have dirname.
- ac_dest_dir=`echo $ac_dest|sed 's%/[^/][^/]*$%%'`
- if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then
- # The dest file is in a subdirectory.
- test ! -d "$ac_dest_dir" && mkdir "$ac_dest_dir"
- ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's%^\./%%'`"
- # A "../" for each directory in $ac_dest_dir_suffix.
- ac_dots=`echo $ac_dest_dir_suffix|sed 's%/[^/]*%../%g'`
- else
- ac_dest_dir_suffix= ac_dots=
- fi
-
- case "$srcdir" in
- [/$]*) ac_rel_source="$srcdir/$ac_source" ;;
- *) ac_rel_source="$ac_dots$srcdir/$ac_source" ;;
- esac
-
- # Make a symlink if possible; otherwise try a hard link.
- if ln -s $ac_rel_source $ac_dest 2>/dev/null ||
- ln $srcdir/$ac_source $ac_dest; then :
- else
- { echo "configure: error: can not link $ac_dest to $srcdir/$ac_source" 1>&2; exit 1; }
- fi
-done
-EOF
cat >> $CONFIG_STATUS <<EOF
EOF
diff --git a/gdb/testsuite/gdb.asm/configure.in b/gdb/testsuite/gdb.asm/configure.in
index 6e3b2c5..bded89e 100644
--- a/gdb/testsuite/gdb.asm/configure.in
+++ b/gdb/testsuite/gdb.asm/configure.in
@@ -12,18 +12,4 @@ AC_SUBST(CC)
AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../../..)
AC_CANONICAL_SYSTEM
-dnl In default case we need to link with some file so use common.inc.
-archinc=common.inc
-case ${target} in
-*arm-*-*) archinc=arm.inc ;;
-xscale-*-*) archinc=arm.inc ;;
-d10v-*-*) archinc=d10v.inc ;;
-s390-*-*) archinc=s390.inc ;;
-i[[3456]]86*) archinc=i386.inc ;;
-m32r*-*) archinc=m32r.inc ;;
-sparc-*-*) archinc=sparc.inc ;;
-xstormy16-*-*) archinc=xstormy16.inc ;;
-esac
-AC_LINK_FILES($archinc,arch.inc)
-
AC_OUTPUT(Makefile)
diff --git a/gdb/testsuite/gdb.asm/powerpc.inc b/gdb/testsuite/gdb.asm/powerpc.inc
new file mode 100644
index 0000000..5aefde2
--- /dev/null
+++ b/gdb/testsuite/gdb.asm/powerpc.inc
@@ -0,0 +1,46 @@
+ comment "subroutine prologue"
+ .macro gdbasm_enter
+ stwu 1, -16(1)
+ stw 31, 8(1)
+ mr 31, 1
+ mflr 0
+ stw 0, 20(1)
+ .endm
+
+ comment "subroutine epilogue"
+ .macro gdbasm_leave
+ lwz 0, 20(1)
+ mtlr 0
+ lwz 31, 8(1)
+ lwz 1, 0(1)
+ blr
+ .endm
+
+ .macro gdbasm_call subr
+ bl \subr
+ .endm
+
+ .macro gdbasm_several_nops
+ nop
+ nop
+ nop
+ nop
+ .endm
+
+ comment "exit (0)"
+ .macro gdbasm_exit0
+ comment "Don't know how to exit, but this will certainly halt..."
+ li 0, 0
+ lwz 0, 0(0)
+ .endm
+
+ comment "crt0 startup"
+ .macro gdbasm_startup
+ .endm
+
+ comment "Declare a data variable"
+ .macro gdbasm_datavar name value
+ .data
+\name:
+ .long \value
+ .endm
diff --git a/gdb/testsuite/gdb.asm/sparc64.inc b/gdb/testsuite/gdb.asm/sparc64.inc
new file mode 100644
index 0000000..fb2253e
--- /dev/null
+++ b/gdb/testsuite/gdb.asm/sparc64.inc
@@ -0,0 +1,34 @@
+ comment "subroutine prologue"
+ .macro gdbasm_enter
+ save %sp, -192, %sp
+ .endm
+
+ comment "subroutine epilogue"
+ .macro gdbasm_leave
+ return %i7 + 8
+ nop
+ .endm
+
+ .macro gdbasm_call subr
+ call \subr
+ nop
+ .endm
+
+ .macro gdbasm_several_nops
+ nop
+ nop
+ nop
+ nop
+ .endm
+
+ comment "exit (0)"
+ .macro gdbasm_exit0
+ comment "Don't know how to exit, but this will certainly halt..."
+ ldx [%g0], %i0
+ .endm
+
+ comment "crt0 startup"
+ .macro gdbasm_startup
+ clr %fp
+ .endm
+
diff --git a/gdb/testsuite/gdb.base/annota1.exp b/gdb/testsuite/gdb.base/annota1.exp
index bdb5646..bda2bec 100644
--- a/gdb/testsuite/gdb.base/annota1.exp
+++ b/gdb/testsuite/gdb.base/annota1.exp
@@ -115,7 +115,7 @@ gdb_expect {
#
send_gdb "info break\n"
gdb_expect {
- -re "\r\n\032\032post-prompt\r\n\r\n\032\032breakpoints-headers\r\n\r\n\032\032field 0\r\nNum \r\n\032\032field 1\r\nType \r\n\032\032field 2\r\nDisp \r\n\032\032field 3\r\nEnb \r\n\032\032field 4\r\nAddress +\r\n\032\032field 5\r\nWhat\r\n\r\n\032\032breakpoints-table\r\n\r\n\032\032record\r\n\r\n\032\032field 0\r\n1 \r\n\032\032field 1\r\nbreakpoint \r\n\032\032field 2\r\nkeep \r\n\032\032field 3\r\ny \r\n\032\032field 4\r\n$hex \r\n\032\032field 5\r\nin main at ${srcdir}/${subdir}/${srcfile}:$main_line\r\n\r\n\032\032breakpoints-table-end\r\n$gdb_prompt$" \
+ -re "\r\n\032\032post-prompt\r\n\r\n\032\032breakpoints-headers\r\n\r\n\032\032field 0\r\nNum \r\n\032\032field 1\r\nType \r\n\032\032field 2\r\nDisp \r\n\032\032field 3\r\nEnb \r\n\032\032field 4\r\nAddress +\r\n\032\032field 5\r\nWhat\r\n\r\n\032\032breakpoints-table\r\n\r\n\032\032record\r\n\r\n\032\032field 0\r\n1 \r\n\032\032field 1\r\nbreakpoint \r\n\032\032field 2\r\nkeep \r\n\032\032field 3\r\ny \r\n\032\032field 4\r\n$hex +\r\n\032\032field 5\r\nin main at ${srcdir}/${subdir}/${srcfile}:$main_line\r\n\r\n\032\032breakpoints-table-end\r\n$gdb_prompt$" \
{pass "breakpoint info"}
-re ".*$gdb_prompt$" { fail "breakpoint info" }
timeout { fail "breakpoint info (timeout)" }
diff --git a/gdb/testsuite/gdb.base/attach.exp b/gdb/testsuite/gdb.base/attach.exp
index ca6f5e0..2b341af 100644
--- a/gdb/testsuite/gdb.base/attach.exp
+++ b/gdb/testsuite/gdb.base/attach.exp
@@ -1,4 +1,4 @@
-# Copyright 1997, 1999 Free Software Foundation, Inc.
+# Copyright 1997, 1999, 2002 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
@@ -17,16 +17,6 @@
# Please email any bugs, comments, and/or additions to this file to:
# bug-gdb@prep.ai.mit.edu
-# On HP-UX 11.0, this test is causing a process running
-# the program "attach" to be left around spinning.
-# Until we figure out why, I am commenting out the test
-# to avoid polluting tiamat (our 11.0 nightly test machine)
-# with these processes. RT
-#
-# Setting the magic bit in the target app should work.
-# I added a "kill", and also a test for the R3 register
-# warning. JB
-#
if $tracelevel then {
strace $tracelevel
}
@@ -34,9 +24,19 @@ if $tracelevel then {
set prms_id 0
set bug_id 0
+# On HP-UX 11.0, this test is causing a process running the program
+# "attach" to be left around spinning. Until we figure out why, I am
+# commenting out the test to avoid polluting tiamat (our 11.0 nightly
+# test machine) with these processes. RT
+#
+# Setting the magic bit in the target app should work. I added a
+# "kill", and also a test for the R3 register warning. JB
+if { [istarget "hppa*-*-hpux*"] } {
+ return 0
+}
-if { ![istarget "hppa*-*-hpux*"] } {
- #setup_xfail "*-*-*"
+# are we on a target board
+if [is_remote target] then {
return 0
}
@@ -426,13 +426,6 @@ gdb_start
gdb_reinitialize_dir $srcdir/$subdir
do_call_attach_tests
-# Until "set follow-fork-mode" and "catch fork" are implemented on
-# other targets...
-#
-if ![istarget "hppa*-hp-hpux*"] then {
- setup_xfail "*-*-*"
-}
-
# Cleanup the files placed in /tmp and the symlinks
remote_exec build "rm -f ${binfile} ${binfile2} /tmp/attach1.${pid} /tmp/attach2.${pid}"
diff --git a/gdb/testsuite/gdb.base/bar.c b/gdb/testsuite/gdb.base/bar.c
index 8a4da980..dd0bf92 100644
--- a/gdb/testsuite/gdb.base/bar.c
+++ b/gdb/testsuite/gdb.base/bar.c
@@ -1,4 +1,4 @@
-static int barx __attribute__ ((section (".data01"))) = 'b' + 'a' + 'r';
+static int barx = 'b' + 'a' + 'r';
int bar (int x)
{
diff --git a/gdb/testsuite/gdb.base/baz.c b/gdb/testsuite/gdb.base/baz.c
index a13cd16..8da4ffa 100644
--- a/gdb/testsuite/gdb.base/baz.c
+++ b/gdb/testsuite/gdb.base/baz.c
@@ -1,4 +1,4 @@
-static int bazx __attribute__ ((section (".data02"))) = 'b' + 'a' + 'z';
+static int bazx = 'b' + 'a' + 'z';
int baz (int x)
{
diff --git a/gdb/testsuite/gdb.base/completion.exp b/gdb/testsuite/gdb.base/completion.exp
index d8d5baf..f8f4568 100644
--- a/gdb/testsuite/gdb.base/completion.exp
+++ b/gdb/testsuite/gdb.base/completion.exp
@@ -1,4 +1,4 @@
-# Copyright 1998, 1999 Free Software Foundation, Inc.
+# Copyright 1998, 1999, 2002 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
@@ -631,12 +631,18 @@ gdb_expect {
#
# So, we avoid long lines. We `cd' to ${objdir} first, and then do
# the completion relative to the current directory.
+#
+# Note that if we are building in the source tree, then there will be
+# more than one completion for ./Make, so we need to handle that also.
+# A better long term solution might be to create a temporary directory,
+# populate it with a set of known names, and use that directory to
+# test completions.
gdb_test "cd ${objdir}" "Working directory ${objdir}.*" "cd to \${objdir}"
send_gdb "file ./Make\t"
sleep 1
gdb_expect {
- -re "file ./Makefile.*$"\
+ -re "^file ./Make(\\\x07|)file.*$"\
{ send_gdb "\n"
gdb_expect {
-re "\r\nA program is being debugged already\\. Kill it\\? \\(y or n\\) $"\
diff --git a/gdb/testsuite/gdb.base/cvexpr.c b/gdb/testsuite/gdb.base/cvexpr.c
index 176bbe9..5871209 100644
--- a/gdb/testsuite/gdb.base/cvexpr.c
+++ b/gdb/testsuite/gdb.base/cvexpr.c
@@ -273,8 +273,162 @@ unsigned long long (*v_unsigned_long_long_func) (int, int*);
float (*v_float_func) (int, int*);
double (*v_double_func) (int, int*);
-
+void use (void *p)
+{
+}
int main ()
{
+ use (&v_char);
+ use (&v_signed_char);
+ use (&v_unsigned_char);
+
+ use (&v_short);
+ use (&v_signed_short);
+ use (&v_unsigned_short);
+
+ use (&v_int);
+ use (&v_signed_int);
+ use (&v_unsigned_int);
+
+ use (&v_long);
+ use (&v_signed_long);
+ use (&v_unsigned_long);
+
+ use (&v_long_long);
+ use (&v_signed_long_long);
+ use (&v_unsigned_long_long);
+
+ use (&v_float);
+ use (&v_double);
+
+ use (v_char_array);
+ use (v_signed_char_array);
+ use (v_unsigned_char_array);
+
+ use (v_short_array);
+ use (v_signed_short_array);
+ use (v_unsigned_short_array);
+
+ use (v_int_array);
+ use (v_signed_int_array);
+ use (v_unsigned_int_array);
+
+ use (v_long_array);
+ use (v_signed_long_array);
+ use (v_unsigned_long_array);
+
+ use (v_float_array);
+ use (v_double_array);
+
+ use (v_char_pointer);
+ use (v_signed_char_pointer);
+ use (v_unsigned_char_pointer);
+
+ use (v_short_pointer);
+ use (v_signed_short_pointer);
+ use (v_unsigned_short_pointer);
+
+ use (v_int_pointer);
+ use (v_signed_int_pointer);
+ use (v_unsigned_int_pointer);
+
+ use (v_long_pointer);
+ use (v_signed_long_pointer);
+ use (v_unsigned_long_pointer);
+
+ use (v_float_pointer);
+ use (v_double_pointer);
+
+ use (v_char_pointer_pointer);
+ use (v_signed_char_pointer_pointer);
+ use (v_unsigned_char_pointer_pointer);
+
+ use (v_short_pointer_pointer);
+ use (v_signed_short_pointer_pointer);
+ use (v_unsigned_short_pointer_pointer);
+
+ use (v_int_pointer_pointer);
+ use (v_signed_int_pointer_pointer);
+ use (v_unsigned_int_pointer_pointer);
+
+ use (v_long_pointer_pointer);
+ use (v_signed_long_pointer_pointer);
+ use (v_unsigned_long_pointer_pointer);
+
+ use (v_float_pointer_pointer);
+ use (v_double_pointer_pointer);
+
+ use (v_char_array_pointer);
+ use (v_signed_char_array_pointer);
+ use (v_unsigned_char_array_pointer);
+
+ use (v_short_array_pointer);
+ use (v_signed_short_array_pointer);
+ use (v_unsigned_short_array_pointer);
+
+ use (v_int_array_pointer);
+ use (v_signed_int_array_pointer);
+ use (v_unsigned_int_array_pointer);
+
+ use (v_long_array_pointer);
+ use (v_signed_long_array_pointer);
+ use (v_unsigned_long_array_pointer);
+
+ use (v_float_array_pointer);
+ use (v_double_array_pointer);
+
+ use (v_char_pointer_array);
+ use (v_signed_char_pointer_array);
+ use (v_unsigned_char_pointer_array);
+
+ use (v_short_pointer_array);
+ use (v_signed_short_pointer_array);
+ use (v_unsigned_short_pointer_array);
+
+ use (v_int_pointer_array);
+ use (v_signed_int_pointer_array);
+ use (v_unsigned_int_pointer_array);
+
+ use (v_long_pointer_array);
+ use (v_signed_long_pointer_array);
+ use (v_unsigned_long_pointer_array);
+
+ use (v_float_pointer_array);
+ use (v_double_pointer_array);
+
+ use (&v_struct1);
+ use (&v_struct2);
+ use (&v_struct3);
+
+ use (&v_union);
+ use (&v_union2);
+ use (&v_union3);
+
+ use (&v_boolean);
+ use (&v_boolean2);
+ use (&v_misordered);
+
+ use (v_char_func);
+ use (v_signed_char_func);
+ use (v_unsigned_char_func);
+
+ use (v_short_func);
+ use (v_signed_short_func);
+ use (v_unsigned_short_func);
+
+ use (v_int_func);
+ use (v_signed_int_func);
+ use (v_unsigned_int_func);
+
+ use (v_long_func);
+ use (v_signed_long_func);
+ use (v_unsigned_long_func);
+
+ use (v_long_long_func);
+ use (v_signed_long_long_func);
+ use (v_unsigned_long_long_func);
+
+ use (v_float_func);
+ use (v_double_func);
}
diff --git a/gdb/testsuite/gdb.base/dbx.exp b/gdb/testsuite/gdb.base/dbx.exp
index 9df3bda..161333c 100644
--- a/gdb/testsuite/gdb.base/dbx.exp
+++ b/gdb/testsuite/gdb.base/dbx.exp
@@ -168,6 +168,11 @@ proc dbx_reinitialize_dir { subdir } {
# file into gdb for a dbx session. So why not just override gdb_file_cmd with the
# right sequence of events, allowing gdb_load to do its normal thing? This way
# remotes and simulators will work, too.
+#
+# [drow 2002-03-30]: We can restore the old gdb_file_cmd afterwards, though.
+set old_gdb_file_cmd_args [info args gdb_file_cmd]
+set old_gdb_file_cmd_body [info body gdb_file_cmd]
+
proc gdb_file_cmd {arg} {
global verbose
global loadpath
@@ -206,6 +211,11 @@ proc gdb_file_cmd {arg} {
verbose "\t\tLoaded $arg into the $GDB"
send_gdb "exec-file $arg\n"
gdb_expect {
+ -re "A program is being debugged already.*Kill it.*y or n. $" {
+ send_gdb "y\n"
+ verbose "\t\tKilling previous program being debugged"
+ exp_continue
+ }
-re ".*$gdb_prompt $" {
verbose "\t\tLoaded $arg with new symbol table into $GDB"
return 0
@@ -221,23 +231,9 @@ proc gdb_file_cmd {arg} {
perror "$arg wasn't compiled with \"-g\""
return -1
}
- -re "A program is being debugged already.*Kill it.*y or n. $" {
- send_gdb "y\n"
- verbose "\t\tKilling previous program being debugged"
- exp_continue
- }
-re "Load new symbol table from \".*\".*y or n. $" {
send_gdb "y\n"
- gdb_expect {
- -re "Reading symbols from.*done.*$gdb_prompt $" {
- verbose "\t\tLoaded $arg with new symbol table into $GDB"
- return 0
- }
- timeout {
- perror "(timeout) Couldn't load $arg, other program already loaded."
- return -1
- }
- }
+ exp_continue
}
-re ".*No such file or directory.*$gdb_prompt $" {
perror "($arg) No such file or directory\n"
@@ -339,4 +335,6 @@ test_func
gdb_exit
set GDBFLAGS $saved_gdbflags
+eval proc gdb_file_cmd {$old_gdb_file_cmd_args} {$old_gdb_file_cmd_body}
+
return 0
diff --git a/gdb/testsuite/gdb.base/default.exp b/gdb/testsuite/gdb.base/default.exp
index 17d7027..09b65a9 100644
--- a/gdb/testsuite/gdb.base/default.exp
+++ b/gdb/testsuite/gdb.base/default.exp
@@ -1,5 +1,5 @@
# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001
+# 2000, 2001, 2002
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
@@ -34,6 +34,14 @@ set timeout 60
gdb_test "add-symbol-file" "add-symbol-file takes a file name and an address" "add-symbol-file"
+# test append
+gdb_test "append" "\"append\" must be followed by a subcommand\.\[\r\n\]+List of append subcommands:.*"
+gdb_test "append binary" "\"append binary\" must be followed by a subcommand\.\[\r\n\]+List of append binary subcommands:.*"
+gdb_test "append memory" "Missing filename\."
+gdb_test "append value" "Missing filename\."
+gdb_test "append binary memory" "Missing filename\."
+gdb_test "append binary value" "Missing filename\."
+
setup_xfail "mips-idt-*"
send_gdb "attach\n"
gdb_expect {
@@ -53,12 +61,6 @@ gdb_expect {
timeout { fail "(timeout) attach" }
}
-# OBSOLETE # FIXME: attach kills the udi connection
-# OBSOLETE if { [istarget "a29k-*-udi"] } {
-# OBSOLETE gdb_exit
-# OBSOLETE gdb_start
-# OBSOLETE }
-
if ![target_info exists use_gdb_stub] {
gdb_test "break" "No default breakpoint address now." "break"
foreach i "b br bre brea" {
@@ -67,7 +69,6 @@ if ![target_info exists use_gdb_stub] {
setup_xfail "mips-idt-*"
- # OBSOLETE setup_xfail "a29k-*-udi"
gdb_test "backtrace" "No stack."
# ba and bac are no longer unique command prefixes. So these tests
@@ -76,7 +77,6 @@ if ![target_info exists use_gdb_stub] {
#
foreach i "bt ba bac" {
setup_xfail "mips-idt-*"
- # OBSOLETE setup_xfail "a29k-*-udi"
gdb_test $i "No stack." "backtrace \"$i\" abbreviation"
}
} else {
@@ -85,18 +85,10 @@ if ![target_info exists use_gdb_stub] {
# This works on the MIPS IDT board, but confuses future tests.
if ![istarget "mips-idt-*"] then {
- # OBSOLETE setup_xfail "a29k-*-udi"
gdb_test "continue" "The program is not being run." "continue"
- # OBSOLETE setup_xfail "a29k-*-udi"
gdb_test "c" "The program is not being run." "continue \"c\" abbreviation"
}
-# OBSOLETE # FIXME: continue kills the udi connection
-# OBSOLETE if [istarget "a29k-*-udi"] then {
-# OBSOLETE gdb_exit
-# OBSOLETE gdb_start
-# OBSOLETE }
-
#test call
gdb_test "call" "The history is empty..*" "call"
@@ -144,11 +136,6 @@ gdb_expect {
#test detach
gdb_test "detach" "" "detach"
-# OBSOLETE # FIXME: continue kills the udi connection
-# OBSOLETE if [istarget "a29k-*-udi"] then {
-# OBSOLETE gdb_exit
-# OBSOLETE gdb_start
-# OBSOLETE }
if [istarget "h8300-*-hms"] then {
gdb_exit
gdb_start
@@ -191,6 +178,22 @@ gdb_test "document" "Argument required .name of command to define.*" "document"
gdb_test "down" "No stack.*" "down"
#test down-silently
gdb_test "down-silently" "No stack." "down-silently"
+# test dump
+gdb_test "dump" "\"dump\" must be followed by a subcommand\.\[\r\n\]+List of dump subcommands:.*"
+gdb_test "dump binary" "\"dump binary\" must be followed by a subcommand\.\[\r\n\]+List of dump binary subcommands:.*"
+gdb_test "dump ihex" "\"dump ihex\" must be followed by a subcommand\.\[\r\n\]+List of dump ihex subcommands:.*"
+gdb_test "dump memory" "Missing filename\."
+gdb_test "dump srec" "\"dump srec\" must be followed by a subcommand\.\[\r\n\]+List of dump srec subcommands:.*"
+gdb_test "dump tekhex" "\"dump tekhex\" must be followed by a subcommand\.\[\r\n\]+List of dump tekhex subcommands:.*"
+gdb_test "dump value" "Missing filename\."
+gdb_test "dump binary memory" "Missing filename\."
+gdb_test "dump binary value" "Missing filename\."
+gdb_test "dump ihex memory" "Missing filename\."
+gdb_test "dump ihex value" "Missing filename\."
+gdb_test "dump srec memory" "Missing filename\."
+gdb_test "dump srec value" "Missing filename\."
+gdb_test "dump tekhex memory" "Missing filename\."
+gdb_test "dump tekhex value" "Missing filename\."
#test echo
gdb_test "echo" "" "echo"
#test enable breakpoints delete
@@ -226,13 +229,10 @@ gdb_expect {
}
#test frame "f" abbreviation
-# OBSOLETE setup_xfail "a29k-*-udi"
gdb_test "f" "No stack." "frame \"f\" abbreviation"
#test frame
-# OBSOLETE setup_xfail "a29k-*-udi"
gdb_test "frame" "No stack." "frame"
#test fg
-# OBSOLETE setup_xfail "a29k-*-udi"
gdb_test "fg" "The program is not being run." "fg"
# FIXME: fg kills the udi connection
#test file
@@ -253,12 +253,32 @@ gdb_expect {
}
#test finish
-# OBSOLETE setup_xfail "a29k-*-udi"
gdb_test "finish" "The program is not running." "finish"
#test forward-search
# The message here comes from the regexp library, not gdb, and so can
# vary on different systems.
gdb_test "forward-search" "No previous regular expression.*|There is no previous regular expression.*" "forward-search"
+#test gcore
+send_gdb "gcore\n"
+gdb_expect {
+ -re "You can\'t do that without a process to debug.*$gdb_prompt $" {
+ pass "gcore"
+ }
+ -re "Undefined command: .*$gdb_prompt $" {
+ pass "gcore"
+ }
+ default { fail "gcore" }
+}
+send_gdb "generate-core-file\n"
+gdb_expect {
+ -re "You can\'t do that without a process to debug.*$gdb_prompt $" {
+ pass "generate-core-file"
+ }
+ -re "Undefined command: .*$gdb_prompt $" {
+ pass "generate-core-file"
+ }
+ default { fail "generate-core-file" }
+}
#test help "h" abbreviation
gdb_test "h" "List of classes of commands:(\[^\r\n\]*\[\r\n\])+aliases -- Aliases of other commands(\[^\r\n\]*\[\r\n\])+breakpoints -- Making program stop at certain points(\[^\r\n\]*\[\r\n\])+data -- Examining data(\[^\r\n\]*\[\r\n\])+files -- Specifying and examining files(\[^\r\n\]*\[\r\n\])+obscure -- Obscure features(\[^\r\n\]*\[\r\n\])+running -- Running the program(\[^\r\n\]*\[\r\n\])+stack -- Examining the stack(\[^\r\n\]*\[\r\n\])+status -- Status inquiries(\[^\r\n\]*\[\r\n\])+support -- Support facilities(\[^\r\n\]*\[\r\n\])+user-defined -- User-defined commands(\[^\r\n\]*\[\r\n\])+Type \"help\" followed by a class name for a list of commands in that class.(\[^\r\n\]*\[\r\n\])+Type \"help\" followed by command name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "help \"h\" abbreviation"
#test help
@@ -274,7 +294,6 @@ gdb_test "ignore" "Argument required .a breakpoint number.*" "ignore"
#test info address
gdb_test "info address" "Argument required." "info address"
#test info all-registers
-# OBSOLETE setup_xfail "a29k-*-udi"
gdb_test "info all-registers" "The program has no registers now." "info all-registers"
#test info args
gdb_test "info args" "No frame selected." "info args"
@@ -303,6 +322,8 @@ gdb_test "info files" "" "info files"
#test info float
if [istarget "arm*-*-*"] then {
gdb_test "info float" "Software FPU type.*mask:.*flags:.*" "info float"
+} elseif [istarget "xscale*-*-*"] then {
+ gdb_test "info float" "Software FPU type.*mask:.*flags:.*" "info float"
} elseif [istarget "thumb*-*-*"] then {
gdb_test "info float" "Software FPU type.*mask:.*flags:.*" "info float"
} elseif [istarget "strongarm*-*-*"] then {
@@ -317,16 +338,12 @@ gdb_test "info functions" "All defined functions:" "info functions"
#test info locals
gdb_test "info locals" "No frame selected." "info locals"
#test info program
-# OBSOLETE setup_xfail "a29k-*-udi"
gdb_test "info program" "The program being debugged is not being run." "info program"
#test info registers
-# OBSOLETE setup_xfail "a29k-*-udi"
gdb_test "info registers" "The program has no registers now." "info registers"
#test info stack "s" abbreviation
-# OBSOLETE setup_xfail "a29k-*-udi"
gdb_test "info s" "No stack." "info stack \"s\" abbreviation"
#test info stack
-# OBSOLETE setup_xfail "a29k-*-udi"
gdb_test "info stack" "No stack." "info stack"
#test info set
# FIXME -- needs to match the entire output
@@ -353,7 +370,6 @@ gdb_test "info watchpoints" "No breakpoints or watchpoints." "info watchpoints"
#test inspect
gdb_test "inspect" "The history is empty." "inspect"
#test jump
-# OBSOLETE setup_xfail "a29k-*-udi"
gdb_test "jump" "The program is not being run." "jump"
#test kill
gdb_test "kill" "The program is not being run." "kill"
@@ -367,16 +383,12 @@ gdb_test "list" "No symbol table is loaded. Use the \"file\" command.*" "list"
# to deduce the filename from the exec file.
gdb_test "load" "You can't do that when your target is `None'.*|The load command takes a file name.*|Must specify at least a file name with the load command.*|.*Use the .file. or .exec-file. command.*" "load"
#test next "n" abbreviation
-# OBSOLETE setup_xfail "a29k-*-udi"
gdb_test "n" "The program is not being run." "next \"n\" abbreviation"
#test next
-# OBSOLETE setup_xfail "a29k-*-udi"
gdb_test "next" "The program is not being run." "next"
#test nexti "ni" abbreviation
-# OBSOLETE setup_xfail "a29k-*-udi"
gdb_test "ni" "The program is not being run." "nexti \"ni\" abbreviation"
#test nexti
-# OBSOLETE setup_xfail "a29k-*-udi"
gdb_test "nexti" "The program is not being run." "nexti"
#test output
gdb_test "output" "Argument required .expression to compute.*" "output"
@@ -470,8 +482,11 @@ No program loaded.*$gdb_prompt $"\
#test rbreak
gdb_test "rbreak" "" "rbreak"
+# test restore
+gdb_test "restore" "You can't do that without a process to debug\."
+
#test return
-# The middle case accomodated the OBSOLETE a29k, where doing the "ni"
+# The middle case accomodated the obsolete a29k, where doing the "ni"
# above causes an initial stack to be created.
gdb_test "return" "No selected frame..*" "return" "Make .* return now.*y or n. $" "y"
@@ -479,10 +494,8 @@ gdb_test "return" "No selected frame..*" "return" "Make .* return now.*y or n.
#test reverse-search
gdb_test "reverse-search" "No previous regular expression.*|There is no previous regular expression.*" "reverse-search"
#test step "s" abbreviation
-# OBSOLETE setup_xfail "a29k-*-udi"
gdb_test "s" "The program is not being run." "step \"s\" abbreviation #1"
#test step
-# OBSOLETE setup_xfail "a29k-*-udi"
gdb_test "step" "The program is not being run." "step #1"
#test search
gdb_test "search" "No previous regular expression.*|There is no previous regular expression.*" "search"
@@ -667,21 +680,16 @@ gdb_test "show write" "Writing into executable and core files is o.*" "show writ
#test show
gdb_test "show" "confirm: *Whether to confirm potentially dangerous operations is on.(\[^\r\n\]*\[\r\n\])+history filename: *The filename in which to record the command history is (\[^\r\n\]*\[\r\n\])+history save: *Saving of the history record on exit is on.(\[^\r\n\]*\[\r\n\])+history size: *The size of the command history is(\[^\r\n\]*\[\r\n\])+listsize: *Number of source lines gdb will list by default is 10(\[^\r\n]*\[\r\n\])+print elements: *Limit on string chars or array elements to print is 200..*" "show"
#test stepi "si" abbreviation
-# OBSOLETE setup_xfail "a29k-*-udi"
gdb_test "si" "The program is not being run." "stepi \"si\" abbreviation"
#test stepi
-# OBSOLETE setup_xfail "a29k-*-udi"
gdb_test "stepi" "The program is not being run." "stepi"
#test signal
-# OBSOLETE setup_xfail "a29k-*-udi"
gdb_test "signal" "The program is not being run." "signal"
#test source
gdb_test "source" "source command requires pathname of file to source..*|No such file or directory.*" "source"
#test step "s" abbreviation
-# OBSOLETE setup_xfail "a29k-*-udi"
gdb_test "s" "The program is not being run." "step \"s\" abbreviation #2"
#test step
-# OBSOLETE setup_xfail "a29k-*-udi"
gdb_test "step" "The program is not being run." "step #2"
#test symbol-file
gdb_test "symbol-file" "" "symbol-file"
@@ -752,10 +760,8 @@ gdb_test "tbreak" "No default breakpoint address now." "tbreak"
#test tty
gdb_test "tty" "Argument required .terminal name for running target process.*" "tty"
#test until "u" abbreviation
-# OBSOLETE setup_xfail "a29k-*-udi"
gdb_test "u" "The program is not running." "until \"u\" abbreviation"
#test until
-# OBSOLETE setup_xfail "a29k-*-udi"
gdb_test "until" "The program is not running." "until"
#test undisplay
# FIXME -- need to dump full output to detailed log
@@ -798,7 +804,6 @@ gdb_test "watch" "Argument required .expression to compute.*" "watch"
#test whatis
gdb_test "whatis" "The history is empty." "whatis"
#test where
-# OBSOLETE setup_xfail "a29k-*-udi"
gdb_test "where" "No stack." "where"
#test x
#The case in which it prints a number is for vxgdb.
diff --git a/gdb/testsuite/gdb.base/dump.c b/gdb/testsuite/gdb.base/dump.c
new file mode 100644
index 0000000..784edf6
--- /dev/null
+++ b/gdb/testsuite/gdb.base/dump.c
@@ -0,0 +1,44 @@
+#define ARRSIZE 32
+int intarray[ARRSIZE], intarray2[ARRSIZE];
+
+struct teststruct {
+ int a;
+ int b;
+ int c;
+ int d;
+ int e;
+ int f;
+ int g;
+} intstruct, intstruct2;
+
+void checkpoint1 ()
+{
+ /* intarray and teststruct have been initialized. */
+}
+
+void
+zero_all ()
+{
+ memset ((char *) &intarray, 0, sizeof (intarray));
+ memset ((char *) &intarray2, 0, sizeof (intarray2));
+ memset ((char *) &intstruct, 0, sizeof (intstruct));
+ memset ((char *) &intstruct2, 0, sizeof (intstruct2));
+}
+
+main()
+{
+ int i;
+
+ for (i = 0; i < ARRSIZE; i++)
+ intarray[i] = i+1;
+
+ intstruct.a = 12 * 1;
+ intstruct.b = 12 * 2;
+ intstruct.c = 12 * 3;
+ intstruct.d = 12 * 4;
+ intstruct.e = 12 * 5;
+ intstruct.f = 12 * 6;
+ intstruct.g = 12 * 7;
+
+ checkpoint1 ();
+}
diff --git a/gdb/testsuite/gdb.base/dump.exp b/gdb/testsuite/gdb.base/dump.exp
new file mode 100644
index 0000000..826fdfb
--- /dev/null
+++ b/gdb/testsuite/gdb.base/dump.exp
@@ -0,0 +1,442 @@
+
+# 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
+
+# This file was written by Michael Snyder (msnyder@redhat.com)
+# This is a test for the gdb command "dump".
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile "dump"
+
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+# Clean up any stale output files from previous test runs
+
+remote_exec build "rm -f intarr1.bin intarr1b.bin intarr1.ihex intarr1.srec intarr1.tekhex intarr2.bin intarr2b.bin intarr2.ihex intarr2.srec intarr2.tekhex intstr1.bin intstr1b.bin intstr1.ihex intstr1.srec intstr1.tekhex intstr2.bin intstr2b.bin intstr2.ihex intstr2.srec intstr2.tekhex intarr3.srec"
+
+# Test help (FIXME:)
+
+# Run target program until data structs are initialized.
+
+if { ! [ runto checkpoint1 ] } then {
+ gdb_suppress_entire_file "Program failed to run, so all tests in this file will automatically fail."
+}
+
+# Now generate some dump files.
+
+proc make_dump_file { command msg } {
+ global gdb_prompt
+
+ send_gdb "${command}\n"
+ gdb_expect {
+ -re ".*\[Ee\]rror.*$gdb_prompt $" { fail $msg }
+ -re ".*\[Ww\]arning.*$gdb_prompt $" { fail $msg }
+ -re ".*\[Uu\]ndefined .*$gdb_prompt $" { fail $msg }
+ -re ".*$gdb_prompt $" { pass $msg }
+ timeout { fail "$msg (timeout)" }
+ }
+}
+
+make_dump_file "dump val intarr1.bin intarray" \
+ "dump array as value, default"
+
+make_dump_file "dump val intstr1.bin intstruct" \
+ "dump struct as value, default"
+
+make_dump_file "dump bin val intarr1b.bin intarray" \
+ "dump array as value, binary"
+
+make_dump_file "dump bin val intstr1b.bin intstruct" \
+ "dump struct as value, binary"
+
+make_dump_file "dump srec val intarr1.srec intarray" \
+ "dump array as value, srec"
+
+make_dump_file "dump srec val intstr1.srec intstruct" \
+ "dump struct as value, srec"
+
+make_dump_file "dump ihex val intarr1.ihex intarray" \
+ "dump array as value, intel hex"
+
+make_dump_file "dump ihex val intstr1.ihex intstruct" \
+ "dump struct as value, intel hex"
+
+make_dump_file "dump tekhex val intarr1.tekhex intarray" \
+ "dump array as value, tekhex"
+
+make_dump_file "dump tekhex val intstr1.tekhex intstruct" \
+ "dump struct as value, tekhex"
+
+proc capture_value { expression } {
+ global gdb_prompt
+ global expect_out
+
+ set output_string ""
+ send_gdb "print ${expression}\n"
+ gdb_expect {
+ -re ".*\[\r\n\]+.\[0123456789\]+ = (\[^\r\n\]+).*$gdb_prompt $" {
+ set output_string $expect_out(1,string)
+ }
+ default {
+ fail "capture_value failed on $expression."
+ }
+ }
+ return $output_string
+}
+
+set array_start [capture_value "/x &intarray\[0\]"]
+set array_end [capture_value "/x &intarray\[32\]"]
+set struct_start [capture_value "/x &intstruct"]
+set struct_end [capture_value "/x &intstruct + 1"]
+
+set array_val [capture_value "intarray"]
+set struct_val [capture_value "intstruct"]
+
+make_dump_file "dump mem intarr2.bin $array_start $array_end" \
+ "dump array as memory, default"
+
+make_dump_file "dump mem intstr2.bin $struct_start $struct_end" \
+ "dump struct as memory, default"
+
+make_dump_file "dump bin mem intarr2b.bin $array_start $array_end" \
+ "dump array as memory, binary"
+
+make_dump_file "dump bin mem intstr2b.bin $struct_start $struct_end" \
+ "dump struct as memory, binary"
+
+make_dump_file "dump srec mem intarr2.srec $array_start $array_end" \
+ "dump array as memory, srec"
+
+make_dump_file "dump srec mem intstr2.srec $struct_start $struct_end" \
+ "dump struct as memory, srec"
+
+make_dump_file "dump ihex mem intarr2.ihex $array_start $array_end" \
+ "dump array as memory, ihex"
+
+make_dump_file "dump ihex mem intstr2.ihex $struct_start $struct_end" \
+ "dump struct as memory, ihex"
+
+make_dump_file "dump tekhex mem intarr2.tekhex $array_start $array_end" \
+ "dump array as memory, tekhex"
+
+make_dump_file "dump tekhex mem intstr2.tekhex $struct_start $struct_end" \
+ "dump struct as memory, tekhex"
+
+# test complex expressions
+make_dump_file \
+ "dump srec mem intarr3.srec &intarray \(char *\) &intarray + sizeof intarray" \
+ "dump array as mem, srec, expressions"
+
+
+# Now start a fresh gdb session, and reload the saved value files.
+
+gdb_exit
+gdb_start
+gdb_file_cmd ${binfile}
+
+# Reload saved values one by one, and compare.
+
+if { ![string compare $array_val [capture_value "intarray"]] } then {
+ fail "start with intarray un-initialized"
+} else {
+ pass "start with intarray un-initialized"
+}
+
+if { ![string compare $struct_val [capture_value "intstruct"]] } then {
+ fail "start with intstruct un-initialized"
+} else {
+ pass "start with intstruct un-initialized"
+}
+
+proc test_reload_saved_value { filename msg oldval newval } {
+ global gdb_prompt
+
+ gdb_file_cmd $filename
+ if { ![string compare $oldval [capture_value $newval]] } then {
+ pass $msg
+ } else {
+ fail $msg
+ }
+}
+
+proc test_restore_saved_value { restore_args msg oldval newval } {
+ global gdb_prompt
+
+ gdb_test "restore $restore_args" \
+ "Restoring .*" \
+ "Restore command, $msg"
+
+ if { ![string compare $oldval [capture_value $newval]] } then {
+ pass "Restored value, $msg"
+ } else {
+ fail "Restored value, $msg"
+ }
+}
+
+test_reload_saved_value "intarr1.srec" "reload array as value, srec" \
+ $array_val "intarray"
+test_reload_saved_value "intstr1.srec" "reload struct as value, srec" \
+ $struct_val "intstruct"
+test_reload_saved_value "intarr2.srec" "reload array as memory, srec" \
+ $array_val "intarray"
+test_reload_saved_value "intstr2.srec" "reload struct as memory, srec" \
+ $struct_val "intstruct"
+
+test_reload_saved_value "intarr1.ihex" "reload array as value, intel hex" \
+ $array_val "intarray"
+test_reload_saved_value "intstr1.ihex" "reload struct as value, intel hex" \
+ $struct_val "intstruct"
+test_reload_saved_value "intarr2.ihex" "reload array as memory, intel hex" \
+ $array_val "intarray"
+test_reload_saved_value "intstr2.ihex" "reload struct as memory, intel hex" \
+ $struct_val "intstruct"
+
+test_reload_saved_value "intarr1.tekhex" "reload array as value, tekhex" \
+ $array_val "intarray"
+test_reload_saved_value "intstr1.tekhex" "reload struct as value, tekhex" \
+ $struct_val "intstruct"
+test_reload_saved_value "intarr2.tekhex" "reload array as memory, tekhex" \
+ $array_val "intarray"
+test_reload_saved_value "intstr2.tekhex" "reload struct as memory, tekhex" \
+ $struct_val "intstruct"
+
+# Start a fresh gdb session
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+# Run to main.
+if { ! [ runto main ] } then {
+ gdb_suppress_entire_file "Program failed to run, so remaining tests in this file will automatically fail."
+}
+
+if { ![string compare $array_val [capture_value "intarray"]] } then {
+ fail "start with intarray un-initialized, runto main"
+} else {
+ pass "start with intarray un-initialized, runto main"
+}
+
+if { ![string compare $struct_val [capture_value "intstruct"]] } then {
+ fail "start with intstruct un-initialized, runto main"
+} else {
+ pass "start with intstruct un-initialized, runto main"
+}
+
+test_restore_saved_value "intarr1.srec" "array as value, srec" \
+ $array_val "intarray"
+
+test_restore_saved_value "intstr1.srec" "struct as value, srec" \
+ $struct_val "intstruct"
+
+gdb_test "print zero_all ()" "void" "zero all"
+
+test_restore_saved_value "intarr2.srec" "array as memory, srec" \
+ $array_val "intarray"
+
+test_restore_saved_value "intstr2.srec" "struct as memory, srec" \
+ $struct_val "intstruct"
+
+gdb_test "print zero_all ()" ""
+
+test_restore_saved_value "intarr1.ihex" "array as value, ihex" \
+ $array_val "intarray"
+
+test_restore_saved_value "intstr1.ihex" "struct as value, ihex" \
+ $struct_val "intstruct"
+
+gdb_test "print zero_all ()" ""
+
+test_restore_saved_value "intarr2.ihex" "array as memory, ihex" \
+ $array_val "intarray"
+
+test_restore_saved_value "intstr2.ihex" "struct as memory, ihex" \
+ $struct_val "intstruct"
+
+gdb_test "print zero_all ()" ""
+
+test_restore_saved_value "intarr1.tekhex" "array as value, tekhex" \
+ $array_val "intarray"
+
+test_restore_saved_value "intstr1.tekhex" "struct as value, tekhex" \
+ $struct_val "intstruct"
+
+gdb_test "print zero_all ()" ""
+
+test_restore_saved_value "intarr2.tekhex" "array as memory, tekhex" \
+ $array_val "intarray"
+
+test_restore_saved_value "intstr2.tekhex" "struct as memory, tekhex" \
+ $struct_val "intstruct"
+
+gdb_test "print zero_all ()" ""
+
+test_restore_saved_value "intarr1.bin binary $array_start" \
+ "array as value, binary" \
+ $array_val "intarray"
+
+test_restore_saved_value "intstr1.bin binary $struct_start" \
+ "struct as value, binary" \
+ $struct_val "intstruct"
+
+gdb_test "print zero_all ()" ""
+
+test_restore_saved_value "intarr2.bin binary $array_start" \
+ "array as memory, binary" \
+ $array_val "intarray"
+
+test_restore_saved_value "intstr2.bin binary $struct_start" \
+ "struct as memory, binary" \
+ $struct_val "intstruct"
+
+# test restore with offset.
+
+set array2_start [capture_value "/x &intarray2\[0\]"]
+set struct2_start [capture_value "/x &intstruct2"]
+set array2_offset \
+ [capture_value "/x (char *) &intarray2 - (char *) &intarray"]
+set struct2_offset \
+ [capture_value "/x (char *) &intstruct2 - (char *) &intstruct"]
+
+gdb_test "print zero_all ()" ""
+
+test_restore_saved_value "intarr1.srec $array2_offset" \
+ "array copy, srec" \
+ $array_val "intarray2"
+
+test_restore_saved_value "intstr1.srec $struct2_offset" \
+ "struct copy, srec" \
+ $struct_val "intstruct2"
+
+gdb_test "print zero_all ()" ""
+
+test_restore_saved_value "intarr1.ihex $array2_offset" \
+ "array copy, ihex" \
+ $array_val "intarray2"
+
+test_restore_saved_value "intstr1.ihex $struct2_offset" \
+ "struct copy, ihex" \
+ $struct_val "intstruct2"
+
+gdb_test "print zero_all ()" ""
+
+test_restore_saved_value "intarr1.tekhex $array2_offset" \
+ "array copy, tekhex" \
+ $array_val "intarray2"
+
+test_restore_saved_value "intstr1.tekhex $struct2_offset" \
+ "struct copy, tekhex" \
+ $struct_val "intstruct2"
+
+gdb_test "print zero_all ()" ""
+
+test_restore_saved_value "intarr1.bin binary $array2_start" \
+ "array copy, binary" \
+ $array_val "intarray2"
+
+test_restore_saved_value "intstr1.bin binary $struct2_start" \
+ "struct copy, binary" \
+ $struct_val "intstruct2"
+
+#
+# test restore with start/stop addresses.
+#
+# For this purpose, we will restore just the third element of the array,
+# and check to see that adjacent elements are not modified.
+#
+# We will need the address and offset of the third and fourth elements.
+#
+
+set element3_start [capture_value "/x &intarray\[3\]"]
+set element4_start [capture_value "/x &intarray\[4\]"]
+set element3_offset \
+ [capture_value "/x (char *) &intarray\[3\] - (char *) &intarray\[0\]"]
+set element4_offset \
+ [capture_value "/x (char *) &intarray\[4\] - (char *) &intarray\[0\]"]
+
+gdb_test "print zero_all ()" ""
+
+test_restore_saved_value "intarr1.srec 0 $element3_start $element4_start" \
+ "array partial, srec" \
+ [capture_value "4"] "intarray\[3\]"
+
+gdb_test "print intarray\[2\] == 0" " = 1" "element 2 not changed - 1"
+gdb_test "print intarray\[4\] == 0" " = 1" "element 4 not changed - 1"
+
+gdb_test "print zero_all ()" ""
+
+test_restore_saved_value "intarr1.ihex 0 $element3_start $element4_start" \
+ "array partial, ihex" \
+ [capture_value "4"] "intarray\[3\]"
+
+gdb_test "print intarray\[2\] == 0" " = 1" "element 2 not changed - 2"
+gdb_test "print intarray\[4\] == 0" " = 1" "element 4 not changed - 2"
+
+gdb_test "print zero_all ()" ""
+
+test_restore_saved_value "intarr1.tekhex 0 $element3_start $element4_start" \
+ "array partial, tekhex" \
+ [capture_value "4"] "intarray\[3\]"
+
+gdb_test "print intarray\[2\] == 0" " = 1" "element 2 not changed - 3"
+gdb_test "print intarray\[4\] == 0" " = 1" "element 4 not changed - 3"
+
+gdb_test "print zero_all ()" ""
+
+test_restore_saved_value \
+ "intarr1.bin binary $array_start $element3_offset $element4_offset" \
+ "array partial, binary" \
+ [capture_value "4"] "intarray\[3\]"
+
+gdb_test "print intarray\[2\] == 0" " = 1" "element 2 not changed - 4"
+gdb_test "print intarray\[4\] == 0" " = 1" "element 4 not changed - 4"
+
+gdb_test "print zero_all ()" "" ""
+
+# restore with expressions
+test_restore_saved_value \
+ "intarr3.srec ${array2_start}-${array_start} &intarray\[3\] &intarray\[4\]" \
+ "array partial with expressions" \
+ [capture_value "4"] "intarray2\[3\]"
+
+gdb_test "print intarray2\[2\] == 0" " = 1" "element 2 not changed, == 4"
+gdb_test "print intarray2\[4\] == 0" " = 1" "element 4 not changed, == 4"
+
+
+# clean up files
+
+remote_exec build "rm -f intarr1.bin intarr1b.bin intarr1.ihex intarr1.srec intarr1.tekhex intarr2.bin intarr2b.bin intarr2.ihex intarr2.srec intarr2.tekhex intstr1.bin intstr1b.bin intstr1.ihex intstr1.srec intstr1.tekhex intstr2.bin intstr2b.bin intstr2.ihex intstr2.srec intstr2.tekhex intarr3.srec"
+
diff --git a/gdb/testsuite/gdb.base/ending-run.exp b/gdb/testsuite/gdb.base/ending-run.exp
index 80f1cc0..df6a708 100644
--- a/gdb/testsuite/gdb.base/ending-run.exp
+++ b/gdb/testsuite/gdb.base/ending-run.exp
@@ -178,6 +178,10 @@ gdb_expect {
# This is what happens on Sanyo XStormy16
pass "step out of main"
}
+ -re ".*init ().*$gdb_prompt $" {
+ # This is what happens on many Mips targets
+ pass "step out of main"
+ }
-re ".*in ..change.mode ().*$gdb_prompt $" {
# This is what happens on ARM in thumb mode -fn 2000-02-01
pass "step out of main on ARM thumb"
diff --git a/gdb/testsuite/gdb.base/foo.c b/gdb/testsuite/gdb.base/foo.c
index ada9cf4..2553607 100644
--- a/gdb/testsuite/gdb.base/foo.c
+++ b/gdb/testsuite/gdb.base/foo.c
@@ -1,4 +1,4 @@
-static int foox __attribute__ ((section (".data00"))) = 'f' + 'o' + 'o';
+static int foox = 'f' + 'o' + 'o';
int foo (int x)
{
diff --git a/gdb/testsuite/gdb.base/funcargs.c b/gdb/testsuite/gdb.base/funcargs.c
index 31c5eec..f7dfc64 100644
--- a/gdb/testsuite/gdb.base/funcargs.c
+++ b/gdb/testsuite/gdb.base/funcargs.c
@@ -747,7 +747,7 @@ int main ()
call2f (f, l, d, c, f, s, d, i);
call2g (l, d, c, f, s, d, i, f);
call2h (d, c, f, s, d, i, f, l);
- call2i (c, f, c, c, d, c, c, c, f, s, c, d);;
+ call2i (c, f, c, c, d, c, c, c, f, s, c, d);
/* Test dereferencing pointers to various integral and floating types */
diff --git a/gdb/testsuite/gdb.base/funcargs.exp b/gdb/testsuite/gdb.base/funcargs.exp
index 3b837bc..2ed154a 100644
--- a/gdb/testsuite/gdb.base/funcargs.exp
+++ b/gdb/testsuite/gdb.base/funcargs.exp
@@ -1,4 +1,4 @@
-# Copyright 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000
+# Copyright 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
@@ -58,9 +58,6 @@ proc integral_args {} {
gdb_breakpoint call0e
# Run; should stop at call0a and print actual arguments.
- # OBSOLETE # The a29k fails all of these tests, perhaps because the prologue
- # OBSOLETE # code is broken.
- # OBSOLETE setup_xfail "a29k-*-udi"
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
gdb_run_cmd
gdb_expect {
@@ -118,9 +115,6 @@ proc unsigned_integral_args {} {
gdb_breakpoint call1e;
# Run; should stop at call1a and print actual arguments.
- # OBSOLETE # The a29k fails all of these tests, perhaps because the prologue
- # OBSOLETE # code is broken.
- # OBSOLETE setup_xfail "a29k-*-udi"
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
gdb_run_cmd
gdb_expect {
@@ -184,9 +178,6 @@ proc float_and_integral_args {} {
# Run; should stop at call2a and print actual arguments.
setup_xfail "i960-*-*" 1813
- # OBSOLETE # The a29k fails all of these tests, perhaps because the prologue
- # OBSOLETE # code is broken.
- # OBSOLETE setup_xfail "a29k-*-udi"
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" "mips-sgi-irix5*" }
# The debug info. for "f" is not correct. It's a known bug.
if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
@@ -285,9 +276,6 @@ proc pointer_args {} {
# Run; should stop at call3a and print actual arguments.
# Try dereferencing the arguments.
- # OBSOLETE # The a29k fails all of these tests, perhaps because the prologue
- # OBSOLETE # code is broken.
- # OBSOLETE setup_xfail "a29k-*-udi"
gdb_run_cmd
gdb_expect {
-re ".* call3a \\(cp=$hex \"a.*\", sp=$hex, ip=$hex, lp=$hex\\) .*$gdb_prompt $" { pass "run to call3a" }
@@ -344,9 +332,6 @@ proc structs_by_reference {} {
# Run; should stop at call4a and print actual arguments.
# Try dereferencing the arguments.
- # OBSOLETE # The a29k fails all of these tests, perhaps because the prologue
- # OBSOLETE # code is broken.
- # OBSOLETE setup_xfail "a29k-*-udi"
gdb_run_cmd
gdb_expect {
-re ".* call4a \\(stp=$hex\\) .*$gdb_prompt $" {
@@ -403,9 +388,6 @@ proc structs_by_value {} {
# Run; should stop at call5a and print actual arguments.
# Try dereferencing the arguments.
- # OBSOLETE # The a29k fails all of these tests, perhaps because the prologue
- # OBSOLETE # code is broken.
- # OBSOLETE setup_xfail "a29k-*-udi"
gdb_run_cmd
gdb_expect {
-re ".* call5a \\(st=\{s1 = 101, s2 = 102\}\\) .*$gdb_prompt $" {
@@ -480,9 +462,6 @@ proc discard_and_shuffle {} {
# Run; should stop at call6a and print actual arguments.
# Print backtrace.
- # OBSOLETE # The a29k fails all of these tests, perhaps because the prologue
- # OBSOLETE # code is broken.
- # OBSOLETE setup_xfail "a29k-*-udi"
gdb_run_cmd
gdb_expect {
-re ".*Breakpoint $decimal, call6a .*$gdb_prompt $" { pass "run to call6a" }
@@ -754,9 +733,6 @@ proc shuffle_round_robin {} {
# Run; should stop at call7a and print actual arguments.
# Print backtrace.
- # OBSOLETE # The a29k fails all of these tests, perhaps because the prologue
- # OBSOLETE # code is broken.
- # OBSOLETE setup_xfail "a29k-*-udi"
gdb_run_cmd
gdb_expect {
-re ".*Breakpoint $decimal, call7a .*$gdb_prompt $" {
@@ -983,9 +959,6 @@ proc recursive_structs_by_value {} {
}
if ![istarget sparclet-*-*] {
- # OBSOLETE # The a29k fails all of these tests, perhaps because the prologue
- # OBSOLETE # code is broken.
- # OBSOLETE setup_xfail "a29k-*-udi"
send_gdb "backtrace 100\n"
gdb_expect_list "recursive passing of structs by value" ".*$gdb_prompt $" {
".*\[\r\n\]#0 .* hitbottom \\(\\) "
diff --git a/gdb/testsuite/gdb.base/gcore.exp b/gdb/testsuite/gdb.base/gcore.exp
index da3ab49..f8d5baa 100644
--- a/gdb/testsuite/gdb.base/gcore.exp
+++ b/gdb/testsuite/gdb.base/gcore.exp
@@ -85,7 +85,7 @@ proc capture_command_output { command prefix } {
gdb_test "break terminal_func" "Breakpoint .* at .*${srcfile}, line .*" \
"set breakpoint at terminal_func"
-gdb_test "continue" "Breakpoint .*, terminal_func.*" \
+gdb_test "continue" "Breakpoint .* terminal_func.*" \
"continue to terminal_func"
set print_prefix ".\[0123456789\]* = "
diff --git a/gdb/testsuite/gdb.base/grbx.c b/gdb/testsuite/gdb.base/grbx.c
index 92f7323..58034bb 100644
--- a/gdb/testsuite/gdb.base/grbx.c
+++ b/gdb/testsuite/gdb.base/grbx.c
@@ -1,4 +1,4 @@
-static int grbxx __attribute__ ((section (".data03"))) = 'g' + 'r' + 'b' + 'x';
+static int grbxx = 'g' + 'r' + 'b' + 'x';
int grbx (int x)
{
diff --git a/gdb/testsuite/gdb.base/help.exp b/gdb/testsuite/gdb.base/help.exp
index a09f8da..4b3d2ee 100644
--- a/gdb/testsuite/gdb.base/help.exp
+++ b/gdb/testsuite/gdb.base/help.exp
@@ -1,5 +1,5 @@
# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000
+# 2000, 2002
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
@@ -35,512 +35,560 @@ gdb_test "set height 400" "" "test set height"
# use a larger expect input buffer for long help outputs.
# test help add-symbol-file
-gdb_test "help add-symbol-file" "Usage: add-symbol-file FILE ADDR .-s <SECT> <SECT_ADDR> -s <SECT> <SECT_ADDR> ....*\[\r\n\]+Load the symbols from FILE, assuming FILE has been dynamically loaded..*\[\r\n\]+ADDR is the starting address of the file's text..*\[\r\n\]+The optional arguments are section-name section-address pairs and.*\[\r\n\]+should be specified if the data and bss segments are not contiguous.*\[\r\n\]+with the text. SECT is a section name to be loaded at SECT_ADDR." "help add-symbol-file"
+gdb_test "help add-symbol-file" "Usage: add-symbol-file FILE ADDR \\\[-s <SECT> <SECT_ADDR> -s <SECT> <SECT_ADDR> \.\.\.\\\]\[\r\n\]+Load the symbols from FILE, assuming FILE has been dynamically loaded\.\[\r\n\]+ADDR is the starting address of the file's text\.\[\r\n\]+The optional arguments are section-name section-address pairs and\[\r\n\]+should be specified if the data and bss segments are not contiguous\[\r\n\]+with the text\. SECT is a section name to be loaded at SECT_ADDR\." "help add-symbol-file"
# test help aliases
-gdb_test "help aliases" "Aliases of other commands..*\[\r\n\]+List of commands\:.*\[\r\n\]+Type \"help\" followed by command name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help aliases"
-gdb_test "help attach" "Attach to a process or file outside of GDB..*\[\r\n\]+This command attaches to another target, of the same type as your last.*\[\r\n\]+\"target\" command .\"info files\" will show your target stack.*\[\r\n\]+The command may take as argument a process id or a device file..*\[\r\n\]+For a process id, you must have permission to send the process a signal,.*\[\r\n\]+and it must have the same effective uid as the debugger..*\[\r\n\]+When using \"attach\" with a process id, the debugger finds the.*\[\r\n\]+program running in the process, looking first in the current working.*\[\r\n\]+directory, or .if not found there. using the source file search path.*\[\r\n\]+\\(see the \"directory\" command\\). You can also use the \"file\" command.*\[\r\n\]+to specify the program, and to load its symbol table." "help attach"
+gdb_test "help aliases" "Aliases of other commands\.\[\r\n\]+List of commands\:.*\[\r\n\]+Type \"help\" followed by command name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help aliases"
+# test help append
+gdb_test "help append" "Append target code/data to a local file\.\[\r\n\]+List of append subcommands:.*"
+gdb_test "help append binary" "Append target code/data to a raw binary file\.\[\r\n\]+List of append binary subcommands:.*"
+gdb_test "help append memory" "Append contents of memory to a raw binary file\.\[\r\n\]+Arguments are FILE START STOP\. Writes the contents of memory within the\[\r\n\]+range \\\[START \.\. STOP\\) to the specifed FILE in raw target ordered bytes\."
+gdb_test "help append value" "Append the value of an expression to a raw binary file\.\[\r\n\]+Arguments are FILE EXPRESSION\. Writes the value of EXPRESSION to\[\r\n\]+the specified FILE in raw target ordered bytes\."
+gdb_test "help append binary memory" "Append contents of memory to a raw binary file\.\[\r\n\]+Arguments are FILE START STOP\. Writes the contents of memory within the\[\r\n\]+range \\\[START \.\. STOP\\) to the specifed FILE in raw target ordered bytes\."
+gdb_test "help append binary value" "Append the value of an expression to a raw binary file\.\[\r\n\]+Arguments are FILE EXPRESSION\. Writes the value of EXPRESSION\[\r\n\]+to the specified FILE in raw target ordered bytes\."
+# test help attach
+gdb_test "help attach" "Attach to a process or file outside of GDB\.\[\r\n\]+This command attaches to another target, of the same type as your last\[\r\n\]+\"target\" command \\(\"info files\" will show your target stack\\)\.\[\r\n\]+The command may take as argument a process id or a device file\.\[\r\n\]+For a process id, you must have permission to send the process a signal,\[\r\n\]+and it must have the same effective uid as the debugger\.\[\r\n\]+When using \"attach\" with a process id, the debugger finds the\[\r\n\]+program running in the process, looking first in the current working\[\r\n\]+directory, or \\(if not found there\\) using the source file search path\[\r\n\]+\\(see the \"directory\" command\\)\. You can also use the \"file\" command\[\r\n\]+to specify the program, and to load its symbol table\." "help attach"
# test help breakpoint "b" abbreviation
-gdb_test "help b" "Set breakpoint at specified line or function..*\[\r\n\]+Argument may be line number, function name, or \"\[*\]\" and an address..*\[\r\n\]+If line number is specified, break at start of code for that line..*\[\r\n\]+If function is specified, break at start of code for that function..*\[\r\n\]+If an address is specified, break at that exact address..*\[\r\n\]+With no arg, uses current execution address of selected stack frame..*\[\r\n\]+This is useful for breaking on return to a stack frame..*\[\r\n\]+Multiple breakpoints at one place are permitted, and useful if conditional..*\[\r\n\]+Do \"help breakpoints\" for info on other commands dealing with breakpoints." "help breakpoint \"b\" abbreviation"
+gdb_test "help b" "Set breakpoint at specified line or function\.\[\r\n\]+Argument may be line number, function name, or \"\[*\]\" and an address\.\[\r\n\]+If line number is specified, break at start of code for that line\.\[\r\n\]+If function is specified, break at start of code for that function\.\[\r\n\]+If an address is specified, break at that exact address\.\[\r\n\]+With no arg, uses current execution address of selected stack frame\.\[\r\n\]+This is useful for breaking on return to a stack frame\.\[\r\n\]+Multiple breakpoints at one place are permitted, and useful if conditional\.\[\r\n\]+Do \"help breakpoints\" for info on other commands dealing with breakpoints\." "help breakpoint \"b\" abbreviation"
# test help breakpoint "br" abbreviation
-gdb_test "help br" "Set breakpoint at specified line or function..*\[\r\n\]+Argument may be line number, function name, or \"\[*\]\" and an address..*\[\r\n\]+If line number is specified, break at start of code for that line..*\[\r\n\]+If function is specified, break at start of code for that function..*\[\r\n\]+If an address is specified, break at that exact address..*\[\r\n\]+With no arg, uses current execution address of selected stack frame..*\[\r\n\]+This is useful for breaking on return to a stack frame..*\[\r\n\]+Multiple breakpoints at one place are permitted, and useful if conditional..*\[\r\n\]+Do \"help breakpoints\" for info on other commands dealing with breakpoints." "help breakpoint \"br\" abbreviation"
+gdb_test "help br" "Set breakpoint at specified line or function\.\[\r\n\]+Argument may be line number, function name, or \"\[*\]\" and an address\.\[\r\n\]+If line number is specified, break at start of code for that line\.\[\r\n\]+If function is specified, break at start of code for that function\.\[\r\n\]+If an address is specified, break at that exact address\.\[\r\n\]+With no arg, uses current execution address of selected stack frame\.\[\r\n\]+This is useful for breaking on return to a stack frame\.\[\r\n\]+Multiple breakpoints at one place are permitted, and useful if conditional\.\[\r\n\]+Do \"help breakpoints\" for info on other commands dealing with breakpoints\." "help breakpoint \"br\" abbreviation"
# test help breakpoint "bre" abbreviation
-gdb_test "help bre" "Set breakpoint at specified line or function..*\[\r\n\]+Argument may be line number, function name, or \"\[*\]\" and an address..*\[\r\n\]+If line number is specified, break at start of code for that line..*\[\r\n\]+If function is specified, break at start of code for that function..*\[\r\n\]+If an address is specified, break at that exact address..*\[\r\n\]+With no arg, uses current execution address of selected stack frame..*\[\r\n\]+This is useful for breaking on return to a stack frame..*\[\r\n\]+Multiple breakpoints at one place are permitted, and useful if conditional..*\[\r\n\]+Do \"help breakpoints\" for info on other commands dealing with breakpoints." "help breakpoint \"bre\" abbreviation"
+gdb_test "help bre" "Set breakpoint at specified line or function\.\[\r\n\]+Argument may be line number, function name, or \"\[*\]\" and an address\.\[\r\n\]+If line number is specified, break at start of code for that line\.\[\r\n\]+If function is specified, break at start of code for that function\.\[\r\n\]+If an address is specified, break at that exact address\.\[\r\n\]+With no arg, uses current execution address of selected stack frame\.\[\r\n\]+This is useful for breaking on return to a stack frame\.\[\r\n\]+Multiple breakpoints at one place are permitted, and useful if conditional\.\[\r\n\]+Do \"help breakpoints\" for info on other commands dealing with breakpoints\." "help breakpoint \"bre\" abbreviation"
# test help breakpoint "brea" abbreviation
-gdb_test "help brea" "Set breakpoint at specified line or function..*\[\r\n\]+Argument may be line number, function name, or \"\[*\]\" and an address..*\[\r\n\]+If line number is specified, break at start of code for that line..*\[\r\n\]+If function is specified, break at start of code for that function..*\[\r\n\]+If an address is specified, break at that exact address..*\[\r\n\]+With no arg, uses current execution address of selected stack frame..*\[\r\n\]+This is useful for breaking on return to a stack frame..*\[\r\n\]+Multiple breakpoints at one place are permitted, and useful if conditional..*\[\r\n\]+Do \"help breakpoints\" for info on other commands dealing with breakpoints." "help breakpoint \"brea\" abbreviation"
+gdb_test "help brea" "Set breakpoint at specified line or function\.\[\r\n\]+Argument may be line number, function name, or \"\[*\]\" and an address\.\[\r\n\]+If line number is specified, break at start of code for that line\.\[\r\n\]+If function is specified, break at start of code for that function\.\[\r\n\]+If an address is specified, break at that exact address\.\[\r\n\]+With no arg, uses current execution address of selected stack frame\.\[\r\n\]+This is useful for breaking on return to a stack frame\.\[\r\n\]+Multiple breakpoints at one place are permitted, and useful if conditional\.\[\r\n\]+Do \"help breakpoints\" for info on other commands dealing with breakpoints\." "help breakpoint \"brea\" abbreviation"
# test help breakpoint "break" abbreviation
-gdb_test "help break" "Set breakpoint at specified line or function..*\[\r\n\]+Argument may be line number, function name, or \"\[*\]\" and an address..*\[\r\n\]+If line number is specified, break at start of code for that line..*\[\r\n\]+If function is specified, break at start of code for that function..*\[\r\n\]+If an address is specified, break at that exact address..*\[\r\n\]+With no arg, uses current execution address of selected stack frame..*\[\r\n\]+This is useful for breaking on return to a stack frame..*\[\r\n\]+Multiple breakpoints at one place are permitted, and useful if conditional..*\[\r\n\]+Do \"help breakpoints\" for info on other commands dealing with breakpoints." "help breakpoint \"break\" abbreviation"
+gdb_test "help break" "Set breakpoint at specified line or function\.\[\r\n\]+Argument may be line number, function name, or \"\[*\]\" and an address\.\[\r\n\]+If line number is specified, break at start of code for that line\.\[\r\n\]+If function is specified, break at start of code for that function\.\[\r\n\]+If an address is specified, break at that exact address\.\[\r\n\]+With no arg, uses current execution address of selected stack frame\.\[\r\n\]+This is useful for breaking on return to a stack frame\.\[\r\n\]+Multiple breakpoints at one place are permitted, and useful if conditional\.\[\r\n\]+Do \"help breakpoints\" for info on other commands dealing with breakpoints\." "help breakpoint \"break\" abbreviation"
# test help breakpoints
-gdb_test "help breakpoints" "Making program stop at certain points..*\[\r\n\]+List of commands\:.*\[\r\n\]+awatch -- Set a watchpoint for an expression.*\[\r\n\]+break -- Set breakpoint at specified line or function.*\[\r\n\]+catch -- Set catchpoints to catch events.*\[\r\n\]+clear -- Clear breakpoint at specified line or function.*\[\r\n\]+commands -- Set commands to be executed when a breakpoint is hit.*\[\r\n\]+condition -- Specify breakpoint number N to break only if COND is true.*\[\r\n\]+delete -- Delete some breakpoints or auto-display expressions.*\[\r\n\]+disable -- Disable some breakpoints.*\[\r\n\]+enable -- Enable some breakpoints.*\[\r\n\]+hbreak -- Set a hardware assisted breakpoint.*\[\r\n\]+ignore -- Set ignore-count of breakpoint number N to COUNT.*\[\r\n\]+rwatch -- Set a read watchpoint for an expression.*\[\r\n\]+tbreak -- Set a temporary breakpoint.*\[\r\n\]+tcatch -- Set temporary catchpoints to catch events.*\[\r\n\]+thbreak -- Set a temporary hardware assisted breakpoint.*\[\r\n\]+watch -- Set a watchpoint for an expression.*\[\r\n\]+Type \"help\" followed by command name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help breakpoints"
+gdb_test "help breakpoints" "Making program stop at certain points\.\[\r\n\]+List of commands:\[\r\n\]+awatch -- Set a watchpoint for an expression\[\r\n\]+break -- Set breakpoint at specified line or function\[\r\n\]+catch -- Set catchpoints to catch events\[\r\n\]+clear -- Clear breakpoint at specified line or function\[\r\n\]+commands -- Set commands to be executed when a breakpoint is hit\[\r\n\]+condition -- Specify breakpoint number N to break only if COND is true\[\r\n\]+delete -- Delete some breakpoints or auto-display expressions\[\r\n\]+disable -- Disable some breakpoints\[\r\n\]+enable -- Enable some breakpoints\[\r\n\]+hbreak -- Set a hardware assisted breakpoint\[\r\n\]+ignore -- Set ignore-count of breakpoint number N to COUNT\[\r\n\]+rbreak -- Set a breakpoint for all functions matching REGEXP\[\r\n\]+rwatch -- Set a read watchpoint for an expression\[\r\n\]+tbreak -- Set a temporary breakpoint\[\r\n\]+tcatch -- Set temporary catchpoints to catch events\[\r\n\]+thbreak -- Set a temporary hardware assisted breakpoint\[\r\n\]+watch -- Set a watchpoint for an expression\[\r\n\]+Type \"help\" followed by command name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help breakpoints"
# test help backtrace "bt" abbreviation
-gdb_test "help bt" "Print backtrace of all stack frames, or innermost COUNT frames..*\[\r\n\]+With a negative argument, print outermost -COUNT frames..*\[\r\n\]+Use of the 'full' qualifier also prints the values of the local variables." "help backtrace \"bt\" abbreviation"
+gdb_test "help bt" "Print backtrace of all stack frames, or innermost COUNT frames\.\[\r\n\]+With a negative argument, print outermost -COUNT frames\.\[\r\n\]+Use of the 'full' qualifier also prints the values of the local variables\." "help backtrace \"bt\" abbreviation"
# test help backtrace
-gdb_test "help backtrace" "Print backtrace of all stack frames, or innermost COUNT frames..*\[\r\n\]+With a negative argument, print outermost -COUNT frames..*\[\r\n\]+Use of the 'full' qualifier also prints the values of the local variables." "help backtrace"
+gdb_test "help backtrace" "Print backtrace of all stack frames, or innermost COUNT frames\.\[\r\n\]+With a negative argument, print outermost -COUNT frames\.\[\r\n\]+Use of the 'full' qualifier also prints the values of the local variables\." "help backtrace"
# test help continue "c" abbreviation
-gdb_test "help c" "Continue program being debugged.*" "help continue \"c\" abbreviation"
+gdb_test "help c" "Continue program being debugged.*" "help continue \"c\" abbreviation"
# test help continue
-gdb_test "help continue" "Continue program being debugged.*" "help continue"
+gdb_test "help continue" "Continue program being debugged.*" "help continue"
# test help call
-gdb_test "help call" "Call a function.*" "help call"
+gdb_test "help call" "Call a function.*" "help call"
# test help catch
gdb_test "help catch" "Set catchpoints to catch events.*Raised signals may be caught:.*catch signal.*all signals.*catch signal.*signame.*a particular signal.*Raised exceptions may be caught:.*catch throw.*all exceptions, when thrown.*catch throw.*exceptname.*a particular exception, when thrown.*catch catch.*all exceptions, when caught.*catch catch.*exceptname.*a particular exception, when caught.*Thread or process events may be caught:.*catch thread_start.*any threads, just after creation.*catch thread_exit.*any threads, just before expiration.*catch thread_join.*any threads, just after joins.*catch start.*any processes, just after creation.*catch exit.*any processes, just before expiration.*catch fork.*calls to fork.*catch vfork.*calls to vfork.*catch exec.*calls to exec.*Dynamically.linked library events may be caught:.*catch load.*loads of any library.*catch load.*libname.*loads of a particular library.*catch unload.*unloads of any library.*catch unload.*libname.*unloads of a particular library.*The act of your program's execution stopping may also be caught:.*catch stop.*Do.*help set follow-fork-mode.*for info on debugging your program.*after a fork or vfork is caught.*Do.*help breakpoints.*for info on other commands dealing with breakpoints." "help catch"
# test help cd
-gdb_test "help cd" "Set working directory to DIR for debugger and program being debugged..*\[\r\n\]+The change does not take effect for the program being debugged.*\[\r\n\]+until the next time it is started." "help cd"
+gdb_test "help cd" "Set working directory to DIR for debugger and program being debugged\.\[\r\n\]+The change does not take effect for the program being debugged\[\r\n\]+until the next time it is started\." "help cd"
# test help clear
-gdb_test "help clear" "Clear breakpoint at specified line or function.*\[\r\n\]+Argument may be line number, function name, or .* and an address.*\[\r\n\]+If line number is specified, all breakpoints in that line are cleared.*\[\r\n\]+If function is specified, breakpoints at beginning of function are cleared.*\[\r\n\]+If an address is specified, breakpoints at that address are cleared.*\[\r\n\]+With no argument, clears all breakpoints in the line that the selected frame.*\[\r\n\]+is executing in..*\[\r\n\]+See also the \"delete\" command which clears breakpoints by number." "help clear"
+gdb_test "help clear" "Clear breakpoint at specified line or function\.\[\r\n\]+Argument may be line number, function name, or \"\\*\" and an address\.\[\r\n\]+If line number is specified, all breakpoints in that line are cleared\.\[\r\n\]+If function is specified, breakpoints at beginning of function are cleared\.\[\r\n\]+If an address is specified, breakpoints at that address are cleared\.\[\r\n\]+With no argument, clears all breakpoints in the line that the selected frame\[\r\n\]+is executing in\.\[\r\n\]+See also the \"delete\" command which clears breakpoints by number\." "help clear"
# test help commands
-gdb_test "help commands" "Set commands to be executed when a breakpoint is hit..*\[\r\n\]+Give breakpoint number as argument after \"commands\"..*\[\r\n\]+With no argument, the targeted breakpoint is the last one set..*\[\r\n\]+The commands themselves follow starting on the next line..*\[\r\n\]+Type a line containing \"end\" to indicate the end of them..*\[\r\n\]+Give \"silent\" as the first line to make the breakpoint silent;.*\[\r\n\]+then no output is printed when it is hit, except what the commands print." "help commands"
+gdb_test "help commands" "Set commands to be executed when a breakpoint is hit\.\[\r\n\]+Give breakpoint number as argument after \"commands\"\.\[\r\n\]+With no argument, the targeted breakpoint is the last one set\.\[\r\n\]+The commands themselves follow starting on the next line\.\[\r\n\]+Type a line containing \"end\" to indicate the end of them\.\[\r\n\]+Give \"silent\" as the first line to make the breakpoint silent;\[\r\n\]+then no output is printed when it is hit, except what the commands print\." "help commands"
# test help condition
-gdb_test "help condition" "Specify breakpoint number N to break only if COND is true..*\[\r\n\]+Usage is `condition N COND', where N is an integer and COND is an.*\[\r\n\]+expression to be evaluated whenever breakpoint N is reached. " "help condition"
+gdb_test "help condition" "Specify breakpoint number N to break only if COND is true\.\[\r\n\]+Usage is `condition N COND', where N is an integer and COND is an\[\r\n\]+expression to be evaluated whenever breakpoint N is reached." "help condition"
# test help core-file
-gdb_test "help core-file" "Use FILE as core dump for examining memory and registers..*\[\r\n\]+No arg means have no core file. This command has been superseded by the.*\[\r\n\]+`target core' and `detach' commands." "help core-file"
+gdb_test "help core-file" "Use FILE as core dump for examining memory and registers\.\[\r\n\]+No arg means have no core file\. This command has been superseded by the\[\r\n\]+`target core' and `detach' commands\." "help core-file"
# test help delete "d" abbreviation
-gdb_test "help d" "Delete some breakpoints or auto-display expressions..*\[\r\n\]+Arguments are breakpoint numbers with spaces in between..*\[\r\n\]+To delete all breakpoints, give no argument..*\[\r\n\]+Also a prefix command for deletion of other GDB objects..*\[\r\n\]+The \"unset\" command is also an alias for \"delete\"..*\[\r\n\]+List of delete subcommands:.*\[\r\n\]+delete breakpoints -- Delete some breakpoints or auto-display expressions.*\[\r\n\]+delete display -- Cancel some expressions to be displayed when program stops.*\[\r\n\]+Type \"help delete\" followed by delete subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help delete \"d\" abbreviation"
+gdb_test "help d" "Delete some breakpoints or auto-display expressions\.\[\r\n\]+Arguments are breakpoint numbers with spaces in between\.\[\r\n\]+To delete all breakpoints, give no argument\.\[\r\n\]+Also a prefix command for deletion of other GDB objects\.\[\r\n\]+The \"unset\" command is also an alias for \"delete\"\.\[\r\n\]+List of delete subcommands:\[\r\n\]+delete breakpoints -- Delete some breakpoints or auto-display expressions\[\r\n\]+delete display -- Cancel some expressions to be displayed when program stops\[\r\n\]+delete mem -- Delete memory region\[\r\n\]+delete tracepoints -- Delete specified tracepoints\[\r\n\]+Type \"help delete\" followed by delete subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help delete \"d\" abbreviation"
# test help delete
-gdb_test "help delete" "Delete some breakpoints or auto-display expressions..*\[\r\n\]+Arguments are breakpoint numbers with spaces in between..*\[\r\n\]+To delete all breakpoints, give no argument..*\[\r\n\]+Also a prefix command for deletion of other GDB objects..*\[\r\n\]+The \"unset\" command is also an alias for \"delete\"..*\[\r\n\]+List of delete subcommands:.*\[\r\n\]+delete breakpoints -- Delete some breakpoints or auto-display expressions.*\[\r\n\]+delete display -- Cancel some expressions to be displayed when program stops.*\[\r\n\]+Type \"help delete\" followed by delete subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help delete"
+gdb_test "help delete" "Delete some breakpoints or auto-display expressions\.\[\r\n\]+Arguments are breakpoint numbers with spaces in between\.\[\r\n\]+To delete all breakpoints, give no argument\.\[\r\n\]+Also a prefix command for deletion of other GDB objects\.\[\r\n\]+The \"unset\" command is also an alias for \"delete\"\.\[\r\n\]+List of delete subcommands:\[\r\n\]+delete breakpoints -- Delete some breakpoints or auto-display expressions\[\r\n\]+delete display -- Cancel some expressions to be displayed when program stops\[\r\n\]+delete mem -- Delete memory region\[\r\n\]+delete tracepoints -- Delete specified tracepoints\[\r\n\]+Type \"help delete\" followed by delete subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help delete"
# test help data
-gdb_test "help data" ".*\[\r\n\]+Examining data..*\[\r\n\]+List of commands:.*\[\r\n\]+Type \"help\" followed by command name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help data"
+gdb_test "help data" "Examining data\.\[\r\n\]+List of commands:.*\[\r\n\]+Type \"help\" followed by command name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help data"
# test help define
-gdb_test "help define" "Define a new command.*" "help define"
+gdb_test "help define" "Define a new command.*" "help define"
# test help delete breakpoints
-gdb_test "help delete breakpoints" "Delete some breakpoints or auto-display expressions..*\[\r\n\]+Arguments are breakpoint numbers with spaces in between..*\[\r\n\]+To delete all breakpoints, give no argument..*\[\r\n\]+This command may be abbreviated \"delete\"." "help delete breakpoints"
+gdb_test "help delete breakpoints" "Delete some breakpoints or auto-display expressions\.\[\r\n\]+Arguments are breakpoint numbers with spaces in between\.\[\r\n\]+To delete all breakpoints, give no argument\.\[\r\n\]+This command may be abbreviated \"delete\"\." "help delete breakpoints"
# test help delete display
-gdb_test "help delete display" "Cancel some expressions to be displayed when program stops..*\[\r\n\]+Arguments are the code numbers of the expressions to stop displaying..*\[\r\n\]+No argument means cancel all automatic-display expressions..*\[\r\n\]+Do \"info display\" to see current list of code numbers." "help delete display"
+gdb_test "help delete display" "Cancel some expressions to be displayed when program stops\.\[\r\n\]+Arguments are the code numbers of the expressions to stop displaying\.\[\r\n\]+No argument means cancel all automatic-display expressions\.\[\r\n\]+Do \"info display\" to see current list of code numbers\." "help delete display"
# test help detach
-gdb_test "help detach" "Detach a process or file previously attached.\[\r\n\]+If a process, it is no longer traced, and it continues its execution.\[ \r\n\]+If\[ \r\n\]+you were debugging a file, the file is closed and gdb no longer accesses it." "help detach"
+gdb_test "help detach" "Detach a process or file previously attached\.\[\r\n\]+If a process, it is no longer traced, and it continues its execution\.\[ \r\n\]+If\[ \r\n\]+you were debugging a file, the file is closed and gdb no longer accesses it\." "help detach"
# test help directory
-gdb_test "help directory" "Add directory DIR to beginning of search path for source files..*\[\r\n\]+Forget cached info on source file locations and line positions..*\[\r\n\]+DIR can also be .cwd for the current working directory, or .cdir for the.*\[\r\n\]+directory in which the source file was compiled into object code..*\[\r\n\]+With no argument, reset the search path to .cdir:.cwd, the default." "help directory"
+gdb_test "help directory" "Add directory DIR to beginning of search path for source files\.\[\r\n\]+Forget cached info on source file locations and line positions\.\[\r\n\]+DIR can also be \\\$cwd for the current working directory, or \\\$cdir for the\[\r\n\]+directory in which the source file was compiled into object code\.\[\r\n\]+With no argument, reset the search path to \\\$cdir:\\\$cwd, the default\." "help directory"
# test help disable "dis" abbreviation
-gdb_test "help dis" "Disable some breakpoints..*\[\r\n\]+Arguments are breakpoint numbers with spaces in between..*\[\r\n\]+To disable all breakpoints, give no argument..*\[\r\n\]+A disabled breakpoint is not forgotten, but has no effect until reenabled..*\[\r\n\]+List of disable subcommands:.*\[\r\n\]+disable breakpoints -- Disable some breakpoints.*\[\r\n\]+disable display -- Disable some expressions to be displayed when program stops.*\[\r\n\]+Type \"help disable\" followed by disable subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help disable \"dis\" abbreviation"
+gdb_test "help dis" "Disable some breakpoints\.\[\r\n\]+Arguments are breakpoint numbers with spaces in between\.\[\r\n\]+To disable all breakpoints, give no argument\.\[\r\n\]+A disabled breakpoint is not forgotten, but has no effect until reenabled\.\[\r\n\]+List of disable subcommands:\[\r\n\]+disable breakpoints -- Disable some breakpoints\[\r\n\]+disable display -- Disable some expressions to be displayed when program stops\[\r\n\]+disable mem -- Disable memory region\[\r\n\]+disable tracepoints -- Disable specified tracepoints\[\r\n\]+Type \"help disable\" followed by disable subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help disable \"dis\" abbreviation"
# test help disable "disa" abbreviation
-gdb_test "help disa" "Disable some breakpoints..*\[\r\n\]+Arguments are breakpoint numbers with spaces in between..*\[\r\n\]+To disable all breakpoints, give no argument..*\[\r\n\]+A disabled breakpoint is not forgotten, but has no effect until reenabled..*\[\r\n\]+List of disable subcommands:.*\[\r\n\]+disable breakpoints -- Disable some breakpoints.*\[\r\n\]+disable display -- Disable some expressions to be displayed when program stops.*\[\r\n\]+Type \"help disable\" followed by disable subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help disable \"disa\" abbreviation"
+gdb_test "help disa" "Disable some breakpoints\.\[\r\n\]+Arguments are breakpoint numbers with spaces in between\.\[\r\n\]+To disable all breakpoints, give no argument\.\[\r\n\]+A disabled breakpoint is not forgotten, but has no effect until reenabled\.\[\r\n\]+List of disable subcommands:\[\r\n\]+disable breakpoints -- Disable some breakpoints\[\r\n\]+disable display -- Disable some expressions to be displayed when program stops\[\r\n\]+disable mem -- Disable memory region\[\r\n\]+disable tracepoints -- Disable specified tracepoints\[\r\n\]+Type \"help disable\" followed by disable subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help disable \"disa\" abbreviation"
# test help disable
-gdb_test "help disable" "Disable some breakpoints..*\[\r\n\]+Arguments are breakpoint numbers with spaces in between..*\[\r\n\]+To disable all breakpoints, give no argument..*\[\r\n\]+A disabled breakpoint is not forgotten, but has no effect until reenabled..*\[\r\n\]+List of disable subcommands:.*\[\r\n\]+disable breakpoints -- Disable some breakpoints.*\[\r\n\]+disable display -- Disable some expressions to be displayed when program stops.*\[\r\n\]+Type \"help disable\" followed by disable subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help disable"
+gdb_test "help disable" "Disable some breakpoints\.\[\r\n\]+Arguments are breakpoint numbers with spaces in between\.\[\r\n\]+To disable all breakpoints, give no argument\.\[\r\n\]+A disabled breakpoint is not forgotten, but has no effect until reenabled\.\[\r\n\]+List of disable subcommands:\[\r\n\]+disable breakpoints -- Disable some breakpoints\[\r\n\]+disable display -- Disable some expressions to be displayed when program stops\[\r\n\]+disable mem -- Disable memory region\[\r\n\]+disable tracepoints -- Disable specified tracepoints\[\r\n\]+Type \"help disable\" followed by disable subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help disable"
# test help disable breakpoints
-gdb_test "help disable breakpoints" "Disable some breakpoints..*\[\r\n\]+Arguments are breakpoint numbers with spaces in between..*\[\r\n\]+To disable all breakpoints, give no argument..*\[\r\n\]+A disabled breakpoint is not forgotten, but has no effect until reenabled..*\[\r\n\]+This command may be abbreviated \"disable\"." "help disable breakpoints"
+gdb_test "help disable breakpoints" "Disable some breakpoints\.\[\r\n\]+Arguments are breakpoint numbers with spaces in between\.\[\r\n\]+To disable all breakpoints, give no argument\.\[\r\n\]+A disabled breakpoint is not forgotten, but has no effect until reenabled\.\[\r\n\]+This command may be abbreviated \"disable\"." "help disable breakpoints"
# test help disable display
-gdb_test "help disable display" "Disable some expressions to be displayed when program stops..*\[\r\n\]+Arguments are the code numbers of the expressions to stop displaying..*\[\r\n\]+No argument means disable all automatic-display expressions..*\[\r\n\]+Do \"info display\" to see current list of code numbers." "help disable display"
+gdb_test "help disable display" "Disable some expressions to be displayed when program stops\.\[\r\n\]+Arguments are the code numbers of the expressions to stop displaying\.\[\r\n\]+No argument means disable all automatic-display expressions\.\[\r\n\]+Do \"info display\" to see current list of code numbers\." "help disable display"
# test help disassemble
-gdb_test "help disassemble" "Disassemble a specified section of memory..*\[\r\n\]+Default is the function surrounding the pc of the selected frame..*\[\r\n\]+With a single argument, the function surrounding that address is dumped..*\[\r\n\]+Two arguments are taken as a range of memory to dump." "help disassemble"
+gdb_test "help disassemble" "Disassemble a specified section of memory\.\[\r\n\]+Default is the function surrounding the pc of the selected frame\.\[\r\n\]+With a single argument, the function surrounding that address is dumped\.\[\r\n\]+Two arguments are taken as a range of memory to dump\." "help disassemble"
# test help display
-gdb_test "help display" "Print value of expression EXP each time the program stops..*\[\r\n\]+/FMT may be used before EXP as in the \"print\" command..*\[\r\n\]+/FMT \"i\" or \"s\" or including a size-letter is allowed,.*\[\r\n\]+as in the \"x\" command, and then EXP is used to get the address to examine.*\[\r\n\]+and examining is done as in the \"x\" command..*\[\r\n\]+With no argument, display all currently requested auto-display expressions..*\[\r\n\]+Use \"undisplay\" to cancel display requests previously made." "help display"
+gdb_test "help display" "Print value of expression EXP each time the program stops\.\[\r\n\]+/FMT may be used before EXP as in the \"print\" command\.\[\r\n\]+/FMT \"i\" or \"s\" or including a size-letter is allowed,\[\r\n\]+as in the \"x\" command, and then EXP is used to get the address to examine\[\r\n\]+and examining is done as in the \"x\" command\.\[\r\n\]+With no argument, display all currently requested auto-display expressions\.\[\r\n\]+Use \"undisplay\" to cancel display requests previously made\." "help display"
# test help do
-gdb_test "help do" "Select and print stack frame called by this one..*\[\r\n\]+An argument says how many frames down to go." "help do"
+gdb_test "help do" "Select and print stack frame called by this one\.\[\r\n\]+An argument says how many frames down to go\." "help do"
# test help document
-gdb_test "help document" "Document a user-defined command..*\[\r\n\]+Give command name as argument. Give documentation on following lines..*\[\r\n\]+End with a line of just \"end\"." "help document"
+gdb_test "help document" "Document a user-defined command\.\[\r\n\]+Give command name as argument\. Give documentation on following lines\.\[\r\n\]+End with a line of just \"end\"\." "help document"
# test help down
-gdb_test "help down" "Select and print stack frame called by this one..*\[\r\n\]+An argument says how many frames down to go." "help down"
+gdb_test "help down" "Select and print stack frame called by this one\.\[\r\n\]+An argument says how many frames down to go\." "help down"
# test help down-silently
-gdb_test "help down-silently" "Same as the `down' command, but does not print anything..*\[\r\n\]+This is useful in command scripts." "help down-silently"
+gdb_test "help down-silently" "Same as the `down' command, but does not print anything\.\[\r\n\]+This is useful in command scripts\." "help down-silently"
+# test help dump
+gdb_test "help dump" "Dump target code/data to a local file\.\[\r\n\]+List of dump subcommands:.*"
+gdb_test "help dump binary" "Write target code/data to a raw binary file\.\[\r\n\]+List of dump binary subcommands:.*"
+gdb_test "help dump ihex" "Write target code/data to an intel hex file\.\[\r\n\]+List of dump ihex subcommands:.*"
+gdb_test "help dump memory" "Write contents of memory to a raw binary file\.\[\r\n\]+Arguments are FILE START STOP\. Writes the contents of memory within the\[\r\n\]+range \\\[START \.\. STOP\\) to the specifed FILE in raw target ordered bytes\."
+gdb_test "help dump srec" "Write target code/data to an srec file\.\[\r\n\]+List of dump srec subcommands:.*"
+gdb_test "help dump tekhex" "Write target code/data to a tekhex file\.\[\r\n\]+List of dump tekhex subcommands:.*"
+gdb_test "help dump value" "Write the value of an expression to a raw binary file\.\[\r\n\]+Arguments are FILE EXPRESSION\. Writes the value of EXPRESSION to\[\r\n\]+the specified FILE in raw target ordered bytes\."
+gdb_test "help dump binary memory" "Write contents of memory to a raw binary file\.\[\r\n\]+Arguments are FILE START STOP\. Writes the contents of memory\[\r\n\]+within the range \\\[START \.\. STOP\\) to the specifed FILE in binary format\."
+gdb_test "help dump binary value" "Write the value of an expression to a raw binary file\.\[\r\n\]+Arguments are FILE EXPRESSION\. Writes the value of EXPRESSION\[\r\n\]+to the specified FILE in raw target ordered bytes\." "help dump binary value"
+gdb_test "help dump ihex memory" "Write contents of memory to an ihex file\.\[\r\n\]+Arguments are FILE START STOP\. Writes the contents of memory within\[\r\n\]+the range \\\[START \.\. STOP\\) to the specifed FILE in intel hex format\."
+gdb_test "help dump ihex value" "Write the value of an expression to an ihex file\.\[\r\n\]+Arguments are FILE EXPRESSION\. Writes the value of EXPRESSION\[\r\n\]+to the specified FILE in intel hex format\."
+gdb_test "help dump srec memory" "Write contents of memory to an srec file\.\[\r\n\]+Arguments are FILE START STOP\. Writes the contents of memory\[\r\n\]+within the range \\\[START \.\. STOP\\) to the specifed FILE in srec format\."
+gdb_test "help dump srec value" "Write the value of an expression to an srec file\.\[\r\n\]+Arguments are FILE EXPRESSION\. Writes the value of EXPRESSION\[\r\n\]+to the specified FILE in srec format\."
+gdb_test "help dump tekhex memory" "Write contents of memory to a tekhex file\.\[\r\n\]+Arguments are FILE START STOP\. Writes the contents of memory\[\r\n\]+within the range \\\[START \.\. STOP\\) to the specifed FILE in tekhex format\."
+gdb_test "help dump tekhex value" "Write the value of an expression to a tekhex file\.\[\r\n\]+Arguments are FILE EXPRESSION\. Writes the value of EXPRESSION\[\r\n\]+to the specified FILE in tekhex format\."
# this command was removed from GDB 4.5.8
# test help dump-me
#send_gdb "help dump-me"
-# -re "Get fatal error; make debugger dump its core."
+# -re "Get fatal error; make debugger dump its core\."
#
# }
# test help echo
-gdb_test "help echo" "Print a constant string. Give string as argument..*\[\r\n\]+C escape sequences may be used in the argument..*\[\r\n\]+No newline is added at the end of the argument;.*\[\r\n\]+use \".n\" if you want a newline to be printed..*\[\r\n\]+Since leading and trailing whitespace are ignored in command arguments,.*\[\r\n\]+if you want to print some you must use \".\" before leading whitespace.*\[\r\n\]+to be printed or after trailing whitespace." "help echo"
+gdb_test "help echo" "Print a constant string\. Give string as argument\.\[\r\n\]+C escape sequences may be used in the argument\.\[\r\n\]+No newline is added at the end of the argument;\[\r\n\]+use \"\\\\n\" if you want a newline to be printed\.\[\r\n\]+Since leading and trailing whitespace are ignored in command arguments,\[\r\n\]+if you want to print some you must use \"\\\\\" before leading whitespace\[\r\n\]+to be printed or after trailing whitespace\." "help echo"
# test help enable breakpoints delete
-gdb_test "help enable breakpoints delete" "Enable breakpoints and delete when hit. Give breakpoint numbers..*\[\r\n\]+If a breakpoint is hit while enabled in this fashion, it is deleted." "help enable breakpoints delete"
+gdb_test "help enable breakpoints delete" "Enable breakpoints and delete when hit\. Give breakpoint numbers\.\[\r\n\]+If a breakpoint is hit while enabled in this fashion, it is deleted\." "help enable breakpoints delete"
# test help enable breakpoints once
-gdb_test "help enable breakpoints once" "Enable breakpoints for one hit..*" "help enable breakpoints once"
+gdb_test "help enable breakpoints once" "Enable breakpoints for one hit.*" "help enable breakpoints once"
# test help enable breakpoints
-gdb_test "help enable breakpoints" "Enable some breakpoints..*\[\r\n\]+Give breakpoint numbers .separated by spaces. as arguments..*\[\r\n\]+This is used to cancel the effect of the \"disable\" command..*\[\r\n\]+May be abbreviated to simply \"enable\"..*.*\[\r\n\]+List of enable breakpoints subcommands:.*\[\r\n\]+enable breakpoints delete -- Enable breakpoints and delete when hit.*\[\r\n\]+enable breakpoints once -- Enable breakpoints for one hit.*\[\r\n\]+Type \"help enable breakpoints\" followed by enable breakpoints subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help enable breakpoints"
+gdb_test "help enable breakpoints" "Enable some breakpoints\.\[\r\n\]+Give breakpoint numbers \\(separated by spaces\\) as arguments\.\[\r\n\]+This is used to cancel the effect of the \"disable\" command\.\[\r\n\]+May be abbreviated to simply \"enable\"\.\[\r\n\]+List of enable breakpoints subcommands:\[\r\n\]+enable breakpoints delete -- Enable breakpoints and delete when hit\[\r\n\]+enable breakpoints once -- Enable breakpoints for one hit\[\r\n\]+Type \"help enable breakpoints\" followed by enable breakpoints subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help enable breakpoints"
# test help enable delete
-gdb_test "help enable delete" "Enable breakpoints and delete when hit. Give breakpoint numbers..*\[\r\n\]+If a breakpoint is hit while enabled in this fashion, it is deleted." "help enable delete"
+gdb_test "help enable delete" "Enable breakpoints and delete when hit\. Give breakpoint numbers\.\[\r\n\]+If a breakpoint is hit while enabled in this fashion, it is deleted\." "help enable delete"
# test help enable display
-gdb_test "help enable display" "Enable some expressions to be displayed when program stops..*\[\r\n\]+Arguments are the code numbers of the expressions to resume displaying..*\[\r\n\]+No argument means enable all automatic-display expressions..*\[\r\n\]+Do \"info display\" to see current list of code numbers." "help enable display"
+gdb_test "help enable display" "Enable some expressions to be displayed when program stops\.\[\r\n\]+Arguments are the code numbers of the expressions to resume displaying\.\[\r\n\]+No argument means enable all automatic-display expressions\.\[\r\n\]+Do \"info display\" to see current list of code numbers\." "help enable display"
# test help enable once
-gdb_test "help enable once" "Enable breakpoints for one hit.*" "help enable once"
+gdb_test "help enable once" "Enable breakpoints for one hit.*" "help enable once"
# test help enable
-gdb_test "help enable" "Enable some breakpoints..*\[\r\n\]+Give breakpoint numbers .separated by spaces. as arguments..*\[\r\n\]+With no subcommand, breakpoints are enabled until you command otherwise..*\[\r\n\]+This is used to cancel the effect of the \"disable\" command..*\[\r\n\]+With a subcommand you can enable temporarily..*\[\r\n\]+List of enable subcommands:.*\[\r\n\]+enable delete -- Enable breakpoints and delete when hit.*\[\r\n\]+enable display -- Enable some expressions to be displayed when program stops.*\[\r\n\]+enable once -- Enable breakpoints for one hit.*\[\r\n\]+Type \"help enable\" followed by enable subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help enable"
+gdb_test "help enable" "Enable some breakpoints\.\[\r\n\]+Give breakpoint numbers \\(separated by spaces\\) as arguments\.\[\r\n\]+With no subcommand, breakpoints are enabled until you command otherwise\.\[\r\n\]+This is used to cancel the effect of the \"disable\" command\.\[\r\n\]+With a subcommand you can enable temporarily\.\[\r\n\]+List of enable subcommands:\[\r\n\]+enable delete -- Enable breakpoints and delete when hit\[\r\n\]+enable display -- Enable some expressions to be displayed when program stops\[\r\n\]+enable mem -- Enable memory region\[\r\n\]+enable once -- Enable breakpoints for one hit\[\r\n\]+enable tracepoints -- Enable specified tracepoints\[\r\n\]+Type \"help enable\" followed by enable subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help enable"
# test help exec-file
-gdb_test "help exec-file" "Use FILE as program for getting contents of pure memory..*\[\r\n\]+If FILE cannot be found as specified, your execution directory path.*\[\r\n\]+is searched for a command of that name..*\[\r\n\]+No arg means have no executable file." "help exec-file"
+gdb_test "help exec-file" "Use FILE as program for getting contents of pure memory\.\[\r\n\]+If FILE cannot be found as specified, your execution directory path\[\r\n\]+is searched for a command of that name\.\[\r\n\]+No arg means have no executable file\." "help exec-file"
# test help frame "f" abbreviation
-gdb_test "help f" "Select and print a stack frame..*\[\r\n\]+With no argument, print the selected stack frame. .See also \"info frame\".*\[\r\n\]+An argument specifies the frame to select..*\[\r\n\]+It can be a stack frame number or the address of the frame..*\[\r\n\]+With argument, nothing is printed if input is coming from.*\[\r\n\]+a command file or a user-defined command." "help frame \"f\" abbreviation"
+gdb_test "help f" "Select and print a stack frame\.\[\r\n\]+With no argument, print the selected stack frame\. \\(See also \"info frame\"\\)\.\[\r\n\]+An argument specifies the frame to select\.\[\r\n\]+It can be a stack frame number or the address of the frame\.\[\r\n\]+With argument, nothing is printed if input is coming from\[\r\n\]+a command file or a user-defined command\." "help frame \"f\" abbreviation"
# test help frame
-gdb_test "help frame" "Select and print a stack frame..*\[\r\n\]+With no argument, print the selected stack frame. .See also \"info frame\"...*\[\r\n\]+An argument specifies the frame to select..*\[\r\n\]+It can be a stack frame number or the address of the frame..*\[\r\n\]+With argument, nothing is printed if input is coming from.*\[\r\n\]+a command file or a user-defined command." "help frame"
+gdb_test "help frame" "Select and print a stack frame\.\[\r\n\]+With no argument, print the selected stack frame\. \\(See also \"info frame\"\\)\.\[\r\n\]+An argument specifies the frame to select\.\[\r\n\]+It can be a stack frame number or the address of the frame\.\[\r\n\]+With argument, nothing is printed if input is coming from\[\r\n\]+a command file or a user-defined command\." "help frame"
# test help fg
-gdb_test "help fg" "Continue program being debugged.*" "help fg"
+gdb_test "help fg" "Continue program being debugged.*" "help fg"
# test help file
-gdb_test "help file" "Use FILE as program to be debugged..*\[\r\n\]+It is read for its symbols, for getting the contents of pure memory,.*\[\r\n\]+and it is the program executed when you use the `run' command..*\[\r\n\]+If FILE cannot be found as specified, your execution directory path.*\[\r\n\]+..PATH. is searched for a command of that name..*\[\r\n\]+No arg means to have no executable file and no symbols." "help file"
+gdb_test "help file" "Use FILE as program to be debugged\.\[\r\n\]+It is read for its symbols, for getting the contents of pure memory,\[\r\n\]+and it is the program executed when you use the `run' command\.\[\r\n\]+If FILE cannot be found as specified, your execution directory path\[\r\n\]+\\(\\\$PATH\\) is searched for a command of that name\.\[\r\n\]+No arg means to have no executable file and no symbols\." "help file"
# test help files
gdb_test "help files" "Specifying.*" "help files"
# test help finish
-gdb_test "help finish" "Execute until selected stack frame returns..*\[\r\n\]+Upon return, the value returned is printed and put in the value history." "help finish"
+gdb_test "help finish" "Execute until selected stack frame returns\.\[\r\n\]+Upon return, the value returned is printed and put in the value history\." "help finish"
# test help forward-search
-gdb_test "help forward-search" "Search for regular expression .see regex.3.. from last line listed..*" "help forward-search"
+gdb_test "help forward-search" "Search for regular expression \\(see regex\\(3\\)\\) from last line listed.*" "help forward-search"
+# test help gcore
+send_gdb "help gcore\n"
+gdb_expect {
+ -re "Undefined command: \"gcore\"\. Try \"help\".*$gdb_prompt $" {
+ pass "help gcore"
+ }
+ -re "Save a core file with the current state of the debugged process\.\[\r\n\]+Argument is optional filename\. Default filename is 'core\.<process_id>'.*$gdb_prompt $" {
+ pass "help gcore"
+ }
+ default { fail "help gcore" }
+}
+send_gdb "help generate-core-file\n"
+gdb_expect {
+ -re "Undefined command: \"generate-core-file\"\. Try \"help\".*$gdb_prompt $" {
+ pass "help gcore"
+ }
+ -re "Save a core file with the current state of the debugged process\.\[\r\n\]+Argument is optional filename\. Default filename is 'core\.<process_id>'.*$gdb_prompt $" {
+ pass "help gcore"
+ }
+ default { fail "help gcore" }
+}
# test help help "h" abbreviation
-gdb_test "help h" "Print list of commands." "help help \"h\" abbreviation"
+gdb_test "help h" "Print list of commands\." "help help \"h\" abbreviation"
# test help help
-gdb_test "help help" "Print list of commands." "help help"
+gdb_test "help help" "Print list of commands\." "help help"
# test help handle
-gdb_test "help handle" "Specify how to handle a signal..*" "help handle"
+gdb_test "help handle" "Specify how to handle a signal\..*" "help handle"
# test help info "i" abbreviation
-gdb_test "help i" "Generic command for showing things about the program being debugged..*\[\r\n\]+List of info subcommands:.*\[\r\n\]+Type \"help info\" followed by info subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help info \"i\" abbreviation"
+gdb_test "help i" "Generic command for showing things about the program being debugged\.\[\r\n\]+List of info subcommands:.*\[\r\n\]+Type \"help info\" followed by info subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help info \"i\" abbreviation"
# test help info
-gdb_test "help info" "Generic command for showing things about the program being debugged..*\[\r\n\]+List of info subcommands:.*\[\r\n\]+Type \"help info\" followed by info subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help info"
+gdb_test "help info" "Generic command for showing things about the program being debugged\.\[\r\n\]+List of info subcommands:.*\[\r\n\]+Type \"help info\" followed by info subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help info"
# test help ignore
-gdb_test "help ignore" "Set ignore-count of breakpoint number N to COUNT..*\[\r\n\]+Usage is `ignore N COUNT'." "help ignore"
+gdb_test "help ignore" "Set ignore-count of breakpoint number N to COUNT\.\[\r\n\]+Usage is `ignore N COUNT'\." "help ignore"
# test help info address
-gdb_test "help info address" "Describe where symbol SYM is stored." "help info address"
+gdb_test "help info address" "Describe where symbol SYM is stored\." "help info address"
# test help info all-registers
-gdb_test "help info all-registers" "List of all registers and their contents, for selected stack frame..*\[\r\n\]+Register name as argument means describe only that register." "help info all-registers"
+gdb_test "help info all-registers" "List of all registers and their contents, for selected stack frame\.\[\r\n\]+Register name as argument means describe only that register\." "help info all-registers"
# test help info args
-gdb_test "help info args" "Argument variables of current stack frame." "help info args"
+gdb_test "help info args" "Argument variables of current stack frame\." "help info args"
# test help info breakpoints
-gdb_test "help info breakpoints" "Status of user-settable breakpoints, or breakpoint number NUMBER..*\[\r\n\]+breakpoint set." "help info breakpoints"
+gdb_test "help info breakpoints" "Status of user-settable breakpoints, or breakpoint number NUMBER\..*\[\r\n\]+breakpoint set\." "help info breakpoints"
# test help info catch
-gdb_test "help info catch" "Exceptions that can be caught in the current stack frame." "help info catch"
+gdb_test "help info catch" "Exceptions that can be caught in the current stack frame\." "help info catch"
# test help info copying
-gdb_test "help info copying" "Conditions for redistributing copies of GDB." "help info copying"
+gdb_test "help info copying" "Conditions for redistributing copies of GDB\." "help info copying"
# test help info display
-gdb_test "help info display" "Expressions to display when program stops, with code numbers." "help info display"
+gdb_test "help info display" "Expressions to display when program stops, with code numbers\." "help info display"
# test help info frame "f" abbreviation
-gdb_test "help info f" "All about selected stack frame, or frame at ADDR." "help info frame \"f\" abbreviation"
+gdb_test "help info f" "All about selected stack frame, or frame at ADDR\." "help info frame \"f\" abbreviation"
# test help info frame
-gdb_test "help info frame" "All about selected stack frame, or frame at ADDR." "help info frame"
+gdb_test "help info frame" "All about selected stack frame, or frame at ADDR\." "help info frame"
# test help info files
-gdb_test "help info files" "Names of targets and files being debugged..*\[\r\n\]+Shows the entire stack of targets currently in use .including the exec-file,.*\[\r\n\]+core-file, and process, if any., as well as the symbol file name." "help info files"
+gdb_test "help info files" "Names of targets and files being debugged\.\[\r\n\]+Shows the entire stack of targets currently in use \\(including the exec-file,\[\r\n\]+core-file, and process, if any\\), as well as the symbol file name\." "help info files"
# test help info float
-gdb_test "help info float" "Print the status of the floating point unit" "help info float"
+gdb_test "help info float" "Print the status of the floating point unit" "help info float"
# test help info functions
-gdb_test "help info functions" "All function names, or those matching REGEXP." "help info functions"
+gdb_test "help info functions" "All function names, or those matching REGEXP\." "help info functions"
# test help info line
-gdb_test "help info line" "Core addresses of the code for a source line..*\[\r\n\]+Line can be specified as.*\[\r\n\]+ LINENUM, to list around that line in current file,.*\[\r\n\]+ FILE:LINENUM, to list around that line in that file,.*\[\r\n\]+ FUNCTION, to list around beginning of that function,.*\[\r\n\]+ FILE:FUNCTION, to distinguish among like-named static functions..*\[\r\n\]+Default is to describe the last source line that was listed..*\[\r\n\]+This sets the default address for \"x\" to the line's first instruction.*\[\r\n\]+so that \"x.i\" suffices to start examining the machine code..*\[\r\n\]+The address is also stored as the value of \"._\"." "help info line"
+gdb_test "help info line" "Core addresses of the code for a source line\.\[\r\n\]+Line can be specified as\[\r\n\]+ LINENUM, to list around that line in current file,\[\r\n\]+ FILE:LINENUM, to list around that line in that file,\[\r\n\]+ FUNCTION, to list around beginning of that function,\[\r\n\]+ FILE:FUNCTION, to distinguish among like-named static functions\.\[\r\n\]+Default is to describe the last source line that was listed\.\[\r\n\]+This sets the default address for \"x\" to the line's first instruction\[\r\n\]+so that \"x/i\" suffices to start examining the machine code\.\[\r\n\]+The address is also stored as the value of \"\\\$_\"\." "help info line"
# test help info locals
-gdb_test "help info locals" "Local variables of current stack frame." "help info locals"
+gdb_test "help info locals" "Local variables of current stack frame\." "help info locals"
# test help info program
-gdb_test "help info program" "Execution status of the program." "help info program"
+gdb_test "help info program" "Execution status of the program\." "help info program"
# test help info registers
-gdb_test "help info registers" "List of integer registers and their contents, for selected stack frame..*\[\r\n\]+Register name as argument means describe only that register." "help info registers"
+gdb_test "help info registers" "List of integer registers and their contents, for selected stack frame\.\[\r\n\]+Register name as argument means describe only that register\." "help info registers"
# test help info stack "s" abbreviation
-gdb_test "help info s" "Backtrace of the stack, or innermost COUNT frames." "help info stack \"s\" abbreviation"
+gdb_test "help info s" "Backtrace of the stack, or innermost COUNT frames\." "help info stack \"s\" abbreviation"
# test help info stack
-gdb_test "help info stack" "Backtrace of the stack, or innermost COUNT frames." "help info stack"
+gdb_test "help info stack" "Backtrace of the stack, or innermost COUNT frames\." "help info stack"
# test help info set
-gdb_test "help info set" "Show all GDB settings." "help info set"
+gdb_test "help info set" "Show all GDB settings\." "help info set"
# test help info signals
-gdb_test "help info signals" "What debugger does when program gets various signals.*" "help info signals"
+gdb_test "help info signals" "What debugger does when program gets various signals.*" "help info signals"
# test help info source
-gdb_test "help info source" "Information about the current source file." "help info source"
+gdb_test "help info source" "Information about the current source file\." "help info source"
# test help info sources
-gdb_test "help info sources" "Source files in the program." "help info sources"
+gdb_test "help info sources" "Source files in the program\." "help info sources"
# test help info symbol
gdb_test "help info symbol" "Describe what symbol is at location ADDR.*"
# test help info target
-gdb_test "help info target" "Names of targets and files being debugged..*\[\r\n\]+Shows the entire stack of targets currently in use .including the exec-file,.*\[\r\n\]+core-file, and process, if any., as well as the symbol file name." "help info target"
+gdb_test "help info target" "Names of targets and files being debugged\.\[\r\n\]+Shows the entire stack of targets currently in use \\(including the exec-file,\[\r\n\]+core-file, and process, if any\\), as well as the symbol file name\." "help info target"
# test help info terminal
-gdb_test "help info terminal" "Print inferior's saved terminal status." "help info terminal"
+gdb_test "help info terminal" "Print inferior's saved terminal status\." "help info terminal"
# test help info types
-gdb_test "help info types" "All type names, or those matching REGEXP." "help info types"
+gdb_test "help info types" "All type names, or those matching REGEXP\." "help info types"
# test help info variables
-gdb_test "help info variables" "All global and static variable names, or those matching REGEXP." "help info variables"
+gdb_test "help info variables" "All global and static variable names, or those matching REGEXP\." "help info variables"
# test help info warranty
-gdb_test "help info warranty" "Various kinds of warranty you do not have." "help info warranty"
+gdb_test "help info warranty" "Various kinds of warranty you do not have\." "help info warranty"
# test help info watchpoints
-gdb_test "help info watchpoints" "Synonym for ``info breakpoints''." "help info watchpoints"
+gdb_test "help info watchpoints" "Synonym for ``info breakpoints''\." "help info watchpoints"
# test help inspect
-gdb_test "help inspect" "Same as \"print\" command, except that if you are running in the epoch.*\[\r\n\]+environment, the value is printed in its own window." "help inspect"
+gdb_test "help inspect" "Same as \"print\" command, except that if you are running in the epoch\[\r\n\]+environment, the value is printed in its own window\." "help inspect"
# test help jump
-gdb_test "help jump" "Continue program being debugged at specified line or address..*\[\r\n\]+Give as argument either LINENUM or \[*\]+ADDR, where ADDR is an expression.*\[\r\n\]+for an address to start at." "help jump"
+gdb_test "help jump" "Continue program being debugged at specified line or address\.\[\r\n\]+Give as argument either LINENUM or \[*\]+ADDR, where ADDR is an expression\[\r\n\]+for an address to start at\." "help jump"
# test help kill
-gdb_test "help kill" "Kill execution of program being debugged." "help kill"
+gdb_test "help kill" "Kill execution of program being debugged\." "help kill"
# test help list "l" abbreviation
-gdb_test "help l" "List specified function or line..*\[\r\n\]+With no argument, lists ten more lines after or around previous listing..*\[\r\n\]+\"list -\" lists the ten lines before a previous ten-line listing..*\[\r\n\]+One argument specifies a line, and ten lines are listed around that line..*\[\r\n\]+Two arguments with comma between specify starting and ending lines to list..*\[\r\n\]+Lines can be specified in these ways:.*\[\r\n\]+ LINENUM, to list around that line in current file,.*\[\r\n\]+ FILE:LINENUM, to list around that line in that file,.*\[\r\n\]+ FUNCTION, to list around beginning of that function,.*\[\r\n\]+ FILE:FUNCTION, to distinguish among like-named static functions..*\[\r\n\]+ \[*\]+ADDRESS, to list around the line containing that address..*\[\r\n\]+With two args if one is empty it stands for ten lines away from the other arg." "help list \"l\" abbreviation"
+gdb_test "help l" "List specified function or line\.\[\r\n\]+With no argument, lists ten more lines after or around previous listing\.\[\r\n\]+\"list -\" lists the ten lines before a previous ten-line listing\.\[\r\n\]+One argument specifies a line, and ten lines are listed around that line\.\[\r\n\]+Two arguments with comma between specify starting and ending lines to list\.\[\r\n\]+Lines can be specified in these ways:\[\r\n\]+ LINENUM, to list around that line in current file,\[\r\n\]+ FILE:LINENUM, to list around that line in that file,\[\r\n\]+ FUNCTION, to list around beginning of that function,\[\r\n\]+ FILE:FUNCTION, to distinguish among like-named static functions\.\[\r\n\]+ \[*\]ADDRESS, to list around the line containing that address\.\[\r\n\]+With two args if one is empty it stands for ten lines away from the other arg\." "help list \"l\" abbreviation"
# test help list
-gdb_test "help list" "List specified function or line..*\[\r\n\]+With no argument, lists ten more lines after or around previous listing..*\[\r\n\]+\"list -\" lists the ten lines before a previous ten-line listing..*\[\r\n\]+One argument specifies a line, and ten lines are listed around that line..*\[\r\n\]+Two arguments with comma between specify starting and ending lines to list..*\[\r\n\]+Lines can be specified in these ways:.*\[\r\n\]+ LINENUM, to list around that line in current file,.*\[\r\n\]+ FILE:LINENUM, to list around that line in that file,.*\[\r\n\]+ FUNCTION, to list around beginning of that function,.*\[\r\n\]+ FILE:FUNCTION, to distinguish among like-named static functions..*\[\r\n\]+ \[*\]+ADDRESS, to list around the line containing that address..*\[\r\n\]+With two args if one is empty it stands for ten lines away from the other arg." "help list"
+gdb_test "help list" "List specified function or line\.\[\r\n\]+With no argument, lists ten more lines after or around previous listing\.\[\r\n\]+\"list -\" lists the ten lines before a previous ten-line listing\.\[\r\n\]+One argument specifies a line, and ten lines are listed around that line\.\[\r\n\]+Two arguments with comma between specify starting and ending lines to list\.\[\r\n\]+Lines can be specified in these ways:\[\r\n\]+ LINENUM, to list around that line in current file,\[\r\n\]+ FILE:LINENUM, to list around that line in that file,\[\r\n\]+ FUNCTION, to list around beginning of that function,\[\r\n\]+ FILE:FUNCTION, to distinguish among like-named static functions\.\[\r\n\]+ \[*\]ADDRESS, to list around the line containing that address\.\[\r\n\]+With two args if one is empty it stands for ten lines away from the other arg\." "help list"
# test help load
-gdb_test "help load" "Dynamically load FILE into the running program, and record its symbols.*\[\r\n\]+for access from GDB." "help load"
+gdb_test "help load" "Dynamically load FILE into the running program, and record its symbols\[\r\n\]+for access from GDB\." "help load"
# test help make
-gdb_test "help make" "Run the ``make'' program using the rest of the line as arguments." "help make"
+gdb_test "help make" "Run the ``make'' program using the rest of the line as arguments\." "help make"
# test help next "n" abbreviation
-gdb_test "help n" "Step program, proceeding through subroutine calls..*\[\r\n\]+Like the \"step\" command as long as subroutine calls do not happen;.*\[\r\n\]+when they do, the call is treated as one instruction..*\[\r\n\]+Argument N means do this N times .or till program stops for another reason.." "help next \"n\" abbreviation"
+gdb_test "help n" "Step program, proceeding through subroutine calls\.\[\r\n\]+Like the \"step\" command as long as subroutine calls do not happen;\[\r\n\]+when they do, the call is treated as one instruction\.\[\r\n\]+Argument N means do this N times \\(or till program stops for another reason\\)\." "help next \"n\" abbreviation"
# test help next
-gdb_test "help next" "Step program, proceeding through subroutine calls..*\[\r\n\]+Like the \"step\" command as long as subroutine calls do not happen;.*\[\r\n\]+when they do, the call is treated as one instruction..*\[\r\n\]+Argument N means do this N times .or till program stops for another reason.." "help next"
+gdb_test "help next" "Step program, proceeding through subroutine calls\.\[\r\n\]+Like the \"step\" command as long as subroutine calls do not happen;\[\r\n\]+when they do, the call is treated as one instruction\.\[\r\n\]+Argument N means do this N times \\(or till program stops for another reason\\)\." "help next"
# test help nexti
-gdb_test "help ni" "Step one instruction, but proceed through subroutine calls..*\[\r\n\]+Argument N means do this N times .or till program stops for another reason.." "help nexti"
+gdb_test "help ni" "Step one instruction, but proceed through subroutine calls\.\[\r\n\]+Argument N means do this N times \\(or till program stops for another reason\\)\." "help nexti"
# all the commands that used to be here are now in "maintainance" instead
# test help obscure
-gdb_test "help obscure" "Obscure features..*\[\r\n\]+List of commands:.*\[\r\n\]+Type \"help\" followed by command name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help obscure"
+gdb_test "help obscure" "Obscure features\.\[\r\n\]+List of commands:.*\[\r\n\]+Type \"help\" followed by command name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help obscure"
# test help output
-gdb_test "help output" "Like \"print\" but don't put in value history and don't print newline..*\[\r\n\]+This is useful in user-defined commands." "help output"
+gdb_test "help output" "Like \"print\" but don't put in value history and don't print newline\.\[\r\n\]+This is useful in user-defined commands\." "help output"
# test help overlay
gdb_test "help overlay" "Commands for debugging overlays.*"
-gdb_test "help overlay off" "Disable overlay debugging."
-gdb_test "help overlay manual" "Enable overlay debugging."
-gdb_test "help overlay auto" "Enable automatic overlay debugging."
-gdb_test "help overlay list" "List mappings of overlay sections."
-gdb_test "help overlay map" "Assert that an overlay section is mapped."
-gdb_test "help overlay unmap" "Assert that an overlay section is unmapped."
-gdb_test "help overlay load" "Read the overlay mapping state from the target."
+gdb_test "help overlay off" "Disable overlay debugging\."
+gdb_test "help overlay manual" "Enable overlay debugging\."
+gdb_test "help overlay auto" "Enable automatic overlay debugging\."
+gdb_test "help overlay list" "List mappings of overlay sections\."
+gdb_test "help overlay map" "Assert that an overlay section is mapped\."
+gdb_test "help overlay unmap" "Assert that an overlay section is unmapped\."
+gdb_test "help overlay load" "Read the overlay mapping state from the target\."
# test help print "p" abbreviation
-gdb_test "help p" "Print value of expression EXP..*\[\r\n\]+Variables accessible are those of the lexical environment of the selected.*\[\r\n\]+EXP may be preceded with /FMT, where FMT is a format letter.*\[\r\n\]+but no count or size letter .see \"x\" command.." "help print \"p\" abbreviation"
+gdb_test "help p" "Print value of expression EXP\.\[\r\n\]+Variables accessible are those of the lexical environment of the selected.*\[\r\n\]+EXP may be preceded with /FMT, where FMT is a format letter\[\r\n\]+but no count or size letter \\(see \"x\" command\\)\." "help print \"p\" abbreviation"
# test help print
-gdb_test "help print" "Print value of expression EXP..*\[\r\n\]+Variables accessible are those of the lexical environment of the selected.*\[\r\n\]+EXP may be preceded with /FMT, where FMT is a format letter.*\[\r\n\]+but no count or size letter .see \"x\" command.." "help print"
+gdb_test "help print" "Print value of expression EXP\.\[\r\n\]+Variables accessible are those of the lexical environment of the selected.*\[\r\n\]+EXP may be preceded with /FMT, where FMT is a format letter\[\r\n\]+but no count or size letter \\(see \"x\" command\\)\." "help print"
# test help path
-gdb_test "help path" "Add directory DIR.s. to beginning of search path for object files..*\[\r\n\]+.cwd in the path means the current working directory..*\[\r\n\]+This path is equivalent to the .PATH shell variable. It is a list of.*\[\r\n\]+directories, separated by colons. These directories are searched to find.*\[\r\n\]+fully linked executable files and separately compiled object files as needed." "help path"
+gdb_test "help path" "Add directory DIR\\(s\\) to beginning of search path for object files\.\[\r\n\]+\\\$cwd in the path means the current working directory\.\[\r\n\]+This path is equivalent to the \\\$PATH shell variable\. It is a list of\[\r\n\]+directories, separated by colons\. These directories are searched to find\[\r\n\]+fully linked executable files and separately compiled object files as needed\." "help path"
# test help printcmds
-gdb_test "help printcmds" "Undefined command: \"printcmds\". Try \"help\"." "help printcmds"
+gdb_test "help printcmds" "Undefined command: \"printcmds\"\. Try \"help\"\." "help printcmds"
# test help printf
-gdb_test "help printf" "printf \"printf format string\", arg1, arg2, arg3, ..., argn.*\[\r\n\]+This is useful for formatted output in user-defined commands." "help printf"
+gdb_test "help printf" "printf \"printf format string\", arg1, arg2, arg3, \.\.\., argn\[\r\n\]+This is useful for formatted output in user-defined commands\." "help printf"
# test help ptype
-gdb_test "help ptype" "Print definition of type.*" "help ptype"
+gdb_test "help ptype" "Print definition of type.*" "help ptype"
# test help pwd
-gdb_test "help pwd" "Print working directory. This is used for your program as well." "help pwd"
+gdb_test "help pwd" "Print working directory\. This is used for your program as well\." "help pwd"
# test help quit "q" abbreviation
-gdb_test "help q" "Exit gdb." "help quit \"q\" abbreviation"
+gdb_test "help q" "Exit gdb\." "help quit \"q\" abbreviation"
# test help quit
-gdb_test "help quit" "Exit gdb." "help quit"
+gdb_test "help quit" "Exit gdb\." "help quit"
# test help run "r" abbreviation
-gdb_test "help r" "Start debugged program. You may specify arguments to give it..*\[\r\n\]+Args may include .*, or .*; they are expanded using \"sh\"..*\[\r\n\]+Input and output redirection with \".\", \".\", or \"..\" are also allowed..*\[\r\n\]+With no arguments, uses arguments last specified .with \"run\" or \"set args\"...*\[\r\n\]+To cancel previous arguments and run with no arguments,.*\[\r\n\]+use \"set args\" without arguments." "help run \"r\" abbreviation"
+gdb_test "help r" "Start debugged program\. You may specify arguments to give it\.\[\r\n\]+Args may include \"\\*\", or \"\\\[\.\.\.\\\]\"; they are expanded using \"sh\"\.\[\r\n\]+Input and output redirection with \">\", \"<\", or \">>\" are also allowed\.\[\r\n\]+With no arguments, uses arguments last specified \\(with \"run\" or \"set args\"\\)\.\[\r\n\]+To cancel previous arguments and run with no arguments,\[\r\n\]+use \"set args\" without arguments\." "help run \"r\" abbreviation"
# test help run
-gdb_test "help run" "Start debugged program. You may specify arguments to give it..*\[\r\n\]+Args may include .*, or .*; they are expanded using \"sh\"..*\[\r\n\]+Input and output redirection with \".\", \".\", or \"..\" are also allowed..*\[\r\n\]+With no arguments, uses arguments last specified .with \"run\" or \"set args\"...*\[\r\n\]+To cancel previous arguments and run with no arguments,.*\[\r\n\]+use \"set args\" without arguments." "help run"
+gdb_test "help run" "Start debugged program\. You may specify arguments to give it\.\[\r\n\]+Args may include \"\\*\", or \"\\\[\.\.\.\\\]\"; they are expanded using \"sh\"\.\[\r\n\]+Input and output redirection with \">\", \"<\", or \">>\" are also allowed\.\[\r\n\]+With no arguments, uses arguments last specified \\(with \"run\" or \"set args\"\\)\.\[\r\n\]+To cancel previous arguments and run with no arguments,\[\r\n\]+use \"set args\" without arguments\." "help run"
# test help rbreak
-gdb_test "help rbreak" "Set a breakpoint for all functions matching REGEXP." "help rbreak"
+gdb_test "help rbreak" "Set a breakpoint for all functions matching REGEXP\." "help rbreak"
+# test help restore
+gdb_test "help restore" "Restore the contents of FILE to target memory\.\[\r\n\]+Arguments are FILE OFFSET START END where all except FILE are optional\.\[\r\n\]+OFFSET will be added to the base address of the file \\(default zero\\)\.\[\r\n\]+If START and END are given, only the file contents within that range\[\r\n\]+\\(file relative\\) will be restored to target memory\."
# test help return
-gdb_test "help return" "Make selected stack frame return to its caller..*\[\r\n\]+Control remains in the debugger, but when you continue.*\[\r\n\]+execution will resume in the frame above the one now selected..*\[\r\n\]+If an argument is given, it is an expression for the value to return." "help return"
+gdb_test "help return" "Make selected stack frame return to its caller\.\[\r\n\]+Control remains in the debugger, but when you continue\[\r\n\]+execution will resume in the frame above the one now selected\.\[\r\n\]+If an argument is given, it is an expression for the value to return\." "help return"
# test help reverse-search
-gdb_test "help reverse-search" "Search backward for regular expression .see regex.3.. from last line listed..*" "help reverse-search"
+gdb_test "help reverse-search" "Search backward for regular expression \\(see regex\\(3\\)\\) from last line listed\..*" "help reverse-search"
# test help running
-gdb_test "help running" "Running the program..*\[\r\n\]+List of commands:.*\[\r\n\]+Type \"help\" followed by command name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help running"
+gdb_test "help running" "Running the program\.\[\r\n\]+List of commands:.*\[\r\n\]+Type \"help\" followed by command name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help running"
# test help step "s" abbreviation
-gdb_test "help s" "Step program until it reaches a different source line..*\[\r\n\]+Argument N means do this N times .or till program stops for another reason.." "help step \"s\" abbreviation"
+gdb_test "help s" "Step program until it reaches a different source line\.\[\r\n\]+Argument N means do this N times \\(or till program stops for another reason\\)\." "help step \"s\" abbreviation"
# test help step
-gdb_test "help step" "Step program until it reaches a different source line..*\[\r\n\]+Argument N means do this N times .or till program stops for another reason.." "help step #1"
+gdb_test "help step" "Step program until it reaches a different source line\.\[\r\n\]+Argument N means do this N times \\(or till program stops for another reason\\)\." "help step #1"
# test help search
-gdb_test "help search" "Search for regular expression .see regex.3.. from last line listed..*" "help search"
+gdb_test "help search" "Search for regular expression \\(see regex\\(3\\)\\) from last line listed\..*" "help search"
# test help section
-gdb_test "help section" "Change the base address of section SECTION of the exec file to ADDR..*\[\r\n\]+This can be used if the exec file does not contain section addresses,.*\[\r\n\]+.such as in the a.out format., or when the addresses specified in the.*\[\r\n\]+file itself are wrong. Each section must be changed separately. The.*\[\r\n\]+``info files'' command lists all the sections and their addresses." "help section"
+gdb_test "help section" "Change the base address of section SECTION of the exec file to ADDR\.\[\r\n\]+This can be used if the exec file does not contain section addresses,\[\r\n\]+\\(such as in the a\.out format\\), or when the addresses specified in the\[\r\n\]+file itself are wrong\. Each section must be changed separately\. The\[\r\n\]+``info files'' command lists all the sections and their addresses\." "help section"
#test help set annotate
-gdb_test "help set annotate" "Set annotation_level.*\[\r\n\]+0 == normal; 1 == fullname \\(for use when running under emacs\\).*\[\r\n\]+2 == output annotated suitably for use by programs that control GDB." "help set annotate"
+gdb_test "help set annotate" "Set annotation_level\.\[\r\n\]+0 == normal; 1 == fullname \\(for use when running under emacs\\)\[\r\n\]+2 == output annotated suitably for use by programs that control GDB\." "help set annotate"
# test help set args
-gdb_test "help set args" "Set argument list to give program being debugged when it is started..*\[\r\n\]+Follow this command with any number of args, to be passed to the program."
+gdb_test "help set args" "Set argument list to give program being debugged when it is started\.\[\r\n\]+Follow this command with any number of args, to be passed to the program\."
# test help set check "c" abbreviation
-gdb_test "help set c" "Set the status of the type/range checker.*\[\r\n\]+List of set check subcommands:.*\[\r\n\]+set check range -- Set range checking.*\[\r\n\]+set check type -- Set type checking.*\[\r\n\]+Type \"help set check\" followed by set check subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help set check \"c\" abbreviation"
+gdb_test "help set c" "Set the status of the type/range checker\.\[\r\n\]+List of set check subcommands:\[\r\n\]+set check range -- Set range checking\[\r\n\]+set check type -- Set type checking\[\r\n\]+Type \"help set check\" followed by set check subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help set check \"c\" abbreviation"
# test help set check "ch" abbreviation
-gdb_test "help set ch" "Set the status of the type/range checker.*\[\r\n\]+List of set check subcommands:.*\[\r\n\]+set check range -- Set range checking.*\[\r\n\]+set check type -- Set type checking.*\[\r\n\]+Type \"help set check\" followed by set check subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help set check \"ch\" abbreviation"
+gdb_test "help set ch" "Set the status of the type/range checker\.\[\r\n\]+List of set check subcommands:\[\r\n\]+set check range -- Set range checking\[\r\n\]+set check type -- Set type checking\[\r\n\]+Type \"help set check\" followed by set check subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help set check \"ch\" abbreviation"
# test help set check
-gdb_test "help set check" "Set the status of the type/range checker.*\[\r\n\]+List of set check subcommands:.*\[\r\n\]+set check range -- Set range checking.*\[\r\n\]+set check type -- Set type checking.*\[\r\n\]+Type \"help set check\" followed by set check subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help set check"
+gdb_test "help set check" "Set the status of the type/range checker\.\[\r\n\]+List of set check subcommands:\[\r\n\]+set check range -- Set range checking\[\r\n\]+set check type -- Set type checking\[\r\n\]+Type \"help set check\" followed by set check subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help set check"
# test help set check range
-gdb_test "help set check range" "Set range checking. .on/warn/off/auto." "help set check range"
+gdb_test "help set check range" "Set range checking\. \\(on/warn/off/auto\\)" "help set check range"
# test help set check type
-gdb_test "help set check type" "Set type checking. .on/warn/off/auto." "help set check type"
+gdb_test "help set check type" "Set type checking\. \\(on/warn/off/auto\\)." "help set check type"
# test help set complaints
-gdb_test "help set complaints" "Set max number of complaints about incorrect symbols." "help set complaints"
+gdb_test "help set complaints" "Set max number of complaints about incorrect symbols\." "help set complaints"
# test help set confirm
-gdb_test "help set confirm" "Set whether to confirm potentially dangerous operations." "help set confirm"
+gdb_test "help set confirm" "Set whether to confirm potentially dangerous operations\." "help set confirm"
# test help set editing
-gdb_test "help set editing" "Set editing of command lines as they are typed..*\[\r\n\]+Use \"on\" to enable the editing, and \"off\" to disable it..*\[\r\n\]+Without an argument, command line editing is enabled. To edit, use.*\[\r\n\]+EMACS-like or VI-like commands like control-P or ESC." "help set editing"
+gdb_test "help set editing" "Set editing of command lines as they are typed\.\[\r\n\]+Use \"on\" to enable the editing, and \"off\" to disable it\.\[\r\n\]+Without an argument, command line editing is enabled\. To edit, use\[\r\n\]+EMACS-like or VI-like commands like control-P or ESC\." "help set editing"
# test help set environment
-gdb_test "help set environment" "Set environment variable value to give the program..*\[\r\n\]+Arguments are VAR VALUE where VAR is variable name and VALUE is value..*\[\r\n\]+VALUES of environment variables are uninterpreted strings..*\[\r\n\]+This does not affect the program until the next \"run\" command." "help set environment"
+gdb_test "help set environment" "Set environment variable value to give the program\.\[\r\n\]+Arguments are VAR VALUE where VAR is variable name and VALUE is value\.\[\r\n\]+VALUES of environment variables are uninterpreted strings\.\[\r\n\]+This does not affect the program until the next \"run\" command\." "help set environment"
# test help set height
-gdb_test "help set height" "Set number of lines gdb thinks are in a page." "help set height"
+gdb_test "help set height" "Set number of lines gdb thinks are in a page\." "help set height"
# test help set history expansion
-gdb_test "help set history expansion" "Set history expansion on command input..*\[\r\n\]+Without an argument, history expansion is enabled." "help set history expansion"
+gdb_test "help set history expansion" "Set history expansion on command input\.\[\r\n\]+Without an argument, history expansion is enabled\." "help set history expansion"
# test help set history filename
-gdb_test "help set history filename" "Set the filename in which to record the command history.*\[\r\n\]+ .the list of previous commands of which a record is kept.." "help set history filename"
+gdb_test "help set history filename" "Set the filename in which to record the command history\[\r\n\]+\\(the list of previous commands of which a record is kept\\)\." "help set history filename"
# test help set history save
-gdb_test "help set history save" "Set saving of the history record on exit..*\[\r\n\]+Use \"on\" to enable the saving, and \"off\" to disable it..*\[\r\n\]+Without an argument, saving is enabled." "help set history save"
+gdb_test "help set history save" "Set saving of the history record on exit\.\[\r\n\]+Use \"on\" to enable the saving, and \"off\" to disable it\.\[\r\n\]+Without an argument, saving is enabled\." "help set history save"
# test help set history size
-gdb_test "help set history size" "Set the size of the command history, .*\[\r\n\]+ie. the number of previous commands to keep a record of." "help set history size"
+gdb_test "help set history size" "Set the size of the command history,\[\r\n\]+ie\. the number of previous commands to keep a record of\." "help set history size"
# test help set history
-gdb_test "help set history" "Generic command for setting command history parameters..*\[\r\n\]+List of set history subcommands:.*\[\r\n\]+set history expansion -- Set history expansion on command input.*\[\r\n\]+set history filename -- Set the filename in which to record the command history.*\[\r\n\]+set history save -- Set saving of the history record on exit.*\[\r\n\]+set history size -- Set the size of the command history.*\[\r\n\]+Type \"help set history\" followed by set history subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help set history"
+gdb_test "help set history" "Generic command for setting command history parameters\.\[\r\n\]+List of set history subcommands:\[\r\n\]+set history expansion -- Set history expansion on command input\[\r\n\]+set history filename -- Set the filename in which to record the command history\[\r\n\]+set history save -- Set saving of the history record on exit\[\r\n\]+set history size -- Set the size of the command history\[\r\n\]+Type \"help set history\" followed by set history subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help set history"
# test help set language
-gdb_test "help set language" "Set the current source language." "help set language"
+gdb_test "help set language" "Set the current source language\." "help set language"
# test help set listsize
-gdb_test "help set listsize" "Set number of source lines gdb will list by default." "help set listsize"
+gdb_test "help set listsize" "Set number of source lines gdb will list by default\." "help set listsize"
# test help set print "p" abbreviation
# FIXME -- Ultrix hangs randomly on this very long output from gdb and
# continues with its output only if something is sent to gdb.
# Also, if the system is slow, it may time out because the output is large.
-gdb_test "help set p" ".*\[\r\n\]+Generic command for setting how things print..*\[\r\n\]+List of set print subcommands:.*\[\r\n\]+Type \"help set print\" followed by set print subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help set print \"p\" abbreviatio"
+gdb_test "help set p" "Generic command for setting how things print\.\[\r\n\]+List of set print subcommands:.*\[\r\n\]+Type \"help set print\" followed by set print subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help set print \"p\" abbreviation"
# test help set print "pr" abbreviation
-gdb_test "help set pr" ".*\[\r\n\]+Generic command for setting how things print..*\[\r\n\]+List of set print subcommands:.*\[\r\n\]+Type \"help set print\" followed by set print subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help set print \"pr\" abbreviation"
+gdb_test "help set pr" "Generic command for setting how things print\.\[\r\n\]+List of set print subcommands:.*\[\r\n\]+Type \"help set print\" followed by set print subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help set print \"pr\" abbreviation"
# test help set print
-gdb_test "help set print" ".*\[\r\n\]+Generic command for setting how things print..*\[\r\n\]+List of set print subcommands:.*\[\r\n\]+Type \"help set print\" followed by set print subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help set print"
+gdb_test "help set print" "Generic command for setting how things print\.\[\r\n\]+List of set print subcommands:.*\[\r\n\]+Type \"help set print\" followed by set print subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help set print"
# test help set print address
-gdb_test "help set print address" "Set printing of addresses." "help set print address"
+gdb_test "help set print address" "Set printing of addresses\." "help set print address"
# test help set print array
-gdb_test "help set print array" "Set prettyprinting of arrays." "help set print array"
+gdb_test "help set print array" "Set prettyprinting of arrays\." "help set print array"
# test help set print asm-demangle
-gdb_test "help set print asm-demangle" "Set demangling of C\[+\]+ names in disassembly listings." "help set print asm-demangle"
+gdb_test "help set print asm-demangle" "Set demangling of C\[+\]+ names in disassembly listings\." "help set print asm-demangle"
# test help set print demangle
-gdb_test "help set print demangle" "Set demangling of encoded C\[+\]+ names when displaying symbols." "help set print demangle"
+gdb_test "help set print demangle" "Set demangling of encoded C\[+\]+ names when displaying symbols\." "help set print demangle"
# test help set print elements
-gdb_test "help set print elements" "Set limit on string chars or array elements to print..*\[\r\n\]+\"set print elements 0\" causes there to be no limit." "help set print elements"
+gdb_test "help set print elements" "Set limit on string chars or array elements to print\.\[\r\n\]+\"set print elements 0\" causes there to be no limit\." "help set print elements"
# test help set print object
-gdb_test "help set print object" "Set printing of object's derived type based on vtable info." "help set print object"
+gdb_test "help set print object" "Set printing of object's derived type based on vtable info\." "help set print object"
# test help set print pretty
-gdb_test "help set print pretty" "Set prettyprinting of structures." "help set print pretty"
+gdb_test "help set print pretty" "Set prettyprinting of structures\." "help set print pretty"
# test help set print sevenbit-strings
-gdb_test "help set print sevenbit-strings" "Set printing of 8-bit characters in strings as .nnn." "help set print sevenbit-strings"
+gdb_test "help set print sevenbit-strings" "Set printing of 8-bit characters in strings as \\\\nnn\." "help set print sevenbit-strings"
# test help set print union
-gdb_test "help set print union" "Set printing of unions interior to structures." "help set print union"
+gdb_test "help set print union" "Set printing of unions interior to structures\." "help set print union"
# test help set print vtbl
-gdb_test "help set print vtbl" "Set printing of C\[+\]+ virtual function tables." "help set print vtbl"
+gdb_test "help set print vtbl" "Set printing of C\[+\]+ virtual function tables\." "help set print vtbl"
# test help set prompt
-gdb_test "help set prompt" "Set gdb's prompt" "help set prompt"
+gdb_test "help set prompt" "Set gdb's prompt" "help set prompt"
# test help set radix
-gdb_test "help set radix" "Set default input and output number radices.*\[\r\n\]+Use \'set input-radix\' or \'set output-radix\' to independently set each..*\[\r\n\]+Without an argument, sets both radices back to the default value of 10..*\[\r\n\]+" "help set radix"
+gdb_test "help set radix" "Set default input and output number radices\.\[\r\n\]+Use \'set input-radix\' or \'set output-radix\' to independently set each\.\[\r\n\]+Without an argument, sets both radices back to the default value of 10\." "help set radix"
# test help set symbol-reloading
-gdb_test "help set symbol-reloading" "Set dynamic symbol table reloading multiple times in one run." "help set symbol-reloading"
+gdb_test "help set symbol-reloading" "Set dynamic symbol table reloading multiple times in one run\." "help set symbol-reloading"
# test help set variable
-gdb_test "help set variable" ".*\[\r\n\]+Evaluate expression EXP and assign result to variable VAR, using assignment.*\[\r\n\]+syntax appropriate for the current language .VAR = EXP or VAR := EXP for.*\[\r\n\]+example.. VAR may be a debugger \"convenience\" variable .names starting.*\[\r\n\]+with \\\$., a register .a few standard names starting with \\\$., or an actual.*\[\r\n\]+variable in the program being debugged. EXP is any valid expression.*\[\r\n\]+This may usually be abbreviated to simply \"set\"." "help set variable"
+gdb_test "help set variable" "Evaluate expression EXP and assign result to variable VAR, using assignment\[\r\n\]+syntax appropriate for the current language \\(VAR = EXP or VAR := EXP for\[\r\n\]+example\\)\. VAR may be a debugger \"convenience\" variable \\(names starting\[\r\n\]+with \\\$\\), a register \\(a few standard names starting with \\\$\\), or an actual\[\r\n\]+variable in the program being debugged\. EXP is any valid expression\.\[\r\n\]+This may usually be abbreviated to simply \"set\"\." "help set variable"
# test help set verbose
-gdb_test "help set verbose" "Set verbosity." "help set verbose"
+gdb_test "help set verbose" "Set verbosity\." "help set verbose"
#test help set width
-gdb_test "help set width" "Set number of characters gdb thinks are in a line." "help set width"
+gdb_test "help set width" "Set number of characters gdb thinks are in a line\." "help set width"
# test help set write
# This is only supported on targets which use exec.o.
-gdb_test "help set write" "Set writing into executable and core files." "help set write"
+gdb_test "help set write" "Set writing into executable and core files\." "help set write"
# test help set
# FIXME -- Ultrix hangs randomly on this very long output from gdb and
# continues with its output only if something is sent to gdb.
# Also, if the system is slow, it may time out because the output is large.
-#gdb_test "help set" ".*\[\r\n\]+Evaluate expression EXP and assign result to variable VAR, using assignment.*\[\r\n\]+syntax appropriate for the current language .VAR = EXP or VAR := EXP for.*\[\r\n\]+example.. VAR may be a debugger \"convenience\" variable .names starting.*\[\r\n\]+with \\\$., a register .a few standard names starting with \\\$., or an actual.*\[\r\n\]+variable in the program being debugged. EXP is any valid expression.*\[\r\n\]+set listsize -- Set number of source lines gdb will list by default.*\[\r\n\]+Type \"help set\" followed by set subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous..*\[\r\n\]+" "help set"
+gdb_test "help set" "Evaluate expression EXP and assign result to variable VAR, using assignment\[\r\n\]+syntax appropriate for the current language \\(VAR = EXP or VAR := EXP for\[\r\n\]+example\\)\. VAR may be a debugger \"convenience\" variable \\(names starting\[\r\n\]+with \\\$\\), a register \\(a few standard names starting with \\\$\\), or an actual\[\r\n\]+variable in the program being debugged\. EXP is any valid expression.*\[\r\n\]+set listsize -- Set number of source lines gdb will list by default.*\[\r\n\]+Type \"help set\" followed by set subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous..*\[\r\n\]+" "help set"
# test help shell
-gdb_test "help shell" "Execute the rest of the line as a shell command. .*\[\r\n\]+With no arguments, run an inferior shell." "help shell"
+gdb_test "help shell" "Execute the rest of the line as a shell command\.\[\r\n\]+With no arguments, run an inferior shell\." "help shell"
#test help show annotate
-gdb_test "help show annotate" "Show annotation_level.*\[\r\n\]+0 == normal; 1 == fullname \\(for use when running under emacs\\).*\[\r\n\]+2 == output annotated suitably for use by programs that control GDB." "help show annotate"
+gdb_test "help show annotate" "Show annotation_level\.\[\r\n\]+0 == normal; 1 == fullname \\(for use when running under emacs\\)\[\r\n\]+2 == output annotated suitably for use by programs that control GDB\." "help show annotate"
# test help show args
-gdb_test "help show args" "Show argument list to give program being debugged when it is started..*\[\r\n\]+Follow this command with any number of args, to be passed to the program."
+gdb_test "help show args" "Show argument list to give program being debugged when it is started\.\[\r\n\]+Follow this command with any number of args, to be passed to the program\."
# test help show check "c" abbreviation
-gdb_test "help show c" "Show the status of the type/range checker.*\[\r\n\]+List of show check subcommands:.*\[\r\n\]+show check range -- Show range checking.*\[\r\n\]+show check type -- Show type checking.*\[\r\n\]+Type \"help show check\" followed by show check subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help show check \"c\" abbreviation"
+gdb_test "help show c" "Show the status of the type/range checker\.\[\r\n\]+List of show check subcommands:\[\r\n\]+show check range -- Show range checking\[\r\n\]+show check type -- Show type checking\[\r\n\]+Type \"help show check\" followed by show check subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help show check \"c\" abbreviation"
# test help show check
-gdb_test "help show check" "Show the status of the type/range checker.*\[\r\n\]+List of show check subcommands:.*\[\r\n\]+show check range -- Show range checking.*\[\r\n\]+show check type -- Show type checking.*\[\r\n\]+Type \"help show check\" followed by show check subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help show check"
+gdb_test "help show check" "Show the status of the type/range checker\.\[\r\n\]+List of show check subcommands:\[\r\n\]+show check range -- Show range checking\[\r\n\]+show check type -- Show type checking\[\r\n\]+Type \"help show check\" followed by show check subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help show check"
# test help show check range
-gdb_test "help show check range" "Show range checking. .on/warn/off/auto." "help show check range"
+gdb_test "help show check range" "Show range checking\. \\(on/warn/off/auto\\)" "help show check range"
# test help show check type
-gdb_test "help show check type" "Show type checking. .on/warn/off/auto." "help show check type"
+gdb_test "help show check type" "Show type checking\. \\(on/warn/off/auto\\)" "help show check type"
# test help show commands
-gdb_test "help show commands" "Show the history of commands you typed..*\[\r\n\]+You can supply a command number to start with, or a `\[+\]' to start after.*\[\r\n\]+the previous command number shown." "help show commands"
+gdb_test "help show commands" "Show the history of commands you typed\.\[\r\n\]+You can supply a command number to start with, or a `\[+\]' to start after\[\r\n\]+the previous command number shown\." "help show commands"
# test help show complaints
-gdb_test "help show complaints" "Show max number of complaints about incorrect symbols." "help show complaints"
+gdb_test "help show complaints" "Show max number of complaints about incorrect symbols\." "help show complaints"
# test help show confirm
-gdb_test "help show confirm" "Show whether to confirm potentially dangerous operations." "help show confirm"
+gdb_test "help show confirm" "Show whether to confirm potentially dangerous operations\." "help show confirm"
# test help show convenience
-gdb_test "help show convenience" "Debugger convenience .\".foo\". variables..*\[\r\n\]+These variables are created when you assign them values;.*\[\r\n\]+thus, \"print .foo=1\" gives \".foo\" the value 1. Values may be any type..*\[\r\n\]+A few convenience variables are given values automatically:.*\[\r\n\]+\"._\"holds the last address examined with \"x\" or \"info lines\",.*\[\r\n\]+\".__\" holds the contents of the last address examined with \"x\"." "help show convenience"
+gdb_test "help show convenience" "Debugger convenience \\(\"\\\$foo\"\\) variables\.\[\r\n\]+These variables are created when you assign them values;\[\r\n\]+thus, \"print \\\$foo=1\" gives \"\\\$foo\" the value 1\. Values may be any type\.\[\r\n\]+A few convenience variables are given values automatically:\[\r\n\]+\"\\\$_\"holds the last address examined with \"x\" or \"info lines\",\[\r\n\]+\"\\\$__\" holds the contents of the last address examined with \"x\"\." "help show convenience"
# test help show directories
-gdb_test "help show directories" "Current search path for finding source files..*\[\r\n\]+.cwd in the path means the current working directory..*\[\r\n\]+.cdir in the path means the compilation directory of the source file." "help show directories"
+gdb_test "help show directories" "Current search path for finding source files\.\[\r\n\]+\\\$cwd in the path means the current working directory\.\[\r\n\]+\\\$cdir in the path means the compilation directory of the source file\." "help show directories"
# test help show editing
-gdb_test "help show editing" "Show editing of command lines as they are typed..*\[\r\n\]+Use \"on\" to enable the editing, and \"off\" to disable it..*\[\r\n\]+Without an argument, command line editing is enabled. To edit, use.*\[\r\n\]+EMACS-like or VI-like commands like control-P or ESC." "help show editing"
+gdb_test "help show editing" "Show editing of command lines as they are typed\.\[\r\n\]+Use \"on\" to enable the editing, and \"off\" to disable it\.\[\r\n\]+Without an argument, command line editing is enabled\. To edit, use\[\r\n\]+EMACS-like or VI-like commands like control-P or ESC\." "help show editing"
# test help show environment
-gdb_test "help show environment" "The environment to give the program, or one variable's value..*\[\r\n\]+With an argument VAR, prints the value of environment variable VAR to.*\[\r\n\]+give the program being debugged. With no arguments, prints the entire.*\[\r\n\]+environment to be given to the program." "help show environment"
+gdb_test "help show environment" "The environment to give the program, or one variable's value\.\[\r\n\]+With an argument VAR, prints the value of environment variable VAR to\[\r\n\]+give the program being debugged\. With no arguments, prints the entire\[\r\n\]+environment to be given to the program\." "help show environment"
# test help show height
-gdb_test "help show height" "Show number of lines gdb thinks are in a page." "help show height"
+gdb_test "help show height" "Show number of lines gdb thinks are in a page\." "help show height"
# test help show history expansion
-gdb_test "help show history expansion" "Show history expansion on command input..*\[\r\n\]+Without an argument, history expansion is enabled." "help show history expansion"
+gdb_test "help show history expansion" "Show history expansion on command input\.\[\r\n\]+Without an argument, history expansion is enabled\." "help show history expansion"
# test help show history filename
-gdb_test "help show history filename" "Show the filename in which to record the command history.*\[\r\n\]+ .the list of previous commands of which a record is kept.." "help show history filename"
+gdb_test "help show history filename" "Show the filename in which to record the command history\[\r\n\]+\\(the list of previous commands of which a record is kept\\)\." "help show history filename"
# test help show history save
-gdb_test "help show history save" "Show saving of the history record on exit..*\[\r\n\]+Use \"on\" to enable the saving, and \"off\" to disable it..*\[\r\n\]+Without an argument, saving is enabled." "help show history save"
+gdb_test "help show history save" "Show saving of the history record on exit\.\[\r\n\]+Use \"on\" to enable the saving, and \"off\" to disable it\.\[\r\n\]+Without an argument, saving is enabled\." "help show history save"
# test help show history size
-gdb_test "help show history size" "Show the size of the command history, .*\[\r\n\]+ie. the number of previous commands to keep a record of." "help show history size"
+gdb_test "help show history size" "Show the size of the command history,\[\r\n\]+ie\. the number of previous commands to keep a record of\." "help show history size"
# test help show history
-gdb_test "help show history" "Generic command for showing command history parameters..*\[\r\n\]+List of show history subcommands:.*\[\r\n\]+show history expansion -- Show history expansion on command input.*\[\r\n\]+show history filename -- Show the filename in which to record the command history.*\[\r\n\]+show history save -- Show saving of the history record on exit.*\[\r\n\]+show history size -- Show the size of the command history.*\[\r\n\]+Type \"help show history\" followed by show history subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help show history"
+gdb_test "help show history" "Generic command for showing command history parameters\.\[\r\n\]+List of show history subcommands:\[\r\n\]+show history expansion -- Show history expansion on command input\[\r\n\]+show history filename -- Show the filename in which to record the command history\[\r\n\]+show history save -- Show saving of the history record on exit\[\r\n\]+show history size -- Show the size of the command history\[\r\n\]+Type \"help show history\" followed by show history subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help show history"
# test help show language
-gdb_test "help show language" "Show the current source language." "help show language"
+gdb_test "help show language" "Show the current source language\." "help show language"
# test help show listsize
-gdb_test "help show listsize" "Show number of source lines gdb will list by default." "help show listsize"
+gdb_test "help show listsize" "Show number of source lines gdb will list by default\." "help show listsize"
# test help show print "p" abbreviation
-gdb_test "help show p" "Generic command for showing print settings..*\[\r\n\]+List of show print subcommands:.*\[\r\n\]+Type \"help show print\" followed by show print subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help show print \"p\" abbreviation"
+gdb_test "help show p" "Generic command for showing print settings\.\[\r\n\]+List of show print subcommands:.*\[\r\n\]+Type \"help show print\" followed by show print subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help show print \"p\" abbreviation"
# test help show print "pr" abbreviation
-gdb_test "help show pr" "Generic command for showing print settings..*\[\r\n\]+List of show print subcommands:.*\[\r\n\]+Type \"help show print\" followed by show print subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help show print \"pr\" abbreviation"
+gdb_test "help show pr" "Generic command for showing print settings\.\[\r\n\]+List of show print subcommands:.*\[\r\n\]+Type \"help show print\" followed by show print subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help show print \"pr\" abbreviation"
# test help show print
-gdb_test "help show print" "Generic command for showing print settings..*\[\r\n\]+List of show print subcommands:.*\[\r\n\]+Type \"help show print\" followed by show print subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help show print"
+gdb_test "help show print" "Generic command for showing print settings\.\[\r\n\]+List of show print subcommands:.*\[\r\n\]+Type \"help show print\" followed by show print subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help show print"
# test help show paths
-gdb_test "help show paths" "Current search path for finding object files..*\[\r\n\]+.cwd in the path means the current working directory..*\[\r\n\]+This path is equivalent to the .PATH shell variable. It is a list of.*\[\r\n\]+directories, separated by colons. These directories are searched to find.*\[\r\n\]+fully linked executable files and separately compiled object files as needed." "help show paths"
+gdb_test "help show paths" "Current search path for finding object files\.\[\r\n\]+\\\$cwd in the path means the current working directory\.\[\r\n\]+This path is equivalent to the \\\$PATH shell variable\. It is a list of\[\r\n\]+directories, separated by colons\. These directories are searched to find\[\r\n\]+fully linked executable files and separately compiled object files as needed\." "help show paths"
# test help show print address
-gdb_test "help show print address" "Show printing of addresses." "help show print address"
+gdb_test "help show print address" "Show printing of addresses\." "help show print address"
# test help show print array
-gdb_test "help show print array" "Show prettyprinting of arrays." "help show print array"
+gdb_test "help show print array" "Show prettyprinting of arrays\." "help show print array"
# test help show print asm-demangle
-gdb_test "help show print asm-demangle" "Show demangling of C\[+\]+ names in disassembly listings." "help show print asm-demangle"
+gdb_test "help show print asm-demangle" "Show demangling of C\[+\]+ names in disassembly listings\." "help show print asm-demangle"
# test help show print demangle
-gdb_test "help show print demangle" "Show demangling of encoded C\[+\]+ names when displaying symbols." "help show print demangle"
+gdb_test "help show print demangle" "Show demangling of encoded C\[+\]+ names when displaying symbols\." "help show print demangle"
# test help show print elements
-gdb_test "help show print elements" "Show limit on string chars or array elements to print..*\[\r\n\]+\"set print elements 0\" causes there to be no limit." "help show print elements"
+gdb_test "help show print elements" "Show limit on string chars or array elements to print\.\[\r\n\]+\"set print elements 0\" causes there to be no limit\." "help show print elements"
# test help show print object
-gdb_test "help show print object" "Show printing of object's derived type based on vtable info." "help show print object"
+gdb_test "help show print object" "Show printing of object's derived type based on vtable info\." "help show print object"
# test help show print pretty
-gdb_test "help show print pretty" "Show prettyprinting of structures." "help show print pretty"
+gdb_test "help show print pretty" "Show prettyprinting of structures\." "help show print pretty"
# test help show print sevenbit-strings
-gdb_test "help show print sevenbit-strings" "Show printing of 8-bit characters in strings as .nnn." "help show print sevenbit-strings"
+gdb_test "help show print sevenbit-strings" "Show printing of 8-bit characters in strings as \\\\nnn\." "help show print sevenbit-strings"
# test help show print union
-gdb_test "help show print union" "Show printing of unions interior to structures." "help show print union"
+gdb_test "help show print union" "Show printing of unions interior to structures\." "help show print union"
# test help show print vtbl
-gdb_test "help show print vtbl" "Show printing of C\[+\]+ virtual function tables." "help show print vtbl"
+gdb_test "help show print vtbl" "Show printing of C\[+\]+ virtual function tables\." "help show print vtbl"
# test help show prompt
-gdb_test "help show prompt" "Show gdb's prompt" "help show prompt"
+gdb_test "help show prompt" "Show gdb's prompt" "help show prompt"
# test help show radix
-gdb_test "help show radix" "Show the default input and output number radices.*\[\r\n\]+Use \'show input-radix\' or \'show output-radix\' to independently show each.*\[\r\n\]+" "help show radix"
+gdb_test "help show radix" "Show the default input and output number radices\.\[\r\n\]+Use \'show input-radix\' or \'show output-radix\' to independently show each\." "help show radix"
# test help show symbol-reloading
-gdb_test "help show symbol-reloading" "Show dynamic symbol table reloading multiple times in one run." "help show symbol-reloading"
+gdb_test "help show symbol-reloading" "Show dynamic symbol table reloading multiple times in one run\." "help show symbol-reloading"
# test help show user
-gdb_test "help show user" "Show definitions of user defined commands..*\[\r\n\]+Argument is the name of the user defined command..*\[\r\n\]+With no argument, show definitions of all user defined commands." "help show user"
+gdb_test "help show user" "Show definitions of user defined commands\.\[\r\n\]+Argument is the name of the user defined command\.\[\r\n\]+With no argument, show definitions of all user defined commands\." "help show user"
# test help show values
-gdb_test "help show values" "Elements of value history around item number IDX .or last ten.." "help show values"
+gdb_test "help show values" "Elements of value history around item number IDX \\(or last ten\\)\." "help show values"
# test help show verbose
-gdb_test "help show verbose" "Show verbosity..*" "help show verbose"
+gdb_test "help show verbose" "Show verbosity\." "help show verbose"
# test help show version
-gdb_test "help show version" "Show what version of GDB this is." "help show version"
+gdb_test "help show version" "Show what version of GDB this is\." "help show version"
# test help show width
-gdb_test "help show width" "Show number of characters gdb thinks are in a line." "help show width"
+gdb_test "help show width" "Show number of characters gdb thinks are in a line\." "help show width"
# test help show write
# This is only supported on targets which use exec.o.
-gdb_test "help show write" "Show writing into executable and core files." "help show write"
+gdb_test "help show write" "Show writing into executable and core files\." "help show write"
# test help show
# FIXME -- Ultrix hangs randomly on this very long output from gdb and
# continues with its output only if something is sent to gdb.
# Also, if the system is slow, it may time out because the output is large.
-#gdb_test "help show" "Generic command for showing things about the debugger..*\[\r\n\]+List of show subcommands:.*\[\r\n\]+show listsize -- Show number of source lines gdb will list by default.*\[\r\n\]+show directories -- Current search path for finding source files.*\[\r\n\]+Type \"help show\" followed by show subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help show"
+gdb_test "help show" "Generic command for showing things about the debugger\.\[\r\n\]+List of show subcommands:.*\[\r\n\]+show directories -- Current search path for finding source files.*\[\r\n\]+show listsize -- Show number of source lines gdb will list by default.*\[\r\n\]+Type \"help show\" followed by show subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help show"
# test help step
-gdb_test "help step" "Step program until it reaches a different source line..*\[\r\n\]+Argument N means do this N times .or till program stops for another reason.." "help step #2"
+gdb_test "help step" "Step program until it reaches a different source line\.\[\r\n\]+Argument N means do this N times \\(or till program stops for another reason\\)\." "help step #2"
# test help stepi "si" abbreviation
-gdb_test "help si" "Step one instruction exactly..*\[\r\n\]+Argument N means do this N times .or till program stops for another reason.." "help stepi \"si\" abbreviation"
+gdb_test "help si" "Step one instruction exactly\.\[\r\n\]+Argument N means do this N times \\(or till program stops for another reason\\)\." "help stepi \"si\" abbreviation"
# test help stepi
-gdb_test "help stepi" "Step one instruction exactly..*\[\r\n\]+Argument N means do this N times .or till program stops for another reason.." "help stepi"
+gdb_test "help stepi" "Step one instruction exactly\.\[\r\n\]+Argument N means do this N times \\(or till program stops for another reason\\)\." "help stepi"
# test help signal
-gdb_test "help signal" "Continue program giving it signal.*" "help signal"
+gdb_test "help signal" "Continue program giving it signal.*" "help signal"
# test help source
# vxgdb reads .vxgdbinit
-gdb_test "help source" "Read commands from a file named FILE..*\[\r\n\]+Note that the file \"\[^\"\]*\" is read automatically in this way.*\[\r\n\]+when gdb is started." "help source"
+gdb_test "help source" "Read commands from a file named FILE\.\[\r\n\]+Note that the file \"\[^\"\]*\" is read automatically in this way\[\r\n\]+when gdb is started\." "help source"
# test help stack
-gdb_test "help stack" "Examining the stack..*\[\r\n\]+When the program being debugged stops, gdb selects the innermost frame..*\[\r\n\]+The commands below can be used to select other frames by number or address..*\[\r\n\]+List of commands:.*\[\r\n\]+backtrace -- Print backtrace of all stack frames.*\[\r\n\]+bt -- Print backtrace of all stack frames.*\[\r\n\]+down -- Select and print stack frame called by this one.*\[\r\n\]+frame -- Select and print a stack frame.*\[\r\n\]+return -- Make selected stack frame return to its caller.*\[\r\n\]+select-frame -- Select a stack frame without printing anything.*\[\r\n\]+up -- Select and print stack frame that called this one.*\[\r\n\]+Type \"help\" followed by command name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help stack"
+gdb_test "help stack" "Examining the stack\..*\[\r\n\]+When the program being debugged stops, gdb selects the innermost frame\.\[\r\n\]+The commands below can be used to select other frames by number or address\.\[\r\n\]+List of commands:\[\r\n\]+backtrace -- Print backtrace of all stack frames\[\r\n\]+bt -- Print backtrace of all stack frames\[\r\n\]+down -- Select and print stack frame called by this one\[\r\n\]+frame -- Select and print a stack frame\[\r\n\]+return -- Make selected stack frame return to its caller\[\r\n\]+select-frame -- Select a stack frame without printing anything\[\r\n\]+up -- Select and print stack frame that called this one\[\r\n\]+Type \"help\" followed by command name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help stack"
# test help status
-gdb_test "help status" "Status inquiries..*\[\r\n\]+List of commands:.*\[\r\n\]+info -- Generic command for showing things about the program being debugged.*\[\r\n\]+show -- Generic command for showing things about the debugger.*\[\r\n\]+Type \"help\" followed by command name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help status"
+gdb_test "help status" "Status inquiries\.\[\r\n\]+List of commands:\[\r\n\]+info -- Generic command for showing things about the program being debugged.*\[\r\n\]+show -- Generic command for showing things about the debugger\[\r\n\]+Type \"help\" followed by command name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help status"
+
# test help support
# FIXME -- Ultrix hangs randomly on this very long output from gdb and
# continues with its output only if something is sent to gdb.
# Also, if the system is slow, it may time out because the output is large.
-#gdb_test "help support" "Support facilities..*\[\r\n\]+List of commands:.*\[\r\n\]+show confirm -- Show whether to confirm potentially dangerous operations.*\[\r\n\]+show history -- Generic command for showing command history parameters.*\[\r\n\]+down-silently -- Same as the `down' command.*\[\r\n\]+up-silently -- Same as the `up' command.*\[\r\n\]+Type \"help\" followed by command name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help support"
+gdb_test "help support" "Support facilities\.\[\r\n\]+List of commands:.*\[\r\n\]+show confirm -- Show whether to confirm potentially dangerous operations.*\[\r\n\]+show history -- Generic command for showing command history parameters.*\[\r\n\]+Type \"help\" followed by command name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help support"
# test help symbol-file
-gdb_test "help symbol-file" "Load symbol table from executable file FILE..*\[\r\n\]+The `file' command can also load symbol tables, as well as setting the file.*\[\r\n\]+to execute." "help symbol-file"
+gdb_test "help symbol-file" "Load symbol table from executable file FILE\.\[\r\n\]+The `file' command can also load symbol tables, as well as setting the file\[\r\n\]+to execute\." "help symbol-file"
# test help target child
-gdb_test "help target child" "Unix child process .started by the \"run\" command..*|Undefined target command: \"child\". Try \"help target\"." "help target child"
+gdb_test "help target child" "Unix child process \\(started by the \"run\" command\\)\.|Undefined target command: \"child\"\. Try \"help target\"\." "help target child"
# test help target procfs
-gdb_test "help target procfs" "Unix /proc child process .started by the \"run\" command.*|Undefined target command: \"procfs\". Try \"help target\"." "help target procfs (procfs version)"
+gdb_test "help target procfs" "Unix /proc child process \\(started by the \"run\" command\\)\.|Undefined target command: \"procfs\"\. Try \"help target\"\." "help target procfs (procfs version)"
# test help target core
-gdb_test "help target core" ".*Use a core file as a target.*Specify the filename of the core file.*|(Undefined target command: \"core\". Try \"help target\".)" "help target core"
+gdb_test "help target core" "Use a core file as a target\. Specify the filename of the core file\.|(Undefined target command: \"core\"\. Try \"help target\"\.)" "help target core"
# test help target exec
-gdb_test "help target exec" "Use an executable file as a target..*\[\r\n\]+Specify the filename of the executable file." "help target exec"
+gdb_test "help target exec" "Use an executable file as a target\.\[\r\n\]+Specify the filename of the executable file\." "help target exec"
# test help target remote
-gdb_test "help target remote" "Use a remote computer via a serial line, using a gdb-specific protocol..*\[\r\n\]+Specify the serial device it is connected to.*\[\r\n\]+.e.g. .*" "help target remote"
+gdb_test "help target remote" "Use a remote computer via a serial line, using a gdb-specific protocol\.\[\r\n\]+Specify the serial device it is connected to\[\r\n\]+\\(e.g. .*" "help target remote"
# test help target
# the child process target may be "target child" or "target procfs"
-gdb_test "help target" "Connect to a target machine or process..*\[\r\n\]+The first argument is the type or protocol of the target machine..*\[\r\n\]+Remaining arguments are interpreted by the target protocol. For more.*\[\r\n\]+information on the arguments for a particular protocol, type.*\[\r\n\]+`help target ' followed by the protocol name..*\[\r\n\]+List of target subcommands:.*\[\r\n\]+target exec -- Use an executable file as a target.*\[\r\n\]+Type \"help target\" followed by target subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help target"
+gdb_test "help target" "Connect to a target machine or process\.\[\r\n\]+The first argument is the type or protocol of the target machine\.\[\r\n\]+Remaining arguments are interpreted by the target protocol\. For more\[\r\n\]+information on the arguments for a particular protocol, type\[\r\n\]+`help target ' followed by the protocol name\.\[\r\n\]+List of target subcommands:.*\[\r\n\]+target exec -- Use an executable file as a target.*\[\r\n\]+Type \"help target\" followed by target subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help target"
# test help tbreak
-gdb_test "help tbreak" "Set a temporary breakpoint.*" "help tbreak"
+gdb_test "help tbreak" "Set a temporary breakpoint.*" "help tbreak"
# test help tty
-gdb_test "help tty" "Set terminal for future runs of program being debugged." "help tty"
+gdb_test "help tty" "Set terminal for future runs of program being debugged\." "help tty"
# test help until "u" abbreviation
-gdb_test "help u" "Execute until the program reaches a source line greater than the current.*\[\r\n\]+or a specified line or address or function .same args as break command...*\[\r\n\]+Execution will also stop upon exit from the current stack frame." "help until \"u\" abbreviation"
+gdb_test "help u" "Execute until the program reaches a source line greater than the current\[\r\n\]+or a specified line or address or function \\(same args as break command\\)\.\[\r\n\]+Execution will also stop upon exit from the current stack frame\." "help until \"u\" abbreviation"
# test help until
-gdb_test "help until" "Execute until the program reaches a source line greater than the current.*\[\r\n\]+or a specified line or address or function .same args as break command...*\[\r\n\]+Execution will also stop upon exit from the current stack frame." "help until"
+gdb_test "help until" "Execute until the program reaches a source line greater than the current\[\r\n\]+or a specified line or address or function \\(same args as break command\\)\.\[\r\n\]+Execution will also stop upon exit from the current stack frame\." "help until"
# test help undisplay
-gdb_test "help undisplay" "Cancel some expressions to be displayed when program stops..*\[\r\n\]+Arguments are the code numbers of the expressions to stop displaying..*\[\r\n\]+No argument means cancel all automatic-display expressions..*\[\r\n\]+\"delete display\" has the same effect as this command..*\[\r\n\]+Do \"info display\" to see current list of code numbers." "help undisplay"
+gdb_test "help undisplay" "Cancel some expressions to be displayed when program stops\.\[\r\n\]+Arguments are the code numbers of the expressions to stop displaying\.\[\r\n\]+No argument means cancel all automatic-display expressions\.\[\r\n\]+\"delete display\" has the same effect as this command\.\[\r\n\]+Do \"info display\" to see current list of code numbers\." "help undisplay"
# test help unset environment
-gdb_test "help unset environment" "Cancel environment variable VAR for the program..*\[\r\n\]+This does not affect the program until the next \"run\" command." "help unset environment"
+gdb_test "help unset environment" "Cancel environment variable VAR for the program\.\[\r\n\]+This does not affect the program until the next \"run\" command\." "help unset environment"
# test help unset
-gdb_test "help unset" "Complement to certain \"set\" commands.*\[\r\n\]+List of unset subcommands:.*\[\r\n\]+unset environment -- Cancel environment variable VAR for the program.*\[\r\n\]+Type \"help unset\" followed by unset subcommand name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help unset"
+gdb_test "help unset" "Complement to certain \"set\" commands\.\[\r\n\]+List of unset subcommands:\[\r\n\]+unset environment -- Cancel environment variable VAR for the program\[\r\n\]+Type \"help unset\" followed by unset subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help unset"
# test help up
-gdb_test "help up" "Select and print stack frame that called this one..*\[\r\n\]+An argument says how many frames up to go." "help up"
+gdb_test "help up" "Select and print stack frame that called this one\.\[\r\n\]+An argument says how many frames up to go\." "help up"
# test help up-silently
-gdb_test "help up-silently" "Same as the `up' command, but does not print anything..*\[\r\n\]+This is useful in command scripts." "help up-silently"
+gdb_test "help up-silently" "Same as the `up' command, but does not print anything\.\[\r\n\]+This is useful in command scripts\." "help up-silently"
# test help user-defined
-gdb_test "help user-defined" "User-defined commands..*\[\r\n\]+The commands in this class are those defined by the user..*\[\r\n\]+Use the \"define\" command to define a command..*\[\r\n\]+List of commands:.*\[\r\n\]+Type \"help\" followed by command name for full documentation..*\[\r\n\]+Command name abbreviations are allowed if unambiguous." "help user-defined"
+gdb_test "help user-defined" "User-defined commands\.\[\r\n\]+The commands in this class are those defined by the user\.\[\r\n\]+Use the \"define\" command to define a command\.\[\r\n\]+List of commands:.*\[\r\n\]+Type \"help\" followed by command name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help user-defined"
# test help watch
-gdb_test "help watch" "Set a watchpoint for an expression..*\[\r\n\]+A watchpoint stops execution of your program whenever the value of.*\[\r\n\]+an expression changes." "help watch"
+gdb_test "help watch" "Set a watchpoint for an expression\.\[\r\n\]+A watchpoint stops execution of your program whenever the value of\[\r\n\]+an expression changes\." "help watch"
# test help whatis
-gdb_test "help whatis" "Print data type of expression EXP." "help whatis"
+gdb_test "help whatis" "Print data type of expression EXP\." "help whatis"
# test help where
-gdb_test "help where" "Print backtrace of all stack frames, or innermost COUNT frames..*\[\r\n\]+With a negative argument, print outermost -COUNT frames..*\[\r\n\]+Use of the 'full' qualifier also prints the values of the local variables." "help where"
+gdb_test "help where" "Print backtrace of all stack frames, or innermost COUNT frames\.\[\r\n\]+With a negative argument, print outermost -COUNT frames\.\[\r\n\]+Use of the 'full' qualifier also prints the values of the local variables\." "help where"
# test help x
-gdb_test "help x" "Examine memory: x/FMT ADDRESS..*\[\r\n\]+ADDRESS is an expression for the memory address to examine..*\[\r\n\]+FMT is a repeat count followed by a format letter and a size letter..*\[\r\n\]+Defaults for format and size letters are those previously used..*\[\r\n\]+Default count is 1. Default address is following last thing printed.*\[\r\n\]+with this command or \"print\"." "help x"
+gdb_test "help x" "Examine memory: x/FMT ADDRESS\.\[\r\n\]+ADDRESS is an expression for the memory address to examine\.\[\r\n\]+FMT is a repeat count followed by a format letter and a size letter\..*\[\r\n\]+Defaults for format and size letters are those previously used\.\[\r\n\]+Default count is 1\. Default address is following last thing printed\[\r\n\]+with this command or \"print\"\." "help x"
# test help info bogus-gdb-command
-gdb_test "help info bogus-gdb-command" "Undefined info command: \"bogus-gdb-command\". Try \"help info\"." "help info bogus-gdb-command"
+gdb_test "help info bogus-gdb-command" "Undefined info command: \"bogus-gdb-command\"\. Try \"help info\"\." "help info bogus-gdb-command"
# test help gotcha
-gdb_test "help gotcha" "Undefined command: \"gotcha\". Try \"help\"." "help gotcha"
+gdb_test "help gotcha" "Undefined command: \"gotcha\"\. Try \"help\"\." "help gotcha"
# test apropos regex
gdb_test "apropos \\\(print\[\^ bsiedf\\\".-\]\\\)" "handle -- Specify how to handle a signal"
# test apropos >1 word string
diff --git a/gdb/testsuite/gdb.base/list.exp b/gdb/testsuite/gdb.base/list.exp
index ddd1e36..881e0e6 100644
--- a/gdb/testsuite/gdb.base/list.exp
+++ b/gdb/testsuite/gdb.base/list.exp
@@ -1,4 +1,4 @@
-# Copyright 1992, 1994, 1995, 1996, 1997, 1998, 1999
+# Copyright 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2002
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
@@ -93,6 +93,8 @@ proc test_listsize {} {
gdb_test "show listsize" "Number of source lines gdb will list by default is 10.*" "show default list size"
# Show the default lines
+ # Note that remote targets that have debugging info for _start available will
+ # list the lines there instead of main, so we skip this test for remote targets.
# The second case is for optimized code, it is still correct.
if [is_remote target] {
@@ -162,12 +164,10 @@ proc test_listsize {} {
proc test_list_include_file {} {
global gdb_prompt
- # OBSOLETE setup_xfail "a29k-*-udi"
setup_xfail_format "DWARF 1"
setup_xfail_format "COFF"
gdb_test "list list0.h:1" "1\[ \t\]+/\[*\]+ An include file .*10\[ \t\]+bar \\(x\\+\\+\\);" "list line 1 in include file"
- # OBSOLETE setup_xfail "a29k-*-udi"
setup_xfail_format "DWARF 1"
setup_xfail_format "COFF"
gdb_test "list list0.h:100" "Line number 95 out of range; .*list0.h has 3\[67\] lines." "list message for lines past EOF"
@@ -229,7 +229,6 @@ proc test_list_function {} {
# gcc appears to generate incorrect debugging information for code
# in include files, which breaks this test.
# SunPRO cc is the second case below, it's also correct.
- # OBSOLETE setup_xfail "a29k-*-udi"
gdb_test "list main" "(5\[ \t\]+int x;.*14\[ \t\]+foo \[(\]+.*\[)\]+;|1\[ \t\]+#include .*10\[ \t\]+x = 0;)" "list function in source file 1"
# Ultrix gdb takes the second case below; it's also correct.
@@ -394,7 +393,6 @@ proc test_list_filename_and_function {} {
# gcc appears to generate incorrect debugging information for code
# in include files, which breaks this test.
# SunPRO cc is the second case below, it's also correct.
- # OBSOLETE setup_xfail "a29k-*-udi"
send_gdb "list list0.c:main\n"
gdb_expect {
-re "1\[ \t\]+#include .*10\[ \t\]+x = 0;\r\n$gdb_prompt $" {
@@ -408,7 +406,6 @@ proc test_list_filename_and_function {} {
}
# The i960 is a second case
- # OBSOLETE # The a29k-amd-udi is a second case
# Not sure what the point of having this function be unused is.
# AIX is legitimately removing it.
@@ -432,7 +429,6 @@ proc test_list_filename_and_function {} {
# SunPRO cc is the third case.
setup_xfail "rs6000-*-*" 1804
setup_xfail "powerpc-*-*" 1804
- # OBSOLETE setup_xfail "a29k-*-udi"
setup_xfail_format "DWARF 1"
setup_xfail_format "COFF"
send_gdb "list list0.h:foo\n"
@@ -454,7 +450,6 @@ proc test_list_filename_and_function {} {
}
# Ultrix gdb is the second case.
- # OBSOLETE # a29k-amd-udi is the third case.
send_gdb "list list1.c:bar\n"
gdb_expect {
-re "4\[ \t\]+void.*13\[ \t\]+\}\r\n$gdb_prompt $" {
@@ -471,7 +466,6 @@ proc test_list_filename_and_function {} {
}
# The i960 is a second case
- # OBSOLETE # The a29k-amd-udi is a second case
# Not sure what the point of having this function be unused is.
# AIX is legitimately removing it.
diff --git a/gdb/testsuite/gdb.base/long_long.exp b/gdb/testsuite/gdb.base/long_long.exp
index ff8a1f9..016b0e6 100644
--- a/gdb/testsuite/gdb.base/long_long.exp
+++ b/gdb/testsuite/gdb.base/long_long.exp
@@ -157,6 +157,11 @@ if { $sizeof_double == 8 } {
# assume the long long represents a floating point double in ARM format
gdb_test "p/f oct" ".*2.1386676354387559e\\+265.*"
+ } elseif [ istarget "xscale*-*-*" ] then {
+
+# assume the long long represents a floating point double in ARM format
+ gdb_test "p/f oct" ".*2.1386676354387559e\\+265.*"
+
} else {
# assume the long long represents a floating point double in little
diff --git a/gdb/testsuite/gdb.base/maint.exp b/gdb/testsuite/gdb.base/maint.exp
index 11a14c1..44ae25d 100644
--- a/gdb/testsuite/gdb.base/maint.exp
+++ b/gdb/testsuite/gdb.base/maint.exp
@@ -415,7 +415,7 @@ gdb_expect {
send_gdb "maint info breakpoints\n"
gdb_expect {
- -re "Num\[ \t\]+Type\[ \t\]+Disp\[ \t\]+Enb\[ \t\]+Address\[ \t\]+What\r\n1\[ \t\]+breakpoint\[ \t\]+keep\[ \t\]+y\[ \t\]+$hex in main at.*break.c:75\r\n\[ \t\]+breakpoint already hit 1 time\r\n.*$gdb_prompt $"\
+ -re "Num\[ \t\]+Type\[ \t\]+Disp\[ \t\]+Enb\[ \t\]+Address\[ \t\]+What\r\n1\[ \t\]+breakpoint\[ \t\]+keep\[ \t\]+y\[ \t\]+$hex\[ \t\]+in main at.*break.c:75\r\n\[ \t\]+breakpoint already hit 1 time\r\n.*$gdb_prompt $"\
{ pass "maint info breakpoints" }
-re "Num\[ \t\]+Type\[ \t\]+Disp\[ \t\]+Enb\[ \t\]+Address\[ \t\]+What\r\n1\[ \t\]+breakpoint\[ \t\]+keep\[ \t\]+y\[ \t\]+$hex in main at.*break.c:75\r\n\[ \t\]+breakpoint already hit 1 time\r\n-1\[ \t\]+shlib events\[ \t\]+keep\[ \t\]+y\[ \t\]+$hex.*breakpoint already hit.*$gdb_prompt $"\
{ pass "maint info breakpoints (with shlib events)" }
diff --git a/gdb/testsuite/gdb.base/opaque.exp b/gdb/testsuite/gdb.base/opaque.exp
index 668e1c3..4030b4f 100644
--- a/gdb/testsuite/gdb.base/opaque.exp
+++ b/gdb/testsuite/gdb.base/opaque.exp
@@ -1,4 +1,5 @@
-# Copyright 1992, 1994, 1995, 1996, 1997, 1999 Free Software Foundation, Inc.
+# Copyright 1992, 1994, 1995, 1996, 1997, 1999, 2002 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
@@ -85,7 +86,6 @@ proc setup_xfail_on_opaque_pointer {} {
global gcc_compiled
setup_xfail "vax-*-*" "i*86-sequent-bsd*"
- # OBSOLETE setup_xfail "a29k-*-udi"
if {!$gcc_compiled} then {
setup_xfail "alpha-*-*" "mips-sgi-irix5*"
}
diff --git a/gdb/testsuite/gdb.base/overlays.exp b/gdb/testsuite/gdb.base/overlays.exp
index a65adea..9188b27 100644
--- a/gdb/testsuite/gdb.base/overlays.exp
+++ b/gdb/testsuite/gdb.base/overlays.exp
@@ -178,6 +178,42 @@ gdb_expect {
timeout { fail "(timeout) Automatic unmapping" }
}
+# Verify that both sec1 and sec2 can be loaded simultaneously.
+proc simultaneous_pair { sec1 sec2 } {
+ global gdb_prompt
+
+ set pairname "$sec1 and $sec2 mapped simultaneously"
+ gdb_test "overlay map $sec1" "" "$pairname: map $sec1"
+ gdb_test "overlay map $sec2" "" "$pairname: map $sec2"
+
+ set seen_sec1 0
+ set seen_sec2 0
+
+ send_gdb "overlay list\n"
+ gdb_expect {
+ -re ".*[string_to_regexp $sec1], " { set seen_sec1 1; exp_continue }
+ -re ".*[string_to_regexp $sec2], " { set seen_sec2 1; exp_continue }
+ -re ".*$gdb_prompt $" {
+ if {$seen_sec1 && $seen_sec2} {
+ pass "$pairname"
+ } else {
+ fail "$pairname"
+ }
+ }
+ timeout { fail "(timeout) $pairname" }
+ }
+}
+
+simultaneous_pair .ovly0 .ovly2
+simultaneous_pair .ovly0 .ovly3
+simultaneous_pair .ovly1 .ovly2
+simultaneous_pair .ovly1 .ovly3
+
+simultaneous_pair .data00 .data02
+simultaneous_pair .data00 .data03
+simultaneous_pair .data01 .data02
+simultaneous_pair .data01 .data03
+
# test automatic mode
gdb_test "overlay auto" ""
diff --git a/gdb/testsuite/gdb.base/ovlymgr.c b/gdb/testsuite/gdb.base/ovlymgr.c
index 0b04c54..f4958ed 100644
--- a/gdb/testsuite/gdb.base/ovlymgr.c
+++ b/gdb/testsuite/gdb.base/ovlymgr.c
@@ -30,6 +30,15 @@ FlushCache (void)
#endif
}
+/* _ovly_debug_event:
+ * Debuggers may set a breakpoint here, to be notified
+ * when the overlay table has been modified.
+ */
+static void
+_ovly_debug_event (void)
+{
+}
+
/* OverlayLoad:
* Copy the overlay into its runtime region,
* and mark the overlay as "mapped".
@@ -57,7 +66,7 @@ OverlayLoad (unsigned long ovlyno)
_ovly_table[ovlyno][SIZE]);
FlushCache ();
-
+ _ovly_debug_event ();
return TRUE;
}
@@ -80,6 +89,7 @@ OverlayUnload (unsigned long ovlyno)
_ovly_table[ovlyno][VMA],
_ovly_table[ovlyno][SIZE]);
+ _ovly_debug_event ();
return TRUE;
}
diff --git a/gdb/testsuite/gdb.base/printcmds.exp b/gdb/testsuite/gdb.base/printcmds.exp
index 279816a..6c4213e 100644
--- a/gdb/testsuite/gdb.base/printcmds.exp
+++ b/gdb/testsuite/gdb.base/printcmds.exp
@@ -1,5 +1,5 @@
-# Copyright 1992, 1994, 1995, 1996, 1997, 1999, 2000
-# Free Software Foundation, Inc.
+# Copyright 1992, 1994, 1995, 1996, 1997, 1999, 2000, 2002 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
@@ -619,25 +619,16 @@ proc test_print_string_constants {} {
# (Test may involve inferior malloc() calls).
set timeout 60;
- # OBSOLETE setup_xfail "a29k-*-udi" 2416
gdb_test "p \"a string\"" " = \"a string\""
- # OBSOLETE setup_xfail "a29k-*-udi" 2416
gdb_test "p \"embedded \\000 null\"" " = \"embedded \\\\0 null\""
- # OBSOLETE setup_xfail "a29k-*-udi" 2416
gdb_test "p \"abcd\"\[2\]" " = 99 'c'"
- # OBSOLETE setup_xfail "a29k-*-udi" 2416
gdb_test "p sizeof (\"abcdef\")" " = 7"
- # OBSOLETE setup_xfail "a29k-*-udi" 2416
gdb_test "ptype \"foo\"" " = char \\\[4\\\]"
- # OBSOLETE setup_xfail "a29k-*-udi" 2416
gdb_test "p *\"foo\"" " = 102 'f'"
- # OBSOLETE setup_xfail "a29k-*-udi" 2416
gdb_test "ptype *\"foo\"" " = char"
- # OBSOLETE setup_xfail "a29k-*-udi" 2416
gdb_test "p &*\"foo\"" " = \"foo\""
setup_xfail "*-*-*"
gdb_test "ptype &*\"foo\"" "type = char \\*"
- # OBSOLETE setup_xfail "a29k-*-udi" 2416
gdb_test "p (char *)\"foo\"" " = \"foo\""
}
@@ -653,17 +644,11 @@ proc test_print_array_constants {} {
# (Test may involve inferior malloc() calls).
set timeout 60;
- # OBSOLETE setup_xfail "a29k-*-udi" 2416
gdb_test "print {'a','b','c'}" " = \"abc\""
- # OBSOLETE setup_xfail "a29k-*-udi" 2416
gdb_test_escape_braces "print {0,1,2}" " = {0, 1, 2}"
- # OBSOLETE setup_xfail "a29k-*-udi" 2416
gdb_test_escape_braces "print {(long)0,(long)1,(long)2}" " = {0, 1, 2}"
- # OBSOLETE setup_xfail "a29k-*-udi" 2416
gdb_test_escape_braces "print {{0,1,2},{3,4,5}}" " = {{0, 1, 2}, {3, 4, 5}}"
- # OBSOLETE setup_xfail "a29k-*-udi" 2416
gdb_test "print {4,5,6}\[2\]" " = 6"
- # OBSOLETE setup_xfail "a29k-*-udi" 2416
gdb_test "print *&{4,5,6}\[1\]" " = 5"
}
diff --git a/gdb/testsuite/gdb.base/ptype.exp b/gdb/testsuite/gdb.base/ptype.exp
index 2851e89..8ef738e 100644
--- a/gdb/testsuite/gdb.base/ptype.exp
+++ b/gdb/testsuite/gdb.base/ptype.exp
@@ -1,5 +1,5 @@
-# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1999, 2000
-# Free Software Foundation, Inc.
+# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1999,
+# 2000, 2002 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
@@ -174,7 +174,6 @@ gdb_test "ptype red" "type = enum \{red, green, blue\}.*" "ptype unnamed enumera
# merged into whatis.exp, or else maintenance will be a royal pain -kingdon
#setup_xfail "i960-*-*" 1821
#setup_xfail "mips-idt-*" "mips-sgi-*"
-# OBSOLETE #setup_xfail "a29k-*-*"
#send "ptype v_char\n"
#gdb_expect {
# -re "type = char.*$gdb_prompt $" { pass "ptype char" }
@@ -184,7 +183,6 @@ gdb_test "ptype red" "type = enum \{red, green, blue\}.*" "ptype unnamed enumera
#
#
#setup_xfail "mips-*-*"
-# OBSOLETE #setup_xfail "a29k-*-*"
#send "ptype v_signed_char\n"
#gdb_expect {
# -re "type = signed char.*$gdb_prompt $" { pass "ptype signed char" }
@@ -281,7 +279,6 @@ gdb_test "ptype v_int" "type = int.*" "ptype int"
#
#setup_xfail "i960-*-*" 1821
#setup_xfail "mips-idt-*" "mips-sgi-*"
-# OBSOLETE #setup_xfail "a29k-*-*"
#send "ptype v_char_array\n"
#gdb_expect {
# -re "type = char .2..*$gdb_prompt $" { pass "ptype char array" }
@@ -291,7 +288,6 @@ gdb_test "ptype v_int" "type = int.*" "ptype int"
#
#
#setup_xfail "mips-*-*"
-# OBSOLETE #setup_xfail "a29k-*-*"
#send "ptype v_signed_char_array\n"
#gdb_expect {
# -re "type = (|signed )char .2..*$gdb_prompt $" { pass "ptype signed char array" }
@@ -386,7 +382,6 @@ gdb_test "ptype t_char_array" "type = (|unsigned )char \\\[0?\\\]"
##
#setup_xfail "i960-*-*" 1821
#setup_xfail "mips-idt-*" "mips-sgi-*"
-# OBSOLETE #setup_xfail "a29k-*-*"
#send "ptype v_char_pointer\n"
#gdb_expect {
# -re "type = char \*.*$gdb_prompt $" { pass "ptype char pointer" }
@@ -396,7 +391,6 @@ gdb_test "ptype t_char_array" "type = (|unsigned )char \\\[0?\\\]"
#
#
#setup_xfail "mips-*-*"
-# OBSOLETE #setup_xfail "a29k-*-*"
#send "ptype v_signed_char_pointer\n"
#gdb_expect {
# -re "type = (|signed )char \*.*$gdb_prompt $"
diff --git a/gdb/testsuite/gdb.base/relocate.c b/gdb/testsuite/gdb.base/relocate.c
new file mode 100644
index 0000000..d202392
--- /dev/null
+++ b/gdb/testsuite/gdb.base/relocate.c
@@ -0,0 +1,17 @@
+static int static_foo = 1;
+static int static_bar = 2;
+
+int global_foo = 3;
+int global_bar = 4;
+
+int
+function_foo ()
+{
+ return 5;
+}
+
+int
+function_bar ()
+{
+ return 6;
+}
diff --git a/gdb/testsuite/gdb.base/relocate.exp b/gdb/testsuite/gdb.base/relocate.exp
new file mode 100644
index 0000000..c4e25de
--- /dev/null
+++ b/gdb/testsuite/gdb.base/relocate.exp
@@ -0,0 +1,108 @@
+# Copyright 2002 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
+
+# relocate.exp -- Expect script to test loading symbols from unrelocated
+# object files.
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set testfile relocate
+set srcfile ${srcdir}/${subdir}/${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}.o
+
+remote_exec build "rm -f ${binfile}"
+if { [gdb_compile "${srcfile}" "${binfile}" object {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+proc get_var_address { var } {
+ global gdb_prompt hex
+
+ send_gdb "print &${var}\n"
+ # Match output like:
+ # $1 = (int *) 0x0
+ # $5 = (int (*)()) 0
+ # $6 = (int (*)()) 0x24 <function_bar>
+ gdb_expect {
+ -re "\\\$\[0-9\]+ = \\(.*\\) (0|$hex)( <${var}>)?\[\r\n\]+${gdb_prompt} $"
+ {
+ pass "get address of ${var}"
+ if { $expect_out(1,string) == "0" } {
+ return "0x0"
+ } else {
+ return $expect_out(1,string)
+ }
+ }
+ -re "${gdb_prompt} $"
+ { fail "get address of ${var} (unknown output)" }
+ timeout
+ { fail "get address of ${var} (timeout)" }
+ }
+ return ""
+}
+
+
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+# Load the object file.
+gdb_test "add-symbol-file ${binfile} 0" \
+ "Reading symbols from .*${testfile}\\.o\\.\\.\\.done\\." \
+ "add-symbol-file ${testfile}.o 0" \
+ "add symbol table from file \".*${testfile}\\.o\" at\[ \t\r\n\]+\.text_addr = 0x0\[\r\n\]+\\(y or n\\) " \
+ "y"
+
+# Print the addresses of static variables.
+set static_foo_addr [get_var_address static_foo]
+set static_bar_addr [get_var_address static_bar]
+
+# Make sure they have different addresses.
+if { "${static_foo_addr}" == "${static_bar_addr}" } {
+ fail "static variables have different addresses"
+} else {
+ pass "static variables have different addresses"
+}
+
+# Print the addresses of global variables.
+set global_foo_addr [get_var_address global_foo]
+set global_bar_addr [get_var_address global_bar]
+
+# Make sure they have different addresses.
+if { "${global_foo_addr}" == "${global_bar_addr}" } {
+ fail "global variables have different addresses"
+} else {
+ pass "global variables have different addresses"
+}
+
+# Print the addresses of functions.
+set function_foo_addr [get_var_address function_foo]
+set function_bar_addr [get_var_address function_bar]
+
+# Make sure they have different addresses.
+if { "${function_foo_addr}" == "${function_bar_addr}" } {
+ fail "functions have different addresses"
+} else {
+ pass "functions have different addresses"
+}
+
+return 0
diff --git a/gdb/testsuite/gdb.base/scope.exp b/gdb/testsuite/gdb.base/scope.exp
index 1765a44..db2c7ea 100644
--- a/gdb/testsuite/gdb.base/scope.exp
+++ b/gdb/testsuite/gdb.base/scope.exp
@@ -1,5 +1,5 @@
-# Copyright 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000
-# Free Software Foundation, Inc.
+# Copyright 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002 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
@@ -515,7 +515,6 @@ proc test_at_localscopes {} {
# This test will only fail if the file was compiled by gcc, but
# there's no way to check that.
- # OBSOLETE setup_xfail "a29k-*-udi" 2423
if [gdb_test "cont" "Break.* marker4.*at .*:$decimal.*" \
"continue to marker4 in scope.exp"] then { gdb_suppress_tests }
if [gdb_test "up" ".*localscopes.*" "up from marker4 in scope.exp"] {
diff --git a/gdb/testsuite/gdb.base/shlib-call.exp b/gdb/testsuite/gdb.base/shlib-call.exp
index d5336f4..47919be 100644
--- a/gdb/testsuite/gdb.base/shlib-call.exp
+++ b/gdb/testsuite/gdb.base/shlib-call.exp
@@ -70,7 +70,12 @@ if {$gcc_compiled == 0} {
set additional_flags ""
}
} else {
- set additional_flags "additional_flags=-fpic"
+ if { ([istarget "powerpc*-*-aix*"]
+ || [istarget "rs6000*-*-aix*"]) } {
+ set additional_flags ""
+ } else {
+ set additional_flags "additional_flags=-fpic"
+ }
}
if {[gdb_compile "${srcdir}/${subdir}/${libfile}1.c" "${objdir}/${subdir}/${libfile}1.o" object [list debug $additional_flags]] != ""} {
@@ -93,7 +98,15 @@ if [istarget "hppa*-*-hpux*"] {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
}
-if {[gdb_compile "${objdir}/${subdir}/${testfile}.o ${objdir}/${subdir}/${libfile}1.sl ${objdir}/${subdir}/${libfile}2.sl" "${binfile}" executable {debug}] != ""} {
+
+if { ($gcc_compiled
+ && ([istarget "powerpc*-*-aix*"]
+ || [istarget "rs6000*-*-aix*"] )) } {
+ set additional_flags "additional_flags=-L${objdir}/${subdir}"
+} else {
+ set additional_flags ""
+}
+if {[gdb_compile "${objdir}/${subdir}/${testfile}.o ${objdir}/${subdir}/${libfile}1.sl ${objdir}/${subdir}/${libfile}2.sl" "${binfile}" executable [list debug $additional_flags]] != ""} {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
diff --git a/gdb/testsuite/gdb.base/step-test.exp b/gdb/testsuite/gdb.base/step-test.exp
index 48af23c..9a21136 100644
--- a/gdb/testsuite/gdb.base/step-test.exp
+++ b/gdb/testsuite/gdb.base/step-test.exp
@@ -1,4 +1,4 @@
-# Copyright 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+# Copyright 1997, 1998, 1999, 2000, 2002 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
@@ -204,6 +204,12 @@ test_i "nexti over function" "nexti" \
# argument. Opinion is bitterly divided about whether this is the
# right behavior for GDB or not, but we'll catch it here, so folks
# won't forget about it.
+# Update 4/4/2002 - Regardless of which opinion you have, you would
+# probably have to agree that gdb is currently behaving as designed,
+# in the absence of additional code to not stop in functions used
+# internally by the compiler. Since the testsuite should be checking
+# for conformance to the design, the correct behavior is to accept the
+# cases where gdb stops in memcpy/bcopy.
gdb_test \
"break [gdb_get_line_number "step-test.exp: large struct by value"]" \
@@ -212,9 +218,23 @@ gdb_test \
gdb_test "continue" \
".*Breakpoint ${decimal},.*large_struct_by_value.*" \
"run to pass large struct"
-gdb_test "step" \
- ".*step-test.exp: arrive here 1.*" \
- "large struct by value"
+send_gdb "step\n"
+gdb_expect {
+ -re ".*step-test.exp: arrive here 1.*$gdb_prompt $" {
+ pass "large struct by value"
+ }
+ -re ".*(memcpy|bcopy).*$gdb_prompt $" {
+ send_gdb "finish\n" ; gdb_expect -re "$gdb_prompt $"
+ send_gdb "step\n"
+ exp_continue
+ }
+ -re ".*$gdb_prompt $" {
+ fail "large struct by value"
+ }
+ timeout {
+ fail "large struct by value (timeout)"
+ }
+}
gdb_continue_to_end "step-test.exp"
diff --git a/gdb/testsuite/gdb.base/watchpoint.exp b/gdb/testsuite/gdb.base/watchpoint.exp
index 083d807..e150d55 100644
--- a/gdb/testsuite/gdb.base/watchpoint.exp
+++ b/gdb/testsuite/gdb.base/watchpoint.exp
@@ -383,6 +383,7 @@ proc test_stepping {} {
# because we are out of the dummy by the first time the inferior
# stops.
clear_xfail "arm*-*-*"
+ clear_xfail "xscale*-*-*"
clear_xfail "d10v*-*-*"
clear_xfail "m68*-*-*"
clear_xfail "i*86*-*-*"
diff --git a/gdb/testsuite/gdb.base/whatis.exp b/gdb/testsuite/gdb.base/whatis.exp
index c2d7608..79c48e4 100644
--- a/gdb/testsuite/gdb.base/whatis.exp
+++ b/gdb/testsuite/gdb.base/whatis.exp
@@ -1,5 +1,5 @@
-# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1999
-# Free Software Foundation, Inc.
+# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1999, 2002
+# 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
@@ -85,7 +85,6 @@ if $signed_keyword_not_used then {
} else {
set signed_char "signed char"
}
-# OBSOLETE setup_xfail "a29k-*-*"
if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix*" }
gdb_test "whatis v_signed_char" \
"type = $signed_char" \
diff --git a/gdb/testsuite/gdb.c++/classes.exp b/gdb/testsuite/gdb.c++/classes.exp
index 87d533b..dbdea5d 100644
--- a/gdb/testsuite/gdb.c++/classes.exp
+++ b/gdb/testsuite/gdb.c++/classes.exp
@@ -907,7 +907,7 @@ proc do_tests {} {
-re "= 82.*$gdb_prompt $" {
pass "calling method for small class"
}
- -re "Address requested for identifier .v. which is in a register.*$gdb_prompt $" {
+ -re "Address requested for identifier .v. which is in register.*$gdb_prompt $" {
setup_xfail "*-*-*" 2972
fail "calling method for small class"
}
diff --git a/gdb/testsuite/gdb.c++/cplusfuncs.exp b/gdb/testsuite/gdb.c++/cplusfuncs.exp
index 61d26ae..9057cc2 100644
--- a/gdb/testsuite/gdb.c++/cplusfuncs.exp
+++ b/gdb/testsuite/gdb.c++/cplusfuncs.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1992, 1997, 1999, 2001 Free Software Foundation, Inc.
+# Copyright 1992, 1997, 1999, 2001, 2002 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
@@ -320,13 +320,6 @@ proc test_lookup_operator_functions {} {
global dm_type_void
global dm_type_void_star
- # OBSOLETE # # These tests don't work for COFF targets; don't even try them
- # OBSOLETE # if [istarget "a29k-*-udi"] then {
- # OBSOLETE # setup_xfail "a29k-*-udi"
- # OBSOLETE # fail "skipping operator tests"
- # OBSOLETE # return
- # OBSOLETE # }
-
# operator* requires quoting so that GDB does not treat it as a regexp.
info_func "operator\\*(" "void foo::operator*($dm_type_foo_ref);"
info_func "operator%(" "void foo::operator%($dm_type_foo_ref);"
diff --git a/gdb/testsuite/gdb.c++/hang.H b/gdb/testsuite/gdb.c++/hang.H
new file mode 100644
index 0000000..26fec87
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/hang.H
@@ -0,0 +1,12 @@
+struct A
+{
+ struct B *b_ptr_in_a;
+};
+
+struct C
+{
+ struct B
+ {
+ int member_of_B_in_C;
+ };
+};
diff --git a/gdb/testsuite/gdb.c++/hang.exp b/gdb/testsuite/gdb.c++/hang.exp
new file mode 100644
index 0000000..4c117a1
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/hang.exp
@@ -0,0 +1,128 @@
+# Copyright (C) 2002 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
+}
+
+set prms_id 0
+set bug_id 0
+
+if { [skip_cplus_tests] } { continue }
+
+set testfile hang
+set binfile ${objdir}/${subdir}/${testfile}
+
+foreach file {hang1 hang2 hang3} {
+ if {[gdb_compile "${srcdir}/${subdir}/${file}.C" "${file}.o" object {c++ debug}] != ""} {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+ }
+}
+
+if {[gdb_compile "hang1.o hang2.o hang3.o" ${binfile} executable {c++ debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+
+# As of May 1, 2002, GDB hangs trying to read the debug info for the
+# `hang2.o' compilation unit from the executable `hang', when compiled
+# by g++ 2.96 with STABS debugging info. Here's what's going on, as
+# best as I can tell.
+#
+# The definition of `struct A' in `hang.H' refers to `struct B' as an
+# incomplete type. The stabs declare type number (1,3) to be a cross-
+# reference type, `xsB:'.
+#
+# The definition of `struct C' contains a nested definition for
+# `struct B' --- or more properly, `struct C::B'. However, the stabs
+# fail to qualify the structure tag: it just looks like a definition
+# for `struct B'. I think this is a compiler bug, but perhaps GCC
+# doesn't emit qualified names for a reason.
+#
+# `hang.H' gets #included by both `hang1.C' and `hang2.C'. So the
+# stabs for `struct A', the incomplete `struct B', and `struct C'
+# appear in both hang1.o's and hang2.o's stabs.
+#
+# When those two files are linked together, since hang2.o appears
+# later in the command line, its #inclusion of `hang.H' gets replaced
+# with an N_EXCL stab, referring back to hang1.o's stabs for the
+# header file.
+#
+# When GDB builds psymtabs for the executable hang, it notes that
+# hang2.o's stabs contain an N_EXCL referring to a header that appears
+# in full in hang1.o's stabs. So hang2.o's psymtab lists a dependency
+# on hang1.o's psymtab.
+#
+# When the user types the command `print var_in_b', GDB scans the
+# psymtabs for a symbol by that name, and decides to read full symbols
+# for `hang2.o'.
+#
+# Since `hang2.o''s psymtab lists `hang1.o' as a dependency, GDB first
+# reads `hang1.o''s symbols. When GDB sees `(1,3)=xsB:', it creates a
+# type object for `struct B', sets its TYPE_FLAG_STUB flag, and
+# records it as type number `(1,3)'.
+#
+# When GDB finds the definition of `struct C::B', since the stabs
+# don't indicate that the type is nested within C, it treats it as
+# a definition of `struct B'.
+#
+# When GDB is finished reading `hang1.o''s symbols, it calls
+# `cleanup_undefined_types'. This function mistakes the definition of
+# `struct C::B' for a definition for `struct B', and overwrites the
+# incomplete type object for the real `struct B', using `memcpy'. Now
+# stabs type number `(1,3)' refers to this (incorrect) complete type.
+# Furthermore, the `memcpy' simply copies the original's `cv_type'
+# field to the target, giving the target a corrupt `cv_type' ring: the
+# chain does not point back to the target type.
+#
+# Having satisfied `hang2.o''s psymtab's dependencies, GDB begins to
+# read `hang2.o''s symbols. These contain the true definition for
+# `struct B', which refers to type number `(1,3)' as the type it's
+# defining. GDB looks up type `(1,3)', and finds the (incorrect)
+# complete type established by the call to `cleanup_undefined_types'
+# above. However, it doesn't notice that the type is already defined,
+# and passes it to `read_struct_type', which then writes the new
+# definition's size, field list, etc. into the type object which
+# already has those fields initialized. Adding insult to injury,
+# `read_struct_type' then calls `finish_cv_type'; since the `memcpy'
+# in `cleanup_undefined_types' corrupted the target type's `cv_type'
+# ring, `finish_cv_type' enters an infinite loop.
+
+# This checks that GDB recognizes when a structure is about to be
+# overwritten, and refuses, with a complaint.
+gdb_test "print var_in_b" " = 1729" "doesn't overwrite struct type"
+
+# This checks that cleanup_undefined_types doesn't create corrupt
+# cv_type chains. Note that var_in_hang3 does need to be declared in
+# a separate compilation unit, whose psymtab depends on hang1.o's
+# psymtab. Otherwise, GDB won't call cleanup_undefined_types (as it
+# finishes hang1.o's symbols) before it calls make_cv_type (while
+# reading hang3.o's symbols).
+#
+# The bug only happens when you compile with -gstabs+; Otherwise, GCC
+# won't include the `const' qualifier on `const_B_ptr' in `hang3.o''s
+# STABS, so GDB won't try to create a const variant of the smashed
+# struct type, and get caught by the corrupted cv_type chain.
+gdb_test "print var_in_hang3" " = 42" "doesn't corrupt cv_type chain"
diff --git a/gdb/testsuite/gdb.c++/hang1.C b/gdb/testsuite/gdb.c++/hang1.C
new file mode 100644
index 0000000..4b04d77
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/hang1.C
@@ -0,0 +1,3 @@
+#include "hang.H"
+
+int main (int argc, char **argv) { return 0; }
diff --git a/gdb/testsuite/gdb.c++/hang2.C b/gdb/testsuite/gdb.c++/hang2.C
new file mode 100644
index 0000000..59732f8
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/hang2.C
@@ -0,0 +1,8 @@
+#include "hang.H"
+
+struct B
+{
+ int member_of_B;
+};
+
+int var_in_b = 1729;
diff --git a/gdb/testsuite/gdb.c++/hang3.C b/gdb/testsuite/gdb.c++/hang3.C
new file mode 100644
index 0000000..92c82fa
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/hang3.C
@@ -0,0 +1,4 @@
+#include "hang.H"
+
+const struct B *const_B_ptr;
+int var_in_hang3 = 42;
diff --git a/gdb/testsuite/gdb.c++/local.cc b/gdb/testsuite/gdb.c++/local.cc
index c811deb..5bfc44a 100644
--- a/gdb/testsuite/gdb.c++/local.cc
+++ b/gdb/testsuite/gdb.c++/local.cc
@@ -56,12 +56,6 @@ int main()
il.ilc = 'b';
il.ip = &c;
+ marker1();
}
- marker1();
}
-
-
-
-
-
-
diff --git a/gdb/testsuite/gdb.c++/local.exp b/gdb/testsuite/gdb.c++/local.exp
index a93598f..091d643 100644
--- a/gdb/testsuite/gdb.c++/local.exp
+++ b/gdb/testsuite/gdb.c++/local.exp
@@ -1,4 +1,4 @@
-# Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+# Copyright 1998, 1999, 2000, 2001, 2002 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
@@ -19,6 +19,7 @@
# tests for local variables
# Written by Satish Pai <pai@apollo.hp.com> 1997-07-08
+# Cleaned by Michael Chastain <mec@shout.net> 2002-04-08
# This file is part of the gdb testsuite
@@ -68,28 +69,46 @@ if ![runto 'marker1'] then {
gdb_test "up" ".*main.*" "up from marker1"
-
-# srikanth, These tests have always been run only with aCC. Now in
-# the new scheme of things, we run it twice, once with aCC, and once
-# with g++. Flag these tests as expected failures when run with g++.
-# as these are failing now and were never known to pass with g++.
-global gcc_compiled
-if {$gcc_compiled} then {
-setup_xfail "*-*-*"
-}
-
# Local classes in g++ get names like "main.1::InnerLocal", just like local
# static variables. Some targets use "___" instead of ".".
+
+# ---
+# Pattern 1:
+# PASS
+# dwarf-2
+# gcc 2.95.3
+#
+# Pattern 2:
+# FAIL
+# This has a duplicate "char loc_foo" line. This is a bug.
+# Historically this has been an XFAIL.
+# dwarf-2
+# gcc 2.96-rh, 3.0.4, gcc-3_1-branch, HEAD
+#
+# Pattern 3:
+# PASS
+# stabs+
+# gcc 2.95.3, 2.96-rh, 3.0.4, gcc-3_1-branch, HEAD
+#
+# Pattern 4:
+# This an old pattern from the hppa aCC version of this file.
+# I left it alone.
+#
+# chastain 2002-04-08
+
set sep "(\[.\]|___)\[0-9\]"
send_gdb "ptype Local\n"
gdb_expect {
- -re "type = class Local \{\r\n\[\t \]*public:\r\n\[\t \]*int loc1;\r\n\r\n\[\t \]*.char loc_foo\\(char\\);\r\n\[\t \]*\}\[\t \]*\\(Local at.*local\\.cc:10\\).*$gdb_prompt $" { pass "ptype Local" }
- -re "type = class Local \{\r\n\[\t \]*public:\r\n\[\t \]*int loc1;\r\n\r\n\[\t \]*.char loc_foo\\(char\\);\r\n\[\t \]*\}\[\t \]*\\(Local at.*local\\.cc:\[0-9\]*\\).*$gdb_prompt $" { pass "ptype Local (incorrect line number?)" }
- -re "type = class Local \{\r\n\[\t \]*public:\r\n\[\t \]*int loc1;\r\n\r\n\[\t \]*Local & operator=\\((foobar__Fi${sep}::|)Local const &\\);\r\n\[\t \]*Local\\((foobar__Fi${sep}::|)Local const &\\);\r\n\[\t \]*Local\\(void\\);\r\n\[\t \]*char loc_foo\\(char\\);\r\n\[\t \]*\}*.*$gdb_prompt $" { pass "ptype Local" }
- -re "type = class Local \{\r\n\[\t \]*public:\r\n\[\t \]*int loc1;\r\n\r\n\[\t \]*char loc_foo\\(char\\);\r\n\[\t \]*\\(Local at.*local\\.cc:\[0-9\]*\\)\r\n\}.*$gdb_prompt $" { pass "ptype Local (aCC)" }
- -re ".*$gdb_prompt $" { fail "ptype Local" }
- timeout { fail "(timeout) ptype Local" }
+ -re "type = class Local \{\[\r\n\t \]*public:\[\r\n\t \]*int loc1;\[\r\n\t \]*char loc_foo\\((const *|)char\\);\[\r\n\t \]*\}.*$gdb_prompt $" { pass "ptype Local" }
+ -re "type = class Local \{\[\r\n\t \]*public:\[\r\n\t \]*int loc1;\[\r\n\t \]*char loc_foo\\((const *|)char\\);\[\r\n\t \]*char loc_foo\\((const *|)char\\);\[\r\n\t \]*\}.*$gdb_prompt $" {
+ # setup_kfail "gdb/483"
+ fail "ptype Local (gdb/483)"
+ }
+ -re "type = class Local \{\[\r\n\t \]*public:\[\r\n\t \]*int loc1;\[\r\n\t \]*Local & operator *=\\((foobar__Fi${sep}::|)Local const *&\\);\[\r\n\t \]*Local\\((foobar__Fi${sep}::|)Local const *&\\);\[\r\n\t \]*Local\\((void|)\\);\[\r\n\t \]*char loc_foo\\(char\\);\[\r\n\t \]*\}.*$gdb_prompt $" { pass "ptype Local" }
+ -re "type = class Local \{\r\n\[\t \]*public:\r\n\[\t \]*int loc1;\r\n\r\n\[\t \]*char loc_foo\\(char\\);\r\n\[\t \]*\\(Local at.*local\\.cc:\[0-9\]*\\)\r\n\}.*$gdb_prompt $" { xpass "ptype Local (old aCC)" }
+ -re ".*$gdb_prompt $" { fail "ptype Local" }
+ timeout { fail "(timeout) ptype Local" }
}
# DTS CLLbs14316 and CLLbs17058
@@ -99,49 +118,82 @@ gdb_expect {
# There is a number at the end of InnerLocal4 which should not be there,
# DTS CLLbs14316
# The line number for the class
-setup_xfail "hppa*-*-*" CLLbs14316
+# setup_xfail "hppa*-*-*" CLLbs14316
+
+# ---
+# Pattern 1:
+# PASS
+# dwarf-2
+# 2.95.3, 2.96-rh, 3.0.4, gcc-3_1-branch, HEAD
+#
+# Pattern 2:
+# PASS
+# stabs+
+# 2.95.3, 2.96-rh, 3.0.4, gcc-3_1-branch, HEAD
+#
+# Pattern 3:
+# Old hppa pattern.
+#
+# Pattern 4:
+# Old hppa pattern.
+#
+# chastain 2002-04-08
+
send_gdb "ptype InnerLocal\n"
gdb_expect {
- -re "type = class InnerLocal \{\r\n\[\t \]*public:\r\n\[\t \]*char ilc;\r\n\[\t \]*int \\*ip;\r\n\[\t \]*InnerLocal::NestedInnerLocal nest1;\r\n\r\n\[\t \]*.int il_foo\\(const unsigned char &\\);\r\n\[\t \]*\}\[\t \]*\\(Local at.*local\\.cc:36\\).*$gdb_prompt $" { pass "ptype InnerLocal" }
- -re "type = class InnerLocal \{\r\n\[\t \]*public:\r\n\[\t \]*char ilc;\r\n\[\t \]*int \\*ip;\r\n\[\t \]*class InnerLocal::NestedInnerLocal nest1;\r\n\r\n\[\t \]*.int il_foo\\(const unsigned char &\\);\r\n\[\t \]*\}\[\t \]*\\(Local at.*local\\.cc:36\\).*$gdb_prompt $" { pass "ptype InnerLocal" }
- -re "type = class InnerLocal \{\r\n\[\t \]*public:\r\n\[\t \]*char ilc;\r\n\[\t \]*int \\*ip;\r\n\[\t \]*InnerLocal::NestedInnerLocal nest1;\r\n\r\n\[\t \]*.int il_foo\\(const unsigned char &\\);\r\n\[\t \]*\}\[\t \]*\\(Local at.*local\\.cc:\[0-9\]*\\).*$gdb_prompt $" { pass "ptype InnerLocal (incorrect line number?" }
- -re "type = class InnerLocal \{\r\n\[\t \]*public:\r\n\[\t \]*char ilc;\r\n\[\t \]*int \\*ip;\r\n\[\t \]*class InnerLocal::NestedInnerLocal nest1;\r\n\r\n\[\t \]*.int il_foo\\(const unsigned char &\\);\r\n\[\t \]*\}\[\t \]*\\(Local at.*local\\.cc:\[0-9\]*\\).*$gdb_prompt $" { pass "ptype InnerLocal (incorrect line number?" }
- -re "type = class InnerLocal \{\r\n\[\t \]*public:\r\n\[\t \]*char ilc;\r\n\[\t \]*int \\*ip;\r\n\[\t \]*InnerLocal::NestedInnerLocal nest1;\r\n\r\n\[\t \]*.int il_foo\\(unsigned char const &\\);\r\n\[\t \]*\}\[\t \]*\\(Local at.*local\\.cc:36\\).*$gdb_prompt $" { pass "ptype InnerLocal HP aCC" }
- -re "type = class InnerLocal \{\r\n\[\t \]*public:\r\n\[\t \]*char ilc;\r\n\[\t \]*int \\*ip;\r\n\[\t \]*NestedInnerLocal nest1;\r\n\r\n\[\t \]*InnerLocal & operator=\\((main${sep}::|)InnerLocal const &\\);\r\n\[\t \]*InnerLocal\\((main${sep}::|)InnerLocal const &\\);\r\n\[\t \]*InnerLocal\\(void\\);\r\n\[\t \]*int il_foo\\(unsigned char const &\\);\r\n\*\}\r\n*.*$gdb_prompt $" { pass "ptype InnerLocal" }
- -re "type = class InnerLocal \{\r\n\[\t \]*public:\r\n\[\t \]*char ilc;\r\n\[\t \]*int \\*ip;\r\n\[\t \]*class InnerLocal4::NestedInnerLocal nest1;\r\n\r\n\[\t \]*int il_foo\\(unsigned char const &\\);\r\n\[\t \]*\\(Local at.*local\.cc:\[0-9\]+\\)\r\n\}.*$gdb_prompt $" { pass "ptype InnerLocal (aCC)" }
- -re ".*$gdb_prompt $" { fail "ptype InnerLocal" }
- timeout { fail "(timeout) ptype InnerLocal" }
+ -re "type = class InnerLocal \{\[\r\n\t \]*public:\[\r\n\t \]*char ilc;\[\r\n\t \]*int \\* *ip;\[\r\n\t \]*NestedInnerLocal nest1;\[\r\n\t \]*int il_foo\\((unsigned char const|const unsigned char) *&\\);\[\r\n\t \]*\}.*$gdb_prompt $" { pass "ptype InnerLocal" }
+ -re "type = class InnerLocal \{\[\r\n\t \]*public:\[\r\n\t \]*char ilc;\[\r\n\t \]*int \\* *ip;\[\r\n\t \]*NestedInnerLocal nest1;\[\r\n\t \]*InnerLocal *& operator *=\\((main${sep}::|)InnerLocal const *&\\);\[\r\n\t \]*InnerLocal\\((main${sep}::|)InnerLocal const *&\\);\[\r\n\t \]*InnerLocal\\((void|)\\);\[\r\n\t \]*int il_foo\\(unsigned char const *&\\);\[\r\n\t \]*\}.*$gdb_prompt $" { pass "ptype InnerLocal" }
+ -re "type = class InnerLocal \{\r\n\[\t \]*public:\r\n\[\t \]*char ilc;\r\n\[\t \]*int \\*ip;\r\n\[\t \]*InnerLocal::NestedInnerLocal nest1;\r\n\r\n\[\t \]*.int il_foo\\(unsigned char const &\\);\r\n\[\t \]*\}\[\t \]*\\(Local at.*local\\.cc:36\\).*$gdb_prompt $" { pass "ptype InnerLocal (old HP aCC)" }
+ -re "type = class InnerLocal \{\r\n\[\t \]*public:\r\n\[\t \]*char ilc;\r\n\[\t \]*int \\*ip;\r\n\[\t \]*class InnerLocal4::NestedInnerLocal nest1;\r\n\r\n\[\t \]*int il_foo\\(unsigned char const &\\);\r\n\[\t \]*\\(Local at.*local\.cc:\[0-9\]+\\)\r\n\}.*$gdb_prompt $" { pass "ptype InnerLocal (old HP aCC)" }
+ -re ".*$gdb_prompt $" { fail "ptype InnerLocal" }
+ timeout { fail "(timeout) ptype InnerLocal" }
}
+#---
+# Pattern 1:
+# PASS
+# dwarf-2
+# gcc 2.95.3, 2.96-rh, 3.0.4, gcc-3_1-branch, HEAD
+#
+# Pattern 2:
+# PASS
+# stabs+
+# gcc 2.95.3, 2.96-rh, 3.0.4, gcc-3_1-branch, HEAD
+#
+# chastain 2002-04-08
+
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" }
- -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:\[0-9\]*\\).*$gdb_prompt $" { pass "ptype NestedInnerLocal (incorrect line number?)" }
- -re "type = class NestedInnerLocal \{\r\n\[\t \]*public:\r\n\[\t \]*int nil;\r\n\r\n\[\t \]*NestedInnerLocal & operator=\\((main${sep}::InnerLocal::|)NestedInnerLocal const &\\);\r\n\[\t \]*NestedInnerLocal\\((main${sep}::InnerLocal::|)NestedInnerLocal const &\\);\r\n\[\t \]*NestedInnerLocal\\(void\\);\r\n\[\t \]*int nil_foo\\(int\\);\r\n\}\r\n*.*$gdb_prompt $" { pass "ptype NestedInnerLocal" }
- -re "No symbol.*in current context.*$gdb_prompt $" { pass "ptype NestedInnerLocal (known aCC limitation)" }
- -re ".*$gdb_prompt $" { fail "ptype NestedInnerLocal" }
- timeout { fail "(timeout) ptype NestedInnerLocal" }
-}
-
-# srikanth, These tests have always been run only with aCC. Now in
-# the new scheme of things, we run it twice, once with aCC, and once
-# with g++. Flag these tests as expected failures when run with g++.
-# as these are failing now and were never known to pass with g++.
-global gcc_compiled
-if {$gcc_compiled} then {
-setup_xfail "*-*-*"
+ -re "type = class NestedInnerLocal \{\[\r\n\t \]*public:\[\r\n\t \]*int nil;\[\r\n\t \]*int nil_foo\\(int\\);\[\r\n\t \]*\}.*$gdb_prompt $" { pass "ptype NestedInnerLocal" }
+ -re "type = class NestedInnerLocal \{\[\r\n\t \]*public:\[\r\n\t \]*int nil;\[\r\n\t \]*NestedInnerLocal *& *operator *= *\\((main${sep}::|)InnerLocal::NestedInnerLocal const *&\\);\[\r\n\t \]*NestedInnerLocal\\((main${sep}::|)InnerLocal::NestedInnerLocal const *&\\);\[\r\n\t \]*NestedInnerLocal\\((void|)\\);\[\r\n\t \]*int nil_foo\\(int\\);\[\r\n\t \]*\}.*$gdb_prompt $" { pass "ptype NestedInnerLocal" }
+ -re ".*$gdb_prompt $" { fail "ptype NestedInnerLocal" }
+ timeout { fail "(timeout) ptype NestedInnerLocal" }
}
# gdb incorrectly interprets the NestedInnerLocal in
# InnerLocal::NestedInnerLocal as field name instead of a type name;
# See CLLbs14784.
-setup_xfail *-*-* CLLbs14784
+
+#---
+# Pattern 3:
+# FAIL
+# The comment above, about CLLbs14784, is still correct.
+# dwarf-2
+# gcc 2.95.3, 2.96-rh, 3.0.4, gcc-3_1-branch, HEAD
+# stabs+
+# gcc 2.95.3, 2.96-rh, 3.0.4, gcc-3_1-branch, HEAD
+#
+# chastain 2002-04-08
+
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" }
- -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:\[0-9\]*\\).*$gdb_prompt $" { pass "ptype InnerLocal::NestedInnerLocal (incorrect line number?)" }
- -re ".*$gdb_prompt $" { fail "ptype InnerLocal::NestedInnerLocal" }
- timeout { fail "(timeout) ptype InnerLocal::NestedInnerLocal" }
+ -re "type = class InnerLocal::NestedInnerLocal \{\[\r\n\t \]*public:\[\r\n\t \]*int nil;\[\r\n\t \]*int nil_foo\\(int\\);\[\r\n\t \]*\}.*$gdb_prompt $" { pass "ptype InnerLocal::NestedInnerLocal" }
+ -re "type = class InnerLocal::NestedInnerLocal \{\[\r\n\t \]*public:\[\r\n\t \]*int nil;\[\r\n\t \]*NestedInnerLocal *& *operator *= *\\((main${sep}::|)InnerLocal::NestedInnerLocal const *&\\);\[\r\n\t \]*NestedInnerLocal\\((main${sep}::|)InnerLocal::NestedInnerLocal const *&\\);\[\r\n\t \]*NestedInnerLocal\\((void|)\\);\[\r\n\t \]*int nil_foo\\(int\\);\[\r\n\t \]*\}.*$gdb_prompt $" { pass "ptype InnerLocal::NestedInnerLocal" }
+ -re "There is no field named NestedInnerLocal.*$gdb_prompt $" {
+ # setup_kfail "gdb/482"
+ fail "ptype InnerLocal::NestedInnerLocal (gdb/482)"
+ }
+ -re "No symbol .*NestedInnerLocal.* in current context.*$gdb_prompt $" { fail "ptype InnerLocal::NestedInnerLocal (bogus symbol lookup)" }
+ -re ".*$gdb_prompt $" { fail "ptype InnerLocal::NestedInnerLocal" }
+ timeout { fail "(timeout) ptype InnerLocal::NestedInnerLocal" }
}
-
-
diff --git a/gdb/testsuite/gdb.c++/method.exp b/gdb/testsuite/gdb.c++/method.exp
index 99369a9..8deafa8 100644
--- a/gdb/testsuite/gdb.c++/method.exp
+++ b/gdb/testsuite/gdb.c++/method.exp
@@ -70,157 +70,95 @@ if ![runto_main] then {
continue
}
-send_gdb "break A::foo\n"
-gdb_expect {
- -re "Breakpoint \[0-9\]* at $hex.*file .*method.cc, line 38*\\.\r\n$gdb_prompt $" {
- pass "set breakpoint on A::foo"
- }
- -re ".*$gdb_prompt $" { fail "set breakpoint on A::foo" }
- timeout { fail "(timeout) set breakpoint on A::foo" }
-}
+gdb_test "break A::foo" \
+ "Breakpoint \[0-9\]* at $hex.*file .*method.cc, line 38\\."
-send_gdb "continue\n"
-gdb_expect {
- -re "Continuing\\.\r\n\r\nBreakpoint \[0-9\]*, A::foo(\\(int\\)|) \\(this=$hex, arg=13\\) at .*method\\.cc:38\r\n38\[\t \]*x \\+= arg;\r\n$gdb_prompt $" {
- pass "continued and got breakpoint in A::foo"
- }
- -re ".*$gdb_prompt $" { fail "continuing and breaking in A::foo" }
- timeout { fail "(timeout) continue" }
-}
+gdb_test "continue" \
+ "Continuing\\.\r\n\r\nBreakpoint \[0-9\]*, A::foo(\\(int\\)|) \\(this=$hex, arg=13\\) at .*method\\.cc:38\r\n38\[\t \]*x \\+= arg;" \
+ "continue to A::foo"
# Check ability to access this-relative stuff.
-send_gdb "print x\n"
-gdb_expect {
- -re "\\$\[0-9\]* = 20\r\n$gdb_prompt $" {
- pass "access this-relative x (in foo)"
- }
- -re ".*$gdb_prompt $" { fail "print x (in foo)" }
- timeout { fail "(timeout) print x (in foo)" }
-}
+gdb_test "print x" \
+ "\\$\[0-9\]* = 20" \
+ "print x in A::foo"
# Check access to this pointer
-send_gdb "print this\n"
-gdb_expect {
- -re "\\$\[0-9\]* = \\(A \\*\\) $hex\r\n$gdb_prompt $" {
- pass "print this (in foo)"
- }
- -re ".*$gdb_prompt $" { fail "print this (in foo)" }
- timeout { fail "(timeout) print this (in foo)" }
-}
+gdb_test "print this" \
+ "\\$\[0-9\]* = \\((class |)A *\\* *(const|)\\) $hex" \
+ "print this in A::foo"
# Now do everything over again for A::bar, because sometimes processing one method
# (the first one) is fine, but the second one's debug info gets munged beyond recognition.
-send_gdb "break A::bar\n"
-gdb_expect {
- -re "Breakpoint \[0-9\]* at $hex.*file .*method.cc, line 44\\.\r\n$gdb_prompt $" {
- pass "set breakpoint on A::bar"
- }
- -re ".*$gdb_prompt $" { fail "set breakpoint on A::bar" }
- timeout { fail "(timeout) set breakpoint on A::bar" }
-}
+gdb_test "break A::bar" \
+ "Breakpoint \[0-9\]* at $hex.*file .*method.cc, line 44\\."
-send_gdb "continue\n"
-gdb_expect {
- -re "Continuing\\.\r\n\r\nBreakpoint \[0-9\]*, A::bar(\\(int\\) const|) \\(this=$hex, arg=15\\) at .*method\\.cc:44\r\n44\[\t \]*return arg \\+ 2 \\* x;\r\n$gdb_prompt $" {
- pass "continued and got breakpoint in A::bar"
- }
- -re ".*$gdb_prompt $" { fail "continuing and breaking in A::bar" }
- timeout { fail "(timeout) continue" }
-}
+gdb_test "continue" \
+ "Continuing\\.\r\n\r\nBreakpoint \[0-9\]*, A::bar(\\(int\\) const|) \\(this=$hex, arg=15\\) at .*method\\.cc:44\r\n44\[\t \]*return arg \\+ 2 \\* x;" \
+ "continue to A::bar"
# Check ability to access this-relative stuff.
-send_gdb "print x\n"
-gdb_expect {
- -re "\\$\[0-9\]* = 33\r\n$gdb_prompt $" {
- pass "access this-relative x (in bar)"
- }
- -re ".*$gdb_prompt $" { fail "print x (in bar)" }
- timeout { fail "(timeout) print x (in bar)" }
-}
+gdb_test "print x" \
+ "\\$\[0-9\]* = 33" \
+ "print x in A::bar"
# Check access to this pointer
+get_debug_format
+
send_gdb "print this\n"
gdb_expect {
- -re "\\$\[0-9\]* = \\(const class A \\*\\) $hex\r\n$gdb_prompt $" {
- global gcc_compiled
- if {$gcc_compiled} {
- xfail "print this (in bar)"
- } else {
- pass "print this (in bar)"
- }
- }
- -re "\\$\[0-9\]* = \\(A \\*\\) $hex\r\n$gdb_prompt $" {
- global gcc_compiled
- if {$gcc_compiled} {
- pass "print this (in bar)"
- } else {
- xfail "print this (in bar)"
- }
- }
- -re ".*$gdb_prompt $" { fail "print this (in bar)" }
- timeout { fail "(timeout) print this (in bar)" }
+ -re "\\$\[0-9\]* = \\(const (class |)A *\\* *(const|)\\) $hex\r\n$gdb_prompt $" {
+ pass "print this in A::bar"
+ }
+ -re "\\$\[0-9\]* = \\((class |)A *\\* *(const|)\\) $hex\r\n$gdb_prompt $" {
+ # gcc versions up to 3.0.4 with -gstabs+ do not emit "const" indicators,
+ # so the output is "A *". It should be "const A *" or "const A * const".
+ setup_xfail_format "stabs"
+ fail "print this in A::bar (missing const)"
+ }
+ -re "\\$\[0-9\]* = \\(const (class |)\{\\.\\.\\.\} *\\* *(const|)\\) $hex\r\n$gdb_prompt $" {
+ # gcc versions gcc-3_1-branch%20020404 and HEAD%20020404 with -gstabs+
+ # produce good stabs, but gdb prints "const class {...} *" const.
+ # This is PR gdb/277.
+ # setup_kfail "gdb/277"
+ fail "print this in A::bar (gdb/277)"
+ }
+ -re ".*$gdb_prompt $" { fail "print this in A::bar" }
+ timeout { fail "(timeout) print this in A::bar" }
}
# Check again with funk::getFunky (this is the original test case
# for CHFts23426); sometimes having a constructor with no arguments
# will nuke the debug info read in for other methods in the class.
-send_gdb "break funk::getFunky\n"
-gdb_expect {
- -re "Breakpoint \[0-9\]* at $hex.*file .*method.cc, line 20\\.\r\n$gdb_prompt $" {
- pass "set breakpoint on funk::getFunky"
- }
- -re ".*$gdb_prompt $" { fail "set breakpoint on funk::getfunky" }
- timeout { fail "(timeout) set breakpoint on funk::getfunky" }
-}
+gdb_test "break 21" \
+ "Breakpoint \[0-9\]* at $hex.*file .*method.cc, line 21\\."
-send_gdb "continue\n"
-gdb_expect {
- -re "Continuing\\.\r\n\r\nBreakpoint \[0-9\]*, funk::getFunky(\\(int, int\\)|) \\(this=$hex, a=1, b=2\\) at .*method\\.cc:20\r\n20\[\t \]*res = a \\+ b - data_;\r\n$gdb_prompt $" {
- pass "continued and got breakpoint in funk::getfunky"
- }
- -re ".*$gdb_prompt $" { fail "continuing and breaking in funk::getfunky" }
- timeout { fail "(timeout) continue" }
-}
+gdb_test "continue" \
+ "Continuing\\.\r\n\r\nBreakpoint \[0-9\]*, funk::getFunky(\\(int, int\\)|) \\(this=$hex, a=1, b=2\\) at .*method\\.cc:21\r\n21\[\t \]*data_ = res;" \
+ "continue to 21"
# Check ability to access this-relative stuff.
-send_gdb "print data_\n"
-gdb_expect {
- -re "\\$\[0-9\]* = 33\r\n$gdb_prompt $" {
- pass "access this-relative data_ in getFunky"
- }
- -re ".*$gdb_prompt $" { fail "print data_ in getFunky" }
- timeout { fail "(timeout) print data_ in getFunky" }
-}
+gdb_test "print data_" \
+ "\\$\[0-9\]* = 33" \
+ "print data_ in funk::getFunky"
# Check access to this pointer
-send_gdb "print this\n"
-gdb_expect {
- -re "\\$\[0-9\]* = \\(funk \\*\\) $hex\r\n$gdb_prompt $" {
- pass "print this in getFunky"
- }
- -re ".*$gdb_prompt $" { fail "print this in getfunky" }
- timeout { fail "(timeout) print this in getfunky" }
-}
+gdb_test "print this" \
+ "\\$\[0-9\]* = \\((class |)funk *\\* *(const|)\\) $hex" \
+ "print this in funk::getFunky"
# Check access to local variable
-send_gdb "print res\n"
-gdb_expect {
- -re "\\$\[0-9\]* = .\[0-9\]*\r\n$gdb_prompt $" {
- pass "print res in getFunky"
- }
- -re ".*$gdb_prompt $" { fail "print res in getfunky" }
- timeout { fail "(timeout) print res in getfunky" }
-}
-
+gdb_test "print res" \
+ "\\$\[0-9\]* = -30" \
+ "print res in funk::getFunky"
# Check ptype of class -- should show const/volatile methods
@@ -242,12 +180,6 @@ gdb_expect {
timeout { fail "(timeout) ptype A" }
}
-send_gdb "cont\n"
-gdb_expect {
- -re "Continuing.\r\n\r\nProgram exited normally.\r\n$gdb_prompt $" {
- pass "finish program"
- }
- -re "$gdb_prompt $" { fail "finish program" }
- timeout { fail "(timeout) finish program" }
-}
-
+gdb_test "cont" \
+ "Continuing.\r\n\r\nProgram exited normally." \
+ "finish program"
diff --git a/gdb/testsuite/gdb.c++/misc.exp b/gdb/testsuite/gdb.c++/misc.exp
index 1cdc61c..a2d122f 100644
--- a/gdb/testsuite/gdb.c++/misc.exp
+++ b/gdb/testsuite/gdb.c++/misc.exp
@@ -1,4 +1,5 @@
-# Copyright 1992, 1994, 1995, 1996, 1997, 1999 Free Software Foundation, Inc.
+# Copyright 1992, 1994, 1995, 1996, 1997, 1999, 2002 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
@@ -41,7 +42,6 @@ proc deduce_language_of_main {} {
# See what language gdb thinks main() is, prior to reading full symbols.
# I think this fails for COFF targets.
- # OBSOLETE setup_xfail "a29k-*-udi"
send_gdb "show language\n"
gdb_expect {
-re ".* source language is \"auto; currently c\[+\]+\".*$gdb_prompt $" {
diff --git a/gdb/testsuite/gdb.c++/ovldbreak.exp b/gdb/testsuite/gdb.c++/ovldbreak.exp
index 7f5513b..9852cb5 100644
--- a/gdb/testsuite/gdb.c++/ovldbreak.exp
+++ b/gdb/testsuite/gdb.c++/ovldbreak.exp
@@ -157,20 +157,20 @@ set_bp_overloaded "foo::overload1arg" "$menu_overload1arg" 13 13 110
gdb_test "info break" \
"Num Type\[\t \]+Disp Enb Address\[\t \]+What.*
-\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex in main at.*$srcfile:49\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in main at.*$srcfile:49\r
\[\t \]+breakpoint already hit 1 time\r
-\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex in foo::overload1arg\\(char\\) at.*$srcfile:111\r
-\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex in foo::overload1arg\\(signed char\\) at.*$srcfile:112\r
-\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex in foo::overload1arg\\(unsigned char\\) at.*$srcfile:113\r
-\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex in foo::overload1arg\\(short\\) at.*$srcfile:114\r
-\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex in foo::overload1arg\\(unsigned short\\) at.*$srcfile:115\r
-\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex in foo::overload1arg\\(int\\) at.*$srcfile:116\r
-\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex in foo::overload1arg\\((unsigned|unsigned int)\\) at.*$srcfile:117\r
-\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex in foo::overload1arg\\(long\\) at.*$srcfile:118\r
-\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex in foo::overload1arg\\(unsigned long\\) at.*$srcfile:119\r
-\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex in foo::overload1arg\\(float\\) at.*$srcfile:120\r
-\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex in foo::overload1arg\\(double\\) at.*$srcfile:121\r
-\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex in foo::overload1arg\\((void|)\\) at.*$srcfile:110" \
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(char\\) at.*$srcfile:111\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(signed char\\) at.*$srcfile:112\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned char\\) at.*$srcfile:113\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(short\\) at.*$srcfile:114\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned short\\) at.*$srcfile:115\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(int\\) at.*$srcfile:116\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned|unsigned int)\\) at.*$srcfile:117\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(long\\) at.*$srcfile:118\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned long\\) at.*$srcfile:119\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(float\\) at.*$srcfile:120\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(double\\) at.*$srcfile:121\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((void|)\\) at.*$srcfile:110" \
"breakpoint info (after setting one-by-one)"
@@ -215,20 +215,20 @@ gdb_expect {
gdb_test "info break" \
"Num Type\[\t \]+Disp Enb Address\[\t \]+What.*
-\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex in main at.*$srcfile:49\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in main at.*$srcfile:49\r
\[\t \]+breakpoint already hit 1 time\r
-\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex in foo::overload1arg\\(char\\) at.*$srcfile:111\r
-\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex in foo::overload1arg\\(signed char\\) at.*$srcfile:112\r
-\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex in foo::overload1arg\\(unsigned char\\) at.*$srcfile:113\r
-\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex in foo::overload1arg\\(short\\) at.*$srcfile:114\r
-\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex in foo::overload1arg\\(unsigned short\\) at.*$srcfile:115\r
-\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex in foo::overload1arg\\(int\\) at.*$srcfile:116\r
-\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex in foo::overload1arg\\((unsigned|unsigned int)\\) at.*$srcfile:117\r
-\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex in foo::overload1arg\\(long\\) at.*$srcfile:118\r
-\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex in foo::overload1arg\\(unsigned long\\) at.*$srcfile:119\r
-\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex in foo::overload1arg\\(float\\) at.*$srcfile:120\r
-\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex in foo::overload1arg\\(double\\) at.*$srcfile:121\r
-\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex in foo::overload1arg\\((void|)\\) at.*$srcfile:110" \
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(char\\) at.*$srcfile:111\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(signed char\\) at.*$srcfile:112\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned char\\) at.*$srcfile:113\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(short\\) at.*$srcfile:114\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned short\\) at.*$srcfile:115\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(int\\) at.*$srcfile:116\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned|unsigned int)\\) at.*$srcfile:117\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(long\\) at.*$srcfile:118\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned long\\) at.*$srcfile:119\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(float\\) at.*$srcfile:120\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(double\\) at.*$srcfile:121\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((void|)\\) at.*$srcfile:110" \
"breakpoint info (after cancel)"
@@ -294,18 +294,18 @@ gdb_expect {
gdb_test "info break" \
"Num Type\[\t \]+Disp Enb Address\[\t \]+What.*
-\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex in foo::overload1arg\\(double\\) at.*$srcfile:121\r
-\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex in foo::overload1arg\\(float\\) at.*$srcfile:120\r
-\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex in foo::overload1arg\\(unsigned long\\) at.*$srcfile:119\r
-\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex in foo::overload1arg\\(long\\) at.*$srcfile:118\r
-\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex in foo::overload1arg\\((unsigned|unsigned int)\\) at.*$srcfile:117\r
-\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex in foo::overload1arg\\(int\\) at.*$srcfile:116\r
-\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex in foo::overload1arg\\(unsigned short\\) at.*$srcfile:115\r
-\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex in foo::overload1arg\\(short\\) at.*$srcfile:114\r
-\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex in foo::overload1arg\\(unsigned char\\) at.*$srcfile:113\r
-\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex in foo::overload1arg\\(signed char\\) at.*$srcfile:112\r
-\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex in foo::overload1arg\\(char\\) at.*$srcfile:111\r
-\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex in foo::overload1arg\\((void|)\\) at.*$srcfile:110" \
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(double\\) at.*$srcfile:121\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(float\\) at.*$srcfile:120\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned long\\) at.*$srcfile:119\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(long\\) at.*$srcfile:118\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned|unsigned int)\\) at.*$srcfile:117\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(int\\) at.*$srcfile:116\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned short\\) at.*$srcfile:115\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(short\\) at.*$srcfile:114\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned char\\) at.*$srcfile:113\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(signed char\\) at.*$srcfile:112\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(char\\) at.*$srcfile:111\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((void|)\\) at.*$srcfile:110" \
"breakpoint info (after setting on all)"
diff --git a/gdb/testsuite/gdb.gdb/xfullpath.exp b/gdb/testsuite/gdb.gdb/xfullpath.exp
new file mode 100644
index 0000000..e4a6e2a
--- /dev/null
+++ b/gdb/testsuite/gdb.gdb/xfullpath.exp
@@ -0,0 +1,198 @@
+# Copyright 2002
+# 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
+
+# This file was written by Joel Brobecker. (brobecker@gnat.com), derived
+# from selftest.exp, written by Rob Savoye.
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+# are we on a target board
+if [is_remote target] {
+ return
+}
+
+if [istarget "m68k*-*-hpux*"] then {
+ # The top-level makefile passes CFLAGS= (no -g) for hp300. This probably
+ # should be fixed (it is only needed for gcc bootstrapping, not gdb),
+ # but until then.....
+ setup_xfail "*-*-*"
+ fail "cannot test self if compiled without debug info"
+ return -1
+}
+
+proc setup_test { executable } {
+ global gdb_prompt
+ global timeout
+
+ # load yourself into the debugger
+ # This can take a relatively long time, particularly for testing where
+ # the executable is being accessed over a network, or where gdb does not
+ # support partial symbols for a particular target and has to load the
+ # entire symbol table. Set the timeout to 10 minutes, which should be
+ # adequate for most environments (it *has* timed out with 5 min on a
+ # SPARCstation SLC under moderate load, so this isn't unreasonable).
+ # After gdb is started, set the timeout to 30 seconds for the duration
+ # of this test, and then back to the original value.
+
+ set oldtimeout $timeout
+ set timeout 600
+ verbose "Timeout is now $timeout seconds" 2
+ if {[gdb_load $executable] <0} then {
+ set timeout $oldtimeout
+ verbose "Timeout is now $timeout seconds" 2
+ return -1
+ }
+ set timeout $oldtimeout
+ verbose "Timeout is now $timeout seconds" 2
+
+ # Set a breakpoint at main
+ gdb_test "break captured_main" \
+ "Breakpoint.*at.* file.*, line.*" \
+ "breakpoint in captured_main"
+
+ # run yourself
+ # It may take a very long time for the inferior gdb to start (lynx),
+ # so we bump it back up for the duration of this command.
+ set timeout 600
+
+ set description "run until breakpoint at captured_main"
+ send_gdb "run -nw\n"
+ gdb_expect {
+ -re "Starting program.*Breakpoint \[0-9\]+,.*captured_main .data.* at .*main.c:.*$gdb_prompt $" {
+ pass "$description"
+ }
+ -re "Starting program.*Breakpoint \[0-9\]+,.*captured_main .data.*$gdb_prompt $" {
+ xfail "$description (line numbers scrambled?)"
+ }
+ -re "vfork: No more processes.*$gdb_prompt $" {
+ fail "$description (out of virtual memory)"
+ set timeout $oldtimeout
+ verbose "Timeout is now $timeout seconds" 2
+ return -1
+ }
+ -re ".*$gdb_prompt $" {
+ fail "$description"
+ set timeout $oldtimeout
+ verbose "Timeout is now $timeout seconds" 2
+ return -1
+ }
+ timeout {
+ fail "$description (timeout)"
+ }
+ }
+
+ set timeout $oldtimeout
+ verbose "Timeout is now $timeout seconds" 2
+
+ return 0
+}
+
+proc test_with_self { executable } {
+
+ set setup_result [setup_test $executable]
+ if {$setup_result <0} then {
+ return -1
+ }
+
+ # A file which contains a directory prefix
+ gdb_test "print xfullpath (\"./xfullpath.exp\")" \
+ ".\[0-9\]+ =.*\".*/xfullpath.exp\"" \
+ "A filename with ./ as the directory prefix"
+
+ # A file which contains a directory prefix
+ gdb_test "print xfullpath (\"../../defs.h\")" \
+ ".\[0-9\]+ =.*\".*/defs.h\"" \
+ "A filename with ../ in the directory prefix"
+
+ # A one-character filename
+ gdb_test "print xfullpath (\"./a\")" \
+ ".\[0-9\]+ =.*\".*/a\"" \
+ "A one-char filename in the current directory"
+
+ # A file in the root directory
+ gdb_test "print xfullpath (\"/root_file_which_should_exist\")" \
+ ".\[0-9\]+ =.*\"/root_file_which_should_exist\"" \
+ "A filename in the root directory"
+
+ # A file which does not have a directory prefix
+ gdb_test "print xfullpath (\"xfullpath.exp\")" \
+ ".\[0-9\]+ =.*\"xfullpath.exp\"" \
+ "A filename without any directory prefix"
+
+ # A one-char filename without any directory prefix
+ gdb_test "print xfullpath (\"a\")" \
+ ".\[0-9\]+ =.*\"a\"" \
+ "A one-char filename without any directory prefix"
+
+ # An empty filename
+ gdb_test "print xfullpath (\"\")" \
+ ".\[0-9\]+ =.*\"\"" \
+ "An empty filename"
+
+ return 0
+}
+
+# Find a pathname to a file that we would execute if the shell was asked
+# to run $arg using the current PATH.
+
+proc find_gdb { arg } {
+
+ # If the arg directly specifies an existing executable file, then
+ # simply use it.
+
+ if [file executable $arg] then {
+ return $arg
+ }
+
+ set result [which $arg]
+ if [string match "/" [ string range $result 0 0 ]] then {
+ return $result
+ }
+
+ # If everything fails, just return the unqualified pathname as default
+ # and hope for best.
+
+ return $arg
+}
+
+# Run the test with self.
+# Copy the file executable file in case this OS doesn't like to edit its own
+# text space.
+
+set GDB_FULLPATH [find_gdb $GDB]
+
+# Remove any old copy lying around.
+remote_file host delete x$tool
+
+gdb_start
+set file [remote_download host $GDB_FULLPATH x$tool]
+set result [test_with_self $file];
+gdb_exit;
+catch "remote_file host delete $file";
+
+if {$result <0} then {
+ warning "Couldn't test self"
+ return -1
+}
diff --git a/gdb/testsuite/gdb.hp/gdb.threads-hp/usrthbasic.c b/gdb/testsuite/gdb.hp/gdb.threads-hp/usrthbasic.c
deleted file mode 100644
index 043b2a6..0000000
--- a/gdb/testsuite/gdb.hp/gdb.threads-hp/usrthbasic.c
+++ /dev/null
@@ -1,171 +0,0 @@
-/* OBSOLETE #include <stdio.h> */
-/* OBSOLETE */
-/* OBSOLETE /* #include "config.h" */ */
-/* OBSOLETE #define HAVE_PTHREAD_H */
-/* OBSOLETE #define __hpux__ */
-/* OBSOLETE #define __osf__ */
-/* OBSOLETE */
-/* OBSOLETE #ifndef HAVE_PTHREAD_H */
-/* OBSOLETE */
-/* OBSOLETE /* Don't even try to compile. In fact, cause a syntax error that we can */
-/* OBSOLETE look for as a compiler error message and know that we have no pthread */
-/* OBSOLETE support. In that case we can just suppress the test completely. */ */
-/* OBSOLETE */
-/* OBSOLETE #error "no posix threads support" */
-/* OBSOLETE */
-/* OBSOLETE #else */
-/* OBSOLETE */
-/* OBSOLETE /* OK. We have the right header. If we try to compile this and fail, then */
-/* OBSOLETE there is something wrong and the user should know about it so the testsuite */
-/* OBSOLETE should issue an ERROR result.. */ */
-/* OBSOLETE */
-/* OBSOLETE #ifdef __linux__ */
-/* OBSOLETE #define _MIT_POSIX_THREADS 1 /* Linux (or at least RedHat 4.0) needs this */ */
-/* OBSOLETE #endif */
-/* OBSOLETE */
-/* OBSOLETE #include <pthread.h> */
-/* OBSOLETE */
-/* OBSOLETE /* Under OSF 2.0 & 3.0 and HPUX 10, the second arg of pthread_create */
-/* OBSOLETE is prototyped to be just a "pthread_attr_t", while under Solaris it */
-/* OBSOLETE is a "pthread_attr_t *". Arg! */ */
-/* OBSOLETE */
-/* OBSOLETE #if defined (__osf__) || defined (__hpux__) */
-/* OBSOLETE #define PTHREAD_CREATE_ARG2(arg) arg */
-/* OBSOLETE #define PTHREAD_CREATE_NULL_ARG2 null_attr */
-/* OBSOLETE static pthread_attr_t null_attr; */
-/* OBSOLETE #else */
-/* OBSOLETE #define PTHREAD_CREATE_ARG2(arg) &arg */
-/* OBSOLETE #define PTHREAD_CREATE_NULL_ARG2 NULL */
-/* OBSOLETE #endif */
-/* OBSOLETE */
-/* OBSOLETE static int verbose = 0; */
-/* OBSOLETE */
-/* OBSOLETE static void */
-/* OBSOLETE common_routine (arg) */
-/* OBSOLETE int arg; */
-/* OBSOLETE { */
-/* OBSOLETE static int from_thread1; */
-/* OBSOLETE static int from_thread2; */
-/* OBSOLETE static int from_main; */
-/* OBSOLETE static int hits; */
-/* OBSOLETE static int full_coverage; */
-/* OBSOLETE */
-/* OBSOLETE if (verbose) printf("common_routine (%d)\n", arg); */
-/* OBSOLETE hits++; */
-/* OBSOLETE switch (arg) */
-/* OBSOLETE { */
-/* OBSOLETE case 0: */
-/* OBSOLETE from_main++; */
-/* OBSOLETE break; */
-/* OBSOLETE case 1: */
-/* OBSOLETE from_thread1++; */
-/* OBSOLETE break; */
-/* OBSOLETE case 2: */
-/* OBSOLETE from_thread2++; */
-/* OBSOLETE break; */
-/* OBSOLETE } */
-/* OBSOLETE if (from_main && from_thread1 && from_thread2) */
-/* OBSOLETE full_coverage = 1; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE static void * */
-/* OBSOLETE thread1 (void *arg) */
-/* OBSOLETE { */
-/* OBSOLETE int i; */
-/* OBSOLETE int z = 0; */
-/* OBSOLETE */
-/* OBSOLETE if (verbose) printf ("thread1 (%0x) ; pid = %d\n", arg, getpid ()); */
-/* OBSOLETE for (i=1; i <= 10000000; i++) */
-/* OBSOLETE { */
-/* OBSOLETE if (verbose) printf("thread1 %d\n", pthread_self ()); */
-/* OBSOLETE z += i; */
-/* OBSOLETE common_routine (1); */
-/* OBSOLETE sleep(1); */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE static void * */
-/* OBSOLETE thread2 (void * arg) */
-/* OBSOLETE { */
-/* OBSOLETE int i; */
-/* OBSOLETE int k = 0; */
-/* OBSOLETE */
-/* OBSOLETE if (verbose) printf ("thread2 (%0x) ; pid = %d\n", arg, getpid ()); */
-/* OBSOLETE for (i=1; i <= 10000000; i++) */
-/* OBSOLETE { */
-/* OBSOLETE if (verbose) printf("thread2 %d\n", pthread_self ()); */
-/* OBSOLETE k += i; */
-/* OBSOLETE common_routine (2); */
-/* OBSOLETE sleep(1); */
-/* OBSOLETE } */
-/* OBSOLETE sleep(100); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE int */
-/* OBSOLETE foo (a, b, c) */
-/* OBSOLETE int a, b, c; */
-/* OBSOLETE { */
-/* OBSOLETE int d, e, f; */
-/* OBSOLETE */
-/* OBSOLETE if (verbose) printf("a=%d\n", a); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE main(argc, argv) */
-/* OBSOLETE int argc; */
-/* OBSOLETE char **argv; */
-/* OBSOLETE { */
-/* OBSOLETE pthread_t tid1, tid2; */
-/* OBSOLETE int j; */
-/* OBSOLETE int t = 0; */
-/* OBSOLETE void (*xxx) (); */
-/* OBSOLETE pthread_attr_t attr; */
-/* OBSOLETE */
-/* OBSOLETE if (verbose) printf ("pid = %d\n", getpid()); */
-/* OBSOLETE */
-/* OBSOLETE foo (1, 2, 3); */
-/* OBSOLETE */
-/* OBSOLETE #ifndef __osf__ */
-/* OBSOLETE if (pthread_attr_init (&attr)) */
-/* OBSOLETE { */
-/* OBSOLETE perror ("pthread_attr_init 1"); */
-/* OBSOLETE exit (1); */
-/* OBSOLETE } */
-/* OBSOLETE #endif */
-/* OBSOLETE */
-/* OBSOLETE #ifdef PTHREAD_SCOPE_SYSTEM */
-/* OBSOLETE if (pthread_attr_setscope (&attr, PTHREAD_SCOPE_SYSTEM)) */
-/* OBSOLETE { */
-/* OBSOLETE perror ("pthread_attr_setscope 1"); */
-/* OBSOLETE exit (1); */
-/* OBSOLETE } */
-/* OBSOLETE #endif */
-/* OBSOLETE */
-/* OBSOLETE if (pthread_create (&tid1, pthread_attr_default, thread1, (void *) 0xfeedface)) */
-/* OBSOLETE { */
-/* OBSOLETE perror ("pthread_create 1"); */
-/* OBSOLETE exit (1); */
-/* OBSOLETE } */
-/* OBSOLETE if (verbose) printf ("Made thread %d\n", tid1); */
-/* OBSOLETE sleep (1); */
-/* OBSOLETE */
-/* OBSOLETE if (pthread_create (&tid2, null_attr, thread2, (void *) 0xdeadbeef)) */
-/* OBSOLETE { */
-/* OBSOLETE perror ("pthread_create 2"); */
-/* OBSOLETE exit (1); */
-/* OBSOLETE } */
-/* OBSOLETE if (verbose) printf("Made thread %d\n", tid2); */
-/* OBSOLETE */
-/* OBSOLETE sleep (1); */
-/* OBSOLETE */
-/* OBSOLETE for (j = 1; j <= 10000000; j++) */
-/* OBSOLETE { */
-/* OBSOLETE if (verbose) printf("top %d\n", pthread_self ()); */
-/* OBSOLETE common_routine (0); */
-/* OBSOLETE sleep(1); */
-/* OBSOLETE t += j; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE exit(0); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE #endif /* ifndef HAVE_PTHREAD_H */ */
diff --git a/gdb/testsuite/gdb.hp/gdb.threads-hp/usrthbasic.exp b/gdb/testsuite/gdb.hp/gdb.threads-hp/usrthbasic.exp
deleted file mode 100644
index 60f3605..0000000
--- a/gdb/testsuite/gdb.hp/gdb.threads-hp/usrthbasic.exp
+++ /dev/null
@@ -1,110 +0,0 @@
-# OBSOLETE # usrthbasic.exp -- Expect script to test gdb with user threads
-# OBSOLETE # Copyright (C) 1992 Free Software Foundation, Inc.
-# OBSOLETE
-# OBSOLETE # This program is free software; you can redistribute it and/or modify
-# OBSOLETE # it under the terms of the GNU General Public License as published by
-# OBSOLETE # the Free Software Foundation; either version 2 of the License, or
-# OBSOLETE # (at your option) any later version.
-# OBSOLETE #
-# OBSOLETE # This program is distributed in the hope that it will be useful,
-# OBSOLETE # but WITHOUT ANY WARRANTY; without even the implied warranty of
-# OBSOLETE # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# OBSOLETE # GNU General Public License for more details.
-# OBSOLETE #
-# OBSOLETE # You should have received a copy of the GNU General Public License
-# OBSOLETE # along with this program; if not, write to the Free Software
-# OBSOLETE # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-# OBSOLETE
-# OBSOLETE # Please email any bugs, comments, and/or additions to this file to:
-# OBSOLETE # bug-gdb@prep.ai.mit.edu
-# OBSOLETE
-# OBSOLETE # use this to debug:
-# OBSOLETE #
-# OBSOLETE #log_user 1
-# OBSOLETE
-verbose "HP's thread tests are broken beyond repair right now."
-return 0
-# OBSOLETE
-# OBSOLETE if $tracelevel {
-# OBSOLETE strace $tracelevel
-# OBSOLETE }
-# OBSOLETE
-# OBSOLETE if { [skip_hp_tests] } { continue }
-# OBSOLETE
-# OBSOLETE if { ![istarget "hppa*-*-hpux*"] || [istarget "hppa64-*-*"] } {
-# OBSOLETE verbose "HPUX thread test ignored for non-hppa or PA64 targets."
-# OBSOLETE return 0
-# OBSOLETE }
-# OBSOLETE
-# OBSOLETE set testfile usrthbasic
-# OBSOLETE set srcfile ${srcdir}/${subdir}/${testfile}.c
-# OBSOLETE set binfile ${srcdir}/${subdir}/${testfile}
-# OBSOLETE
-# OBSOLETE # To build the executable we need to link against the thread library.
-# OBSOLETE #
-# OBSOLETE # /opt/ansic/bin/cc -Ae +DAportable -g -o usrthbasic -lcma usrthbasic.c
-# OBSOLETE #
-# OBSOLETE ## we have trouble building it on 11.0, so we use the prebuilt
-# OBSOLETE ## executable instead.
-# OBSOLETE ##
-# OBSOLETE ##if { [gdb_compile "${srcdir}/${subdir}/${testfile}.c" "${binfile}" executable {debug additional_flags=-Ae ldflags=-lcma}] != "" } {
-# OBSOLETE ## gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
-# OBSOLETE ##}
-# OBSOLETE
-# OBSOLETE # We don't really seem to need longer waits.
-# OBSOLETE #
-# OBSOLETE ##set oldtimeout $timeout
-# OBSOLETE ##set timeout [expr "$timeout + 0"]
-# OBSOLETE ##set oldverbose $verbose
-# OBSOLETE ##set verbose 40
-# OBSOLETE
-# OBSOLETE #=========================
-# OBSOLETE #
-# OBSOLETE # Test looking at threads.
-# OBSOLETE #
-# OBSOLETE gdb_exit
-# OBSOLETE gdb_start
-# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir
-# OBSOLETE gdb_load ${binfile}
-# OBSOLETE
-# OBSOLETE gdb_test "b main" ".*Breakpoint 1.*" "b main"
-# OBSOLETE gdb_test "run" "Breakpoint 1, main.*:119.*" "run to main"
-# OBSOLETE gdb_test "b thread1" ".*Breakpoint 2.*" "b thread1"
-# OBSOLETE gdb_test "info threads" "\\* 1 system thread.*:119\[^(\]*" \
-# OBSOLETE "info threads at main"
-# OBSOLETE gdb_test "c" "Breakpoint 2, thread1.*" "continue to thread1"
-# OBSOLETE gdb_test "info threads" \
-# OBSOLETE "\\* 3 system thread.*thread1.*libcma.1.*libcma.1\[^(\]*" \
-# OBSOLETE "info threads at main"
-# OBSOLETE gdb_test "b 165" "Breakpoint 3.*165.*" "break at main counter"
-# OBSOLETE gdb_test "c" "Breakpoint 3, main.*" "continue to main counter"
-# OBSOLETE gdb_test "info threads" " 4 system thread.*\\* 1 system thread.*main.*" \
-# OBSOLETE "info threads at main counter"
-# OBSOLETE gdb_test "b 97" "Breakpoint 4.*97.*" "break at thread2 counter"
-# OBSOLETE gdb_test "b 81" "Breakpoint 5.*81.*" "break at thread1 counter"
-# OBSOLETE gdb_test "bt" "#0 main.* at \[^(\]*" "backtrace at main counter"
-# OBSOLETE
-# OBSOLETE # After switching to thread 4, the cma scheduler should schedule it next
-# OBSOLETE # and we should hit its breakpoint in thread2.
-# OBSOLETE gdb_test "thread 4" ".Switching to thread 4.*cma__dispatch.*" \
-# OBSOLETE "switch to thread 4"
-# OBSOLETE gdb_test "bt" "#0 .*thread2.*" "backtrace at thread 4"
-# OBSOLETE sleep 1
-# OBSOLETE gdb_test "c" ".*Breakpoint 4, thread2.*" "continue and get to thread 4"
-# OBSOLETE
-# OBSOLETE # After switching to thread 1, the cma scheduler should schedule it next
-# OBSOLETE # and we should hit its breakpoint (in main).
-# OBSOLETE gdb_test "thread 1" ".*Switching to thread 1.*cma__dispatch.*" \
-# OBSOLETE "switch to thread 1"
-# OBSOLETE sleep 1
-# OBSOLETE gdb_test "c" ".*Breakpoint 3, main.*usrthbasic.c:165.*" \
-# OBSOLETE "continue and get to thread 1"
-# OBSOLETE
-# OBSOLETE # Done!
-# OBSOLETE #
-# OBSOLETE gdb_exit
-# OBSOLETE
-# OBSOLETE ##set timeout $oldtimeout
-# OBSOLETE ##set verbose $oldverbose
-# OBSOLETE
-# OBSOLETE return 0
diff --git a/gdb/testsuite/gdb.hp/gdb.threads-hp/usrthcore.c b/gdb/testsuite/gdb.hp/gdb.threads-hp/usrthcore.c
deleted file mode 100644
index c3bc18d..0000000
--- a/gdb/testsuite/gdb.hp/gdb.threads-hp/usrthcore.c
+++ /dev/null
@@ -1,177 +0,0 @@
-/* OBSOLETE #include <stdio.h> */
-/* OBSOLETE */
-/* OBSOLETE /* #include "config.h" */ */
-/* OBSOLETE #define HAVE_PTHREAD_H */
-/* OBSOLETE #define __hpux__ */
-/* OBSOLETE #define __osf__ */
-/* OBSOLETE */
-/* OBSOLETE #ifndef HAVE_PTHREAD_H */
-/* OBSOLETE */
-/* OBSOLETE /* Don't even try to compile. In fact, cause a syntax error that we can */
-/* OBSOLETE look for as a compiler error message and know that we have no pthread */
-/* OBSOLETE support. In that case we can just suppress the test completely. */ */
-/* OBSOLETE */
-/* OBSOLETE #error "no posix threads support" */
-/* OBSOLETE */
-/* OBSOLETE #else */
-/* OBSOLETE */
-/* OBSOLETE /* OK. We have the right header. If we try to compile this and fail, then */
-/* OBSOLETE there is something wrong and the user should know about it so the testsuite */
-/* OBSOLETE should issue an ERROR result.. */ */
-/* OBSOLETE */
-/* OBSOLETE #ifdef __linux__ */
-/* OBSOLETE #define _MIT_POSIX_THREADS 1 /* Linux (or at least RedHat 4.0) needs this */ */
-/* OBSOLETE #endif */
-/* OBSOLETE */
-/* OBSOLETE #include <pthread.h> */
-/* OBSOLETE */
-/* OBSOLETE /* Under OSF 2.0 & 3.0 and HPUX 10, the second arg of pthread_create */
-/* OBSOLETE is prototyped to be just a "pthread_attr_t", while under Solaris it */
-/* OBSOLETE is a "pthread_attr_t *". Arg! */ */
-/* OBSOLETE */
-/* OBSOLETE #if defined (__osf__) || defined (__hpux__) */
-/* OBSOLETE #define PTHREAD_CREATE_ARG2(arg) arg */
-/* OBSOLETE #define PTHREAD_CREATE_NULL_ARG2 null_attr */
-/* OBSOLETE static pthread_attr_t null_attr; */
-/* OBSOLETE #else */
-/* OBSOLETE #define PTHREAD_CREATE_ARG2(arg) &arg */
-/* OBSOLETE #define PTHREAD_CREATE_NULL_ARG2 NULL */
-/* OBSOLETE #endif */
-/* OBSOLETE */
-/* OBSOLETE static int verbose = 0; */
-/* OBSOLETE */
-/* OBSOLETE static void */
-/* OBSOLETE common_routine (arg) */
-/* OBSOLETE int arg; */
-/* OBSOLETE { */
-/* OBSOLETE static int from_thread1; */
-/* OBSOLETE static int from_thread2; */
-/* OBSOLETE static int from_main; */
-/* OBSOLETE static int hits; */
-/* OBSOLETE static int full_coverage; */
-/* OBSOLETE */
-/* OBSOLETE if (verbose) printf("common_routine (%d)\n", arg); */
-/* OBSOLETE hits++; */
-/* OBSOLETE switch (arg) */
-/* OBSOLETE { */
-/* OBSOLETE case 0: */
-/* OBSOLETE from_main++; */
-/* OBSOLETE break; */
-/* OBSOLETE case 1: */
-/* OBSOLETE from_thread1++; */
-/* OBSOLETE break; */
-/* OBSOLETE case 2: */
-/* OBSOLETE from_thread2++; */
-/* OBSOLETE break; */
-/* OBSOLETE } */
-/* OBSOLETE if (from_main && from_thread1 && from_thread2) */
-/* OBSOLETE full_coverage = 1; */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE static void * */
-/* OBSOLETE thread1 (void *arg) */
-/* OBSOLETE { */
-/* OBSOLETE int i; */
-/* OBSOLETE int z = 0; */
-/* OBSOLETE */
-/* OBSOLETE if (verbose) printf ("thread1 (%0x) ; pid = %d\n", arg, getpid ()); */
-/* OBSOLETE for (i=1; i <= 10000000; i++) */
-/* OBSOLETE { */
-/* OBSOLETE if (verbose) printf("thread1 %d\n", pthread_self ()); */
-/* OBSOLETE z += i; */
-/* OBSOLETE common_routine (1); */
-/* OBSOLETE sleep(1); */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE static void * */
-/* OBSOLETE thread2 (void * arg) */
-/* OBSOLETE { */
-/* OBSOLETE int i; */
-/* OBSOLETE int k = 0; */
-/* OBSOLETE */
-/* OBSOLETE if (verbose) printf ("thread2 (%0x) ; pid = %d\n", arg, getpid ()); */
-/* OBSOLETE for (i=1; i <= 10000000; i++) */
-/* OBSOLETE { */
-/* OBSOLETE if (verbose) printf("thread2 %d\n", pthread_self ()); */
-/* OBSOLETE k += i; */
-/* OBSOLETE common_routine (2); */
-/* OBSOLETE sleep(1); */
-/* OBSOLETE } */
-/* OBSOLETE sleep(100); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE int */
-/* OBSOLETE foo (a, b, c) */
-/* OBSOLETE int a, b, c; */
-/* OBSOLETE { */
-/* OBSOLETE int d, e, f; */
-/* OBSOLETE */
-/* OBSOLETE if (verbose) printf("a=%d\n", a); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE main(argc, argv) */
-/* OBSOLETE int argc; */
-/* OBSOLETE char **argv; */
-/* OBSOLETE { */
-/* OBSOLETE pthread_t tid1, tid2; */
-/* OBSOLETE int j; */
-/* OBSOLETE int t = 0; */
-/* OBSOLETE void (*xxx) (); */
-/* OBSOLETE pthread_attr_t attr; */
-/* OBSOLETE */
-/* OBSOLETE if (verbose) printf ("pid = %d\n", getpid()); */
-/* OBSOLETE */
-/* OBSOLETE foo (1, 2, 3); */
-/* OBSOLETE */
-/* OBSOLETE #ifndef __osf__ */
-/* OBSOLETE if (pthread_attr_init (&attr)) */
-/* OBSOLETE { */
-/* OBSOLETE perror ("pthread_attr_init 1"); */
-/* OBSOLETE exit (1); */
-/* OBSOLETE } */
-/* OBSOLETE #endif */
-/* OBSOLETE */
-/* OBSOLETE #ifdef PTHREAD_SCOPE_SYSTEM */
-/* OBSOLETE if (pthread_attr_setscope (&attr, PTHREAD_SCOPE_SYSTEM)) */
-/* OBSOLETE { */
-/* OBSOLETE perror ("pthread_attr_setscope 1"); */
-/* OBSOLETE exit (1); */
-/* OBSOLETE } */
-/* OBSOLETE #endif */
-/* OBSOLETE */
-/* OBSOLETE if (pthread_create (&tid1, pthread_attr_default, thread1, (void *) 0xfeedface)) */
-/* OBSOLETE { */
-/* OBSOLETE perror ("pthread_create 1"); */
-/* OBSOLETE exit (1); */
-/* OBSOLETE } */
-/* OBSOLETE if (verbose) printf ("Made thread %d\n", tid1); */
-/* OBSOLETE sleep (1); */
-/* OBSOLETE */
-/* OBSOLETE if (pthread_create (&tid2, null_attr, thread2, (void *) 0xdeadbeef)) */
-/* OBSOLETE { */
-/* OBSOLETE perror ("pthread_create 2"); */
-/* OBSOLETE exit (1); */
-/* OBSOLETE } */
-/* OBSOLETE if (verbose) printf("Made thread %d\n", tid2); */
-/* OBSOLETE */
-/* OBSOLETE sleep (1); */
-/* OBSOLETE */
-/* OBSOLETE for (j = 1; j <= 10000000; j++) */
-/* OBSOLETE { */
-/* OBSOLETE if (verbose) printf("top %d\n", pthread_self ()); */
-/* OBSOLETE common_routine (0); */
-/* OBSOLETE sleep(1); */
-/* OBSOLETE t += j; */
-/* OBSOLETE if (j > 3) */
-/* OBSOLETE { */
-/* OBSOLETE int* int_p; */
-/* OBSOLETE int_p = 0; */
-/* OBSOLETE *int_p = 1; */
-/* OBSOLETE } */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE exit(0); */
-/* OBSOLETE } */
-/* OBSOLETE */
-/* OBSOLETE #endif /* ifndef HAVE_PTHREAD_H */ */
diff --git a/gdb/testsuite/gdb.hp/gdb.threads-hp/usrthcore.exp b/gdb/testsuite/gdb.hp/gdb.threads-hp/usrthcore.exp
deleted file mode 100644
index b373c3a..0000000
--- a/gdb/testsuite/gdb.hp/gdb.threads-hp/usrthcore.exp
+++ /dev/null
@@ -1,92 +0,0 @@
-# OBSOLETE # usrthcore.exp -- Expect script to test gdb with user threads
-# OBSOLETE # Copyright (C) 1992 Free Software Foundation, Inc.
-# OBSOLETE
-# OBSOLETE # This program is free software; you can redistribute it and/or modify
-# OBSOLETE # it under the terms of the GNU General Public License as published by
-# OBSOLETE # the Free Software Foundation; either version 2 of the License, or
-# OBSOLETE # (at your option) any later version.
-# OBSOLETE #
-# OBSOLETE # This program is distributed in the hope that it will be useful,
-# OBSOLETE # but WITHOUT ANY WARRANTY; without even the implied warranty of
-# OBSOLETE # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# OBSOLETE # GNU General Public License for more details.
-# OBSOLETE #
-# OBSOLETE # You should have received a copy of the GNU General Public License
-# OBSOLETE # along with this program; if not, write to the Free Software
-# OBSOLETE # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-# OBSOLETE
-# OBSOLETE # Please email any bugs, comments, and/or additions to this file to:
-# OBSOLETE # bug-gdb@prep.ai.mit.edu
-# OBSOLETE
-# OBSOLETE # use this to debug:
-# OBSOLETE #
-# OBSOLETE #log_user 1
-# OBSOLETE
-verbose "HP's thread tests are broken beyond repair right now."
-return 0
-# OBSOLETE
-# OBSOLETE if $tracelevel {
-# OBSOLETE strace $tracelevel
-# OBSOLETE }
-# OBSOLETE
-# OBSOLETE if { [skip_hp_tests] } { continue }
-# OBSOLETE
-# OBSOLETE if { ![istarget "hppa*-*-hpux*"] || [istarget "hppa64-*-*"] } {
-# OBSOLETE verbose "HPUX thread test ignored for non-hppa or PA64 targets."
-# OBSOLETE return 0
-# OBSOLETE }
-# OBSOLETE
-# OBSOLETE set testfile usrthcore
-# OBSOLETE set srcfile ${srcdir}/${subdir}/${testfile}.c
-# OBSOLETE set binfile ${srcdir}/${subdir}/${testfile}
-# OBSOLETE
-# OBSOLETE # To build the executable we need to link against the thread library.
-# OBSOLETE #
-# OBSOLETE # /opt/ansic/bin/cc -Ae +DAportable -g -o usrthcore -lcma usrthcore.c
-# OBSOLETE #
-# OBSOLETE ## we have trouble building it on 11.0, so we use the prebuilt
-# OBSOLETE ## executable instead.
-# OBSOLETE ##
-# OBSOLETE ##if { [gdb_compile "${srcdir}/${subdir}/${testfile}.c -lcma" "${binfile}" executable {debug additional_flags=-Ae ldflags=-lcma}] != "" } {
-# OBSOLETE ## gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
-# OBSOLETE ##}
-# OBSOLETE
-# OBSOLETE #=========================
-# OBSOLETE #
-# OBSOLETE # Test looking at threads in a core file
-# OBSOLETE #
-# OBSOLETE
-# OBSOLETE remote_exec build "rm -f core"
-# OBSOLETE remote_exec build "${binfile}"
-# OBSOLETE
-# OBSOLETE gdb_exit
-# OBSOLETE gdb_start
-# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir
-# OBSOLETE gdb_load ${binfile}
-# OBSOLETE gdb_test "core-file core" \
-# OBSOLETE ".*Core was generated by `usrthcore'.*in main.*usrthcore.c:170.*" \
-# OBSOLETE "load corefile"
-# OBSOLETE
-# OBSOLETE gdb_test "info thread" \
-# OBSOLETE " 4 .*cma__dispatch.*\\* 1 .*in main.*usrthcore.c:170.*" \
-# OBSOLETE "info thread on core file"
-# OBSOLETE gdb_test "bt" "#0.*in main.*usrthcore.c:170" "backtrace on active thread"
-# OBSOLETE gdb_test "thread 4" ".*Switching to thread 4.*cma__dispatch.*" \
-# OBSOLETE "switch to thread 4 (thread2 procedure)"
-# OBSOLETE gdb_test "bt" "#0.*cma__dispatch.*thread2.*usrthcore.c:99.*" \
-# OBSOLETE "Backtrace on inactive thread (thread2 procedure)"
-# OBSOLETE gdb_test "b thread1" "Breakpoint 1.*usrthcore.c, line 75.*" \
-# OBSOLETE "break on thread1"
-# OBSOLETE gdb_test "run" "Starting program.*Breakpoint 1, thread1.*usrthcore.c:75.*" \
-# OBSOLETE "run program, get to thread1 procedure"
-# OBSOLETE gdb_test "info threads" "\\* \[23\] .*thread1.* 1 .*cma__dispatch.*" \
-# OBSOLETE "info threads after running core"
-# OBSOLETE
-# OBSOLETE
-# OBSOLETE # Done!
-# OBSOLETE #
-# OBSOLETE gdb_exit
-# OBSOLETE
-# OBSOLETE remote_exec build "rm -f core"
-# OBSOLETE
-# OBSOLETE return 0
diff --git a/gdb/testsuite/gdb.hp/gdb.threads-hp/usrthfork.c b/gdb/testsuite/gdb.hp/gdb.threads-hp/usrthfork.c
deleted file mode 100644
index f5614de..0000000
--- a/gdb/testsuite/gdb.hp/gdb.threads-hp/usrthfork.c
+++ /dev/null
@@ -1,17 +0,0 @@
-/* OBSOLETE #include <stdio.h> */
-/* OBSOLETE #include <pthread.h> */
-/* OBSOLETE #include <sys/types.h> */
-/* OBSOLETE */
-/* OBSOLETE int main(void){ */
-/* OBSOLETE pid_t pid; */
-/* OBSOLETE */
-/* OBSOLETE switch (pid = fork()){ */
-/* OBSOLETE case 0: */
-/* OBSOLETE printf("child\n"); */
-/* OBSOLETE break; */
-/* OBSOLETE default: */
-/* OBSOLETE printf("parent\n"); */
-/* OBSOLETE break; */
-/* OBSOLETE } */
-/* OBSOLETE return 0; */
-/* OBSOLETE } */
diff --git a/gdb/testsuite/gdb.hp/gdb.threads-hp/usrthfork.exp b/gdb/testsuite/gdb.hp/gdb.threads-hp/usrthfork.exp
deleted file mode 100644
index 994a6e2..0000000
--- a/gdb/testsuite/gdb.hp/gdb.threads-hp/usrthfork.exp
+++ /dev/null
@@ -1,75 +0,0 @@
-# OBSOLETE # user_th_basic.exp -- Expect script to test gdb with user threads
-# OBSOLETE # Copyright (C) 1992 Free Software Foundation, Inc.
-# OBSOLETE
-# OBSOLETE # This program is free software; you can redistribute it and/or modify
-# OBSOLETE # it under the terms of the GNU General Public License as published by
-# OBSOLETE # the Free Software Foundation; either version 2 of the License, or
-# OBSOLETE # (at your option) any later version.
-# OBSOLETE #
-# OBSOLETE # This program is distributed in the hope that it will be useful,
-# OBSOLETE # but WITHOUT ANY WARRANTY; without even the implied warranty of
-# OBSOLETE # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# OBSOLETE # GNU General Public License for more details.
-# OBSOLETE #
-# OBSOLETE # You should have received a copy of the GNU General Public License
-# OBSOLETE # along with this program; if not, write to the Free Software
-# OBSOLETE # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-# OBSOLETE
-# OBSOLETE # Please email any bugs, comments, and/or additions to this file to:
-# OBSOLETE # bug-gdb@prep.ai.mit.edu
-# OBSOLETE
-verbose "HP's thread tests are broken beyond repair right now."
-return 0
-# OBSOLETE
-# OBSOLETE if $tracelevel {
-# OBSOLETE strace $tracelevel
-# OBSOLETE }
-# OBSOLETE
-# OBSOLETE if { ![istarget "hppa*-*-hpux*"] || [istarget "hppa64-*-*"] } {
-# OBSOLETE verbose "HPUX thread test ignored for non-hppa or PA64 targets."
-# OBSOLETE return 0
-# OBSOLETE }
-# OBSOLETE
-# OBSOLETE set testfile usrthfork
-# OBSOLETE set srcfile ${srcdir}/${subdir}/${testfile}.c
-# OBSOLETE set binfile ${srcdir}/${subdir}/${testfile}
-# OBSOLETE
-# OBSOLETE # To build the executable we need to link against the thread library.
-# OBSOLETE #
-# OBSOLETE # /opt/ansic/bin/cc -Ae -g -o usrthfork -lcma usrthfork.c
-# OBSOLETE #
-# OBSOLETE ## we have trouble building it on 11.0, so we use the prebuilt
-# OBSOLETE ## executable instead.
-# OBSOLETE ##
-# OBSOLETE ##if { [gdb_compile "${srcdir}/${subdir}/${testfile}.c" "${binfile}" executable {debug additional_flags=-Ae ldflags=-lcma}] != "" } {
-# OBSOLETE ## gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
-# OBSOLETE ##}
-# OBSOLETE
-# OBSOLETE #=========================
-# OBSOLETE #
-# OBSOLETE # Test looking at threads.
-# OBSOLETE #
-# OBSOLETE gdb_exit
-# OBSOLETE gdb_start
-# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir
-# OBSOLETE gdb_load ${binfile}
-# OBSOLETE
-# OBSOLETE gdb_test "set follow-fork-mode parent" ".*" "set follow-fork-mode parent"
-# OBSOLETE gdb_test "b main" "Breakpoint 1.*" "b main"
-# OBSOLETE gdb_test "run" "Breakpoint 1, main.*:8.*" "run to main"
-# OBSOLETE ##gdb_test "next" \
-# OBSOLETE ## ".*New process.*Detaching after fork from process.*13.*parent.*" \
-# OBSOLETE ## "next on CMA fork"
-# OBSOLETE send_gdb "next\n"
-# OBSOLETE gdb_expect {
-# OBSOLETE -re ".*Detaching after fork from.*$gdb_prompt $" {
-# OBSOLETE pass "next on CMA fork"
-# OBSOLETE }
-# OBSOLETE -re ".*$gdb_prompt $" { fail "next on CMA fork" }
-# OBSOLETE timeout { fail "(timeout) next on CMA fork" }
-# OBSOLETE }
-# OBSOLETE exec sleep 1
-# OBSOLETE
-# OBSOLETE gdb_exit
-# OBSOLETE
-# OBSOLETE return 0
diff --git a/gdb/testsuite/gdb.java/jmisc1.exp b/gdb/testsuite/gdb.java/jmisc1.exp
new file mode 100644
index 0000000..eea559e
--- /dev/null
+++ b/gdb/testsuite/gdb.java/jmisc1.exp
@@ -0,0 +1,91 @@
+# Copyright 2002 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
+
+# This file was written by Anthony Green. (green@redhat.com)
+#
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+load_lib "java.exp"
+
+set testfile "jmisc"
+set srcfile ${srcdir}/$subdir/${testfile}.java
+set binfile ${objdir}/${subdir}/${testfile}
+if { [compile_java_from_source ${srcfile} ${binfile} "-g"] != "" } {
+ untested "Couldn't compile ${srcfile}"
+ return -1
+}
+
+# Set the current language to java. This counts as a test. If it
+# fails, then we skip the other tests.
+
+proc set_lang_java {} {
+ global gdb_prompt
+ global binfile objdir subdir
+
+ verbose "loading file '$binfile'"
+ gdb_load $binfile
+
+ send_gdb "set language java\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" {}
+ timeout { fail "set language java (timeout)" ; return 0 }
+ }
+
+ return [gdb_test "show language" ".* source language is \"java\".*" \
+ "set language to \"java\""]
+}
+
+set prms_id 0
+set bug_id 0
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+gdb_test "set print sevenbit-strings" ".*"
+
+if ![set_lang_java] then {
+ runto ${testfile}.main(java.lang.String\[\])
+
+ send_gdb "ptype jmisc\n"
+ gdb_expect {
+ -re "type = class jmisc extends java.lang.Object \{\[\r\n\ \t]+void main\\(java\.lang\.String\\\[]\\);\[\r\n\ \t]+void <init>\\(void\\);\[\r\n\ \t]+\}\[\r\n\ \t]+$gdb_prompt $" { pass "ptype jmisc" }
+ -re ".*$gdb_prompt $" { fail "ptype jmisc" }
+ timeout { fail "ptype jmisc (timeout)" ; return }
+ }
+
+ send_gdb "p args\n"
+ gdb_expect {
+ -re "\\\$1 = java\.lang\.String\\\[]@\[a-f0-9]+\[\r\n\ \t]+$gdb_prompt $" { pass "p args" }
+ -re ".*$gdb_prompt $" { fail "p args" }
+ timeout { fail "p args (timeout)" ; return }
+ }
+
+ send_gdb "p *args\n"
+ gdb_expect {
+ -re "\\\$2 = \{length: 0\}\[\r\n\ \t]+$gdb_prompt $" { pass "p *args" }
+ -re ".*$gdb_prompt $" { fail "p *args" }
+ timeout { fail "p *args (timeout)" ; return }
+ }
+}
diff --git a/gdb/testsuite/gdb.java/jmisc2.exp b/gdb/testsuite/gdb.java/jmisc2.exp
new file mode 100644
index 0000000..2eeb99d
--- /dev/null
+++ b/gdb/testsuite/gdb.java/jmisc2.exp
@@ -0,0 +1,91 @@
+# Copyright 2002 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
+
+# This file was written by Anthony Green. (green@redhat.com)
+#
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+load_lib "java.exp"
+
+set testfile "jmisc"
+set srcfile ${srcdir}/$subdir/${testfile}.java
+set binfile ${objdir}/${subdir}/${testfile}
+if { [compile_java_from_source ${srcfile} ${binfile} "-g"] != "" } {
+ untested "Couldn't compile ${srcfile}"
+ return -1
+}
+
+# Set the current language to java. This counts as a test. If it
+# fails, then we skip the other tests.
+
+proc set_lang_java {} {
+ global gdb_prompt
+ global binfile objdir subdir
+
+ verbose "loading file '$binfile'"
+ gdb_load $binfile
+
+ send_gdb "set language java\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" {}
+ timeout { fail "set language java (timeout)" ; return 0 }
+ }
+
+ return [gdb_test "show language" ".* source language is \"java\".*" \
+ "set language to \"java\""]
+}
+
+set prms_id 0
+set bug_id 0
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+gdb_test "set print sevenbit-strings" ".*"
+
+if ![set_lang_java] then {
+ send_gdb "ptype jmisc\n"
+ gdb_expect {
+ -re "type = class jmisc extends java.lang.Object \{\[\r\n\ \t]+void main\\(java\.lang\.String\\\[]\\);\[\r\n\ \t]+void <init>\\(void\\);\[\r\n\ \t]+\}\[\r\n\ \t]+$gdb_prompt $" { pass "ptype jmisc" }
+ -re ".*$gdb_prompt $" { fail "ptype jmisc" }
+ timeout { fail "ptype jmisc (timeout)" ; return }
+ }
+
+ runto ${testfile}.main(java.lang.String\[\])
+
+ send_gdb "p args\n"
+ gdb_expect {
+ -re "\\\$1 = java\.lang\.String\\\[]@\[a-f0-9]+\[\r\n\ \t]+$gdb_prompt $" { pass "p args" }
+ -re ".*$gdb_prompt $" { fail "p args" }
+ timeout { fail "p args (timeout)" ; return }
+ }
+
+ send_gdb "p *args\n"
+ gdb_expect {
+ -re "\\\$2 = \{length: 0\}\[\r\n\ \t]+$gdb_prompt $" { pass "p *args" }
+ -re ".*$gdb_prompt $" { fail "p *args" }
+ timeout { fail "p *args (timeout)" ; return }
+ }
+}
diff --git a/gdb/testsuite/gdb.threads/linux-dp.exp b/gdb/testsuite/gdb.threads/linux-dp.exp
index 0f1b26a..67ed122 100644
--- a/gdb/testsuite/gdb.threads/linux-dp.exp
+++ b/gdb/testsuite/gdb.threads/linux-dp.exp
@@ -214,7 +214,8 @@ proc check_philosopher_stack {thread seen_name} {
}
set any_interesting 0
-array unset seen
+array set seen {}
+unset seen
for {set i 1} {$i <= 7} {incr i} {
if [check_philosopher_stack $i seen] {
set any_interesting 1
diff --git a/gdb/testsuite/gdb.trace/gdb_c_test.c b/gdb/testsuite/gdb.trace/gdb_c_test.c
index 7477590..03382c2 100644
--- a/gdb/testsuite/gdb.trace/gdb_c_test.c
+++ b/gdb/testsuite/gdb.trace/gdb_c_test.c
@@ -2542,7 +2542,7 @@ find_memory(unsigned char *mem, long count,
mem, mem_block, mem_addr, mem_size, mem_stamp);
#endif
*location = mem_block + (mem - mem_addr);
- length = mem_size - (mem - mem_addr);;
+ length = mem_size - (mem - mem_addr);
if (length < count)
*incr = length;
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index b36211f..e476599 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -440,9 +440,9 @@ proc gdb_test { args } {
# we need to set -notransfer expect option so that
# command output is not lost for pattern matching
# - guo
- gdb_expect -notransfer 2 {
- -re "\[\r\n\]" { }
- timeout { }
+ gdb_expect 2 {
+ -notransfer -re "\[\r\n\]" { verbose "partial: match" 3 }
+ timeout { verbose "partial: timeout" 3 }
}
set string [string range "$string" [expr $foo + 1] end];
} else {
@@ -1132,20 +1132,6 @@ proc send_gdb { string } {
#
proc gdb_expect { args } {
- # allow -notransfer expect flag specification,
- # used by gdb_test routine for multi-line commands.
- # packed with gtimeout when fed to remote_expect routine,
- # which is a hack but due to what looks like a res and orig
- # parsing problem in remote_expect routine (dejagnu/lib/remote.exp):
- # what's fed into res is not removed from orig.
- # - guo
- if { [lindex $args 0] == "-notransfer" } {
- set notransfer -notransfer;
- set args [lrange $args 1 end];
- } else {
- set notransfer "";
- }
-
if { [llength $args] == 2 && [lindex $args 0] != "-re" } {
set gtimeout [lindex $args 0];
set expcode [list [lindex $args 1]];
@@ -1186,7 +1172,7 @@ proc gdb_expect { args } {
}
}
set code [catch \
- {uplevel remote_expect host "$gtimeout $notransfer" $expcode} string];
+ {uplevel remote_expect host $gtimeout $expcode} string];
if [info exists old_val] {
set remote_suppress_flag $old_val;
} else {
diff --git a/gdb/thread-db.c b/gdb/thread-db.c
index 2e7620e..d38db74 100644
--- a/gdb/thread-db.c
+++ b/gdb/thread-db.c
@@ -239,7 +239,7 @@ thread_from_lwp (ptid_t ptid)
err = td_ta_map_lwp2thr_p (thread_agent, GET_LWP (ptid), &th);
if (err != TD_OK)
- error ("Cannot find user-level thread for LWP %d: %s",
+ error ("Cannot find user-level thread for LWP %ld: %s",
GET_LWP (ptid), thread_db_err_str (err));
err = td_thr_get_info_p (&th, &ti);
diff --git a/gdb/thread.c b/gdb/thread.c
index b9c1f02..45130bb 100644
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -421,7 +421,7 @@ info_threads_command (char *arg, int from_tty)
struct thread_info *tp;
ptid_t current_ptid;
struct frame_info *cur_frame;
- int saved_frame_level = selected_frame_level;
+ int saved_frame_level = frame_relative_level (selected_frame);
int counter;
char *extra_info;
@@ -476,7 +476,7 @@ info_threads_command (char *arg, int from_tty)
}
else
{
- select_frame (cur_frame, saved_frame_level);
+ select_frame (cur_frame);
}
/* re-show current frame. */
@@ -495,7 +495,7 @@ switch_to_thread (ptid_t ptid)
flush_cached_frames ();
registers_changed ();
stop_pc = read_pc ();
- select_frame (get_current_frame (), 0);
+ select_frame (get_current_frame ());
}
static void
@@ -713,7 +713,7 @@ do_captured_thread_select (struct ui_out *uiout,
#endif
ui_out_text (uiout, ")]");
- print_stack_frame (selected_frame, selected_frame_level, 1);
+ print_stack_frame (selected_frame, frame_relative_level (selected_frame), 1);
return GDB_RC_OK;
}
diff --git a/gdb/top.c b/gdb/top.c
index 972a557..4749c38 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -27,6 +27,7 @@
#include "cli/cli-cmds.h"
#include "cli/cli-script.h"
#include "cli/cli-setshow.h"
+#include "cli/cli-decode.h"
#include "symtab.h"
#include "inferior.h"
#include <signal.h>
@@ -693,12 +694,7 @@ execute_command (char *p, int from_tty)
}
/* If this command has been pre-hooked, run the hook first. */
- if ((c->hook_pre) && (!c->hook_in))
- {
- c->hook_in = 1; /* Prevent recursive hooking */
- execute_user_command (c->hook_pre, (char *) 0);
- c->hook_in = 0; /* Allow hook to work again once it is complete */
- }
+ execute_cmd_pre_hook (c);
if (c->flags & DEPRECATED_WARN_USER)
deprecated_cmd_warning (&line);
@@ -715,12 +711,7 @@ execute_command (char *p, int from_tty)
(*c->func) (c, arg, from_tty & caution);
/* If this command has been post-hooked, run the hook last. */
- if ((c->hook_post) && (!c->hook_in))
- {
- c->hook_in = 1; /* Prevent recursive hooking */
- execute_user_command (c->hook_post, (char *) 0);
- c->hook_in = 0; /* allow hook to work again once it is complete */
- }
+ execute_cmd_post_hook (c);
}
@@ -1444,7 +1435,7 @@ get_prompt_1 (void *data)
if (*promptp != gdb_prompt_escape)
error ("Syntax error at prompt position %d",
- promptp - local_prompt);
+ (int) (promptp - local_prompt));
else
{
promptp++; /* skip second escape char */
@@ -1590,7 +1581,7 @@ get_prompt_1 (void *data)
break; /* void type -- no output */
default:
error ("bad data type at prompt position %d",
- promptp - local_prompt);
+ (int) (promptp - local_prompt));
break;
}
outp += strlen (outp);
@@ -1999,7 +1990,7 @@ Without an argument, saving is enabled.", &sethistlist),
&showhistlist);
c = add_set_cmd ("size", no_class, var_integer, (char *) &history_size,
- "Set the size of the command history, \n\
+ "Set the size of the command history,\n\
ie. the number of previous commands to keep a record of.", &sethistlist);
add_show_from_set (c, &showhistlist);
set_cmd_sfunc (c, set_history_size_command);
@@ -2007,8 +1998,8 @@ ie. the number of previous commands to keep a record of.", &sethistlist);
c = add_set_cmd ("filename", no_class, var_filename,
(char *) &history_filename,
"Set the filename in which to record the command history\n\
- (the list of previous commands of which a record is kept).", &sethistlist);
- c->completer = filename_completer;
+(the list of previous commands of which a record is kept).", &sethistlist);
+ set_cmd_completer (c, filename_completer);
add_show_from_set (c, &showhistlist);
add_show_from_set
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 860b483..dd5adb0 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -190,7 +190,7 @@ trace_error (char *buf)
if (*++buf == '0') /* general case: */
error ("tracepoint.c: error in outgoing packet.");
else
- error ("tracepoint.c: error in outgoing packet at field #%d.",
+ error ("tracepoint.c: error in outgoing packet at field #%ld.",
strtol (buf, NULL, 16));
case '2':
error ("trace API error 0x%s.", ++buf);
@@ -1928,7 +1928,7 @@ finish_tfind_command (char *msg,
flush_cached_frames ();
registers_changed ();
- select_frame (get_current_frame (), 0);
+ select_frame (get_current_frame ());
set_traceframe_num (target_frameno);
set_tracepoint_num (target_tracept);
if (target_frameno == -1)
@@ -1958,7 +1958,8 @@ finish_tfind_command (char *msg,
else
source_only = 1;
- print_stack_frame (selected_frame, selected_frame_level, source_only);
+ print_stack_frame (selected_frame, frame_relative_level (selected_frame),
+ source_only);
do_displays ();
}
}
@@ -2280,7 +2281,7 @@ tracepoint_save_command (char *args, int from_tty)
pathname = tilde_expand (args);
if (!(fp = fopen (pathname, "w")))
error ("Unable to open file '%s' for saving tracepoints (%s)",
- args, strerror (errno));
+ args, safe_strerror (errno));
xfree (pathname);
ALL_TRACEPOINTS (tp)
@@ -2677,7 +2678,7 @@ last tracepoint set.");
c = add_com ("save-tracepoints", class_trace, tracepoint_save_command,
"Save current tracepoint definitions as a script.\n\
Use the 'source' command in another debug session to restore them.");
- c->completer = filename_completer;
+ set_cmd_completer (c, filename_completer);
add_com ("tdump", class_trace, trace_dump_command,
"Print everything collected at the current tracepoint.");
@@ -2800,7 +2801,7 @@ Argument may be a line number, function name, or '*' plus an address.\n\
For a line number or function, trace at the start of its code.\n\
If an address is specified, trace at that exact address.\n\n\
Do \"help tracepoints\" for info on other tracepoint commands.");
- c->completer = location_completer;
+ set_cmd_completer (c, location_completer);
add_com_alias ("tp", "trace", class_alias, 0);
add_com_alias ("tr", "trace", class_alias, 1);
diff --git a/gdb/tui/ChangeLog b/gdb/tui/ChangeLog
index 2f676a8..d278c6a 100644
--- a/gdb/tui/ChangeLog
+++ b/gdb/tui/ChangeLog
@@ -1,3 +1,7 @@
+2002-03-15 Andrew Cagney <ac131313@redhat.com>
+
+ * tui-out.c (XMALLOC): Delete macro. Update copyright.
+
2002-03-01 Andrew Cagney <ac131313@redhat.com>
* tui-hooks.c: Add FIXME to explain true/false problem. Update
diff --git a/gdb/tui/tui-out.c b/gdb/tui/tui-out.c
index 9789c65..a8cc58b 100644
--- a/gdb/tui/tui-out.c
+++ b/gdb/tui/tui-out.c
@@ -1,5 +1,7 @@
/* Output generating routines for GDB CLI.
- Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
+
+ Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+
Contributed by Cygnus Solutions.
Written by Fernando Nasser for Cygnus.
@@ -26,12 +28,6 @@
#include "gdb_string.h"
#include "gdb_assert.h"
-/* Convenience macro for allocting typesafe memory. */
-
-#ifndef XMALLOC
-#define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE))
-#endif
-
struct ui_out_data
{
struct ui_file *stream;
diff --git a/gdb/ui-file.c b/gdb/ui-file.c
index 86655e9..3dbcaab 100644
--- a/gdb/ui-file.c
+++ b/gdb/ui-file.c
@@ -1,5 +1,6 @@
/* UI_FILE - a generic STDIO like output stream.
- Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
+
+ Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of GDB.
@@ -24,9 +25,6 @@
#include "ui-file.h"
#include "gdb_string.h"
-#undef XMALLOC
-#define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
-
static ui_file_isatty_ftype null_file_isatty;
static ui_file_write_ftype null_file_write;
static ui_file_fputs_ftype null_file_fputs;
diff --git a/gdb/ui-out.c b/gdb/ui-out.c
index 06db646..c07d695 100644
--- a/gdb/ui-out.c
+++ b/gdb/ui-out.c
@@ -1,5 +1,7 @@
/* Output generating routines for GDB.
- Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
+
+ Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+
Contributed by Cygnus Solutions.
Written by Fernando Nasser for Cygnus.
@@ -27,11 +29,6 @@
#include "ui-out.h"
#include "gdb_assert.h"
-/* Convenience macro for allocting typesafe memory. */
-
-#undef XMALLOC
-#define XMALLOC(TYPE) (TYPE*) xmalloc (sizeof (TYPE))
-
/* table header structures */
struct ui_out_hdr
@@ -495,9 +492,14 @@ ui_out_field_core_addr (struct ui_out *uiout,
{
char addstr[20];
- /* FIXME-32x64: need a print_address_numeric with field width */
+ /* FIXME: cagney/2002-05-03: Need local_address_string() function
+ that returns the language localized string formatted to a width
+ based on TARGET_ADDR_BIT. */
/* print_address_numeric (address, 1, local_stream); */
- strcpy (addstr, local_hex_string_custom ((unsigned long) address, "08l"));
+ if (TARGET_ADDR_BIT <= 32)
+ strcpy (addstr, local_hex_string_custom ((unsigned long) address, "08l"));
+ else
+ strcpy (addstr, local_hex_string_custom ((unsigned long) address, "016l"));
ui_out_field_string (uiout, fldname, addstr);
}
diff --git a/gdb/utils.c b/gdb/utils.c
index be9dc45..4baea62 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -61,6 +61,7 @@
#include "expression.h"
#include "language.h"
#include "annotate.h"
+#include "filenames.h"
#include "inferior.h" /* for signed_pointer_to_address */
@@ -81,9 +82,11 @@ extern PTR realloc ();
#ifdef NEED_DECLARATION_FREE
extern void free ();
#endif
-
-#undef XMALLOC
-#define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
+/* Actually, we'll never have the decl, since we don't define _GNU_SOURCE. */
+#if defined(HAVE_CANONICALIZE_FILE_NAME) \
+ && defined(NEED_DECLARATION_CANONICALIZE_FILE_NAME)
+extern char *canonicalize_file_name (const char *);
+#endif
/* readline defines this. */
#undef savestring
@@ -2532,21 +2535,76 @@ string_to_core_addr (const char *my_string)
char *
gdb_realpath (const char *filename)
{
-#ifdef HAVE_CANONICALIZE_FILE_NAME
- return canonicalize_file_name (filename);
-#elif defined (HAVE_REALPATH)
-#if defined (PATH_MAX)
+#if defined(HAVE_REALPATH)
+# if defined (PATH_MAX)
char buf[PATH_MAX];
-#elif defined (MAXPATHLEN)
+# define USE_REALPATH
+# elif defined (MAXPATHLEN)
char buf[MAXPATHLEN];
-#elif defined (HAVE_UNISTD_H) && defined(HAVE_ALLOCA)
+# define USE_REALPATH
+# elif defined (HAVE_UNISTD_H) && defined(HAVE_ALLOCA)
char *buf = alloca ((size_t)pathconf ("/", _PC_PATH_MAX));
-#else
-#error "Neither PATH_MAX nor MAXPATHLEN defined"
-#endif
+# define USE_REALPATH
+# endif
+#endif /* HAVE_REALPATH */
+
+#if defined(USE_REALPATH)
char *rp = realpath (filename, buf);
return xstrdup (rp ? rp : filename);
+#elif defined(HAVE_CANONICALIZE_FILE_NAME)
+ char *rp = canonicalize_file_name (filename);
+ if (rp == NULL)
+ return xstrdup (filename);
+ else
+ return rp;
#else
return xstrdup (filename);
#endif
}
+
+/* Return a copy of FILENAME, with its directory prefix canonicalized
+ by gdb_realpath. */
+
+char *
+xfullpath (const char *filename)
+{
+ const char *base_name = lbasename (filename);
+ char *dir_name;
+ char *real_path;
+ char *result;
+
+ /* Extract the basename of filename, and return immediately
+ a copy of filename if it does not contain any directory prefix. */
+ if (base_name == filename)
+ return xstrdup (filename);
+
+ dir_name = alloca ((size_t) (base_name - filename + 2));
+ /* Allocate enough space to store the dir_name + plus one extra
+ character sometimes needed under Windows (see below), and
+ then the closing \000 character */
+ strncpy (dir_name, filename, base_name - filename);
+ dir_name[base_name - filename] = '\000';
+
+#ifdef HAVE_DOS_BASED_FILE_SYSTEM
+ /* We need to be careful when filename is of the form 'd:foo', which
+ is equivalent of d:./foo, which is totally different from d:/foo. */
+ if (strlen (dir_name) == 2 &&
+ isalpha (dir_name[0]) && dir_name[1] == ':')
+ {
+ dir_name[2] = '.';
+ dir_name[3] = '\000';
+ }
+#endif
+
+ /* Canonicalize the directory prefix, and build the resulting
+ filename. If the dirname realpath already contains an ending
+ directory separator, avoid doubling it. */
+ real_path = gdb_realpath (dir_name);
+ if (IS_DIR_SEPARATOR (real_path[strlen (real_path) - 1]))
+ result = concat (real_path, base_name, NULL);
+ else
+ result = concat (real_path, SLASH_STRING, base_name, NULL);
+
+ xfree (real_path);
+ return result;
+}
diff --git a/gdb/valarith.c b/gdb/valarith.c
index 5852ac6..cc067cb 100644
--- a/gdb/valarith.c
+++ b/gdb/valarith.c
@@ -43,12 +43,50 @@ static struct value *value_subscripted_rvalue (struct value *, struct value *, i
void _initialize_valarith (void);
+/* Given a pointer, return the size of its target.
+ If the pointer type is void *, then return 1.
+ If the target type is incomplete, then error out.
+ This isn't a general purpose function, but just a
+ helper for value_sub & value_add.
+*/
+
+static LONGEST
+find_size_for_pointer_math (struct type *ptr_type)
+{
+ LONGEST sz = -1;
+ struct type *ptr_target;
+
+ ptr_target = check_typedef (TYPE_TARGET_TYPE (ptr_type));
+
+ sz = TYPE_LENGTH (ptr_target);
+ if (sz == 0)
+ {
+ if (TYPE_CODE (ptr_type) == TYPE_CODE_VOID)
+ sz = 1;
+ else
+ {
+ char *name;
+
+ name = TYPE_NAME (ptr_target);
+ if (name == NULL)
+ name = TYPE_TAG_NAME (ptr_target);
+ if (name == NULL)
+ error ("Cannot perform pointer math on incomplete types, "
+ "try casting to a known type, or void *.");
+ else
+ error ("Cannot perform pointer math on incomplete type \"%s\", "
+ "try casting to a known type, or void *.", name);
+ }
+ }
+ return sz;
+}
+
struct value *
value_add (struct value *arg1, struct value *arg2)
{
struct value *valint;
struct value *valptr;
- register int len;
+ LONGEST sz;
struct type *type1, *type2, *valptrtype;
COERCE_NUMBER (arg1);
@@ -77,12 +115,12 @@ value_add (struct value *arg1, struct value *arg2)
valint = arg1;
valptrtype = type2;
}
- len = TYPE_LENGTH (check_typedef (TYPE_TARGET_TYPE (valptrtype)));
- if (len == 0)
- len = 1; /* For (void *) */
+
+ sz = find_size_for_pointer_math (valptrtype);
+
retval = value_from_pointer (valptrtype,
value_as_address (valptr)
- + (len * value_as_long (valint)));
+ + (sz * value_as_long (valint)));
VALUE_BFD_SECTION (retval) = VALUE_BFD_SECTION (valptr);
return retval;
}
@@ -104,7 +142,8 @@ value_sub (struct value *arg1, struct value *arg2)
if (TYPE_CODE (type2) == TYPE_CODE_INT)
{
/* pointer - integer. */
- LONGEST sz = TYPE_LENGTH (check_typedef (TYPE_TARGET_TYPE (type1)));
+ LONGEST sz = find_size_for_pointer_math (type1);
+
return value_from_pointer (type1,
(value_as_address (arg1)
- (sz * value_as_long (arg2))));
@@ -759,7 +798,7 @@ value_binop (struct value *arg1, struct value *arg2, enum exp_opcode op)
case BINOP_EXP:
v = pow (v1, v2);
if (errno)
- error ("Cannot perform exponentiation: %s", strerror (errno));
+ error ("Cannot perform exponentiation: %s", safe_strerror (errno));
break;
default:
@@ -897,7 +936,7 @@ value_binop (struct value *arg1, struct value *arg2, enum exp_opcode op)
case BINOP_EXP:
v = pow (v1, v2);
if (errno)
- error ("Cannot perform exponentiation: %s", strerror (errno));
+ error ("Cannot perform exponentiation: %s", safe_strerror (errno));
break;
case BINOP_REM:
@@ -1021,7 +1060,7 @@ value_binop (struct value *arg1, struct value *arg2, enum exp_opcode op)
case BINOP_EXP:
v = pow (v1, v2);
if (errno)
- error ("Cannot perform exponentiation: %s", strerror (errno));
+ error ("Cannot perform exponentiation: %s", safe_strerror (errno));
break;
case BINOP_REM:
diff --git a/gdb/valops.c b/gdb/valops.c
index 4532da7..146f1a6 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -607,7 +607,7 @@ value_assign (struct value *toval, struct value *fromval)
if (changed_len > (int) sizeof (LONGEST))
error ("Can't handle bitfields which don't fit in a %d bit word.",
- sizeof (LONGEST) * HOST_CHAR_BIT);
+ (int) sizeof (LONGEST) * HOST_CHAR_BIT);
read_memory (VALUE_ADDRESS (toval) + VALUE_OFFSET (toval),
buffer, changed_len);
@@ -644,7 +644,7 @@ value_assign (struct value *toval, struct value *fromval)
if (len > (int) sizeof (LONGEST))
error ("Can't handle bitfields in registers larger than %d bits.",
- sizeof (LONGEST) * HOST_CHAR_BIT);
+ (int) sizeof (LONGEST) * HOST_CHAR_BIT);
if (VALUE_BITPOS (toval) + VALUE_BITSIZE (toval)
> len * HOST_CHAR_BIT)
@@ -1190,8 +1190,12 @@ value_arg_coerce (struct value *arg, struct type *param_type,
type = lookup_pointer_type (type);
break;
case TYPE_CODE_ARRAY:
+ /* Arrays are coerced to pointers to their first element, unless
+ they are vectors, in which case we want to leave them alone,
+ because they are passed by value. */
if (current_language->c_style_arrays)
- type = lookup_pointer_type (TYPE_TARGET_TYPE (type));
+ if (!TYPE_VECTOR (type))
+ type = lookup_pointer_type (TYPE_TARGET_TYPE (type));
break;
case TYPE_CODE_UNDEF:
case TYPE_CODE_PTR:
@@ -1385,6 +1389,8 @@ hand_function_call (struct value *function, int nargs, struct value **args)
if (CALL_DUMMY_LOCATION == ON_STACK)
{
write_memory (start_sp, (char *) dummy1, sizeof_dummy1);
+ if (USE_GENERIC_DUMMY_FRAMES)
+ generic_save_call_dummy_addr (start_sp, start_sp + sizeof_dummy1);
}
if (CALL_DUMMY_LOCATION == BEFORE_TEXT_END)
@@ -1401,6 +1407,8 @@ hand_function_call (struct value *function, int nargs, struct value **args)
sp = old_sp;
real_pc = text_end - sizeof_dummy1;
write_memory (real_pc, (char *) dummy1, sizeof_dummy1);
+ if (USE_GENERIC_DUMMY_FRAMES)
+ generic_save_call_dummy_addr (real_pc, real_pc + sizeof_dummy1);
}
if (CALL_DUMMY_LOCATION == AFTER_TEXT_END)
@@ -1412,11 +1420,18 @@ hand_function_call (struct value *function, int nargs, struct value **args)
errcode = target_write_memory (real_pc, (char *) dummy1, sizeof_dummy1);
if (errcode != 0)
error ("Cannot write text segment -- call_function failed");
+ if (USE_GENERIC_DUMMY_FRAMES)
+ generic_save_call_dummy_addr (real_pc, real_pc + sizeof_dummy1);
}
if (CALL_DUMMY_LOCATION == AT_ENTRY_POINT)
{
real_pc = funaddr;
+ if (USE_GENERIC_DUMMY_FRAMES)
+ /* NOTE: cagney/2002-04-13: The entry point is going to be
+ modified with a single breakpoint. */
+ generic_save_call_dummy_addr (CALL_DUMMY_ADDRESS (),
+ CALL_DUMMY_ADDRESS () + 1);
}
#ifdef lint
@@ -3250,7 +3265,7 @@ value_of_this (int complain)
/* Calling lookup_block_symbol is necessary to get the LOC_REGISTER
symbol instead of the LOC_ARG one (if both exist). */
- sym = lookup_block_symbol (b, funny_this, VAR_NAMESPACE);
+ sym = lookup_block_symbol (b, funny_this, NULL, VAR_NAMESPACE);
if (sym == NULL)
{
if (complain)
diff --git a/gdb/valprint.c b/gdb/valprint.c
index 131769b..36854ce 100644
--- a/gdb/valprint.c
+++ b/gdb/valprint.c
@@ -1,7 +1,8 @@
/* Print values for GDB, the GNU debugger.
- Copyright 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
- 1997, 1998, 1999, 2000, 2001
- Free Software Foundation, Inc.
+
+ Copyright 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
+ 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation,
+ Inc.
This file is part of GDB.
@@ -335,7 +336,7 @@ print_longest (struct ui_file *stream, int format, int use_local,
val_long);
break;
case 'u':
- fprintf_filtered (stream, "%llu", val_long);
+ fprintf_filtered (stream, "%llu", (long long) val_long);
break;
case 'x':
fprintf_filtered (stream,
@@ -414,109 +415,6 @@ print_longest (struct ui_file *stream, int format, int use_local,
#endif /* CC_HAS_LONG_LONG || PRINTF_HAS_LONG_LONG */
}
-#if 0
-void
-strcat_longest (int format, int use_local, LONGEST val_long, char *buf,
- int buflen)
-{
-/* FIXME: Use buflen to avoid buffer overflow. */
-#if defined (CC_HAS_LONG_LONG) && !defined (PRINTF_HAS_LONG_LONG)
- long vtop, vbot;
-
- vtop = val_long >> (sizeof (long) * HOST_CHAR_BIT);
- vbot = (long) val_long;
-
- if ((format == 'd' && (val_long < INT_MIN || val_long > INT_MAX))
- || ((format == 'u' || format == 'x') && (unsigned long long) val_long > UINT_MAX))
- {
- sprintf (buf, "0x%lx%08lx", vtop, vbot);
- return;
- }
-#endif
-
-#ifdef PRINTF_HAS_LONG_LONG
- switch (format)
- {
- case 'd':
- sprintf (buf,
- (use_local ? local_decimal_format_custom ("ll") : "%lld"),
- val_long);
- break;
- case 'u':
- sprintf (buf, "%llu", val_long);
- break;
- case 'x':
- sprintf (buf,
- (use_local ? local_hex_format_custom ("ll") : "%llx"),
-
- val_long);
- break;
- case 'o':
- sprintf (buf,
- (use_local ? local_octal_format_custom ("ll") : "%llo"),
- val_long);
- break;
- case 'b':
- sprintf (buf, local_hex_format_custom ("02ll"), val_long);
- break;
- case 'h':
- sprintf (buf, local_hex_format_custom ("04ll"), val_long);
- break;
- case 'w':
- sprintf (buf, local_hex_format_custom ("08ll"), val_long);
- break;
- case 'g':
- sprintf (buf, local_hex_format_custom ("016ll"), val_long);
- break;
- default:
- internal_error (__FILE__, __LINE__, "failed internal consistency check");
- }
-#else /* !PRINTF_HAS_LONG_LONG */
- /* In the following it is important to coerce (val_long) to a long. It does
- nothing if !LONG_LONG, but it will chop off the top half (which we know
- we can ignore) if the host supports long longs. */
-
- switch (format)
- {
- case 'd':
- sprintf (buf, (use_local ? local_decimal_format_custom ("l") : "%ld"),
- ((long) val_long));
- break;
- case 'u':
- sprintf (buf, "%lu", ((unsigned long) val_long));
- break;
- case 'x':
- sprintf (buf, (use_local ? local_hex_format_custom ("l") : "%lx"),
- ((long) val_long));
- break;
- case 'o':
- sprintf (buf, (use_local ? local_octal_format_custom ("l") : "%lo"),
- ((long) val_long));
- break;
- case 'b':
- sprintf (buf, local_hex_format_custom ("02l"),
- ((long) val_long));
- break;
- case 'h':
- sprintf (buf, local_hex_format_custom ("04l"),
- ((long) val_long));
- break;
- case 'w':
- sprintf (buf, local_hex_format_custom ("08l"),
- ((long) val_long));
- break;
- case 'g':
- sprintf (buf, local_hex_format_custom ("016l"),
- ((long) val_long));
- break;
- default:
- internal_error (__FILE__, __LINE__, "failed internal consistency check");
- }
-
-#endif /* !PRINTF_HAS_LONG_LONG */
-}
-#endif
-
/* This used to be a macro, but I don't think it is called often enough
to merit such treatment. */
/* Convert a LONGEST to an int. This is used in contexts (e.g. number of
@@ -1294,7 +1192,7 @@ val_print_string (CORE_ADDR addr, int len, int width, struct ui_file *stream)
static void
set_input_radix (char *args, int from_tty, struct cmd_list_element *c)
{
- set_input_radix_1 (from_tty, *(unsigned *) c->var);
+ set_input_radix_1 (from_tty, input_radix);
}
/* ARGSUSED */
@@ -1310,6 +1208,8 @@ set_input_radix_1 (int from_tty, unsigned radix)
if (radix < 2)
{
+ /* FIXME: cagney/2002-03-17: This needs to revert the bad radix
+ value. */
error ("Nonsense input radix ``decimal %u''; input radix unchanged.",
radix);
}
@@ -1325,7 +1225,7 @@ set_input_radix_1 (int from_tty, unsigned radix)
static void
set_output_radix (char *args, int from_tty, struct cmd_list_element *c)
{
- set_output_radix_1 (from_tty, *(unsigned *) c->var);
+ set_output_radix_1 (from_tty, output_radix);
}
static void
@@ -1345,6 +1245,8 @@ set_output_radix_1 (int from_tty, unsigned radix)
output_format = 'o'; /* octal */
break;
default:
+ /* FIXME: cagney/2002-03-17: This needs to revert the bad radix
+ value. */
error ("Unsupported output radix ``decimal %u''; output radix unchanged.",
radix);
}
diff --git a/gdb/value.h b/gdb/value.h
index d6fa9ff..62dc490 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -125,14 +125,6 @@ struct value
list. */
struct value *next;
- /* ??? When is this used? */
- union
- {
- CORE_ADDR memaddr;
- char *myaddr;
- }
- substring_addr;
-
/* Register number if the value is from a register. Is not kept
if you take a field of a structure that is stored in a
register. Shouldn't it be? */
@@ -166,9 +158,10 @@ struct value
union
{
long contents[1];
- double force_double_align;
- LONGEST force_longlong_align;
- char *literal_data;
+ DOUBLEST force_doublest_align;
+ LONGEST force_longest_align;
+ CORE_ADDR force_core_addr_align;
+ void *force_pointer_align;
}
aligner;
/* Do not add any new members here -- contents above will trash them */
@@ -317,7 +310,8 @@ extern struct value *value_from_register (struct type *type, int regnum,
extern struct value *value_of_variable (struct symbol *var, struct block *b);
-extern struct value *value_of_register (int regnum);
+extern struct value *value_of_register (int regnum,
+ struct frame_info *frame);
extern int symbol_read_needs_frame (struct symbol *);
diff --git a/gdb/varobj.c b/gdb/varobj.c
index f56b7aa..9ae145e 100644
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -426,7 +426,7 @@ varobj_create (char *objname,
block = NULL;
if (fi != NULL)
- block = get_frame_block (fi);
+ block = get_frame_block (fi, 0);
p = expression;
innermost_block = NULL;
@@ -458,7 +458,7 @@ varobj_create (char *objname,
{
var->root->frame = FRAME_FP (fi);
old_fi = selected_frame;
- select_frame (fi, -1);
+ select_frame (fi);
}
/* We definitively need to catch errors here.
@@ -485,7 +485,7 @@ varobj_create (char *objname,
/* Reset the selected frame */
if (fi != NULL)
- select_frame (old_fi, -1);
+ select_frame (old_fi);
}
/* If the variable object name is null, that means this
@@ -983,7 +983,7 @@ varobj_update (struct varobj **varp, struct varobj ***changelist)
}
/* Restore selected frame */
- select_frame (old_fi, -1);
+ select_frame (old_fi);
if (type_changed)
return -2;
@@ -1862,7 +1862,7 @@ c_value_of_root (struct varobj **var_handle)
within_scope = fi != NULL;
/* FIXME: select_frame could fail */
if (within_scope)
- select_frame (fi, -1);
+ select_frame (fi);
}
if (within_scope)
diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c
index a5fbe3a..0478227 100644
--- a/gdb/vax-tdep.c
+++ b/gdb/vax-tdep.c
@@ -1,5 +1,5 @@
/* Print VAX instructions for GDB, the GNU debugger.
- Copyright 1986, 1989, 1991, 1992, 1995, 1996, 1998, 1999, 2000
+ Copyright 1986, 1989, 1991, 1992, 1995, 1996, 1998, 1999, 2000, 2002
Free Software Foundation, Inc.
This file is part of GDB.
@@ -23,8 +23,39 @@
#include "symtab.h"
#include "opcode/vax.h"
#include "gdbcore.h"
+#include "inferior.h"
+#include "regcache.h"
#include "frame.h"
#include "value.h"
+#include "arch-utils.h"
+
+#include "vax-tdep.h"
+
+static gdbarch_register_name_ftype vax_register_name;
+static gdbarch_register_byte_ftype vax_register_byte;
+static gdbarch_register_raw_size_ftype vax_register_raw_size;
+static gdbarch_register_virtual_size_ftype vax_register_virtual_size;
+static gdbarch_register_virtual_type_ftype vax_register_virtual_type;
+
+static gdbarch_skip_prologue_ftype vax_skip_prologue;
+static gdbarch_saved_pc_after_call_ftype vax_saved_pc_after_call;
+static gdbarch_frame_num_args_ftype vax_frame_num_args;
+static gdbarch_frame_chain_ftype vax_frame_chain;
+static gdbarch_frame_saved_pc_ftype vax_frame_saved_pc;
+static gdbarch_frame_args_address_ftype vax_frame_args_address;
+static gdbarch_frame_locals_address_ftype vax_frame_locals_address;
+static gdbarch_frame_init_saved_regs_ftype vax_frame_init_saved_regs;
+static gdbarch_get_saved_register_ftype vax_get_saved_register;
+
+static gdbarch_store_struct_return_ftype vax_store_struct_return;
+static gdbarch_extract_return_value_ftype vax_extract_return_value;
+static gdbarch_store_return_value_ftype vax_store_return_value;
+static gdbarch_extract_struct_value_address_ftype
+ vax_extract_struct_value_address;
+
+static gdbarch_push_dummy_frame_ftype vax_push_dummy_frame;
+static gdbarch_pop_frame_ftype vax_pop_frame;
+static gdbarch_fix_call_dummy_ftype vax_fix_call_dummy;
/* Return 1 if P points to an invalid floating point value.
LEN is the length in bytes -- not relevant on the Vax. */
@@ -52,10 +83,280 @@
static unsigned char *print_insn_arg ();
+static char *
+vax_register_name (int regno)
+{
+ static char *register_names[] =
+ {
+ "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
+ "r8", "r9", "r10", "r11", "ap", "fp", "sp", "pc",
+ "ps",
+ };
+
+ if (regno < 0)
+ return (NULL);
+ if (regno >= (sizeof(register_names) / sizeof(*register_names)))
+ return (NULL);
+ return (register_names[regno]);
+}
+
+static int
+vax_register_byte (int regno)
+{
+ return (regno * 4);
+}
+
+static int
+vax_register_raw_size (int regno)
+{
+ return (4);
+}
+
+static int
+vax_register_virtual_size (int regno)
+{
+ return (4);
+}
+
+static struct type *
+vax_register_virtual_type (int regno)
+{
+ return (builtin_type_int);
+}
+
+static void
+vax_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp,
+ struct frame_info *frame, int regnum,
+ enum lval_type *lval)
+{
+ CORE_ADDR addr;
+
+ if (!target_has_registers)
+ error ("No registers.");
+
+ /* Normal systems don't optimize out things with register numbers. */
+ if (optimized != NULL)
+ *optimized = 0;
+ addr = find_saved_register (frame, regnum);
+ if (addr != 0)
+ {
+ if (lval != NULL)
+ *lval = lval_memory;
+ if (regnum == SP_REGNUM)
+ {
+ if (raw_buffer != NULL)
+ {
+ /* Put it back in target format. */
+ store_address (raw_buffer, REGISTER_RAW_SIZE (regnum),
+ (LONGEST) addr);
+ }
+ if (addrp != NULL)
+ *addrp = 0;
+ return;
+ }
+ if (raw_buffer != NULL)
+ target_read_memory (addr, raw_buffer, REGISTER_RAW_SIZE (regnum));
+ }
+ else
+ {
+ if (lval != NULL)
+ *lval = lval_register;
+ addr = REGISTER_BYTE (regnum);
+ if (raw_buffer != NULL)
+ read_register_gen (regnum, raw_buffer);
+ }
+ if (addrp != NULL)
+ *addrp = addr;
+}
+
+static void
+vax_frame_init_saved_regs (struct frame_info *frame)
+{
+ int regnum, regmask;
+ CORE_ADDR next_addr;
+
+ if (frame->saved_regs)
+ return;
+
+ frame_saved_regs_zalloc (frame);
+
+ regmask = read_memory_integer (frame->frame + 4, 4) >> 16;
+
+ next_addr = frame->frame + 16;
+
+ /* regmask's low bit is for register 0, which is the first one
+ what would be pushed. */
+ for (regnum = 0; regnum < AP_REGNUM; regnum++)
+ {
+ if (regmask & (1 << regnum))
+ frame->saved_regs[regnum] = next_addr += 4;
+ }
+
+ frame->saved_regs[SP_REGNUM] = next_addr + 4;
+ if (regmask & (1 << FP_REGNUM))
+ frame->saved_regs[SP_REGNUM] +=
+ 4 + (4 * read_memory_integer (next_addr + 4, 4));
+
+ frame->saved_regs[PC_REGNUM] = frame->frame + 16;
+ frame->saved_regs[FP_REGNUM] = frame->frame + 12;
+ frame->saved_regs[AP_REGNUM] = frame->frame + 8;
+ frame->saved_regs[PS_REGNUM] = frame->frame + 4;
+}
+
+static CORE_ADDR
+vax_frame_saved_pc (struct frame_info *frame)
+{
+ if (frame->signal_handler_caller)
+ return (sigtramp_saved_pc (frame)); /* XXXJRT */
+
+ return (read_memory_integer (frame->frame + 16, 4));
+}
+
+CORE_ADDR
+vax_frame_args_address_correct (struct frame_info *frame)
+{
+ /* Cannot find the AP register value directly from the FP value. Must
+ find it saved in the frame called by this one, or in the AP register
+ for the innermost frame. However, there is no way to tell the
+ difference between the innermost frame and a frame for which we
+ just don't know the frame that it called (e.g. "info frame 0x7ffec789").
+ For the sake of argument, suppose that the stack is somewhat trashed
+ (which is one reason that "info frame" exists). So, return 0 (indicating
+ we don't know the address of the arglist) if we don't know what frame
+ this frame calls. */
+ if (frame->next)
+ return (read_memory_integer (frame->next->frame + 8, 4));
+
+ return (0);
+}
+
+static CORE_ADDR
+vax_frame_args_address (struct frame_info *frame)
+{
+ /* In most of GDB, getting the args address is too important to
+ just say "I don't know". This is sometimes wrong for functions
+ that aren't on top of the stack, but c'est la vie. */
+ if (frame->next)
+ return (read_memory_integer (frame->next->frame + 8, 4));
+
+ return (read_register (AP_REGNUM));
+}
+
+static CORE_ADDR
+vax_frame_locals_address (struct frame_info *frame)
+{
+ return (frame->frame);
+}
+
+static int
+vax_frame_num_args (struct frame_info *fi)
+{
+ return (0xff & read_memory_integer (FRAME_ARGS_ADDRESS (fi), 1));
+}
+
+static CORE_ADDR
+vax_frame_chain (struct frame_info *frame)
+{
+ /* In the case of the VAX, the frame's nominal address is the FP value,
+ and 12 bytes later comes the saved previous FP value as a 4-byte word. */
+ if (inside_entry_file (frame->pc))
+ return (0);
+
+ return (read_memory_integer (frame->frame + 12, 4));
+}
+
+static void
+vax_push_dummy_frame (void)
+{
+ CORE_ADDR sp = read_register (SP_REGNUM);
+ int regnum;
+
+ sp = push_word (sp, 0); /* arglist */
+ for (regnum = 11; regnum >= 0; regnum--)
+ sp = push_word (sp, read_register (regnum));
+ sp = push_word (sp, read_register (PC_REGNUM));
+ sp = push_word (sp, read_register (FP_REGNUM));
+ sp = push_word (sp, read_register (AP_REGNUM));
+ sp = push_word (sp, (read_register (PS_REGNUM) & 0xffef) + 0x2fff0000);
+ sp = push_word (sp, 0);
+ write_register (SP_REGNUM, sp);
+ write_register (FP_REGNUM, sp);
+ write_register (AP_REGNUM, sp + (17 * 4));
+}
+
+static void
+vax_pop_frame (void)
+{
+ CORE_ADDR fp = read_register (FP_REGNUM);
+ int regnum;
+ int regmask = read_memory_integer (fp + 4, 4);
+
+ write_register (PS_REGNUM,
+ (regmask & 0xffff)
+ | (read_register (PS_REGNUM) & 0xffff0000));
+ write_register (PC_REGNUM, read_memory_integer (fp + 16, 4));
+ write_register (FP_REGNUM, read_memory_integer (fp + 12, 4));
+ write_register (AP_REGNUM, read_memory_integer (fp + 8, 4));
+ fp += 16;
+ for (regnum = 0; regnum < 12; regnum++)
+ if (regmask & (0x10000 << regnum))
+ write_register (regnum, read_memory_integer (fp += 4, 4));
+ fp = fp + 4 + ((regmask >> 30) & 3);
+ if (regmask & 0x20000000)
+ {
+ regnum = read_memory_integer (fp, 4);
+ fp += (regnum + 1) * 4;
+ }
+ write_register (SP_REGNUM, fp);
+ flush_cached_frames ();
+}
+
+/* The VAX call dummy sequence:
+
+ calls #69, @#32323232
+ bpt
+
+ It is 8 bytes long. The address and argc are patched by
+ vax_fix_call_dummy(). */
+static LONGEST vax_call_dummy_words[] = { 0x329f69fb, 0x03323232 };
+static int sizeof_vax_call_dummy_words = sizeof(vax_call_dummy_words);
+
+static void
+vax_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs,
+ struct value **args, struct type *type, int gcc_p)
+{
+ dummy[1] = nargs;
+ store_unsigned_integer (dummy + 3, 4, fun);
+}
+
+static void
+vax_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
+{
+ write_register (1, addr);
+}
+
+static void
+vax_extract_return_value (struct type *valtype, char *regbuf, char *valbuf)
+{
+ memcpy (valbuf, regbuf + REGISTER_BYTE (0), TYPE_LENGTH (valtype));
+}
+
+static void
+vax_store_return_value (struct type *valtype, char *valbuf)
+{
+ write_register_bytes (0, valbuf, TYPE_LENGTH (valtype));
+}
+
+static CORE_ADDR
+vax_extract_struct_value_address (char *regbuf)
+{
+ return (extract_address (regbuf + REGISTER_BYTE (0), REGISTER_RAW_SIZE (0)));
+}
+
/* Advance PC across any function entry prologue instructions
to reach some "real" code. */
-CORE_ADDR
+static CORE_ADDR
vax_skip_prologue (CORE_ADDR pc)
{
register int op = (unsigned char) read_memory_integer (pc, 1);
@@ -81,17 +382,12 @@ vax_skip_prologue (CORE_ADDR pc)
return pc;
}
-/* Return number of args passed to a frame.
- Can return -1, meaning no way to tell. */
-
-int
-vax_frame_num_args (struct frame_info *fi)
+static CORE_ADDR
+vax_saved_pc_after_call (struct frame_info *frame)
{
- return (0xff & read_memory_integer (FRAME_ARGS_ADDRESS (fi), 1));
+ return (FRAME_SAVED_PC(frame));
}
-
-
-
+
/* Print the vax instruction at address MEMADDR in debugged memory,
from disassembler info INFO.
Returns length of the instruction, in bytes. */
@@ -142,7 +438,7 @@ vax_print_insn (CORE_ADDR memaddr, disassemble_info *info)
}
return p - buffer;
}
-
+
static unsigned char *
print_insn_arg (char *d, register char *p, CORE_ADDR addr,
disassemble_info *info)
@@ -313,9 +609,101 @@ print_insn_arg (char *d, register char *p, CORE_ADDR addr,
return (unsigned char *) p;
}
+
+/* Initialize the current architecture based on INFO. If possible, re-use an
+ architecture from ARCHES, which is a list of architectures already created
+ during this debugging session.
+
+ Called e.g. at program startup, when reading a core file, and when reading
+ a binary file. */
+
+static struct gdbarch *
+vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
+{
+ struct gdbarch *gdbarch;
+
+ /* Right now there is only one VAX architecture variant. */
+ if (arches != NULL)
+ return (arches->gdbarch);
+
+ gdbarch = gdbarch_alloc (&info, NULL);
+
+ /* Register info */
+ set_gdbarch_num_regs (gdbarch, VAX_NUM_REGS);
+ set_gdbarch_sp_regnum (gdbarch, VAX_SP_REGNUM);
+ set_gdbarch_fp_regnum (gdbarch, VAX_FP_REGNUM);
+ set_gdbarch_pc_regnum (gdbarch, VAX_PC_REGNUM);
+ set_gdbarch_ps_regnum (gdbarch, VAX_PS_REGNUM);
+
+ set_gdbarch_register_name (gdbarch, vax_register_name);
+ set_gdbarch_register_size (gdbarch, VAX_REGISTER_SIZE);
+ set_gdbarch_register_bytes (gdbarch, VAX_REGISTER_BYTES);
+ set_gdbarch_register_byte (gdbarch, vax_register_byte);
+ set_gdbarch_register_raw_size (gdbarch, vax_register_raw_size);
+ set_gdbarch_max_register_raw_size (gdbarch, VAX_MAX_REGISTER_RAW_SIZE);
+ set_gdbarch_register_virtual_size (gdbarch, vax_register_virtual_size);
+ set_gdbarch_max_register_virtual_size (gdbarch,
+ VAX_MAX_REGISTER_VIRTUAL_SIZE);
+ set_gdbarch_register_virtual_type (gdbarch, vax_register_virtual_type);
+
+ /* Frame and stack info */
+ set_gdbarch_skip_prologue (gdbarch, vax_skip_prologue);
+ set_gdbarch_saved_pc_after_call (gdbarch, vax_saved_pc_after_call);
+
+ set_gdbarch_frame_num_args (gdbarch, vax_frame_num_args);
+ set_gdbarch_frameless_function_invocation (gdbarch,
+ generic_frameless_function_invocation_not);
+
+ set_gdbarch_frame_chain (gdbarch, vax_frame_chain);
+ set_gdbarch_frame_chain_valid (gdbarch, func_frame_chain_valid);
+ set_gdbarch_frame_saved_pc (gdbarch, vax_frame_saved_pc);
+
+ set_gdbarch_frame_args_address (gdbarch, vax_frame_args_address);
+ set_gdbarch_frame_locals_address (gdbarch, vax_frame_locals_address);
+
+ set_gdbarch_frame_init_saved_regs (gdbarch, vax_frame_init_saved_regs);
+
+ set_gdbarch_frame_args_skip (gdbarch, 4);
+
+ set_gdbarch_get_saved_register (gdbarch, vax_get_saved_register);
+
+ set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
+
+ /* Return value info */
+ set_gdbarch_store_struct_return (gdbarch, vax_store_struct_return);
+ set_gdbarch_extract_return_value (gdbarch, vax_extract_return_value);
+ set_gdbarch_store_return_value (gdbarch, vax_store_return_value);
+ set_gdbarch_extract_struct_value_address (gdbarch,
+ vax_extract_struct_value_address);
+
+ /* Call dummy info */
+ set_gdbarch_push_dummy_frame (gdbarch, vax_push_dummy_frame);
+ set_gdbarch_pop_frame (gdbarch, vax_pop_frame);
+ set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
+ set_gdbarch_call_dummy_p (gdbarch, 1);
+ set_gdbarch_call_dummy_words (gdbarch, vax_call_dummy_words);
+ set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof_vax_call_dummy_words);
+ set_gdbarch_fix_call_dummy (gdbarch, vax_fix_call_dummy);
+ set_gdbarch_call_dummy_start_offset (gdbarch, 0);
+ set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1);
+ set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 7);
+ set_gdbarch_use_generic_dummy_frames (gdbarch, 0);
+ set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy_on_stack);
+ set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0);
+
+ /* Breakpoint info */
+ set_gdbarch_decr_pc_after_break (gdbarch, 0);
+
+ /* Misc info */
+ set_gdbarch_function_start_offset (gdbarch, 2);
+
+ return (gdbarch);
+}
void
_initialize_vax_tdep (void)
{
+ gdbarch_register (bfd_arch_vax, vax_gdbarch_init, NULL);
+
tm_print_insn = vax_print_insn;
}
diff --git a/gdb/vax-tdep.h b/gdb/vax-tdep.h
new file mode 100644
index 0000000..95324bc
--- /dev/null
+++ b/gdb/vax-tdep.h
@@ -0,0 +1,55 @@
+/* Common target dependent code for GDB on VAX systems.
+ Copyright 2002 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. */
+
+#ifndef VAX_TDEP_H
+#define VAX_TDEP_H
+
+/* 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 VAX_REGISTER_SIZE 4
+
+/* Number of machine registers. */
+#define VAX_NUM_REGS 17
+
+/* Total amount of space needed to store our copies of the machine's
+ register state. */
+#define VAX_REGISTER_BYTES (VAX_NUM_REGS * 4)
+
+/* Largest value REGISTER_RAW_SIZE can have. */
+#define VAX_MAX_REGISTER_RAW_SIZE 4
+
+/* Largest value REGISTER_VIRTUAL_SIZE can have. */
+#define VAX_MAX_REGISTER_VIRTUAL_SIZE 4
+
+/* Register numbers of various important registers.
+ Note that most of these values are "real" register numbers,
+ and correspond to the general registers of the machine,
+ and are "phony" register numbers which is too large
+ to be an actual register number as far as the user is concerned
+ but serves to get the desired value when passed to read_register. */
+
+#define VAX_AP_REGNUM 12 /* argument pointer */
+#define VAX_FP_REGNUM 13 /* Contains address of executing stack frame */
+#define VAX_SP_REGNUM 14 /* Contains address of top of stack */
+#define VAX_PC_REGNUM 15 /* Contains program counter */
+#define VAX_PS_REGNUM 16 /* Contains processor status */
+
+#endif /* VAX_TDEP_H */
diff --git a/gdb/version.in b/gdb/version.in
index 4810350..63bac33 100644
--- a/gdb/version.in
+++ b/gdb/version.in
@@ -1 +1 @@
-5.1.90-2002-03-27-cvs
+2002-05-06-cvs
diff --git a/gdb/win32-nat.c b/gdb/win32-nat.c
index ddbcd0b..d519f7b 100644
--- a/gdb/win32-nat.c
+++ b/gdb/win32-nat.c
@@ -123,7 +123,8 @@ static DEBUG_EVENT current_event; /* The current debug event from
WaitForDebugEvent */
static HANDLE current_process_handle; /* Currently executing process */
static thread_info *current_thread; /* Info on currently selected thread */
-static DWORD main_thread_id; /* Thread ID of the main thread */
+static DWORD main_thread_id; /* Thread ID of the main thread */
+static pid_t cygwin_pid; /* pid of cygwin process */
/* Counts of things. */
static int exception_count = 0;
@@ -139,9 +140,6 @@ static int debug_memory = 0; /* show target memory accesses */
static int debug_exceptions = 0; /* show target exceptions */
static int useshell = 0; /* use shell for subprocesses */
-/* Path to shell */
-static char shell[MAX_PATH + 1];
-
/* This vector maps GDB's idea of a register's number into an address
in the win32 exception context vector.
@@ -1461,6 +1459,8 @@ child_create_inferior (char *exec_file, char *allargs, char **env)
char *args;
char real_path[MAXPATHLEN];
char *toexec;
+ char shell[MAX_PATH + 1]; /* Path to shell */
+ const char *sh;
if (!exec_file)
error ("No executable specified, use `target exec'.\n");
@@ -1468,7 +1468,7 @@ child_create_inferior (char *exec_file, char *allargs, char **env)
memset (&si, 0, sizeof (si));
si.cb = sizeof (si);
- if (!useshell || !shell[0])
+ if (!useshell)
{
flags = DEBUG_ONLY_THIS_PROCESS;
cygwin_conv_to_win32_path (exec_file, real_path);
@@ -1476,8 +1476,13 @@ child_create_inferior (char *exec_file, char *allargs, char **env)
}
else
{
- char *newallargs = alloca (sizeof (" -c 'exec '") + strlen (exec_file)
- + strlen (allargs) + 2);
+ char *newallargs;
+ sh = getenv ("SHELL");
+ if (!sh)
+ sh = "/bin/sh";
+ cygwin_conv_to_win32_path (sh, shell);
+ newallargs = alloca (sizeof (" -c 'exec '") + strlen (exec_file)
+ + strlen (allargs) + 2);
sprintf (newallargs, " -c 'exec %s %s'", exec_file, allargs);
allargs = newallargs;
toexec = shell;
@@ -1497,7 +1502,7 @@ child_create_inferior (char *exec_file, char *allargs, char **env)
/* Prepare the environment vars for CreateProcess. */
{
- /* This code use to assume all env vars were file names and would
+ /* This code used to assume all env vars were file names and would
translate them all to win32 style. That obviously doesn't work in the
general case. The current rule is that we only translate PATH.
We need to handle PATH because we're about to call CreateProcess and
@@ -1813,27 +1818,12 @@ void
_initialize_inftarg (void)
{
struct cmd_list_element *c;
- const char *sh;
init_child_ops ();
c = add_com ("dll-symbols", class_files, dll_symbol_command,
"Load dll library symbols from FILE.");
- c->completer = filename_completer;
-
- sh = getenv ("SHELL");
- if (!sh)
- sh = "/bin/sh";
- if (access (sh, X_OK) != 0)
- {
- shell[0] = '\0';
- useshell = 0;
- }
- else
- {
- cygwin_conv_to_win32_path (sh, shell);
- useshell = 1;
- }
+ set_cmd_completer (c, filename_completer);
add_com_alias ("sharedlibrary", "dll-symbols", class_alias, 1);
diff --git a/gdb/x86-64-linux-nat.c b/gdb/x86-64-linux-nat.c
index 3fb24dd..fd9246c 100644
--- a/gdb/x86-64-linux-nat.c
+++ b/gdb/x86-64-linux-nat.c
@@ -33,6 +33,19 @@
#include <sys/debugreg.h>
#include <sys/syscall.h>
#include <sys/procfs.h>
+#include <sys/reg.h>
+
+/* Mapping between the general-purpose registers in `struct user'
+ format and GDB's register array layout. */
+
+static int x86_64_regmap[] = {
+ RAX, RBX, RCX, RDX,
+ RSI, RDI, RBP, RSP,
+ R8, R9, R10, R11,
+ R12, R13, R14, R15,
+ RIP, EFLAGS,
+ DS, ES, FS, GS
+};
static unsigned long
x86_64_linux_dr_get (int regnum)
@@ -74,8 +87,7 @@ x86_64_linux_dr_set (int regnum, unsigned long value)
tid = PIDGET (inferior_ptid);
errno = 0;
- ptrace (PT_WRITE_U, tid,
- offsetof (struct user, u_debugreg[regnum]), value);
+ ptrace (PT_WRITE_U, tid, offsetof (struct user, u_debugreg[regnum]), value);
if (errno != 0)
perror_with_name ("Couldn't write debug register");
}
@@ -113,11 +125,9 @@ x86_64_linux_dr_get_status (void)
the register sets used by `ptrace'. */
#define GETREGS_SUPPLIES(regno) \
- (0 <= (regno) && (regno) <= 17)
+ (0 <= (regno) && (regno) < x86_64_num_gregs)
#define GETFPREGS_SUPPLIES(regno) \
(FP0_REGNUM <= (regno) && (regno) <= MXCSR_REGNUM)
-
-#define PTRACE_XFER_TYPE unsigned long
/* Transfering the general-purpose registers between GDB, inferiors
@@ -132,7 +142,7 @@ supply_gregset (elf_gregset_t * gregsetp)
elf_greg_t *regp = (elf_greg_t *) gregsetp;
int i;
- for (i = 0; i < X86_64_NUM_GREGS; i++)
+ for (i = 0; i < x86_64_num_gregs; i++)
supply_register (i, (char *) (regp + x86_64_regmap[i]));
}
@@ -146,9 +156,9 @@ fill_gregset (elf_gregset_t * gregsetp, int regno)
elf_greg_t *regp = (elf_greg_t *) gregsetp;
int i;
- for (i = 0; i < X86_64_NUM_GREGS; i++)
+ for (i = 0; i < x86_64_num_gregs; i++)
if ((regno == -1 || regno == i))
- read_register_gen (i, regp + x86_64_regmap[i]);
+ read_register_gen (i, (char *) (regp + x86_64_regmap[i]));
}
/* Fetch all general-purpose registers from process/thread TID and
@@ -160,7 +170,7 @@ fetch_regs (int tid)
elf_gregset_t regs;
if (ptrace (PTRACE_GETREGS, tid, 0, (long) &regs) < 0)
- perror_with_name ("Couldn't get registers");
+ perror_with_name ("Couldn't get registers");
supply_gregset (&regs);
}
@@ -332,163 +342,7 @@ static const unsigned char linux_syscall[] = { 0x0f, 0x05 };
/* Offset to saved processor registers from <asm/ucontext.h> */
#define LINUX_UCONTEXT_SIGCONTEXT_OFFSET (36)
-/* Resume execution of the inferior process.
- If STEP is nonzero, single-step it.
- If SIGNAL is nonzero, give it that signal. */
-
-void
-child_resume (ptid_t ptid, int step, enum target_signal signal)
-{
- int pid = PIDGET (ptid);
- int request = PTRACE_CONT;
-
- if (pid == -1)
- /* Resume all threads. */
- /* I think this only gets used in the non-threaded case, where "resume
- all threads" and "resume inferior_ptid" are the same. */
- pid = PIDGET (inferior_ptid);
-
- if (step)
- {
- CORE_ADDR pc = read_pc_pid (pid_to_ptid (pid));
- unsigned char buf[LINUX_SYSCALL_LEN];
-
- request = PTRACE_SINGLESTEP;
-
- /* Returning from a signal trampoline is done by calling a
- special system call (sigreturn or rt_sigreturn, see
- i386-linux-tdep.c for more information). This system call
- restores the registers that were saved when the signal was
- raised, including %eflags. That means that single-stepping
- won't work. Instead, we'll have to modify the signal context
- that's about to be restored, and set the trace flag there. */
-
- /* First check if PC is at a system call. */
- if (read_memory_nobpt (pc, (char *) buf, LINUX_SYSCALL_LEN) == 0
- && memcmp (buf, linux_syscall, LINUX_SYSCALL_LEN) == 0)
- {
- int syscall =
- read_register_pid (LINUX_SYSCALL_REGNUM, pid_to_ptid (pid));
-
- /* Then check the system call number. */
- if (syscall == SYS_rt_sigreturn)
- {
- CORE_ADDR sp = read_register (SP_REGNUM);
- CORE_ADDR addr = sp;
- unsigned long int eflags;
-
- addr +=
- sizeof (struct siginfo) + LINUX_UCONTEXT_SIGCONTEXT_OFFSET;
-
- /* Set the trace flag in the context that's about to be
- restored. */
- addr += LINUX_SIGCONTEXT_EFLAGS_OFFSET;
- read_memory (addr, (char *) &eflags, 8);
- eflags |= 0x0100;
- write_memory (addr, (char *) &eflags, 8);
- }
- }
- }
-
- if (ptrace (request, pid, 0, target_signal_to_host (signal)) == -1)
- perror_with_name ("ptrace");
-}
-
-
-/* Copy LEN bytes to or from inferior's memory starting at MEMADDR
- to debugger memory starting at MYADDR. Copy to inferior if
- WRITE is nonzero. TARGET is ignored.
-
- Returns the length copied, which is either the LEN argument or zero.
- This xfer function does not do partial moves, since child_ops
- doesn't allow memory operations to cross below us in the target stack
- anyway. */
-
-int
-child_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
- struct mem_attrib *attrib, struct target_ops *target)
-{
- register int i;
- /* Round starting address down to longword boundary. */
- register CORE_ADDR addr = memaddr & -sizeof (PTRACE_XFER_TYPE);
- /* Round ending address up; get number of longwords that makes. */
- register int count
- = (((memaddr + len) - addr) + sizeof (PTRACE_XFER_TYPE) - 1)
- / sizeof (PTRACE_XFER_TYPE);
- /* Allocate buffer of that many longwords. */
- /* FIXME (alloca): This code, cloned from infptrace.c, is unsafe
- because it uses alloca to allocate a buffer of arbitrary size.
- For very large xfers, this could crash GDB's stack. */
- register PTRACE_XFER_TYPE *buffer
- = (PTRACE_XFER_TYPE *) alloca (count * sizeof (PTRACE_XFER_TYPE));
-
- if (write)
- {
- /* Fill start and end extra bytes of buffer with existing memory data. */
- if (addr != memaddr || len < (int) sizeof (PTRACE_XFER_TYPE))
- {
- /* Need part of initial word -- fetch it. */
- ptrace (PT_READ_I, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) addr, buffer);
- }
-
- if (count > 1) /* FIXME, avoid if even boundary */
- {
- ptrace (PT_READ_I, PIDGET (inferior_ptid),
- ((PTRACE_ARG3_TYPE)
- (addr + (count - 1) * sizeof (PTRACE_XFER_TYPE))),
- buffer + count - 1);
- }
-
- /* Copy data to be written over corresponding part of buffer */
-
- memcpy ((char *) buffer + (memaddr & (sizeof (PTRACE_XFER_TYPE) - 1)),
- myaddr, len);
-
- /* Write the entire buffer. */
-
- for (i = 0; i < count; i++, addr += sizeof (PTRACE_XFER_TYPE))
- {
- errno = 0;
- ptrace (PT_WRITE_D, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) addr, buffer[i]);
- if (errno)
- {
- /* Using the appropriate one (I or D) is necessary for
- Gould NP1, at least. */
- errno = 0;
- ptrace (PT_WRITE_I, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) addr, buffer[i]);
- }
- if (errno)
- return 0;
- }
-#ifdef CLEAR_INSN_CACHE
- CLEAR_INSN_CACHE ();
-#endif
- }
- else
- {
- /* Read all the longwords */
- for (i = 0; i < count; i++, addr += sizeof (PTRACE_XFER_TYPE))
- {
- errno = 0;
- ptrace (PT_READ_I, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) addr, buffer + i);
- if (errno)
- return 0;
- }
-
- /* Copy appropriate bytes out of the buffer. */
- memcpy (myaddr,
- (char *) buffer + (memaddr & (sizeof (PTRACE_XFER_TYPE) - 1)),
- len);
- }
- return len;
-}
-
/* Interpreting register set info found in core files. */
-
/* Provide registers to GDB from a core file.
CORE_REG_SECT points to an array of bytes, which are the contents
@@ -567,12 +421,12 @@ x86_64_register_u_addr (CORE_ADDR blockend, int regnum)
CORE_ADDR fpstate;
CORE_ADDR ubase;
ubase = blockend;
- if (IS_FP_REGNUM(regnum))
+ if (IS_FP_REGNUM (regnum))
{
fpstate = ubase + ((char *) &u.i387.st_space - (char *) &u);
return (fpstate + 16 * (regnum - FP0_REGNUM));
}
- else if (IS_SSE_REGNUM(regnum))
+ else if (IS_SSE_REGNUM (regnum))
{
fpstate = ubase + ((char *) &u.i387.xmm_space - (char *) &u);
return (fpstate + 16 * (regnum - XMM0_REGNUM));
@@ -586,3 +440,9 @@ _initialize_x86_64_linux_nat (void)
{
add_core_fns (&linux_elf_core_fns);
}
+
+int
+kernel_u_size (void)
+{
+ return (sizeof (struct user));
+}
diff --git a/gdb/x86-64-tdep.c b/gdb/x86-64-tdep.c
index c13dd34..50b0227 100644
--- a/gdb/x86-64-tdep.c
+++ b/gdb/x86-64-tdep.c
@@ -32,44 +32,132 @@
#include "dwarf2cfi.h"
#include "gdb_assert.h"
-
/* Register numbers of various important registers. */
#define RAX_REGNUM 0
-#define RDX_REGNUM 1
+#define RDX_REGNUM 3
#define RDI_REGNUM 5
#define EFLAGS_REGNUM 17
-#define XMM1_REGNUM 35
+#define ST0_REGNUM 22
+#define XMM1_REGNUM 39
+
+struct register_info
+{
+ int size;
+ char *name;
+ struct type **type;
+};
/* x86_64_register_raw_size_table[i] is the number of bytes of storage in
GDB's register array occupied by register i. */
-int x86_64_register_raw_size_table[X86_64_NUM_REGS] = {
- 8, 8, 8, 8,
- 8, 8, 8, 8,
- 8, 8, 8, 8,
- 8, 8, 8, 8,
- 8, 4,
- 10, 10, 10, 10,
- 10, 10, 10, 10,
- 4, 4, 4, 4,
- 4, 4, 4, 4,
- 16, 16, 16, 16,
- 16, 16, 16, 16,
- 16, 16, 16, 16,
- 16, 16, 16, 16,
- 4
+static struct register_info x86_64_register_info_table[] = {
+ /* 0 */ {8, "rax", &builtin_type_int64},
+ /* 1 */ {8, "rbx", &builtin_type_int64},
+ /* 2 */ {8, "rcx", &builtin_type_int64},
+ /* 3 */ {8, "rdx", &builtin_type_int64},
+ /* 4 */ {8, "rsi", &builtin_type_int64},
+ /* 5 */ {8, "rdi", &builtin_type_int64},
+ /* 6 */ {8, "rbp", &builtin_type_void_func_ptr},
+ /* 7 */ {8, "rsp", &builtin_type_void_func_ptr},
+ /* 8 */ {8, "r8", &builtin_type_int64},
+ /* 9 */ {8, "r9", &builtin_type_int64},
+ /* 10 */ {8, "r10", &builtin_type_int64},
+ /* 11 */ {8, "r11", &builtin_type_int64},
+ /* 12 */ {8, "r12", &builtin_type_int64},
+ /* 13 */ {8, "r13", &builtin_type_int64},
+ /* 14 */ {8, "r14", &builtin_type_int64},
+ /* 15 */ {8, "r15", &builtin_type_int64},
+ /* 16 */ {8, "rip", &builtin_type_void_func_ptr},
+ /* 17 */ {4, "eflags", &builtin_type_int32},
+ /* 18 */ {4, "ds", &builtin_type_int32},
+ /* 19 */ {4, "es", &builtin_type_int32},
+ /* 20 */ {4, "fs", &builtin_type_int32},
+ /* 21 */ {4, "gs", &builtin_type_int32},
+ /* 22 */ {10, "st0", &builtin_type_i387_ext},
+ /* 23 */ {10, "st1", &builtin_type_i387_ext},
+ /* 24 */ {10, "st2", &builtin_type_i387_ext},
+ /* 25 */ {10, "st3", &builtin_type_i387_ext},
+ /* 26 */ {10, "st4", &builtin_type_i387_ext},
+ /* 27 */ {10, "st5", &builtin_type_i387_ext},
+ /* 28 */ {10, "st6", &builtin_type_i387_ext},
+ /* 29 */ {10, "st7", &builtin_type_i387_ext},
+ /* 30 */ {4, "fctrl", &builtin_type_int32},
+ /* 31 */ {4, "fstat", &builtin_type_int32},
+ /* 32 */ {4, "ftag", &builtin_type_int32},
+ /* 33 */ {4, "fiseg", &builtin_type_int32},
+ /* 34 */ {4, "fioff", &builtin_type_int32},
+ /* 35 */ {4, "foseg", &builtin_type_int32},
+ /* 36 */ {4, "fooff", &builtin_type_int32},
+ /* 37 */ {4, "fop", &builtin_type_int32},
+ /* 38 */ {16, "xmm0", &builtin_type_v4sf},
+ /* 39 */ {16, "xmm1", &builtin_type_v4sf},
+ /* 40 */ {16, "xmm2", &builtin_type_v4sf},
+ /* 41 */ {16, "xmm3", &builtin_type_v4sf},
+ /* 42 */ {16, "xmm4", &builtin_type_v4sf},
+ /* 43 */ {16, "xmm5", &builtin_type_v4sf},
+ /* 44 */ {16, "xmm6", &builtin_type_v4sf},
+ /* 45 */ {16, "xmm7", &builtin_type_v4sf},
+ /* 46 */ {16, "xmm8", &builtin_type_v4sf},
+ /* 47 */ {16, "xmm9", &builtin_type_v4sf},
+ /* 48 */ {16, "xmm10", &builtin_type_v4sf},
+ /* 49 */ {16, "xmm11", &builtin_type_v4sf},
+ /* 50 */ {16, "xmm12", &builtin_type_v4sf},
+ /* 51 */ {16, "xmm13", &builtin_type_v4sf},
+ /* 52 */ {16, "xmm14", &builtin_type_v4sf},
+ /* 53 */ {16, "xmm15", &builtin_type_v4sf},
+ /* 54 */ {4, "mxcsr", &builtin_type_int32}
};
+/* This array is a mapping from Dwarf-2 register
+ numbering to GDB's one. Dwarf-2 numbering is
+ defined in x86-64 ABI, section 3.6. */
+static int x86_64_dwarf2gdb_regno_map[] = {
+ 0, 1, 2, 3, /* RAX - RDX */
+ 4, 5, 6, 7, /* RSI, RDI, RBP, RSP */
+ 8, 9, 10, 11, /* R8 - R11 */
+ 12, 13, 14, 15, /* R12 - R15 */
+ -1, /* RA - not mapped */
+ XMM1_REGNUM - 1, XMM1_REGNUM, /* XMM0 ... */
+ XMM1_REGNUM + 1, XMM1_REGNUM + 2,
+ XMM1_REGNUM + 3, XMM1_REGNUM + 4,
+ XMM1_REGNUM + 5, XMM1_REGNUM + 6,
+ XMM1_REGNUM + 7, XMM1_REGNUM + 8,
+ XMM1_REGNUM + 9, XMM1_REGNUM + 10,
+ XMM1_REGNUM + 11, XMM1_REGNUM + 12,
+ XMM1_REGNUM + 13, XMM1_REGNUM + 14, /* ... XMM15 */
+ ST0_REGNUM + 0, ST0_REGNUM + 1, /* ST0 ... */
+ ST0_REGNUM + 2, ST0_REGNUM + 3,
+ ST0_REGNUM + 4, ST0_REGNUM + 5,
+ ST0_REGNUM + 6, ST0_REGNUM + 7 /* ... ST7 */
+};
+
+static int x86_64_dwarf2gdb_regno_map_length =
+ sizeof (x86_64_dwarf2gdb_regno_map) /
+ sizeof (x86_64_dwarf2gdb_regno_map[0]);
+
+/* Number of all registers */
+#define X86_64_NUM_REGS (sizeof (x86_64_register_info_table) / \
+ sizeof (x86_64_register_info_table[0]))
+
+/* Number of general registers. */
+#define X86_64_NUM_GREGS (22)
+
+int x86_64_num_regs = X86_64_NUM_REGS;
+int x86_64_num_gregs = X86_64_NUM_GREGS;
+
+/* Did we already print a note about frame pointer? */
+int omit_fp_note_printed = 0;
+
/* Number of bytes of storage in the actual machine representation for
register REGNO. */
int
x86_64_register_raw_size (int regno)
{
- return x86_64_register_raw_size_table[regno];
+ return x86_64_register_info_table[regno].size;
}
/* x86_64_register_byte_table[i] is the offset into the register file of the
start of register number i. We initialize this from
- x86_64_register_raw_size_table. */
+ x86_64_register_info_table. */
int x86_64_register_byte_table[X86_64_NUM_REGS];
/* Index within `registers' of the first byte of the space for register REGNO. */
@@ -84,16 +172,7 @@ x86_64_register_byte (int regno)
static struct type *
x86_64_register_virtual_type (int regno)
{
- if (regno == PC_REGNUM || regno == SP_REGNUM)
- return builtin_type_void_func_ptr;
- if (IS_FP_REGNUM (regno))
- return builtin_type_i387_ext;
- if (IS_SSE_REGNUM (regno))
- return builtin_type_v4sf;
- if (IS_FPU_CTRL_REGNUM (regno) || regno == MXCSR_REGNUM
- || regno == EFLAGS_REGNUM)
- return builtin_type_int32;
- return builtin_type_int64;
+ return *x86_64_register_info_table[regno].type;
}
/* x86_64_register_convertible is true if register N's virtual format is
@@ -147,6 +226,19 @@ x86_64_register_convert_to_raw (struct type *type, int regnum,
memcpy (to, from, FPU_REG_RAW_SIZE);
}
+/* Dwarf-2 <-> GDB register numbers mapping. */
+int
+x86_64_dwarf2_reg_to_regnum (int dw_reg)
+{
+ if (dw_reg < 0 || dw_reg > x86_64_dwarf2gdb_regno_map_length)
+ {
+ warning ("Dwarf-2 uses unmapped register #%d\n", dw_reg);
+ return dw_reg;
+ }
+
+ return x86_64_dwarf2gdb_regno_map[dw_reg];
+}
+
/* This is the variable that is set with "set disassembly-flavour", and
its legitimate values. */
static const char att_flavour[] = "att";
@@ -556,20 +648,20 @@ x86_64_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
int ssereg = 0;
int i;
static int int_parameter_registers[INT_REGS] = {
- 5 /*RDI*/, 4 /*RSI*/,
- 1 /*RDX*/, 2 /*RCX*/,
- 8 /*R8 */ , 9 /*R9 */
+ 5 /* RDI */ , 4 /* RSI */ ,
+ 3 /* RDX */ , 2 /* RCX */ ,
+ 8 /* R8 */ , 9 /* R9 */
};
/* XMM0 - XMM15 */
static int sse_parameter_registers[SSE_REGS] = {
- 34, 35, 36, 37,
- 38, 39, 40, 41,
- 42, 43, 44, 45,
- 46, 47, 48, 49
+ XMM1_REGNUM - 1, XMM1_REGNUM, XMM1_REGNUM + 1, XMM1_REGNUM + 2,
+ XMM1_REGNUM + 3, XMM1_REGNUM + 4, XMM1_REGNUM + 5, XMM1_REGNUM + 6,
+ XMM1_REGNUM + 7, XMM1_REGNUM + 8, XMM1_REGNUM + 9, XMM1_REGNUM + 10,
+ XMM1_REGNUM + 11, XMM1_REGNUM + 12, XMM1_REGNUM + 13, XMM1_REGNUM + 14
};
int stack_values_count = 0;
int *stack_values;
- stack_values = alloca (naregs * sizeof (int));
+ stack_values = alloca (nargs * sizeof (int));
for (i = 0; i < nargs; i++)
{
enum x86_64_reg_class class[MAX_CLASSES];
@@ -639,7 +731,7 @@ x86_64_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
}
while (--stack_values_count >= 0)
{
- value_ptr arg = args[stack_values[stack_values_count]];
+ struct value *arg = args[stack_values[stack_values_count]];
int len = TYPE_LENGTH (VALUE_ENCLOSING_TYPE (arg));
len += 7;
len -= len % 8;
@@ -704,27 +796,9 @@ x86_64_store_return_value (struct type *type, char *valbuf)
static char *
x86_64_register_name (int reg_nr)
{
- static char *register_names[] = {
- "rax", "rdx", "rcx", "rbx",
- "rsi", "rdi", "rbp", "rsp",
- "r8", "r9", "r10", "r11",
- "r12", "r13", "r14", "r15",
- "rip", "eflags",
- "st0", "st1", "st2", "st3",
- "st4", "st5", "st6", "st7",
- "fctrl", "fstat", "ftag", "fiseg",
- "fioff", "foseg", "fooff", "fop",
- "xmm0", "xmm1", "xmm2", "xmm3",
- "xmm4", "xmm5", "xmm6", "xmm7",
- "xmm8", "xmm9", "xmm10", "xmm11",
- "xmm12", "xmm13", "xmm14", "xmm15",
- "mxcsr"
- };
- if (reg_nr < 0)
- return NULL;
- if (reg_nr >= (sizeof (register_names) / sizeof (*register_names)))
+ if (reg_nr < 0 || reg_nr >= X86_64_NUM_REGS)
return NULL;
- return register_names[reg_nr];
+ return x86_64_register_info_table[reg_nr].name;
}
@@ -759,16 +833,75 @@ x86_64_frameless_function_invocation (struct frame_info *frame)
return 0;
}
-/* On x86_64 there are no reasonable prologs. */
+/* If a function with debugging information and known beginning
+ is detected, we will return pc of the next line in the source
+ code. With this approach we effectively skip the prolog. */
+
+#define PROLOG_BUFSIZE 4
CORE_ADDR
x86_64_skip_prologue (CORE_ADDR pc)
{
+ int i, firstline, currline;
+ struct symtab_and_line v_sal;
+ struct symbol *v_function;
+ CORE_ADDR salendaddr = 0, endaddr = 0;
+
+ /* We will handle only functions beginning with:
+ 55 pushq %rbp
+ 48 89 e5 movq %rsp,%rbp
+ */
+ unsigned char prolog_expect[PROLOG_BUFSIZE] = { 0x55, 0x48, 0x89, 0xe5 },
+ prolog_buf[PROLOG_BUFSIZE];
+
+ read_memory (pc, (char *) prolog_buf, PROLOG_BUFSIZE);
+
+ /* First check, whether pc points to pushq %rbp. If not,
+ * print a recommendation to enable frame pointer. */
+ if (prolog_expect[0] != prolog_buf[0])
+ {
+ if (!omit_fp_note_printed)
+ {
+ printf_filtered
+ ("NOTE: This function doesn't seem to have a valid prologue.\n"
+ " Consider adding -fno-omit-frame-pointer to your gcc's CFLAGS.\n");
+ omit_fp_note_printed++;
+ }
+ return pc;
+ }
+ /* Valid prolog continues with movq %rsp,%rbp. */
+ for (i = 1; i < PROLOG_BUFSIZE; i++)
+ if (prolog_expect[i] != prolog_buf[i])
+ return pc + 1; /* First instruction after pushq %rbp. */
+
+ v_function = find_pc_function (pc);
+ v_sal = find_pc_line (pc, 0);
+
+ /* If pc doesn't point to a function with debuginfo,
+ some of the following may be NULL. */
+ if (!v_function || !v_function->ginfo.value.block || !v_sal.symtab)
+ return pc;
+
+ firstline = v_sal.line;
+ currline = firstline;
+ salendaddr = v_sal.end;
+ endaddr = v_function->ginfo.value.block->endaddr;
+
+ for (i = 0; i < v_sal.symtab->linetable->nitems; i++)
+ if (v_sal.symtab->linetable->item[i].line > firstline
+ && v_sal.symtab->linetable->item[i].pc >= salendaddr
+ && v_sal.symtab->linetable->item[i].pc < endaddr)
+ {
+ pc = v_sal.symtab->linetable->item[i].pc;
+ currline = v_sal.symtab->linetable->item[i].line;
+ break;
+ }
+
return pc;
}
/* Sequence of bytes for breakpoint instruction. */
static unsigned char *
-x86_64_breakpoint_from_pc (CORE_ADDR *pc, int *lenptr)
+x86_64_breakpoint_from_pc (CORE_ADDR * pc, int *lenptr)
{
static unsigned char breakpoint[] = { 0xcc };
*lenptr = 1;
@@ -776,10 +909,11 @@ x86_64_breakpoint_from_pc (CORE_ADDR *pc, int *lenptr)
}
static struct gdbarch *
-i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
+x86_64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
{
struct gdbarch *gdbarch;
struct gdbarch_tdep *tdep;
+ int i, sum;
/* Find a candidate among the list of pre-declared architectures. */
for (arches = gdbarch_list_lookup_by_info (arches, &info);
@@ -801,7 +935,7 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
break;
default:
internal_error (__FILE__, __LINE__,
- "i386_gdbarch_init: unknown machine type");
+ "x86_64_gdbarch_init: unknown machine type");
}
break;
case bfd_mach_i386_i386:
@@ -818,12 +952,12 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
return arches->gdbarch;
default:
internal_error (__FILE__, __LINE__,
- "i386_gdbarch_init: unknown machine type");
+ "x86_64_gdbarch_init: unknown machine type");
}
break;
default:
internal_error (__FILE__, __LINE__,
- "i386_gdbarch_init: unknown machine type");
+ "x86_64_gdbarch_init: unknown machine type");
}
}
@@ -843,7 +977,7 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
break;
default:
internal_error (__FILE__, __LINE__,
- "i386_gdbarch_init: unknown machine type");
+ "x86_64_gdbarch_init: unknown machine type");
}
set_gdbarch_long_bit (gdbarch, 64);
@@ -858,10 +992,12 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_register_raw_size (gdbarch, x86_64_register_raw_size);
set_gdbarch_max_register_raw_size (gdbarch, 16);
set_gdbarch_register_byte (gdbarch, x86_64_register_byte);
+
/* Total amount of space needed to store our copies of the machine's register
(SIZEOF_GREGS + SIZEOF_FPU_REGS + SIZEOF_FPU_CTRL_REGS + SIZEOF_SSE_REGS) */
- set_gdbarch_register_bytes (gdbarch,
- (18 * 8) + (8 * 10) + (8 * 4) + (16 * 16 + 4));
+ for (i = 0, sum = 0; i < X86_64_NUM_REGS; i++)
+ sum += x86_64_register_info_table[i].size;
+ set_gdbarch_register_bytes (gdbarch, sum);
set_gdbarch_register_virtual_size (gdbarch, generic_register_virtual_size);
set_gdbarch_max_register_virtual_size (gdbarch, 16);
@@ -878,10 +1014,9 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_fp_regnum (gdbarch, 6); /* (rbp) */
set_gdbarch_pc_regnum (gdbarch, 16); /* (rip) Contains program counter. */
- set_gdbarch_fp0_regnum (gdbarch, 18); /* First FPU floating-point register. */
+ set_gdbarch_fp0_regnum (gdbarch, X86_64_NUM_GREGS); /* First FPU floating-point register. */
set_gdbarch_read_fp (gdbarch, cfi_read_fp);
- set_gdbarch_write_fp (gdbarch, cfi_write_fp);
/* Discard from the stack the innermost frame, restoring all registers. */
set_gdbarch_pop_frame (gdbarch, x86_64_pop_frame);
@@ -970,7 +1105,9 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
- set_gdbarch_breakpoint_from_pc (gdbarch, x86_64_breakpoint_from_pc);
+ set_gdbarch_breakpoint_from_pc (gdbarch,
+ (gdbarch_breakpoint_from_pc_ftype *)
+ x86_64_breakpoint_from_pc);
/* Amount PC must be decremented by after a breakpoint. This is often the
@@ -979,13 +1116,15 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* Use dwarf2 debug frame informations. */
set_gdbarch_dwarf2_build_frame_info (gdbarch, dwarf2_build_frame_info);
+ set_gdbarch_dwarf2_reg_to_regnum (gdbarch, x86_64_dwarf2_reg_to_regnum);
+
return gdbarch;
}
void
_initialize_x86_64_tdep (void)
{
- register_gdbarch_init (bfd_arch_i386, i386_gdbarch_init);
+ register_gdbarch_init (bfd_arch_i386, x86_64_gdbarch_init);
/* Initialize the table saying where each register starts in the
register file. */
@@ -996,7 +1135,7 @@ _initialize_x86_64_tdep (void)
for (i = 0; i < X86_64_NUM_REGS; i++)
{
x86_64_register_byte_table[i] = offset;
- offset += x86_64_register_raw_size_table[i];
+ offset += x86_64_register_info_table[i].size;
}
}
diff --git a/gdb/x86-64-tdep.h b/gdb/x86-64-tdep.h
index d04da8b..d15b8e7 100644
--- a/gdb/x86-64-tdep.h
+++ b/gdb/x86-64-tdep.h
@@ -24,24 +24,9 @@
#define X86_64_TDEP_H
#include "i386-tdep.h"
-#include <sys/reg.h>
-/* Mapping between the general-purpose registers in `struct user'
- format and GDB's register array layout. */
-
-static int x86_64_regmap[] = {
- RAX, RDX, RCX, RBX,
- RSI, RDI, RBP, RSP,
- R8, R9, R10, R11,
- R12, R13, R14, R15,
- RIP, EFLAGS
-};
-
-/* Number of all registers */
-#define X86_64_NUM_REGS (51)
-
-/* Number of general registers. */
-#define X86_64_NUM_GREGS (18)
+extern int x86_64_num_regs;
+extern int x86_64_num_gregs;
gdbarch_frame_saved_pc_ftype x86_64_linux_frame_saved_pc;
gdbarch_saved_pc_after_call_ftype x86_64_linux_saved_pc_after_call;
diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
index 965473a..d878111 100644
--- a/gdb/xcoffread.c
+++ b/gdb/xcoffread.c
@@ -38,6 +38,8 @@
#include "coff/internal.h"
#include "libcoff.h" /* FIXME, internal data from BFD */
+#include "coff/xcoff.h"
+#include "libxcoff.h"
#include "coff/rs6000.h"
#include "symtab.h"
@@ -908,7 +910,7 @@ read_xcoff_symtab (struct partial_symtab *pst)
char *strtbl = ((struct coff_symfile_info *) objfile->sym_private)->strtbl;
char *debugsec =
((struct coff_symfile_info *) objfile->sym_private)->debugsec;
- char *debugfmt = xcoff_data (abfd)->xcoff64 ? "XCOFF64" : "XCOFF";
+ char *debugfmt = bfd_xcoff_is_xcoff64 (abfd) ? "XCOFF64" : "XCOFF";
struct internal_syment symbol[1];
union internal_auxent main_aux;
@@ -1632,7 +1634,7 @@ static int
read_symbol_lineno (int symno)
{
struct objfile *objfile = this_symtab_psymtab->objfile;
- boolean xcoff64 = xcoff_data (objfile->obfd)->xcoff64;
+ boolean xcoff64 = bfd_xcoff_is_xcoff64 (objfile->obfd);
struct coff_symfile_info *info =
(struct coff_symfile_info *)objfile->sym_private;
diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c
index 918a19e..f8c20b7 100644
--- a/gdb/xstormy16-tdep.c
+++ b/gdb/xstormy16-tdep.c
@@ -1,5 +1,6 @@
/* Target-dependent code for the Sanyo Xstormy16a (LC590000) processor.
- Copyright 2001, Free Software Foundation, Inc.
+
+ Copyright 2001, 2002 Free Software Foundation, Inc.
This file is part of GDB.
@@ -857,7 +858,7 @@ xstormy16_saved_pc_after_call (struct frame_info *ignore)
return pc;
}
-static unsigned char *
+const static unsigned char *
xstormy16_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
{
static unsigned char breakpoint[] = { 0x06, 0x0 };
diff --git a/gdb/z8k-tdep.c b/gdb/z8k-tdep.c
index 622cbc0..572a878 100644
--- a/gdb/z8k-tdep.c
+++ b/gdb/z8k-tdep.c
@@ -1,6 +1,7 @@
/* Target-machine dependent code for Zilog Z8000, for GDB.
- Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
- Free Software Foundation, Inc.
+
+ Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+ 2002 Free Software Foundation, Inc.
This file is part of GDB.
@@ -159,10 +160,6 @@ read_memory_pointer (CORE_ADDR x)
CORE_ADDR
z8k_frame_chain (struct frame_info *thisframe)
{
- if (thisframe->prev == 0)
- {
- /* This is the top of the stack, let's get the sp for real */
- }
if (!inside_entry_file (thisframe->pc))
{
return read_memory_pointer (thisframe->frame);
@@ -330,8 +327,8 @@ z8k_print_register_hook (int regno)
{
unsigned short l[2];
- read_relative_register_raw_bytes (regno, (char *) (l + 0));
- read_relative_register_raw_bytes (regno + 1, (char *) (l + 1));
+ frame_register_read (selected_frame, regno, (char *) (l + 0));
+ frame_register_read (selected_frame, regno + 1, (char *) (l + 1));
printf_unfiltered ("\t");
printf_unfiltered ("%04x%04x", l[0], l[1]);
}
@@ -340,10 +337,10 @@ z8k_print_register_hook (int regno)
{
unsigned short l[4];
- read_relative_register_raw_bytes (regno, (char *) (l + 0));
- read_relative_register_raw_bytes (regno + 1, (char *) (l + 1));
- read_relative_register_raw_bytes (regno + 2, (char *) (l + 2));
- read_relative_register_raw_bytes (regno + 3, (char *) (l + 3));
+ frame_register_read (selected_frame, regno, (char *) (l + 0));
+ frame_register_read (selected_frame, regno + 1, (char *) (l + 1));
+ frame_register_read (selected_frame, regno + 2, (char *) (l + 2));
+ frame_register_read (selected_frame, regno + 3, (char *) (l + 3));
printf_unfiltered ("\t");
printf_unfiltered ("%04x%04x%04x%04x", l[0], l[1], l[2], l[3]);
@@ -353,7 +350,7 @@ z8k_print_register_hook (int regno)
unsigned short rval;
int i;
- read_relative_register_raw_bytes (regno, (char *) (&rval));
+ frame_register_read (selected_frame, regno, (char *) (&rval));
printf_unfiltered ("\n");
for (i = 0; i < 10; i += 2)