This is an archive of the discontinued LLVM Phabricator instance.

Fix SBError::SetErrorToGenericError
ClosedPublic

Authored by werat on Oct 26 2020, 5:09 AM.

Details

Summary

SBError::SetErrorToGenericError should call Status::SetErrorToGenericError, not Status::SetErrorToErrno.

Diff Detail

Event Timeline

werat created this revision.Oct 26 2020, 5:09 AM
werat requested review of this revision.Oct 26 2020, 5:09 AM
teemperor requested changes to this revision.Oct 26 2020, 5:30 AM

Could you add a test for this? This should be enough:

diff --git a/lldb/test/API/python_api/sberror/TestSBError.py b/lldb/test/API/python_api/sberror/TestSBError.py
new file mode 100644
index 000000000000..91d5a334bff2
--- /dev/null
+++ b/lldb/test/API/python_api/sberror/TestSBError.py
@@ -0,0 +1,11 @@
+from lldbsuite.test.lldbtest import *
+
+class TestSBError(TestBase):
+
+    mydir = TestBase.compute_mydir(__file__)
+    NO_DEBUG_INFO_TESTCASE = True
+
+    def test_generic_error(self):
+      error = lldb.SBError()
+      error.SetErrorToGenericError()
+      self.assertEqual(error.GetType(), lldb.eErrorTypeGeneric)

Otherwise this LGTM, thanks for the patch!

This revision now requires changes to proceed.Oct 26 2020, 5:30 AM
werat updated this revision to Diff 300652.Oct 26 2020, 6:41 AM

Add a test case.

teemperor accepted this revision.Oct 26 2020, 6:43 AM

Thanks! I assume you don't have commit access, so I'll land this for you.

This revision is now accepted and ready to land.Oct 26 2020, 6:43 AM
werat added a comment.Oct 26 2020, 6:43 AM

Thanks! Yeah, I don't have commit access, thanks for landing it for me.

This revision was automatically updated to reflect the committed changes.