[Lldb-commits] [lldb] [lldb-dap] Assorted small fixes for runInTerminal (PR #140908)

2025-05-22 Thread Hu Jialun via lldb-commits
SuibianP wrote: I don't have commit access and please kindly help commit on my behalf when you see fit. https://github.com/llvm/llvm-project/pull/140908 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/l

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-05-22 Thread Hu Jialun via lldb-commits
SuibianP wrote: The FIFO file served two purposes, - Send real target PID back to debugger - Synchronisation: Prevent premature execution of target And the original implementation 0f0462c states the reason against socket and signal, > I'm using this instead of using a signal or a similar mecha

[Lldb-commits] [lldb] [lldb-dap] Assorted small fixes for runInTerminal (PR #140908)

2025-05-21 Thread Hu Jialun via lldb-commits
SuibianP wrote: I still wonder why CI checks (such as [this](https://buildkite.com/llvm-project/github-pull-requests/builds/180533#0196e513-330d-4fe5-8ed4-8e96fc5b1a89)) were `PASS` without catching the errors. I could only guess it is in `isTestSupported`. https://github.com/llvm/llvm-projec

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-05-08 Thread Hu Jialun via lldb-commits
@@ -24,41 +31,105 @@ using namespace llvm; namespace lldb_dap { -FifoFile::FifoFile(StringRef path) : m_path(path) {} +FifoFile::FifoFile(std::string path, FILE *f) : m_path(path), m_file(f) {} + +Expected FifoFile::create(StringRef path) { + auto file = fopen(path.data(), "

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-05-06 Thread Hu Jialun via lldb-commits
SuibianP wrote: Pinging again for review @ashgti @omjavaid @walter-erquinigo Also want to highlight https://github.com/SuibianP/llvm-project/commit/f9675fbe23abe59c3cf56a6263b7a78ec20e42d4#diff-ed319b24adfa654beeff8b32f9d8f975c62299fbe5cb6fbe1028aa6bbaa369e7. Not sure how it is passing CI tho

[Lldb-commits] [lldb] [lldb-dap] Add runInTerminal support for Windows (PR #138160)

2025-05-05 Thread Hu Jialun via lldb-commits
SuibianP wrote: > Another PR looks abandoned It is actually not (yet). I have been actively waiting for maintainers to drop another review and have pinged & rebased several times over these three months. https://github.com/llvm/llvm-project/pull/138160 _

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-05-05 Thread Hu Jialun via lldb-commits
https://github.com/SuibianP updated https://github.com/llvm/llvm-project/pull/121269 >From f9675fbe23abe59c3cf56a6263b7a78ec20e42d4 Mon Sep 17 00:00:00 2001 From: Jialun Hu Date: Mon, 24 Feb 2025 22:10:17 +0800 Subject: [PATCH] [lldb-dap] Implement runInTerminal for Windows Currently, the name

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-04-06 Thread Hu Jialun via lldb-commits
https://github.com/SuibianP updated https://github.com/llvm/llvm-project/pull/121269 >From d13e94bfb5a54ed597d34a6a5ad3f2be25533884 Mon Sep 17 00:00:00 2001 From: Jialun Hu Date: Mon, 24 Feb 2025 22:10:17 +0800 Subject: [PATCH] [lldb-dap] Implement runInTerminal for Windows Currently, the name

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-04-03 Thread Hu Jialun via lldb-commits
SuibianP wrote: Pinging @ashgti and @walter-erquinigo for review before I forget again https://github.com/llvm/llvm-project/pull/121269 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commi

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-04-02 Thread Hu Jialun via lldb-commits
https://github.com/SuibianP updated https://github.com/llvm/llvm-project/pull/121269 >From babc347b5ad20d9d155c717323dc9796fce6b756 Mon Sep 17 00:00:00 2001 From: Jialun Hu Date: Mon, 24 Feb 2025 22:10:17 +0800 Subject: [PATCH] [lldb-dap] Implement runInTerminal for Windows Currently, the name

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-03-06 Thread Hu Jialun via lldb-commits
SuibianP wrote: Hi @ashgti, pinging just in case GitHub had its notification fall through the cracks again :) I have left several possibly debatable review chains open for your kind attention, and would appreciate instructions on next steps. https://github.com/llvm/llvm-project/pull/121269 __

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-03-06 Thread Hu Jialun via lldb-commits
https://github.com/SuibianP updated https://github.com/llvm/llvm-project/pull/121269 >From 0b7cc855990aad5d4b9b9beb2726e4b0ac5a3755 Mon Sep 17 00:00:00 2001 From: Jialun Hu Date: Mon, 24 Feb 2025 22:10:17 +0800 Subject: [PATCH] [lldb-dap] Implement runInTerminal for Windows Currently, the name

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-03-01 Thread Hu Jialun via lldb-commits
https://github.com/SuibianP edited https://github.com/llvm/llvm-project/pull/121269 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-03-01 Thread Hu Jialun via lldb-commits
@@ -1,11 +1,13 @@ #include #include -#include + +#include SuibianP wrote: Turns out Apple does not yet support C11 `threads.h`. https://github.com/llvm/llvm-project/blob/7e8a06cfa4a2951b8ee77e19e34926e6e535b4d1/clang/lib/Basic/Targets/OSTargets.cpp#L61-L62

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-03-01 Thread Hu Jialun via lldb-commits
https://github.com/SuibianP updated https://github.com/llvm/llvm-project/pull/121269 >From 20fbed5a080a90aabe1d3f8c316af56e91284c1e Mon Sep 17 00:00:00 2001 From: Jialun Hu Date: Mon, 24 Feb 2025 22:10:17 +0800 Subject: [PATCH] [lldb-dap] Implement runInTerminal for Windows Currently, the name

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-02-28 Thread Hu Jialun via lldb-commits
https://github.com/SuibianP edited https://github.com/llvm/llvm-project/pull/121269 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-02-28 Thread Hu Jialun via lldb-commits
@@ -21,21 +23,28 @@ namespace lldb_dap { /// The file is destroyed when the destructor is invoked. struct FifoFile { FifoFile(llvm::StringRef path); + FifoFile(llvm::StringRef path, FILE *f); + FifoFile(FifoFile &&other); + + FifoFile(const FifoFile &) = delete; + FifoFil

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-02-28 Thread Hu Jialun via lldb-commits
@@ -24,41 +30,95 @@ using namespace llvm; namespace lldb_dap { -FifoFile::FifoFile(StringRef path) : m_path(path) {} - +FifoFile::FifoFile(StringRef path) +: m_path(path), m_file(fopen(path.data(), "r+")) { + std::error_code EC; + if (m_file == nullptr) { +EC = std:

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-02-27 Thread Hu Jialun via lldb-commits
https://github.com/SuibianP updated https://github.com/llvm/llvm-project/pull/121269 >From fd85cd7225ff5ddb861dbda8f0ace84e53b021bf Mon Sep 17 00:00:00 2001 From: Jialun Hu Date: Mon, 24 Feb 2025 22:10:17 +0800 Subject: [PATCH] [lldb-dap] Implement runInTerminal for Windows Currently, the name

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-02-27 Thread Hu Jialun via lldb-commits
https://github.com/SuibianP updated https://github.com/llvm/llvm-project/pull/121269 >From d34c8043bfe0d7bda5a4ef9c2c23915071d06bd5 Mon Sep 17 00:00:00 2001 From: Jialun Hu Date: Mon, 24 Feb 2025 22:10:17 +0800 Subject: [PATCH] [lldb-dap] Implement runInTerminal for Windows Currently, the name

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-02-27 Thread Hu Jialun via lldb-commits
https://github.com/SuibianP updated https://github.com/llvm/llvm-project/pull/121269 >From 259dfbb0fc181b1f28d3678688778947dad5b317 Mon Sep 17 00:00:00 2001 From: Jialun Hu Date: Mon, 24 Feb 2025 22:10:17 +0800 Subject: [PATCH] [lldb-dap] Implement runInTerminal for Windows Currently, the name

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-02-27 Thread Hu Jialun via lldb-commits
https://github.com/SuibianP edited https://github.com/llvm/llvm-project/pull/121269 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-02-27 Thread Hu Jialun via lldb-commits
@@ -24,41 +30,95 @@ using namespace llvm; namespace lldb_dap { -FifoFile::FifoFile(StringRef path) : m_path(path) {} +std::error_code EC; +FifoFile::FifoFile(StringRef path) +: m_path(path), m_file(fopen(path.data(), "r+")) { + if (m_file == nullptr) { +EC = std::e

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-02-27 Thread Hu Jialun via lldb-commits
@@ -1,11 +1,13 @@ #include #include -#include + +#include SuibianP wrote: [`threads.h`](https://en.cppreference.com/w/c/header/threads) is in ISO C11 standard ยง7.26. The tests are all [passing in Linux x64 CI](https://buildkite.com/llvm-project/github-pul

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-02-26 Thread Hu Jialun via lldb-commits
https://github.com/SuibianP updated https://github.com/llvm/llvm-project/pull/121269 >From c08879c346a1f127324669fc6b74ce5a7407a30d Mon Sep 17 00:00:00 2001 From: Jialun Hu Date: Mon, 24 Feb 2025 22:10:17 +0800 Subject: [PATCH] [lldb-dap] Implement runInTerminal for Windows Currently, the name

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-02-26 Thread Hu Jialun via lldb-commits
https://github.com/SuibianP edited https://github.com/llvm/llvm-project/pull/121269 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-02-26 Thread Hu Jialun via lldb-commits
@@ -24,41 +30,95 @@ using namespace llvm; namespace lldb_dap { -FifoFile::FifoFile(StringRef path) : m_path(path) {} - +FifoFile::FifoFile(StringRef path) +: m_path(path), m_file(fopen(path.data(), "r+")) { + std::error_code EC; + if (m_file == nullptr) { +EC = std:

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-02-26 Thread Hu Jialun via lldb-commits
@@ -24,41 +30,95 @@ using namespace llvm; namespace lldb_dap { -FifoFile::FifoFile(StringRef path) : m_path(path) {} - +FifoFile::FifoFile(StringRef path) +: m_path(path), m_file(fopen(path.data(), "r+")) { + std::error_code EC; + if (m_file == nullptr) { +EC = std:

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-02-26 Thread Hu Jialun via lldb-commits
@@ -24,41 +30,95 @@ using namespace llvm; namespace lldb_dap { -FifoFile::FifoFile(StringRef path) : m_path(path) {} +std::error_code EC; +FifoFile::FifoFile(StringRef path) +: m_path(path), m_file(fopen(path.data(), "r+")) { + if (m_file == nullptr) { +EC = std::e

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-02-26 Thread Hu Jialun via lldb-commits
@@ -24,41 +30,95 @@ using namespace llvm; namespace lldb_dap { -FifoFile::FifoFile(StringRef path) : m_path(path) {} +std::error_code EC; +FifoFile::FifoFile(StringRef path) +: m_path(path), m_file(fopen(path.data(), "r+")) { + if (m_file == nullptr) { +EC = std::e

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-02-26 Thread Hu Jialun via lldb-commits
https://github.com/SuibianP updated https://github.com/llvm/llvm-project/pull/121269 >From 9f89e9c59d444057abe517e3c912f6af00c69a2b Mon Sep 17 00:00:00 2001 From: Jialun Hu Date: Mon, 24 Feb 2025 22:10:17 +0800 Subject: [PATCH] [lldb-dap] Implement runInTerminal for Windows Currently, the name

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-02-21 Thread Hu Jialun via lldb-commits
https://github.com/SuibianP edited https://github.com/llvm/llvm-project/pull/121269 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-02-21 Thread Hu Jialun via lldb-commits
https://github.com/SuibianP edited https://github.com/llvm/llvm-project/pull/121269 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-02-21 Thread Hu Jialun via lldb-commits
@@ -24,41 +30,95 @@ using namespace llvm; namespace lldb_dap { -FifoFile::FifoFile(StringRef path) : m_path(path) {} - +FifoFile::FifoFile(StringRef path) +: m_path(path), m_file(fopen(path.data(), "r+")) { + std::error_code EC; + if (m_file == nullptr) { +EC = std:

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-02-21 Thread Hu Jialun via lldb-commits
@@ -24,41 +30,95 @@ using namespace llvm; namespace lldb_dap { -FifoFile::FifoFile(StringRef path) : m_path(path) {} - +FifoFile::FifoFile(StringRef path) +: m_path(path), m_file(fopen(path.data(), "r+")) { + std::error_code EC; + if (m_file == nullptr) { +EC = std:

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-02-21 Thread Hu Jialun via lldb-commits
@@ -24,41 +30,95 @@ using namespace llvm; namespace lldb_dap { -FifoFile::FifoFile(StringRef path) : m_path(path) {} - +FifoFile::FifoFile(StringRef path) +: m_path(path), m_file(fopen(path.data(), "r+")) { + std::error_code EC; + if (m_file == nullptr) { +EC = std:

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-02-21 Thread Hu Jialun via lldb-commits
https://github.com/SuibianP edited https://github.com/llvm/llvm-project/pull/121269 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-02-21 Thread Hu Jialun via lldb-commits
https://github.com/SuibianP edited https://github.com/llvm/llvm-project/pull/121269 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-02-21 Thread Hu Jialun via lldb-commits
https://github.com/SuibianP edited https://github.com/llvm/llvm-project/pull/121269 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-02-21 Thread Hu Jialun via lldb-commits
@@ -24,41 +30,95 @@ using namespace llvm; namespace lldb_dap { -FifoFile::FifoFile(StringRef path) : m_path(path) {} +std::error_code EC; +FifoFile::FifoFile(StringRef path) +: m_path(path), m_file(fopen(path.data(), "r+")) { + if (m_file == nullptr) { +EC = std::e

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-02-21 Thread Hu Jialun via lldb-commits
@@ -24,41 +30,95 @@ using namespace llvm; namespace lldb_dap { -FifoFile::FifoFile(StringRef path) : m_path(path) {} +std::error_code EC; +FifoFile::FifoFile(StringRef path) +: m_path(path), m_file(fopen(path.data(), "r+")) { + if (m_file == nullptr) { +EC = std::e

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-02-21 Thread Hu Jialun via lldb-commits
@@ -158,13 +156,25 @@ std::string RunInTerminalDebugAdapterCommChannel::GetLauncherError() { } Expected> CreateRunInTerminalCommFile() { + int comm_fd; SmallString<256> comm_file; - if (std::error_code EC = sys::fs::getPotentiallyUniqueTempFileName( - "lldb-dap-

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-02-09 Thread Hu Jialun via lldb-commits
https://github.com/SuibianP edited https://github.com/llvm/llvm-project/pull/121269 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-02-05 Thread Hu Jialun via lldb-commits
https://github.com/SuibianP updated https://github.com/llvm/llvm-project/pull/121269 >From c656de0311a7ecb954b1ac1ce0eda1879efffeb6 Mon Sep 17 00:00:00 2001 From: Hu Jialun Date: Sat, 28 Dec 2024 22:39:33 +0800 Subject: [PATCH] [lldb-dap] Implement runInTerminal for Windows Currently, the name

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-02-05 Thread Hu Jialun via lldb-commits
@@ -24,41 +30,95 @@ using namespace llvm; namespace lldb_dap { -FifoFile::FifoFile(StringRef path) : m_path(path) {} +std::error_code EC; +FifoFile::FifoFile(StringRef path) +: m_path(path), m_file(fopen(path.data(), "r+")) { + if (m_file == nullptr) { +EC = std::e

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-02-05 Thread Hu Jialun via lldb-commits
@@ -21,21 +23,22 @@ namespace lldb_dap { /// The file is destroyed when the destructor is invoked. struct FifoFile { FifoFile(llvm::StringRef path); + FifoFile(llvm::StringRef path, FILE *f); + // FifoFile(llvm::StringRef path, FILE *f); + FifoFile(FifoFile &&other); + +

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-02-05 Thread Hu Jialun via lldb-commits
@@ -24,41 +30,95 @@ using namespace llvm; namespace lldb_dap { -FifoFile::FifoFile(StringRef path) : m_path(path) {} +std::error_code EC; SuibianP wrote: Unintended, moved into function. https://github.com/llvm/llvm-project/pull/121269 _

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-02-05 Thread Hu Jialun via lldb-commits
@@ -21,21 +23,22 @@ namespace lldb_dap { /// The file is destroyed when the destructor is invoked. struct FifoFile { FifoFile(llvm::StringRef path); + FifoFile(llvm::StringRef path, FILE *f); + // FifoFile(llvm::StringRef path, FILE *f); SuibianP wrote: Re

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-02-05 Thread Hu Jialun via lldb-commits
@@ -2249,6 +2249,11 @@ llvm::Error request_runInTerminal(DAP &dap, } }); + llvm::errs() << "WaitForLauncher\n"; SuibianP wrote: Oops, debug leftover again... Removed. https://github.com/llvm/llvm-project/p

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-02-05 Thread Hu Jialun via lldb-commits
@@ -2249,6 +2249,11 @@ llvm::Error request_runInTerminal(DAP &dap, } }); + llvm::errs() << "WaitForLauncher\n"; + auto err = comm_channel.WaitForLauncher(); + llvm::errs() << "WaitForLauncher returned\n";

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-02-05 Thread Hu Jialun via lldb-commits
@@ -24,41 +30,95 @@ using namespace llvm; namespace lldb_dap { -FifoFile::FifoFile(StringRef path) : m_path(path) {} +std::error_code EC; +FifoFile::FifoFile(StringRef path) +: m_path(path), m_file(fopen(path.data(), "r+")) { + if (m_file == nullptr) { +EC = std::e

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-02-05 Thread Hu Jialun via lldb-commits
@@ -24,41 +30,95 @@ using namespace llvm; namespace lldb_dap { -FifoFile::FifoFile(StringRef path) : m_path(path) {} +std::error_code EC; +FifoFile::FifoFile(StringRef path) +: m_path(path), m_file(fopen(path.data(), "r+")) { + if (m_file == nullptr) { +EC = std::e

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-02-05 Thread Hu Jialun via lldb-commits
@@ -24,41 +30,95 @@ using namespace llvm; namespace lldb_dap { -FifoFile::FifoFile(StringRef path) : m_path(path) {} +std::error_code EC; +FifoFile::FifoFile(StringRef path) +: m_path(path), m_file(fopen(path.data(), "r+")) { + if (m_file == nullptr) { +EC = std::e

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-02-05 Thread Hu Jialun via lldb-commits
@@ -9,7 +9,13 @@ #include "FifoFiles.h" #include "JSONUtils.h" SuibianP wrote: Removed one empty line and preserved those around `ifdef` guarded includes, the same way `lldb-dap.cpp` does it. https://github.com/llvm/llvm-project/pull/121269

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-02-04 Thread Hu Jialun via lldb-commits
@@ -24,41 +30,95 @@ using namespace llvm; namespace lldb_dap { -FifoFile::FifoFile(StringRef path) : m_path(path) {} +std::error_code EC; +FifoFile::FifoFile(StringRef path) +: m_path(path), m_file(fopen(path.data(), "r+")) { + if (m_file == nullptr) { +EC = std::e

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-02-04 Thread Hu Jialun via lldb-commits
@@ -24,41 +30,95 @@ using namespace llvm; namespace lldb_dap { -FifoFile::FifoFile(StringRef path) : m_path(path) {} +std::error_code EC; +FifoFile::FifoFile(StringRef path) +: m_path(path), m_file(fopen(path.data(), "r+")) { + if (m_file == nullptr) { +EC = std::e

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-02-04 Thread Hu Jialun via lldb-commits
@@ -111,8 +111,10 @@ Error RunInTerminalLauncherCommChannel::WaitUntilDebugAdaptorAttaches( return message.takeError(); } -Error RunInTerminalLauncherCommChannel::NotifyPid() { - return m_io.SendJSON(RunInTerminalMessagePid(getpid()).ToJSON()); +Error RunInTerminalLaunch

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-02-04 Thread Hu Jialun via lldb-commits
https://github.com/SuibianP updated https://github.com/llvm/llvm-project/pull/121269 >From 41650cf89122dbc35285488ae4d7bd03034a751e Mon Sep 17 00:00:00 2001 From: Hu Jialun Date: Sat, 28 Dec 2024 22:39:33 +0800 Subject: [PATCH] [lldb-dap] Implement runInTerminal for Windows Currently, the name

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-01-24 Thread Hu Jialun via lldb-commits
SuibianP wrote: I [enabled `runInTerminal` tests for Windows](https://github.com/llvm/llvm-project/pull/121269/files#diff-38cf10e0a83515e5c6acf5449a3f5de1d63f116d932a32ba169b746826ead1d4) (will fix line 93 later) except for the 4 launcher tests that requires `os.mkfifo` (https://github.com/pyt

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-01-24 Thread Hu Jialun via lldb-commits
@@ -71,12 +74,14 @@ class FifoFileIO { /// \return /// An \a llvm::Error object indicating whether the data was consumed by /// a reader or not. - llvm::Error SendJSON( - const llvm::json::Value &json, - std::chrono::milliseconds timeout = std::chrono::

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-01-24 Thread Hu Jialun via lldb-commits
@@ -21,21 +23,22 @@ namespace lldb_dap { /// The file is destroyed when the destructor is invoked. struct FifoFile { FifoFile(llvm::StringRef path); + FifoFile(llvm::StringRef path, FILE *f); + // FifoFile(llvm::StringRef path, FILE *f); + FifoFile(FifoFile &&other); + +

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-01-24 Thread Hu Jialun via lldb-commits
https://github.com/SuibianP updated https://github.com/llvm/llvm-project/pull/121269 >From dc866c2d106292b7fe49f8c1ac45dbd3905b81d6 Mon Sep 17 00:00:00 2001 From: Hu Jialun Date: Sat, 28 Dec 2024 22:39:33 +0800 Subject: [PATCH] [lldb-dap] Implement runInTerminal for Windows Currently, the name

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-01-24 Thread Hu Jialun via lldb-commits
@@ -158,13 +164,24 @@ std::string RunInTerminalDebugAdapterCommChannel::GetLauncherError() { } Expected> CreateRunInTerminalCommFile() { + int comm_fd; SmallString<256> comm_file; - if (std::error_code EC = sys::fs::getPotentiallyUniqueTempFileName( - "lldb-dap-

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-01-24 Thread Hu Jialun via lldb-commits
@@ -111,8 +111,10 @@ Error RunInTerminalLauncherCommChannel::WaitUntilDebugAdaptorAttaches( return message.takeError(); } -Error RunInTerminalLauncherCommChannel::NotifyPid() { - return m_io.SendJSON(RunInTerminalMessagePid(getpid()).ToJSON()); +Error RunInTerminalLaunch

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-01-24 Thread Hu Jialun via lldb-commits
@@ -71,12 +74,14 @@ class FifoFileIO { /// \return /// An \a llvm::Error object indicating whether the data was consumed by /// a reader or not. - llvm::Error SendJSON( - const llvm::json::Value &json, - std::chrono::milliseconds timeout = std::chrono::

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-01-19 Thread Hu Jialun via lldb-commits
https://github.com/SuibianP updated https://github.com/llvm/llvm-project/pull/121269 >From c32fb82903243e59d6a33e4e38a4da6267981ea6 Mon Sep 17 00:00:00 2001 From: Hu Jialun Date: Sat, 28 Dec 2024 22:39:33 +0800 Subject: [PATCH] [lldb-dap] Implement runInTerminal for Windows Currently, the name

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-01-18 Thread Hu Jialun via lldb-commits
https://github.com/SuibianP updated https://github.com/llvm/llvm-project/pull/121269 >From c23b994141630ef9a1c56760aae889f37334aa69 Mon Sep 17 00:00:00 2001 From: Hu Jialun Date: Sat, 28 Dec 2024 22:39:33 +0800 Subject: [PATCH] [lldb-dap] Implement runInTerminal for Windows Currently, the name

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-01-18 Thread Hu Jialun via lldb-commits
SuibianP wrote: As it turns out that Win32 `execvp` actually [creates a new process instead of replace the current process image](https://github.com/python/cpython/issues/101191#issuecomment-1399013437), I changed the implementation to use `CreateProcess` before reporting the PID of the targe

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-01-18 Thread Hu Jialun via lldb-commits
https://github.com/SuibianP ready_for_review https://github.com/llvm/llvm-project/pull/121269 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-01-16 Thread Hu Jialun via lldb-commits
SuibianP wrote: Hi @JDevlieghere, sorry for pinging again but could you please kindly help take a look at this when you have time? Thanks in advance! https://github.com/llvm/llvm-project/pull/121269 ___ lldb-commits mailing list lldb-commits@lists.llv

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-01-07 Thread Hu Jialun via lldb-commits
https://github.com/SuibianP updated https://github.com/llvm/llvm-project/pull/121269 >From b475e34ef1522b2919fc881d88bfa817bb719aa4 Mon Sep 17 00:00:00 2001 From: Hu Jialun Date: Sat, 28 Dec 2024 22:39:33 +0800 Subject: [PATCH] [lldb-dap] Implement runInTerminal for Windows Currently, the name

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-01-07 Thread Hu Jialun via lldb-commits
https://github.com/SuibianP updated https://github.com/llvm/llvm-project/pull/121269 >From 35d7391ec513b2b27082eafaf15693a4a3f5f158 Mon Sep 17 00:00:00 2001 From: Hu Jialun Date: Sat, 28 Dec 2024 22:39:33 +0800 Subject: [PATCH] [lldb-dap] Implement runInTerminal for Windows Currently, the name

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2025-01-07 Thread Hu Jialun via lldb-commits
SuibianP wrote: Ping https://github.com/llvm/llvm-project/pull/121269 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2024-12-28 Thread Hu Jialun via lldb-commits
https://github.com/SuibianP updated https://github.com/llvm/llvm-project/pull/121269 >From b980d11a234138a2c5a3f1509ee9d0dee51ccae0 Mon Sep 17 00:00:00 2001 From: Hu Jialun Date: Sat, 28 Dec 2024 22:39:33 +0800 Subject: [PATCH] [lldb-dap] Implement runInTerminal for Windows Currently, the name

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2024-12-28 Thread Hu Jialun via lldb-commits
SuibianP wrote: The patch currently suffers from a critical issue that I cannot diagnose. Help is much appreciated. When the debug adapter attempts to attach to the launcher, https://github.com/llvm/llvm-project/blob/4c8c18c8c54308b945d6c78e2c71ebabf29cb554/lldb/tools/lldb-dap/lldb-dap.cpp#L20

[Lldb-commits] [lldb] [lldb-dap] Implement `runInTerminal` for Windows (PR #121269)

2024-12-28 Thread Hu Jialun via lldb-commits
https://github.com/SuibianP created https://github.com/llvm/llvm-project/pull/121269 Currently, the named pipe is passed by name and a transient `ofstream` is constructed at each I/O request. This assumes, - Blocking semantics: FIFO I/O waits for the other side to connect. - Buffered semant