summaryrefslogtreecommitdiffstats
path: root/llvm/test/DebugInfo/PDB
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-08-04 20:02:38 +0000
committerZachary Turner <zturner@google.com>2017-08-04 20:02:38 +0000
commitfb1cd5090ca507c7d7472eae57398697a38ba0da (patch)
treedae903d09cd5d07e7e0eb5412630a259085af7e1 /llvm/test/DebugInfo/PDB
parent785cec91a4545d239220b9c70e2fae1e99fc4483 (diff)
downloadbcm5719-llvm-fb1cd5090ca507c7d7472eae57398697a38ba0da.tar.gz
bcm5719-llvm-fb1cd5090ca507c7d7472eae57398697a38ba0da.zip
[llvm-pdbutil] Dump image section headers.
Image section headers are stored in the DBI stream, but we had no way to dump them. This patch adds dumping support, along with some tests that LLD actually dumps them correctly. Differential Revision: https://reviews.llvm.org/D36332 llvm-svn: 310107
Diffstat (limited to 'llvm/test/DebugInfo/PDB')
-rw-r--r--llvm/test/DebugInfo/PDB/pdbdump-headers.test10
-rw-r--r--llvm/test/DebugInfo/PDB/section-headers.test66
2 files changed, 71 insertions, 5 deletions
diff --git a/llvm/test/DebugInfo/PDB/pdbdump-headers.test b/llvm/test/DebugInfo/PDB/pdbdump-headers.test
index bbf500233b2..92bb9b8087e 100644
--- a/llvm/test/DebugInfo/PDB/pdbdump-headers.test
+++ b/llvm/test/DebugInfo/PDB/pdbdump-headers.test
@@ -534,19 +534,19 @@ ALL-NEXT: IMAGE_SCN_CNT_UNINITIALIZED_DATA | IMAGE_SCN_ALIGN_4BYTES | IM
ALL-NEXT: IMAGE_SCN_MEM_WRITE
ALL: Section Map
ALL-NEXT: ============================================================
-ALL-NEXT: Section 0000 | ovl = 0, group = 0, frame = 0, name = 1
+ALL-NEXT: Section 0000 | ovl = 0, group = 0, frame = 1, name = 65535
ALL-NEXT: class = 65535, offset = 0, size = 4122
ALL-NEXT: flags = read | execute | 32 bit addr | selector
-ALL-NEXT: Section 0001 | ovl = 1, group = 0, frame = 0, name = 2
+ALL-NEXT: Section 0001 | ovl = 0, group = 0, frame = 2, name = 65535
ALL-NEXT: class = 65535, offset = 0, size = 690
ALL-NEXT: flags = read | 32 bit addr | selector
-ALL-NEXT: Section 0002 | ovl = 2, group = 0, frame = 0, name = 3
+ALL-NEXT: Section 0002 | ovl = 0, group = 0, frame = 3, name = 65535
ALL-NEXT: class = 65535, offset = 0, size = 4
ALL-NEXT: flags = read | write | 32 bit addr | selector
-ALL-NEXT: Section 0003 | ovl = 3, group = 0, frame = 0, name = 4
+ALL-NEXT: Section 0003 | ovl = 0, group = 0, frame = 4, name = 65535
ALL-NEXT: class = 65535, offset = 0, size = 8
ALL-NEXT: flags = read | 32 bit addr | selector
-ALL-NEXT: Section 0004 | ovl = 4, group = 0, frame = 0, name = 0
+ALL-NEXT: Section 0004 | ovl = 0, group = 0, frame = 0, name = 65535
ALL-NEXT: class = 65535, offset = 0, size = 4294967295
ALL-NEXT: flags = 32 bit addr | absolute addr
diff --git a/llvm/test/DebugInfo/PDB/section-headers.test b/llvm/test/DebugInfo/PDB/section-headers.test
new file mode 100644
index 00000000000..a4b4ba427c1
--- /dev/null
+++ b/llvm/test/DebugInfo/PDB/section-headers.test
@@ -0,0 +1,66 @@
+RUN: llvm-pdbutil dump -section-headers %p/Inputs/empty.pdb | FileCheck %s
+
+CHECK: Section Headers
+CHECK-NEXT: ============================================================
+CHECK-LABEL: SECTION HEADER #1
+CHECK-NEXT: .text name
+CHECK-NEXT: 101A virtual size
+CHECK-NEXT: 1000 virtual address
+CHECK-NEXT: 1200 size of raw data
+CHECK-NEXT: 400 file pointer to raw data
+CHECK-NEXT: 0 file pointer to relocation table
+CHECK-NEXT: 0 file pointer to line numbers
+CHECK-NEXT: 0 number of relocations
+CHECK-NEXT: 0 number of line numbers
+CHECK-NEXT: 60000020 flags
+CHECK-NEXT: IMAGE_SCN_CNT_CODE
+CHECK-NEXT: IMAGE_SCN_MEM_EXECUTE
+CHECK-NEXT: IMAGE_SCN_MEM_READ
+
+CHECK-LABEL: SECTION HEADER #2
+CHECK-NEXT: .rdata name
+CHECK-NEXT: 2B2 virtual size
+CHECK-NEXT: 3000 virtual address
+CHECK-NEXT: 400 size of raw data
+CHECK-NEXT: 1600 file pointer to raw data
+CHECK-NEXT: 0 file pointer to relocation table
+CHECK-NEXT: 0 file pointer to line numbers
+CHECK-NEXT: 0 number of relocations
+CHECK-NEXT: 0 number of line numbers
+CHECK-NEXT: 40000040 flags
+CHECK-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA
+CHECK-NEXT: IMAGE_SCN_MEM_READ
+
+CHECK-LABEL: SECTION HEADER #3
+CHECK-NEXT: .data name
+CHECK-NEXT: 4 virtual size
+CHECK-NEXT: 4000 virtual address
+CHECK-NEXT: 0 size of raw data
+CHECK-NEXT: 0 file pointer to raw data
+CHECK-NEXT: 0 file pointer to relocation table
+CHECK-NEXT: 0 file pointer to line numbers
+CHECK-NEXT: 0 number of relocations
+CHECK-NEXT: 0 number of line numbers
+CHECK-NEXT: C0000040 flags
+CHECK-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA
+CHECK-NEXT: IMAGE_SCN_MEM_READ
+CHECK-NEXT: IMAGE_SCN_MEM_WRITE
+
+CHECK-LABEL: SECTION HEADER #4
+CHECK-NEXT: .reloc name
+CHECK-NEXT: 8 virtual size
+CHECK-NEXT: 5000 virtual address
+CHECK-NEXT: 200 size of raw data
+CHECK-NEXT: 1A00 file pointer to raw data
+CHECK-NEXT: 0 file pointer to relocation table
+CHECK-NEXT: 0 file pointer to line numbers
+CHECK-NEXT: 0 number of relocations
+CHECK-NEXT: 0 number of line numbers
+CHECK-NEXT: 42000040 flags
+CHECK-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA
+CHECK-NEXT: IMAGE_SCN_MEM_DISCARDABLE
+CHECK-NEXT: IMAGE_SCN_MEM_READ
+
+CHECK: Original Section Headers
+CHECK-NEXT: ============================================================
+CHECK-NEXT: PDB does not contain the requested image section header type
OpenPOWER on IntegriCloud