如何使用LLDB进入最外层的函数调用

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

本文关键字:函数调用 何使用 LLDB      更新时间:2023-10-16

假设我正在调试这样的代码

   outer(fn1(), fn2());

如果我使用 s 命令,LLDB 将首先步入fn1,然后我键入 fin 步出,s再次步入fn2fin......直到现在我才能进入outer这是我从一开始就想要的。

有没有办法告诉LLDB在哪个函数调用上单步执行?

lldb 附带了一个别名:sif 。在给定的示例中,您可以运行:

(lldb) sif outer

你可以记住它是step into function

它适用于部分匹配,不必使用完整的函数名称进行调用。在这种情况下,您也可以运行sif out例如。

thread step-in --step-in-target outer或更紧凑地说,s -t outer将在进入outer时停止。 有关文档,请参阅help s

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