xcode Step Over Thread 和 Step Into Thread 命令有什么用?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13970271/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 02:22:04  来源:igfitidea点击:

What is the use for the Step Over Thread and Step Into Thread commands?

xcodedebugginggdblldb

提问by Guillaume

Can someone explain what is the purpose of the Step Over Threadand Step Into Threaddebugger commands in Xcode? In what case is it useful to use them rather than the usual Step Overand Step Into? What is the difference and when does it matter?

有人能解释一下Xcode 中Step Over ThreadStep Into Thread调试器命令的目的是什么吗?在什么情况下使用它们而不是通常的Step OverStep Into有用?有什么区别,什么时候重要?

Edit: To clarify the question, I'm not asking about the difference between Step Over/Step Into/Step Out, I'm asking about the difference between the normal and the "Thread" versions, and in what case one version is more useful than the other.

编辑:为了澄清这个问题,我不是在问 Step Over/Step Into/Step Out 之间的区别,我问的是普通版本和“线程”版本之间的区别,在什么情况下一个版本更多比另一个有用。

回答by user1594895

  • Step Into
  • 踏入

Executes the current statement and then stops at the next statement. If the current statement is a function or script call, then the debugger steps into that function or script, otherwise it stops at the next statement.

执行当前语句,然后在下一个语句处停止。如果当前语句是一个函数或脚本调用,则调试器会进入该函数或脚本,否则它会在下一个语句处停止。

  • Step Over
  • 跨过

Executes the current statement and then stops at the next statement. If the current statement is a function or script call then the debugger executes the whole function or script, and it stops at the next statement after the function call.

执行当前语句,然后在下一个语句处停止。如果当前语句是函数或脚本调用,则调试器执行整个函数或脚本,并在函数调用后的下一个语句处停止。

  • Step Out
  • 走出去

Steps out of the current function and up one level if the function is nested. If in the main body, the script is executed to the end, or to the next breakpoint. The skipped statements are executed, but not stepped through.

如果函数是嵌套的,则跳出当前函数并向上一级。如果在主体中,脚本执行到最后,或者到下一个断点。跳过的语句会被执行,但不会单步执行。

Argument is general About debugging so look at

参数是通用的关于调试所以看

What is the difference between Step Into and Step Over in the Eclipse debugger?

Eclipse 调试器中的 Step Into 和 Step Over 有什么区别?

Looking at specific the focus is thread so you can look at your "multithread" application as single thread application without having multiple events/thread etc. running while you are stopped at break point. You have a "stable enviorment".

查看特定的焦点是线程,因此您可以将“多线程”应用程序视为单线程应用程序,而无需在断点处停止时运行多个事件/线程等。你有一个“稳定的环境”。

http://developer.apple.com/library/ios/#documentation/ToolsLanguages/Conceptual/Xcode4UserGuide/060-Debug_Your_App/debug_app.html

http://developer.apple.com/library/ios/#documentation/ToolsLanguages/Conceptual/Xcode4UserGuide/060-Debug_Your_App/debug_app.html

回答by Marek R

I just struggle with the same question. Question is a bit old but it looks like I found the proper answer.

我只是在同一个问题上挣扎。问题有点老,但看起来我找到了正确的答案。

Here in documentation, I found something like that:

在文档中,我发现了类似的内容:

Control-Shift to step into or over the active thread only while holding other threads stopped (the step icons show a dashed rather than solid line below the arrow).

Control-Shift 仅在其他线程停止的情况下进入或跨过活动线程(步骤图标在箭头下方显示虚线而不是实线)。

Control-Shift-<Fx Key or click> are respective shortcuts for thread versions of step over and step into. So it looks like that this executes only current thread and suspending temporary all other threads. Normal versions continues execution of all not suspended threads.

Control-Shift-< Fx 键或单击> 分别是 step over 和 step into 线程版本的快捷键。所以看起来这仅执行当前线程并暂停所有其他线程。普通版本继续执行所有未挂起的线程。

回答by CRDave

a very simple explanation of this term:

这个术语的一个非常简单的解释:

Step Into, Step Over, Step Out Commands (Debug Menu)

Step In, Step Over, Step Out 命令(调试菜单)

回答by Jan Rüegg

According to this book:

根据这本书

Step Over Threadand Step Into Threadfreeze all other threads while you advance the thread you're debugging. Hold down Shift and Control while clicking the buttons, or select the commands in the Debugmenu, to get the effect.

Step Over ThreadStep Into Thread在您推进正在调试的线程时冻结所有其他线程。在单击按钮的同时按住 Shift 和 Control 键,或在“调试”菜单中选择命令 ,以获得效果。