diff --git a/Core/Debugger/MemBlockInfo.cpp b/Core/Debugger/MemBlockInfo.cpp index cb63e83f50..1ff7d16d50 100644 --- a/Core/Debugger/MemBlockInfo.cpp +++ b/Core/Debugger/MemBlockInfo.cpp @@ -129,7 +129,7 @@ bool MemSlabMap::Find(MemBlockFlags flags, uint32_t addr, uint32_t size, std::ve bool found = false; while (slab != nullptr && slab->start < end) { if (slab->pc != 0 || !slab->tag.empty()) { - results.push_back({ flags, slab->start, slab->end - slab->start, slab->pc, slab->tag, slab->allocated }); + results.push_back({ flags, slab->start, slab->end - slab->start, slab->ticks, slab->pc, slab->tag, slab->allocated }); found = true; } slab = slab->next; diff --git a/Core/Debugger/MemBlockInfo.h b/Core/Debugger/MemBlockInfo.h index b32601585c..fa851ffdfe 100644 --- a/Core/Debugger/MemBlockInfo.h +++ b/Core/Debugger/MemBlockInfo.h @@ -40,6 +40,7 @@ struct MemBlockInfo { MemBlockFlags flags; uint32_t start; uint32_t size; + uint64_t ticks; uint32_t pc; std::string tag; bool allocated; diff --git a/Windows/Debugger/CtrlMemView.cpp b/Windows/Debugger/CtrlMemView.cpp index d06f1d9dd1..326fa1bdf8 100644 --- a/Windows/Debugger/CtrlMemView.cpp +++ b/Windows/Debugger/CtrlMemView.cpp @@ -555,11 +555,17 @@ void CtrlMemView::onMouseMove(WPARAM wParam, LPARAM lParam, int button) } -void CtrlMemView::updateStatusBarText() -{ - char text[64]; - sprintf(text,"%08X",curAddress); - SendMessage(GetParent(wnd),WM_DEB_SETSTATUSBARTEXT,0,(LPARAM)text); +void CtrlMemView::updateStatusBarText() { + std::vector memRangeInfo = FindMemInfoByFlag(highlightFlags_, curAddress, 1); + + char text[512]; + snprintf(text, sizeof(text), "%08X", curAddress); + // There should only be one. + for (MemBlockInfo info : memRangeInfo) { + snprintf(text, sizeof(text), "%08X - %s (at PC %08X / %lld ticks)", curAddress, info.tag.c_str(), info.pc, info.ticks); + } + + SendMessage(GetParent(wnd), WM_DEB_SETSTATUSBARTEXT, 0, (LPARAM)text); } void CtrlMemView::gotoPoint(int x, int y) diff --git a/Windows/Debugger/Debugger_MemoryDlg.cpp b/Windows/Debugger/Debugger_MemoryDlg.cpp index 9214a34673..6532c6a6f1 100644 --- a/Windows/Debugger/Debugger_MemoryDlg.cpp +++ b/Windows/Debugger/Debugger_MemoryDlg.cpp @@ -2,6 +2,7 @@ #include "Windows/stdafx.h" #include +#include #include "..\resource.h" #include "Common/Data/Encoding/Utf8.h" @@ -81,6 +82,8 @@ CMemoryDlg::CMemoryDlg(HINSTANCE _hInstance, HWND _hParent, DebugInterface *_cpu ComboBox_SetItemData(layerDropdown_, 3, MemBlockFlags::TEXTURE); ComboBox_SetCurSel(layerDropdown_, 0); + status_ = GetDlgItem(m_hDlg, IDC_MEMVIEW_STATUS); + memView = CtrlMemView::getFrom(memViewHdl); memView->setDebugger(_cpu); @@ -220,6 +223,10 @@ BOOL CMemoryDlg::DlgProc(UINT message, WPARAM wParam, LPARAM lParam) { Update(); return TRUE; + case WM_DEB_SETSTATUSBARTEXT: + SendMessage(status_, SB_SETTEXT, 0, (LPARAM)ConvertUTF8ToWString((const char *)lParam).c_str()); + break; + case WM_INITDIALOG: return TRUE; @@ -250,11 +257,11 @@ void CMemoryDlg::Size() int dlg_w = winRect.right - winRect.left; int dlg_h = winRect.bottom - winRect.top; - int wf = slRect.right-slRect.left; int w = dlg_w - 3 * fontScale - wf*2; - int top = 48 * fontScale; - int height = dlg_h - top; + int top = 40 * fontScale; + int bottom = 24 * fontScale; + int height = dlg_h - top - bottom; //HWND, X, Y, width, height, repaint MoveWindow(symListHdl, 0 ,top, wf, height, TRUE); MoveWindow(memViewHdl, wf+4 ,top, w, height, TRUE); diff --git a/Windows/Debugger/Debugger_MemoryDlg.h b/Windows/Debugger/Debugger_MemoryDlg.h index f8a9d20b50..cf771c6415 100644 --- a/Windows/Debugger/Debugger_MemoryDlg.h +++ b/Windows/Debugger/Debugger_MemoryDlg.h @@ -18,6 +18,7 @@ private: CtrlMemView *memView; HWND memViewHdl, symListHdl, editWnd, searchBoxHdl, srcListHdl; HWND layerDropdown_; + HWND status_; BOOL DlgProc(UINT message, WPARAM wParam, LPARAM lParam); public: diff --git a/Windows/ppsspp.rc b/Windows/ppsspp.rc index 24bf02b4df..bc7e30e064 100644 --- a/Windows/ppsspp.rc +++ b/Windows/ppsspp.rc @@ -307,7 +307,7 @@ END #include "aboutbox.rc" #endif -IDD_MEMORY DIALOGEX 0, 0, 700, 287 +IDD_MEMORY DIALOGEX 0, 0, 700, 310 STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME EXSTYLE WS_EX_TOOLWINDOW CAPTION "Memory View" @@ -329,6 +329,8 @@ BEGIN EDITTEXT IDC_SEARCH_BOX,397,6,100,13,ES_AUTOHSCROLL PUSHBUTTON "Search",IDC_BUTTON_SEARCH,504,5,50,14 LTEXT "Search:",IDC_STATIC,369,8,27,8 + + CONTROL "",IDC_MEMVIEW_STATUS,"msctls_statusbar32",WS_CHILD | WS_VISIBLE,0,286,700,24 END IDD_INPUTBOX DIALOGEX 0, 0, 163, 55 diff --git a/Windows/resource.h b/Windows/resource.h index a13d9b3846..96a4fcab50 100644 --- a/Windows/resource.h +++ b/Windows/resource.h @@ -375,6 +375,7 @@ #define IDC_GEDBG_STEPCOUNT_COMBO 40203 #define ID_FILE_DUMP_VIDEO_OUTPUT 40204 #define ID_EMULATION_CHAT 40205 +#define IDC_MEMVIEW_STATUS 40206 // Dummy option to let the buffered rendering hotkey cycle through all the options. #define ID_OPTIONS_BUFFEREDRENDERINGDUMMY 40500 @@ -387,7 +388,7 @@ #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 256 -#define _APS_NEXT_COMMAND_VALUE 40200 +#define _APS_NEXT_COMMAND_VALUE 40207 #define _APS_NEXT_CONTROL_VALUE 1202 #define _APS_NEXT_SYMED_VALUE 101 #endif