[Lldb-commits] [PATCH] D108351: [lldb server] Tidy up LLDB server return codes and associated tests

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Aug 19 11:39:19 PDT 2021


clayborg added inline comments.


================
Comment at: lldb/tools/lldb-server/lldb-platform.cpp:289
     fprintf(stderr, "failed to create acceptor: %s", error.AsCString());
-    exit(socket_error);
+    return -1;
   }
----------------
Should we return error.GetError() if it is non zero? IIRC it will be the actual errno. And best to not return -1, just return 1.

```
uint32_t SBError::GetError() const;
```


================
Comment at: lldb/tools/lldb-server/lldb-platform.cpp:295
     printf("failed to listen: %s\n", error.AsCString());
-    exit(socket_error);
+    return -1;
   }
----------------
Same as above?


================
Comment at: lldb/tools/lldb-server/lldb-platform.cpp:323
       WithColor::error() << error.AsCString() << '\n';
-      exit(socket_error);
+      return -1;
     }
----------------
Same as my above comment, "error" will contain the "errno" value I believe. So maybe return "error.GetError()" as suggested above?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108351/new/

https://reviews.llvm.org/D108351



More information about the lldb-commits mailing list