aboutsummaryrefslogtreecommitdiff
path: root/lldb/tools/lldb-dap/EventHelper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/tools/lldb-dap/EventHelper.cpp')
-rw-r--r--lldb/tools/lldb-dap/EventHelper.cpp40
1 files changed, 23 insertions, 17 deletions
diff --git a/lldb/tools/lldb-dap/EventHelper.cpp b/lldb/tools/lldb-dap/EventHelper.cpp
index 3042d32..c5d5f2b 100644
--- a/lldb/tools/lldb-dap/EventHelper.cpp
+++ b/lldb/tools/lldb-dap/EventHelper.cpp
@@ -15,6 +15,7 @@
#include "Protocol/ProtocolRequests.h"
#include "Protocol/ProtocolTypes.h"
#include "lldb/API/SBFileSpec.h"
+#include "lldb/API/SBPlatform.h"
#include "llvm/Support/Error.h"
#include <utility>
@@ -78,11 +79,9 @@ void SendExtraCapabilities(DAP &dap) {
// { "$ref": "#/definitions/Event" },
// {
// "type": "object",
-// "description": "Event message for 'process' event type. The event
-// indicates that the debugger has begun debugging a
-// new process. Either one that it has launched, or one
-// that it has attached to.",
-// "properties": {
+// "description": "The event indicates that the debugger has begun
+// debugging a new process. Either one that it has launched, or one that
+// it has attached to.", "properties": {
// "event": {
// "type": "string",
// "enum": [ "process" ]
@@ -93,31 +92,37 @@ void SendExtraCapabilities(DAP &dap) {
// "name": {
// "type": "string",
// "description": "The logical name of the process. This is
-// usually the full path to process's executable
-// file. Example: /home/myproj/program.js."
+// usually the full path to process's executable file. Example:
+// /home/example/myproj/program.js."
// },
// "systemProcessId": {
// "type": "integer",
-// "description": "The system process id of the debugged process.
-// This property will be missing for non-system
-// processes."
+// "description": "The process ID of the debugged process, as
+// assigned by the operating system. This property should be
+// omitted for logical processes that do not map to operating
+// system processes on the machine."
// },
// "isLocalProcess": {
// "type": "boolean",
// "description": "If true, the process is running on the same
-// computer as the debug adapter."
+// computer as the debug adapter."
// },
// "startMethod": {
// "type": "string",
// "enum": [ "launch", "attach", "attachForSuspendedLaunch" ],
// "description": "Describes how the debug engine started
-// debugging this process.",
-// "enumDescriptions": [
+// debugging this process.", "enumDescriptions": [
// "Process was launched under the debugger.",
// "Debugger attached to an existing process.",
-// "A project launcher component has launched a new process in
-// a suspended state and then asked the debugger to attach."
+// "A project launcher component has launched a new process in a
+// suspended state and then asked the debugger to attach."
// ]
+// },
+// "pointerSize": {
+// "type": "integer",
+// "description": "The size of a pointer or address for this
+// process, in bits. This value may be used by clients when
+// formatting addresses for display."
// }
// },
// "required": [ "name" ]
@@ -126,7 +131,7 @@ void SendExtraCapabilities(DAP &dap) {
// "required": [ "event", "body" ]
// }
// ]
-// }
+// },
void SendProcessEvent(DAP &dap, LaunchMethod launch_method) {
lldb::SBFileSpec exe_fspec = dap.target.GetExecutable();
char exe_path[PATH_MAX];
@@ -136,7 +141,8 @@ void SendProcessEvent(DAP &dap, LaunchMethod launch_method) {
EmplaceSafeString(body, "name", exe_path);
const auto pid = dap.target.GetProcess().GetProcessID();
body.try_emplace("systemProcessId", (int64_t)pid);
- body.try_emplace("isLocalProcess", true);
+ body.try_emplace("isLocalProcess", dap.target.GetPlatform().IsHost());
+ body.try_emplace("pointerSize", dap.target.GetAddressByteSize() * 8);
const char *startMethod = nullptr;
switch (launch_method) {
case Launch: