Fix SBError::SetErrorToGenericError

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

Reviewed By: teemperor

Differential Revision: https://reviews.llvm.org/D90151
This commit is contained in:
Andy Yankovsky 2020-10-26 15:31:35 +01:00 committed by Raphael Isemann
parent 532f3bec3e
commit 206e8d8905
2 changed files with 14 additions and 1 deletions

View File

@ -118,7 +118,7 @@ void SBError::SetErrorToGenericError() {
LLDB_RECORD_METHOD_NO_ARGS(void, SBError, SetErrorToGenericError);
CreateIfNeeded();
m_opaque_up->SetErrorToErrno();
m_opaque_up->SetErrorToGenericError();
}
void SBError::SetErrorString(const char *err_str) {

View File

@ -0,0 +1,13 @@
"""Test the SBError APIs."""
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)