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?
You can also set breakpoints on function names. To do this, just type "break [functionname]". gdb will stop your program just before that function is called.
Breakpoints are set with the break command (abbreviated b ). The debugger convenience variable `$bpnum' records the number of the breakpoint you've set most recently; see section Convenience variables, for a discussion of what you can do with convenience variables.
This applies to breakpoints set with the break command as well as to internal breakpoints set by commands like next and finish . For breakpoints set with hbreak , GDB will always use hardware breakpoints. You can control this automatic behaviour with the following commands: set breakpoint auto-hw on.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With