[Lldb-commits] [lldb] [lldb] Fixed PipeWindows bugs; added Pipe::WriteWithTimeout() (PR #101383)

2024-08-03 Thread Dmitry Vasilyev via lldb-commits
slydiman wrote: I have reverted the original `PipeWindows::CreateNew()` removed in this [commit](https://github.com/llvm/llvm-project/commit/e55850be23a09969a3a619c4767d86cd532b1006). Note the following comment was here at the beginning and it is correct. See also [here for more

[Lldb-commits] [lldb] [lldb] Fixed PipeWindows bugs; added Pipe::WriteWithTimeout() (PR #101383)

2024-08-03 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman edited https://github.com/llvm/llvm-project/pull/101383 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Fixed PipeWindows bugs; added Pipe::WriteWithTimeout() (PR #101383)

2024-08-03 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman edited https://github.com/llvm/llvm-project/pull/101383 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Added Pipe::WriteWithTimeout() (PR #101383)

2024-08-01 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman updated https://github.com/llvm/llvm-project/pull/101383 >From 9c5005d9f28bf1419250a3b3d0d2f5e2ab34b58d Mon Sep 17 00:00:00 2001 From: Dmitry Vasilyev Date: Wed, 31 Jul 2024 22:02:53 +0400 Subject: [PATCH] [lldb] Added Pipe::WriteWithTimeout() Fixed few bugs in

[Lldb-commits] [lldb] [lldb] Added Pipe::WriteWithTimeout() (PR #101383)

2024-08-01 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman updated https://github.com/llvm/llvm-project/pull/101383 >From f88510ee4ae348b62550d785d3efaa4a4a7ee050 Mon Sep 17 00:00:00 2001 From: Dmitry Vasilyev Date: Wed, 31 Jul 2024 22:02:53 +0400 Subject: [PATCH] [lldb] Added Pipe::WriteWithTimeout() Fixed few bugs in

[Lldb-commits] [lldb] [lldb] Added Pipe::WriteWithTimeout() (PR #101383)

2024-08-01 Thread Dmitry Vasilyev via lldb-commits
slydiman wrote: @labath Note I have updated PipeTest.OpenAsReader. The behavior of the creating named pipe is different on Windows and Posix. PipePosix calls mkfifo() and does not open the pipe. But PipeWindows really creates the pipe, which is already opened for read and write. Currently

[Lldb-commits] [lldb] [lldb] Added Pipe::WriteWithTimeout() (PR #101383)

2024-08-01 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman updated https://github.com/llvm/llvm-project/pull/101383 >From 459303737e728a2cda683eb73f46763661126efa Mon Sep 17 00:00:00 2001 From: Dmitry Vasilyev Date: Wed, 31 Jul 2024 22:02:53 +0400 Subject: [PATCH] [lldb] Added Pipe::WriteWithTimeout() Fixed few bugs in

[Lldb-commits] [lldb] [lldb] Multithreading lldb-server works on Windows now; fixed gdb port mapping (PR #100670)

2024-08-01 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman updated https://github.com/llvm/llvm-project/pull/100670 >From 7fb5b2ee53f3125dc2b93cb6fba28b35c70b70e1 Mon Sep 17 00:00:00 2001 From: Dmitry Vasilyev Date: Thu, 25 Jul 2024 00:34:34 +0400 Subject: [PATCH 1/2] [lldb] Multithreading lldb-server works on Windows now;

[Lldb-commits] [lldb] [lldb] Updated lldb-server to spawn the child process and share socket on Windows (PR #101283)

2024-07-31 Thread Dmitry Vasilyev via lldb-commits
slydiman wrote: I have moved all Pipe related changes to #101383. https://github.com/llvm/llvm-project/pull/101283 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Updated lldb-server to spawn the child process and share socket on Windows (PR #101283)

2024-07-31 Thread Dmitry Vasilyev via lldb-commits
slydiman wrote: @labath > one of the issues (ETXTBSY) you refer to as "system bugs" I meant https://bugzilla.kernel.org/show_bug.cgi?id=546 and [this discussion](https://github.com/llvm/llvm-project/pull/100670/files#r1693201568). I'm sad that you don't believe. I concluded that no one uses

[Lldb-commits] [lldb] [lldb] Updated lldb-server to spawn the child process and share socket on Windows (PR #101283)

2024-07-31 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman edited https://github.com/llvm/llvm-project/pull/101283 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Updated lldb-server to spawn the child process and share socket on Windows (PR #101283)

2024-07-31 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman updated https://github.com/llvm/llvm-project/pull/101283 >From 6b2a41ba3d71270e81e24a42d3b4f5dc2f96b939 Mon Sep 17 00:00:00 2001 From: Dmitry Vasilyev Date: Wed, 31 Jul 2024 05:41:21 +0400 Subject: [PATCH] [lldb] Updated lldb-server to spawn the child process and

[Lldb-commits] [lldb] [lldb] Added Pipe::WriteWithTimeout() (PR #101383)

2024-07-31 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman created https://github.com/llvm/llvm-project/pull/101383 Fixed few bugs in PipeWindows. Added the test for async read/write. >From 1d6edb89e242f17908518e9d1b5da431d0d0908b Mon Sep 17 00:00:00 2001 From: Dmitry Vasilyev Date: Wed, 31 Jul 2024 22:02:53 +0400 Subject:

[Lldb-commits] [lldb] [lldb] Updated lldb-server to spawn the child process and share socket on Windows (PR #101283)

2024-07-31 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman edited https://github.com/llvm/llvm-project/pull/101283 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Fixed lldb-server crash (TestLogHandler was not thread safe) (PR #101326)

2024-07-31 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman closed https://github.com/llvm/llvm-project/pull/101326 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Updated lldb-server to spawn the child process and share socket on Windows (PR #101283)

2024-07-31 Thread Dmitry Vasilyev via lldb-commits
@@ -114,6 +120,218 @@ static Status save_socket_id_to_file(const std::string _id, return status; } +static GDBRemoteCommunicationServerPlatform::PortMap gdbserver_portmap; +static std::mutex gdbserver_portmap_mutex; + +#if defined(_WIN32) +static void

[Lldb-commits] [lldb] [lldb] Updated lldb-server to spawn the child process and share socket on Windows (PR #101283)

2024-07-31 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman edited https://github.com/llvm/llvm-project/pull/101283 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Updated lldb-server to spawn the child process and share socket on Windows (PR #101283)

2024-07-31 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman updated https://github.com/llvm/llvm-project/pull/101283 >From add315c8db91c4d51f9b298cc64478c0497857a5 Mon Sep 17 00:00:00 2001 From: Dmitry Vasilyev Date: Wed, 31 Jul 2024 05:41:21 +0400 Subject: [PATCH] [lldb] Updated lldb-server to spawn the child process and

[Lldb-commits] [lldb] [lldb] Updated lldb-server to spawn the child process and share socket on Windows (PR #101283)

2024-07-31 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman edited https://github.com/llvm/llvm-project/pull/101283 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Updated lldb-server to spawn the child process and share socket on Windows (PR #101283)

2024-07-31 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman updated https://github.com/llvm/llvm-project/pull/101283 >From c785238cf366746a383e74a89be7c7431cd41d3c Mon Sep 17 00:00:00 2001 From: Dmitry Vasilyev Date: Wed, 31 Jul 2024 05:41:21 +0400 Subject: [PATCH] [lldb] Updated lldb-server to spawn the child process and

[Lldb-commits] [lldb] [lldb] Updated lldb-server to spawn the child process and share socket on Windows (PR #101283)

2024-07-31 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman edited https://github.com/llvm/llvm-project/pull/101283 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Fixed lldb-server crash (TestLogHandler was not thread safe) (PR #101326)

2024-07-31 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman created https://github.com/llvm/llvm-project/pull/101326 Host::LaunchProcess() requires to SetMonitorProcessCallback. This callback is called from the child process monitor thread. We cannot control this thread anyway. lldb-server may crash if there is a logging

[Lldb-commits] [lldb] [lldb] Updated lldb-server to spawn the child process and share socket on Windows (PR #101283)

2024-07-31 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman edited https://github.com/llvm/llvm-project/pull/101283 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Updated lldb-server to spawn the child process and share socket on Windows (PR #101283)

2024-07-31 Thread Dmitry Vasilyev via lldb-commits
slydiman wrote: @labath > For consistency, and to minimize the number of ifdefs, I believe windows and > non-windows paths should use as similar approaches as possible. That means I > think the end state should be that the posix path also uses a fork+exec > approach. fork+exec on

[Lldb-commits] [lldb] [lldb] Updated lldb-server to spawn the child process and share socket on Windows (PR #101283)

2024-07-31 Thread Dmitry Vasilyev via lldb-commits
slydiman wrote: > What, if any, are the changes to how you would run lldb-server on Windows? I > see a new argument here but not sure if that's only meant for lldb-server to > pass to itself when it starts a child process. The explanation [is

[Lldb-commits] [lldb] [lldb] Updated lldb-server to spawn the child process and share socket on Windows (PR #101283)

2024-07-31 Thread Dmitry Vasilyev via lldb-commits
@@ -283,54 +293,94 @@ Status PipeWindows::ReadWithTimeout(void *buf, size_t size, DWORD sys_bytes_read = size; BOOL result = ::ReadFile(m_read, buf, sys_bytes_read, _bytes_read, _read_overlapped); - if (!result && GetLastError() !=

[Lldb-commits] [lldb] [lldb] Updated lldb-server to spawn the child process and share socket on Windows (PR #101283)

2024-07-31 Thread Dmitry Vasilyev via lldb-commits
@@ -283,54 +293,94 @@ Status PipeWindows::ReadWithTimeout(void *buf, size_t size, DWORD sys_bytes_read = size; BOOL result = ::ReadFile(m_read, buf, sys_bytes_read, _bytes_read, _read_overlapped); - if (!result && GetLastError() !=

[Lldb-commits] [lldb] [lldb] Updated lldb-server to spawn the child process and share socket on Windows (PR #101283)

2024-07-31 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman updated https://github.com/llvm/llvm-project/pull/101283 >From 526708c8ac09275049c9afc8e7673fc5f3d889ed Mon Sep 17 00:00:00 2001 From: Dmitry Vasilyev Date: Wed, 31 Jul 2024 05:41:21 +0400 Subject: [PATCH] [lldb] Updated lldb-server to spawn the child process and

[Lldb-commits] [lldb] [lldb] Updated lldb-server to spawn the child process and share socket on Windows (PR #101283)

2024-07-31 Thread Dmitry Vasilyev via lldb-commits
@@ -159,6 +159,40 @@ GDBRemoteCommunicationServerPlatform::GDBRemoteCommunicationServerPlatform( GDBRemoteCommunicationServerPlatform::~GDBRemoteCommunicationServerPlatform() = default; +void GDBRemoteCommunicationServerPlatform::Proc( +const lldb_private::Args ) { +

[Lldb-commits] [lldb] [lldb] Updated lldb-server to spawn the child process and share socket on Windows (PR #101283)

2024-07-31 Thread Dmitry Vasilyev via lldb-commits
@@ -159,6 +159,40 @@ GDBRemoteCommunicationServerPlatform::GDBRemoteCommunicationServerPlatform( GDBRemoteCommunicationServerPlatform::~GDBRemoteCommunicationServerPlatform() = default; +void GDBRemoteCommunicationServerPlatform::Proc( +const lldb_private::Args ) { +

[Lldb-commits] [lldb] [lldb] Updated lldb-server to spawn the child process and share socket on Windows (PR #101283)

2024-07-31 Thread Dmitry Vasilyev via lldb-commits
@@ -159,6 +159,40 @@ GDBRemoteCommunicationServerPlatform::GDBRemoteCommunicationServerPlatform( GDBRemoteCommunicationServerPlatform::~GDBRemoteCommunicationServerPlatform() = default; +void GDBRemoteCommunicationServerPlatform::Proc( slydiman wrote:

[Lldb-commits] [lldb] [lldb] Updated lldb-server to spawn the child process and share socket on Windows (PR #101283)

2024-07-31 Thread Dmitry Vasilyev via lldb-commits
@@ -27,11 +27,13 @@ class TestLogHandler : public LogHandler { : m_stream_sp(stream_sp) {} void Emit(llvm::StringRef message) override { +std::lock_guard guard(m_mutex); slydiman wrote: Probably I can separate this change to another patch. It is

[Lldb-commits] [lldb] [lldb] Updated lldb-server to spawn the child process and share socket on Windows (PR #101283)

2024-07-31 Thread Dmitry Vasilyev via lldb-commits
@@ -114,6 +120,218 @@ static Status save_socket_id_to_file(const std::string _id, return status; } +static GDBRemoteCommunicationServerPlatform::PortMap gdbserver_portmap; +static std::mutex gdbserver_portmap_mutex; + +#if defined(_WIN32) slydiman wrote:

[Lldb-commits] [lldb] [lldb] Updated lldb-server to spawn the child process and share socket on Windows (PR #101283)

2024-07-31 Thread Dmitry Vasilyev via lldb-commits
slydiman wrote: > What exactly does `lldb-server --server` mean? Sorry. I have updated the description with `lldb-server platform --server`. https://github.com/llvm/llvm-project/pull/101283 ___ lldb-commits mailing list lldb-commits@lists.llvm.org

[Lldb-commits] [lldb] [lldb] Updated lldb-server to spawn the child process and share socket on Windows (PR #101283)

2024-07-31 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman edited https://github.com/llvm/llvm-project/pull/101283 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Updated lldb-server to spawn the child process and share socket on Windows (PR #101283)

2024-07-30 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman edited https://github.com/llvm/llvm-project/pull/101283 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Updated lldb-server to spawn the child process and share socket on Windows (PR #101283)

2024-07-30 Thread Dmitry Vasilyev via lldb-commits
slydiman wrote: Note GDBRemoteCommunicationServerPlatform::DebugserverProcessReaped() may cause a crash if this callback will be called from the child monitor thread after destroing the instance of GDBRemoteCommunicationServerPlatform. It is impossible to control this thread anyway. Hope I

[Lldb-commits] [lldb] [lldb] Updated lldb-server to spawn the child process and share socket on Windows (PR #101283)

2024-07-30 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman updated https://github.com/llvm/llvm-project/pull/101283 >From 396b9a0595c04a8ec2e01c06788ddf9498ee3c4c Mon Sep 17 00:00:00 2001 From: Dmitry Vasilyev Date: Wed, 31 Jul 2024 05:41:21 +0400 Subject: [PATCH] [lldb] Updated lldb-server to spawn the child process and

[Lldb-commits] [lldb] [lldb] Updated lldb-server to spawn the child process and share socket on Windows (PR #101283)

2024-07-30 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman created https://github.com/llvm/llvm-project/pull/101283 `lldb-server --server` works on Windows now w/o multithreading. The rest functionality remains unchanged. Added also PipeWindows::WriteWithTimeout(), fixed PipeWindows::ReadWithTimeout() and missing

[Lldb-commits] [lldb] [lldb] Multithreading lldb-server works on Windows now; fixed gdb port mapping (PR #100670)

2024-07-29 Thread Dmitry Vasilyev via lldb-commits
slydiman wrote: @labath It seems we do not need qSupported and qUpgradeToGdbConnection. We can run `lldb-server platform --server --listen 1234 --gdbserver-port 1235` Option 1: On receiving qLaunchGDBServer we can - fork the child process to know the new pid - send the response with the pid

[Lldb-commits] [lldb] [lldb] Improved lldb-server stability for remote launching (PR #100659)

2024-07-29 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman closed https://github.com/llvm/llvm-project/pull/100659 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Improved lldb-server stability for remote launching (PR #100659)

2024-07-29 Thread Dmitry Vasilyev via lldb-commits
slydiman wrote: I have moved this patch to #100670. https://github.com/llvm/llvm-project/pull/100659 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Multithreading lldb-server works on Windows now; fixed gdb port mapping (PR #100670)

2024-07-29 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman updated https://github.com/llvm/llvm-project/pull/100670 >From 0870140c8b8d465570a696b35b59fbf55610919a Mon Sep 17 00:00:00 2001 From: Dmitry Vasilyev Date: Thu, 25 Jul 2024 00:34:34 +0400 Subject: [PATCH 1/2] [lldb] Multithreading lldb-server works on Windows now;

[Lldb-commits] [lldb] [lldb] Improved lldb-server stability for remote launching (PR #100659)

2024-07-29 Thread Dmitry Vasilyev via lldb-commits
slydiman wrote: > I'd like to hear your opinion on my port mapping alternative. https://github.com/llvm/llvm-project/pull/100670#issuecomment-2255991921 https://github.com/llvm/llvm-project/pull/100659 ___ lldb-commits mailing list

[Lldb-commits] [lldb] [lldb] Multithreading lldb-server works on Windows now; fixed gdb port mapping (PR #100670)

2024-07-29 Thread Dmitry Vasilyev via lldb-commits
slydiman wrote: > The way this would work is by letting the platform instance > delegate/upgrate/convert the platform connection into a gdbserver one. The > way this would work would be something like this: > > 1. `lldb-server platform` would advertise (say in `qSupported`) its support > for

[Lldb-commits] [lldb] [lldb] Improved lldb-server stability for remote launching (PR #100659)

2024-07-29 Thread Dmitry Vasilyev via lldb-commits
slydiman wrote: > Ok, so if I'm reading this right you're saying you saw no ETXTBSY errors with > the current implementation --server flag. Is that correct ? Right. Initially I have marked #100670 as dependent on this. Ok, agreed. So, we can try to use O_CLOFORK. And simple solution is to

[Lldb-commits] [lldb] [lldb] Improved lldb-server stability for remote launching (PR #100659)

2024-07-29 Thread Dmitry Vasilyev via lldb-commits
slydiman wrote: See also https://github.com/golang/go/issues/22315 https://github.com/llvm/llvm-project/pull/100659 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Improved lldb-server stability for remote launching (PR #100659)

2024-07-29 Thread Dmitry Vasilyev via lldb-commits
slydiman wrote: > that could mean that something like `$CC hello.cc && ./a.out` could fail > (what we're doing here isn't fundamentally different than that). The difference is that cc creates a.out and exits itself. But `lldb-server platform` is still running after creating the executable.

[Lldb-commits] [lldb] [lldb] Improved lldb-server stability for remote launching (PR #100659)

2024-07-29 Thread Dmitry Vasilyev via lldb-commits
slydiman wrote: > Does this refer the the forking implementation you get with the --server > flag, or the serial implementation which only handles one connection at a > time (without the flag)? I mean the `--server` flag. It is very hard to reproduce this issue with the serial implementation

[Lldb-commits] [lldb] [lldb] Multithreading lldb-server works on Windows now; fixed gdb port mapping (PR #100670)

2024-07-29 Thread Dmitry Vasilyev via lldb-commits
slydiman wrote: > If this is only really used for a "only for few requests via the platform > protocol", then why not make the CWD a property of the platform object? > (Either through a virtual filesystem, or just by having it as a string, and > resolving things explicitly) It is possible to

[Lldb-commits] [lldb] [lldb] Multithreading lldb-server works on Windows now; fixed gdb port mapping (PR #100670)

2024-07-26 Thread Dmitry Vasilyev via lldb-commits
slydiman wrote: > One way I can imagine this happening is if the FileSystem instance was local > to a GDBRemoteCommunicationServerPlatform instance -- rather than the thread > it happens to be (mostly) running on. This will require more changes to, > basically, plumb the filesystem instance

[Lldb-commits] [lldb] [lldb] Multithreading lldb-server works on Windows now; fixed gdb port mapping (PR #100670)

2024-07-26 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman edited https://github.com/llvm/llvm-project/pull/100670 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Multithreading lldb-server works on Windows now; fixed gdb port mapping (PR #100670)

2024-07-26 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman edited https://github.com/llvm/llvm-project/pull/100670 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Multithreading lldb-server works on Windows now; fixed gdb port mapping (PR #100670)

2024-07-26 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman edited https://github.com/llvm/llvm-project/pull/100670 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Improved lldb-server stability for remote launching (PR #100659)

2024-07-26 Thread Dmitry Vasilyev via lldb-commits
slydiman wrote: Of course lldb waits for the vFile:close response before sending the vRun packet and lldb-server actually closes the file handle (all of them). No any leaks. Otherwise this workaround wouldn't work. The behavior is the same on Linux and Windows targets. I launched 100

[Lldb-commits] [lldb] [lldb] Optimized lldb-server memory usage (PR #100666)

2024-07-26 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman closed https://github.com/llvm/llvm-project/pull/100666 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Optimized lldb-server memory usage (PR #100666)

2024-07-26 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman updated https://github.com/llvm/llvm-project/pull/100666 >From 0e451f16b91bab2bc2cd1375eb02e4fe71998790 Mon Sep 17 00:00:00 2001 From: Dmitry Vasilyev Date: Fri, 26 Jul 2024 02:40:49 +0400 Subject: [PATCH 1/3] [lldb] Optimized lldb-server memory usage MAX_PATH is

[Lldb-commits] [lldb] [lldb] Multithreading lldb-server works on Windows now; fixed gdb port mapping (PR #100670)

2024-07-26 Thread Dmitry Vasilyev via lldb-commits
@@ -324,6 +324,18 @@ Status PipePosix::ReadWithTimeout(void *buf, size_t size, bytes_read += result; if (bytes_read == size || result == 0) break; + +// This is the workaround for the following bug in Linux multithreading +// select()

[Lldb-commits] [lldb] [lldb] Multithreading lldb-server works on Windows now; fixed gdb port mapping (PR #100670)

2024-07-26 Thread Dmitry Vasilyev via lldb-commits
slydiman wrote: > to replace the fork with spawning a new process (fork+execve) instead. Have > you considered that? To fix all gdb port mapping issues we need a common port mapping available to all platform connections. It is possible only with the multithreading.

[Lldb-commits] [lldb] [lldb] Optimized lldb-server memory usage (PR #100666)

2024-07-26 Thread Dmitry Vasilyev via lldb-commits
@@ -1145,7 +1145,8 @@ Status GDBRemoteCommunication::StartDebugserverProcess( if (socket_pipe.CanWrite()) socket_pipe.CloseWriteFileDescriptor(); if (socket_pipe.CanRead()) { -char port_cstr[PATH_MAX] = {0}; +// The port number may be

[Lldb-commits] [lldb] [lldb] Optimized lldb-server memory usage (PR #100666)

2024-07-26 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman updated https://github.com/llvm/llvm-project/pull/100666 >From 0e451f16b91bab2bc2cd1375eb02e4fe71998790 Mon Sep 17 00:00:00 2001 From: Dmitry Vasilyev Date: Fri, 26 Jul 2024 02:40:49 +0400 Subject: [PATCH 1/2] [lldb] Optimized lldb-server memory usage MAX_PATH is

[Lldb-commits] [lldb] [lldb] Multithreading lldb-server works on Windows now; fixed gdb port mapping (PR #100670)

2024-07-25 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman edited https://github.com/llvm/llvm-project/pull/100670 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Multithreading lldb-server works on Windows now; fixed gdb port mapping (PR #100670)

2024-07-25 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman created https://github.com/llvm/llvm-project/pull/100670 Removed fork(). Used threads and the common thread-safe port map for all platform connections. Updated lldb::FileSystem to use llvm::vfs::createPhysicalFileSystem() with an own virtual working directory per

[Lldb-commits] [lldb] [lldb] Improved lldb-server stability for remote launching (PR #100659)

2024-07-25 Thread Dmitry Vasilyev via lldb-commits
@@ -201,7 +201,7 @@ struct ForkLaunchInfo { execve(info.argv[0], const_cast(info.argv), info.envp); #if defined(__linux__) - if (errno == ETXTBSY) { + for (int i = 0; i < 50; ++i) { slydiman wrote: I think it is redundant. Currently lldb-server contains

[Lldb-commits] [lldb] [lldb] Improved lldb-server stability for remote launching (PR #100659)

2024-07-25 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman updated https://github.com/llvm/llvm-project/pull/100659 >From 21fd03faa1224d44bd132a0b53d66d896210a044 Mon Sep 17 00:00:00 2001 From: Dmitry Vasilyev Date: Fri, 26 Jul 2024 01:48:35 +0400 Subject: [PATCH] [lldb] Improved lldb-server stability for remote launching

[Lldb-commits] [lldb] [lldb] Optimized lldb-server memory usage (PR #100666)

2024-07-25 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman created https://github.com/llvm/llvm-project/pull/100666 MAX_PATH is definitely larger than 6 bytes we are expecting for this message, and could be rather large depending on the target OS (4K for some Linux OSs). Since the buffer gets allocated on the stack we

[Lldb-commits] [lldb] [lldb] Improved lldb-server stability for remote launching (PR #100659)

2024-07-25 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman created https://github.com/llvm/llvm-project/pull/100659 We faced the issue running cross api tests in 8 threads. The executable is installed to the target by the process `lldb-server platform`, but launched by the another process `lldb-server gdbserver`. We got

[Lldb-commits] [lldb] [lldb][Windows] Fixed Host::Kill() (PR #99721)

2024-07-21 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman closed https://github.com/llvm/llvm-project/pull/99721 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb][Windows] Fixed Host::Kill() (PR #99721)

2024-07-20 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman edited https://github.com/llvm/llvm-project/pull/99721 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb][Windows] Fixed Host::Kill() (PR #99721)

2024-07-20 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman updated https://github.com/llvm/llvm-project/pull/99721 >From c033ba3832141409c2dac7e7363c0c85caa2274b Mon Sep 17 00:00:00 2001 From: Dmitry Vasilyev Date: Sat, 20 Jul 2024 03:48:12 +0400 Subject: [PATCH] [lldb][Windows] Fixed Host::Kill()

[Lldb-commits] [lldb] [lldb][Windows] Fixed Host::Kill() (PR #99721)

2024-07-20 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman edited https://github.com/llvm/llvm-project/pull/99721 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb][Windows] Fixed Host::Kill() (PR #99721)

2024-07-19 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman created https://github.com/llvm/llvm-project/pull/99721 HostProcessWindows::Terminate() correctly uses m_process which type is process_t (HANDLE) to call ::TerminateProcess(). But Host::Kill() uses a cast from pid, which is wrong. >From

[Lldb-commits] [lldb] [lldb] Fixed the error `unable to launch a GDB server` in API tests (PR #98833)

2024-07-17 Thread Dmitry Vasilyev via lldb-commits
slydiman wrote: > Agreed, so silent UB would just be making things worse. So, this patch fixes that issue, right? > Perhaps I am spelling the port option differently, or you mean a lldb-server > gdbserver launched by a platform ignores the port. It seems it depends on the system. Note I'm

[Lldb-commits] [lldb] [lldb] Fixed the error `unable to launch a GDB server` in API tests (PR #98833)

2024-07-16 Thread Dmitry Vasilyev via lldb-commits
slydiman wrote: The best solution is simply to remove all code related to gdb port mapping, because it does not work at all. Try to run `netstat` and you will be surprised. 1. lldb-server in gdbserver mode completely ignores the port from the url `tcp://[hostname]:port`. It binds to port 0

[Lldb-commits] [lldb] [lldb] Fixed the error `unable to launch a GDB server` in API tests (PR #98833)

2024-07-16 Thread Dmitry Vasilyev via lldb-commits
slydiman wrote: > Did you consider making `AllowPort(0)` do nothing? GetNextAvailablePort() returns 0 in case of the empty map. LaunchGDBServer() does not update the map with the pid if the port is 0. So 0 is a special value which means `any`. Adding 0 to a map causes an unexpected behavior.

[Lldb-commits] [lldb] [lldb] Fixed the error `unable to launch a GDB server` in API tests (PR #98833)

2024-07-15 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman edited https://github.com/llvm/llvm-project/pull/98833 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Fixed the error `unable to launch a GDB server` in API tests (PR #98833)

2024-07-15 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman edited https://github.com/llvm/llvm-project/pull/98833 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Fixed the error `unable to launch a GDB server` in API tests (PR #98833)

2024-07-15 Thread Dmitry Vasilyev via lldb-commits
slydiman wrote: It seems `StartDebugserverProcess()` ignores the port anyway and parameters `--min-gdbserver-port`, `--max-gdbserver-port`, `--gdbserver-port` are useless at all, but it is out of scope of this patch. https://github.com/llvm/llvm-project/pull/98833

[Lldb-commits] [lldb] [lldb] Fixed the error `unable to launch a GDB server` in API tests (PR #98833)

2024-07-15 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman edited https://github.com/llvm/llvm-project/pull/98833 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Fixed the error `unable to launch a GDB server` in API tests (PR #98833)

2024-07-15 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman edited https://github.com/llvm/llvm-project/pull/98833 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Fixed the error `unable to launch a GDB server` in API tests (PR #98833)

2024-07-14 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman created https://github.com/llvm/llvm-project/pull/98833 TestPlatformLaunchGDBServer.py runs ldb-server w/o parameters `--min-gdbserver-port`, `--max-gdbserver-port` or `--gdbserver-port`. So `gdbserver_portmap` is empty and

[Lldb-commits] [lldb] [lldb] Have lldb-server assign ports to children in platform mode (PR #88845)

2024-07-13 Thread Dmitry Vasilyev via lldb-commits
slydiman wrote: Here is the log of lldb-server processes (parent and child) on remote Linux ``` /home/ubuntu/lldb-server p --log-channels lldb all --listen *:1234 --server --min-gdbserver-port 1236 --max-gdbserver-port 1240 /home/ubuntu/lldb-server gdbserver tcp://[10.1.1.170]:0 --native-regs

[Lldb-commits] [lldb] [lldb] Unify Platform::ResolveExecutable (PR #96256)

2024-06-26 Thread Dmitry Vasilyev via lldb-commits
slydiman wrote: It seems this patch breaks the following tests on cross setups: ``` Failed Tests (6): lldb-api :: commands/process/attach/TestProcessAttach.py lldb-api :: commands/process/detach-resumes/TestDetachResumes.py lldb-api :: functionalities/dyld-exec-linux/TestDyldExecLinux.py

[Lldb-commits] [lldb] [lldb] Fix TestModuleLoadedNotifys API test to work correctly on most of Linux targets (PR #94672)

2024-06-10 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman closed https://github.com/llvm/llvm-project/pull/94672 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Fix TestModuleLoadedNotifys API test to work correctly on most of Linux targets (PR #94672)

2024-06-10 Thread Dmitry Vasilyev via lldb-commits
@@ -118,6 +118,6 @@ def test_launch_notifications(self): # On Linux we get events for ld.so, [vdso], the binary and then all libraries. avg_solibs_added_per_event = round( -float(total_solibs_added) / float(total_modules_added_events) +

[Lldb-commits] [lldb] [lldb] Fix TestModuleLoadedNotifys API test to work correctly on most of Linux targets (PR #94672)

2024-06-10 Thread Dmitry Vasilyev via lldb-commits
@@ -115,9 +151,10 @@ def test_launch_notifications(self): # binaries in batches. Check that we got back more than 1 solib per event. # In practice on Darwin today, we get back two events for a do-nothing c # program: a.out and dyld, and then all the

[Lldb-commits] [lldb] [lldb] Fix TestModuleLoadedNotifys API test to work correctly on most of Linux targets (PR #94672)

2024-06-10 Thread Dmitry Vasilyev via lldb-commits
@@ -1,3 +1,23 @@ -CXX_SOURCES := main.cpp - -include Makefile.rules +CXX_SOURCES := main.cpp +LD_EXTRAS := -L. -lloadunload_d -lloadunload_c -lloadunload_a -lloadunload_b slydiman wrote: Done. https://github.com/llvm/llvm-project/pull/94672

[Lldb-commits] [lldb] [lldb] Fix TestModuleLoadedNotifys API test to work correctly on most of Linux targets (PR #94672)

2024-06-10 Thread Dmitry Vasilyev via lldb-commits
@@ -0,0 +1,7 @@ +extern "C" int b_function(); + +int a_init() { return 234; } + +int a_global = a_init(); slydiman wrote: Done. https://github.com/llvm/llvm-project/pull/94672 ___ lldb-commits mailing list

[Lldb-commits] [lldb] [lldb] Fix TestModuleLoadedNotifys API test to work correctly on most of Linux targets (PR #94672)

2024-06-10 Thread Dmitry Vasilyev via lldb-commits
@@ -9,22 +9,51 @@ from lldbsuite.test import lldbutil +@skipUnlessPlatform(["linux"] + lldbplatformutil.getDarwinOSTriples()) class ModuleLoadedNotifysTestCase(TestBase): NO_DEBUG_INFO_TESTCASE = True # At least DynamicLoaderDarwin and DynamicLoaderPOSIXDYLD

[Lldb-commits] [lldb] [lldb] Fix TestModuleLoadedNotifys API test to work correctly on most of Linux targets (PR #94672)

2024-06-10 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman updated https://github.com/llvm/llvm-project/pull/94672 >From 3f91ecacdcf1eedc95b72e8a85591e60a863431e Mon Sep 17 00:00:00 2001 From: Dmitry Vasilyev Date: Thu, 6 Jun 2024 23:38:03 +0400 Subject: [PATCH 1/4] [lldb] Fix TestModuleLoadedNotifys API test to work

[Lldb-commits] [lldb] [lldb] Gracefully down TestCoroutineHandle test in case the 'coroutine' feature is missing (PR #94903)

2024-06-10 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman closed https://github.com/llvm/llvm-project/pull/94903 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Gracefully down TestCoroutineHandle test in case the 'coroutine' feature is missing (PR #94903)

2024-06-09 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman updated https://github.com/llvm/llvm-project/pull/94903 >From 6e988bcbbd4310a09c6baa553b4cf55998e92034 Mon Sep 17 00:00:00 2001 From: Dmitry Vasilyev Date: Sun, 9 Jun 2024 18:33:03 +0400 Subject: [PATCH] [lldb] Gracefully down TestCoroutineHandle test in case the

[Lldb-commits] [lldb] [lldb] Gracefully down TestCoroutineHandle test in case the 'coroutine' feature is missing (PR #94903)

2024-06-09 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman created https://github.com/llvm/llvm-project/pull/94903 Do not let the compiler gets failed in case the target platform does not support the 'coroutine' C++ features. Just compile without it and let lldb know about missed/unsupported feature. >From

[Lldb-commits] [lldb] [lldb] Fix TestModuleLoadedNotifys API test to work correctly on most of Linux targets (PR #94672)

2024-06-08 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman updated https://github.com/llvm/llvm-project/pull/94672 >From 3f91ecacdcf1eedc95b72e8a85591e60a863431e Mon Sep 17 00:00:00 2001 From: Dmitry Vasilyev Date: Thu, 6 Jun 2024 23:38:03 +0400 Subject: [PATCH 1/3] [lldb] Fix TestModuleLoadedNotifys API test to work

[Lldb-commits] [lldb] [lldb] Fix TestModuleLoadedNotifys API test to work correctly on most of Linux targets (PR #94672)

2024-06-08 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman updated https://github.com/llvm/llvm-project/pull/94672 >From 3f91ecacdcf1eedc95b72e8a85591e60a863431e Mon Sep 17 00:00:00 2001 From: Dmitry Vasilyev Date: Thu, 6 Jun 2024 23:38:03 +0400 Subject: [PATCH 1/3] [lldb] Fix TestModuleLoadedNotifys API test to work

[Lldb-commits] [lldb] [lldb] Fix TestModuleLoadedNotifys API test to work correctly on most of Linux targets (PR #94672)

2024-06-08 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman updated https://github.com/llvm/llvm-project/pull/94672 >From 3f91ecacdcf1eedc95b72e8a85591e60a863431e Mon Sep 17 00:00:00 2001 From: Dmitry Vasilyev Date: Thu, 6 Jun 2024 23:38:03 +0400 Subject: [PATCH 1/3] [lldb] Fix TestModuleLoadedNotifys API test to work

[Lldb-commits] [lldb] [lldb] Fix TestModuleLoadedNotifys API test to work correctly on most of Linux targets (PR #94672)

2024-06-08 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman updated https://github.com/llvm/llvm-project/pull/94672 >From 3f91ecacdcf1eedc95b72e8a85591e60a863431e Mon Sep 17 00:00:00 2001 From: Dmitry Vasilyev Date: Thu, 6 Jun 2024 23:38:03 +0400 Subject: [PATCH 1/3] [lldb] Fix TestModuleLoadedNotifys API test to work

[Lldb-commits] [lldb] [lldb] Fix TestModuleLoadedNotifys API test to work correctly on most of Linux targets (PR #94672)

2024-06-08 Thread Dmitry Vasilyev via lldb-commits
@@ -118,6 +118,6 @@ def test_launch_notifications(self): # On Linux we get events for ld.so, [vdso], the binary and then all libraries. avg_solibs_added_per_event = round( -float(total_solibs_added) / float(total_modules_added_events) +

[Lldb-commits] [lldb] [lldb] Fix TestModuleLoadedNotifys API test to work correctly on most of Linux targets (PR #94672)

2024-06-08 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman updated https://github.com/llvm/llvm-project/pull/94672 >From 3f91ecacdcf1eedc95b72e8a85591e60a863431e Mon Sep 17 00:00:00 2001 From: Dmitry Vasilyev Date: Thu, 6 Jun 2024 23:38:03 +0400 Subject: [PATCH 1/3] [lldb] Fix TestModuleLoadedNotifys API test to work

[Lldb-commits] [lldb] [lldb] Fix TestModuleLoadedNotifys API test to work correctly on most of Linux targets (PR #94672)

2024-06-07 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman edited https://github.com/llvm/llvm-project/pull/94672 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

  1   2   3   >