[Lldb-commits] [lldb] [lldb] [debugserver] fix qLaunchSuccess error, add QErrorStringInPacketSupported (PR #82593)

Alex Langford via lldb-commits lldb-commits at lists.llvm.org
Thu Feb 22 10:24:03 PST 2024


================
@@ -3944,15 +3955,22 @@ rnb_err_t RNBRemote::HandlePacket_v(const char *p) {
         // The order of these checks is important.  
         if (process_does_not_exist (pid_attaching_to)) {
           DNBLogError("Tried to attach to pid that doesn't exist");
-          std::string return_message = "E96;";
-          return_message += cstring_to_asciihex_string("no such process.");
+          std::string return_message = "E96";
----------------
bulbazord wrote:

I see this pattern in lots of places, is it worth abstracting out? Something like:

```
std::string CreateAttachError(const char *additional_context = nullptr) {
    std::string message = "E96";
    if (additional_context)
        message += ";" + cstring_to_asciihex_string(additional_context);
    return message;
}
```

What do you think?

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


More information about the lldb-commits mailing list