如何中断与模式匹配的所有功能?

编程入门 行业动态 更新时间:2024-10-18 20:31:25
本文介绍了如何中断与模式匹配的所有功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试破坏所有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.

更多推荐

如何中断与模式匹配的所有功能?

本文发布于:2023-11-07 10:52:10,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1566259.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:模式   功能

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!