mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2026-07-09 17:24:49 -06:00
qt: gdb: Do not change GDB settings when the gdbport arg is used (#2257)
This commit is contained in:
parent
9a0f0e3caf
commit
d61801ad76
@ -299,8 +299,7 @@ GMainWindow::GMainWindow(Core::System& system_)
|
||||
if (i >= args.size() - 1 || args[i + 1].startsWith(QChar::fromLatin1('-'))) {
|
||||
continue;
|
||||
}
|
||||
Settings::values.use_gdbstub = true;
|
||||
Settings::values.gdbstub_port = strtoul(args[++i].toLatin1(), NULL, 0);
|
||||
gdbport_from_arg = strtoul(args[++i].toLatin1(), NULL, 0);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -1526,6 +1525,13 @@ void GMainWindow::BootGame(const QString& filename) {
|
||||
system.RegisterAppLoaderEarly(loader);
|
||||
}
|
||||
|
||||
// Override GDB settings if emulator was launched with
|
||||
// GDB port option.
|
||||
if (gdbport_from_arg != -1) {
|
||||
system.SetGDBPortOverride(gdbport_from_arg);
|
||||
system.SetDebugNextProcessFlag();
|
||||
}
|
||||
|
||||
system.ApplySettings();
|
||||
|
||||
Settings::LogSettings();
|
||||
|
||||
@ -407,6 +407,8 @@ private:
|
||||
// Whether game was paused due to stopping video dumping
|
||||
bool game_paused_for_dumping = false;
|
||||
|
||||
int gdbport_from_arg = -1;
|
||||
|
||||
QString gl_renderer;
|
||||
std::vector<QString> physical_devices;
|
||||
|
||||
|
||||
@ -762,8 +762,13 @@ void System::Reset() {
|
||||
|
||||
void System::ApplySettings() {
|
||||
#ifdef ENABLE_GDBSTUB
|
||||
GDBStub::SetServerPort(Settings::values.gdbstub_port.GetValue());
|
||||
GDBStub::ToggleServer(Settings::values.use_gdbstub.GetValue());
|
||||
if (override_gdb_port != -1) {
|
||||
GDBStub::SetServerPort(override_gdb_port);
|
||||
GDBStub::ToggleServer(true);
|
||||
} else {
|
||||
GDBStub::SetServerPort(Settings::values.gdbstub_port.GetValue());
|
||||
GDBStub::ToggleServer(Settings::values.use_gdbstub.GetValue());
|
||||
}
|
||||
#endif
|
||||
|
||||
if (gpu) {
|
||||
|
||||
@ -421,6 +421,10 @@ public:
|
||||
|
||||
void DebugUnscheduleAllThreadsFromFrontend(bool unschedule);
|
||||
|
||||
void SetGDBPortOverride(int port) {
|
||||
override_gdb_port = port;
|
||||
}
|
||||
|
||||
private:
|
||||
/**
|
||||
* Initialize the emulated system.
|
||||
@ -531,6 +535,7 @@ private:
|
||||
std::function<void()> info_led_color_changed;
|
||||
|
||||
bool debug_next_process;
|
||||
int override_gdb_port = -1;
|
||||
|
||||
friend class boost::serialization::access;
|
||||
template <typename Archive>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user