The global cost counters, which are used for printing the
summary line, where zeroed before in init_exec_state(), called
by unwind_thread().
Stack unwinding (i.e. unwind_thread) is also done at instrumentation
state changes, and there, we want the cost counters to be zeroed
(was fix for bug 150606). Do this explicitly now.
PS: The correct fix for bug 150606 is not to zero the cost counters
(we do not really want this at instrumentation state changes), but
to store the current counter values in a "last_instr_state_on_cost"
counter, and use this as the global cost counter on enter for functions
which are left but were not detected to be entered.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10782
CLG_(current_fn_stack).top = CLG_(current_fn_stack).bottom;
}
+static
+void zero_state_cost(thread_info* t)
+{
+ CLG_(zero_cost)( CLG_(sets).full, CLG_(current_state).cost );
+}
+
/* Ups, this can go wrong... */
extern void VG_(discard_translations) ( Addr64 start, ULong range );
/* reset internal state: call stacks, simulator */
CLG_(forall_threads)(unwind_thread);
+ CLG_(forall_threads)(zero_state_cost);
(*CLG_(cachesim).clear)();
- if (0)
- CLG_(forall_threads)(zero_thread_cost);
if (VG_(clo_verbosity) > 1)
VG_(message)(Vg_DebugMsg, "%s: instrumentation switched %s\n",
/* setup new cxtinfo struct for this signal handler */
es = push_exec_state(sigNum);
- // because of this, below call to init_exec_state will zero es->cost
+ CLG_(zero_cost)( CLG_(sets).full, es->cost );
CLG_(current_state).cost = es->cost;
es->call_stack_bottom = CLG_(current_call_stack).sp;
es->jmps_passed = 0;
es->bbcc = 0;
es->nonskipped = 0;
- CLG_(init_cost)( CLG_(sets).full, es->cost );
}
/* allocate real cost space: needed as incremented by
* simulation functions */
es->cost = CLG_(get_eventset_cost)(CLG_(sets).full);
-
+ CLG_(zero_cost)( CLG_(sets).full, es->cost );
CLG_(init_exec_state)(es);
es->sig = sigNum;
es->call_stack_bottom = 0;