我正在尝试破坏所有pthread函数,但是gdb似乎不支持通配符:
I'm trying to break on all pthread functions, but it looks like gdb doesn't support wildcard here:
(gdb) b pthread_* Function "pthread_*" not defined.有什么想法吗?
推荐答案使用rbreak ^pthread_
来自 GDB:设置断点:
rbreak正则表达式
rbreak regex
在与正则表达式regex匹配的所有函数上设置断点.
Set breakpoints on all functions matching the regular expression regex.
正则表达式的语法是与grep之类的工具一起使用的标准语法.请注意,这与Shell使用的语法不同,因此,例如foo *会匹配所有包含fo后跟零个或多个os的函数.有一个隐含的.*在您提供的正则表达式前后,因此,若要仅匹配以foo开头的函数,请使用^ foo.
The syntax of the regular expression is the standard one used with tools like grep. Note that this is different from the syntax used by shells, so for instance foo* matches all functions that include an fo followed by zero or more os. There is an implicit .* leading and trailing the regular expression you supply, so to match only functions that begin with foo, use ^foo.
更多推荐
如何中断与模式匹配的所有功能?
发布评论