简体   繁体   English

如何在LLDB中逐步进入最外部的函数调用?

[英]How to step-into outermost function call in the line with LLDB?

Let's say I'm debugging code like this 假设我正在调试这样的代码

   outer(fn1(), fn2());

If I use the s command, LLDB will first step into fn1 , then I type fin to step-out, s again steps into fn2 , fin ... and only now I'm able to step-into outer which is what I wanted since the beginning. 如果我使用s命令,则LLDB将首先进入fn1 ,然后键入fin进行跳出,再次将s进入fn2fin ...然后才可以进入outer ,这正是我想要的从一开始。

Is there a way to tell LLDB on which function call to step-in? 有没有一种方法可以告诉LLDB哪个函数调用步入?

thread step-in --step-in-target outer or more compactly, s -t outer will stop when it has stepped into outer . thread step-in --step-in-target outer或更紧凑,当s -t outer步入outer时将停止。 See help s for the documentation. 有关文档,请参见help s

lldb comes with an alias for exactly this: sif . lldb附带一个别名: sif In the given example, you can run: 在给定的示例中,您可以运行:

(lldb) sif outer

You can remember it as s tep i nto f unction 你可以记住它为S TEP 扎成 ˚F油膏

It works with partial matches, it doesn't have to be called with the full function name. 它适用于部分匹配,而不必使用完整的函数名来调用。 In this case, you could also run sif out for example. 在这种情况下,您也可以运行sif out例如。

直接不是。但是您可以在外部函数的定义中设置断点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM