Update PC when simulate break instruction.
authorDenis Chertykov <chertykov@gmail.com>
Tue, 19 Jul 2016 06:47:23 +0000 (09:47 +0300)
committerDenis Chertykov <chertykov@gmail.com>
Tue, 19 Jul 2016 06:47:23 +0000 (09:47 +0300)
PR target/ 19401
* avr/interp.c (step_once): Pass break instruction address to
sim_engine_halt function which writes that to PC. Remove code that
follows that function call as it is unreachable.

sim/ChangeLog
sim/avr/interp.c

index 76c384d..d7cc92c 100644 (file)
@@ -1,3 +1,10 @@
+2016-07-19  Pitchumani Sivanupandi  <pitchumani.s@atmel.com>
+
+       PR target/ 19401
+       * avr/interp.c (step_once): Pass break instruction address to
+       sim_engine_halt function which writes that to PC. Remove code that
+       follows that function call as it is unreachable.
+
 2016-02-03  Maciej W. Rozycki  <macro@linux-mips.org>
 
        * MAINTAINERS (Past sim maintainers): Add Thiemo Seufer.
index 31a9940..fcce9b2 100644 (file)
@@ -911,8 +911,7 @@ step_once (SIM_CPU *cpu)
 
       case OP_break:
        /* Stop on this address.  */
-       sim_engine_halt (CPU_STATE (cpu), cpu, NULL, cpu->pc, sim_stopped, SIM_SIGTRAP);
-       cpu->pc = ipc;
+       sim_engine_halt (CPU_STATE (cpu), cpu, NULL, ipc, sim_stopped, SIM_SIGTRAP);
        break;
 
       case OP_bld: