[Lldb-commits] [lldb] Add `SBModule.SetLocateDwoCallback` (PR #69517)

Alex Langford via lldb-commits lldb-commits at lists.llvm.org
Thu Oct 19 09:42:33 PDT 2023


================
@@ -696,3 +696,55 @@ template <> bool SetNumberFromPyObject<double>(double &number, PyObject *obj) {
   $1 = $input == Py_None;
   $1 = $1 || PyCallable_Check(reinterpret_cast<PyObject *>($input));
 }
+
+// For lldb::SBModuleLocateDwoCallback
+// The `baton` is the actual Python function passed, and we invoke the `baton` via a SWIG function.
+%typemap(in) (lldb::SBModuleLocateDwoCallback callback,
+              void *baton) {
+  if (!($input == Py_None ||
+        PyCallable_Check(reinterpret_cast<PyObject *>($input)))) {
----------------
bulbazord wrote:

IMO it's simpler and easier to read if you apply De Morgan's here.

```
if ($input != Py_None && !PyCallable_Check(reinterpret_cast<PyObject *>($input))) {
```

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


More information about the lldb-commits mailing list