llvm-project/lldb/examples/python
Vedant Kumar e31b2d7d7b [lldb][crashlog] Avoid specifying arch for image when a UUID is present
When adding an image to a target for crashlog purposes, avoid specifying
the architecture of the image.

This has the effect of making SBTarget::AddModule infer the ArchSpec for
the image based on the SBTarget's architecture, which LLDB puts serious
effort into calculating correctly (in TargetList::CreateTargetInternal).

The status quo is that LLDB randomly guesses the ArchSpec for a module
if its architecture is specified, via:

```
  SBTarget::AddModule -> Platform::GetAugmentedArchSpec -> Platform::IsCompatibleArchitecture ->
GetSupportedArchitectureAtIndex -> {ARM,x86}GetSupportedArchitectureAtIndex
```

... which means that the same crashlog can fail to load on an Apple
Silicon Mac (due to the random guess of arm64e-apple-macosx for the
module's ArchSpec not being compatible with the SBTarget's (correct)
ArchSpec), while loading just fine on an Intel Mac.

I'm not sure how to add a test for this (it doesn't look like there's
test coverage of this path in-tree). It seems like it would be pretty
complicated to regression test: the host LLDB would need to be built for
arm64e, we'd need a hand-crafted arm64e iOS crashlog, and we'd need a
binary with an iOS deployment target. I'm open to other / simpler
options.

rdar://82679400

Differential Revision: https://reviews.llvm.org/D110013
2021-09-20 10:23:35 -07:00
..
scripted_process [lldb/Plugins] Add ScriptedProcess Process Plugin 2021-07-22 14:47:33 +02:00
armv7_cortex_m_target_defintion.py Harmonize Python shebang 2020-07-16 21:53:45 +02:00
bsd.py Harmonize Python shebang 2020-07-16 21:53:45 +02:00
cmdtemplate.py Harmonize Python shebang 2020-07-16 21:53:45 +02:00
crashlog.py [lldb] Update crashlog.py to accept multiple results from mdfind 2021-09-07 08:36:58 -07:00
delta.py Harmonize Python shebang 2020-07-16 21:53:45 +02:00
diagnose_nsstring.py
diagnose_unwind.py
dict_utils.py
disasm-stress-test.py Harmonize Python shebang 2020-07-16 21:53:45 +02:00
disasm.py Harmonize Python shebang 2020-07-16 21:53:45 +02:00
disassembly_mode.py
file_extract.py Harmonize Python shebang 2020-07-16 21:53:45 +02:00
gdb_disassemble.py
gdbremote.py Harmonize Python shebang 2020-07-16 21:53:45 +02:00
globals.py Harmonize Python shebang 2020-07-16 21:53:45 +02:00
in_call_stack.py [Examples] Move structured-data unpacking out of the loop. (NFC) 2019-11-22 15:43:39 -08:00
jump.py
lldb_module_utils.py Harmonize Python shebang 2020-07-16 21:53:45 +02:00
lldbtk.py Harmonize Python shebang 2020-07-16 21:53:45 +02:00
mach_o.py Harmonize Python shebang 2020-07-16 21:53:45 +02:00
memory.py Harmonize Python shebang 2020-07-16 21:53:45 +02:00
operating_system.py Harmonize Python shebang 2020-07-16 21:53:45 +02:00
performance.py [lldb] [gdb-remote server] Introduce new stop reasons for fork and vfork 2021-04-24 11:08:33 +02:00
process_events.py [lldb] Fix typos. NFC. 2021-05-31 06:48:57 +07:00
pytracer.py
sbvalue.py Harmonize Python shebang 2020-07-16 21:53:45 +02:00
scripted_step.py
shadow.py Harmonize Python shebang 2020-07-16 21:53:45 +02:00
sources.py Harmonize Python shebang 2020-07-16 21:53:45 +02:00
stacks.py Harmonize Python shebang 2020-07-16 21:53:45 +02:00
step_and_print.py
symbolication.py [lldb][crashlog] Avoid specifying arch for image when a UUID is present 2021-09-20 10:23:35 -07:00
types.py Harmonize Python shebang 2020-07-16 21:53:45 +02:00
x86_64_linux_target_definition.py Harmonize Python shebang 2020-07-16 21:53:45 +02:00
x86_64_qemu_target_definition.py Harmonize Python shebang 2020-07-16 21:53:45 +02:00
x86_64_target_definition.py Harmonize Python shebang 2020-07-16 21:53:45 +02:00