Require always-non-stop for multi-target resumptions
[deliverable/binutils-gdb.git] / sim / rl78 / trace.c
index 12f78935f89fe4258be2db6355ef956bce8dcc0b..cba59e89693cf597cc2ec6cdce15ff98cd57dd18 100644 (file)
@@ -1,7 +1,6 @@
 /* trace.c --- tracing output for the RL78 simulator.
 
-   Copyright (C) 2005, 2007, 2008, 2009, 2010, 2011
-   Free Software Foundation, Inc.
+   Copyright (C) 2005-2020 Free Software Foundation, Inc.
    Contributed by Red Hat, Inc.
 
    This file is part of the GNU simulators.
@@ -38,6 +37,8 @@
 #include "mem.h"
 #include "load.h"
 
+static disassembler_ftype rl78_disasm_fn = NULL;
+
 static int
 sim_dis_read (bfd_vma memaddr, bfd_byte * ptr, unsigned int length,
              struct disassemble_info *info)
@@ -112,6 +113,7 @@ void
 sim_disasm_init (bfd *prog)
 {
   current_bfd = prog;
+  rl78_disasm_fn = NULL;
 }
 
 typedef struct Files
@@ -222,7 +224,7 @@ sim_get_current_source_location (const char **  pfilename,
          if (s->flags & SEC_CODE || code_section == 0)
            {
              code_section = s;
-             code_base = bfd_section_lma (current_bfd, s);
+             code_base = bfd_section_lma (s);
              break;
            }
        }
@@ -257,6 +259,18 @@ sim_disasm_one (void)
 
   trace = 0;
 
+  if (!rl78_disasm_fn)
+    {
+      if (rl78_g10_mode)
+       rl78_disasm_fn = print_insn_rl78_g10;
+      else if (g14_multiply)
+       rl78_disasm_fn = print_insn_rl78_g14;
+      else if (g13_multiply)
+       rl78_disasm_fn = print_insn_rl78_g13;
+      else
+       rl78_disasm_fn = print_insn_rl78;
+    }
+
   if (filename && functionname && lineno)
     {
       if (lineno != prev_lineno || strcmp (prev_filename, filename))
@@ -324,7 +338,7 @@ sim_disasm_one (void)
   printf ("\033[33m %08llx %06x: ", total_clocks, mypc);
 #endif
 
-  max = print_insn_rl78 (mypc, & info);
+  max = rl78_disasm_fn (mypc, & info);
 
   for (i = 0; i < max; i ++)
     printf ("%02x", mem_get_qi (mypc + i));
This page took 0.025119 seconds and 4 git commands to generate.