mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Extract FormatStateRow() from the Win32 GE debugger to GPU/Debugger/Registers
This commit is contained in:
1 parent
0c524b712e
commit
21997784bf
23 files changed
+927
-807
No files matched your search
@@ -158,7 +158,7 @@ void CtrlThreadList::showMenu(int itemIndex, const POINT &pt)
|
||||
}
|
||||
}
|
||||
|
||||
void CtrlThreadList::GetColumnText(wchar_t* dest, int row, int col)
|
||||
void CtrlThreadList::GetColumnText(wchar_t* dest, size_t destSize, int row, int col)
|
||||
{
|
||||
if (row < 0 || row >= (int)threads.size()) {
|
||||
return;
|
||||
@@ -457,7 +457,7 @@ int CtrlBreakpointList::getBreakpointIndex(int itemIndex, bool& isMemory)
|
||||
return -1;
|
||||
}
|
||||
|
||||
void CtrlBreakpointList::GetColumnText(wchar_t* dest, int row, int col)
|
||||
void CtrlBreakpointList::GetColumnText(wchar_t* dest, size_t destSize, int row, int col)
|
||||
{
|
||||
if (!PSP_IsInited()) {
|
||||
return;
|
||||
@@ -512,10 +512,8 @@ void CtrlBreakpointList::GetColumnText(wchar_t* dest, int row, int col)
|
||||
wsprintf(dest,L"0x%08X",mc.end-mc.start);
|
||||
} else {
|
||||
const std::string sym = g_symbolMap->GetLabelString(displayedBreakPoints_[index].addr);
|
||||
if (!sym.empty())
|
||||
{
|
||||
std::wstring s = ConvertUTF8ToWString(sym);
|
||||
wcscpy(dest,s.c_str());
|
||||
if (!sym.empty()) {
|
||||
ConvertUTF8ToWString(dest, destSize, sym);
|
||||
} else {
|
||||
wcscpy(dest,L"-");
|
||||
}
|
||||
@@ -529,8 +527,7 @@ void CtrlBreakpointList::GetColumnText(wchar_t* dest, int row, int col)
|
||||
} else {
|
||||
char temp[256];
|
||||
disasm->getOpcodeText(displayedBreakPoints_[index].addr, temp, sizeof(temp));
|
||||
std::wstring s = ConvertUTF8ToWString(temp);
|
||||
wcscpy(dest,s.c_str());
|
||||
ConvertUTF8ToWString(dest, destSize, temp);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -669,7 +666,7 @@ bool CtrlStackTraceView::WindowMessage(UINT msg, WPARAM wParam, LPARAM lParam, L
|
||||
return false;
|
||||
}
|
||||
|
||||
void CtrlStackTraceView::GetColumnText(wchar_t* dest, int row, int col)
|
||||
void CtrlStackTraceView::GetColumnText(wchar_t* dest, size_t destSize, int row, int col)
|
||||
{
|
||||
// We should have emptied the list if g_symbolMap is nullptr, but apparently we don't,
|
||||
// so let's have a sanity check here.
|
||||
@@ -779,16 +776,15 @@ bool CtrlModuleList::WindowMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESU
|
||||
return false;
|
||||
}
|
||||
|
||||
void CtrlModuleList::GetColumnText(wchar_t* dest, int row, int col)
|
||||
void CtrlModuleList::GetColumnText(wchar_t* dest, size_t destSize, int row, int col)
|
||||
{
|
||||
if (row < 0 || row >= (int)modules.size()) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (col)
|
||||
{
|
||||
switch (col) {
|
||||
case ML_NAME:
|
||||
wcscpy(dest,ConvertUTF8ToWString(modules[row].name).c_str());
|
||||
ConvertUTF8ToWString(dest, destSize, modules[row].name);
|
||||
break;
|
||||
case ML_ADDRESS:
|
||||
wsprintf(dest,L"%08X",modules[row].address);
|
||||
@@ -887,7 +883,7 @@ bool CtrlWatchList::WindowMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESUL
|
||||
return false;
|
||||
}
|
||||
|
||||
void CtrlWatchList::GetColumnText(wchar_t *dest, int row, int col) {
|
||||
void CtrlWatchList::GetColumnText(wchar_t *dest, size_t destSize, int row, int col) {
|
||||
const auto &watch = watches_[row];
|
||||
switch (col) {
|
||||
case WL_NAME:
|
||||
@@ -913,12 +909,12 @@ void CtrlWatchList::GetColumnText(wchar_t *dest, int row, int col) {
|
||||
break;
|
||||
case WatchFormat::FLOAT:
|
||||
memcpy(&valuef, &value, sizeof(valuef));
|
||||
swprintf_s(dest, 255, L"%f", valuef);
|
||||
swprintf_s(dest, destSize, L"%f", valuef);
|
||||
break;
|
||||
case WatchFormat::STR:
|
||||
if (Memory::IsValidAddress(value)) {
|
||||
uint32_t len = Memory::ValidSize(value, 255);
|
||||
swprintf_s(dest, 255, L"%.*S", len, Memory::GetCharPointer(value));
|
||||
swprintf_s(dest, destSize, L"%.*S", len, Memory::GetCharPointer(value));
|
||||
} else {
|
||||
wsprintf(dest, L"(0x%08X)", value);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ public:
|
||||
const char* getCurrentThreadName();
|
||||
protected:
|
||||
bool WindowMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT &returnValue) override;
|
||||
void GetColumnText(wchar_t *dest, int row, int col) override;
|
||||
void GetColumnText(wchar_t *dest, size_t destSize, int row, int col) override;
|
||||
int GetRowCount() override { return (int) threads.size(); }
|
||||
void OnDoubleClick(int itemIndex, int column) override;
|
||||
void OnRightClick(int itemIndex, int column, const POINT &point) override;
|
||||
@@ -40,7 +40,7 @@ public:
|
||||
void reloadBreakpoints();
|
||||
protected:
|
||||
bool WindowMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT &returnValue) override;
|
||||
void GetColumnText(wchar_t *dest, int row, int col) override;
|
||||
void GetColumnText(wchar_t *dest, size_t destSize, int row, int col) override;
|
||||
int GetRowCount() override { return getTotalBreakpointCount(); }
|
||||
void OnDoubleClick(int itemIndex, int column) override;
|
||||
void OnRightClick(int itemIndex, int column, const POINT &point) override;
|
||||
@@ -68,7 +68,7 @@ public:
|
||||
void loadStackTrace();
|
||||
protected:
|
||||
bool WindowMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT &returnValue) override;
|
||||
void GetColumnText(wchar_t *dest, int row, int col) override;
|
||||
void GetColumnText(wchar_t *dest, size_t destSize, int row, int col) override;
|
||||
int GetRowCount() override { return (int)frames.size(); }
|
||||
void OnDoubleClick(int itemIndex, int column) override;
|
||||
private:
|
||||
@@ -84,7 +84,7 @@ public:
|
||||
void loadModules();
|
||||
protected:
|
||||
bool WindowMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT &returnValue) override;
|
||||
void GetColumnText(wchar_t *dest, int row, int col) override;
|
||||
void GetColumnText(wchar_t *dest, size_t destSize, int row, int col) override;
|
||||
int GetRowCount() override { return (int)modules.size(); }
|
||||
void OnDoubleClick(int itemIndex, int column) override;
|
||||
private:
|
||||
@@ -99,7 +99,7 @@ public:
|
||||
|
||||
protected:
|
||||
bool WindowMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT &returnValue) override;
|
||||
void GetColumnText(wchar_t *dest, int row, int col) override;
|
||||
void GetColumnText(wchar_t *dest, size_t destSize, int row, int col) override;
|
||||
int GetRowCount() override { return (int)watches_.size(); }
|
||||
void OnRightClick(int itemIndex, int column, const POINT &point) override;
|
||||
bool ListenRowPrePaint() override { return true; }
|
||||
|
||||
Reference in new issue
Block a user