diff --git a/CMakeLists.txt b/CMakeLists.txt
index a1cc6b95f5..5d1b359c53 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1414,6 +1414,8 @@ add_library(${CoreLibName} ${CoreLinkType}
Core/Debugger/WebSocket/GameBroadcaster.h
Core/Debugger/WebSocket/GameSubscriber.cpp
Core/Debugger/WebSocket/GameSubscriber.h
+ Core/Debugger/WebSocket/HLESubscriber.cpp
+ Core/Debugger/WebSocket/HLESubscriber.h
Core/Debugger/WebSocket/LogBroadcaster.cpp
Core/Debugger/WebSocket/LogBroadcaster.h
Core/Debugger/WebSocket/SteppingBroadcaster.cpp
diff --git a/Core/Core.vcxproj b/Core/Core.vcxproj
index 1b95d40373..d38b535a23 100644
--- a/Core/Core.vcxproj
+++ b/Core/Core.vcxproj
@@ -189,6 +189,7 @@
+
@@ -546,6 +547,7 @@
+
diff --git a/Core/Core.vcxproj.filters b/Core/Core.vcxproj.filters
index f4803dd56c..221dd1c738 100644
--- a/Core/Core.vcxproj.filters
+++ b/Core/Core.vcxproj.filters
@@ -725,6 +725,9 @@
Debugger\WebSocket
+
+ Debugger\WebSocket
+
@@ -1340,6 +1343,9 @@
HLE\Kernel
+
+ Debugger\WebSocket
+
diff --git a/Core/Debugger/WebSocket.cpp b/Core/Debugger/WebSocket.cpp
index f477746c78..7bce20cc5e 100644
--- a/Core/Debugger/WebSocket.cpp
+++ b/Core/Debugger/WebSocket.cpp
@@ -52,6 +52,7 @@
#include "Core/Debugger/WebSocket/CPUCoreSubscriber.h"
#include "Core/Debugger/WebSocket/DisasmSubscriber.h"
#include "Core/Debugger/WebSocket/GameSubscriber.h"
+#include "Core/Debugger/WebSocket/HLESubscriber.h"
#include "Core/Debugger/WebSocket/SteppingSubscriber.h"
typedef void *(*SubscriberInit)(DebuggerEventHandlerMap &map);
@@ -66,6 +67,7 @@ static const std::vector subscribers({
{ &WebSocketCPUCoreInit, nullptr },
{ &WebSocketDisasmInit, &WebSocketDisasmShutdown },
{ &WebSocketGameInit, nullptr },
+ { &WebSocketHLEInit, nullptr },
{ &WebSocketSteppingInit, &WebSocketSteppingShutdown },
});
diff --git a/Core/Debugger/WebSocket/HLESubscriber.cpp b/Core/Debugger/WebSocket/HLESubscriber.cpp
new file mode 100644
index 0000000000..efb82c3b36
--- /dev/null
+++ b/Core/Debugger/WebSocket/HLESubscriber.cpp
@@ -0,0 +1,103 @@
+// Copyright (c) 2018- PPSSPP Project.
+
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, version 2.0 or later versions.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License 2.0 for more details.
+
+// A copy of the GPL 2.0 should have been included with the program.
+// If not, see http://www.gnu.org/licenses/
+
+// Official git repository and contact information can be found at
+// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
+
+#include "Core/Debugger/SymbolMap.h"
+#include "Core/Debugger/WebSocket/HLESubscriber.h"
+#include "Core/Debugger/WebSocket/WebSocketUtils.h"
+#include "Core/HLE/sceKernelThread.h"
+
+void *WebSocketHLEInit(DebuggerEventHandlerMap &map) {
+ map["hle.thread.list"] = &WebSocketHLEThreadList;
+ map["hle.func.list"] = &WebSocketHLEFuncList;
+ map["hle.module.list"] = &WebSocketHLEModuleList;
+
+ return nullptr;
+}
+
+void WebSocketHLEThreadList(DebuggerRequest &req) {
+ // Will just return none of the CPU isn't ready yet.
+ auto threads = GetThreadsInfo();
+
+ JsonWriter &json = req.Respond();
+ json.pushArray("threads");
+ for (auto th : threads) {
+ json.pushDict();
+ json.writeUint("id", th.id);
+ json.writeString("name", th.name);
+ json.writeInt("status", th.status);
+ json.pushArray("statuses");
+ if (th.status & THREADSTATUS_RUNNING)
+ json.writeString("running");
+ if (th.status & THREADSTATUS_READY)
+ json.writeString("ready");
+ if (th.status & THREADSTATUS_WAIT)
+ json.writeString("wait");
+ if (th.status & THREADSTATUS_SUSPEND)
+ json.writeString("suspend");
+ if (th.status & THREADSTATUS_DORMANT)
+ json.writeString("dormant");
+ if (th.status & THREADSTATUS_DEAD)
+ json.writeString("dead");
+ json.pop();
+ json.writeUint("pc", th.curPC);
+ json.writeUint("entry", th.entrypoint);
+ json.writeUint("initialStackSize", th.initialStack);
+ json.writeUint("currentStackSize", th.stackSize);
+ json.writeInt("priority", th.priority);
+ json.writeInt("priority", (int)th.waitType);
+ json.writeBool("isCurrent", th.isCurrent);
+ json.pop();
+ }
+ json.pop();
+}
+
+void WebSocketHLEFuncList(DebuggerRequest &req) {
+ if (!g_symbolMap)
+ return req.Fail("CPU not active");
+
+ auto functions = g_symbolMap->GetAllSymbols(ST_FUNCTION);
+
+ JsonWriter &json = req.Respond();
+ json.pushArray("functions");
+ for (auto f : functions) {
+ json.pushDict();
+ json.writeString("name", f.name);
+ json.writeUint("address", f.address);
+ json.writeUint("size", f.size);
+ json.pop();
+ }
+ json.pop();
+}
+
+void WebSocketHLEModuleList(DebuggerRequest &req) {
+ if (!g_symbolMap)
+ return req.Fail("CPU not active");
+
+ auto modules = g_symbolMap->getAllModules();
+
+ JsonWriter &json = req.Respond();
+ json.pushArray("functions");
+ for (auto m : modules) {
+ json.pushDict();
+ json.writeString("name", m.name);
+ json.writeUint("address", m.address);
+ json.writeUint("size", m.size);
+ json.writeBool("isActive", m.active);
+ json.pop();
+ }
+ json.pop();
+}
diff --git a/Core/Debugger/WebSocket/HLESubscriber.h b/Core/Debugger/WebSocket/HLESubscriber.h
new file mode 100644
index 0000000000..61af4dc80d
--- /dev/null
+++ b/Core/Debugger/WebSocket/HLESubscriber.h
@@ -0,0 +1,26 @@
+// Copyright (c) 2018- PPSSPP Project.
+
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, version 2.0 or later versions.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License 2.0 for more details.
+
+// A copy of the GPL 2.0 should have been included with the program.
+// If not, see http://www.gnu.org/licenses/
+
+// Official git repository and contact information can be found at
+// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
+
+#pragma once
+
+#include "Core/Debugger/WebSocket/WebSocketUtils.h"
+
+void *WebSocketHLEInit(DebuggerEventHandlerMap &map);
+
+void WebSocketHLEThreadList(DebuggerRequest &req);
+void WebSocketHLEFuncList(DebuggerRequest &req);
+void WebSocketHLEModuleList(DebuggerRequest &req);
diff --git a/Core/HLE/sceKernelThread.cpp b/Core/HLE/sceKernelThread.cpp
index 11d246576e..576c3f1182 100644
--- a/Core/HLE/sceKernelThread.cpp
+++ b/Core/HLE/sceKernelThread.cpp
@@ -15,10 +15,11 @@
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
-#include
-#include