[Lldb-commits] [lldb] [lldb-mcp] Auto connect to the first running lldb mcp instance. (PR #157503)

2025-09-09 Thread John Harrison via lldb-commits
@@ -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

[Lldb-commits] [lldb] [lldb-mcp] Auto connect to the first running lldb mcp instance. (PR #157503)

2025-09-09 Thread John Harrison via lldb-commits
@@ -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

[Lldb-commits] [lldb] [lldb-mcp] Auto connect to the first running lldb mcp instance. (PR #157503)

2025-09-08 Thread John Harrison via lldb-commits
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.

[Lldb-commits] [lldb] [lldb-mcp] Auto connect to the first running lldb mcp instance. (PR #157503)

2025-09-08 Thread John Harrison via lldb-commits
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

[Lldb-commits] [lldb] Default-initialize all fields of lldb_dap::protocol::Symbol. (PR #157150)

2025-09-05 Thread John Harrison via lldb-commits
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

[Lldb-commits] [lldb] ensure that dap_symbol is always initialized (PR #156956)

2025-09-05 Thread John Harrison via 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

[Lldb-commits] [lldb] lldb-dap: Stop using replicated variable ids (PR #124232)

2025-09-05 Thread John Harrison via 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)

[Lldb-commits] [lldb] [lldb] Moving MCPTransport into its own file. (PR #156712)

2025-09-04 Thread John Harrison via lldb-commits
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

[Lldb-commits] [lldb] [lldb-dap] Add new optional argument `time-to-live` when using `--connection` (PR #156803)

2025-09-04 Thread John Harrison via 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

[Lldb-commits] [lldb] [lldb-dap] Add new optional argument `time-to-live` when using `--connection` (PR #156803)

2025-09-04 Thread John Harrison via 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

[Lldb-commits] [lldb] [lldb-dap] Add new optional argument `time-to-live` when using `--connection` (PR #156803)

2025-09-04 Thread John Harrison via lldb-commits
@@ -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

[Lldb-commits] [lldb] [lldb-dap] Add new optional argument `time-to-live` when using `--connection` (PR #156803)

2025-09-04 Thread John Harrison via 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

[Lldb-commits] [lldb] [lldb] Moving MCPTransport into its own file. (PR #156712)

2025-09-03 Thread John Harrison via lldb-commits
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

[Lldb-commits] [lldb] [lldb] Adjust ProtocolServer connection defaults. (PR #155714)

2025-08-29 Thread John Harrison via lldb-commits
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

[Lldb-commits] [lldb] [lldb] Adjust ProtocolServer connection defaults. (PR #155714)

2025-08-29 Thread John Harrison via 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

[Lldb-commits] [lldb] lldb-dap: Stop using replicated variable ids (PR #124232)

2025-08-29 Thread John Harrison via lldb-commits
@@ -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

[Lldb-commits] [lldb] lldb-dap: Stop using replicated variable ids (PR #124232)

2025-08-29 Thread John Harrison via lldb-commits
@@ -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

[Lldb-commits] [lldb] lldb-dap: Stop using replicated variable ids (PR #124232)

2025-08-29 Thread John Harrison via lldb-commits
@@ -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

[Lldb-commits] [lldb] lldb-dap: Stop using replicated variable ids (PR #124232)

2025-08-29 Thread John Harrison via lldb-commits
@@ -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

[Lldb-commits] [lldb] lldb-dap: Stop using replicated variable ids (PR #124232)

2025-08-29 Thread John Harrison via lldb-commits
@@ -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

[Lldb-commits] [lldb] [lldb] Adjust ProtocolServer connection defaults. (PR #155714)

2025-08-28 Thread John Harrison via 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

[Lldb-commits] [lldb] [lldb] Adjust ProtocolServer connection defaults. (PR #155714)

2025-08-28 Thread John Harrison via 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/7] [lldb] Adjust ProtocolServer connection defaults. This adjus

[Lldb-commits] [lldb] [lldb] Adjust ProtocolServer connection defaults. (PR #155714)

2025-08-28 Thread John Harrison via 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/6] [lldb] Adjust ProtocolServer connection defaults. This adjus

[Lldb-commits] [lldb] [lldb] Adjust ProtocolServer connection defaults. (PR #155714)

2025-08-28 Thread John Harrison via 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/3] [lldb] Adjust ProtocolServer connection defaults. This adjus

[Lldb-commits] [lldb] [lldb] Adjust ProtocolServer connection defaults. (PR #155714)

2025-08-28 Thread John Harrison via lldb-commits
@@ -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

[Lldb-commits] [lldb] [lldb] Adjust ProtocolServer connection defaults. (PR #155714)

2025-08-28 Thread John Harrison via lldb-commits
@@ -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

[Lldb-commits] [lldb] [lldb] Adjust ProtocolServer connection defaults. (PR #155714)

2025-08-28 Thread John Harrison via lldb-commits
@@ -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

[Lldb-commits] [lldb] [lldb] Adjust ProtocolServer connection defaults. (PR #155714)

2025-08-28 Thread John Harrison via 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/2] [lldb] Adjust ProtocolServer connection defaults. This adjus

[Lldb-commits] [lldb] [lldb] Add lldbHost dependency to lldbProtocolMCP (PR #155811)

2025-08-28 Thread John Harrison via lldb-commits
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

[Lldb-commits] [lldb] [lldb] Adjust ProtocolServer connection defaults. (PR #155714)

2025-08-27 Thread John Harrison via 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

[Lldb-commits] [lldb] [lldb] Correct a usage after a rename was merged. (PR #155720)

2025-08-27 Thread John Harrison via lldb-commits
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

[Lldb-commits] [lldb] [lldb] Correct a usage after a rename was merged. (PR #155720)

2025-08-27 Thread John Harrison via 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

[Lldb-commits] [lldb] [lldb] Adjust ProtocolServer connection defaults. (PR #155714)

2025-08-27 Thread John Harrison via lldb-commits
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

[Lldb-commits] [lldb] [lldb] Adjust ProtocolServer connection defaults. (PR #155714)

2025-08-27 Thread John Harrison via lldb-commits
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

[Lldb-commits] [lldb] [lldb] NFC Moving mcp::Transport into its own file. (PR #155711)

2025-08-27 Thread John Harrison via 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

[Lldb-commits] [lldb] [lldb] Add lldb-mcp scaffolding (PR #155708)

2025-08-27 Thread John Harrison via 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

[Lldb-commits] [lldb] [lldb] Add lldb-mcp scaffolding (PR #155708)

2025-08-27 Thread John Harrison via lldb-commits
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

[Lldb-commits] [lldb] [lldb] Adjust ProtocolServer connection defaults. (PR #155714)

2025-08-27 Thread John Harrison via 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

[Lldb-commits] [lldb] [lldb] Adjust ProtocolServer connection defaults. (PR #155714)

2025-08-27 Thread John Harrison via lldb-commits
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

[Lldb-commits] [lldb] [lldb] NFC Moving mcp::Transport into its own file. (PR #155711)

2025-08-27 Thread John Harrison via lldb-commits
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

[Lldb-commits] [lldb] [lldb] Add lldb-mcp scaffolding (PR #155708)

2025-08-27 Thread John Harrison via lldb-commits
@@ -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 ---

[Lldb-commits] [lldb] [lldb] Add lldb-mcp scaffolding (PR #155708)

2025-08-27 Thread John Harrison via 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

[Lldb-commits] [lldb] [lldb] Add lldb-mcp scaffolding (PR #155708)

2025-08-27 Thread John Harrison via 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

[Lldb-commits] [lldb] [lldb] Add lldb-mcp scaffolding (PR #155708)

2025-08-27 Thread John Harrison via lldb-commits
@@ -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 _

[Lldb-commits] [lldb] [lldb-dap] Adding exception handling for dap server disconnect and terminations in lldbdap_testcase.py (PR #155335)

2025-08-26 Thread John Harrison via lldb-commits
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

[Lldb-commits] [lldb] [lldb] Adding structured types for existing MCP calls. (PR #155460)

2025-08-26 Thread John Harrison via 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

[Lldb-commits] [lldb] [lldb] Adding structured types for existing MCP calls. (PR #155460)

2025-08-26 Thread John Harrison via 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

[Lldb-commits] [lldb] [lldb] Adding structured types for existing MCP calls. (PR #155460)

2025-08-26 Thread John Harrison via lldb-commits
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

[Lldb-commits] [lldb] [lldb] Adding structured types for existing MCP calls. (PR #155460)

2025-08-26 Thread John Harrison via lldb-commits
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

[Lldb-commits] [lldb] [lldb] Adding structured types for existing MCP calls. (PR #155460)

2025-08-26 Thread John Harrison via lldb-commits
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

[Lldb-commits] [lldb] [lldb] Adding structured types for existing MCP calls. (PR #155460)

2025-08-26 Thread John Harrison via lldb-commits
@@ -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

[Lldb-commits] [lldb] [lldb] Creating a new Binder helper for JSONRPC transport. (PR #155315)

2025-08-26 Thread John Harrison via lldb-commits
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

[Lldb-commits] [lldb] [lldb] Creating a new Binder helper for JSONRPC transport. (PR #155315)

2025-08-26 Thread John Harrison via 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

[Lldb-commits] [lldb] [lldb] Adding structured types for existing MCP calls. (PR #155460)

2025-08-26 Thread John Harrison via lldb-commits
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

[Lldb-commits] [lldb] [lldb-dap] Adding exception handling for dap server disconnect and terminations in lldbdap_testcase.py (PR #155335)

2025-08-26 Thread John Harrison via lldb-commits
@@ -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() +

[Lldb-commits] [lldb] [lldb] Creating a new Binder helper for JSONRPC transport. (PR #155315)

2025-08-25 Thread John Harrison via lldb-commits
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

[Lldb-commits] [lldb] [lldb][lldb-dap] parse `pathFormat` as an optional (PR #155238)

2025-08-25 Thread John Harrison via lldb-commits
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

[Lldb-commits] [lldb] [lldb-dap] Migrating 'completions' to structured types. (PR #153317)

2025-08-22 Thread John Harrison via 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

[Lldb-commits] [lldb] [lldb-dap] Migrating 'completions' to structured types. (PR #153317)

2025-08-21 Thread John Harrison via 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

[Lldb-commits] [lldb] [lldb-dap] Migrating 'completions' to structured types. (PR #153317)

2025-08-21 Thread John Harrison via 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/5] [lldb-dap] Migrating 'completions' to structured types. This

[Lldb-commits] [lldb] [lldb-dap] Migrating 'completions' to structured types. (PR #153317)

2025-08-21 Thread John Harrison via 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

[Lldb-commits] [lldb] Reapply "[lldb-dap] Re-land refactor of DebugCommunication. (#147787)" (PR #154832)

2025-08-21 Thread John Harrison via lldb-commits
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

[Lldb-commits] [lldb] [lldb-dap] Re-land refactor of DebugCommunication. (PR #147787)

2025-08-21 Thread John Harrison via lldb-commits
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

[Lldb-commits] [lldb] [lldb-dap] Re-land refactor of DebugCommunication. (PR #147787)

2025-08-20 Thread John Harrison via 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

[Lldb-commits] [lldb] [lldb-dap] Re-land refactor of DebugCommunication. (PR #147787)

2025-08-20 Thread John Harrison via lldb-commits
@@ -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

[Lldb-commits] [lldb] [lldb-dap] Re-land refactor of DebugCommunication. (PR #147787)

2025-08-20 Thread John Harrison via lldb-commits
@@ -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

[Lldb-commits] [lldb] [lldb-dap] Re-land refactor of DebugCommunication. (PR #147787)

2025-08-20 Thread John Harrison via lldb-commits
@@ -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

[Lldb-commits] [lldb] [lldb-dap] Re-land refactor of DebugCommunication. (PR #147787)

2025-08-20 Thread John Harrison via lldb-commits
@@ -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

[Lldb-commits] [lldb] [lldb-dap] Re-land refactor of DebugCommunication. (PR #147787)

2025-08-20 Thread John Harrison via lldb-commits
@@ -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

[Lldb-commits] [lldb] [lldb-dap] Re-land refactor of DebugCommunication. (PR #147787)

2025-08-20 Thread John Harrison via 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/2] [lldb-dap] Reland refactor of DebugCommunication. Originally

[Lldb-commits] [lldb] [lldb-dap] Migrating 'completions' to structured types. (PR #153317)

2025-08-19 Thread John Harrison via lldb-commits
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

[Lldb-commits] [lldb] [lldb-dap] Migrating 'completions' to structured types. (PR #153317)

2025-08-19 Thread John Harrison via 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/4] [lldb-dap] Migrating 'completions' to structured types. This

[Lldb-commits] [lldb] [lldb-dap] Add module symbol table viewer to VS Code extension #140626 (PR #153836)

2025-08-19 Thread John Harrison via lldb-commits
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

[Lldb-commits] [lldb] [lldb-dap] Add module symbol table viewer to VS Code extension #140626 (PR #153836)

2025-08-19 Thread John Harrison via 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

[Lldb-commits] [lldb] [lldb-dap] Add module symbol table viewer to VS Code extension #140626 (PR #153836)

2025-08-19 Thread John Harrison via lldb-commits
@@ -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

[Lldb-commits] [lldb] [lldb-dap] Add module symbol table viewer to VS Code extension #140626 (PR #153836)

2025-08-19 Thread John Harrison via lldb-commits
@@ -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

[Lldb-commits] [lldb] [lldb-dap] Add module symbol table viewer to VS Code extension #140626 (PR #153836)

2025-08-19 Thread John Harrison via lldb-commits
@@ -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

[Lldb-commits] [lldb] [lldb] Refactoring JSONTransport into an abstract RPC Message Handler and transport layer. (PR #153121)

2025-08-19 Thread John Harrison via lldb-commits
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

[Lldb-commits] [lldb] [lldb] Refactoring JSONTransport into an abstract RPC Message Handler and transport layer. (PR #153121)

2025-08-15 Thread John Harrison via 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

[Lldb-commits] [lldb] [lldb] Refactoring JSONTransport into an abstract RPC Message Handler and transport layer. (PR #153121)

2025-08-15 Thread John Harrison via lldb-commits
@@ -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

[Lldb-commits] [lldb] [lldb-dap] Add module symbol table viewer to VS Code extension #140626 (PR #153836)

2025-08-15 Thread John Harrison via lldb-commits
@@ -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

[Lldb-commits] [lldb] [lldb-dap] Add module symbol table viewer to VS Code extension #140626 (PR #153836)

2025-08-15 Thread John Harrison via lldb-commits
@@ -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

[Lldb-commits] [lldb] [lldb-dap] Add module symbol table viewer to VS Code extension #140626 (PR #153836)

2025-08-15 Thread John Harrison via lldb-commits
@@ -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

[Lldb-commits] [lldb] [lldb-dap] Add module symbol table viewer to VS Code extension #140626 (PR #153836)

2025-08-15 Thread John Harrison via lldb-commits
@@ -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

[Lldb-commits] [lldb] [lldb-dap] Add module symbol table viewer to VS Code extension #140626 (PR #153836)

2025-08-15 Thread John Harrison via lldb-commits
@@ -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

[Lldb-commits] [lldb] [lldb-dap] Add module symbol table viewer to VS Code extension #140626 (PR #153836)

2025-08-15 Thread John Harrison via lldb-commits
@@ -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

[Lldb-commits] [lldb] [lldb-dap] Add module symbol table viewer to VS Code extension #140626 (PR #153836)

2025-08-15 Thread John Harrison via lldb-commits
@@ -259,19 +266,40 @@ { "command": "lldb-dap.modules.copyProperty", "title": "Copy Value" + }, + { +"command": "lldb-dap.modules.showSymbols", +"title": "Show Module Symbols" + }, + { +"category": "lldb-dap", +

[Lldb-commits] [lldb] [lldb-dap] Add module symbol table viewer to VS Code extension #140626 (PR #153836)

2025-08-15 Thread John Harrison via lldb-commits
@@ -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

[Lldb-commits] [lldb] [lldb-dap] Add module symbol table viewer to VS Code extension #140626 (PR #153836)

2025-08-15 Thread John Harrison via lldb-commits
@@ -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://

[Lldb-commits] [lldb] [lldb-dap] Add module symbol table viewer to VS Code extension #140626 (PR #153836)

2025-08-15 Thread John Harrison via lldb-commits
@@ -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

[Lldb-commits] [lldb] [lldb-dap] Add module symbol table viewer to VS Code extension #140626 (PR #153836)

2025-08-15 Thread John Harrison via lldb-commits
@@ -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

[Lldb-commits] [lldb] [lldb-dap] Add module symbol table viewer to VS Code extension #140626 (PR #153836)

2025-08-15 Thread John Harrison via lldb-commits
@@ -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

[Lldb-commits] [lldb] [lldb-dap] Add module symbol table viewer to VS Code extension #140626 (PR #153836)

2025-08-15 Thread John Harrison via lldb-commits
@@ -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

[Lldb-commits] [lldb] [lldb-dap] Add module symbol table viewer to VS Code extension #140626 (PR #153836)

2025-08-15 Thread John Harrison via lldb-commits
@@ -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

[Lldb-commits] [lldb] [lldb-dap] Add module symbol table viewer to VS Code extension #140626 (PR #153836)

2025-08-15 Thread John Harrison via lldb-commits
@@ -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

[Lldb-commits] [lldb] [lldb-dap] Add module symbol table viewer to VS Code extension #140626 (PR #153836)

2025-08-15 Thread John Harrison via lldb-commits
@@ -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

[Lldb-commits] [lldb] [lldb] Refactoring JSONTransport into an abstract RPC Message Handler and transport layer. (PR #153121)

2025-08-13 Thread John Harrison via lldb-commits
@@ -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

[Lldb-commits] [lldb] [lldb] Refactoring JSONTransport into an abstract RPC Message Handler and transport layer. (PR #153121)

2025-08-13 Thread John Harrison via lldb-commits
@@ -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()); +

[Lldb-commits] [lldb] [lldb] Refactoring JSONTransport into an abstract RPC Message Handler and transport layer. (PR #153121)

2025-08-13 Thread John Harrison via lldb-commits
@@ -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) {

[Lldb-commits] [lldb] [lldb] Refactoring JSONTransport into an abstract RPC Message Handler and transport layer. (PR #153121)

2025-08-13 Thread John Harrison via lldb-commits
@@ -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   2   3   4   5   6   7   8   9   10   >