[ob/pushed] Use gdb_insn_length instead of creating dummy stream
authorPedro Alves <palves@redhat.com>
Wed, 1 Feb 2017 00:07:50 +0000 (00:07 +0000)
committerPedro Alves <palves@redhat.com>
Wed, 1 Feb 2017 00:07:50 +0000 (00:07 +0000)
gdb/ChangeLog:
2017-02-01  Pedro Alves  <palves@redhat.com>

* i386-tdep.c (i386_fast_tracepoint_valid_at): Use gdb_insn_length.

gdb/ChangeLog
gdb/i386-tdep.c

index 91cde2bc09aa89ef0da60d9eaa7b60a95666ad09..710b181578e8b2a660fdfd7a66091207dddf1221 100644 (file)
@@ -1,3 +1,7 @@
+2017-02-01  Pedro Alves  <palves@redhat.com>
+
+       * i386-tdep.c (i386_fast_tracepoint_valid_at): Use gdb_insn_length.
+
 2017-01-31  Pedro Alves  <palves@redhat.com>
 
        * mi/mi-interp.c (mi_breakpoint_created, mi_breakpoint_modified):
index 8a4d59f6fdae8ec785462d0ceedcd6501b955cf0..b86c623c1b253a9ff56090d20e50311c01cbeed1 100644 (file)
@@ -8110,7 +8110,6 @@ i386_fast_tracepoint_valid_at (struct gdbarch *gdbarch, CORE_ADDR addr,
                               char **msg)
 {
   int len, jumplen;
-  static struct ui_file *gdb_null = NULL;
 
   /*  Ask the target for the minimum instruction length supported.  */
   jumplen = target_get_min_fast_tracepoint_insn_len ();
@@ -8133,12 +8132,8 @@ i386_fast_tracepoint_valid_at (struct gdbarch *gdbarch, CORE_ADDR addr,
       jumplen = (register_size (gdbarch, 0) == 8) ? 5 : 4;
     }
 
-  /* Dummy file descriptor for the disassembler.  */
-  if (!gdb_null)
-    gdb_null = ui_file_new ();
-
   /* Check for fit.  */
-  len = gdb_print_insn (gdbarch, addr, gdb_null, NULL);
+  len = gdb_insn_length (gdbarch, addr);
 
   if (len < jumplen)
     {