[Lldb-commits] [lldb] [lldb-dap] Correct the variable name from a half finished merge. (PR #130186)

2025-03-06 Thread John Harrison via lldb-commits
https://github.com/ashgti ready_for_review https://github.com/llvm/llvm-project/pull/130186 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb-dap] Correct the variable name from a half finished merge. (PR #130186)

2025-03-06 Thread John Harrison via lldb-commits
https://github.com/ashgti created https://github.com/llvm/llvm-project/pull/130186 None >From ab48e2c1ee83ed9068f080d2f072f4fb957e1bb7 Mon Sep 17 00:00:00 2001 From: John Harrison Date: Thu, 6 Mar 2025 23:06:20 +0100 Subject: [PATCH] [lldb-dap] Correct the variable name from a half finished m

[Lldb-commits] [lldb] [lldb-dap] Correct the variable name from a half finished merge. (PR #130186)

2025-03-06 Thread John Harrison via lldb-commits
https://github.com/ashgti closed https://github.com/llvm/llvm-project/pull/130186 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb-dap] Refactoring IOStream into Transport handler. (PR #130026)

2025-03-06 Thread John Harrison via lldb-commits
https://github.com/ashgti updated https://github.com/llvm/llvm-project/pull/130026 >From a9ae73407acad86c49099f4c7eba914e639f0850 Mon Sep 17 00:00:00 2001 From: John Harrison Date: Thu, 6 Mar 2025 10:18:36 +0100 Subject: [PATCH] [lldb-dap] Refactoring IOStream into Transport handler. Instead o

[Lldb-commits] [lldb] [lldb-dap] Refactoring IOStream into Transport handler. (PR #130026)

2025-03-06 Thread John Harrison via lldb-commits
@@ -722,40 +683,9 @@ void DAP::SetTarget(const lldb::SBTarget target) { } } -PacketStatus DAP::GetNextObject(llvm::json::Object &object) { - std::string json = ReadJSON(); - if (json.empty()) -return PacketStatus::EndOfFile; - - llvm::StringRef json_sref(json); - llv

[Lldb-commits] [lldb] [lldb-dap] Refactoring IOStream into Transport handler. (PR #130026)

2025-03-06 Thread John Harrison via lldb-commits
@@ -0,0 +1,56 @@ +//===-- Transport.h ---===// +// +// 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: Apa

[Lldb-commits] [lldb] [lldb-dap] Refactoring IOStream into Transport handler. (PR #130026)

2025-03-06 Thread John Harrison via lldb-commits
@@ -1526,7 +1526,8 @@ static void addStatistic(lldb::SBTarget &target, llvm::json::Object &event) { const char *key = keys.GetStringAtIndex(i); FilterAndGetValueForKey(statistics, key, stats_body); } - event.try_emplace("statistics", std::move(stats_body)); + llvm:

[Lldb-commits] [lldb] [lldb-dap] Refactoring IOStream into Transport handler. (PR #130026)

2025-03-06 Thread John Harrison via lldb-commits
@@ -237,65 +238,25 @@ void DAP::StopEventHandlers() { } } -// Send the JSON in "json_str" to the "out" stream. Correctly send the -// "Content-Length:" field followed by the length, followed by the raw -// JSON bytes. -void DAP::SendJSON(const std::string &json_str) { - out

[Lldb-commits] [lldb] [lldb-dap] Refactoring IOStream into Transport handler. (PR #130026)

2025-03-06 Thread John Harrison via lldb-commits
https://github.com/ashgti ready_for_review https://github.com/llvm/llvm-project/pull/130026 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb-dap] Refactoring IOStream into Transport handler. (PR #130026)

2025-03-06 Thread John Harrison via lldb-commits
@@ -0,0 +1,152 @@ +//===-- Transport.cpp -===// +// +// 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: Ap

[Lldb-commits] [lldb] [lldb-dap] Restore the override FD used by the output redirect on stop. (PR #129964)

2025-03-06 Thread John Harrison via lldb-commits
https://github.com/ashgti updated https://github.com/llvm/llvm-project/pull/129964 >From bcecf0c2aa0d398478734f24a9913cb398167e66 Mon Sep 17 00:00:00 2001 From: John Harrison Date: Thu, 6 Mar 2025 02:05:46 +0100 Subject: [PATCH 1/2] [lldb-dap] Restore the override FD used by the output redirec

[Lldb-commits] [lldb] [lldb-dap] Refactoring IOStream into Transport handler. (PR #130026)

2025-03-06 Thread John Harrison via lldb-commits
ashgti wrote: > Why is this still marked as draft? It looks almost ready to be merged to me 🙂 I was going to wait for #129964 first so I didn't have to many PRs on top of PRs (github PRs don't stack well, at least IMO). https://github.com/llvm/llvm-project/pull/130026 _

[Lldb-commits] [lldb] [lldb-dap] Refactoring IOStream into Transport handler. (PR #130026)

2025-03-10 Thread John Harrison via lldb-commits
@@ -0,0 +1,146 @@ +//===-- Transport.cpp -===// +// +// 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: Ap

[Lldb-commits] [lldb] [lldb-dap] Refactoring IOStream into Transport handler. (PR #130026)

2025-03-10 Thread John Harrison via lldb-commits
@@ -0,0 +1,146 @@ +//===-- Transport.cpp -===// +// +// 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: Ap

[Lldb-commits] [lldb] [lldb-dap] Refactoring IOStream into Transport handler. (PR #130026)

2025-03-10 Thread John Harrison via lldb-commits
@@ -838,19 +775,16 @@ llvm::Error DAP::Loop() { StopEventHandlers(); }); while (!disconnecting) { -llvm::json::Object object; -lldb_dap::PacketStatus status = GetNextObject(object); - -if (status == lldb_dap::PacketStatus::EndOfFile) { - break; -} -

[Lldb-commits] [lldb] [lldb-dap] Adding logging helpers. (PR #130653)

2025-03-11 Thread John Harrison via lldb-commits
https://github.com/ashgti updated https://github.com/llvm/llvm-project/pull/130653 >From 88f1cf3469c9f24a768f5147c22cfe414aea014e Mon Sep 17 00:00:00 2001 From: John Harrison Date: Sat, 8 Mar 2025 17:55:34 -0800 Subject: [PATCH 1/3] [lldb-dap] Adding logging helpers. Improving logging by defin

[Lldb-commits] [lldb] [lldb-dap] Adding logging helpers. (PR #130653)

2025-03-11 Thread John Harrison via lldb-commits
@@ -239,14 +241,7 @@ void DAP::SendJSON(const llvm::json::Value &json) { std::lock_guard locker(mutex); SendJSON(json_str); - if (log) { -auto now = std::chrono::duration( -std::chrono::system_clock::now().time_since_epoch()); -*log << llvm::formatv("{0:f9

[Lldb-commits] [lldb] [lldb-dap] Adding logging helpers. (PR #130653)

2025-03-11 Thread John Harrison via lldb-commits
@@ -711,22 +700,15 @@ PacketStatus DAP::GetNextObject(llvm::json::Object &object) { llvm::StringRef json_sref(json); llvm::Expected json_value = llvm::json::parse(json_sref); - if (auto error = json_value.takeError()) { -std::string error_str = llvm::toString(std::mo

[Lldb-commits] [lldb] [lldb-dap] Migrating terminated statistics to the event body. (PR #130454)

2025-03-11 Thread John Harrison via lldb-commits
https://github.com/ashgti closed https://github.com/llvm/llvm-project/pull/130454 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb-dap] Refactoring IOStream into Transport handler. (PR #130026)

2025-03-11 Thread John Harrison via lldb-commits
@@ -0,0 +1,58 @@ +//===-- DAPLog.h --===// +// +// 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: Apa

[Lldb-commits] [lldb] [lldb-dap] Refactoring IOStream into Transport handler. (PR #130026)

2025-03-11 Thread John Harrison via lldb-commits
https://github.com/ashgti updated https://github.com/llvm/llvm-project/pull/130026 >From c340c38a82880114471938b19512670d7f94245e Mon Sep 17 00:00:00 2001 From: John Harrison Date: Thu, 6 Mar 2025 10:18:36 +0100 Subject: [PATCH 1/4] [lldb-dap] Refactoring IOStream into Transport handler. Inste

[Lldb-commits] [lldb] [lldb-dap] Adding support for cancelling a request. (PR #130169)

2025-03-11 Thread John Harrison via lldb-commits
https://github.com/ashgti created https://github.com/llvm/llvm-project/pull/130169 Adding support for cancelling requests. There are two forms of request cancellation. * Preemptively cancelling a request that is in the queue. * Actively cancelling the in progress request as a best effort attem

[Lldb-commits] [lldb] [lldb-dap] Refactoring IOStream into Transport handler. (PR #130026)

2025-03-11 Thread John Harrison via lldb-commits
https://github.com/ashgti created https://github.com/llvm/llvm-project/pull/130026 Instead of having two discrete InputStream and OutputStream helpers, this merges the two into a unifed 'Transport' handler. This handler is responsible for reading the DAP message headers, parsing the resulting

[Lldb-commits] [lldb] [lldb-dap] Adding logging helpers. (PR #130653)

2025-03-11 Thread John Harrison via lldb-commits
https://github.com/ashgti closed https://github.com/llvm/llvm-project/pull/130653 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb-dap] Refactoring IOStream into Transport handler. (PR #130026)

2025-03-11 Thread John Harrison via lldb-commits
@@ -315,23 +316,19 @@ serveConnection(const Socket::SocketProtocol &protocol, const std::string &name, &dap_sessions_mutex, &dap_sessions, &clientCount](

[Lldb-commits] [lldb] [lldb-dap] Updating RequestHandler to encode/decode arguments and response. (PR #130090)

2025-03-11 Thread John Harrison via lldb-commits
https://github.com/ashgti created https://github.com/llvm/llvm-project/pull/130090 This is a work in progress refactor to add explicit types instead of generic 'llvm::json::Value' types to the DAP protocol. This updates RequestHandler to have take the type of the arguments and response body for

[Lldb-commits] [lldb] [lldb-dap] Refactoring IOStream into Transport handler. (PR #130026)

2025-03-11 Thread John Harrison via lldb-commits
https://github.com/ashgti updated https://github.com/llvm/llvm-project/pull/130026 >From c340c38a82880114471938b19512670d7f94245e Mon Sep 17 00:00:00 2001 From: John Harrison Date: Thu, 6 Mar 2025 10:18:36 +0100 Subject: [PATCH 1/5] [lldb-dap] Refactoring IOStream into Transport handler. Inste

[Lldb-commits] [lldb] [lldb-dap] Refactoring IOStream into Transport handler. (PR #130026)

2025-03-11 Thread John Harrison via lldb-commits
@@ -0,0 +1,144 @@ +//===-- Transport.cpp -===// +// +// 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: Ap

[Lldb-commits] [lldb] [lldb-dap] Refactoring IOStream into Transport handler. (PR #130026)

2025-03-11 Thread John Harrison via lldb-commits
@@ -838,19 +770,12 @@ llvm::Error DAP::Loop() { StopEventHandlers(); }); while (!disconnecting) { -llvm::json::Object object; -lldb_dap::PacketStatus status = GetNextObject(object); - -if (status == lldb_dap::PacketStatus::EndOfFile) { +std::optional nex

[Lldb-commits] [lldb] [lldb-dap] Creating a new set of types for handling DAP messages. (PR #129155)

2025-02-27 Thread John Harrison via lldb-commits
ashgti wrote: For reference, this is part of a larger refactor to support 'cancel' requests. I have a working prototype in https://github.com/ashgti/llvm-project/tree/lldb-dap-cancel that I am splitting up into smaller individual patches. https://github.com/llvm/llvm-project/pull/129155 _

[Lldb-commits] [lldb] [lldb-dap] Creating a dedicated Transport class for DAP communication. (PR #128972)

2025-02-27 Thread John Harrison via lldb-commits
https://github.com/ashgti converted_to_draft https://github.com/llvm/llvm-project/pull/128972 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb-dap] Creating well defined structures for DAP messages. (PR #129155)

2025-02-27 Thread John Harrison via lldb-commits
https://github.com/ashgti edited https://github.com/llvm/llvm-project/pull/129155 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb-dap] Creating a new set of types for handling DAP messages. (PR #129155)

2025-02-27 Thread John Harrison via lldb-commits
https://github.com/ashgti created https://github.com/llvm/llvm-project/pull/129155 This adds a new `Protocol.{h,cpp}` for defining structured types that represent Debug Adapter Protocol messages. This adds static types to define well structure messages for the protocol. This iteration include

[Lldb-commits] [lldb] [lldb-dap] Creating a dedicated Transport class for DAP communication. (PR #128972)

2025-02-27 Thread John Harrison via lldb-commits
https://github.com/ashgti closed https://github.com/llvm/llvm-project/pull/128972 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb-dap] Creating a dedicated Transport class for DAP communication. (PR #128972)

2025-02-27 Thread John Harrison via lldb-commits
ashgti wrote: Replacing this with https://github.com/llvm/llvm-project/pull/129155 for a smaller set of files to review. https://github.com/llvm/llvm-project/pull/128972 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/

[Lldb-commits] [lldb] [lldb-dap] Creating well defined structures for DAP messages. (PR #129155)

2025-02-27 Thread John Harrison via lldb-commits
https://github.com/ashgti ready_for_review https://github.com/llvm/llvm-project/pull/129155 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb-dap] Creating well defined structures for DAP messages. (PR #129155)

2025-02-27 Thread John Harrison via lldb-commits
https://github.com/ashgti edited https://github.com/llvm/llvm-project/pull/129155 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb-dap] Adding server mode support to lldb-dap VSCode extension. (PR #128957)

2025-02-27 Thread John Harrison via lldb-commits
https://github.com/ashgti updated https://github.com/llvm/llvm-project/pull/128957 >From e95459a73ad5a1448841ed6c2422f66b23f6b486 Mon Sep 17 00:00:00 2001 From: John Harrison Date: Wed, 26 Feb 2025 14:56:10 -0800 Subject: [PATCH 1/3] [lldb-dap] Adding server mode support to lldb-dap VSCode ext

[Lldb-commits] [lldb] [lldb-dap] Adding server mode support to lldb-dap VSCode extension. (PR #128957)

2025-02-27 Thread John Harrison via lldb-commits
@@ -88,6 +88,12 @@ "additionalProperties": { "type": "string" } +}, +"lldb-dap.serverMode": { + "scope": "resource", + "type": "boolean", + "description": "Run lldb-dap in server mode. When enabled, lldb

[Lldb-commits] [lldb] [lldb-dap] Adaptor -> Adapter (NFC) (PR #129110)

2025-02-27 Thread John Harrison via lldb-commits
https://github.com/ashgti approved this pull request. https://github.com/llvm/llvm-project/pull/129110 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb-dap] Creating a dedicated Transport class for DAP communication. (PR #128972)

2025-02-27 Thread John Harrison via lldb-commits
ashgti wrote: > This PR feels like it combines 3 different changes: > > * Introducing the Transport class > * Using LLDB's logging > * Introducing the protocol class > > Would it be a lot of work to split this up into 3 separate PRs? If not I'm > happy to review everything together here. The T

[Lldb-commits] [lldb] [lldb-dap] Creating a dedicated Transport class for DAP communication. (PR #128972)

2025-02-27 Thread John Harrison via lldb-commits
https://github.com/ashgti ready_for_review https://github.com/llvm/llvm-project/pull/128972 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb-dap] Creating a dedicated Transport class for DAP communication. (PR #128972)

2025-02-27 Thread John Harrison via lldb-commits
https://github.com/ashgti edited https://github.com/llvm/llvm-project/pull/128972 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb-dap] Adaptor -> Adapter (NFC) (PR #129110)

2025-02-27 Thread John Harrison via lldb-commits
ashgti wrote: There are a few other places where `Adaptor` is used: ``` $ rg -i adaptor lldb lldb/packages/Python/lldbsuite/test/test_categories.py 34:"lldb-dap": "Tests for the Debug Adaptor Protocol with lldb-dap", lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py 79:

[Lldb-commits] [lldb] [lldb-dap] Adaptor -> Adapter (NFC) (PR #129110)

2025-02-27 Thread John Harrison via lldb-commits
https://github.com/ashgti approved this pull request. https://github.com/llvm/llvm-project/pull/129110 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb-dap] Support cancel requests and add explicit DAP structures. (PR #128276)

2025-02-27 Thread John Harrison via lldb-commits
https://github.com/ashgti closed https://github.com/llvm/llvm-project/pull/128276 ___ 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 process picker command to VS Code extension (PR #128943)

2025-02-28 Thread John Harrison via lldb-commits
@@ -0,0 +1,102 @@ +import { ChildProcessWithoutNullStreams } from "child_process"; +import { Process, ProcessTree } from "."; +import { Transform } from "stream"; + +/** Parses process information from a given line of process output. */ +export type ProcessTreeParser = (line: stri

[Lldb-commits] [lldb] [lldb-dap] Creating well defined structures for DAP messages. (PR #129155)

2025-02-28 Thread John Harrison via lldb-commits
@@ -0,0 +1,187 @@ +//===-- Protocol.h ===// +// +// 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: Ap

[Lldb-commits] [lldb] [lldb-dap] Creating well defined structures for DAP messages. (PR #129155)

2025-02-28 Thread John Harrison via lldb-commits
https://github.com/ashgti edited https://github.com/llvm/llvm-project/pull/129155 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb-dap] Creating well defined structures for DAP messages. (PR #129155)

2025-02-28 Thread John Harrison via lldb-commits
@@ -0,0 +1,191 @@ +//===-- Protocol.cpp --===// +// +// 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: Ap

[Lldb-commits] [lldb] [lldb-dap] Creating well defined structures for DAP messages. (PR #129155)

2025-02-28 Thread John Harrison via lldb-commits
https://github.com/ashgti edited https://github.com/llvm/llvm-project/pull/129155 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb-dap] Creating well defined structures for DAP messages. (PR #129155)

2025-02-28 Thread John Harrison via lldb-commits
@@ -0,0 +1,191 @@ +//===-- Protocol.cpp --===// +// +// 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: Ap

[Lldb-commits] [lldb] [lldb-dap] Creating well defined structures for DAP messages. (PR #129155)

2025-02-28 Thread John Harrison via lldb-commits
@@ -0,0 +1,187 @@ +//===-- Protocol.h ===// +// +// 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: Ap

[Lldb-commits] [lldb] [lldb-dap] Creating well defined structures for DAP messages. (PR #129155)

2025-02-28 Thread John Harrison via lldb-commits
ashgti wrote: I also added some additional validations like checking that an `Event` has a `"seq": 0` (per the spec) and to make sure various strings are not empty. https://github.com/llvm/llvm-project/pull/129155 ___ lldb-commits mailing list lldb-co

[Lldb-commits] [lldb] [lldb-dap] Creating well defined structures for DAP messages. (PR #129155)

2025-02-28 Thread John Harrison via lldb-commits
https://github.com/ashgti updated https://github.com/llvm/llvm-project/pull/129155 >From 5ec870632250a2bf59341c2699a6a93b31c155ba Mon Sep 17 00:00:00 2001 From: John Harrison Date: Thu, 27 Feb 2025 15:27:41 -0800 Subject: [PATCH 1/2] [lldb-dap] Creating a new set of types for handling DAP mess

[Lldb-commits] [lldb] [lldb-dap] Creating well defined structures for DAP messages. (PR #129155)

2025-02-28 Thread John Harrison via lldb-commits
@@ -0,0 +1,191 @@ +//===-- Protocol.cpp --===// +// +// 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: Ap

[Lldb-commits] [lldb] [lldb-dap] Creating well defined structures for DAP messages. (PR #129155)

2025-02-28 Thread John Harrison via lldb-commits
@@ -0,0 +1,191 @@ +//===-- Protocol.cpp --===// +// +// 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: Ap

[Lldb-commits] [lldb] [lldb-dap] Adding server mode support to lldb-dap VSCode extension. (PR #128957)

2025-02-28 Thread John Harrison via lldb-commits
https://github.com/ashgti closed https://github.com/llvm/llvm-project/pull/128957 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb-dap] Adding server mode support to lldb-dap VSCode extension. (PR #128957)

2025-02-28 Thread John Harrison via lldb-commits
@@ -88,6 +88,12 @@ "additionalProperties": { "type": "string" } +}, +"lldb-dap.serverMode": { + "scope": "resource", + "type": "boolean", + "markdownDescription": "Run lldb-dap in server mode.\n\nWhen e

[Lldb-commits] [lldb] [lldb-dap] Adding server mode support to lldb-dap VSCode extension. (PR #128957)

2025-03-01 Thread John Harrison via lldb-commits
@@ -15,13 +13,14 @@ import { DisposableContext } from "./disposable-context"; export class LLDBDapExtension extends DisposableContext { constructor() { super(); +const factory = new LLDBDapDescriptorFactory(); +this.pushSubscription(factory); ashg

[Lldb-commits] [lldb] [lldb-dap] Adding server mode support to lldb-dap VSCode extension. (PR #128957)

2025-03-01 Thread John Harrison via lldb-commits
ashgti wrote: I filed #129283 to track some of the improvements discussed in the comments so they're not lost. https://github.com/llvm/llvm-project/pull/128957 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

[Lldb-commits] [lldb] [lldb-dap] Allow providing debug adapter arguments in the extension (PR #129262)

2025-02-28 Thread John Harrison via lldb-commits
@@ -137,53 +157,59 @@ export class LLDBDapDescriptorFactory const dbgOptions = { env: { -...executable?.options?.env, ...configEnvironment, ...env, }, }; -const dbgArgs = executable?.args ?? []; +const dbgArgs = getDAPArg

[Lldb-commits] [lldb] [lldb-dap] Creating well defined structures for DAP messages. (PR #129155)

2025-02-28 Thread John Harrison via lldb-commits
https://github.com/ashgti updated https://github.com/llvm/llvm-project/pull/129155 >From 5ec870632250a2bf59341c2699a6a93b31c155ba Mon Sep 17 00:00:00 2001 From: John Harrison Date: Thu, 27 Feb 2025 15:27:41 -0800 Subject: [PATCH 1/3] [lldb-dap] Creating a new set of types for handling DAP mess

[Lldb-commits] [lldb] [lldb-dap] Refactoring IOStream into Transport handler. (PR #130026)

2025-03-11 Thread John Harrison via lldb-commits
ashgti wrote: Apparently rebasing my changes on a main caused GH to not let me reply to some comments directly (still learning GH's PR nuances...). >From labath > That probably fine, but I am pretty sure that being abstract doesn't prevent > you from [forming a reference](https://godbolt.org/z

[Lldb-commits] [lldb] [lldb-dap] Updating RequestHandler to encode/decode arguments and response. (PR #130090)

2025-03-13 Thread John Harrison via lldb-commits
@@ -30,216 +30,170 @@ namespace lldb_dap::protocol { // MARK: Base Protocol -// "Request": { -// "allOf": [ { "$ref": "#/definitions/ProtocolMessage" }, { -// "type": "object", -// "description": "A client or debug adapter initiated request.", -// "properties":

[Lldb-commits] [lldb] [lldb-dap] Updating RequestHandler to encode/decode arguments and response. (PR #130090)

2025-03-13 Thread John Harrison via lldb-commits
https://github.com/ashgti updated https://github.com/llvm/llvm-project/pull/130090 >From f26c9a79ca234bee77ec1a9694bf8be2d0e3745c Mon Sep 17 00:00:00 2001 From: John Harrison Date: Thu, 6 Mar 2025 13:21:10 +0100 Subject: [PATCH 1/5] [lldb-dap] Updating RequestHandler to encode/decode arguments

[Lldb-commits] [lldb] [lldb-dap] Updating RequestHandler to encode/decode arguments and response. (PR #130090)

2025-03-13 Thread John Harrison via lldb-commits
@@ -240,6 +240,137 @@ using Message = std::variant; bool fromJSON(const llvm::json::Value &, Message &, llvm::json::Path); llvm::json::Value toJSON(const Message &); +// MARK: Types + +// "Source": { +// "type": "object", +// "description": "A `Source` is a descriptor for

[Lldb-commits] [lldb] [lldb-dap] Updating RequestHandler to encode/decode arguments and response. (PR #130090)

2025-03-13 Thread John Harrison via lldb-commits
@@ -57,235 +68,288 @@ class RequestHandler { DAP &dap; }; -class AttachRequestHandler : public RequestHandler { -public: - using RequestHandler::RequestHandler; +/// Base class for handling DAP requests. Handlers should declare their +/// arguments and response body types l

[Lldb-commits] [lldb] [lldb-dap] Support vscode launch URLs (PR #125843)

2025-03-12 Thread John Harrison via lldb-commits
https://github.com/ashgti approved this pull request. Looks great! https://github.com/llvm/llvm-project/pull/125843 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb-dap] Updating RequestHandler to encode/decode arguments and response. (PR #130090)

2025-03-13 Thread John Harrison via lldb-commits
ashgti wrote: > What is your overall plan for this PR? > > I assume the first step is to get buy-in from all reviewers into the new > structure for our JSON types. But what comes after? Are you planning to > update this PR to cover all JSON types / requests / responses? Are you > planning to

[Lldb-commits] [lldb] [lldb-dap] Updating RequestHandler to encode/decode arguments and response. (PR #130090)

2025-03-13 Thread John Harrison via lldb-commits
https://github.com/ashgti updated https://github.com/llvm/llvm-project/pull/130090 >From f26c9a79ca234bee77ec1a9694bf8be2d0e3745c Mon Sep 17 00:00:00 2001 From: John Harrison Date: Thu, 6 Mar 2025 13:21:10 +0100 Subject: [PATCH 1/6] [lldb-dap] Updating RequestHandler to encode/decode arguments

[Lldb-commits] [lldb] [lldb-dap] Updating RequestHandler to encode/decode arguments and response. (PR #130090)

2025-03-13 Thread John Harrison via lldb-commits
https://github.com/ashgti updated https://github.com/llvm/llvm-project/pull/130090 >From f26c9a79ca234bee77ec1a9694bf8be2d0e3745c Mon Sep 17 00:00:00 2001 From: John Harrison Date: Thu, 6 Mar 2025 13:21:10 +0100 Subject: [PATCH 1/7] [lldb-dap] Updating RequestHandler to encode/decode arguments

[Lldb-commits] [lldb] [lldb-dap] Validate server mode support prior to invoking lldb-dap. (PR #130855)

2025-03-12 Thread John Harrison via lldb-commits
https://github.com/ashgti closed https://github.com/llvm/llvm-project/pull/130855 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb-dap] Updating RequestHandler to encode/decode arguments and response. (PR #130090)

2025-03-13 Thread John Harrison via lldb-commits
https://github.com/ashgti edited https://github.com/llvm/llvm-project/pull/130090 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb-dap] Updating the logging of lldb-dap to use existing LLDBLog. (PR #129294)

2025-03-05 Thread John Harrison via lldb-commits
https://github.com/ashgti closed https://github.com/llvm/llvm-project/pull/129294 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb-dap] Creating well defined structures for DAP messages. (PR #129155)

2025-03-05 Thread John Harrison via lldb-commits
https://github.com/ashgti closed https://github.com/llvm/llvm-project/pull/129155 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb-dap] Adding server mode support to lldb-dap VSCode extension. (PR #128957)

2025-03-03 Thread John Harrison via lldb-commits
https://github.com/ashgti updated https://github.com/llvm/llvm-project/pull/128957 >From e95459a73ad5a1448841ed6c2422f66b23f6b486 Mon Sep 17 00:00:00 2001 From: John Harrison Date: Wed, 26 Feb 2025 14:56:10 -0800 Subject: [PATCH 1/4] [lldb-dap] Adding server mode support to lldb-dap VSCode ext

[Lldb-commits] [lldb] [lldb-dap] Improving EOF handling on stream input and adding new unit tests (PR #129581)

2025-03-05 Thread John Harrison via lldb-commits
ashgti wrote: That is a SIGPIPE, so something is writing after the output is closed. I can try that locally and see if I have the same issue. https://github.com/llvm/llvm-project/pull/129581 ___ lldb-commits mailing list lldb-commits@lists.llvm.org ht

[Lldb-commits] [lldb] [lldb-dap] Use LLDB_INVALID_LINE_NUMBER & LLDB_INVALID_COLUMN_NUMBER (PR #129948)

2025-03-05 Thread John Harrison via lldb-commits
https://github.com/ashgti approved this pull request. https://github.com/llvm/llvm-project/pull/129948 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb-dap] Refactoring IOStream into Transport handler. (PR #130026)

2025-03-12 Thread John Harrison via lldb-commits
@@ -63,12 +64,12 @@ const char DEV_NULL[] = "/dev/null"; namespace lldb_dap { -DAP::DAP(llvm::StringRef client_name, llvm::StringRef path, std::ofstream *log, - lldb::IOObjectSP input, lldb::IOObjectSP output, ReplMode repl_mode, - std::vector pre_init_command

[Lldb-commits] [lldb] [lldb-dap] Refactoring IOStream into Transport handler. (PR #130026)

2025-03-12 Thread John Harrison via lldb-commits
https://github.com/ashgti updated https://github.com/llvm/llvm-project/pull/130026 >From c340c38a82880114471938b19512670d7f94245e Mon Sep 17 00:00:00 2001 From: John Harrison Date: Thu, 6 Mar 2025 10:18:36 +0100 Subject: [PATCH 01/10] [lldb-dap] Refactoring IOStream into Transport handler. Ins

[Lldb-commits] [lldb] [lldb-dap] Refactoring IOStream into Transport handler. (PR #130026)

2025-03-12 Thread John Harrison via lldb-commits
https://github.com/ashgti updated https://github.com/llvm/llvm-project/pull/130026 >From c340c38a82880114471938b19512670d7f94245e Mon Sep 17 00:00:00 2001 From: John Harrison Date: Thu, 6 Mar 2025 10:18:36 +0100 Subject: [PATCH 1/8] [lldb-dap] Refactoring IOStream into Transport handler. Inste

[Lldb-commits] [lldb] [lldb-dap] Refactoring IOStream into Transport handler. (PR #130026)

2025-03-12 Thread John Harrison via lldb-commits
https://github.com/ashgti updated https://github.com/llvm/llvm-project/pull/130026 >From c340c38a82880114471938b19512670d7f94245e Mon Sep 17 00:00:00 2001 From: John Harrison Date: Thu, 6 Mar 2025 10:18:36 +0100 Subject: [PATCH 1/9] [lldb-dap] Refactoring IOStream into Transport handler. Inste

[Lldb-commits] [lldb] [lldb-dap] Refactoring IOStream into Transport handler. (PR #130026)

2025-03-11 Thread John Harrison via lldb-commits
https://github.com/ashgti updated https://github.com/llvm/llvm-project/pull/130026 >From c340c38a82880114471938b19512670d7f94245e Mon Sep 17 00:00:00 2001 From: John Harrison Date: Thu, 6 Mar 2025 10:18:36 +0100 Subject: [PATCH 1/6] [lldb-dap] Refactoring IOStream into Transport handler. Inste

[Lldb-commits] [lldb] [lldb-dap] Refactoring IOStream into Transport handler. (PR #130026)

2025-03-12 Thread John Harrison via lldb-commits
@@ -210,12 +209,33 @@ struct DAP { // will contain that expression. std::string last_nonempty_var_expression; - DAP(llvm::StringRef client_name, llvm::StringRef path, std::ofstream *log, - lldb::IOObjectSP input, lldb::IOObjectSP output, ReplMode repl_mode, - st

[Lldb-commits] [lldb] [lldb-dap] Updating RequestHandler to encode/decode arguments and response. (PR #130090)

2025-03-12 Thread John Harrison via lldb-commits
https://github.com/ashgti updated https://github.com/llvm/llvm-project/pull/130090 >From f26c9a79ca234bee77ec1a9694bf8be2d0e3745c Mon Sep 17 00:00:00 2001 From: John Harrison Date: Thu, 6 Mar 2025 13:21:10 +0100 Subject: [PATCH 1/2] [lldb-dap] Updating RequestHandler to encode/decode arguments

[Lldb-commits] [lldb] [lldb-dap] Updating RequestHandler to encode/decode arguments and response. (PR #130090)

2025-03-12 Thread John Harrison via lldb-commits
@@ -240,6 +240,137 @@ using Message = std::variant; bool fromJSON(const llvm::json::Value &, Message &, llvm::json::Path); llvm::json::Value toJSON(const Message &); +// MARK: Types + +// "Source": { +// "type": "object", +// "description": "A `Source` is a descriptor for

[Lldb-commits] [lldb] [lldb-dap] Updating RequestHandler to encode/decode arguments and response. (PR #130090)

2025-03-12 Thread John Harrison via lldb-commits
@@ -240,6 +240,137 @@ using Message = std::variant; bool fromJSON(const llvm::json::Value &, Message &, llvm::json::Path); llvm::json::Value toJSON(const Message &); +// MARK: Types + +// "Source": { +// "type": "object", +// "description": "A `Source` is a descriptor for

[Lldb-commits] [lldb] [lldb-dap] Updating RequestHandler to encode/decode arguments and response. (PR #130090)

2025-03-12 Thread John Harrison via lldb-commits
@@ -240,6 +240,137 @@ using Message = std::variant; bool fromJSON(const llvm::json::Value &, Message &, llvm::json::Path); llvm::json::Value toJSON(const Message &); +// MARK: Types + +// "Source": { +// "type": "object", +// "description": "A `Source` is a descriptor for

[Lldb-commits] [lldb] [lldb-dap] Updating RequestHandler to encode/decode arguments and response. (PR #130090)

2025-03-12 Thread John Harrison via lldb-commits
@@ -57,235 +68,288 @@ class RequestHandler { DAP &dap; }; -class AttachRequestHandler : public RequestHandler { -public: - using RequestHandler::RequestHandler; +/// Base class for handling DAP requests. Handlers should declare their +/// arguments and response body types l

[Lldb-commits] [lldb] [lldb-dap] Updating RequestHandler to encode/decode arguments and response. (PR #130090)

2025-03-12 Thread John Harrison via lldb-commits
https://github.com/ashgti updated https://github.com/llvm/llvm-project/pull/130090 >From f26c9a79ca234bee77ec1a9694bf8be2d0e3745c Mon Sep 17 00:00:00 2001 From: John Harrison Date: Thu, 6 Mar 2025 13:21:10 +0100 Subject: [PATCH 1/3] [lldb-dap] Updating RequestHandler to encode/decode arguments

[Lldb-commits] [lldb] [lldb-dap] Updating RequestHandler to encode/decode arguments and response. (PR #130090)

2025-03-12 Thread John Harrison via lldb-commits
https://github.com/ashgti ready_for_review https://github.com/llvm/llvm-project/pull/130090 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb-dap] Updating RequestHandler to encode/decode arguments and response. (PR #130090)

2025-03-12 Thread John Harrison via lldb-commits
@@ -57,235 +68,288 @@ class RequestHandler { DAP &dap; }; -class AttachRequestHandler : public RequestHandler { -public: - using RequestHandler::RequestHandler; +/// Base class for handling DAP requests. Handlers should declare their +/// arguments and response body types l

[Lldb-commits] [lldb] [lldb-dap] Upgrade @types/node to fix TS2386 in node/module.d.ts (PR #126994)

2025-02-12 Thread John Harrison via lldb-commits
https://github.com/ashgti approved this pull request. https://github.com/llvm/llvm-project/pull/126994 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb-dap] Ensure we do not print the close sentinel when closing stdout. (PR #126833)

2025-02-12 Thread John Harrison via lldb-commits
@@ -25,6 +26,10 @@ using llvm::Expected; using llvm::inconvertibleErrorCode; using llvm::StringRef; +namespace { +char kCloseSentinel[] = "\0"; +} // namespace ashgti wrote: Done. https://github.com/llvm/llvm-project/pull/126833 _

[Lldb-commits] [lldb] [lldb-dap] Ensure we do not print the close sentinel when closing stdout. (PR #126833)

2025-02-12 Thread John Harrison via lldb-commits
@@ -59,7 +64,10 @@ Error OutputRedirector::RedirectTo(std::function callback) { while (!m_stopped) { ssize_t bytes_count = ::read(read_fd, &buffer, sizeof(buffer)); // EOF detected. - if (bytes_count == 0) + if (bytes_count == 0 || as

[Lldb-commits] [lldb] [lldb-dap] Ensure we do not print the close sentinel when closing stdout. (PR #126833)

2025-02-12 Thread John Harrison via lldb-commits
@@ -59,7 +64,10 @@ Error OutputRedirector::RedirectTo(std::function callback) { while (!m_stopped) { ssize_t bytes_count = ::read(read_fd, &buffer, sizeof(buffer)); // EOF detected. - if (bytes_count == 0) + if (bytes_count == 0 || + (bytes_c

[Lldb-commits] [lldb] [lldb-dap] Ensure we do not print the close sentinel when closing stdout. (PR #126833)

2025-02-12 Thread John Harrison via lldb-commits
https://github.com/ashgti updated https://github.com/llvm/llvm-project/pull/126833 >From af07cbad6524cfb0509f93565eb86584e4c3576c Mon Sep 17 00:00:00 2001 From: John Harrison Date: Tue, 11 Feb 2025 16:58:20 -0800 Subject: [PATCH 1/2] [lldb-dap] Ensure we do not print the close sentinel when cl

[Lldb-commits] [lldb] [lldb-dap] Refactoring lldb-dap port listening mode to allow multiple connections. (PR #116392)

2025-02-14 Thread John Harrison via lldb-commits
ashgti wrote: @JDevlieghere Any thoughts on the server mode? https://github.com/llvm/llvm-project/pull/116392 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb-dap] Refactoring lldb-dap port listening mode to allow multiple connections. (PR #116392)

2025-02-21 Thread John Harrison via lldb-commits
@@ -58,12 +58,13 @@ const char DEV_NULL[] = "/dev/null"; namespace lldb_dap { -DAP::DAP(llvm::StringRef path, std::ofstream *log, ReplMode repl_mode, - StreamDescriptor input, StreamDescriptor output) -: debug_adaptor_path(path), log(log), input(std::move(input)),

<    2   3   4   5   6   7   8   9   10   11   >