diff options
| author | 2022-06-06 12:56:01 -0400 | |
|---|---|---|
| committer | 2022-06-16 13:18:07 -0400 | |
| commit | 208ed712f42cfd277405a22663197dc1c5e84cfe (patch) | |
| tree | 56c1a3cbddf392d700e817cd4093564e3f096013 /src/core/arm/arm_interface.h | |
| parent | Merge pull request #8457 from liamwhite/kprocess-suspend (diff) | |
| download | yuzu-208ed712f42cfd277405a22663197dc1c5e84cfe.tar.gz yuzu-208ed712f42cfd277405a22663197dc1c5e84cfe.tar.xz yuzu-208ed712f42cfd277405a22663197dc1c5e84cfe.zip | |
core/debugger: memory breakpoint support
Diffstat (limited to 'src/core/arm/arm_interface.h')
| -rw-r--r-- | src/core/arm/arm_interface.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/core/arm/arm_interface.h b/src/core/arm/arm_interface.h index 66f6107e9..4e431e27a 100644 --- a/src/core/arm/arm_interface.h +++ b/src/core/arm/arm_interface.h | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <array> | 7 | #include <array> |
| 8 | #include <span> | ||
| 8 | #include <vector> | 9 | #include <vector> |
| 9 | 10 | ||
| 10 | #include <dynarmic/interface/halt_reason.h> | 11 | #include <dynarmic/interface/halt_reason.h> |
| @@ -19,13 +20,16 @@ struct PageTable; | |||
| 19 | 20 | ||
| 20 | namespace Kernel { | 21 | namespace Kernel { |
| 21 | enum class VMAPermission : u8; | 22 | enum class VMAPermission : u8; |
| 22 | } | 23 | enum class DebugWatchpointType : u8; |
| 24 | struct DebugWatchpoint; | ||
| 25 | } // namespace Kernel | ||
| 23 | 26 | ||
| 24 | namespace Core { | 27 | namespace Core { |
| 25 | class System; | 28 | class System; |
| 26 | class CPUInterruptHandler; | 29 | class CPUInterruptHandler; |
| 27 | 30 | ||
| 28 | using CPUInterrupts = std::array<CPUInterruptHandler, Core::Hardware::NUM_CPU_CORES>; | 31 | using CPUInterrupts = std::array<CPUInterruptHandler, Core::Hardware::NUM_CPU_CORES>; |
| 32 | using WatchpointArray = std::array<Kernel::DebugWatchpoint, Core::Hardware::NUM_WATCHPOINTS>; | ||
| 29 | 33 | ||
| 30 | /// Generic ARMv8 CPU interface | 34 | /// Generic ARMv8 CPU interface |
| 31 | class ARM_Interface { | 35 | class ARM_Interface { |
| @@ -170,6 +174,7 @@ public: | |||
| 170 | virtual void SaveContext(ThreadContext64& ctx) = 0; | 174 | virtual void SaveContext(ThreadContext64& ctx) = 0; |
| 171 | virtual void LoadContext(const ThreadContext32& ctx) = 0; | 175 | virtual void LoadContext(const ThreadContext32& ctx) = 0; |
| 172 | virtual void LoadContext(const ThreadContext64& ctx) = 0; | 176 | virtual void LoadContext(const ThreadContext64& ctx) = 0; |
| 177 | void LoadWatchpointArray(const WatchpointArray& wp); | ||
| 173 | 178 | ||
| 174 | /// Clears the exclusive monitor's state. | 179 | /// Clears the exclusive monitor's state. |
| 175 | virtual void ClearExclusiveState() = 0; | 180 | virtual void ClearExclusiveState() = 0; |
| @@ -198,18 +203,24 @@ public: | |||
| 198 | static constexpr Dynarmic::HaltReason break_loop = Dynarmic::HaltReason::UserDefined2; | 203 | static constexpr Dynarmic::HaltReason break_loop = Dynarmic::HaltReason::UserDefined2; |
| 199 | static constexpr Dynarmic::HaltReason svc_call = Dynarmic::HaltReason::UserDefined3; | 204 | static constexpr Dynarmic::HaltReason svc_call = Dynarmic::HaltReason::UserDefined3; |
| 200 | static constexpr Dynarmic::HaltReason breakpoint = Dynarmic::HaltReason::UserDefined4; | 205 | static constexpr Dynarmic::HaltReason breakpoint = Dynarmic::HaltReason::UserDefined4; |
| 206 | static constexpr Dynarmic::HaltReason watchpoint = Dynarmic::HaltReason::UserDefined5; | ||
| 201 | 207 | ||
| 202 | protected: | 208 | protected: |
| 203 | /// System context that this ARM interface is running under. | 209 | /// System context that this ARM interface is running under. |
| 204 | System& system; | 210 | System& system; |
| 205 | CPUInterrupts& interrupt_handlers; | 211 | CPUInterrupts& interrupt_handlers; |
| 212 | const WatchpointArray* watchpoints; | ||
| 206 | bool uses_wall_clock; | 213 | bool uses_wall_clock; |
| 207 | 214 | ||
| 208 | static void SymbolicateBacktrace(Core::System& system, std::vector<BacktraceEntry>& out); | 215 | static void SymbolicateBacktrace(Core::System& system, std::vector<BacktraceEntry>& out); |
| 216 | const Kernel::DebugWatchpoint* MatchingWatchpoint( | ||
| 217 | VAddr addr, u64 size, Kernel::DebugWatchpointType access_type) const; | ||
| 209 | 218 | ||
| 210 | virtual Dynarmic::HaltReason RunJit() = 0; | 219 | virtual Dynarmic::HaltReason RunJit() = 0; |
| 211 | virtual Dynarmic::HaltReason StepJit() = 0; | 220 | virtual Dynarmic::HaltReason StepJit() = 0; |
| 212 | virtual u32 GetSvcNumber() const = 0; | 221 | virtual u32 GetSvcNumber() const = 0; |
| 222 | virtual const Kernel::DebugWatchpoint* HaltedWatchpoint() const = 0; | ||
| 223 | virtual void RewindBreakpointInstruction() = 0; | ||
| 213 | }; | 224 | }; |
| 214 | 225 | ||
| 215 | } // namespace Core | 226 | } // namespace Core |