aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1993-09-30 21:42:23 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1993-09-30 21:42:23 +0000
commit2289e1c30be68c24c6b4e110773296928ecc4fe1 (patch)
treed83e268cf748c47709fa83f1cbc98c79fdf73b94
parentc5198d937809755e1893f84a78d795b49aaaca56 (diff)
downloadgdb-2289e1c30be68c24c6b4e110773296928ecc4fe1.zip
gdb-2289e1c30be68c24c6b4e110773296928ecc4fe1.tar.gz
gdb-2289e1c30be68c24c6b4e110773296928ecc4fe1.tar.bz2
* inflow.c (generic_mourn_inferior): Call reinit_frame_cache
instead of doing it ourself. * blockframe.c (reinit_frame_cache): Use code which was in generic_mourn_inferior so we can use this function even when we have switched targets. * corelow.c (core_detach): Call reinit_frame_cache. * target.c (target_detach): Don't call generic_mourn_inferior (revert yesterday's change, now handled by core_detach). * objfiles.c (free_objfile): Detach any core file if we call SOLIB_CLEAR. #include target.h.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/blockframe.c24
2 files changed, 22 insertions, 7 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 0ff6254..d471065 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
Thu Sep 30 11:30:56 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+ * inflow.c (generic_mourn_inferior): Call reinit_frame_cache
+ instead of doing it ourself.
+ * blockframe.c (reinit_frame_cache): Use code which was in
+ generic_mourn_inferior so we can use this function even when
+ we have switched targets.
* corelow.c (core_detach): Call reinit_frame_cache.
* target.c (target_detach): Don't call generic_mourn_inferior
(revert yesterday's change, now handled by core_detach).
diff --git a/gdb/blockframe.c b/gdb/blockframe.c
index 6430cba..a61face 100644
--- a/gdb/blockframe.c
+++ b/gdb/blockframe.c
@@ -186,10 +186,17 @@ flush_cached_frames ()
void
reinit_frame_cache ()
{
- FRAME fr = current_frame;
flush_cached_frames ();
- if (fr)
- set_current_frame ( create_new_frame (read_fp (), read_pc ()));
+ if (target_has_stack)
+ {
+ set_current_frame (create_new_frame (read_fp (), read_pc ()));
+ select_frame (get_current_frame (), 0);
+ }
+ else
+ {
+ set_current_frame (0);
+ select_frame ((FRAME) 0, -1);
+ }
}
/* Return a structure containing various interesting information
@@ -262,7 +269,7 @@ struct frame_info *
get_prev_frame_info (next_frame)
FRAME next_frame;
{
- FRAME_ADDR address;
+ FRAME_ADDR address = 0;
struct frame_info *prev;
int fromleaf = 0;
char *name;
@@ -725,7 +732,7 @@ find_pc_partial_function (pc, name, address, endaddr)
}
/* Return the innermost stack frame executing inside of BLOCK,
- or zero if there is no such frame. If BLOCK is NULL, just return NULL. */
+ or NULL if there is no such frame. If BLOCK is NULL, just return NULL. */
FRAME
block_innermost_frame (block)
@@ -733,12 +740,15 @@ block_innermost_frame (block)
{
struct frame_info *fi;
register FRAME frame;
- register CORE_ADDR start = BLOCK_START (block);
- register CORE_ADDR end = BLOCK_END (block);
+ register CORE_ADDR start;
+ register CORE_ADDR end;
if (block == NULL)
return NULL;
+ start = BLOCK_START (block);
+ end = BLOCK_END (block);
+
frame = 0;
while (1)
{