Line 284... |
Line 284... |
or1k_write_spr_reg (regno, data)
|
or1k_write_spr_reg (regno, data)
|
unsigned int regno;
|
unsigned int regno;
|
unsigned int data;
|
unsigned int data;
|
{
|
{
|
or1k_set_chain (SC_RISC_DEBUG);
|
or1k_set_chain (SC_RISC_DEBUG);
|
or1k_write_reg (regno + REG_SPACE, data);
|
or1k_write_reg (regno + REG_SPACE, (ULONGEST)data);
|
}
|
}
|
|
|
/* Reads register SPR from regno. */
|
/* Reads register SPR from regno. */
|
|
|
unsigned int
|
unsigned int
|
Line 623... |
Line 623... |
if (or1k_status == TARGET_RUNNING)
|
if (or1k_status == TARGET_RUNNING)
|
error ("Program is already running.");
|
error ("Program is already running.");
|
else
|
else
|
error ("The program is not being run.");
|
error ("The program is not being run.");
|
|
|
|
|
/* Clear reason register for later. */
|
/* Clear reason register for later. */
|
or1k_write_spr_reg (DRR_SPRNUM, 0);
|
or1k_write_spr_reg (DRR_SPRNUM, 0);
|
|
|
|
/* Else clause added by CZ 26/06/01 */
|
if (step)
|
if (step)
|
{
|
{
|
/* HW STEP. Set DMR1_ST. */
|
/* HW STEP. Set DMR1_ST. */
|
dmr1 |= DMR1_ST;
|
dmr1 |= DMR1_ST;
|
or1k_write_spr_reg (DMR1_SPRNUM, dmr1);
|
or1k_write_spr_reg (DMR1_SPRNUM, dmr1);
|
dmr1 &= ~DMR1_ST;
|
dmr1 &= ~DMR1_ST;
|
}
|
}
|
|
else
|
|
{
|
|
dmr1 &= ~DMR1_ST;
|
|
or1k_write_spr_reg (DMR1_SPRNUM, dmr1);
|
|
}
|
|
|
or1k_commit_debug_registers ();
|
or1k_commit_debug_registers ();
|
/* Run the target. */
|
/* Run the target. */
|
or1k_unstall ();
|
or1k_unstall ();
|
or1k_status = TARGET_RUNNING;
|
or1k_status = TARGET_RUNNING;
|
Line 717... |
Line 724... |
{
|
{
|
/* Search all active breakpoints for a match. */
|
/* Search all active breakpoints for a match. */
|
CORE_ADDR pc = read_pc ();
|
CORE_ADDR pc = read_pc ();
|
int breakpoint = 0;
|
int breakpoint = 0;
|
int i;
|
int i;
|
unsigned long value; /* CZ */
|
unsigned char break_bytes[4] = BRK_INSTR_STRUCT;
|
|
unsigned long b_insn = ntohl(*((unsigned long*)break_bytes));
|
|
unsigned long value;
|
|
|
for (i = 0; i < or1k_implementation.num_used_matchpoints; i++)
|
for (i = 0; i < or1k_implementation.num_used_matchpoints; i++)
|
if (dvr[i] == pc && dcr[i].dp && dcr[i].cc == CC_EQUAL
|
if (dvr[i] == pc && dcr[i].dp && dcr[i].cc == CC_EQUAL
|
&& !dcr[i].sc && dcr[i].ct == CT_FETCH)
|
&& !dcr[i].sc && dcr[i].ct == CT_FETCH)
|
{
|
{
|
Line 731... |
Line 740... |
hit_watchpoint = !breakpoint;
|
hit_watchpoint = !breakpoint;
|
|
|
/* Cause the trap/breakpoint exception to be ignored. This is
|
/* Cause the trap/breakpoint exception to be ignored. This is
|
the behavior of the simulator when the PC value is changed
|
the behavior of the simulator when the PC value is changed
|
by a write command. All pending exceptions are cleared and
|
by a write command. All pending exceptions are cleared and
|
the simulator continues at the PC value specified. */
|
the simulator continues at the PC value specified. We need
|
|
to do this if the instruction at the current PC has the
|
|
value BRK_INSTR_STRUCT */
|
|
|
|
if(b_insn == or1k_read_reg((pc >> 2) + MEM_SPACE))
|
|
{
|
or1k_write_spr_reg(PC_SPRNUM,value);
|
or1k_write_spr_reg(PC_SPRNUM,value);
|
}
|
}
|
|
}
|
else
|
else
|
hit_watchpoint = 0;
|
hit_watchpoint = 0;
|
|
|
/* If the stop PC is in the _exit function, assume
|
/* If the stop PC is in the _exit function, assume
|
we hit the 'break 0x3ff' instruction in _exit, so this
|
we hit the 'break 0x3ff' instruction in _exit, so this
|