import gdb-19990422 snapshot

This commit is contained in:
Stan Shebs
1999-04-26 18:34:20 +00:00
parent 1996fae846
commit 7a292a7adf
354 changed files with 13433 additions and 11180 deletions

View File

@ -1,3 +1,25 @@
1999-04-06 Keith Seitz <keiths@cygnus.com>
* wrapper.c (stop_simulator): New global.
(sim_stop): Set sim state to STOP and set
stop_simulator.
(sim_resume): Reset stop_simulator.
(sim_stop_reason): If stop_simulator is set, tell gdb
that the we took SIGINT.
* armemu.c (ARMul_Emulate26): Don't loop forever. Stop if
stop_simulator is set.
1999-04-02 Keith Seitz <keiths@cygnus.com>
* armemu.c (ARMul_Emulate26): If NEED_UI_LOOP_HOOK, call ui_loop_hook
whenever the counter expires.
* Makefile.in (SIM_EXTRA_CFLAGS): Include define NEED_UI_LOOP_HOOK.
1999-03-24 Nick Clifton <nickc@cygnus.com>
* armemu.c (ARMul_Emulate26): Handle new breakpoint value.
* thumbemu.c (ARMul_ThumbDecode): Handle new breakpoint value.
Mon Sep 14 09:00:05 1998 Nick Clifton <nickc@cygnus.com>
* wrapper.c (sim_open): Set endianness according to BFD or command

View File

@ -18,7 +18,7 @@
## COMMON_PRE_CONFIG_FRAG
SIM_EXTRA_CFLAGS = -DMODET
SIM_EXTRA_CFLAGS = -DMODET -DNEED_UI_LOOP_HOOK
SIM_OBJS = armcopro.o armemu26.o armemu32.o arminit.o armos.o armsupp.o \
armvirt.o bag.o thumbemu.o wrapper.o sim-load.o

View File

@ -18,6 +18,7 @@
#include "armdefs.h"
#include "armemu.h"
#include "armos.h"
static ARMword GetDPRegRHS(ARMul_State *state, ARMword instr) ;
static ARMword GetDPSRegRHS(ARMul_State *state, ARMword instr) ;
@ -43,6 +44,19 @@ static unsigned MultiplyAdd64(ARMul_State *state, ARMword instr,int signextend,i
#define LDEFAULT (0) /* default : do nothing */
#define LSCC (1) /* set condition codes on result */
#ifdef NEED_UI_LOOP_HOOK
/* How often to run the ui_loop update, when in use */
#define UI_LOOP_POLL_INTERVAL 0x32000
/* Counter for the ui_loop_hook update */
static long ui_loop_hook_counter = UI_LOOP_POLL_INTERVAL;
/* Actual hook to call to run through gdb's gui event loop */
extern int (*ui_loop_hook) (int);
#endif /* NEED_UI_LOOP_HOOK */
extern int stop_simulator;
/***************************************************************************\
* short-hand macros for LDR/STR *
\***************************************************************************/
@ -2166,10 +2180,20 @@ mainswitch:
break ;
case 0x7f : /* Load Byte, WriteBack, Pre Inc, Reg */
if (BIT(4)) {
ARMul_UndefInstr(state,instr) ;
break ;
}
if (BIT(4))
{
/* Check for the special breakpoint opcode.
This value should correspond to the value defined
as ARM_BE_BREAKPOINT in gdb/arm-tdep.c. */
if (BITS (0,19) == 0xfdefe)
{
if (! ARMul_OSHandleSWI (state, SWI_Breakpoint))
ARMul_Abort (state, ARMul_SWIV);
}
else
ARMul_UndefInstr(state,instr) ;
break ;
}
UNDEF_LSRBaseEQOffWb ;
UNDEF_LSRBaseEQDestWb ;
UNDEF_LSRPCBaseWb ;
@ -2549,11 +2573,19 @@ mainswitch:
donext:
#endif
#ifdef NEED_UI_LOOP_HOOK
if (ui_loop_hook != NULL && ui_loop_hook_counter-- < 0)
{
ui_loop_hook_counter = UI_LOOP_POLL_INTERVAL;
ui_loop_hook (0);
}
#endif /* NEED_UI_LOOP_HOOK */
if (state->Emulate == ONCE)
state->Emulate = STOP;
else if (state->Emulate != RUN)
break;
} while (1) ; /* do loop */
} while (!stop_simulator) ; /* do loop */
state->decoded = decoded ;
state->loaded = loaded ;

View File

@ -29,6 +29,7 @@ existing ARM simulator. */
#include "armdefs.h"
#include "armemu.h"
#include "armos.h"
/* Decode a 16bit Thumb instruction. The instruction is in the low
16-bits of the tinstr field, with the following Thumb instruction
@ -356,6 +357,9 @@ ARMul_ThumbDecode (state,pc,tinstr,ainstr)
/* Breakpoint must be handled specially. */
if ((tinstr & 0x00FF) == 0x18)
*ainstr |= ((tinstr & 0x00FF) << 16);
/* New breakpoint value. See gdb/arm-tdep.c */
else if ((tinstr & 0x00FF) == 0xFE)
* ainstr |= SWI_Breakpoint;
else
*ainstr |= (tinstr & 0x00FF);
}

View File

@ -50,6 +50,8 @@ static int verbosity;
/* Non-zero to set big endian mode. */
static int big_endian;
int stop_simulator;
static void
init ()
{
@ -154,7 +156,9 @@ int
sim_stop (sd)
SIM_DESC sd;
{
return 0;
state->Emulate = STOP;
stop_simulator = 1;
return 1;
}
void
@ -163,6 +167,7 @@ sim_resume (sd, step, siggnal)
int step, siggnal;
{
state->EndCondition = 0;
stop_simulator = 0;
if (step)
{
@ -435,7 +440,12 @@ sim_stop_reason (sd, reason, sigrc)
enum sim_stop *reason;
int *sigrc;
{
if (state->EndCondition == 0)
if (stop_simulator)
{
*reason = sim_stopped;
*sigrc = SIGINT;
}
else if (state->EndCondition == 0)
{
*reason = sim_exited;
*sigrc = state->Reg[0] & 255;