* frame.c (frame_pop, frame_observer_target_changed): Call
reinit_frame_cache. (flush_cached_frames): Rename to reinit_frame_cache and delete old implementation. * frame.h (flush_cached_frames): Delete prototype and update comment. * bsd-kvm.c (bsd_kvm_open, bsd_kvm_proc_cmd, bsd_kvm_pcb_cmd): Call reinit_frame_cache instead of flush_cached_frames. Do not call select_frame after reinit_frame_cache. * corelow.c (core_open): Likewise. * gdbarch.sh (deprecated_current_gdbarch_select_hack): Likewise. * infrun.c (prepare_to_proceed, context_switch) (handle_inferior_event): Likewise. * linux-fork.c (fork_load_infrun_state): Likewise. * ocd.c (ocd_start_remote): Likewise. * remote-e7000.c (e7000_start_remote): Likewise. * remote-mips.c (device): Likewise. * thread.c (switch_to_thread): Likewise. * tracepoint.c (finish_tfind_command): Likewise. * gdbarch.c: Regenerated.
This commit is contained in:
parent
664e3ee9c3
commit
35f196d907
14 changed files with 47 additions and 56 deletions
|
@ -1,3 +1,26 @@
|
||||||
|
2007-02-28 Daniel Jacobowitz <dan@codesourcery.com>
|
||||||
|
|
||||||
|
* frame.c (frame_pop, frame_observer_target_changed): Call
|
||||||
|
reinit_frame_cache.
|
||||||
|
(flush_cached_frames): Rename to reinit_frame_cache and delete
|
||||||
|
old implementation.
|
||||||
|
* frame.h (flush_cached_frames): Delete prototype and update comment.
|
||||||
|
|
||||||
|
* bsd-kvm.c (bsd_kvm_open, bsd_kvm_proc_cmd, bsd_kvm_pcb_cmd): Call
|
||||||
|
reinit_frame_cache instead of flush_cached_frames. Do not call
|
||||||
|
select_frame after reinit_frame_cache.
|
||||||
|
* corelow.c (core_open): Likewise.
|
||||||
|
* gdbarch.sh (deprecated_current_gdbarch_select_hack): Likewise.
|
||||||
|
* infrun.c (prepare_to_proceed, context_switch)
|
||||||
|
(handle_inferior_event): Likewise.
|
||||||
|
* linux-fork.c (fork_load_infrun_state): Likewise.
|
||||||
|
* ocd.c (ocd_start_remote): Likewise.
|
||||||
|
* remote-e7000.c (e7000_start_remote): Likewise.
|
||||||
|
* remote-mips.c (device): Likewise.
|
||||||
|
* thread.c (switch_to_thread): Likewise.
|
||||||
|
* tracepoint.c (finish_tfind_command): Likewise.
|
||||||
|
* gdbarch.c: Regenerated.
|
||||||
|
|
||||||
2007-02-28 Jerome Guitton <guitton@adacore.com>
|
2007-02-28 Jerome Guitton <guitton@adacore.com>
|
||||||
Joel Brobecker <brobecker@adacore.com>
|
Joel Brobecker <brobecker@adacore.com>
|
||||||
|
|
||||||
|
|
|
@ -93,8 +93,7 @@ bsd_kvm_open (char *filename, int from_tty)
|
||||||
|
|
||||||
target_fetch_registers (-1);
|
target_fetch_registers (-1);
|
||||||
|
|
||||||
flush_cached_frames ();
|
reinit_frame_cache ();
|
||||||
select_frame (get_current_frame ());
|
|
||||||
print_stack_frame (get_selected_frame (NULL), -1, 1);
|
print_stack_frame (get_selected_frame (NULL), -1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -276,8 +275,7 @@ bsd_kvm_proc_cmd (char *arg, int fromtty)
|
||||||
|
|
||||||
target_fetch_registers (-1);
|
target_fetch_registers (-1);
|
||||||
|
|
||||||
flush_cached_frames ();
|
reinit_frame_cache ();
|
||||||
select_frame (get_current_frame ());
|
|
||||||
print_stack_frame (get_selected_frame (NULL), -1, 1);
|
print_stack_frame (get_selected_frame (NULL), -1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -297,8 +295,7 @@ bsd_kvm_pcb_cmd (char *arg, int fromtty)
|
||||||
|
|
||||||
target_fetch_registers (-1);
|
target_fetch_registers (-1);
|
||||||
|
|
||||||
flush_cached_frames ();
|
reinit_frame_cache ();
|
||||||
select_frame (get_current_frame ());
|
|
||||||
print_stack_frame (get_selected_frame (NULL), -1, 1);
|
print_stack_frame (get_selected_frame (NULL), -1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -378,8 +378,7 @@ core_open (char *filename, int from_tty)
|
||||||
target_fetch_registers (-1);
|
target_fetch_registers (-1);
|
||||||
|
|
||||||
/* Now, set up the frame cache, and print the top of stack. */
|
/* Now, set up the frame cache, and print the top of stack. */
|
||||||
flush_cached_frames ();
|
reinit_frame_cache ();
|
||||||
select_frame (get_current_frame ());
|
|
||||||
print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC);
|
print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
22
gdb/frame.c
22
gdb/frame.c
|
@ -537,7 +537,7 @@ frame_pop (struct frame_info *this_frame)
|
||||||
|
|
||||||
/* We've made right mess of GDB's local state, just discard
|
/* We've made right mess of GDB's local state, just discard
|
||||||
everything. */
|
everything. */
|
||||||
flush_cached_frames ();
|
reinit_frame_cache ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1070,13 +1070,13 @@ get_next_frame (struct frame_info *this_frame)
|
||||||
void
|
void
|
||||||
frame_observer_target_changed (struct target_ops *target)
|
frame_observer_target_changed (struct target_ops *target)
|
||||||
{
|
{
|
||||||
flush_cached_frames ();
|
reinit_frame_cache ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Flush the entire frame cache. */
|
/* Flush the entire frame cache. */
|
||||||
|
|
||||||
void
|
void
|
||||||
flush_cached_frames (void)
|
reinit_frame_cache (void)
|
||||||
{
|
{
|
||||||
/* Since we can't really be sure what the first object allocated was */
|
/* Since we can't really be sure what the first object allocated was */
|
||||||
obstack_free (&frame_cache_obstack, 0);
|
obstack_free (&frame_cache_obstack, 0);
|
||||||
|
@ -1086,21 +1086,7 @@ flush_cached_frames (void)
|
||||||
select_frame (NULL);
|
select_frame (NULL);
|
||||||
annotate_frames_invalid ();
|
annotate_frames_invalid ();
|
||||||
if (frame_debug)
|
if (frame_debug)
|
||||||
fprintf_unfiltered (gdb_stdlog, "{ flush_cached_frames () }\n");
|
fprintf_unfiltered (gdb_stdlog, "{ reinit_frame_cache () }\n");
|
||||||
}
|
|
||||||
|
|
||||||
/* Flush the frame cache, and start a new one if necessary. */
|
|
||||||
|
|
||||||
void
|
|
||||||
reinit_frame_cache (void)
|
|
||||||
{
|
|
||||||
flush_cached_frames ();
|
|
||||||
|
|
||||||
/* FIXME: The inferior_ptid test is wrong if there is a corefile. */
|
|
||||||
if (PIDGET (inferior_ptid) != 0)
|
|
||||||
{
|
|
||||||
select_frame (get_current_frame ());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Find where a register is saved (in memory or another register).
|
/* Find where a register is saved (in memory or another register).
|
||||||
|
|
15
gdb/frame.h
15
gdb/frame.h
|
@ -225,17 +225,10 @@ extern struct frame_info *get_current_frame (void);
|
||||||
/* Invalidates the frame cache (this function should have been called
|
/* Invalidates the frame cache (this function should have been called
|
||||||
invalidate_cached_frames).
|
invalidate_cached_frames).
|
||||||
|
|
||||||
FIXME: cagney/2002-11-28: The only difference between
|
FIXME: cagney/2002-11-28: There should be two methods: one that
|
||||||
flush_cached_frames() and reinit_frame_cache() is that the latter
|
reverts the thread's selected frame back to current frame (for when
|
||||||
explicitly sets the selected frame back to the current frame -- there
|
the inferior resumes) and one that does not (for when the user
|
||||||
isn't any real difference (except that one delays the selection of
|
modifies the target invalidating the frame cache). */
|
||||||
a new frame). Code can instead simply rely on get_selected_frame()
|
|
||||||
to reinit the selected frame as needed. As for invalidating the
|
|
||||||
cache, there should be two methods: one that reverts the thread's
|
|
||||||
selected frame back to current frame (for when the inferior
|
|
||||||
resumes) and one that does not (for when the user modifies the
|
|
||||||
target invalidating the frame cache). */
|
|
||||||
extern void flush_cached_frames (void);
|
|
||||||
extern void reinit_frame_cache (void);
|
extern void reinit_frame_cache (void);
|
||||||
|
|
||||||
/* On demand, create the selected frame and then return it. If the
|
/* On demand, create the selected frame and then return it. If the
|
||||||
|
|
|
@ -4202,7 +4202,7 @@ deprecated_current_gdbarch_select_hack (struct gdbarch *new_gdbarch)
|
||||||
current_gdbarch_swap_out_hack ();
|
current_gdbarch_swap_out_hack ();
|
||||||
current_gdbarch_swap_in_hack (new_gdbarch);
|
current_gdbarch_swap_in_hack (new_gdbarch);
|
||||||
architecture_changed_event ();
|
architecture_changed_event ();
|
||||||
flush_cached_frames ();
|
reinit_frame_cache ();
|
||||||
}
|
}
|
||||||
|
|
||||||
extern void _initialize_gdbarch (void);
|
extern void _initialize_gdbarch (void);
|
||||||
|
|
|
@ -2241,7 +2241,7 @@ deprecated_current_gdbarch_select_hack (struct gdbarch *new_gdbarch)
|
||||||
current_gdbarch_swap_out_hack ();
|
current_gdbarch_swap_out_hack ();
|
||||||
current_gdbarch_swap_in_hack (new_gdbarch);
|
current_gdbarch_swap_in_hack (new_gdbarch);
|
||||||
architecture_changed_event ();
|
architecture_changed_event ();
|
||||||
flush_cached_frames ();
|
reinit_frame_cache ();
|
||||||
}
|
}
|
||||||
|
|
||||||
extern void _initialize_gdbarch (void);
|
extern void _initialize_gdbarch (void);
|
||||||
|
|
11
gdb/infrun.c
11
gdb/infrun.c
|
@ -686,10 +686,9 @@ prepare_to_proceed (void)
|
||||||
|
|
||||||
/* FIXME: This stuff came from switch_to_thread() in
|
/* FIXME: This stuff came from switch_to_thread() in
|
||||||
thread.c (which should probably be a public function). */
|
thread.c (which should probably be a public function). */
|
||||||
flush_cached_frames ();
|
reinit_frame_cache ();
|
||||||
registers_changed ();
|
registers_changed ();
|
||||||
stop_pc = wait_pc;
|
stop_pc = wait_pc;
|
||||||
select_frame (get_current_frame ());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We return 1 to indicate that there is a breakpoint here,
|
/* We return 1 to indicate that there is a breakpoint here,
|
||||||
|
@ -1157,7 +1156,7 @@ context_switch (struct execution_control_state *ecs)
|
||||||
&ecs->current_line, &ecs->current_symtab);
|
&ecs->current_line, &ecs->current_symtab);
|
||||||
}
|
}
|
||||||
inferior_ptid = ecs->ptid;
|
inferior_ptid = ecs->ptid;
|
||||||
flush_cached_frames ();
|
reinit_frame_cache ();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1304,7 +1303,7 @@ handle_inferior_event (struct execution_control_state *ecs)
|
||||||
}
|
}
|
||||||
ecs->infwait_state = infwait_normal_state;
|
ecs->infwait_state = infwait_normal_state;
|
||||||
|
|
||||||
flush_cached_frames ();
|
reinit_frame_cache ();
|
||||||
|
|
||||||
/* If it's a new process, add it to the thread database */
|
/* If it's a new process, add it to the thread database */
|
||||||
|
|
||||||
|
@ -1429,7 +1428,7 @@ handle_inferior_event (struct execution_control_state *ecs)
|
||||||
if (!ptid_equal (ecs->ptid, inferior_ptid))
|
if (!ptid_equal (ecs->ptid, inferior_ptid))
|
||||||
{
|
{
|
||||||
context_switch (ecs);
|
context_switch (ecs);
|
||||||
flush_cached_frames ();
|
reinit_frame_cache ();
|
||||||
}
|
}
|
||||||
|
|
||||||
stop_pc = read_pc ();
|
stop_pc = read_pc ();
|
||||||
|
@ -1490,7 +1489,7 @@ handle_inferior_event (struct execution_control_state *ecs)
|
||||||
if (!ptid_equal (ecs->ptid, inferior_ptid))
|
if (!ptid_equal (ecs->ptid, inferior_ptid))
|
||||||
{
|
{
|
||||||
context_switch (ecs);
|
context_switch (ecs);
|
||||||
flush_cached_frames ();
|
reinit_frame_cache ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If no catchpoint triggered for this, then keep going. */
|
/* If no catchpoint triggered for this, then keep going. */
|
||||||
|
|
|
@ -250,10 +250,6 @@ fork_load_infrun_state (struct fork_info *fp)
|
||||||
registers_changed ();
|
registers_changed ();
|
||||||
reinit_frame_cache ();
|
reinit_frame_cache ();
|
||||||
|
|
||||||
/* We must select a new frame before making any inferior calls to
|
|
||||||
avoid warnings. */
|
|
||||||
select_frame (get_current_frame ());
|
|
||||||
|
|
||||||
stop_pc = read_pc ();
|
stop_pc = read_pc ();
|
||||||
nullify_last_target_wait_ptid ();
|
nullify_last_target_wait_ptid ();
|
||||||
|
|
||||||
|
|
|
@ -223,7 +223,7 @@ ocd_start_remote (void *dummy)
|
||||||
doesn't happen here (in fact, it may not be possible to get the monitor to
|
doesn't happen here (in fact, it may not be possible to get the monitor to
|
||||||
send the appropriate packet). */
|
send the appropriate packet). */
|
||||||
|
|
||||||
flush_cached_frames ();
|
reinit_frame_cache ();
|
||||||
registers_changed ();
|
registers_changed ();
|
||||||
stop_pc = read_pc ();
|
stop_pc = read_pc ();
|
||||||
print_stack_frame (get_selected_frame (NULL), 0, SRC_AND_LOC);
|
print_stack_frame (get_selected_frame (NULL), 0, SRC_AND_LOC);
|
||||||
|
|
|
@ -628,7 +628,7 @@ e7000_start_remote (void *dummy)
|
||||||
that the target is about to print out a status message of some sort. That
|
that the target is about to print out a status message of some sort. That
|
||||||
doesn't happen here. */
|
doesn't happen here. */
|
||||||
|
|
||||||
flush_cached_frames ();
|
reinit_frame_cache ();
|
||||||
registers_changed ();
|
registers_changed ();
|
||||||
stop_pc = read_pc ();
|
stop_pc = read_pc ();
|
||||||
print_stack_frame (get_selected_frame (NULL), 0, SRC_AND_LOC);
|
print_stack_frame (get_selected_frame (NULL), 0, SRC_AND_LOC);
|
||||||
|
|
|
@ -1584,7 +1584,7 @@ device is attached to the target board (e.g., /dev/ttya).\n"
|
||||||
of some sort. That doesn't happen here (in fact, it may not be
|
of some sort. That doesn't happen here (in fact, it may not be
|
||||||
possible to get the monitor to send the appropriate packet). */
|
possible to get the monitor to send the appropriate packet). */
|
||||||
|
|
||||||
flush_cached_frames ();
|
reinit_frame_cache ();
|
||||||
registers_changed ();
|
registers_changed ();
|
||||||
stop_pc = read_pc ();
|
stop_pc = read_pc ();
|
||||||
print_stack_frame (get_selected_frame (NULL), 0, SRC_AND_LOC);
|
print_stack_frame (get_selected_frame (NULL), 0, SRC_AND_LOC);
|
||||||
|
|
|
@ -461,10 +461,9 @@ switch_to_thread (ptid_t ptid)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
inferior_ptid = ptid;
|
inferior_ptid = ptid;
|
||||||
flush_cached_frames ();
|
reinit_frame_cache ();
|
||||||
registers_changed ();
|
registers_changed ();
|
||||||
stop_pc = read_pc ();
|
stop_pc = read_pc ();
|
||||||
select_frame (get_current_frame ());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -1969,9 +1969,8 @@ finish_tfind_command (char **msg,
|
||||||
error (_("Bogus reply from target: %s"), reply);
|
error (_("Bogus reply from target: %s"), reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
flush_cached_frames ();
|
reinit_frame_cache ();
|
||||||
registers_changed ();
|
registers_changed ();
|
||||||
select_frame (get_current_frame ());
|
|
||||||
set_traceframe_num (target_frameno);
|
set_traceframe_num (target_frameno);
|
||||||
set_tracepoint_num (target_tracept);
|
set_tracepoint_num (target_tracept);
|
||||||
if (target_frameno == -1)
|
if (target_frameno == -1)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue