Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breakpoints: Fix crash after clearing all memory breakpoints #8669

Merged
merged 1 commit into from Mar 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions Source/Core/Core/PowerPC/BreakPoints.cpp
Expand Up @@ -196,6 +196,15 @@ void MemChecks::Remove(u32 address)
});
}

void MemChecks::Clear()
{
Core::RunAsCPUThread([&] {
m_mem_checks.clear();
JitInterface::ClearCache();
PowerPC::DBATUpdated();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you explain why this is required?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bug doesn't occur when memory point is deleted by pressing Delete button (not Clear button), so I compared MemChecks::Remove and MemChecks::Clear.
I don't know how it works internally but compared to Memchecks::Remove, MemChecks::Clear lacks JitInterface::ClearCache and PowerPC::DBATUpdated.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, that makes sense.

});
}

TMemCheck* MemChecks::GetMemCheck(u32 address, size_t size)
{
const auto iter =
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/PowerPC/BreakPoints.h
Expand Up @@ -88,7 +88,7 @@ class MemChecks
bool OverlapsMemcheck(u32 address, u32 length) const;
void Remove(u32 address);

void Clear() { m_mem_checks.clear(); }
void Clear();
bool HasAny() const { return !m_mem_checks.empty(); }

private:
Expand Down