diff --git a/sysdeps/linux-gnu/trace.c b/sysdeps/linux-gnu/trace.c index 292af11..314deb4 100644 --- a/sysdeps/linux-gnu/trace.c +++ b/sysdeps/linux-gnu/trace.c @@ -260,6 +260,9 @@ static void process_event(struct task *task, int status) if (bp) { assert(bp->type != SW_BP); assert(bp->hw_bp_slot == i); + + if (options.verbose > 1) + ++leader->num_hw_bp; } else #endif @@ -269,6 +272,9 @@ static void process_event(struct task *task, int status) return; assert(bp->type == SW_BP); + if (options.verbose > 1) + ++leader->num_sw_bp; + set_instruction_pointer(task, bp->addr); } #if 1 diff --git a/task.h b/task.h index fec0cc6..41b0aa5 100644 --- a/task.h +++ b/task.h @@ -81,6 +81,9 @@ struct task { /* set in leader: number of stopped threads including the leader */ unsigned int threads_stopped; + unsigned long num_hw_bp; + unsigned long num_sw_bp; + /* set in leader: dictionary of breakpoints */ struct dict *breakpoints; diff --git a/trace.c b/trace.c index 11143bf..efa26f2 100644 --- a/trace.c +++ b/trace.c @@ -94,6 +94,10 @@ void detach_proc(struct task *leader) assert(leader->leader == 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); }