This isn't quite what you want, but the lldb "disassemble" command's -m flag
will give you mixed source/assembly:
(lldb) dis -f -m
Sketch`main at SKTMain.m:16
15
16 int main(int argc, const char *argv[]) {
17 NSLog (@"Added for testing rebuilds.");
Sketch`main:
0x100018fa0 <+0>: pushq %rbp
0x100018fa1 <+1>: movq %rsp, %rbp
0x100018fa4 <+4>: subq $0x160, %rsp ; imm = 0x160
0x100018fab <+11>: leaq 0xa376(%rip), %rax ; @"Added for testing
rebuilds."
0x100018fb2 <+18>: movq 0x90f7(%rip), %rcx ; (void
*)0x00007fff7e476070: __stack_chk_guard
0x100018fb9 <+25>: movq (%rcx), %rcx
0x100018fbc <+28>: movq %rcx, -0x8(%rbp)
0x100018fc0 <+32>: movl $0x0, -0xf4(%rbp)
0x100018fca <+42>: movl %edi, -0xf8(%rbp)
0x100018fd0 <+48>: movq %rsi, -0x100(%rbp)
Sketch`main + 55 at SKTMain.m:17
16 int main(int argc, const char *argv[]) {
17 NSLog (@"Added for testing rebuilds.");
18 bool got_a_bool = NO;
0x100018fd7 <+55>: movq %rax, %rdi
0x100018fda <+58>: movb $0x0, %al
0x100018fdc <+60>: callq 0x10001d34a ; symbol stub for:
NSLog
0x100018fe1 <+65>: leaq 0xa360(%rip), %rcx ;
@Sketch.__TEXT.__ustring + 0
etc... The display gives you a line of context before and after the line that
the subsequent disassembly is for.
Not as nice as a GUI view, but not nothing...
Jim
> On Feb 9, 2016, at 11:18 AM, Jens Alfke <[email protected]> wrote:
>
> One nice feature of Instruments is its side-by-side display of source code
> next to assembly code. This is a great help when trying to figure out what
> the compiled code for a function or a line of code looks like.
>
> Is there any way to get something like that when not using Instruments? Right
> now I’m looking at the Assembly assistant view in Xcode, which is really hard
> to work with — I have to search through the huge output to find the function
> I want, and the listing is full of jump labels and assembler directives that
> make it hard to pick out the actual instructions.
>
> I’d even be happy to have a shellscript that would post-process the assembly
> and output a more readable form. (Which yeah, I could write myself, but I’d
> rather spend that hour debugging my current crasher, not remembering how sed
> works.)
>
> —Jens
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Xcode-users mailing list ([email protected])
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/xcode-users/jingham%40apple.com
>
> This email sent to [email protected]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/xcode-users/archive%40mail-archive.com
This email sent to [email protected]