mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-22 18:53:28 +01:00
SPU/Debugger: Improve debugging reservations
Simplify and make the debugging results more consistent.
This commit is contained in:
parent
9d8f4d5cfa
commit
a71bdc761e
@ -4248,6 +4248,8 @@ s64 spu_thread::get_ch_value(u32 ch)
|
|||||||
resrv_mem = vm::get_super_ptr<decltype(rdata)>(raddr);
|
resrv_mem = vm::get_super_ptr<decltype(rdata)>(raddr);
|
||||||
std::shared_ptr<utils::shm> rdata_shm;
|
std::shared_ptr<utils::shm> rdata_shm;
|
||||||
|
|
||||||
|
const u32 old_raddr = raddr;
|
||||||
|
|
||||||
// Does not need to safe-access reservation if LR is the only event masked
|
// Does not need to safe-access reservation if LR is the only event masked
|
||||||
// Because it's either an access violation or a livelock if an invalid memory is passed
|
// Because it's either an access violation or a livelock if an invalid memory is passed
|
||||||
if (raddr && mask1 > SPU_EVENT_LR)
|
if (raddr && mask1 > SPU_EVENT_LR)
|
||||||
@ -4293,14 +4295,6 @@ s64 spu_thread::get_ch_value(u32 ch)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_paused(old))
|
|
||||||
{
|
|
||||||
// Ensure spu_thread::rdata's stagnancy while the thread is paused for debugging purposes
|
|
||||||
check_state();
|
|
||||||
state += cpu_flag::wait;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Optimized check
|
// Optimized check
|
||||||
if (raddr && (!vm::check_addr(raddr) || rtime != vm::reservation_acquire(raddr) || !cmp_rdata(rdata, *resrv_mem)))
|
if (raddr && (!vm::check_addr(raddr) || rtime != vm::reservation_acquire(raddr) || !cmp_rdata(rdata, *resrv_mem)))
|
||||||
{
|
{
|
||||||
@ -4326,11 +4320,6 @@ s64 spu_thread::get_ch_value(u32 ch)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_paused(old))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!vm::check_addr(_this->raddr) || !cmp_rdata(_this->rdata, *_this->resrv_mem))
|
if (!vm::check_addr(_this->raddr) || !cmp_rdata(_this->rdata, *_this->resrv_mem))
|
||||||
{
|
{
|
||||||
_this->set_events(SPU_EVENT_LR);
|
_this->set_events(SPU_EVENT_LR);
|
||||||
@ -4355,6 +4344,18 @@ s64 spu_thread::get_ch_value(u32 ch)
|
|||||||
}
|
}
|
||||||
|
|
||||||
wakeup_delay();
|
wakeup_delay();
|
||||||
|
|
||||||
|
if (is_paused(state - cpu_flag::suspend))
|
||||||
|
{
|
||||||
|
if (!raddr && old_raddr)
|
||||||
|
{
|
||||||
|
// Restore reservation address temporarily for debugging use
|
||||||
|
raddr = old_raddr;
|
||||||
|
check_state();
|
||||||
|
raddr = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
check_state();
|
check_state();
|
||||||
return events.events & mask1;
|
return events.events & mask1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user