================
@@ -554,7 +554,8 @@ llvm::json::Value CreateStackFrame(DAP &dap, lldb::SBFrame 
&frame,
 
   lldb::SBModule module = frame.GetModule();
   if (module.IsValid()) {
-    std::string uuid = module.GetUUIDString();
+    const char *uuid_cstr = module.GetUUIDString();
+    std::string uuid = uuid_cstr ? uuid_cstr : "";
     if (!uuid.empty())
       object.try_emplace("moduleId", uuid);
----------------
da-viper wrote:

```suggestion
    if (const llvm::StringRef uuid = module.GetUUIDString(); !uuid.empty())
      object.try_emplace("moduleId", uuid.str());
```
It makes more sense to use `llvm::StringRef` as we only convert/store it if it 
is valid. and the underlying `char *` is owned by lldb. 



https://github.com/llvm/llvm-project/pull/169844
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to