[Lldb-commits] [lldb] [lldb] Implement bytecode based SyntheticChildren (PR #179832)

Adrian Prantl via lldb-commits lldb-commits at lists.llvm.org
Wed Feb 4 17:49:34 PST 2026


================
@@ -251,3 +253,122 @@ std::string ScriptedSyntheticChildren::GetDescription() {
 
   return std::string(sstr.GetString());
 }
+
+BytecodeSyntheticChildren::FrontEnd::FrontEnd(
+    ValueObject &backend,
+    FormatterBytecode::SyntheticProviderDefinition &definition)
+    : SyntheticChildrenFrontEnd(backend), m_definition(definition) {
+  FormatterBytecode::DataStack data(backend.GetSP());
+  if (!m_definition.init) {
+    m_self = std::move(data);
+    return;
+  }
+
+  FormatterBytecode::ControlStack control = {m_definition.init->getBuffer()};
+  auto error =
+      FormatterBytecode::Interpret(control, data, FormatterBytecode::sig_init);
+
+  if (!error && data.size() > 0)
+    m_self = std::move(data);
+}
+
+lldb::ChildCacheState BytecodeSyntheticChildren::FrontEnd::Update() {
+  if (!m_definition.update)
+    return ChildCacheState::eRefetch;
+
+  FormatterBytecode::ControlStack control = {m_definition.update->getBuffer()};
+  FormatterBytecode::DataStack data = m_self;
+  auto error = FormatterBytecode::Interpret(control, data,
----------------
adrian-prantl wrote:

Seems like it is, actually. You need to at least LLDB_LOG_ERROR() here. Otherwise this is an assert.

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


More information about the lldb-commits mailing list