Add a way to access the ImDebugger from the DevMenu

This commit is contained in:
Henrik Rydgård 2024-11-21 14:36:31 +01:00
parent 68b496a868
commit 0e3c1df9b3
51 changed files with 69 additions and 8 deletions

View File

@ -317,7 +317,7 @@ bool JitBlockCache::RangeMayHaveEmuHacks(u32 start, u32 end) const {
static int binary_search(const JitBlock blocks_[], const u8 *baseoff, int imin, int imax) {
while (imin < imax) {
int imid = (imin + imax) / 2;
int imid = (imin + imax) >> 1;
if (blocks_[imid].normalEntry < baseoff)
imin = imid + 1;
else

View File

@ -79,8 +79,8 @@ namespace MIPSStackWalk {
}
bool ScanForEntry(StackFrame &frame, u32 entry, u32 &ra) {
// Let's hope there are no > 1MB functions on the PSP, for the sake of humanity...
const u32 LONGEST_FUNCTION = 1024 * 1024;
// Let's hope there are no > 0.5MB functions on the PSP, for the sake of humanity...
const u32 LONGEST_FUNCTION = 1024 * 512;
// TODO: Check if found entry is in the same symbol? Might be wrong sometimes...
if (entry != INVALIDTARGET && frame.pc == entry) {

View File

@ -124,6 +124,10 @@ void DevMenuScreen::CreatePopupContents(UI::ViewGroup *parent) {
items->Add(new Choice(dev->T("Log View")))->OnClick.Handle(this, &DevMenuScreen::OnLogView);
#endif
items->Add(new Choice(dev->T("Logging Channels")))->OnClick.Handle(this, &DevMenuScreen::OnLogConfig);
items->Add(new Choice(dev->T("Debugger")))->OnClick.Add([](UI::EventParams &e) {
g_Config.bShowImDebugger = !g_Config.bShowImDebugger;
return UI::EVENT_DONE;
});
items->Add(new Choice(sy->T("Developer Tools")))->OnClick.Handle(this, &DevMenuScreen::OnDeveloperTools);
// Debug overlay

View File

@ -1537,8 +1537,7 @@ ScreenRenderFlags EmuScreen::render(ScreenRenderMode mode) {
}
PSP_RunLoopWhileState();
// Hopefully coreState is now CORE_NEXTFRAME
// Hopefully, after running, coreState is now CORE_NEXTFRAME
switch (coreState) {
case CORE_NEXTFRAME:
// Reached the end of the frame, all good. Set back to running for the next frame
@ -1609,7 +1608,8 @@ ScreenRenderFlags EmuScreen::render(ScreenRenderMode mode) {
screenManager()->getUIContext()->BeginFrame();
if (!(mode & ScreenRenderMode::TOP)) {
// We're in run-behind mode, but we don't want to draw chat, debug UI and stuff.
renderImDebugger();
// We're in run-behind mode, but we don't want to draw chat, debug UI and stuff. We do draw the imdebugger though.
// So, darken and bail here.
// Reset viewport/scissor to be sure.
draw->SetViewport(viewport);
@ -1640,7 +1640,13 @@ ScreenRenderFlags EmuScreen::render(ScreenRenderMode mode) {
darken();
}
renderImDebugger();
return flags;
}
void EmuScreen::renderImDebugger() {
if (g_Config.bShowImDebugger) {
Draw::DrawContext *draw = screenManager()->getDrawContext();
if (!imguiInited_) {
imguiInited_ = true;
imDebugger_ = std::make_unique<ImDebugger>();
@ -1660,7 +1666,6 @@ ScreenRenderFlags EmuScreen::render(ScreenRenderMode mode) {
ImGui_ImplThin3d_RenderDrawData(ImGui::GetDrawData(), draw);
}
}
return flags;
}
bool EmuScreen::hasVisibleUI() {

View File

@ -79,6 +79,7 @@ private:
void bootComplete();
bool hasVisibleUI();
void renderUI();
void renderImDebugger();
void onVKey(int virtualKeyCode, bool down);
void onVKeyAnalog(int virtualKeyCode, float value);

View File

@ -4,6 +4,7 @@
#include "ext/imgui/imgui_internal.h"
#include "Common/StringUtils.h"
#include "Core/Config.h"
#include "Core/RetroAchievements.h"
#include "Core/Core.h"
#include "Core/Debugger/DebugInterface.h"
@ -380,6 +381,12 @@ void ImDebugger::Frame(MIPSDebugInterface *mipsDebug) {
ImGui::Checkbox("Struct viewer", &cfg_.structViewerOpen);
ImGui::EndMenu();
}
if (ImGui::BeginMenu("Misc")) {
if (ImGui::MenuItem("Close Debugger")) {
g_Config.bShowImDebugger = false;
}
ImGui::EndMenu();
}
ImGui::EndMainMenuBar();
}

View File

@ -305,6 +305,7 @@ Create/Open textures.ini file for current game = Create/Open textures.ini file f
Current = ‎الحالي
Debug overlay = Debug overlay
Debug stats = Debug stats
Debugger = Debugger
Dev Tools = ‎أدوات المطور
DevMenu = قائمة المطور
Disabled JIT functionality = Disabled JIT functionality

View File

@ -297,6 +297,7 @@ Create/Open textures.ini file for current game = Create/Open textures.ini file f
Current = Current
Debug overlay = Debug overlay
Debug stats = Debug stats
Debugger = Debugger
Dev Tools = Development tools
DevMenu = DevMenu
Disabled JIT functionality = Disabled JIT functionality

View File

@ -297,6 +297,7 @@ Create/Open textures.ini file for current game = Create/Open textures.ini file f
Current = Current
Debug overlay = Debug overlay
Debug stats = Debug stats
Debugger = Debugger
Dev Tools = Development tools
DevMenu = DevMenu
Disabled JIT functionality = Disabled JIT functionality

View File

@ -297,6 +297,7 @@ Create/Open textures.ini file for current game = Crear/Obrir fitxer «textures.i
Current = Actual
Debug overlay = Debug overlay
Debug stats = Debug stats
Debugger = Debugger
Dev Tools = Development tools
DevMenu = DevMenu
Disabled JIT functionality = Disabled JIT functionality

View File

@ -297,6 +297,7 @@ Create/Open textures.ini file for current game = Create/Open textures.ini file f
Current = Současný
Debug overlay = Debug overlay
Debug stats = Debug stats
Debugger = Debugger
Dev Tools = Development tools
DevMenu = DevMenu
Disabled JIT functionality = Disabled JIT functionality

View File

@ -297,6 +297,7 @@ Create/Open textures.ini file for current game = Opret/Åben textures.ini fil fo
Current = Aktuelle
Debug overlay = Debug overlay
Debug stats = Debug stats
Debugger = Debugger
Dev Tools = Development tools
DevMenu = DevMenu
Disabled JIT functionality = Disabled JIT functionality

View File

@ -297,6 +297,7 @@ Create/Open textures.ini file for current game = Erstelle/Öffne textures.ini f
Current = Aktuell
Debug overlay = Debug overlay
Debug stats = Debug stats
Debugger = Debugger
Dev Tools = Entwicklungswerkzeuge
DevMenu = Entwicklermenü
Disabled JIT functionality = Deaktivierte JIT Funktionalität

View File

@ -297,6 +297,7 @@ Create/Open textures.ini file for current game = Create/Open textures.ini file f
Current = Current
Debug overlay = Debug overlay
Debug stats = Debug stats
Debugger = Debugger
Dev Tools = Development tools
DevMenu = DevMenu
Disabled JIT functionality = Disabled JIT functionality

View File

@ -323,6 +323,7 @@ Create/Open textures.ini file for current game = Create/Open textures.ini file f
Current = Current
Debug overlay = Debug overlay
Debug stats = Debug stats
Debugger = Debugger
Dev Tools = Development tools
DevMenu = DevMenu
Disabled JIT functionality = Disabled JIT functionality

View File

@ -297,6 +297,7 @@ Create/Open textures.ini file for current game = Crear/Abrir archivo "textures.i
Current = Actual
Debug overlay = Debug overlay
Debug stats = Debug stats
Debugger = Debugger
Dev Tools = Herramientas de desarrollo
DevMenu = DevMenu
Disabled JIT functionality = Desactivar funcionalidad JIT

View File

@ -297,6 +297,7 @@ Create/Open textures.ini file for current game = Crear/Abrir archivo textures.in
Current = Actual
Debug overlay = Debug overlay
Debug stats = Estadisticas debug
Debugger = Debugger
Dev Tools = Herramientas de\ndesarrollador
DevMenu = Menú Depuración
Disabled JIT functionality = Apagar funcionalidad de JIT

View File

@ -297,6 +297,7 @@ Create/Open textures.ini file for current game = ساختن یا باز کردن
Current = جاری کردن
Debug overlay = Debug overlay
Debug stats = Debug stats
Debugger = Debugger
Dev Tools = ابزارهای توسعه
DevMenu = منوی توسعه دهنده
Disabled JIT functionality = قابلیت JIT غیر فعال

View File

@ -297,6 +297,7 @@ Create/Open textures.ini file for current game = Create/Open textures.ini file f
Current = Nykyinen
Debug overlay = Päällyksen virheenetsintä
Debug stats = Debug stats
Debugger = Debugger
Dev Tools = Kehitystökalut
DevMenu = Kehitysvalikko
Disabled JIT functionality = Disabled JIT functionality

View File

@ -297,6 +297,7 @@ Create/Open textures.ini file for current game = Créer/Ouvrir le fichier "textu
Current = Actuel
Debug overlay = Debug overlay
Debug stats = Debug stats
Debugger = Debugger
Dev Tools = Outils de développement
DevMenu = MenuDev
Disabled JIT functionality = Fonctionnalité JIT désactivée

View File

@ -297,6 +297,7 @@ Create/Open textures.ini file for current game = Create/Open textures.ini file f
Current = Actual
Debug overlay = Debug overlay
Debug stats = Debug stats
Debugger = Debugger
Dev Tools = Development tools
DevMenu = DevMenu
Disabled JIT functionality = Disabled JIT functionality

View File

@ -297,6 +297,7 @@ Create/Open textures.ini file for current game = Δημιουργία/Άνοιγ
Current = Τρέχον
Debug overlay = Debug overlay
Debug stats = Debug stats
Debugger = Debugger
Dev Tools = Εργαλεία ανάπτυξης
DevMenu = DevMenu
Disabled JIT functionality = Disabled JIT functionality

View File

@ -297,6 +297,7 @@ Create/Open textures.ini file for current game = Create/Open textures.ini file f
Current = Current
Debug overlay = Debug overlay
Debug stats = Debug stats
Debugger = Debugger
Dev Tools = Development tools
DevMenu = DevMenu
Disabled JIT functionality = Disabled JIT functionality

View File

@ -297,6 +297,7 @@ Create/Open textures.ini file for current game = Create/Open textures.ini file f
Current = Current
Debug overlay = Debug overlay
Debug stats = Debug stats
Debugger = Debugger
Dev Tools = Development tools
DevMenu = DevMenu
Disabled JIT functionality = Disabled JIT functionality

View File

@ -297,6 +297,7 @@ Create/Open textures.ini file for current game = Kreiraj/Otvori textures.ini dat
Current = Trenutačno
Debug overlay = Debug overlay
Debug stats = Debug stats
Debugger = Debugger
Dev Tools = Razvojni alati
DevMenu = DevMenu
Disabled JIT functionality = Isključena JIT funkcionalnost

View File

@ -297,6 +297,7 @@ Create/Open textures.ini file for current game = textures.ini fájl készítése
Current = Jelenlegi
Debug overlay = Hibakereső overlay
Debug stats = Hibakereső statisztikák
Debugger = Debugger
Dev Tools = Fejlesztői eszközök
DevMenu = DevMenu
Disabled JIT functionality = Kikapcsolt JIT funkcionalitások

View File

@ -297,6 +297,7 @@ Create/Open textures.ini file for current game = Buat/Buka file textures.ini unt
Current = Saat ini
Debug overlay = Debug overlay
Debug stats = Debug stats
Debugger = Debugger
Dev Tools = Alat pengembang
DevMenu = Menu pengembang
Disabled JIT functionality = Fungsi JIT dinonaktifkan

View File

@ -297,6 +297,7 @@ Create/Open textures.ini file for current game = Crea/Apri il file textures.ini
Current = Corrente
Debug overlay = Debug dell'overlay
Debug stats = Statistiche debug
Debugger = Debugger
Dev Tools = Strumenti di sviluppo
DevMenu = MenuSvil
Disabled JIT functionality = Funzionalità JIT Disattivata

View File

@ -297,6 +297,7 @@ Create/Open textures.ini file for current game = 現在のゲームの textures.
Current = 現在
Debug overlay = デバッグオーバーレイ
Debug stats = Debug stats
Debugger = Debugger
Dev Tools = 開発用ツール
DevMenu = 開発者用メニュー
Disabled JIT functionality = 無効化するJIT機能

View File

@ -297,6 +297,7 @@ Create/Open textures.ini file for current game = Create/Open textures.ini file f
Current = Saiki
Debug overlay = Debug overlay
Debug stats = Debug stats
Debugger = Debugger
Dev Tools = Development tools
DevMenu = DevMenu
Disabled JIT functionality = Disabled JIT functionality

View File

@ -299,6 +299,7 @@ Create/Open textures.ini file for current game = 현재 게임에 대한 texture
Current = 현재
Debug overlay = 디버그 오버레이
Debug stats = 디버그 통계
Debugger = Debugger
Dev Tools = 개발 도구
DevMenu = 개발메뉴
Disabled JIT functionality = 비활성화된 JIT 기능

View File

@ -313,6 +313,7 @@ Create/Open textures.ini file for current game = Create/Open textures.ini file f
Current = Current
Debug overlay = Debug overlay
Debug stats = Debug stats
Debugger = Debugger
Dev Tools = Development tools
DevMenu = DevMenu
Disabled JIT functionality = Disabled JIT functionality

View File

@ -297,6 +297,7 @@ Create/Open textures.ini file for current game = ສ້າງ/ເປີດໄຟ
Current = Current
Debug overlay = Debug overlay
Debug stats = Debug stats
Debugger = Debugger
Dev Tools = Development tools
DevMenu = DevMenu
Disabled JIT functionality = Disabled JIT functionality

View File

@ -297,6 +297,7 @@ Create/Open textures.ini file for current game = Create/Open textures.ini file f
Current = Current
Debug overlay = Debug overlay
Debug stats = Debug stats
Debugger = Debugger
Dev Tools = Development tools
DevMenu = DevMenu
Disabled JIT functionality = Disabled JIT functionality

View File

@ -297,6 +297,7 @@ Create/Open textures.ini file for current game = Create/Open textures.ini file f
Current = Current
Debug overlay = Debug overlay
Debug stats = Debug stats
Debugger = Debugger
Dev Tools = Alat pembangunan
DevMenu = DevMenu
Disabled JIT functionality = Fungsi JIT yang dilumpuhkan

View File

@ -297,6 +297,7 @@ Create/Open textures.ini file for current game = textures.ini-bestand voor huidi
Current = Huidige
Debug overlay = Debug overlay
Debug stats = Debug stats
Debugger = Debugger
Dev Tools = Ontwikkelingstools
DevMenu = Ontwikkelaarsmenu
Disabled JIT functionality = Disabled JIT functionality

View File

@ -297,6 +297,7 @@ Create/Open textures.ini file for current game = Create/Open textures.ini file f
Current = Current
Debug overlay = Debug overlay
Debug stats = Debug stats
Debugger = Debugger
Dev Tools = Development tools
DevMenu = DevMenu
Disabled JIT functionality = Disabled JIT functionality

View File

@ -297,6 +297,7 @@ Create/Open textures.ini file for current game = Stwórz/otwórz plik textures.i
Current = Obecny
Debug overlay = Nakładka debugowania
Debug stats = Statystyki debugowania
Debugger = Debugger
Dev Tools = Narzędzia Developerskie
DevMenu = Menu deweloperskie
Disabled JIT functionality = Wyłącz funkcje JIT

View File

@ -323,6 +323,7 @@ Create/Open textures.ini file for current game = Criar/Abrir o arquivo textures.
Current = Atual
Debug overlay = Sobreposição do debug
Debug stats = Estatísticas do debug
Debugger = Debugger
Dev Tools = Ferramentas de desenvolvimento
DevMenu = Menu do DEV
Disabled JIT functionality = Funcionalidade do JIT desativada

View File

@ -321,6 +321,7 @@ Create/Open textures.ini file for current game = Criar/Abrir o ficheiro textures
Current = Atual
Debug overlay = Sobreposição Debug
Debug stats = Estatísticas Debug
Debugger = Debugger
Dev Tools = Ferramentas de desenvolvedor
DevMenu = Menu de Desenvolvedor
Disabled JIT functionality = Funcionalidade do JIT desabilitada

View File

@ -298,6 +298,7 @@ Create/Open textures.ini file for current game = Create/Open textures.ini file f
Current = Current
Debug overlay = Debug overlay
Debug stats = Debug stats
Debugger = Debugger
Dev Tools = Development tools
DevMenu = DevMenu
Disabled JIT functionality = Disabled JIT functionality

View File

@ -297,6 +297,7 @@ Create/Open textures.ini file for current game = Создать/открыть
Current = Текущий
Debug overlay = Оверлей отладки
Debug stats = Статистика отладки
Debugger = Debugger
Dev Tools = Инструменты разработчика
DevMenu = Меню разраб.
Disabled JIT functionality = Отключение функционала JIT

View File

@ -297,6 +297,7 @@ Create/Open textures.ini file for current game = Skapa/öppna textures.ini-filen
Current = Aktuellt
Debug overlay = Debug-overlay
Debug stats = Debug-statistik
Debugger = Debugger
Dev Tools = Utvecklingsverktyg
DevMenu = DevMenu
Disabled JIT functionality = Avstängd JIT-funktionalitet

View File

@ -298,6 +298,7 @@ Create/Open textures.ini file for current game = Gumawa/Buksan ang textures.ini
Current = Kasalukuyan
Debug overlay = Debug overlay
Debug stats = Mga istatistika ng pag-debug
Debugger = Debugger
Dev Tools = Mga Dev tools
DevMenu = DevMenu
Disabled JIT functionality = Na-disable ang functionality ng JIT

View File

@ -300,6 +300,7 @@ Current = ค่าดั้งเดิม
Current log file = ไฟล์บันทึกค่าในตอนนี้
Debug overlay = ตัวแสดงช่วยแก้ไขบั๊ก
Debug stats = สถานะการแก้ไขจุดบกพร่อง
Debugger = Debugger
Dev Tools = เครื่องมือนักพัฒนา
DevMenu = เมนูผู้พัฒนา
Disabled JIT functionality = ปิดฟังก์ชั่นการทำงานของระบบ JIT

View File

@ -299,6 +299,7 @@ Create/Open textures.ini file for current game = Şu anki oyun için textures.in
Current = Şimdi
Debug overlay = Hata ayıklama yer paylaşımı
Debug stats = Hata ayıklama istatistikleri
Debugger = Debugger
Dev Tools = Geliştirme araçları
DevMenu = Geliştirici Menüsü
Disabled JIT functionality = JIT işlevselliğini devre dışı bırakın

View File

@ -297,6 +297,7 @@ Create/Open textures.ini file for current game = Створити/Відкрит
Current = Поточний
Debug overlay = Налагодження накладання
Debug stats = Статистика налагодження
Debugger = Debugger
Dev Tools = Інструменти розробника
DevMenu = Меню розроб.
Disabled JIT functionality = Вимкнений функціонал JIT

View File

@ -297,6 +297,7 @@ Create/Open textures.ini file for current game = Tạo/Mở tệp textures.ini c
Current = Hiện tại
Debug overlay = Debug overlay
Debug stats = Debug stats
Debugger = Debugger
Dev Tools = Công cụ NPH
DevMenu = Menu NPH
Disabled JIT functionality = Disabled JIT functionality

View File

@ -297,6 +297,7 @@ Create/Open textures.ini file for current game = 创建/打开当前游戏的tex
Current = 当前
Debug overlay = 调试叠加层
Debug stats = 调试统计
Debugger = Debugger
Dev Tools = 开发者工具
DevMenu = 开发者菜单
Disabled JIT functionality = 已禁用的JIT功能

View File

@ -297,6 +297,7 @@ Create/Open textures.ini file for current game = 為目前遊戲建立/開啟 te
Current = 目前
Debug overlay = 偵錯覆疊
Debug stats = 偵錯統計資料
Debugger = Debugger
Dev Tools = 開發工具
DevMenu = 開發選單
Disabled JIT functionality = 停用 JIT 功能

@ -1 +1 @@
Subproject commit 7648485f14e8e5ee45e8e39b1eb4d3206dbd405a
Subproject commit f3271af11ab8591164b871e36520a7210964f3f6