On Dec 24, 2013, at 19:48 , Rick Mann <email@hidden> wrote:
Multiple calls happen. No macro.
I’m seeing something like this too, in Obj-C source code like this:
- (NSRange) otherMethod: (NSRange) range { … }
- (void) myMethod: (NSNotification*) notification { NSTextView* textView = notification.object; NSTextView* inputView = …;
NSRange range = …; NSRange result = [self otherMethod: range]; // <— line 111 }
The breakpoint is set at line 111. When I run this (Debug configuration), the breakpoint becomes *two* breakpoints at line 111 as soon as the debugger starts. When I hit the first breakpoint, it stops at address 0x100032991:
0x100032991: movq -56(%rbp), %rdi 0x100032995: movq 7165452(%rip), %rsi ; “otherMethod:" 0x10003299c: movq -136(%rbp), %rdx 0x1000329a3: movq 6990070(%rip), %rax ; (void *)0x00007fff8ac70080: objc_msgSend 0x1000329aa: callq *%rax 0x1000329ac: movq %rax, -152(%rbp) 0x1000329b3: movq %rdx, -144(%rbp)
0x1000329ba: movl $0, -92(%rbp) 0x1000329c1: leaq -88(%rbp), %rdi 0x1000329c5: xorl êx, êx 0x1000329c7: movq %rax, %rsi 0x1000329ca: movq %rax, -200(%rbp) 0x1000329d1: callq 0x10053f8e8 ; symbol stub for: objc_storeStrong 0x1000329d6: leaq -80(%rbp), %rdi 0x1000329da: movq -200(%rbp), %rsi 0x1000329e1: callq 0x10053f8e8 ; symbol stub for: objc_storeStrong 0x1000329e6: movl -92(%rbp), ìx 0x1000329e9: testl ìx, ìx 0x1000329eb: jne 0x1000329fd ; -[MyClass myMethod:] + 477 at MyClass.m:111 0x1000329f1: jmpq 0x1000329f6 ; -[MyClass myMethod:] + 470 at MyClass.m:111
0x1000329f6: movl $0, -92(%rbp) 0x1000329fd: leaq -72(%rbp), %rdi 0x100032a01: xorl %esi, %esi 0x100032a03: callq 0x10053f8e8 ; symbol stub for: objc_storeStrong 0x100032a08: movl -92(%rbp), êx 0x100032a0b: subl $1, êx 0x100032a0e: movl êx, -204(%rbp) 0x100032a14: ja 0x100032a28 ; -[MyClass myMethod:] + 520 0x100032a1a: jmpq 0x100032a1f ; -[MyClass myMethod:] + 511 at MyClass.m:112
0x100032a1f: addq $208, %rsp 0x100032a26: popq %rbp 0x100032a27: ret
(The blank lines aren’t in the disassembly. I inserted them to make it easier to see the relevant addresses.)
After continuing, it stops at the second breakpoint, at address 0x1000329f6.
Interestingly, if I step multiple times after the first breakpoint instead of continuing, then it stops an extra time: at address 0x1000329ba, then at 0x1000329f6, then finally at 0x100032a1f for the return.
It looks to me like this is some side effect of ARC — the line number debug information is duplicated for ARC-related code. I assume that the three ‘objc_storeStrong’ calls are releasing the objects stored in the local variables earlier in the method.
|