How do I break on all functions that matches a pattern?
gdb
Solution
Use `rbreak ^pthread_`
From GDB: Setting Breakpoints:
rbreak regex
Set breakpoints on all functions matching the regular expression regex.
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.
Problem
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. ``` Any ideas?