Xcode Debugger - 如何单步执行CPU指令 [英] Xcode Debugger - how to single step at level of CPU instructions

查看:98
本文介绍了Xcode Debugger - 如何单步执行CPU指令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这绝对是强迫的,但是我非常着迷于编译器如何将C代码转换为机器指令。由于我对某些指令有点模糊,如果我可以在单个机器指令级别(下面)下方看到一个编译程序的操作,那么C语句的级别(可能会产生几个CPU指令)就会很有帮助。换句话说,我可以在单个机器指令之后观察寄存器/内存的变化吗?



我确定这可能与其他一些调试器,但我只使用Xcode

解决方案

si 是Step Instruction, ni 是下一个指令。对于代码行,它们具有与step和next相同的语义,仅在指令级别。


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 would be helpful if I could watch the operation of a compiled program at the level of individual machine instructions - "below" the level of a C statement (which might generate several CPU instructions). In other words, can I watch the registers/memory change after a single machine instruction?

I'm sure it's possible with some other debuggers, but I am only using Xcode.

解决方案

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.

这篇关于Xcode Debugger - 如何单步执行CPU指令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆