[Lldb-commits] [lldb] [lldb] Multithreading lldb-server works on Windows now; fixed gdb port mapping (PR #100670)
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Mon Jul 29 07:18:55 PDT 2024
labath 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 this new mode.
> > 2. Before asking the platform to launch a new gdb server, lldb would query this feature. If present, instead of the usual action (`qLaunchGDBServer`), it would create _another_ platform connection, using the same port as the original one. As we're using the same port, we'd go through all the nats just like the original connection.
> > 3. On this new connection it would send a new special packet (let's call it `qUpgradeToGdbConnection`)
> > 4. `lldb server platform` would launch an gdbserver instance and everything else would proceed as before.
> >
> > On non-darwin platform (darwin uses `debugserver`) we could optimize to avoid spawning a new process, and just call the relevant gdb-server code directly.
>
> But debugserver on darwin will not support this feauture. It will still require the port map or disabling firewall.
I think it should already [support that](https://github.com/llvm/llvm-project/blob/97c62b8f7501d1c6c2f507b075fbe45a31d2b9dc/lldb/tools/debugserver/source/debugserver.cpp#L1297). If it doesn't, and it comes down to this, I volunteer to help you with making sure that works.
https://github.com/llvm/llvm-project/pull/100670
More information about the lldb-commits
mailing list