For example:
dprintf main,"hello\n" run
It produces the same result as:
break main commands silent printf "hello\n" continue end run
Is there a significant advantage when using dprintf over commands , for example. is it much faster (if so, why?) or has several different functions?
Or is it basically a convenience team?
Source
In source 7.9.1, breakpoint.c:dprintf_command , which defines dprintf , calls create_breakpoint , which also calls break_command , so they both seem to use the same underlying mechanism.
The main difference is that dprintf passes the dprintf_breakpoint_ops structure, which has different callbacks and gets initialized to initialize_breakpoint_ops .
dprintf keeps a list of command lines similar to commands , depending on the settings. It:
- set to
update_dprintf_command_list - which is called after checking
type == bp_dprintf inside init_breakpoint_sal - which is called
create_breakpoint .
When a breakpoint is reached:
bpstat_stop_status is called and calls b->ops->after_condition_true (bs); for reached breakpointafter_condition_true for dprintf is dprintf_after_condition_truebpstat_do_actions_1 runs commands
gdb
Ciro Santilli 华 涌 低端 人口 六四 事件 法轮功 Jul 27 '15 at 13:04 on 2015-07-27 13:04
source share