]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
sim: cris: use standard output helpers
authorMike Frysinger <vapier@gentoo.org>
Sat, 2 Jan 2016 16:11:09 +0000 (11:11 -0500)
committerMike Frysinger <vapier@gentoo.org>
Sat, 2 Jan 2016 19:00:48 +0000 (14:00 -0500)
The sim-io module provides output helpers, so no need to define local
ones anymore.

sim/cris/ChangeLog
sim/cris/sim-if.c

index df428e7f774fd36a7ad7876f6169381191c81fee..1e28c12b937870fe27a930deb5162e00d609a5cb 100644 (file)
@@ -1,3 +1,9 @@
+2016-01-02  Mike Frysinger  <vapier@gentoo.org>
+
+       * sim-if.c (xprintf, eprintf): Delete.
+       (cris_load_elf_file): Delete callback.  Change xprintf to
+       sim_io_printf and eprintf to sim_io_eprintf.
+
 2016-01-02  Mike Frysinger  <vapier@gentoo.org>
 
        * sim-if.c (current_state): Delete.
index cf680cf513645f0c2fa4cd9d3d96b49e2d3a27ec..ac4ab45824029413c487d6f80d27889abe87f66b 100644 (file)
@@ -229,32 +229,6 @@ cris_option_handler (SIM_DESC sd, sim_cpu *cpu ATTRIBUTE_UNUSED, int opt,
   return sim_profile_set_option (sd, "-model", PROFILE_MODEL_IDX, "on");
 }
 
-/* FIXME: Remove these, globalize those in sim-load.c, move elsewhere.  */
-
-static void
-xprintf  (host_callback *callback, const char *fmt, ...)
-{
-  va_list ap;
-
-  va_start (ap, fmt);
-
-  (*callback->vprintf_filtered) (callback, fmt, ap);
-
-  va_end (ap);
-}
-
-static void
-eprintf (host_callback *callback, const char *fmt, ...)
-{
-  va_list ap;
-
-  va_start (ap, fmt);
-
-  (*callback->evprintf_filtered) (callback, fmt, ap);
-
-  va_end (ap);
-}
-
 /* An ELF-specific simplified ../common/sim-load.c:sim_load_file,
    using the program headers, not sections, in order to make sure that
    the program headers themeselves are also loaded.  The caller is
@@ -267,7 +241,6 @@ cris_load_elf_file (SIM_DESC sd, struct bfd *abfd, sim_write_fn do_write)
   int n_hdrs;
   int i;
   bfd_boolean verbose = STATE_OPEN_KIND (sd) == SIM_OPEN_DEBUG;
-  host_callback *callback = STATE_CALLBACK (sd);
 
   phdr = elf_tdata (abfd)->phdr;
   n_hdrs = elf_elfheader (abfd)->e_phnum;
@@ -286,24 +259,24 @@ cris_load_elf_file (SIM_DESC sd, struct bfd *abfd, sim_write_fn do_write)
       buf = xmalloc (phdr[i].p_filesz);
 
       if (verbose)
-       xprintf (callback, "Loading segment at 0x%lx, size 0x%lx\n",
-                lma, phdr[i].p_filesz);
+       sim_io_printf (sd, "Loading segment at 0x%lx, size 0x%lx\n",
+                      lma, phdr[i].p_filesz);
 
       if (bfd_seek (abfd, phdr[i].p_offset, SEEK_SET) != 0
          || (bfd_bread (buf, phdr[i].p_filesz, abfd) != phdr[i].p_filesz))
        {
-         eprintf (callback,
-                  "%s: could not read segment at 0x%lx, size 0x%lx\n",
-                  STATE_MY_NAME (sd), lma, phdr[i].p_filesz);
+         sim_io_eprintf (sd,
+                         "%s: could not read segment at 0x%lx, size 0x%lx\n",
+                         STATE_MY_NAME (sd), lma, phdr[i].p_filesz);
          free (buf);
          return FALSE;
        }
 
       if (do_write (sd, lma, buf, phdr[i].p_filesz) != phdr[i].p_filesz)
        {
-         eprintf (callback,
-                  "%s: could not load segment at 0x%lx, size 0x%lx\n",
-                  STATE_MY_NAME (sd), lma, phdr[i].p_filesz);
+         sim_io_eprintf (sd,
+                         "%s: could not load segment at 0x%lx, size 0x%lx\n",
+                         STATE_MY_NAME (sd), lma, phdr[i].p_filesz);
          free (buf);
          return FALSE;
        }