diff options
author | Greg Clayton <gclayton@apple.com> | 2019-03-06 18:04:10 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2019-03-06 18:04:10 +0000 |
commit | 6795eb388442469af74245545b445d9505fdc9d8 (patch) | |
tree | 019daf67b373f4acd9ed93cf33e927ffba206c74 /lldb/packages/Python/lldbsuite/test | |
parent | 641d0b8cee4529ed2dca697cb76de6ce4d800871 (diff) | |
download | bcm5719-llvm-6795eb388442469af74245545b445d9505fdc9d8.tar.gz bcm5719-llvm-6795eb388442469af74245545b445d9505fdc9d8.zip |
Fix core files for 32 bit architectures that are supported in ProcessELFCore.cpp
Core files need to know the size of the PRSTATUS header so that we can grab the register values that follow it. The code that figure out this size was using a hard coded list of architecture cores instead of relying on 32 or 64 bit for most cores.
The fix here fixes core files for 32 bit ARM. Prior to this the PRSTATUS header size was being returned as zero and the register values were being taken from the first bytes of the PRSTATUS struct (signo, etc).
Differential Revision: https://reviews.llvm.org/D58985
llvm-svn: 355526
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
2 files changed, 29 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/TestLinuxCore.py b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/TestLinuxCore.py index e965817a820..c2746bf1a80 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/TestLinuxCore.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/TestLinuxCore.py @@ -217,6 +217,35 @@ class LinuxCoreTestCase(TestBase): self.dbg.DeleteTarget(target) + @skipIf(triple='^mips') + @skipIfLLVMTargetMissing("ARM") + def test_arm_core(self): + # check 32 bit ARM core file + target = self.dbg.CreateTarget(None) + self.assertTrue(target, VALID_TARGET) + process = target.LoadCore("linux-arm.core") + + values = {} + values["r0"] = "0x00000000" + values["r1"] = "0x00000001" + values["r2"] = "0x00000002" + values["r3"] = "0x00000003" + values["r4"] = "0x00000004" + values["r5"] = "0x00000005" + values["r6"] = "0x00000006" + values["r7"] = "0x00000007" + values["r8"] = "0x00000008" + values["r9"] = "0x00000009" + values["r10"] = "0x0000000a" + values["r11"] = "0x0000000b" + values["r12"] = "0x0000000c" + values["sp"] = "0x0000000d" + values["lr"] = "0x0000000e" + values["pc"] = "0x0000000f" + values["cpsr"] = "0x00000010" + for regname, value in values.items(): + self.expect("register read {}".format(regname), substrs=["{} = {}".format(regname, value)]) + def check_memory_regions(self, process, region_count): region_list = process.GetMemoryRegions() self.assertEqual(region_list.GetSize(), region_count) diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/linux-arm.core b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/linux-arm.core Binary files differnew file mode 100644 index 00000000000..a919a9d6ae6 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/linux-arm.core |