[Lldb-commits] [lldb] 7667d80 - Revert "[lldb] Fix ppc64 detection in lldb"

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Tue May 3 06:28:50 PDT 2022


Author: David Spickett
Date: 2022-05-03T13:24:10Z
New Revision: 7667d805948e8049420b01c92f84c56528b42567

URL: https://github.com/llvm/llvm-project/commit/7667d805948e8049420b01c92f84c56528b42567
DIFF: https://github.com/llvm/llvm-project/commit/7667d805948e8049420b01c92f84c56528b42567.diff

LOG: Revert "[lldb] Fix ppc64 detection in lldb"

This reverts commit f114f009486816ed4b3bf984f0fbbb8fc80914f6.

Due to hitting an assert on our lldb bots:
https://lab.llvm.org/buildbot/#/builders/96/builds/22715

../llvm-project/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp:170:
virtual lldb::RegisterContextSP ThreadElfCore::CreateRegisterContextForFrame(
lldb_private::StackFrame *): Assertion `false && "Architecture or OS not supported"' failed.

Added: 
    

Modified: 
    lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
    lldb/source/Utility/ArchSpec.cpp
    lldb/test/API/functionalities/postmortem/elf-core/TestLinuxCore.py

Removed: 
    lldb/test/API/functionalities/postmortem/elf-core/linux-ppc64.core
    lldb/test/API/functionalities/postmortem/elf-core/linux-ppc64.out


################################################################################
diff  --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
index 28ccfbe3d6e64..684d070c54d26 100644
--- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -310,19 +310,9 @@ static uint32_t riscvVariantFromElfFlags(const elf::ELFHeader &header) {
   }
 }
 
-static uint32_t ppc64VariantFromElfFlags(const elf::ELFHeader &header) {
-  uint32_t endian = header.e_ident[EI_DATA];
-  if (endian == ELFDATA2LSB)
-    return ArchSpec::eCore_ppc64le_generic;
-  else
-    return ArchSpec::eCore_ppc64_generic;
-}
-
 static uint32_t subTypeFromElfHeader(const elf::ELFHeader &header) {
   if (header.e_machine == llvm::ELF::EM_MIPS)
     return mipsVariantFromElfFlags(header);
-  else if (header.e_machine == llvm::ELF::EM_PPC64)
-    return ppc64VariantFromElfFlags(header);
   else if (header.e_machine == llvm::ELF::EM_RISCV)
     return riscvVariantFromElfFlags(header);
 

diff  --git a/lldb/source/Utility/ArchSpec.cpp b/lldb/source/Utility/ArchSpec.cpp
index c6feacfc7c1e6..963005b5cdfa7 100644
--- a/lldb/source/Utility/ArchSpec.cpp
+++ b/lldb/source/Utility/ArchSpec.cpp
@@ -358,10 +358,10 @@ static const ArchDefinitionEntry g_elf_arch_entries[] = {
      0xFFFFFFFFu, 0xFFFFFFFFu}, // Intel MCU // FIXME: is this correct?
     {ArchSpec::eCore_ppc_generic, llvm::ELF::EM_PPC, LLDB_INVALID_CPUTYPE,
      0xFFFFFFFFu, 0xFFFFFFFFu}, // PowerPC
-    {ArchSpec::eCore_ppc64le_generic, llvm::ELF::EM_PPC64,
-     ArchSpec::eCore_ppc64le_generic, 0xFFFFFFFFu, 0xFFFFFFFFu}, // PowerPC64le
-    {ArchSpec::eCore_ppc64_generic, llvm::ELF::EM_PPC64,
-     ArchSpec::eCore_ppc64_generic, 0xFFFFFFFFu, 0xFFFFFFFFu}, // PowerPC64
+    {ArchSpec::eCore_ppc64le_generic, llvm::ELF::EM_PPC64, LLDB_INVALID_CPUTYPE,
+     0xFFFFFFFFu, 0xFFFFFFFFu}, // PowerPC64le
+    {ArchSpec::eCore_ppc64_generic, llvm::ELF::EM_PPC64, LLDB_INVALID_CPUTYPE,
+     0xFFFFFFFFu, 0xFFFFFFFFu}, // PowerPC64
     {ArchSpec::eCore_arm_generic, llvm::ELF::EM_ARM, LLDB_INVALID_CPUTYPE,
      0xFFFFFFFFu, 0xFFFFFFFFu}, // ARM
     {ArchSpec::eCore_arm_aarch64, llvm::ELF::EM_AARCH64, LLDB_INVALID_CPUTYPE,
@@ -400,8 +400,8 @@ static const ArchDefinitionEntry g_elf_arch_entries[] = {
      LLDB_INVALID_CPUTYPE, 0xFFFFFFFFu, 0xFFFFFFFFu}, // HEXAGON
     {ArchSpec::eCore_arc, llvm::ELF::EM_ARC_COMPACT2, LLDB_INVALID_CPUTYPE,
      0xFFFFFFFFu, 0xFFFFFFFFu}, // ARC
-    {ArchSpec::eCore_avr, llvm::ELF::EM_AVR, LLDB_INVALID_CPUTYPE, 0xFFFFFFFFu,
-     0xFFFFFFFFu}, // AVR
+    {ArchSpec::eCore_avr, llvm::ELF::EM_AVR, LLDB_INVALID_CPUTYPE,
+     0xFFFFFFFFu, 0xFFFFFFFFu}, // AVR
     {ArchSpec::eCore_riscv32, llvm::ELF::EM_RISCV,
      ArchSpec::eRISCVSubType_riscv32, 0xFFFFFFFFu, 0xFFFFFFFFu}, // riscv32
     {ArchSpec::eCore_riscv64, llvm::ELF::EM_RISCV,

diff  --git a/lldb/test/API/functionalities/postmortem/elf-core/TestLinuxCore.py b/lldb/test/API/functionalities/postmortem/elf-core/TestLinuxCore.py
index 14da7f6051e62..d1948b6752753 100644
--- a/lldb/test/API/functionalities/postmortem/elf-core/TestLinuxCore.py
+++ b/lldb/test/API/functionalities/postmortem/elf-core/TestLinuxCore.py
@@ -24,14 +24,12 @@ class LinuxCoreTestCase(TestBase):
     _i386_pid = 32306
     _x86_64_pid = 32259
     _s390x_pid = 1045
-    _ppc64_pid = 28146
     _ppc64le_pid = 28147
 
     _aarch64_regions = 4
     _i386_regions = 4
     _x86_64_regions = 5
     _s390x_regions = 2
-    _ppc64_regions = 2
     _ppc64le_regions = 2
 
     @skipIfLLVMTargetMissing("AArch64")
@@ -51,12 +49,6 @@ def test_ppc64le(self):
         self.do_test("linux-ppc64le", self._ppc64le_pid, self._ppc64le_regions,
                      "linux-ppc64le.ou")
 
-    @skipIfLLVMTargetMissing("PowerPC")
-    def test_ppc64(self):
-        """Test that lldb can read the process information from an ppc64 linux core file."""
-        self.do_test("linux-ppc64", self._ppc64_pid, self._ppc64_regions,
-                     "linux-ppc64.ou")
-
     @skipIfLLVMTargetMissing("X86")
     def test_x86_64(self):
         """Test that lldb can read the process information from an x86_64 linux core file."""

diff  --git a/lldb/test/API/functionalities/postmortem/elf-core/linux-ppc64.core b/lldb/test/API/functionalities/postmortem/elf-core/linux-ppc64.core
deleted file mode 100644
index fb776e0c9ec33..0000000000000
Binary files a/lldb/test/API/functionalities/postmortem/elf-core/linux-ppc64.core and /dev/null 
diff er

diff  --git a/lldb/test/API/functionalities/postmortem/elf-core/linux-ppc64.out b/lldb/test/API/functionalities/postmortem/elf-core/linux-ppc64.out
deleted file mode 100755
index c1c0871859ff7..0000000000000
Binary files a/lldb/test/API/functionalities/postmortem/elf-core/linux-ppc64.out and /dev/null 
diff er


        


More information about the lldb-commits mailing list