如何打破GDB中每个类的方法?

时间:2021-07-09 20:44:11

I have a class with a regrettable number of methods. I would like gdb to break whenever I enter the class, so through any of the methods. Is there a way to do this without setting break points individually for each method?

我有一个令人遗憾的方法课程。每当我进入类时,我都希望gdb能够中断,所以通过任何方法。有没有办法在不为每种方法单独设置断点的情况下执行此操作?

1 个解决方案

#1


13  

I never tried it myself, but it seems you can try the rbreak command :

我自己从未尝试过,但似乎你可以试试rbreak命令:

rbreak regex

rbreak正则表达式

Set breakpoints on all functions matching the regular expression regex. This command sets an unconditional breakpoint on all matches, printing a list of all breakpoints it set. Once these breakpoints are set, they are treated just like the breakpoints set with the break command.

在与正则表达式正则表达式匹配的所有函数上设置断点。此命令在所有匹配项上设置无条件断点,打印它设置的所有断点的列表。设置这些断点后,它们将被视为与使用break命令设置的断点一样。

#1


13  

I never tried it myself, but it seems you can try the rbreak command :

我自己从未尝试过,但似乎你可以试试rbreak命令:

rbreak regex

rbreak正则表达式

Set breakpoints on all functions matching the regular expression regex. This command sets an unconditional breakpoint on all matches, printing a list of all breakpoints it set. Once these breakpoints are set, they are treated just like the breakpoints set with the break command.

在与正则表达式正则表达式匹配的所有函数上设置断点。此命令在所有匹配项上设置无条件断点,打印它设置的所有断点的列表。设置这些断点后,它们将被视为与使用break命令设置的断点一样。