[Lldb-commits] [lldb] [lldb] Set return status to Failed when Python command raises uncaught exception (PR #113996)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Mon Dec 2 02:30:08 PST 2024


================
@@ -642,6 +649,16 @@ bool lldb_private::python::SWIGBridge::LLDBSwigPythonCallCommandObject(
   pfunc(SWIGBridge::ToSWIGWrapper(std::move(debugger)), PythonString(args),
         SWIGBridge::ToSWIGWrapper(exe_ctx_ref_sp), cmd_retobj_arg.obj());
 
+  if (PyErr_Occurred()) {
+    py_err_cleaner.~PyErr_Cleaner();
----------------
labath wrote:

Fair enough. How about then making a new function (`Expected<PythonObject> PythonCallable::Call(/*something*/)` which does the right thing, and then porting callers you care about to the new API?

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


More information about the lldb-commits mailing list