Simplifying debug stuff, as I'm not going to bother with gdb.
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "xenia/debug/client/xdp/xdp_client.h"
|
||||
#include "xenia/debug/debug_client.h"
|
||||
#include "xenia/debug/ui/model/system.h"
|
||||
#include "xenia/ui/loop.h"
|
||||
|
||||
@@ -31,7 +31,7 @@ class Application {
|
||||
|
||||
xe::ui::Loop* loop() { return loop_.get(); }
|
||||
MainWindow* main_window() const { return main_window_.get(); }
|
||||
client::xdp::XdpClient* client() { return &client_; }
|
||||
DebugClient* client() { return &client_; }
|
||||
model::System* system() const { return system_.get(); }
|
||||
|
||||
void Quit();
|
||||
@@ -43,7 +43,7 @@ class Application {
|
||||
|
||||
std::unique_ptr<xe::ui::Loop> loop_;
|
||||
std::unique_ptr<MainWindow> main_window_;
|
||||
client::xdp::XdpClient client_;
|
||||
DebugClient client_;
|
||||
|
||||
std::unique_ptr<model::System> system_;
|
||||
};
|
||||
|
||||
@@ -21,8 +21,6 @@ namespace xe {
|
||||
namespace debug {
|
||||
namespace ui {
|
||||
|
||||
using namespace xe::debug::client::xdp;
|
||||
|
||||
using xe::ui::MenuItem;
|
||||
|
||||
const std::wstring kBaseTitle = L"xenia debugger";
|
||||
|
||||
@@ -42,7 +42,7 @@ class MainWindow {
|
||||
void OnClose();
|
||||
|
||||
Application* app_ = nullptr;
|
||||
xe::debug::client::xdp::XdpClient* client_ = nullptr;
|
||||
xe::debug::DebugClient* client_ = nullptr;
|
||||
|
||||
std::unique_ptr<xe::ui::Window> window_;
|
||||
std::unique_ptr<el::Form> form_;
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace model {
|
||||
|
||||
using namespace xe::debug::proto;
|
||||
|
||||
System::System(xe::ui::Loop* loop, client::xdp::XdpClient* client)
|
||||
System::System(xe::ui::Loop* loop, DebugClient* client)
|
||||
: loop_(loop), client_(client) {}
|
||||
|
||||
ExecutionState System::execution_state() {
|
||||
@@ -83,7 +83,10 @@ void System::OnModulesUpdated(std::vector<const ModuleListEntry*> entries) {
|
||||
}
|
||||
}
|
||||
for (auto module_handle : extra_modules) {
|
||||
modules_by_handle_[module_handle]->set_dead(true);
|
||||
auto module = modules_by_handle_.find(module_handle);
|
||||
if (module != modules_by_handle_.end()) {
|
||||
module->second->set_dead(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
loop_->Post([this]() {
|
||||
@@ -112,7 +115,10 @@ void System::OnThreadsUpdated(std::vector<const ThreadListEntry*> entries) {
|
||||
}
|
||||
}
|
||||
for (auto thread_handle : extra_threads) {
|
||||
modules_by_handle_[thread_handle]->set_dead(true);
|
||||
auto thread = threads_by_handle_.find(thread_handle);
|
||||
if (thread != threads_by_handle_.end()) {
|
||||
thread->second->set_dead(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
loop_->Post([this]() {
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "xenia/base/delegate.h"
|
||||
#include "xenia/debug/client/xdp/xdp_client.h"
|
||||
#include "xenia/debug/debug_client.h"
|
||||
#include "xenia/debug/ui/model/function.h"
|
||||
#include "xenia/debug/ui/model/module.h"
|
||||
#include "xenia/debug/ui/model/thread.h"
|
||||
@@ -28,14 +28,12 @@ namespace debug {
|
||||
namespace ui {
|
||||
namespace model {
|
||||
|
||||
using xe::debug::client::xdp::ExecutionState;
|
||||
|
||||
class System : public client::xdp::ClientListener {
|
||||
class System : public ClientListener {
|
||||
public:
|
||||
System(xe::ui::Loop* loop, client::xdp::XdpClient* client);
|
||||
System(xe::ui::Loop* loop, DebugClient* client);
|
||||
|
||||
xe::ui::Loop* loop() const { return loop_; }
|
||||
client::xdp::XdpClient* client() const { return client_; }
|
||||
DebugClient* client() const { return client_; }
|
||||
|
||||
ExecutionState execution_state();
|
||||
|
||||
@@ -57,7 +55,7 @@ class System : public client::xdp::ClientListener {
|
||||
std::vector<const proto::ThreadListEntry*> entries) override;
|
||||
|
||||
xe::ui::Loop* loop_ = nullptr;
|
||||
client::xdp::XdpClient* client_ = nullptr;
|
||||
DebugClient* client_ = nullptr;
|
||||
|
||||
std::recursive_mutex mutex_;
|
||||
std::vector<std::unique_ptr<Module>> modules_;
|
||||
|
||||
@@ -28,12 +28,12 @@ class View {
|
||||
std::string name() const { return name_; }
|
||||
el::LayoutBox* root_element() { return &root_element_; }
|
||||
xe::ui::Loop* loop() const { return Application::current()->loop(); }
|
||||
client::xdp::XdpClient* client() const { return client_; }
|
||||
DebugClient* client() const { return client_; }
|
||||
model::System* system() const { return Application::current()->system(); }
|
||||
|
||||
virtual el::Element* BuildUI() = 0;
|
||||
|
||||
virtual void Setup(xe::debug::client::xdp::XdpClient* client) = 0;
|
||||
virtual void Setup(xe::debug::DebugClient* client) = 0;
|
||||
|
||||
protected:
|
||||
View(std::string name) : name_(name) {}
|
||||
@@ -41,7 +41,7 @@ class View {
|
||||
std::string name_;
|
||||
el::LayoutBox root_element_;
|
||||
std::unique_ptr<el::EventHandler> handler_;
|
||||
xe::debug::client::xdp::XdpClient* client_ = nullptr;
|
||||
xe::debug::DebugClient* client_ = nullptr;
|
||||
};
|
||||
|
||||
} // namespace ui
|
||||
|
||||
@@ -16,8 +16,6 @@ namespace ui {
|
||||
namespace views {
|
||||
namespace cpu {
|
||||
|
||||
using namespace xe::debug::client::xdp;
|
||||
|
||||
CpuView::CpuView() : View("CPU") {}
|
||||
|
||||
CpuView::~CpuView() = default;
|
||||
@@ -147,7 +145,7 @@ el::Element* CpuView::BuildUI() {
|
||||
return &root_element_;
|
||||
}
|
||||
|
||||
void CpuView::Setup(XdpClient* client) {
|
||||
void CpuView::Setup(DebugClient* client) {
|
||||
client_ = client;
|
||||
|
||||
system()->on_execution_state_changed.AddListener(
|
||||
|
||||
@@ -28,7 +28,7 @@ class CpuView : public View {
|
||||
|
||||
el::Element* BuildUI() override;
|
||||
|
||||
void Setup(xe::debug::client::xdp::XdpClient* client) override;
|
||||
void Setup(xe::debug::DebugClient* client) override;
|
||||
|
||||
protected:
|
||||
void UpdateElementState();
|
||||
|
||||
@@ -36,7 +36,7 @@ el::Element* GpuView::BuildUI() {
|
||||
return &root_element_;
|
||||
}
|
||||
|
||||
void GpuView::Setup(xe::debug::client::xdp::XdpClient* client) {
|
||||
void GpuView::Setup(xe::debug::DebugClient* client) {
|
||||
//
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ class GpuView : public View {
|
||||
|
||||
el::Element* BuildUI() override;
|
||||
|
||||
void Setup(xe::debug::client::xdp::XdpClient* client) override;
|
||||
void Setup(xe::debug::DebugClient* client) override;
|
||||
|
||||
protected:
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user