[Lldb-commits] [lldb] [lldb-dap] Updating VariableDescription to use GetDescription() as a fallback. (PR #77026)

John Harrison via lldb-commits lldb-commits at lists.llvm.org
Thu Jan 11 17:28:29 PST 2024


================
@@ -1210,15 +1210,16 @@ bool SBValue::GetDescription(SBStream &description) {
 
   ValueLocker locker;
   lldb::ValueObjectSP value_sp(GetSP(locker));
-  if (value_sp) {
-    DumpValueObjectOptions options;
-    options.SetUseDynamicType(m_opaque_sp->GetUseDynamic());
-    options.SetUseSyntheticValue(m_opaque_sp->GetUseSynthetic());
-    value_sp->Dump(strm, options);
-  } else {
+  if (!value_sp) {
     strm.PutCString("No value");
----------------
ashgti wrote:

I wasn't sure if the `No value` output was an expected behavior on the SBValue, so I didn't want to change that behavior.

For example:

```
$ lldb
(lldb) script
Python Interactive Interpreter. To exit, type 'quit()', 'exit()' or Ctrl-D.
>>> lldb.SBValue() # __str__ > __repr__ > SBValue::GetDescription
No value
```

If I removed the `No value` string, then GetDescription would simply return "" or maybe None. I can update that if its appropriate, but I wasn't sure if that behavioral change was desired.

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


More information about the lldb-commits mailing list