Don't report memory return values on MacOS_arm64 of SysV_arm64 ABI's.

They don't require that the memory return address be restored prior to
function exit, so there's no guarantee the value is correct.  It's better
to return nothing that something that's not accurate.

Differential Revision: https://reviews.llvm.org/D121348
This commit is contained in:
Jim Ingham
2022-03-14 14:37:38 -07:00
parent 36fe3f13a9
commit 33f9fc77d1
9 changed files with 80 additions and 14 deletions

View File

@@ -112,6 +112,29 @@ class TargetAPITestCase(TestBase):
self.assertIsNotNone(data_section2)
self.assertEqual(data_section.name, data_section2.name)
def test_get_ABIName(self):
d = {'EXE': 'b.out'}
self.build(dictionary=d)
self.setTearDownCleanup(dictionary=d)
target = self.create_simple_target('b.out')
abi_pre_launch = target.GetABIName()
self.assertTrue(len(abi_pre_launch) != 0, "Got an ABI string")
breakpoint = target.BreakpointCreateByLocation(
"main.c", self.line_main)
self.assertTrue(breakpoint, VALID_BREAKPOINT)
# Put debugger into synchronous mode so when we target.LaunchSimple returns
# it will guaranteed to be at the breakpoint
self.dbg.SetAsync(False)
# Launch the process, and do not stop at the entry point.
process = target.LaunchSimple(
None, None, self.get_process_working_directory())
abi_after_launch = target.GetABIName()
self.assertEqual(abi_pre_launch, abi_after_launch, "ABI's match before and during run")
def test_read_memory(self):
d = {'EXE': 'b.out'}
self.build(dictionary=d)