[Lldb-commits] [lldb] [lldb] Multithreading lldb-server works on Windows now; fixed gdb port mapping (PR #100670)
Dmitry Vasilyev via lldb-commits
lldb-commits at lists.llvm.org
Mon Jul 29 04:34:41 PDT 2024
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 store an own FileSystem object in the platform handler, but it requires to update 80% of GDBRemoteCommunicationServerCommon.cpp and implement some behavior switch in inherited classes.
I tried to minimize changes. I have added the new FileSystem::InitializePerThread() which is used only in GDBRemoteCommunicationServerPlatform and its base clases in case of multithreading. All other code uses the same FileSystem, nothing changed. FileSystem::InitializePerThread() uses the CWD of the app. So the behavior for the thread is the same as for a forked child process.
I don't see any other threads where FileSystem is used. `lldb-server platform` creates only one additional thread to monitor a child process. But it does not use any file system operations.
Anyway if FileSystem::InitializePerThread() was not called, any new thread uses the common app's FileSystem. It is safe.
https://github.com/llvm/llvm-project/pull/100670
More information about the lldb-commits
mailing list