[aarch64] Remove handling of ADR/ADRP from prologue analyzer
[binutils-gdb.git] / sim / rx / trace.c
index a005797b4ecbcf09d68578b0f7d2e790edf02235..8d9293c4a6369b1cf23c92a553e168a46256becc 100644 (file)
@@ -1,6 +1,6 @@
 /* trace.c --- tracing output for the RX simulator.
 
-Copyright (C) 2005-2021 Free Software Foundation, Inc.
+Copyright (C) 2005-2022 Free Software Foundation, Inc.
 Contributed by Red Hat, Inc.
 
 This file is part of the GNU simulators.
@@ -18,8 +18,9 @@ GNU General Public License for more details.
 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
+/* This must come before any other includes.  */
+#include "defs.h"
 
-#include "config.h"
 #include <stdio.h>
 #include <stdarg.h>
 #include <string.h>
@@ -82,7 +83,7 @@ remove_useless_symbols (asymbol ** symbols, long count)
 }
 
 static int
-compare_symbols (const PTR ap, const PTR bp)
+compare_symbols (const void *ap, const void *bp)
 {
   const asymbol *a = *(const asymbol **) ap;
   const asymbol *b = *(const asymbol **) bp;
@@ -108,6 +109,18 @@ op_printf (char *buf, char *fmt, ...)
   return ret;
 }
 
+static int ATTRIBUTE_PRINTF (3, 4)
+op_styled_printf (char *buf, enum disassembler_style style, char *fmt, ...)
+{
+  int ret;
+  va_list ap;
+
+  va_start (ap, fmt);
+  ret = vsprintf (opbuf + strlen (opbuf), fmt, ap);
+  va_end (ap);
+  return ret;
+}
+
 static bfd *       current_bfd = NULL;
 static asymbol **  symtab = NULL;
 static int         symcount = 0;
@@ -208,7 +221,7 @@ sim_get_current_source_location (const char **  pfilename,
 
       initted = 1;
       memset (& info, 0, sizeof (info));
-      INIT_DISASSEMBLE_INFO (info, stdout, op_printf);
+      INIT_DISASSEMBLE_INFO (info, stdout, op_printf, op_styled_printf);
       info.read_memory_func = sim_dis_read;
       info.arch = bfd_get_arch (current_bfd);
       info.mach = bfd_get_mach (current_bfd);