Hook up the new (bare-bones) ImGui debug window to GPU stepping, fix stepping.

This commit is contained in:
Henrik Rydgård committed 2024-12-05 00:51:59 +01:00
1 parent 11819e87cf
commit 474e7acf54
16 files changed
+89 -63

No files matched your search

+3 -17
View File
@@ -39,8 +39,7 @@ std::recursive_mutex DisassemblyManager::entriesLock_;
DebugInterface* DisassemblyManager::cpu;
int DisassemblyManager::maxParamChars = 29;
bool isInInterval(u32 start, u32 size, u32 value)
{
bool isInInterval(u32 start, u32 size, u32 value) {
return start <= value && value <= (start+size-1);
}
@@ -196,7 +195,6 @@ void DisassemblyManager::analyze(u32 address, u32 size = 1024)
if (!PSP_IsInited())
return;
auto memLock = Memory::Lock();
std::lock_guard<std::recursive_mutex> guard(entriesLock_);
auto it = findDisassemblyEntry(entries, address, false);
if (it != entries.end())
@@ -285,12 +283,9 @@ std::vector<BranchLine> DisassemblyManager::getBranchLines(u32 start, u32 size)
void DisassemblyManager::getLine(u32 address, bool insertSymbols, DisassemblyLineInfo &dest, DebugInterface *cpuDebug)
{
// This is here really to avoid lock ordering issues.
auto memLock = Memory::Lock();
std::lock_guard<std::recursive_mutex> guard(entriesLock_);
auto it = findDisassemblyEntry(entries,address,false);
if (it == entries.end())
{
if (it == entries.end()) {
analyze(address);
it = findDisassemblyEntry(entries,address,false);
}
@@ -319,7 +314,6 @@ void DisassemblyManager::getLine(u32 address, bool insertSymbols, DisassemblyLin
u32 DisassemblyManager::getStartAddress(u32 address)
{
auto memLock = Memory::Lock();
std::lock_guard<std::recursive_mutex> guard(entriesLock_);
auto it = findDisassemblyEntry(entries,address,false);
if (it == entries.end())
@@ -337,15 +331,13 @@ u32 DisassemblyManager::getStartAddress(u32 address)
u32 DisassemblyManager::getNthPreviousAddress(u32 address, int n)
{
auto memLock = Memory::Lock();
std::lock_guard<std::recursive_mutex> guard(entriesLock_);
while (Memory::IsValidAddress(address))
{
auto it = findDisassemblyEntry(entries,address,false);
if (it == entries.end())
break;
while (it != entries.end())
{
while (it != entries.end()) {
DisassemblyEntry* entry = it->second;
int oldLineNum = entry->getLineNum(address,true);
if (n <= oldLineNum)
@@ -366,7 +358,6 @@ u32 DisassemblyManager::getNthPreviousAddress(u32 address, int n)
u32 DisassemblyManager::getNthNextAddress(u32 address, int n)
{
auto memLock = Memory::Lock();
std::lock_guard<std::recursive_mutex> guard(entriesLock_);
while (Memory::IsValidAddress(address))
{
@@ -401,7 +392,6 @@ DisassemblyManager::~DisassemblyManager() {
void DisassemblyManager::clear()
{
auto memLock = Memory::Lock();
std::lock_guard<std::recursive_mutex> guard(entriesLock_);
for (auto it = entries.begin(); it != entries.end(); it++)
{
@@ -412,7 +402,6 @@ void DisassemblyManager::clear()
DisassemblyFunction::DisassemblyFunction(u32 _address, u32 _size): address(_address), size(_size)
{
auto memLock = Memory::Lock();
if (!PSP_IsInited())
return;
@@ -426,7 +415,6 @@ DisassemblyFunction::~DisassemblyFunction() {
void DisassemblyFunction::recheck()
{
auto memLock = Memory::Lock();
if (!PSP_IsInited())
return;
@@ -888,7 +876,6 @@ bool DisassemblyMacro::disassemble(u32 address, DisassemblyLineInfo &dest, bool
DisassemblyData::DisassemblyData(u32 _address, u32 _size, DataType _type): address(_address), size(_size), type(_type)
{
auto memLock = Memory::Lock();
if (!PSP_IsInited())
return;
@@ -898,7 +885,6 @@ DisassemblyData::DisassemblyData(u32 _address, u32 _size, DataType _type): addre
void DisassemblyData::recheck()
{
auto memLock = Memory::Lock();
if (!PSP_IsInited())
return;