@@ -7,25 +7,89 @@
//===--===//
#include "lldb/Protocol/MCP/Server.h"
+#include "lldb/Host/File.h"
+#include "lldb/Host/FileSystem.h"
+#include "lldb/Host/HostInfo.h"
+#include "lldb/Host/JSONTransport.h"
#in
@@ -7,25 +7,89 @@
//===--===//
#include "lldb/Protocol/MCP/Server.h"
+#include "lldb/Host/File.h"
+#include "lldb/Host/FileSystem.h"
+#include "lldb/Host/HostInfo.h"
+#include "lldb/Host/JSONTransport.h"
#in
https://github.com/ashgti updated
https://github.com/llvm/llvm-project/pull/157503
>From ec45d323014b15ce7a960fc519ef3782820a44d2 Mon Sep 17 00:00:00 2001
From: John Harrison
Date: Mon, 8 Sep 2025 09:05:15 -0700
Subject: [PATCH] [lldb-mcp] Auto connect to the first running lldb mcp
instance.
https://github.com/ashgti created
https://github.com/llvm/llvm-project/pull/157503
This improves the flow by automatically connecting to an exisitng lldb
instance, if one is found.
Future improvements include:
* Launching a binary if an instance isn't detected.
* Multiplexing if multiple inst
https://github.com/ashgti closed
https://github.com/llvm/llvm-project/pull/157150
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
ashgti wrote:
I'll send an update to initialize all the variables.
https://github.com/llvm/llvm-project/pull/156956
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
@@ -62,7 +97,11 @@ struct Variables {
/// These are the variables evaluated from debug console REPL.
llvm::DenseMap m_referencedpermanent_variables;
- int64_t m_next_temporary_var_ref{VARREF_FIRST_VAR_IDX};
+ /// Key = frame_id
+ /// Value = (locals, globals Registers)
https://github.com/ashgti closed
https://github.com/llvm/llvm-project/pull/156712
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
@@ -327,6 +348,23 @@ serveConnection(const Socket::SocketProtocol &protocol,
const std::string &name,
std::unique_lock lock(dap_sessions_mutex);
dap_sessions.erase(&loop);
std::notify_all_at_thread_exit(dap_sessions_condition, std::move(lock));
+
+ if (t
@@ -327,6 +348,23 @@ serveConnection(const Socket::SocketProtocol &protocol,
const std::string &name,
std::unique_lock lock(dap_sessions_mutex);
dap_sessions.erase(&loop);
std::notify_all_at_thread_exit(dap_sessions_condition, std::move(lock));
+
+ if (t
@@ -509,6 +547,17 @@ int main(int argc, char *argv[]) {
}
if (!connection.empty()) {
+int ttl = 0;
ashgti wrote:
nit: Could this be `ttl_ms` or maybe a `std::chrono::milliseconds` instead of
an `int`?
https://github.com/llvm/llvm-project/pull/156803
@@ -327,6 +348,23 @@ serveConnection(const Socket::SocketProtocol &protocol,
const std::string &name,
std::unique_lock lock(dap_sessions_mutex);
dap_sessions.erase(&loop);
std::notify_all_at_thread_exit(dap_sessions_condition, std::move(lock));
+
+ if (t
https://github.com/ashgti updated
https://github.com/llvm/llvm-project/pull/156712
>From de461689fdfc19e3c4bca841fb693bef59c66253 Mon Sep 17 00:00:00 2001
From: John Harrison
Date: Wed, 3 Sep 2025 09:18:45 -0700
Subject: [PATCH 1/2] [lldb] Moving MCPTransport into its own file.
Moving `lldb_pr
https://github.com/ashgti closed
https://github.com/llvm/llvm-project/pull/155714
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
https://github.com/ashgti updated
https://github.com/llvm/llvm-project/pull/155714
>From 831a505e3e8368cf2ee5cae995b8920fbc8d2365 Mon Sep 17 00:00:00 2001
From: John Harrison
Date: Wed, 27 Aug 2025 15:58:04 -0700
Subject: [PATCH 1/8] [lldb] Adjust ProtocolServer connection defaults.
This adjus
@@ -9,6 +9,7 @@
#ifndef LLDB_TOOLS_LLDB_DAP_JSONUTILS_H
#define LLDB_TOOLS_LLDB_DAP_JSONUTILS_H
+#include "DAP.h"
ashgti wrote:
We have DAPForward on line 13, do we need the full DAP here?
https://github.com/llvm/llvm-project/pull/124232
@@ -103,3 +120,76 @@ lldb::SBValue Variables::FindVariable(uint64_t
variablesReference,
}
return variable;
}
+
+std::optional
+Variables::GetScopeKind(const int64_t variablesReference) {
+ auto scope_kind_iter = m_scope_kinds.find(variablesReference);
+ if (scope_kind_it
@@ -11,6 +11,7 @@
#include "ExceptionBreakpoint.h"
#include "LLDBUtils.h"
#include "ProtocolUtils.h"
+#include "Variables.h"
ashgti wrote:
Is variables needed any here? I don't see any usage...
https://github.com/llvm/llvm-project/pull/124232
@@ -103,3 +120,76 @@ lldb::SBValue Variables::FindVariable(uint64_t
variablesReference,
}
return variable;
}
+
+std::optional
+Variables::GetScopeKind(const int64_t variablesReference) {
+ auto scope_kind_iter = m_scope_kinds.find(variablesReference);
+ if (scope_kind_it
@@ -103,3 +119,55 @@ lldb::SBValue Variables::FindVariable(uint64_t
variablesReference,
}
return variable;
}
+
+std::optional
+Variables::GetScopeKind(const int64_t variablesReference) {
+ auto iter = m_scope_kinds.find(variablesReference);
+ if (iter != m_scope_kinds.en
https://github.com/ashgti updated
https://github.com/llvm/llvm-project/pull/155714
>From 831a505e3e8368cf2ee5cae995b8920fbc8d2365 Mon Sep 17 00:00:00 2001
From: John Harrison
Date: Wed, 27 Aug 2025 15:58:04 -0700
Subject: [PATCH 1/8] [lldb] Adjust ProtocolServer connection defaults.
This adjus
https://github.com/ashgti updated
https://github.com/llvm/llvm-project/pull/155714
>From 831a505e3e8368cf2ee5cae995b8920fbc8d2365 Mon Sep 17 00:00:00 2001
From: John Harrison
Date: Wed, 27 Aug 2025 15:58:04 -0700
Subject: [PATCH 1/7] [lldb] Adjust ProtocolServer connection defaults.
This adjus
https://github.com/ashgti updated
https://github.com/llvm/llvm-project/pull/155714
>From 831a505e3e8368cf2ee5cae995b8920fbc8d2365 Mon Sep 17 00:00:00 2001
From: John Harrison
Date: Wed, 27 Aug 2025 15:58:04 -0700
Subject: [PATCH 1/6] [lldb] Adjust ProtocolServer connection defaults.
This adjus
https://github.com/ashgti updated
https://github.com/llvm/llvm-project/pull/155714
>From 831a505e3e8368cf2ee5cae995b8920fbc8d2365 Mon Sep 17 00:00:00 2001
From: John Harrison
Date: Wed, 27 Aug 2025 15:58:04 -0700
Subject: [PATCH 1/3] [lldb] Adjust ProtocolServer connection defaults.
This adjus
@@ -104,6 +104,43 @@ llvm::Error
ProtocolServerMCP::Start(ProtocolServer::Connection connection) {
if (llvm::Error error = handles.takeError())
return error;
+ auto listening_uris = m_listener->GetListeningConnectionURI();
+ if (listening_uris.empty())
+return cre
@@ -104,6 +104,43 @@ llvm::Error
ProtocolServerMCP::Start(ProtocolServer::Connection connection) {
if (llvm::Error error = handles.takeError())
return error;
+ auto listening_uris = m_listener->GetListeningConnectionURI();
+ if (listening_uris.empty())
+return cre
@@ -14,11 +14,23 @@
#include "lldb/Protocol/MCP/Resource.h"
#include "lldb/Protocol/MCP/Tool.h"
#include "lldb/Protocol/MCP/Transport.h"
+#include "lldb/lldb-types.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/Support/Error.h"
+#include "llvm/Support/JSON.h"
namespace
https://github.com/ashgti updated
https://github.com/llvm/llvm-project/pull/155714
>From 831a505e3e8368cf2ee5cae995b8920fbc8d2365 Mon Sep 17 00:00:00 2001
From: John Harrison
Date: Wed, 27 Aug 2025 15:58:04 -0700
Subject: [PATCH 1/2] [lldb] Adjust ProtocolServer connection defaults.
This adjus
https://github.com/ashgti approved this pull request.
https://github.com/llvm/llvm-project/pull/155811
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
https://github.com/ashgti updated
https://github.com/llvm/llvm-project/pull/155714
>From 831a505e3e8368cf2ee5cae995b8920fbc8d2365 Mon Sep 17 00:00:00 2001
From: John Harrison
Date: Wed, 27 Aug 2025 15:58:04 -0700
Subject: [PATCH] [lldb] Adjust ProtocolServer connection defaults.
This adjusts t
https://github.com/ashgti ready_for_review
https://github.com/llvm/llvm-project/pull/155720
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
https://github.com/ashgti created
https://github.com/llvm/llvm-project/pull/155720
Fixes lldb-mcp, aa71d95 was merged after 71a065e.
>From 6630ce4639806ea392f3ad3a1b36bf6c40b423f2 Mon Sep 17 00:00:00 2001
From: John Harrison
Date: Wed, 27 Aug 2025 16:30:14 -0700
Subject: [PATCH] [lldb] Correct
ashgti wrote:
Right now, I wasn't entirely sure how to make the MCP server's fully unique on
the host or what information we need to store about the servers, so I'm
currently using the lldb pid to make the files unique. That could be replaced
in the future by something else a UUID or hash.
ht
https://github.com/ashgti ready_for_review
https://github.com/llvm/llvm-project/pull/155714
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
https://github.com/ashgti closed
https://github.com/llvm/llvm-project/pull/155711
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
@@ -0,0 +1,80 @@
+//===--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apac
https://github.com/ashgti approved this pull request.
https://github.com/llvm/llvm-project/pull/155708
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
ashgti wrote:
This is built on #155711, so I'll leave it as a draft until that is in.
https://github.com/llvm/llvm-project/pull/155714
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commit
https://github.com/ashgti created
https://github.com/llvm/llvm-project/pull/155714
This adjusts the ProtocolServer command to default to create a new connection
listening on `localhost:0` and adds a new `ServerMetadata` details to
`~/.lldb/mcp/lldb-.json` to record information about the curren
https://github.com/ashgti created
https://github.com/llvm/llvm-project/pull/155711
Moving `lldb_protocol::mcp::MCPTransport` out of Server.h and into its own file
and simplifying the name to `Transport`.
>From b10f3ffca74e08234960fc0a3d4dfb5431d901ee Mon Sep 17 00:00:00 2001
From: John Harriso
@@ -0,0 +1,21 @@
+
+http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
+
+
+ CFBundleDevelopmentRegion
+ English
+ CFBundleIdentifier
+ com.apple.lldb-dap
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ lldb-dap
---
@@ -0,0 +1,80 @@
+//===--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apac
@@ -0,0 +1,80 @@
+//===--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apac
@@ -0,0 +1,21 @@
+
+http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
+
+
+ CFBundleDevelopmentRegion
+ English
+ CFBundleIdentifier
+ com.apple.lldb-dap
ashgti wrote:
com.apple.lldb-mcp?
https://github.com/llvm/llvm-project/pull/155708
_
https://github.com/ashgti approved this pull request.
https://github.com/llvm/llvm-project/pull/155335
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
https://github.com/ashgti closed
https://github.com/llvm/llvm-project/pull/155460
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
@@ -198,12 +207,165 @@ struct ToolDefinition {
// JSON Schema for the tool's parameters.
std::optional inputSchema;
};
-
llvm::json::Value toJSON(const ToolDefinition &);
bool fromJSON(const llvm::json::Value &, ToolDefinition &, llvm::json::Path);
using ToolArguments
https://github.com/ashgti updated
https://github.com/llvm/llvm-project/pull/155460
>From 8b89bfa1a114dd45bbd0b8023540112654f8590b Mon Sep 17 00:00:00 2001
From: John Harrison
Date: Tue, 26 Aug 2025 10:56:45 -0700
Subject: [PATCH 1/3] [lldb] Adding structured types for existing MCP calls.
This
https://github.com/ashgti updated
https://github.com/llvm/llvm-project/pull/155460
>From 8b89bfa1a114dd45bbd0b8023540112654f8590b Mon Sep 17 00:00:00 2001
From: John Harrison
Date: Tue, 26 Aug 2025 10:56:45 -0700
Subject: [PATCH 1/2] [lldb] Adding structured types for existing MCP calls.
This
https://github.com/ashgti updated
https://github.com/llvm/llvm-project/pull/155460
>From 8b89bfa1a114dd45bbd0b8023540112654f8590b Mon Sep 17 00:00:00 2001
From: John Harrison
Date: Tue, 26 Aug 2025 10:56:45 -0700
Subject: [PATCH 1/2] [lldb] Adding structured types for existing MCP calls.
This
@@ -81,6 +81,10 @@ bool operator==(const Request &a, const Request &b) {
return a.id == b.id && a.method == b.method && a.params == b.params;
}
+void PrintTo(const Request &req, std::ostream *os) {
+ *os << formatv("{0}", toJSON(req)).str();
+}
ashgti wrote
https://github.com/ashgti converted_to_draft
https://github.com/llvm/llvm-project/pull/155315
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
ashgti wrote:
> Let's split out the changes to the protocol, we can land and test those
> independently and that would simplify this patch a lot. I also think all the
> socket code is (not yet) necessary.
Split the protocol changes into #155460 and I'll also add another to move the
MCPTranspo
https://github.com/ashgti created
https://github.com/llvm/llvm-project/pull/155460
This adds or renames existing types to match the names of the types on
https://modelcontextprotocol.io/specification/2025-06-18/schema for the
existing calls.
The new types are used in the unit tests and server
@@ -466,8 +466,15 @@ def attach(
# if we throw an exception during the test case.
def cleanup():
if disconnectAutomatically:
-self.dap_server.request_disconnect(terminateDebuggee=True)
-self.dap_server.terminate()
+
https://github.com/ashgti created
https://github.com/llvm/llvm-project/pull/155315
The `lldb_protocol::mcp::Binder` class is used to craft bindings between
requests and notifications to specific handlers.
This supports both incoming and outgoing handlers that bind these functions to
a Message
https://github.com/ashgti approved this pull request.
https://github.com/llvm/llvm-project/pull/155238
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
https://github.com/ashgti closed
https://github.com/llvm/llvm-project/pull/153317
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
https://github.com/ashgti updated
https://github.com/llvm/llvm-project/pull/153317
>From 3db3a7184eb7d729c37f7dc02f826c77df8c65e9 Mon Sep 17 00:00:00 2001
From: John Harrison
Date: Tue, 12 Aug 2025 16:23:18 -0700
Subject: [PATCH 1/6] [lldb-dap] Migrating 'completions' to structured types.
This
https://github.com/ashgti updated
https://github.com/llvm/llvm-project/pull/153317
>From 3db3a7184eb7d729c37f7dc02f826c77df8c65e9 Mon Sep 17 00:00:00 2001
From: John Harrison
Date: Tue, 12 Aug 2025 16:23:18 -0700
Subject: [PATCH 1/5] [lldb-dap] Migrating 'completions' to structured types.
This
https://github.com/ashgti updated
https://github.com/llvm/llvm-project/pull/153317
>From 3db3a7184eb7d729c37f7dc02f826c77df8c65e9 Mon Sep 17 00:00:00 2001
From: John Harrison
Date: Tue, 12 Aug 2025 16:23:18 -0700
Subject: [PATCH 1/6] [lldb-dap] Migrating 'completions' to structured types.
This
https://github.com/ashgti created
https://github.com/llvm/llvm-project/pull/154832
This reverts commit 0f33b90b6117bcfa6ca3779c641c1ee8d03590fd and includes a fix
for the added test that was submitted between my last update and pull.
>From ff17fd28c43d1109c8cb6057c628ad6f4b541242 Mon Sep 17 00
https://github.com/ashgti closed
https://github.com/llvm/llvm-project/pull/147787
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
https://github.com/ashgti updated
https://github.com/llvm/llvm-project/pull/147787
>From e692c5f9bda1c37e486dfbbd4a57fe573c83045e Mon Sep 17 00:00:00 2001
From: John Harrison
Date: Wed, 9 Jul 2025 10:25:08 -0700
Subject: [PATCH 1/3] [lldb-dap] Reland refactor of DebugCommunication.
Originally
@@ -1141,15 +1253,22 @@ def request_completions(self, text, frameId=None):
"type": "request",
"arguments": args_dict,
}
-return self.send_recv(command_dict)
-
-def request_modules(self, startModule: int, moduleCount: int):
-re
@@ -188,267 +241,326 @@ def validate_response(cls, command, response):
)
def _read_packet_thread(self):
-done = False
try:
-while not done:
+while True:
packet = read_packet(self.recv, trace_file=self.tr
@@ -1141,15 +1253,22 @@ def request_completions(self, text, frameId=None):
"type": "request",
"arguments": args_dict,
}
-return self.send_recv(command_dict)
-
-def request_modules(self, startModule: int, moduleCount: int):
-re
@@ -188,267 +241,326 @@ def validate_response(cls, command, response):
)
def _read_packet_thread(self):
-done = False
try:
-while not done:
+while True:
packet = read_packet(self.recv, trace_file=self.tr
@@ -152,25 +189,41 @@ def __init__(
self.log_file = log_file
self.send = send
self.recv = recv
-self.recv_packets: list[Optional[ProtocolMessage]] = []
-self.recv_condition = threading.Condition()
-self.recv_thread = threading.Thr
https://github.com/ashgti updated
https://github.com/llvm/llvm-project/pull/147787
>From e692c5f9bda1c37e486dfbbd4a57fe573c83045e Mon Sep 17 00:00:00 2001
From: John Harrison
Date: Wed, 9 Jul 2025 10:25:08 -0700
Subject: [PATCH 1/2] [lldb-dap] Reland refactor of DebugCommunication.
Originally
ashgti wrote:
> Missing unit test for `CompletionItem`
Done, added unit tests to cover the new JSON types.
https://github.com/llvm/llvm-project/pull/153317
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailma
https://github.com/ashgti updated
https://github.com/llvm/llvm-project/pull/153317
>From 3db3a7184eb7d729c37f7dc02f826c77df8c65e9 Mon Sep 17 00:00:00 2001
From: John Harrison
Date: Tue, 12 Aug 2025 16:23:18 -0700
Subject: [PATCH 1/4] [lldb-dap] Migrating 'completions' to structured types.
This
https://github.com/ashgti approved this pull request.
https://github.com/llvm/llvm-project/pull/153836
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
ashgti wrote:
Just to double check, can you run `npm package && code --install-extension
out/lldb-dap.vsix` to make sure the css/js files are bundled correctly.
Otherwise, LGTM with the last few comments.
https://github.com/llvm/llvm-project/pull/153836
@@ -39,6 +45,9 @@ export class DebugSessionTracker
private modulesChanged = new vscode.EventEmitter<
vscode.DebugSession | undefined
>();
+ private sessionGotCapabilities =
ashgti wrote:
Sounds good to me
https://github.com/llvm/llvm-project/pull/153
@@ -146,6 +164,10 @@ export class DebugSessionTracker
this.logger.info(
`Session "${session.name}" exited with code ${exitCode}`,
);
+
+ this.sessionExited.fire(session);
+} else if (isEvent(message, "capabilities")) {
+ this.sessionGotCapabili
@@ -594,6 +594,20 @@ class CancelRequestHandler : public
RequestHandler> {
+public:
+ using RequestHandler::RequestHandler;
+ static llvm::StringLiteral GetCommand() { return "moduleSymbols"; }
ashgti wrote:
+1
https://github.com/llvm/llvm-project/pull/153836
https://github.com/ashgti closed
https://github.com/llvm/llvm-project/pull/153121
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
ashgti wrote:
I refactored this a bit to not have the `Transport` run the `MainLoop`, instead
have it register with the loop.
This changed the flow of how errors are handled. Now instead of simply logging
any errors I surface them to the `MessageHandler` and it can choose how to
handle the er
@@ -54,112 +50,227 @@ class TransportUnhandledContentsError
std::string m_unhandled_contents;
};
-class TransportInvalidError : public llvm::ErrorInfo {
+/// A transport is responsible for maintaining the connection to a client
+/// application, and reading/writing structure
@@ -981,6 +981,23 @@ struct WriteMemoryResponseBody {
};
llvm::json::Value toJSON(const WriteMemoryResponseBody &);
+struct DAPGetModuleSymbolsArguments {
+ /// The module UUID for which to retrieve symbols.
+ std::optional moduleId;
ashgti wrote:
I think a
@@ -21,7 +21,7 @@
#include
#include
-namespace lldb_dap::protocol {
+namespace lldb_dap::protocol::dap {
ashgti wrote:
I don't think we should need to change the existing namespace. The
`lldb_dap::protocol` namespace already corresponds to the types used f
@@ -48,6 +48,38 @@ struct SourceLLDBData {
bool fromJSON(const llvm::json::Value &, SourceLLDBData &, llvm::json::Path);
llvm::json::Value toJSON(const SourceLLDBData &);
+struct DAPSymbol {
+ /// The symbol uid.
+ uint32_t userId;
+
+ /// True if this symbol is debug infor
@@ -0,0 +1,185 @@
+import * as vscode from "vscode";
+import { DebugProtocol } from "@vscode/debugprotocol";
+
+import { DebugSessionTracker } from "../debug-session-tracker";
+import { DisposableContext } from "../disposable-context";
+
+import { DAPSymbolType } from "..";
+
+exp
@@ -981,6 +981,23 @@ struct WriteMemoryResponseBody {
};
llvm::json::Value toJSON(const WriteMemoryResponseBody &);
+struct DAPGetModuleSymbolsArguments {
+ /// The module UUID for which to retrieve symbols.
+ std::optional moduleId;
ashgti wrote:
Any reaso
@@ -0,0 +1,185 @@
+import * as vscode from "vscode";
+import { DebugProtocol } from "@vscode/debugprotocol";
+
+import { DebugSessionTracker } from "../debug-session-tracker";
+import { DisposableContext } from "../disposable-context";
+
+import { DAPSymbolType } from "..";
+
+exp
@@ -259,19 +266,40 @@
{
"command": "lldb-dap.modules.copyProperty",
"title": "Copy Value"
+ },
+ {
+"command": "lldb-dap.modules.showSymbols",
+"title": "Show Module Symbols"
+ },
+ {
+"category": "lldb-dap",
+
@@ -29,11 +29,15 @@
],
"devDependencies": {
"@types/node": "^18.19.41",
+"@types/tabulator-tables": "^6.2.10",
"@types/vscode": "1.75.0",
+"@types/vscode-webview": "^1.57.5",
"@vscode/debugprotocol": "^1.68.0",
"@vscode/vsce": "^3.2.2",
+"esbu
@@ -594,6 +594,17 @@ class CancelRequestHandler : public
RequestHandler> {
+public:
+ using RequestHandler::RequestHandler;
+ static llvm::StringLiteral GetCommand() { return "dapGetModuleSymbols"; }
ashgti wrote:
What about the name `moduleSymbols`?
https://
@@ -48,6 +48,38 @@ struct SourceLLDBData {
bool fromJSON(const llvm::json::Value &, SourceLLDBData &, llvm::json::Path);
llvm::json::Value toJSON(const SourceLLDBData &);
+struct DAPSymbol {
+ /// The symbol uid.
+ uint32_t userId;
+
+ /// True if this symbol is debug infor
@@ -0,0 +1,90 @@
+import type { CellComponent, ColumnDefinition } from "tabulator-tables";
+import type { DAPSymbolType } from ".."
+
+function get_tabulator_hexa_formatter(padding: number): (cell: CellComponent)
=> string {
+ return (cell: CellComponent) => {
+const val = c
@@ -48,6 +48,38 @@ struct SourceLLDBData {
bool fromJSON(const llvm::json::Value &, SourceLLDBData &, llvm::json::Path);
llvm::json::Value toJSON(const SourceLLDBData &);
+struct DAPSymbol {
+ /// The symbol uid.
+ uint32_t userId;
ashgti wrote:
What does t
@@ -0,0 +1,14 @@
+export {};
+
+/// The symbol type we get from the lldb-dap server
+export type DAPSymbolType = {
ashgti wrote:
If this type is going to be shared between the web and node runtime, its
somewhat common to `declare interface` for the type. That te
@@ -981,6 +981,23 @@ struct WriteMemoryResponseBody {
};
llvm::json::Value toJSON(const WriteMemoryResponseBody &);
+struct DAPGetModuleSymbolsArguments {
ashgti wrote:
nit: Drop `DAP` prefix?
https://github.com/llvm/llvm-project/pull/153836
@@ -48,6 +48,38 @@ struct SourceLLDBData {
bool fromJSON(const llvm::json::Value &, SourceLLDBData &, llvm::json::Path);
llvm::json::Value toJSON(const SourceLLDBData &);
+struct DAPSymbol {
ashgti wrote:
nit: Can we drop `DAP`? I think this should already be
@@ -981,6 +981,23 @@ struct WriteMemoryResponseBody {
};
llvm::json::Value toJSON(const WriteMemoryResponseBody &);
+struct DAPGetModuleSymbolsArguments {
+ /// The module UUID for which to retrieve symbols.
+ std::optional moduleId;
+
+ /// The module path.
+ std::optiona
@@ -938,88 +933,74 @@ void DAP::ClearCancelRequest(const CancelArguments &args)
{
}
template
-static std::optional getArgumentsIfRequest(const Message &pm,
+static std::optional getArgumentsIfRequest(const Request &req,
llvm::St
@@ -258,36 +259,33 @@ void DAP::SendJSON(const llvm::json::Value &json) {
llvm::json::Path::Root root;
if (!fromJSON(json, message, root)) {
DAP_LOG_ERROR(log, root.getError(), "({1}) encoding failed: {0}",
- transport.GetClientName());
+
@@ -344,13 +346,14 @@ serveConnection(const Socket::SocketProtocol &protocol,
const std::string &name,
bool client_failed = false;
{
std::scoped_lock lock(dap_sessions_mutex);
-for (auto [sock, dap] : dap_sessions) {
+for (auto [loop, dap] : dap_sessions) {
@@ -54,112 +50,220 @@ class TransportUnhandledContentsError
std::string m_unhandled_contents;
};
-class TransportInvalidError : public llvm::ErrorInfo {
+/// A transport is responsible for maintaining the connection to a client
+/// application, and reading/writing structure
1 - 100 of 1185 matches
Mail list logo