A new debugger.

Lots of bugs/rough edges/etc - issues will be filed.
Old-style debugging still works (just use --emit_source_annotations to get
the helpful movs back and --break_on_instruction will still fire).
This commit is contained in:
Ben Vanik
2015-09-20 21:31:05 -07:00
parent 8046c19898
commit 5d033f9cb3
90 changed files with 4183 additions and 4651 deletions

View File

@@ -9,6 +9,7 @@
#include "xenia/app/emulator_window.h"
#include "third_party/elemental-forms/src/el/elements.h"
#include "xenia/base/clock.h"
#include "xenia/base/logging.h"
#include "xenia/base/platform.h"
@@ -105,6 +106,10 @@ bool EmulatorWindow::Initialize() {
}
} break;
case 0x13: { // VK_PAUSE
CpuBreakIntoDebugger();
} break;
case 0x70: { // VK_F1
ShowHelpWebsite();
} break;
@@ -147,6 +152,12 @@ bool EmulatorWindow::Initialize() {
L"&Pause/Resume Profiler", L"`",
[]() { Profiler::TogglePause(); }));
}
cpu_menu->AddChild(MenuItem::Create(MenuItem::Type::kSeparator));
{
cpu_menu->AddChild(MenuItem::Create(
MenuItem::Type::kString, L"&Break and Show Debugger", L"Pause/Break",
std::bind(&EmulatorWindow::CpuBreakIntoDebugger, this)));
}
main_menu->AddChild(std::move(cpu_menu));
// GPU menu.
@@ -207,6 +218,25 @@ void EmulatorWindow::CpuTimeScalarSetDouble() {
UpdateTitle();
}
void EmulatorWindow::CpuBreakIntoDebugger() {
auto debugger = emulator()->debugger();
if (!debugger) {
auto message_form = new el::MessageForm(window_->root_element(),
TBIDC("debug_error_window"));
message_form->Show("Xenia Debugger",
"Xenia must be launched with the --debug flag in order "
"to enable debugging.");
return;
}
if (debugger->execution_state() == debug::ExecutionState::kRunning) {
// Currently running, so interrupt (and show the debugger).
debugger->Pause();
} else {
// Not running, so just bring the debugger into focus.
debugger->Show();
}
}
void EmulatorWindow::GpuTraceFrame() {
emulator()->graphics_system()->RequestFrameTrace();
}