[Lldb-commits] [PATCH] D136890: [lldb-vscode] Don't call SBValue.GetError after generating a summary.

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Oct 27 16:17:21 PDT 2022


clayborg added inline comments.


================
Comment at: lldb/tools/lldb-vscode/JSONUtils.cpp:143
+    llvm::StringRef value = v.GetValue();
+    llvm::StringRef summary = v.GetSummary();
+    llvm::StringRef type_name = v.GetType().GetDisplayTypeName();
----------------
yinghuitan wrote:
> Sorry for the late comment. The fix is fine but it depends on an important assumption that GetError() has to be called before GetSummary(). Can we add an explicit comment to document this so that future refactoring won't violate it again.
We shouldn't, we need to fix this API bug in LLDB itself. Just calling SBValue::GetError() shouldn't end up clearing the m_summary_str IMHO. This seems like the real bug. This is working around this. IF we add a comment, it won't end up being true when we fix the issue.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136890/new/

https://reviews.llvm.org/D136890



More information about the lldb-commits mailing list