diff options
Diffstat (limited to 'lldb/test')
-rw-r--r-- | lldb/test/API/commands/register/register/aarch64_mte_ctrl_register/TestMTECtrlRegister.py | 32 | ||||
-rw-r--r-- | lldb/test/API/functionalities/breakpoint/scripted_bkpt/TestScriptedResolver.py | 4 | ||||
-rw-r--r-- | lldb/test/API/functionalities/breakpoint/scripted_bkpt/resolver.py | 24 | ||||
-rw-r--r-- | lldb/test/API/functionalities/gdb_remote_client/TestGDBServerTargetXML.py | 11 | ||||
-rw-r--r-- | lldb/test/API/linux/aarch64/mte_core_file/TestAArch64LinuxMTEMemoryTagCoreFile.py | 11 | ||||
-rw-r--r-- | lldb/test/API/linux/aarch64/mte_core_file/core.mte | bin | 20608 -> 417920 bytes | |||
-rw-r--r-- | lldb/test/API/linux/aarch64/mte_core_file/core.nomte | bin | 20480 -> 32768 bytes | |||
-rw-r--r-- | lldb/test/API/linux/aarch64/mte_core_file/main.c | 2 |
8 files changed, 68 insertions, 16 deletions
diff --git a/lldb/test/API/commands/register/register/aarch64_mte_ctrl_register/TestMTECtrlRegister.py b/lldb/test/API/commands/register/register/aarch64_mte_ctrl_register/TestMTECtrlRegister.py index 2570f26..c003d87 100644 --- a/lldb/test/API/commands/register/register/aarch64_mte_ctrl_register/TestMTECtrlRegister.py +++ b/lldb/test/API/commands/register/register/aarch64_mte_ctrl_register/TestMTECtrlRegister.py @@ -34,29 +34,41 @@ class MTECtrlRegisterTestCase(TestBase): substrs=["stop reason = breakpoint 1."], ) - def check_mte_ctrl(async_err, sync_err): + has_store_only = self.isAArch64MTEStoreOnly() + + def check_mte_ctrl(async_err, sync_err, store_only): # Bit 0 = tagged addressing enabled # Bit 1 = synchronous faults # Bit 2 = asynchronous faults - value = "0x{:016x}".format((async_err << 2) | (sync_err << 1) | 1) + # Bit 19 = store only checking mode + value = "0x{:016x}".format( + (store_only << 19) | (async_err << 2) | (sync_err << 1) | 1 + ) expected = [value] if self.hasXMLSupport(): + fields = "(" + if has_store_only: + fields += f"STORE_ONLY = {store_only}, " + tfc_modes = ["NONE", "SYNC", "ASYNC", "ASYMM"] - expected.append( - f"(TAGS = 0, TCF = TCF_{tfc_modes[async_err << 1 | sync_err]}, TAGGED_ADDR_ENABLE = 1)".format( - async_err, sync_err - ) - ) + fields += f"TAGS = 0, TCF = TCF_{tfc_modes[async_err << 1 | sync_err]}, TAGGED_ADDR_ENABLE = 1)" + + expected.append(fields) self.expect("register read mte_ctrl", substrs=expected) # We start enabled with synchronous faults. - check_mte_ctrl(0, 1) + check_mte_ctrl(0, 1, 0) # Change to asynchronous faults. self.runCmd("register write mte_ctrl 5") - check_mte_ctrl(1, 0) + check_mte_ctrl(1, 0, 0) # This would return to synchronous faults if we did not restore the # previous value. self.expect("expression setup_mte()", substrs=["= 0"]) - check_mte_ctrl(1, 0) + check_mte_ctrl(1, 0, 0) + + # Store only checking requires FEAT_MTE_STORE_ONLY. + if has_store_only: + self.runCmd(f"register write mte_ctrl {1 | (1 << 19)}") + check_mte_ctrl(0, 0, 1) diff --git a/lldb/test/API/functionalities/breakpoint/scripted_bkpt/TestScriptedResolver.py b/lldb/test/API/functionalities/breakpoint/scripted_bkpt/TestScriptedResolver.py index 0a1003a..634940d 100644 --- a/lldb/test/API/functionalities/breakpoint/scripted_bkpt/TestScriptedResolver.py +++ b/lldb/test/API/functionalities/breakpoint/scripted_bkpt/TestScriptedResolver.py @@ -235,11 +235,13 @@ class TestScriptedResolver(TestBase): substrs=["2"], msg="Was only passed modules", ) - + print(f"Made first breakpoint: {bkpt}") + bkpt = None # Make a breakpoint that asks for modules, check that we didn't get any files: bkpt = target.BreakpointCreateFromScript( "resolver.ResolverModuleDepth", extra_args, module_list, file_list ) + print(f"Made Second breakpoint: {bkpt}") self.assertGreater( bkpt.GetNumLocations(), 0, "ResolverModuleDepth got no locations." ) diff --git a/lldb/test/API/functionalities/breakpoint/scripted_bkpt/resolver.py b/lldb/test/API/functionalities/breakpoint/scripted_bkpt/resolver.py index 8b91702..85c73401 100644 --- a/lldb/test/API/functionalities/breakpoint/scripted_bkpt/resolver.py +++ b/lldb/test/API/functionalities/breakpoint/scripted_bkpt/resolver.py @@ -13,6 +13,7 @@ class Resolver: Resolver.got_files = 0 def __callback__(self, sym_ctx): + print("Resolver callback called") sym_name = "not_a_real_function_name" sym_item = self.extra_args.GetValueForKey("symbol") if sym_item.IsValid(): @@ -34,9 +35,18 @@ class Resolver: return if sym_ctx.module.IsValid(): + print(f"Looking for {sym_name}") sym = sym_ctx.module.FindSymbol(sym_name, lldb.eSymbolTypeCode) if sym.IsValid(): + print(f"Adding location at {sym.GetStartAddress()} to {self.bkpt}") self.bkpt.AddLocation(sym.GetStartAddress()) + print(f"After addition: {self.bkpt}") + else: + print("Didn't find it, however...") + + print(f"GotFiles: {Resolver.got_files}") + for func in Resolver.func_list: + print(f"Function: func") def get_short_help(self): return "I am a python breakpoint resolver" @@ -46,17 +56,31 @@ class ResolverModuleDepth(Resolver): def __get_depth__(self): return lldb.eSearchDepthModule + def __callback__(self, sym_ctx): + print(f"About to call the Resolver callback for {self.bkpt}") + Resolver.__callback__(self, sym_ctx) + print("Called the callback for ResolverModuleDepth") + class ResolverCUDepth(Resolver): def __get_depth__(self): return lldb.eSearchDepthCompUnit + def __callback__(self, sym_ctx): + Resolver.__callback__(self, sym_ctx) + class ResolverFuncDepth(Resolver): def __get_depth__(self): return lldb.eSearchDepthFunction + def __callback__(self, sym_ctx): + Resolver.__callback__(self, sym_ctx) + class ResolverBadDepth(Resolver): def __get_depth__(self): return lldb.kLastSearchDepthKind + 1 + + def __callback__(self, sym_ctx): + Resolver.__callback__(self, sym_ctx) diff --git a/lldb/test/API/functionalities/gdb_remote_client/TestGDBServerTargetXML.py b/lldb/test/API/functionalities/gdb_remote_client/TestGDBServerTargetXML.py index 9a70f67..db5b5a0 100644 --- a/lldb/test/API/functionalities/gdb_remote_client/TestGDBServerTargetXML.py +++ b/lldb/test/API/functionalities/gdb_remote_client/TestGDBServerTargetXML.py @@ -692,6 +692,9 @@ class TestGDBServerTargetXML(GDBRemoteTestBase): "0102030405060708" # t4 "0102030405060708" # t5 "0102030405060708" # t6 + "6162636465666768" # pc + "0000C03F" # ft0 + "e07a6147a8a40940" # ft1 ) def qXferRead(self, obj, annex, offset, length): @@ -737,6 +740,10 @@ class TestGDBServerTargetXML(GDBRemoteTestBase): <reg name="t6" bitsize="64" type="int"/> <reg name="pc" bitsize="64" type="code_ptr"/> </feature> + <feature name='org.gnu.gdb.riscv.fpu'> + <reg name='ft0' bitsize='32' type='ieee_single'/> + <reg name='ft1' bitsize='64' type='ieee_double'/> + </feature> </target>""", False, ) @@ -799,6 +806,10 @@ class TestGDBServerTargetXML(GDBRemoteTestBase): self.match("register read x29", ["t4 = 0x0807060504030201"]) self.match("register read x30", ["t5 = 0x0807060504030201"]) self.match("register read x31", ["t6 = 0x0807060504030201"]) + self.match("register read pc", ["pc = 0x6867666564636261"]) + # test FPU registers + self.match("register read ft0", ["ft0 = 1.5"]) + self.match("register read ft1", ["ft1 = 3.2053990913985757"]) @skipIfXmlSupportMissing @skipIfRemote diff --git a/lldb/test/API/linux/aarch64/mte_core_file/TestAArch64LinuxMTEMemoryTagCoreFile.py b/lldb/test/API/linux/aarch64/mte_core_file/TestAArch64LinuxMTEMemoryTagCoreFile.py index bfdc822..825e1a4 100644 --- a/lldb/test/API/linux/aarch64/mte_core_file/TestAArch64LinuxMTEMemoryTagCoreFile.py +++ b/lldb/test/API/linux/aarch64/mte_core_file/TestAArch64LinuxMTEMemoryTagCoreFile.py @@ -10,8 +10,8 @@ from lldbsuite.test.lldbtest import * class AArch64LinuxMTEMemoryTagCoreFileTestCase(TestBase): NO_DEBUG_INFO_TESTCASE = True - MTE_BUF_ADDR = hex(0xFFFF82C74000) - BUF_ADDR = hex(0xFFFF82C73000) + MTE_BUF_ADDR = hex(0xFFFFA733B000) + BUF_ADDR = hex(0xFFFFA733A000) @skipIfLLVMTargetMissing("AArch64") def test_mte_tag_core_file_memory_region(self): @@ -215,7 +215,7 @@ class AArch64LinuxMTEMemoryTagCoreFileTestCase(TestBase): self.expect( "bt", substrs=[ - "* thread #1, name = 'a.out.mte', stop reason = SIGSEGV: sync tag check fault (fault address=0xffff82c74010)" + "* thread #1, name = 'a.out.mte', stop reason = SIGSEGV: sync tag check fault (fault address=0xffffa733b010)" ], ) @@ -231,12 +231,15 @@ class AArch64LinuxMTEMemoryTagCoreFileTestCase(TestBase): self.runCmd("target create --core core.mte") # The expected value is: # * Allowed tags value of 0xFFFF, shifted up by 3 resulting in 0x7fff8. + # * Bit 19 set to 0, which means that store only checking is disabled. # * Bit 1 set to enable synchronous tag faults. # * Bit 0 set to enable the tagged address ABI. expected = ["mte_ctrl = 0x000000000007fffb"] if self.hasXMLSupport(): - expected.append("(TAGS = 65535, TCF = TCF_SYNC, TAGGED_ADDR_ENABLE = 1)") + expected.append( + "(STORE_ONLY = 0, TAGS = 65535, TCF = TCF_SYNC, TAGGED_ADDR_ENABLE = 1)" + ) self.expect("register read mte_ctrl", substrs=expected) diff --git a/lldb/test/API/linux/aarch64/mte_core_file/core.mte b/lldb/test/API/linux/aarch64/mte_core_file/core.mte Binary files differindex 84a3266..188d06d 100644 --- a/lldb/test/API/linux/aarch64/mte_core_file/core.mte +++ b/lldb/test/API/linux/aarch64/mte_core_file/core.mte diff --git a/lldb/test/API/linux/aarch64/mte_core_file/core.nomte b/lldb/test/API/linux/aarch64/mte_core_file/core.nomte Binary files differindex 201f288..454ff83 100644 --- a/lldb/test/API/linux/aarch64/mte_core_file/core.nomte +++ b/lldb/test/API/linux/aarch64/mte_core_file/core.nomte diff --git a/lldb/test/API/linux/aarch64/mte_core_file/main.c b/lldb/test/API/linux/aarch64/mte_core_file/main.c index 6537edd..5974594 100644 --- a/lldb/test/API/linux/aarch64/mte_core_file/main.c +++ b/lldb/test/API/linux/aarch64/mte_core_file/main.c @@ -23,7 +23,7 @@ int main(int argc, char const *argv[]) { #ifdef NO_MTE - *(char *)(0) = 0; + __builtin_trap(); #endif if (prctl(PR_SET_TAGGED_ADDR_CTRL, |