aboutsummaryrefslogtreecommitdiff
path: root/gdb/breakpoint.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2004-05-02 00:21:41 +0000
committerAndrew Cagney <cagney@redhat.com>2004-05-02 00:21:41 +0000
commit7789d0fa8245d35616961917b7c4702b97bd898f (patch)
tree4ff0cd6ae39225bcbc6f4d506e106ba0e1ac8891 /gdb/breakpoint.c
parent090df6852e2ff06f172598ab9fe01b5f21279e74 (diff)
downloadgdb-7789d0fa8245d35616961917b7c4702b97bd898f.zip
gdb-7789d0fa8245d35616961917b7c4702b97bd898f.tar.gz
gdb-7789d0fa8245d35616961917b7c4702b97bd898f.tar.bz2
2004-05-01 Andrew Cagney <cagney@redhat.com>
* breakpoint.c (insert_bp_location): Use get_frame_id, and frame_find_by_id instead of frame_relative_level. (do_enable_breakpoint): Ditto. * thread.c: Update copyright. (info_threads_command): Ditto, simplify.
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r--gdb/breakpoint.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 1633395..0fd4d23 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -910,18 +910,17 @@ insert_bp_location (struct bp_location *bpt,
must watch. As soon as a many-to-one mapping is available I'll
convert this. */
- struct frame_info *saved_frame;
- int saved_level, within_current_scope;
+ int within_current_scope;
struct value *mark = value_mark ();
struct value *v;
+ struct frame_id saved_frame_id;
- /* Save the current frame and level so we can restore it after
+ /* Save the current frame's ID so we can restore it after
evaluating the watchpoint expression on its own frame. */
/* FIXME drow/2003-09-09: It would be nice if evaluate_expression
took a frame parameter, so that we didn't have to change the
selected frame. */
- saved_frame = deprecated_selected_frame;
- saved_level = frame_relative_level (deprecated_selected_frame);
+ saved_frame_id = get_frame_id (deprecated_selected_frame);
/* Determine if the watchpoint is within scope. */
if (bpt->owner->exp_valid_block == NULL)
@@ -1018,10 +1017,8 @@ insert_bp_location (struct bp_location *bpt,
bpt->owner->disposition = disp_del_at_next_stop;
}
- /* Restore the frame and level. */
- if (saved_frame != deprecated_selected_frame
- || saved_level != frame_relative_level (deprecated_selected_frame))
- select_frame (saved_frame);
+ /* Restore the selected frame. */
+ select_frame (frame_find_by_id (saved_frame_id));
return val;
}
@@ -7564,8 +7561,6 @@ disable_command (char *args, int from_tty)
static void
do_enable_breakpoint (struct breakpoint *bpt, enum bpdisp disposition)
{
- struct frame_info *save_selected_frame = NULL;
- int save_selected_frame_level = -1;
int target_resources_ok, other_type_used;
struct value *mark;
@@ -7612,6 +7607,9 @@ do_enable_breakpoint (struct breakpoint *bpt, enum bpdisp disposition)
bpt->type == bp_read_watchpoint ||
bpt->type == bp_access_watchpoint)
{
+ struct frame_id saved_frame_id;
+
+ saved_frame_id = get_frame_id (get_selected_frame ());
if (bpt->exp_valid_block != NULL)
{
struct frame_info *fr =
@@ -7624,9 +7622,6 @@ is valid is not currently in scope.\n", bpt->number);
bpt->enable_state = bp_disabled;
return;
}
-
- save_selected_frame = deprecated_selected_frame;
- save_selected_frame_level = frame_relative_level (deprecated_selected_frame);
select_frame (fr);
}
@@ -7661,8 +7656,7 @@ have been allocated for other watchpoints.\n", bpt->number);
}
}
- if (save_selected_frame_level >= 0)
- select_frame (save_selected_frame);
+ select_frame (frame_find_by_id (saved_frame_id));
value_free_to_mark (mark);
}
}