aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog250
-rw-r--r--gdb/Makefile.dist46
-rw-r--r--gdb/TAGS1586
-rw-r--r--gdb/a.out.gnu.h60
-rw-r--r--gdb/altos-dep.c8
-rw-r--r--gdb/blockframe.c46
-rw-r--r--gdb/breakpoint.c15
-rw-r--r--gdb/coffread.c20
-rwxr-xr-xgdb/config.gdb32
-rw-r--r--gdb/convex-dep.c13
-rw-r--r--gdb/core.c34
-rw-r--r--gdb/dbxread.c121
-rw-r--r--gdb/default-dep.c11
-rw-r--r--gdb/expprint.c2
-rw-r--r--gdb/expread.tab.c21
-rw-r--r--gdb/expread.y5
-rw-r--r--gdb/findvar.c23
-rw-r--r--gdb/gdb.texinfo17
-rw-r--r--gdb/gould-dep.c8
-rw-r--r--gdb/hp-include/sys/fcntl.h4
-rw-r--r--gdb/hp300bsd-dep.c77
-rw-r--r--gdb/hp9k320-dep.c41
-rw-r--r--gdb/i386-dep.c8
-rw-r--r--gdb/infcmd.c86
-rw-r--r--gdb/inflow.c7
-rw-r--r--gdb/infrun.c26
-rw-r--r--gdb/isi-dep.c8
-rw-r--r--gdb/m-convex.h24
-rw-r--r--gdb/m-hp300bsd.h13
-rw-r--r--gdb/m-hp9k320.h4
-rw-r--r--gdb/m-i386.h13
-rw-r--r--gdb/m-merlin.h8
-rw-r--r--gdb/m-pyr.h612
-rw-r--r--gdb/m-sparc.h35
-rw-r--r--gdb/m-sun3os4.h6
-rw-r--r--gdb/m68k-opcode.h67
-rw-r--r--gdb/m68k-pinsn.c68
-rw-r--r--gdb/main.c71
-rw-r--r--gdb/news-dep.c8
-rw-r--r--gdb/printcmd.c43
-rw-r--r--gdb/pyr-dep.c819
-rw-r--r--gdb/pyr-opcode.h287
-rw-r--r--gdb/pyr-pinsn.c346
-rw-r--r--gdb/readline/ChangeLog15
-rw-r--r--gdb/readline/Makefile4
-rw-r--r--gdb/readline/history.texinfo194
-rw-r--r--gdb/readline/readline.c3
-rw-r--r--gdb/readline/readline.texinfo425
-rw-r--r--gdb/remote.c2
-rw-r--r--gdb/source.c12
-rw-r--r--gdb/sparc-dep.c8
-rw-r--r--gdb/sun3-dep.c15
-rw-r--r--gdb/symmetry-dep.c8
-rw-r--r--gdb/symmisc.c2
-rw-r--r--gdb/symseg.h12
-rw-r--r--gdb/symtab.c12
-rw-r--r--gdb/umax-dep.c8
-rw-r--r--gdb/valops.c12
-rw-r--r--gdb/valprint.c61
-rw-r--r--gdb/version.c2
-rw-r--r--gdb/xgdb.c2
61 files changed, 4690 insertions, 1106 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d0bfbe1..1f2342b 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,6 +1,254 @@
+Thu Feb 8 01:11:55 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * GDB 3.5 released.
+
+ * version.c: Change version number to 3.5
+
+Tue Feb 6 15:58:06 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * m-hp9k320.h: define ATTACH_DETACH.
+ hp9k320-dep.c [ATTACH_DETACH]: New code.
+
+Thu Feb 1 17:43:00 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * valprint.c (is_nan, val_print): Use char * not void *.
+
+ * symmisc.c (print_symbol): Print newline after label.
+
+Tue Jan 30 15:35:52 1990 Jim Kingdon (kingdon at albert.ai.mit.edu)
+
+ * Makefile.dist (READLINE): Add {readline,history}.texinfo.
+
+ * m-merlin.h: Put in clarifying comments about SHELL_FILE.
+ config.gdb (merlin): Explain about /usr/local/lib/gdb-sh.
+
+Sat Jan 27 02:30:27 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * version.c: Change version number to 3.5alpha.1.
+
+ * dbxread.c (process_one_symbol): Compare context_stack_depth
+ with !VARIABLES_INSIDE_BLOCK, not VARIABLES_INSIDE_BLOCK.
+
+Fri Jan 26 01:21:51 1990 Jim Kingdon (kingdon at mole.ai.mit.edu)
+
+ * main.c [ALIGN_STACK_ON_STARTUP]: New code.
+ m-i386.h: Define ALIGN_STACK_ON_STARTUP.
+
+ * m-merlin.h (NO_SIGINTERRUPT, SHELL_FILE): Define.
+
+ * umax-dep.c (exec_file_command): Add commas to call to
+ read_section_hdr.
+
+Tue Jan 23 15:49:47 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * dbxread.c (define_symbol): Deal with deftype 'X'.
+
+ * convex-dep.c (wait): Make it pid_t.
+
+ * convex-dep.c (comm_registers_info): accept decimal comm register
+ specification, as "i comm 32768".
+
+ * dbxread.c (process_one_symbol): Make VARIABLES_INSIDE_BLOCK
+ macro say by itself where variables are. Pass it desc.
+ m-convex.h (VARIABLES_INSIDE_BLOCK): Nonzero for native compiler.
+
+ * m-convex.h (SET_STACK_LIMIT_HUGE): Define.
+ (IGNORE_SYMBOL): Take out #ifdef N_MONPT and put in 0xc4.
+
+Fri Jan 19 20:04:15 1990 Jim Kingdon (kingdon at albert.ai.mit.edu)
+
+ * printcmd.c (print_frame_args): Always set highest_offset to
+ current_offset when former is -1.
+
+ * dbxread.c (read_struct_type): Print nice error message
+ when encountering multiple inheritance.
+
+Thu Jan 18 13:43:30 1990 Jim Kingdon (kingdon at mole.ai.mit.edu)
+
+ * dbxread.c (read_dbx_symtab): Always treat N_FN as a potential
+ source for a x.o or -lx symbol, ignoring OFILE_FN_FLAGGED.
+
+ * printcmd.c (print_frame_args): Cast -1 to (CORE_ADDR).
+
+ * hp300bsd-dep.c (_initialize_hp300_dep): Get kernel_u_addr.
+ m-hp300bsd.h (KERNEL_U_ADDR): Use kernel_u_addr.
+
+ * infcmd.c (run_command): #if 0 out call to
+ breakpoint_clear_ignore_counts.
+
+Thu Jan 11 12:58:12 1990 Jim Kingdon (kingdon at mole)
+
+ * printcmd.c (print_frame_args) [STRUCT_ARG_SYM_GARBAGE]:
+ Try looking up name of var before giving up & printing '?'.
+
+Wed Jan 10 14:00:14 1990 Jim Kingdon (kingdon at pogo)
+
+ * many files: Move stdio.h before param.h.
+
+ * sun3-dep.c (store_inferior_registers): Only try to write FP
+ regs #ifdef FP0_REGNUM.
+
+Mon Jan 8 17:56:15 1990 Jim Kingdon (kingdon at pogo)
+
+ * symtab.c: #if 0 out "info methods" code.
+
+Sat Jan 6 12:33:04 1990 Jim Kingdon (kingdon at pogo)
+
+ * dbxread.c (read_struct_type): Set TYPE_NFN_FIELDS_TOTAL
+ from all baseclasses; remove vestigial variable baseclass.
+
+ * findvar.c (read_var_value): Check REG_STRUCT_HAS_ADDR.
+ printcmd.c (print_frame_args): Check STRUCT_ARG_SYM_GARBAGE.
+ m-sparc.h: Define REG_STRUCT_HAS_ADDR and STRUCT_ARG_SYM_GARBAGE.
+
+ * blockframe.c (get_frame_block): Subtract one from pc if not
+ innermost frame.
+
+Fri Dec 29 15:26:33 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * printcmd.c (print_frame_args): check highest_offset != -1, not i.
+
+Thu Dec 28 16:21:02 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * valops.c (value_struct_elt): Clean up error msg.
+
+ * breakpoint.c (describe_other_breakpoints):
+ Delete extra space before "also set at" and add period at end.
+
+Tue Dec 19 10:28:42 1989 Jim Kingdon (kingdon at pogo)
+
+ * source.c (print_source_lines): Tell user which line number
+ was out of range when printing error message.
+
+Sun Dec 17 14:14:09 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * blockframe.c (find_pc_partial_function): Use
+ BLOCK_START (SYMBOL_BLOCK_VALUE (f)) instead of
+ SYMBOL_VALUE (f) to get start of function.
+
+ * dbxread.c: Make xxmalloc just a #define for xmalloc.
+
+Thu Dec 14 16:13:16 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * m68k-opcode.h (fseq & following fp instructions):
+ Change @ to $.
+
+Fri Dec 8 19:06:44 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * breakpoint.c (breakpoint_clear_ignore_counts): New function.
+ infcmd.c (run_command): Call it.
+
+Wed Dec 6 15:03:38 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * valprint.c: Change it so "array-max 0" means there is
+ no limit.
+
+ * expread.y (yylex): Change error message "invalid token in
+ expression" to "invalid character '%c' in expression".
+
+Mon Dec 4 16:12:54 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * blockframe.c (find_pc_partial_function): Always return 1
+ for success, 0 for failure, and set *NAME and *ADDRESS to
+ match the return value.
+
+ * dbxread.c (symbol_file_command): Use perror_with_name on
+ error from stat.
+ (psymtab_to_symtab, add_file_command),
+ core.c (validate_files), source.c (find_source_lines),
+ default-dep.c (exec_file_command): Check for errors from stat,
+ fstat, and myread.
+
+Fri Dec 1 05:16:42 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * valops.c (check_field): When following pointers, just get
+ their types; don't call value_ind.
+
+Thu Nov 30 14:45:29 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * config.gdb (pyr): New machine.
+ core.c [REG_STACK_SEGMENT]: New code.
+ dbxread.c (process_one_symbol): Cast return from copy_pending
+ to long before casting to enum namespace.
+ infrun.c: Split registers_info into DO_REGISTERS_INFO
+ and registers_info.
+ m-pyr.h, pyr-{dep.c,opcode.h,pinsn.c}: New files.
+
+ * hp300bsd-dep.c: Stay in sync with default-dep.c.
+
+ * m-hp300bsd.h (IN_SIGTRAMP): Define.
+
+Mon Nov 27 23:48:21 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
+
+ * m-sparc.h (EXTRACT_RETURN_VALUE, STORE_RETURN_VALUE):
+ Return floating point values in %f0.
+
+Tue Nov 21 00:34:46 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * dbxread.c (read_type): #if 0 out code which skips to
+ comma following x-ref.
+
+Sat Nov 18 20:10:54 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * valprint.c (val_print): Undo changes of Nov 11 & 16.
+ (print_string): Add parameter force_ellipses.
+ (val_print): Pass force_ellipses true when we stop fetching string
+ before we get to the end, else pass false.
+
+Thu Nov 16 11:59:50 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * infrun.c (restore_inferior_status): Don't try to restore
+ selected frame if the inferior no longer exists.
+
+ * valprint.c (val_print): Rewrite string printing code not to
+ call print_string.
+
+ * Makefile.dist (clean): Remove xgdb and xgdb.o.
+
+Tue Nov 14 12:41:47 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * Makefile.dist (XGDB, bindir, xbindir, install, all): New stuff.
+
+Sat Nov 11 15:29:38 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * valprint.c (val_print): chars_to_get: New variable.
+
+Thu Nov 9 12:31:47 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * main.c (main): Process "-help" as a switch that doesn't
+ take an argument.
+
+Wed Nov 8 13:07:02 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * Makefile.dist (gdb.tar.Z): Add "else true".
+
+Tue Nov 7 12:25:14 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * infrun.c (restore_inferior_status): Don't dereference fid if NULL.
+
+ * config.gdb (sun3, sun4): Accept "sun3" and "sun4".
+
+Mon Nov 6 09:49:23 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * Makefile.dist (Makefile): Move comments after commands.
+
+ * *-dep.c [READ_COFF_SYMTAB]: Pass optional header size to
+ read_section_hdr().
+
+ * inflow.c: Include <fcntl.h> regardless of USG.
+
+ * coffread.c (read_section_hdr): Add optional_header_size.
+ (symbol_file_command): Pass optional header size to
+ read_section_hdr().
+ (read_coff_symtab): Initialize filestring.
+
+ * version.c: Change version to 3.4.xxx.
+
+ * GDB 3.4 released.
+
Sun Nov 5 11:39:01 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
- * version.c: Change version to 3.4
+ * version.c: Change version to 3.4.
* symtab.c (decode_line_1): Only skip past "struct" if it
is there.
diff --git a/gdb/Makefile.dist b/gdb/Makefile.dist
index d142d0f..3cbc91f 100644
--- a/gdb/Makefile.dist
+++ b/gdb/Makefile.dist
@@ -1,12 +1,17 @@
/* This file should be run through the C preprocessor by config.gdb
to produce the Makefile. */
-/* System V:
- If your system has a broken alloca(), define ALLOCA & ALLOCA1 below.
- Also, if you compile gdb with a compiler which uses the coff
- encapsulation feature (this is a function of the compiler used, NOT
- of the m-?.h file selected by config.gdb), you must make sure that
- the GNU nm is the one that is used by munch. */
+/* Define this to xgdb if you want to compile xgdb as well as gdb. */
+XGDB=
+/* Place to install binaries. */
+bindir=/usr/local/bin
+/* Place to install X binaries. */
+xbindir=$(bindir)
+
+/* System V: If you compile gdb with a compiler which uses the coff
+ encapsulation feature (this is a function of the compiler used, NOT
+ of the m-?.h file selected by config.gdb), you must make sure that
+ the GNU nm is the one that is used by munch. */
/* If you are compiling with GCC, make sure that either 1) You use the
-traditional flag, or 2) You have the fixed include files where GCC
@@ -105,7 +110,7 @@ MUNCH_DEFINE = ${SYSV_DEFINE}
TERMCAP = -ltermcap
/* M_CLIBS, if defined, has system-dependent libs
- For example, -lPW for System V */
+ For example, -lPW for System V to get alloca(). */
#ifndef M_CLIBS
#define M_CLIBS
#endif
@@ -123,23 +128,24 @@ SFILES = blockframe.c breakpoint.c dbxread.c coffread.c command.c core.c \
DEPFILES = umax-dep.c gould-dep.c default-dep.c sun3-dep.c \
sparc-dep.c hp9k320-dep.c hp300bsd-dep.c news-dep.c i386-dep.c \
- symmetry-dep.c convex-dep.c altos-dep.c isi-dep.c
+ symmetry-dep.c convex-dep.c altos-dep.c isi-dep.c pyr-dep.c
PINSNS = gld-pinsn.c i386-pinsn.c sparc-pinsn.c vax-pinsn.c m68k-pinsn.c \
- ns32k-pinsn.c convex-pinsn.c
+ ns32k-pinsn.c convex-pinsn.c pyr-pinsn.c
HFILES = command.h defs.h environ.h expression.h frame.h getpagesize.h \
inferior.h symseg.h symtab.h value.h wait.h \
a.out.encap.h a.out.gnu.h stab.gnu.h
OPCODES = m68k-opcode.h pn-opcode.h sparc-opcode.h npl-opcode.h vax-opcode.h \
- ns32k-opcode.h convex-opcode.h
+ ns32k-opcode.h convex-opcode.h pyr-opcode.h
MFILES = m-hp9k320.h m-hp300bsd.h m-i386.h m-i386gas.h \
m-i386-sv32.h m-i386g-sv32.h m-isi.h m-merlin.h \
m-altos.h m-news.h m-newsos3.h m-npl.h m-pn.h \
m-sparc.h m-sun2.h m-sun3.h m-sun2os4.h \
- m-sun3os4.h m-sun4os4.h m-umax.h m-vax.h m-symmetry.h m-convex.h
+ m-sun3os4.h m-sun4os4.h m-umax.h m-vax.h m-symmetry.h m-convex.h \
+ m-pyr.h
/* This list of files really shouldn't be in this makefile, but I can't think
of any good way to get the readline makefile to tell us what files
@@ -148,6 +154,7 @@ READLINE = readline.c history.c funmap.c \
emacs_keymap.c vi_keymap.c vi_mode.c keymaps.c \
readline.h history.h keymaps.h chardefs.h \
inc-readline.texinfo inc-history.texinfo \
+ readline.texinfo history.texinfo \
Makefile ChangeLog
REMOTE_EXAMPLES = remote-sa.m68k.shar remote-multi.shar
@@ -193,6 +200,16 @@ MD=M_MAKEDEFINE
${CC} -c ${CFLAGS} $< */
TARGET_ARCH=
+all: gdb $(XGDB)
+
+install: gdb $(XGDB)
+ cp gdb $(bindir)/gdb.new
+ mv $(bindir)/gdb.new $(bindir)/gdb
+ -if [ "$(XGDB)" = xgdb ]; then \
+ cp xgdb $(xbindir)/xgdb.new; \
+ mv $(xbindir)/xgdb.new $(xbindir)xgdb; \
+ fi
+
gdb : $(OBS) $(TSOBS) ${ADD_DEPS} ${RL_LIB}
rm -f init.c
./munch ${MUNCH_DEFINE} $(OBS) $(TSOBS) > init.c
@@ -206,11 +223,11 @@ gdb1 : gdb
Makefile : Makefile.dist
cp Makefile.dist tmp.c
+ $(CC) -E >Makefile tmp.c $(MD) "-DM_MAKEDEFINE=$(MD)"
+ -rm tmp.c
/* This did not work-- -Usparc became "-Usparc" became "-Usparc.
Or something like that. */
/* $(CC) -E >Makefile tmp.c $(MD) "-DM_MAKEDEFINE=\"$(MD)\"" */
- $(CC) -E >Makefile tmp.c $(MD) "-DM_MAKEDEFINE=$(MD)"
- -rm tmp.c
xgdb : $(OBS) $(TSOBS) xgdb.o ${ADD_DEPS} ${RL_LIB}
rm -f init.c
@@ -251,12 +268,13 @@ gdb.tar: ${TARFILES}
overwrite it. compress -f is not what we want, because we do want
to know if compress would not make it smaller. */
gdb.tar.Z: gdb.tar
- if [ -f gdb.tar.Z ]; then rm -f gdb.tar.Z; fi
+ if [ -f gdb.tar.Z ]; then rm -f gdb.tar.Z; else true; fi
compress gdb.tar
clean:
rm -f ${OBS} ${TSOBS} ${NTSOBS} ${OBSTACK} ${REGEX} ${GNU_MALLOC}
rm -f init.c init.o
+ rm -f xgdb.o xgdb
rm -f gdb core gdb.tar gdb.tar.Z make.log
rm -f gdb[0-9]
cd readline ; make clean
diff --git a/gdb/TAGS b/gdb/TAGS
index e8a5e56..018f394 100644
--- a/gdb/TAGS
+++ b/gdb/TAGS
@@ -1,240 +1,241 @@
-dbxread.c,2354
-#define IGNORE_SYMBOL(164,4914
-#define IGNORE_SYMBOL(169,5028
-#define MAX_OF_TYPE(5113,141022
-#define MIN_OF_TYPE(5114,141075
-#define READ_FILE_HEADERS(211,6321
-#define READ_FILE_HEADERS(218,6571
-#define READ_STRING_TABLE_SIZE(197,5872
-#define SET_ELEMENT_P(85,2728
-#define STAB_REG_TO_REGNUM(264,8007
-#define TYPE_OF_SET_ELEMENT(86,2788
-_initialize_dbxread 5393,149221
-add_bincl_to_list 1824,50638
-add_file_command 3616,99938
-add_new_header_file 686,20412
-add_old_header_file 657,19394
-add_symbol_to_list 867,25287
-add_this_object_header_file 637,18767
-add_undefined_type 4073,113549
-cleanup_undefined_types 4089,113992
-compare_misc_functions 1399,39494
-compare_psymbols 2662,72591
-compare_symbols 1487,41458
-condense_addl_misc_bunches 3413,94383
-condense_misc_bunches 1428,40167
-copy_pending 5357,148363
-dbx_alloc_type 814,24174
-dbx_create_type 797,23649
-dbx_lookup_type 746,22223
-define_symbol 3778,104025
-discard_misc_bunches 1412,39806
-end_psymtab 2686,73305
-end_symtab 1207,34565
-explicit_lookup_type 846,24755
-fill_in_vptr_fieldno 5345,148030
-fill_symbuf 1764,48931
-find_corresponding_bincl_psymtab 1849,51331
-finish_block 932,26830
-fix_common_block 5379,148917
- for 2612,71266
-free_bincl_list 1867,51719
-free_header_files 612,18133
-get_sym_file 1740,48273
-hash_symsegs 3150,86601
-hashname 3123,86078
-init_bincl_list 1812,50383
-init_header_files 599,17782
-init_misc_functions 1361,38562
-init_psymbol_list 1793,49686
-make_blockvector 1023,29323
-new_object_header_files 626,18495
-next_symbol_text 1780,49407
-obconcat 508,14582
-obsavestring 486,14075
-pop_subfile 1319,37721
-process_one_symbol 3181,87419
-psymtab_to_symtab(2827,77376
-psymtab_to_symtab_1 2764,75669
-push_subfile 1305,37370
-read_addl_syms 3456,95405
-read_args 5303,146873
-read_array_type 4953,136572
-read_dbx_symtab 1891,52496
-read_enum_type 5030,138577
-read_number 5264,146160
-read_ofile_symtab 3009,82363
-read_range_type 5117,141147
-read_struct_type 4445,122700
-read_type 4142,115449
-read_type_number 3758,103693
-really_free_pendings 896,26045
-record_line 1065,30528
-record_misc_function 1369,38676
-scan_file_globals 2936,80331
-sort_syms 1508,42042
-sort_symtab_syms 1517,42168
-start_psymtab 2631,71801
-start_subfile 1149,32781
-start_symtab 1096,31315
-symbol_file_command 1557,43492
-xxmalloc 470,13738
-
-blockframe.c,647
+dbxread.c,2355
+#define IGNORE_SYMBOL(175,5471
+#define IGNORE_SYMBOL(180,5585
+#define MAX_OF_TYPE(5178,143279
+#define MIN_OF_TYPE(5179,143332
+#define READ_FILE_HEADERS(222,6878
+#define READ_FILE_HEADERS(229,7128
+#define READ_STRING_TABLE_SIZE(208,6429
+#define SET_ELEMENT_P(97,3304
+#define STAB_REG_TO_REGNUM(275,8564
+#define TYPE_OF_SET_ELEMENT(98,3364
+_initialize_dbxread 5458,151478
+add_bincl_to_list 1842,51414
+add_file_command 3640,101006
+add_new_header_file 704,21220
+add_old_header_file 675,20202
+add_symbol_to_list 885,26095
+add_this_object_header_file 655,19575
+add_undefined_type 4109,115061
+cleanup_undefined_types 4125,115504
+compare_misc_functions 1417,40302
+compare_psymbols 2687,73625
+compare_symbols 1505,42266
+condense_addl_misc_bunches 3437,95451
+condense_misc_bunches 1446,40975
+copy_pending 5422,150620
+dbx_alloc_type 832,24982
+dbx_create_type 815,24457
+dbx_lookup_type 764,23031
+define_symbol 3803,105130
+discard_misc_bunches 1430,40614
+end_psymtab 2711,74339
+end_symtab 1225,35373
+explicit_lookup_type 864,25563
+fill_in_vptr_fieldno 5410,150287
+fill_symbuf 1782,49707
+find_corresponding_bincl_psymtab 1867,52107
+finish_block 950,27638
+fix_common_block 5444,151174
+ for 2637,72300
+free_bincl_list 1885,52495
+free_header_files 630,18941
+get_sym_file 1758,49049
+hash_symsegs 3176,87669
+hashname 3149,87146
+init_bincl_list 1830,51159
+init_header_files 617,18590
+init_misc_functions 1379,39370
+init_psymbol_list 1811,50462
+make_blockvector 1041,30131
+new_object_header_files 644,19303
+next_symbol_text 1798,50183
+obconcat 526,15390
+obsavestring 504,14883
+pop_subfile 1337,38529
+process_one_symbol 3207,88487
+psymtab_to_symtab(2852,78410
+psymtab_to_symtab_1 2789,76703
+push_subfile 1323,38178
+read_addl_syms 3480,96473
+read_args 5368,149130
+read_array_type 5018,138829
+read_dbx_symtab 1909,53272
+read_enum_type 5095,140834
+read_number 5329,148417
+read_ofile_symtab 3035,83431
+read_range_type 5182,143404
+read_struct_type 4488,124519
+read_type 4178,116961
+read_type_number 3783,104798
+really_free_pendings 914,26853
+record_line 1083,31336
+record_misc_function 1387,39484
+scan_file_globals 2962,81399
+sort_syms 1526,42850
+sort_symtab_syms 1535,42976
+start_psymtab 2656,72835
+start_subfile 1167,33589
+start_symtab 1114,32123
+symbol_file_command 1575,44300
+xxmalloc 485,14484
+
+blockframe.c,649
#define FRAMELESS_LOOK_FOR_PROLOGUE(163,4369
-_initialize_blockframe 595,15906
-block_for_pc 351,9907
-block_innermost_frame 574,15493
+_initialize_blockframe 601,16174
+block_for_pc 362,10363
+block_innermost_frame 580,15761
create_new_frame 80,2165
-find_pc_function 422,11439
-find_pc_misc_function 529,14090
-find_pc_partial_function 445,12194
+find_pc_function 433,11895
+find_pc_misc_function 535,14358
+find_pc_partial_function 450,12430
flush_cached_frames 132,3234
-get_current_block 311,9005
+get_current_block 322,9461
get_current_frame 64,1933
-get_frame_block 301,8854
-get_frame_function 336,9578
+get_frame_block 302,8898
+get_frame_function 347,10034
get_frame_info 149,3857
-get_frame_pc 279,8317
-get_frame_saved_regs 290,8505
+get_frame_pc 280,8361
+get_frame_saved_regs 291,8549
get_next_frame 120,3036
-get_pc_function_start 317,9077
+get_pc_function_start 328,9533
get_prev_frame 108,2779
-get_prev_frame_info 186,5408
+get_prev_frame_info 187,5452
outside_startup_file 41,1369
set_current_frame 73,2085
-breakpoint.c,1353
-#define ALL_BREAKPOINTS(79,2818
-_initialize_breakpoint 1222,29424
-break_command 783,19872
-break_command_1 676,17146
-breakpoint_1 425,11273
-breakpoint_auto_delete 934,23503
-breakpoint_cond_eval 349,9392
-breakpoint_here_p 333,9062
-breakpoint_stop_status 364,9891
-breakpoints_info 490,12855
-check_duplicates 555,14367
-clear_breakpoint_commands 236,6805
-clear_breakpoints 1010,25078
-clear_command 855,21469
-clear_momentary_breakpoints 626,15940
-commands_command 166,4928
-condition_command 116,3841
-decode_line_spec_1 1195,28751
-delete_breakpoint 951,23808
-delete_command 984,24430
-describe_other_breakpoints 509,13241
-disable_breakpoint 1136,27694
-disable_command 1148,27923
-do_breakpoint_commands 218,6245
-enable_breakpoint 1112,27251
-enable_command 1124,27477
-enable_delete_breakpoint 1176,28408
-enable_delete_command 1185,28545
-enable_once_breakpoint 1160,28152
-enable_once_command 1169,28290
-get_breakpoint_commands 247,7090
-ignore_command 1050,25970
-insert_breakpoints 265,7481
-map_breakpoint_numbers 1077,26570
-mark_breakpoints_out 320,8751
-remove_breakpoints 291,8118
-set_breakpoint 642,16292
-set_breakpoint_commands 253,7157
-set_default_breakpoint 538,13897
-set_ignore_count 1020,25303
-set_momentary_breakpoint 614,15691
-set_raw_breakpoint 576,14887
-tbreak_command 791,19992
-until_break_command 803,20231
-
-dbxread.c,2354
-#define IGNORE_SYMBOL(164,4914
-#define IGNORE_SYMBOL(169,5028
-#define MAX_OF_TYPE(5113,141022
-#define MIN_OF_TYPE(5114,141075
-#define READ_FILE_HEADERS(211,6321
-#define READ_FILE_HEADERS(218,6571
-#define READ_STRING_TABLE_SIZE(197,5872
-#define SET_ELEMENT_P(85,2728
-#define STAB_REG_TO_REGNUM(264,8007
-#define TYPE_OF_SET_ELEMENT(86,2788
-_initialize_dbxread 5393,149221
-add_bincl_to_list 1824,50638
-add_file_command 3616,99938
-add_new_header_file 686,20412
-add_old_header_file 657,19394
-add_symbol_to_list 867,25287
-add_this_object_header_file 637,18767
-add_undefined_type 4073,113549
-cleanup_undefined_types 4089,113992
-compare_misc_functions 1399,39494
-compare_psymbols 2662,72591
-compare_symbols 1487,41458
-condense_addl_misc_bunches 3413,94383
-condense_misc_bunches 1428,40167
-copy_pending 5357,148363
-dbx_alloc_type 814,24174
-dbx_create_type 797,23649
-dbx_lookup_type 746,22223
-define_symbol 3778,104025
-discard_misc_bunches 1412,39806
-end_psymtab 2686,73305
-end_symtab 1207,34565
-explicit_lookup_type 846,24755
-fill_in_vptr_fieldno 5345,148030
-fill_symbuf 1764,48931
-find_corresponding_bincl_psymtab 1849,51331
-finish_block 932,26830
-fix_common_block 5379,148917
- for 2612,71266
-free_bincl_list 1867,51719
-free_header_files 612,18133
-get_sym_file 1740,48273
-hash_symsegs 3150,86601
-hashname 3123,86078
-init_bincl_list 1812,50383
-init_header_files 599,17782
-init_misc_functions 1361,38562
-init_psymbol_list 1793,49686
-make_blockvector 1023,29323
-new_object_header_files 626,18495
-next_symbol_text 1780,49407
-obconcat 508,14582
-obsavestring 486,14075
-pop_subfile 1319,37721
-process_one_symbol 3181,87419
-psymtab_to_symtab(2827,77376
-psymtab_to_symtab_1 2764,75669
-push_subfile 1305,37370
-read_addl_syms 3456,95405
-read_args 5303,146873
-read_array_type 4953,136572
-read_dbx_symtab 1891,52496
-read_enum_type 5030,138577
-read_number 5264,146160
-read_ofile_symtab 3009,82363
-read_range_type 5117,141147
-read_struct_type 4445,122700
-read_type 4142,115449
-read_type_number 3758,103693
-really_free_pendings 896,26045
-record_line 1065,30528
-record_misc_function 1369,38676
-scan_file_globals 2936,80331
-sort_syms 1508,42042
-sort_symtab_syms 1517,42168
-start_psymtab 2631,71801
-start_subfile 1149,32781
-start_symtab 1096,31315
-symbol_file_command 1557,43492
-xxmalloc 470,13738
+breakpoint.c,1396
+#define ALL_BREAKPOINTS(78,2817
+_initialize_breakpoint 1231,29590
+break_command 782,19871
+break_command_1 675,17145
+breakpoint_1 424,11272
+breakpoint_auto_delete 933,23502
+breakpoint_clear_ignore_counts 1048,25951
+breakpoint_cond_eval 348,9391
+breakpoint_here_p 332,9061
+breakpoint_stop_status 363,9890
+breakpoints_info 489,12854
+check_duplicates 554,14366
+clear_breakpoint_commands 235,6804
+clear_breakpoints 1009,25077
+clear_command 854,21468
+clear_momentary_breakpoints 625,15939
+commands_command 165,4927
+condition_command 115,3840
+decode_line_spec_1 1204,28917
+delete_breakpoint 950,23807
+delete_command 983,24429
+describe_other_breakpoints 508,13240
+disable_breakpoint 1145,27860
+disable_command 1157,28089
+do_breakpoint_commands 217,6244
+enable_breakpoint 1121,27417
+enable_command 1133,27643
+enable_delete_breakpoint 1185,28574
+enable_delete_command 1194,28711
+enable_once_breakpoint 1169,28318
+enable_once_command 1178,28456
+get_breakpoint_commands 246,7089
+ignore_command 1059,26136
+insert_breakpoints 264,7480
+map_breakpoint_numbers 1086,26736
+mark_breakpoints_out 319,8750
+remove_breakpoints 290,8117
+set_breakpoint 641,16291
+set_breakpoint_commands 252,7156
+set_default_breakpoint 537,13896
+set_ignore_count 1019,25302
+set_momentary_breakpoint 613,15690
+set_raw_breakpoint 575,14886
+tbreak_command 790,19991
+until_break_command 802,20230
+
+dbxread.c,2355
+#define IGNORE_SYMBOL(175,5471
+#define IGNORE_SYMBOL(180,5585
+#define MAX_OF_TYPE(5178,143279
+#define MIN_OF_TYPE(5179,143332
+#define READ_FILE_HEADERS(222,6878
+#define READ_FILE_HEADERS(229,7128
+#define READ_STRING_TABLE_SIZE(208,6429
+#define SET_ELEMENT_P(97,3304
+#define STAB_REG_TO_REGNUM(275,8564
+#define TYPE_OF_SET_ELEMENT(98,3364
+_initialize_dbxread 5458,151478
+add_bincl_to_list 1842,51414
+add_file_command 3640,101006
+add_new_header_file 704,21220
+add_old_header_file 675,20202
+add_symbol_to_list 885,26095
+add_this_object_header_file 655,19575
+add_undefined_type 4109,115061
+cleanup_undefined_types 4125,115504
+compare_misc_functions 1417,40302
+compare_psymbols 2687,73625
+compare_symbols 1505,42266
+condense_addl_misc_bunches 3437,95451
+condense_misc_bunches 1446,40975
+copy_pending 5422,150620
+dbx_alloc_type 832,24982
+dbx_create_type 815,24457
+dbx_lookup_type 764,23031
+define_symbol 3803,105130
+discard_misc_bunches 1430,40614
+end_psymtab 2711,74339
+end_symtab 1225,35373
+explicit_lookup_type 864,25563
+fill_in_vptr_fieldno 5410,150287
+fill_symbuf 1782,49707
+find_corresponding_bincl_psymtab 1867,52107
+finish_block 950,27638
+fix_common_block 5444,151174
+ for 2637,72300
+free_bincl_list 1885,52495
+free_header_files 630,18941
+get_sym_file 1758,49049
+hash_symsegs 3176,87669
+hashname 3149,87146
+init_bincl_list 1830,51159
+init_header_files 617,18590
+init_misc_functions 1379,39370
+init_psymbol_list 1811,50462
+make_blockvector 1041,30131
+new_object_header_files 644,19303
+next_symbol_text 1798,50183
+obconcat 526,15390
+obsavestring 504,14883
+pop_subfile 1337,38529
+process_one_symbol 3207,88487
+psymtab_to_symtab(2852,78410
+psymtab_to_symtab_1 2789,76703
+push_subfile 1323,38178
+read_addl_syms 3480,96473
+read_args 5368,149130
+read_array_type 5018,138829
+read_dbx_symtab 1909,53272
+read_enum_type 5095,140834
+read_number 5329,148417
+read_ofile_symtab 3035,83431
+read_range_type 5182,143404
+read_struct_type 4488,124519
+read_type 4178,116961
+read_type_number 3783,104798
+really_free_pendings 914,26853
+record_line 1083,31336
+record_misc_function 1387,39484
+scan_file_globals 2962,81399
+sort_syms 1526,42850
+sort_symtab_syms 1535,42976
+start_psymtab 2656,72835
+start_subfile 1167,33589
+start_symtab 1114,32123
+symbol_file_command 1575,44300
+xxmalloc 485,14484
coffread.c,1153
-_initialize_coff 1995,51136
+_initialize_coff 2005,51461
add_symbol_to_list 239,6659
coff_alloc_type 216,6044
coff_lookup_type 191,5303
@@ -242,34 +243,34 @@ compare_misc_functions 574,15824
compare_symbols 643,17250
complete_symtab 420,11661
condense_misc_bunches 600,16328
-decode_base_type 1693,43554
-decode_function_type 1678,43222
-decode_type 1609,41585
+decode_base_type 1703,43879
+decode_function_type 1688,43547
+decode_type 1619,41910
discard_misc_bunches 587,16136
end_symtab 443,12339
-enter_linenos 1323,33763
-fill_in_vptr_fieldno 1974,50581
+enter_linenos 1333,34088
+fill_in_vptr_fieldno 1984,50906
finish_block 255,7053
-free_stringtab 1242,32265
-get_sym_file 828,22012
-getfilename 1270,32727
-getsymname 1250,32361
-hashname 1347,34456
-init_lineno 1299,33361
+free_stringtab 1252,32590
+get_sym_file 829,22034
+getfilename 1280,33052
+getsymname 1260,32686
+hashname 1357,34781
+init_lineno 1309,33686
init_misc_functions 530,14772
-init_stringtab 1205,31478
+init_stringtab 1215,31803
make_blockvector 334,9209
-patch_opaque_types 1395,35616
-patch_type 1368,34736
-process_coff_symbol 1456,37317
-psymtab_to_symtab 1987,50949
-read_aout_hdr 1141,29963
-read_coff_symtab 851,22597
-read_enum_type 1892,48254
-read_file_hdr 1104,29391
-read_one_sym 1175,30677
-read_section_hdr 1154,30216
-read_struct_type 1797,45857
+patch_opaque_types 1405,35941
+patch_type 1378,35061
+process_coff_symbol 1466,37642
+psymtab_to_symtab 1997,51274
+read_aout_hdr 1144,30026
+read_coff_symtab 852,22619
+read_enum_type 1902,48579
+read_file_hdr 1107,29454
+read_one_sym 1185,31002
+read_section_hdr 1162,30467
+read_struct_type 1807,46182
record_line 372,10317
record_misc_function 538,14886
sort_syms 655,17641
@@ -296,22 +297,22 @@ shell_escape 815,22224
core.c,428
#define N_DATADDR(60,1462
-#define N_MAGIC(37,1073
-#define N_MAGIC(39,1116
+#define N_MAGIC(38,1092
+#define N_MAGIC(40,1135
#define N_TXTADDR(56,1392
-_initialize_core(501,11938
-close_exec_file 161,3652
-files_info 222,4972
-get_exec_file 206,4721
-have_core_file_p 216,4911
-myread 457,11184
-read_memory 274,6251
-register_addr 484,11669
-reopen_exec_file 169,3741
-specify_exec_file_hook 150,3418
-validate_files 185,4140
-write_memory 298,6810
-xfer_core_file 324,7551
+_initialize_core(531,12986
+close_exec_file 167,3820
+files_info 232,5329
+get_exec_file 216,5078
+have_core_file_p 226,5268
+myread 487,12232
+read_memory 284,6608
+register_addr 514,12717
+reopen_exec_file 175,3909
+specify_exec_file_hook 156,3586
+validate_files 191,4308
+write_memory 308,7167
+xfer_core_file 334,7908
environ.c,205
environ_vector 87,2273
@@ -342,74 +343,76 @@ print_subexp 105,3561
findvar.c,319
find_saved_register 34,1194
-locate_var_value 489,13624
+locate_var_value 506,14105
read_register 207,6246
read_register_bytes 181,5670
read_relative_register_raw_bytes 104,3552
read_var_value 250,7313
supply_register 238,6995
-value_from_register 324,8965
+value_from_register 341,9446
value_of_register 138,4309
write_register 217,6487
write_register_bytes 193,5953
-infcmd.c,711
-_initialize_infcmd 1000,23564
-attach_command 879,21184
-cont_command 195,4400
-detach_command 948,22621
-environment_info 596,13961
-finish_command 509,11745
-float_info 987,23343
-have_inferior_p 113,2973
-jump_command 314,6947
-next_command 232,5120
-nexti_command 246,5322
-program_info 574,13352
-read_memory_integer 695,16288
-read_pc 751,17739
-registers_info 769,18009
-run_command 139,3401
-run_stack_dummy 409,9239
-set_args_command 119,3038
-set_environment_command 616,14363
-signal_command 367,8069
-step_1 252,5399
-step_command 224,4968
-stepi_command 240,5245
-tty_command 128,3179
-unset_environment_command 676,15776
-until_command 492,11379
-until_next_command 445,10390
-write_pc 757,17808
+infcmd.c,790
+#define DO_REGISTERS_INFO(790,18805
+_initialize_infcmd 1034,24596
+attach_command 913,22216
+cont_command 208,4740
+detach_command 982,23653
+static void do_registers_info 791,18865
+environment_info 609,14301
+finish_command 522,12085
+float_info 1021,24375
+have_inferior_p 114,3013
+jump_command 327,7287
+next_command 245,5460
+nexti_command 259,5662
+program_info 587,13692
+read_memory_integer 708,16628
+read_pc 764,18079
+registers_info 860,20846
+run_command 140,3441
+run_stack_dummy 422,9579
+set_args_command 120,3078
+set_environment_command 629,14703
+signal_command 380,8409
+step_1 265,5739
+step_command 237,5308
+stepi_command 253,5585
+tty_command 129,3219
+unset_environment_command 689,16116
+until_command 505,11719
+until_next_command 458,10730
+write_pc 770,18148
inflow.c,335
-_initialize_inflow 511,12264
-create_inferior 365,8512
-inferior_died 459,10830
-kill_command 447,10602
-new_tty 323,7661
-term_status_command 272,6237
-terminal_inferior 140,3148
-terminal_init_inferior 109,2609
-terminal_ours 193,4436
-terminal_ours_1 202,4530
-terminal_ours_for_output 180,4199
-try_writing_regs_command 479,11383
+_initialize_inflow 514,12406
+create_inferior 368,8654
+inferior_died 462,10972
+kill_command 450,10744
+new_tty 326,7803
+term_status_command 275,6379
+terminal_inferior 143,3290
+terminal_init_inferior 112,2751
+terminal_ours 196,4578
+terminal_ours_1 205,4672
+terminal_ours_for_output 183,4341
+try_writing_regs_command 482,11525
infrun.c,452
#define IN_SIGTRAMP(166,5961
-_initialize_infrun 1366,41425
+_initialize_infrun 1384,42362
attach_program 448,13556
clear_proceed_status 263,8729
-handle_command 1161,34864
-insert_step_breakpoint 1139,34287
-normal_stop 1031,31038
+handle_command 1169,35281
+insert_step_breakpoint 1147,34704
+normal_stop 1034,31187
proceed 291,9587
-remove_step_breakpoint 1151,34589
-restore_inferior_status 1320,39947
-save_inferior_status 1289,38718
-signals_info 1248,37466
+remove_step_breakpoint 1159,35006
+restore_inferior_status 1328,40364
+save_inferior_status 1297,39135
+signals_info 1256,37883
start_inferior 383,11941
start_remote 430,13196
wait_for_inferior 472,14197
@@ -418,72 +421,72 @@ writing_pc 370,11620
kdb-start.c,14
start 29,911
-main.c,1395
+main.c,1396
#define ISATTY(47,1291
-add_com 1096,28194
-add_com_alias 1108,28421
-add_info 1064,27479
-add_info_alias 1075,27672
+add_com 1105,28415
+add_com_alias 1117,28642
+add_info 1073,27700
+add_info_alias 1084,27893
catch_errors 177,4170
-catch_termination 793,20409
-cd_command 1348,33403
-command_line_input 848,22259
-command_loop 525,13560
-define_command 1154,29214
+catch_termination 802,20630
+cd_command 1357,33624
+command_line_input 857,22480
+command_loop 534,13781
+define_command 1163,29435
disconnect 207,4712
-do_nothing 518,13460
-document_command 1194,30215
-dont_repeat 549,14224
-dump_me_command 1463,35430
-echo_command 1437,35046
-editing_info 1512,36452
-error_no_arg 1118,28619
-execute_command 475,12385
-float_handler 1695,40905
-free_command_lines 1046,27170
-gdb_readline 566,14745
-help_command 1125,28713
-info_command 1087,28000
-initialize_cmd_lists 1702,41002
-initialize_main 1716,41459
-initialize_signals 808,20856
-input_from_terminal_p 1327,32957
+do_nothing 527,13681
+document_command 1203,30436
+dont_repeat 558,14445
+dump_me_command 1472,35651
+echo_command 1446,35267
+editing_info 1521,36673
+error_no_arg 1127,28840
+execute_command 484,12606
+float_handler 1704,41126
+free_command_lines 1055,27391
+gdb_readline 575,14966
+help_command 1134,28934
+info_command 1096,28221
+initialize_cmd_lists 1711,41223
+initialize_main 1725,41680
+initialize_signals 817,21077
+input_from_terminal_p 1336,33178
main 231,5192
-parse_binary_operation 1473,35577
-print_gdb_version 1239,31139
-print_prompt 1259,31637
-pwd_command 1333,33028
-quit_command 1306,32443
-read_command_lines 995,25868
+parse_binary_operation 1482,35798
+print_gdb_version 1248,31360
+print_prompt 1268,31858
+pwd_command 1342,33249
+quit_command 1315,32664
+read_command_lines 1004,26089
return_to_top_level 160,3706
-set_editing 1502,36210
-set_history 1626,39639
-set_history_expansion 1610,39313
-set_history_filename 1646,40027
-set_history_size 1635,39860
-set_history_write 1618,39482
-set_prompt_command 1268,31778
-set_verbose_command 1675,40510
+set_editing 1511,36431
+set_history 1635,39860
+set_history_expansion 1619,39534
+set_history_filename 1655,40248
+set_history_size 1644,40081
+set_history_write 1627,39703
+set_prompt_command 1277,31999
+set_verbose_command 1684,40731
source_cleanup 220,5004
-source_command 1408,34540
-stop_sig 741,19239
-symbol_completion_function 633,16489
-validate_comname 1133,28847
-verbose_info 1683,40660
-version_info 1249,31489
+source_command 1417,34761
+stop_sig 750,19460
+symbol_completion_function 642,16710
+validate_comname 1142,29068
+verbose_info 1692,40881
+version_info 1258,31710
printcmd.c,943
-_initialize_printcmd 1625,38235
+_initialize_printcmd 1656,39183
address_info 592,13980
clear_displays 916,21753
compare_ints 1210,27800
-containing_function_bounds 1539,36095
+containing_function_bounds 1570,37043
decode_format 80,2251
delete_display 931,21964
disable_current_display 1084,25192
disable_display 1069,24954
disable_display_command 1162,26927
-disassemble_command 1565,36755
+disassemble_command 1596,37703
display_command 853,20570
display_info 1096,25473
do_displays 1057,24704
@@ -496,10 +499,10 @@ print_address 404,9676
print_command 513,12305
print_formatted 175,4422
print_frame_args 1223,28116
-print_frame_nameless_args 1308,30365
+print_frame_nameless_args 1339,31313
print_scalar_formatted 218,5618
print_variable_value 1200,27581
-printf_command 1333,30952
+printf_command 1364,31900
ptype_command 768,18351
set_command 581,13730
set_next_address 389,9302
@@ -538,24 +541,24 @@ remote_write_bytes 377,8208
remote_write_inferior_memory 467,10193
tohex 229,5357
-source.c,488
-_initialize_source 954,23365
-ambiguous_line_spec 575,13769
+source.c,489
+_initialize_source 956,23462
+ambiguous_line_spec 577,13866
directories_info 132,3510
directory_command 156,4027
find_source_lines 362,8523
-forward_search_command 807,19993
-get_filename_and_charpos 446,10571
-identify_source_line 478,11440
+forward_search_command 809,20090
+get_filename_and_charpos 448,10659
+identify_source_line 480,11528
init_source_path 138,3601
-line_info 747,18381
-list_command 587,14000
+line_info 749,18478
+list_command 589,14097
openp 295,7020
-print_source_lines 502,12090
-reverse_search_command 877,21586
+print_source_lines 504,12178
+reverse_search_command 879,21683
select_source_symtab 68,2053
-source_charpos_line 420,9931
-source_line_charpos 406,9635
+source_charpos_line 422,10019
+source_line_charpos 408,9723
stack.c,657
_initialize_stack 879,22697
@@ -652,9 +655,9 @@ symmisc.c,569
#define RELOCATE(143,4006
#define TEXT_RELOCATE(157,4600
#define UNRELOCATE(147,4201
-_initialize_symmisc 576,15724
-block_depth 556,15387
-free_all_psymtabs(568,15569
+_initialize_symmisc 576,15726
+block_depth 556,15389
+free_all_psymtabs(568,15571
free_all_symtabs 35,1081
free_symtab 89,2472
free_symtab_block 67,1765
@@ -671,14 +674,14 @@ relocate_type 290,8487
relocate_typevector 270,7878
symtab.c,1477
-_initialize_symtab 2388,65501
+_initialize_symtab 2394,65746
block_function 1102,30299
-compare_symbols 2179,59357
-completion_list_add_symbol 2245,60968
-contained_in 2230,60698
+compare_symbols 2185,59602
+completion_list_add_symbol 2251,61213
+contained_in 2236,60943
create_array_type 604,16947
decode_line_1 1438,39022
-decode_line_2 1806,50086
+decode_line_2 1809,50251
decode_line_spec 1791,49695
find_line_common 1354,36778
find_line_pc 1289,34998
@@ -688,16 +691,16 @@ find_pc_line_pc_range 1399,37601
find_pc_psymbol 765,21363
find_pc_psymtab 750,20994
find_pc_symtab 1114,30525
-functions_info 2156,59021
-init_type 2202,59965
-list_symbols 1980,54032
+functions_info 2159,59186
+init_type 2208,60210
+list_symbols 1983,54197
lookup_basetype_type 507,14022
lookup_block_symbol 1007,27715
lookup_enum 268,7169
lookup_function_type 569,15751
lookup_member_type 383,10719
lookup_method_type 437,12136
-lookup_misc_func 1903,52326
+lookup_misc_func 1906,52491
lookup_partial_symbol 945,26144
lookup_partial_symtab 165,4536
lookup_pointer_type 323,8661
@@ -710,18 +713,18 @@ lookup_symtab_1 86,2715
lookup_typename 183,4935
lookup_union 250,6688
lookup_unsigned_typename 214,5725
-make_symbol_completion_list 2270,61739
-methods_info 2170,59193
-output_source_filename 1918,52626
+make_symbol_completion_list 2276,61984
+methods_info 2175,59423
+output_source_filename 1921,52791
smash_to_function_type 724,20334
smash_to_member_type 658,18480
smash_to_method_type 675,18938
smash_to_pointer_type 631,17770
smash_to_reference_type 695,19530
-sort_block_syms 2191,59748
-sources_info 1946,53079
-types_info 2163,59109
-variables_info 2149,58933
+sort_block_syms 2197,59993
+sources_info 1949,53244
+types_info 2166,59274
+variables_info 2152,59098
utils.c,893
#define ISATTY(34,1102
@@ -782,11 +785,11 @@ value_zerop 555,14239
valops.c,539
call_function 514,14497
-check_field 994,27520
-destructor_name_p 967,26823
+check_field 997,27716
+destructor_name_p 970,27019
push_bytes 436,12810
push_word 416,12444
-typecmp 1189,32376
+typecmp 1187,32455
value_addr 354,10374
value_arg_coerce 476,13603
value_arg_push 499,14050
@@ -795,32 +798,32 @@ value_at 87,2594
value_cast 33,1132
value_coerce_array 326,9567
value_ind 381,11139
-value_of_this 1217,33059
+value_of_this 1215,33138
value_of_variable 316,9365
value_push 455,13151
value_repeat 293,8780
-value_string 704,20059
-value_struct_elt 783,22387
-value_struct_elt_for_address 1075,29361
+value_string 707,20254
+value_struct_elt 786,22582
+value_struct_elt_for_address 1073,29440
value_zero 72,2297
-valprint.c,462
-_initialize_valprint 1314,34466
-format_info 1297,34020
-is_nan 737,19321
-print_string 51,1540
-set_maximum_command 1274,33552
-set_prettyprint_command 1282,33721
-set_unionprint_command 1290,33878
-type_print 783,20553
-type_print_1 795,20784
-type_print_base 1076,28463
-type_print_derivation_info 862,22651
-type_print_method_args 824,21667
-type_print_varspec_prefix 917,24229
-type_print_varspec_suffix 985,25987
-val_print 250,6740
-value_print 132,3315
+valprint.c,463
+_initialize_valprint 1340,35520
+format_info 1319,34937
+is_nan 757,20190
+print_string 55,1786
+set_maximum_command 1294,34421
+set_prettyprint_command 1304,34638
+set_unionprint_command 1312,34795
+type_print 803,21422
+type_print_1 815,21653
+type_print_base 1096,29332
+type_print_derivation_info 882,23520
+type_print_method_args 844,22536
+type_print_varspec_prefix 937,25098
+type_print_varspec_suffix 1005,26856
+val_print 254,6975
+value_print 136,3547
values.c,901
_initialize_values 1015,26691
@@ -859,18 +862,18 @@ value_virtual_fn_field 712,18047
version.c,0
expread.y,617
-_initialize_expread 1757,40919
-copy_name 1439,33557
+_initialize_expread 1758,40995
+copy_name 1440,33633
end_arglist 830,19836
free_funcalls 844,20138
-length_of_subexp 1473,34461
-parse_c_1 1680,39165
-parse_c_expression 1725,40302
+length_of_subexp 1474,34537
+parse_c_1 1681,39241
+parse_c_expression 1726,40378
parse_number 999,23497
-pop_type 1749,40813
-prefixify_expression 1453,33893
-prefixify_subexp 1559,36093
-push_type 1736,40511
+pop_type 1750,40889
+prefixify_expression 1454,33969
+prefixify_subexp 1560,36169
+push_type 1737,40587
start_arglist 816,19477
write_exp_elt 864,20582
write_exp_elt_dblcst 911,21351
@@ -880,7 +883,7 @@ write_exp_elt_opcode 878,20912
write_exp_elt_sym 889,21061
write_exp_elt_type 922,21496
write_exp_string 947,21920
-yyerror 1430,33402
+yyerror 1431,33478
yylex 1140,26428
xgdb.c,449
@@ -948,21 +951,21 @@ store_inferior_registers 132,3168
write_inferior_memory 218,5717
sun3-dep.c,402
-#define IS_OBJECT_FILE(313,8593
-#define N_DATADDR(303,8150
-#define N_TXTADDR(299,8080
+#define IS_OBJECT_FILE(320,8666
+#define N_DATADDR(310,8223
+#define N_TXTADDR(306,8153
attach 102,2379
call_ptrace 49,1407
-core_file_command 402,10637
+core_file_command 409,10710
detach 118,2684
-exec_file_command 503,13724
+exec_file_command 510,13797
fetch_inferior_registers 130,2884
kill_inferior 55,1530
kill_inferior_fast 68,1763
-read_inferior_memory 203,5427
+read_inferior_memory 210,5500
resume 83,2049
store_inferior_registers 166,4024
-write_inferior_memory 241,6539
+write_inferior_memory 248,6612
sparc-dep.c,585
#define IS_OBJECT_FILE(447,11886
@@ -972,54 +975,57 @@ attach 201,4808
call_ptrace 56,1547
core_file_command 537,13933
detach 217,5113
-do_restore_insn 877,23985
-do_save_insn 833,22733
+do_restore_insn 879,24031
+do_save_insn 835,22779
exec_file_command 655,17493
fetch_inferior_registers 229,5313
-frame_saved_pc 758,20229
-isannulled 983,26794
+frame_saved_pc 760,20275
+isannulled 985,26840
kill_inferior 63,1675
kill_inferior_fast 77,1913
read_inferior_memory 337,8720
resume 177,4387
-setup_arbitrary_frame 784,21093
+setup_arbitrary_frame 786,21139
single_step 112,2764
-skip_prologue 906,24717
+skip_prologue 908,24763
store_inferior_registers 269,6777
write_inferior_memory 375,9832
-hp9k320-dep.c,481
-#define INFERIOR_AR0(97,2239
-#define N_DATADDR(367,9261
-#define N_TXTADDR(363,9191
+hp9k320-dep.c,516
+#define INFERIOR_AR0(130,2835
+#define N_DATADDR(400,9857
+#define N_TXTADDR(396,9787
+attach 60,1582
call_ptrace 48,1357
-core_file_command 458,11314
-exec_file_command 565,14072
- fetch_inferior_register 103,2395
- fetch_inferior_registers 188,4353
-kill_inferior 54,1477
-kill_inferior_fast 67,1710
-read_inferior_memory 256,6284
- resume 82,1996
- store_inferior_register 156,3596
- store_inferior_register_1 134,3103
-store_inferior_registers 211,5018
-write_inferior_memory 294,7396
-
-hp300bsd-dep.c,363
-#define N_DATADDR(288,7455
-#define N_SET_MAGIC(43,1174
-#define N_TXTADDR(284,7385
-call_ptrace 55,1488
-core_file_command 377,9485
-exec_file_command 470,11771
-fetch_inferior_registers 105,2414
-kill_inferior 61,1611
-kill_inferior_fast 74,1850
-read_inferior_memory 184,4585
-resume 89,2142
-store_inferior_registers 132,3189
-write_inferior_memory 222,5705
+core_file_command 491,11910
+detach 76,1883
+exec_file_command 598,14668
+ fetch_inferior_register 136,2991
+ fetch_inferior_registers 221,4949
+kill_inferior 87,2073
+kill_inferior_fast 100,2306
+read_inferior_memory 289,6880
+ resume 115,2592
+ store_inferior_register 189,4192
+ store_inferior_register_1 167,3699
+store_inferior_registers 244,5614
+write_inferior_memory 327,7992
+
+hp300bsd-dep.c,399
+#define N_DATADDR(294,7822
+#define N_SET_MAGIC(42,1186
+#define N_TXTADDR(290,7752
+_initialize_hp300bsd_dep 601,15509
+call_ptrace 58,1571
+core_file_command 385,9875
+exec_file_command 495,12806
+fetch_inferior_registers 108,2497
+kill_inferior 64,1694
+kill_inferior_fast 77,1933
+read_inferior_memory 187,4668
+resume 92,2225
+store_inferior_registers 135,3272
+write_inferior_memory 233,6185
news-dep.c,352
#define N_DATADDR(310,8075
@@ -1027,7 +1033,7 @@ news-dep.c,352
call_ptrace 45,1330
core_file_command 401,10128
exec_file_command 493,12408
-execle(629,15592
+execle(631,15638
fetch_inferior_registers 95,2228
kill_inferior 51,1453
kill_inferior_fast 64,1686
@@ -1041,126 +1047,126 @@ i386-dep.c,1091
#define N_SET_MAGIC(45,1190
#define N_SET_MAGIC(47,1250
#define N_TXTADDR(274,6920
-#define U_FPSTATE(1200,29992
+#define U_FPSTATE(1202,30038
call_ptrace 62,1570
-codestream_fill 578,14567
-#define codestream_get(574,14433
-#define codestream_peek(572,14324
-codestream_read 605,15129
-codestream_seek 595,14935
-#define codestream_tell(571,14263
+codestream_fill 580,14613
+#define codestream_get(576,14479
+#define codestream_peek(574,14370
+codestream_read 607,15175
+codestream_seek 597,14981
+#define codestream_tell(573,14309
core_file_command 365,8994
-double_to_i387 1039,26003
+double_to_i387 1041,26049
exec_file_command 459,11340
fetch_inferior_registers 112,2468
-i386_float_info 1203,30033
-i386_follow_jump 617,15344
-i386_frame_find_saved_regs 858,21492
-i386_frame_num_args 780,19198
-i386_get_frame_setup 666,16376
-i386_pop_frame 949,23489
-i386_push_dummy_frame 936,23133
-i386_register_u_addr 988,24486
-i386_skip_prologue 909,22630
-i387_to_double 1009,25052
+i386_float_info 1205,30079
+i386_follow_jump 619,15390
+i386_frame_find_saved_regs 860,21538
+i386_frame_num_args 782,19244
+i386_get_frame_setup 668,16422
+i386_pop_frame 951,23535
+i386_push_dummy_frame 938,23179
+i386_register_u_addr 990,24532
+i386_skip_prologue 911,22676
+i387_to_double 1011,25098
kill_inferior 68,1693
kill_inferior_fast 81,1926
-print_387_control_word 1073,26710
-print_387_status 1136,28443
-print_387_status_word 1110,27738
+print_387_control_word 1075,26756
+print_387_status 1138,28489
+print_387_status_word 1112,27784
read_inferior_memory 179,4266
resume 96,2212
-static unsigned char codestream_buf[sizeof 567,14157
+static unsigned char codestream_buf[sizeof 569,14203
store_inferior_registers 139,3227
write_inferior_memory 217,5378
symmetry-dep.c,1106
-#define I386_REGNO_TO_SYMMETRY(698,18016
+#define I386_REGNO_TO_SYMMETRY(700,18062
#define N_DATADDR(343,9198
#define N_TXTADDR(339,9128
attach 114,2677
call_ptrace 59,1703
-codestream_fill 652,16972
-#define codestream_get(647,16837
-#define codestream_peek(645,16728
-codestream_read 679,17534
-codestream_seek 669,17340
-#define codestream_tell(644,16667
+codestream_fill 654,17018
+#define codestream_get(649,16883
+#define codestream_peek(647,16774
+codestream_read 681,17580
+codestream_seek 671,17386
+#define codestream_tell(646,16713
core_file_command 432,11245
detach 130,2982
-double_to_i387 1048,26920
+double_to_i387 1050,26966
exec_file_command 525,13637
fetch_inferior_registers(208,4989
-i386_float_info 994,25379
-i386_follow_jump 1159,29727
-i386_frame_find_saved_regs 702,18143
-i386_get_frame_setup 1065,27297
-i386_skip_prologue 1203,30603
-i387_to_double 1018,25969
+i386_float_info 996,25425
+i386_follow_jump 1161,29773
+i386_frame_find_saved_regs 704,18189
+i386_get_frame_setup 1067,27343
+i386_skip_prologue 1205,30649
+i387_to_double 1020,26015
kill_inferior 67,1828
kill_inferior_fast 80,2061
-print_1167_control_word(875,22691
-print_1167_regs(950,24720
-print_387_control_word 754,19292
-print_387_status_word 791,20320
-print_fpa_status(979,25128
-print_fpu_status(816,21067
+print_1167_control_word(877,22737
+print_1167_regs(952,24766
+print_387_control_word 756,19338
+print_387_status_word 793,20366
+print_fpa_status(981,25174
+print_fpu_status(818,21113
read_inferior_memory 242,6503
resume 95,2347
-round(625,16334
-static unsigned char codestream_buf[sizeof 640,16561
+round(627,16380
+static unsigned char codestream_buf[sizeof 642,16607
store_inferior_registers(142,3178
-symmetry_extract_return_value(1230,31106
+symmetry_extract_return_value(1232,31152
write_inferior_memory 278,7596
convex-dep.c,1325
-_initialize_convex_dep 1883,49453
-alias_command 1562,40922
-attach 415,10525
-call_ptrace 297,7803
-comm_registers_info 1770,46540
-convex_cont_command 1749,45982
-core_file_command 891,22904
-create_inferior_hook 390,9929
-decout 1451,38265
-detach 437,10953
-exec_file_command 1061,27835
-execle 308,8054
-fetch_inferior_registers 328,8477
-is_trapped_internalvar 1323,34556
-kill_inferior 450,11200
-kill_inferior_fast 463,11439
-one_cont_command 1759,46207
-print_maps 1256,32700
-psw_info 1823,47727
-static ptr_cmp 1302,33801
-read_comm_register 576,14234
-read_inferior_memory 346,8915
-read_vector_register 476,11674
-read_vector_register_1 513,12817
-resume 616,15286
-scan_stack 856,22194
-select_thread 838,21692
-set_base_command 1494,39297
-set_fixed_scheduling 882,22743
-set_parallel_command 1532,40135
-set_pipelining_command 1513,39651
-set_thread_command 1717,45229
-set_trapped_internalvar 1423,37354
-static sig_noop 321,8315
+_initialize_convex_dep 1881,49440
+alias_command 1562,40924
+attach 414,10521
+call_ptrace 296,7799
+comm_registers_info 1770,46542
+convex_cont_command 1749,45984
+core_file_command 891,22906
+create_inferior_hook 389,9925
+decout 1451,38267
+detach 436,10949
+exec_file_command 1061,27837
+execle 307,8050
+fetch_inferior_registers 327,8473
+is_trapped_internalvar 1323,34558
+kill_inferior 449,11196
+kill_inferior_fast 462,11435
+one_cont_command 1759,46209
+print_maps 1256,32702
+psw_info 1822,47715
+static ptr_cmp 1302,33803
+read_comm_register 575,14230
+read_inferior_memory 345,8911
+read_vector_register 475,11670
+read_vector_register_1 512,12813
+resume 615,15282
+scan_stack 856,22196
+select_thread 838,21694
+set_base_command 1494,39299
+set_fixed_scheduling 882,22745
+set_parallel_command 1532,40137
+set_pipelining_command 1513,39653
+set_thread_command 1717,45231
+set_trapped_internalvar 1423,37356
+static sig_noop 320,8311
#define signal_stack_is_empty(164,4341
-store_inferior_registers 335,8634
-subsig_name 1650,43201
-thread_continue 643,16080
-thread_info 1620,42331
-threadstat 1699,44828
-value_of_trapped_internalvar 1345,35101
-vector_type 1408,36928
-wait 721,18383
-write_comm_register 595,14751
-write_inferior_memory 374,9507
-write_vector_register 534,13349
-xfer_core_file 1153,30129
+store_inferior_registers 334,8630
+subsig_name 1650,43203
+thread_continue 642,16076
+thread_info 1620,42333
+threadstat 1699,44830
+value_of_trapped_internalvar 1345,35103
+vector_type 1408,36930
+wait 721,18385
+write_comm_register 594,14747
+write_inferior_memory 373,9503
+write_vector_register 533,13345
+xfer_core_file 1153,30131
altos-dep.c,363
#define N_DATADDR(279,7070
@@ -1194,6 +1200,25 @@ resume 154,3621
store_inferior_registers 197,4652
write_inferior_memory 275,6803
+pyr-dep.c,508
+#define N_DATADDR(363,10228
+#define N_SET_MAGIC(34,1072
+#define N_TXTADDR(359,10158
+call_ptrace 47,1407
+core_file_command 463,12556
+exec_file_command 637,17502
+fetch_inferior_registers 97,2305
+CORE_ADDR frame_args_addr 797,21812
+CORE_ADDR frame_locals_address 772,20968
+kill_inferior 53,1530
+kill_inferior_fast 66,1763
+pyr_do_registers_info 741,20158
+pyr_print_registers(713,19288
+read_inferior_memory 230,6369
+resume 81,2049
+store_inferior_registers 190,5381
+write_inferior_memory 276,7860
+
gld-pinsn.c,79
findarg(193,4447
findframe(223,5160
@@ -1247,15 +1272,15 @@ m68k-pinsn.c,408
#define NEXTPACKED(63,1837
#define NEXTSINGLE(53,1604
#define NEXTWORD(47,1444
-_initialize_pinsn(864,19795
+_initialize_pinsn(870,19950
convert_from_68881 789,18309
-convert_to_68881 825,19086
+convert_to_68881 828,19162
fetch_arg 574,13657
print_base 763,17494
print_indexed 673,15446
print_insn 73,2231
print_insn_arg 167,4704
-sigemt(857,19730
+sigemt(863,19885
ns32k-pinsn.c,300
#define Adrmod_is_index(132,2910
@@ -1277,6 +1302,13 @@ int print_effa 284,7421
print_insn 115,3284
#define reg(30,1039
+pyr-pinsn.c,162
+#define NEXTLONG(71,2182
+print_insn 79,2408
+CORE_ADDR pyr_frame_chain(39,1377
+CORE_ADDR pyr_saved_pc(47,1568
+/*const*/ static int nopcodes = (sizeof 62,1938
+
command.h,0
defs.h,40
@@ -1438,34 +1470,34 @@ a.out.encap.h,279
#define N_TXTADDR(122,3686
#define _N_HDROFF(118,3518
-a.out.gnu.h,515
-#define N_BADMAG(57,1758
-#define N_BSSADDR(107,3102
-#define N_DATADDR(101,2883
-#define N_DATOFF(70,2129
-#define N_DRELOFF(74,2226
-#define N_FLAGS(34,1001
-#define N_MACHTYPE(33,924
-#define N_MAGIC(32,877
-#define N_SET_FLAGS(46,1439
-#define N_SET_INFO(35,1054
-#define N_SET_MACHTYPE(42,1312
-#define N_SET_MAGIC(39,1205
-#define N_STROFF(78,2329
-#define N_SYMOFF(76,2278
-#define N_TRELOFF(72,2177
-#define N_TXTADDR(81,2438
-#define N_TXTOFF(67,2019
-#define _N_BADMAG(61,1862
-#define _N_HDROFF(65,1967
+a.out.gnu.h,521
+#define N_BADMAG(76,2045
+#define N_BSSADDR(142,3681
+#define N_DATADDR(135,3437
+#define N_DATOFF(93,2478
+#define N_DRELOFF(101,2639
+#define N_FLAGS(52,1264
+#define N_MACHTYPE(51,1187
+#define N_MAGIC(49,1133
+#define N_SET_FLAGS(64,1702
+#define N_SET_INFO(53,1317
+#define N_SET_MACHTYPE(60,1575
+#define N_SET_MAGIC(57,1468
+#define N_STROFF(109,2804
+#define N_SYMOFF(105,2722
+#define N_TRELOFF(97,2558
+#define N_TXTADDR(114,2945
+#define N_TXTOFF(88,2337
+#define _N_BADMAG(81,2156
+#define _N_HDROFF(85,2261
stab.gnu.h,28
#define __define_stab(7,87
m68k-opcode.h,138
#define one(193,7500
-int numopcodes=sizeof(1675,87045
-struct m68k_opcode *endop = m68k_opcodes+sizeof(1677,87107
+int numopcodes=sizeof(1678,87218
+struct m68k_opcode *endop = m68k_opcodes+sizeof(1680,87280
#define two(194,7527
pn-opcode.h,94
@@ -1484,24 +1516,26 @@ ns32k-opcode.h,0
convex-opcode.h,0
+pyr-opcode.h,0
+
m-hp9k320.h,1101
#define ABOUT_TO_RETURN(117,3264
#define EXTRACT_RETURN_VALUE(232,7243
#define EXTRACT_STRUCT_VALUE_ADDRESS(245,7750
-#define FIX_CALL_DUMMY(480,17969
+#define FIX_CALL_DUMMY(484,18046
#define FP_REGISTER_ADDR(254,8118
-#define FRAMELESS_FUNCTION_INVOCATION(292,9563
-#define FRAME_ARGS_ADDRESS(297,9741
-#define FRAME_CHAIN(277,9015
-#define FRAME_CHAIN_COMBINE(285,9271
-#define FRAME_CHAIN_VALID(282,9154
-#define FRAME_FIND_SAVED_REGS(333,11110
-#define FRAME_LOCALS_ADDRESS(299,9787
-#define FRAME_NUM_ARGS(306,10045
-#define FRAME_NUM_ARGS(309,10094
-#define FRAME_SAVED_PC(295,9664
-#define INIT_STACK(506,18793
-#define INIT_STACK(544,20002
+#define FRAMELESS_FUNCTION_INVOCATION(296,9640
+#define FRAME_ARGS_ADDRESS(301,9818
+#define FRAME_CHAIN(281,9092
+#define FRAME_CHAIN_COMBINE(289,9348
+#define FRAME_CHAIN_VALID(286,9231
+#define FRAME_FIND_SAVED_REGS(337,11187
+#define FRAME_LOCALS_ADDRESS(303,9864
+#define FRAME_NUM_ARGS(310,10122
+#define FRAME_NUM_ARGS(313,10171
+#define FRAME_SAVED_PC(299,9741
+#define INIT_STACK(510,18870
+#define INIT_STACK(548,20079
#define INVALID_FLOAT(121,3398
#define REGISTER_ADDR(247,7815
#define REGISTER_BYTE(168,5080
@@ -1516,66 +1550,68 @@ m-hp9k320.h,1101
#define STORE_RETURN_VALUE(238,7447
#define STORE_STRUCT_RETURN(225,7004
-m-hp300bsd.h,1067
-#define ABOUT_TO_RETURN(101,2834
-#define EXTRACT_RETURN_VALUE(219,6991
-#define EXTRACT_STRUCT_VALUE_ADDRESS(232,7498
-#define FIX_CALL_DUMMY(482,18337
-#define FRAMELESS_FUNCTION_INVOCATION(294,9929
-#define FRAME_ARGS_ADDRESS(299,10107
-#define FRAME_CHAIN(279,9383
-#define FRAME_CHAIN_COMBINE(287,9637
-#define FRAME_CHAIN_VALID(284,9520
-#define FRAME_FIND_SAVED_REGS(335,11477
-#define FRAME_LOCALS_ADDRESS(301,10153
-#define FRAME_NUM_ARGS(308,10411
-#define FRAME_NUM_ARGS(311,10460
-#define FRAME_SAVED_PC(297,10030
-#define INIT_STACK(506,19143
-#define INVALID_FLOAT(105,2968
-#define REGISTER_BYTE(153,4701
-#define REGISTER_CONVERTIBLE(183,5759
-#define REGISTER_CONVERT_TO_RAW(197,6222
-#define REGISTER_CONVERT_TO_VIRTUAL(188,5926
-#define REGISTER_RAW_SIZE(164,5163
-#define REGISTER_U_ADDR(244,7954
-#define REGISTER_VIRTUAL_SIZE(170,5419
-#define REGISTER_VIRTUAL_TYPE(206,6503
+m-hp300bsd.h,1128
+#define ABOUT_TO_RETURN(112,3373
+#define EXTRACT_RETURN_VALUE(230,7530
+#define EXTRACT_STRUCT_VALUE_ADDRESS(243,8037
+#define FIX_CALL_DUMMY(493,18876
+#define FRAMELESS_FUNCTION_INVOCATION(305,10468
+#define FRAME_ARGS_ADDRESS(310,10646
+#define FRAME_CHAIN(290,9922
+#define FRAME_CHAIN_COMBINE(298,10176
+#define FRAME_CHAIN_VALID(295,10059
+#define FRAME_FIND_SAVED_REGS(346,12016
+#define FRAME_LOCALS_ADDRESS(312,10692
+#define FRAME_NUM_ARGS(319,10950
+#define FRAME_NUM_ARGS(322,10999
+#define FRAME_SAVED_PC(308,10569
+#define INIT_STACK(517,19682
+#define INVALID_FLOAT(116,3507
+#define IN_SIGTRAMP(87,2743
+#define REGISTER_BYTE(164,5240
+#define REGISTER_CONVERTIBLE(194,6298
+#define REGISTER_CONVERT_TO_RAW(208,6761
+#define REGISTER_CONVERT_TO_VIRTUAL(199,6465
+#define REGISTER_RAW_SIZE(175,5702
+#define REGISTER_U_ADDR(255,8493
+#define REGISTER_VIRTUAL_SIZE(181,5958
+#define REGISTER_VIRTUAL_TYPE(217,7042
#define SAVED_PC_AFTER_CALL(73,2160
#define SKIP_PROLOGUE(60,1724
-#define STORE_RETURN_VALUE(225,7195
-#define STORE_STRUCT_RETURN(212,6752
-#define vprintf(236,7634
-
-m-i386.h,1025
-#define ABOUT_TO_RETURN(119,3253
-#define EXTRACT_RETURN_VALUE(234,6801
-#define EXTRACT_STRUCT_VALUE_ADDRESS(247,7308
-#define FIX_CALL_DUMMY(330,10061
-#define FRAMELESS_FUNCTION_INVOCATION(278,8412
-#define FRAME_ARGS_ADDRESS(283,8590
-#define FRAME_CHAIN(263,7867
-#define FRAME_CHAIN_COMBINE(271,8120
-#define FRAME_CHAIN_VALID(268,8003
-#define FRAME_FIND_SAVED_REGS(302,9280
-#define FRAME_LOCALS_ADDRESS(285,8636
-#define FRAME_NUM_ARGS(290,8775
-#define FRAME_SAVED_PC(281,8513
-#define INIT_STACK(361,10949
-#define INVALID_FLOAT(124,3443
-#define REGISTER_BYTE(183,5301
-#define REGISTER_CONVERTIBLE(206,5845
-#define REGISTER_CONVERT_TO_RAW(216,6160
-#define REGISTER_CONVERT_TO_VIRTUAL(211,5981
-#define REGISTER_RAW_SIZE(188,5426
-#define REGISTER_U_ADDR(173,4961
-#define REGISTER_VIRTUAL_SIZE(193,5545
-#define REGISTER_VIRTUAL_TYPE(221,6326
-#define SAVED_PC_AFTER_CALL(91,2581
-#define SKIP_PROLOGUE(84,2284
-#define STORE_RETURN_VALUE(240,7005
-#define STORE_STRUCT_RETURN(226,6515
-#define vfork(39,1134
+#define STORE_RETURN_VALUE(236,7734
+#define STORE_STRUCT_RETURN(223,7291
+#define my_offsetof(82,2473
+#define vprintf(247,8173
+
+m-i386.h,1026
+#define ABOUT_TO_RETURN(132,3931
+#define EXTRACT_RETURN_VALUE(247,7479
+#define EXTRACT_STRUCT_VALUE_ADDRESS(260,7986
+#define FIX_CALL_DUMMY(343,10739
+#define FRAMELESS_FUNCTION_INVOCATION(291,9090
+#define FRAME_ARGS_ADDRESS(296,9268
+#define FRAME_CHAIN(276,8545
+#define FRAME_CHAIN_COMBINE(284,8798
+#define FRAME_CHAIN_VALID(281,8681
+#define FRAME_FIND_SAVED_REGS(315,9958
+#define FRAME_LOCALS_ADDRESS(298,9314
+#define FRAME_NUM_ARGS(303,9453
+#define FRAME_SAVED_PC(294,9191
+#define INIT_STACK(374,11627
+#define INVALID_FLOAT(137,4121
+#define REGISTER_BYTE(196,5979
+#define REGISTER_CONVERTIBLE(219,6523
+#define REGISTER_CONVERT_TO_RAW(229,6838
+#define REGISTER_CONVERT_TO_VIRTUAL(224,6659
+#define REGISTER_RAW_SIZE(201,6104
+#define REGISTER_U_ADDR(186,5639
+#define REGISTER_VIRTUAL_SIZE(206,6223
+#define REGISTER_VIRTUAL_TYPE(234,7004
+#define SAVED_PC_AFTER_CALL(104,3259
+#define SKIP_PROLOGUE(97,2962
+#define STORE_RETURN_VALUE(253,7683
+#define STORE_STRUCT_RETURN(239,7193
+#define vfork(52,1812
m-i386gas.h,0
@@ -1617,34 +1653,34 @@ m-isi.h,1086
#define STORE_STRUCT_RETURN(229,7665
#define vprintf(387,14431
-m-merlin.h,980
-#define ABOUT_TO_RETURN(90,2631
-#define EXTRACT_RETURN_VALUE(241,7793
-#define EXTRACT_STRUCT_VALUE_ADDRESS(254,8300
-#define FIX_CALL_DUMMY(406,13667
-#define FRAME_ARGS_ADDRESS(287,9473
-#define FRAME_CHAIN(272,9006
-#define FRAME_CHAIN_COMBINE(280,9260
-#define FRAME_CHAIN_VALID(277,9143
-#define FRAME_FIND_SAVED_REGS(329,10838
-#define FRAME_LOCALS_ADDRESS(289,9519
-#define FRAME_NUM_ARGS(294,9658
-#define FRAME_SAVED_PC(284,9364
-#define INIT_STACK(435,14654
-#define INVALID_FLOAT(94,2763
-#define REGISTER_BYTE(179,5817
-#define REGISTER_CONVERTIBLE(205,6639
-#define REGISTER_CONVERT_TO_RAW(216,6982
-#define REGISTER_CONVERT_TO_VIRTUAL(210,6773
-#define REGISTER_RAW_SIZE(186,6090
-#define REGISTER_U_ADDR(143,4420
-#define REGISTER_VIRTUAL_SIZE(192,6315
-#define REGISTER_VIRTUAL_TYPE(222,7178
-#define SAVED_PC_AFTER_CALL(62,1962
-#define SKIP_PROLOGUE(48,1465
-#define STORE_RETURN_VALUE(247,7997
-#define STORE_STRUCT_RETURN(235,7590
-#define vprintf(349,11691
+m-merlin.h,981
+#define ABOUT_TO_RETURN(98,2971
+#define EXTRACT_RETURN_VALUE(249,8133
+#define EXTRACT_STRUCT_VALUE_ADDRESS(262,8640
+#define FIX_CALL_DUMMY(414,14007
+#define FRAME_ARGS_ADDRESS(295,9813
+#define FRAME_CHAIN(280,9346
+#define FRAME_CHAIN_COMBINE(288,9600
+#define FRAME_CHAIN_VALID(285,9483
+#define FRAME_FIND_SAVED_REGS(337,11178
+#define FRAME_LOCALS_ADDRESS(297,9859
+#define FRAME_NUM_ARGS(302,9998
+#define FRAME_SAVED_PC(292,9704
+#define INIT_STACK(443,14994
+#define INVALID_FLOAT(102,3103
+#define REGISTER_BYTE(187,6157
+#define REGISTER_CONVERTIBLE(213,6979
+#define REGISTER_CONVERT_TO_RAW(224,7322
+#define REGISTER_CONVERT_TO_VIRTUAL(218,7113
+#define REGISTER_RAW_SIZE(194,6430
+#define REGISTER_U_ADDR(151,4760
+#define REGISTER_VIRTUAL_SIZE(200,6655
+#define REGISTER_VIRTUAL_TYPE(230,7518
+#define SAVED_PC_AFTER_CALL(70,2302
+#define SKIP_PROLOGUE(56,1805
+#define STORE_RETURN_VALUE(255,8337
+#define STORE_STRUCT_RETURN(243,7930
+#define vprintf(357,12031
m-altos.h,1249
#define ABOUT_TO_RETURN(149,3914
@@ -1780,38 +1816,40 @@ m-pn.h,1077
#define STORE_RETURN_VALUE(318,11200
#define STORE_STRUCT_RETURN(306,10794
-m-sparc.h,1162
-#define ABOUT_TO_RETURN(108,3543
-#define EXTRACT_RETURN_VALUE(243,8214
-#define EXTRACT_STRUCT_VALUE_ADDRESS(256,8805
-#define FIX_CALL_DUMMY(668,25292
-#define FRAMELESS_FUNCTION_INVOCATION(330,11399
-#define FRAME_ARGS_ADDRESS(338,11655
-#define FRAME_CHAIN(317,10906
-#define FRAME_CHAIN_COMBINE(323,11107
-#define FRAME_CHAIN_VALID(320,10990
-#define FRAME_FIND_SAVED_REGS(372,13037
-#define FRAME_LOCALS_ADDRESS(342,11754
-#define FRAME_NUM_ARGS(349,12012
-#define FRAME_SAVED_PC(335,11544
-#define FRAME_STRUCT_ARGS_ADDRESS(340,11701
-#define GET_RWINDOW_REG(276,9300
-#define INIT_EXTRA_FRAME_INFO(310,10692
-#define INVALID_FLOAT(113,3698
-#define PC_ADJUST(78,2670
-#define REGISTER_BYTE(172,6081
-#define REGISTER_CONVERTIBLE(212,7216
-#define REGISTER_CONVERT_TO_RAW(223,7535
-#define REGISTER_CONVERT_TO_VIRTUAL(217,7352
-#define REGISTER_IN_WINDOW_P(184,6542
-#define REGISTER_RAW_SIZE(192,6752
-#define REGISTER_VIRTUAL_SIZE(199,6916
-#define REGISTER_VIRTUAL_TYPE(229,7705
-#define SAVED_PC_AFTER_CALL(81,2773
-#define SKIP_PROLOGUE(66,2226
-#define STACK_ALIGN(92,3028
-#define STORE_RETURN_VALUE(249,8486
-#define STORE_STRUCT_RETURN(236,7963
+m-sparc.h,1242
+#define ABOUT_TO_RETURN(120,4161
+#define EXTRACT_RETURN_VALUE(255,8832
+#define EXTRACT_STRUCT_VALUE_ADDRESS(285,10282
+#define FIX_CALL_DUMMY(697,26769
+#define FRAMELESS_FUNCTION_INVOCATION(359,12876
+#define FRAME_ARGS_ADDRESS(367,13132
+#define FRAME_CHAIN(346,12383
+#define FRAME_CHAIN_COMBINE(352,12584
+#define FRAME_CHAIN_VALID(349,12467
+#define FRAME_FIND_SAVED_REGS(401,14514
+#define FRAME_LOCALS_ADDRESS(371,13231
+#define FRAME_NUM_ARGS(378,13489
+#define FRAME_SAVED_PC(364,13021
+#define FRAME_STRUCT_ARGS_ADDRESS(369,13178
+#define GET_RWINDOW_REG(305,10777
+#define INIT_EXTRA_FRAME_INFO(339,12169
+#define INVALID_FLOAT(125,4316
+#define PC_ADJUST(90,3288
+#define REGISTER_BYTE(184,6699
+#define REGISTER_CONVERTIBLE(224,7834
+#define REGISTER_CONVERT_TO_RAW(235,8153
+#define REGISTER_CONVERT_TO_VIRTUAL(229,7970
+#define REGISTER_IN_WINDOW_P(196,7160
+#define REGISTER_RAW_SIZE(204,7370
+#define REGISTER_VIRTUAL_SIZE(211,7534
+#define REGISTER_VIRTUAL_TYPE(241,8323
+#define REG_STRUCT_HAS_ADDR(54,1937
+#define SAVED_PC_AFTER_CALL(93,3391
+#define SKIP_PROLOGUE(78,2844
+#define STACK_ALIGN(104,3646
+#define STORE_RETURN_VALUE(269,9450
+#define STORE_STRUCT_RETURN(248,8581
+#define STRUCT_ARG_SYM_GARBAGE(55,1981
m-sun2.h,1033
#define ABOUT_TO_RETURN(87,2526
@@ -1969,41 +2007,75 @@ m-symmetry.h,1043
#define STORE_STRUCT_RETURN(340,10541
#define vprintf(366,11512
-m-convex.h,1245
-#define ABOUT_TO_RETURN(169,5578
-#define EXTRACT_RETURN_VALUE(297,9649
-#define EXTRACT_STRUCT_VALUE_ADDRESS(312,10243
-#define FIX_CALL_DUMMY(566,20487
-#define FRAMELESS_FUNCTION_INVOCATION(385,12786
-#define FRAME_ARGS_ADDRESS(395,13148
-#define FRAME_CHAIN(370,12212
-#define FRAME_CHAIN_COMBINE(375,12399
-#define FRAME_CHAIN_VALID(372,12282
-#define FRAME_FIND_SAVED_REGS(424,14435
-#define FRAME_LOCALS_ADDRESS(397,13224
-#define FRAME_NUM_ARGS(402,13361
-#define FRAME_SAVED_PC(393,13081
-#define IGNORE_SYMBOL(61,1855
-#define IGNORE_SYMBOL(66,2028
-#define INVALID_FLOAT(174,5728
-#define READ_FILE_HEADERS(587,21192
-#define READ_STRING_TABLE_SIZE(579,21017
-#define REGISTER_BYTE(242,7925
-#define REGISTER_CONVERTIBLE(267,8631
-#define REGISTER_CONVERT_TO_RAW(278,8972
-#define REGISTER_CONVERT_TO_VIRTUAL(272,8765
-#define REGISTER_RAW_SIZE(249,8171
-#define REGISTER_VIRTUAL_SIZE(254,8314
-#define REGISTER_VIRTUAL_TYPE(284,9165
-#define SAVED_PC_AFTER_CALL(127,4104
-#define SKIP_PROLOGUE(103,3126
-#define STAB_REG_TO_REGNUM(221,7242
-#define STORE_RETURN_VALUE(305,9931
-#define STORE_STRUCT_RETURN(290,9402
-#define is_arith_pc(142,4731
-#define is_break_pc(143,4805
-#define is_trace_pc(141,4657
-#define vprintf(317,10425
+m-convex.h,1255
+#define ABOUT_TO_RETURN(164,5490
+#define EXTRACT_RETURN_VALUE(292,9561
+#define EXTRACT_STRUCT_VALUE_ADDRESS(307,10155
+#define FIX_CALL_DUMMY(564,20654
+#define FRAMELESS_FUNCTION_INVOCATION(383,12953
+#define FRAME_ARGS_ADDRESS(393,13315
+#define FRAME_CHAIN(368,12379
+#define FRAME_CHAIN_COMBINE(373,12566
+#define FRAME_CHAIN_VALID(370,12449
+#define FRAME_FIND_SAVED_REGS(422,14602
+#define FRAME_LOCALS_ADDRESS(395,13391
+#define FRAME_NUM_ARGS(400,13528
+#define FRAME_SAVED_PC(391,13248
+#define IGNORE_SYMBOL(61,1926
+#define INVALID_FLOAT(169,5640
+#define READ_FILE_HEADERS(585,21359
+#define READ_STRING_TABLE_SIZE(577,21184
+#define REGISTER_BYTE(237,7837
+#define REGISTER_CONVERTIBLE(262,8543
+#define REGISTER_CONVERT_TO_RAW(273,8884
+#define REGISTER_CONVERT_TO_VIRTUAL(267,8677
+#define REGISTER_RAW_SIZE(244,8083
+#define REGISTER_VIRTUAL_SIZE(249,8226
+#define REGISTER_VIRTUAL_TYPE(279,9077
+#define SAVED_PC_AFTER_CALL(122,4016
+#define SKIP_PROLOGUE(98,3038
+#define STAB_REG_TO_REGNUM(216,7154
+#define STORE_RETURN_VALUE(300,9843
+#define STORE_STRUCT_RETURN(285,9314
+#define VARIABLES_INSIDE_BLOCK(345,11602
+#define is_arith_pc(137,4643
+#define is_break_pc(138,4717
+#define is_trace_pc(136,4569
+#define vprintf(312,10337
+
+m-pyr.h,1197
+#define ABOUT_TO_RETURN(161,5545
+#define DO_REGISTERS_INFO(229,8251
+#define EXTRACT_RETURN_VALUE(349,12330
+#define EXTRACT_STRUCT_VALUE_ADDRESS(363,12932
+#define FIX_CALL_DUMMY(605,22297
+#define FRAME_ARGS_ADDRESS(442,15805
+#define FRAME_ARGS_ADDRESS(451,16011
+#define FRAME_CHAIN(405,14368
+#define FRAME_CHAIN_COMBINE(413,14615
+#define FRAME_CHAIN_VALID(408,14455
+#define FRAME_FIND_SAVED_REGS(491,17613
+#define FRAME_LOCALS_ADDRESS(445,15861
+#define FRAME_LOCALS_ADDRESS(454,16105
+#define FRAME_NUM_ARGS(462,16272
+#define FRAME_SAVED_PC(430,15262
+#define INIT_EXTRA_FRAME_INFO(377,13325
+#define INVALID_FLOAT(170,5940
+#define REGISTER_BYTE(289,10449
+#define REGISTER_CONVERTIBLE(312,11070
+#define REGISTER_CONVERT_TO_RAW(323,11385
+#define REGISTER_CONVERT_TO_VIRTUAL(317,11204
+#define REGISTER_IN_WINDOW_P(283,10290
+#define REGISTER_RAW_SIZE(294,10615
+#define REGISTER_U_ADDR(240,8652
+#define REGISTER_VIRTUAL_SIZE(299,10772
+#define REGISTER_VIRTUAL_TYPE(329,11553
+#define SAVED_PC_AFTER_CALL(109,3770
+#define SKIP_PROLOGUE(101,3504
+#define STACK_ALIGN(144,5027
+#define STORE_RETURN_VALUE(356,12594
+#define STORE_STRUCT_RETURN(338,11861
+#define vprintf(367,13067
obstack.h,1102
#define __INT_TO_PTR(121,5178
diff --git a/gdb/a.out.gnu.h b/gdb/a.out.gnu.h
index e1de8f9..81abb52 100644
--- a/gdb/a.out.gnu.h
+++ b/gdb/a.out.gnu.h
@@ -21,15 +21,33 @@ struct exec
/* these go in the N_MACHTYPE field */
enum machine_type {
+#if defined (M_OLDSUN2)
+ M__OLDSUN2 = M_OLDSUN2,
+#else
M_OLDSUN2 = 0,
+#endif
+#if defined (M_68010)
+ M__68010 = M_68010,
+#else
M_68010 = 1,
+#endif
+#if defined (M_68020)
+ M__68020 = M_68020,
+#else
M_68020 = 2,
+#endif
+#if defined (M_SPARC)
+ M__SPARC = M_SPARC
+#else
M_SPARC = 3,
+#endif
/* skip a bunch so we don't run into any of sun's numbers */
M_386 = 100,
};
+#if !defined (N_MAGIC)
#define N_MAGIC(exec) ((exec).a_info & 0xffff)
+#endif
#define N_MACHTYPE(exec) ((enum machine_type)(((exec).a_info >> 16) & 0xff))
#define N_FLAGS(exec) (((exec).a_info >> 24) & 0xff)
#define N_SET_INFO(exec, magic, type, flags) \
@@ -54,9 +72,11 @@ enum machine_type {
/* Code indicating demand-paged executable. */
#define ZMAGIC 0413
+#if !defined (N_BADMAG)
#define N_BADMAG(x) \
(N_MAGIC(x) != OMAGIC && N_MAGIC(x) != NMAGIC \
&& N_MAGIC(x) != ZMAGIC)
+#endif
#define _N_BADMAG(x) \
(N_MAGIC(x) != OMAGIC && N_MAGIC(x) != NMAGIC \
@@ -64,26 +84,40 @@ enum machine_type {
#define _N_HDROFF(x) (1024 - sizeof (struct exec))
+#if !defined (N_TXTOFF)
#define N_TXTOFF(x) \
(N_MAGIC(x) == ZMAGIC ? _N_HDROFF((x)) + sizeof (struct exec) : sizeof (struct exec))
+#endif
+#if !defined (N_DATOFF)
#define N_DATOFF(x) (N_TXTOFF(x) + (x).a_text)
+#endif
+#if !defined (N_TRELOFF)
#define N_TRELOFF(x) (N_DATOFF(x) + (x).a_data)
+#endif
+#if !defined (N_DRELOFF)
#define N_DRELOFF(x) (N_TRELOFF(x) + (x).a_trsize)
+#endif
+#if !defined (N_SYMOFF)
#define N_SYMOFF(x) (N_DRELOFF(x) + (x).a_drsize)
+#endif
+#if !defined (N_STROFF)
#define N_STROFF(x) (N_SYMOFF(x) + (x).a_syms)
+#endif
/* Address of text segment in memory after it is loaded. */
+#if !defined (N_TXTADDR)
#define N_TXTADDR(x) 0
+#endif
/* Address of data segment in memory after it is loaded.
Note that it is up to you to define SEGMENT_SIZE
on machines not listed here. */
-#ifdef vax
+#if defined(vax) || defined(hp300) || defined(pyr)
#define SEGMENT_SIZE page_size
#endif
#ifdef sony
@@ -104,8 +138,11 @@ enum machine_type {
#endif
/* Address of bss segment in memory after it is loaded. */
+#if !defined (N_BSSADDR)
#define N_BSSADDR(x) (N_DATADDR(x) + (x).a_data)
+#endif
+#if !defined (N_NLIST_DECLARED)
struct nlist {
union {
char *n_name;
@@ -117,17 +154,36 @@ struct nlist {
short n_desc;
unsigned long n_value;
};
+#endif /* no N_NLIST_DECLARED. */
+#if !defined (N_UNDF)
#define N_UNDF 0
+#endif
+#if !defined (N_ABS)
#define N_ABS 2
+#endif
+#if !defined (N_TEXT)
#define N_TEXT 4
+#endif
+#if !defined (N_DATA)
#define N_DATA 6
+#endif
+#if !defined (N_BSS)
#define N_BSS 8
+#endif
+#if !defined (N_FN)
#define N_FN 15
+#endif
+#if !defined (N_EXT)
#define N_EXT 1
+#endif
+#if !defined (N_TYPE)
#define N_TYPE 036
+#endif
+#if !defined (N_STAB)
#define N_STAB 0340
+#endif
/* The following type indicates the definition of a symbol as being
an indirect reference to another symbol. The other symbol
@@ -159,6 +215,7 @@ struct nlist {
/* This is output from LD. */
#define N_SETV 0x1C /* Pointer to set vector in data area. */
+#if !defined (N_RELOCATION_INFO_DECLARED)
/* This structure describes a single relocation to be performed.
The text-relocation section of the file is a vector of these structures,
all of which apply to the text section.
@@ -188,6 +245,7 @@ struct relocation_info
it is desirable to clear them. */
unsigned int r_pad:4;
};
+#endif /* no N_RELOCATION_INFO_DECLARED. */
#endif /* __A_OUT_GNU_H__ */
diff --git a/gdb/altos-dep.c b/gdb/altos-dep.c
index 1af6992..53d198f 100644
--- a/gdb/altos-dep.c
+++ b/gdb/altos-dep.c
@@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with GDB; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+#include <stdio.h>
#include "defs.h"
#include "param.h"
#include "frame.h"
@@ -27,7 +28,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <sys/types.h>
#endif
-#include <stdio.h>
#include <sys/param.h>
#include <sys/dir.h>
#include <signal.h>
@@ -526,10 +526,12 @@ exec_file_command (filename, from_tty)
if (read_aout_hdr (execchan, &exec_aouthdr, aout_hdrsize) < 0)
error ("\"%s\": can't read optional aouthdr", execfile);
- if (read_section_hdr (execchan, _TEXT, &text_hdr, num_sections) < 0)
+ if (read_section_hdr (execchan, _TEXT, &text_hdr, num_sections,
+ aout_hdrsize) < 0)
error ("\"%s\": can't read text section header", execfile);
- if (read_section_hdr (execchan, _DATA, &data_hdr, num_sections) < 0)
+ if (read_section_hdr (execchan, _DATA, &data_hdr, num_sections,
+ aout_hdrsize) < 0)
error ("\"%s\": can't read data section header", execfile);
text_start = exec_aouthdr.text_start;
diff --git a/gdb/blockframe.c b/gdb/blockframe.c
index 2817017..8563b23 100644
--- a/gdb/blockframe.c
+++ b/gdb/blockframe.c
@@ -180,7 +180,8 @@ get_frame_info (frame)
}
/* Return a structure containing various interesting information
- about the frame that called NEXT_FRAME. */
+ about the frame that called NEXT_FRAME. Returns NULL
+ if there is no such frame. */
struct frame_info *
get_prev_frame_info (next_frame)
@@ -302,9 +303,19 @@ get_frame_block (frame)
FRAME frame;
{
struct frame_info *fi;
+ CORE_ADDR pc;
fi = get_frame_info (frame);
- return block_for_pc (fi->pc);
+
+ pc = fi->pc;
+ if (fi->next_frame != 0)
+ /* We are not in the innermost frame. We need to subtract one to
+ get the correct block, in case the call instruction was the
+ last instruction of the block. If there are any machines on
+ which the saved pc does not point to after the call insn, we
+ probably want to make fi->pc point after the call insn anyway. */
+ --pc;
+ return block_for_pc (pc);
}
struct block *
@@ -431,15 +442,9 @@ find_pc_function (pc)
/* Finds the "function" (text symbol) that is smaller than PC
but greatest of all of the potential text symbols. Sets
*NAME and/or *ADDRESS conditionally if that pointer is non-zero.
- Returns 0 if it couldn't find anything, 1 if it did.
-
- Note that there are several possible responses:
- * Set *NAME and *ADDRESS to nonzero values and return 0
- * Set *NAME and *ADDRESS to zero and return 0
- * Don't set *NAME and *ADDRESS and return 1
- (I don't know whether it *should* work this way, but I'd rather
- document it than risk breaking code
- which depends on this behavior). */
+ Returns 0 if it couldn't find anything, 1 if it did. On a zero
+ return, *NAME and *ADDRESS are always set to zero. On a 1 return,
+ *NAME and *ADDRESS contain real information. */
int
find_pc_partial_function (pc, name, address)
@@ -462,6 +467,7 @@ find_pc_partial_function (pc, name, address)
f = find_pc_function (pc);
if (!f)
{
+ return_error:
/* No availible symbol. */
if (name != 0)
*name = 0;
@@ -473,7 +479,8 @@ find_pc_partial_function (pc, name, address)
if (name)
*name = SYMBOL_NAME (f);
if (address)
- *address = SYMBOL_VALUE (f);
+ *address = BLOCK_START (SYMBOL_BLOCK_VALUE (f));
+ return 1;
}
/* Get the information from a combination of the pst
@@ -484,20 +491,18 @@ find_pc_partial_function (pc, name, address)
if (!psb && miscfunc == -1)
{
- if (address != 0)
- *address = 0;
- if (name != 0)
- *name = 0;
- return 0;
+ goto return_error;
}
if (!psb
|| (miscfunc != -1
- && SYMBOL_VALUE(psb) < misc_function_vector[miscfunc].address))
+ && (SYMBOL_VALUE(psb)
+ < misc_function_vector[miscfunc].address)))
{
if (address)
*address = misc_function_vector[miscfunc].address;
if (name)
*name = misc_function_vector[miscfunc].name;
+ return 1;
}
else
{
@@ -505,6 +510,7 @@ find_pc_partial_function (pc, name, address)
*address = SYMBOL_VALUE (psb);
if (name)
*name = SYMBOL_NAME (psb);
+ return 1;
}
}
else
@@ -512,13 +518,13 @@ find_pc_partial_function (pc, name, address)
{
miscfunc = find_pc_misc_function (pc);
if (miscfunc == -1)
- return 0;
+ goto return_error;
if (address)
*address = misc_function_vector[miscfunc].address;
if (name)
*name = misc_function_vector[miscfunc].name;
+ return 1;
}
- return 1;
}
/* Find the misc function whose address is the largest
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index e4bb5a1..0cffc45 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -17,13 +17,12 @@ You should have received a copy of the GNU General Public License
along with GDB; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+#include <stdio.h>
#include "defs.h"
#include "param.h"
#include "symtab.h"
#include "frame.h"
-#include <stdio.h>
-
/* This is the sequence of bytes we insert for a breakpoint. */
static char break_insn[] = BREAKPOINT;
@@ -527,7 +526,7 @@ describe_other_breakpoints (pc)
(b->enable == disabled) ? " (disabled)" : "",
(others > 1) ? "," : ((others == 1) ? " and" : ""));
}
- printf (" also set at pc 0x%x\n", pc);
+ printf ("also set at pc 0x%x.\n", pc);
}
}
@@ -1044,6 +1043,16 @@ set_ignore_count (bptnum, count, from_tty)
error ("No breakpoint number %d.", bptnum);
}
+/* Clear the ignore counts of all breakpoints. */
+void
+breakpoint_clear_ignore_counts ()
+{
+ struct breakpoint *b;
+
+ ALL_BREAKPOINTS (b)
+ b->ignore_count = 0;
+}
+
/* Command to set ignore-count of breakpoint N to COUNT. */
static void
diff --git a/gdb/coffread.c b/gdb/coffread.c
index f6a9c8a..a657cf3 100644
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License
along with GDB; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+#include <stdio.h>
#include "defs.h"
#include "param.h"
#ifdef COFF_FORMAT
@@ -31,7 +32,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#endif
#include <a.out.h>
-#include <stdio.h>
#include <obstack.h>
#include <sys/param.h>
#include <sys/file.h>
@@ -762,7 +762,8 @@ symbol_file_command (name)
num_sections = file_hdr.f_nscns;
symtab_offset = file_hdr.f_symptr;
- if (read_section_hdr (desc, _TEXT, &text_hdr, num_sections) < 0)
+ if (read_section_hdr (desc, _TEXT, &text_hdr, num_sections,
+ file_hdr.f_opthdr) < 0)
error ("\"%s\": can't read text section header", name);
/* Read the line number table, all at once. */
@@ -865,7 +866,9 @@ read_coff_symtab (desc, nsyms)
int num_object_files = 0;
int next_file_symnum = -1;
- char *filestring;
+
+ /* Name of the current file. */
+ char *filestring = "";
int depth;
int fcn_first_line;
int fcn_last_line;
@@ -1151,15 +1154,22 @@ read_aout_hdr (chan, aout_hdr, size)
return 0;
}
-read_section_hdr (chan, section_name, section_hdr, nsects)
+/* Read a section header. OPTIONAL_HEADER_SIZE is the size of the
+ optional header (normally f_opthdr from the file header).
+
+ Return nonnegative for success, -1 for failure. */
+int
+read_section_hdr (chan, section_name, section_hdr, nsects,
+ optional_header_size)
register int chan;
register char *section_name;
SCNHDR *section_hdr;
register int nsects;
+ int optional_header_size;
{
register int i;
- if (lseek (chan, FILHSZ + sizeof (AOUTHDR), 0) < 0)
+ if (lseek (chan, FILHSZ + optional_header_size, 0) < 0)
return -1;
for (i = 0; i < nsects; i++)
diff --git a/gdb/config.gdb b/gdb/config.gdb
index f94eee6..b4261e8 100755
--- a/gdb/config.gdb
+++ b/gdb/config.gdb
@@ -70,6 +70,13 @@ sun3)
machine=sun3os3
os=""
;;
+ *)
+# Arguably, the default should be sun3os4, but in that case we'd want
+# to change the list of machine types given by "config.gdb" so it
+# doesn't list "sun3 sun3os4".
+ machine=sun3os3
+ os=""
+ ;;
esac
;;
sparc|sun4)
@@ -78,6 +85,13 @@ sparc|sun4)
machine=sun4os4
os=""
;;
+ *)
+# Arguably, the default should be sun4os4, but in that case we'd want
+# to change the list of machine types given by "config.gdb" so it
+# doesn't list "sun4 sun4os4".
+ machine=sun4os3
+ os=""
+ ;;
esac
;;
# GCC accepts sequent-i386 or symmetry, so be consistent.
@@ -120,6 +134,11 @@ altosgas)
depfile=altos-dep.c
opcodefile=m68k-opcode.h
;;
+pyramid)
+ echo
+ echo "Note that GDB on Pyramids only works with GCC."
+ echo
+ ;;
vax)
echo
# The following types of /bin/cc failures have been observed:
@@ -147,7 +166,6 @@ hp9k320)
opcodefile=m68k-opcode.h
;;
hp300bsd)
-# Not sure what makefile editing (if any) is necessary for this machine.
pinsnfile=m68k-pinsn.c
opcodefile=m68k-opcode.h
;;
@@ -197,6 +215,15 @@ i386g-sv32)
opcodefile=m-i386.h
;;
merlin)
+ echo ""
+ echo "To install GDB on this machine you must copy /bin/sh"
+ echo "to /usr/local/lib/gdb-sh, and make it world readable"
+ echo "and writeable. For example:"
+ echo " cp /bin/sh /usr/local/lib/gdb-sh"
+ echo " chmod ogu+rw /usr/local/lib/gdb-sh"
+ echo "If you want to put it somewhere other than /usr/local/lib,"
+ echo "edit the definition of SHELL_FILE in m-merlin.h"
+ echo ""
pinsnfile=ns32k-pinsn.c
opcodefile=ns32k-opcode.h
;;
@@ -228,6 +255,9 @@ sun2os2|sun2-os2)
;;
sun2os4|sun2-os4)
# Compile GDB without shared libraries so that it can be run on itself.
+# -Bstatic is the right flag for cc.
+# For gcc, -Bstatic is (probably) a no-op, and -g (which is specified by
+# Makefile.dist prevents use of shared libraries).
makedefine=-DM_CFLAGS=-Bstatic
echo
echo "Make sure to compile any program on which you want to run gdb"
diff --git a/gdb/convex-dep.c b/gdb/convex-dep.c
index 1b8e8d7..f09bee1 100644
--- a/gdb/convex-dep.c
+++ b/gdb/convex-dep.c
@@ -1,5 +1,5 @@
/* Convex stuff for GDB.
- Copyright (C) 1989 Free Software Foundation, Inc.
+ Copyright (C) 1990 Free Software Foundation, Inc.
This file is part of GDB.
@@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License
along with GDB; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+#include <stdio.h>
#include "defs.h"
#include "param.h"
#include "command.h"
@@ -26,7 +27,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "inferior.h"
#include "wait.h"
-#include <stdio.h>
#include <signal.h>
#include <fcntl.h>
#include <a.out.h>
@@ -220,7 +220,6 @@ extern int exec_mtime;
/* Virtual addresses of bounds of the two areas of memory in the core file.
NB: These variables are set to plausible but useless values on convex. */
-
extern CORE_ADDR data_start;
extern CORE_ADDR data_end;
@@ -718,6 +717,7 @@ thread_continue (thread, step, signal)
running; we will do a real wait, the thread will do something, and
we will return that. */
+pid_t
wait (w)
union wait *w;
{
@@ -1774,13 +1774,12 @@ comm_registers_info (arg)
if (arg)
{
- if (sscanf (arg, "0x%x", &regnum) == 1)
+ if (sscanf (arg, "0x%x", &regnum) == 1
+ || sscanf (argc, "%d", &regnum) == 1)
{
if (regnum > 0)
regnum &= ~0x8000;
}
- else if (sscanf (arg, "%d", &regnum) == 1)
- ;
else if (sscanf (arg, "$c%d", &regnum) == 1)
;
else if (sscanf (arg, "$C%d", &regnum) == 1)
@@ -1861,7 +1860,6 @@ psw_info (arg)
};
long psw;
-
struct pswbit *p;
if (arg)
@@ -1948,4 +1946,3 @@ set parallel on normal mode, parallel execution on random available CPUs\n\
&cmdlist);
}
-
diff --git a/gdb/core.c b/gdb/core.c
index 40e44fe..6472db9 100644
--- a/gdb/core.c
+++ b/gdb/core.c
@@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License
along with GDB; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+#include <stdio.h>
#include "defs.h"
#include "param.h"
#include "frame.h" /* required by inferior.h */
@@ -39,7 +40,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#define N_MAGIC(exec) ((exec).a_magic)
#endif
#endif
-#include <stdio.h>
#include <signal.h>
#include <sys/param.h>
#include <sys/dir.h>
@@ -98,6 +98,12 @@ CORE_ADDR data_end;
CORE_ADDR stack_start;
CORE_ADDR stack_end;
+#if defined (REG_STACK_SEGMENT)
+/* Start and end of the register stack segment. */
+CORE_ADDR reg_stack_start;
+CORE_ADDR reg_stack_end;
+#endif /* REG_STACK_SEGMENT */
+
/* Virtual addresses of bounds of two areas of memory in the exec file.
Note that the data area in the exec file is used only when there is no core file. */
@@ -188,7 +194,11 @@ validate_files ()
{
struct stat st_core;
- fstat (corechan, &st_core);
+ if (fstat (corechan, &st_core) < 0)
+ /* It might be a good idea to print an error message.
+ On the other hand, if the user tries to *do* anything with
+ the core file, (s)he'll find out soon enough. */
+ return;
if (N_MAGIC (core_aouthdr) != 0
&& bcmp (&core_aouthdr, &exec_aouthdr, sizeof core_aouthdr))
@@ -368,6 +378,18 @@ xfer_core_file (memaddr, myaddr, len)
xferfile = &corefile;
xferchan = corechan;
}
+#ifdef REG_STACK_SEGMENT
+ /* Pyramids have an extra segment in the virtual address space
+ for the (control) stack of register-window frames */
+ else if (memaddr >= reg_stack_start && memaddr < reg_stack_end)
+ {
+ i = min (len, reg_stack_end - memaddr);
+ fileptr = memaddr - reg_stack_start + reg_stack_offset;
+ xferfile = &corefile;
+ xferchan = corechan;
+ }
+#endif /* REG_STACK_SEGMENT */
+
else if (corechan < 0
&& memaddr >= exec_data_start && memaddr < exec_data_end)
{
@@ -404,7 +426,15 @@ xfer_core_file (memaddr, myaddr, len)
stack, set i to do the rest of the operation now. */
i = len;
}
+#ifdef REG_STACK_SEGMENT
+ else if (memaddr >= reg_stack_end && reg_stack_end != 0)
+ {
+ i = min (len, reg_stack_start - memaddr);
+ }
+ else if (memaddr >= stack_end && memaddr < reg_stack_start)
+#else /* no REG_STACK_SEGMENT. */
else if (memaddr >= stack_end && stack_end != 0)
+#endif /* no REG_STACK_SEGMENT. */
{
/* Since there is nothing at higher addresses than
the stack, set i to do the rest of the operation now. */
diff --git a/gdb/dbxread.c b/gdb/dbxread.c
index 9c9f2bf..c5a0fb6 100644
--- a/gdb/dbxread.c
+++ b/gdb/dbxread.c
@@ -17,6 +17,18 @@ You should have received a copy of the GNU General Public License
along with GDB; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+/* Symbol read-in occurs in two phases:
+ 1. A scan (read_dbx_symtab()) of the entire executable, whose sole
+ purpose is to make a list of symbols (partial symbol table)
+ which will cause symbols
+ to be read in if referenced. This scan happens when the
+ "symbol-file" command is given (symbol_file_command()).
+ 2. Full read-in of symbols. (psymtab_to_symtab()). This happens
+ when a symbol in a file for which symbols have not yet been
+ read in is referenced.
+ 2a. The "add-file" command. Similar to #2. */
+
+#include <stdio.h>
#include "param.h"
#ifdef READ_DBX_FORMAT
@@ -110,7 +122,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#endif /* not __GNU_STAB__ */
#endif /* NO_GNU_STABS */
-#include <stdio.h>
#include <obstack.h>
#include <sys/param.h>
#include <sys/file.h>
@@ -466,6 +477,10 @@ static int undef_types_allocated, undef_types_length;
#define HASH_OFFSET 0
#endif
+#if 0
+/* I'm not sure why this is here. To debug bugs which cause
+ an infinite loop of allocations, I suppose. In any event,
+ dumping core when out of memory isn't usually right. */
static int
xxmalloc (n)
{
@@ -477,6 +492,9 @@ xxmalloc (n)
}
return v;
}
+#else /* not 0 */
+#define xxmalloc xmalloc
+#endif /* not 0 */
/* Make a copy of the string at PTR with SIZE characters in the symbol obstack
(and add a null character at the end in the copy).
@@ -1634,7 +1652,7 @@ symbol_file_command (name, from_tty)
if (val < 0)
perror_with_name (name);
if (stat (name, &statbuf) == -1)
- error ("internal: error in stat of already open file.");
+ perror_with_name (name);
READ_STRING_TABLE_SIZE (buffer);
if (buffer >= 0 && buffer < statbuf.st_size)
{
@@ -2096,14 +2114,18 @@ read_dbx_symtab (desc, stringtab, stringtab_size, nlistlen, inclink,
#ifdef N_NBTEXT
case N_NBTEXT:
#endif
-#ifdef OFILE_FN_FLAGGED
+
+ /* We need to be able to deal with both N_FN or N_TEXT,
+ because we have no way of knowing whether the sys-supplied ld
+ or GNU ld was used to make the executable. */
+/* #ifdef OFILE_FN_FLAGGED */
#if ! (N_FN & N_EXT)
case N_FN:
#endif
case N_FN | N_EXT:
-#else
+/* #else */
case N_TEXT:
-#endif
+/* #endif */
SET_NAMESTRING();
if ((namestring[0] == '-' && namestring[1] == 'l')
|| (namestring [(nsl = strlen (namestring)) - 1] == 'o'
@@ -2131,6 +2153,8 @@ read_dbx_symtab (desc, stringtab, stringtab_size, nlistlen, inclink,
}
continue;
+#if 0
+ /* See comments at N_FN above. */
#ifdef OFILE_FN_FLAGGED
case N_TEXT:
#else
@@ -2139,6 +2163,7 @@ read_dbx_symtab (desc, stringtab, stringtab_size, nlistlen, inclink,
#endif
case N_FN | N_EXT:
#endif
+#endif /* 0 */
case N_UNDF:
case N_UNDF | N_EXT:
case N_ABS:
@@ -2866,7 +2891,8 @@ psymtab_to_symtab(pst)
}
/* Open symbol file and read in string table */
- stat (name, &statbuf);
+ if (stat (name, &statbuf) < 0)
+ perror_with_name (name);
desc = open(name, O_RDONLY, 0); /* symbol_file_command
guarrantees that the symbol file name
will be absolute, so there is no
@@ -3267,13 +3293,16 @@ process_one_symbol (type, desc, value, name)
if (desc != new->depth)
error ("Invalid symbol data: N_LBRAC/N_RBRAC symbol mismatch, symtab pos %d.", symnum);
- /* Can only use new->locals as local symbols here if we're in
- gcc or on a machine that puts them before the lbrack. */
/* Some native compilers put the variable decls inside of an
- LBRAC/RBRAC block. */
-#ifdef VARIABLES_INSIDE_BLOCK
- if (processing_gcc_compilation)
+ LBRAC/RBRAC block. This macro should be nonzero if this
+ is true. DESC is N_DESC from the N_RBRAC symbol. */
+#if !defined (VARIABLES_INSIDE_BLOCK)
+#define VARIABLES_INSIDE_BLOCK(desc) 0
#endif
+
+ /* Can only use new->locals as local symbols here if we're in
+ gcc or on a machine that puts them before the lbrack. */
+ if (!VARIABLES_INSIDE_BLOCK(desc))
local_symbols = new->locals;
/* If this is not the outermost LBRAC...RBRAC pair in the
@@ -3285,11 +3314,8 @@ process_one_symbol (type, desc, value, name)
to be attached to the function's own block. However, if
it is so, we need to indicate that we just moved outside
of the function. */
-#ifdef VARIABLES_INSIDE_BLOCK
- if (local_symbols && context_stack_depth > processing_gcc_compilation)
-#else
- if (local_symbols && context_stack_depth > 1)
-#endif
+ if (local_symbols
+ && context_stack_depth > !VARIABLES_INSIDE_BLOCK(desc))
{
/* Muzzle a compiler bug that makes end < start. */
if (new->start_addr > value)
@@ -3303,11 +3329,9 @@ process_one_symbol (type, desc, value, name)
{
within_function = 0;
}
-#ifdef VARIABLES_INSIDE_BLOCK
- /* gcc: normal. pcc: now pop locals of block just finished. */
- if (!processing_gcc_compilation)
+ if (VARIABLES_INSIDE_BLOCK(desc))
+ /* Now pop locals of block just finished. */
local_symbols = new->locals;
-#endif
break;
case N_FN | N_EXT:
@@ -3386,8 +3410,8 @@ process_one_symbol (type, desc, value, name)
bzero (sym, sizeof *sym);
SYMBOL_NAME (sym) = savestring (name, strlen (name));
SYMBOL_CLASS (sym) = LOC_BLOCK;
- SYMBOL_NAMESPACE (sym) = (enum namespace)
- copy_pending (local_symbols, common_block_i, common_block);
+ SYMBOL_NAMESPACE (sym) = (enum namespace)((long)
+ copy_pending (local_symbols, common_block_i, common_block));
i = hashname (SYMBOL_NAME (sym));
SYMBOL_VALUE (sym) = (int) global_sym_chain[i];
global_sym_chain[i] = sym;
@@ -3673,7 +3697,8 @@ add_file_command (arg_string)
val = lseek (desc, STRING_TABLE_OFFSET, 0);
if (val < 0)
perror_with_name (name);
- stat (name, &statbuf);
+ if (stat (name, &statbuf) < 0)
+ perror_with_name (name);
READ_STRING_TABLE_SIZE (buffer);
if (buffer >= 0 && buffer < statbuf.st_size)
{
@@ -4059,6 +4084,17 @@ define_symbol (value, string, desc)
add_symbol_to_list (sym, &local_symbols);
break;
+ case 'X':
+ /* This is used by Sun FORTRAN for "function result value".
+ Sun claims ("dbx and dbxtool interfaces", 2nd ed)
+ that Pascal uses it too, but when I tried it Pascal used
+ "x:3" (local symbol) instead. */
+ SYMBOL_CLASS (sym) = LOC_LOCAL;
+ SYMBOL_VALUE (sym) = value;
+ SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+ add_symbol_to_list (sym, &local_symbols);
+ break;
+
default:
error ("Invalid symbol data: unknown symbol-type code `%c' at symtab pos %d.", deftype, symnum);
}
@@ -4233,6 +4269,12 @@ read_type (pp)
/* Set the pointer ahead of the name which we just read. */
*pp = from;
+#if 0
+ /* The following hack is clearly wrong, because it doesn't
+ check whether we are in a baseclass. I tried to reproduce
+ the case that it is trying to fix, but I couldn't get
+ g++ to put out a cross reference to a basetype. Perhaps
+ it doesn't do it anymore. */
/* Note: for C++, the cross reference may be to a base type which
has not yet been seen. In this case, we skip to the comma,
which will mark the end of the base class name. (The ':'
@@ -4242,6 +4284,7 @@ read_type (pp)
from = (char *) index (*pp, ',');
if (from)
*pp = from;
+#endif /* 0 */
}
/* Now check to see whether the type has already been declared. */
@@ -4476,7 +4519,6 @@ read_struct_type (pp, type)
register struct next_fnfieldlist *mainlist = 0;
int nfn_fields = 0;
- struct type *baseclass = NULL;
int read_possible_virtual_info = 0;
if (TYPE_MAIN_VARIANT (type) == 0)
@@ -4549,9 +4591,27 @@ read_struct_type (pp, type)
error ("Invalid symbol data: bad visibility format at symtab pos %d.",
symnum);
}
+
+ /* Offset of the portion of the object corresponding to
+ this baseclass. Always zero in the absence of
+ multiple inheritance. */
offset = read_number (pp, ',');
baseclass = read_type (pp);
*pp += 1; /* skip trailing ';' */
+
+ if (offset != 0)
+ {
+ static int error_printed = 0;
+
+ if (!error_printed)
+ {
+ fprintf (stderr,
+"\nWarning: GDB has limited understanding of multiple inheritance...");
+ error_printed = 1;
+ }
+ offset = 0;
+ }
+
baseclass_vec[i] = lookup_basetype_type (baseclass, offset, via_virtual, via_public);
/* Since lookup_basetype_type can copy the type,
@@ -4601,12 +4661,12 @@ read_struct_type (pp, type)
new->next = list;
list = new;
- /* Read the data. */
+ /* Get the field name. */
p = *pp;
while (*p != ':') p++;
list->field.name = obsavestring (*pp, p - *pp);
- /* C++: Check to see if we have hit the methods yet. */
+ /* C++: Check to see if we have hit the methods yet. */
if (p[1] == ':')
break;
@@ -4857,8 +4917,13 @@ Therefore GDB will not know about your class variables.\n\
TYPE_NFN_FIELDS (type) = nfn_fields;
TYPE_NFN_FIELDS_TOTAL (type) = nfn_fields;
- if (baseclass)
- TYPE_NFN_FIELDS_TOTAL (type) += TYPE_NFN_FIELDS_TOTAL (baseclass);
+
+ {
+ int i;
+ for (i = 1; i <= TYPE_N_BASECLASSES (type); ++i)
+ TYPE_NFN_FIELDS_TOTAL (type) +=
+ TYPE_NFN_FIELDS_TOTAL (TYPE_BASECLASS (type, i));
+ }
TYPE_FN_FIELDLISTS (type) =
(struct fn_fieldlist *) obstack_alloc (symbol_obstack,
diff --git a/gdb/default-dep.c b/gdb/default-dep.c
index b38c205..a20d567 100644
--- a/gdb/default-dep.c
+++ b/gdb/default-dep.c
@@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License
along with GDB; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+#include <stdio.h>
#include "defs.h"
#include "param.h"
#include "frame.h"
@@ -26,7 +27,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <sys/types.h>
#endif
-#include <stdio.h>
#include <sys/param.h>
#include <sys/dir.h>
#include <signal.h>
@@ -525,10 +525,12 @@ exec_file_command (filename, from_tty)
if (read_aout_hdr (execchan, &exec_aouthdr, aout_hdrsize) < 0)
error ("\"%s\": can't read optional aouthdr", execfile);
- if (read_section_hdr (execchan, _TEXT, &text_hdr, num_sections) < 0)
+ if (read_section_hdr (execchan, _TEXT, &text_hdr, num_sections,
+ aout_hdrsize) < 0)
error ("\"%s\": can't read text section header", execfile);
- if (read_section_hdr (execchan, _DATA, &data_hdr, num_sections) < 0)
+ if (read_section_hdr (execchan, _DATA, &data_hdr, num_sections,
+ aout_hdrsize) < 0)
error ("\"%s\": can't read data section header", execfile);
text_start = exec_aouthdr.text_start;
@@ -565,7 +567,8 @@ exec_file_command (filename, from_tty)
data_start = exec_data_start;
data_end += exec_data_start;
- fstat (execchan, &st_exec);
+ if (fstat (execchan, &st_exec) < 0)
+ perror_with_name (filename);
exec_mtime = st_exec.st_mtime;
}
#endif /* not COFF_FORMAT */
diff --git a/gdb/expprint.c b/gdb/expprint.c
index adbcec7..8ac95e9 100644
--- a/gdb/expprint.c
+++ b/gdb/expprint.c
@@ -17,13 +17,13 @@ You should have received a copy of the GNU General Public License
along with GDB; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+#include <stdio.h>
#include "defs.h"
#include "symtab.h"
#include "param.h"
#include "expression.h"
#include "value.h"
-#include <stdio.h>
/* These codes indicate operator precedences, least tightly binding first. */
/* Adding 1 to a precedence value is done for binary operators,
diff --git a/gdb/expread.tab.c b/gdb/expread.tab.c
index 87de8f6..cb0b8d9 100644
--- a/gdb/expread.tab.c
+++ b/gdb/expread.tab.c
@@ -40,13 +40,13 @@
#line 29 "expread.y"
+#include <stdio.h>
#include "defs.h"
#include "param.h"
#include "symtab.h"
#include "frame.h"
#include "expression.h"
-#include <stdio.h>
#include <a.out.h>
static struct expression *expout;
@@ -137,7 +137,7 @@ typedef union
#ifndef YYLTYPE
typedef
struct yyltype
- {
+ {
int timestamp;
int first_line;
int first_column;
@@ -145,7 +145,7 @@ typedef
int last_column;
char *text;
}
- yyltype;
+ yyltype;
#define YYLTYPE yyltype
#endif
@@ -197,7 +197,8 @@ static const char yytranslate[] = { 0,
50, 51, 52
};
-static const short yyrline[] = { 0,
+#if YYDEBUG != 0
+static const short yyrline[] = { 0,
190, 194, 195, 200, 203, 206, 210, 214, 218, 222,
226, 230, 234, 238, 244, 248, 254, 258, 262, 266,
272, 275, 279, 283, 289, 295, 301, 305, 309, 313,
@@ -220,6 +221,7 @@ static const char * const yytname[] = { 0,
"DECREMENT","ARROW","'.'","'['","'('","'!'","'~'","']'","')'","'{'",
"'}'","':'","start"
};
+#endif
static const short yyr1[] = { 0,
63, 64, 64, 65, 65, 65, 65, 65, 65, 65,
@@ -548,9 +550,6 @@ yyparse()
/* routines */
int yylen;
- void yyerror();
- void bcopy();
- int yylex();
#if YYDEBUG != 0
if (yydebug)
@@ -582,9 +581,7 @@ yynewstate:
/* Give user a chance to reallocate the stack */
/* Use copies of these so that the &'s don't force the real ones into memory. */
YYSTYPE *yyvs1 = yyvs;
-#if defined(yyoverflow) || defined(YYLSP_NEEDED)
YYLTYPE *yyls1 = yyls;
-#endif
short *yyss1 = yyss;
/* Get the current used size of the three stacks, in elements. */
@@ -639,6 +636,7 @@ yynewstate:
/* Do appropriate processing given the current state. */
/* Read a lookahead token if we need one and don't already have one. */
+yyresume:
/* First try to decide what to do without reference to lookahead token. */
@@ -1402,7 +1400,7 @@ case 104:
break;}
}
/* the action file gets copied in in place of this dollarsign */
-#line 331 "bison.simple"
+#line 327 "bison.simple"
yyvsp -= yylen;
yyssp -= yylen;
@@ -2030,7 +2028,8 @@ yylex ()
if (!(c == '_' || c == '$'
|| (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')))
- error ("Invalid token in expression.");
+ /* We must have come across a bad character (e.g. ';'). */
+ error ("Invalid character '%c' in expression.", c);
/* It's a name. See how long it is. */
namelen = 0;
diff --git a/gdb/expread.y b/gdb/expread.y
index 8af164e..f088511 100644
--- a/gdb/expread.y
+++ b/gdb/expread.y
@@ -27,13 +27,13 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
come first in the result. */
%{
+#include <stdio.h>
#include "defs.h"
#include "param.h"
#include "symtab.h"
#include "frame.h"
#include "expression.h"
-#include <stdio.h>
#include <a.out.h>
static struct expression *expout;
@@ -1283,7 +1283,8 @@ yylex ()
if (!(c == '_' || c == '$'
|| (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')))
- error ("Invalid token in expression.");
+ /* We must have come across a bad character (e.g. ';'). */
+ error ("Invalid character '%c' in expression.", c);
/* It's a name. See how long it is. */
namelen = 0;
diff --git a/gdb/findvar.c b/gdb/findvar.c
index 82d32b7..0157d10 100644
--- a/gdb/findvar.c
+++ b/gdb/findvar.c
@@ -283,11 +283,19 @@ read_var_value (var, frame)
addr = val;
break;
+/* Nonzero if a struct which is located in a register or a LOC_ARG
+ really contains
+ the address of the struct, not the struct itself. GCC_P is nonzero
+ if the function was compiled with GCC. */
+#if !defined (REG_STRUCT_HAS_ADDR)
+#define REG_STRUCT_HAS_ADDR(gcc_p) 0
+#endif
+
case LOC_ARG:
fi = get_frame_info (frame);
addr = val + FRAME_ARGS_ADDRESS (fi);
break;
-
+
case LOC_REF_ARG:
fi = get_frame_info (frame);
addr = val + FRAME_ARGS_ADDRESS (fi);
@@ -308,8 +316,17 @@ read_var_value (var, frame)
case LOC_REGISTER:
case LOC_REGPARM:
- v = value_from_register (type, val, frame);
- return v;
+ {
+ struct block *b = get_frame_block (frame);
+
+ v = value_from_register (type, val, frame);
+
+ if (REG_STRUCT_HAS_ADDR(b->gcc_compile_flag)
+ && TYPE_CODE (type) == TYPE_CODE_STRUCT)
+ addr = *(CORE_ADDR *)VALUE_CONTENTS (v);
+ else
+ return v;
+ }
}
read_memory (addr, VALUE_CONTENTS (v), len);
diff --git a/gdb/gdb.texinfo b/gdb/gdb.texinfo
index 6d6f21d..532de96 100644
--- a/gdb/gdb.texinfo
+++ b/gdb/gdb.texinfo
@@ -2850,6 +2850,8 @@ Print all data types that are defined in the program.
Print all data types that are defined in the program whose names
contain a match for regular expression @var{regexp}.
+@ignore
+This was never implemented.
@item info methods
@itemx info methods @var{regexp}
@kindex info methods
@@ -2860,6 +2862,7 @@ C++ classes provide a large number of methods. Thus, the output
from the @samp{ptype} command can be overwhelming and hard to use. The
@samp{info-methods} command filters the methods, printing only those
which match the regular-expression @var{regexp}.
+@end ignore
@item printsyms @var{filename}
@kindex printsyms
@@ -3328,8 +3331,20 @@ Execute one instruction, like the GDB @samp{stepi} command.
Execute until exit from the selected stack frame, like the GDB
@samp{finish} command.
-@item C-c C-c
+@item M-c
+@comment C-c C-p in emacs 19
Continue execution of the program, like the GDB @samp{cont} command.
+
+@item M-u
+@comment C-c C-u in emacs 19
+Go up the number of frames indicated by the numeric argument
+(@pxref{Arguments, , Numeric Arguments, emacs, The GNU Emacs Manual}),
+like the GDB @samp{up} command.@refill
+
+@item M-d
+@comment C-c C-d in emacs 19
+Go down the number of frames indicated by the numeric argument, like the
+GDB @samp{down} command.
@end table
In any source file, the Emacs command @kbd{C-x SPC} (@code{gdb-break})
diff --git a/gdb/gould-dep.c b/gdb/gould-dep.c
index 79080c8..7526022 100644
--- a/gdb/gould-dep.c
+++ b/gdb/gould-dep.c
@@ -17,12 +17,12 @@ You should have received a copy of the GNU General Public License
along with GDB; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+#include <stdio.h>
#include "defs.h"
#include "param.h"
#include "frame.h"
#include "inferior.h"
-#include <stdio.h>
#include <sys/param.h>
#include <sys/dir.h>
#include <signal.h>
@@ -499,10 +499,12 @@ exec_file_command (filename, from_tty)
if (read_aout_hdr (execchan, &exec_aouthdr, aout_hdrsize) < 0)
error ("\"%s\": can't read optional aouthdr", execfile);
- if (read_section_hdr (execchan, _TEXT, &text_hdr, num_sections) < 0)
+ if (read_section_hdr (execchan, _TEXT, &text_hdr, num_sections,
+ aout_hdrsize) < 0)
error ("\"%s\": can't read text section header", execfile);
- if (read_section_hdr (execchan, _DATA, &data_hdr, num_sections) < 0)
+ if (read_section_hdr (execchan, _DATA, &data_hdr, num_sections,
+ aout_hdrsize) < 0)
error ("\"%s\": can't read data section header", execfile);
text_start = exec_aouthdr.text_start;
diff --git a/gdb/hp-include/sys/fcntl.h b/gdb/hp-include/sys/fcntl.h
deleted file mode 100644
index 7523510..0000000
--- a/gdb/hp-include/sys/fcntl.h
+++ /dev/null
@@ -1,4 +0,0 @@
-/* The GNU programs do #include <sys/fcntl.h>
- but on HPUX that file is just fcntl.h.
- This "redirects" the #include to the proper directory. */
-#include <fcntl.h>
diff --git a/gdb/hp300bsd-dep.c b/gdb/hp300bsd-dep.c
index 71fdb95..7199339 100644
--- a/gdb/hp300bsd-dep.c
+++ b/gdb/hp300bsd-dep.c
@@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License
along with GDB; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+#include <stdio.h>
#include "defs.h"
#include "param.h"
#include "frame.h"
@@ -26,13 +27,11 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <sys/types.h>
#endif
-#include <stdio.h>
#include <sys/param.h>
#include <sys/dir.h>
#include <signal.h>
-#include <sys/user.h>
#include <sys/ioctl.h>
-#include <fcntl.h>
+/* #include <fcntl.h> Can we live without this? */
#ifdef COFF_ENCAPSULATE
#include "a.out.encap.h"
@@ -42,10 +41,14 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#ifndef N_SET_MAGIC
#define N_SET_MAGIC(exec, val) ((exec).a_magic = (val))
#endif
+
+#include <sys/user.h> /* After a.out.h */
#include <sys/file.h>
#include <sys/stat.h>
#include <sys/ptrace.h>
+CORE_ADDR kernel_u_addr;
+
extern int errno;
/* This function simply calls ptrace with the given arguments.
@@ -200,9 +203,17 @@ read_inferior_memory (memaddr, myaddr, len)
for (i = 0; i < count; i++, addr += sizeof (int))
{
errno = 0;
+#if 0
+ /* This is now done by read_memory, because when this function did it,
+ reading a byte or short int hardware port read whole longs, causing
+ serious side effects
+ such as bus errors and unexpected hardware operation. This would
+ also be a problem with ptrace if the inferior process could read
+ or write hardware registers, but that's not usually the case. */
if (remote_debugging)
buffer[i] = remote_fetch_word (addr);
else
+#endif
buffer[i] = ptrace (PT_READ_I, inferior_pid, addr, 0);
if (errno)
return errno;
@@ -275,11 +286,6 @@ write_inferior_memory (memaddr, myaddr, len)
/* Work with core dump and executable files, for GDB.
This code would be in core.c if it weren't machine-dependent. */
-/* Recognize COFF format systems because a.out.h defines AOUTHDR. */
-#ifdef AOUTHDR
-#define COFF_FORMAT
-#endif
-
#ifndef N_TXTADDR
#define N_TXTADDR(hdr) 0
#endif /* no N_TXTADDR */
@@ -296,8 +302,10 @@ write_inferior_memory (memaddr, myaddr, len)
#endif
#ifndef COFF_FORMAT
+#ifndef AOUTHDR
#define AOUTHDR struct exec
#endif
+#endif
extern char *sys_siglist[];
@@ -413,18 +421,30 @@ core_file_command (filename, from_tty)
{
struct user u;
- int reg_offset;
+ unsigned int reg_offset;
val = myread (corechan, &u, sizeof u);
if (val < 0)
- perror_with_name (filename);
+ perror_with_name ("Not a core file: reading upage");
+ if (val != sizeof u)
+ error ("Not a core file: could only read %d bytes", val);
+
+ /* We are depending on exec_file_command having been called
+ previously to set exec_data_start. Since the executable
+ and the core file share the same text segment, the address
+ of the data segment will be the same in both. */
data_start = exec_data_start;
data_end = data_start + NBPG * u.u_dsize;
stack_start = stack_end - NBPG * u.u_ssize;
data_offset = NBPG * UPAGES;
stack_offset = NBPG * (UPAGES + u.u_dsize);
- reg_offset = (int) u.u_ar0 - KERNEL_U_ADDR;
+
+ /* Some machines put an absolute address in here and some put
+ the offset in the upage of the regs. */
+ reg_offset = (int) u.u_ar0;
+ if (reg_offset > NBPG * UPAGES)
+ reg_offset -= KERNEL_U_ADDR;
/* I don't know where to find this info.
So, for now, mark it as not available. */
@@ -441,12 +461,17 @@ core_file_command (filename, from_tty)
char buf[MAX_REGISTER_RAW_SIZE];
val = lseek (corechan, register_addr (regno, reg_offset), 0);
- if (val < 0)
- perror_with_name (filename);
+ if (val < 0
+ || (val = myread (corechan, buf, sizeof buf)) < 0)
+ {
+ char * buffer = (char *) alloca (strlen (reg_names[regno])
+ + 30);
+ strcpy (buffer, "Reading register ");
+ strcat (buffer, reg_names[regno]);
+
+ perror_with_name (buffer);
+ }
- val = myread (corechan, buf, sizeof buf);
- if (val < 0)
- perror_with_name (filename);
supply_register (regno, buf);
}
}
@@ -515,10 +540,12 @@ exec_file_command (filename, from_tty)
if (read_aout_hdr (execchan, &exec_aouthdr, aout_hdrsize) < 0)
error ("\"%s\": can't read optional aouthdr", execfile);
- if (read_section_hdr (execchan, _TEXT, &text_hdr, num_sections) < 0)
+ if (read_section_hdr (execchan, _TEXT, &text_hdr, num_sections,
+ aout_hdrsize) < 0)
error ("\"%s\": can't read text section header", execfile);
- if (read_section_hdr (execchan, _DATA, &data_hdr, num_sections) < 0)
+ if (read_section_hdr (execchan, _DATA, &data_hdr, num_sections,
+ aout_hdrsize) < 0)
error ("\"%s\": can't read data section header", execfile);
text_start = exec_aouthdr.text_start;
@@ -569,3 +596,17 @@ exec_file_command (filename, from_tty)
if (exec_file_display_hook)
(*exec_file_display_hook) (filename);
}
+
+void
+_initialize_hp300bsd_dep ()
+{
+ struct nlist names[2];
+
+ /* Get the address of the u area. */
+ names[0].n_un.n_name = "_u";
+ names[1].n_un.n_name = NULL;
+ if (nlist ("/vmunix", names) == 0)
+ kernel_u_addr = names[0].n_value;
+ else
+ kernel_u_addr = 0x00917000;
+}
diff --git a/gdb/hp9k320-dep.c b/gdb/hp9k320-dep.c
index 09876ca..e8a4727 100644
--- a/gdb/hp9k320-dep.c
+++ b/gdb/hp9k320-dep.c
@@ -17,12 +17,12 @@ You should have received a copy of the GNU General Public License
along with GDB; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+#include <stdio.h>
#include "defs.h"
#include "param.h"
#include "frame.h"
#include "inferior.h"
-#include <stdio.h>
#define WOPR
#include <sys/param.h>
#include <sys/dir.h>
@@ -51,6 +51,39 @@ int request, pid, arg3, arg4;
return ptrace (request, pid, arg3, arg4);
}
+#ifdef ATTACH_DETACH
+
+extern int attach_flag ;
+
+/* Start debugging the process whose number is PID. */
+
+attach (pid)
+ int pid;
+{
+ errno = 0;
+ ptrace (PT_ATTACH, pid, 0, 0);
+ if (errno)
+ perror_with_name ("ptrace");
+ attach_flag = 1;
+ return pid;
+}
+
+/* Stop debugging the process whose number is PID
+ and continue it with signal number SIGNAL.
+ SIGNAL = 0 means just continue it. */
+
+void
+detach (signal)
+ int signal;
+{
+ errno = 0;
+ ptrace (PT_DETACH, inferior_pid, 1, signal);
+ if (errno)
+ perror_with_name ("ptrace");
+ attach_flag = 0;
+}
+#endif /* ATTACH_DETACH */
+
kill_inferior ()
{
if (remote_debugging)
@@ -610,10 +643,12 @@ exec_file_command (filename, from_tty)
if (read_aout_hdr (execchan, &exec_aouthdr, aout_hdrsize) < 0)
error ("\"%s\": can't read optional aouthdr", execfile);
- if (read_section_hdr (execchan, _TEXT, &text_hdr, num_sections) < 0)
+ if (read_section_hdr (execchan, _TEXT, &text_hdr, num_sections,
+ aout_hdrsize) < 0)
error ("\"%s\": can't read text section header", execfile);
- if (read_section_hdr (execchan, _DATA, &data_hdr, num_sections) < 0)
+ if (read_section_hdr (execchan, _DATA, &data_hdr, num_sections,
+ aout_hdrsize) < 0)
error ("\"%s\": can't read data section header", execfile);
text_start = exec_aouthdr.text_start;
diff --git a/gdb/i386-dep.c b/gdb/i386-dep.c
index f3ae993..c4630d0 100644
--- a/gdb/i386-dep.c
+++ b/gdb/i386-dep.c
@@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License
along with GDB; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+#include <stdio.h>
#include "defs.h"
#include "param.h"
#include "frame.h"
@@ -26,7 +27,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <sys/types.h>
#endif
-#include <stdio.h>
#include <sys/param.h>
#include <sys/dir.h>
#include <signal.h>
@@ -504,10 +504,12 @@ exec_file_command (filename, from_tty)
if (read_aout_hdr (execchan, &exec_aouthdr, aout_hdrsize) < 0)
error ("\"%s\": can't read optional aouthdr", execfile);
- if (read_section_hdr (execchan, _TEXT, &text_hdr, num_sections) < 0)
+ if (read_section_hdr (execchan, _TEXT, &text_hdr, num_sections,
+ aout_hdrsize) < 0)
error ("\"%s\": can't read text section header", execfile);
- if (read_section_hdr (execchan, _DATA, &data_hdr, num_sections) < 0)
+ if (read_section_hdr (execchan, _DATA, &data_hdr, num_sections,
+ aout_hdrsize) < 0)
error ("\"%s\": can't read data section header", execfile);
text_start = exec_aouthdr.text_start;
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 254c961..4033117 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License
along with GDB; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+#include <stdio.h>
#include "defs.h"
#include "param.h"
#include "symtab.h"
@@ -25,7 +26,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "environ.h"
#include "value.h"
-#include <stdio.h>
#include <signal.h>
#include <sys/param.h>
@@ -107,6 +107,7 @@ struct environ *inferior_environ;
CORE_ADDR read_pc ();
struct command_line *get_breakpoint_commands ();
+void breakpoint_clear_ignore_counts ();
int
@@ -160,6 +161,18 @@ Start it from the beginning? "))
kill_inferior ();
}
+#if 0
+ /* On the other hand, some users want to do
+ break open
+ ignore 1 40
+ run
+ So it's not clear what is best. */
+
+ /* It is confusing to the user for ignore counts to stick around
+ from previous runs of the inferior. So clear them. */
+ breakpoint_clear_ignore_counts ();
+#endif
+
exec_file = (char *) get_exec_file (1);
if (remote_debugging)
@@ -765,33 +778,22 @@ write_pc (val)
char *reg_names[] = REGISTER_NAMES;
-static void
-registers_info (addr_exp)
- char *addr_exp;
+/* Print out the machine register regnum. If regnum is -1,
+ print all registers.
+ For most machines, having all_registers_info() print the
+ register(s) one per line is good enough. If a different format
+ is required, (eg, for SPARC or Pyramid 90x, which both have
+ lots of regs), or there is an existing convention for showing
+ all the registers, define the macro DO_REGISTERS_INFO(regnum)
+ to provide that format. */
+#if !defined (DO_REGISTERS_INFO)
+#define DO_REGISTERS_INFO(regnum) do_registers_info(regnum)
+static void do_registers_info (regnum)
+ int regnum;
{
register int i;
- int regnum;
-
- if (!have_inferior_p () && !have_core_file_p ())
- error ("No inferior or core file");
- if (addr_exp)
- {
- if (*addr_exp >= '0' && *addr_exp <= '9')
- regnum = atoi (addr_exp);
- else
- {
- register char *p = addr_exp;
- if (p[0] == '$')
- p++;
- for (regnum = 0; regnum < NUM_REGS; regnum++)
- if (!strcmp (p, reg_names[regnum]))
- break;
- if (regnum == NUM_REGS)
- error ("%s: invalid register name.", addr_exp);
- }
- }
- else
+ if (regnum == -1)
printf_filtered (
"Register Contents (relative to selected stack frame)\n\n");
@@ -801,7 +803,7 @@ registers_info (addr_exp)
unsigned char virtual_buffer[MAX_REGISTER_VIRTUAL_SIZE];
REGISTER_TYPE val;
- if (addr_exp != 0 && i != regnum)
+ if (regnum != -1 && i != regnum)
continue;
/* Get the data in raw format, then convert also to virtual format. */
@@ -852,6 +854,38 @@ registers_info (addr_exp)
printf_filtered ("\n");
}
}
+#endif /* no DO_REGISTERS_INFO. */
+
+static void
+registers_info (addr_exp)
+ char *addr_exp;
+{
+ int regnum;
+
+ if (!have_inferior_p () && !have_core_file_p ())
+ error ("No inferior or core file");
+
+ if (addr_exp)
+ {
+ if (*addr_exp >= '0' && *addr_exp <= '9')
+ regnum = atoi (addr_exp);
+ else
+ {
+ register char *p = addr_exp;
+ if (p[0] == '$')
+ p++;
+ for (regnum = 0; regnum < NUM_REGS; regnum++)
+ if (!strcmp (p, reg_names[regnum]))
+ break;
+ if (regnum == NUM_REGS)
+ error ("%s: invalid register name.", addr_exp);
+ }
+ }
+ else
+ regnum = -1;
+
+ DO_REGISTERS_INFO(regnum);
+}
#ifdef ATTACH_DETACH
#define PROCESS_ATTACH_ALLOWED 1
diff --git a/gdb/inflow.c b/gdb/inflow.c
index 3a1bdf2..5062643 100644
--- a/gdb/inflow.c
+++ b/gdb/inflow.c
@@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License
along with GDB; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+#include <stdio.h>
#include "defs.h"
#include "param.h"
#include "frame.h"
@@ -24,10 +25,12 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#ifdef USG
#include <sys/types.h>
-#include <fcntl.h>
#endif
-#include <stdio.h>
+/* Some USG-esque systems (some of which are BSD-esque enough so that USG
+ is not defined) want this header, and it won't do any harm. */
+#include <fcntl.h>
+
#include <sys/param.h>
#include <sys/dir.h>
#include <signal.h>
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 5dcf564..c930da0 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -116,6 +116,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+#include <stdio.h>
#include "defs.h"
#include "param.h"
#include "symtab.h"
@@ -123,7 +124,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "inferior.h"
#include "wait.h"
-#include <stdio.h>
#include <signal.h>
/* unistd.h is needed to #define X_OK */
@@ -842,6 +842,9 @@ wait_for_inferior ()
if (IN_SIGTRAMP (stop_pc, stop_func_name)
&& !IN_SIGTRAMP (prev_pc, prev_func_name))
{
+ /* This code is needed at least in the following case:
+ The user types "next" and then a signal arrives (before
+ the "next" is done). */
/* We've just taken a signal; go until we are back to
the point where we took it and one more. */
step_resume_break_address = prev_pc;
@@ -1083,6 +1086,11 @@ Further execution is probably impossible.\n");
if (access (exec_file, X_OK) != 0)
printf ("The file \"%s\" is not executable.\n", exec_file);
else
+ /* I don't think we should ever get here.
+ wait_for_inferior now ignores SIGSEGV's which happen in
+ the shell (since the Bourne shell (/bin/sh) has some
+ rather, er, uh, *unorthodox* memory management
+ involving catching SIGSEGV). */
printf ("\
You have just encountered a bug in \"sh\". GDB starts your program\n\
by running \"sh\" with a command to exec your program.\n\
@@ -1343,14 +1351,24 @@ restore_inferior_status (inf_status)
bcopy (inf_status->stop_registers, stop_registers, REGISTER_BYTES);
- if (inf_status->restore_stack_info)
+ /* The inferior can be gone if the user types "print exit(0)"
+ (and perhaps other times). */
+ if (have_inferior_p() && inf_status->restore_stack_info)
{
fid = find_relative_frame (get_current_frame (),
&level);
-
- if (FRAME_FP (fid) != inf_status->selected_frame_address ||
+
+ if (fid == 0 ||
+ FRAME_FP (fid) != inf_status->selected_frame_address ||
level != 0)
{
+ /* I'm not sure this error message is a good idea. I have
+ only seen it occur after "Can't continue previously
+ requested operation" (we get called from do_cleanups), in
+ which case it just adds insult to injury (one confusing
+ error message after another. Besides which, does the
+ user really care if we can't restore the previously
+ selected frame? */
fprintf (stderr, "Unable to restore previously selected frame.\n");
select_frame (get_current_frame (), 0);
return;
diff --git a/gdb/isi-dep.c b/gdb/isi-dep.c
index bbeae10..013d4c9 100644
--- a/gdb/isi-dep.c
+++ b/gdb/isi-dep.c
@@ -18,6 +18,7 @@ In other words, go ahead and share GDB, but don't try to stop
anyone else from sharing it farther. Help stamp out software hoarding!
*/
+#include <stdio.h>
#include "defs.h"
#include "param.h"
#include "frame.h"
@@ -27,7 +28,6 @@ anyone else from sharing it farther. Help stamp out software hoarding!
#include <sys/types.h>
#endif
-#include <stdio.h>
#include <sys/param.h>
#include <sys/dir.h>
#include <signal.h>
@@ -568,10 +568,12 @@ exec_file_command (filename, from_tty)
if (read_aout_hdr (execchan, &exec_aouthdr, aout_hdrsize) < 0)
error ("\"%s\": can't read optional aouthdr", execfile);
- if (read_section_hdr (execchan, _TEXT, &text_hdr, num_sections) < 0)
+ if (read_section_hdr (execchan, _TEXT, &text_hdr, num_sections,
+ aout_hdrsize) < 0)
error ("\"%s\": can't read text section header", execfile);
- if (read_section_hdr (execchan, _DATA, &data_hdr, num_sections) < 0)
+ if (read_section_hdr (execchan, _DATA, &data_hdr, num_sections,
+ aout_hdrsize) < 0)
error ("\"%s\": can't read data section header", execfile);
text_start = exec_aouthdr.text_start;
diff --git a/gdb/m-convex.h b/gdb/m-convex.h
index d391175..b2764d2 100644
--- a/gdb/m-convex.h
+++ b/gdb/m-convex.h
@@ -35,7 +35,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
/* Get rid of any system-imposed stack limit if possible. */
-/* #define SET_STACK_LIMIT_HUGE */
+#define SET_STACK_LIMIT_HUGE
/* Define this if the C compiler puts an underscore at the front
of external names before giving them to the linker. */
@@ -56,17 +56,12 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#define BELIEVE_PCC_PROMOTION 1
/* Symbol types to ignore. */
-
-#if defined (N_MONPT)
+/* 0xc4 is N_MONPT. Use the numeric value for the benefit of people
+ with (rather) old OS's. */
#define IGNORE_SYMBOL(TYPE) \
(((TYPE) & ~N_EXT) == N_TBSS \
|| ((TYPE) & ~N_EXT) == N_TDATA \
- || ((TYPE) & ~N_EXT) == N_MONPT)
-#else /* no N_MONPT */
-#define IGNORE_SYMBOL(TYPE) \
- (((TYPE) & ~N_EXT) == N_TBSS \
- || ((TYPE) & ~N_EXT) == N_TDATA)
-#endif /* no N_MONPT */
+ || ((TYPE) & ~N_EXT) == 0xc4)
/* Use SIGCONT rather than SIGTSTP because convex Unix occasionally
turkeys SIGTSTP. I think. */
@@ -341,10 +336,13 @@ extern struct value *value_of_trapped_internalvar ();
#define PRINT_TYPELESS_INTEGER decout
-/* Specify that variables for a particular lexical context are listed
- after the beginning LBRAC instead of before in the executables list
- of symbols. */
-#define VARIABLES_INSIDE_BLOCK
+/* For the native compiler, variables for a particular lexical context
+ are listed after the beginning LBRAC instead of before in the
+ executables list of symbols. Using "gcc_compiled." to distinguish
+ between GCC and native compiler doesn't work on Convex because the
+ linker sorts the symbols to put "gcc_compiled." in the wrong place.
+ desc is nonzero for native, zero for gcc. */
+#define VARIABLES_INSIDE_BLOCK(desc) (desc != 0)
/* Pcc occaisionally puts an SO where there should be an SOL. */
#define PCC_SOL_BROKEN
diff --git a/gdb/m-hp300bsd.h b/gdb/m-hp300bsd.h
index ae0568a..4cb7c42 100644
--- a/gdb/m-hp300bsd.h
+++ b/gdb/m-hp300bsd.h
@@ -76,7 +76,18 @@ read_memory_integer (read_register (SP_REGNUM), 4)
/* This is the amount to subtract from u.u_ar0
to get the offset in the core file of the register values. */
-#define KERNEL_U_ADDR 0x00917000
+#define KERNEL_U_ADDR kernel_u_addr
+
+/* Same as offsetof macro from stddef.h (which 4.3BSD doesn't have). */
+#define my_offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER)
+
+/* On the HP300, sigtramp is in the u area. Gak! User struct is not
+ mapped to the same virtual address in user/kernel address space
+ (hence STACK_END_ADDR as opposed to KERNEL_U_ADDR). */
+#define IN_SIGTRAMP(pc, name) \
+ ((pc) >= STACK_END_ADDR + my_offsetof (struct user, u_pcb.pcb_sigc[0]) \
+ && (pc) < STACK_END_ADDR + my_offsetof (struct user, u_pcb.pcb_sigc[12]) \
+ )
/* Address of end of stack space. */
diff --git a/gdb/m-hp9k320.h b/gdb/m-hp9k320.h
index 3725476..173d3d0 100644
--- a/gdb/m-hp9k320.h
+++ b/gdb/m-hp9k320.h
@@ -258,6 +258,10 @@ read_memory_integer (read_register (SP_REGNUM), 4)
: (&u.u_pcb.pcb_mc68881[FMC68881_C + ((regno) - FPC_REGNUM)]))) \
- ((char *) (& u)))
+/* Do implement the attach and detach commands. */
+
+#define ATTACH_DETACH
+
/* Describe the pointer in each stack frame to the previous stack frame
(its caller). */
diff --git a/gdb/m-i386.h b/gdb/m-i386.h
index ff62a25..5449ec4 100644
--- a/gdb/m-i386.h
+++ b/gdb/m-i386.h
@@ -32,6 +32,19 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#define i386
#endif
+/* I'm running gdb 3.4 under 386/ix 2.0.2, which is a derivative of AT&T's
+Sys V/386 3.2.
+
+On some machines, gdb crashes when it's starting up while calling the
+vendor's termio tgetent() routine. It always works when run under
+itself (actually, under 3.2, it's not an infinitely recursive bug.)
+After some poking around, it appears that depending on the environment
+size, or whether you're running YP, or the phase of the moon or something,
+the stack is not always long-aligned when main() is called, and tgetent()
+takes strong offense at that. On some machines this bug never appears, but
+on those where it does, it occurs quite reliably. */
+#define ALIGN_STACK_ON_STARTUP
+
/* define USG if you are using sys5 /usr/include's */
#define USG
diff --git a/gdb/m-merlin.h b/gdb/m-merlin.h
index ef8d1ec..a50c2c1 100644
--- a/gdb/m-merlin.h
+++ b/gdb/m-merlin.h
@@ -21,6 +21,14 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#define ns16000
#endif
+/* This machine doesn't have the siginterrupt call. */
+#define NO_SIGINTERRUPT
+
+/* Under Utek, a ptrace'd process can be the only active process for
+ an executable. Therefore instead of /bin/sh use gdb-sh (which should
+ just be a copy of /bin/sh which is world readable and writeable). */
+#define SHELL_FILE "/usr/local/lib/gdb-sh"
+
/* Define the bit, byte, and word ordering of the machine. */
/* #define BITS_BIG_ENDIAN */
/* #define BYTES_BIG_ENDIAN */
diff --git a/gdb/m-pyr.h b/gdb/m-pyr.h
new file mode 100644
index 0000000..89d8444
--- /dev/null
+++ b/gdb/m-pyr.h
@@ -0,0 +1,612 @@
+/* Definitions to make GDB run on a Pyramidax under OSx 4.0 (4.2bsd).
+ Copyright (C) 1988, 1989 Free Software Foundation, Inc.
+
+This file is part of GDB.
+
+GDB 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 1, or (at your option)
+any later version.
+
+GDB 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 GDB; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* The FSF prefers to define "pyramid on Pyramid 90x machines; the
+ manufacturer insists on "pyr". Define both. */
+
+#ifndef pyr
+#define pyr
+#endif
+
+#ifndef pyramid
+#define pyramid
+#endif
+
+/* Define PYRAMID_CONTROL_FRAME_DEBUGGING to get copious messages
+ about reading the control stack on standard output. This
+ makes gdb unusable as a debugger. */
+
+/* #define PYRAMID_CONTROL_FRAME_DEBUGGING */
+
+/* Define PYRAMID_FRAME_DEBUGGING
+/* use Pyramid's slightly strange ptrace */
+#define PYRAMID_PTRACE
+
+/* Traditional Unix virtual address spaces have thre regions: text,
+ data and stack. The text, initialised data, and uninitialised data
+ are represented in separate segments of the a.out file.
+ When a process dumps core, the data and stack regions are written
+ to a core file. This gives a debugger enough information to
+ reconstruct (and debug) the virtual address space at the time of
+ the coredump.
+ Pyramids have an distinct fourth region of the virtual address
+ space, in which the contents of the windowed registers are stacked
+ in fixed-size frames. Pyramid refer to this region as the control
+ stack. Each call (or trap) automatically allocates a new register
+ frame; each return deallocates the current frame and restores the
+ windowed registers to their values before the call.
+
+ When dumping core, the control stack is written to a core files as
+ a third segment. The core-handling functions need to know to deal
+ with it. */
+/* Tell core.c there is an extra segment. */
+#define REG_STACK_SEGMENT
+/* Tell dep.c what the extra segment is. */
+#define PYRAMID_CORE
+
+/* Define the bit, byte, and word ordering of the machine. */
+#define BITS_BIG_ENDIAN
+#define BYTES_BIG_ENDIAN
+#define WORDS_BIG_ENDIAN
+
+/* Floating point is IEEE compatible on most Pyramid hardware
+ (Older processors do not have IEEE NaNs). */
+#define IEEE_FLOAT
+
+#define NO_SIGINTERRUPT
+
+#define HAVE_WAIT_STRUCT
+
+/* Get rid of any system-imposed stack limit if possible. */
+
+#define SET_STACK_LIMIT_HUGE
+
+/* Define this if the C compiler puts an underscore at the front
+ of external names before giving them to the linker. */
+
+#define NAMES_HAVE_UNDERSCORE
+
+/* Debugger information will be in DBX format. */
+
+#define READ_DBX_FORMAT
+
+/* 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. */
+
+/* FIXME -- do we want to skip insns to allocate the local frame?
+ If so, what do they look like?
+ This is becoming harder, since tege@sics.SE wants to change
+ gcc to not output a prologue when no frame is needed. */
+#define SKIP_PROLOGUE(pc) do {} while (0)
+
+
+/* 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)
+
+/* This is the amount to subtract from u.u_ar0
+ to get the offset in the core file of the register values. */
+
+#define KERNEL_U_ADDR (0x80000000 - (UPAGES * NBPG))
+
+/* Address of end of stack space. */
+/* This seems to be right for the 90x comp.vuw.ac.nz.
+ The correct value at any site may be a function of the configured
+ maximum control stack depth. If so, I don't know where the
+ control-stack depth is configured, so I can't #include it here. */
+#define STACK_END_ADDR (0xc00cc000)
+
+/* Register window stack (Control stack) stack definitions
+ - Address of beginning of control stack.
+ - size of control stack frame
+ (Note that since crts0 is usually the first function called,
+ main()'s control stack is one frame (0x80 bytes) beyond this value. */
+
+#define CONTROL_STACK_ADDR (0xc00cd000)
+
+/* Bytes in a register window -- 16 parameter regs, 16 local regs
+ for each call, is 32 regs * 4 bytes */
+
+#define CONTROL_STACK_FRAME_SIZE (32*4)
+
+/* FIXME. On a pyr, Data Stack grows downward; control stack goes upwards.
+ Which direction should we use for INNER_THAN, PC_INNER_THAN ?? */
+
+#define INNER_THAN <
+#define PC_INNER_THAN >
+
+/* Stack has strict alignment. */
+
+#define STACK_ALIGN(ADDR) (((ADDR)+3)&-4)
+
+/* Sequence of bytes for breakpoint instruction. */
+
+#define BREAKPOINT {0xf0, 00, 00, 00}
+
+/* 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
+
+/* Nonzero if instruction at PC is a return instruction.
+ On a pyr, this is either "ret" or "retd".
+ It would be friendly to check that any "retd" always had an
+ argument of 0, since anything else is invalid. */
+
+#define ABOUT_TO_RETURN(pc) \
+(((read_memory_integer (pc, 2) & 0x3ff0) == 0x3090) || \
+ ((read_memory_integer (pc, 2) & 0x0ff0) == 0x00a0))
+
+/* Return 1 if P points to an invalid floating point value.
+ LEN is the length in bytes -- not relevant on the Vax. */
+/* FIXME -- this is ok for a vax, bad for big-endian ieee format.
+ I would use the definition for a Sun; but it is no better! */
+
+#define INVALID_FLOAT(p, len) ((*(short *) p & 0xff80) == 0x8000)
+
+/* Larges integer type */
+#define LONGEST long
+
+/* Name of the builtin type for the LONGEST type above. */
+#define BUILTIN_TYPE_LONGEST builtin_type_long
+
+/* Say how long (ordinary) registers are. */
+
+#define REGISTER_TYPE long
+
+/* Number of machine registers */
+/* pyramids have 64, plus one for the PSW; plus perhaps one more for the
+ kernel stack pointer (ksp) and control-stack pointer (CSP) */
+
+#define NUM_REGS 67
+
+/* Initializer for an array of names of registers.
+ There should be NUM_REGS strings in this initializer. */
+
+#define REGISTER_NAMES \
+{"gr0", "gr1", "gr2", "gr3", "gr4", "gr5", "gr6", "gr7", \
+ "gr8", "gr9", "gr10", "gr11", "logpsw", "cfp", "sp", "pc", \
+ "pr0", "pr1", "pr2", "pr3", "pr4", "pr5", "pr6", "pr7", \
+ "pr8", "pr9", "pr10", "pr11", "pr12", "pr13", "pr14", "pr15", \
+ "lr0", "lr1", "lr2", "lr3", "lr4", "lr5", "lr6", "lr7", \
+ "lr8", "lr9", "lr10", "lr11", "lr12", "lr13", "lr14", "lr15", \
+ "tr0", "tr1", "tr2", "tr3", "tr4", "tr5", "tr6", "tr7", \
+ "tr8", "tr9", "tr10", "tr11", "tr12", "tr13", "tr14", "tr15", \
+ "psw", "ksp", "csp"}
+
+/* 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. */
+
+/* pseudo-registers: */
+#define PS_REGNUM 64 /* Contains processor status */
+#define PSW_REGNUM 64 /* Contains current psw, whatever it is.*/
+#define CSP_REGNUM 65 /* address of this control stack frame*/
+#define KSP_REGNUM 66 /* Contains process's Kernel Stack Pointer */
+
+#define CFP_REGNUM 13 /* Current data-stack frame ptr */
+#define TR0_REGNUM 48 /* After function call, contains
+ function result */
+
+/* Registers interesting to the machine-independent part of gdb*/
+
+#define FP_REGNUM CSP_REGNUM /* Contains address of executing (control)
+ stack frame */
+#define SP_REGNUM 14 /* Contains address of top of stack -??*/
+#define PC_REGNUM 15 /* Contains program counter */
+
+/* Define DO_REGISTERS_INFO() to do machine-specific formatting
+ of register dumps. */
+
+#define DO_REGISTERS_INFO(_regnum) pyr_do_registers_info(_regnum)
+
+/* need this so we can find the global registers: they never get saved. */
+extern unsigned int global_reg_offset;
+extern unsigned int last_frame_offset;
+extern unsigned int reg_stack_start;
+extern unsigned int reg_stack_end;
+extern unsigned int reg_stack_offset;
+
+
+/* Define offsets of registers in the core file (or maybe u area) */
+#define REGISTER_U_ADDR(addr, blockend, regno) \
+{ struct user __u; \
+ addr = blockend + (regno - 16 ) * 4; \
+ if (regno == 67) { \
+ printf("\\geting reg 67\\"); \
+ addr = (int)(&__u.u_pcb.pcb_csp) - (int) &__u; \
+ } else if (regno == KSP_REGNUM) { \
+ printf("\\geting KSP (reg %d)\\", KSP_REGNUM); \
+ addr = (int)(&__u.u_pcb.pcb_ksp) - (int) &__u; \
+ } else if (regno == CSP_REGNUM) { \
+ printf("\\geting CSP (reg %d\\",CSP_REGNUM); \
+ addr = (int)(&__u.u_pcb.pcb_csp) - (int) &__u; \
+ } else if (regno == 64) { \
+ printf("\\geting reg 64\\"); \
+ addr = (int)(&__u.u_pcb.pcb_csp) - (int) &__u; \
+ } else if (regno == PS_REGNUM) \
+ addr = blockend - 4; \
+ else if (1 && ((16 > regno) && (regno > 11))) \
+ addr = last_frame_offset + (4 *(regno+32)); \
+ else if (0 && (12 > regno)) \
+ addr = global_reg_offset + (4 *regno); \
+ else if (16 > regno) \
+ addr = global_reg_offset + (4 *regno); \
+ else \
+ addr = blockend + (regno - 16 ) * 4; \
+}
+
+
+
+/* Total amount of space needed to store our copies of the machine's
+ register state, the array `registers'. */
+#define REGISTER_BYTES (NUM_REGS*4)
+
+/* the Pyramid has register windows. */
+
+#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" (out
+ registers shifting into ins counts) upon subroutine calls and thus
+ there is no need to search more than one stack frame for it. */
+
+#define REGISTER_IN_WINDOW_P(regnum) \
+ ((regnum) >= 16 && (regnum) < 64)
+
+/* 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 Pyramid, 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 Pyramid, 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
+
+/* Nonzero if register N requires conversion
+ from raw format to virtual format. */
+
+#define REGISTER_CONVERTIBLE(N) 0
+
+/* Convert data from raw format for register REGNUM
+ to virtual format for register REGNUM. */
+
+#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,FROM,TO) \
+ bcopy ((FROM), (TO), 4);
+
+/* Convert data from virtual format for register REGNUM
+ to raw format for register REGNUM. */
+
+#define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) \
+ bcopy ((FROM), (TO), 4);
+
+/* Return the GDB type object for the "standard" data type
+ of data in register N. */
+
+#define REGISTER_VIRTUAL_TYPE(N) builtin_type_int
+
+/* FIXME: It seems impossible for both EXTRACT_RETURN_VALUE and
+ STORE_RETURN_VALUE to be correct. */
+
+/* Store the address of the place in which to copy the structure the
+ subroutine will return. This is called from call_function. */
+
+/****FIXME****/
+#define STORE_STRUCT_RETURN(ADDR, SP) \
+ { write_register (TR0_REGNUM, (ADDR)); }
+
+/* Extract from an array REGBUF containing the (raw) register state
+ a function return value of type TYPE, and copy that, in virtual format,
+ into VALBUF. */
+
+/* Note that on a register-windowing machine (eg, Pyr, SPARC), this is
+ where the value is found after the function call -- ie, it should
+ correspond to GNU CC's FUNCTION_VALUE rather than FUNCTION_OUTGOING_VALUE.*/
+
+#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
+ bcopy (((int *)(REGBUF))+TR0_REGNUM, VALBUF, TYPE_LENGTH (TYPE))
+
+/* Write into appropriate registers a function return value
+ of type TYPE, given in virtual format. */
+/* on pyrs, values are returned in */
+
+#define STORE_RETURN_VALUE(TYPE,VALBUF) \
+ write_register_bytes (REGISTER_BYTE(TR0_REGNUM), VALBUF, TYPE_LENGTH (TYPE))
+
+/* Extract from an array REGBUF containing the (raw) register state
+ the address in which a function should return its structure value,
+ as a CORE_ADDR (or an expression that can be used as one). */
+/* FIXME */
+#define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
+ ( ((int *)(REGBUF)) [TR0_REGNUM])
+
+/* Compensate for lack of `vprintf' function. */
+#define vprintf(format, ap) _doprnt (format, ap, stdout)
+
+/* Describe the pointer in each stack frame to the previous stack frame
+ (its caller). */
+
+#define EXTRA_FRAME_INFO \
+ FRAME_ADDR bottom; \
+ CORE_ADDR frame_cfp; \
+ CORE_ADDR frame_window_addr;
+
+#define INIT_EXTRA_FRAME_INFO(fci) \
+do { \
+ (fci)->frame_window_addr = (fci)->frame; \
+ (fci)->bottom = \
+ ((fci)->next ? \
+ ((fci)->frame == (fci)->next_frame ? \
+ (fci)->next->bottom : (fci)->next->frame) : \
+ read_register (SP_REGNUM)); \
+ (fci)->frame_cfp = \
+ read_register (CFP_REGNUM); \
+ /***fprintf (stderr, \
+ "[[creating new frame for %0x,pc=%0x,csp=%0x]]\n", \
+ (fci)->frame, (fci)->pc,(fci)->frame_cfp);*/ \
+} while (0);
+
+/* 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. */
+
+/* In the case of the pyr, the frame's nominal address is the address
+ of parameter register 0. The previous frame is found 32 words up. */
+
+#define FRAME_CHAIN(thisframe) \
+ ( (thisframe) -> frame - CONTROL_STACK_FRAME_SIZE)
+
+#define FRAME_CHAIN_VALID(chain, thisframe) \
+ (chain != 0 && (outside_startup_file (FRAME_SAVED_PC (thisframe))))
+
+ /*((thisframe) >= CONTROL_STACK_ADDR))*/
+
+#define FRAME_CHAIN_COMBINE(chain, thisframe) (chain)
+
+/* 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.
+
+ I do not understand what this means on a Pyramid, where functions
+ *always* have a control-stack frame, but may or may not have a
+ frame on the data stack. Since GBD uses the value of the
+ control stack pointer as its "address" of a frame, FRAMELESS
+ is always 1, so does not need to be defined. */
+
+
+/* Where is the PC for a specific frame */
+
+#define FRAME_SAVED_PC(fi) \
+ ((CORE_ADDR) (read_memory_integer ( (fi) -> frame + 60, 4)))
+
+/* There may be bugs in FRAME_ARGS_ADDRESS and FRAME_LOCALS_ADDRESS;
+ or there may be bugs in accessing the registers that break
+ their definitions.
+ Having the macros expand into functions makes them easier to debug.
+ When the bug is finally located, the inline macro defintions can
+ be un-#if 0ed, and frame_args_addr and frame_locals_address can
+ be deleted from pyr-dep.c */
+
+/* If the argument is on the stack, it will be here. */
+#define FRAME_ARGS_ADDRESS(fi) \
+ frame_args_addr(fi)
+
+#define FRAME_LOCALS_ADDRESS(fi) \
+ frame_locals_address(fi)
+
+/* The following definitions doesn't seem to work.
+ I don't understand why. */
+#if 0
+#define FRAME_ARGS_ADDRESS(fi) \
+ /*(FRAME_FP(fi) + (13*4))*/ (read_register (CFP_REGNUM))
+
+#define FRAME_LOCALS_ADDRESS(fi) \
+ ((fi)->frame +(16*4))
+
+#endif /* 0 */
+
+/* Return number of args passed to a frame.
+ Can return -1, meaning no way to tell. */
+
+#define FRAME_NUM_ARGS(val, fi) (val = -1)
+
+/* Return number of bytes at start of arglist that are not really args. */
+
+#define FRAME_ARGS_SKIP 0
+
+/* Put here the code to store, into 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.
+
+ Note that on register window machines, we are currently making the
+ assumption that window registers are being saved somewhere in the
+ frame in which they are being used. If they are stored in an
+ inferior frame, find_saved_register will break.
+
+ On pyrs, frames of window registers are stored contiguously on a
+ separate stack. All window registers are always stored.
+ The pc and psw (gr15 and gr14) are also always saved: the call
+ insn saves them in pr15 and pr14 of the new frame (tr15,tr14 of the
+ old frame).
+ The data-stack frame pointer (CFP) is only saved in functions which
+ allocate a (data)stack frame (with "adsf"). We detect them by
+ looking at the first insn of the procedure.
+
+ Other non-window registers (gr0-gr11) are never saved. Pyramid's C
+ compiler and gcc currently ignore them, so it's not an issue. */
+
+#define FRAME_FIND_SAVED_REGS(fi_p, frame_saved_regs) \
+{ register int regnum; \
+ register CORE_ADDR pc; \
+ register CORE_ADDR fn_start_pc; \
+ register int first_insn; \
+ register CORE_ADDR prev_cf_addr; \
+ register int window_ptr; \
+ FRAME fid = FRAME_INFO_ID (fi_p); \
+ if (!fid) fatal ("Bad frame info struct in FRAME_FIND_SAVED_REGS"); \
+ bzero (&(frame_saved_regs), sizeof (frame_saved_regs)); \
+ \
+ window_ptr = prev_cf_addr = FRAME_FP(fi_p); \
+ \
+ for (regnum = 16 ; regnum < 64; regnum++,window_ptr+=4) \
+ { \
+ (frame_saved_regs).regs[regnum] = window_ptr; \
+ } \
+ \
+ /* In each window, psw, and pc are "saved" in tr14,tr15. */ \
+ /*** psw is sometimes saved in gr12 (so sez <sys/pcb.h>) */ \
+ (frame_saved_regs).regs[PS_REGNUM] = FRAME_FP(fi_p) + (14*4); \
+ \
+/*(frame_saved_regs).regs[PC_REGNUM] = (frame_saved_regs).regs[31];*/ \
+ (frame_saved_regs).regs[PC_REGNUM] = FRAME_FP(fi_p) + ((15+32)*4); \
+ \
+ /* Functions that allocate a frame save sp *where*? */ \
+/*first_insn = read_memory_integer (get_pc_function_start ((fi_p)->pc),4); */ \
+ \
+ fn_start_pc = (get_pc_function_start ((fi_p)->pc)); \
+ first_insn = read_memory_integer(fn_start_pc, 4); \
+ \
+ if (0x08 == ((first_insn >> 20) &0x0ff)) { \
+ /* NB: because WINDOW_REGISTER_P(cfp) is false, a saved cfp \
+ in this frame is only visible in this frame's callers. \
+ That means the cfp we mark saved is my caller's cfp, ie pr13. \
+ I don't understand why we don't have to do that for pc, too. */ \
+ \
+ (frame_saved_regs).regs[CFP_REGNUM] = FRAME_FP(fi_p)+(13*4); \
+ \
+ (frame_saved_regs).regs[SP_REGNUM] = \
+ read_memory_integer (FRAME_FP(fi_p)+((13+32)*4),4); \
+ } \
+ \
+/* \
+ *(frame_saved_regs).regs[CFP_REGNUM] = (frame_saved_regs).regs[61]; \
+ * (frame_saved_regs).regs[SP_REGNUM] = \
+ * read_memory_integer (FRAME_FP(fi_p)+((13+32)*4),4); \
+ */ \
+ \
+ (frame_saved_regs).regs[CSP_REGNUM] = prev_cf_addr; \
+}
+
+/* Things needed for making the inferior call functions. */
+
+/* These are all lies. These macro definitions are appropriate for a
+ SPARC. On a pyramid, pushing a dummy frame will
+ surely involve writing the control stack pointer,
+ then saving the pc. This requires a privileged instruction.
+ Maybe one day Pyramid can be persuaded to add a syscall to do this.
+ Until then, we are out of luck. */
+
+/* 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); \
+ set_current_frame (read_register (FP_REGNUM)); }
+
+/* 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 */
+
+/* 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, type) \
+{ *((char *) dummyname + 1) = nargs; \
+ *(int *)((char *) dummyname + 3) = fun; }
+
+/* Interface definitions for kernel debugger KDB. */
+
+/* I have *no idea* how to debug OSx kernels, so this
+ is flushed, possible forever. */
diff --git a/gdb/m-sparc.h b/gdb/m-sparc.h
index eb190f5..f166f3f 100644
--- a/gdb/m-sparc.h
+++ b/gdb/m-sparc.h
@@ -42,6 +42,18 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#define READ_DBX_FORMAT
+/* When passing a structure to a function, Sun cc passes the address
+ in a register, not the structure itself. It (under SunOS4) creates
+ two symbols, so we get a LOC_ARG saying the address is on the stack
+ (a lie, and a serious one since we don't know which register to
+ use), and a LOC_REGISTER saying that the struct is in a register
+ (sort of a lie, but fixable with REG_STRUCT_HAS_ADDR).
+
+ This still doesn't work if the argument is not one passed in a
+ register (i.e. it's the 7th or later argument). */
+#define REG_STRUCT_HAS_ADDR(gcc_p) (!gcc_p)
+#define STRUCT_ARG_SYM_GARBAGE(gcc_p) (!gcc_p)
+
/* If Pcc says that a parameter is a short, it's a short. This is
because the parameter does get passed in in a register as an int,
but pcc puts it onto the stack frame as a short (not nailing
@@ -240,14 +252,31 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
a function return value of type TYPE, and copy that, in virtual format,
into VALBUF. */
-#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
- bcopy (((int *)(REGBUF))+8, (VALBUF), TYPE_LENGTH (TYPE))
+#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
+ { \
+ if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
+ { \
+ bcopy (((int *)(REGBUF))+FP0_REGNUM, \
+ (VALBUF), TYPE_LENGTH(TYPE)); \
+ } \
+ else \
+ bcopy (((int *)(REGBUF))+8, (VALBUF), TYPE_LENGTH (TYPE)); \
+ }
/* Write into appropriate registers a function return value
of type TYPE, given in virtual format. */
/* On sparc, values are returned in register %o0. */
#define STORE_RETURN_VALUE(TYPE,VALBUF) \
- write_register_bytes (REGISTER_BYTE (8), VALBUF, TYPE_LENGTH (TYPE))
+ { \
+ if (TYPE_CODE (TYPE) = TYPE_CODE_FLT) \
+ /* Floating-point values are returned in the register pair */ \
+ /* formed by %f0 and %f1 (doubles are, anyway). */ \
+ write_register_bytes (REGISTER_BYTE (FP0_REGNUM), (VALBUF), \
+ TYPE_LENGTH (TYPE)); \
+ else \
+ /* Other values are returned in register %o0. */ \
+ write_register_bytes (REGISTER_BYTE (8), 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,
diff --git a/gdb/m-sun3os4.h b/gdb/m-sun3os4.h
index cd9179a..8082154 100644
--- a/gdb/m-sun3os4.h
+++ b/gdb/m-sun3os4.h
@@ -22,6 +22,8 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#define FPU
/* There is a bug which can cause alloca to fail to allocate large
- areas of memory one time in every 4096 (we think). Hard to reproduce
- so it will be hard to detect when this bug is fixed. */
+ areas of memory one time in every 4096 (we think). */
+/* chase@orc.olivetti.com says that 4 megabyte alloca's consistently fail,
+ even though the stack limit (SET_STACK_LIMIT_HUGE) has been set
+ to 250 megabytes. */
#define BROKEN_LARGE_ALLOCA
diff --git a/gdb/m68k-opcode.h b/gdb/m68k-opcode.h
index 3fde5e2..255645e 100644
--- a/gdb/m68k-opcode.h
+++ b/gdb/m68k-opcode.h
@@ -1088,38 +1088,41 @@ struct m68k_opcode m68k_opcodes[] =
{"fscalex", two(0xF000, 0x4826), two(0xF1C0, 0xFC7F), "Ii;xF7"},
/* {"fscalex", two(0xF000, 0x0026), two(0xF1C0, 0xE07F), "IiFt"}, JF */
-{"fseq", two(0xF040, 0x0001), two(0xF1C0, 0xFFFF), "Ii@s"},
-{"fsf", two(0xF040, 0x0000), two(0xF1C0, 0xFFFF), "Ii@s"},
-{"fsge", two(0xF040, 0x0013), two(0xF1C0, 0xFFFF), "Ii@s"},
-{"fsgl", two(0xF040, 0x0016), two(0xF1C0, 0xFFFF), "Ii@s"},
-{"fsgle", two(0xF040, 0x0017), two(0xF1C0, 0xFFFF), "Ii@s"},
-{"fsgt", two(0xF040, 0x0012), two(0xF1C0, 0xFFFF), "Ii@s"},
-{"fsle", two(0xF040, 0x0015), two(0xF1C0, 0xFFFF), "Ii@s"},
-{"fslt", two(0xF040, 0x0014), two(0xF1C0, 0xFFFF), "Ii@s"},
-{"fsne", two(0xF040, 0x000E), two(0xF1C0, 0xFFFF), "Ii@s"},
-{"fsnge", two(0xF040, 0x001C), two(0xF1C0, 0xFFFF), "Ii@s"},
-{"fsngl", two(0xF040, 0x0019), two(0xF1C0, 0xFFFF), "Ii@s"},
-{"fsngle", two(0xF040, 0x0018), two(0xF1C0, 0xFFFF), "Ii@s"},
-{"fsngt", two(0xF040, 0x001D), two(0xF1C0, 0xFFFF), "Ii@s"},
-{"fsnle", two(0xF040, 0x001A), two(0xF1C0, 0xFFFF), "Ii@s"},
-{"fsnlt", two(0xF040, 0x001B), two(0xF1C0, 0xFFFF), "Ii@s"},
-{"fsoge", two(0xF040, 0x0003), two(0xF1C0, 0xFFFF), "Ii@s"},
-{"fsogl", two(0xF040, 0x0006), two(0xF1C0, 0xFFFF), "Ii@s"},
-{"fsogt", two(0xF040, 0x0002), two(0xF1C0, 0xFFFF), "Ii@s"},
-{"fsole", two(0xF040, 0x0005), two(0xF1C0, 0xFFFF), "Ii@s"},
-{"fsolt", two(0xF040, 0x0004), two(0xF1C0, 0xFFFF), "Ii@s"},
-{"fsor", two(0xF040, 0x0007), two(0xF1C0, 0xFFFF), "Ii@s"},
-{"fsseq", two(0xF040, 0x0011), two(0xF1C0, 0xFFFF), "Ii@s"},
-{"fssf", two(0xF040, 0x0010), two(0xF1C0, 0xFFFF), "Ii@s"},
-{"fssne", two(0xF040, 0x001E), two(0xF1C0, 0xFFFF), "Ii@s"},
-{"fsst", two(0xF040, 0x001F), two(0xF1C0, 0xFFFF), "Ii@s"},
-{"fst", two(0xF040, 0x000F), two(0xF1C0, 0xFFFF), "Ii@s"},
-{"fsueq", two(0xF040, 0x0009), two(0xF1C0, 0xFFFF), "Ii@s"},
-{"fsuge", two(0xF040, 0x000B), two(0xF1C0, 0xFFFF), "Ii@s"},
-{"fsugt", two(0xF040, 0x000A), two(0xF1C0, 0xFFFF), "Ii@s"},
-{"fsule", two(0xF040, 0x000D), two(0xF1C0, 0xFFFF), "Ii@s"},
-{"fsult", two(0xF040, 0x000C), two(0xF1C0, 0xFFFF), "Ii@s"},
-{"fsun", two(0xF040, 0x0008), two(0xF1C0, 0xFFFF), "Ii@s"},
+/* $ is necessary to prevent the assembler from using PC-relative.
+ If @ were used, "label: fseq label" could produce "ftrapeq",
+ because "label" became "pc@label". */
+{"fseq", two(0xF040, 0x0001), two(0xF1C0, 0xFFFF), "Ii$s"},
+{"fsf", two(0xF040, 0x0000), two(0xF1C0, 0xFFFF), "Ii$s"},
+{"fsge", two(0xF040, 0x0013), two(0xF1C0, 0xFFFF), "Ii$s"},
+{"fsgl", two(0xF040, 0x0016), two(0xF1C0, 0xFFFF), "Ii$s"},
+{"fsgle", two(0xF040, 0x0017), two(0xF1C0, 0xFFFF), "Ii$s"},
+{"fsgt", two(0xF040, 0x0012), two(0xF1C0, 0xFFFF), "Ii$s"},
+{"fsle", two(0xF040, 0x0015), two(0xF1C0, 0xFFFF), "Ii$s"},
+{"fslt", two(0xF040, 0x0014), two(0xF1C0, 0xFFFF), "Ii$s"},
+{"fsne", two(0xF040, 0x000E), two(0xF1C0, 0xFFFF), "Ii$s"},
+{"fsnge", two(0xF040, 0x001C), two(0xF1C0, 0xFFFF), "Ii$s"},
+{"fsngl", two(0xF040, 0x0019), two(0xF1C0, 0xFFFF), "Ii$s"},
+{"fsngle", two(0xF040, 0x0018), two(0xF1C0, 0xFFFF), "Ii$s"},
+{"fsngt", two(0xF040, 0x001D), two(0xF1C0, 0xFFFF), "Ii$s"},
+{"fsnle", two(0xF040, 0x001A), two(0xF1C0, 0xFFFF), "Ii$s"},
+{"fsnlt", two(0xF040, 0x001B), two(0xF1C0, 0xFFFF), "Ii$s"},
+{"fsoge", two(0xF040, 0x0003), two(0xF1C0, 0xFFFF), "Ii$s"},
+{"fsogl", two(0xF040, 0x0006), two(0xF1C0, 0xFFFF), "Ii$s"},
+{"fsogt", two(0xF040, 0x0002), two(0xF1C0, 0xFFFF), "Ii$s"},
+{"fsole", two(0xF040, 0x0005), two(0xF1C0, 0xFFFF), "Ii$s"},
+{"fsolt", two(0xF040, 0x0004), two(0xF1C0, 0xFFFF), "Ii$s"},
+{"fsor", two(0xF040, 0x0007), two(0xF1C0, 0xFFFF), "Ii$s"},
+{"fsseq", two(0xF040, 0x0011), two(0xF1C0, 0xFFFF), "Ii$s"},
+{"fssf", two(0xF040, 0x0010), two(0xF1C0, 0xFFFF), "Ii$s"},
+{"fssne", two(0xF040, 0x001E), two(0xF1C0, 0xFFFF), "Ii$s"},
+{"fsst", two(0xF040, 0x001F), two(0xF1C0, 0xFFFF), "Ii$s"},
+{"fst", two(0xF040, 0x000F), two(0xF1C0, 0xFFFF), "Ii$s"},
+{"fsueq", two(0xF040, 0x0009), two(0xF1C0, 0xFFFF), "Ii$s"},
+{"fsuge", two(0xF040, 0x000B), two(0xF1C0, 0xFFFF), "Ii$s"},
+{"fsugt", two(0xF040, 0x000A), two(0xF1C0, 0xFFFF), "Ii$s"},
+{"fsule", two(0xF040, 0x000D), two(0xF1C0, 0xFFFF), "Ii$s"},
+{"fsult", two(0xF040, 0x000C), two(0xF1C0, 0xFFFF), "Ii$s"},
+{"fsun", two(0xF040, 0x0008), two(0xF1C0, 0xFFFF), "Ii$s"},
{"fsgldivb", two(0xF000, 0x5824), two(0xF1C0, 0xFC7F), "Ii;bF7"},
{"fsgldivd", two(0xF000, 0x5424), two(0xF1C0, 0xFC7F), "Ii;FF7"},
diff --git a/gdb/m68k-pinsn.c b/gdb/m68k-pinsn.c
index 22fa5d7..8d474a9 100644
--- a/gdb/m68k-pinsn.c
+++ b/gdb/m68k-pinsn.c
@@ -795,28 +795,31 @@ convert_from_68881 (from, to)
*to = 0.0;
return;
}
+ else
+ {
#ifdef HPUX_ASM
- asm ("mov.l 8(%a6),%a0");
- asm ("mov.l 12(%a6),%a1");
- asm ("fmove.x (%a0),%fp0");
- asm ("fmove.d %fp0,(%a1)");
+ asm ("mov.l 8(%a6),%a0");
+ asm ("mov.l 12(%a6),%a1");
+ asm ("fmove.x (%a0),%fp0");
+ asm ("fmove.d %fp0,(%a1)");
#else /* not HPUX_ASM */
#if 0
- asm ("movl a6@(8),a0");
- asm ("movl a6@(12),a1");
- asm ("fmovex a0@,fp0");
- asm ("fmoved fp0,a1@");
+ asm ("movl a6@(8),a0");
+ asm ("movl a6@(12),a1");
+ asm ("fmovex a0@,fp0");
+ asm ("fmoved fp0,a1@");
#else
- /* Hand-assemble those insns since some assemblers lose
- and some have different syntax. */
- asm (".word 020156");
- asm (".word 8");
- asm (".word 021156");
- asm (".word 12");
- asm (".long 0xf2104800");
- asm (".long 0xf2117400");
+ /* Hand-assemble those insns since some assemblers lose
+ and some have different syntax. */
+ asm (".word 020156");
+ asm (".word 8");
+ asm (".word 021156");
+ asm (".word 12");
+ asm (".long 0xf2104800");
+ asm (".long 0xf2117400");
#endif
#endif /* not HPUX_ASM */
+ }
}
/* The converse: convert the double *FROM to an extended float
@@ -828,27 +831,30 @@ convert_to_68881 (from, to)
{
if (!have_fpu)
return;
+ else
+ {
#ifdef HPUX_ASM
- asm ("mov.l 8(%a6),%a0");
- asm ("mov.l 12(%a6),%a1");
- asm ("fmove.d (%a0),%fp0");
- asm ("fmove.x %fp0,(%a1)");
+ asm ("mov.l 8(%a6),%a0");
+ asm ("mov.l 12(%a6),%a1");
+ asm ("fmove.d (%a0),%fp0");
+ asm ("fmove.x %fp0,(%a1)");
#else /* not HPUX_ASM */
#if 0
- asm ("movl a6@(8),a0");
- asm ("movl a6@(12),a1");
- asm ("fmoved a0@,fp0");
- asm ("fmovex fp0,a1@");
+ asm ("movl a6@(8),a0");
+ asm ("movl a6@(12),a1");
+ asm ("fmoved a0@,fp0");
+ asm ("fmovex fp0,a1@");
#else
- /* Hand-assemble those insns since some assemblers lose. */
- asm (".word 020156");
- asm (".word 8");
- asm (".word 021156");
- asm (".word 12");
- asm (".long 0xf2105400");
- asm (".long 0xf2116800");
+ /* Hand-assemble those insns since some assemblers lose. */
+ asm (".word 020156");
+ asm (".word 8");
+ asm (".word 021156");
+ asm (".word 12");
+ asm (".long 0xf2105400");
+ asm (".long 0xf2116800");
#endif
#endif /* not HPUX_ASM */
+ }
}
static jmp_buf fpu_check;
diff --git a/gdb/main.c b/gdb/main.c
index 12282d5..bd78f59 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License
along with GDB; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+#include <stdio.h>
#include "defs.h"
#include "command.h"
#include "param.h"
@@ -27,7 +28,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#endif
#include <sys/file.h>
-#include <stdio.h>
#include <setjmp.h>
#include <signal.h>
#include <sys/param.h>
@@ -239,6 +239,12 @@ main (argc, argv, envp)
int batch = 0;
register int i;
+#if defined (ALIGN_STACK_ON_STARTUP)
+ i = (int) &count & 0x3;
+ if (i != 0)
+ alloca (4 - i);
+#endif
+
quit_flag = 0;
linesize = 100;
line = (char *) xmalloc (linesize);
@@ -276,7 +282,38 @@ main (argc, argv, envp)
frame_file_full_name = 1;
else if (!strcmp (argv[i], "-xgdb_verbose"))
xgdb_verbose = 1;
+ /* -help: print a summary of command line switches. */
+ else if (!strcmp (argv[i], "-help"))
+ {
+ fputs ("\
+This is GDB, the GNU debugger. Use the command\n\
+ gdb [options] [executable [core-file]]\n\
+to enter the debugger.\n\
+\n\
+Options available are:\n\
+ -help Print this message.\n\
+ -quiet Do not print version number on startup.\n\
+ -fullname Output information used by emacs-GDB interface.\n\
+ -batch Exit after processing options.\n\
+ -nx Do not read .gdbinit file.\n\
+ -tty TTY Use TTY for input/output by the program being debugged.\n\
+ -cd DIR Change current directory to DIR.\n\
+ -directory DIR Search for source files in DIR.\n\
+ -command FILE Execute GDB commands from FILE.\n\
+ -symbols SYMFILE Read symbols from SYMFILE.\n\
+ -exec EXECFILE Use EXECFILE as the executable.\n\
+ -se FILE Use FILE as symbol file and executable file.\n\
+ -core COREFILE Analyze the core dump COREFILE.\n\
+\n\
+For more information, type \"help\" from within GDB, or consult the\n\
+GDB manual (available as on-line info or a printed manual).\n", stderr);
+ /* Exiting after printing this message seems like
+ the most useful thing to do. */
+ exit (0);
+ }
else if (argv[i][0] == '-')
+ /* Other options take arguments, so don't confuse an
+ argument with an option. */
i++;
}
@@ -307,7 +344,8 @@ main (argc, argv, envp)
if (!strcmp (arg, "-q") || !strcmp (arg, "-nx")
|| !strcmp (arg, "-quiet") || !strcmp (arg, "-batch")
|| !strcmp (arg, "-fullname") || !strcmp (arg, "-nw")
- || !strcmp (arg, "-xgdb_verbose"))
+ || !strcmp (arg, "-xgdb_verbose")
+ || !strcmp (arg, "-help"))
/* Already processed above */
continue;
@@ -348,35 +386,6 @@ main (argc, argv, envp)
else if (!strcmp (arg, "-t") || !strcmp (arg, "-tty"))
tty_command (argv[i], 0);
- /* -help: print a summary of command line switches. */
- else if (!strcmp (arg, "-help"))
- {
- fputs ("\
-This is GDB, the GNU debugger. Use the command\n\
- gdb [options] [executable [core-file]]\n\
-to enter the debugger.\n\
-\n\
-Options available are:\n\
- -help Print this message.\n\
- -quiet Do not print version number on startup.\n\
- -fullname Output information used by emacs-GDB interface.\n\
- -batch Exit after processing options.\n\
- -nx Do not read .gdbinit file.\n\
- -tty TTY Use TTY for input/output by the program being debugged.\n\
- -cd DIR Change current directory to DIR.\n\
- -directory DIR Search for source files in DIR.\n\
- -command FILE Execute GDB commands from FILE.\n\
- -symbols SYMFILE Read symbols from SYMFILE.\n\
- -exec EXECFILE Use EXECFILE as the executable.\n\
- -se FILE Use FILE as symbol file and executable file.\n\
- -core COREFILE Analyze the core dump COREFILE.\n\
-\n\
-For more information, type \"help\" from within GDB, or consult the\n\
-GDB manual (available as on-line info or a printed manual).\n", stderr);
- /* Exiting after printing this message seems like
- the most useful thing to do. */
- exit (0);
- }
else
error ("Unknown command-line switch: \"%s\"\n", arg);
}
diff --git a/gdb/news-dep.c b/gdb/news-dep.c
index ff4397c..d4e0f54 100644
--- a/gdb/news-dep.c
+++ b/gdb/news-dep.c
@@ -17,12 +17,12 @@ You should have received a copy of the GNU General Public License
along with GDB; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+#include <stdio.h>
#include "defs.h"
#include "param.h"
#include "frame.h"
#include "inferior.h"
-#include <stdio.h>
#include <sys/param.h>
#include <sys/dir.h>
#include <signal.h>
@@ -538,10 +538,12 @@ exec_file_command (filename, from_tty)
if (read_aout_hdr (execchan, &exec_aouthdr, aout_hdrsize) < 0)
error ("\"%s\": can't read optional aouthdr", execfile);
- if (read_section_hdr (execchan, _TEXT, &text_hdr, num_sections) < 0)
+ if (read_section_hdr (execchan, _TEXT, &text_hdr, num_sections,
+ aout_hdrsize) < 0)
error ("\"%s\": can't read text section header", execfile);
- if (read_section_hdr (execchan, _DATA, &data_hdr, num_sections) < 0)
+ if (read_section_hdr (execchan, _DATA, &data_hdr, num_sections,
+ aout_hdrsize) < 0)
error ("\"%s\": can't read data section header", execfile);
text_start = exec_aouthdr.text_start;
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index 269ec4b..dc9803e 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -1233,7 +1233,9 @@ print_frame_args (func, fi, num, stream)
register int last_regparm = 0;
register struct symbol *lastsym, *sym, *nextsym;
register value val;
- CORE_ADDR highest_offset = 0;
+ /* Offset of stack argument that is at the highest offset.
+ -1 if we haven't come to a stack argument yet. */
+ CORE_ADDR highest_offset = (CORE_ADDR) -1;
register CORE_ADDR addr = FRAME_ARGS_ADDRESS (fi);
if (func)
@@ -1273,10 +1275,12 @@ print_frame_args (func, fi, num, stream)
current_offset
= (((current_offset + sizeof (int) - 1) / sizeof (int))
* sizeof (int));
-
- if ((current_offset
- + (arg_size - sizeof (int) + 3) / (sizeof (int)))
- > highest_offset)
+
+ /* If this is the highest offset seen yet, set highest_offset. */
+ if (highest_offset == (CORE_ADDR)-1
+ || ((current_offset
+ + (arg_size - sizeof (int) + 3) / (sizeof (int)))
+ > highest_offset))
highest_offset = current_offset;
}
@@ -1284,6 +1288,32 @@ print_frame_args (func, fi, num, stream)
fprintf_filtered (stream, ", ");
fputs_filtered (SYMBOL_NAME (sym), stream);
fputs_filtered ("=", stream);
+
+/* Nonzero if a LOC_ARG which is a struct is useless. */
+#if !defined (STRUCT_ARG_SYM_GARBAGE)
+#define STRUCT_ARG_SYM_GARBAGE(gcc_p) 0
+#endif
+
+ if (STRUCT_ARG_SYM_GARBAGE (b->gcc_compile_flag)
+ && TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_STRUCT
+ && SYMBOL_CLASS (sym) == LOC_ARG)
+ {
+ /* Try looking up that name. SunOS4 puts out a usable
+ symbol as a local variable (in addition to the one
+ for the arg). */
+ struct symbol *sym2 =
+ lookup_symbol (SYMBOL_NAME (sym), b, VAR_NAMESPACE, 0);
+
+ if (sym2 != NULL)
+ val = value_of_variable (sym2);
+ else
+ {
+ fputs_filtered ("?", stream);
+ first = 0;
+ continue;
+ }
+ }
+
value_print (val, stream, 0, Val_no_prettyprint);
first = 0;
}
@@ -1292,7 +1322,8 @@ print_frame_args (func, fi, num, stream)
enough about the stack to find them. */
if (num != -1)
{
- if (i && num * sizeof (int) + FRAME_ARGS_SKIP > highest_offset)
+ if (highest_offset != (CORE_ADDR) -1
+ && num * sizeof (int) + FRAME_ARGS_SKIP > highest_offset)
print_frame_nameless_args (addr,
highest_offset + sizeof (int),
num * sizeof (int) + FRAME_ARGS_SKIP,
diff --git a/gdb/pyr-dep.c b/gdb/pyr-dep.c
new file mode 100644
index 0000000..0e7156d
--- /dev/null
+++ b/gdb/pyr-dep.c
@@ -0,0 +1,819 @@
+/* Low level interface to ptrace, for GDB when running under Unix.
+ Copyright (C) 1988, 1989 Free Software Foundation, Inc.
+
+This file is part of GDB.
+
+GDB 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 1, or (at your option)
+any later version.
+
+GDB 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 GDB; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <stdio.h>
+#include "defs.h"
+#include "param.h"
+#include "frame.h"
+#include "inferior.h"
+
+#include <sys/param.h>
+#include <sys/dir.h>
+#include <signal.h>
+#include <sys/ioctl.h>
+/* #include <fcntl.h> Can we live without this? */
+
+#include <a.out.h>
+#ifndef N_SET_MAGIC
+#define N_SET_MAGIC(exec, val) ((exec).a_magic = (val))
+#endif
+
+#include <sys/user.h> /* After a.out.h */
+#include <sys/file.h>
+#include <sys/stat.h>
+
+extern int errno;
+
+/* This function simply calls ptrace with the given arguments.
+ It exists so that all calls to ptrace are isolated in this
+ machine-dependent file. */
+int
+call_ptrace (request, pid, arg3, arg4)
+ int request, pid, arg3, arg4;
+{
+ return ptrace (request, pid, arg3, arg4);
+}
+
+kill_inferior ()
+{
+ if (remote_debugging)
+ return;
+ if (inferior_pid == 0)
+ return;
+ ptrace (8, inferior_pid, 0, 0);
+ wait (0);
+ inferior_died ();
+}
+
+/* This is used when GDB is exiting. It gives less chance of error.*/
+
+kill_inferior_fast ()
+{
+ if (remote_debugging)
+ return;
+ if (inferior_pid == 0)
+ return;
+ ptrace (8, inferior_pid, 0, 0);
+ wait (0);
+}
+
+/* Resume execution of the inferior process.
+ If STEP is nonzero, single-step it.
+ If SIGNAL is nonzero, give it that signal. */
+
+void
+resume (step, signal)
+ int step;
+ int signal;
+{
+ errno = 0;
+ if (remote_debugging)
+ remote_resume (step, signal);
+ else
+ {
+ ptrace (step ? 9 : 7, inferior_pid, 1, signal);
+ if (errno)
+ perror_with_name ("ptrace");
+ }
+}
+
+void
+fetch_inferior_registers ()
+{
+ register int regno, datum;
+ register unsigned int regaddr;
+ int reg_buf[NUM_REGS+1];
+ struct user u;
+ register int skipped_frames = 0;
+
+ if (remote_debugging)
+ remote_fetch_registers ();
+ else
+ {
+ for (regno = 0; regno < 64; regno++) {
+ reg_buf[regno] = ptrace (3, inferior_pid, regno, 0);
+
+#if defined(PYRAMID_CONTROL_FRAME_DEBUGGING)
+ printf ("Fetching %s from inferior, got %0x\n",
+ reg_names[regno],
+ reg_buf[regno]);
+#endif /* PYRAMID_CONTROL_FRAME_DEBUGGING */
+
+ if (reg_buf[regno] == -1 && errno == EIO) {
+ printf("fetch_interior_registers: fetching %s from inferior\n",
+ reg_names[regno]);
+ errno = 0;
+ }
+ supply_register (regno, reg_buf+regno);
+ }
+ /* that leaves regs 64, 65, and 66 */
+ datum = ptrace (3, inferior_pid,
+ ((char *)&u.u_pcb.pcb_csp) -
+ ((char *)&u), 0);
+
+
+
+ /* FIXME: Find the Current Frame Pointer (CFP). CFP is a global
+ register (ie, NOT windowed), that gets saved in a frame iff
+ the code for that frame has a prologue (ie, "adsf N"). If
+ there is a prologue, the adsf insn saves the old cfp in
+ pr13, cfp is set to sp, and N bytes of locals are allocated
+ (sp is decremented by n).
+ This makes finding CFP hard. I guess the right way to do it
+ is:
+ - If this is the innermost frame, believe ptrace() or
+ the core area.
+ - Otherwise:
+ Find the first insn of the current frame.
+ - find the saved pc;
+ - find the call insn that saved it;
+ - figure out where the call is to;
+ - if the first insn is an adsf, we got a frame
+ pointer. */
+
+
+ /* Normal processors have separate stack pointers for user and
+ kernel mode. Getting the last user mode frame on such
+ machines is easy: the kernel context of the ptrace()'d
+ process is on the kernel stack, and the USP points to what
+ we want. But Pyramids only have a single cfp for both user and
+ kernel mode. And processes being ptrace()'d have some
+ kernel-context control frames on their stack.
+ To avoid tracing back into the kernel context of an inferior,
+ we skip 0 or more contiguous control frames where the pc is
+ in the kernel. */
+
+ while (1) {
+ register int inferior_saved_pc;
+ inferior_saved_pc = ptrace (1, inferior_pid, datum+((32+15)*4), 0);
+ if (inferior_saved_pc > 0) break;
+#if defined(PYRAMID_CONTROL_FRAME_DEBUGGING)
+ printf("skipping kernel frame %08x, pc=%08x\n", datum,
+ inferior_saved_pc);
+#endif /* PYRAMID_CONTROL_FRAME_DEBUGGING */
+ skipped_frames++;
+ datum -= CONTROL_STACK_FRAME_SIZE;
+ }
+
+ reg_buf[CSP_REGNUM] = datum;
+ supply_register(CSP_REGNUM, reg_buf+CSP_REGNUM);
+#ifdef PYRAMID_CONTROL_FRAME_DEBUGGING
+ if (skipped_frames) {
+ fprintf (stderr,
+ "skipped %d frames from %x to %x; cfp was %x, now %x\n",
+ skipped_frames, reg_buf[CSP_REGNUM]);
+ }
+#endif /* PYRAMID_CONTROL_FRAME_DEBUGGING */
+ }
+}
+
+/* Store our register values back into the inferior.
+ If REGNO is -1, do this for all registers.
+ Otherwise, REGNO specifies which register (so we can save time). */
+
+store_inferior_registers (regno)
+ int regno;
+{
+ register unsigned int regaddr;
+ char buf[80];
+
+ if (regno >= 0)
+ {
+ if ((0 <= regno) && (regno < 64)) {
+ /*regaddr = register_addr (regno, offset);*/
+ regaddr = regno;
+ errno = 0;
+ ptrace (6, inferior_pid, regaddr, read_register (regno));
+ if (errno != 0)
+ {
+ sprintf (buf, "writing register number %d", regno);
+ perror_with_name (buf);
+ }
+ }
+ }
+ else for (regno = 0; regno < NUM_REGS; regno++)
+ {
+ /*regaddr = register_addr (regno, offset);*/
+ regaddr = regno;
+ errno = 0;
+ ptrace (6, inferior_pid, regaddr, read_register (regno));
+ if (errno != 0)
+ {
+ sprintf (buf, "writing all regs, number %d", regno);
+ perror_with_name (buf);
+ }
+ }
+}
+
+/* Copy LEN bytes from inferior's memory starting at MEMADDR
+ to debugger memory starting at MYADDR.
+ On failure (cannot read from inferior, usually because address is out
+ of bounds) returns the value of errno. */
+
+int
+read_inferior_memory (memaddr, myaddr, len)
+ CORE_ADDR memaddr;
+ char *myaddr;
+ int len;
+{
+ register int i;
+ /* Round starting address down to longword boundary. */
+ register CORE_ADDR addr = memaddr & - sizeof (int);
+ /* Round ending address up; get number of longwords that makes. */
+ register int count
+ = (((memaddr + len) - addr) + sizeof (int) - 1) / sizeof (int);
+ /* Allocate buffer of that many longwords. */
+ register int *buffer = (int *) alloca (count * sizeof (int));
+ extern int errno;
+
+ /* Read all the longwords */
+ for (i = 0; i < count; i++, addr += sizeof (int))
+ {
+ errno = 0;
+#if 0
+/*This is now done by read_memory, because when this function did it,
+ reading a byte or short int hardware port read whole longs, causing
+ serious side effects
+ such as bus errors and unexpected hardware operation. This would
+ also be a problem with ptrace if the inferior process could read
+ or write hardware registers, but that's not usually the case. */
+ if (remote_debugging)
+ buffer[i] = remote_fetch_word (addr);
+ else
+#endif
+ buffer[i] = ptrace (1, inferior_pid, addr, 0);
+ if (errno)
+ return errno;
+ }
+
+ /* Copy appropriate bytes out of the buffer. */
+ bcopy ((char *) buffer + (memaddr & (sizeof (int) - 1)), myaddr, len);
+ return 0;
+}
+
+/* Copy LEN bytes of data from debugger memory at MYADDR
+ to inferior's memory at MEMADDR.
+ On failure (cannot write the inferior)
+ returns the value of errno. */
+
+int
+write_inferior_memory (memaddr, myaddr, len)
+ CORE_ADDR memaddr;
+ char *myaddr;
+ int len;
+{
+ register int i;
+ /* Round starting address down to longword boundary. */
+ register CORE_ADDR addr = memaddr & - sizeof (int);
+ /* Round ending address up; get number of longwords that makes. */
+ register int count
+ = (((memaddr + len) - addr) + sizeof (int) - 1) / sizeof (int);
+ /* Allocate buffer of that many longwords. */
+ register int *buffer = (int *) alloca (count * sizeof (int));
+ extern int errno;
+
+ /* Fill start and end extra bytes of buffer with existing memory data. */
+
+ if (remote_debugging)
+ buffer[0] = remote_fetch_word (addr);
+ else
+ buffer[0] = ptrace (1, inferior_pid, addr, 0);
+
+ if (count > 1)
+ {
+ if (remote_debugging)
+ buffer[count - 1]
+ = remote_fetch_word (addr + (count - 1) * sizeof (int));
+ else
+ buffer[count - 1]
+ = ptrace (1, inferior_pid,
+ addr + (count - 1) * sizeof (int), 0);
+ }
+
+ /* Copy data to be written over corresponding part of buffer */
+
+ bcopy (myaddr, (char *) buffer + (memaddr & (sizeof (int) - 1)), len);
+
+ /* Write the entire buffer. */
+
+ for (i = 0; i < count; i++, addr += sizeof (int))
+ {
+ errno = 0;
+ if (remote_debugging)
+ remote_store_word (addr, buffer[i]);
+ else
+ ptrace (4, inferior_pid, addr, buffer[i]);
+ if (errno)
+ return errno;
+ }
+
+ return 0;
+}
+
+/*** Extensions to core and dump files, for GDB. */
+
+extern unsigned int last_frame_offset;
+
+#ifdef PYRAMID_CORE
+
+/* Can't make definitions here static, since core.c needs them
+ to do bounds checking on the core-file areas. O well. */
+
+/* have two stacks: one for data, one for register windows. */
+extern CORE_ADDR reg_stack_start;
+extern CORE_ADDR reg_stack_end;
+
+/* need this so we can find the global registers: they never get saved. */
+static CORE_ADDR global_reg_offset;
+static CORE_ADDR last_frame_address;
+static CORE_ADDR last_frame_offset;
+
+
+/* Address in core file of start of register window stack area.
+ Don't know if is this any of meaningful, useful or necessary. */
+static CORE_ADDR reg_stack_offset;
+
+#endif /* PYRAMID_CORE */
+
+
+/* Work with core dump and executable files, for GDB.
+ This code would be in core.c if it weren't machine-dependent. */
+
+#ifndef N_TXTADDR
+#define N_TXTADDR(hdr) 0
+#endif /* no N_TXTADDR */
+
+#ifndef N_DATADDR
+#define N_DATADDR(hdr) hdr.a_text
+#endif /* no N_DATADDR */
+
+/* Make COFF and non-COFF names for things a little more compatible
+ to reduce conditionals later. */
+
+#ifdef COFF_FORMAT
+#define a_magic magic
+#endif
+
+#ifndef COFF_FORMAT
+#ifndef AOUTHDR
+#define AOUTHDR struct exec
+#endif
+#endif
+
+extern char *sys_siglist[];
+
+
+/* Hook for `exec_file_command' command to call. */
+
+extern void (*exec_file_display_hook) ();
+
+/* File names of core file and executable file. */
+
+extern char *corefile;
+extern char *execfile;
+
+/* Descriptors on which core file and executable file are open.
+ Note that the execchan is closed when an inferior is created
+ and reopened if the inferior dies or is killed. */
+
+extern int corechan;
+extern int execchan;
+
+/* Last modification time of executable file.
+ Also used in source.c to compare against mtime of a source file. */
+
+extern int exec_mtime;
+
+/* Virtual addresses of bounds of the two areas of memory in the core file. */
+
+extern CORE_ADDR data_start;
+extern CORE_ADDR data_end;
+extern CORE_ADDR stack_start;
+extern CORE_ADDR stack_end;
+
+#ifdef PYRAMID_CORE
+/* Well, "two areas of memory" on most machines; but pyramids have a
+ third area, for the register-window stack, and we need its
+ base and bound too. */
+
+extern CORE_ADDR reg_stack_start;
+extern CORE_ADDR reg_stack_start;
+#endif /* PYRAMID_CORE */
+
+/* Virtual addresses of bounds of two areas of memory in the exec file.
+ Note that the data area in the exec file is used only when there is no core file. */
+
+extern CORE_ADDR text_start;
+extern CORE_ADDR text_end;
+
+extern CORE_ADDR exec_data_start;
+extern CORE_ADDR exec_data_end;
+
+/* Address in executable file of start of text area data. */
+
+extern int text_offset;
+
+/* Address in executable file of start of data area data. */
+
+extern int exec_data_offset;
+
+/* Address in core file of start of data area data. */
+
+extern int data_offset;
+
+/* Address in core file of start of stack area data. */
+
+extern int stack_offset;
+
+#ifdef COFF_FORMAT
+/* various coff data structures */
+
+extern FILHDR file_hdr;
+extern SCNHDR text_hdr;
+extern SCNHDR data_hdr;
+
+#endif /* not COFF_FORMAT */
+
+/* a.out header saved in core file. */
+
+extern AOUTHDR core_aouthdr;
+
+/* a.out header of exec file. */
+
+extern AOUTHDR exec_aouthdr;
+
+extern void validate_files ();
+
+core_file_command (filename, from_tty)
+ char *filename;
+ int from_tty;
+{
+ int val;
+ extern char registers[];
+
+ /* Discard all vestiges of any previous core file
+ and mark data and stack spaces as empty. */
+
+ if (corefile)
+ free (corefile);
+ corefile = 0;
+
+ if (corechan >= 0)
+ close (corechan);
+ corechan = -1;
+
+ data_start = 0;
+ data_end = 0;
+ stack_start = STACK_END_ADDR;
+ stack_end = STACK_END_ADDR;
+
+#ifdef PYRAMID_CORE
+ reg_stack_start = CONTROL_STACK_ADDR;
+ reg_stack_end = CONTROL_STACK_ADDR; /* this isn't strictly true...*/
+#endif /* PYRAMID_CORE */
+
+ /* Now, if a new core file was specified, open it and digest it. */
+
+ if (filename)
+ {
+ filename = tilde_expand (filename);
+ make_cleanup (free, filename);
+
+ if (have_inferior_p ())
+ error ("To look at a core file, you must kill the inferior with \"kill\".");
+ corechan = open (filename, O_RDONLY, 0);
+ if (corechan < 0)
+ perror_with_name (filename);
+ /* 4.2-style (and perhaps also sysV-style) core dump file. */
+ {
+ struct user u;
+
+ unsigned int reg_offset;
+
+ val = myread (corechan, &u, sizeof u);
+ if (val < 0)
+ perror_with_name ("Not a core file: reading upage");
+ if (val != sizeof u)
+ error ("Not a core file: could only read %d bytes", val);
+ data_start = exec_data_start;
+
+ data_end = data_start + NBPG * u.u_dsize;
+ data_offset = NBPG * UPAGES;
+ stack_offset = NBPG * (UPAGES + u.u_dsize);
+
+ /* find registers in core file */
+#ifdef PYRAMID_PTRACE
+ stack_start = stack_end - NBPG * u.u_ussize;
+ reg_stack_offset = stack_offset + (NBPG *u.u_ussize);
+ reg_stack_end = reg_stack_start + NBPG * u.u_cssize;
+
+ last_frame_address = ((int) u.u_pcb.pcb_csp);
+ last_frame_offset = reg_stack_offset + last_frame_address
+ - CONTROL_STACK_ADDR ;
+ global_reg_offset = (char *)&u - (char *)&u.u_pcb.pcb_gr0 ;
+
+ /* skip any control-stack frames that were executed in the
+ kernel. */
+
+ while (1) {
+ char buf[4];
+ val = lseek (corechan, last_frame_offset+(47*4), 0);
+ if (val < 0)
+ perror_with_name (filename);
+ val = myread (corechan, buf, sizeof buf);
+ if (val < 0)
+ perror_with_name (filename);
+
+ if (*(int *)buf >= 0)
+ break;
+ printf ("skipping frame %0x\n", last_frame_address);
+ last_frame_offset -= CONTROL_STACK_FRAME_SIZE;
+ last_frame_address -= CONTROL_STACK_FRAME_SIZE;
+ }
+ reg_offset = last_frame_offset;
+
+#if 1 || defined(PYRAMID_CONTROL_FRAME_DEBUGGING)
+ printf ("Control stack pointer = 0x%08x\n",
+ u.u_pcb.pcb_csp);
+ printf ("offset to control stack %d outermost frame %d (%0x)\n",
+ reg_stack_offset, reg_offset, last_frame_address);
+#endif /* PYRAMID_CONTROL_FRAME_DEBUGGING */
+
+#else /* not PYRAMID_CORE */
+ stack_start = stack_end - NBPG * u.u_ssize;
+ reg_offset = (int) u.u_ar0 - KERNEL_U_ADDR;
+#endif /* not PYRAMID_CORE */
+
+#ifdef __not_on_pyr_yet
+ /* Some machines put an absolute address in here and some put
+ the offset in the upage of the regs. */
+ reg_offset = (int) u.u_ar0;
+ if (reg_offset > NBPG * UPAGES)
+ reg_offset -= KERNEL_U_ADDR;
+#endif
+
+ /* I don't know where to find this info.
+ So, for now, mark it as not available. */
+ N_SET_MAGIC (core_aouthdr, 0);
+
+ /* Read the register values out of the core file and store
+ them where `read_register' will find them. */
+
+ {
+ register int regno;
+
+ for (regno = 0; regno < 64; regno++)
+ {
+ char buf[MAX_REGISTER_RAW_SIZE];
+
+ val = lseek (corechan, register_addr (regno, reg_offset), 0);
+ if (val < 0
+ || (val = myread (corechan, buf, sizeof buf)) < 0)
+ {
+ char * buffer = (char *) alloca (strlen (reg_names[regno])
+ + 30);
+ strcpy (buffer, "Reading register ");
+ strcat (buffer, reg_names[regno]);
+
+ perror_with_name (buffer);
+ }
+
+ if (val < 0)
+ perror_with_name (filename);
+#ifdef PYRAMID_CONTROL_FRAME_DEBUGGING
+ printf ("[reg %s(%d), offset in file %s=0x%0x, addr =0x%0x, =%0x]\n",
+ reg_names[regno], regno, filename,
+ register_addr(regno, reg_offset),
+ regno * 4 + last_frame_address,
+ *((int *)buf));
+#endif /* PYRAMID_CONTROL_FRAME_DEBUGGING */
+ supply_register (regno, buf);
+ }
+ }
+ }
+ if (filename[0] == '/')
+ corefile = savestring (filename, strlen (filename));
+ else
+ {
+ corefile = concat (current_directory, "/", filename);
+ }
+
+#if 1 || defined(PYRAMID_CONTROL_FRAME_DEBUGGING)
+ printf ("Providing CSP (%0x) as nominal address of current frame.\n",
+ last_frame_address);
+#endif PYRAMID_CONTROL_FRAME_DEBUGGING
+ /* FIXME: Which of the following is correct? */
+#if 0
+ set_current_frame ( create_new_frame (read_register (FP_REGNUM),
+ read_pc ()));
+#else
+ set_current_frame ( create_new_frame (last_frame_address,
+ read_pc ()));
+#endif
+
+ select_frame (get_current_frame (), 0);
+ validate_files ();
+ }
+ else if (from_tty)
+ printf ("No core file now.\n");
+}
+
+exec_file_command (filename, from_tty)
+ char *filename;
+ int from_tty;
+{
+ int val;
+
+ /* Eliminate all traces of old exec file.
+ Mark text segment as empty. */
+
+ if (execfile)
+ free (execfile);
+ execfile = 0;
+ data_start = 0;
+ data_end -= exec_data_start;
+ text_start = 0;
+ text_end = 0;
+ exec_data_start = 0;
+ exec_data_end = 0;
+ if (execchan >= 0)
+ close (execchan);
+ execchan = -1;
+
+ /* Now open and digest the file the user requested, if any. */
+
+ if (filename)
+ {
+ filename = tilde_expand (filename);
+ make_cleanup (free, filename);
+
+ execchan = openp (getenv ("PATH"), 1, filename, O_RDONLY, 0,
+ &execfile);
+ if (execchan < 0)
+ perror_with_name (filename);
+
+#ifdef COFF_FORMAT
+#else /* not COFF_FORMAT */
+ {
+ struct stat st_exec;
+
+#ifdef gould
+#endif /* gould */
+ val = myread (execchan, &exec_aouthdr, sizeof (AOUTHDR));
+
+ if (val < 0)
+ perror_with_name (filename);
+
+ text_start = N_TXTADDR (exec_aouthdr);
+ exec_data_start = N_DATADDR (exec_aouthdr);
+#ifdef gould
+#else
+ text_offset = N_TXTOFF (exec_aouthdr);
+ exec_data_offset = N_TXTOFF (exec_aouthdr) + exec_aouthdr.a_text;
+#endif
+ text_end = text_start + exec_aouthdr.a_text;
+ exec_data_end = exec_data_start + exec_aouthdr.a_data;
+ data_start = exec_data_start;
+ data_end += exec_data_start;
+
+ fstat (execchan, &st_exec);
+ exec_mtime = st_exec.st_mtime;
+ }
+#endif /* not COFF_FORMAT */
+
+ validate_files ();
+ }
+ else if (from_tty)
+ printf ("No exec file now.\n");
+
+ /* Tell display code (if any) about the changed file name. */
+ if (exec_file_display_hook)
+ (*exec_file_display_hook) (filename);
+}
+
+/*** Prettier register printing. ***/
+
+/* Print registers in the same format as pyramid's dbx, adb, sdb. */
+pyr_print_registers(reg_buf, regnum)
+ long *reg_buf[];
+{
+ register int regno;
+ int usp, ksp;
+ struct user u;
+
+ for (regno = 0; regno < 16; regno++) {
+ printf/*_filtered*/ ("%6.6s: %8x %6.6s: %8x %6s: %8x %6s: %8x\n",
+ reg_names[regno], reg_buf[regno],
+ reg_names[regno+16], reg_buf[regno+16],
+ reg_names[regno+32], reg_buf[regno+32],
+ reg_names[regno+48], reg_buf[regno+48]);
+ }
+ usp = ptrace (3, inferior_pid,
+ ((char *)&u.u_pcb.pcb_usp) -
+ ((char *)&u), 0);
+ ksp = ptrace (3, inferior_pid,
+ ((char *)&u.u_pcb.pcb_ksp) -
+ ((char *)&u), 0);
+ printf/*_filtered*/ ("\n%6.6s: %8x %6.6s: %8x (%08x) %6.6s %8x\n",
+ reg_names[CSP_REGNUM],reg_buf[CSP_REGNUM],
+ reg_names[KSP_REGNUM], reg_buf[KSP_REGNUM], ksp,
+ "usp", usp);
+}
+
+/* Print the register regnum, or all registers if regnum is -1. */
+
+pyr_do_registers_info (regnum)
+ int regnum;
+{
+ /* On a pyr, we know a virtual register can always fit in an long.
+ Here (and elsewhere) we take advantage of that. Yuk. */
+ long raw_regs[MAX_REGISTER_RAW_SIZE*NUM_REGS];
+ register int i;
+
+ for (i = 0 ; i < 64 ; i++) {
+ read_relative_register_raw_bytes(i, raw_regs+i);
+ }
+ if (regnum == -1)
+ pyr_print_registers (raw_regs, regnum);
+ else
+ for (i = 0; i < NUM_REGS; i++)
+ if (i == regnum) {
+ long val = raw_regs[i];
+
+ fputs_filtered (reg_names[i], stdout);
+ printf_filtered(":");
+ print_spaces_filtered (6 - strlen (reg_names[i]), stdout);
+ if (val == 0)
+ printf_filtered ("0");
+ else
+ printf_filtered ("0x%08x %d", val, val);
+ printf_filtered("\n");
+ }
+}
+
+/*** Debugging editions of various macros from m-pyr.h ****/
+
+CORE_ADDR frame_locals_address (frame)
+ FRAME frame;
+{
+ register int addr = find_saved_register (frame,CFP_REGNUM);
+ register int result = read_memory_integer (addr, 4);
+#ifdef PYRAMID_CONTROL_FRAME_DEBUGGING
+ fprintf (stderr,
+ "\t[[..frame_locals:%8x, %s= %x @%x fcfp= %x foo= %x\n\t gr13=%x pr13=%x tr13=%x @%x]]\n",
+ frame->frame,
+ reg_names[CFP_REGNUM],
+ result, addr,
+ frame->frame_cfp, (CFP_REGNUM),
+
+
+ read_register(13), read_register(29), read_register(61),
+ find_saved_register(frame, 61));
+#endif /* PYRAMID_CONTROL_FRAME_DEBUGGING */
+
+ /* FIXME: I thought read_register (CFP_REGNUM) should be the right answer;
+ or at least CFP_REGNUM relative to FRAME (ie, result).
+ There seems to be a bug in the way the innermost frame is set up. */
+
+ return ((frame->next) ? result: frame->frame_cfp);
+}
+
+CORE_ADDR frame_args_addr (frame)
+ FRAME frame;
+{
+ register int addr = find_saved_register (frame,CFP_REGNUM);
+ register int result = read_memory_integer (addr, 4);
+
+#ifdef PYRAMID_CONTROL_FRAME_DEBUGGING
+ fprintf (stderr,
+ "\t[[..frame_args:%8x, %s= %x @%x fcfp= %x r_r= %x\n\t gr13=%x pr13=%x tr13=%x @%x]]\n",
+ frame->frame,
+ reg_names[CFP_REGNUM],
+ result, addr,
+ frame->frame_cfp, read_register(CFP_REGNUM),
+
+ read_register(13), read_register(29), read_register(61),
+ find_saved_register(frame, 61));
+#endif /* PYRAMID_CONTROL_FRAME_DEBUGGING */
+
+ /* FIXME: I thought read_register (CFP_REGNUM) should be the right answer;
+ or at least CFP_REGNUM relative to FRAME (ie, result).
+ There seems to be a bug in the way the innermost frame is set up. */
+ return ((frame->next) ? result: frame->frame_cfp);
+}
diff --git a/gdb/pyr-opcode.h b/gdb/pyr-opcode.h
new file mode 100644
index 0000000..06632b8
--- /dev/null
+++ b/gdb/pyr-opcode.h
@@ -0,0 +1,287 @@
+/* pyramid.opcode.h -- gdb initial attempt. */
+
+/* pyramid opcode table: wot to do with this
+ particular opcode */
+
+struct pyr_datum
+{
+ char nargs;
+ char * args; /* how to compile said opcode */
+ unsigned long mask; /* Bit vector: which operand modes are valid
+ for this opcode */
+ unsigned char code; /* op-code (always 6(?) bits */
+};
+
+typedef struct pyr_insn_format {
+ unsigned int mode :4;
+ unsigned int operator :8;
+ unsigned int index_scale :2;
+ unsigned int index_reg :6;
+ unsigned int operand_1 :6;
+ unsigned int operand_2:6;
+} pyr_insn_format;
+
+
+/* We store four bytes of opcode for all opcodes.
+ Pyramid is sufficiently RISCy that:
+ - insns are always an integral number of words;
+ - the length of any insn can be told from the first word of
+ the insn. (ie, if there are zero, one, or two words of
+ immediate operand/offset).
+
+
+ The args component is a string containing two characters for each
+ operand of the instruction. The first specifies the kind of operand;
+ the second, the place it is stored. */
+
+/* Kinds of operands:
+ mask assembler syntax description
+ 0x0001: movw Rn,Rn register to register
+ 0x0002: movw K,Rn quick immediate to register
+ 0x0004: movw I,Rn long immediate to register
+ 0x0008: movw (Rn),Rn register indirect to register
+ movw (Rn)[x],Rn register indirect to register
+ 0x0010: movw I(Rn),Rn offset register indirect to register
+ movw I(Rn)[x],Rn offset register indirect, indexed, to register
+
+ 0x0020: movw Rn,(Rn) register to register indirect
+ 0x0040: movw K,(Rn) quick immediate to register indirect
+ 0x0080: movw I,(Rn) long immediate to register indirect
+ 0x0100: movw (Rn),(Rn) register indirect to-register indirect
+ 0x0100: movw (Rn),(Rn) register indirect to-register indirect
+ 0x0200: movw I(Rn),(Rn) register indirect+offset to register indirect
+ 0x0200: movw I(Rn),(Rn) register indirect+offset to register indirect
+
+ 0x0400: movw Rn,I(Rn) register to register indirect+offset
+ 0x0800: movw K,I(Rn) quick immediate to register indirect+offset
+ 0x1000: movw I,I(Rn) long immediate to register indirect+offset
+ 0x1000: movw (Rn),I(Rn) register indirect to-register indirect+offset
+ 0x1000: movw I(Rn),I(Rn) register indirect+offset to register indirect
+ +offset
+ 0x0000: (irregular) ???
+
+
+ Each insn has a four-bit field encoding the type(s) of its operands.
+*/
+
+/* Some common combinations
+ */
+
+/* the first 5,(0x1|0x2|0x4|0x8|0x10) ie (1|2|4|8|16), ie ( 32 -1)*/
+#define GEN_TO_REG (31)
+
+#define UNKNOWN ((unsigned long)-1)
+#define ANY (GEN_TO_REG | (GEN_TO_REG << 5) | (GEN_TO_REG << 15))
+
+#define CONVERT (1|8|0x10|0x20|0x200)
+
+#define K_TO_REG (2)
+#define I_TO_REG (4)
+#define NOTK_TO_REG (GEN_TO_REG & ~K_TO_REG)
+#define NOTI_TO_REG (GEN_TO_REG & ~I_TO_REG)
+
+/* The assembler requires that this array be sorted as follows:
+ all instances of the same mnemonic must be consecutive.
+ All instances of the same mnemonic with the same number of operands
+ must be consecutive.
+ */
+
+struct pyr_opcode /* pyr opcode text */
+{
+ char * name; /* opcode name: lowercase string [key] */
+ struct pyr_datum datum; /* rest of opcode table [datum] */
+};
+
+#define pyr_how args
+#define pyr_nargs nargs
+#define pyr_mask mask
+#define pyr_name name
+
+struct pyr_opcode pyr_opcodes[] =
+{
+ {"movb", { 2, "", UNKNOWN, 0x11}, },
+ {"movh", { 2, "", UNKNOWN, 0x12} },
+ {"movw", { 2, "", ANY, 0x10} },
+ {"movl", { 2, "", ANY, 0x13} },
+ {"mnegw", { 2, "", (0x1|0x8|0x10), 0x14} },
+ {"mnegf", { 2, "", 0x1, 0x15} },
+ {"mnegd", { 2, "", 0x1, 0x16} },
+ {"mcomw", { 2, "", (0x1|0x8|0x10), 0x17} },
+ {"mabsw", { 2, "", (0x1|0x8|0x10), 0x18} },
+ {"mabsf", { 2, "", 0x1, 0x19} },
+ {"mabsd", { 2, "", 0x1, 0x1a} },
+ {"mtstw", { 2, "", (0x1|0x8|0x10), 0x1c} },
+ {"mtstf", { 2, "", 0x1, 0x1d} },
+ {"mtstd", { 2, "", 0x1, 0x1e} },
+ {"mova", { 2, "", 0x8|0x10, 0x1f} },
+ {"movzbw", { 2, "", (0x1|0x8|0x10), 0x20} },
+ {"movzhw", { 2, "", (0x1|0x8|0x10), 0x21} },
+ /* 2 insns out of order here */
+ {"movbl", { 2, "", 1, 0x4f} },
+ {"filbl", { 2, "", 1, 0x4e} },
+
+ {"cvtbw", { 2, "", CONVERT, 0x22} },
+ {"cvthw", { 2, "", CONVERT, 0x23} },
+ {"cvtwb", { 2, "", CONVERT, 0x24} },
+ {"cvtwh", { 2, "", CONVERT, 0x25} },
+ {"cvtwf", { 2, "", CONVERT, 0x26} },
+ {"cvtwd", { 2, "", CONVERT, 0x27} },
+ {"cvtfw", { 2, "", CONVERT, 0x28} },
+ {"cvtfd", { 2, "", CONVERT, 0x29} },
+ {"cvtdw", { 2, "", CONVERT, 0x2a} },
+ {"cvtdf", { 2, "", CONVERT, 0x2b} },
+
+ {"addw", { 2, "", GEN_TO_REG, 0x40} },
+ {"addwc", { 2, "", GEN_TO_REG, 0x41} },
+ {"subw", { 2, "", GEN_TO_REG, 0x42} },
+ {"subwb", { 2, "", GEN_TO_REG, 0x43} },
+ {"rsubw", { 2, "", GEN_TO_REG, 0x44} },
+ {"mulw", { 2, "", GEN_TO_REG, 0x45} },
+ {"emul", { 2, "", GEN_TO_REG, 0x47} },
+ {"umulw", { 2, "", GEN_TO_REG, 0x46} },
+ {"divw", { 2, "", GEN_TO_REG, 0x48} },
+ {"ediv", { 2, "", GEN_TO_REG, 0x4a} },
+ {"rdivw", { 2, "", GEN_TO_REG, 0x4b} },
+ {"udivw", { 2, "", GEN_TO_REG, 0x49} },
+ {"modw", { 2, "", GEN_TO_REG, 0x4c} },
+ {"umodw", { 2, "", GEN_TO_REG, 0x4d} },
+
+
+ {"addf", { 2, "", 1, 0x50} },
+ {"addd", { 2, "", 1, 0x51} },
+ {"subf", { 2, "", 1, 0x52} },
+ {"subd", { 2, "", 1, 0x53} },
+ {"mulf", { 2, "", 1, 0x56} },
+ {"muld", { 2, "", 1, 0x57} },
+ {"divf", { 2, "", 1, 0x58} },
+ {"divd", { 2, "", 1, 0x59} },
+
+
+ {"cmpb", { 2, "", UNKNOWN, 0x61} },
+ {"cmph", { 2, "", UNKNOWN, 0x62} },
+ {"cmpw", { 2, "", UNKNOWN, 0x60} },
+ {"ucmpb", { 2, "", UNKNOWN, 0x66} },
+ /* WHY no "ucmph"??? */
+ {"ucmpw", { 2, "", UNKNOWN, 0x65} },
+ {"xchw", { 2, "", UNKNOWN, 0x0f} },
+
+
+ {"andw", { 2, "", GEN_TO_REG, 0x30} },
+ {"orw", { 2, "", GEN_TO_REG, 0x31} },
+ {"xorw", { 2, "", GEN_TO_REG, 0x32} },
+ {"bicw", { 2, "", GEN_TO_REG, 0x33} },
+ {"lshlw", { 2, "", GEN_TO_REG, 0x38} },
+ {"ashlw", { 2, "", GEN_TO_REG, 0x3a} },
+ {"ashll", { 2, "", GEN_TO_REG, 0x3c} },
+ {"ashrw", { 2, "", GEN_TO_REG, 0x3b} },
+ {"ashrl", { 2, "", GEN_TO_REG, 0x3d} },
+ {"rotlw", { 2, "", GEN_TO_REG, 0x3e} },
+ {"rotrw", { 2, "", GEN_TO_REG, 0x3f} },
+
+ /* push and pop insns are "going away next release". */
+ {"pushw", { 2, "", GEN_TO_REG, 0x0c} },
+ {"popw", { 2, "", (0x1|0x8|0x10), 0x0d} },
+ {"pusha", { 2, "", (0x8|0x10), 0x0e} },
+
+ {"bitsw", { 2, "", UNKNOWN, 0x35} },
+ {"bitcw", { 2, "", UNKNOWN, 0x36} },
+ /* some kind of ibra/dbra insns??*/
+ {"icmpw", { 2, "", UNKNOWN, 0x67} },
+ {"dcmpw", { 2, "", (1|4|0x20|0x80|0x400|0x1000), 0x69} },/*FIXME*/
+ {"acmpw", { 2, "", 1, 0x6b} },
+
+ /* Call is written as a 1-op insn, but is always (dis)assembled as a 2-op
+ insn with a 2nd op of tr14. The assembler will have to grok this. */
+ {"call", { 2, "", GEN_TO_REG, 0x04} },
+ {"call", { 1, "", GEN_TO_REG, 0x04} },
+
+ {"callk", { 1, "", UNKNOWN, 0x06} },/* system call?*/
+ /* Ret is usually written as a 0-op insn, but gets disassembled as a
+ 1-op insn. The operand is always tr15. */
+ {"ret", { 0, "", UNKNOWN, 0x09} },
+ {"ret", { 1, "", UNKNOWN, 0x09} },
+ {"adsf", { 2, "", (1|2|4), 0x08} },
+ {"retd", { 2, "", UNKNOWN, 0x0a} },
+ {"btc", { 2, "", UNKNOWN, 0x01} },
+ {"bfc", { 2, "", UNKNOWN, 0x02} },
+ /* Careful: halt is 0x00000000. Jump must have some other (mode?)bit set?? */
+ {"jump", { 1, "", UNKNOWN, 0x00} },
+ {"btp", { 2, "", UNKNOWN, 0xf00} },
+ /* read control-stack pointer is another 1-or-2 operand insn. */
+ {"rcsp", { 2, "", UNKNOWN, 0x01f} },
+ {"rcsp", { 1, "", UNKNOWN, 0x01f} }
+};
+
+/* end: pyramid.opcode.h */
+/* One day I will have to take the time to find out what operands
+ are valid for these insns, and guess at what they mean.
+
+ I can't imagine what the "I???" insns (iglob, etc) do.
+
+ the arithmetic-sounding insns ending in "p" sound awfully like BCD
+ arithmetic insns:
+ dshlp -> Decimal SHift Left Packed
+ dshrp -> Decimal SHift Right Packed
+ and cvtlp would be convert long to packed.
+ I have no idea how the operands are interpreted; but having them be
+ a long register with (address, length) of an in-memory packed BCD operand
+ would not be surprising.
+ They are unlikely to be a packed bcd string: 64 bits of long give
+ is only 15 digits+sign, which isn't enough for COBOL.
+ */
+#if 0
+ {"wcsp", { 2, "", UNKNOWN, 0x00} }, /*write csp?*/
+ /* The OSx Operating System Porting Guide claims SSL does things
+ with tr12 (a register reserved to it) to do with static block-structure
+ references. SSL=Set Static Link? It's "Going away next release". */
+ {"ssl", { 2, "", UNKNOWN, 0x00} },
+ {"ccmps", { 2, "", UNKNOWN, 0x00} },
+ {"lcd", { 2, "", UNKNOWN, 0x00} },
+ {"uemul", { 2, "", UNKNOWN, 0x00} }, /*unsigned emul*/
+ {"srf", { 2, "", UNKNOWN, 0x00} }, /*Gidget time???*/
+ {"mnegp", { 2, "", UNKNOWN, 0x00} }, /move-neg phys?*/
+ {"ldp", { 2, "", UNKNOWN, 0x00} }, /*load phys?*/
+ {"ldti", { 2, "", UNKNOWN, 0x00} },
+ {"ldb", { 2, "", UNKNOWN, 0x00} },
+ {"stp", { 2, "", UNKNOWN, 0x00} },
+ {"stti", { 2, "", UNKNOWN, 0x00} },
+ {"stb", { 2, "", UNKNOWN, 0x00} },
+ {"stu", { 2, "", UNKNOWN, 0x00} },
+ {"addp", { 2, "", UNKNOWN, 0x00} },
+ {"subp", { 2, "", UNKNOWN, 0x00} },
+ {"mulp", { 2, "", UNKNOWN, 0x00} },
+ {"divp", { 2, "", UNKNOWN, 0x00} },
+ {"dshlp", { 2, "", UNKNOWN, 0x00} }, /* dec shl packed? */
+ {"dshrp", { 2, "", UNKNOWN, 0x00} }, /* dec shr packed? */
+ {"movs", { 2, "", UNKNOWN, 0x00} }, /*move (string?)?*/
+ {"cmpp", { 2, "", UNKNOWN, 0x00} }, /* cmp phys?*/
+ {"cmps", { 2, "", UNKNOWN, 0x00} }, /* cmp (string?)?*/
+ {"cvtlp", { 2, "", UNKNOWN, 0x00} }, /* cvt long to p??*/
+ {"cvtpl", { 2, "", UNKNOWN, 0x00} }, /* cvt p to l??*/
+ {"dintr", { 2, "", UNKNOWN, 0x00} }, /* ?? intr ?*/
+ {"rphysw", { 2, "", UNKNOWN, 0x00} }, /* read phys word?*/
+ {"wphysw", { 2, "", UNKNOWN, 0x00} }, /* write phys word?*/
+ {"cmovs", { 2, "", UNKNOWN, 0x00} },
+ {"rsubw", { 2, "", UNKNOWN, 0x00} },
+ {"bicpsw", { 2, "", UNKNOWN, 0x00} }, /* clr bit in psw? */
+ {"bispsw", { 2, "", UNKNOWN, 0x00} }, /* set bit in psw? */
+ {"eio", { 2, "", UNKNOWN, 0x00} }, /* ?? ?io ? */
+ {"callp", { 2, "", UNKNOWN, 0x00} }, /* call phys?*/
+ {"callr", { 2, "", UNKNOWN, 0x00} },
+ {"lpcxt", { 2, "", UNKNOWN, 0x00} }, /*load proc context*/
+ {"rei", { 2, "", UNKNOWN, 0x00} }, /*ret from intrpt*/
+ {"rport", { 2, "", UNKNOWN, 0x00} }, /*read-port?*/
+ {"rtod", { 2, "", UNKNOWN, 0x00} }, /*read-time-of-day?*/
+ {"ssi", { 2, "", UNKNOWN, 0x00} },
+ {"vtpa", { 2, "", UNKNOWN, 0x00} }, /*virt-to-phys-addr?*/
+ {"wicl", { 2, "", UNKNOWN, 0x00} }, /* write icl ? */
+ {"wport", { 2, "", UNKNOWN, 0x00} }, /*write-port?*/
+ {"wtod", { 2, "", UNKNOWN, 0x00} }, /*write-time-of-day?*/
+ {"flic", { 2, "", UNKNOWN, 0x00} },
+ {"iglob", { 2, "", UNKNOWN, 0x00} }, /* I global? */
+ {"iphys", { 2, "", UNKNOWN, 0x00} }, /* I physical? */
+ {"ipid", { 2, "", UNKNOWN, 0x00} }, /* I pid? */
+ {"ivect", { 2, "", UNKNOWN, 0x00} }, /* I vector? */
+ {"lamst", { 2, "", UNKNOWN, 0x00} },
+ {"tio", { 2, "", UNKNOWN, 0x00} },
+#endif
diff --git a/gdb/pyr-pinsn.c b/gdb/pyr-pinsn.c
new file mode 100644
index 0000000..f119adf
--- /dev/null
+++ b/gdb/pyr-pinsn.c
@@ -0,0 +1,346 @@
+/* Disassembler for the Pyramid Technology 90x
+ Copyright (C) 1988,1989 Free Software Foundation, Inc.
+
+This file is part of GDB, the GNU disassembler.
+
+GDB 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 1, or (at your option)
+any later version.
+
+GDB 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 GDB; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <stdio.h>
+
+#include "defs.h"
+#include "param.h"
+#include "symtab.h"
+#include "opcode.h"
+
+
+/* A couple of functions used for debugging frame-handling on
+ Pyramids. (The Pyramid-dependent handling of register values for
+ windowed registers is known to be buggy.)
+
+ When debugging, these functions supplant the normal definitions of some
+ of the macros in m-pyramid.h The quantity of information produced
+ when these functions are used makes the gdb unusable as a
+ debugger for user programs. */
+
+extern unsigned pyr_saved_pc(), pyr_frame_chain();
+
+CORE_ADDR pyr_frame_chain(frame)
+ CORE_ADDR frame;
+{
+ int foo=frame - CONTROL_STACK_FRAME_SIZE;
+ /* printf ("...following chain from %x: got %x\n", frame, foo);*/
+ return foo;
+}
+
+CORE_ADDR pyr_saved_pc(frame)
+ CORE_ADDR frame;
+{
+ int foo=0;
+ foo = read_memory_integer (((CORE_ADDR)(frame))+60, 4);
+ printf ("..reading pc from frame 0x%0x+%d regs: got %0x\n",
+ frame, 60/4, foo);
+ return foo;
+}
+
+
+/* Pyramid instructions are never longer than this many bytes. */
+#define MAXLEN 24
+
+/* Number of elements in the opcode table. */
+/*const*/ static int nopcodes = (sizeof (pyr_opcodes) / sizeof( pyr_opcodes[0]));
+#define NOPCODES (nopcodes)
+
+extern char *reg_names[];
+
+/* Let's be byte-independent so we can use this as a cross-assembler.
+ (will this ever be useful?
+ */
+
+#define NEXTLONG(p) \
+ (p += 4, (((((p[-4] << 8) + p[-3]) << 8) + p[-2]) << 8) + p[-1])
+
+
+/* Print one instruction at address MEMADDR in debugged memory,
+ on STREAM. Returns length of the instruction, in bytes. */
+
+int
+print_insn (memaddr, stream)
+ CORE_ADDR memaddr;
+ FILE *stream;
+{
+ unsigned char buffer[MAXLEN];
+ register int i, nargs, insn_size =4;
+ register unsigned char *p;
+ register char *d;
+ register int insn_opcode, operand_mode;
+ register int index_multiplier, index_reg_regno, op_1_regno, op_2_regno ;
+ long insn; /* first word of the insn, not broken down. */
+ pyr_insn_format insn_decode; /* the same, broken out into op{code,erands} */
+ long extra_1, extra_2;
+
+ read_memory (memaddr, buffer, MAXLEN);
+ insn_decode = *((pyr_insn_format *) buffer);
+ insn = * ((int *) buffer);
+ insn_opcode = insn_decode.operator;
+ operand_mode = insn_decode.mode;
+ index_multiplier = insn_decode.index_scale;
+ index_reg_regno = insn_decode.index_reg;
+ op_1_regno = insn_decode.operand_1;
+ op_2_regno = insn_decode.operand_2;
+
+
+ if (*((int *)buffer) == 0x0) {
+ /* "halt" looks just like an invalid "jump" to the insn decoder,
+ so is dealt with as a special case */
+ fprintf (stream, "halt");
+ return (4);
+ }
+
+ for (i = 0; i < NOPCODES; i++)
+ if (pyr_opcodes[i].datum.code == insn_opcode)
+ break;
+
+ if (i == NOPCODES)
+ /* FIXME: Handle unrecognised instructions better. */
+ fprintf (stream, "???\t#%08x\t(op=%x mode =%x)",
+ insn, insn_decode.operator, insn_decode.mode);
+ else
+ {
+ /* Print the mnemonic for the instruction. Pyramid insn operands
+ are so regular that we can deal with almost all of them
+ separately.
+ Unconditional branches are an exception: they are encoded as
+ conditional branches (branch if false condition, I think)
+ with no condition specified. The average user will not be
+ aware of this. To maintain their illusion that an
+ unconditional branch insn exists, we will have to FIXME to
+ treat the insn mnemnonic of all branch instructions here as a
+ special case: check the operands of branch insn and print an
+ appropriate mnemonic. */
+
+ fprintf (stream, "%s\t", pyr_opcodes[i].name);
+
+ /* Print the operands of the insn (as specified in
+ insn.operand_mode).
+ Branch operands of branches are a special case: they are a word
+ offset, not a byte offset. */
+
+ if (insn_decode.operator == 0x01 || insn_decode.operator == 0x02) {
+ register int bit_codes=(insn >> 16)&0xf;
+ register int i;
+ register int displacement = (insn & 0x0000ffff) << 2;
+
+ static char cc_bit_names[] = "cvzn"; /* z,n,c,v: strange order? */
+
+ /* Is bfc and no bits specified an unconditional branch?*/
+ for (i=0;i<4;i++) {
+ if ((bit_codes) & 0x1)
+ fputc (cc_bit_names[i], stream);
+ bit_codes >>= 1;
+ }
+
+ fprintf (stream, ",%0x",
+ displacement + memaddr);
+ return (insn_size);
+ }
+
+ switch (operand_mode) {
+ case 0:
+ fprintf (stream, "%s,%s",
+ reg_names [op_1_regno],
+ reg_names [op_2_regno]);
+ break;
+
+ case 1:
+ fprintf (stream, " 0x%0x,%s",
+ op_1_regno,
+ reg_names [op_2_regno]);
+ break;
+
+ case 2:
+ read_memory (memaddr+4, buffer, MAXLEN);
+ insn_size += 4;
+ extra_1 = * ((int *) buffer);
+ fprintf (stream, " $0x%0x,%s",
+ extra_1,
+ reg_names [op_2_regno]);
+ break;
+ case 3:
+ fprintf (stream, " (%s),%s",
+ reg_names [op_1_regno],
+ reg_names [op_2_regno]);
+ break;
+
+ case 4:
+ read_memory (memaddr+4, buffer, MAXLEN);
+ insn_size += 4;
+ extra_1 = * ((int *) buffer);
+ fprintf (stream, " 0x%0x(%s),%s",
+ extra_1,
+ reg_names [op_1_regno],
+ reg_names [op_2_regno]);
+ break;
+
+ /* S1 destination mode */
+ case 5:
+ fprintf (stream,
+ ((index_reg_regno) ? "%s,(%s)[%s*%1d]" : "%s,(%s)"),
+ reg_names [op_1_regno],
+ reg_names [op_2_regno],
+ reg_names [index_reg_regno],
+ index_multiplier);
+ break;
+
+ case 6:
+ fprintf (stream,
+ ((index_reg_regno) ? " $%#0x,(%s)[%s*%1d]"
+ : " $%#0x,(%s)"),
+ op_1_regno,
+ reg_names [op_2_regno],
+ reg_names [index_reg_regno],
+ index_multiplier);
+ break;
+
+ case 7:
+ read_memory (memaddr+4, buffer, MAXLEN);
+ insn_size += 4;
+ extra_1 = * ((int *) buffer);
+ fprintf (stream,
+ ((index_reg_regno) ? " $%#0x,(%s)[%s*%1d]"
+ : " $%#0x,(%s)"),
+ extra_1,
+ reg_names [op_2_regno],
+ reg_names [index_reg_regno],
+ index_multiplier);
+ break;
+
+ case 8:
+ fprintf (stream,
+ ((index_reg_regno) ? " (%s),(%s)[%s*%1d]" : " (%s),(%s)"),
+ reg_names [op_1_regno],
+ reg_names [op_2_regno],
+ reg_names [index_reg_regno],
+ index_multiplier);
+ break;
+
+ case 9:
+ read_memory (memaddr+4, buffer, MAXLEN);
+ insn_size += 4;
+ extra_1 = * ((int *) buffer);
+ fprintf (stream,
+ ((index_reg_regno)
+ ? "%#0x(%s),(%s)[%s*%1d]"
+ : "%#0x(%s),(%s)"),
+ extra_1,
+ reg_names [op_1_regno],
+ reg_names [op_2_regno],
+ reg_names [index_reg_regno],
+ index_multiplier);
+ break;
+
+ /* S2 destination mode */
+ case 10:
+ read_memory (memaddr+4, buffer, MAXLEN);
+ insn_size += 4;
+ extra_1 = * ((int *) buffer);
+ fprintf (stream,
+ ((index_reg_regno) ? "%s,%#0x(%s)[%s*%1d]" : "%s,%#0x(%s)"),
+ reg_names [op_1_regno],
+ extra_1,
+ reg_names [op_2_regno],
+ reg_names [index_reg_regno],
+ index_multiplier);
+ break;
+ case 11:
+ read_memory (memaddr+4, buffer, MAXLEN);
+ insn_size += 4;
+ extra_1 = * ((int *) buffer);
+ fprintf (stream,
+ ((index_reg_regno) ?
+ " $%#0x,%#0x(%s)[%s*%1d]" : " $%#0x,%#0x(%s)"),
+ op_1_regno,
+ extra_1,
+ reg_names [op_2_regno],
+ reg_names [index_reg_regno],
+ index_multiplier);
+ break;
+ case 12:
+ read_memory (memaddr+4, buffer, MAXLEN);
+ insn_size += 4;
+ extra_1 = * ((int *) buffer);
+ read_memory (memaddr+8, buffer, MAXLEN);
+ insn_size += 4;
+ extra_2 = * ((int *) buffer);
+ fprintf (stream,
+ ((index_reg_regno) ?
+ " $%#0x,%#0x(%s)[%s*%1d]" : " $%#0x,%#0x(%s)"),
+ extra_1,
+ extra_2,
+ reg_names [op_2_regno],
+ reg_names [index_reg_regno],
+ index_multiplier);
+ break;
+
+ case 13:
+ read_memory (memaddr+4, buffer, MAXLEN);
+ insn_size += 4;
+ extra_1 = * ((int *) buffer);
+ fprintf (stream,
+ ((index_reg_regno)
+ ? " (%s),%#0x(%s)[%s*%1d]"
+ : " (%s),%#0x(%s)"),
+ reg_names [op_1_regno],
+ extra_1,
+ reg_names [op_2_regno],
+ reg_names [index_reg_regno],
+ index_multiplier);
+ break;
+ case 14:
+ read_memory (memaddr+4, buffer, MAXLEN);
+ insn_size += 4;
+ extra_1 = * ((int *) buffer);
+ read_memory (memaddr+8, buffer, MAXLEN);
+ insn_size += 4;
+ extra_2 = * ((int *) buffer);
+ fprintf (stream,
+ ((index_reg_regno) ? "%#0x(%s),%#0x(%s)[%s*%1d]"
+ : "%#0x(%s),%#0x(%s) "),
+ extra_1,
+ reg_names [op_1_regno],
+ extra_2,
+ reg_names [op_2_regno],
+ reg_names [index_reg_regno],
+ index_multiplier);
+ break;
+
+ default:
+ fprintf (stream,
+ ((index_reg_regno) ? "%s,%s [%s*%1d]" : "%s,%s"),
+ reg_names [op_1_regno],
+ reg_names [op_2_regno],
+ reg_names [index_reg_regno],
+ index_multiplier);
+ fprintf (stream,
+ "\t\t# unknown mode in %08x",
+ insn);
+ break;
+ } /* switch */
+ }
+
+ {
+ return insn_size;
+ }
+ abort ();
+}
diff --git a/gdb/readline/ChangeLog b/gdb/readline/ChangeLog
index 58a5784..b72a59d 100644
--- a/gdb/readline/ChangeLog
+++ b/gdb/readline/ChangeLog
@@ -1,9 +1,22 @@
+Thu Feb 8 01:04:00 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * Makefile (the *other* libreadline.a): Uncomment out ranlib line.
+
+Thu Feb 1 17:50:22 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
+
+ * Makefile (libreadline.a): Uncomment out ranlib line.
+
+Sun Nov 26 16:29:11 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
+
+ * readline.c (rl_deprep_terminal): Only restore local_mode_flags
+ if they had been set.
+
Thu Oct 19 17:18:40 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
* Move vi_doing_insert from vi_mode.c to readline.c
* readline.c: Move compare_strings before its use.
- Remove definitions.
+ Remove declarations.
* readline.c: Move defining_kbd_macro above rl_dispatch.
(rl_dispatch): Remove "extern int defining_kbd_macro".
diff --git a/gdb/readline/Makefile b/gdb/readline/Makefile
index fadca97..dc11539 100644
--- a/gdb/readline/Makefile
+++ b/gdb/readline/Makefile
@@ -65,7 +65,7 @@ all: libreadline.a
libreadline.a: readline.o history.o funmap.o keymaps.o
$(RM) -f libreadline.a
$(AR) clq libreadline.a readline.o history.o funmap.o keymaps.o
-# if [ -f $(RANLIB) ]; then $(RANLIB) libreadline.a; fi
+ if [ -f $(RANLIB) ]; then $(RANLIB) libreadline.a; fi
readline.o: readline.h chardefs.h keymaps.h history.h readline.c vi_mode.c
$(CC) -c $(CFLAGS) $(CPPFLAGS) $(READLINE_DEFINES) \
@@ -111,4 +111,4 @@ clean:
$(DESTDIR)/libreadline.a: libreadline.a
-mv $(DESTDIR)/libreadline.a $(DESTDIR)/libreadline.old
cp libreadline.a $(DESTDIR)/libreadline.a
-# $(RANLIB) -t $(DESTDIR)/libreadline.a
+ $(RANLIB) -t $(DESTDIR)/libreadline.a
diff --git a/gdb/readline/history.texinfo b/gdb/readline/history.texinfo
new file mode 100644
index 0000000..526d66d
--- /dev/null
+++ b/gdb/readline/history.texinfo
@@ -0,0 +1,194 @@
+\input texinfo.tex
+@setfilename history.info
+
+@ifinfo
+This file documents the GNU History library.
+
+Copyright (C) 1988 Free Software Foundation, Inc.
+Authored by Brian Fox.
+
+Permission is granted to make and distribute verbatim copies of this manual
+provided the copyright notice and this permission notice are preserved on
+all copies.
+
+@ignore
+Permission is granted to process this file through Tex and print the
+results, provided the printed document carries copying permission notice
+identical to this one except for the removal of this paragraph (this
+paragraph not being relevant to the printed manual).
+@end ignore
+
+Permission is granted to copy and distribute modified versions of this
+manual under the conditions for verbatim copying, provided also that the
+GNU Copyright statement is available to the distributee, and provided that
+the entire resulting derived work is distributed under the terms of a
+permission notice identical to this one.
+
+Permission is granted to copy and distribute translations of this manual
+into another language, under the above conditions for modified versions.
+@end ifinfo
+
+@node Top, Introduction, , (DIR)
+
+This document describes the GNU History library, a programming tool that
+provides a consistent user interface for recalling lines of previously
+typed input.
+
+@menu
+* Introduction:: What is the GNU History library for?
+* Interactive Use:: What it feels like using History as a user.
+* Programming:: How to use History in your programs.
+@end menu
+
+@node Introduction, Interactive Use, , Top
+@unnumbered Introduction
+
+Many programs read input from the user a line at a time. The GNU history
+library is able to keep track of those lines, associate arbitrary data with
+each line, and utilize information from previous lines in making up new
+ones.
+
+The programmer using the History library has available to him functions for
+remembering lines on a history stack, associating arbitrary data with a
+line, removing lines from the stack, searching through the stack for a
+line containing an arbitrary text string, and referencing any line on the
+stack directly. In addition, a history @dfn{expansion} function is
+available which provides for a consistent user interface across many
+different programs.
+
+The end-user using programs written with the History library has the
+benifit of a consistent user interface, with a set of well-known commands
+for manipulating the text of previous lines and using that text in new
+commands. The basic history manipulation commands are similar to the
+history substitution used by Csh.
+
+If the programmer desires, he can use the Readline library, which includes
+history manipulation by default, and has the added advantage of Emacs style
+command line editing.
+
+@node Interactive Use, Programming, Introduction, Top
+@chapter Interactive Use
+
+@section History Expansion
+@cindex expansion
+
+The History library provides a history expansion feature that is similar to
+the history expansion in Csh. The following text describes what syntax
+features are available.
+
+History expansion takes place in two parts. The first is to determine
+which line from the previous history should be used during substitution.
+The second is to select portions of that line for inclusion into the
+current one. The line selected from the previous history is called the
+@dfn{event}, and the portions of that line that are acted upon are called
+@dfn{words}. The line is broken into words in the same fashion that the
+Bash shell does, so that several English (or Unix) words surrounded by
+quotes are considered as one word.
+
+@menu
+* Event Designators:: How to specify which history line to use.
+* Word Designators:: Specifying which words are of interest.
+* Modifiers:: Modifying the results of susbstitution.
+@end menu
+
+@node Event Designators, Word Designators, , Interactive Use
+@subsection Event Designators
+@cindex event designators
+
+An event designator is a reference to a command line entry in the history
+list.
+
+@table @var
+
+@item !
+Start a history subsititution, except when followed by a @key{SPC},
+@key{TAB}, @key{RET}, @key{=} or @key{(}.
+
+@item !!
+Refer to the previous command. This is a synonym for @code{!-1}.
+
+@item !n
+Refer to command line @var{n}.
+
+@item !-n
+Refer to the current command line minus @var{n}.
+
+@item !string
+Refer to the most recent command starting with @var{string}.
+
+@item !?string[?]
+Refer to the most recent command containing @var{string}.
+
+@end table
+
+@node Word Designators, Modifiers, Event Designators, Interactive Use
+@subsection Word Designators
+
+A @key{:} separates the event specification from the word designator. It
+can be omitted if the word designator begins with a @key{^}, @key{$},
+@key{*} or @key{%}. Words are numbered from the beginning of the line,
+with the first word being denoted by a 0 (zero).
+
+@table @asis
+
+@item @var{0} (zero)
+The zero'th word. For many applications, this is the command word.
+
+@item n
+The @var{n}'th word.
+
+@item @var{^}
+The first argument. that is, word 1.
+
+@item @var{$}
+The last argument.
+
+@item @var{%}
+The word matched by the most recent @code{?string?} search.
+
+@item @var{x}-@var{y}
+A range of words; @code{-@var{y}} is equivalent to @code{0-@var{y}}.
+
+@item @var{*}
+All of the words, excepting the zero'th. This is a synonym for @samp{1-$}.
+It is not an error to use @samp{*} if there is just one word in the event.
+The empty string is returned in that case.
+
+@end table
+
+@node Modifiers, , Word Designators, Interactive Use
+@subsection Modifiers
+
+After the optional word designator, you can add a sequence of one or more
+of the following modifiers, each preceded by a @key{:}.
+
+@table @code
+
+@item #
+The entire command line typed so far. This means the current command,
+not the previous command, so it really isn't a word designator, and doesn't
+belong in this section.
+
+@item h
+Remove a trailing pathname component, leaving only the head.
+
+@item r
+Remove a trailing suffix of the form ".xxx", leaving the basename.
+
+@item e
+Remove all but the suffix.
+
+@item t
+Remove all leading pathname components, leaving the tail.
+
+@item p
+Print the new command but do not execute it. This takes effect
+immediately, so it should be the last specifier on the line.
+
+@end table
+
+@node Programming, , Interactive Use, Top
+@chapter Programming
+
+@bye
+
diff --git a/gdb/readline/readline.c b/gdb/readline/readline.c
index 0185e13..c111491 100644
--- a/gdb/readline/readline.c
+++ b/gdb/readline/readline.c
@@ -2078,7 +2078,8 @@ rl_deprep_terminal ()
int tty = fileno (rl_instream);
#if defined (TIOCLGET) && defined (LPASS8)
- ioctl (tty, TIOCLSET, &local_mode_flags);
+ if ((the_ttybuff.sg_flags & (ODDP | EVENP)) == (ODDP | EVENP))
+ ioctl (tty, TIOCLSET, &local_mode_flags);
#endif
#ifdef TIOCSLTC
diff --git a/gdb/readline/readline.texinfo b/gdb/readline/readline.texinfo
new file mode 100644
index 0000000..40e5211
--- /dev/null
+++ b/gdb/readline/readline.texinfo
@@ -0,0 +1,425 @@
+\input texinfo @c -*-texinfo-*-
+@comment %**start of header (This is for running Texinfo on a region.)
+@setfilename readline.info
+@settitle Line Editing Commands
+@comment %**end of header (This is for running Texinfo on a region.)
+@synindex fn vr
+
+@iftex
+@comment finalout
+@end iftex
+
+@ifinfo
+This document describes the GNU Readline Library, a utility for aiding
+in the consitency of user interface across discrete programs that need
+to provide a command line interface.
+
+Copyright (C) 1988 Free Software Foundation, Inc.
+
+Permission is granted to make and distribute verbatim copies of
+this manual provided the copyright notice and this permission notice
+pare preserved on all copies.
+
+@ignore
+Permission is granted to process this file through TeX and print the
+results, provided the printed document carries copying permission
+notice identical to this one except for the removal of this paragraph
+(this paragraph not being relevant to the printed manual).
+
+@end ignore
+Permission is granted to copy and distribute modified versions of this
+manual under the conditions for verbatim copying, provided that the entire
+resulting derived work is distributed under the terms of a permission
+notice identical to this one.
+
+Permission is granted to copy and distribute translations of this manual
+into another language, under the above conditions for modified versions,
+except that this permission notice may be stated in a translation approved
+by the Foundation.
+@end ifinfo
+
+@setchapternewpage odd
+@titlepage
+@sp 11
+@center @titlefont{GNU Readline Library}
+@sp 2
+@center by Brian Fox
+@sp 2
+@center Version 1.0
+@sp 2
+@center February 1989
+
+@comment Include the Distribution inside the titlepage environment so
+@c that headings are turned off.
+
+@page
+@vskip 0pt plus 1filll
+Copyright @copyright{} 1989 Free Software Foundation, Inc.
+
+@sp 2
+This document describes the GNU Readline Library, a utility for aiding
+in the consistency of user interface across discrete programs that need
+to provide a command line interface.
+@sp 2
+
+Published by the Free Software Foundation @*
+675 Massachusetts Avenue, @*
+Cambridge, MA 02139 USA
+
+Permission is granted to make and distribute verbatim copies of
+this manual provided the copyright notice and this permission notice
+are preserved on all copies.
+
+Permission is granted to copy and distribute modified versions of this
+manual under the conditions for verbatim copying, provided that the entire
+resulting derived work is distributed under the terms of a permission
+notice identical to this one.
+
+Permission is granted to copy and distribute translations of this manual
+into another language, under the above conditions for modified versions,
+except that this permission notice may be stated in a translation approved
+by the Foundation.
+
+@end titlepage
+
+@node Top, Readline Top, ,(DIR)
+@chapter GNU Readline Library
+
+@ifinfo
+This document describes the GNU Readline Library, a utility for aiding
+in the consistency of user interface across discrete programs that need
+to provide a command line interface.
+@end ifinfo
+
+@menu
+* Readline Top:: GNU Readline User's Manual
+* Readline Technical:: GNU Readline Programmer's Manual
+@end menu
+@include inc-readline.texinfo
+@node Readline Technical, , Top, Top
+@chapter Readline Programmer's Manual
+
+This manual describes the interface between the GNU Readline Library and
+user programs. If you are a programmer, and you wish to include the
+features found in GNU Readline in your own programs, such as completion,
+line editing, and interactive history manipulation, this documentation
+is for you.
+
+@menu
+* Default Behaviour:: Using the default behaviour of Readline.
+* Custom Functions:: Adding your own functions to Readline.
+* Custom Completers:: Supplanting or supplementing Readline's
+ completion functions.
+* Variable Index:: Index of externally tweakable variables.
+@end menu
+
+@node Default Behaviour, Custom Functions, Readline Technical, Readline Technical
+@section Default Behaviour
+
+Many programs provide a command line interface, such as @code{mail},
+@code{ftp}, and @code{sh}. For such programs, the default behaviour of
+Readline is sufficient. This section describes how to use Readline in
+the simplest way possible, perhaps to replace calls in your code to
+@code{gets ()}.
+
+@findex readline ()
+@cindex readline, function
+The function @code{readline} prints a prompt and then reads and returns
+a single line of text from the user. The line which @code{readline ()}
+returns is allocated with @code{malloc ()}; you should @code{free ()}
+the line when you are done with it. The declaration in ANSI C is
+
+@example
+@code{char *readline (char *@var{prompt});}
+@end example
+
+So, one might say
+@example
+@code{char *line = readline ("Enter a line: ");}
+@end example
+in order to read a line of text from the user.
+
+The line which is returned has the final newline removed, so only the
+text of the line remains.
+
+If readline encounters an EOF while reading the line, and the line is
+empty at that point, then @code{(char *)NULL} is returned. Otherwise,
+the line is ended just as if a newline was typed.
+
+If you want the user to be able to get at the line later, (with
+@key{C-p} for example), you must call @code{add_history ()} to save the
+line away in a @dfn{history} list of such lines.
+
+@example
+@code{add_history (line)};
+@end example
+
+For full details on the GNU History Library, see the associated manual.
+
+It is polite to avoid saving empty lines on the history list, since
+no one has a burning need to reuse a blank line. Here is a function
+which usefully replaces the standard @code{gets ()} library function:
+
+@example
+/* A static variable for holding the line. */
+static char *my_gets_line = (char *)NULL;
+
+/* Read a string, and return a pointer to it. Returns NULL on EOF. */
+char *
+my_gets ()
+@{
+ /* If the buffer has already been allocated, return the memory
+ to the free pool. */
+ if (my_gets_line != (char *)NULL)
+ free (my_gets_line);
+
+ /* Get a line from the user. */
+ my_gets_line = readline ("");
+
+ /* If the line has any text in it, save it on the history. */
+ if (my_get_line && *my_gets_line)
+ add_history (my_gets_line);
+
+ return (my_gets_line);
+@}
+@end example
+
+The above code gives the user the default behaviour of @key{TAB}
+completion: completion on file names. If you do not want readline to
+complete on filenames, you can change the binding of the @key{TAB} key
+with @code{rl_bind_key ()}.
+
+@findex rl_bind_key ()
+
+@example
+@code{int rl_bind_key (int @var{key}, (int (*)())@var{function});}
+@end example
+
+@code{rl_bind_key ()} takes 2 arguments; @var{key} is the character that
+you want to bind, and @var{function} is the address of the function to
+run when @var{key} is pressed. Binding @key{TAB} to @code{rl_insert ()}
+makes @key{TAB} just insert itself.
+
+@code{rl_bind_key ()} returns non-zero if @var{key} is not a valid
+ASCII character code (between 0 and 255).
+
+@example
+@code{rl_bind_key ('\t', rl_insert);}
+@end example
+
+@node Custom Functions, Custom Completers, Default Behaviour, Readline Technical
+@section Custom Functions
+
+Readline provides a great many functions for manipulating the text of
+the line. But it isn't possible to anticipate the needs of all
+programs. This section describes the various functions and variables
+defined in within the Readline library which allow a user program to add
+customized functionality to Readline.
+
+@menu
+* The Function Type:: C declarations to make code readable.
+* Function Naming:: How to give a function you write a name.
+* Keymaps:: Making keymaps.
+* Binding Keys:: Changing Keymaps.
+* Function Writing:: Variables and calling conventions.
+* Allowing Undoing:: How to make your functions undoable.
+@end menu
+
+@node The Function Type, Function Naming, Custom Functions, Custom Functions
+For the sake of readabilty, we declare a new type of object, called
+@dfn{Function}. `Function' is a C language function which returns an
+@code{int}. The type declaration for `Function' is:
+
+@code{typedef int Function ();}
+
+The reason for declaring this new type is to make it easier to discuss
+pointers to C functions. Let us say we had a variable called @var{func}
+which was a pointer to a function. Instead of the classic C declaration
+
+@code{int (*)()func;}
+
+we have
+
+@code{Function *func;}
+
+@node Function Naming, Keymaps, The Function Type, Custom Functions
+@subsection Naming a Function
+
+The user can dynamically change the bindings of keys while using
+Readline. This is done by representing the function with a descriptive
+name. The user is able to type the descriptive name when referring to
+the function. Thus, in an init file, one might find
+
+@example
+Meta-Rubout: backward-kill-word
+@end example
+
+This binds @key{Meta-Rubout} to the function @emph{descriptively} named
+@code{backward-kill-word}. You, as a programmer, should bind the
+functions you write to descriptive names as well. Here is how to do
+that.
+
+@defun rl_add_defun (char *name, Function *function, int key)
+Add @var{name} to the list of named functions. Make @var{function} be
+the function that gets called. If @var{key} is not -1, then bind it to
+@var{function} using @code{rl_bind_key ()}.
+@end defun
+
+Using this function alone is sufficient for most applications. It is
+the recommended way to add a few functions to the default functions that
+Readline has built in already. If you need to do more or different
+things than adding a function to Readline, you may need to use the
+underlying functions described below.
+
+@node Keymaps, Binding Keys, Function Naming, Custom Functions
+@subsection Selecting a Keymap
+
+Key bindings take place on a @dfn{keymap}. The keymap is the
+association between the keys that the user types and the functions that
+get run. You can make your own keymaps, copy existing keymaps, and tell
+Readline which keymap to use.
+
+@defun rl_make_bare_keymap ()
+Returns a new, empty keymap. The space for the keymap is allocated with
+@code{malloc ()}; you should @code{free ()} it when you are done.
+@end defun
+
+@defun rl_copy_keymap (Keymap map)
+Return a new keymap which is a copy of @var{map}.
+@end defun
+
+@defun rl_make_keymap ()
+Return a new keymap with the printing characters bound to rl_insert,
+the lowercase Meta characters bound to run their equivalents, and
+the Meta digits bound to produce numeric arguments.
+@end defun
+
+@node Binding Keys, Function Writing, Keymaps, Custom Functions
+@subsection Binding Keys
+
+You associate keys with functions through the keymap. Here are
+the functions for doing that.
+
+@defun rl_bind_key (int key, Function *function)
+Binds @var{key} to @var{function} in the currently selected keymap.
+Returns non-zero in the case of an invalid @var{key}.
+@end defun
+
+@defun rl_bind_key_in_map (int key, Function *function, Keymap map)
+Bind @var{key} to @var{function} in @var{map}. Returns non-zero in the case
+of an invalid @var{key}.
+@end defun
+
+@defun rl_unbind_key (int key)
+Make @var{key} do nothing in the currently selected keymap.
+Returns non-zero in case of error.
+@end defun
+
+@defun rl_unbind_key_in_map (int key, Keymap map)
+Make @var{key} be bound to the null function in @var{map}.
+Returns non-zero in case of error.
+@end defun
+
+@node Function Writing, Allowing Undoing, Binding Keys, Custom Functions
+@subsection Writing a New Function
+
+In order to write new functions for Readline, you need to know the
+calling conventions for keyboard invoked functions, and the names of the
+variables that describe the current state of the line gathered so far.
+
+@defvar char *rl_line_buffer
+This is the line gathered so far. You are welcome to modify the
+contents of this, but see Undoing, below.
+@end defvar
+
+@defvar int rl_point
+The offset of the current cursor position in @var{rl_line_buffer}.
+@end defvar
+
+@defvar int rl_end
+The number of characters present in @code{rl_line_buffer}. When
+@code{rl_point} is at the end of the line, then @code{rl_point} and
+@code{rl_end} are equal.
+@end defvar
+
+The calling sequence for a command @code{foo} looks like
+
+@example
+@code{foo (count, key)}
+@end example
+
+where @var{count} is the numeric argument (or 1 if defaulted) and
+@var{key} is the key that invoked this function.
+
+It is completely up to the function as to what should be done with the
+numeric argument; some functions use it as a repeat count, other
+functions as a flag, and some choose to ignore it. In general, if a
+function uses the numeric argument as a repeat count, it should be able
+to do something useful with a negative argument as well as a positive
+argument. At the very least, it should be aware that it can be passed a
+negative argument.
+
+@node Allowing Undoing, , Function Writing, Custom Functions
+@subsection Allowing Undoing
+
+Supporting the undo command is a painless thing to do, and makes your
+function much more useful to the end user. It is certainly easy to try
+something if you know you can undo it. I could use an undo function for
+the stock market.
+
+If your function simply inserts text once, or deletes text once, and it
+calls @code{rl_insert_text ()} or @code{rl_delete_text ()} to do it, then
+undoing is already done for you automatically, and you can safely skip
+this section.
+
+If you do multiple insertions or multiple deletions, or any combination
+of these operations, you will want to group them together into one
+operation. This can be done with @code{rl_begin_undo_group ()} and
+@code{rl_end_undo_group ()}.
+
+@defun rl_begin_undo_group ()
+Begins saving undo information in a group construct. The undo
+information usually comes from calls to @code{rl_insert_text ()} and
+@code{rl_delete_text ()}, but they could be direct calls to
+@code{rl_add_undo ()}.
+@end defun
+
+@defun rl_end_undo_group ()
+Closes the current undo group started with @code{rl_begin_undo_group
+()}. There should be exactly one call to @code{rl_end_undo_group ()}
+for every call to @code{rl_begin_undo_group ()}.
+@end defun
+
+Finally, if you neither insert nor delete text, but directly modify the
+existing text (e.g. change its case), you call @code{rl_modifying ()}
+once, just before you modify the text. You must supply the indices of
+the text range that you are going to modify.
+
+@defun rl_modifying (int start, int end)
+Tell Readline to save the text between @var{start} and @var{end} as a
+single undo unit. It is assumed that subsequent to this call you will
+modify that range of text in some way.
+@end defun
+
+@subsection An Example
+
+Let us say that we are actually going to put an example here.
+
+@node Custom Completers, Variable Index, Custom Functions, Readline Technical
+
+Typically, a program that reads commands from the user has a way of
+disambiguating between commands and data. If your program is one of
+these, then it can provide completion for either commands, or data, or
+both commands and data. The following sections describe how your
+program and Readline cooperate to provide this service to end users.
+
+@menu
+@end menu
+
+@node Variable Index, , Custom Completers, Readline Technical
+@appendix Variable Index
+@printindex vr
+@contents
+
+@bye
+
diff --git a/gdb/remote.c b/gdb/remote.c
index 66f3b2c..5bf5768 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -66,6 +66,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
kill req k
*/
+#include <stdio.h>
#include "defs.h"
#include "param.h"
#include "frame.h"
@@ -78,7 +79,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <fcntl.h>
#endif
-#include <stdio.h>
#include <signal.h>
#include <sys/ioctl.h>
#include <sys/file.h>
diff --git a/gdb/source.c b/gdb/source.c
index bf8760b..ae3a70d 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License
along with GDB; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+#include <stdio.h>
#include "defs.h"
#include "symtab.h"
#include "param.h"
@@ -26,7 +27,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <fcntl.h>
#endif
-#include <stdio.h>
#include <sys/param.h>
#include <sys/stat.h>
#include <sys/file.h>
@@ -370,12 +370,14 @@ find_source_lines (s, desc)
int *line_charpos = (int *) xmalloc (lines_allocated * sizeof (int));
extern int exec_mtime;
- fstat (desc, &st);
+ if (fstat (desc, &st) < 0)
+ perror_with_name (s->filename);
if (get_exec_file (0) != 0 && exec_mtime < st.st_mtime)
printf ("Source file is more recent than executable.\n");
data = (char *) alloca (st.st_size);
- myread (desc, data, st.st_size);
+ if (myread (desc, data, st.st_size) < 0)
+ perror_with_name (s->filename);
end = data + st.st_size;
p = data;
line_charpos[0] = 0;
@@ -525,8 +527,8 @@ print_source_lines (s, line, stopline, noerror)
if (line < 1 || line > s->nlines)
{
close (desc);
- error ("Line number out of range; %s has %d lines.",
- s->filename, s->nlines);
+ error ("Line number %d out of range; %s has %d lines.",
+ line, s->filename, s->nlines);
}
if (lseek (desc, s->line_charpos[line - 1], 0) < 0)
diff --git a/gdb/sparc-dep.c b/gdb/sparc-dep.c
index 2a73c68..29f6ae0 100644
--- a/gdb/sparc-dep.c
+++ b/gdb/sparc-dep.c
@@ -19,13 +19,13 @@ You should have received a copy of the GNU General Public License
along with GDB; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+#include <stdio.h>
#include "defs.h"
#include "param.h"
#include "frame.h"
#include "inferior.h"
#include "obstack.h"
-#include <stdio.h>
#include <sys/param.h>
#include <sys/dir.h>
#include <sys/user.h>
@@ -700,10 +700,12 @@ exec_file_command (filename, from_tty)
if (read_aout_hdr (execchan, &exec_aouthdr, aout_hdrsize) < 0)
error ("\"%s\": can't read optional aouthdr", execfile);
- if (read_section_hdr (execchan, _TEXT, &text_hdr, num_sections) < 0)
+ if (read_section_hdr (execchan, _TEXT, &text_hdr, num_sections,
+ aout_hdrsize) < 0)
error ("\"%s\": can't read text section header", execfile);
- if (read_section_hdr (execchan, _DATA, &data_hdr, num_sections) < 0)
+ if (read_section_hdr (execchan, _DATA, &data_hdr, num_sections,
+ aout_hdrsize) < 0)
error ("\"%s\": can't read data section header", execfile);
text_start = exec_aouthdr.text_start;
diff --git a/gdb/sun3-dep.c b/gdb/sun3-dep.c
index 0a99e6a..d7cf880 100644
--- a/gdb/sun3-dep.c
+++ b/gdb/sun3-dep.c
@@ -18,12 +18,12 @@ You should have received a copy of the GNU General Public License
along with GDB; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+#include <stdio.h>
#include "defs.h"
#include "param.h"
#include "frame.h"
#include "inferior.h"
-#include <stdio.h>
#include <sys/param.h>
#include <sys/dir.h>
#include <sys/user.h>
@@ -175,16 +175,23 @@ store_inferior_registers (regno)
else
{
bcopy (registers, &inferior_registers, 16 * 4);
+#ifdef FP0_REGNUM
bcopy (&registers[REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers,
sizeof inferior_fp_registers.fps_regs);
+#endif
inferior_registers.r_ps = *(int *)&registers[REGISTER_BYTE (PS_REGNUM)];
inferior_registers.r_pc = *(int *)&registers[REGISTER_BYTE (PC_REGNUM)];
+
+#ifdef FP0_REGNUM
bcopy (&registers[REGISTER_BYTE (FPC_REGNUM)],
&inferior_fp_registers.fps_control,
sizeof inferior_fp_registers - sizeof inferior_fp_registers.fps_regs);
+#endif
ptrace (PTRACE_SETREGS, inferior_pid, &inferior_registers);
+#if FP0_REGNUM
ptrace (PTRACE_SETFPREGS, inferior_pid, &inferior_fp_registers);
+#endif
}
}
@@ -548,10 +555,12 @@ exec_file_command (filename, from_tty)
if (read_aout_hdr (execchan, &exec_aouthdr, aout_hdrsize) < 0)
error ("\"%s\": can't read optional aouthdr", execfile);
- if (read_section_hdr (execchan, _TEXT, &text_hdr, num_sections) < 0)
+ if (read_section_hdr (execchan, _TEXT, &text_hdr, num_sections,
+ aout_hdrsize) < 0)
error ("\"%s\": can't read text section header", execfile);
- if (read_section_hdr (execchan, _DATA, &data_hdr, num_sections) < 0)
+ if (read_section_hdr (execchan, _DATA, &data_hdr, num_sections,
+ aout_hdrsize) < 0)
error ("\"%s\": can't read data section header", execfile);
text_start = exec_aouthdr.text_start;
diff --git a/gdb/symmetry-dep.c b/gdb/symmetry-dep.c
index 92fd89a..78b4449 100644
--- a/gdb/symmetry-dep.c
+++ b/gdb/symmetry-dep.c
@@ -19,13 +19,13 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
/* many 387-specific items of use taken from i386-dep.c */
+#include <stdio.h>
#include "defs.h"
#include "param.h"
#include "frame.h"
#include "inferior.h"
#include "symtab.h"
-#include <stdio.h>
#include <signal.h>
#include <sys/param.h>
#include <sys/user.h>
@@ -570,10 +570,12 @@ exec_file_command (filename, from_tty)
if (read_aout_hdr (execchan, &exec_aouthdr, aout_hdrsize) < 0)
error ("\"%s\": can't read optional aouthdr", execfile);
- if (read_section_hdr (execchan, _TEXT, &text_hdr, num_sections) < 0)
+ if (read_section_hdr (execchan, _TEXT, &text_hdr, num_sections,
+ aout_hdrsize) < 0)
error ("\"%s\": can't read text section header", execfile);
- if (read_section_hdr (execchan, _DATA, &data_hdr, num_sections) < 0)
+ if (read_section_hdr (execchan, _DATA, &data_hdr, num_sections,
+ aout_hdrsize) < 0)
error ("\"%s\": can't read data section header", execfile);
text_start = exec_aouthdr.text_start;
diff --git a/gdb/symmisc.c b/gdb/symmisc.c
index 600bb28..bb4eb50 100644
--- a/gdb/symmisc.c
+++ b/gdb/symmisc.c
@@ -456,7 +456,7 @@ print_symbol (symbol, depth, outfile)
print_spaces (depth, outfile);
if (SYMBOL_NAMESPACE (symbol) == LABEL_NAMESPACE)
{
- fprintf (outfile, "label %s at 0x%x", SYMBOL_NAME (symbol),
+ fprintf (outfile, "label %s at 0x%x\n", SYMBOL_NAME (symbol),
SYMBOL_VALUE (symbol));
return;
}
diff --git a/gdb/symseg.h b/gdb/symseg.h
index 468580e..43a8123 100644
--- a/gdb/symseg.h
+++ b/gdb/symseg.h
@@ -286,7 +286,12 @@ struct type
/* If this type has a base class, put it here.
If this type is a pointer type, the chain of member pointer
types goes here.
- Unused otherwise. */
+ Unused otherwise.
+
+ Contrary to all maxims of C style and common sense, the baseclasses
+ are indexed from 1 to N_BASECLASSES rather than 0 to N_BASECLASSES-1
+ (i.e. BASECLASSES points to one *before* the first element of
+ the array). */
struct type **baseclasses;
};
@@ -444,7 +449,10 @@ struct partial_symbol
/* Address class (for info_symbols) */
enum address_class class;
/* Value (only used for static functions currently). Done this
- way so that we can use the struct symbol macros. */
+ way so that we can use the struct symbol macros.
+ Note that the address of a function is SYMBOL_VALUE (pst)
+ in a partial symbol table, but BLOCK_START (SYMBOL_BLOCK_VALUE (st))
+ in a symbol table. */
union
{
long value;
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 2b4dfb7..376733f 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -17,11 +17,11 @@ You should have received a copy of the GNU General Public License
along with GDB; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+#include <stdio.h>
#include "defs.h"
#include "symtab.h"
#include "param.h"
-#include <stdio.h>
#include <obstack.h>
#include <assert.h>
@@ -1802,6 +1802,9 @@ decode_line_spec (string, funfirstline)
return sals;
}
+/* Given a list of NELTS symbols in sym_arr (with corresponding
+ mangled names in physnames), return a list of lines to operate on
+ (ask user if necessary). */
struct symtabs_and_lines
decode_line_2 (argptr, sym_arr, physnames, nelts, funfirstline)
char **argptr;
@@ -2130,8 +2133,8 @@ list_symbols (regexp, class)
}
else
{
- char buf[1024];
# if 0
+ char buf[1024];
type_print_base (TYPE_FN_FIELD_TYPE(t, i), stdout, 0, 0);
type_print_varspec_prefix (TYPE_FN_FIELD_TYPE(t, i), stdout, 0);
sprintf (buf, " %s::", TYPE_NAME (t));
@@ -2166,12 +2169,15 @@ types_info (regexp)
list_symbols (regexp, 2);
}
+#if 0
+/* Tiemann says: "info methods was never implemented." */
static void
methods_info (regexp)
char *regexp;
{
list_symbols (regexp, 3);
}
+#endif /* 0 */
/* Call sort_block_syms to sort alphabetically the symbols of one block. */
@@ -2393,11 +2399,13 @@ _initialize_symtab ()
"All function names, or those matching REGEXP.");
add_info ("types", types_info,
"All types names, or those matching REGEXP.");
+#if 0
add_info ("methods", methods_info,
"All method names, or those matching REGEXP::REGEXP.\n\
If the class qualifier is ommited, it is assumed to be the current scope.\n\
If the first REGEXP is ommited, then all methods matching the second REGEXP\n\
are listed.");
+#endif
add_info ("sources", sources_info,
"Source files in the program.");
diff --git a/gdb/umax-dep.c b/gdb/umax-dep.c
index 0f055f7..717ea45 100644
--- a/gdb/umax-dep.c
+++ b/gdb/umax-dep.c
@@ -17,12 +17,12 @@ You should have received a copy of the GNU General Public License
along with GDB; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+#include <stdio.h>
#include "defs.h"
#include "param.h"
#include "frame.h"
#include "inferior.h"
-#include <stdio.h>
#include <sys/param.h>
#include <sys/dir.h>
#include <signal.h>
@@ -534,10 +534,12 @@ exec_file_command (filename, from_tty)
if (read_aout_hdr (execchan, &exec_aouthdr, aout_hdrsize) < 0)
error ("\"%s\": can't read optional aouthdr", execfile);
- if (read_section_hdr (execchan, _TEXT, &text_hdr, num_sections) < 0)
+ if (read_section_hdr (execchan, _TEXT, &text_hdr, num_sections,
+ aout_hdrsize) < 0)
error ("\"%s\": can't read text section header", execfile);
- if (read_section_hdr (execchan, _DATA, &data_hdr, num_sections) < 0)
+ if (read_section_hdr (execchan, _DATA, &data_hdr, num_sections,
+ aout_hdrsize) < 0)
error ("\"%s\": can't read data section header", execfile);
text_start = exec_aouthdr.text_start;
diff --git a/gdb/valops.c b/gdb/valops.c
index 2e7354b..873518b 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -534,6 +534,9 @@ call_function (function, nargs, args)
save_inferior_status (&inf_status, 1);
old_chain = make_cleanup (restore_inferior_status, &inf_status);
+ /* PUSH_DUMMY_FRAME is responsible for saving the inferior registers
+ (and POP_FRAME for restoring them). (At least on most machines)
+ they are saved on the stack in the inferior. */
PUSH_DUMMY_FRAME;
old_sp = sp = read_register (SP_REGNUM);
@@ -872,7 +875,7 @@ value_struct_elt (arg1, args, name, static_memfuncp, err)
}
if (found == 0)
- error ("there is no field named %s", name);
+ error ("There is no field named %s.", name);
return 0;
}
@@ -1008,11 +1011,7 @@ check_field (arg1, name)
/* Follow pointers until we get to a non-pointer. */
while (TYPE_CODE (t) == TYPE_CODE_PTR || TYPE_CODE (t) == TYPE_CODE_REF)
- {
- arg1 = value_ind (arg1);
- COERCE_ARRAY (arg1);
- t = VALUE_TYPE (arg1);
- }
+ t = TYPE_TARGET_TYPE (t);
if (TYPE_CODE (t) == TYPE_CODE_MEMBER)
error ("not implemented: member type in check_field");
@@ -1037,7 +1036,6 @@ check_field (arg1, name)
break;
t = TYPE_BASECLASS (t, 1);
- VALUE_TYPE (arg1) = t; /* side effect! */
}
/* C++: If it was not found as a data field, then try to
diff --git a/gdb/valprint.c b/gdb/valprint.c
index 8b01964..2bf1f88 100644
--- a/gdb/valprint.c
+++ b/gdb/valprint.c
@@ -23,10 +23,13 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "symtab.h"
#include "value.h"
+/* GNU software is only expected to run on systems with 32-bit integers. */
+#define UINT_MAX 0xffffffff
+
/* Maximum number of chars to print for a string pointer value
- or vector contents. */
+ or vector contents, or UINT_MAX for no limit. */
-static int print_max;
+static unsigned int print_max;
static void type_print_varspec_suffix ();
static void type_print_varspec_prefix ();
@@ -45,13 +48,15 @@ char **float_type_table;
/* Print the character string STRING, printing at most LENGTH characters.
Printing stops early if the number hits print_max; repeat counts
- are printed as appropriate. */
+ are printed as appropriate. Print ellipses at the end if we
+ had to stop before printing LENGTH characters, or if FORCE_ELLIPSES. */
void
-print_string (stream, string, length)
+print_string (stream, string, length, force_ellipses)
FILE *stream;
char *string;
unsigned int length;
+ int force_ellipses;
{
register unsigned int i;
unsigned int things_printed = 0;
@@ -118,8 +123,7 @@ print_string (stream, string, length)
if (in_quotes)
fputs_filtered ("\"", stream);
- /* Print ellipses if we stopped before printing LENGTH characters. */
- if (i < length)
+ if (force_ellipses || i < length)
fputs_filtered ("...", stream);
}
@@ -149,7 +153,7 @@ value_print (val, stream, format, pretty)
/* Print arrays of characters using string syntax. */
if (typelen == 1 && TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_INT
&& format == 0)
- print_string (stream, VALUE_CONTENTS (val), n);
+ print_string (stream, VALUE_CONTENTS (val), n, 0);
else
{
unsigned int things_printed = 0;
@@ -292,7 +296,7 @@ val_print (type, valaddr, address, stream, format,
/* For an array of chars, print with string syntax. */
if (eltlen == 1 && TYPE_CODE (elttype) == TYPE_CODE_INT
&& format == 0)
- print_string (stream, valaddr, len);
+ print_string (stream, valaddr, len, 0);
else
{
unsigned int things_printed = 0;
@@ -478,7 +482,9 @@ val_print (type, valaddr, address, stream, format,
&& TYPE_CODE (elttype) == TYPE_CODE_INT
&& format == 0
&& unpack_long (type, valaddr) != 0
- && print_max)
+ /* If print_max is UINT_MAX, the alloca below will fail.
+ In that case don't try to print the string. */
+ && print_max < UINT_MAX)
{
fprintf_filtered (stream, " ");
@@ -497,6 +503,16 @@ val_print (type, valaddr, address, stream, format,
int out_of_bounds = 0;
char *string = (char *) alloca (print_max);
+ /* If the loop ends by us hitting print_max characters,
+ we need to have elipses at the end. */
+ int force_ellipses = 1;
+
+ /* This loop only fetches print_max characters, even
+ though print_string might want to print more
+ (with repeated characters). This is so that
+ we don't spend forever fetching if we print
+ a long string consisting of the same character
+ repeated. */
while (i < print_max)
{
QUIT;
@@ -504,19 +520,23 @@ val_print (type, valaddr, address, stream, format,
+ i, &c, 1))
{
out_of_bounds = 1;
+ force_ellipses = 0;
break;
}
else if (c == '\0')
- break;
+ {
+ force_ellipses = 0;
+ break;
+ }
else
string[i++] = c;
}
if (i != 0)
- print_string (stream, string, i);
+ print_string (stream, string, i, force_ellipses);
if (out_of_bounds)
fprintf_filtered (stream,
- "*** <Address 0x%x out of bounds>",
+ " <Address 0x%x out of bounds>",
(*(int *) valaddr) + i);
}
@@ -699,7 +719,7 @@ val_print (type, valaddr, address, stream, format,
break;
}
#ifdef IEEE_FLOAT
- if (is_nan ((void *) valaddr, TYPE_LENGTH (type)))
+ if (is_nan ((char *) valaddr, TYPE_LENGTH (type)))
{
fprintf_filtered (stream, "NaN");
break;
@@ -735,7 +755,7 @@ val_print (type, valaddr, address, stream, format,
int
is_nan (fp, len)
- void *fp;
+ char *fp;
int len;
{
int lowhalf, highhalf;
@@ -1276,6 +1296,8 @@ set_maximum_command (arg)
{
if (!arg) error_no_arg ("value for maximum elements to print");
print_max = parse_and_eval_address (arg);
+ if (print_max == 0)
+ print_max = UINT_MAX;
}
static void
@@ -1304,8 +1326,12 @@ format_info (arg, from_tty)
prettyprint ? "on" : "off");
printf ("Printing of unions interior to structures is %s.\n",
unionprint ? "on" : "off");
- printf ("The maximum number of array elements printed is %d.\n",
- print_max);
+ if (print_max == UINT_MAX)
+ printf_filtered
+ ("There is no maximum number of array elements printed.\n");
+ else
+ printf_filtered
+ ("The maximum number of array elements printed is %d.\n", print_max);
}
extern struct cmd_list_element *setlist;
@@ -1314,7 +1340,8 @@ void
_initialize_valprint ()
{
add_cmd ("array-max", class_vars, set_maximum_command,
- "Set NUMBER as limit on string chars or array elements to print.",
+ "Set NUMBER as limit on string chars or array elements to print.\n\
+\"set array-max 0\" causes there to be no limit.",
&setlist);
add_cmd ("prettyprint", class_support, set_prettyprint_command,
diff --git a/gdb/version.c b/gdb/version.c
index d141464..2f3dd85 100644
--- a/gdb/version.c
+++ b/gdb/version.c
@@ -17,4 +17,4 @@ You should have received a copy of the GNU General Public License
along with GDB; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-char *version = "3.4";
+char *version = "3.5";
diff --git a/gdb/xgdb.c b/gdb/xgdb.c
index 54290ec..1d342a9 100644
--- a/gdb/xgdb.c
+++ b/gdb/xgdb.c
@@ -19,6 +19,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
/* Original version was contributed by Derek Beatty, 30 June 87. */
+#include <stdio.h>
#include "defs.h"
#include "param.h"
#include "symtab.h"
@@ -32,7 +33,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <X11/Box.h>
#include <X11/VPaned.h>
-#include <stdio.h>
/*#define XtNfunction "function"*/