show breakpoint statistics in mode -vv

This commit is contained in:
Stefani Seibold 2015-05-18 09:07:09 +02:00
parent dec3daabba
commit bd6aadcb7f
3 changed files with 13 additions and 0 deletions

View File

@ -260,6 +260,9 @@ static void process_event(struct task *task, int status)
if (bp) { if (bp) {
assert(bp->type != SW_BP); assert(bp->type != SW_BP);
assert(bp->hw_bp_slot == i); assert(bp->hw_bp_slot == i);
if (options.verbose > 1)
++leader->num_hw_bp;
} }
else else
#endif #endif
@ -269,6 +272,9 @@ static void process_event(struct task *task, int status)
return; return;
assert(bp->type == SW_BP); assert(bp->type == SW_BP);
if (options.verbose > 1)
++leader->num_sw_bp;
set_instruction_pointer(task, bp->addr); set_instruction_pointer(task, bp->addr);
} }
#if 1 #if 1

3
task.h
View File

@ -81,6 +81,9 @@ struct task {
/* set in leader: number of stopped threads including the leader */ /* set in leader: number of stopped threads including the leader */
unsigned int threads_stopped; unsigned int threads_stopped;
unsigned long num_hw_bp;
unsigned long num_sw_bp;
/* set in leader: dictionary of breakpoints */ /* set in leader: dictionary of breakpoints */
struct dict *breakpoints; struct dict *breakpoints;

View File

@ -94,6 +94,10 @@ void detach_proc(struct task *leader)
assert(leader->leader == leader); assert(leader->leader == leader);
breakpoint_disable_all(leader); breakpoint_disable_all(leader);
if (options.verbose > 1)
fprintf(stderr, "+++ process detach pid=%d sw-bp:%lu hw-bp:%lu +++\n", leader->pid, leader->num_sw_bp, leader->num_hw_bp);
each_task(leader, &detach_cb, NULL); each_task(leader, &detach_cb, NULL);
} }