[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-20 Thread Pavel Labath via lldb-commits
labath wrote: That would be great, thanks. BTW, I've checked the test and its form after https://github.com/llvm/llvm-project/pull/140331 (where `self.launch` does not send the configurationDone` event) does reproduce the problem I encountered. https://github.com/llvm/llvm-project/pull/138219

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-19 Thread John Harrison via lldb-commits
ashgti wrote: I'll take a look at the currently disabled DAP tests and see if we can enable more of them. https://github.com/llvm/llvm-project/pull/138219 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-19 Thread Pavel Labath via lldb-commits
labath wrote: FWIW, https://github.com/llvm/llvm-project/pull/140331 fixes this. I was looking at the test coverage, and it seems that the only test making use of this is TestDAP_setBreakpoints.py. It superficially looks like it should catch this, but after trying it out, it seems that it does

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-19 Thread Pavel Labath via lldb-commits
labath wrote: I think I've found a(nother) problem with this change. One of the arguments of the launch request is `sourceMap`, which sets the `target.source-map` setting. The setting is necessary to correctly resolve file+line breakpoints in case the file's path on the host system does not ma

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-07 Thread Jonas Devlieghere via lldb-commits
JDevlieghere wrote: The following two tests are both setting breakpoints without stopping at entry, which means that we could have run past the breakpoint by the time it's set: ``` lldb-api :: tools/lldb-dap/completions/TestDAP_completions.py lldb-api :: tools/lldb-dap/startDebugging/TestDA

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-07 Thread Jonas Devlieghere via lldb-commits
JDevlieghere wrote: Looking at the logs, the common theme appears to be that all the test binaries exit before they hit any breakpoints. My best guess as to why this is only happening on Windows is the way the dynamic loader there works. If that's the case, then it means that those tests are m

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-07 Thread David Spickett via lldb-commits
DavidSpickett wrote: I've reverted this. Please take a look at the logs of https://lab.llvm.org/buildbot/#/builders/141/builds/8500 and see if any of it makes sense to you. We didn't have failures on Linux (though a lot of tests are disabled, they would be disabled everywhere) so my first ins

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-07 Thread David Spickett via lldb-commits
DavidSpickett wrote: We have failing tests on Windows after this. Latest result at this time is: ``` Unresolved Tests (2): lldb-api :: tools/lldb-dap/completions/TestDAP_completions.py lldb-api :: tools/lldb-dap/startDebugging/TestDAP_startDebugging.py ***

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-06 Thread Jonas Devlieghere via lldb-commits
JDevlieghere wrote: I created #138778 to track extending the launch and attach helpers to take breakpoints. https://github.com/llvm/llvm-project/pull/138219 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-06 Thread Jonas Devlieghere via lldb-commits
https://github.com/JDevlieghere closed https://github.com/llvm/llvm-project/pull/138219 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-06 Thread Jonas Devlieghere via lldb-commits
https://github.com/JDevlieghere updated https://github.com/llvm/llvm-project/pull/138219 Rate limit ยท GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,s

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-06 Thread Jonas Devlieghere via lldb-commits
JDevlieghere wrote: > Unblocked! Thanks! > > @kusmour Please take another look. In the current state all the test pass > > (reliably) locally and the linux bot seems happy too. Not sure if we want > > to keep the test disabled for now or turn them back on and see what the > > reliability is

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-06 Thread via lldb-commits
kusmour wrote: Unblocked! > @kusmour Please take another look. In the current state all the test pass > (reliably) locally and the linux bot seems happy too. Not sure if we want to > keep the test disabled for now or turn them back on and see what the > reliability is like on the bots. I don

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-05 Thread Jonas Devlieghere via lldb-commits
https://github.com/JDevlieghere updated https://github.com/llvm/llvm-project/pull/138219 >From b7391070942219a691a691822477e2a7616be1ab Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Fri, 2 May 2025 09:59:01 -0700 Subject: [PATCH] [lldb-dap] Change the launch sequence This PR changes h

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-05 Thread Jonas Devlieghere via lldb-commits
https://github.com/JDevlieghere updated https://github.com/llvm/llvm-project/pull/138219 >From afd0475ea23ed79f074c3f4143b86e6efb557d37 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Fri, 2 May 2025 09:59:01 -0700 Subject: [PATCH] [lldb-dap] Change the launch sequence This PR changes h

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-02 Thread John Harrison via lldb-commits
@@ -333,6 +333,7 @@ def attach( exitCommands=None, attachCommands=None, coreFile=None, +stopOnAttach=True, ashgti wrote: Sounds good, we can follow up with some other improvements to tests. https://github.com/llvm/llvm-project/

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-02 Thread John Harrison via lldb-commits
https://github.com/ashgti approved this pull request. Yesterday I enabled all the lldb-dap tests that support macOS and I noticed #138197 where some tests `attach` failed due to attaching to a parallel test process. I was consistently hitting it on my MBP but I think due to timing not on my Ma

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-02 Thread Jonas Devlieghere via lldb-commits
@@ -137,55 +137,69 @@ void AttachRequestHandler::operator()(const llvm::json::Object &request) const { dap.SendOutput(OutputType::Console, llvm::StringRef(attach_msg, attach_msg_len)); } - if (attachCommands.empty()) { -// No "attachCommands", jus

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-02 Thread Jonas Devlieghere via lldb-commits
@@ -591,6 +591,7 @@ def request_attach( attachCommands=None, terminateCommands=None, coreFile=None, +stopOnAttach=True, JDevlieghere wrote: See my reply to John: https://github.com/llvm/llvm-project/pull/138219#discussion_r2072

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-02 Thread via lldb-commits
@@ -137,55 +137,69 @@ void AttachRequestHandler::operator()(const llvm::json::Object &request) const { dap.SendOutput(OutputType::Console, llvm::StringRef(attach_msg, attach_msg_len)); } - if (attachCommands.empty()) { -// No "attachCommands", jus

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-02 Thread via lldb-commits
@@ -25,9 +25,10 @@ def spawn_and_wait(program, delay): process.wait() -@skipIf class TestDAP_attach(lldbdap_testcase.DAPTestCaseBase): def set_and_hit_breakpoint(self, continueToExit=True): +self.dap_server.wait_for_stopped() kusmour wrote:

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-02 Thread via lldb-commits
@@ -427,6 +430,7 @@ def cleanup(): # Initialize and launch the program self.dap_server.request_initialize(sourceInitFile) +self.dap_server.request_configurationDone() kusmour wrote: ditto https://github.com/llvm/llvm-project/pull/1382

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-02 Thread via lldb-commits
@@ -235,7 +235,7 @@ def test_auto_completions(self): """ Tests completion requests in "repl-mode=auto" """ -self.setup_debugee() +self.setup_debugee(stopOnEntry=True) kusmour wrote: Any reason why we are changing the tes

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-02 Thread via lldb-commits
@@ -591,6 +591,7 @@ def request_attach( attachCommands=None, terminateCommands=None, coreFile=None, +stopOnAttach=True, kusmour wrote: Is there any reason we want to make this true by default? 1) Our current tests don't have sto

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-02 Thread via lldb-commits
@@ -88,8 +88,8 @@ def test_stopOnEntry(self): """ program = self.getBuildArtifact("a.out") self.build_and_launch(program, stopOnEntry=True) -self.set_function_breakpoints(["main"]) -stopped_events = self.continue_to_next_stop() +

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-02 Thread via lldb-commits
@@ -357,6 +358,7 @@ def cleanup(): self.addTearDownHook(cleanup) # Initialize and launch the program self.dap_server.request_initialize(sourceInitFile) +self.dap_server.request_configurationDone() kusmour wrote: Shouldn't we wai

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-02 Thread via lldb-commits
https://github.com/kusmour requested changes to this pull request. https://github.com/llvm/llvm-project/pull/138219 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-02 Thread Jonas Devlieghere via lldb-commits
@@ -333,6 +333,7 @@ def attach( exitCommands=None, attachCommands=None, coreFile=None, +stopOnAttach=True, JDevlieghere wrote: The way the tests are currently written, they expect to be stopped after the launch (presumably beca

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-02 Thread John Harrison via lldb-commits
@@ -591,6 +591,7 @@ def request_attach( attachCommands=None, terminateCommands=None, coreFile=None, +stopOnAttach=True, ashgti wrote: Should we default to `False` for attach requests? https://github.com/llvm/llvm-project/pull/1

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-02 Thread John Harrison via lldb-commits
@@ -333,6 +333,7 @@ def attach( exitCommands=None, attachCommands=None, coreFile=None, +stopOnAttach=True, ashgti wrote: Should we default this to `False`? Or should we have the `DAPTestCaseBase` case `attach` and `launch` help

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-02 Thread Jonas Devlieghere via lldb-commits
JDevlieghere wrote: > > @kusmour Can you please confirm whether or not there's a reason to run the > > launch or attach commands in asynchronous mode? It looks like the > > divergence was introduced when the feature was added > > (https://reviews.llvm.org/D154028) and I'm not sure it's necessa

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-02 Thread via lldb-commits
llvmbot wrote: @llvm/pr-subscribers-lldb Author: Jonas Devlieghere (JDevlieghere) Changes This PR changes how we treat the launch sequence in lldb-dap. - Send the initialized event after we finish handling the initialize request, rather than after we finish attaching or launching. -

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-02 Thread Jonas Devlieghere via lldb-commits
https://github.com/JDevlieghere ready_for_review https://github.com/llvm/llvm-project/pull/138219 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-02 Thread Jonas Devlieghere via lldb-commits
https://github.com/JDevlieghere updated https://github.com/llvm/llvm-project/pull/138219 >From e7333489e50b1efe16203e8fd7b6dc7f2dcd4439 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Fri, 2 May 2025 09:59:01 -0700 Subject: [PATCH 1/3] [lldb-dap] Change the launch sequence This PR chang

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-02 Thread John Harrison via lldb-commits
@@ -893,10 +893,23 @@ llvm::Error DAP::Loop() { return errWrapper; } + // The launch sequence is special and we need to carefully handle + // packets in the right order. The launch and attach requests cannot + // be answered unt

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-02 Thread John Harrison via lldb-commits
@@ -893,10 +893,23 @@ llvm::Error DAP::Loop() { return errWrapper; } + // The launch sequence is special and we need to carefully handle + // packets in the right order. The launch and attach requests cannot + // be answered unt

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-02 Thread via lldb-commits
kusmour wrote: > @kusmour Can you please confirm whether or not there's a reason to run the > launch or attach commands in asynchronous mode? It looks like the divergence > was introduced when the feature was added (https://reviews.llvm.org/D154028) > and I'm not sure it's necessary. My local

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-02 Thread Jonas Devlieghere via lldb-commits
@@ -893,10 +893,23 @@ llvm::Error DAP::Loop() { return errWrapper; } + // The launch sequence is special and we need to carefully handle + // packets in the right order. The launch and attach requests cannot + // be answered unt

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-02 Thread Jonas Devlieghere via lldb-commits
@@ -893,10 +893,23 @@ llvm::Error DAP::Loop() { return errWrapper; } + // The launch sequence is special and we need to carefully handle + // packets in the right order. The launch and attach requests cannot + // be answered unt

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-02 Thread John Harrison via lldb-commits
@@ -893,10 +893,23 @@ llvm::Error DAP::Loop() { return errWrapper; } + // The launch sequence is special and we need to carefully handle + // packets in the right order. The launch and attach requests cannot + // be answered unt

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-02 Thread John Harrison via lldb-commits
@@ -893,10 +893,23 @@ llvm::Error DAP::Loop() { return errWrapper; } + // The launch sequence is special and we need to carefully handle + // packets in the right order. The launch and attach requests cannot + // be answered unt

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-02 Thread John Harrison via lldb-commits
@@ -938,15 +954,30 @@ llvm::Error DAP::Loop() { StopEventHandlers(); }); - while (!disconnecting || !m_queue.empty()) { + while (true) { std::unique_lock lock(m_queue_mutex); -m_queue_cv.wait(lock, [&] { return disconnecting || !m_queue.empty(); }); +m_que

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-02 Thread John Harrison via lldb-commits
@@ -417,8 +424,11 @@ struct DAP { lldb::SBMutex GetAPIMutex() const { return target.GetAPIMutex(); } private: - std::mutex m_queue_mutex; + /// Queue for all incoming messages. std::deque m_queue; + /// Dedicated queue for launching and attaching. + std::deque m_launc

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-02 Thread Jonas Devlieghere via lldb-commits
@@ -161,20 +161,22 @@ static void EventThreadFunction(DAP &dap) { case lldb::eStateSuspended: break; case lldb::eStateStopped: -// We launch and attach in synchronous mode then the first stop -// event will not be delivere

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-02 Thread Jonas Devlieghere via lldb-commits
JDevlieghere wrote: @kusmour Can you please confirm whether or not there's a reason to run the launch or attach commands in asynchronous mode? It looks like the divergence was introduced when the feature was added (https://reviews.llvm.org/D154028) and I'm not sure it's necessary. My local tes

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-02 Thread Jonas Devlieghere via lldb-commits
https://github.com/JDevlieghere edited https://github.com/llvm/llvm-project/pull/138219 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-02 Thread Jonas Devlieghere via lldb-commits
@@ -417,8 +424,11 @@ struct DAP { lldb::SBMutex GetAPIMutex() const { return target.GetAPIMutex(); } private: - std::mutex m_queue_mutex; + /// Queue for all incoming messages. std::deque m_queue; + /// Dedicated queue for launching and attaching. + std::deque m_launc

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-02 Thread Jonas Devlieghere via lldb-commits
@@ -161,20 +161,22 @@ static void EventThreadFunction(DAP &dap) { case lldb::eStateSuspended: break; case lldb::eStateStopped: -// We launch and attach in synchronous mode then the first stop -// event will not be delivere

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-02 Thread Jonas Devlieghere via lldb-commits
https://github.com/JDevlieghere updated https://github.com/llvm/llvm-project/pull/138219 >From e7333489e50b1efe16203e8fd7b6dc7f2dcd4439 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Fri, 2 May 2025 09:59:01 -0700 Subject: [PATCH] [lldb-dap] Change the launch sequence This PR changes h

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-01 Thread John Harrison via lldb-commits
@@ -161,20 +161,22 @@ static void EventThreadFunction(DAP &dap) { case lldb::eStateSuspended: break; case lldb::eStateStopped: -// We launch and attach in synchronous mode then the first stop -// event will not be delivere

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-01 Thread John Harrison via lldb-commits
@@ -161,20 +161,22 @@ static void EventThreadFunction(DAP &dap) { case lldb::eStateSuspended: break; case lldb::eStateStopped: -// We launch and attach in synchronous mode then the first stop -// event will not be delivere

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-01 Thread John Harrison via lldb-commits
@@ -417,8 +424,11 @@ struct DAP { lldb::SBMutex GetAPIMutex() const { return target.GetAPIMutex(); } private: - std::mutex m_queue_mutex; + /// Queue for all incoming messages. std::deque m_queue; + /// Dedicated queue for launching and attaching. + std::deque m_launc

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-01 Thread John Harrison via lldb-commits
@@ -161,20 +161,22 @@ static void EventThreadFunction(DAP &dap) { case lldb::eStateSuspended: break; case lldb::eStateStopped: ashgti wrote: May be unrelated but in [`lldb_private::StateIsRunningState`](https://github.com/llvm/

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-01 Thread via lldb-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff HEAD~1 HEAD --extensions h,cpp -- lldb/tools/lldb-dap/DAP.cpp lldb/tools/lldb-dap/DAP

[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-01 Thread Jonas Devlieghere via lldb-commits
https://github.com/JDevlieghere created https://github.com/llvm/llvm-project/pull/138219 This PR changes how we treat the launch sequence in lldb-dap. - Send the initialized event after we finish handling the initialize request, rather than after we finish attaching or launching. - Delay han