[英]How to step into a function but not its parameters using GDB
As you may know, in GDB with step(s)
command you can step into a function.您可能知道,在 GDB 中,您可以使用
step(s)
命令单步执行 function。 But s
examine and step into the function's parameters at first.但是
s
首先检查并进入函数的参数。 For example for the following function:例如对于以下 function:
foo(bar(1));
stepping into foo
, steps into bar
and then into foo
.踏入
foo
,踏入bar
,然后踏入foo
。 Stepping into the parameters become annoying as soon as the parameters count become more and more.一旦参数数量越来越多,进入参数就会变得很烦人。 Is it possible to directly step into
foo
execution and skip stepping into its parameters using GDB?是否可以使用 GDB 直接进入
foo
执行并跳过进入其参数?
I know I can set a breakpoint for foo
:) I'm searching for other solutions.我知道我可以为
foo
设置断点 :) 我正在寻找其他解决方案。
When dealing with some complex calls:在处理一些复杂的调用时:
printf("%d %d\n", function(), next_function());
I "go to" with step
to that line and then single step si
into.我“去”
step
到那条线,然后单si
进入。 It single steps into the first function called.它单步进入第一个 function 调用。 Then you can
finish
to get out and si
again into the next function.然后你可以
finish
退出并再次进入下一个si
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.