[quote='797102022, DTS Engineer, /thread/760029?answerId=797102022#797102022']
If you only want to look at the app, rather than run it, you can ignoer the whole thing:
[/quote]
So I ran
lldb ~/Library/Developer/Xcode/Archives/2024-07-12/MyApp\ macOS\ 12.07.2024\,\ 20.43.xcarchive/Products/Applications/MyApp.app
To translate the addresses from the crash report to lldb, it wasn't sufficient to subtract the binary image base address, but I found some help at Symbolicating with LLDB. By running
lldb image list
which outputs
[ 0] 2521131E-2080-387D-B96E-8DB6AA18E011 0x0000000100000000 ~/Library/Developer/Xcode/Archives/2024-07-12/MyApp macOS 12.07.2024, 20.43.xcarchive/Products/Applications/MyApp.app/Contents/MacOS/MyApp
/System/Volumes/Data/~/Library/Developer/Xcode/Archives/2024-07-12/MyApp macOS 12.07.2024, 20.43.xcarchive/dSYMs/MyApp.app.dSYM/Contents/Resources/DWARF/MyApp
[ 1] 37BBC384-0755-31C7-A808-0ED49E44DD8E 0x00000001800b8000 /usr/lib/dyld
...
I found out that there is another base address here 0x0000000100000000 (which almost looks like 0x0) that I also have to subtract.
So the real offset is
0x104468000 - 0x0000000100000000 = 0x004468000
which I could set with
lldb target modules load --file MyApp --slide 0x004468000
So now I can disassemble by directly providing the addresses from the crash report, and I confirm that all crash report addresses point to the correct symbol names.
But when I run
lldb disas -a 0x00000001044fff28
(where 0x00000001044fff28 is the address for the call to MyViewController.myModalAction in the crash report), I get this relatively short and rather obscure output:
MyApp`merged @objc MyApp.MyViewController.myModalAction(Any) -> ():
0x1044ffed8 <+0>: sub sp, sp, #0x50
0x1044ffedc <+4>: stp x22, x21, [sp, #0x20]
0x1044ffee0 <+8>: stp x20, x19, [sp, #0x30]
0x1044ffee4 <+12>: stp x29, x30, [sp, #0x40]
0x1044ffee8 <+16>: add x29, sp, #0x40
0x1044ffeec <+20>: mov x19, x3
0x1044ffef0 <+24>: mov x20, x2
0x1044ffef4 <+28>: mov x21, x0
0x1044ffef8 <+32>: mov x0, x2
0x1044ffefc <+36>: bl 0x1001d6a60 ; symbol stub for: swift_unknownObjectRetain
0x1044fff00 <+40>: mov x0, x21
0x1044fff04 <+44>: bl 0x1001d6664 ; symbol stub for: objc_retain
0x1044fff08 <+48>: mov x21, x0
0x1044fff0c <+52>: mov x8, sp
0x1044fff10 <+56>: mov x0, x20
0x1044fff14 <+60>: bl 0x1001d5ee4 ; symbol stub for: Swift._bridgeAnyObjectToAny(Swift.Optional<Swift.AnyObject>) -> Any
0x1044fff18 <+64>: mov x0, x20
0x1044fff1c <+68>: bl 0x1001d6a54 ; symbol stub for: swift_unknownObjectRelease
0x1044fff20 <+72>: mov x20, x21
0x1044fff24 <+76>: blr x19
0x1044fff28 <+80>: mov x0, sp
0x1044fff2c <+84>: bl 0x100008ce4 ; __swift_destroy_boxed_opaque_existential_0 at <compiler-generated>
0x1044fff30 <+88>: mov x0, x21
0x1044fff34 <+92>: bl 0x1001d6658 ; symbol stub for: objc_release
0x1044fff38 <+96>: ldp x29, x30, [sp, #0x40]
0x1044fff3c <+100>: ldp x20, x19, [sp, #0x30]
0x1044fff40 <+104>: ldp x22, x21, [sp, #0x20]
0x1044fff44 <+108>: add sp, sp, #0x50
0x1044fff48 <+112>: ret
Whereas if I run
lldb disas -n myModalAction
I get a way longer output which contains the expected calls to my own other methods, starting with
MyApp`MyViewController.myModalAction(_:):
0x1044f9578 <+0>: stp x28, x27, [sp, #-0x60]!
...
Notice how the first lines of these two outputs differ:
MyApp`merged @objc MyApp.MyViewController.myModalAction(Any) -> ()
vs
MyApp`MyViewController.myModalAction(_:)
What does this difference mean? The line in the crash report
13 MyApp 0x00000001044fff28 @objc MyViewController.myModalAction(_:) + 80
is the only one that doesn't make sense and couldn't possibly call the line above it.