add option to break on data/prefetch errors when GDB stub is connected
This commit is contained in:
parent
7c1d2a64f4
commit
197634d411
21
src/ARM.cpp
21
src/ARM.cpp
|
@ -123,6 +123,7 @@ ARM::ARM(u32 num, bool jit, std::optional<GDBArgs> gdb, melonDS::NDS& nds) :
|
|||
)
|
||||
GdbStub.Init();
|
||||
IsSingleStep = false;
|
||||
BreakOnError = gdb->BreakOnError;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -545,6 +546,16 @@ void ARMv5::PrefetchAbort()
|
|||
{
|
||||
Log(LogLevel::Warn, "ARM9: prefetch abort (%08X)\n", R[15]);
|
||||
|
||||
#ifdef GDBSTUB_ENABLED
|
||||
Gdb::StubState s = GdbStub.Poll();
|
||||
if (BreakOnError && s != Gdb::StubState::NoConn)
|
||||
{
|
||||
BreakReq = true;
|
||||
GdbCheckB();
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
u32 oldcpsr = CPSR;
|
||||
CPSR &= ~0xBF;
|
||||
CPSR |= 0x97;
|
||||
|
@ -568,6 +579,16 @@ void ARMv5::DataAbort()
|
|||
{
|
||||
Log(LogLevel::Warn, "ARM9: data abort (%08X)\n", R[15]);
|
||||
|
||||
#ifdef GDBSTUB_ENABLED
|
||||
Gdb::StubState s = GdbStub.Poll();
|
||||
if (BreakOnError && s != Gdb::StubState::NoConn)
|
||||
{
|
||||
BreakReq = true;
|
||||
GdbCheckB();
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
u32 oldcpsr = CPSR;
|
||||
CPSR &= ~0xBF;
|
||||
CPSR |= 0x97;
|
||||
|
|
|
@ -206,6 +206,7 @@ protected:
|
|||
bool IsSingleStep;
|
||||
bool BreakReq;
|
||||
bool BreakOnStartup;
|
||||
bool BreakOnError;
|
||||
u16 Port;
|
||||
|
||||
public:
|
||||
|
|
|
@ -79,6 +79,7 @@ struct GDBArgs
|
|||
u16 PortARM9 = 0;
|
||||
bool ARM7BreakOnStartup = false;
|
||||
bool ARM9BreakOnStartup = false;
|
||||
bool BreakOnError = false;
|
||||
};
|
||||
|
||||
/// Arguments to pass into the NDS constructor.
|
||||
|
|
|
@ -310,6 +310,7 @@ LegacyEntry LegacyFile[] =
|
|||
|
||||
#ifdef GDBSTUB_ENABLED
|
||||
{"GdbEnabled", 1, "Gdb.Enabled", false},
|
||||
{"GdbBreakOnError", 1, "Gdb.BreakOnError", true},
|
||||
{"GdbPortARM7", 0, "Gdb.ARM7.Port", true},
|
||||
{"GdbPortARM9", 0, "Gdb.ARM9.Port", true},
|
||||
{"GdbARM7BreakOnStartup", 1, "Gdb.ARM7.BreakOnStartup", true},
|
||||
|
|
|
@ -1285,6 +1285,7 @@ bool EmuInstance::updateConsole(UpdateConsoleNDSArgs&& _ndsargs, UpdateConsoleGB
|
|||
static_cast<u16>(gdbopt.GetInt("ARM9.Port")),
|
||||
gdbopt.GetBool("ARM7.BreakOnStartup"),
|
||||
gdbopt.GetBool("ARM9.BreakOnStartup"),
|
||||
gdbopt.GetBool("BreakOnError")
|
||||
};
|
||||
auto gdbargs = gdbopt.GetBool("Enabled") ? std::make_optional(_gdbargs) : std::nullopt;
|
||||
#else
|
||||
|
|
|
@ -96,6 +96,7 @@ EmuSettingsDialog::EmuSettingsDialog(QWidget* parent) : QDialog(parent), ui(new
|
|||
|
||||
#ifdef GDBSTUB_ENABLED
|
||||
ui->cbGdbEnabled->setChecked(instcfg.GetBool("Gdb.Enabled"));
|
||||
ui->cbGdbBreakOnError->setChecked(instcfg.GetBool("Gdb.BreakOnError"));
|
||||
ui->intGdbPortA7->setValue(instcfg.GetInt("Gdb.ARM7.Port"));
|
||||
ui->intGdbPortA9->setValue(instcfg.GetInt("Gdb.ARM9.Port"));
|
||||
ui->cbGdbBOSA7->setChecked(instcfg.GetBool("Gdb.ARM7.BreakOnStartup"));
|
||||
|
@ -294,6 +295,7 @@ void EmuSettingsDialog::done(int r)
|
|||
#endif
|
||||
#ifdef GDBSTUB_ENABLED
|
||||
instcfg.SetBool("Gdb.Enabled", ui->cbGdbEnabled->isChecked());
|
||||
instcfg.SetBool("Gdb.BreakOnError", ui->cbGdbBreakOnError->isChecked());
|
||||
instcfg.SetInt("Gdb.ARM7.Port", ui->intGdbPortA7->value());
|
||||
instcfg.SetInt("Gdb.ARM9.Port", ui->intGdbPortA9->value());
|
||||
instcfg.SetBool("Gdb.ARM7.BreakOnStartup", ui->cbGdbBOSA7->isChecked());
|
||||
|
|
|
@ -607,14 +607,21 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="7">
|
||||
<item row="3" column="0" colspan="3">
|
||||
<widget class="QCheckBox" name="cbGdbBreakOnError">
|
||||
<property name="text">
|
||||
<string>Break on data error</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="7">
|
||||
<widget class="QLabel" name="label_18">
|
||||
<property name="text">
|
||||
<string>Note: melonDS must be restarted in order for these changes to have effect</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="7">
|
||||
<item row="4" column="0" colspan="7">
|
||||
<widget class="QLabel" name="label_19">
|
||||
<property name="text">
|
||||
<string>Note: GDB stub cannot be used together with the JIT recompiler</string>
|
||||
|
|
Loading…
Reference in New Issue