mirror of
https://github.com/Atmosphere-NX/Atmosphere-libs.git
synced 2025-06-27 05:22:46 +02:00
kern: improve single-step around user-exception entry
This commit is contained in:
parent
2b91674b42
commit
0a262ed268
@ -109,13 +109,9 @@ namespace ams::kern::arch::arm64 {
|
||||
break;
|
||||
}
|
||||
|
||||
/* If we should, clear the thread's state as single-step. */
|
||||
/* In the event that we return from this exception, we want SPSR.SS set so that we advance an instruction if single-stepping. */
|
||||
#if defined(MESOSPHERE_ENABLE_HARDWARE_SINGLE_STEP)
|
||||
if (AMS_UNLIKELY(GetCurrentThread().IsSingleStep())) {
|
||||
GetCurrentThread().ClearSingleStep();
|
||||
cpu::MonitorDebugSystemControlRegisterAccessor().SetSoftwareStep(false).Store();
|
||||
cpu::EnsureInstructionConsistency();
|
||||
}
|
||||
context->psr |= (1ul << 21);
|
||||
#endif
|
||||
|
||||
/* If we should process the user exception (and it's not a breakpoint), try to enter. */
|
||||
@ -224,6 +220,15 @@ namespace ams::kern::arch::arm64 {
|
||||
}
|
||||
}
|
||||
|
||||
/* If we should, clear the thread's state as single-step. */
|
||||
#if defined(MESOSPHERE_ENABLE_HARDWARE_SINGLE_STEP)
|
||||
if (AMS_UNLIKELY(GetCurrentThread().IsSingleStep())) {
|
||||
GetCurrentThread().ClearSingleStep();
|
||||
cpu::MonitorDebugSystemControlRegisterAccessor().SetSoftwareStep(false).Store();
|
||||
cpu::EnsureInstructionConsistency();
|
||||
}
|
||||
#endif
|
||||
|
||||
{
|
||||
/* Collect additional information based on the ec. */
|
||||
ams::svc::DebugException exception;
|
||||
|
Loading…
Reference in New Issue
Block a user