[Lldb-commits] [PATCH] D129614: [lldb/crashlog] Surface error using SBCommandReturnObject argument

Med Ismail Bennani via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Jul 28 15:54:13 PDT 2022


mib marked 2 inline comments as done.
mib added inline comments.


================
Comment at: lldb/examples/python/crashlog.py:1012-1015
+    def error(message, sb_error=lldb.SBError()):
+        nonlocal result
+        result.SetError(sb_error, "error: %s" % message)
+        return
----------------
JDevlieghere wrote:
> Can we do this with a try-catch + an exception?
@JDevlieghere As mentioned on D129611, if we raise an exception we won't be able to surface the error to lldb or even to IDEs. I think it's better to use the `SBCommandReturnObject`

@kastiglione true! I'll remove the "error: " prefix, but I think it's reasonable to keep this helper function to avoid code duplication.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D129614



More information about the lldb-commits mailing list