[Lldb-commits] [lldb] [lldb] Removed gdbserver ports map from lldb-server (PR #104238)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 4 01:12:20 PDT 2024


================
@@ -879,20 +879,12 @@ lldb::thread_result_t GDBRemoteCommunication::ListenThread() {
   return {};
 }
 
-Status GDBRemoteCommunication::StartDebugserverProcess(
-    const char *url, Platform *platform, ProcessLaunchInfo &launch_info,
-    uint16_t *port, const Args *inferior_args, int pass_comm_fd) {
+bool GDBRemoteCommunication::GetDebugserverPath(
+    Platform *platform, FileSpec &debugserver_file_spec) {
----------------
labath wrote:

Minimizing changes is not what I'm concerned with. This change in particular could be easily split off into its own patch.
I don't think
```
FileSpec &debugserver_file_spec = launch_info.GetExecutableFile();
if (GetDebugserverPath(platform, debugserver_file_spec)) {
```
is inherently better than
```
launch_info.GetExecutableFile() = GetDebugserverPath(platform);
if (launch_info.GetExecutableFile()) {
```
or 
```
if (FileSpec debugserver_file_spec = GetDebugserverPath(platform)) {
  launch_info.GetExecutableFile() = debugserver_file_spec;
```

In fact, I'd say it's the opposite, because that pattern leaves it ambiguous as to what is the value of the by-ref argument in the failure case (is it unchanged, empty/invalid, or undefined)?

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


More information about the lldb-commits mailing list