c++: LLDB + Python - how to print a std::string in the python script
<p>I'm experimenting with LLDB + python in order to get better printing of json strings to a file. For a given std::string variable (call it buffer), I've tried the following within a python breakpoint script in order to pretty print to a file - all have been unsuccessful:</p>

<pre><code>json.dump(frame.FindVariable("buffer"), handle, indent=4)
# ^^^^ error that SBValue* is not serializable
json.dump(frame.FindVariable("buffer").GetValue(), handle, indent=4)
# ^^^^ emits null
json.dump(frame.EvaluateExpression("buffer.c_str()"), handle, indent=4)
# ^^^^ error that SBValue* is not serializable
json.dump(frame.EvaluateExpression("buffer.c_str()").GetValue(), handle, indent=4)
# ^^^^ prints an address...not useful
json.dump(frame.EvaluateExpression("buffer.c_str()").GetData(), handle, indent=4)
# ^^^^ error that SBValue* is not serializable
</code></pre>

<p>Does anyone know what magic sauce will allow me to turn a std::string frame variable into a python string for passing to json.dump() ?</p>