I'd like to inspect some global variables before a crash happens. The issue only reproduces on a certain stack trace and setting a breakpoint on the innermost function (or any other from the stack) will not get me close enough.
Can I achieve the result of breaking only when the top of the stack contains something like this ?
#0 __GI_connect
#1 curl_connect
#2 get_file
#3 init_assets
Just doing
b init_assets
c
b get_file
c
...
doesn't work since init_assets is called multiple times and it doesn't call curl every time, so gdb will break in unrelated code that uses curl.
You can use a conditional breakpoint with the the
$_caller_is
convenience function. Something like this: