tracing - How to do a specific action when ANY Unknown Breakpoint gets Hit in GDB -


i have read following question: do specific action when breakpoint hits in gdb

here, use 'command' decide when specified breakboint gets hit.

my question is:

suppose put breakpoints on functions matching given pattern:

gdb$rbreak func_ 

=> 100 breakpoints (say)

when execute code, want same action - on hitting each of these functions.

hence, cannot define like:

command break_point_number  

// since don't know how many breakpoints there

can please suggest me:

how can specific action-set when breakpoint gets hit in gdb?

thanks.

with new enough version of gdb can use range:

(gdb) rbreak whatever ... gdb creates breakpoints n, n+1, ..., m (gdb) commands n-m > stuff > end 

i forget when feature went in.

with older version of gdb, i'm not sure can done.

it can done difficulty: use set logging write output file, "info break", "shell" run scripts edit file gdb commands, "source". painful.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

javascript - addthis share facebook and google+ url -

ios - Show keyboard with UITextField in the input accessory view -