[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] 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] 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 `gdbserver_portmap.GetNextAvailablePort()`

[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-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-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 and

[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 w

[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 0712380a0ef60fae0a3035ac1e57

[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() HostProcessWindows::Termin

[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-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] 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 the

[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 bette

[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 W

[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 a

[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 t

[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] 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 de

[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 "1024\0

[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. https://github.com/llvm/llv

[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() h

[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 de

[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] 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 connect

[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] 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 to

[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] 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] 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. Som

[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: > 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 cal

[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: > 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@lists.

[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 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] 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] 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 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 initializ

[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 sh

[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 wil

[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-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: > 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 ht

[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 &socket_id, return status; } +static GDBRemoteCommunicationServerPlatform::PortMap gdbserver_portmap; +static std::mutex gdbserver_portmap_mutex; + +#if defined(_WIN32) slydiman wr

[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 n

[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: No

[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 &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 &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
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 sh

[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, &sys_bytes_read, &m_read_overlapped); - if (!result && GetLastError() != ERROR_I

[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, &sys_bytes_read, &m_read_overlapped); - if (!result && GetLastError() != ERROR_I

[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 here](https://github.com/llvm/llvm-project/pull/10

[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 non-Window

[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 aro

[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 sh

[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 sh

[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
@@ -114,6 +120,218 @@ static Status save_socket_id_to_file(const std::string &socket_id, return status; } +static GDBRemoteCommunicationServerPlatform::PortMap gdbserver_portmap; +static std::mutex gdbserver_portmap_mutex; + +#if defined(_WIN32) +static void SpawnProcessRea

[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
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] 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 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 sh

[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 > 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 t

[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] 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] 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 Pipe

[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

[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 Pipe

[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 Pipe

[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] 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 details](http

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

2024-08-05 Thread Dmitry Vasilyev via lldb-commits
@@ -44,8 +42,70 @@ TEST_F(PipeTest, OpenAsReader) { size_t name_len = name.size(); name += "foobar"; llvm::StringRef name_ref(name.data(), name_len); + // Note OpenAsReader() do nothing on Windows, the pipe is already opened for + // read and write. ASSERT_THAT_ERROR

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

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

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

2024-08-05 Thread Dmitry Vasilyev via lldb-commits
slydiman wrote: @labath Thanks for the review. I have updated everything. 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] Updated lldb-server to spawn the child process and share socket on Windows (PR #101283)

2024-08-05 Thread Dmitry Vasilyev via lldb-commits
slydiman wrote: @labath >That's nice, but I think we should figure out how to reduce the number of >ifdefs in this patch. Porting linux away from fork may not be your concern, >but figuring out how to make the code less branchy is. If you can do that >without removing forks, I can take it upo

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

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

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

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

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

2024-08-05 Thread Dmitry Vasilyev via lldb-commits
https://github.com/slydiman closed 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] Updated lldb-server to spawn the child process and share socket on Windows (PR #101283)

2024-08-05 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-08-06 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 1/2] [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 (PR #101283)

2024-08-06 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 (PR #101283)

2024-08-06 Thread Dmitry Vasilyev via lldb-commits
slydiman wrote: I have updated the patch to spawn the child process on non-Windows too and minimized the number of `#ifdef _WIN32`. https://github.com/llvm/llvm-project/pull/101283 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://list

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

2024-08-06 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 1/2] [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 (PR #101283)

2024-08-06 Thread Dmitry Vasilyev via lldb-commits
slydiman wrote: @labath Please look at the updated patch. ServeSingleConnection() = client_handle() AcceptConnectionFromParent() = some code + client_handle() ServeInSubprocess() = spawn_process() lldb-platform.cpp is simple. Currently we don't see the whole picture before the part 2 of this pa

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

2024-08-07 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 1/3] [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 (PR #101283)

2024-08-07 Thread Dmitry Vasilyev via lldb-commits
slydiman wrote: @labath I have added the class SharedSocket. I have implemented all the recommendations. Note we have the buildbot for cross tests (Windows x64/Linux x64 host and Linux Aarch64 target). So everything is tested. Hope 1191 API tests run with this lldb-server are enough. https://

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

2024-08-07 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 1/3] [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 (PR #101283)

2024-08-08 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 1/4] [lldb] Updated lldb-server to spawn the child process and

  1   2   3   4   5   6   7   >