mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-21 01:12:32 +08:00
import gdb-1999-07-19 snapshot
This commit is contained in:
parent
dc9e099fc0
commit
adf40b2e16
@ -1,3 +1,78 @@
|
||||
1999-07-16 Keith Seitz <keiths@cygnus.com>
|
||||
|
||||
* remote.c (_initialize_remote): "remotebreak" should be a var_boolean.
|
||||
|
||||
1999-07-15 Jim Blandy <jimb@cris.red-bean.com>
|
||||
|
||||
Make the output from "info registers" fit withinin 80 columns.
|
||||
* hppa-tdep.c: Make it easy to change row and column counts.
|
||||
Switch to three columns, instead of four, and adjust spacing.
|
||||
|
||||
First cut at supporting HPPA2.0 in "wide" (64-bit) mode.
|
||||
* configure.tgt: Add hppa2.0w target.
|
||||
* config/pa/hppa64.mt, config/pa/tm-hppa64.h: New files.
|
||||
* hppa-tdep.c (hppa_fix_call_dummy): Dyke out code to tweak the
|
||||
call dummy, if target is PA2.0w. This is temporary, until I get
|
||||
function calls working.
|
||||
* hppah-nat.c (fetch_register): Rewritten to handle both narrow
|
||||
and wide register requests.
|
||||
(HPPAH_OFFSETOF): New macro.
|
||||
|
||||
* gdbtypes.c (is_integral_type): New function.
|
||||
* gdbtypes.h: Prototype for above.
|
||||
|
||||
1999-07-15 J.T. Conklin <jtc@redback.com>
|
||||
|
||||
* configure.tgt (i[3456]86-*-vxworks*): New target.
|
||||
* config/i386/vxworks.mt: New file, x86 VxWorks target
|
||||
* config/i386/tm-vxworks.h: New file.
|
||||
|
||||
* configure.tgt (powerpc-*-vxworks*): New target.
|
||||
* config/powerpc/vxworks.mt: New file, PowerPC VxWorks target
|
||||
* config/powerpc/tm-vxworks.h: New file.
|
||||
|
||||
* NEWS: Mention the new configs.
|
||||
|
||||
1999-07-15 Fernando Nasser <fnasser@cygnus.com>
|
||||
|
||||
* target.c (target_preopen): Prevent query when not from_tty.
|
||||
* infcmd.c (run_command): Prevent query when not from_tty.
|
||||
|
||||
1999-07-15 Fernando Nasser <fnasser@cygnus.com>
|
||||
|
||||
* event-loop.c: Fix typo in comment.
|
||||
|
||||
Wed Jul 14 17:29:31 1999 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
|
||||
* ser-pipe.c (struct pipe_state): Define.
|
||||
(pipe_close): Retain the PID of the sub-process using ``struct
|
||||
pipe_state''. Delete #ifdef code that used popen().
|
||||
(pipe_close): Kill of the sub-process as part of the cleanup.
|
||||
|
||||
* serial.h (struct _serial_t): Add field ``state''.
|
||||
|
||||
1999-07-13 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
|
||||
|
||||
* event-top.c (display_gdb_prompt): Don't display the prompt if we
|
||||
are in the middle of an execution command. Also trick readline so
|
||||
it doesn't try to display the prompt.
|
||||
(command_line_handler): Get rid of change_prompt, unused variable.
|
||||
Use {push, pop}_prompt mechanism in case of multiline commands.
|
||||
|
||||
* infrun.c (complete_execution): Set target_executing to 0 as
|
||||
first thing, so that display_gdb_prompt does the right thing.
|
||||
|
||||
Tue Jul 13 20:29:46 1999 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
|
||||
* parse.c (build_parse): Fix conditional increment of num_std_regs
|
||||
for SP_REGNUM. Was conditional on FP_REGNUM.
|
||||
|
||||
Tue Jul 13 16:44:58 1999 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
|
||||
* gdbarch.h, gdbarch.c: Revert 1999-07-07 Stan Shebs
|
||||
<shebs@andros.cygnus.com> indentation change. Don't let indent
|
||||
mess with these files.
|
||||
|
||||
Mon Jul 12 11:15:09 1999 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
|
||||
* config/mips/tm-mips.h (REGISTER_CONVERT_TO_RAW,
|
||||
@ -17,6 +92,13 @@ Mon Jul 12 11:15:09 1999 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
|
||||
* NEWS: Document protocol change.
|
||||
|
||||
1999-07-12 Keith Seitz <keiths@cygnus.com>
|
||||
|
||||
* rdi-share/unixcomm.c (Unix_ResetSerial): Remove CYGWIN32
|
||||
conditional. It's no longer needed.
|
||||
(SERPORT1, SERPORT2): Linux serial ports are "/dev/ttyX", not
|
||||
"/dev/cuaX" (X=0,1,2,3,...).
|
||||
|
||||
Mon Jul 12 02:02:00 1999 Andrew Cagney <cagney@amy.cygnus.com>
|
||||
|
||||
* defs.h, utils.c (fputstrn_filtered, fputstrn_unfiltered,
|
||||
|
@ -224,7 +224,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 = 19990712
|
||||
VERSION = 19990719
|
||||
DIST=gdb
|
||||
|
||||
LINT=/usr/5bin/lint
|
||||
|
22
gdb/NEWS
22
gdb/NEWS
@ -3,6 +3,18 @@
|
||||
|
||||
*** Changes since GDB-4.18:
|
||||
|
||||
* New targets
|
||||
|
||||
x86 VxWorks i[3456]86-*-vxworks*
|
||||
PowerPC VxWorks powerpc-*-vxworks*
|
||||
TI TMS320C80 tic80-*-*
|
||||
|
||||
* OBSOLETE configurations
|
||||
|
||||
Altos 3068 m68*-altos-*
|
||||
Convex c1-*-*, c2-*-*
|
||||
Pyramid pyramid-*-*
|
||||
|
||||
* Remote targets can connect to a sub-program
|
||||
|
||||
A popen(3) style serial-device has been added. This device starts a
|
||||
@ -13,16 +25,6 @@ with that. The sub-program to run is specified using the syntax
|
||||
(gdb) set remotedebug 1
|
||||
(gdb) target extended-remote |mn10300-elf-sim program-args
|
||||
|
||||
* New targets
|
||||
|
||||
TI TMS320C80 tic80-*-*
|
||||
|
||||
* OBSOLETE configurations
|
||||
|
||||
Altos 3068 m68*-altos-*
|
||||
Convex c1-*-*, c2-*-*
|
||||
Pyramid pyramid-*-*
|
||||
|
||||
* MIPS 64 remote protocol
|
||||
|
||||
A long standing bug in the mips64 remote protocol where by GDB
|
||||
|
28
gdb/config/i386/tm-vxworks.h
Normal file
28
gdb/config/i386/tm-vxworks.h
Normal file
@ -0,0 +1,28 @@
|
||||
/* Target machine description for VxWorks on the 80[3456]86,
|
||||
for GDB, the GNU debugger.
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GDB.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef TM_VXWORKS_H
|
||||
#define TM_VXWORKS_H
|
||||
|
||||
#include "i386/tm-i386v.h"
|
||||
#include "tm-vxworks.h"
|
||||
|
||||
#endif /* ifndef TM_VXWORKS_H */
|
3
gdb/config/i386/vxworks.mt
Normal file
3
gdb/config/i386/vxworks.mt
Normal file
@ -0,0 +1,3 @@
|
||||
# Target: i386 running VxWorks
|
||||
TDEPFILES= i386-tdep.o i387-tdep.o
|
||||
TM_FILE= tm-vxworks.h
|
4
gdb/config/pa/hppa64.mt
Normal file
4
gdb/config/pa/hppa64.mt
Normal file
@ -0,0 +1,4 @@
|
||||
# Target: HP PA-RISC 2.0 running HPUX 11.00 in wide mode
|
||||
TDEPFILES= hppa-tdep.o # pa64-solib.o
|
||||
TM_FILE= tm-hppa64.h
|
||||
TM_CLIBS= # $(srcdir)/libxpdl.a
|
320
gdb/config/pa/tm-hppa64.h
Normal file
320
gdb/config/pa/tm-hppa64.h
Normal file
@ -0,0 +1,320 @@
|
||||
/* Parameters for execution on any Hewlett-Packard PA-RISC machine.
|
||||
Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1995
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
Contributed by the Center for Software Science at the
|
||||
University of Utah (pa-gdb-bugs@cs.utah.edu).
|
||||
|
||||
This file is part of GDB.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* PA 64-bit specific definitions. Override those which are in
|
||||
tm-hppa.h */
|
||||
|
||||
#include "pa/tm-hppah.h"
|
||||
|
||||
#define HPUX_1100 1
|
||||
|
||||
/* jimb: this must go. I'm just using it to disable code I haven't
|
||||
gotten working yet. */
|
||||
#define GDB_TARGET_IS_HPPA_20W
|
||||
|
||||
/* The low two bits of the IA are the privilege level of the instruction. */
|
||||
#define ADDR_BITS_REMOVE(addr) ((CORE_ADDR)addr & (CORE_ADDR)~3)
|
||||
|
||||
/* Say how long (ordinary) registers are. This is used in
|
||||
push_word and a few other places, but REGISTER_RAW_SIZE is
|
||||
the real way to know how big a register is. */
|
||||
|
||||
#undef REGISTER_SIZE
|
||||
#define REGISTER_SIZE 8
|
||||
|
||||
/* Number of bytes of storage in the actual machine representation
|
||||
for register N. On the PA-RISC 2.0, all regs are 8 bytes, including
|
||||
the FP registers (they're accessed as two 4 byte halves). */
|
||||
|
||||
#undef REGISTER_RAW_SIZE
|
||||
#define REGISTER_RAW_SIZE(N) 8
|
||||
|
||||
/* Largest value REGISTER_RAW_SIZE can have. */
|
||||
|
||||
#undef MAX_REGISTER_RAW_SIZE
|
||||
#define MAX_REGISTER_RAW_SIZE 8
|
||||
|
||||
/* Total amount of space needed to store our copies of the machine's
|
||||
register state, the array `registers'. */
|
||||
|
||||
#undef REGISTER_BYTES
|
||||
#define REGISTER_BYTES (NUM_REGS * 8)
|
||||
|
||||
/* Index within `registers' of the first byte of the space for
|
||||
register N. */
|
||||
|
||||
#undef REGISTER_BYTE
|
||||
#define REGISTER_BYTE(N) ((N) * 8)
|
||||
|
||||
#undef REGISTER_VIRTUAL_TYPE
|
||||
#define REGISTER_VIRTUAL_TYPE(N) \
|
||||
((N) < FP4_REGNUM ? builtin_type_unsigned_long_long : builtin_type_double)
|
||||
|
||||
|
||||
/* Number of machine registers */
|
||||
#undef NUM_REGS
|
||||
#define NUM_REGS 96
|
||||
|
||||
/* Initializer for an array of names of registers.
|
||||
There should be NUM_REGS strings in this initializer.
|
||||
They are in rows of eight entries */
|
||||
#undef REGISTER_NAMES
|
||||
#define REGISTER_NAMES \
|
||||
{"flags", "r1", "rp", "r3", "r4", "r5", "r6", "r7", \
|
||||
"r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", \
|
||||
"r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", \
|
||||
"r24", "r25", "r26", "dp", "ret0", "ret1", "sp", "r31", \
|
||||
"sar", "pcoqh", "pcsqh", "pcoqt", "pcsqt", "eiem", "iir", "isr", \
|
||||
"ior", "ipsw", "goto", "sr4", "sr0", "sr1", "sr2", "sr3", \
|
||||
"sr5", "sr6", "sr7", "cr0", "cr8", "cr9", "ccr", "cr12", \
|
||||
"cr13", "cr24", "cr25", "cr26", "mpsfu_high","mpsfu_low","mpsfu_ovflo","pad",\
|
||||
"fpsr", "fpe1", "fpe2", "fpe3", "fr4", "fr5", "fr6", "fr7", \
|
||||
"fr8", "fr9", "fr10", "fr11", "fr12", "fr13", "fr14", "fr15", \
|
||||
"fr16", "fr17", "fr18", "fr19", "fr20", "fr21", "fr22", "fr23", \
|
||||
"fr24", "fr25", "fr26", "fr27", "fr28", "fr29", "fr30", "fr31"}
|
||||
|
||||
#undef FP0_REGNUM
|
||||
#undef FP4_REGNUM
|
||||
#define FP0_REGNUM 64 /* floating point reg. 0 (fspr)*/
|
||||
#define FP4_REGNUM 68
|
||||
|
||||
/* Redefine some target bit sizes from the default. */
|
||||
|
||||
/* Number of bits in a long or unsigned long for the target machine. */
|
||||
|
||||
#define TARGET_LONG_BIT 64
|
||||
|
||||
/* Number of bits in a long long or unsigned long long for the
|
||||
target machine. */
|
||||
|
||||
#define TARGET_LONG_LONG_BIT 64
|
||||
|
||||
/* Number of bits in a pointer for the target machine */
|
||||
|
||||
#define TARGET_PTR_BIT 64
|
||||
|
||||
/* Argument Pointer Register */
|
||||
#define AP_REGNUM 29
|
||||
|
||||
#define DP_REGNUM 27
|
||||
|
||||
#define FP5_REGNUM 70
|
||||
|
||||
#define SR5_REGNUM 48
|
||||
|
||||
#undef FRAME_ARGS_ADDRESS
|
||||
#define FRAME_ARGS_ADDRESS(fi) ((fi)->ap)
|
||||
|
||||
/* We access locals from SP. This may not work for frames which call
|
||||
alloca; for those, we may need to consult unwind tables.
|
||||
jimb: FIXME. */
|
||||
#undef FRAME_LOCALS_ADDRESS
|
||||
#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
|
||||
|
||||
#define INIT_FRAME_AP init_frame_ap
|
||||
|
||||
#define EXTRA_FRAME_INFO \
|
||||
CORE_ADDR ap;
|
||||
|
||||
/* For a number of horrible reasons we may have to adjust the location
|
||||
of variables on the stack. Ugh. jimb: why? */
|
||||
#define HPREAD_ADJUST_STACK_ADDRESS(ADDR) hpread_adjust_stack_address(ADDR)
|
||||
|
||||
extern int hpread_adjust_stack_address PARAMS ((CORE_ADDR));
|
||||
|
||||
|
||||
/* jimb: omitted dynamic linking stuff here */
|
||||
|
||||
/* This sequence of words is the instructions
|
||||
|
||||
; Call stack frame has already been built by gdb. Since we could be calling
|
||||
; a varargs function, and we do not have the benefit of a stub to put things in
|
||||
; the right place, we load the first 8 word of arguments into both the general
|
||||
; and fp registers.
|
||||
call_dummy
|
||||
copy %r4,%r29
|
||||
copy %r5,%r22
|
||||
copy %r6,%r27
|
||||
fldd -64(0,%r29),%fr4
|
||||
fldd -56(0,%r29),%fr5
|
||||
fldd -48(0,%r29),%fr6
|
||||
fldd -40(0,%r29),%fr7
|
||||
fldd -32(0,%r29),%fr8
|
||||
fldd -24(0,%r29),%fr9
|
||||
fldd -16(0,%r29),%fr10
|
||||
fldd -8(0,%r29),%fr11
|
||||
copy %r22,%r1
|
||||
ldd -64(%r29), %r26
|
||||
ldd -56(%r29), %r25
|
||||
ldd -48(%r29), %r24
|
||||
ldd -40(%r29), %r23
|
||||
ldd -32(%r29), %r22
|
||||
ldd -24(%r29), %r21
|
||||
ldd -16(%r29), %r20
|
||||
bve,l (%r1),%r2
|
||||
ldd -8(%r29), %r19
|
||||
break 4, 8
|
||||
mtsp %r21, %sr0
|
||||
ble 0(%sr0, %r22)
|
||||
nop
|
||||
*/
|
||||
|
||||
#undef CALL_DUMMY
|
||||
#define CALL_DUMMY {0x349d0000, 0x34b60000, 0x34db0000, \
|
||||
0x53a43f83, 0x53a53f93, 0x53a63fa3, 0x53a73fb3,\
|
||||
0x53a83fc3, 0x53a93fd3, 0x2fa1100a, 0x2fb1100b,\
|
||||
0x36c10000, 0x53ba3f81, 0x53b93f91, 0x53b83fa1,\
|
||||
0x53b73fb1, 0x53b63fc1, 0x53b53fd1, 0x0fa110d4,\
|
||||
0xe820f000, 0x0fb110d3, 0x00010004, 0x00151820,\
|
||||
0xe6c00000, 0x08000240}
|
||||
|
||||
#undef CALL_DUMMY_LENGTH
|
||||
#define CALL_DUMMY_LENGTH (INSTRUCTION_SIZE * 25)
|
||||
|
||||
#undef FUNC_LDIL_OFFSET
|
||||
#undef FUNC_LDO_OFFSET
|
||||
#undef SR4EXPORT_LDIL_OFFSET
|
||||
#undef SR4EXPORT_LDO_OFFSET
|
||||
#undef CALL_DUMMY_LOCATION
|
||||
/* jimb: need to find out what AT_WDB_CALL_DUMMY is about */
|
||||
#if 0
|
||||
#define CALL_DUMMY_LOCATION AFTER_TEXT_END
|
||||
extern CORE_ADDR wdb_call_dummy_addr;
|
||||
#undef PC_IN_CALL_DUMMY
|
||||
#define PC_IN_CALL_DUMMY(pc, sp, frame_address) \
|
||||
((pc) >= wdb_call_dummy_addr && \
|
||||
(pc) <= wdb_call_dummy_addr + CALL_DUMMY_LENGTH)
|
||||
#endif
|
||||
|
||||
#undef REG_STRUCT_HAS_ADDR
|
||||
|
||||
#undef EXTRACT_RETURN_VALUE
|
||||
/* RM: floats are returned in FR4R, doubles in FR4
|
||||
* integral values are in r28, padded on the left
|
||||
* aggregates less that 65 bits are in r28, right padded
|
||||
* aggregates upto 128 bits are in r28 and r29, right padded
|
||||
*/
|
||||
#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
|
||||
{ \
|
||||
if (TYPE_CODE (TYPE) == TYPE_CODE_FLT && !SOFT_FLOAT) \
|
||||
memcpy ((VALBUF), \
|
||||
((char *)(REGBUF)) + REGISTER_BYTE (FP4_REGNUM) + \
|
||||
(REGISTER_SIZE - TYPE_LENGTH (TYPE)), \
|
||||
TYPE_LENGTH (TYPE)); \
|
||||
else if (is_integral_type(TYPE) || SOFT_FLOAT) \
|
||||
memcpy ((VALBUF), \
|
||||
(char *)(REGBUF) + REGISTER_BYTE (28) + \
|
||||
(REGISTER_SIZE - TYPE_LENGTH (TYPE)), \
|
||||
TYPE_LENGTH (TYPE)); \
|
||||
else if (TYPE_LENGTH (TYPE) <= 8) \
|
||||
memcpy ((VALBUF), \
|
||||
(char *)(REGBUF) + REGISTER_BYTE (28), \
|
||||
TYPE_LENGTH (TYPE)); \
|
||||
else if (TYPE_LENGTH (TYPE) <= 16) \
|
||||
{ \
|
||||
memcpy ((VALBUF), \
|
||||
(char *)(REGBUF) + REGISTER_BYTE (28), \
|
||||
8); \
|
||||
memcpy (((char *) VALBUF + 8), \
|
||||
(char *)(REGBUF) + REGISTER_BYTE (29), \
|
||||
TYPE_LENGTH (TYPE) - 8); \
|
||||
} \
|
||||
}
|
||||
|
||||
/* RM: struct upto 128 bits are returned in registers */
|
||||
#undef USE_STRUCT_CONVENTION
|
||||
#define USE_STRUCT_CONVENTION(gcc_p, value_type)\
|
||||
(TYPE_LENGTH (value_type) > 16)
|
||||
|
||||
/* RM: for return command */
|
||||
#undef STORE_RETURN_VALUE
|
||||
#define STORE_RETURN_VALUE(TYPE,VALBUF) \
|
||||
{ \
|
||||
if (TYPE_CODE (TYPE) == TYPE_CODE_FLT && !SOFT_FLOAT) \
|
||||
write_register_bytes \
|
||||
(REGISTER_BYTE (FP4_REGNUM) + \
|
||||
(REGISTER_SIZE - TYPE_LENGTH (TYPE)), \
|
||||
(VALBUF), \
|
||||
TYPE_LENGTH (TYPE)); \
|
||||
else if (is_integral_type(TYPE) || SOFT_FLOAT) \
|
||||
write_register_bytes \
|
||||
(REGISTER_BYTE (28) + \
|
||||
(REGISTER_SIZE - TYPE_LENGTH (TYPE)), \
|
||||
(VALBUF), \
|
||||
TYPE_LENGTH (TYPE)); \
|
||||
else if (TYPE_LENGTH (TYPE) <= 8) \
|
||||
write_register_bytes \
|
||||
( REGISTER_BYTE (28), \
|
||||
(VALBUF), \
|
||||
TYPE_LENGTH (TYPE)); \
|
||||
else if (TYPE_LENGTH (TYPE) <= 16) \
|
||||
{ \
|
||||
write_register_bytes \
|
||||
(REGISTER_BYTE (28), \
|
||||
(VALBUF), \
|
||||
8); \
|
||||
write_register_bytes \
|
||||
(REGISTER_BYTE (29), \
|
||||
((char *) VALBUF + 8), \
|
||||
TYPE_LENGTH (TYPE) - 8); \
|
||||
} \
|
||||
}
|
||||
|
||||
/* RM: these are the PA64 equivalents of the macros in tm-hppah.h --
|
||||
* see comments there. For PA64, the save_state structure is at an
|
||||
* offset of 24 32-bit words from the sigcontext structure. The 64 bit
|
||||
* general registers are at an offset of 640 bytes from the beginning of the
|
||||
* save_state structure, and the floating pointer register are at an offset
|
||||
* of 256 bytes from the beginning of the save_state structure.
|
||||
*/
|
||||
#undef FRAME_SAVED_PC_IN_SIGTRAMP
|
||||
#define FRAME_SAVED_PC_IN_SIGTRAMP(FRAME, TMP) \
|
||||
{ \
|
||||
*(TMP) = read_memory_integer ((FRAME)->frame + (24 * 4) + 640 + (33 * 8), 8); \
|
||||
}
|
||||
|
||||
#undef FRAME_BASE_BEFORE_SIGTRAMP
|
||||
#define FRAME_BASE_BEFORE_SIGTRAMP(FRAME, TMP) \
|
||||
{ \
|
||||
*(TMP) = read_memory_integer ((FRAME)->frame + (24 * 4) + 640 + (30 * 8), 8); \
|
||||
}
|
||||
|
||||
#undef FRAME_FIND_SAVED_REGS_IN_SIGTRAMP
|
||||
#define FRAME_FIND_SAVED_REGS_IN_SIGTRAMP(FRAME, FSR) \
|
||||
{ \
|
||||
int i; \
|
||||
CORE_ADDR TMP1, TMP2; \
|
||||
TMP1 = (FRAME)->frame + (24 * 4) + 640; \
|
||||
TMP2 = (FRAME)->frame + (24 * 4) + 256; \
|
||||
for (i = 0; i < NUM_REGS; i++) \
|
||||
{ \
|
||||
if (i == SP_REGNUM) \
|
||||
(FSR)->regs[SP_REGNUM] = read_memory_integer (TMP1 + SP_REGNUM * 8, 8); \
|
||||
else if (i >= FP0_REGNUM) \
|
||||
(FSR)->regs[i] = TMP2 + (i - FP0_REGNUM) * 8; \
|
||||
else \
|
||||
(FSR)->regs[i] = TMP1 + i * 8; \
|
||||
} \
|
||||
}
|
||||
|
||||
/* jimb: omitted purify call support */
|
28
gdb/config/powerpc/tm-vxworks.h
Normal file
28
gdb/config/powerpc/tm-vxworks.h
Normal file
@ -0,0 +1,28 @@
|
||||
/* Target machine description for VxWorks on the PowerPC,
|
||||
for GDB, the GNU debugger.
|
||||
Copyright 1999 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GDB.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef TM_VXWORKS_H
|
||||
#define TM_VXWORKS_H
|
||||
|
||||
#include "powerpc/tm-ppc-eabi.h"
|
||||
#include "tm-vxworks.h"
|
||||
|
||||
#endif /* ifndef TM_VXWORKS_H */
|
3
gdb/config/powerpc/vxworks.mt
Normal file
3
gdb/config/powerpc/vxworks.mt
Normal file
@ -0,0 +1,3 @@
|
||||
# Target: Powerpc running VxWorks
|
||||
TDEPFILES= rs6000-tdep.o
|
||||
TM_FILE= tm-vxworks.h
|
@ -63,8 +63,10 @@ h8500-*-*) gdb_target=h8500 ;;
|
||||
|
||||
fr30-*-elf*) gdb_target=fr30 ;;
|
||||
|
||||
|
||||
hppa*-*-bsd*) gdb_target=hppabsd ;;
|
||||
hppa*-*-pro*) gdb_target=hppapro ;;
|
||||
hppa2.0w-*-hpux11*) gdb_target=hppa64 ;;
|
||||
hppa*-*-hpux*) gdb_target=hppahpux ;;
|
||||
hppa*-*-hiux*) gdb_target=hppahpux ;;
|
||||
hppa*-*-osf*) gdb_target=hppaosf ;;
|
||||
@ -107,6 +109,7 @@ i[3456]86-*-netware*) gdb_target=i386nw
|
||||
configdirs="${configdirs} nlm" ;;
|
||||
i[3456]86-*-osf1mk*) gdb_target=i386mk ;;
|
||||
i[3456]86-*-cygwin*) gdb_target=cygwin ;;
|
||||
i[3456]86-*-vxworks*) gdb_target=vxworks ;;
|
||||
|
||||
i960-*-bout*) gdb_target=vxworks960 ;;
|
||||
i960-nindy-coff*) gdb_target=nindy960 ;;
|
||||
@ -223,6 +226,7 @@ powerpcle-*-eabi* | powerpcle-*-sysv* | powerpcle-*-elf*)
|
||||
else
|
||||
gdb_target=ppcle-eabi
|
||||
fi ;;
|
||||
powerpc-*-vxworks*) gdb_target=vxworks ;;
|
||||
|
||||
# OBSOLETE pyramid-*-*) gdb_target=pyramid ;;
|
||||
|
||||
|
@ -1,3 +1,8 @@
|
||||
1999-07-14 Jim Blandy <jimb@zwingli.cygnus.com>
|
||||
|
||||
* gdbint.texinfo (PREPARE_TO_PROCEED, ADDR_BITS_REMOVE): Doc
|
||||
fixes.
|
||||
|
||||
Tue Jun 29 11:43:55 1999 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
|
||||
* gdbint.texinfo (SAVE_DUMMY_FRAME_TOS): Define.
|
||||
|
@ -1163,13 +1163,17 @@ line options to GDB. They are currently used only for the unsupported
|
||||
i960 Nindy target, and should not be used in any other configuration.
|
||||
|
||||
@item ADDR_BITS_REMOVE (addr)
|
||||
If a raw machine address includes any bits that are not really part of
|
||||
the address, then define this macro to expand into an expression that
|
||||
zeros those bits in @var{addr}. For example, the two low-order bits of
|
||||
a Motorola 88K address may be used by some kernels for their own
|
||||
purposes, since addresses must always be 4-byte aligned, and so are of
|
||||
no use for addressing. Those bits should be filtered out with an
|
||||
expression such as @code{((addr) & ~3)}.
|
||||
If a raw machine instruction address includes any bits that are not
|
||||
really part of the address, then define this macro to expand into an
|
||||
expression that zeros those bits in @var{addr}. This is only used for
|
||||
addresses of instructions, and even then not in all contexts.
|
||||
|
||||
For example, the two low-order bits of the PC on the Hewlett-Packard PA
|
||||
2.0 architecture contain the privilege level of the corresponding
|
||||
instruction. Since instructions must always be aligned on four-byte
|
||||
boundaries, the processor masks out these bits to generate the actual
|
||||
address of the instruction. ADDR_BITS_REMOVE should filter out these
|
||||
bits with an expression such as @code{((addr) & ~3)}.
|
||||
|
||||
@item BEFORE_MAIN_LOOP_HOOK
|
||||
Define this to expand into any code that you want to execute before the
|
||||
@ -2043,6 +2047,22 @@ root directory.
|
||||
Define this to be able to, when a breakpoint insertion fails, warn the
|
||||
user that another process may be running with the same executable.
|
||||
|
||||
@item PREPARE_TO_PROCEED @var{select_it}
|
||||
This (ugly) macro allows a native configuration to customize the way the
|
||||
@code{proceed} function in @file{infrun.c} deals with switching between
|
||||
threads.
|
||||
|
||||
In a multi-threaded task we may select another thread and then continue
|
||||
or step. But if the old thread was stopped at a breakpoint, it will
|
||||
immediately cause another breakpoint stop without any execution (i.e. it
|
||||
will report a breakpoint hit incorrectly). So GDB must step over it
|
||||
first.
|
||||
|
||||
If defined, @code{PREPARE_TO_PROCEED} should check the current thread
|
||||
against the thread that reported the most recent event. If a step-over
|
||||
is required, it returns TRUE. If @var{select_it} is non-zero, it should
|
||||
reselect the old thread.
|
||||
|
||||
@item PROC_NAME_FMT
|
||||
Defines the format for the name of a @file{/proc} device. Should be
|
||||
defined in @file{nm.h} @emph{only} in order to override the default
|
||||
|
@ -38,7 +38,7 @@
|
||||
Events can be inserted at the front of the queue or at the end of
|
||||
the queue. Events will be extracted from the queue for processing
|
||||
starting from the head. Therefore, events inserted at the head of
|
||||
the queue will be processed in a last in first out fashoin, while
|
||||
the queue will be processed in a last in first out fashion, while
|
||||
those inserted at the tail of the queue will be processed in a first
|
||||
in first out manner. All the fields are NULL if the queue is
|
||||
empty. */
|
||||
|
@ -245,6 +245,28 @@ display_gdb_prompt (new_prompt)
|
||||
int prompt_length = 0;
|
||||
char *gdb_prompt = get_prompt ();
|
||||
|
||||
|
||||
if (target_executing && sync_execution)
|
||||
{
|
||||
/* This is to trick readline into not trying to display the
|
||||
prompt. Even though we display the prompt using this
|
||||
function, readline still tries to do its own display if we
|
||||
don't call rl_callback_handler_install and
|
||||
rl_callback_handler_remove (which readline detects because a
|
||||
global variable is not set). If readline did that, it could
|
||||
mess up gdb signal handlers for SIGINT. Readline assumes
|
||||
that between calls to rl_set_signals and rl_clear_signals gdb
|
||||
doesn't do anything with the signal handlers. Well, that's
|
||||
not the case, because when the target executes we change the
|
||||
SIGINT signal handler. If we allowed readline to display the
|
||||
prompt, the signal handler change would happen exactly
|
||||
between the calls to the above two functions.
|
||||
Calling rl_callback_handler_remove(), does the job. */
|
||||
|
||||
rl_callback_handler_remove ();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!new_prompt)
|
||||
{
|
||||
/* Just use the top of the prompt stack. */
|
||||
@ -267,6 +289,7 @@ display_gdb_prompt (new_prompt)
|
||||
rl_callback_handler_remove ();
|
||||
rl_callback_handler_install (new_prompt, input_handler);
|
||||
}
|
||||
/* new_prompt at this point can be the top of the stack or the one passed in */
|
||||
else if (new_prompt)
|
||||
{
|
||||
/* Don't use a _filtered function here. It causes the assumed
|
||||
@ -287,7 +310,7 @@ display_gdb_prompt (new_prompt)
|
||||
'set annotate'. It pushes a new prompt (with prefix and suffix) on top
|
||||
of the prompt stack, if the annotation level desired is 2, otherwise
|
||||
it pops the top of the prompt stack when we want the annotation level
|
||||
to be the normal ones (1 or 2). */
|
||||
to be the normal ones (1 or 0). */
|
||||
static void
|
||||
change_annotation_level ()
|
||||
{
|
||||
@ -535,7 +558,6 @@ command_line_handler (rl)
|
||||
static unsigned linelength = 0;
|
||||
register char *p;
|
||||
char *p1;
|
||||
int change_prompt = 0;
|
||||
extern char *line;
|
||||
extern int linesize;
|
||||
char *nline;
|
||||
@ -565,7 +587,7 @@ command_line_handler (rl)
|
||||
p = readline_input_state.linebuffer_ptr;
|
||||
free (readline_input_state.linebuffer);
|
||||
more_to_come = 0;
|
||||
change_prompt = 1;
|
||||
pop_prompt ();
|
||||
}
|
||||
|
||||
#ifdef STOP_SIGNAL
|
||||
@ -626,8 +648,10 @@ command_line_handler (rl)
|
||||
/* We will not invoke a execute_command if there is more
|
||||
input expected to complete the command. So, we need to
|
||||
print an empty prompt here. */
|
||||
display_gdb_prompt ("");
|
||||
more_to_come = 1;
|
||||
push_prompt ("", "", "");
|
||||
display_gdb_prompt (0);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
1143
gdb/gdbarch.c
1143
gdb/gdbarch.c
File diff suppressed because it is too large
Load Diff
517
gdb/gdbarch.h
517
gdb/gdbarch.h
File diff suppressed because it is too large
Load Diff
@ -1616,6 +1616,20 @@ can_dereference (t)
|
||||
&& TYPE_CODE (TYPE_TARGET_TYPE (t)) != TYPE_CODE_VOID);
|
||||
}
|
||||
|
||||
int
|
||||
is_integral_type (t)
|
||||
struct type *t;
|
||||
{
|
||||
CHECK_TYPEDEF (t);
|
||||
return
|
||||
((t != NULL)
|
||||
&& ((TYPE_CODE(t) == TYPE_CODE_INT)
|
||||
|| (TYPE_CODE(t) == TYPE_CODE_ENUM)
|
||||
|| (TYPE_CODE(t) == TYPE_CODE_CHAR)
|
||||
|| (TYPE_CODE(t) == TYPE_CODE_RANGE)
|
||||
|| (TYPE_CODE(t) == TYPE_CODE_BOOL)));
|
||||
}
|
||||
|
||||
/* Chill varying string and arrays are represented as follows:
|
||||
|
||||
struct { int __var_length; ELEMENT_TYPE[MAX_SIZE] __var_data};
|
||||
|
@ -1138,6 +1138,8 @@ print_scalar_formatted PARAMS ((char *, struct type *, int, int, GDB_FILE *));
|
||||
|
||||
extern int can_dereference PARAMS ((struct type *));
|
||||
|
||||
extern int is_integral_type PARAMS ((struct type *));
|
||||
|
||||
extern void maintenance_print_type PARAMS ((char *, int));
|
||||
|
||||
/* typeprint.c */
|
||||
|
@ -2127,6 +2127,7 @@ hppa_fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p)
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef GDB_TARGET_IS_HPPA_20W
|
||||
/* Store upper 21 bits of function address into ldil. fun will either be
|
||||
the final target (most cases) or __d_plt_call when calling into a shared
|
||||
library and __gcc_plt_call is not available. */
|
||||
@ -2144,6 +2145,7 @@ hppa_fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p)
|
||||
deposit_14 (fun & MASK_11,
|
||||
extract_unsigned_integer (&dummy[FUNC_LDO_OFFSET],
|
||||
INSTRUCTION_SIZE)));
|
||||
#endif /* GDB_TARGET_IS_HPPA_20W */
|
||||
#ifdef SR4EXPORT_LDIL_OFFSET
|
||||
|
||||
{
|
||||
@ -2514,17 +2516,22 @@ pa_print_registers (raw_regs, regnum, fpregs)
|
||||
int fpregs;
|
||||
{
|
||||
int i, j;
|
||||
long raw_val[2]; /* Alas, we are compiled so that "long long" is 32 bits */
|
||||
/* Alas, we are compiled so that "long long" is 32 bits */
|
||||
long raw_val[2];
|
||||
long long_val;
|
||||
int rows = 24, columns = 3;
|
||||
|
||||
for (i = 0; i < 18; i++)
|
||||
for (i = 0; i < rows; i++)
|
||||
{
|
||||
for (j = 0; j < 4; j++)
|
||||
for (j = 0; j < columns; j++)
|
||||
{
|
||||
/* We display registers in column-major order. */
|
||||
int regnum = i + j * rows;
|
||||
|
||||
/* Q: Why is the value passed through "extract_signed_integer",
|
||||
while above, in "pa_do_registers_info" it isn't?
|
||||
A: ? */
|
||||
pa_register_look_aside (raw_regs, i + (j * 18), &raw_val[0]);
|
||||
pa_register_look_aside (raw_regs, regnum, &raw_val[0]);
|
||||
|
||||
/* Even fancier % formats to prevent leading zeros
|
||||
and still maintain the output in columns. */
|
||||
@ -2533,17 +2540,17 @@ pa_print_registers (raw_regs, regnum, fpregs)
|
||||
/* Being big-endian, on this machine the low bits
|
||||
(the ones we want to look at) are in the second longword. */
|
||||
long_val = extract_signed_integer (&raw_val[1], 4);
|
||||
printf_filtered ("%8.8s: %8x ",
|
||||
REGISTER_NAME (i + (j * 18)), long_val);
|
||||
printf_filtered ("%8.8s: %8x",
|
||||
REGISTER_NAME (regnum), long_val);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* raw_val = extract_signed_integer(&raw_val, 8); */
|
||||
if (raw_val[0] == 0)
|
||||
printf_filtered ("%8.8s: %8x ",
|
||||
REGISTER_NAME (i + (j * 18)), raw_val[1]);
|
||||
printf_filtered ("%8.8s: %8x",
|
||||
REGISTER_NAME (regnum), raw_val[1]);
|
||||
else
|
||||
printf_filtered ("%8.8s: %8x%8.8x ", REGISTER_NAME (i + (j * 18)),
|
||||
printf_filtered ("%8.8s: %8x%8.8x", REGISTER_NAME (regnum),
|
||||
raw_val[0], raw_val[1]);
|
||||
}
|
||||
}
|
||||
|
@ -104,45 +104,92 @@ store_inferior_registers (regno)
|
||||
store_inferior_registers (regno);
|
||||
}
|
||||
|
||||
/* Fetch one register. */
|
||||
|
||||
/* Our own version of the offsetof macro, since we can't assume ANSI C. */
|
||||
#define HPPAH_OFFSETOF(type, member) ((int) (&((type *) 0)->member))
|
||||
|
||||
/* Fetch a register's value from the process's U area. */
|
||||
static void
|
||||
fetch_register (regno)
|
||||
int regno;
|
||||
{
|
||||
register unsigned int regaddr;
|
||||
char buf[MAX_REGISTER_RAW_SIZE];
|
||||
register int i;
|
||||
unsigned int addr, len, offset;
|
||||
int i;
|
||||
|
||||
/* Offset of registers within the u area. */
|
||||
unsigned int offset;
|
||||
offset = 0;
|
||||
len = REGISTER_RAW_SIZE (regno);
|
||||
|
||||
offset = U_REGS_OFFSET;
|
||||
/* Requests for register zero actually want the save_state's
|
||||
ss_flags member. As RM says: "Oh, what a hack!" */
|
||||
if (regno == 0)
|
||||
{
|
||||
save_state_t ss;
|
||||
addr = HPPAH_OFFSETOF (save_state_t, ss_flags);
|
||||
len = sizeof (ss.ss_flags);
|
||||
|
||||
regaddr = register_addr (regno, offset);
|
||||
for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int))
|
||||
/* Note that ss_flags is always an int, no matter what
|
||||
REGISTER_RAW_SIZE(0) says. Assuming all HP-UX PA machines
|
||||
are big-endian, put it at the least significant end of the
|
||||
value, and zap the rest of the buffer. */
|
||||
offset = REGISTER_RAW_SIZE (0) - len;
|
||||
memset (buf, 0, sizeof (buf));
|
||||
}
|
||||
|
||||
/* Floating-point registers come from the ss_fpblock area. */
|
||||
else if (regno >= FP0_REGNUM)
|
||||
addr = (HPPAH_OFFSETOF (save_state_t, ss_fpblock)
|
||||
+ (REGISTER_BYTE (regno) - REGISTER_BYTE (FP0_REGNUM)));
|
||||
|
||||
/* Wide registers come from the ss_wide area.
|
||||
I think it's more PC to test (ss_flags & SS_WIDEREGS) to select
|
||||
between ss_wide and ss_narrow than to use the raw register size.
|
||||
But checking ss_flags would require an extra ptrace call for
|
||||
every register reference. Bleah. */
|
||||
else if (len == 8)
|
||||
addr = (HPPAH_OFFSETOF (save_state_t, ss_wide)
|
||||
+ REGISTER_BYTE (regno));
|
||||
|
||||
/* Narrow registers come from the ss_narrow area. Note that
|
||||
ss_narrow starts with gr1, not gr0. */
|
||||
else if (len == 4)
|
||||
addr = (HPPAH_OFFSETOF (save_state_t, ss_narrow)
|
||||
+ (REGISTER_BYTE (regno) - REGISTER_BYTE (1)));
|
||||
|
||||
else
|
||||
fatal ("hppa-nat.c (fetch_register): unexpected register size");
|
||||
|
||||
for (i = 0; i < len; i += sizeof (int))
|
||||
{
|
||||
errno = 0;
|
||||
*(int *) &buf[i] = call_ptrace (PT_RUREGS, inferior_pid,
|
||||
(PTRACE_ARG3_TYPE) regaddr, 0);
|
||||
regaddr += sizeof (int);
|
||||
/* Copy an int from the U area to buf. Fill the least
|
||||
significant end if len != raw_size. */
|
||||
* (int *) &buf[offset + i] =
|
||||
call_ptrace (PT_RUREGS, inferior_pid,
|
||||
(PTRACE_ARG3_TYPE) addr + i, 0);
|
||||
if (errno != 0)
|
||||
{
|
||||
/* Warning, not error, in case we are attached; sometimes the
|
||||
kernel doesn't let us at the registers. */
|
||||
/* Warning, not error, in case we are attached; sometimes
|
||||
the kernel doesn't let us at the registers. */
|
||||
char *err = safe_strerror (errno);
|
||||
char *msg = alloca (strlen (err) + 128);
|
||||
sprintf (msg, "reading register %s: %s", REGISTER_NAME (regno), err);
|
||||
sprintf (msg, "reading `%s' register: %s",
|
||||
REGISTER_NAME (regno), err);
|
||||
warning (msg);
|
||||
goto error_exit;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* If we're reading an address from the instruction address queue,
|
||||
mask out the bottom two bits --- they contain the privilege
|
||||
level. */
|
||||
if (regno == PCOQ_HEAD_REGNUM || regno == PCOQ_TAIL_REGNUM)
|
||||
buf[3] &= ~0x3;
|
||||
buf[len - 1] &= ~0x3;
|
||||
|
||||
supply_register (regno, buf);
|
||||
error_exit:;
|
||||
}
|
||||
|
||||
|
||||
/* Copy LEN bytes to or from inferior's memory starting at MEMADDR
|
||||
to debugger memory starting at MYADDR. Copy to inferior if
|
||||
WRITE is nonzero.
|
||||
|
@ -244,8 +244,8 @@ run_command (args, from_tty)
|
||||
|
||||
if (inferior_pid != 0 && target_has_execution)
|
||||
{
|
||||
if (
|
||||
!query ("The program being debugged has been started already.\n\
|
||||
if (from_tty
|
||||
&& !query ("The program being debugged has been started already.\n\
|
||||
Start it from the beginning? "))
|
||||
error ("Program not restarted.");
|
||||
target_kill ();
|
||||
|
@ -1262,6 +1262,9 @@ fetch_inferior_event ()
|
||||
|
||||
if (!async_ecs->wait_some_more)
|
||||
{
|
||||
/* Do only the cleanups that have been added by this
|
||||
function. Let the continuations for the commands do the rest,
|
||||
if there are any. */
|
||||
do_exec_cleanups (old_cleanups);
|
||||
normal_stop ();
|
||||
/* Is there anything left to do for the command issued to
|
||||
@ -3112,6 +3115,7 @@ complete_execution ()
|
||||
{
|
||||
extern cleanup_sigint_signal_handler PARAMS ((void));
|
||||
|
||||
target_executing = 0;
|
||||
if (sync_execution)
|
||||
{
|
||||
add_file_handler (input_fd, (file_handler_func *) call_readline, 0);
|
||||
@ -3120,7 +3124,6 @@ complete_execution ()
|
||||
cleanup_sigint_signal_handler ();
|
||||
display_gdb_prompt (0);
|
||||
}
|
||||
target_executing = 0;
|
||||
}
|
||||
|
||||
/* Here to return control to GDB when the inferior stops for real.
|
||||
|
@ -1324,7 +1324,7 @@ build_parse ()
|
||||
if (FP_REGNUM >= 0)
|
||||
num_std_regs++;
|
||||
#endif
|
||||
#ifdef FP_REGNUM
|
||||
#ifdef SP_REGNUM
|
||||
if (SP_REGNUM >= 0)
|
||||
num_std_regs++;
|
||||
#endif
|
||||
|
@ -82,8 +82,8 @@
|
||||
#endif
|
||||
|
||||
#ifdef __linux__
|
||||
#define SERPORT1 "/dev/cua0"
|
||||
#define SERPORT2 "/dev/cua1"
|
||||
#define SERPORT1 "/dev/ttyS0"
|
||||
#define SERPORT2 "/dev/ttyS1"
|
||||
#define PARPORT1 "/dev/par0"
|
||||
#define PARPORT2 "/dev/par1"
|
||||
#endif
|
||||
@ -305,15 +305,6 @@ extern void Unix_ResetSerial(void)
|
||||
struct termios terminfo;
|
||||
|
||||
tcgetattr(serpfd, &terminfo);
|
||||
#ifdef __CYGWIN32__
|
||||
/* Expedient, but it works. */
|
||||
terminfo.c_iflag = 0;
|
||||
terminfo.c_oflag = 0;
|
||||
terminfo.c_cflag = 48;
|
||||
terminfo.c_lflag = 0;
|
||||
terminfo.c_cc[VMIN] = 0;
|
||||
terminfo.c_cc[VTIME] = 1;
|
||||
#else
|
||||
terminfo.c_lflag &= ~(ICANON | ISIG | ECHO | IEXTEN);
|
||||
terminfo.c_iflag &= ~(IGNCR | INPCK | ISTRIP | ICRNL | BRKINT);
|
||||
terminfo.c_iflag |= (IXON | IXOFF | IGNBRK);
|
||||
@ -322,7 +313,6 @@ extern void Unix_ResetSerial(void)
|
||||
terminfo.c_cc[VMIN] = 1;
|
||||
terminfo.c_cc[VTIME] = 0;
|
||||
terminfo.c_oflag &= ~OPOST;
|
||||
#endif
|
||||
tcsetattr(serpfd, TCSAFLUSH, &terminfo);
|
||||
}
|
||||
|
||||
|
@ -4832,7 +4832,7 @@ terminating `#' character and checksum.",
|
||||
|
||||
add_show_from_set
|
||||
(add_set_cmd ("remotebreak", no_class,
|
||||
var_integer, (char *) &remote_break,
|
||||
var_boolean, (char *) &remote_break,
|
||||
"Set whether to send break if interrupted.\n",
|
||||
&setlist),
|
||||
&showlist);
|
||||
|
@ -54,6 +54,15 @@ static void pipe_print_tty_state PARAMS ((serial_t, serial_ttystate));
|
||||
|
||||
extern void _initialize_ser_pipe PARAMS ((void));
|
||||
|
||||
#undef XMALLOC
|
||||
#define XMALLOC(T) ((T*) xmalloc (sizeof (T)))
|
||||
|
||||
|
||||
struct pipe_state
|
||||
{
|
||||
int pid;
|
||||
};
|
||||
|
||||
/* Open up a raw pipe */
|
||||
|
||||
static int
|
||||
@ -64,23 +73,8 @@ pipe_open (scb, name)
|
||||
#if !defined(O_NONBLOCK) || !defined(F_GETFL) || !defined(F_SETFL)
|
||||
return -1;
|
||||
#else
|
||||
#if defined (__NetBSD__) || defined (__FreeBSD__)
|
||||
|
||||
/* check the BSD popen sources for where "r+" comes from :-) */
|
||||
FILE *stream;
|
||||
stream = popen (name + 1, "r+");
|
||||
if (stream == NULL)
|
||||
{
|
||||
fprintf_unfiltered (gdb_stderr, "%s: popen failed\n", name + 1);
|
||||
return -1;
|
||||
}
|
||||
scb->ttystate = stream; /* borrow that space */
|
||||
scb->fd = fileno (stream);
|
||||
|
||||
#else
|
||||
|
||||
struct pipe_state *state;
|
||||
/* This chunk: */
|
||||
|
||||
/* Copyright (c) 1988, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
@ -92,20 +86,20 @@ pipe_open (scb, name)
|
||||
if (socketpair (AF_UNIX, SOCK_STREAM, 0, pdes) < 0)
|
||||
return -1;
|
||||
|
||||
switch (pid = vfork ())
|
||||
pid = vfork ();
|
||||
|
||||
/* Error. */
|
||||
if (pid == -1)
|
||||
{
|
||||
case -1: /* Error. */
|
||||
close (pdes[0]);
|
||||
close (pdes[1]);
|
||||
return -1;
|
||||
case 0: /* Child. */
|
||||
#if 0
|
||||
/* POSIX.2 B.3.2.2 "popen() shall ensure that any streams
|
||||
from previous popen() calls that remain open in the
|
||||
parent process are closed in the new child process. */
|
||||
for (old = pidlist; old; old = old->next)
|
||||
close (fileno (old->fp)); /* don't allow a flush */
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Child. */
|
||||
if (pid == 0)
|
||||
{
|
||||
/* re-wire pdes[1] to stdin/stdout */
|
||||
close (pdes[0]);
|
||||
if (pdes[1] != STDOUT_FILENO)
|
||||
{
|
||||
@ -113,15 +107,25 @@ pipe_open (scb, name)
|
||||
close (pdes[1]);
|
||||
}
|
||||
dup2 (STDOUT_FILENO, STDIN_FILENO);
|
||||
#if 0
|
||||
/* close any stray FD's - FIXME - how? */
|
||||
/* POSIX.2 B.3.2.2 "popen() shall ensure that any streams
|
||||
from previous popen() calls that remain open in the
|
||||
parent process are closed in the new child process. */
|
||||
for (old = pidlist; old; old = old->next)
|
||||
close (fileno (old->fp)); /* don't allow a flush */
|
||||
#endif
|
||||
execl ("/bin/sh", "sh", "-c", name + 1, NULL);
|
||||
_exit (127);
|
||||
}
|
||||
|
||||
/* Parent; assume fdopen can't fail. */
|
||||
/* Parent. */
|
||||
close (pdes[1]);
|
||||
/* :end chunk */
|
||||
state = XMALLOC (struct pipe_state);
|
||||
state->pid = pid;
|
||||
scb->fd = pdes[0];
|
||||
scb->ttystate = NULL;
|
||||
#endif
|
||||
scb->state = state;
|
||||
|
||||
/* Make it non-blocking */
|
||||
{
|
||||
@ -359,14 +363,17 @@ static void
|
||||
pipe_close (scb)
|
||||
serial_t scb;
|
||||
{
|
||||
if (scb->fd < 0)
|
||||
return;
|
||||
if (scb->ttystate != NULL)
|
||||
pclose ((FILE *) scb->ttystate);
|
||||
else
|
||||
close (scb->fd);
|
||||
scb->ttystate = NULL;
|
||||
scb->fd = -1;
|
||||
struct pipe_state *state = scb->state;
|
||||
if (state != NULL)
|
||||
{
|
||||
int pid = state->pid;
|
||||
close (scb->fd);
|
||||
scb->fd = -1;
|
||||
free (state);
|
||||
scb->state = NULL;
|
||||
kill (pid, SIGTERM);
|
||||
/* Might be useful to check that the child does die. */
|
||||
}
|
||||
}
|
||||
|
||||
static struct serial_ops pipe_ops =
|
||||
|
@ -29,6 +29,7 @@ struct _serial_t
|
||||
{
|
||||
int fd; /* File descriptor */
|
||||
struct serial_ops *ops; /* Function vector */
|
||||
void *state; /* Local context info for open FD */
|
||||
serial_ttystate ttystate; /* Not used (yet) */
|
||||
int bufcnt; /* Amount of data in receive buffer */
|
||||
unsigned char *bufp; /* Current byte */
|
||||
|
@ -962,7 +962,8 @@ target_preopen (from_tty)
|
||||
|
||||
if (target_has_execution)
|
||||
{
|
||||
if (query ("A program is being debugged already. Kill it? "))
|
||||
if (!from_tty
|
||||
|| query ("A program is being debugged already. Kill it? "))
|
||||
target_kill ();
|
||||
else
|
||||
error ("Program not killed.");
|
||||
|
@ -1,3 +1,19 @@
|
||||
Tue Jul 13 23:37:18 1999 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
|
||||
* gdb.base/configure.in: Check for gdbvars.exp instead of
|
||||
a1-selftest.exp.
|
||||
* gdb.base/configure: Re-generate.
|
||||
|
||||
1999-07-12 Stan Shebs <shebs@andros.cygnus.com>
|
||||
|
||||
* gdb.base/selftest.exp: Rename from a1-selftest.exp, no point
|
||||
in trying to run first and name is too long.
|
||||
|
||||
* gdb.base/pointers.c, gdb.base/pointers.exp: Add contents of
|
||||
pointers2.c and pointers2.exp, respectively.
|
||||
* gdb.base/pointers2.c, gdb.base/pointers2.exp: Remove, makes
|
||||
doschk happier.
|
||||
|
||||
1999-07-08 Stan Shebs <shebs@andros.cygnus.com>
|
||||
|
||||
* gdb.base/callfwmall.c, gdb.base/callfwmall.exp: Renamed from
|
||||
|
21
gdb/testsuite/gdb.base/configure
vendored
21
gdb/testsuite/gdb.base/configure
vendored
@ -1,7 +1,7 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated automatically using autoconf version 2.12.1
|
||||
# Generated automatically using autoconf version 2.13
|
||||
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
|
||||
#
|
||||
# This configure script is free software; the Free Software Foundation
|
||||
@ -333,7 +333,7 @@ EOF
|
||||
verbose=yes ;;
|
||||
|
||||
-version | --version | --versio | --versi | --vers)
|
||||
echo "configure generated by autoconf version 2.12.1"
|
||||
echo "configure generated by autoconf version 2.13"
|
||||
exit 0 ;;
|
||||
|
||||
-with-* | --with-*)
|
||||
@ -451,7 +451,7 @@ echo > confdefs.h
|
||||
|
||||
# A filename unique to this package, relative to the directory that
|
||||
# configure is in, which we can look for to find out if srcdir is correct.
|
||||
ac_unique_file=a1-selftest.exp
|
||||
ac_unique_file=gdbvars.exp
|
||||
|
||||
# Find the source files, if location was not specified.
|
||||
if test -z "$srcdir"; then
|
||||
@ -503,9 +503,11 @@ ac_ext=c
|
||||
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
|
||||
ac_cpp='$CPP $CPPFLAGS'
|
||||
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
|
||||
ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
|
||||
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
|
||||
cross_compiling=$ac_cv_prog_cc_cross
|
||||
|
||||
ac_exeext=
|
||||
ac_objext=o
|
||||
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
|
||||
# Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
|
||||
if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
|
||||
@ -569,7 +571,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
|
||||
fi
|
||||
|
||||
echo $ac_n "checking host system type""... $ac_c" 1>&6
|
||||
echo "configure:573: checking host system type" >&5
|
||||
echo "configure:575: checking host system type" >&5
|
||||
|
||||
host_alias=$host
|
||||
case "$host_alias" in
|
||||
@ -590,7 +592,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
|
||||
echo "$ac_t""$host" 1>&6
|
||||
|
||||
echo $ac_n "checking target system type""... $ac_c" 1>&6
|
||||
echo "configure:594: checking target system type" >&5
|
||||
echo "configure:596: checking target system type" >&5
|
||||
|
||||
target_alias=$target
|
||||
case "$target_alias" in
|
||||
@ -608,7 +610,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
|
||||
echo "$ac_t""$target" 1>&6
|
||||
|
||||
echo $ac_n "checking build system type""... $ac_c" 1>&6
|
||||
echo "configure:612: checking build system type" >&5
|
||||
echo "configure:614: checking build system type" >&5
|
||||
|
||||
build_alias=$build
|
||||
case "$build_alias" in
|
||||
@ -654,7 +656,7 @@ EOF
|
||||
# Ultrix sh set writes to stderr and can't be redirected directly,
|
||||
# and sets the high bit in the cache file unless we assign to the vars.
|
||||
(set) 2>&1 |
|
||||
case `(ac_space=' '; set) 2>&1 | grep ac_space` in
|
||||
case `(ac_space=' '; set | grep ac_space) 2>&1` in
|
||||
*ac_space=\ *)
|
||||
# `set' does not quote correctly, so add quotes (double-quote substitution
|
||||
# turns \\\\ into \\, and sed turns \\ into \).
|
||||
@ -733,7 +735,7 @@ do
|
||||
echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
|
||||
exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
|
||||
-version | --version | --versio | --versi | --vers | --ver | --ve | --v)
|
||||
echo "$CONFIG_STATUS generated by autoconf version 2.12.1"
|
||||
echo "$CONFIG_STATUS generated by autoconf version 2.13"
|
||||
exit 0 ;;
|
||||
-help | --help | --hel | --he | --h)
|
||||
echo "\$ac_cs_usage"; exit 0 ;;
|
||||
@ -756,6 +758,7 @@ s%@SHELL@%$SHELL%g
|
||||
s%@CFLAGS@%$CFLAGS%g
|
||||
s%@CPPFLAGS@%$CPPFLAGS%g
|
||||
s%@CXXFLAGS@%$CXXFLAGS%g
|
||||
s%@FFLAGS@%$FFLAGS%g
|
||||
s%@DEFS@%$DEFS%g
|
||||
s%@LDFLAGS@%$LDFLAGS%g
|
||||
s%@LIBS@%$LIBS%g
|
||||
|
@ -5,7 +5,7 @@ dnl script appropriate for this directory. For more information, check
|
||||
dnl any existing configure script.
|
||||
|
||||
AC_PREREQ(2.5)
|
||||
AC_INIT(a1-selftest.exp)
|
||||
AC_INIT(gdbvars.exp)
|
||||
|
||||
CC=${CC-cc}
|
||||
AC_SUBST(CC)
|
||||
|
@ -176,29 +176,41 @@ gdb_expect {
|
||||
}
|
||||
|
||||
send_gdb "maint print objfiles\n"
|
||||
|
||||
# To avoid timeouts, we avoid expects with many .* patterns that match
|
||||
# many lines.
|
||||
gdb_expect {
|
||||
-re ".*Object file.*break: Objfile at $hex, bfd at $hex, \[0-9\]* minsyms\[\r\t \]+\n"
|
||||
{ pass "maint print objfiles: header" }
|
||||
-re ".*$gdb_prompt $" { fail "maint print objfiles: header" }
|
||||
timeout { fail "(timeout) maint print objfiles: header" }
|
||||
# many lines. Instead, we keep track of which milestones we've seen
|
||||
# in the output, and stop when we've seen all of them.
|
||||
|
||||
set header 0
|
||||
set psymtabs 0
|
||||
set symtabs 0
|
||||
set keep_looking 1
|
||||
|
||||
while {$keep_looking} {
|
||||
gdb_expect {
|
||||
|
||||
-re ".*Object file.*break: Objfile at $hex, bfd at $hex, \[0-9\]* minsyms\[\r\t \]+\n" { set header 1 }
|
||||
-re ".*Psymtabs:\[\r\t \]+\n" { set psymtabs 1 }
|
||||
-re ".*Symtabs:\[\r\t \]+\n" { set symtabs 1 }
|
||||
|
||||
-re ".*$gdb_prompt $" {
|
||||
set keep_looking 0
|
||||
}
|
||||
timeout {
|
||||
fail "(timeout) maint print objfiles"
|
||||
set keep_looking 0
|
||||
}
|
||||
}
|
||||
}
|
||||
gdb_expect {
|
||||
-re ".*Psymtabs:\[\r\t \]+\n" { pass "maint print objfiles: psymtabs" }
|
||||
-re ".*$gdb_prompt $" { fail "maint print objfiles: psymtabs" }
|
||||
timeout { fail "(timeout) maint print objfiles: psymtabs" }
|
||||
}
|
||||
gdb_expect {
|
||||
-re ".*Symtabs:\[\r\t \]+\n" { pass "maint print objfiles: symtabs" }
|
||||
-re ".*$gdb_prompt $" { fail "maint print objfiles: symtabs" }
|
||||
timeout { fail "(timeout) maint print objfiles: symtabs" }
|
||||
}
|
||||
gdb_expect {
|
||||
-re ".*$gdb_prompt $" { pass "maint print objfiles: prompt" }
|
||||
timeout { fail "(timeout) maint print objfiles: prompt" }
|
||||
|
||||
proc maint_pass_if {val name} {
|
||||
if $val { pass $name } else { fail $name }
|
||||
}
|
||||
|
||||
maint_pass_if $header "maint print objfiles: header"
|
||||
maint_pass_if $psymtabs "maint print objfiles: psymtabs"
|
||||
maint_pass_if $symtabs "maint print objfiles: symtabs"
|
||||
|
||||
send_gdb "maint print psymbols\n"
|
||||
gdb_expect {
|
||||
-re "print-psymbols takes an output file name and optional symbol file name.*$gdb_prompt $"\
|
||||
@ -282,6 +294,13 @@ gdb_expect {
|
||||
timeout { fail "(timeout) maint print symbols w/o args" }
|
||||
}
|
||||
|
||||
# This command can legitimately take many minutes to execute. If the
|
||||
# executable is dynamically linked, then you get all the debugging
|
||||
# info for the entire library --- 89Mb on my system. -jimb
|
||||
|
||||
set old_timeout $timeout
|
||||
set timeout 600
|
||||
|
||||
send_gdb "maint print symbols symbols_output\n"
|
||||
gdb_expect {
|
||||
-re "^maint print symbols symbols_output\r\n$gdb_prompt $"\
|
||||
@ -291,7 +310,7 @@ gdb_expect {
|
||||
-re "symbols_output\r\n$gdb_prompt $"\
|
||||
{
|
||||
# See comments for `maint print psymbols'.
|
||||
send_gdb "shell grep 'main.*block' symbols_output\n"
|
||||
send_gdb "shell grep 'main(.*block' symbols_output\n"
|
||||
gdb_expect {
|
||||
-re "int main\\(int, char \\*\\*, char \\*\\*\\); block.*$gdb_prompt $"\
|
||||
{ pass "maint print symbols" }
|
||||
@ -309,6 +328,7 @@ gdb_expect {
|
||||
timeout { fail "(timeout) maint print symbols" }
|
||||
}
|
||||
|
||||
set timeout $old_timeout
|
||||
|
||||
send_gdb "maint print type argc\n"
|
||||
gdb_expect {
|
||||
@ -356,7 +376,9 @@ gdb_expect {
|
||||
}
|
||||
|
||||
# Try it again, and check for shlib event info. Not supported everywhere.
|
||||
if {! [istarget "hppa*-*-hpux*"]} then {
|
||||
if {! ([istarget "hppa*-*-hpux*"]
|
||||
|| [istarget "*-*-linux*"]
|
||||
|| [istarget "*-*-solaris*"])} then {
|
||||
setup_xfail "*-*-*"
|
||||
}
|
||||
send_gdb "maint info breakpoints\n"
|
||||
|
@ -97,7 +97,9 @@ int main ()
|
||||
v_unsigned_int_pointer = v_double_pointer;
|
||||
|
||||
v_unsigned_int_pointer = v_unsigned_int;*/
|
||||
|
||||
|
||||
more_code ();
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
@ -172,5 +174,49 @@ void dummy()
|
||||
|
||||
}
|
||||
|
||||
void marker1 ()
|
||||
{
|
||||
}
|
||||
|
||||
int more_code()
|
||||
{
|
||||
char C, *pC, **ppC, ***pppC, ****ppppC, *****pppppC, ******ppppppC;
|
||||
unsigned char UC, *pUC;
|
||||
short S, *pS;
|
||||
unsigned short US, *pUS;
|
||||
int I, *pI;
|
||||
unsigned int UI, *pUI;
|
||||
long L, *pL;
|
||||
unsigned long UL, *pUL;
|
||||
float F, *pF;
|
||||
double D, *pD;
|
||||
|
||||
C = 'A';
|
||||
UC = 21;
|
||||
S = -14;
|
||||
US = 7;
|
||||
I = 102;
|
||||
UI = 1002;
|
||||
L = -234;
|
||||
UL = 234;
|
||||
F = 1.25E10;
|
||||
D = -1.375E-123;
|
||||
pC = &C;
|
||||
ppC = &pC;
|
||||
pppC = &ppC;
|
||||
ppppC = &pppC;
|
||||
pppppC = &ppppC;
|
||||
ppppppC = &pppppC;
|
||||
pUC = &UC;
|
||||
pS = &S;
|
||||
pUS = &US;
|
||||
pI = &I;
|
||||
pUI = &UI;
|
||||
pL = &L;
|
||||
pUL = &UL;
|
||||
pF = &F;
|
||||
pD = &D;
|
||||
|
||||
marker1();
|
||||
return 0;
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ if ![runto_main] then {
|
||||
continue
|
||||
}
|
||||
|
||||
gdb_test "next" "return 0;" "continuing after dummy()"
|
||||
gdb_test "next" "" "continuing after dummy()"
|
||||
|
||||
|
||||
#
|
||||
@ -359,3 +359,233 @@ gdb_expect {
|
||||
-re ".*$gdb_prompt $" { fail "print through ptr to ptr" }
|
||||
timeout { fail "(timeout) print through ptr to ptr" }
|
||||
}
|
||||
|
||||
# tests for pointers
|
||||
# with elementary type variables and pointers.
|
||||
#
|
||||
|
||||
send_gdb "break marker1\n" ; gdb_expect -re ".*$gdb_prompt $"
|
||||
|
||||
send_gdb "cont\n"
|
||||
gdb_expect {
|
||||
-re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" {
|
||||
send_gdb "up\n"
|
||||
gdb_expect {
|
||||
-re ".*$gdb_prompt $" {}
|
||||
timeout { fail "up from marker1" }
|
||||
}
|
||||
}
|
||||
-re "$gdb_prompt $" { fail "continue to marker1" }
|
||||
timeout { fail "(timeout) continue to marker1" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "print *pUC\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 21 \'.025\'.*$gdb_prompt $" {
|
||||
pass "print value of *pUC"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of *pUC" }
|
||||
timeout { fail "(timeout) print value of *pUC" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "ptype pUC\n"
|
||||
gdb_expect {
|
||||
-re "type = unsigned char \\*.*$gdb_prompt $" { pass "ptype pUC" }
|
||||
-re ".*$gdb_prompt $" { fail "ptype pUC" }
|
||||
timeout { fail "(timeout) ptype pUC" }
|
||||
}
|
||||
|
||||
send_gdb "print *pS\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = -14.*$gdb_prompt $" {
|
||||
pass "print value of *pS"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of *pS" }
|
||||
timeout { fail "(timeout) print value of *pS" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "ptype pS\n"
|
||||
gdb_expect {
|
||||
-re "type = short \\*.*$gdb_prompt $" { pass "ptype pS" }
|
||||
-re "type = short int \\*.*$gdb_prompt $" { pass "ptype pS" }
|
||||
-re ".*$gdb_prompt $" { fail "ptype pS" }
|
||||
timeout { fail "(timeout) ptype pS" }
|
||||
}
|
||||
|
||||
send_gdb "print *pUS\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 7.*$gdb_prompt $" {
|
||||
pass "print value of *pUS"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of *pUS" }
|
||||
timeout { fail "(timeout) print value of *pUS" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "ptype pUS\n"
|
||||
gdb_expect {
|
||||
-re "type = unsigned short \\*.*$gdb_prompt $" { pass "ptype pUS" }
|
||||
-re "type = short unsigned int \\*.*$gdb_prompt $" { pass "ptype pUS" }
|
||||
-re ".*$gdb_prompt $" { fail "ptype pUS" }
|
||||
timeout { fail "(timeout) ptype pUS" }
|
||||
}
|
||||
|
||||
send_gdb "print *pI\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 102.*$gdb_prompt $" {
|
||||
pass "print value of *pI"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of *pI" }
|
||||
timeout { fail "(timeout) print value of *pI" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "ptype pI\n"
|
||||
gdb_expect {
|
||||
-re "type = int \\*.*$gdb_prompt $" { pass "ptype pI" }
|
||||
-re ".*$gdb_prompt $" { fail "ptype pI" }
|
||||
timeout { fail "(timeout) ptype pI" }
|
||||
}
|
||||
|
||||
send_gdb "print *pUI\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 1002.*$gdb_prompt $" {
|
||||
pass "print value of *pUI"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of *pUI" }
|
||||
timeout { fail "(timeout) print value of *pUI" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "ptype pUI\n"
|
||||
gdb_expect {
|
||||
-re "type = unsigned int \\*.*$gdb_prompt $" { pass "ptype pUI" }
|
||||
-re ".*$gdb_prompt $" { fail "ptype pUI" }
|
||||
timeout { fail "(timeout) ptype pUI" }
|
||||
}
|
||||
|
||||
send_gdb "print *pL\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = -234.*$gdb_prompt $" {
|
||||
pass "print value of *pL"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of *pL" }
|
||||
timeout { fail "(timeout) print value of *pL" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "ptype pL\n"
|
||||
gdb_expect {
|
||||
-re "type = long \\*.*$gdb_prompt $" { pass "ptype pL" }
|
||||
-re "type = long int \\*.*$gdb_prompt $" { pass "ptype pL" }
|
||||
-re ".*$gdb_prompt $" { fail "ptype pL" }
|
||||
timeout { fail "(timeout) ptype pL" }
|
||||
}
|
||||
|
||||
send_gdb "print *pUL\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 234.*$gdb_prompt $" {
|
||||
pass "print value of *pUL"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of *pUL" }
|
||||
timeout { fail "(timeout) print value of *pUL" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "ptype pUL\n"
|
||||
gdb_expect {
|
||||
-re "type = unsigned long \\*.*$gdb_prompt $" { pass "ptype pUL" }
|
||||
-re "type = long unsigned int \\*.*$gdb_prompt $" { pass "ptype pUL" }
|
||||
-re ".*$gdb_prompt $" { fail "ptype pUL" }
|
||||
timeout { fail "(timeout) ptype pUL" }
|
||||
}
|
||||
|
||||
send_gdb "print *pF\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 1.2\[0-9\]*e\\+10.*$gdb_prompt $" {
|
||||
pass "print value of *pF"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of *pF" }
|
||||
timeout { fail "(timeout) print value of *pF" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "ptype pF\n"
|
||||
gdb_expect {
|
||||
-re "type = float \\*.*$gdb_prompt $" { pass "ptype pF" }
|
||||
-re ".*$gdb_prompt $" { fail "ptype pF" }
|
||||
timeout { fail "(timeout) ptype pF" }
|
||||
}
|
||||
|
||||
send_gdb "print *pD\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = -1.375e-123.*$gdb_prompt $" {
|
||||
pass "print value of *pD"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of *pD" }
|
||||
timeout { fail "(timeout) print value of *pD" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "ptype pD\n"
|
||||
gdb_expect {
|
||||
-re "type = double \\*.*$gdb_prompt $" { pass "ptype pD" }
|
||||
-re ".*$gdb_prompt $" { fail "ptype pD" }
|
||||
timeout { fail "(timeout) ptype pD" }
|
||||
}
|
||||
|
||||
send_gdb "print ******ppppppC\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]* = 65 \'A\'.*$gdb_prompt $" {
|
||||
pass "print value of ******ppppppC"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "print value of ******ppppppC" }
|
||||
timeout { fail "(timeout) print value of ******ppppppC" }
|
||||
}
|
||||
|
||||
|
||||
send_gdb "ptype pC\n"
|
||||
gdb_expect {
|
||||
-re "type = char \\*.*$gdb_prompt $" { pass "ptype pC" }
|
||||
-re ".*$gdb_prompt $" { fail "ptype pC" }
|
||||
timeout { fail "(timeout) ptype pC" }
|
||||
}
|
||||
|
||||
send_gdb "ptype ppC\n"
|
||||
gdb_expect {
|
||||
-re "type = char \\*\\*.*$gdb_prompt $" { pass "ptype ppC" }
|
||||
-re ".*$gdb_prompt $" { fail "ptype ppC" }
|
||||
timeout { fail "(timeout) ptype ppC" }
|
||||
}
|
||||
|
||||
send_gdb "ptype pppC\n"
|
||||
gdb_expect {
|
||||
-re "type = char \\*\\*\\*.*$gdb_prompt $" { pass "ptype pppC" }
|
||||
-re ".*$gdb_prompt $" { fail "ptype pppC" }
|
||||
timeout { fail "(timeout) ptype pppC" }
|
||||
}
|
||||
|
||||
send_gdb "ptype ppppC\n"
|
||||
gdb_expect {
|
||||
-re "type = char \\*\\*\\*\\*.*$gdb_prompt $" { pass "ptype ppppC" }
|
||||
-re ".*$gdb_prompt $" { fail "ptype ppppC" }
|
||||
timeout { fail "(timeout) ptype ppppC" }
|
||||
}
|
||||
|
||||
send_gdb "ptype pppppC\n"
|
||||
gdb_expect {
|
||||
-re "type = char \\*\\*\\*\\*\\*.*$gdb_prompt $" { pass "ptype pppppC" }
|
||||
-re ".*$gdb_prompt $" { fail "ptype pppppC" }
|
||||
timeout { fail "(timeout) ptype pppppC" }
|
||||
}
|
||||
|
||||
send_gdb "ptype ppppppC\n"
|
||||
gdb_expect {
|
||||
-re "type = char \\*\\*\\*\\*\\*\\*.*$gdb_prompt $" { pass "ptype ppppppC" }
|
||||
-re ".*$gdb_prompt $" { fail "ptype ppppppC" }
|
||||
timeout { fail "(timeout) ptype ppppppC" }
|
||||
}
|
||||
|
||||
|
430
gdb/testsuite/gdb.base/selftest.exp
Normal file
430
gdb/testsuite/gdb.base/selftest.exp
Normal file
@ -0,0 +1,430 @@
|
||||
# Copyright (C) 1988, 1990, 1991, 1992, 1994, 1997 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# Please email any bugs, comments, and/or additions to this file to:
|
||||
# bug-gdb@prep.ai.mit.edu
|
||||
|
||||
# This file was written by Rob Savoye. (rob@cygnus.com)
|
||||
|
||||
if $tracelevel then {
|
||||
strace $tracelevel
|
||||
}
|
||||
|
||||
set prms_id 0
|
||||
set bug_id 0
|
||||
|
||||
# are we on a target board
|
||||
if [is_remote target] {
|
||||
return
|
||||
}
|
||||
|
||||
if [istarget "m68k*-*-hpux*"] then {
|
||||
# The top-level makefile passes CFLAGS= (no -g) for hp300. This probably
|
||||
# should be fixed (it is only needed for gcc bootstrapping, not gdb),
|
||||
# but until then.....
|
||||
setup_xfail "*-*-*"
|
||||
fail "cannot test self if compiled without debug info"
|
||||
return -1
|
||||
}
|
||||
|
||||
# Not all of the lines of code near the start of main are executed for
|
||||
# every machine. Also, optimization may reorder some of the lines.
|
||||
# So all we do is try to step or next over everything until we get
|
||||
# to a line that we know is always executed.
|
||||
|
||||
proc do_steps_and_nexts {} {
|
||||
global gdb_prompt
|
||||
global srcdir
|
||||
|
||||
gdb_reinitialize_dir $srcdir/..
|
||||
|
||||
for {set count 0} {$count < 20} {incr count} {
|
||||
send_gdb "list\n"
|
||||
gdb_expect {
|
||||
-re ".*symarg = NULL.*$gdb_prompt $" {
|
||||
set description "step over symarg initialization"
|
||||
set command "step"
|
||||
}
|
||||
-re ".*execarg = NULL.*$gdb_prompt $" {
|
||||
set description "step over execarg initialization"
|
||||
set command "step"
|
||||
}
|
||||
-re ".*corearg = NULL.*$gdb_prompt $" {
|
||||
set description "step over corearg initialization"
|
||||
set command "step"
|
||||
}
|
||||
-re ".*cdarg = NULL.*$gdb_prompt $" {
|
||||
set description "step over cdarg initialization"
|
||||
set command "step"
|
||||
}
|
||||
-re ".*ttyarg = NULL.*$gdb_prompt $" {
|
||||
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"
|
||||
}
|
||||
-re ".*START_PROGRESS.*$gdb_prompt $" {
|
||||
set description "next over START_PROGRESS and everything it calls"
|
||||
set command "next"
|
||||
}
|
||||
-re ".*mac_init.*$gdb_prompt $" {
|
||||
set description "next over mac_init and everything it calls"
|
||||
set command "next"
|
||||
}
|
||||
-re ".*init_malloc.*$gdb_prompt $" {
|
||||
set description "next over init_malloc and everything it calls"
|
||||
set command "next"
|
||||
}
|
||||
-re ".*count . 0x3.*$gdb_prompt $" {
|
||||
set description "next over conditional stack alignment code 1"
|
||||
set command "next"
|
||||
}
|
||||
-re ".*if .i != 0.*$gdb_prompt $" {
|
||||
set description "next over conditional stack alignment code 2"
|
||||
set command "next"
|
||||
}
|
||||
-re ".*alloca .i - 4.*$gdb_prompt $" {
|
||||
set description "next over conditional stack alignment alloca"
|
||||
set command "next"
|
||||
}
|
||||
-re ".*SET_TOP_LEVEL.*$gdb_prompt $" {
|
||||
set description "next over SET_TOP_LEVEL call"
|
||||
set command "next"
|
||||
}
|
||||
-re ".*cmdsize = 1.*$gdb_prompt $" {
|
||||
set description "step over cmdsize initialization"
|
||||
set command "next"
|
||||
}
|
||||
-re ".*cmdarg = .* xmalloc.*$gdb_prompt $" {
|
||||
set description "next over cmdarg initialization via xmalloc"
|
||||
set command "next"
|
||||
}
|
||||
-re ".*ncmd = 0.*$gdb_prompt $" {
|
||||
set description "next over ncmd initialization"
|
||||
set command "next"
|
||||
}
|
||||
-re ".*dirsize = 1.*$gdb_prompt $" {
|
||||
set description "next over dirsize initialization"
|
||||
set command "next"
|
||||
}
|
||||
-re ".*dirarg = .* xmalloc.*$gdb_prompt $" {
|
||||
return
|
||||
}
|
||||
-re "\[ \t\]+\{\r\n$gdb_prompt $" {
|
||||
setup_xfail "mips-*-irix5*"
|
||||
fail "$description ended up at odd location"
|
||||
}
|
||||
-re ".*main.c.*No such file or directory.*$gdb_prompt $" {
|
||||
setup_xfail "rs6000-*-aix3*"
|
||||
fail "must be able to list source lines"
|
||||
return
|
||||
}
|
||||
-re ".*$gdb_prompt $" {
|
||||
fail "unknown source line after $description"
|
||||
return
|
||||
}
|
||||
default {
|
||||
fail "unknown source line near main"
|
||||
return
|
||||
}
|
||||
}
|
||||
send_gdb "$command\n"
|
||||
gdb_expect {
|
||||
-re ".*No such file or directory.\r\n$gdb_prompt $" {
|
||||
fail "$description (no source available)"
|
||||
}
|
||||
-re ".*A file or directory .* does not exist..\r\n$gdb_prompt $" {
|
||||
fail "$description (no source available)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" {
|
||||
pass "$description"
|
||||
}
|
||||
timeout {
|
||||
fail "$description (timeout)"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
proc test_with_self { executable } {
|
||||
global gdb_prompt
|
||||
global tool
|
||||
global det_file
|
||||
global decimal
|
||||
global timeout
|
||||
|
||||
# load yourself into the debugger
|
||||
# This can take a relatively long time, particularly for testing where
|
||||
# the executable is being accessed over a network, or where gdb does not
|
||||
# support partial symbols for a particular target and has to load the
|
||||
# entire symbol table. Set the timeout to 10 minutes, which should be
|
||||
# adequate for most environments (it *has* timed out with 5 min on a
|
||||
# SPARCstation SLC under moderate load, so this isn't unreasonable).
|
||||
# After gdb is started, set the timeout to 30 seconds for the duration
|
||||
# of this test, and then back to the original value.
|
||||
|
||||
set oldtimeout $timeout
|
||||
set timeout 600
|
||||
verbose "Timeout is now $timeout seconds" 2
|
||||
if {[gdb_load $executable] <0} then {
|
||||
set timeout $oldtimeout
|
||||
verbose "Timeout is now $timeout seconds" 2
|
||||
return -1
|
||||
}
|
||||
set timeout $oldtimeout
|
||||
verbose "Timeout is now $timeout seconds" 2
|
||||
|
||||
# disassemble yourself
|
||||
gdb_test "x/10i main" \
|
||||
"x/10i.*main.*main.$decimal.*main.$decimal.*" \
|
||||
"Disassemble main"
|
||||
|
||||
# Set a breakpoint at main
|
||||
gdb_test "break main" \
|
||||
"Breakpoint.*at.* file.*, line.*" \
|
||||
"breakpoint in main"
|
||||
|
||||
# We'll need this when we send a ^C to GDB. Need to do it before we
|
||||
# run the program and gdb starts saving and restoring tty states.
|
||||
# On Ultrix, we don't need it and it is really slow (because shell_escape
|
||||
# doesn't use vfork).
|
||||
if ![istarget "*-*-ultrix*"] then {
|
||||
gdb_test "shell stty intr '^C'" "" \
|
||||
"set interrupt character in test_with_self"
|
||||
}
|
||||
|
||||
# FIXME: If we put this after the run to main, the first list
|
||||
# command doesn't print the same line as the current line where
|
||||
# gdb is stopped.
|
||||
gdb_test "set listsize 1" "" "set listsize to 1"
|
||||
|
||||
# run yourself
|
||||
# It may take a very long time for the inferior gdb to start (lynx),
|
||||
# so we bump it back up for the duration of this command.
|
||||
set timeout 600
|
||||
|
||||
set description "run until breakpoint at main"
|
||||
send_gdb "run -nw\n"
|
||||
gdb_expect {
|
||||
-re "Starting program.*Breakpoint \[0-9\]+,.*main .argc.*argv.* at .*main.c:.*$gdb_prompt $" {
|
||||
pass "$description"
|
||||
}
|
||||
-re "Starting program.*Breakpoint \[0-9\]+,.*main .argc.*argv.*$gdb_prompt $" {
|
||||
xfail "$description (line numbers scrambled?)"
|
||||
}
|
||||
-re "vfork: No more processes.*$gdb_prompt $" {
|
||||
fail "$description (out of virtual memory)"
|
||||
set timeout $oldtimeout
|
||||
verbose "Timeout is now $timeout seconds" 2
|
||||
return -1
|
||||
}
|
||||
-re ".*$gdb_prompt $" {
|
||||
fail "$description"
|
||||
set timeout $oldtimeout
|
||||
verbose "Timeout is now $timeout seconds" 2
|
||||
return -1
|
||||
}
|
||||
timeout {
|
||||
fail "$description (timeout)"
|
||||
}
|
||||
}
|
||||
|
||||
set timeout $oldtimeout
|
||||
verbose "Timeout is now $timeout seconds" 2
|
||||
|
||||
# do we have a version number ?
|
||||
send_gdb "print version\n"
|
||||
gdb_expect {
|
||||
-re ".\[0-9\]+ = +0x.*\[0-9.\]+.*$gdb_prompt $" {
|
||||
pass "printed version"
|
||||
}
|
||||
-re ".\[0-9\]+ = +.+ +0x.*\[0-9.\]+.*$gdb_prompt $" {
|
||||
pass "printed version with cast"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "printed version" }
|
||||
timeout { fail "(timeout) printed version" }
|
||||
}
|
||||
|
||||
do_steps_and_nexts
|
||||
|
||||
gdb_test "print \"foo\"" ".\[0-9\]+ = \"foo\"" "print a string"
|
||||
|
||||
# do_steps_and_nexts left us ready to execute an xmalloc call,
|
||||
# so give that a try.
|
||||
# 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-*-*" "mips-*-*"
|
||||
set description "step into xmalloc call"
|
||||
send_gdb "step\n"
|
||||
gdb_expect {
|
||||
-re "xmalloc.*size=.*at.*utils.c.*$gdb_prompt $" {
|
||||
pass "$description"
|
||||
}
|
||||
-re ".*No such file or directory.\r\n$gdb_prompt $" {
|
||||
pass "$description (no source available)"
|
||||
}
|
||||
-re "A file or directory .* does not exist..\r\n$gdb_prompt $" {
|
||||
pass "$description (no source available)"
|
||||
}
|
||||
-re ".*$gdb_prompt $" {
|
||||
fail "$description"
|
||||
}
|
||||
timeout {
|
||||
fail "$description (timeout)"
|
||||
}
|
||||
}
|
||||
|
||||
# start the "xgdb" process
|
||||
send_gdb "continue\n"
|
||||
gdb_expect {
|
||||
-re "GNU gdb \[0-9\.\]*.*
|
||||
Copyright \[0-9\]* Free Software Foundation, Inc.*
|
||||
GDB is free software, covered by the GNU General Public License, and you are.*
|
||||
welcome to change it and/or distribute copies of it under certain conditions.*
|
||||
Type \"show copying\" to see the conditions.*
|
||||
There is absolutely no warranty for GDB. Type \"show warranty\" for details.*
|
||||
This GDB was configured as .*$gdb_prompt $"\
|
||||
{ pass "xgdb is at prompt" }
|
||||
-re "GDB is free software and you are welcome to distribute copies of it.*
|
||||
under certain conditions; type \"show copying\" to see the conditions..*
|
||||
There is absolutely no warranty for GDB; type \"show warranty\" for details..*
|
||||
GDB.*Copyright \[0-9\]+ Free Software Foundation, Inc..*$gdb_prompt $"\
|
||||
{ pass "xgdb is at prompt (obsolescent gdb)" }
|
||||
-re ".*$gdb_prompt $" { fail "xgdb is at prompt" }
|
||||
timeout { fail "(timeout) xgdb is at prompt" }
|
||||
}
|
||||
|
||||
# set xgdb prompt so we can tell which is which
|
||||
send_gdb "set prompt (xgdb) \n"
|
||||
gdb_expect {
|
||||
-re "\[(\]xgdb\[)\].*\[(\]xgdb\[)\] $" { pass "Set xgdb prompt" }
|
||||
-re ".*$gdb_prompt $" { fail "Set xgdb prompt" }
|
||||
default { fail "(timeout) Set xgdb prompt" }
|
||||
}
|
||||
|
||||
# kill the xgdb process
|
||||
set description "send ^C to child process"
|
||||
send_gdb "\003"
|
||||
gdb_expect {
|
||||
-re "Program received signal SIGINT.*$gdb_prompt $" {
|
||||
pass "$description"
|
||||
}
|
||||
-re ".*$gdb_prompt $" {
|
||||
fail "$description"
|
||||
}
|
||||
timeout {
|
||||
fail "$description (timeout)"
|
||||
}
|
||||
}
|
||||
|
||||
set description "send SIGINT signal to child process"
|
||||
send_gdb "signal SIGINT\n"
|
||||
gdb_expect {
|
||||
-re "Continuing with signal SIGINT.*$gdb_prompt $" {
|
||||
pass "$description"
|
||||
}
|
||||
-re ".*$gdb_prompt $" {
|
||||
fail "$description"
|
||||
}
|
||||
timeout {
|
||||
fail "$description (timeout)"
|
||||
}
|
||||
}
|
||||
|
||||
# get a stack trace
|
||||
#
|
||||
# This fails on some linux systems for unknown reasons. On the
|
||||
# systems where it fails, sometimes it works fine when run manually.
|
||||
# The testsuite failures may not be limited to just aout systems.
|
||||
setup_xfail "i*86-pc-linuxaout-gnu" "hppa*-*-hpux*"
|
||||
set description "backtrace through signal handler"
|
||||
send_gdb "backtrace\n"
|
||||
gdb_expect {
|
||||
-re "#0.*read.*in main \\(.*\\) at .*main\\.c.*$gdb_prompt $" {
|
||||
pass "$description"
|
||||
}
|
||||
-re ".*$gdb_prompt $" {
|
||||
# On the alpha, we hit the infamous problem about gdb
|
||||
# being unable to get the frame pointer (mentioned in
|
||||
# gdb/README). As it is intermittent, there is no way to
|
||||
# XFAIL it which will give us an XPASS if the problem goes
|
||||
# away.
|
||||
setup_xfail "alpha*-*-osf*"
|
||||
fail "$description"
|
||||
}
|
||||
timeout {
|
||||
fail "$description (timeout)"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Set the timeout back to the value it had when we were called.
|
||||
set timeout $oldtimeout
|
||||
verbose "Timeout is now $timeout seconds" 2
|
||||
|
||||
# Restart gdb in case next test expects it to be started already.
|
||||
return 0
|
||||
}
|
||||
|
||||
# Find a pathname to a file that we would execute if the shell was asked
|
||||
# to run $arg using the current PATH.
|
||||
|
||||
proc find_gdb { arg } {
|
||||
|
||||
# If the arg directly specifies an existing executable file, then
|
||||
# simply use it.
|
||||
|
||||
if [file executable $arg] then {
|
||||
return $arg
|
||||
}
|
||||
|
||||
set result [which $arg]
|
||||
if [string match "/" [ string range $result 0 0 ]] then {
|
||||
return $result
|
||||
}
|
||||
|
||||
# If everything fails, just return the unqualified pathname as default
|
||||
# and hope for best.
|
||||
|
||||
return $arg
|
||||
}
|
||||
|
||||
# Run the test with self.
|
||||
# Copy the file executable file in case this OS doesn't like to edit its own
|
||||
# text space.
|
||||
|
||||
set GDB_FULLPATH [find_gdb $GDB]
|
||||
|
||||
# Remove any old copy lying around.
|
||||
remote_file host delete x$tool
|
||||
|
||||
gdb_start
|
||||
set file [remote_download host $GDB_FULLPATH x$tool]
|
||||
set result [test_with_self $file];
|
||||
gdb_exit;
|
||||
catch "remote_file host delete $file";
|
||||
|
||||
if {$result <0} then {
|
||||
warning "Couldn't test self"
|
||||
return -1
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
# Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1998, 1999 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -265,6 +265,10 @@ gdb_expect {
|
||||
|
||||
send_gdb "print g_instance.a\n"
|
||||
gdb_expect {
|
||||
-re "warning.*$gdb_prompt $" {
|
||||
# The compiler doesn't think this is ambiguous.
|
||||
fail "print value of g_instance.a"
|
||||
}
|
||||
-re ".\[0-9\]* = 15.*$gdb_prompt $" {
|
||||
pass "print value of g_instance.a"
|
||||
}
|
||||
@ -274,6 +278,10 @@ gdb_expect {
|
||||
|
||||
send_gdb "print g_instance.b\n"
|
||||
gdb_expect {
|
||||
-re "warning.*$gdb_prompt $" {
|
||||
# The compiler doesn't think this is ambiguous.
|
||||
fail "print value of g_instance.b"
|
||||
}
|
||||
-re ".\[0-9\]* = 16.*$gdb_prompt $" {
|
||||
pass "print value of g_instance.b"
|
||||
}
|
||||
@ -283,6 +291,10 @@ gdb_expect {
|
||||
|
||||
send_gdb "print g_instance.c\n"
|
||||
gdb_expect {
|
||||
-re "warning.*$gdb_prompt $" {
|
||||
# The compiler doesn't think this is ambiguous.
|
||||
fail "print value of g_instance.c"
|
||||
}
|
||||
-re ".\[0-9\]* = 17.*$gdb_prompt $" {
|
||||
pass "print value of g_instance.c"
|
||||
}
|
||||
|
@ -1,3 +1,10 @@
|
||||
1999-07-13 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
|
||||
|
||||
* acconfig.h: Fix typo: it's GWINSZ_IN_SYS_IOCTL, not
|
||||
TIOCGWINSZ_IN_SYS_IOCTL.
|
||||
|
||||
* config.h.in: Regenerate with autoheader.
|
||||
|
||||
1999-04-27 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
|
||||
|
||||
* ChangeLog.Cygnus: new file. It is the old Changelog.
|
||||
|
@ -1,3 +1,13 @@
|
||||
Fri Jul 16 14:47:53 1999 Dave Brolley <brolley@cygnus.com>
|
||||
|
||||
* cgen-utils.c (RORSI): New function.
|
||||
(ROLSI): New function.
|
||||
|
||||
1999-07-14 Doug Evans <devans@casey.cygnus.com>
|
||||
|
||||
* Makefile.in (TAGS): Tweak TAGS regex.
|
||||
* cgen-mem.h (*): Add TAGS markers.
|
||||
|
||||
Sun Jul 11 23:47:20 1999 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
|
||||
* sim-resume.c (sim_resume): Ensure that the siggnal [sic] is only
|
||||
|
@ -103,8 +103,8 @@ tags etags: TAGS
|
||||
# And the sim-n-foo.h files create functions that can't be found either.
|
||||
TAGS: force
|
||||
cd $(srcdir) && \
|
||||
etags --regex '/^\([a-z_]+\) (/\1/' --regex '/^\/[*] TAGS: .*/' \
|
||||
*.[ch]
|
||||
etags --regex '/^\([a-z_]+\) (/\1/' --regex '/^.*\/[*] TAGS: .*/' \
|
||||
*.c *.h
|
||||
|
||||
clean:
|
||||
rm -f *.[oa] *~ core
|
||||
|
@ -47,14 +47,14 @@ XCONCAT2 (GETMEM,mode) (SIM_CPU *cpu, IADDR pc, ADDR a) \
|
||||
extern mode XCONCAT2 (GETMEM,mode) (SIM_CPU *, IADDR, ADDR);
|
||||
#endif
|
||||
|
||||
DECLARE_GETMEM (QI, 1)
|
||||
DECLARE_GETMEM (UQI, 1)
|
||||
DECLARE_GETMEM (HI, 2)
|
||||
DECLARE_GETMEM (UHI, 2)
|
||||
DECLARE_GETMEM (SI, 4)
|
||||
DECLARE_GETMEM (USI, 4)
|
||||
DECLARE_GETMEM (DI, 8)
|
||||
DECLARE_GETMEM (UDI, 8)
|
||||
DECLARE_GETMEM (QI, 1) /* TAGS: GETMEMQI */
|
||||
DECLARE_GETMEM (UQI, 1) /* TAGS: GETMEMUQI */
|
||||
DECLARE_GETMEM (HI, 2) /* TAGS: GETMEMHI */
|
||||
DECLARE_GETMEM (UHI, 2) /* TAGS: GETMEMUHI */
|
||||
DECLARE_GETMEM (SI, 4) /* TAGS: GETMEMSI */
|
||||
DECLARE_GETMEM (USI, 4) /* TAGS: GETMEMUSI */
|
||||
DECLARE_GETMEM (DI, 8) /* TAGS: GETMEMDI */
|
||||
DECLARE_GETMEM (UDI, 8) /* TAGS: GETMEMUDI */
|
||||
|
||||
#undef DECLARE_GETMEM
|
||||
|
||||
@ -74,14 +74,14 @@ XCONCAT2 (SETMEM,mode) (SIM_CPU *cpu, IADDR pc, ADDR a, mode val) \
|
||||
extern void XCONCAT2 (SETMEM,mode) (SIM_CPU *, IADDR, ADDR, mode);
|
||||
#endif
|
||||
|
||||
DECLARE_SETMEM (QI, 1)
|
||||
DECLARE_SETMEM (UQI, 1)
|
||||
DECLARE_SETMEM (HI, 2)
|
||||
DECLARE_SETMEM (UHI, 2)
|
||||
DECLARE_SETMEM (SI, 4)
|
||||
DECLARE_SETMEM (USI, 4)
|
||||
DECLARE_SETMEM (DI, 8)
|
||||
DECLARE_SETMEM (UDI, 8)
|
||||
DECLARE_SETMEM (QI, 1) /* TAGS: SETMEMQI */
|
||||
DECLARE_SETMEM (UQI, 1) /* TAGS: SETMEMUQI */
|
||||
DECLARE_SETMEM (HI, 2) /* TAGS: SETMEMHI */
|
||||
DECLARE_SETMEM (UHI, 2) /* TAGS: SETMEMUHI */
|
||||
DECLARE_SETMEM (SI, 4) /* TAGS: SETMEMSI */
|
||||
DECLARE_SETMEM (USI, 4) /* TAGS: SETMEMUSI */
|
||||
DECLARE_SETMEM (DI, 8) /* TAGS: SETMEMDI */
|
||||
DECLARE_SETMEM (UDI, 8) /* TAGS: SETMEMUDI */
|
||||
|
||||
#undef DECLARE_SETMEM
|
||||
|
||||
@ -101,10 +101,10 @@ XCONCAT2 (GETIMEM,mode) (SIM_CPU *cpu, IADDR a) \
|
||||
extern mode XCONCAT2 (GETIMEM,mode) (SIM_CPU *, ADDR);
|
||||
#endif
|
||||
|
||||
DECLARE_GETIMEM (UQI, 1)
|
||||
DECLARE_GETIMEM (UHI, 2)
|
||||
DECLARE_GETIMEM (USI, 4)
|
||||
DECLARE_GETIMEM (UDI, 8)
|
||||
DECLARE_GETIMEM (UQI, 1) /* TAGS: GETIMEMUQI */
|
||||
DECLARE_GETIMEM (UHI, 2) /* TAGS: GETIMEMUHI */
|
||||
DECLARE_GETIMEM (USI, 4) /* TAGS: GETIMEMUSI */
|
||||
DECLARE_GETIMEM (UDI, 8) /* TAGS: GETIMEMUDI */
|
||||
|
||||
#undef DECLARE_GETIMEM
|
||||
|
||||
@ -132,8 +132,8 @@ XCONCAT2 (GETMEM,mode) (SIM_CPU *cpu, IADDR pc, ADDR a) \
|
||||
extern mode XCONCAT2 (GETMEM,mode) (SIM_CPU *, IADDR, ADDR);
|
||||
#endif
|
||||
|
||||
DECLARE_GETMEM (SF, 4)
|
||||
DECLARE_GETMEM (DF, 8)
|
||||
DECLARE_GETMEM (SF, 4) /* TAGS: GETMEMSF */
|
||||
DECLARE_GETMEM (DF, 8) /* TAGS: GETMEMDF */
|
||||
|
||||
#undef DECLARE_GETMEM
|
||||
|
||||
@ -151,8 +151,8 @@ XCONCAT2 (SETMEM,mode) (SIM_CPU *cpu, IADDR pc, ADDR a, mode val) \
|
||||
extern void XCONCAT2 (SETMEM,mode) (SIM_CPU *, IADDR, ADDR, mode);
|
||||
#endif
|
||||
|
||||
DECLARE_SETMEM (SF, 4)
|
||||
DECLARE_SETMEM (DF, 8)
|
||||
DECLARE_SETMEM (SF, 4) /* TAGS: SETMEMSF */
|
||||
DECLARE_SETMEM (DF, 8) /* TAGS: SETMEMDF */
|
||||
|
||||
#undef DECLARE_SETMEM
|
||||
|
||||
@ -174,20 +174,20 @@ XCONCAT2 (GETT,mode) (unsigned char *p) \
|
||||
extern mode XCONCAT2 (GETT,mode) (unsigned char *);
|
||||
#endif
|
||||
|
||||
DECLARE_GETT (QI, 1)
|
||||
DECLARE_GETT (UQI, 1)
|
||||
DECLARE_GETT (HI, 2)
|
||||
DECLARE_GETT (UHI, 2)
|
||||
DECLARE_GETT (SI, 4)
|
||||
DECLARE_GETT (USI, 4)
|
||||
DECLARE_GETT (DI, 8)
|
||||
DECLARE_GETT (UDI, 8)
|
||||
DECLARE_GETT (QI, 1) /* TAGS: GETTQI */
|
||||
DECLARE_GETT (UQI, 1) /* TAGS: GETTUQI */
|
||||
DECLARE_GETT (HI, 2) /* TAGS: GETTHI */
|
||||
DECLARE_GETT (UHI, 2) /* TAGS: GETTUHI */
|
||||
DECLARE_GETT (SI, 4) /* TAGS: GETTSI */
|
||||
DECLARE_GETT (USI, 4) /* TAGS: GETTUSI */
|
||||
DECLARE_GETT (DI, 8) /* TAGS: GETTDI */
|
||||
DECLARE_GETT (UDI, 8) /* TAGS: GETTUDI */
|
||||
|
||||
/* ??? defered until necessary
|
||||
DECLARE_GETT (SF, 4)
|
||||
DECLARE_GETT (DF, 8)
|
||||
DECLARE_GETT (TF, 16)
|
||||
*/
|
||||
#if 0 /* ??? defered until necessary */
|
||||
DECLARE_GETT (SF, 4) /* TAGS: GETTSF */
|
||||
DECLARE_GETT (DF, 8) /* TAGS: GETTDF */
|
||||
DECLARE_GETT (TF, 16) /* TAGS: GETTTF */
|
||||
#endif
|
||||
|
||||
#undef DECLARE_GETT
|
||||
|
||||
@ -209,20 +209,20 @@ XCONCAT2 (SETT,mode) (unsigned char *buf, mode val) \
|
||||
extern mode XCONCAT2 (GETT,mode) (unsigned char *, mode);
|
||||
#endif
|
||||
|
||||
DECLARE_SETT (QI, 1)
|
||||
DECLARE_SETT (UQI, 1)
|
||||
DECLARE_SETT (HI, 2)
|
||||
DECLARE_SETT (UHI, 2)
|
||||
DECLARE_SETT (SI, 4)
|
||||
DECLARE_SETT (USI, 4)
|
||||
DECLARE_SETT (DI, 8)
|
||||
DECLARE_SETT (UDI, 8)
|
||||
DECLARE_SETT (QI, 1) /* TAGS: SETTQI */
|
||||
DECLARE_SETT (UQI, 1) /* TAGS: SETTUQI */
|
||||
DECLARE_SETT (HI, 2) /* TAGS: SETTHI */
|
||||
DECLARE_SETT (UHI, 2) /* TAGS: SETTUHI */
|
||||
DECLARE_SETT (SI, 4) /* TAGS: SETTSI */
|
||||
DECLARE_SETT (USI, 4) /* TAGS: SETTUSI */
|
||||
DECLARE_SETT (DI, 8) /* TAGS: SETTDI */
|
||||
DECLARE_SETT (UDI, 8) /* TAGS: SETTUDI */
|
||||
|
||||
/* ??? defered until necessary
|
||||
DECLARE_SETT (SF, 4)
|
||||
DECLARE_SETT (DF, 8)
|
||||
DECLARE_SETT (TF, 16)
|
||||
*/
|
||||
#if 0 /* ??? defered until necessary */
|
||||
DECLARE_SETT (SF, 4) /* TAGS: SETTSF */
|
||||
DECLARE_SETT (DF, 8) /* TAGS: SETTDF */
|
||||
DECLARE_SETT (TF, 16) /* TAGS: SETTTF */
|
||||
#endif
|
||||
|
||||
#undef DECLARE_SETT
|
||||
|
||||
|
@ -320,3 +320,38 @@ CONVDISI (val)
|
||||
}
|
||||
|
||||
#endif /* DI_FN_SUPPORT */
|
||||
|
||||
SI
|
||||
RORSI (val, shift)
|
||||
SI val;
|
||||
int shift;
|
||||
{
|
||||
if (shift != 0)
|
||||
{
|
||||
int remain = 32 - shift;
|
||||
int mask = (1 << shift) - 1;
|
||||
SI result = (val & mask) << remain;
|
||||
mask = (1 << remain) - 1;
|
||||
result |= (val >> shift) & mask;
|
||||
return result;
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
SI
|
||||
ROLSI (val, shift)
|
||||
SI val;
|
||||
int shift;
|
||||
{
|
||||
if (shift != 0)
|
||||
{
|
||||
int remain = 32 - shift;
|
||||
int mask = (1 << remain) - 1;
|
||||
SI result = (val & mask) << shift;
|
||||
mask = (1 << shift) - 1;
|
||||
result |= (val >> remain) & mask;
|
||||
return result;
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
|
@ -1,3 +1,18 @@
|
||||
1999-07-14 Frank Ch. Eigler <fche@cygnus.com>
|
||||
|
||||
Implement "sim firmware" option, inspired by jimb's version of 1998-01.
|
||||
* interp.c (firmware_option_p): New global flag: "sim firmware" given.
|
||||
(idt_monitor_base): Base address for IDT monitor traps.
|
||||
(pmon_monitor_base): Ditto for PMON.
|
||||
(lsipmon_monitor_base): Ditto for LSI PMON.
|
||||
(MONITOR_BASE, MONITOR_SIZE): Removed macros.
|
||||
(mips_option): Add "firmware" option with new OPTION_FIRMWARE key.
|
||||
(sim_firmware_command): New function.
|
||||
(mips_option_handler): Call it for OPTION_FIRMWARE.
|
||||
(sim_open): Allocate memory for idt_monitor region. If "--board"
|
||||
option was given, add no monitor by default. Add BREAK hooks only if
|
||||
monitors are also there.
|
||||
|
||||
Mon Jul 12 00:02:27 1999 Andrew Cagney <cagney@amy.cygnus.com>
|
||||
|
||||
* interp.c (sim_monitor): Flush output before reading input.
|
||||
|
@ -132,12 +132,33 @@ static void ColdReset PARAMS((SIM_DESC sd));
|
||||
#define INDELAYSLOT() ((STATE & simDELAYSLOT) != 0)
|
||||
#define INJALDELAYSLOT() ((STATE & simJALDELAYSLOT) != 0)
|
||||
|
||||
/* Note that the monitor code essentially assumes this layout of memory.
|
||||
If you change these, change the monitor code, too. */
|
||||
#define K0BASE (0x80000000)
|
||||
#define K0SIZE (0x20000000)
|
||||
#define K1BASE (0xA0000000)
|
||||
#define K1SIZE (0x20000000)
|
||||
#define MONITOR_BASE (0xBFC00000)
|
||||
#define MONITOR_SIZE (1 << 11)
|
||||
|
||||
/* Simple run-time monitor support.
|
||||
|
||||
We emulate the monitor by placing magic reserved instructions at
|
||||
the monitor's entry points; when we hit these instructions, instead
|
||||
of raising an exception (as we would normally), we look at the
|
||||
instruction and perform the appropriate monitory operation.
|
||||
|
||||
`*_monitor_base' are the physical addresses at which the corresponding
|
||||
monitor vectors are located. `0' means none. By default,
|
||||
install all three.
|
||||
The RSVD_INSTRUCTION... macros specify the magic instructions we
|
||||
use at the monitor entry points. */
|
||||
static int firmware_option_p = 0;
|
||||
static SIM_ADDR idt_monitor_base = 0xBFC00000;
|
||||
static SIM_ADDR pmon_monitor_base = 0xBFC00500;
|
||||
static SIM_ADDR lsipmon_monitor_base = 0xBFC00200;
|
||||
|
||||
static SIM_RC sim_firmware_command (SIM_DESC sd, char* arg);
|
||||
|
||||
|
||||
#define MEM_SIZE (2 << 20)
|
||||
|
||||
|
||||
@ -158,6 +179,7 @@ static DECLARE_OPTION_HANDLER (mips_option_handler);
|
||||
enum {
|
||||
OPTION_DINERO_TRACE = OPTION_START,
|
||||
OPTION_DINERO_FILE,
|
||||
OPTION_FIRMWARE,
|
||||
OPTION_BOARD
|
||||
};
|
||||
|
||||
@ -225,6 +247,9 @@ Re-compile simulator with \"-DTRACE\" to enable this option.\n");
|
||||
#endif /* TRACE */
|
||||
return SIM_RC_OK;
|
||||
|
||||
case OPTION_FIRMWARE:
|
||||
return sim_firmware_command (sd, arg);
|
||||
|
||||
case OPTION_BOARD:
|
||||
{
|
||||
if (arg)
|
||||
@ -248,6 +273,9 @@ static const OPTION mips_options[] =
|
||||
{ {"dinero-file", required_argument, NULL, OPTION_DINERO_FILE},
|
||||
'\0', "FILE", "Write dinero trace to FILE",
|
||||
mips_option_handler },
|
||||
{ {"firmware", required_argument, NULL, OPTION_FIRMWARE},
|
||||
'\0', "[idt|pmon|lsipmon|none][@ADDRESS]", "Emulate ROM monitor",
|
||||
mips_option_handler },
|
||||
{ {"board", required_argument, NULL, OPTION_BOARD},
|
||||
'\0', "none" /* rely on compile-time string concatenation for other options */
|
||||
|
||||
@ -341,8 +369,7 @@ sim_open (kind, cb, abfd, argv)
|
||||
{
|
||||
/* Allocate core managed memory */
|
||||
|
||||
/* the monitor */
|
||||
sim_do_commandf (sd, "memory region 0x%lx,0x%lx", MONITOR_BASE, MONITOR_SIZE);
|
||||
|
||||
/* For compatibility with the old code - under this (at level one)
|
||||
are the kernel spaces K0 & K1. Both of these map to a single
|
||||
smaller sub region */
|
||||
@ -392,6 +419,15 @@ sim_open (kind, cb, abfd, argv)
|
||||
/* match VIRTUAL memory layout of JMR-TX3904 board */
|
||||
int i;
|
||||
|
||||
/* --- disable monitor unless forced on by user --- */
|
||||
|
||||
if (! firmware_option_p)
|
||||
{
|
||||
idt_monitor_base = 0;
|
||||
pmon_monitor_base = 0;
|
||||
lsipmon_monitor_base = 0;
|
||||
}
|
||||
|
||||
/* --- environment --- */
|
||||
|
||||
STATE_ENVIRONMENT (sd) = OPERATING_ENVIRONMENT;
|
||||
@ -556,51 +592,54 @@ sim_open (kind, cb, abfd, argv)
|
||||
open_trace(sd);
|
||||
#endif /* TRACE */
|
||||
|
||||
/* Write an abort sequence into the TRAP (common) exception vector
|
||||
addresses. This is to catch code executing a TRAP (et.al.)
|
||||
instruction without installing a trap handler. */
|
||||
{
|
||||
unsigned32 halt[2] = { 0x2404002f /* addiu r4, r0, 47 */,
|
||||
HALT_INSTRUCTION /* BREAK */ };
|
||||
H2T (halt[0]);
|
||||
H2T (halt[1]);
|
||||
sim_write (sd, 0x80000000, (char *) halt, sizeof (halt));
|
||||
sim_write (sd, 0x80000180, (char *) halt, sizeof (halt));
|
||||
sim_write (sd, 0x80000200, (char *) halt, sizeof (halt));
|
||||
sim_write (sd, 0xBFC00200, (char *) halt, sizeof (halt));
|
||||
sim_write (sd, 0xBFC00380, (char *) halt, sizeof (halt));
|
||||
sim_write (sd, 0xBFC00400, (char *) halt, sizeof (halt));
|
||||
}
|
||||
|
||||
/*
|
||||
sim_io_eprintf (sd, "idt@%x pmon@%x lsipmon@%x\n",
|
||||
idt_monitor_base,
|
||||
pmon_monitor_base,
|
||||
lsipmon_monitor_base);
|
||||
*/
|
||||
|
||||
/* Write the monitor trap address handlers into the monitor (eeprom)
|
||||
address space. This can only be done once the target endianness
|
||||
has been determined. */
|
||||
{
|
||||
unsigned loop;
|
||||
/* Entry into the IDT monitor is via fixed address vectors, and
|
||||
not using machine instructions. To avoid clashing with use of
|
||||
the MIPS TRAP system, we place our own (simulator specific)
|
||||
"undefined" instructions into the relevant vector slots. */
|
||||
for (loop = 0; (loop < MONITOR_SIZE); loop += 4)
|
||||
{
|
||||
address_word vaddr = (MONITOR_BASE + loop);
|
||||
unsigned32 insn = (RSVD_INSTRUCTION | (((loop >> 2) & RSVD_INSTRUCTION_ARG_MASK) << RSVD_INSTRUCTION_ARG_SHIFT));
|
||||
H2T (insn);
|
||||
sim_write (sd, vaddr, (char *)&insn, sizeof (insn));
|
||||
}
|
||||
if (idt_monitor_base != 0)
|
||||
{
|
||||
unsigned loop;
|
||||
unsigned idt_monitor_size = 1 << 11;
|
||||
|
||||
/* the default monitor region */
|
||||
sim_do_commandf (sd, "memory region 0x%x,0x%x",
|
||||
idt_monitor_base, idt_monitor_size);
|
||||
|
||||
/* Entry into the IDT monitor is via fixed address vectors, and
|
||||
not using machine instructions. To avoid clashing with use of
|
||||
the MIPS TRAP system, we place our own (simulator specific)
|
||||
"undefined" instructions into the relevant vector slots. */
|
||||
for (loop = 0; (loop < idt_monitor_size); loop += 4)
|
||||
{
|
||||
address_word vaddr = (idt_monitor_base + loop);
|
||||
unsigned32 insn = (RSVD_INSTRUCTION |
|
||||
(((loop >> 2) & RSVD_INSTRUCTION_ARG_MASK)
|
||||
<< RSVD_INSTRUCTION_ARG_SHIFT));
|
||||
H2T (insn);
|
||||
sim_write (sd, vaddr, (char *)&insn, sizeof (insn));
|
||||
}
|
||||
}
|
||||
|
||||
if ((pmon_monitor_base != 0) || (lsipmon_monitor_base != 0))
|
||||
{
|
||||
/* The PMON monitor uses the same address space, but rather than
|
||||
branching into it the address of a routine is loaded. We can
|
||||
cheat for the moment, and direct the PMON routine to IDT style
|
||||
instructions within the monitor space. This relies on the IDT
|
||||
monitor not using the locations from 0xBFC00500 onwards as its
|
||||
entry points.*/
|
||||
for (loop = 0; (loop < 24); loop++)
|
||||
{
|
||||
address_word vaddr = (MONITOR_BASE + 0x500 + (loop * 4));
|
||||
unsigned32 value = ((0x500 - 8) / 8); /* default UNDEFINED reason code */
|
||||
switch (loop)
|
||||
{
|
||||
unsigned loop;
|
||||
for (loop = 0; (loop < 24); loop++)
|
||||
{
|
||||
unsigned32 value = ((0x500 - 8) / 8); /* default UNDEFINED reason code */
|
||||
switch (loop)
|
||||
{
|
||||
case 0: /* read */
|
||||
value = 7;
|
||||
break;
|
||||
@ -623,15 +662,43 @@ sim_open (kind, cb, abfd, argv)
|
||||
value = 28;
|
||||
break;
|
||||
}
|
||||
/* FIXME - should monitor_base be SIM_ADDR?? */
|
||||
value = ((unsigned int)MONITOR_BASE + (value * 8));
|
||||
H2T (value);
|
||||
sim_write (sd, vaddr, (char *)&value, sizeof (value));
|
||||
|
||||
/* The LSI MiniRISC PMON has its vectors at 0x200, not 0x500. */
|
||||
vaddr -= 0x300;
|
||||
sim_write (sd, vaddr, (char *)&value, sizeof (value));
|
||||
SIM_ASSERT (idt_monitor_base != 0);
|
||||
value = ((unsigned int) idt_monitor_base + (value * 8));
|
||||
H2T (value);
|
||||
|
||||
if (pmon_monitor_base != 0)
|
||||
{
|
||||
address_word vaddr = (pmon_monitor_base + (loop * 4));
|
||||
sim_write (sd, vaddr, (char *)&value, sizeof (value));
|
||||
}
|
||||
|
||||
if (lsipmon_monitor_base != 0)
|
||||
{
|
||||
address_word vaddr = (lsipmon_monitor_base + (loop * 4));
|
||||
sim_write (sd, vaddr, (char *)&value, sizeof (value));
|
||||
}
|
||||
}
|
||||
|
||||
/* Write an abort sequence into the TRAP (common) exception vector
|
||||
addresses. This is to catch code executing a TRAP (et.al.)
|
||||
instruction without installing a trap handler. */
|
||||
if ((idt_monitor_base != 0) ||
|
||||
(pmon_monitor_base != 0) ||
|
||||
(lsipmon_monitor_base != 0))
|
||||
{
|
||||
unsigned32 halt[2] = { 0x2404002f /* addiu r4, r0, 47 */,
|
||||
HALT_INSTRUCTION /* BREAK */ };
|
||||
H2T (halt[0]);
|
||||
H2T (halt[1]);
|
||||
sim_write (sd, 0x80000000, (char *) halt, sizeof (halt));
|
||||
sim_write (sd, 0x80000180, (char *) halt, sizeof (halt));
|
||||
sim_write (sd, 0x80000200, (char *) halt, sizeof (halt));
|
||||
/* XXX: Write here unconditionally? */
|
||||
sim_write (sd, 0xBFC00200, (char *) halt, sizeof (halt));
|
||||
sim_write (sd, 0xBFC00380, (char *) halt, sizeof (halt));
|
||||
sim_write (sd, 0xBFC00400, (char *) halt, sizeof (halt));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -935,6 +1002,91 @@ fetch_str (SIM_DESC sd,
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
||||
/* Implements the "sim firmware" command:
|
||||
sim firmware NAME[@ADDRESS] --- emulate ROM monitor named NAME.
|
||||
NAME can be idt, pmon, or lsipmon. If omitted, ADDRESS
|
||||
defaults to the normal address for that monitor.
|
||||
sim firmware none --- don't emulate any ROM monitor. Useful
|
||||
if you need a clean address space. */
|
||||
static SIM_RC
|
||||
sim_firmware_command (SIM_DESC sd, char *arg)
|
||||
{
|
||||
int address_present = 0;
|
||||
SIM_ADDR address;
|
||||
|
||||
/* Signal occurrence of this option. */
|
||||
firmware_option_p = 1;
|
||||
|
||||
/* Parse out the address, if present. */
|
||||
{
|
||||
char *p = strchr (arg, '@');
|
||||
if (p)
|
||||
{
|
||||
char *q;
|
||||
address_present = 1;
|
||||
p ++; /* skip over @ */
|
||||
|
||||
address = strtoul (p, &q, 0);
|
||||
if (*q != '\0')
|
||||
{
|
||||
sim_io_printf (sd, "Invalid address given to the"
|
||||
"`sim firmware NAME@ADDRESS' command: %s\n",
|
||||
p);
|
||||
return SIM_RC_FAIL;
|
||||
}
|
||||
}
|
||||
else
|
||||
address_present = 0;
|
||||
}
|
||||
|
||||
if (! strncmp (arg, "idt", 3))
|
||||
{
|
||||
idt_monitor_base = address_present ? address : 0xBFC00000;
|
||||
pmon_monitor_base = 0;
|
||||
lsipmon_monitor_base = 0;
|
||||
}
|
||||
else if (! strncmp (arg, "pmon", 4))
|
||||
{
|
||||
/* pmon uses indirect calls. Hook into implied idt. */
|
||||
pmon_monitor_base = address_present ? address : 0xBFC00500;
|
||||
idt_monitor_base = pmon_monitor_base - 0x500;
|
||||
lsipmon_monitor_base = 0;
|
||||
}
|
||||
else if (! strncmp (arg, "lsipmon", 7))
|
||||
{
|
||||
/* lsipmon uses indirect calls. Hook into implied idt. */
|
||||
pmon_monitor_base = 0;
|
||||
lsipmon_monitor_base = address_present ? address : 0xBFC00200;
|
||||
idt_monitor_base = lsipmon_monitor_base - 0x200;
|
||||
}
|
||||
else if (! strncmp (arg, "none", 4))
|
||||
{
|
||||
if (address_present)
|
||||
{
|
||||
sim_io_printf (sd,
|
||||
"The `sim firmware none' command does "
|
||||
"not take an `ADDRESS' argument.\n");
|
||||
return SIM_RC_FAIL;
|
||||
}
|
||||
idt_monitor_base = 0;
|
||||
pmon_monitor_base = 0;
|
||||
lsipmon_monitor_base = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
sim_io_printf (sd, "\
|
||||
Unrecognized name given to the `sim firmware NAME' command: %s\n\
|
||||
Recognized firmware names are: `idt', `pmon', `lsipmon', and `none'.\n",
|
||||
arg);
|
||||
return SIM_RC_FAIL;
|
||||
}
|
||||
|
||||
return SIM_RC_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Simple monitor interface (currently setup for the IDT and PMON monitors) */
|
||||
void
|
||||
sim_monitor (SIM_DESC sd,
|
||||
|
@ -1,3 +1,7 @@
|
||||
Tue Jul 13 13:26:20 1999 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
|
||||
* interp.c: Clarify error message reporting an unknown board.
|
||||
|
||||
1999-05-08 Felix Lee <flee@cygnus.com>
|
||||
|
||||
* configure: Regenerated to track ../common/aclocal.m4 changes.
|
||||
|
@ -1114,10 +1114,10 @@ sim_open (kind, cb, abfd, argv)
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( NULL != board )
|
||||
{
|
||||
printf("Error: invalid --board option.\n");
|
||||
return 0;
|
||||
if (board != NULL)
|
||||
{
|
||||
sim_io_eprintf (sd, "Error: Board `%s' unknown.\n", board);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,13 @@
|
||||
1999-07-16 Ben Elliston <bje@cygnus.com>
|
||||
|
||||
* sim/arm/misaligned1.ms: New test case.
|
||||
* sim/arm/misaligned2.ms: Likewise.
|
||||
* sim/arm/misaligned3.ms: Likewise.
|
||||
|
||||
1999-07-16 Ben Elliston <bje@cygnus.com>
|
||||
|
||||
* sim/arm/misc.exp: Enable basic tests.
|
||||
|
||||
1999-04-21 Doug Evans <devans@casey.cygnus.com>
|
||||
|
||||
* sim/m32r/nop.cgs: Add missing nop insn.
|
||||
|
Loading…
Reference in New Issue
Block a user