aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2002-12-11 22:34:47 +0000
committerAndrew Cagney <cagney@redhat.com>2002-12-11 22:34:47 +0000
commit818dd999829879775f22b319e1fe2c8c3a7f77b9 (patch)
treeb99aa20bd136480e564fa4585b38f15daf180aa1
parent4d3c225097b42b1df5e5b703c8e7c3cf9a15c4c3 (diff)
downloadgdb-818dd999829879775f22b319e1fe2c8c3a7f77b9.zip
gdb-818dd999829879775f22b319e1fe2c8c3a7f77b9.tar.gz
gdb-818dd999829879775f22b319e1fe2c8c3a7f77b9.tar.bz2
2002-12-06 Andrew Cagney <ac131313@redhat.com>
* breakpoint.h (struct breakpoint): Replace frame with frame_id. (set_momentary_breaokpoint): Replace `struct frame_info' parameter with `struct frame_id'. (set_longjmp_resume_breakpoint): Ditto. * infrun.c (handle_inferior_event): Update. * breakpoint.c (watch_command_1, until_break_command): Update. * infrun.c (handle_inferior_event, check_sigtramp2): Update. (handle_inferior_event, step_over_function): Update. * breakpoint.c (bpstat_stop_status, print_one_breakpoint): Update. (set_raw_breakpoint, set_longjmp_resume_breakpoint): Update. (set_momentary_breakpoint, deprecated_frame_in_dummy): Update. * infcmd.c (finish_command, run_stack_dummy): Update.
-rw-r--r--gdb/ChangeLog15
-rw-r--r--gdb/breakpoint.c38
-rw-r--r--gdb/breakpoint.h10
-rw-r--r--gdb/infcmd.c7
-rw-r--r--gdb/infrun.c21
5 files changed, 54 insertions, 37 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index dba36bb..32cd7f7 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,18 @@
+2002-12-11 Andrew Cagney <ac131313@redhat.com>
+
+ * breakpoint.h (struct breakpoint): Replace frame with frame_id.
+ (set_momentary_breaokpoint): Replace `struct frame_info' parameter
+ with `struct frame_id'.
+ (set_longjmp_resume_breakpoint): Ditto.
+ * infrun.c (handle_inferior_event): Update.
+ * breakpoint.c (watch_command_1, until_break_command): Update.
+ * infrun.c (handle_inferior_event, check_sigtramp2): Update.
+ (handle_inferior_event, step_over_function): Update.
+ * breakpoint.c (bpstat_stop_status, print_one_breakpoint): Update.
+ (set_raw_breakpoint, set_longjmp_resume_breakpoint): Update.
+ (set_momentary_breakpoint, deprecated_frame_in_dummy): Update.
+ * infcmd.c (finish_command, run_stack_dummy): Update.
+
2002-12-11 Kevin Buettner <kevinb@redhat.com>
* dwarf2read.c (dwarf2_const_ignored, dwarf2_volatile_ignored)
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 4c97aae..d575b53 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -1704,7 +1704,7 @@ deprecated_frame_in_dummy (struct frame_info *frame)
ALL_BREAKPOINTS (b)
{
if (b->type == bp_call_dummy
- && b->frame == get_frame_base (frame)
+ && frame_id_eq (b->frame_id, get_frame_id (frame))
/* We need to check the PC as well as the frame on the sparc,
for signals.exp in the testsuite. */
&& (get_frame_pc (frame)
@@ -2727,8 +2727,8 @@ bpstat_stop_status (CORE_ADDR *pc, int not_a_sw_breakpoint)
real_breakpoint = 1;
}
- if (b->frame &&
- b->frame != get_frame_base (get_current_frame ()))
+ if (frame_id_p (b->frame_id)
+ && !frame_id_eq (b->frame_id, get_frame_id (get_current_frame ())))
bs->stop = 0;
else
{
@@ -3417,11 +3417,13 @@ print_one_breakpoint (struct breakpoint *b,
ui_out_text (uiout, "\n");
- if (b->frame)
+ if (frame_id_p (b->frame_id))
{
annotate_field (6);
ui_out_text (uiout, "\tstop only in stack frame at ");
- ui_out_field_core_addr (uiout, "frame", b->frame);
+ /* FIXME: cagney/2002-12-01: Shouldn't be poeking around inside
+ the frame ID. */
+ ui_out_field_core_addr (uiout, "frame", b->frame_id.base);
ui_out_text (uiout, "\n");
}
@@ -3842,7 +3844,7 @@ set_raw_breakpoint (struct symtab_and_line sal, enum bptype bptype)
b->silent = 0;
b->ignore_count = 0;
b->commands = NULL;
- b->frame = 0;
+ b->frame_id = null_frame_id;
b->dll_pathname = NULL;
b->triggered_dll_pathname = NULL;
b->forked_inferior_pid = 0;
@@ -4308,7 +4310,7 @@ hw_watchpoint_used_count (enum bptype type, int *other_type_used)
that gets deleted automatically... */
void
-set_longjmp_resume_breakpoint (CORE_ADDR pc, struct frame_info *frame)
+set_longjmp_resume_breakpoint (CORE_ADDR pc, struct frame_id frame_id)
{
register struct breakpoint *b;
@@ -4317,10 +4319,7 @@ set_longjmp_resume_breakpoint (CORE_ADDR pc, struct frame_info *frame)
{
b->address = pc;
b->enable_state = bp_enabled;
- if (frame != NULL)
- b->frame = get_frame_base (frame);
- else
- b->frame = 0;
+ b->frame_id = frame_id;
check_duplicates (b);
return;
}
@@ -4372,14 +4371,14 @@ enable_watchpoints_after_interactive_call_stop (void)
Restrict it to frame FRAME if FRAME is nonzero. */
struct breakpoint *
-set_momentary_breakpoint (struct symtab_and_line sal, struct frame_info *frame,
+set_momentary_breakpoint (struct symtab_and_line sal, struct frame_id frame_id,
enum bptype type)
{
register struct breakpoint *b;
b = set_raw_breakpoint (sal, type);
b->enable_state = bp_enabled;
b->disposition = disp_donttouch;
- b->frame = (frame ? get_frame_base (frame) : 0);
+ b->frame_id = frame_id;
/* If we're debugging a multi-threaded program, then we
want momentary breakpoints to be active in only a
@@ -5428,7 +5427,7 @@ watch_command_1 (char *arg, int accessflag, int from_tty)
scope_breakpoint->disposition = disp_del;
/* Only break in the proper frame (help with recursion). */
- scope_breakpoint->frame = get_frame_base (prev_frame);
+ scope_breakpoint->frame_id = get_frame_id (prev_frame);
/* Set the address at which we will stop. */
scope_breakpoint->address = get_frame_pc (prev_frame);
@@ -5616,7 +5615,9 @@ until_break_command (char *arg, int from_tty)
resolve_sal_pc (&sal);
- breakpoint = set_momentary_breakpoint (sal, deprecated_selected_frame, bp_until);
+ breakpoint =
+ set_momentary_breakpoint (sal,get_frame_id (deprecated_selected_frame),
+ bp_until);
if (!event_loop_p || !target_can_async_p ())
old_chain = make_cleanup_delete_breakpoint (breakpoint);
@@ -5648,9 +5649,10 @@ until_break_command (char *arg, int from_tty)
if (prev_frame)
{
- sal = find_pc_line (get_frame_pc (prev_frame), 0);
- sal.pc = get_frame_pc (prev_frame);
- breakpoint = set_momentary_breakpoint (sal, prev_frame, bp_until);
+ sal = find_pc_line (prev_frame->pc, 0);
+ sal.pc = prev_frame->pc;
+ breakpoint = set_momentary_breakpoint (sal, get_frame_id (prev_frame),
+ bp_until);
if (!event_loop_p || !target_can_async_p ())
make_cleanup_delete_breakpoint (breakpoint);
else
diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h
index 0b59a0d..7b359cb 100644
--- a/gdb/breakpoint.h
+++ b/gdb/breakpoint.h
@@ -237,7 +237,7 @@ struct breakpoint
struct command_line *commands;
/* Stack depth (address of frame). If nonzero, break only if fp
equals this. */
- CORE_ADDR frame;
+ struct frame_id frame_id;
/* Conditional. Break only if this expression's value is nonzero. */
struct expression *cond;
@@ -521,9 +521,6 @@ enum breakpoint_here
/* Prototypes for breakpoint-related functions. */
-/* Forward declarations for prototypes */
-struct frame_info;
-
extern enum breakpoint_here breakpoint_here_p (CORE_ADDR);
extern int breakpoint_inserted_here_p (CORE_ADDR);
@@ -532,6 +529,7 @@ extern int breakpoint_inserted_here_p (CORE_ADDR);
implements a functional superset of this function. The only reason
it hasn't been removed is because some architectures still don't
use the new framework. Once they have been fixed, this can go. */
+struct frame_info;
extern int deprecated_frame_in_dummy (struct frame_info *);
extern int breakpoint_thread_match (CORE_ADDR, ptid_t);
@@ -545,7 +543,7 @@ extern void breakpoint_re_set_thread (struct breakpoint *);
extern int ep_is_exception_catchpoint (struct breakpoint *);
extern struct breakpoint *set_momentary_breakpoint
- (struct symtab_and_line, struct frame_info *, enum bptype);
+ (struct symtab_and_line, struct frame_id, enum bptype);
extern void set_ignore_count (int, int, int);
@@ -619,7 +617,7 @@ extern void disable_longjmp_breakpoint (void);
extern void enable_overlay_breakpoints (void);
extern void disable_overlay_breakpoints (void);
-extern void set_longjmp_resume_breakpoint (CORE_ADDR, struct frame_info *);
+extern void set_longjmp_resume_breakpoint (CORE_ADDR, struct frame_id);
/* These functions respectively disable or reenable all currently
enabled watchpoints. When disabled, the watchpoints are marked
call_disabled. When reenabled, they are marked enabled.
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index a455129..c8b5aa2 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -1018,8 +1018,11 @@ run_stack_dummy (CORE_ADDR addr, struct regcache *buffer)
addr is the address of the call dummy plus the CALL_DUMMY_START_OFFSET,
so we need to subtract the CALL_DUMMY_START_OFFSET. */
+ /* FIXME: cagney/2002-12-01: Rather than pass in curent frame,
+ why not just create, and then pass in a frame ID. This would
+ make it possible to eliminate set_current_frame(). */
bpt = set_momentary_breakpoint (sal,
- get_current_frame (),
+ get_frame_id (get_current_frame ()),
bp_call_dummy);
bpt->disposition = disp_del;
@@ -1284,7 +1287,7 @@ finish_command (char *arg, int from_tty)
sal = find_pc_line (get_frame_pc (frame), 0);
sal.pc = get_frame_pc (frame);
- breakpoint = set_momentary_breakpoint (sal, frame, bp_finish);
+ breakpoint = set_momentary_breakpoint (sal, get_frame_id (frame), bp_finish);
if (!event_loop_p || !target_can_async_p ())
old_chain = make_cleanup_delete_breakpoint (breakpoint);
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 0bb2e75..60adc59 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -2063,7 +2063,7 @@ process_event_stop_test:
set_longjmp_resume_breakpoint (jmp_buf_pc, get_current_frame ());
else
#endif /* 0 */
- set_longjmp_resume_breakpoint (jmp_buf_pc, NULL);
+ set_longjmp_resume_breakpoint (jmp_buf_pc, null_frame_id);
ecs->handling_longjmp = 1; /* FIXME */
keep_going (ecs);
return;
@@ -2356,7 +2356,7 @@ process_event_stop_test:
check_for_old_step_resume_breakpoint ();
step_resume_breakpoint =
- set_momentary_breakpoint (sr_sal, NULL, bp_step_resume);
+ set_momentary_breakpoint (sr_sal, null_frame_id, bp_step_resume);
if (breakpoints_inserted)
insert_breakpoints ();
}
@@ -2412,7 +2412,7 @@ process_event_stop_test:
step_frame_id; I don't think anyone thought to try it. */
check_for_old_step_resume_breakpoint ();
step_resume_breakpoint =
- set_momentary_breakpoint (sr_sal, NULL, bp_step_resume);
+ set_momentary_breakpoint (sr_sal, null_frame_id, bp_step_resume);
if (breakpoints_inserted)
insert_breakpoints ();
}
@@ -2521,7 +2521,7 @@ process_event_stop_test:
xxx.section = find_pc_overlay (xxx.pc);
check_for_old_step_resume_breakpoint ();
step_resume_breakpoint =
- set_momentary_breakpoint (xxx, NULL, bp_step_resume);
+ set_momentary_breakpoint (xxx, null_frame_id, bp_step_resume);
insert_breakpoints ();
keep_going (ecs);
return;
@@ -2599,7 +2599,7 @@ process_event_stop_test:
is where the new fp value is established. */
check_for_old_step_resume_breakpoint ();
step_resume_breakpoint =
- set_momentary_breakpoint (sr_sal, NULL, bp_step_resume);
+ set_momentary_breakpoint (sr_sal, null_frame_id, bp_step_resume);
if (breakpoints_inserted)
insert_breakpoints ();
@@ -2713,7 +2713,7 @@ check_sigtramp2 (struct execution_control_state *ecs)
/* We perhaps could set the frame if we kept track of what the
frame corresponding to prev_pc was. But we don't, so don't. */
through_sigtramp_breakpoint =
- set_momentary_breakpoint (sr_sal, NULL, bp_through_sigtramp);
+ set_momentary_breakpoint (sr_sal, null_frame_id, bp_through_sigtramp);
if (breakpoints_inserted)
insert_breakpoints ();
@@ -2771,7 +2771,7 @@ step_into_function (struct execution_control_state *ecs)
established. */
check_for_old_step_resume_breakpoint ();
step_resume_breakpoint =
- set_momentary_breakpoint (sr_sal, NULL, bp_step_resume);
+ set_momentary_breakpoint (sr_sal, null_frame_id, bp_step_resume);
if (breakpoints_inserted)
insert_breakpoints ();
@@ -2804,13 +2804,12 @@ step_over_function (struct execution_control_state *ecs)
check_for_old_step_resume_breakpoint ();
step_resume_breakpoint =
- set_momentary_breakpoint (sr_sal, get_current_frame (), bp_step_resume);
+ set_momentary_breakpoint (sr_sal, get_frame_id (get_current_frame ()),
+ bp_step_resume);
if (frame_id_p (step_frame_id)
&& !IN_SOLIB_DYNSYM_RESOLVE_CODE (sr_sal.pc))
- /* FIXME: cagney/2002-12-01: Someone should modify the breakpoint
- code so that it uses a frame ID, instead of a frame address. */
- step_resume_breakpoint->frame = step_frame_id.base;
+ step_resume_breakpoint->frame_id = step_frame_id;
if (breakpoints_inserted)
insert_breakpoints ();