MCPcopy Create free account
hub / github.com/cemu-project/Cemu / DebuggerWindow2

Method DebuggerWindow2

src/gui/debugger/DebuggerWindow2.cpp:269–334  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

267}
268
269DebuggerWindow2::DebuggerWindow2(wxFrame& parent, const wxRect& display_size)
270 : wxFrame(&parent, wxID_ANY, _("PPC Debugger"), wxDefaultPosition, wxSize(1280, 300), wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxSYSTEM_MENU | wxCAPTION | wxCLOSE_BOX | wxCLIP_CHILDREN | wxRESIZE_BORDER | wxFRAME_FLOAT_ON_PARENT),
271 m_module_address(0)
272{
273 this->wxWindowBase::SetBackgroundColour(*wxWHITE);
274
275 const auto file = ActiveSettings::GetConfigPath("debugger/config.xml");
276 m_config.SetFilename(file.generic_wstring());
277 m_config.Load();
278
279 debuggerState.breakOnEntry = m_config.data().break_on_start;
280
281 m_main_position = parent.GetPosition();
282 m_main_size = parent.GetSize();
283
284 auto y = std::max<uint32>(300, (display_size.GetHeight() - 500 - 300) * 0.8);
285 this->SetSize(1280, y);
286
287 CreateMenuBar();
288 CreateToolBar();
289
290 wxBoxSizer* main_sizer = new wxBoxSizer(wxVERTICAL);
291
292 // load configs for already loaded modules
293 const auto module_count = RPLLoader_GetModuleCount();
294 const auto module_list = RPLLoader_GetModuleList();
295 for (sint32 i = 0; i < module_count; i++)
296 {
297 const auto module = module_list[i];
298 LoadModuleStorage(module);
299 }
300
301 wxString label_text = _("> no modules loaded");
302 if (module_count != 0)
303 {
304 RPLModule* current_rpl_module = RPLLoader_FindModuleByCodeAddr(MEMORY_CODEAREA_ADDR);
305 if (current_rpl_module)
306 label_text = wxString::Format("> %s", current_rpl_module->moduleName2.c_str());
307 else
308 label_text = _("> unknown module");
309 }
310
311 m_module_label = new wxStaticText(this, wxID_ANY, label_text);
312 m_module_label->SetBackgroundColour(*wxWHITE);
313 m_module_label->SetForegroundColour(wxColour(0xFFbf52fe));
314 main_sizer->Add(m_module_label, 0, wxEXPAND | wxALL, 5);
315
316 m_disasm_ctrl = new DisasmCtrl(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxScrolledWindowStyle);
317 main_sizer->Add(m_disasm_ctrl, 1, wxEXPAND);
318
319 this->SetSizer(main_sizer);
320 this->wxWindowBase::Layout();
321
322 m_register_window = new RegisterWindow(*this, m_main_position, m_main_size);
323 m_dump_window = new DumpWindow(*this, m_main_position, m_main_size);
324 m_breakpoint_window = new BreakpointWindow(*this, m_main_position, m_main_size);
325 m_module_window = new ModuleWindow(*this, m_main_position, m_main_size);
326 m_symbol_window = new SymbolWindow(*this, m_main_position, m_main_size);

Callers

nothing calls this directly

Calls 10

RPLLoader_GetModuleCountFunction · 0.85
RPLLoader_GetModuleListFunction · 0.85
SetFilenameMethod · 0.80
GetPositionMethod · 0.80
AddMethod · 0.80
LoadMethod · 0.45
dataMethod · 0.45
GetSizeMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected