================
@@ -416,8 +416,11 @@ llvm::json::Value CreateModule(lldb::SBTarget &target, 
lldb::SBModule &module,
   } else {
     object.try_emplace("symbolStatus", "Symbols not found.");
   }
-  std::string loaded_addr = std::to_string(
-      module.GetObjectFileHeaderAddress().GetLoadAddress(target));
+  std::string loaded_addr;
+  llvm::raw_string_ostream os_hex(loaded_addr);
+  os_hex << llvm::format_hex(
+      module.GetObjectFileHeaderAddress().GetLoadAddress(target),
+      sizeof(lldb::addr_t));
----------------
JDevlieghere wrote:

I assumed the load address was a "number" but the 
[spec](https://microsoft.github.io/debug-adapter-protocol/specification#Types_Module)
 says it's a "string" in which case I agree it makes more sense to the hex 
conversion here. 

You can  simplify this something like this:
```
object.try_emplace("addressRange", llvm::format({0:x}, 
module.GetObjectFileHeaderAddress().GetLoadAddress(target)).str());
```


https://github.com/llvm/llvm-project/pull/139934
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to