-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[lldb] Pick the correct architecutre when target and core file disagr…
…ee (#105576) In f9f3316, Adrian fixed an issue where LLDB wouldn't update the target's architecture when the process reported a different triple that only differed in its sub-architecture. This unintentionally regressed core file debugging when the core file reports the base architecture (e.g. armv7) while the main binary knows the correct CPU subtype (e.g. armv7em). After the aforementioned change, we update the target architecture from armv7em to armv7. Fix the issue by trusting the target architecture over the ProcessMachCore process. rdar://133834304
- Loading branch information
1 parent
3c54aa1
commit 9f41805
Showing
4 changed files
with
102 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
--- !mach-o | ||
FileHeader: | ||
magic: 0xFEEDFACE | ||
cputype: 0xC | ||
cpusubtype: 0x10 | ||
filetype: 0x2 | ||
ncmds: 3 | ||
sizeofcmds: 272 | ||
flags: 0x200085 | ||
LoadCommands: | ||
- cmd: LC_SEGMENT | ||
cmdsize: 56 | ||
segname: __PAGEZERO | ||
vmaddr: 0 | ||
vmsize: 16384 | ||
fileoff: 0 | ||
filesize: 0 | ||
maxprot: 0 | ||
initprot: 0 | ||
nsects: 0 | ||
flags: 0 | ||
- cmd: LC_SEGMENT | ||
cmdsize: 192 | ||
segname: __TEXT | ||
vmaddr: 16384 | ||
vmsize: 32768 | ||
fileoff: 0 | ||
filesize: 32768 | ||
maxprot: 5 | ||
initprot: 5 | ||
nsects: 2 | ||
flags: 0 | ||
Sections: | ||
- sectname: __text | ||
segname: __TEXT | ||
addr: 0xBFB4 | ||
size: 4 | ||
offset: 0x7FB4 | ||
align: 1 | ||
reloff: 0x0 | ||
nreloc: 0 | ||
flags: 0x80000400 | ||
reserved1: 0x0 | ||
reserved2: 0x0 | ||
reserved3: 0x0 | ||
content: '00207047' | ||
- sectname: __unwind_info | ||
segname: __TEXT | ||
addr: 0xBFB8 | ||
size: 72 | ||
offset: 0x7FB8 | ||
align: 2 | ||
reloff: 0x0 | ||
nreloc: 0 | ||
flags: 0x0 | ||
reserved1: 0x0 | ||
reserved2: 0x0 | ||
reserved3: 0x0 | ||
content: 010000001C000000000000001C000000000000001C00000002000000B57F00003400000034000000BA7F00000000000034000000030000000C000100100001000000000000000000 | ||
- cmd: LC_UUID | ||
cmdsize: 24 | ||
uuid: C2065535-C63D-3C6A-BF79-19CF960DEF2E |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- !mach-o | ||
FileHeader: | ||
magic: 0xFEEDFACF | ||
cputype: 0xC | ||
cpusubtype: 0x9 | ||
filetype: 0x4 | ||
ncmds: 1 | ||
sizeofcmds: 84 | ||
flags: 0x0 | ||
reserved: 0x0 | ||
LoadCommands: | ||
- cmd: LC_THREAD | ||
cmdsize: 84 | ||
PayloadBytes: [ 0x1, 0x0, 0x0, 0x0, 0x11, 0x0, 0x0, 0x0, 0x0, 0x0, | ||
0x1, 0x0, 0x0, 0x0, 0x2, 0x0, 0x0, 0x0, 0x3, 0x0, | ||
0x0, 0x0, 0x4, 0x0, 0x0, 0x0, 0x5, 0x0, 0x0, 0x0, | ||
0x6, 0x0, 0x0, 0x0, 0x7, 0x0, 0x0, 0x0, 0x8, 0x0, | ||
0x0, 0x0, 0x9, 0x0, 0x0, 0x0, 0xA, 0x0, 0x0, 0x0, | ||
0xB, 0x0, 0x0, 0x0, 0xC, 0x0, 0x0, 0x0, 0xD, 0x0, | ||
0x0, 0x0, 0xE, 0x0, 0x0, 0x0, 0xF, 0x0, 0x0, 0x0, | ||
0x10, 0x0, 0x0, 0x0, 0x11, 0x0 ] | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# RUN: yaml2obj %S/Inputs/corefile.yaml -o %t.corefile | ||
# RUN: yaml2obj %S/Inputs/a.out.yaml -o %t.out | ||
|
||
# RUN: %lldb -b -c %t.corefile %t.out -o 'target list ' | FileCheck %s --check-prefix BINARY | ||
# BINARY: target {{.*}} arch=armv7em-apple | ||
|
||
# RUN: %lldb -b %t.corefile -o 'target list' | FileCheck %s --check-prefix CORE | ||
# CORE: target {{.*}} arch=armv7-apple |