Xcode Debugger - how to single step at level of CPU instructions

前端 未结 4 1584
慢半拍i
慢半拍i 2021-02-20 15:06

This is definitely obsessive, but I am fascinated by how cleverly the compiler translates C code into machine instructions. Since I am a little fuzzy on some instructions, it

相关标签:
4条回答
  • 2021-02-20 15:22

    It's possible to use Xcode's step over, step in, and step out commands with the debugger. The trick is to hold the ctrl (Control) key while you mouse over the debugger step icons to change the context. Underneath each step icon, the line will change to a dot and you can then step at the instruction level.

    See the attached screenshot highlighted with a red oval.

    0 讨论(0)
  • 2021-02-20 15:23

    si is "Step Instruction", and ni is "Next Instruction". They have the same semantics as "step" and "next" do for lines of code, just on the instruction level.

    0 讨论(0)
  • 2021-02-20 15:32

    In the Debugger window, enable assembly: Run/Debugger display/Source and disassembly. Wait till you hit a breakpoint. Then use Run/Step into(over) instruction to step in assembly.

    0 讨论(0)
  • 2021-02-20 15:35

    Ooops, didn't check closely enough - Step Into w/Option (Cmd-Opt-Shft-I = ⌘⌥⇧I)

    0 讨论(0)
提交回复
热议问题