Index: infrun.c =================================================================== RCS file: /cvs/src/src/gdb/infrun.c,v retrieving revision 1.108 diff -u -p -r1.108 infrun.c --- infrun.c 5 May 2003 00:27:07 -0000 1.108 +++ infrun.c 5 May 2003 20:34:16 -0000 @@ -667,6 +667,12 @@ clear_proceed_status (void) bpstat_clear (&stop_bpstat); } + +/* Record the pc of the program the last time it stopped. This is + just used internally by wait_for_inferior, but need to be preserved + over calls to it and cleared when the inferior is started. */ +static CORE_ADDR prev_pc; + /* Basic routine for continuing the program in various fashions. ADDR is the address to resume at, or -1 for resume where stopped. @@ -772,6 +778,10 @@ proceed (CORE_ADDR addr, enum target_sig inferior. */ gdb_flush (gdb_stdout); + /* Refresh prev_pc value which may have been altered by an inferior + function call or a return command. */ + prev_pc = read_pc (); + /* Resume inferior. */ resume (oneproc || step || bpstat_should_step (), stop_signal); @@ -785,11 +795,6 @@ proceed (CORE_ADDR addr, enum target_sig normal_stop (); } } - -/* Record the pc of the program the last time it stopped. This is - just used internally by wait_for_inferior, but need to be preserved - over calls to it and cleared when the inferior is started. */ -static CORE_ADDR prev_pc; /* Start remote-debugging of a machine over a serial link. */