1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 02:32:36 +01:00

Avoid silent failures in RSX violation handler

This commit is contained in:
Rui Pinheiro 2018-09-06 22:20:39 +01:00 committed by kd-11
parent 06572c6011
commit 13faf4e816

View File

@ -1089,17 +1089,36 @@ bool handle_access_violation(u32 addr, bool is_writing, x64_context* context)
const auto cpu = get_current_cpu_thread();
if (rsx::g_access_violation_handler && rsx::g_access_violation_handler(addr, is_writing))
if (rsx::g_access_violation_handler)
{
bool handled = false;
try
{
handled = rsx::g_access_violation_handler(addr, is_writing);
}
catch (std::runtime_error &e)
{
LOG_FATAL(RSX, "g_access_violation_handler(0x%x, %d): %s", addr, is_writing, e.what());
if (cpu)
{
vm::temporary_unlock(*cpu);
cpu->state += cpu_flag::dbg_pause;
cpu->test_state();
return false;
}
}
if (handled)
{
g_tls_fault_rsx++;
if (cpu)
{
cpu->test_state();
}
return true;
}
}
auto code = (const u8*)RIP(context);
@ -1384,7 +1403,6 @@ static LONG exception_handler(PEXCEPTION_POINTERS pExp)
return EXCEPTION_CONTINUE_EXECUTION;
}
}
return EXCEPTION_CONTINUE_SEARCH;
}