2008-03-02 Jan Kratochvil * breakpoint.c (update_watchpoint): Move B->VAL setting behind the VALUE_CONTENTS call. --- ./gdb/breakpoint.c 27 Feb 2008 20:27:49 -0000 1.304 +++ ./gdb/breakpoint.c 2 Mar 2008 08:27:20 -0000 @@ -913,13 +917,15 @@ update_watchpoint (struct breakpoint *b, during evaluation, and set watchoints at addresses as needed. Those values are explicitly deleted here. */ v = evaluate_expression (b->exp); + /* Fetch the value first as if ti fails and breaks out by the exception + there will be no stale V left in B->VAL. */ + value_contents (v); /* Avoid setting b->val if it's already set. The meaning of b->val is 'the last value' user saw, and we should update it only if we reported that last value to user. As it happens, the code that reports it updates b->val directly. */ if (b->val == NULL) b->val = v; - value_contents (v); value_release_to_mark (mark); /* Look at each value on the value chain. */