Search code examples
iphoneios6xcode4.5

disable disassembly view while debugging


I'm trying to figure out how to turn off the disassembly view in Xcode while debugging. I'd like to just keep jumping through my code instead of getting sidetracked looking through all the assembly code. I believe there was an option for this in previous versions of Xcode under the debug menu, but I can't find any options in Xcode 4.5 (latest release). Any ideas?

Edit:

I double checked to make sure I was in fact in my own code and not in a library, and it still does this when I am in my own code. Here is a picture of what happens:

http://i1238.photobucket.com/albums/ff487/davidohyer/ScreenShot2012-10-02at35031PM.png

This occurred by just creating a new project, making a dummy function, calling that dummy function from viewDidLoad, setting a breakpoint on the function call and stepping through using F6. Any ideas? No external libraries used. I verified that the option you mentioned is turned off when this happens.

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.

    [self initVals];
}

-(void)initVals
{
    self.img = [[UIImageView alloc] init];
}

Solution

  • Product > Debug Workflow > Show Disassembly While Debugging

    enter image description here

    Remember you'll only be able to see your own code. Breakpoints and/or crashes that occurs inside some library or framework will just show assembly, because there's simply so source code to show.

    EDIT

    The disassembly you are showing in your edit is from UIViewController. You can see it in the sidebar, as well in the symbol stub comments in the disassembly.

    You may break on your own code, but then, if you step from here, you'll fatally end in some framework code.

    In your example, you break on the initVals call, from viewDidLoad on a UIViewController subclass.

    If you step pass the end of this, you'll end in UIViewController code, as it has still a lot of stuff to do after viewDidLoad.

    So to resume, pay attention of the symbol names on the sidebar. Here, it just shows you're not in your subclass, but in some superclass method implementation. Hence the assembly only output.

    EDIT 2

    Imagine the following code, from a library (binary only):

    @interface Foo: NSObject
    
    - ( void )test1;
    - ( void )test2;
    - ( void )test3;
    
    @end
    

    And then you subclass it:

    @interface Bar: Foo
    
    @end
    

    Now, Foo does the following:

    - ( void )test1
    {
        [ self test2 ];
        [ self test3 ];
    }
    

    In your subclass, let's say you only override test2:

    - ( void )test2
    {
        ...
    
        /* Breakpoint here, at the end */
    }
    

    If you step from the breakpoint, you'll end in the test3 superclass implementation, which is called right after test2 from test1.

    So you'll just jump from your own code to the superclass implementation. Here again, no human readable code to show, but only assembly.