* hppa-pinsn.c (print_insn): Improve handling of be and ble
[deliverable/binutils-gdb.git] / gdb / infrun.c
index 16404f305747ab94bd06fad22901630ba42122a5..ab4e3e0f986c4c961e22093219396829afe4d5c7 100644 (file)
@@ -186,6 +186,16 @@ hook_stop_stub PARAMS ((char *));
 #define IN_SOLIB_TRAMPOLINE(pc,name)   0
 #endif
 
+/* On some systems, the PC may be left pointing at an instruction that  won't
+   actually be executed.  This is usually indicated by a bit in the PSW.  If
+   we find ourselves in such a state, then we step the target beyond the
+   nullified instruction before returning control to the user so as to avoid
+   confusion. */
+
+#ifndef INSTRUCTION_NULLIFIED
+#define INSTRUCTION_NULLIFIED 0
+#endif
+
 #ifdef TDESC
 #include "tdesc.h"
 int safe_to_init_tdesc_context = 0;
@@ -576,6 +586,15 @@ wait_for_inferior ()
        single_step (0);        /* This actually cleans up the ss */
 #endif /* NO_SINGLE_STEP */
       
+/* If PC is pointing at a nullified instruction, then step beyond it so that
+   the user won't be confused when GDB appears to be ready to execute it. */
+
+      if (INSTRUCTION_NULLIFIED)
+       {
+         resume (1, 0);
+         continue;
+       }
+
       stop_pc = read_pc ();
       set_current_frame ( create_new_frame (read_register (FP_REGNUM),
                                            read_pc ()));
@@ -973,7 +992,7 @@ wait_for_inferior ()
              if (tmp != 0)
                stop_func_start = tmp;
 
-             symtab = find_pc_symtab (stop_pc);
+             symtab = find_pc_symtab (stop_func_start);
              if (symtab && LINETABLE (symtab))
                goto step_into_function;
 
This page took 0.023264 seconds and 4 git commands to generate.