Step into function call in gdb but not calls for parameters

牧云@^-^@ 提交于 2021-01-28 17:36:01

问题


I would like to step into the function GDB is currently at, but not into the functions that are called to prepare the parameters for the call.

Is there a single command in gdb that steps over functions like initial_metadata_flags() and directly into SendInitialMetadata?

  void StartCallInternal() {
>   single_buf.SendInitialMetadata(&context_->send_initial_metadata_,
                                   context_->initial_metadata_flags());
  }

If there is, I did not see it mentioned here: https://sourceware.org/gdb/onlinedocs/gdb/Continuing-and-Stepping.html

My current workaround is to step, finish, step, finish, until I get to the primary function on that line. But would like something more direct.

There are similar questions asked about Python and Visual Studio, but I haven't found a good answer for gdb.


回答1:


You can configure functions that you want to skip while stepping:

(gdb) help skip
Ignore a function while stepping.

Usage: skip [FUNCTION-NAME]
       skip [FILE-SPEC] [FUNCTION-SPEC]
If no arguments are given, ignore the current function.

FILE-SPEC is one of:
       -fi|-file FILE-NAME
       -gfi|-gfile GLOB-FILE-PATTERN
FUNCTION-SPEC is one of:
       -fu|-function FUNCTION-NAME
       -rfu|-rfunction FUNCTION-NAME-REGULAR-EXPRESSION
...


来源:https://stackoverflow.com/questions/60820583/step-into-function-call-in-gdb-but-not-calls-for-parameters

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!