mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-09 00:11:24 +12:00
debugger: Fix single stepping (#9793)
This commit is contained in:
parent
e76d8eb046
commit
20eb4352fb
7 changed files with 58 additions and 11 deletions
|
@ -667,6 +667,26 @@ bool cpu_thread::check_state() noexcept
|
|||
store = true;
|
||||
}
|
||||
|
||||
// Can't process dbg_step if we only paused temporarily
|
||||
if (cpu_can_stop && flags & cpu_flag::dbg_step)
|
||||
{
|
||||
if (u32 pc = get_pc(), *pc2 = get_pc2(); pc != umax && pc2)
|
||||
{
|
||||
if (pc != *pc2)
|
||||
{
|
||||
flags -= cpu_flag::dbg_step;
|
||||
flags += cpu_flag::dbg_pause;
|
||||
store = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Can't test, ignore flag
|
||||
flags -= cpu_flag::dbg_step;
|
||||
store = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Atomically clean wait flag and escape
|
||||
if (!(flags & (cpu_flag::exit + cpu_flag::ret + cpu_flag::stop)))
|
||||
{
|
||||
|
@ -703,14 +723,6 @@ bool cpu_thread::check_state() noexcept
|
|||
retval = cpu_can_stop;
|
||||
}
|
||||
|
||||
if (cpu_can_stop && flags & cpu_flag::dbg_step)
|
||||
{
|
||||
// Can't process dbg_step if we only paused temporarily
|
||||
flags += cpu_flag::dbg_pause;
|
||||
flags -= cpu_flag::dbg_step;
|
||||
store = true;
|
||||
}
|
||||
|
||||
escape = true;
|
||||
state1 = flags;
|
||||
return store;
|
||||
|
@ -876,6 +888,29 @@ u32 cpu_thread::get_pc() const
|
|||
return pc ? atomic_storage<u32>::load(*pc) : UINT32_MAX;
|
||||
}
|
||||
|
||||
u32* cpu_thread::get_pc2()
|
||||
{
|
||||
switch (id_type())
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
return &static_cast<ppu_thread*>(this)->dbg_step_pc;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
return &static_cast<spu_thread*>(this)->dbg_step_pc;
|
||||
}
|
||||
case 0x55:
|
||||
{
|
||||
const auto ctrl = static_cast<rsx::thread*>(this)->ctrl;
|
||||
return ctrl ? &static_cast<rsx::thread*>(this)->dbg_step_pc : nullptr;
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::string cpu_thread::dump_all() const
|
||||
{
|
||||
std::string ret = cpu_thread::dump_misc();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue