summaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorJason Molenda <jsm@bugshack.cygnus.com>1999-06-07 19:19:32 +0000
committerJason Molenda <jsm@bugshack.cygnus.com>1999-06-07 19:19:32 +0000
commit86fc4239597ab2f5f06dde7abbd9b703f40f68e0 (patch)
treeca2dfabc660e8368b912c33df57b7d9653648916 /gdb
parent7bda8502330f896cfee8270608707492d9621feb (diff)
downloadgdb-86fc4239597ab2f5f06dde7abbd9b703f40f68e0.tar.gz
import gdb-1999-06-07 snapshot
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog217
-rw-r--r--gdb/MAINTAINERS3
-rw-r--r--gdb/Makefile.in2
-rw-r--r--gdb/blockframe.c20
-rw-r--r--gdb/config/a29k/tm-vx29k.h7
-rw-r--r--gdb/config/d10v/tm-d10v.h71
-rw-r--r--gdb/config/i386/tm-i386gnu.h22
-rw-r--r--gdb/config/i960/tm-vx960.h7
-rw-r--r--gdb/config/m68k/tm-delta68.h2
-rw-r--r--gdb/config/m68k/tm-news.h2
-rw-r--r--gdb/config/m68k/tm-vx68.h7
-rw-r--r--gdb/config/mips/tm-irix3.h4
-rw-r--r--gdb/config/mips/tm-mips.h26
-rw-r--r--gdb/config/mips/tm-tx39.h4
-rw-r--r--gdb/config/mips/tm-tx39l.h4
-rw-r--r--gdb/config/mips/tm-vxmips.h7
-rw-r--r--gdb/config/ns32k/tm-merlin.h2
-rw-r--r--gdb/config/ns32k/tm-umax.h42
-rw-r--r--gdb/config/pa/tm-hppa.h3
-rw-r--r--gdb/config/sparc/tm-vxsparc.h7
-rw-r--r--gdb/configure.tgt9
-rw-r--r--gdb/d10v-tdep.c161
-rw-r--r--gdb/defs.h6
-rw-r--r--gdb/doc/ChangeLog12
-rw-r--r--gdb/doc/gdb.texinfo475
-rw-r--r--gdb/doc/gdbint.texinfo24
-rw-r--r--gdb/eval.c17
-rw-r--r--gdb/fork-child.c40
-rw-r--r--gdb/frame.h4
-rw-r--r--gdb/gdbarch.c9
-rw-r--r--gdb/gdbarch.h20
-rw-r--r--gdb/gdbthread.h63
-rw-r--r--gdb/gnu-nat.c90
-rw-r--r--gdb/go32-nat.c47
-rw-r--r--gdb/hppa-tdep.c228
-rw-r--r--gdb/inftarg.c60
-rw-r--r--gdb/mips-tdep.c70
-rw-r--r--gdb/ns32k-tdep.c6
-rw-r--r--gdb/parse.c85
-rw-r--r--gdb/parser-defs.h2
-rw-r--r--gdb/remote.c268
-rw-r--r--gdb/rs6000-tdep.c2
-rw-r--r--gdb/somread.c26
-rw-r--r--gdb/symtab.c67
-rw-r--r--gdb/testsuite/ChangeLog19
-rwxr-xr-xgdb/testsuite/configure9
-rw-r--r--gdb/testsuite/configure.in9
-rw-r--r--gdb/testsuite/gdb.base/Makefile.in4
-rw-r--r--gdb/testsuite/gdb.base/a1-selftest.exp6
-rw-r--r--gdb/testsuite/gdb.base/condbreak.exp2
-rw-r--r--gdb/testsuite/gdb.base/ending-run.exp7
-rw-r--r--gdb/testsuite/gdb.base/mips_pro.exp2
-rw-r--r--gdb/testsuite/gdb.c++/cplusfuncs.cc4
-rw-r--r--gdb/testsuite/gdb.c++/templates.cc8
-rw-r--r--gdb/thread.c66
55 files changed, 1528 insertions, 858 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 26a138af3c8..75d8426cc1c 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,220 @@
+1999-06-07 Keith Seitz <keiths@cygnus.com>
+
+ * v850ice.c (init_hidden_window): Do not rely on the existence of
+ a gui for window creation. Return boolean status.
+ (v850ice_open): Use boolean status of init_hidden_window.
+ Allow any ICE execution command to run under CLI. Maybe one
+ day gdb will use a real event loop and allow this code to run.
+ * configure.tgt: Configure the v850 ice for all cygwin-hosted
+ toolchains.
+
+Mon Jun 7 23:37:26 1999 Andrew Cagney <cagney@amy.cygnus.com>
+
+ * config/mips/tm-mips.h (EXTRA_FRAME_INFO): Delete.
+ * mips-tdep.c (mips_init_extra_frame_info): Allocate saved_regs.
+ (temp_saved_regs): Replace struct with a simple pointer.
+ (set_reg_offset, mips32_heuristic_proc_desc, heuristic_proc_desc,
+ mips_init_extra_frame_info): Update.
+
+Mon Jun 7 21:40:12 1999 Andrew Cagney <cagney@amy.cygnus.com>
+
+ * config/mips/tm-mips.h (EXTRA_FRAME_INFO): Move elements from here.
+ * mips-tdep.c (struct frame_extra_info): To here.
+
+ * mips-tdep.c (mips_print_extra_frame_info, mips_find_saved_regs,
+ mips_init_extra_frame_info, mips_pop_frame): Update
+ (mips_init_extra_frame_info): Allocate space for the extra info.
+
+Mon Jun 7 21:08:50 1999 Andrew Cagney <cagney@amy.cygnus.com>
+
+ * config/mips/tm-mips.h (mips_init_extra_frame_info), mips-tdep.c:
+ Rename init_extra_frame_info. Add argument ``fromleaf''.
+
+ * config/mips/tm-mips.h (mips_print_extra_frame_info),
+ mips-tdep.c: New function.
+ (PRINT_EXTRA_FRAME_INFO): Update definition.
+
+Mon Jun 7 20:11:07 1999 Andrew Cagney <cagney@amy.cygnus.com>
+
+ * config/mips/tm-mips.h, config/mips/tm-irix3.h,
+ config/mips/tm-tx19.h, config/mips/tm-tx19l.h,
+ config/mips/tm-tx39.h, config/mips/tm-tx39l.h: Rename macro
+ REGISTER_NAMES to MIPS_REGISTER_NAMES.
+
+ * config/mips/tm-mips.h (REGISTER_NAME): Define.
+ * mips-tdep.c (mips_processor_reg_names): New static variable.
+ (mips_register_name): New function.
+ (mips_set_processor_type): Update mips_processor_reg_names.
+ (mips_generic_reg_names): Initialize using MIPS_REGISTER_NAMES.
+
+Sun Jun 6 11:09:19 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * remote.c (PBUFSIZ): Re-define so that value is computed at
+ run-time.
+ (MAXBUFBYTES): Re-define as a macro function.
+
+1999-06-05 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * symtab.c (decode_line_1): Accept filenames with spaces in
+ 'linespecs' when enclosed in double quotation marks and handle
+ drive specification is DOS format (D:).
+
+1999-06-04 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * parse.c: Don't include <ctype.h> twice.
+
+1999-06-04 David Taylor <taylor@louisiana.cygnus.com>
+
+ Sat May 15 12:16:09 1999 Per Bothner <bothner@deneb.cygnus.com>
+
+ * eval.c (evaluate_subexp_standard): Remove Gilmore rant.
+ (Of course C has "expected types", at least if you allow
+ brace-initializer expressions - as in Gcc.)
+ Remove NULLing out expect_type. Do pass NULL_TYPE in place
+ the incoming expect_type where appropriate.
+
+Fri Jun 4 10:56:23 1999 Jeffrey A Law (law@cygnus.com)
+
+ * hppa-tdep.c (hppa_fix_call_dummy): Make it work for GCC compiled
+ executables without end.o. Clean up lots of mis-guided comments.
+
+Fri Jun 4 17:10:36 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * parser-defs.h (std_regs): Replace array with pointer.
+ * parse.c (build_parse): Build the std_regs table according to the
+ standard registers available.
+
+1999-06-03 Michael Snyder <msnyder@cleaver.cygnus.com>
+
+ * thread.c: eliminate the target_thread_vector (functionality
+ moved into the standard target vector).
+ * gdbthread.h: eliminate target_thread_vector. Move all related
+ defines into remote.c, since they are no longer shared with thread.c.
+ * remote.c: eliminate the target_thread_vector.
+ (remote_find_new_threads): change return type to void, consistent
+ with the target vector table. (cont_thread): rename continue_thread.
+ (record_currthread): remove dead code. (remote_thread_alive):
+ clean up and simplify. (threadref etc.): move definitions to here
+ from gdbthread.h.
+
+1999-06-02 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * inftarg.c (child_create_inferior): Remove dead HPUX specific code
+ which tries to find csh.
+ * fork-child.c: Remove DEBUGGING predefine and conditionalized
+ printfs.
+ (fork_inferior): Remove dead HPUX specific code which assumes shell
+ is csh.
+
+ * hppa-tdep.c: Remove DEBUGGING and #if 0 debugging printfs.
+ * parse.c: Ditto.
+ * somread.c: Ditto.
+
+Thu Jun 3 10:12:38 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * d10v-tdep.c (do_d10v_pop_frame): Rename d10v_pop_frame. Make
+ static.
+ * d10v-tdep.c (d10v_pop_frame), config/d10v/tm-d10v.h: New
+ function. Call generic_pop_current_frame.
+ * config/d10v/tm-d10v.h (POP_FRAME): Update.
+ * gdbarch.h, gdbarch.c (frame_num_args_unknown): New function.
+ * config/d10v/tm-d10v.h (DMEM_START, IMEM_START, STACK_START,
+ ARG1_REGNUM, ARGN_REGNUM, RET1_REGNUM): Move definitions from
+ here.
+ * d10v-tdep.c: To here.
+ * config/d10v/tm-d10v.h (struct type): Move declaration from here.
+ * gdbarch.h: To here.
+ * config/d10v/tm-d10v.h (struct frame_info, struct
+ frame_saved_regs, struct type): Delete declarations.
+
+1999-06-02 Robert Hoehne <robert.hoehne@gmx.net>
+
+ * go32-nat.c: go32_terminal_init, go32_terminal_inferior and
+ go32_terminal_ours are new functions to save/restore the inferior`s
+ stdin/stdout filemodes
+
+1999-06-02 Stan Shebs <shebs@andros.cygnus.com>
+
+ * MAINTAINERS: Add Mark Kettenis, Jeff Law, and Philippe De Muyter
+ as maintainers for Hurd, HP/UX, and COFF, respectively.
+
+1999-06-02 Mark Kettenis <kettenis@gnu.org>
+
+ * gnu-nat.c (inf_continue): New function.
+ (struct inf): Use `unsigned int' instead of `int' for bit-fields.
+ Add new bit-field named `nomsg'.
+ (inf_validate_procinfo): Renamed from inf_validate_stopped, all
+ callers changed. Also update the `nomsg' and `traced' fields of
+ INF.
+ (make_inf): Initialize INF->nomsg.
+ (inf_cleanup): Reset INF->nomsg.
+ (inf_detach): Call `inf_validate_procinfo'. Call `inf_continue'
+ instead of `inf_signal' if the inferior does not have a message
+ port.
+ (gnu_resume): Likewise.
+ (gnu_create_inferior): Reset INF->nomsg in `attach_to_child'.
+ Call `inf_validate_procinfo' after returning from `fork_inferior'.
+ (gnu_attach): Update signal thread and tracing state.
+
+ * config/i386/tm-i386gnu.h: Include "i386/tm-i386.h" instead of
+ "i386/tm-i386v.h".
+ (STACK_END_ADDR): Remove.
+ (SIGCONTEXT_PC_OFFSET): New define.
+ Include "tm-sysv4.h".
+
+1999-06-02 J.T. Conklin <jtc@redback.com>
+
+ * config/tm-vxworks.h: New file, header for definitions common to
+ all vxWorks targets.
+ * config/a29k/tm-vx29k.h, config/i960/tm-vx960.h,
+ config/m68k/tm-vx68.h, config/mips/tm-vxmips.h,
+ config/sparc/tm-vxsparc.h: Include tm-vxworks.h.
+
+Wed Jun 2 17:37:03 1999 Jeffrey A Law (law@cygnus.com)
+
+ * config/pa/tm-hppa.h (IMPORT_SHLIB): New unwind stub type.
+
+1999-06-02 Christopher Faylor <cgf@cygnus.com>
+
+ * configure.tgt: Alphabetically reorder some targets.
+
+1999-06-02 Keith Seitz <keiths@cygnus.com>
+
+ * v850ice.c (v850ice_xfer_memory): Insert lost "break".
+
+1999-06-02 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * rs6000-tdep.c (variants): Fix description of 750 register set.
+ (Thanks to J. T. Conklin.)
+
+Wed Jun 2 16:10:08 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * config/d10v/tm-d10v.h (FRAME_INIT_SAVED_REGS): Replace
+ FRAME_FIND_SAVED_REGS.
+ (d10v_frame_init_saved_regs): Replace d10v_frame_find_saved_regs.
+ * d10v-tdep.c (d10v_pop_frame, d10v_frame_chain,
+ d10v_frame_init_saved_regs): Update.
+
+ * config/d10v/tm-d10v.h (EXTRA_FRAME_INFO): Delete.
+ * d10v-tdep.c (struct frame_extra_info): Define.
+ (d10v_init_extra_frame_info, d10v_pop_frame, d10v_frame_chain,
+ d10v_frame_find_saved_regs): Update.
+
+Tue Jun 1 13:36:31 1999 Philippe De Muyter <phdm@macqel.be>
+
+ * config/m68k/tm-delta68.h (FRAME_NUM_ARGS): Macro prototype fixed.
+ * config/m68k/tm-news.h, config/ns32k/tm-merlin.h: Ditto.
+ * config/ns32k/tm-umax.h (FRAME_NUM_ARGS): Old macro definition
+ removed; new macro prototype fixed.
+
+Wed Jun 2 11:18:37 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * defs.h (REGISTER_NAME): Move compatibility definition from here.
+ * gdbarch.h: To here.
+
+ * frame.h, blockframe.c (generic_fix_call_dummy): New
+ stub function.
+
Tue Jun 1 18:47:54 1999 Andrew Cagney <cagney@b1.cygnus.com>
* parse.c (build_parse): New function. Initialize
diff --git a/gdb/MAINTAINERS b/gdb/MAINTAINERS
index 3810c96c1b8..3ea38367c0f 100644
--- a/gdb/MAINTAINERS
+++ b/gdb/MAINTAINERS
@@ -17,10 +17,13 @@ elf reader Jim Blandy jimb@cygnus.com
stabs reader Jim Blandy jimb@cygnus.com
x86 linux native Jim Blandy jimb@cygnus.com
Scheme support Jim Blandy jimb@cygnus.com
+hurd native Mark Kettenis kettenis@wins.va.nl
+hpux, hp pa native Jeff Law law@cygnus.com
m32r target Michael Snyder msnyder@cygnus.com
tracing Michael Snyder msnyder@cygnus.com
threads Michael Snyder msnyder@cygnus.com
breakpoint.c Michael Snyder msnyder@cygnus.com
+coff reader Philippe De Muyter phdm@macqel.be
macos host & native Stan Shebs shebs@cygnus.com
sds protocol Stan Shebs shebs@cygnus.com
rdi/adp protocol Stan Shebs shebs@cygnus.com
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 714981dcbdd..cc0bd9885d5 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -219,7 +219,7 @@ CDEPS = $(XM_CDEPS) $(TM_CDEPS) $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE) \
ADD_FILES = $(REGEX) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES)
ADD_DEPS = $(REGEX1) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES)
-VERSION = 19990601
+VERSION = 19990607
DIST=gdb
LINT=/usr/5bin/lint
diff --git a/gdb/blockframe.c b/gdb/blockframe.c
index 0ead9483fa9..8f93d6ed531 100644
--- a/gdb/blockframe.c
+++ b/gdb/blockframe.c
@@ -1107,7 +1107,8 @@ pc_in_call_dummy_at_entry_point (pc, sp, frame_address)
* zero, and CALL_DUMMY_LOCATION to AT_ENTRY. Then you must remember
* to define PUSH_RETURN_ADDRESS, because no call instruction will be
* being executed by the target. Also FRAME_CHAIN_VALID as
- * generic_frame_chain_valid. */
+ * generic_frame_chain_valid and FIX_CALL_DUMMY as
+ * generic_fix_call_dummy. */
/* Dummy frame. This saves the processor state just prior to setting
up the inferior function call. Older targets save the registers
@@ -1272,6 +1273,23 @@ generic_frame_chain_valid (fp, fi)
&& !inside_entry_file (FRAME_SAVED_PC(fi)));
}
+/* Function: fix_call_dummy
+ Stub function. Generic dumy frames typically do not need to fix
+ the frame being created */
+
+void
+generic_fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p)
+ char *dummy;
+ CORE_ADDR pc;
+ CORE_ADDR fun;
+ int nargs;
+ struct value **args;
+ struct type *type;
+ int gcc_p;
+{
+ return;
+}
+
/* Function: get_saved_register
Find register number REGNUM relative to FRAME and put its (raw,
target format) contents in *RAW_BUFFER.
diff --git a/gdb/config/a29k/tm-vx29k.h b/gdb/config/a29k/tm-vx29k.h
index 487df82df86..140df051682 100644
--- a/gdb/config/a29k/tm-vx29k.h
+++ b/gdb/config/a29k/tm-vx29k.h
@@ -1,5 +1,5 @@
/* Target machine description for VxWorks on the 29k, for GDB, the GNU debugger.
- Copyright 1994 Free Software Foundation, Inc.
+ Copyright 1994, 1999 Free Software Foundation, Inc.
Contributed by Cygnus Support.
This file is part of GDB.
@@ -19,10 +19,7 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "a29k/tm-a29k.h"
-
-#define GDBINIT_FILENAME ".vxgdbinit"
-
-#define DEFAULT_PROMPT "(vxgdb) "
+#include "tm-vxworks.h"
/* Number of registers in a ptrace_getregs call. */
diff --git a/gdb/config/d10v/tm-d10v.h b/gdb/config/d10v/tm-d10v.h
index 85aa3ef782b..99fd9ac41b9 100644
--- a/gdb/config/d10v/tm-d10v.h
+++ b/gdb/config/d10v/tm-d10v.h
@@ -31,20 +31,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define FUNCTION_START_OFFSET 0
-/* these are the addresses the D10V-EVA board maps data */
-/* and instruction memory to. */
-
-#define DMEM_START 0x0000000
-#define IMEM_START 0x1000000
-#define STACK_START 0x0007ffe
-
-#ifdef __STDC__ /* Forward decls for prototypes */
-struct frame_info;
-struct frame_saved_regs;
-struct type;
-struct value;
-#endif
-
/* Advance PC across any function entry prologue instructions
to reach some "real" code. */
@@ -74,6 +60,8 @@ extern char *d10v_register_name PARAMS ((int reg_nr));
to be actual register numbers as far as the user is concerned
but do serve to get the desired values when passed to read_register. */
+/* Used by both d10v-tdep.c and remote-d10v.c */
+
#define R0_REGNUM 0
#define LR_REGNUM 13
#define SP_REGNUM 15
@@ -85,8 +73,11 @@ extern char *d10v_register_name PARAMS ((int reg_nr));
#define DMAP_REGNUM 34
#define A0_REGNUM 35
+/* ??? */
+#define REGISTER_SIZE 2
+
/* Say how much memory is needed to store a copy of the register set */
-#define REGISTER_BYTES ((NUM_REGS-2)*2+16)
+#define REGISTER_BYTES ((37/*NUM_REGS*/-2)*2+16)
/* Index within `registers' of the first byte of the space for
register N. */
@@ -117,14 +108,13 @@ extern int d10v_register_virtual_size PARAMS ((int reg_nr));
extern struct type *d10v_register_virtual_type PARAMS ((int reg_nr));
#define REGISTER_VIRTUAL_TYPE(N) (d10v_register_virtual_type (N))
-
/* convert $pc and $sp to/from virtual addresses */
extern int d10v_register_convertible PARAMS ((int nr));
-#define REGISTER_CONVERTIBLE(N) (d10v_register_convertible ((N)))
extern void d10v_register_convert_to_virtual PARAMS ((int regnum, struct type *type, char *from, char *to));
+extern void d10v_register_convert_to_raw PARAMS ((struct type *type, int regnum, char *from, char *to));
+#define REGISTER_CONVERTIBLE(N) (d10v_register_convertible ((N)))
#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,TYPE,FROM,TO) \
d10v_register_convert_to_virtual ((REGNUM), (TYPE), (FROM), (TO))
-extern void d10v_register_convert_to_raw PARAMS ((struct type *type, int regnum, char *from, char *to));
#define REGISTER_CONVERT_TO_RAW(TYPE,REGNUM,FROM,TO) \
d10v_register_convert_to_raw ((TYPE), (REGNUM), (FROM), (TO))
@@ -143,10 +133,6 @@ extern CORE_ADDR d10v_convert_daddr_to_raw PARAMS ((CORE_ADDR x));
extern CORE_ADDR d10v_convert_iaddr_to_raw PARAMS ((CORE_ADDR x));
#define D10V_CONVERT_IADDR_TO_RAW(X) (d10v_convert_iaddr_to_raw (X))
-#define ARG1_REGNUM R0_REGNUM
-#define ARGN_REGNUM 3
-#define RET1_REGNUM R0_REGNUM
-
/* Store the address of the place in which to copy the structure the
subroutine will return. This is called from call_function.
@@ -184,21 +170,14 @@ extern use_struct_convention_fn d10v_use_struct_convention;
#define USE_STRUCT_CONVENTION(gcc_p, type) d10v_use_struct_convention (gcc_p, type)
-
/* Define other aspects of the stack frame.
we keep a copy of the worked out return pc lying around, since it
is a useful bit of info */
-#define EXTRA_FRAME_INFO \
- CORE_ADDR return_pc; \
- int frameless; \
- int size;
-
+extern void d10v_init_extra_frame_info PARAMS ((int fromleaf, struct frame_info *fi));
#define INIT_EXTRA_FRAME_INFO(fromleaf, fi) \
d10v_init_extra_frame_info(fromleaf, fi)
-extern void d10v_init_extra_frame_info PARAMS (( int fromleaf, struct frame_info *fi ));
-
/* A macro that tells us whether the function invocation represented
by FI does not have a frame on the stack associated with it. If it
does not, FRAMELESS is set to 1, else 0. */
@@ -234,17 +213,15 @@ extern CORE_ADDR d10v_saved_pc_after_call PARAMS ((struct frame_info *frame));
#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.
+/* Put here the code to store, into frame_info->saved_regs, the
+ addresses of the saved registers of frame described by FRAME_INFO.
This includes special registers such as pc and fp saved in special
- ways in the stack frame. sp is even more special:
- the address we return for it IS the sp for the next frame. */
-
-#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
- d10v_frame_find_saved_regs(frame_info, &(frame_saved_regs))
+ ways in the stack frame. sp is even more special: the address we
+ return for it IS the sp for the next frame. */
-extern void d10v_frame_find_saved_regs PARAMS ((struct frame_info *, struct frame_saved_regs *));
+extern void d10v_frame_init_saved_regs PARAMS ((struct frame_info *));
+#define FRAME_INIT_SAVED_REGS(frame_info) \
+ d10v_frame_init_saved_regs(frame_info)
/* DUMMY FRAMES. Need these to support inferior function calls. They
work like this on D10V: First we set a breakpoint at 0 or __start.
@@ -255,8 +232,8 @@ extern void d10v_frame_find_saved_regs PARAMS ((struct frame_info *, struct fram
breakpoint, clear the break point and pop the old register contents
off the stack. */
-extern void d10v_pop_frame PARAMS ((struct frame_info *frame));
-#define POP_FRAME generic_pop_current_frame (d10v_pop_frame)
+extern void d10v_pop_frame PARAMS ((void));
+#define POP_FRAME d10v_pop_frame ()
#define USE_GENERIC_DUMMY_FRAMES 1
#define CALL_DUMMY {0}
@@ -289,18 +266,8 @@ extern CORE_ADDR d10v_push_arguments PARAMS ((int, struct value **, CORE_ADDR, i
#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
d10v_extract_return_value(TYPE, REGBUF, VALBUF)
- extern void
-d10v_extract_return_value PARAMS ((struct type *, char *, char *));
-
-
-#define REGISTER_SIZE 2
+extern void d10v_extract_return_value PARAMS ((struct type *, char *, char *));
-#ifdef CC_HAS_LONG_LONG
-# define LONGEST long long
-#else
-# define LONGEST long
-#endif
-#define ULONGEST unsigned LONGEST
void d10v_write_pc PARAMS ((CORE_ADDR val, int pid));
CORE_ADDR d10v_read_pc PARAMS ((int pid));
diff --git a/gdb/config/i386/tm-i386gnu.h b/gdb/config/i386/tm-i386gnu.h
index a6e3c087d4d..3dc15a37aec 100644
--- a/gdb/config/i386/tm-i386gnu.h
+++ b/gdb/config/i386/tm-i386gnu.h
@@ -1,5 +1,5 @@
/* Macro definitions for i386, GNU Hurd
- Copyright (C) 1992 Free Software Foundation, Inc.
+ Copyright (C) 1992, 1999 Free Software Foundation, Inc.
This file is part of GDB.
@@ -17,6 +17,9 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+#ifndef TM_I386GNU_H
+#define TM_I386GNU_H 1
+
/* Include common definitions for gnu systems */
#include "nm-gnu.h"
@@ -33,16 +36,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* we can do it */
#define ATTACH_DETACH 1
-/* Sigh. There should be a file for i386 but no sysv stuff in it */
-#include "i386/tm-i386v.h"
+#include "i386/tm-i386.h"
-/* I want to test this float info code. See comment in tm-i386v.h */
#undef FLOAT_INFO
#define FLOAT_INFO { i386_mach3_float_info (); }
-/* Address of end of stack space.
- * for MACH, see <machine/vmparam.h>
- * @@@ I don't know what is in the 5 ints...
- */
-#undef STACK_END_ADDR
-#define STACK_END_ADDR (0xc0000000-sizeof(int [5]))
+/* Offset to saved PC in sigcontext. */
+#define SIGCONTEXT_PC_OFFSET 68
+
+/* We need this file for the SOLIB_TRAMPOLINE stuff. */
+#include "tm-sysv4.h"
+
+#endif /* TM_I386GNU_H */
diff --git a/gdb/config/i960/tm-vx960.h b/gdb/config/i960/tm-vx960.h
index 17e28119b29..e6cade073de 100644
--- a/gdb/config/i960/tm-vx960.h
+++ b/gdb/config/i960/tm-vx960.h
@@ -1,5 +1,5 @@
/* Parameters for VxWorks Intel 960's, for GDB, the GNU debugger.
- Copyright (C) 1986-1991 Free Software Foundation, Inc.
+ Copyright (C) 1986-1991, 1999 Free Software Foundation, Inc.
Contributed by Cygnus Support.
This file is part of GDB.
@@ -19,16 +19,13 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "i960/tm-i960.h"
+#include "tm-vxworks.h"
/* Under VxWorks the IP isn't filled in. Skip it, go with RIP, which has
the real value. */
#undef PC_REGNUM
#define PC_REGNUM RIP_REGNUM
-#define GDBINIT_FILENAME ".vxgdbinit"
-
-#define DEFAULT_PROMPT "(vxgdb) "
-
/* We have more complex, useful breakpoints on the target.
Amount ip must be decremented by after a breakpoint. */
diff --git a/gdb/config/m68k/tm-delta68.h b/gdb/config/m68k/tm-delta68.h
index e0692fbe714..8e7723439e5 100644
--- a/gdb/config/m68k/tm-delta68.h
+++ b/gdb/config/m68k/tm-delta68.h
@@ -76,7 +76,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
Can return -1, meaning no way to tell. */
extern int delta68_frame_num_args PARAMS ((struct frame_info *fi));
-#define FRAME_NUM_ARGS (delta68_frame_num_args ((fi)))
+#define FRAME_NUM_ARGS(fi) (delta68_frame_num_args ((fi)))
/* On M68040 versions of sysV68 R3V7.1, ptrace(PT_WRITE_I) does not clear
the processor's instruction cache as it should. */
diff --git a/gdb/config/m68k/tm-news.h b/gdb/config/m68k/tm-news.h
index b9736a06ccb..d844682b871 100644
--- a/gdb/config/m68k/tm-news.h
+++ b/gdb/config/m68k/tm-news.h
@@ -60,6 +60,6 @@ Here is an m-news.h file for gdb. It supports the 68881 registers.
Can return -1, meaning no way to tell. */
extern int news_frame_num_args PARAMS ((struct frame_info *fi));
-#define FRAME_NUM_ARGS (news_frame_num_args ((fi)))
+#define FRAME_NUM_ARGS(fi) (news_frame_num_args ((fi)))
#include "m68k/tm-m68k.h"
diff --git a/gdb/config/m68k/tm-vx68.h b/gdb/config/m68k/tm-vx68.h
index e601bda737c..fbec915b463 100644
--- a/gdb/config/m68k/tm-vx68.h
+++ b/gdb/config/m68k/tm-vx68.h
@@ -1,5 +1,5 @@
/* Target machine description for VxWorks m68k's, for GDB, the GNU debugger.
- Copyright 1986, 1987, 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1999 Free Software Foundation, Inc.
Contributed by Cygnus Support.
This file is part of GDB.
@@ -18,10 +18,6 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-#define GDBINIT_FILENAME ".vxgdbinit"
-
-#define DEFAULT_PROMPT "(vxgdb) "
-
/* GCC is probably the only compiler used on this configuration. So
get this right even if the code which detects gcc2_compiled. is
still broken. */
@@ -32,6 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define DECR_PC_AFTER_BREAK 0
#include "m68k/tm-m68k.h"
+#include "tm-vxworks.h"
/* Takes the current frame-struct pointer and returns the chain-pointer
to get to the calling frame.
diff --git a/gdb/config/mips/tm-irix3.h b/gdb/config/mips/tm-irix3.h
index 7e8e53eb326..c8a4775ef3f 100644
--- a/gdb/config/mips/tm-irix3.h
+++ b/gdb/config/mips/tm-irix3.h
@@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Redefine register numbers for SGI. */
#undef NUM_REGS
-#undef REGISTER_NAMES
+#undef MIPS_REGISTER_NAMES
#undef FP0_REGNUM
#undef PC_REGNUM
#undef PS_REGNUM
@@ -45,7 +45,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Initializer for an array of names of registers.
There should be NUM_REGS strings in this initializer. */
-#define REGISTER_NAMES \
+#define MIPS_REGISTER_NAMES \
{ "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3", \
"t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", \
"s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", \
diff --git a/gdb/config/mips/tm-mips.h b/gdb/config/mips/tm-mips.h
index 108a203f7f0..e2e5099df6b 100644
--- a/gdb/config/mips/tm-mips.h
+++ b/gdb/config/mips/tm-mips.h
@@ -151,11 +151,16 @@ extern breakpoint_from_pc_fn mips_breakpoint_from_pc;
#define NUM_REGS 90
#endif
+/* Given the register index, return the name of the corresponding
+ register. */
+extern char *mips_register_name PARAMS ((int regnr));
+#define REGISTER_NAME(i) mips_register_name (i)
+
/* Initializer for an array of names of registers.
There should be NUM_REGS strings in this initializer. */
-#ifndef REGISTER_NAMES
-#define REGISTER_NAMES \
+#ifndef MIPS_REGISTER_NAMES
+#define MIPS_REGISTER_NAMES \
{ "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3", \
"t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", \
"s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", \
@@ -438,20 +443,13 @@ typedef struct mips_extra_func_info {
PDR pdr; /* Procedure descriptor record */
} *mips_extra_func_info_t;
-#define EXTRA_FRAME_INFO \
- mips_extra_func_info_t proc_desc; \
- int num_args;
-
-#define INIT_EXTRA_FRAME_INFO(fromleaf, fci) init_extra_frame_info(fci)
-extern void init_extra_frame_info PARAMS ((struct frame_info *));
+extern void mips_init_extra_frame_info PARAMS ((int fromleaf, struct frame_info *));
+#define INIT_EXTRA_FRAME_INFO(fromleaf, fci) \
+ mips_init_extra_frame_info(fromleaf, fci)
+extern void mips_print_extra_frame_info PARAMS ((struct frame_info *frame));
#define PRINT_EXTRA_FRAME_INFO(fi) \
- { \
- if (fi && fi->proc_desc && fi->proc_desc->pdr.framereg < NUM_REGS) \
- printf_filtered (" frame pointer is at %s+%d\n", \
- REGISTER_NAME (fi->proc_desc->pdr.framereg), \
- fi->proc_desc->pdr.frameoffset); \
- }
+ mips_print_extra_frame_info (fi)
/* It takes two values to specify a frame on the MIPS.
diff --git a/gdb/config/mips/tm-tx39.h b/gdb/config/mips/tm-tx39.h
index ee99a282259..36d9e2b2888 100644
--- a/gdb/config/mips/tm-tx39.h
+++ b/gdb/config/mips/tm-tx39.h
@@ -22,8 +22,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "mips/tm-bigmips.h"
-#undef REGISTER_NAMES
-#define REGISTER_NAMES \
+#undef MIPS_REGISTER_NAMES
+#define MIPS_REGISTER_NAMES \
{ "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3", \
"t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", \
"s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", \
diff --git a/gdb/config/mips/tm-tx39l.h b/gdb/config/mips/tm-tx39l.h
index 8ceec7296ea..8889553cc84 100644
--- a/gdb/config/mips/tm-tx39l.h
+++ b/gdb/config/mips/tm-tx39l.h
@@ -22,8 +22,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "mips/tm-mips.h"
-#undef REGISTER_NAMES
-#define REGISTER_NAMES \
+#undef MIPS_REGISTER_NAMES
+#define MIPS_REGISTER_NAMES \
{ "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3", \
"t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", \
"s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", \
diff --git a/gdb/config/mips/tm-vxmips.h b/gdb/config/mips/tm-vxmips.h
index 392a929c200..3f45d7eed5c 100644
--- a/gdb/config/mips/tm-vxmips.h
+++ b/gdb/config/mips/tm-vxmips.h
@@ -1,5 +1,5 @@
/* Target machine description for VxWorks MIPS's, for GDB, the GNU debugger.
- Copyright 1996 Free Software Foundation, Inc.
+ Copyright 1996, 1999 Free Software Foundation, Inc.
Contributed by Cygnus Support.
This file is part of GDB.
@@ -18,11 +18,8 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-#define GDBINIT_FILENAME ".vxgdbinit"
-
-#define DEFAULT_PROMPT "(vxgdb) "
-
#include "mips/tm-mips.h"
+#include "tm-vxworks.h"
/* FIXME: These are almost certainly wrong. */
diff --git a/gdb/config/ns32k/tm-merlin.h b/gdb/config/ns32k/tm-merlin.h
index 9a3edb9cc8a..907179fe68a 100644
--- a/gdb/config/ns32k/tm-merlin.h
+++ b/gdb/config/ns32k/tm-merlin.h
@@ -193,7 +193,7 @@ extern CORE_ADDR merlin_skip_prologue PARAMS ((CORE_ADDR));
Can return -1, meaning no way to tell. */
extern int merlin_frame_num_args PARAMS ((struct frame_info *fi));
-#define FRAME_NUM_ARGS (merlin_frame_num_args ((fi)))
+#define FRAME_NUM_ARGS(fi) (merlin_frame_num_args ((fi)))
/* Return number of bytes at start of arglist that are not really args. */
diff --git a/gdb/config/ns32k/tm-umax.h b/gdb/config/ns32k/tm-umax.h
index d4ea4edfcd0..dd59388a005 100644
--- a/gdb/config/ns32k/tm-umax.h
+++ b/gdb/config/ns32k/tm-umax.h
@@ -221,46 +221,6 @@ extern CORE_ADDR umax_skip_prologue PARAMS ((CORE_ADDR));
extern CORE_ADDR ns32k_get_enter_addr ();
-/* Return number of args passed to a frame.
- Can return -1, meaning no way to tell.
- Encore's C compiler often reuses same area on stack for args,
- so this will often not work properly. If the arg names
- are known, it's likely most of them will be printed. */
-
-#define FRAME_NUM_ARGS(numargs, fi) \
-{ CORE_ADDR pc; \
- CORE_ADDR enter_addr; \
- unsigned int insn; \
- unsigned int addr_mode; \
- int width; \
- \
- numargs = -1; \
- enter_addr = ns32k_get_enter_addr ((fi)->pc); \
- if (enter_addr > 0) \
- { \
- pc = (enter_addr == 1) ? \
- SAVED_PC_AFTER_CALL (fi) : \
- FRAME_SAVED_PC (fi); \
- insn = read_memory_integer (pc,2); \
- addr_mode = (insn >> 11) & 0x1f; \
- insn = insn & 0x7ff; \
- if ((insn & 0x7fc) == 0x57c && \
- addr_mode == 0x14) /* immediate */ \
- { \
- if (insn == 0x57c) /* adjspb */ \
- width = 1; \
- else if (insn == 0x57d) /* adjspw */ \
- width = 2; \
- else if (insn == 0x57f) /* adjspd */ \
- width = 4; \
- numargs = read_memory_integer (pc+2,width); \
- if (width > 1) \
- flip_bytes (&numargs, width); \
- numargs = - sign_extend (numargs, width*8) / 4;\
- } \
- } \
-}
-
/* Return number of bytes at start of arglist that are not really args. */
#define FRAME_ARGS_SKIP 8
@@ -272,7 +232,7 @@ extern CORE_ADDR ns32k_get_enter_addr ();
the address we return for it IS the sp for the next frame. */
extern int umax_frame_num_args PARAMS ((struct frame_info *fi));
-#define FRAME_NUM_ARGS (umax_frame_num_args ((fi)))
+#define FRAME_NUM_ARGS(fi) (umax_frame_num_args ((fi)))
/* Things needed for making the inferior call functions. */
diff --git a/gdb/config/pa/tm-hppa.h b/gdb/config/pa/tm-hppa.h
index 169a8178010..ec83395d656 100644
--- a/gdb/config/pa/tm-hppa.h
+++ b/gdb/config/pa/tm-hppa.h
@@ -1,5 +1,5 @@
/* Parameters for execution on any Hewlett-Packard PA-RISC machine.
- Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1995
+ Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1995, 1999
Free Software Foundation, Inc.
Contributed by the Center for Software Science at the
@@ -723,6 +723,7 @@ enum unwind_stub_types
PARAMETER_RELOCATION = 2,
EXPORT = 10,
IMPORT = 11,
+ IMPORT_SHLIB = 12,
};
/* We use the objfile->obj_private pointer for two things:
diff --git a/gdb/config/sparc/tm-vxsparc.h b/gdb/config/sparc/tm-vxsparc.h
index 66129432a54..06a98fce661 100644
--- a/gdb/config/sparc/tm-vxsparc.h
+++ b/gdb/config/sparc/tm-vxsparc.h
@@ -1,5 +1,5 @@
/* Target machine description for VxWorks sparc's, for GDB, the GNU debugger.
- Copyright 1993 Free Software Foundation, Inc.
+ Copyright 1993, 1999 Free Software Foundation, Inc.
Contributed by Cygnus Support.
This file is part of GDB.
@@ -18,11 +18,8 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-#define GDBINIT_FILENAME ".vxgdbinit"
-
-#define DEFAULT_PROMPT "(vxgdb) "
-
#include "sparc/tm-spc-em.h"
+#include "tm-vxworks.h"
/* FIXME: These are almost certainly wrong. */
diff --git a/gdb/configure.tgt b/gdb/configure.tgt
index 23585453c46..38ac1e97c7b 100644
--- a/gdb/configure.tgt
+++ b/gdb/configure.tgt
@@ -62,8 +62,6 @@ d30v-*-*) gdb_target=d30v ;;
h8300-*-*) gdb_target=h8300 ;;
h8500-*-*) gdb_target=h8500 ;;
-sh-*-*) gdb_target=sh ;;
-
fr30-*-elf*) gdb_target=fr30 ;;
hppa*-*-bsd*) gdb_target=hppabsd ;;
@@ -233,6 +231,8 @@ rs6000-*-lynxos*) gdb_target=rs6000lynx ;;
rs6000-*-aix4*) gdb_target=aix4 ;;
rs6000-*-*) gdb_target=rs6000 ;;
+sh-*-*) gdb_target=sh ;;
+
sparc-*-aout*) gdb_target=sparc-em ;;
sparc-*-coff*) gdb_target=sparc-em ;;
sparc-*-elf*) gdb_target=sparc-em ;;
@@ -267,6 +267,11 @@ fr30-*-*) gdb_target=fr30
;;
v850*-*-*) gdb_target=v850
+ case ${gdb_host} in
+ cygwin*)
+ CONFIG_OBS="${CONFIG_OBS} v850ice.o" ;;
+ * ) ;;
+ esac
;;
w65-*-*) gdb_target=w65 ;;
diff --git a/gdb/d10v-tdep.c b/gdb/d10v-tdep.c
index e5f4d6da712..566af7149cb 100644
--- a/gdb/d10v-tdep.c
+++ b/gdb/d10v-tdep.c
@@ -33,6 +33,26 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "symfile.h"
#include "objfiles.h"
+struct frame_extra_info
+{
+ CORE_ADDR return_pc;
+ int frameless;
+ int size;
+};
+
+/* these are the addresses the D10V-EVA board maps data */
+/* and instruction memory to. */
+
+#define DMEM_START 0x0000000
+#define IMEM_START 0x1000000
+#define STACK_START 0x0007ffe
+
+/* d10v register naming conventions */
+
+#define ARG1_REGNUM R0_REGNUM
+#define ARGN_REGNUM 3
+#define RET1_REGNUM R0_REGNUM
+
/* Local functions */
extern void _initialize_d10v_tdep PARAMS ((void));
@@ -41,6 +61,15 @@ static void d10v_eva_prepare_to_trace PARAMS ((void));
static void d10v_eva_get_trace_data PARAMS ((void));
+static int prologue_find_regs PARAMS ((unsigned short op, struct frame_info *fi, CORE_ADDR addr));
+
+extern void d10v_frame_init_saved_regs PARAMS ((struct frame_info *));
+
+static void do_d10v_pop_frame PARAMS ((struct frame_info *fi));
+
+/* FIXME */
+extern void remote_d10v_translate_xfer_address PARAMS ((CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len));
+
int
d10v_frame_chain_valid (chain, frame)
CORE_ADDR chain;
@@ -278,7 +307,7 @@ CORE_ADDR
d10v_frame_saved_pc (frame)
struct frame_info *frame;
{
- return ((frame)->return_pc);
+ return ((frame)->extra_info->return_pc);
}
CORE_ADDR
@@ -311,42 +340,47 @@ d10v_saved_pc_after_call (frame)
registers. */
void
-d10v_pop_frame (frame)
- struct frame_info *frame;
+d10v_pop_frame ()
+{
+ generic_pop_current_frame (do_d10v_pop_frame);
+}
+
+static void
+do_d10v_pop_frame (fi)
+ struct frame_info *fi;
{
CORE_ADDR fp;
int regnum;
- struct frame_saved_regs fsr;
char raw_buffer[8];
- fp = FRAME_FP (frame);
+ fp = FRAME_FP (fi);
/* fill out fsr with the address of where each */
/* register was stored in the frame */
- get_frame_saved_regs (frame, &fsr);
+ d10v_frame_init_saved_regs (fi);
/* now update the current registers with the old values */
for (regnum = A0_REGNUM; regnum < A0_REGNUM+2 ; regnum++)
{
- if (fsr.regs[regnum])
+ if (fi->saved_regs[regnum])
{
- read_memory (fsr.regs[regnum], raw_buffer, REGISTER_RAW_SIZE(regnum));
+ read_memory (fi->saved_regs[regnum], raw_buffer, REGISTER_RAW_SIZE(regnum));
write_register_bytes (REGISTER_BYTE (regnum), raw_buffer, REGISTER_RAW_SIZE(regnum));
}
}
for (regnum = 0; regnum < SP_REGNUM; regnum++)
{
- if (fsr.regs[regnum])
+ if (fi->saved_regs[regnum])
{
- write_register (regnum, read_memory_unsigned_integer (fsr.regs[regnum], REGISTER_RAW_SIZE(regnum)));
+ write_register (regnum, read_memory_unsigned_integer (fi->saved_regs[regnum], REGISTER_RAW_SIZE(regnum)));
}
}
- if (fsr.regs[PSW_REGNUM])
+ if (fi->saved_regs[PSW_REGNUM])
{
- write_register (PSW_REGNUM, read_memory_unsigned_integer (fsr.regs[PSW_REGNUM], REGISTER_RAW_SIZE(PSW_REGNUM)));
+ write_register (PSW_REGNUM, read_memory_unsigned_integer (fi->saved_regs[PSW_REGNUM], REGISTER_RAW_SIZE(PSW_REGNUM)));
}
write_register (PC_REGNUM, read_register (LR_REGNUM));
- write_register (SP_REGNUM, fp + frame->size);
+ write_register (SP_REGNUM, fp + fi->extra_info->size);
target_store_registers (-1);
flush_cached_frames ();
}
@@ -456,36 +490,38 @@ d10v_skip_prologue (pc)
*/
CORE_ADDR
-d10v_frame_chain (frame)
- struct frame_info *frame;
+d10v_frame_chain (fi)
+ struct frame_info *fi;
{
- struct frame_saved_regs fsr;
-
- d10v_frame_find_saved_regs (frame, &fsr);
+ d10v_frame_init_saved_regs (fi);
- if (frame->return_pc == IMEM_START || inside_entry_file(frame->return_pc))
+ if (fi->extra_info->return_pc == IMEM_START
+ || inside_entry_file (fi->extra_info->return_pc))
return (CORE_ADDR)0;
- if (!fsr.regs[FP_REGNUM])
+ if (!fi->saved_regs[FP_REGNUM])
{
- if (!fsr.regs[SP_REGNUM] || fsr.regs[SP_REGNUM] == STACK_START)
+ if (!fi->saved_regs[SP_REGNUM]
+ || fi->saved_regs[SP_REGNUM] == STACK_START)
return (CORE_ADDR)0;
- return fsr.regs[SP_REGNUM];
+ return fi->saved_regs[SP_REGNUM];
}
- if (!read_memory_unsigned_integer(fsr.regs[FP_REGNUM], REGISTER_RAW_SIZE(FP_REGNUM)))
+ if (!read_memory_unsigned_integer(fi->saved_regs[FP_REGNUM],
+ REGISTER_RAW_SIZE(FP_REGNUM)))
return (CORE_ADDR)0;
- return D10V_MAKE_DADDR (read_memory_unsigned_integer (fsr.regs[FP_REGNUM], REGISTER_RAW_SIZE (FP_REGNUM)));
+ return D10V_MAKE_DADDR (read_memory_unsigned_integer (fi->saved_regs[FP_REGNUM],
+ REGISTER_RAW_SIZE (FP_REGNUM)));
}
static int next_addr, uses_frame;
static int
-prologue_find_regs (op, fsr, addr)
+prologue_find_regs (op, fi, addr)
unsigned short op;
- struct frame_saved_regs *fsr;
+ struct frame_info *fi;
CORE_ADDR addr;
{
int n;
@@ -495,7 +531,7 @@ prologue_find_regs (op, fsr, addr)
{
n = (op & 0x1E0) >> 5;
next_addr -= 2;
- fsr->regs[n] = next_addr;
+ fi->saved_regs[n] = next_addr;
return 1;
}
@@ -504,8 +540,8 @@ prologue_find_regs (op, fsr, addr)
{
n = (op & 0x1E0) >> 5;
next_addr -= 4;
- fsr->regs[n] = next_addr;
- fsr->regs[n+1] = next_addr+2;
+ fi->saved_regs[n] = next_addr;
+ fi->saved_regs[n+1] = next_addr+2;
return 1;
}
@@ -534,7 +570,7 @@ prologue_find_regs (op, fsr, addr)
if ((op & 0x7E1F) == 0x681E)
{
n = (op & 0x1E0) >> 5;
- fsr->regs[n] = next_addr;
+ fi->saved_regs[n] = next_addr;
return 1;
}
@@ -542,23 +578,23 @@ prologue_find_regs (op, fsr, addr)
if ((op & 0x7E3F) == 0x3A1E)
{
n = (op & 0x1E0) >> 5;
- fsr->regs[n] = next_addr;
- fsr->regs[n+1] = next_addr+2;
+ fi->saved_regs[n] = next_addr;
+ fi->saved_regs[n+1] = next_addr+2;
return 1;
}
return 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. */
+/* Put here the code to store, into fi->saved_regs, the addresses of
+ the saved registers of frame described by FRAME_INFO. This
+ includes special registers such as pc and fp saved in special ways
+ in the stack frame. sp is even more special: the address we return
+ for it IS the sp for the next frame. */
+
void
-d10v_frame_find_saved_regs (fi, fsr)
+d10v_frame_init_saved_regs (fi)
struct frame_info *fi;
- struct frame_saved_regs *fsr;
{
CORE_ADDR fp, pc;
unsigned long op;
@@ -566,7 +602,7 @@ d10v_frame_find_saved_regs (fi, fsr)
int i;
fp = fi->frame;
- memset (fsr, 0, sizeof (*fsr));
+ memset (fi->saved_regs, 0, SIZEOF_FRAME_SAVED_REGS);
next_addr = 0;
pc = get_pc_function_start (fi->pc);
@@ -589,15 +625,15 @@ d10v_frame_find_saved_regs (fi, fsr)
/* st rn, @(offset,sp) */
short offset = op & 0xFFFF;
short n = (op >> 20) & 0xF;
- fsr->regs[n] = next_addr + offset;
+ fi->saved_regs[n] = next_addr + offset;
}
else if ((op & 0x3F1F0000) == 0x350F0000)
{
/* st2w rn, @(offset,sp) */
short offset = op & 0xFFFF;
short n = (op >> 20) & 0xF;
- fsr->regs[n] = next_addr + offset;
- fsr->regs[n+1] = next_addr + offset + 2;
+ fi->saved_regs[n] = next_addr + offset;
+ fi->saved_regs[n+1] = next_addr + offset + 2;
}
else
break;
@@ -615,45 +651,45 @@ d10v_frame_find_saved_regs (fi, fsr)
op1 = (op & 0x3FFF8000) >> 15;
op2 = op & 0x7FFF;
}
- if (!prologue_find_regs(op1,fsr,pc) || !prologue_find_regs(op2,fsr,pc))
+ if (!prologue_find_regs(op1, fi, pc) || !prologue_find_regs(op2, fi, pc))
break;
}
pc += 4;
}
- fi->size = -next_addr;
+ fi->extra_info->size = -next_addr;
if (!(fp & 0xffff))
fp = D10V_MAKE_DADDR (read_register(SP_REGNUM));
for (i=0; i<NUM_REGS-1; i++)
- if (fsr->regs[i])
+ if (fi->saved_regs[i])
{
- fsr->regs[i] = fp - (next_addr - fsr->regs[i]);
+ fi->saved_regs[i] = fp - (next_addr - fi->saved_regs[i]);
}
- if (fsr->regs[LR_REGNUM])
+ if (fi->saved_regs[LR_REGNUM])
{
- CORE_ADDR return_pc = read_memory_unsigned_integer (fsr->regs[LR_REGNUM], REGISTER_RAW_SIZE (LR_REGNUM));
- fi->return_pc = D10V_MAKE_IADDR (return_pc);
+ CORE_ADDR return_pc = read_memory_unsigned_integer (fi->saved_regs[LR_REGNUM], REGISTER_RAW_SIZE (LR_REGNUM));
+ fi->extra_info->return_pc = D10V_MAKE_IADDR (return_pc);
}
else
{
- fi->return_pc = D10V_MAKE_IADDR (read_register(LR_REGNUM));
+ fi->extra_info->return_pc = D10V_MAKE_IADDR (read_register(LR_REGNUM));
}
/* th SP is not normally (ever?) saved, but check anyway */
- if (!fsr->regs[SP_REGNUM])
+ if (!fi->saved_regs[SP_REGNUM])
{
/* if the FP was saved, that means the current FP is valid, */
/* otherwise, it isn't being used, so we use the SP instead */
if (uses_frame)
- fsr->regs[SP_REGNUM] = read_register(FP_REGNUM) + fi->size;
+ fi->saved_regs[SP_REGNUM] = read_register(FP_REGNUM) + fi->extra_info->size;
else
{
- fsr->regs[SP_REGNUM] = fp + fi->size;
- fi->frameless = 1;
- fsr->regs[FP_REGNUM] = 0;
+ fi->saved_regs[SP_REGNUM] = fp + fi->extra_info->size;
+ fi->extra_info->frameless = 1;
+ fi->saved_regs[FP_REGNUM] = 0;
}
}
}
@@ -663,9 +699,13 @@ d10v_init_extra_frame_info (fromleaf, fi)
int fromleaf;
struct frame_info *fi;
{
- fi->frameless = 0;
- fi->size = 0;
- fi->return_pc = 0;
+ fi->extra_info = (struct frame_extra_info *)
+ frame_obstack_alloc (sizeof (struct frame_extra_info));
+ frame_saved_regs_zalloc (fi);
+
+ fi->extra_info->frameless = 0;
+ fi->extra_info->size = 0;
+ fi->extra_info->return_pc = 0;
/* The call dummy doesn't save any registers on the stack, so we can
return now. */
@@ -675,8 +715,7 @@ d10v_init_extra_frame_info (fromleaf, fi)
}
else
{
- struct frame_saved_regs dummy;
- d10v_frame_find_saved_regs (fi, &dummy);
+ d10v_frame_init_saved_regs (fi);
}
}
diff --git a/gdb/defs.h b/gdb/defs.h
index 52cff3c8bbb..8251aca0eca 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -747,12 +747,6 @@ extern PTR xmrealloc PARAMS ((PTR, PTR, long));
extern int parse_escape PARAMS ((char **));
-/* compat - handle old targets that just define REGISTER_NAMES */
-#ifndef REGISTER_NAME
-extern char *gdb_register_names[];
-#define REGISTER_NAME(i) gdb_register_names[i]
-#endif
-
/* Message to be printed before the error message, when an error occurs. */
extern char *error_pre_print;
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index 52fe9171785..f527a438fda 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,15 @@
+Mon Jun 7 15:49:40 1999 Stan Shebs <shebs@andros.cygnus.com>
+
+ From Per Bothner <bothner@cygnus.com>:
+ * gdb.texinfo: Document Chill support.
+
+Fri Jun 4 16:58:22 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdbint.texinfo (SP_REGNUM, FP_REGNUM, PC_REGNUM): Add reference
+ to corresponding TARGET_READ_reg TARGET_WRITE_reg macros.
+ Document that the value should be greater-than or equal-to zero.
+ (NO_STD_REGS): Document. Deprecate.
+
Tue Jun 1 15:04:15 1999 Andrew Cagney <cagney@b1.cygnus.com>
* gdbint.texinfo (TARGET_COMPLEX_BIT, TARGET_DOUBLE_COMPLEX_BIT):
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index d7c9d83c190..fec3571be85 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -404,24 +404,25 @@ Change things in your program, so you can experiment with correcting the
effects of one bug and go on to learn about another.
@end itemize
-You can use @value{GDBN} to debug programs written in C or C++.
-@c "MOD2" used as a "miscellaneous languages" flag here.
-@c This is acceptable while there is no real doc for Chill and Pascal.
+You can use @value{GDBN} to debug programs written in C and C++.
For more information, see @ref{Support,,Supported languages}.
For more information, see @ref{C,,C and C++}.
+@cindex Chill
+@cindex Modula-2
Support for Modula-2 and Chill is partial. For information on Modula-2,
-see @ref{Modula-2,,Modula-2}. There is no further documentation on Chill yet.
+see @ref{Modula-2,,Modula-2}. For information on Chill, see @ref{Chill}.
-Debugging Pascal programs which use sets, subranges, file variables, or nested
-functions does not currently work. @value{GDBN} does not support
-entering expressions, printing values, or similar features using Pascal syntax.
+@cindex Pascal
+Debugging Pascal programs which use sets, subranges, file variables, or
+nested functions does not currently work. @value{GDBN} does not support
+entering expressions, printing values, or similar features using Pascal
+syntax.
@cindex Fortran
@value{GDBN} can be used to debug programs written in Fortran, although
-it does not yet support entering expressions, printing values, or
-similar features using Fortran syntax. It may be necessary to refer to
-some variables with a trailing underscore.
+It may be necessary to refer to some variables with a trailing
+underscore.
@ifset HPPA
This version of the manual documents HP Wildebeest (WDB) Version 0.75,
@@ -5886,7 +5887,8 @@ being set automatically by @value{GDBN}.
@node Support, , Checks, Languages
@section Supported languages
-@value{GDBN} supports C, C++, Fortran, Chill, assembly, and Modula-2.
+@value{GDBN} supports C, C++, Fortran, Java, Chill, assembly, and Modula-2.
+@c This is false ...
Some @value{GDBN} features may be used in expressions regardless of the
language you use: the @value{GDBN} @code{@@} and @code{::} operators,
and the @samp{@{type@}addr} construct (@pxref{Expressions,
@@ -5903,7 +5905,8 @@ language reference or tutorial.
@menu
* C:: C and C++
-* Modula-2:: Modula-2
+* Modula-2:: Modula-2
+* Chill:: Chill
@end menu
@node C, Modula-2, , Support
@@ -6463,7 +6466,7 @@ available choices, or to finish the type list for you.
@xref{Completion,, Command completion}, for details on how to do this.
@end table
-@node Modula-2, , C, Support
+@node Modula-2, Chill, C, Support
@subsection Modula-2
@cindex Modula-2
@@ -6905,6 +6908,452 @@ address can be specified by an integral constant, the construct
In @value{GDBN} scripts, the Modula-2 inequality operator @code{#} is
interpreted as the beginning of a comment. Use @code{<>} instead.
+@node Chill, , Modula-2, Support
+@subsection Chill
+
+The extensions made to @value{GDBN} to support Chill only support output
+from the GNU Chill compiler. Other Chill compilers are not currently
+supported, and attempting to debug executables produced by them is most
+likely to give an error as @value{GDBN} reads in the executable's symbol
+table.
+
+This section covers the following Chill related topics and the features
+of @value{GDBN} which support these topics.
+
+@menu
+* How modes are displayed:: How modes are displayed
+* Locations:: Locations and their accesses
+* Values and their Operations:: Values and their Operations
+@end menu
+
+@node How modes are displayed
+@subsubsection How modes are displayed
+
+The Chill Datatype- (Mode) support of @value{GDBN} is directly related
+with the functionality of the GNU Chill compiler, and therefore deviates
+slightly from the standard specification of the Chill language. The
+provided modes are:
+@table @code
+@item @r{@emph{Discrete modes:}}
+@itemize @bullet
+@item
+@emph{Integer Modes} which are predefined by @code{BYTE, UBYTE, INT,
+UINT, LONG, ULONG},
+@item
+@emph{Boolean Mode} which is predefined by @code{BOOL},
+@item
+@emph{Character Mode} which is predefined by @code{CHAR},
+@item
+@emph{Set Mode} which is displayed by the keyword @code{SET}.
+@smallexample
+(@value{GDBP}) ptype x
+type = SET (karli = 10, susi = 20, fritzi = 100)
+@end smallexample
+If the type is an unnumbered set the set element values are omitted.
+@item
+@emph{Range Mode} which is displayed by @code{type = <basemode>
+(<lower bound> : <upper bound>)}, where @code{<lower bound>, <upper
+bound>} can be of any discrete literal expression (e.g. set element
+names).
+@end itemize
+
+@item @r{@emph{Powerset Mode:}}
+A Powerset Mode is displayed by the keyword @code{POWERSET} followed by
+the member mode of the powerset. The member mode can be any discrete mode.
+@smallexample
+(@value{GDBP}) ptype x
+type = POWERSET SET (egon, hugo, otto)
+@end smallexample
+
+@item @r{@emph{Reference Modes:}}
+@itemize @bullet
+@item
+@emph{Bound Reference Mode} which is diplayed by the keyword @code{REF}
+followed by the mode name to which the reference is bound.
+@item
+@emph{Free Reference Mode} which is displayed by the keyword @code{PTR}.
+@end itemize
+
+@item @r{@emph{Procedure mode}}
+The procedure mode is displayed by @code{type = PROC(<parameter list>)
+<return mode> EXCEPTIONS (<exception list>)}. The @code{<parameter
+list>} is a list of the parameter modes. @code{<return mode>} indicates
+the mode of the result of the procedure if any. The exceptionlist lists
+all possible exceptions which can be raised by the procedure.
+
+@ignore
+@item @r{@emph{Instance mode}}
+The instance mode is represented by a structure, which has a static
+type, and is therefore not really of interest.
+@end ignore
+
+@item @r{@emph{Synchronization Modes:}}
+@itemize @bullet
+@item
+@emph{Event Mode} which is displayed by @code{EVENT (<event length>)},
+where @code{(<event length>)} is optional.
+@item
+@emph{Buffer Mode} which is displayed by @code{BUFFER (<buffer length>)
+<buffer element mode>}, where @code{(<buffer length>)} is optional.
+@end itemize
+
+@item @r{@emph{Timing Modes:}}
+@itemize @bullet
+@item
+@emph{Duration Mode} which is predefined by @code{DURATION}
+@item
+@emph{Absolute Time Mode} which is predefined by @code{TIME}
+@end itemize
+
+@item @r{@emph{Real Modes:}}
+Real Modes are predefined with @code{REAL} and @code{LONG_REAL}.
+
+@item @r{@emph{String Modes:}}
+@itemize @bullet
+@item
+@emph{Character String Mode} which is displayed by @code{CHARS(<string
+length>)}, followed by the keyword @code{VARYING} if the String Mode is
+a varying mode
+@item
+@emph{Bit String Mode} which is displayed by @code{BOOLS(<string
+length>)}.
+@end itemize
+
+@item @r{@emph{Array Mode:}}
+The Array Mode is displayed by the keyword @code{ARRAY(<range>)}
+followed by the element mode (which may in turn be an array mode).
+@smallexample
+(@value{GDBP}) ptype x
+type = ARRAY (1:42)
+ ARRAY (1:20)
+ SET (karli = 10, susi = 20, fritzi = 100)
+@end smallexample
+
+@item @r{@emph{Structure Mode}}
+The Structure mode is displayed by the keyword @code{STRUCT(<field
+list>)}. The @code{<field list>} consists of names and modes of fields
+of the structure. Variant structures have the keyword @code{CASE <field>
+OF <variant fields> ESAC} in their field list. Since the current version
+of the GNU Chill compiler doesn't implement tag processing (no runtime
+checks of variant fields, and therefore no debugging info), the output
+always displays all variant fields.
+@smallexample
+(@value{GDBP}) ptype str
+type = STRUCT (
+ as x,
+ bs x,
+ CASE bs OF
+ (karli):
+ cs a
+ (ott):
+ ds x
+ ESAC
+)
+@end smallexample
+@end table
+
+@node Locations
+@subsubsection Locations and their accesses
+
+A location in Chill is an object which can contain values.
+
+A value of a location is generally accessed by the (declared) name of
+the location. The output conforms to the specification of values in
+Chill programs. How values are specified, and which operations are valid
+is the topic of the next section.
+
+The pseudo-location @code{RESULT} (or @code{result}) can be used to
+display or change the result of a currently-active procedure:
+@smallexample
+set result := EXPR
+@end smallexample
+- does the same as the Chill action @code{RESULT EXPR} (which
+is not available in gdb).
+
+Values of reference mode locations are printed by @code{PTR(<hex
+value>)} in case of a free reference mode, and by @code{(REF <reference
+mode>) (<hex-value>)} in case of a bound reference. @code{<hex value>}
+represents the address where the reference points to. To access the
+value of the location referenced by the pointer, use the dereference
+operator `@code{->}'.
+
+Values of procedure mode locations are displayed by @code{@{ PROC
+(<argument modes> ) <return mode> @} <address> <name of procedure
+location>}. @code{<argument modes>} is a list of modes according to the
+parameter specification of the procedure and @code{<address>} shows the
+address of the entry point.
+
+@ignore
+Locations of instance modes are displayed just like a structure with two
+fields specifying the @emph{process type} and the @emph{copy number} of
+the investigated instance location@footnote{This comes from the current
+implementation of instances. They are implemented as a structure (no
+na). The output should be something like @code{[<name of the process>;
+<instance number>]}.}. The field names are @code{__proc_type} and
+@code{__proc_copy}.
+
+Locations of synchronization modes are displayed like a structure with
+the field name @code{__event_data} in case of a event mode location, and
+like a structure with the field @code{__buffer_data} in case of a buffer
+mode location (refer to previous paragraph).
+
+Structure Mode locations are printed by @code{[.<field name>: <value>,
+...]}. The @code{<field name>} corresponds to the structure mode
+definition and the layout of @code{<value>} varies depending of the mode
+of the field. If the investigated structure mode location is of variant
+structure mode the variant parts of the structure are enclosed in curled
+braces (`@code{@{@}}'). Fields enclosed by `@code{@{,@}}' are residing
+on the same memory location and represent the current values of the
+memory location in their specific modes. Since no tag processing is done
+all variants are displayed. A variant field is printed by
+@code{(<variant name>) = .<field name>: <value>}. (who implements the
+stuff ???)
+@smallexample
+(@value{GDBP}) print str1 $4 = [.as: 0, .bs: karli, .<TAG>: { (karli) =
+[.cs: []], (susi) = [.ds: susi]}]
+@end smallexample
+@end ignore
+
+Substructures of string mode-, array mode- or structure mode-values
+(e.g. array slices, fields of structure locations) are accessed using
+certain operations which are descibed in the next chapter.
+
+A location value may be interpreted as having a different mode using the
+location conversion. This mode conversion is written as @code{<mode
+name>(<location>)}. The user has to consider that the sizes of the modes
+have to be equal otherwise an error message occurs. Further no range
+checking of the location against the destination mode is performed and
+therefore the result can be quite confusing.
+@smallexample
+(@value{GDBP}) print int (s(3 up 4)) XXX TO be filled in !! XXX
+@end smallexample
+
+@node Values and their Operations
+@subsubsection Values and their Operations
+
+Values are used to alter locations, to investigate complex structures in
+more detail or to filter relevant information out of a large amount of
+data. There are several (mode dependent) operations defined which enable
+such investigations. These operations are not only applicable to
+constant values but also to locations, which can become quite useful
+when debugging complex structures. During parsing the command line
+(e.g. evaluating an expression) @value{GDBN} treats location names as
+the values behind these locations.
+
+This subchapters describes how values have to be specified and which
+operations are legal to be used with such values.
+
+@table @code
+@item Literal Values
+Literal values are specified in the same manner as in GNU Chill programs.
+For detailed specification refer to the GNU Chill implementation Manual
+chapter 1.5.
+
+@ignore
+@itemize @bullet
+@item
+@emph{Integer Literals} are specified in the same manner as in Chill
+programs (refer z200/88 chpt 5.2.4.2)
+@item
+@emph{Boolean Literals} are defined by @code{TRUE} and @code{FALSE}.
+@item
+@emph{Character Literals} are defined by @code{'<character>'}. (e.g.
+@code{'M'})
+@item
+@emph{Set Literals} are defined by a name which was specified in a set
+mode. The value delivered by a Set Literal is the set value. This is
+comparable to an enumaration in C/C++ language.
+@item
+@emph{Emptiness Literal} is predefined by @code{NULL}. The value of the
+emptiness literal delivers either the empty reference value, the empty
+procedure value or the empty instance value.
+
+@item
+@emph{Character String Literals} are defined by a sequence of characters
+enclosed in single- or double quotes. If a single- or double quote has
+to be part of the string literal it has to be stuffed (specified twice).
+@item
+@emph{Bitstring Literals} are specified in the same manner as in Chill
+programs (refer z200/88 chpt 5.2.4.8).
+@item
+@emph{Floating point literals} are specified in the same manner as in
+(gnu-)Chill programs (refer GNU Chill implementation Manual chapter 1.5).
+@end itemize
+@end ignore
+
+@item Tuple Values
+A tuple is specified by @code{<mode name>[<tuple>]}, where @code{<mode
+name>} can be omitted if the mode of the tuple is unambigous. This
+unambiguity is derived from the context of a evaluated expression.
+@code{<tuple>} can be one of the following:
+@itemize @bullet
+@item @emph{Powerset Tuple}
+@item @emph{Array Tuple}
+@item @emph{Structure Tuple}
+Powerset tuples, array tuples and structure tuples are specified in the
+same manner as in Chill programs refer z200/88 chpt 5.2.5.
+@end itemize
+
+@item String Element Value
+A string element value is specified by @code{<string value>(<index>)},
+where @code{<index>} is a integer expression. It delivers a character
+value which is equivalent to the character indexed by @code{<index>} in
+the string.
+
+@item String Slice Value
+A string slice value is specified by @code{<string value>(<slice
+spec>)}, where @code{<slice spec>} can be either a range of integer
+expressions or specified by @code{<start expr> up <size>}.
+@code{<size>} denotes the number of elements which the slice contains.
+The delivered value is a string value, which is part of the specified
+string.
+
+@item Array Element Values
+An array element value is specified by @code{<array value>(<expr>)} and
+delivers a array element value of the mode of the specified array.
+
+@item Array Slice Values
+An array slice is specified by @code{<array value>(<slice spec>)}, where
+@code{<slice spec>} can be either a range specified by expressions or by
+@code{<start expr> up <size>}. @code{<size>} denotes the number of
+arrayelements the slice contains. The delivered value is an array value
+which is part of the specified array.
+
+@item Structure Field Values
+A structure field value is derived by @code{<structure value>.<field
+name>}, where @code{<field name>} indcates the name of a field specified
+in the mode definition of the structure. The mode of the delivered value
+corresponds to this mode definition in the structure definition.
+
+@item Procedure Call Value
+The procedure call value is derived from the return value of the
+procedure@footnote{If a procedure call is used for instance in an
+expression, then this procedure is called with all its side
+effects. This can lead to confusing results if used carelessly.}.
+
+Values of duration mode locations are represented by ULONG literals.
+
+Values of time mode locations are represented by TIME(<secs>:<nsecs>).
+
+@ignore
+This is not implemented yet:
+@item Built-in Value
+@noindent
+The following built in functions are provided:
+@table @code
+@item @code{ADDR()}
+@item @code{NUM()}
+@item @code{PRED()}
+@item @code{SUCC()}
+@item @code{ABS()}
+@item @code{CARD()}
+@item @code{MAX()}
+@item @code{MIN()}
+@item @code{SIZE()}
+@item @code{UPPER()}
+@item @code{LOWER()}
+@item @code{LENGTH()}
+@item @code{SIN()}
+@item @code{COS()}
+@item @code{TAN()}
+@item @code{ARCSIN()}
+@item @code{ARCCOS()}
+@item @code{ARCTAN()}
+@item @code{EXP()}
+@item @code{LN()}
+@item @code{LOG()}
+@item @code{SQRT()}
+@end table
+
+For a detailed description refer to the GNU Chill implementation manual
+chapter 1.6.
+@end ignore
+
+@item Zero-adic Operator Value
+The zero-adic operator value is derived from the instance value for the
+current active process.
+
+@item Expression Values
+The value delivered by an expression is the result of the evaluation of
+the specified expression. If there are error conditions (mode
+incompatibility, etc.) the evaluation of expressions is aborted with a
+corresponding error message. Expressions may be paranthesised which
+causes the evaluation of this expression before any other expression
+which uses the result of the paranthesised expression. The following
+operators are supported by @value{GDBN}:
+@table @code
+@item @code{OR, ORIF, XOR}
+@item @code{AND, ANDIF}
+@item @code{NOT}
+Logical operators defined over operands of boolean mode.
+@item @code{=, /=}
+Equality and inequality operators defined over all modes.
+@item @code{>, >=}
+@item @code{<, <=}
+Relational operators defined over predefined modes.
+@item @code{+, -}
+@item @code{*, /, MOD, REM}
+Arithmetic operators defined over predefined modes.
+@item @code{-}
+Change sign operator.
+@item @code{//}
+String concatenation operator.
+@item @code{()}
+String repetition operator.
+@item @code{->}
+Referenced location operator which can be used either to take the
+address of a location (@code{->loc}), or to dereference a reference
+location (@code{loc->}).
+@item @code{OR, XOR}
+@item @code{AND}
+@item @code{NOT}
+Powerset and bitstring operators.
+@item @code{>, >=}
+@item @code{<, <=}
+Powerset inclusion operators.
+@item @code{IN}
+Membership operator.
+@end table
+@end table
+
+@subsubsection Chill type and range checks
+
+@value{GDBN} considers two Chill variables mode equivalent if the sizes
+of the two modes are equal. This rule applies recursively to more
+complex datatypes which means that complex modes are treated
+eqivalent if all element modes (which also can be complex modes like
+structures, arrays, etc.) have the same size.
+
+Range checking is done on all mathematical operations, assignment, array
+index bounds and all built in procedures.
+
+Strong type checks are forced using the @value{GDBN} command @code{set
+check strong}. This enforces strong type and range checks on all
+operations where Chill constructs are used (expressions, built in
+functions, etc.) in respect to the semantics as defined in the z.200
+language specification.
+
+@noindent
+All checks can be disabled by the @value{GDBN} command @code{set check
+off}.
+
+@ignore
+@subsubsection Deviations from the Chill Standard Z200/88
+see last paragraph ?
+@end ignore
+
+@subsubsection Chill defaults
+
+If type and range checking are set automatically by @value{GDBN}, they
+both default to @code{on} whenever the working language changes to
+Chill. This happens regardless of whether you, or @value{GDBN},
+selected the working language.
+
+If you allow @value{GDBN} to set the language automatically, then entering
+code compiled from a file whose name ends with @file{.ch} sets the
+working language to Chill. @xref{Automatically, ,Having @value{GDBN} set
+the language automatically}, for further details.
+
@node Symbols, Altering, Languages, Top
@chapter Examining the Symbol Table
diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo
index 15649bee3fb..6eb8177ca83 100644
--- a/gdb/doc/gdbint.texinfo
+++ b/gdb/doc/gdbint.texinfo
@@ -46,7 +46,7 @@ regarded as a program in the language TeX).
@page
@tex
\def\$#1${{#1}} % Kluge: collect RCS revision info without $...$
-\xdef\manvers{\$Revision: 1.1.1.5 $} % For use in headers, footers too
+\xdef\manvers{\$Revision: 1.1.1.6 $} % For use in headers, footers too
{\parskip=0pt
\hfill Cygnus Solutions\par
\hfill \manvers\par
@@ -912,6 +912,9 @@ Your host config file defines this if it includes declarations of
@code{memcpy} and @code{memset}. Define this to avoid conflicts between
the native include files and the declarations in @file{defs.h}.
+@item NO_STD_REGS
+This macro is deprecated.
+
@item NO_SYS_FILE
Define this if your system does not have a @code{<sys/file.h>}.
@@ -1331,7 +1334,11 @@ If defined, then the `info float' command will print information about
the processor's floating point unit.
@item FP_REGNUM
-The number of the frame pointer register.
+If the virtual frame pointer is kept in a register, then define this
+macro to be the number (greater than or equal to zero) of that register.
+
+This should only need to be defined if @code{TARGET_READ_FP} and
+@code{TARGET_WRITE_FP} are not defined.
@item FRAMELESS_FUNCTION_INVOCATION(fi)
Define this to an expression that returns 1 if the function invocation
@@ -1500,8 +1507,10 @@ counter. (Defined only for the RS/6000.)
@item PC_REGNUM
If the program counter is kept in a register, then define this macro to
-be the number of that register. This need be defined only if
-@code{TARGET_WRITE_PC} is not defined.
+be the number (greater than or equal to zero) of that register.
+
+This should only need to be defined if @code{TARGET_READ_PC} and
+@code{TARGET_WRITE_PC} are not defined.
@item NPC_REGNUM
The number of the ``next program counter'' register, if defined.
@@ -1576,8 +1585,11 @@ the functions being called, then define this macro to return a new PC
that is at the start of the real function.
@item SP_REGNUM
-Define this to be the number of the register that serves as the stack
-pointer.
+If the stack-pointer is kept in a register, then define this macro to be
+the number (greater than or equal to zero) of that register.
+
+This should only need to be defined if @code{TARGET_WRITE_SP} and
+@code{TARGET_WRITE_SP} are not defined.
@item STAB_REG_TO_REGNUM
Define this to convert stab register numbers (as gotten from `r'
diff --git a/gdb/eval.c b/gdb/eval.c
index d3c34657396..a6b655fedeb 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -396,19 +396,6 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
struct type ** arg_types;
int save_pos1;
- /* This expect_type crap should not be used for C. C expressions do
- not have any notion of expected types, never has and (goddess
- willing) never will. The C++ code uses it for some twisted
- purpose (I haven't investigated but I suspect it just the usual
- combination of Stroustrup figuring out some crazy language
- feature and Tiemann figuring out some crazier way to try to
- implement it). CHILL has the tuple stuff; I don't know enough
- about CHILL to know whether expected types is the way to do it.
- FORTRAN I don't know. */
- if (exp->language_defn->la_language != language_cplus
- && exp->language_defn->la_language != language_chill)
- expect_type = NULL_TYPE;
-
pc = (*pos)++;
op = exp->elts[pc].opcode;
@@ -421,7 +408,7 @@ evaluate_subexp_standard (expect_type, exp, pos, noside)
0,
exp->elts[pc + 1].type,
&exp->elts[pc + 3].string,
- expect_type);
+ NULL_TYPE);
if (arg1 == NULL)
error ("There is no field named %s", &exp->elts[pc + 3].string);
return arg1;
@@ -1635,7 +1622,7 @@ bad_pointer_to_member:
(*pos) += 3 + BYTES_TO_EXP_ELEM (temm + 1);
}
else
- evaluate_subexp (expect_type, exp, pos, EVAL_SKIP);
+ evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP);
goto nosideret;
}
else
diff --git a/gdb/fork-child.c b/gdb/fork-child.c
index f3504bc6409..7fa4a0bed78 100644
--- a/gdb/fork-child.c
+++ b/gdb/fork-child.c
@@ -1,5 +1,5 @@
/* Fork a Unix child process, and set up to debug it, for GDB.
- Copyright 1990, 1991, 1992, 1993, 1994, 1996 Free Software Foundation, Inc.
+ Copyright 1990, 91, 92, 93, 94, 1996, 1999 Free Software Foundation, Inc.
Contributed by Cygnus Support.
This file is part of GDB.
@@ -33,8 +33,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include <unistd.h>
#endif
-#define DEBUGGING 0
-
/* This just gets used as a default if we can't find SHELL */
#ifndef SHELL_FILE
#define SHELL_FILE "/bin/sh"
@@ -57,9 +55,6 @@ breakup_args (
{
char *cp = scratch;
-#if DEBUGGING
- printf ("breakup_args: input = %s\n", scratch);
-#endif
for (;;)
{
@@ -126,7 +121,6 @@ fork_inferior (exec_file, allargs, env, traceme_fun, init_trace_fun,
char **save_our_env;
int shell = 0;
char **argv;
- char *tryname;
/* If no exec file handed to us, get it from the exec-file command -- with
a good, common error message if none is specified. */
@@ -147,10 +141,6 @@ fork_inferior (exec_file, allargs, env, traceme_fun, init_trace_fun,
shell = 1;
}
-#if DEBUGGING
- printf ("shell is %s\n", shell_file);
-#endif
-
/* Multiplying the length of exec_file by 4 is to account for the fact
that it may expand when quoted; it is a worst-case number based on
every character being '. */
@@ -169,14 +159,6 @@ fork_inferior (exec_file, allargs, env, traceme_fun, init_trace_fun,
{
/* We're going to call execvp. Create argv */
/* Largest case: every other character is a separate arg */
-#if DEBUGGING
- printf ("allocating argv, length = %d\n",
- (
- (strlen (allargs) + 1) / (unsigned) 2
- + 2
- ) * sizeof (*argv)
- );
-#endif
argv = (char **) xmalloc (((strlen (allargs) + 1) / (unsigned) 2 + 2) * sizeof (*argv));
argv[0] = exec_file;
breakup_args (allargs, &argv[1]);
@@ -334,16 +316,7 @@ fork_inferior (exec_file, allargs, env, traceme_fun, init_trace_fun,
*/
if (shell)
{
-#if 0
-
- /* HP change is problematic. The -f option has different meanings
- for different shells. It is particularly inappropriate for
- bourne shells. */
- execlp (shell_file, shell_file, "-f", "-c", shell_command, (char *) 0);
-#else
execlp (shell_file, shell_file, "-c", shell_command, (char *) 0);
-#endif
-
/* If we get here, it's an error */
fprintf_unfiltered (gdb_stderr, "Cannot exec %s: %s.\n", shell_file,
@@ -356,16 +329,7 @@ fork_inferior (exec_file, allargs, env, traceme_fun, init_trace_fun,
/* Otherwise, we directly exec the target program with execvp. */
int i;
char *errstring;
-#if DEBUGGING
- printf ("about to exec target, exec_file = %s\n", exec_file);
- i = 0;
- while (argv[i] != NULL)
- {
- printf ("strlen(argv[%d]) is %d\n", i, strlen (argv[i]));
- printf ("argv[%d] is %s\n", i, argv[i]);
- i++;
- }
-#endif
+
execvp (exec_file, argv);
/* If we get here, it's an error */
diff --git a/gdb/frame.h b/gdb/frame.h
index 0bb9b6f30d0..f15d65d3f59 100644
--- a/gdb/frame.h
+++ b/gdb/frame.h
@@ -241,6 +241,10 @@ extern int generic_pc_in_call_dummy PARAMS ((CORE_ADDR pc,
extern char * generic_find_dummy_frame PARAMS ((CORE_ADDR pc,
CORE_ADDR fp));
+extern void generic_fix_call_dummy PARAMS ((char *dummy, CORE_ADDR pc, CORE_ADDR fun,
+ int nargs, struct value **args,
+ struct type *type, int gcc_p));
+
#ifdef __GNUC__
/* Some native compilers, even ones that are supposed to be ANSI and for which __STDC__
is true, complain about forward decls of enums. */
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index fa92a660a04..e6f647eae2f 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -339,6 +339,15 @@ set_architecture_from_file (abfd)
}
+/* Misc helper functions for targets. */
+
+int
+frame_num_args_unknown (fi)
+ struct frame_info *fi;
+{
+ return -1;
+}
+
/* Disassembler */
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index f922efa6541..2bcc7f61175 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -20,6 +20,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef GDBARCH_H
#define GDBARCH_H
+#ifdef __STDC__
+struct frame_info;
+struct value;
+enum lval_type;
+#endif
+
/* The target-system-dependant byte order is dynamic */
/* TARGET_BYTE_ORDER_SELECTABLE_P determines if the target endianness
@@ -140,6 +146,14 @@ extern disassemble_info tm_print_insn_info;
#endif
+/* Fallback definition for REGISTER_NAME for systems still defining
+ REGISTER_NAMES. */
+#ifndef REGISTER_NAME
+extern char *gdb_register_names[];
+#define REGISTER_NAME(i) gdb_register_names[i]
+#endif
+
+
/* Set the dynamic target-system-dependant parameters (architecture,
byte-order, ...) using information found in the BFD */
@@ -152,6 +166,12 @@ extern void set_gdbarch_from_file PARAMS ((bfd *));
extern void set_architecture_from_arch_mach PARAMS ((enum bfd_architecture, unsigned long));
+/* Helper function for targets that don't know how my arguments are
+ being passed */
+
+extern int frame_num_args_unknown PARAMS ((struct frame_info *fi));
+
+
/* gdbarch trace variable */
extern int gdbarch_debug;
diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h
index 653dd65c16a..c3829e3d129 100644
--- a/gdb/gdbthread.h
+++ b/gdb/gdbthread.h
@@ -55,67 +55,4 @@ extern void save_infrun_state PARAMS ((int, CORE_ADDR, CORE_ADDR, char *,
/* Commands with a prefix of `thread'. */
extern struct cmd_list_element *thread_cmd_list;
-/* Support for external (remote) systems with threads (processes) */
-/* For example real time operating systems */
-
-#define OPAQUETHREADBYTES 8
-/* a 64 bit opaque identifier */
-typedef unsigned char threadref[OPAQUETHREADBYTES] ;
-/* WARNING: This threadref data structure comes from the remote O.S., libstub
- protocol encoding, and remote.c. it is not particularly changable */
-
-/* Right now, the internal structure is int. We want it to be bigger.
- Plan to fix this.
- */
-typedef int gdb_threadref ; /* internal GDB thread reference */
-
-/* gdb_ext_thread_info is an internal GDB data structure which is
- equivalint to the reply of the remote threadinfo packet */
-
-struct gdb_ext_thread_info
-{
- threadref threadid ; /* External form of thread reference */
- int active ; /* Has state interesting to GDB? , regs, stack */
- char display[256] ; /* Brief state display, name, blocked/syspended */
- char shortname[32] ; /* To be used to name threads */
- char more_display[256] ; /* Long info, statistics, queue depth, whatever */
-} ;
-
-/* The volume of remote transfers can be limited by submitting
- a mask containing bits specifying the desired information.
- Use a union of these values as the 'selection' parameter to
- get_thread_info. FIXME: Make these TAG names more thread specific.
- */
-#define TAG_THREADID 1
-#define TAG_EXISTS 2
-#define TAG_DISPLAY 4
-#define TAG_THREADNAME 8
-#define TAG_MOREDISPLAY 16
-
-/* Always initialize an instance of this structure using run time assignments */
-/* Because we are likely to add entrtries to it. */
-/* Alternatly, WE COULD ADD THESE TO THE TARGET VECTOR */
-
-struct target_thread_vector
-{
- int (*find_new_threads)PARAMS((void)) ;
- int (*get_thread_info) PARAMS((
- gdb_threadref * ref,
- int selection,
- struct gdb_ext_thread_info * info
- )) ;
- /* to_thread_alive - Already in the target vector */
- /* to_switch_thread - Done via select frame */
-} ;
-
-extern void bind_target_thread_vector PARAMS((struct target_thread_vector * vec)) ;
-
-extern struct target_thread_vector * unbind_target_thread_vector PARAMS ((void)) ;
-
-extern int target_get_thread_info PARAMS((
- gdb_threadref * ref,
- int selection,
- struct gdb_ext_thread_info * info)) ;
-
-
#endif /* GDBTHREAD_H */
diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c
index 85dc669cba3..2c5843ba02f 100644
--- a/gdb/gnu-nat.c
+++ b/gdb/gnu-nat.c
@@ -1,5 +1,5 @@
/* Interface GDB to the GNU Hurd
- Copyright (C) 1992, 1995, 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1992, 1995, 1996, 1997, 1999 Free Software Foundation, Inc.
This file is part of GDB.
@@ -108,6 +108,7 @@ void inf_set_step_thread (struct inf *inf, struct proc *proc);
void inf_detach (struct inf *inf);
void inf_attach (struct inf *inf, int pid);
void inf_signal (struct inf *inf, enum target_signal sig);
+void inf_continue (struct inf *inf);
#define inf_debug(_inf, msg, args...) \
do { struct inf *__inf = (_inf); \
@@ -194,19 +195,22 @@ struct inf
/* True if we think at least one thread in the inferior could currently be
running. */
- int running : 1;
+ unsigned int running : 1;
/* True if the process has stopped (in the proc server sense). Note that
since a proc server `stop' leaves the signal thread running, the inf can
be RUNNING && STOPPED... */
- int stopped : 1;
+ unsigned int stopped : 1;
+
+ /* True if the inferior has no message port. */
+ unsigned int nomsg : 1;
/* True if the inferior is traced. */
- int traced : 1;
+ unsigned int traced : 1;
/* True if we shouldn't try waiting for the inferior, usually because we
can't for some reason. */
- int no_wait : 1;
+ unsigned int no_wait : 1;
/* When starting a new inferior, we don't try to validate threads until all
the proper execs have been done. This is a count of how many execs we
@@ -635,8 +639,9 @@ struct inf *make_inf ()
inf->step_thread = 0;
inf->signal_thread = 0;
inf->event_port = MACH_PORT_NULL;
- inf->stopped = 0;
inf->running = 0;
+ inf->stopped = 0;
+ inf->nomsg = 1;
inf->traced = 0;
inf->no_wait = 0;
inf->pending_execs = 0;
@@ -680,10 +685,11 @@ inf_cleanup (struct inf *inf)
inf_set_pid (inf, -1);
inf->pid = 0;
+ inf->running = 0;
+ inf->stopped = 0;
+ inf->nomsg = 1;
inf->traced = 0;
inf->no_wait = 0;
- inf->stopped = 0;
- inf->running = 0;
inf->pending_execs = 0;
if (inf->event_port)
@@ -760,9 +766,12 @@ inf_set_pid (struct inf *inf, pid_t pid)
inf->pid = -1;
}
-/* Validates INF's stopped field from the actual proc server state. */
+/* Validates INF's stopped, nomsg and traced field from the actual
+ proc server state. Note that the traced field is only updated from
+ the proc server state if we do not have a message port. If we do
+ have a message port we'd better look at the tracemask itself. */
static void
-inf_validate_stopped (struct inf *inf)
+inf_validate_procinfo (struct inf *inf)
{
char *noise;
mach_msg_type_number_t noise_len = 0;
@@ -776,6 +785,9 @@ inf_validate_stopped (struct inf *inf)
if (! err)
{
inf->stopped = !!(pi->state & PI_STOPPED);
+ inf->nomsg = !!(pi->state & PI_NOMSG);
+ if (inf->nomsg)
+ inf->traced = !!(pi->state & PI_TRACED);
vm_deallocate (mach_task_self (), (vm_address_t)pi, pi_len);
if (noise_len > 0)
vm_deallocate (mach_task_self (), (vm_address_t)noise, noise_len);
@@ -1147,9 +1159,16 @@ inf_detach (struct inf *inf)
{
struct proc *thread;
+ inf_validate_procinfo (inf);
+
inf_set_traced (inf, 0);
if (inf->stopped)
- inf_signal (inf, TARGET_SIGNAL_0);
+ {
+ if (inf->nomsg)
+ inf_continue (inf);
+ else
+ inf_signal (inf, TARGET_SIGNAL_0);
+ }
proc_restore_exc_port (task);
task->sc = inf->detach_sc;
@@ -1291,6 +1310,34 @@ inf_signal (struct inf *inf, enum target_signal sig)
#undef NAME
}
+/* Continue INF without delivering a signal. This is meant to be used
+ when INF does not have a message port. */
+void
+inf_continue (struct inf *inf)
+{
+ process_t proc;
+ error_t err = proc_pid2proc (proc_server, inf->pid, &proc);
+
+ if (! err)
+ {
+ inf_debug (inf, "continuing process");
+
+ err = proc_mark_cont (proc);
+ if (! err)
+ {
+ struct proc *thread;
+
+ for (thread = inf->threads; thread; thread = thread->next)
+ thread_resume (thread->port);
+
+ inf->stopped = 0;
+ }
+ }
+
+ if (err)
+ warning ("Can't continue process: %s", strerror (err));
+}
+
/* The inferior used for all gdb target ops. */
struct inf *current_inferior = 0;
@@ -1800,8 +1847,15 @@ gnu_resume (int tid, int step, enum target_signal sig)
inf_debug (inf, "tid = %d, step = %d, sig = %d", tid, step, sig);
+ inf_validate_procinfo (inf);
+
if (sig != TARGET_SIGNAL_0 || inf->stopped)
- inf_signal (inf, sig);
+ {
+ if (sig == TARGET_SIGNAL_0 && inf->nomsg)
+ inf_continue (inf);
+ else
+ inf_signal (inf, sig);
+ }
else if (inf->wait.exc.reply != MACH_PORT_NULL)
/* We received an exception to which we have chosen not to forward, so
abort the faulting thread, which will perhaps retake it. */
@@ -1923,6 +1977,7 @@ gnu_create_inferior (exec_file, allargs, env)
push_target (&gnu_ops);
inf->pending_execs = 2;
+ inf->nomsg = 1;
inf->traced = 1;
/* Now let the child run again, knowing that it will stop immediately
@@ -1938,6 +1993,7 @@ gnu_create_inferior (exec_file, allargs, env)
fork_inferior (exec_file, allargs, env, trace_me, attach_to_child,
NULL, NULL);
+ inf_validate_procinfo (inf);
inf_update_signal_thread (inf);
inf_set_traced (inf, inf->want_signals);
@@ -2007,13 +2063,13 @@ gnu_attach (args, from_tty)
/* We have to initialize the terminal settings now, since the code
below might try to restore them. */
target_terminal_init ();
-
- inf_update_signal_thread (inf);
- inf_set_traced (inf, inf->want_signals);
-
+
/* If the process was stopped before we attached, make it continue the next
time the user does a continue. */
- inf_validate_stopped (inf);
+ inf_validate_procinfo (inf);
+
+ inf_update_signal_thread (inf);
+ inf_set_traced (inf, inf->want_signals);
#if 0 /* Do we need this? */
renumber_threads (0); /* Give our threads reasonable names. */
diff --git a/gdb/go32-nat.c b/gdb/go32-nat.c
index 2572a119069..d872219fb55 100644
--- a/gdb/go32-nat.c
+++ b/gdb/go32-nat.c
@@ -166,6 +166,12 @@ static int go32_insert_nonaligned_watchpoint (int pid, CORE_ADDR waddr,
CORE_ADDR addr, int len, int rw);
static struct target_ops go32_ops;
+static void
+go32_terminal_init (void);
+static void
+go32_terminal_inferior (void);
+static void
+go32_terminal_ours (void);
static void
print_387_status (unsigned short status, struct env387 *ep)
@@ -812,6 +818,41 @@ go32_insert_hw_breakpoint (CORE_ADDR addr, CORE_ADDR shadow)
return 0;
}
+static int inf_flags_valid = 0;
+static int inf_in_flag;
+static int inf_out_flag;
+
+static void
+go32_terminal_init (void)
+{
+ /* Save the filemodes for stdin/stout */
+ inf_in_flag = setmode(0, 0);
+ setmode(0, inf_in_flag);
+ inf_out_flag = setmode(1, 0);
+ setmode(1, inf_out_flag);
+ inf_flags_valid = 1;
+}
+
+static void
+go32_terminal_inferior (void)
+{
+ /* set the filemodes for stdin/stdout of the inferior */
+ if (inf_flags_valid)
+ {
+ setmode(0, inf_in_flag);
+ setmode(1, inf_out_flag);
+ }
+}
+
+static void
+go32_terminal_ours (void)
+{
+ /* Switch to text mode on stdin/stdout always on the gdb terminal and
+ save the inferior modes to be restored later */
+ inf_in_flag = setmode(0, O_TEXT);
+ inf_out_flag = setmode(1, O_TEXT);
+}
+
static void
init_go32_ops (void)
{
@@ -831,10 +872,10 @@ init_go32_ops (void)
go32_ops.to_files_info = go32_files_info;
go32_ops.to_insert_breakpoint = memory_insert_breakpoint;
go32_ops.to_remove_breakpoint = memory_remove_breakpoint;
- go32_ops.to_terminal_init = ignore;
- go32_ops.to_terminal_inferior = ignore;
+ go32_ops.to_terminal_init = go32_terminal_init;
+ go32_ops.to_terminal_inferior = go32_terminal_inferior;
go32_ops.to_terminal_ours_for_output = ignore;
- go32_ops.to_terminal_ours = ignore;
+ go32_ops.to_terminal_ours = go32_terminal_ours;
go32_ops.to_terminal_info = ignore2;
go32_ops.to_kill = go32_kill_inferior;
go32_ops.to_create_inferior = go32_create_inferior;
diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c
index ce5f1f82191..288f0853f4c 100644
--- a/gdb/hppa-tdep.c
+++ b/gdb/hppa-tdep.c
@@ -1923,7 +1923,22 @@ cover_find_stub_with_shl_get (args)
On the hppa we need to call the stack dummy through $$dyncall.
Therefore our version of FIX_CALL_DUMMY takes an extra argument,
real_pc, which is the location where gdb should start up the
- inferior to do the function call. */
+ inferior to do the function call.
+
+ This has to work across several versions of hpux, bsd, osf1. It has to
+ work regardless of what compiler was used to build the inferior program.
+ It should work regardless of whether or not end.o is available. It has
+ to work even if gdb can not call into the dynamic loader in the inferior
+ to query it for symbol names and addresses.
+
+ Yes, all those cases should work. Luckily code exists to handle most
+ of them. The complexity is in selecting exactly what scheme should
+ be used to perform the inferior call.
+
+ At the current time this routine is known not to handle cases where
+ the program was linked with HP's compiler without including end.o.
+
+ Please contact Jeff Law (law@cygnus.com) before changing this code. */
CORE_ADDR
hppa_fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p)
@@ -1939,20 +1954,35 @@ hppa_fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p)
struct minimal_symbol *msymbol;
struct minimal_symbol *trampoline;
int flags = read_register (FLAGS_REGNUM);
- struct unwind_table_entry *u;
- CORE_ADDR new_stub=0;
- CORE_ADDR solib_handle=0;
+ struct unwind_table_entry *u = NULL;
+ CORE_ADDR new_stub = 0;
+ CORE_ADDR solib_handle = 0;
+
+ /* Nonzero if we will use GCC's PLT call routine. This routine must be
+ passed an import stub, not a PLABEL. It is also necessary to set %r19
+ (the PIC register) before performing the call.
+ If zero, then we are using __d_plt_call (HP's PLT call routine) or we
+ are calling the target directly. When using __d_plt_call we want to
+ use a PLABEL instead of an import stub. */
+ int using_gcc_plt_call = 1;
+
+ /* Prefer __gcc_plt_call over the HP supplied routine because
+ __gcc_plt_call works for any number of arguments. */
trampoline = NULL;
+ if (lookup_minimal_symbol ("__gcc_plt_call", NULL, NULL) == NULL)
+ using_gcc_plt_call = 0;
+
msymbol = lookup_minimal_symbol ("$$dyncall", NULL, NULL);
if (msymbol == NULL)
- error ("Can't find an address for $$dyncall trampoline"); /* purecov: deadcode */
+ error ("Can't find an address for $$dyncall trampoline");
dyncall_addr = SYMBOL_VALUE_ADDRESS (msymbol);
/* FUN could be a procedure label, in which case we have to get
- its real address and the value of its GOT/DP. */
- if (fun & 0x2)
+ its real address and the value of its GOT/DP if we plan to
+ call the routine via gcc_plt_call. */
+ if ((fun & 0x2) && using_gcc_plt_call)
{
/* Get the GOT/DP value for the target function. It's
at *(fun+4). Note the call dummy is *NOT* allowed to
@@ -1967,20 +1997,14 @@ hppa_fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p)
{
#ifndef GDB_TARGET_IS_PA_ELF
- /* FUN could be either an export stub, or the real address of a
- function in a shared library. We must call an import stub
- rather than the export stub or real function for lazy binding
- to work correctly. */
-
- /* elz: let's see if fun is in a shared library */
- solib_handle = som_solib_get_solib_by_pc(fun);
-
- /* elz: for 10.30 and 11.00 the calls via __d_plt_call cannot be made
- via import stubs, only via plables, so this code here becomes useless.
- On 10.20, the plables mechanism works too, so we just ignore this import
- stub stuff */
-#if 0
- if (solib_handle)
+ /* FUN could be an export stub, the real address of a function, or
+ a PLABEL. When using gcc's PLT call routine we must call an import
+ stub rather than the export stub or real function for lazy binding
+ to work correctly
+
+ /* If we are using the gcc PLT call routine, then we need to
+ get the import stub for the target function. */
+ if (using_gcc_plt_call && som_solib_get_got_by_pc (fun))
{
struct objfile *objfile;
struct minimal_symbol *funsymbol, *stub_symbol;
@@ -1994,8 +2018,14 @@ hppa_fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p)
right name. */
ALL_OBJFILES (objfile)
{
- stub_symbol = lookup_minimal_symbol (SYMBOL_NAME (funsymbol),
- NULL, objfile);
+ stub_symbol
+ = lookup_minimal_symbol_solib_trampoline
+ (SYMBOL_NAME (funsymbol), NULL, objfile);
+
+ if (! stub_symbol)
+ stub_symbol = lookup_minimal_symbol (SYMBOL_NAME (funsymbol),
+ NULL, objfile);
+
/* Found a symbol with the right name. */
if (stub_symbol)
{
@@ -2006,7 +2036,9 @@ hppa_fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p)
/* It must also be an import stub. */
u = find_unwind_entry (SYMBOL_VALUE (stub_symbol));
- if (!u || u->stub_unwind.stub_type != IMPORT)
+ if (!u
+ || (u->stub_unwind.stub_type != IMPORT)
+ && u->stub_unwind.stub_type != IMPORT_SHLIB)
continue;
/* OK. Looks like the correct import stub. */
@@ -2014,92 +2046,79 @@ hppa_fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p)
fun = newfun;
}
}
+
+ /* Ouch. We did not find an import stub. Make an attempt to
+ do the right thing instead of just croaking. Most of the
+ time this will actually work. */
if (newfun == 0)
write_register (19, som_solib_get_got_by_pc (fun));
+
+ u = find_unwind_entry (fun);
+ if (u
+ && (u->stub_unwind.stub_type == IMPORT
+ || u->stub_unwind.stub_type == IMPORT_SHLIB))
+ trampoline = lookup_minimal_symbol ("__gcc_plt_call", NULL, NULL);
+
+ /* If we found the import stub in the shared library, then we have
+ to set %r19 before we call the stub. */
+ if (u && u->stub_unwind.stub_type == IMPORT_SHLIB)
+ write_register (19, som_solib_get_got_by_pc (fun));
}
-#endif /* end of if 0 */
#endif
}
- /* If we are calling an import stub (eg calling into a dynamic library)
- then have sr4export call the magic __d_plt_call routine which is linked
- in from end.o. (You can't use _sr4export to call the import stub as
- the value in sp-24 will get fried and you end up returning to the
- wrong location. You can't call the import stub directly as the code
- to bind the PLT entry to a function can't return to a stack address.) */
-
- /* elz:
- There does not have to be an import stub to call a routine in a
- different load module (note: a "load module" is an a.out or a shared
- library). If you call a routine indirectly, going through $$dyncall (or
- $$dyncall_external), you won't go through an import stub. Import stubs
- are only used for direct calls to an imported routine.
-
- What you (wdb) need is to go through $$dyncall with a proper plabel for
- the imported routine. shl_findsym() returns you the address of a plabel
- suitable for use in making an indirect call through, e.g., through
- $$dyncall.
- This is taken care below with the call to find_stub_.... */
-#if 0
- /* elz: this check here is not necessary if we are going to call stuff through
- plabels only, we just now check whether the function we call is in a shlib */
- u = find_unwind_entry (fun);
+ /* If we are calling into another load module then have sr4export call the
+ magic __d_plt_call routine which is linked in from end.o.
- if (u && u->stub_unwind.stub_type == IMPORT ||
- (!(u && u->stub_unwind.stub_type == IMPORT) && solib_handle))
-#endif /* 0 */
- if (solib_handle)
+ You can't use _sr4export to make the call as the value in sp-24 will get
+ fried and you end up returning to the wrong location. You can't call the
+ target as the code to bind the PLT entry to a function can't return to a
+ stack address.
+
+ Also, query the dynamic linker in the inferior to provide a suitable
+ PLABEL for the target function. */
+ if (! using_gcc_plt_call)
{
CORE_ADDR new_fun;
- /* Prefer __gcc_plt_call over the HP supplied routine because
- __gcc_plt_call works for any number of arguments. */
- trampoline = lookup_minimal_symbol ("__gcc_plt_call", NULL, NULL);
- if (trampoline == NULL)
- trampoline = lookup_minimal_symbol ("__d_plt_call", NULL, NULL);
+ /* Get a handle for the shared library containing FUN. Given the
+ handle we can query the shared library for a PLABEL. */
+ solib_handle = som_solib_get_solib_by_pc (fun);
- if (trampoline == NULL)
+ if (solib_handle)
{
- error ("Can't find an address for __d_plt_call or __gcc_plt_call trampoline\nSuggest linking executable with -g (links in /opt/langtools/lib/end.o)");
- }
- /* This is where sr4export will jump to. */
- new_fun = SYMBOL_VALUE_ADDRESS (trampoline);
+ struct minimal_symbol *fmsymbol = lookup_minimal_symbol_by_pc (fun);
- if (strcmp (SYMBOL_NAME (trampoline), "__d_plt_call") == 0)
- {
- /* if the function is in a shared library, but we have no import sub for
- it, we need to get the plabel from a call to __d_shl_get, which is a
- function in end.o. To call this function we need to set up various things */
-
- /* actually now we just use the plabel any time we make the call,
- because on 10.30 and 11.00 this is the only acceptable way. This also
- works fine for 10.20 */
- /* if (!(u && u->stub_unwind.stub_type == IMPORT) && solib_handle) */
- {
- struct minimal_symbol *fmsymbol = lookup_minimal_symbol_by_pc(fun);
-
- new_stub = find_stub_with_shl_get(fmsymbol, solib_handle);
-
- if (new_stub == NULL)
- error("Can't find an import stub for %s", SYMBOL_NAME(fmsymbol)); /* purecov: deadcode */
- }
+ trampoline = lookup_minimal_symbol ("__d_plt_call", NULL, NULL);
+
+ if (trampoline == NULL)
+ {
+ error ("Can't find an address for __d_plt_call or __gcc_plt_call trampoline\nSuggest linking executable with -g or compiling with gcc.");
+ }
+
+ /* This is where sr4export will jump to. */
+ new_fun = SYMBOL_VALUE_ADDRESS (trampoline);
+
+ /* If the function is in a shared library, then call __d_shl_get to
+ get a PLABEL for the target function. */
+ new_stub = find_stub_with_shl_get (fmsymbol, solib_handle);
+
+ if (new_stub == 0)
+ error ("Can't find an import stub for %s", SYMBOL_NAME (fmsymbol));
/* We have to store the address of the stub in __shlib_funcptr. */
- msymbol = lookup_minimal_symbol ("__shlib_funcptr", NULL,
- (struct objfile *)NULL);
- if (msymbol == NULL)
- error ("Can't find an address for __shlib_funcptr"); /* purecov: deadcode */
+ msymbol = lookup_minimal_symbol ("__shlib_funcptr", NULL,
+ (struct objfile *)NULL);
- /* if (new_stub != NULL) */
- target_write_memory (SYMBOL_VALUE_ADDRESS (msymbol), (char *)&new_stub, 4);
- /* this is no longer used */
- /* else
- target_write_memory (SYMBOL_VALUE_ADDRESS (msymbol), (char *)&fun, 4); */
+ if (msymbol == NULL)
+ error ("Can't find an address for __shlib_funcptr");
+ target_write_memory (SYMBOL_VALUE_ADDRESS (msymbol),
+ (char *)&new_stub, 4);
/* We want sr4export to call __d_plt_call, so we claim it is
the final target. Clear trampoline. */
- fun = new_fun;
- trampoline = NULL;
+ fun = new_fun;
+ trampoline = NULL;
}
}
@@ -2131,7 +2150,7 @@ hppa_fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p)
{
msymbol = lookup_minimal_symbol ("_sr4export", NULL, NULL);
if (msymbol == NULL)
- error ("Can't find an address for _sr4export trampoline"); /* purecov: deadcode */
+ error ("Can't find an address for _sr4export trampoline");
trampoline_addr = SYMBOL_VALUE_ADDRESS (msymbol);
}
@@ -2176,7 +2195,6 @@ hppa_fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p)
#endif
else
return dyncall_addr;
-
}
@@ -3961,10 +3979,6 @@ initialize_hp_cxx_exception_support ()
return 0;
}
-#if 0 /* DEBUGGING */
- printf ("Hook addr found is %lx\n", eh_notify_hook_addr);
-#endif
-
/* Next look for the notify callback routine in end.o */
/* This is always available in the SOM symbol dictionary if end.o is linked in */
msym = lookup_minimal_symbol (HP_ACC_EH_notify_callback, NULL, NULL);
@@ -4011,10 +4025,6 @@ initialize_hp_cxx_exception_support ()
message, RETURN_MASK_ALL);
recurse--;
-#if 0 /* DEBUGGING */
- printf ("found plabel for eh notify callback: %x\n", eh_notify_callback_addr);
-#endif
-
exception_catchpoints_are_fragile = 1;
if (!eh_notify_callback_addr)
@@ -4029,10 +4039,6 @@ initialize_hp_cxx_exception_support ()
else
exception_catchpoints_are_fragile = 0;
-#if 0 /* DEBUGGING */
- printf ("Cb addr found is %lx\n", eh_notify_callback_addr);
-#endif
-
/* Now, look for the breakpointable routine in end.o */
/* This should also be available in the SOM symbol dict. if end.o linked in */
msym = lookup_minimal_symbol (HP_ACC_EH_break, NULL, NULL);
@@ -4050,10 +4056,6 @@ initialize_hp_cxx_exception_support ()
return 0;
}
-#if 0 /* DEBUGGING */
- printf ("break addr found is %lx\n", eh_break_addr);
-#endif
-
/* Next look for the catch enable flag provided in end.o */
sym = lookup_symbol (HP_ACC_EH_catch_catch, (struct block *) NULL,
VAR_NAMESPACE, 0, (struct symtab **) NULL);
@@ -4079,10 +4081,6 @@ initialize_hp_cxx_exception_support ()
}
}
-#if 0 /* DEBUGGING */
- printf ("catch catch addr found is %lx\n", eh_catch_catch_addr);
-#endif
-
/* Next look for the catch enable flag provided end.o */
sym = lookup_symbol (HP_ACC_EH_catch_catch, (struct block *) NULL,
VAR_NAMESPACE, 0, (struct symtab **) NULL);
@@ -4108,10 +4106,6 @@ initialize_hp_cxx_exception_support ()
}
}
-#if 0 /* DEBUGGING */
- printf ("catch throw addr found is %lx\n", eh_catch_throw_addr);
-#endif
-
/* Set the flags */
hp_cxx_exception_support = 2; /* everything worked so far */
hp_cxx_exception_support_initialized = 1;
diff --git a/gdb/inftarg.c b/gdb/inftarg.c
index 70d854125f4..d615ff9cffa 100644
--- a/gdb/inftarg.c
+++ b/gdb/inftarg.c
@@ -508,67 +508,7 @@ child_create_inferior (exec_file, allargs, env)
char *allargs;
char **env;
{
-
#ifdef HPUXHPPA
- char *tryname;
- char *shell_file;
- char *p;
- char *p1;
- char *path = getenv ("PATH");
- int len;
- struct stat statbuf;
-
- /* On HP-UX, we have a possible bad interaction between
- * the start-up-with-shell code and our catch-fork/catch-exec
- * logic. To avoid the bad interaction, we start up with the
- * C shell ("csh") and pass it the "-f" flag (fast start-up,
- * don't run .cshrc code).
- * See further comments in inferior.h toward the bottom
- * (STARTUP_WITH_SHELL flag) and in fork-child.c
- */
-
- /* Rather than passing in a hard-wired path like "/bin/csh",
- * we look down the PATH to find csh. I took this code from
- * procfs.c, which is the file in the Sun-specific part of GDB
- * analogous to inftarg.c. See procfs.c for more detailed
- * comments. - RT
- */
- shell_file = "csh";
- if (path == NULL)
- path = "/bin:/usr/bin";
- tryname = alloca (strlen (path) + strlen (shell_file) + 2);
- for (p = path; p != NULL; p = p1 ? p1 + 1: NULL)
- {
- p1 = strchr (p, ':');
- if (p1 != NULL)
- len = p1 - p;
- else
- len = strlen (p);
- strncpy (tryname, p, len);
- tryname[len] = '\0';
- strcat (tryname, "/");
- strcat (tryname, shell_file);
- if (access (tryname, X_OK) < 0)
- continue;
- if (stat (tryname, &statbuf) < 0)
- continue;
- if (!S_ISREG (statbuf.st_mode))
- /* We certainly need to reject directories. I'm not quite
- as sure about FIFOs, sockets, etc., but I kind of doubt
- that people want to exec() these things. */
- continue;
- break;
- }
- if (p == NULL)
- /* Not found. I replaced the error() which existed in procfs.c
- * with simply passing in NULL and hoping fork_inferior()
- * can deal with it. - RT
- */
- /* error ("Can't find shell %s in PATH", shell_file); */
- shell_file = NULL;
- else
- shell_file = tryname;
-
fork_inferior (exec_file, allargs, env, ptrace_me, ptrace_him, pre_fork_inferior, NULL);
#else
fork_inferior (exec_file, allargs, env, ptrace_me, ptrace_him, NULL, NULL);
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index 2d8efdf2f1d..365eb84e26d 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -36,6 +36,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "opcode/mips.h"
+struct frame_extra_info
+{
+ mips_extra_func_info_t proc_desc;
+ int num_args;
+};
+
/* Some MIPS boards don't support floating point while others only
support single-precision floating-point operations. See also
FP_REGISTER_DOUBLE. */
@@ -106,7 +112,16 @@ char *tmp_mips_processor_type;
/* A set of original names, to be used when restoring back to generic
registers from a specific set. */
-char *mips_generic_reg_names[] = REGISTER_NAMES;
+char *mips_generic_reg_names[] = MIPS_REGISTER_NAMES;
+char **mips_processor_reg_names = mips_generic_reg_names;
+
+char *
+mips_register_name (i)
+ int i;
+{
+ return mips_processor_reg_names[i];
+}
+
/* Names of IDT R3041 registers. */
@@ -219,6 +234,18 @@ struct linked_proc_info
struct linked_proc_info *next;
} *linked_proc_desc_table = NULL;
+void
+mips_print_extra_frame_info (fi)
+ struct frame_info *fi;
+{
+ if (fi
+ && fi->extra_info
+ && fi->extra_info->proc_desc
+ && fi->extra_info->proc_desc->pdr.framereg < NUM_REGS)
+ printf_filtered (" frame pointer is at %s+%d\n",
+ REGISTER_NAME (fi->extra_info->proc_desc->pdr.framereg),
+ fi->extra_info->proc_desc->pdr.frameoffset);
+}
/* Should the upper word of 64-bit addresses be zeroed? */
static int mask_address_p = 1;
@@ -873,7 +900,7 @@ mips_find_saved_regs (fci)
return;
}
- proc_desc = fci->proc_desc;
+ proc_desc = fci->extra_info->proc_desc;
if (proc_desc == NULL)
/* I'm not sure how/whether this can happen. Normally when we can't
find a proc_desc, we "synthesize" one using heuristic_proc_desc
@@ -1065,7 +1092,7 @@ mips_frame_saved_pc(frame)
struct frame_info *frame;
{
CORE_ADDR saved_pc;
- mips_extra_func_info_t proc_desc = frame->proc_desc;
+ mips_extra_func_info_t proc_desc = frame->extra_info->proc_desc;
/* We have to get the saved pc from the sigcontext
if it is a signal handler frame. */
int pcreg = frame->signal_handler_caller ? PC_REGNUM
@@ -1080,7 +1107,7 @@ mips_frame_saved_pc(frame)
}
static struct mips_extra_func_info temp_proc_desc;
-static struct frame_saved_regs temp_saved_regs;
+static CORE_ADDR temp_saved_regs[NUM_REGS];
/* Set a register's saved stack address in temp_saved_regs. If an address
has already been set for this register, do nothing; this way we will
@@ -1092,8 +1119,8 @@ set_reg_offset (regno, offset)
int regno;
CORE_ADDR offset;
{
- if (temp_saved_regs.regs[regno] == 0)
- temp_saved_regs.regs[regno] = offset;
+ if (temp_saved_regs[regno] == 0)
+ temp_saved_regs[regno] = offset;
}
@@ -1405,7 +1432,7 @@ mips32_heuristic_proc_desc(start_pc, limit_pc, next_frame, sp)
CORE_ADDR cur_pc;
CORE_ADDR frame_addr = 0; /* Value of $r30. Used by gcc for frame-pointer */
restart:
- memset (&temp_saved_regs, '\0', sizeof(struct frame_saved_regs));
+ memset (temp_saved_regs, '\0', SIZEOF_FRAME_SAVED_REGS);
PROC_FRAME_OFFSET(&temp_proc_desc) = 0;
PROC_FRAME_ADJUST (&temp_proc_desc) = 0; /* offset of FP from SP */
for (cur_pc = start_pc; cur_pc < limit_pc; cur_pc += MIPS_INSTLEN)
@@ -1508,7 +1535,7 @@ heuristic_proc_desc(start_pc, limit_pc, next_frame)
if (start_pc == 0) return NULL;
memset (&temp_proc_desc, '\0', sizeof(temp_proc_desc));
- memset (&temp_saved_regs, '\0', sizeof(struct frame_saved_regs));
+ memset (&temp_saved_regs, '\0', SIZEOF_FRAME_SAVED_REGS);
PROC_LOW_ADDR (&temp_proc_desc) = start_pc;
PROC_FRAME_REG (&temp_proc_desc) = SP_REGNUM;
PROC_PC_REG (&temp_proc_desc) = RA_REGNUM;
@@ -1676,7 +1703,8 @@ mips_frame_chain(frame)
}
void
-init_extra_frame_info(fci)
+mips_init_extra_frame_info(fromleaf, fci)
+ int fromleaf;
struct frame_info *fci;
{
int regnum;
@@ -1685,8 +1713,11 @@ init_extra_frame_info(fci)
mips_extra_func_info_t proc_desc =
fci->next ? cached_proc_desc : find_proc_desc(fci->pc, fci->next);
+ fci->extra_info = (struct frame_extra_info *)
+ frame_obstack_alloc (sizeof (struct frame_extra_info));
+
fci->saved_regs = NULL;
- fci->proc_desc =
+ fci->extra_info->proc_desc =
proc_desc == &temp_proc_desc ? 0 : proc_desc;
if (proc_desc)
{
@@ -1711,21 +1742,21 @@ init_extra_frame_info(fci)
(CORE_ADDR *)NULL,(CORE_ADDR *)NULL);
if (!IN_SIGTRAMP (fci->pc, name))
{
- fci->saved_regs = (CORE_ADDR*)
- frame_obstack_alloc (SIZEOF_FRAME_SAVED_REGS);
- memcpy (fci->saved_regs, temp_saved_regs.regs, SIZEOF_FRAME_SAVED_REGS);
+ frame_saved_regs_zalloc (fci);
+ memcpy (fci->saved_regs, temp_saved_regs, SIZEOF_FRAME_SAVED_REGS);
fci->saved_regs[PC_REGNUM]
= fci->saved_regs[RA_REGNUM];
}
}
/* hack: if argument regs are saved, guess these contain args */
- fci->num_args = -1; /* assume we can't tell how many args for now */
+ /* assume we can't tell how many args for now */
+ fci->extra_info->num_args = -1;
for (regnum = MIPS_LAST_ARG_REGNUM; regnum >= A0_REGNUM; regnum--)
{
if (PROC_REG_MASK(proc_desc) & (1 << regnum))
{
- fci->num_args = regnum - A0_REGNUM + 1;
+ fci->extra_info->num_args = regnum - A0_REGNUM + 1;
break;
}
}
@@ -2109,7 +2140,7 @@ mips_pop_frame()
struct frame_info *frame = get_current_frame ();
CORE_ADDR new_sp = FRAME_FP (frame);
- mips_extra_func_info_t proc_desc = frame->proc_desc;
+ mips_extra_func_info_t proc_desc = frame->extra_info->proc_desc;
write_register (PC_REGNUM, FRAME_SAVED_PC(frame));
if (frame->saved_regs == NULL)
@@ -3012,13 +3043,8 @@ mips_set_processor_type (str)
if (strcasecmp (str, mips_processor_type_table[i].name) == 0)
{
mips_processor_type = str;
-
- for (j = 0; j < NUM_REGS; ++j)
- /* FIXME - MIPS should be defining REGISTER_NAME() instead */
- gdb_register_names[j] = mips_processor_type_table[i].regnames[j];
-
+ mips_processor_reg_names = mips_processor_type_table[i].regnames;
return 1;
-
/* FIXME tweak fpu flag too */
}
}
diff --git a/gdb/ns32k-tdep.c b/gdb/ns32k-tdep.c
index 7946521f8f6..bf5208a2b5a 100644
--- a/gdb/ns32k-tdep.c
+++ b/gdb/ns32k-tdep.c
@@ -100,6 +100,12 @@ merlin_frame_num_args (fi)
return numargs;
}
+
+/* Return number of args passed to a frame.
+ Can return -1, meaning no way to tell.
+ Encore's C compiler often reuses same area on stack for args,
+ so this will often not work properly. If the arg names
+ are known, it's likely most of them will be printed. */
int
umax_frame_num_args (fi)
struct frame_info *fi;
diff --git a/gdb/parse.c b/gdb/parse.c
index d0424ce447a..a18e5210e15 100644
--- a/gdb/parse.c
+++ b/gdb/parse.c
@@ -1,5 +1,5 @@
/* Parse expressions for GDB.
- Copyright (C) 1986, 89, 90, 91, 94, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1986, 89, 90, 91, 94, 98, 1999 Free Software Foundation, Inc.
Modified from expread.y by the Department of Computer Science at the
State University of New York at Buffalo, 1991.
@@ -28,9 +28,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
during the process of parsing; the lower levels of the tree always
come first in the result. */
+#include <ctype.h>
+
#include "defs.h"
#include "gdb_string.h"
-#include <ctype.h>
#include "symtab.h"
#include "gdbtypes.h"
#include "frame.h"
@@ -41,7 +42,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "parser-defs.h"
#include "gdbcmd.h"
#include "symfile.h" /* for overlay functions */
-#include <ctype.h>
/* Global variables declared in parser-defs.h (and commented there). */
struct expression *expout;
@@ -86,30 +86,8 @@ static struct funcall *funcall_chain;
/* Assign machine-independent names to certain registers
(unless overridden by the REGISTER_NAMES table) */
-#ifdef NO_STD_REGS
unsigned num_std_regs = 0;
-struct std_regs std_regs[1];
-#else
-struct std_regs std_regs[] = {
-
-#ifdef PC_REGNUM
- { "pc", PC_REGNUM },
-#endif
-#ifdef FP_REGNUM
- { "fp", FP_REGNUM },
-#endif
-#ifdef SP_REGNUM
- { "sp", SP_REGNUM },
-#endif
-#ifdef PS_REGNUM
- { "ps", PS_REGNUM },
-#endif
-
-};
-
-unsigned num_std_regs = (sizeof std_regs / sizeof std_regs[0]);
-
-#endif
+struct std_regs *std_regs;
/* The generic method for targets to specify how their registers are
named. The mapping can be derived from three sources:
@@ -691,10 +669,6 @@ parse_nested_classes_for_hpacc (name, len, token, class_prefix, argptr)
prefix = tmp;
prefix_len = strlen (prefix);
-#if 0 /* DEBUGGING */
- printf ("Searching for nested class spec: Prefix is %s\n", prefix);
-#endif
-
/* See if the prefix we have now is something we know about */
if (!done)
@@ -741,10 +715,6 @@ parse_nested_classes_for_hpacc (name, len, token, class_prefix, argptr)
if (argptr)
*argptr = done ? p : end;
-#if 0 /* DEBUGGING */
- printf ("Searching for nested class spec: Token is %s, class_prefix %d\n", *token, *class_prefix);
-#endif
-
return sym_var ? sym_var : sym_class; /* found */
}
@@ -1321,6 +1291,8 @@ static void build_parse PARAMS ((void));
static void
build_parse ()
{
+ int i;
+
msym_text_symbol_type =
init_type (TYPE_CODE_FUNC, 1, 0, "<text variable, no debug info>", NULL);
TYPE_TARGET_TYPE (msym_text_symbol_type) = builtin_type_int;
@@ -1331,6 +1303,51 @@ build_parse ()
init_type (TYPE_CODE_INT, 1, 0,
"<variable (not text or data), no debug info>",
NULL);
+
+ /* create the std_regs table */
+
+ num_std_regs = 0;
+#ifdef PC_REGNUM
+ if (PC_REGNUM >= 0)
+ num_std_regs++;
+#endif
+#ifdef FP_REGNUM
+ if (FP_REGNUM >= 0)
+ num_std_regs++;
+#endif
+#ifdef FP_REGNUM
+ if (SP_REGNUM >= 0)
+ num_std_regs++;
+#endif
+#ifdef PS_REGNUM
+ if (PS_REGNUM >= 0)
+ num_std_regs++;
+#endif
+ /* create an empty table */
+ std_regs = xmalloc ((num_std_regs + 1) * sizeof *std_regs);
+ i = 0;
+ /* fill it in */
+#ifdef PC_REGNUM
+ std_regs[i].name = "pc";
+ std_regs[i].regnum = PC_REGNUM;
+ i++;
+#endif
+#ifdef FP_REGNUM
+ std_regs[i].name = "fp";
+ std_regs[i].regnum = FP_REGNUM;
+ i++;
+#endif
+#ifdef SP_REGNUM
+ std_regs[i].name = "sp";
+ std_regs[i].regnum = SP_REGNUM;
+ i++;
+#endif
+#ifdef PS_REGNUM
+ std_regs[i].name = "ps";
+ std_regs[i].regnum = PS_REGNUM;
+ i++;
+#endif
+ memset (&std_regs[i], 0, sizeof (std_regs[i]));
}
void
diff --git a/gdb/parser-defs.h b/gdb/parser-defs.h
index f417692e2d6..dc50694678b 100644
--- a/gdb/parser-defs.h
+++ b/gdb/parser-defs.h
@@ -27,7 +27,7 @@ struct std_regs {
int regnum;
};
-extern struct std_regs std_regs[];
+extern struct std_regs *std_regs;
extern unsigned num_std_regs;
extern struct expression *expout;
diff --git a/gdb/remote.c b/gdb/remote.c
index 5bcff883cfe..2a1a8788bdc 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -313,82 +313,12 @@ static void packet_command PARAMS ((char *, int));
static int stub_unpack_int PARAMS ((char *buff, int fieldlength));
-char *unpack_varlen_hex PARAMS ((char *buff, int *result));
-
-static char *unpack_nibble PARAMS ((char *buf, int *val));
-
-static char *pack_nibble PARAMS ((char *buf, int nibble));
-
-static char *pack_hex_byte PARAMS ((char *pkt, int/*unsigned char*/ byte));
-
-static char *unpack_byte PARAMS ((char *buf, int *value));
-
-static char *pack_int PARAMS ((char *buf, int value));
-
-static char *unpack_int PARAMS ((char *buf, int *value));
-
-static char *unpack_string PARAMS ((char *src, char *dest, int length));
-
-static char *pack_threadid PARAMS ((char *pkt, threadref *id));
-
-static char *unpack_threadid PARAMS ((char *inbuf, threadref *id));
-
-void int_to_threadref PARAMS ((threadref *id, int value));
-
-static int threadref_to_int PARAMS ((threadref *ref));
-
-static void copy_threadref PARAMS ((threadref *dest, threadref *src));
-
-static int threadmatch PARAMS ((threadref *dest, threadref *src));
-
-static char *pack_threadinfo_request PARAMS ((char *pkt, int mode,
- threadref *id));
-
-static int remote_unpack_thread_info_response PARAMS ((char *pkt,
- threadref *expectedref,
- struct gdb_ext_thread_info *info));
-
-
-static int remote_get_threadinfo PARAMS ((threadref *threadid,
- int fieldset, /*TAG mask */
- struct gdb_ext_thread_info *info));
-
-static int adapt_remote_get_threadinfo PARAMS ((gdb_threadref *ref,
- int selection,
- struct gdb_ext_thread_info *info));
-
-static char *pack_threadlist_request PARAMS ((char *pkt, int startflag,
- int threadcount,
- threadref *nextthread));
-
-static int parse_threadlist_response PARAMS ((char *pkt,
- int result_limit,
- threadref *original_echo,
- threadref *resultlist,
- int *doneflag));
-
-static int remote_get_threadlist PARAMS ((int startflag,
- threadref *nextthread,
- int result_limit,
- int *done,
- int *result_count,
- threadref *threadlist));
-
-typedef int (*rmt_thread_action) (threadref *ref, void *context);
-
-static int remote_threadlist_iterator PARAMS ((rmt_thread_action stepfunction,
- void *context, int looplimit));
-
-static int remote_newthread_step PARAMS ((threadref *ref, void *context));
-
static int remote_current_thread PARAMS ((int oldpid));
-int remote_find_new_threads PARAMS ((void));
+static void remote_find_new_threads PARAMS ((void));
static void record_currthread PARAMS ((int currthread));
-static void init_remote_threads PARAMS ((void));
-
/* exported functions */
extern int fromhex PARAMS ((int a));
@@ -415,8 +345,6 @@ static struct target_ops remote_ops;
static struct target_ops extended_remote_ops;
-static struct target_thread_vector remote_thread_vec;
-
/* This was 5 seconds, which is a long time to sit and wait.
Unless this is going though some terminal server or multiplexer or
other form of hairy serial connection, I would think 2 seconds would
@@ -449,25 +377,19 @@ static int remote_binary_download = 1;
/* Have we already checked whether binary downloads work? */
static int remote_binary_checked;
+/* Maximum number of bytes to read/write at once. The value here
+ is chosen to fill up a packet (the headers account for the 32). */
+#define MAXBUFBYTES(N) (((N)-32)/2)
+
/* Having this larger than 400 causes us to be incompatible with m68k-stub.c
and i386-stub.c. Normally, no one would notice because it only matters
for writing large chunks of memory (e.g. in downloads). Also, this needs
to be more than 400 if required to hold the registers (see below, where
we round it up based on REGISTER_BYTES). */
-#define PBUFSIZ 400
-
-/* Maximum number of bytes to read/write at once. The value here
- is chosen to fill up a packet (the headers account for the 32). */
-#define MAXBUFBYTES ((PBUFSIZ-32)/2)
-
/* Round up PBUFSIZ to hold all the registers, at least. */
-/* The blank line after the #if seems to be required to work around a
- bug in HP's PA compiler. */
-#if REGISTER_BYTES > MAXBUFBYTES
-
-#undef PBUFSIZ
-#define PBUFSIZ (REGISTER_BYTES * 2 + 32)
-#endif
+#define PBUFSIZ ((REGISTER_BYTES > MAXBUFBYTES (400)) \
+ ? (REGISTER_BYTES * 2 + 32) \
+ : 400)
/* This variable sets the number of bytes to be written to the target
@@ -475,7 +397,7 @@ static int remote_binary_checked;
targets need smaller values (perhaps because the receiving end
is slow). */
-static int remote_write_size = PBUFSIZ;
+static int remote_write_size;
/* This variable sets the number of bits in an address that are to be
sent in a memory ("M" or "m") packet. Normally, after stripping
@@ -512,7 +434,7 @@ void (*target_wait_loop_hook) PARAMS ((void));
/* These are the threads which we last sent to the remote system.
-1 for all or -2 for not sent yet. */
static int general_thread;
-static int cont_thread;
+static int continue_thread;
/* Call this function as a result of
1) A halt indication (T packet) containing a thread id
@@ -524,14 +446,8 @@ static void
record_currthread (currthread)
int currthread;
{
-#if 0 /* target_wait must not modify inferior_pid! */
- inferior_pid = currthread;
-#endif
general_thread = currthread;
-#if 0 /* setting cont_thread has a different meaning
- from having the target report its thread id. */
- cont_thread = currthread;
-#endif
+
/* If this is a new thread, add it to GDB's thread list.
If we leave it up to WFI to do this, bad things will happen. */
if (!in_thread_list (currthread))
@@ -546,7 +462,7 @@ set_thread (th, gen)
int gen;
{
char buf[PBUFSIZ];
- int state = gen ? general_thread : cont_thread;
+ int state = gen ? general_thread : continue_thread;
if (state == th)
return;
@@ -565,24 +481,23 @@ set_thread (th, gen)
putpkt (buf);
getpkt (buf, 0);
if (gen)
- general_thread = th;
+ general_thread = th;
else
- cont_thread = th;
+ continue_thread = th;
}
/* Return nonzero if the thread TH is still alive on the remote system. */
static int
-remote_thread_alive (th)
- int th;
+remote_thread_alive (tid)
+ int tid;
{
- char buf[PBUFSIZ];
+ char buf[16];
- buf[0] = 'T';
- if (th < 0)
- sprintf (&buf[1], "-%08x", -th);
+ if (tid < 0)
+ sprintf (buf, "T-%08x", -tid);
else
- sprintf (&buf[1], "%08x", th);
+ sprintf (buf, "T%08x", tid);
putpkt (buf);
getpkt (buf, 0);
return (buf[0] == 'O' && buf[1] == 'K');
@@ -594,8 +509,114 @@ remote_thread_alive (th)
remote protocol in general. There is a matching unit test module
in libstub. */
+#define OPAQUETHREADBYTES 8
+
+/* a 64 bit opaque identifier */
+typedef unsigned char threadref[OPAQUETHREADBYTES];
+
+/* WARNING: This threadref data structure comes from the remote O.S., libstub
+ protocol encoding, and remote.c. it is not particularly changable */
+
+/* Right now, the internal structure is int. We want it to be bigger.
+ Plan to fix this.
+ */
+
+typedef int gdb_threadref; /* internal GDB thread reference */
+
+/* gdb_ext_thread_info is an internal GDB data structure which is
+ equivalint to the reply of the remote threadinfo packet */
+
+struct gdb_ext_thread_info
+{
+ threadref threadid; /* External form of thread reference */
+ int active; /* Has state interesting to GDB? , regs, stack */
+ char display[256]; /* Brief state display, name, blocked/syspended */
+ char shortname[32]; /* To be used to name threads */
+ char more_display[256]; /* Long info, statistics, queue depth, whatever */
+};
+
+/* The volume of remote transfers can be limited by submitting
+ a mask containing bits specifying the desired information.
+ Use a union of these values as the 'selection' parameter to
+ get_thread_info. FIXME: Make these TAG names more thread specific.
+ */
+
+#define TAG_THREADID 1
+#define TAG_EXISTS 2
+#define TAG_DISPLAY 4
+#define TAG_THREADNAME 8
+#define TAG_MOREDISPLAY 16
+
#define BUF_THREAD_ID_SIZE (OPAQUETHREADBYTES*2)
+char *unpack_varlen_hex PARAMS ((char *buff, int *result));
+
+static char *unpack_nibble PARAMS ((char *buf, int *val));
+
+static char *pack_nibble PARAMS ((char *buf, int nibble));
+
+static char *pack_hex_byte PARAMS ((char *pkt, int/*unsigned char*/ byte));
+
+static char *unpack_byte PARAMS ((char *buf, int *value));
+
+static char *pack_int PARAMS ((char *buf, int value));
+
+static char *unpack_int PARAMS ((char *buf, int *value));
+
+static char *unpack_string PARAMS ((char *src, char *dest, int length));
+
+static char *pack_threadid PARAMS ((char *pkt, threadref *id));
+
+static char *unpack_threadid PARAMS ((char *inbuf, threadref *id));
+
+void int_to_threadref PARAMS ((threadref *id, int value));
+
+static int threadref_to_int PARAMS ((threadref *ref));
+
+static void copy_threadref PARAMS ((threadref *dest, threadref *src));
+
+static int threadmatch PARAMS ((threadref *dest, threadref *src));
+
+static char *pack_threadinfo_request PARAMS ((char *pkt, int mode,
+ threadref *id));
+
+static int remote_unpack_thread_info_response PARAMS ((char *pkt,
+ threadref *expectedref,
+ struct gdb_ext_thread_info *info));
+
+
+static int remote_get_threadinfo PARAMS ((threadref *threadid,
+ int fieldset, /*TAG mask */
+ struct gdb_ext_thread_info *info));
+
+static int adapt_remote_get_threadinfo PARAMS ((gdb_threadref *ref,
+ int selection,
+ struct gdb_ext_thread_info *info));
+
+static char *pack_threadlist_request PARAMS ((char *pkt, int startflag,
+ int threadcount,
+ threadref *nextthread));
+
+static int parse_threadlist_response PARAMS ((char *pkt,
+ int result_limit,
+ threadref *original_echo,
+ threadref *resultlist,
+ int *doneflag));
+
+static int remote_get_threadlist PARAMS ((int startflag,
+ threadref *nextthread,
+ int result_limit,
+ int *done,
+ int *result_count,
+ threadref *threadlist));
+
+typedef int (*rmt_thread_action) (threadref *ref, void *context);
+
+static int remote_threadlist_iterator PARAMS ((rmt_thread_action stepfunction,
+ void *context, int looplimit));
+
+static int remote_newthread_step PARAMS ((threadref *ref, void *context));
+
/* encode 64 bits in 16 chars of hex */
static const char hexchars[] = "0123456789abcdef";
@@ -1232,26 +1253,15 @@ remote_current_thread (oldpid)
return oldpid;
}
-int
+/* Find new threads for info threads command. */
+
+static void
remote_find_new_threads ()
{
- int ret;
-
- ret = remote_threadlist_iterator (remote_newthread_step, 0,
+ remote_threadlist_iterator (remote_newthread_step, 0,
CRAZY_MAX_THREADS);
if (inferior_pid == MAGIC_NULL_PID) /* ack ack ack */
inferior_pid = remote_current_thread (inferior_pid);
- return ret;
-}
-
-/* Initialize the thread vector which is used by threads.c */
-/* The thread stub is a package, it has an initializer */
-
-static void
-init_remote_threads ()
-{
- remote_thread_vec.find_new_threads = remote_find_new_threads;
- remote_thread_vec.get_thread_info = adapt_remote_get_threadinfo;
}
@@ -1467,19 +1477,14 @@ serial device is attached to the remote system (e.g. /dev/ttya).");
}
push_target (target); /* Switch to using remote target now */
- /* The target vector does not have the thread functions in it yet,
- so we use this function to call back into the thread module and
- register the thread vector and its contained functions. */
- bind_target_thread_vector (&remote_thread_vec);
-
/* Start out by trying the 'P' request to set registers. We set
this each time that we open a new target so that if the user
switches from one stub to another, we can (if the target is
closed and reopened) cope. */
stub_supports_P = 1;
- general_thread = -2;
- cont_thread = -2;
+ general_thread = -2;
+ continue_thread = -2;
/* Force remote_write_bytes to check whether target supports
binary downloading. */
@@ -3121,7 +3126,7 @@ remote_query (query_type, buf, outbuf, bufsiz)
if (! bufsiz)
error ("null pointer to remote bufer size specified");
- /* minimum outbuf size is PBUFSIZE - if bufsiz is not large enough let
+ /* minimum outbuf size is PBUFSIZ - if bufsiz is not large enough let
the caller know and return what the minimum size is */
/* Note: a zero bufsiz can be used to query the minimum buffer size */
if ( *bufsiz < PBUFSIZ )
@@ -3385,7 +3390,7 @@ Specify the serial device it is connected to (e.g. /dev/ttya).";
remote_ops.to_load = generic_load;
remote_ops.to_mourn_inferior = remote_mourn;
remote_ops.to_thread_alive = remote_thread_alive;
- remote_ops.to_find_new_threads = (void*) remote_find_new_threads;
+ remote_ops.to_find_new_threads = remote_find_new_threads;
remote_ops.to_stop = remote_stop;
remote_ops.to_query = remote_query;
remote_ops.to_stratum = process_stratum;
@@ -3420,12 +3425,15 @@ Specify the serial device it is connected to (e.g. /dev/ttya).",
void
_initialize_remote ()
{
+ /* runtime constants */
+ remote_write_size = PBUFSIZ;
+
init_remote_ops ();
add_target (&remote_ops);
init_extended_remote_ops ();
add_target (&extended_remote_ops);
- init_remote_threads ();
+
#if 0
init_remote_threadtests ();
#endif
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index 2a9d255d0ca..1179bd18143 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -1639,7 +1639,7 @@ variants[] =
num_registers (register_names_603), register_names_603 },
{ "604", "Motorola PowerPC 604 or 604e",
num_registers (register_names_604), register_names_604 },
- { "750", "Motorola/IBM PowerPC 750 or 750",
+ { "750", "Motorola/IBM PowerPC 750 or 740",
num_registers (register_names_750), register_names_750 },
{ 0, 0, 0, 0 }
};
diff --git a/gdb/somread.c b/gdb/somread.c
index c03abd01832..259835ff8e7 100644
--- a/gdb/somread.c
+++ b/gdb/somread.c
@@ -1,5 +1,5 @@
/* Read HP PA/Risc object files for GDB.
- Copyright 1991, 1992, 1996 Free Software Foundation, Inc.
+ Copyright 1991, 1992, 1996, 1999 Free Software Foundation, Inc.
Written by Fred Fish at Cygnus Support.
This file is part of GDB.
@@ -547,10 +547,6 @@ init_import_symbols (objfile)
objfile->import_list = NULL;
objfile->import_list_size = 0;
-#if 0 /* DEBUGGING */
- printf ("Processing import list for %s\n", objfile->name);
-#endif
-
/* It doesn't work, for some reason, to read in space $TEXT$;
the subspace $SHLIB_INFO$ has to be used. Some BFD quirk? pai/1997-08-05 */
text_section = bfd_get_section_by_name (objfile->obfd, "$SHLIB_INFO$");
@@ -606,10 +602,6 @@ init_import_symbols (objfile)
else /* null type */
objfile->import_list[k] = NULL;
-#if 0 /* DEBUGGING */
- printf ("Import String %d:%d (%d), type %d is %s\n", j, i, k,
- (int) buffer[i].type, objfile->import_list[k]);
-#endif
}
}
@@ -629,10 +621,6 @@ init_import_symbols (objfile)
}
else
objfile->import_list[k] = NULL;
-#if 0 /* DEBUGGING */
- printf ("Import String F:%d (%d), type %d, is %s\n", i, k,
- (int) buffer[i].type, objfile->import_list[k]);
-#endif
}
objfile->import_list_size = import_list_size;
@@ -681,10 +669,6 @@ init_export_symbols (objfile)
objfile->export_list = NULL;
objfile->export_list_size = 0;
-#if 0 /* DEBUGGING */
- printf ("Processing export list for %s\n", objfile->name);
-#endif
-
/* It doesn't work, for some reason, to read in space $TEXT$;
the subspace $SHLIB_INFO$ has to be used. Some BFD quirk? pai/1997-08-05 */
text_section = bfd_get_section_by_name (objfile->obfd, "$SHLIB_INFO$");
@@ -743,10 +727,6 @@ init_export_symbols (objfile)
objfile->export_list[k].name = NULL;
objfile->export_list[k].address = 0;
}
-#if 0 /* DEBUGGING */
- printf ("Export String %d:%d (%d), type %d is %s\n", j, i, k,
- (int) buffer[i].type, objfile->export_list[k].name);
-#endif
}
}
@@ -770,10 +750,6 @@ init_export_symbols (objfile)
objfile->export_list[k].name = NULL;
objfile->export_list[k].address = 0;
}
-#if 0 /* DEBUGGING */
- printf ("Export String F:%d (%d), type %d, value %x is %s\n", i, k,
- (int) buffer[i].type, buffer[i].value, objfile->export_list[k].name);
-#endif
}
objfile->export_list_size = export_list_size;
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 4da73617345..b51d214faeb 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -2489,8 +2489,10 @@ decode_line_1 (argptr, funfirstline, default_symtab, default_line, canonical)
struct symbol *sym_class;
int i1;
int is_quoted;
+ int is_quote_enclosed;
int has_parens;
int has_if = 0;
+ int has_comma = 0;
struct symbol **sym_arr;
struct type *t;
char *saved_arg = *argptr;
@@ -2562,12 +2564,33 @@ decode_line_1 (argptr, funfirstline, default_symtab, default_line, canonical)
if (has_if)
*ii = ' ';
+ /* Maybe we were called with a line range FILENAME:LINENUM,FILENAME:LINENUM
+ and we must isolate the first half. Outer layers will call again later
+ for the second half */
+ if ((ii = strchr(*argptr, ',')) != NULL)
+ has_comma = 1;
+ /* Temporarily zap out second half to not
+ * confuse the code below.
+ * This is undone below. Do not change ii!!
+ */
+ if (has_comma) {
+ *ii = '\0';
+ }
+
/* Maybe arg is FILE : LINENUM or FILE : FUNCTION */
/* May also be CLASS::MEMBER, or NAMESPACE::NAME */
/* Look for ':', but ignore inside of <> */
s = NULL;
- for (p = *argptr; *p; p++)
+ p = *argptr;
+ if (p[0] == '"')
+ {
+ is_quote_enclosed = 1;
+ p++;
+ }
+ else
+ is_quote_enclosed = 0;
+ for ( ; *p; p++)
{
if (p[0] == '<')
{
@@ -2576,8 +2599,15 @@ decode_line_1 (argptr, funfirstline, default_symtab, default_line, canonical)
error ("malformed template specification in command");
p = temp_end;
}
- if (p[0] == ':' || p[0] == ' ' || p[0] == '\t' || !*p)
- break;
+ /* Check for the end of the first half of the linespec. End of line,
+ a tab, a double colon or the last single colon, or a space. But
+ if enclosed in double quotes we do not break on enclosed spaces */
+ if (!*p
+ || p[0] == '\t'
+ || ((p[0] == ':')
+ && ((p[1] == ':') || (strchr (p + 1, ':') == NULL)))
+ || ((p[0] == ' ') && ! is_quote_enclosed))
+ break;
if (p[0] == '.' && strchr (p, ':') == NULL) /* Java qualified method. */
{
/* Find the *last* '.', since the others are package qualifiers. */
@@ -2590,6 +2620,16 @@ decode_line_1 (argptr, funfirstline, default_symtab, default_line, canonical)
}
}
while (p[0] == ' ' || p[0] == '\t') p++;
+ /* if the closing double quote was left at the end, remove it */
+ if (is_quote_enclosed && ((pp = strchr (p, '"')) != NULL))
+ if (!*(pp+1))
+ *pp = '\0';
+
+ /* Now that we've safely parsed the first half,
+ * put back ',' so outer layers can see it
+ */
+ if (has_comma)
+ *ii = ',';
if ((p[0] == ':' || p[0] == '.') && !has_parens)
{
@@ -2811,8 +2851,6 @@ decode_line_1 (argptr, funfirstline, default_symtab, default_line, canonical)
sym = lookup_symbol (copy, 0, VAR_NAMESPACE, 0, &sym_symtab);
s = (struct symtab *) 0;
/* Prepare to jump: restore the " if (condition)" so outer layers see it */
- if (has_if)
- *ii = ' ';
/* Symbol was found --> jump to normal symbol processing.
Code following "symbol_found" expects "copy" to have the
symbol name, "sym" to have the symbol pointer, "s" to be
@@ -2837,9 +2875,22 @@ decode_line_1 (argptr, funfirstline, default_symtab, default_line, canonical)
/* Extract the file name. */
p1 = p;
while (p != *argptr && p[-1] == ' ') --p;
+ if ((*p == '"') && is_quote_enclosed) --p;
copy = (char *) alloca (p - *argptr + 1);
- memcpy (copy, *argptr, p - *argptr);
- copy[p - *argptr] = 0;
+ if ((**argptr == '"') && is_quote_enclosed)
+ {
+ memcpy (copy, *argptr + 1, p - *argptr - 1);
+ /* It may have the ending quote right after the file name */
+ if (copy[p - *argptr - 2] == '"')
+ copy[p - *argptr - 2] = 0;
+ else
+ copy[p - *argptr - 1] = 0;
+ }
+ else
+ {
+ memcpy (copy, *argptr, p - *argptr);
+ copy[p - *argptr] = 0;
+ }
/* Find that file's data. */
s = lookup_symtab (copy);
@@ -2882,8 +2933,6 @@ decode_line_1 (argptr, funfirstline, default_symtab, default_line, canonical)
/* Yes, we have a symbol; jump to symbol processing */
/* Code after symbol_found expects S, SYM_SYMTAB, SYM,
and COPY to be set correctly */
- if (has_if)
- *ii = ' ';
*argptr = (*p == '\'') ? p + 1 : p;
s = (struct symtab *) 0;
goto symbol_found;
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index cf0e78da3fe..a6fe8dcdeca 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,22 @@
+Fri Jun 4 10:47:46 1999 Jeffrey A Law (law@cygnus.com)
+
+ * gdb.base/a1-selftest.exp: Remove bogus hppa xfail.
+ * gdb.base/mips_pro.exp: Likewise.
+
+1999-06-02 Keith Seitz <keiths@cygnus.com>
+
+ * gdb.c++/templates.cc: Change all "new" operators to throw
+ an exception.
+ * gdb.c++/cplusfuncs.cc: Likewise.
+
+ * gdb.base/Makefile.in (EXECUTABLES): Add smoke1, annota1, and annota2.
+
+Wed Jun 2 17:37:05 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdb.base/condbreak.exp: Use rerun_to_main to start the program.
+ * gdb.base/ending-run.exp: When stepping out of main, accept a
+ step into an arbitrary assembler file.
+
1999-05-20 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* gdb.base/annota1.exp: Allow any number of "frames-invalid" and
diff --git a/gdb/testsuite/configure b/gdb/testsuite/configure
index 2796fe73f67..519e32bf086 100755
--- a/gdb/testsuite/configure
+++ b/gdb/testsuite/configure
@@ -638,7 +638,14 @@ test "$host_alias" != "$target_alias" &&
# Directories to use in all configurations.
-configdirs="gdb.asm gdb.base gdb.c++ gdb.disasm gdb.chill gdb.threads gdb.trace"
+configdirs="gdb.asm \
+ gdb.base \
+ gdb.c++ \
+ gdb.disasm \
+ gdb.chill \
+ gdb.threads \
+ gdb.trace"
+
# Directories to use for a configuration which uses stabs.
stabsdirs="gdb.stabs"
diff --git a/gdb/testsuite/configure.in b/gdb/testsuite/configure.in
index 83356a9e0d1..96e9de727ca 100644
--- a/gdb/testsuite/configure.in
+++ b/gdb/testsuite/configure.in
@@ -13,7 +13,14 @@ AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../..)
AC_CANONICAL_SYSTEM
# Directories to use in all configurations.
-configdirs="gdb.asm gdb.base gdb.c++ gdb.disasm gdb.chill gdb.threads gdb.trace"
+configdirs="gdb.asm \
+ gdb.base \
+ gdb.c++ \
+ gdb.disasm \
+ gdb.chill \
+ gdb.threads \
+ gdb.trace"
+
# Directories to use for a configuration which uses stabs.
stabsdirs="gdb.stabs"
diff --git a/gdb/testsuite/gdb.base/Makefile.in b/gdb/testsuite/gdb.base/Makefile.in
index 11cf1da9095..050ccc8bb8e 100644
--- a/gdb/testsuite/gdb.base/Makefile.in
+++ b/gdb/testsuite/gdb.base/Makefile.in
@@ -1,7 +1,7 @@
VPATH = @srcdir@
srcdir = @srcdir@
-EXECUTABLES = all-types bitfields break \
+EXECUTABLES = all-types annota1 annota2 bitfields break \
call-ar-st call-rt-st call-strs callfuncs callfuncs2 commands \
compiler condbreak constvars coremaker display \
ending-run exprs funcargs int-type interrupt \
@@ -10,7 +10,7 @@ EXECUTABLES = all-types bitfields break \
mips_pro miscexprs nodebug opaque pointers pointers2 printcmds ptype \
recurse reread reread1 restore return run \
scope section_command setshow setvar \
- shmain sigall signals smoke \
+ shmain sigall signals smoke smoke1 \
solib so-impl-ld so-indr-cl \
step-test structs structs2 twice-tmp varargs watchpoint whatis
diff --git a/gdb/testsuite/gdb.base/a1-selftest.exp b/gdb/testsuite/gdb.base/a1-selftest.exp
index bc3893a0ccc..c0d17c815ec 100644
--- a/gdb/testsuite/gdb.base/a1-selftest.exp
+++ b/gdb/testsuite/gdb.base/a1-selftest.exp
@@ -74,6 +74,10 @@ proc do_steps_and_nexts {} {
set description "step over ttyarg initialization"
set command "step"
}
+ -re ".*interparg = NULL.*$gdb_prompt $" {
+ set description "step over interparg initialization"
+ set command "step"
+ }
-re ".*time_at_startup = get_run_time.*$gdb_prompt $" {
set description "next over get_run_time and everything it calls"
set command "next"
@@ -269,7 +273,7 @@ proc test_with_self { executable } {
# If we don't actually enter the xmalloc call when we give a
# step command that seems like a genuine bug. It seems to happen
# on most RISC processors.
- setup_xfail "alpha-*-*" "hppa*-*-*" "mips-*-*"
+ setup_xfail "alpha-*-*" "mips-*-*"
set description "step into xmalloc call"
send_gdb "step\n"
gdb_expect {
diff --git a/gdb/testsuite/gdb.base/condbreak.exp b/gdb/testsuite/gdb.base/condbreak.exp
index cf9deba9c6f..281616b68a4 100644
--- a/gdb/testsuite/gdb.base/condbreak.exp
+++ b/gdb/testsuite/gdb.base/condbreak.exp
@@ -122,7 +122,7 @@ gdb_test "info break" \
#
-gdb_run_cmd
+rerun_to_main
#
# run until the breakpoint at a line number
diff --git a/gdb/testsuite/gdb.base/ending-run.exp b/gdb/testsuite/gdb.base/ending-run.exp
index da78e3be98e..a8d0f05bea6 100644
--- a/gdb/testsuite/gdb.base/ending-run.exp
+++ b/gdb/testsuite/gdb.base/ending-run.exp
@@ -151,9 +151,12 @@ gdb_expect {
-re ".*in.*start.*$gdb_prompt $" {
pass "step out of main"
}
- -re ".*Program received signal SIGTRAP.*$gdb_prompt $" {
+ -re ".*in.*currently asm.*$gdb_prompt $" {
+ pass "step out of main into assembler"
+ }
+ -re ".*Program received signal SIGTRAP.*$gdb_prompt $" {
pass "Cygmon stopped in ending trap."
- }
+ }
timeout { fail "hang or timeout on step at end 1" }
}
diff --git a/gdb/testsuite/gdb.base/mips_pro.exp b/gdb/testsuite/gdb.base/mips_pro.exp
index ea2461e5f04..2b94de674dd 100644
--- a/gdb/testsuite/gdb.base/mips_pro.exp
+++ b/gdb/testsuite/gdb.base/mips_pro.exp
@@ -55,7 +55,7 @@ gdb_load ${binfile}
if [runto middle] then {
# PR 3016
if {$gcc_compiled} then {
- setup_xfail "hppa*-*-*" "mips*-sgi-irix4*" "mips64*-*-elf"
+ setup_xfail "mips*-sgi-irix4*" "mips64*-*-elf"
}
gdb_test "backtrace" "#0.*middle.*#1.*top.*#2.*main.*"
}
diff --git a/gdb/testsuite/gdb.c++/cplusfuncs.cc b/gdb/testsuite/gdb.c++/cplusfuncs.cc
index 924cf54b262..acb73b12af6 100644
--- a/gdb/testsuite/gdb.c++/cplusfuncs.cc
+++ b/gdb/testsuite/gdb.c++/cplusfuncs.cc
@@ -45,7 +45,7 @@ public:
void operator ->* (foo&);
void operator [] (foo&);
void operator () (foo&);
- void* operator new (size_t);
+ void* operator new (size_t) throw ();
void operator delete (void *);
/**/ operator int ();
/**/ operator char* ();
@@ -114,7 +114,7 @@ void foo::operator ^= (foo& afoo) { afoo.ifoo = 0; }
void foo::operator ->* (foo& afoo) { afoo.ifoo = 0; }
void foo::operator [] (foo& afoo) { afoo.ifoo = 0; }
void foo::operator () (foo& afoo) { afoo.ifoo = 0; }
-void* foo::operator new (size_t ival) { ival = 0; return 0; }
+void* foo::operator new (size_t ival) throw () { ival = 0; return 0; }
void foo::operator delete (void *ptr) { ptr = 0; }
/**/ foo::operator int () { return 0; }
/**/ foo::operator char* () { return 0; }
diff --git a/gdb/testsuite/gdb.c++/templates.cc b/gdb/testsuite/gdb.c++/templates.cc
index 25241dc6dbf..470024cbdae 100644
--- a/gdb/testsuite/gdb.c++/templates.cc
+++ b/gdb/testsuite/gdb.c++/templates.cc
@@ -290,7 +290,7 @@ void printf(const char *format, ... )
class T1 {
public:
- static void* operator new(size_t);
+ static void* operator new(size_t) throw ();
static void operator delete(void *pointer);
void operator=(const T1&);
@@ -365,7 +365,7 @@ public:
};
void*
-T1::operator new(size_t)
+T1::operator new(size_t) throw ()
{ return 0; }
void
@@ -456,7 +456,7 @@ public:
T5(int);
T5(const T5<T>&);
~T5();
- static void* operator new(size_t);
+ static void* operator new(size_t) throw ();
static void operator delete(void *pointer);
int value();
@@ -479,7 +479,7 @@ T5<T>::~T5()
template<class T>
void*
-T5<T>::operator new(size_t)
+T5<T>::operator new(size_t) throw ()
{ return 0; }
template<class T>
diff --git a/gdb/thread.c b/gdb/thread.c
index 01d152f2d54..516bca3beb8 100644
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -79,10 +79,6 @@ void _initialize_thread PARAMS ((void));
/* Prototypes for local functions. */
-#if !defined(FIND_NEW_THREADS)
-#define FIND_NEW_THREADS local_find_new_threads
-#endif
-
static struct thread_info *thread_list = NULL;
static int highest_thread_num;
@@ -96,68 +92,6 @@ static void thread_apply_command PARAMS ((char *, int));
static void restore_current_thread PARAMS ((int));
static void switch_to_thread PARAMS ((int pid));
static void prune_threads PARAMS ((void));
-static int local_find_new_threads PARAMS ((void));
-
-/* If the host has threads, the host machine definition may set this
- macro. But, for remote thread debugging, it gets more complex and
- setting macros does not bind to the various target dependent
- methods well. So, we use the vector target_thread_functions */
-
-static struct target_thread_vector *target_thread_functions;
-
-static int
-local_find_new_threads ()
-{
- int retval = 0;
- if (target_thread_functions &&
- target_thread_functions->find_new_threads)
- retval = (*(target_thread_functions->find_new_threads)) ();
- return retval; /* no support */
-}
-
-
-int
-target_get_thread_info PARAMS ((gdb_threadref * ref,
- int selection, /* FIXME: Selection */
- struct gdb_ext_thread_info * info));
-
-int
-target_get_thread_info (ref, selection, info)
-
- gdb_threadref *ref;
- int selection;
- /* FIXME: Selection */
- struct gdb_ext_thread_info *info;
-
-{
- int retval = 0;
- if (target_thread_functions
- && target_thread_functions->get_thread_info)
- retval = (*(target_thread_functions->get_thread_info)) (ref, selection, info);
- return retval;
-}
-
-
-/* It is possible that these bind and unbinf functions implement a
- stack the interface allows it, but its not implemented that way
- */
-
-
-void
-bind_target_thread_vector (vec)
- struct target_thread_vector *vec;
-{
- target_thread_functions = vec;
-}
-
-struct target_thread_vector *
-unbind_target_thread_vector ()
-{
- struct target_thread_vector *retval;
- retval = target_thread_functions;
- target_thread_functions = 0;
- return retval;
-} /* unbind_target_thread-vector */
void
init_thread_list ()