[Lldb-commits] [lldb] [lldb] Add SBStructuredData::GetStringValue overload (PR #216875)

Med Ismail Bennani via lldb-commits lldb-commits at lists.llvm.org
Tue Aug 18 10:52:34 PDT 2026


================
@@ -1,6 +1,17 @@
 STRING_EXTENSION_OUTSIDE(SBStructuredData)
 
 %extend lldb::SBStructuredData {
+    std::string GetStringValue() const {
+        const size_t len = $self->GetStringValue(nullptr, 0);
+        if (len == 0)
+            return std::string{};
+
+        std::string result(len, '\0');
+        $self->GetStringValue(result.data(), result.size() + 1);
+
+        return result;
+    }
----------------
medismailben wrote:

Might as well make a `__str__` operator that calls this

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


More information about the lldb-commits mailing list