mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Debugger: Add initial UI for mem info type.
Does not visualize yet, just implements the selection interface.
This commit is contained in:
1 parent
616f5ddc5a
commit
616850663c
5 files changed
+66
-58
No files matched your search
@@ -797,3 +797,10 @@ void CtrlMemView::toggleOffsetScale(CommonToggles toggle)
|
||||
updateStatusBarText();
|
||||
redraw();
|
||||
}
|
||||
|
||||
void CtrlMemView::setHighlightType(MemBlockFlags flags) {
|
||||
if (highlightFlags_ != flags) {
|
||||
highlightFlags_ = flags;
|
||||
redraw();
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,8 @@
|
||||
//
|
||||
//To get a class instance to be able to access it, just use getFrom(HWND wnd).
|
||||
|
||||
#include "../../Core/Debugger/DebugInterface.h"
|
||||
#include "Core/Debugger/DebugInterface.h"
|
||||
#include "Core/Debugger/MemBlockInfo.h"
|
||||
|
||||
enum OffsetSpacing {
|
||||
offsetSpace = 3, // the number of blank lines that should be left to make space for the offsets
|
||||
@@ -63,6 +64,9 @@ class CtrlMemView
|
||||
bool hasFocus;
|
||||
static wchar_t szClassName[];
|
||||
DebugInterface *debugger;
|
||||
|
||||
MemBlockFlags highlightFlags_ = MemBlockFlags::ALLOC;
|
||||
|
||||
void updateStatusBarText();
|
||||
void search(bool continueSearch);
|
||||
public:
|
||||
@@ -99,4 +103,5 @@ public:
|
||||
void drawOffsetScale(HDC hdc);
|
||||
void toggleOffsetScale(CommonToggles toggle);
|
||||
void toggleStringSearch(CommonToggles toggle);
|
||||
void setHighlightType(MemBlockFlags flags);
|
||||
};
|
||||
@@ -4,11 +4,12 @@
|
||||
#include <windowsx.h>
|
||||
#include "..\resource.h"
|
||||
|
||||
#include "Common/System/Display.h"
|
||||
#include "Common/Data/Encoding/Utf8.h"
|
||||
#include "Common/System/Display.h"
|
||||
|
||||
#include "Core/Debugger/MemBlockInfo.h"
|
||||
#include "Core/Debugger/SymbolMap.h"
|
||||
#include "Core/MIPS/MIPSDebugInterface.h" // BAD
|
||||
#include "Core/MIPS/MIPSDebugInterface.h"
|
||||
|
||||
#include "Debugger_MemoryDlg.h"
|
||||
#include "CtrlMemView.h"
|
||||
@@ -68,6 +69,18 @@ CMemoryDlg::CMemoryDlg(HINSTANCE _hInstance, HWND _hParent, DebugInterface *_cpu
|
||||
searchBoxHdl = GetDlgItem(m_hDlg, IDC_SEARCH_BOX);
|
||||
srcListHdl = GetDlgItem(m_hDlg, IDC_SEARCH_RESULTS);
|
||||
|
||||
layerDropdown_ = GetDlgItem(m_hDlg, IDC_REGIONS);
|
||||
ComboBox_ResetContent(layerDropdown_);
|
||||
ComboBox_AddString(layerDropdown_, L"Show allocations");
|
||||
ComboBox_SetItemData(layerDropdown_, 0, MemBlockFlags::ALLOC);
|
||||
ComboBox_AddString(layerDropdown_, L"Show sub allocations");
|
||||
ComboBox_SetItemData(layerDropdown_, 1, MemBlockFlags::SUB_ALLOC);
|
||||
ComboBox_AddString(layerDropdown_, L"Show writes");
|
||||
ComboBox_SetItemData(layerDropdown_, 2, MemBlockFlags::WRITE);
|
||||
ComboBox_AddString(layerDropdown_, L"Show textures");
|
||||
ComboBox_SetItemData(layerDropdown_, 3, MemBlockFlags::TEXTURE);
|
||||
ComboBox_SetCurSel(layerDropdown_, 0);
|
||||
|
||||
memView = CtrlMemView::getFrom(memViewHdl);
|
||||
memView->setDebugger(_cpu);
|
||||
|
||||
@@ -118,66 +131,53 @@ void CMemoryDlg::searchBoxRedraw(std::vector<u32> results) {
|
||||
void CMemoryDlg::NotifyMapLoaded()
|
||||
{
|
||||
if (m_hDlg)
|
||||
{
|
||||
g_symbolMap->FillSymbolListBox(symListHdl,ST_DATA);
|
||||
int sel = ComboBox_GetCurSel(memViewHdl);
|
||||
ComboBox_ResetContent(memViewHdl);
|
||||
/*
|
||||
for (int i = 0; i < cpu->getMemMap()->numRegions; i++)
|
||||
{
|
||||
// TODO: wchar_t
|
||||
int n = ComboBox_AddString(lb,cpu->getMemMap()->regions[i].name);
|
||||
ComboBox_SetItemData(lb,n,cpu->getMemMap()->regions[i].start);
|
||||
}*/
|
||||
ComboBox_SetCurSel(memViewHdl,sel>=0?sel:0);
|
||||
}
|
||||
g_symbolMap->FillSymbolListBox(symListHdl, ST_DATA);
|
||||
Update();
|
||||
}
|
||||
|
||||
BOOL CMemoryDlg::DlgProc(UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch(message){
|
||||
case WM_COMMAND:{
|
||||
BOOL CMemoryDlg::DlgProc(UINT message, WPARAM wParam, LPARAM lParam) {
|
||||
wchar_t temp[256]{};
|
||||
int n;
|
||||
|
||||
switch (message) {
|
||||
case WM_COMMAND: {
|
||||
HWND lb = GetDlgItem(m_hDlg, LOWORD(wParam));
|
||||
switch (LOWORD(wParam)){
|
||||
switch (LOWORD(wParam)) {
|
||||
case IDC_REGIONS:
|
||||
switch (HIWORD(wParam)) {
|
||||
case LBN_DBLCLK:{
|
||||
int n = ComboBox_GetCurSel(lb);
|
||||
if (n != -1) {
|
||||
unsigned int addr = (unsigned int)ComboBox_GetItemData(lb,n);
|
||||
memView->gotoAddr(addr);
|
||||
}
|
||||
case CBN_SELENDOK:
|
||||
n = ComboBox_GetCurSel(lb);
|
||||
if (n != CB_ERR) {
|
||||
MemBlockFlags flags = (MemBlockFlags)ComboBox_GetItemData(lb, n);
|
||||
memView->setHighlightType(MemBlockFlags(flags));
|
||||
}
|
||||
break;
|
||||
};
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case IDC_SYMBOLS:
|
||||
switch (HIWORD(wParam)) {
|
||||
case LBN_DBLCLK:{
|
||||
int n = ListBox_GetCurSel(lb);
|
||||
if (n != -1) {
|
||||
unsigned int addr = (unsigned int)ListBox_GetItemData(lb,n);
|
||||
memView->gotoAddr(addr);
|
||||
}
|
||||
case LBN_DBLCLK:
|
||||
n = ListBox_GetCurSel(lb);
|
||||
if (n != -1) {
|
||||
unsigned int addr = (unsigned int)ListBox_GetItemData(lb,n);
|
||||
memView->gotoAddr(addr);
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
};
|
||||
case IDC_SEARCH_RESULTS:
|
||||
switch (HIWORD(wParam)) {
|
||||
case LBN_DBLCLK: {
|
||||
int n = ListBox_GetCurSel(lb);
|
||||
if (n != -1) {
|
||||
unsigned int addr = (unsigned int)ListBox_GetItemData(lb, n);
|
||||
memView->gotoAddr(addr);
|
||||
}
|
||||
case LBN_DBLCLK:
|
||||
n = ListBox_GetCurSel(lb);
|
||||
if (n != -1) {
|
||||
unsigned int addr = (unsigned int)ListBox_GetItemData(lb, n);
|
||||
memView->gotoAddr(addr);
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
};
|
||||
break;
|
||||
case IDC_SHOWOFFSETS:
|
||||
switch (HIWORD(wParam))
|
||||
{
|
||||
switch (HIWORD(wParam)) {
|
||||
case BN_CLICKED:
|
||||
if (SendDlgItemMessage(m_hDlg, IDC_SHOWOFFSETS, BM_GETCHECK, 0, 0))
|
||||
memView->toggleOffsetScale(On);
|
||||
@@ -187,10 +187,8 @@ BOOL CMemoryDlg::DlgProc(UINT message, WPARAM wParam, LPARAM lParam)
|
||||
}
|
||||
break;
|
||||
case IDC_BUTTON_SEARCH:
|
||||
switch (HIWORD(wParam))
|
||||
{
|
||||
switch (HIWORD(wParam)) {
|
||||
case BN_CLICKED:
|
||||
wchar_t temp[256];
|
||||
GetWindowText(searchBoxHdl, temp, 255);
|
||||
std::vector<u32> results = memView->searchString(ConvertWStringToUTF8(temp).c_str());
|
||||
if (results.size() > 0){
|
||||
@@ -198,14 +196,14 @@ BOOL CMemoryDlg::DlgProc(UINT message, WPARAM wParam, LPARAM lParam)
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case WM_DEB_MAPLOADED:
|
||||
NotifyMapLoaded();
|
||||
break;
|
||||
case WM_DEB_GOTOADDRESSEDIT:{
|
||||
wchar_t temp[256];
|
||||
case WM_DEB_GOTOADDRESSEDIT: {
|
||||
u32 addr;
|
||||
GetWindowText(editWnd,temp,255);
|
||||
|
||||
@@ -223,10 +221,7 @@ BOOL CMemoryDlg::DlgProc(UINT message, WPARAM wParam, LPARAM lParam)
|
||||
return TRUE;
|
||||
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
return TRUE;
|
||||
|
||||
case WM_SIZE:
|
||||
Size();
|
||||
|
||||
@@ -17,6 +17,7 @@ private:
|
||||
RECT winRect, srRect;
|
||||
CtrlMemView *memView;
|
||||
HWND memViewHdl, symListHdl, editWnd, searchBoxHdl, srcListHdl;
|
||||
HWND layerDropdown_;
|
||||
BOOL DlgProc(UINT message, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
public:
|
||||
|
||||
+3
-3
@@ -321,14 +321,14 @@ BEGIN
|
||||
CONTROL "Normal",IDC_MODENORMAL,"Button",BS_AUTORADIOBUTTON | WS_GROUP,198,9,40,9
|
||||
CONTROL "Symbols",IDC_MODESYMBOLS,"Button",BS_AUTORADIOBUTTON,241,9,43,8
|
||||
GROUPBOX "Mode",IDC_STATIC,191,0,104,22
|
||||
AUTOCHECKBOX "Show Offsets",IDC_SHOWOFFSETS,300,9,55,8
|
||||
COMBOBOX IDC_REGIONS,87,5,88,139,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
AUTOCHECKBOX "Show Offsets",IDC_SHOWOFFSETS,300,9,55,8
|
||||
COMBOBOX IDC_REGIONS,95,5,88,139,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
|
||||
LISTBOX IDC_SEARCH_RESULTS,557,14,140,272,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
|
||||
|
||||
EDITTEXT IDC_SEARCH_BOX,397,6,100,13,ES_AUTOHSCROLL
|
||||
PUSHBUTTON "Search",IDC_BUTTON_SEARCH,504,5,50,14
|
||||
LTEXT "Search:",IDC_STATIC,369,6,27,8
|
||||
LTEXT "Search:",IDC_STATIC,369,8,27,8
|
||||
END
|
||||
|
||||
IDD_INPUTBOX DIALOGEX 0, 0, 163, 55
|
||||
|
||||
Reference in new issue
Block a user