================
@@ -254,13 +254,17 @@ bool 
lldb_private::formatters::LibStdcppStringSummaryProvider(
   } else
     addr_of_string =
         valobj.GetAddressOf(scalar_is_load_addr, &addr_type);
-  if (addr_of_string != LLDB_INVALID_ADDRESS) {
+
+  // We have to check for host address here
+  // because GetAddressOf returns INVALID for all non load addresses.
+  // But we can still format strings in host memory.
+  if (addr_of_string != LLDB_INVALID_ADDRESS ||
+        addr_type == eAddressTypeHost) {
----------------
Jlalond wrote:

> Make sense to fix GetAddressOf to take advantage of the API it is 
> implementing. If the address kind can be host and we can return a valid host 
> address value, I would say we use it. We will need to look over all uses of 
> this API internally if we do change it.

If we decide to go forward with this refactor, I think we should probably split 
this out into it's own independent PR and put this one on pause. As Jim 
mentioned above there are currently places that make assumptions based on the 
value object being host and getting back an invalid address, and we would need 
to correct for that. 



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

Reply via email to