summaryrefslogtreecommitdiff
path: root/src/core/core.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/core.cpp')
-rw-r--r--src/core/core.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp
index dddc16708..219b03af4 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -13,6 +13,8 @@
13#include "core/hle/kernel/thread.h" 13#include "core/hle/kernel/thread.h"
14#include "core/hw/hw.h" 14#include "core/hw/hw.h"
15 15
16#include "core/gdbstub/gdbstub.h"
17
16namespace Core { 18namespace Core {
17 19
18ARM_Interface* g_app_core = nullptr; ///< ARM11 application core 20ARM_Interface* g_app_core = nullptr; ///< ARM11 application core
@@ -20,6 +22,21 @@ ARM_Interface* g_sys_core = nullptr; ///< ARM11 system (OS) core
20 22
21/// Run the core CPU loop 23/// Run the core CPU loop
22void RunLoop(int tight_loop) { 24void RunLoop(int tight_loop) {
25 if (GDBStub::g_server_enabled) {
26 GDBStub::HandlePacket();
27
28 // If the loop is halted and we want to step, use a tiny (1) number of instructions to execute.
29 // Otherwise get out of the loop function.
30 if (GDBStub::GetCpuHaltFlag()) {
31 if (GDBStub::GetCpuStepFlag()) {
32 GDBStub::SetCpuStepFlag(false);
33 tight_loop = 1;
34 } else {
35 return;
36 }
37 }
38 }
39
23 // If we don't have a currently active thread then don't execute instructions, 40 // If we don't have a currently active thread then don't execute instructions,
24 // instead advance to the next event and try to yield to the next thread 41 // instead advance to the next event and try to yield to the next thread
25 if (Kernel::GetCurrentThread() == nullptr) { 42 if (Kernel::GetCurrentThread() == nullptr) {