Skip to content

Commit 0e2ae50

Browse files
committed
[debugger] Add context menus to call stack and symbols windows
1 parent db390fa commit 0e2ae50

File tree

3 files changed

+40
-1
lines changed

3 files changed

+40
-1
lines changed

platforms/shared/desktop/gui_debug_disassembler.cpp

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1635,6 +1635,25 @@ void gui_debug_window_call_stack(void)
16351635
{
16361636
request_goto_address(entry.dest);
16371637
}
1638+
1639+
ImGui::PopFont();
1640+
if (ImGui::BeginPopupContextItem())
1641+
{
1642+
if (ImGui::Selectable("Add Breakpoint"))
1643+
{
1644+
if (!emu_get_core()->GetHuC6280()->IsBreakpoint(HuC6280::HuC6280_BREAKPOINT_TYPE_ROMRAM, entry.dest))
1645+
emu_get_core()->GetHuC6280()->AddBreakpoint(entry.dest);
1646+
}
1647+
1648+
if (ImGui::Selectable("Add Watch"))
1649+
{
1650+
gui_debug_memory_add_watch(0, entry.dest, symbol_text[0] ? symbol_text : NULL);
1651+
}
1652+
1653+
ImGui::EndPopup();
1654+
}
1655+
ImGui::PushFont(gui_default_font);
1656+
16381657
ImGui::SameLine();
16391658
ImGui::TextColored(cyan, "$%04X", entry.dest);
16401659
ImGui::SameLine();
@@ -1810,6 +1829,25 @@ void gui_debug_window_symbols(void)
18101829
{
18111830
request_goto_address(symbol->address);
18121831
}
1832+
1833+
ImGui::PopFont();
1834+
if (ImGui::BeginPopupContextItem())
1835+
{
1836+
if (ImGui::Selectable("Add Breakpoint"))
1837+
{
1838+
if (!emu_get_core()->GetHuC6280()->IsBreakpoint(HuC6280::HuC6280_BREAKPOINT_TYPE_ROMRAM, symbol->address))
1839+
emu_get_core()->GetHuC6280()->AddBreakpoint(symbol->address);
1840+
}
1841+
1842+
if (ImGui::Selectable("Add Watch"))
1843+
{
1844+
gui_debug_memory_add_watch(0, symbol->address, symbol->text);
1845+
}
1846+
1847+
ImGui::EndPopup();
1848+
}
1849+
ImGui::PushFont(gui_default_font);
1850+
18131851
ImGui::SameLine();
18141852
ImGui::TextColored(cyan, "$%02X", b);
18151853

platforms/shared/desktop/gui_debug_memory.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,7 @@ void gui_debug_memory_add_watch(int editor, int address, const char* notes)
410410
}
411411

412412
watches->push_back(watch);
413+
mem_edit[editor].OpenWatchWindow();
413414
}
414415

415416
void gui_debug_memory_remove_watch(int editor, int address)

platforms/shared/desktop/gui_menus.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1439,7 +1439,7 @@ static void menu_debug(void)
14391439
ImGui::Separator();
14401440
ImGui::MenuItem("Show HuC6280 Status", "", &config_debug.show_processor, config_debug.debug);
14411441
ImGui::MenuItem("Show HuC6280 Call Stack", "", &config_debug.show_call_stack, config_debug.debug);
1442-
ImGui::MenuItem("Show Symbols", "", &config_debug.show_symbols, config_debug.debug);
1442+
ImGui::MenuItem("Show HuC6280 Symbols", "", &config_debug.show_symbols, config_debug.debug);
14431443
ImGui::Separator();
14441444
ImGui::MenuItem("Show HuC6260 Info", "", &config_debug.show_huc6260_info, config_debug.debug);
14451445
ImGui::MenuItem("Show HuC6260 Palettes", "", &config_debug.show_huc6260_palettes, config_debug.debug);

0 commit comments

Comments
 (0)