[Lldb-commits] [PATCH] D146152: Add __lldb_init_module_with_target for use when sourcing modules for a target

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Mar 15 10:25:40 PDT 2023


JDevlieghere added a comment.

Thanks for adding this, Jim. This is one of those things that comes up one in a while when it confuses our users. It's great we'll be able to help them adopt this.



================
Comment at: lldb/bindings/python/python-wrapper.swig:1031-1048
+  // First call the target initializer:
+  if (target) {
+    python_function_name_string += ".__lldb_init_module_with_target";
+    python_function_name = python_function_name_string.c_str();
+
+    auto pfunc = PythonObject::ResolveNameWithDictionary<PythonCallable>(
+      python_function_name, dict);
----------------
I'm surprised we might call both. The way I expected this to work is that if `__lldb_init_module_with_target` is defined, that's what we use if wee have a target and otherwise fall back to `__lldb_init_module` assuming it's defined.

What's the benefit of calling both? Do you expect the implementation to be different? Or do you think it's more likely that the implementations will be similar, just one having access to the target? 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146152



More information about the lldb-commits mailing list