Skip to content

Commit af1744c

Browse files
committed
Minidump/Windows: Fix module lookup
Summary: When opening a minidump, we were failing to find an executable because we were searching for i386-unknown-windows, whereas we recognize the pe/coff files as i386-pc-windows. This fixes the triple computation code in the minidump parser to match pe/coff, and adds an appropriate test. NB: I'm not sure setting the vendor to "pc" is really correct for arm(64) windows, but right now that seems to match what we do in the pe/coff case (ArchSpec.cpp:935). Reviewers: clayborg, amccarth Subscribers: javed.absar, kristof.beyls, rnk, markmentovai, lldb-commits Differential Revision: https://reviews.llvm.org/D65955 llvm-svn: 368416
1 parent 4ef50a3 commit af1744c

File tree

4 files changed

+69
-0
lines changed

4 files changed

+69
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
--- !minidump
2+
Streams:
3+
- Type: ModuleList
4+
Modules:
5+
- Base of Image: 0x00000000000B0000
6+
Size of Image: 0x00005000
7+
Module Name: 'find-module.exe'
8+
CodeView Record: 525344533ED87D89C8A8184197F3A925EE4BF74101000000433A5C70726F6A656374735C746573745F6170705C436F6E736F6C654170706C69636174696F6E315C44656275675C436F6E736F6C654170706C69636174696F6E312E70646200
9+
- Type: SystemInfo
10+
Processor Arch: X86
11+
Processor Level: 23
12+
Processor Revision: 2050
13+
Number of Processors: 32
14+
Product type: 1
15+
Major Version: 10
16+
Build Number: 17134
17+
Platform ID: Win32NT
18+
Suite Mask: 0x0300
19+
CPU:
20+
Vendor ID: AuthenticAMD
21+
Version Info: 0x00800F82
22+
Feature Info: 0x178BFBFF
23+
AMD Extended Features: 0x2FD3FBFF
24+
- Type: MiscInfo
25+
Content: 54050000F703000008290000C883495D0000000000000000AC0D000098080000AC0D00000200000002000000002000000D0000000000000002000000C4FFFFFF430065006E007400720061006C0020004500750072006F007000650020005300740061006E0064006100720064002000540069006D006500000000000000000000000A0000000500030000000000000000000000430065006E007400720061006C0020004500750072006F00700065002000530075006D006D00650072002000540069006D00650000000000000000000000000000000300000005000200000000000000C4FFFFFF310037003100330034002E0031002E007800380036006600720065002E007200730034005F00720065006C0065006100730065002E003100380030003400310030002D00310038003000340000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064006200670063006F00720065002E0069003300380036002C00310030002E0030002E00310037003100330034002E0031000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006C816B92
26+
...
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
--- !COFF
2+
OptionalHeader:
3+
AddressOfEntryPoint: 4224
4+
ImageBase: 4194304
5+
SectionAlignment: 4096
6+
FileAlignment: 512
7+
MajorOperatingSystemVersion: 6
8+
MinorOperatingSystemVersion: 0
9+
MajorImageVersion: 0
10+
MinorImageVersion: 0
11+
MajorSubsystemVersion: 6
12+
MinorSubsystemVersion: 0
13+
Subsystem: IMAGE_SUBSYSTEM_WINDOWS_CUI
14+
DLLCharacteristics: [ IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE, IMAGE_DLL_CHARACTERISTICS_NX_COMPAT, IMAGE_DLL_CHARACTERISTICS_NO_SEH, IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE ]
15+
SizeOfStackReserve: 1048576
16+
SizeOfStackCommit: 4096
17+
SizeOfHeapReserve: 1048576
18+
SizeOfHeapCommit: 4096
19+
header:
20+
Machine: IMAGE_FILE_MACHINE_I386
21+
Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_32BIT_MACHINE ]
22+
sections:
23+
- Name: .rdata
24+
Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
25+
VirtualAddress: 8192
26+
VirtualSize: 304
27+
- Name: .reloc
28+
Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
29+
VirtualAddress: 16384
30+
VirtualSize: 48
31+
symbols: []
32+
...
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Test that we correctly find a PE/COFF file in our executable search path, and
2+
use it when opening minidumps.
3+
4+
RUN: yaml2obj %S/Inputs/find-module.exe.yaml > %T/find-module.exe
5+
RUN: yaml2obj %S/Inputs/find-module.dmp.yaml > %T/find-module.dmp
6+
RUN: %lldb -O "settings set target.exec-search-paths %T" \
7+
RUN: -c %T/find-module.dmp -o "image dump objfile" -o exit | FileCheck %s
8+
9+
CHECK-LABEL: image dump objfile
10+
CHECK: ObjectFilePECOFF, file = '{{.*}}find-module.exe', arch = i386

lldb/source/Plugins/Process/minidump/MinidumpParser.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ ArchSpec MinidumpParser::GetArchitecture() {
188188
case OSPlatform::Win32NT:
189189
case OSPlatform::Win32CE:
190190
triple.setOS(llvm::Triple::OSType::Win32);
191+
triple.setVendor(llvm::Triple::VendorType::PC);
191192
break;
192193
case OSPlatform::Linux:
193194
triple.setOS(llvm::Triple::OSType::Linux);

0 commit comments

Comments
 (0)