================
@@ -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:

That I don't know. ValueObject does [explicitly 
return](https://github.com/llvm/llvm-project/blob/main/lldb/source/Core/ValueObject.cpp#L1408C12-L1408C32)
 `LLDB_INVALID_ADDRESS` when `addressType == eAddressTypeHost`. I thought this 
was weird and potentially returning the address of the in memory buffer made 
more sense, but that seemed like a major refactor for a minor string issue

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