Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lldb/tools/lldb-dap/EventHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down Expand Up @@ -136,7 +137,9 @@ 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().GetName() ==
lldb::SBPlatform::GetHostPlatform().GetName());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we expose Platform::IsHost through the SB API?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or we could make SBPlatform comparable?

Copy link
Collaborator

@jimingham jimingham Oct 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Knowing whether the process you are debugging is running locally seems a generally useful piece of information, that should be simple to ask.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added bool SBPlatform::IsHost() const to the lldb API.

const char *startMethod = nullptr;
switch (launch_method) {
case Launch:
Expand Down
2 changes: 2 additions & 0 deletions lldb/tools/lldb-dap/Handler/RestartRequestHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ void RestartRequestHandler::operator()(
return;
}

SendProcessEvent(dap, Launch);

// This is normally done after receiving a "configuration done" request.
// Because we're restarting, configuration has already happened so we can
// continue the process right away.
Expand Down
Loading