aboutsummaryrefslogtreecommitdiff
path: root/gdb/infrun.c
diff options
context:
space:
mode:
authorStu Grossman <grossman@cygnus>1993-10-25 22:24:02 +0000
committerStu Grossman <grossman@cygnus>1993-10-25 22:24:02 +0000
commitb58a197344d539b878e5c0c5cdb90dba4e8f9feb (patch)
treeb0b95965cda3f99f5ce0118abd064a1e9e80dda5 /gdb/infrun.c
parent3c1423d6458909187ccf6257f4ce97be5f99dc0c (diff)
downloadgdb-b58a197344d539b878e5c0c5cdb90dba4e8f9feb.zip
gdb-b58a197344d539b878e5c0c5cdb90dba4e8f9feb.tar.gz
gdb-b58a197344d539b878e5c0c5cdb90dba4e8f9feb.tar.bz2
* infrun.c (wait_for_inferior): Fix PC out of subroutine bounds
check to use prev_func_start/end instead of stop_func_start/end. * remote-udi.c (store_register): Invalidate NPC/PC_REGNUM after changing PC.
Diffstat (limited to 'gdb/infrun.c')
-rw-r--r--gdb/infrun.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 85ebb38..6e75dc1 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -335,6 +335,7 @@ The same program may be running in another process.");
static CORE_ADDR prev_pc;
static CORE_ADDR prev_sp;
static CORE_ADDR prev_func_start;
+static CORE_ADDR prev_func_end;
static char *prev_func_name;
@@ -979,12 +980,11 @@ switch_thread:
or the call instruction itself saves the PC on the stack. */
|| prologue_pc != stop_func_start
|| stop_sp != prev_sp)
- && (/* I think this can only happen if stop_func_start is zero
- (e.g. stop_pc is in some objfile we don't know about).
- If the stop_pc does that (ends up someplace unknown), it
- must be some sort of subroutine call. */
- stop_pc < stop_func_start
- || stop_pc >= stop_func_end
+ && (/* PC is out of bounds of the current function. Note that this
+ seems sorta redundant w.r.t the prior test of stop_func_start
+ != prev_func_start... */
+ stop_pc < prev_func_start
+ || stop_pc >= prev_func_end
/* If we do a call, we will be at the start of a function. */
|| stop_pc == stop_func_start
@@ -1201,6 +1201,7 @@ step_into_function:
original pc would not have
been at the start of a
function. */
+ prev_func_end = stop_func_end;
prev_func_name = stop_func_name;
prev_sp = stop_sp;
@@ -1275,6 +1276,7 @@ step_into_function:
loop. */
prev_pc = read_pc ();
prev_func_start = stop_func_start;
+ prev_func_end = stop_func_end;
prev_func_name = stop_func_name;
prev_sp = stop_sp;
}