mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Debugger: Show memory tag info in status bar.
This commit is contained in:
1 parent
b1a2090e67
commit
d48bb7e105
7 files changed
+29
-11
No files matched your search
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<MemBlockInfo> 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)
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "Windows/stdafx.h"
|
||||
#include <windowsx.h>
|
||||
#include <commctrl.h>
|
||||
#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);
|
||||
|
||||
@@ -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:
|
||||
|
||||
+3
-1
@@ -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
|
||||
|
||||
+2
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user