arch-riscv: Report traps to GDB in SE mode
This commit add code to report illegal instruction and breakpoint traps to GDB (if connected). This merely follows what POWER does.
This commit is contained in:
@@ -205,9 +205,11 @@ UnknownInstFault::invokeSE(ThreadContext *tc, const StaticInstPtr &inst)
|
||||
void
|
||||
IllegalInstFault::invokeSE(ThreadContext *tc, const StaticInstPtr &inst)
|
||||
{
|
||||
auto *rsi = static_cast<RiscvStaticInst *>(inst.get());
|
||||
panic("Illegal instruction 0x%08x at pc %s: %s", rsi->machInst,
|
||||
tc->pcState(), reason.c_str());
|
||||
if (! tc->getSystemPtr()->trapToGdb(GDBSignal::ILL, tc->contextId()) ) {
|
||||
auto *rsi = static_cast<RiscvStaticInst *>(inst.get());
|
||||
panic("Illegal instruction 0x%08x at pc %s: %s", rsi->machInst,
|
||||
tc->pcState(), reason.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@@ -226,7 +228,9 @@ IllegalFrmFault::invokeSE(ThreadContext *tc, const StaticInstPtr &inst)
|
||||
void
|
||||
BreakpointFault::invokeSE(ThreadContext *tc, const StaticInstPtr &inst)
|
||||
{
|
||||
schedRelBreak(0);
|
||||
if (! tc->getSystemPtr()->trapToGdb(GDBSignal::TRAP, tc->contextId()) ) {
|
||||
schedRelBreak(0);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user