[Lldb-commits] [PATCH] D135648: [lldb] Add matching based on Python callbacks for data formatters.

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Oct 14 04:11:39 PDT 2022


labath added inline comments.


================
Comment at: lldb/source/Commands/CommandObjectType.cpp:2306
   if (type == eRegularSynth) {
-    if (category->AnyMatches(type_name, eFormatCategoryItemFilter, false)) {
+    // TODO: Get a suitable type object for type_name so we can create a
+    // complete FormattersMatchCandidate.
----------------
Is that even possible? Like, this command can be run before any binaries/debug info is loaded, right? Maybe we should just call that WAI?


================
Comment at: lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp:2159-2167
+  // Default to false in case of error while running the callback.
+  bool result = false;
+  {
+    Locker py_lock(this,
+                   Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
+    result = LLDBSwigPythonFormatterCallbackFunction(
+        python_function_name, m_dictionary_name.c_str(), type_impl_sp);
----------------
I think we already had code like this somewhere, but these two versions are completely equivalent.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135648



More information about the lldb-commits mailing list