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

Dmitry Vasilyev via lldb-commits lldb-commits at lists.llvm.org
Tue Jul 16 09:49:55 PDT 2024


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 it is hardcoded.
2. Currently lldb-server in platform mode always runs `lldb-server gdbserver tcp://[hostname]:0` because of the bug added 4 years ago and no one noticed this issue.

If gdb port parameters specified, now it causes issues like #97537, but a random port will be used for connection anyway.

If no gdb port parameters specified, the port map must be empty and must stay empty. AllowPort(0) makes the port map not empty and causes an unexpected behavior. This patch fixes this issue.

https://github.com/llvm/llvm-project/pull/98833


More information about the lldb-commits mailing list