View disassembly in XCode 4 (or Xcode 5 or Xcode 6)
Asked Answered
W

5

25

I'm having trouble finding much in the way of information about the new XCode layout. How can I view the disassembly of my source file, rather than just the C++ code?

Whiteheaded answered 12/3, 2011 at 4:0 Comment(1)
In newer versions the assistant editor contains the corresponding views: Preprocess, Assembly and Disassembly. https://mcmap.net/q/383431/-xcode-preprocessor-outputGraner
K
54

In Xcode 4.2 (and Xcode 5), you can see the assembly or disassembly for a file by:

  1. Showing the assistant editor (command+option+Enter is the default shortcut).
  2. In the JumpBar, select the tuxedo icon and select "Assembly" or "Disassembly" from the drop-down list.

You can view the Assembly for a file whether or not you're running the application. Disassembly is only available when the application is running and being debugged.

Kildare answered 24/10, 2011 at 17:46 Comment(1)
... with the observation that in 6 the tuxedo icon is now four squares linked by bridges. It's the topmost and leftmost thing. It'll be above the line numbers column if you have that enabled.Viola
E
21

Follow these simple steps inside of Xcode:

enter image description here

enter image description here

enter image description here

enter image description here

Errolerroll answered 4/7, 2016 at 23:26 Comment(1)
This works on XCode 10, you just have to make sure you are at a breakpoint.Shavonneshaw
A
11

You can also display disassembly by navigating to:

Debug->Debug Workflow->Show Disassembly while debugging.

This will display source and disassembly in the main window view.

Annabal answered 15/12, 2013 at 23:39 Comment(0)
D
1

On Xcode 6 you can go to the menu "Debug -> Debug Workflow -> Always show disassembly".

Downgrade answered 13/1, 2015 at 16:11 Comment(0)
W
-5

From what I read in a very thorough XCode 4 review (http://fireballed.org/linked/2011/03/09/xcode-pilkington/), the ability to show a file as assembly code is now gone in XCode 4. I guess you could always set a breakpoint in a method, and look at it disassembled in the debugger console with something like the "x/100i" command to treat print out the next 100 instructions in assembly, but that is a lot less convenient.

Wootan answered 5/4, 2011 at 19:49 Comment(2)
In Xcode 4.5 you can see the disassembly alongside the code using OldPeculiar's answerSeminarian
Indeed, the functionality was re-introduced back into XCode -- nearly two years later.Whiteheaded

© 2022 - 2024 — McMap. All rights reserved.