gdb, set breakpoint on all functions in a file

后端 未结 2 1948
北海茫月
北海茫月 2020-11-29 05:18

Is there a single command in gdb which can set breakpoints on all the functions in a given file ? I know about rbreak regex which sets breakpoints in matching regular expres

2条回答
  •  半阙折子戏
    2020-11-29 05:40

    (gdb) set height 0
    (gdb) rbreak file.cpp:.*
    

    worked fine for me.

    In my case it was useful to shrink the result set a little bit by specifying a template argument for the functions contained in the file:

    (gdb) rbreak file.cpp:.*TemplateClass.*
    

提交回复
热议问题