[Lldb-commits] [lldb] [lldb] [disassembler] chore: add GetVariableAnnotations to SBInstruction api (PR #177676)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Thu Jan 29 03:27:00 PST 2026


================
@@ -348,3 +351,21 @@ bool SBInstruction::TestEmulation(lldb::SBStream &output_stream,
     return inst_sp->TestEmulation(output_stream.ref(), test_file);
   return false;
 }
+
+SBStructuredData SBInstruction::GetVariableAnnotations() {
+  LLDB_INSTRUMENT_VA(this);
+
+  SBStructuredData result;
+
+  if (!m_opaque_sp || !m_opaque_sp->IsValid())
+    return result;
+
+  lldb::InstructionSP inst_sp = m_opaque_sp->GetSP();
+  if (!inst_sp)
+    return result;
+
+  StructuredData::ArraySP array_sp = inst_sp->GetVariableAnnotations();
+  result.m_impl_up->SetObjectSP(array_sp);
----------------
JDevlieghere wrote:

I assume `SetObjectSP` handles `nullptr` correctly?

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


More information about the lldb-commits mailing list