+/* TODO: Tracing should be converted to common tracing module. */
+int trace = 0;
+int disas = 0;
+int trace_funcs = 0;
+
+static struct disassemble_info info;
+static char opbuf[1000];
+
+static int
+op_printf (char *buf, char *fmt, ...)
+{
+ int ret;
+ va_list ap;
+
+ va_start (ap, fmt);
+ ret = vsprintf (opbuf + strlen (opbuf), fmt, ap);
+ va_end (ap);
+ return ret;
+}
+
+static int
+sim_dis_read (bfd_vma memaddr ATTRIBUTE_UNUSED,
+ bfd_byte * ptr,
+ unsigned int length,
+ struct disassemble_info * info)
+{
+ ARMword val = (ARMword) *((ARMword *) info->application_data);
+
+ while (length--)
+ {
+ * ptr ++ = val & 0xFF;
+ val >>= 8;
+ }
+ return 0;
+}
+
+void
+print_insn (ARMword instr)
+{
+ int size;
+
+ opbuf[0] = 0;
+ info.application_data = & instr;
+ size = print_insn_little_arm (0, & info);
+ fprintf (stderr, " %*s\n", size, opbuf);
+}