summaryrefslogtreecommitdiff
path: root/src/core/arm/arm_interface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/arm/arm_interface.cpp')
-rw-r--r--src/core/arm/arm_interface.cpp41
1 files changed, 40 insertions, 1 deletions
diff --git a/src/core/arm/arm_interface.cpp b/src/core/arm/arm_interface.cpp
index 9a285dfc6..6425e131f 100644
--- a/src/core/arm/arm_interface.cpp
+++ b/src/core/arm/arm_interface.cpp
@@ -121,8 +121,15 @@ void ARM_Interface::Run() {
121 121
122 // Notify the debugger and go to sleep if a breakpoint was hit. 122 // Notify the debugger and go to sleep if a breakpoint was hit.
123 if (Has(hr, breakpoint)) { 123 if (Has(hr, breakpoint)) {
124 RewindBreakpointInstruction();
124 system.GetDebugger().NotifyThreadStopped(current_thread); 125 system.GetDebugger().NotifyThreadStopped(current_thread);
125 current_thread->RequestSuspend(Kernel::SuspendType::Debug); 126 current_thread->RequestSuspend(SuspendType::Debug);
127 break;
128 }
129 if (Has(hr, watchpoint)) {
130 RewindBreakpointInstruction();
131 system.GetDebugger().NotifyThreadWatchpoint(current_thread, *HaltedWatchpoint());
132 current_thread->RequestSuspend(SuspendType::Debug);
126 break; 133 break;
127 } 134 }
128 135
@@ -136,4 +143,36 @@ void ARM_Interface::Run() {
136 } 143 }
137} 144}
138 145
146void ARM_Interface::LoadWatchpointArray(const WatchpointArray& wp) {
147 watchpoints = ℘
148}
149
150const Kernel::DebugWatchpoint* ARM_Interface::MatchingWatchpoint(
151 VAddr addr, u64 size, Kernel::DebugWatchpointType access_type) const {
152 if (!watchpoints) {
153 return nullptr;
154 }
155
156 const VAddr start_address{addr};
157 const VAddr end_address{addr + size};
158
159 for (size_t i = 0; i < Core::Hardware::NUM_WATCHPOINTS; i++) {
160 const auto& watch{(*watchpoints)[i]};
161
162 if (end_address <= watch.start_address) {
163 continue;
164 }
165 if (start_address >= watch.end_address) {
166 continue;
167 }
168 if ((access_type & watch.type) == Kernel::DebugWatchpointType::None) {
169 continue;
170 }
171
172 return &watch;
173 }
174
175 return nullptr;
176}
177
139} // namespace Core 178} // namespace Core