]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - sim/avr/interp.c
sim: cgen: move cgen_cpu_max_extra_bytes logic into the common code
[thirdparty/binutils-gdb.git] / sim / avr / interp.c
index 31a99407bd23a7f0b45303424737cf54cb5b1683..c806f4c46eba330e58f2d538c2b759f068f30c9b 100644 (file)
@@ -1,5 +1,5 @@
 /* Simulator for Atmel's AVR core.
 /* Simulator for Atmel's AVR core.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
    Written by Tristan Gingold, AdaCore.
 
    This file is part of GDB, the GNU debugger.
    Written by Tristan Gingold, AdaCore.
 
    This file is part of GDB, the GNU debugger.
@@ -19,9 +19,8 @@
 
 #include "config.h"
 
 
 #include "config.h"
 
-#ifdef HAVE_STRING_H
 #include <string.h>
 #include <string.h>
-#endif
+
 #include "bfd.h"
 #include "libiberty.h"
 #include "gdb/remote-sim.h"
 #include "bfd.h"
 #include "libiberty.h"
 #include "gdb/remote-sim.h"
@@ -911,8 +910,7 @@ step_once (SIM_CPU *cpu)
 
       case OP_break:
        /* Stop on this address.  */
 
       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:
        break;
 
       case OP_bld:
@@ -1686,19 +1684,12 @@ sim_open (SIM_OPEN_KIND kind, host_callback *cb,
   SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
 
   /* The cpu data is kept in a separately allocated chunk of memory.  */
   SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
 
   /* The cpu data is kept in a separately allocated chunk of memory.  */
-  if (sim_cpu_alloc_all (sd, 1, /*cgen_cpu_max_extra_bytes ()*/0) != SIM_RC_OK)
+  if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
     {
       free_state (sd);
       return 0;
     }
 
     {
       free_state (sd);
       return 0;
     }
 
-  {
-    /* XXX: Only first core gets profiled ?  */
-    SIM_CPU *cpu = STATE_CPU (sd, 0);
-    STATE_WATCHPOINTS (sd)->pc = &cpu->pc;
-    STATE_WATCHPOINTS (sd)->sizeof_pc = sizeof (cpu->pc);
-  }
-
   if (sim_pre_argv_init (sd, argv[0]) != SIM_RC_OK)
     {
       free_state (sd);
   if (sim_pre_argv_init (sd, argv[0]) != SIM_RC_OK)
     {
       free_state (sd);