gdb: Convert language la_value_print field to a method
[deliverable/binutils-gdb.git] / sim / ft32 / interp.c
index 3bc08ee2e49f7f940199f939a794182246907449..d9ff14babb7c7dfdf7ecea306b12074ab72c736c 100644 (file)
@@ -1,6 +1,6 @@
 /* Simulator for the FT32 processor
 
-   Copyright (C) 2008-2017 Free Software Foundation, Inc.
+   Copyright (C) 2008-2020 Free Software Foundation, Inc.
    Contributed by FTDI <support@ftdichip.com>
 
    This file is part of simulators.
@@ -340,16 +340,24 @@ step_once (SIM_DESC sd)
   uint32_t bit_len;
   uint32_t upper;
   uint32_t insnpc;
+  unsigned int sc[2];
+  int isize;
 
-  if (cpu->state.cycles >= cpu->state.next_tick_cycle)
-    {
-      cpu->state.next_tick_cycle += 100000;
-      ft32_push (sd, cpu->state.pc);
-      cpu->state.pc = 12;  /* interrupt 1.  */
-    }
   inst = ft32_read_item (sd, 2, cpu->state.pc);
   cpu->state.cycles += 1;
 
+  if ((STATE_ARCHITECTURE (sd)->mach == bfd_mach_ft32b)
+      && ft32_decode_shortcode (cpu->state.pc, inst, sc))
+    {
+      if ((cpu->state.pc & 3) == 0)
+        inst = sc[0];
+      else
+        inst = sc[1];
+      isize = 2;
+    }
+  else
+    isize = 4;
+
   /* Handle "call 8" (which is FT32's "break" equivalent) here.  */
   if (inst == 0x00340002)
     {
@@ -390,7 +398,7 @@ step_once (SIM_DESC sd)
   upper = (inst >> 27);
 
   insnpc = cpu->state.pc;
-  cpu->state.pc += 4;
+  cpu->state.pc += isize;
   switch (upper)
     {
     case FT32_PAT_TOC:
This page took 0.030543 seconds and 4 git commands to generate.