[Lldb-commits] [lldb] 83a55c6 - minidump: Rename some architecture constants

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Wed Oct 30 06:47:21 PDT 2019


Author: Pavel Labath
Date: 2019-10-30T14:46:00+01:00
New Revision: 83a55c6a575806eec78062dfe128c095c26ab5e2

URL: https://github.com/llvm/llvm-project/commit/83a55c6a575806eec78062dfe128c095c26ab5e2
DIFF: https://github.com/llvm/llvm-project/commit/83a55c6a575806eec78062dfe128c095c26ab5e2.diff

LOG: minidump: Rename some architecture constants

The architecture enum contains two kinds of contstants: the "official" ones
defined by Microsoft, and unofficial constants added by breakpad to cover the
architectures not described by the first ones.

Up until now, there was no big need to differentiate between the two. However,
now that Microsoft has defined
https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/ns-sysinfoapi-system_info
a constant for ARM64, we have a name clash.

This patch renames all breakpad-defined constants with to include the prefix
"BP_". This frees up the name "ARM64", which I'll re-introduce with the new
"official" value in a follow-up patch.

Reviewers: amccarth, clayborg

Subscribers: lldb-commits, llvm-commits

Differential Revision: https://reviews.llvm.org/D69285

Added: 
    

Modified: 
    lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/arm64-macos.yaml
    lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/regions-linux-map.yaml
    lldb/source/Plugins/Process/minidump/MinidumpParser.cpp
    lldb/test/Shell/Minidump/dump-all.test
    lldb/test/Shell/Minidump/fb-dump.test
    llvm/include/llvm/BinaryFormat/MinidumpConstants.def
    llvm/lib/ObjectYAML/MinidumpYAML.cpp
    llvm/test/tools/obj2yaml/basic-minidump.yaml
    llvm/unittests/ObjectYAML/MinidumpYAMLTest.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/arm64-macos.yaml b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/arm64-macos.yaml
index 9114424e4702..70817f14da5e 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/arm64-macos.yaml
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/arm64-macos.yaml
@@ -1,7 +1,7 @@
 --- !minidump
 Streams:         
   - Type:            SystemInfo
-    Processor Arch:  ARM64
+    Processor Arch:  BP_ARM64
     Platform ID:     MacOSX
     CSD Version:     '15E216'
     CPU:             

diff  --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/regions-linux-map.yaml b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/regions-linux-map.yaml
index 3c0961eba077..680ad623361e 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/regions-linux-map.yaml
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/regions-linux-map.yaml
@@ -1,7 +1,7 @@
 --- !minidump
 Streams:         
   - Type:            SystemInfo
-    Processor Arch:  ARM64
+    Processor Arch:  BP_ARM64
     Platform ID:     Linux
     CSD Version:     '15E216'
     CPU:             

diff  --git a/lldb/source/Plugins/Process/minidump/MinidumpParser.cpp b/lldb/source/Plugins/Process/minidump/MinidumpParser.cpp
index 47cfd5bd2730..99717e7fe34a 100644
--- a/lldb/source/Plugins/Process/minidump/MinidumpParser.cpp
+++ b/lldb/source/Plugins/Process/minidump/MinidumpParser.cpp
@@ -173,7 +173,7 @@ ArchSpec MinidumpParser::GetArchitecture() {
   case ProcessorArchitecture::ARM:
     triple.setArch(llvm::Triple::ArchType::arm);
     break;
-  case ProcessorArchitecture::ARM64:
+  case ProcessorArchitecture::BP_ARM64:
     triple.setArch(llvm::Triple::ArchType::aarch64);
     break;
   default:

diff  --git a/lldb/test/Shell/Minidump/dump-all.test b/lldb/test/Shell/Minidump/dump-all.test
index 92f2be24e173..507c1688bb8b 100644
--- a/lldb/test/Shell/Minidump/dump-all.test
+++ b/lldb/test/Shell/Minidump/dump-all.test
@@ -57,7 +57,7 @@
 --- !minidump
 Streams:         
   - Type:            SystemInfo
-    Processor Arch:  ARM64
+    Processor Arch:  BP_ARM64
     Platform ID:     Linux
     CSD Version:     '15E216'
     CPU:             

diff  --git a/lldb/test/Shell/Minidump/fb-dump.test b/lldb/test/Shell/Minidump/fb-dump.test
index 1cd777c6d718..319db2f3d368 100644
--- a/lldb/test/Shell/Minidump/fb-dump.test
+++ b/lldb/test/Shell/Minidump/fb-dump.test
@@ -61,7 +61,7 @@
 --- !minidump
 Streams:         
   - Type:            SystemInfo
-    Processor Arch:  ARM64
+    Processor Arch:  BP_ARM64
     Platform ID:     Linux
     CSD Version:     '15E216'
     CPU:             

diff  --git a/llvm/include/llvm/BinaryFormat/MinidumpConstants.def b/llvm/include/llvm/BinaryFormat/MinidumpConstants.def
index aeef399af7a4..c04a10d30d4c 100644
--- a/llvm/include/llvm/BinaryFormat/MinidumpConstants.def
+++ b/llvm/include/llvm/BinaryFormat/MinidumpConstants.def
@@ -85,21 +85,21 @@ HANDLE_MDMP_STREAM_TYPE(0xFACECCCC, FacebookAppStateLog)
 HANDLE_MDMP_STREAM_TYPE(0xFACEDEAD, FacebookAbortReason)
 HANDLE_MDMP_STREAM_TYPE(0xFACEE000, FacebookThreadName)
 
-HANDLE_MDMP_ARCH(0x0000, X86)      // PROCESSOR_ARCHITECTURE_INTEL
-HANDLE_MDMP_ARCH(0x0001, MIPS)     // PROCESSOR_ARCHITECTURE_MIPS
-HANDLE_MDMP_ARCH(0x0002, Alpha)    // PROCESSOR_ARCHITECTURE_ALPHA
-HANDLE_MDMP_ARCH(0x0003, PPC)      // PROCESSOR_ARCHITECTURE_PPC
-HANDLE_MDMP_ARCH(0x0004, SHX)      // PROCESSOR_ARCHITECTURE_SHX (Super-H)
-HANDLE_MDMP_ARCH(0x0005, ARM)      // PROCESSOR_ARCHITECTURE_ARM
-HANDLE_MDMP_ARCH(0x0006, IA64)     // PROCESSOR_ARCHITECTURE_IA64
-HANDLE_MDMP_ARCH(0x0007, Alpha64)  // PROCESSOR_ARCHITECTURE_ALPHA64
-HANDLE_MDMP_ARCH(0x0008, MSIL)     // PROCESSOR_ARCHITECTURE_MSIL
-HANDLE_MDMP_ARCH(0x0009, AMD64)    // PROCESSOR_ARCHITECTURE_AMD64
-HANDLE_MDMP_ARCH(0x000a, X86Win64) // PROCESSOR_ARCHITECTURE_IA32_ON_WIN64
-HANDLE_MDMP_ARCH(0x8001, SPARC)    // Breakpad-defined value for SPARC
-HANDLE_MDMP_ARCH(0x8002, PPC64)    // Breakpad-defined value for PPC64
-HANDLE_MDMP_ARCH(0x8003, ARM64)    // Breakpad-defined value for ARM64
-HANDLE_MDMP_ARCH(0x8004, MIPS64)   // Breakpad-defined value for MIPS64
+HANDLE_MDMP_ARCH(0x0000, X86)       // PROCESSOR_ARCHITECTURE_INTEL
+HANDLE_MDMP_ARCH(0x0001, MIPS)      // PROCESSOR_ARCHITECTURE_MIPS
+HANDLE_MDMP_ARCH(0x0002, Alpha)     // PROCESSOR_ARCHITECTURE_ALPHA
+HANDLE_MDMP_ARCH(0x0003, PPC)       // PROCESSOR_ARCHITECTURE_PPC
+HANDLE_MDMP_ARCH(0x0004, SHX)       // PROCESSOR_ARCHITECTURE_SHX (Super-H)
+HANDLE_MDMP_ARCH(0x0005, ARM)       // PROCESSOR_ARCHITECTURE_ARM
+HANDLE_MDMP_ARCH(0x0006, IA64)      // PROCESSOR_ARCHITECTURE_IA64
+HANDLE_MDMP_ARCH(0x0007, Alpha64)   // PROCESSOR_ARCHITECTURE_ALPHA64
+HANDLE_MDMP_ARCH(0x0008, MSIL)      // PROCESSOR_ARCHITECTURE_MSIL
+HANDLE_MDMP_ARCH(0x0009, AMD64)     // PROCESSOR_ARCHITECTURE_AMD64
+HANDLE_MDMP_ARCH(0x000a, X86Win64)  // PROCESSOR_ARCHITECTURE_IA32_ON_WIN64
+HANDLE_MDMP_ARCH(0x8001, BP_SPARC)  // Breakpad-defined value for SPARC
+HANDLE_MDMP_ARCH(0x8002, BP_PPC64)  // Breakpad-defined value for PPC64
+HANDLE_MDMP_ARCH(0x8003, BP_ARM64)  // Breakpad-defined value for ARM64
+HANDLE_MDMP_ARCH(0x8004, BP_MIPS64) // Breakpad-defined value for MIPS64
 
 HANDLE_MDMP_PLATFORM(0x0000, Win32S) // Win32 on Windows 3.1
 HANDLE_MDMP_PLATFORM(0x0001, Win32Windows) // Windows 95-98-Me

diff  --git a/llvm/lib/ObjectYAML/MinidumpYAML.cpp b/llvm/lib/ObjectYAML/MinidumpYAML.cpp
index 21b2a4d78629..aa7382247a0a 100644
--- a/llvm/lib/ObjectYAML/MinidumpYAML.cpp
+++ b/llvm/lib/ObjectYAML/MinidumpYAML.cpp
@@ -336,7 +336,7 @@ static void streamMapping(yaml::IO &IO, SystemInfoStream &Stream) {
     IO.mapOptional("CPU", Info.CPU.X86);
     break;
   case ProcessorArchitecture::ARM:
-  case ProcessorArchitecture::ARM64:
+  case ProcessorArchitecture::BP_ARM64:
     IO.mapOptional("CPU", Info.CPU.Arm);
     break;
   default:

diff  --git a/llvm/test/tools/obj2yaml/basic-minidump.yaml b/llvm/test/tools/obj2yaml/basic-minidump.yaml
index 9797e1200e37..0ed887b5a813 100644
--- a/llvm/test/tools/obj2yaml/basic-minidump.yaml
+++ b/llvm/test/tools/obj2yaml/basic-minidump.yaml
@@ -3,7 +3,7 @@
 --- !minidump
 Streams:
   - Type:            SystemInfo
-    Processor Arch:  ARM64
+    Processor Arch:  BP_ARM64
     Platform ID:     Linux
     CSD Version:     Linux 3.13.0-91-generic
     CPU:
@@ -92,7 +92,7 @@ Streams:
 # CHECK:      --- !minidump
 # CHECK-NEXT: Streams:
 # CHECK-NEXT:   - Type:            SystemInfo
-# CHECK-NEXT:     Processor Arch:  ARM64
+# CHECK-NEXT:     Processor Arch:  BP_ARM64
 # CHECK-NEXT:     Platform ID:     Linux
 # CHECK-NEXT:     CSD Version:     Linux 3.13.0-91-generic
 # CHECK-NEXT:     CPU:

diff  --git a/llvm/unittests/ObjectYAML/MinidumpYAMLTest.cpp b/llvm/unittests/ObjectYAML/MinidumpYAMLTest.cpp
index a3c9e7ef18ed..ca7fff13d0a7 100644
--- a/llvm/unittests/ObjectYAML/MinidumpYAMLTest.cpp
+++ b/llvm/unittests/ObjectYAML/MinidumpYAMLTest.cpp
@@ -33,7 +33,7 @@ TEST(MinidumpYAML, Basic) {
 --- !minidump
 Streams:
   - Type:            SystemInfo
-    Processor Arch:  ARM64
+    Processor Arch:  BP_ARM64
     Platform ID:     Linux
     CPU:
       CPUID:           0x05060708
@@ -53,7 +53,7 @@ TEST(MinidumpYAML, Basic) {
   auto ExpectedSysInfo = File.getSystemInfo();
   ASSERT_THAT_EXPECTED(ExpectedSysInfo, Succeeded());
   const SystemInfo &SysInfo = *ExpectedSysInfo;
-  EXPECT_EQ(ProcessorArchitecture::ARM64, SysInfo.ProcessorArch);
+  EXPECT_EQ(ProcessorArchitecture::BP_ARM64, SysInfo.ProcessorArch);
   EXPECT_EQ(OSPlatform::Linux, SysInfo.PlatformId);
   EXPECT_EQ(0x05060708u, SysInfo.CPU.Arm.CPUID);
 


        


More information about the lldb-commits mailing list