]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Introduce gdb_disassembly_flags
authorPedro Alves <palves@redhat.com>
Mon, 4 Sep 2017 17:23:22 +0000 (18:23 +0100)
committerPedro Alves <palves@redhat.com>
Mon, 4 Sep 2017 17:23:22 +0000 (18:23 +0100)
For some reason I ended up staring at some of the "int flags" in
btrace-related code, and I got confused because I had no clue what the
flags where supposed to indicate.

Fix that by using enum_flags, so that:
  #1 - it's clear from the type what the flags are about, and
  #2 - the compiler can catch mismatching mistakes

gdb/ChangeLog:
2017-09-04  Pedro Alves  <palves@redhat.com>

* cli/cli-cmds.c (print_disassembly, disassemble_current_function)
(disassemble_command): Use gdb_disassembly_flags instead of bare
int.
* disasm.c (gdb_pretty_print_disassembler::pretty_print_insn)
(dump_insns, do_mixed_source_and_assembly_deprecated)
(do_mixed_source_and_assembly, do_assembly_only, gdb_disassembly):
Use gdb_disassembly_flags instead of bare int.
* disasm.h (DISASSEMBLY_SOURCE_DEPRECATED, DISASSEMBLY_RAW_INSN)
(DISASSEMBLY_OMIT_FNAME, DISASSEMBLY_FILENAME)
(DISASSEMBLY_OMIT_PC, DISASSEMBLY_SOURCE)
(DISASSEMBLY_SPECULATIVE): No longer macros.  Instead they're...
(enum gdb_disassembly_flag): ... values of this new enumeration.
(gdb_disassembly_flags): Define.
(gdb_disassembly)
(gdb_pretty_print_disassembler::pretty_print_insn): Use it.
* mi/mi-cmd-disas.c (mi_cmd_disassemble): Use
gdb_disassembly_flags instead of bare int.
* record-btrace.c (btrace_insn_history)
(record_btrace_insn_history, record_btrace_insn_history_range)
(record_btrace_insn_history_from): Use gdb_disassembly_flags
instead of bare int.
* record.c (get_insn_history_modifiers, cmd_record_insn_history):
Use gdb_disassembly_flags instead of bare int.
* target-debug.h (target_debug_print_gdb_disassembly_flags):
Define.
* target-delegates.c: Regenerate.
* target.c (target_insn_history, target_insn_history_from)
(target_insn_history_range): Use gdb_disassembly_flags instead of
bare int.
* target.h: Include "disasm.h".
(struct target_ops) <to_insn_history, to_insn_history_from,
to_insn_history_range>: Use gdb_disassembly_flags instead of bare
int.
(target_insn_history, target_insn_history_from)
(target_insn_history_range): Use gdb_disassembly_flags instead of
bare int.

gdb/ChangeLog
gdb/cli/cli-cmds.c
gdb/disasm.c
gdb/disasm.h
gdb/mi/mi-cmd-disas.c
gdb/record-btrace.c
gdb/record.c
gdb/target-debug.h
gdb/target-delegates.c
gdb/target.c
gdb/target.h

index 39a47ec4b1ab7c865d6d5dc28ae9986532f77197..9c9c6b1f921002ceb4da79b55a09741cea0ad600 100644 (file)
@@ -1,3 +1,42 @@
+2017-09-04  Pedro Alves  <palves@redhat.com>
+
+       * cli/cli-cmds.c (print_disassembly, disassemble_current_function)
+       (disassemble_command): Use gdb_disassembly_flags instead of bare
+       int.
+       * disasm.c (gdb_pretty_print_disassembler::pretty_print_insn)
+       (dump_insns, do_mixed_source_and_assembly_deprecated)
+       (do_mixed_source_and_assembly, do_assembly_only, gdb_disassembly):
+       Use gdb_disassembly_flags instead of bare int.
+       * disasm.h (DISASSEMBLY_SOURCE_DEPRECATED, DISASSEMBLY_RAW_INSN)
+       (DISASSEMBLY_OMIT_FNAME, DISASSEMBLY_FILENAME)
+       (DISASSEMBLY_OMIT_PC, DISASSEMBLY_SOURCE)
+       (DISASSEMBLY_SPECULATIVE): No longer macros.  Instead they're...
+       (enum gdb_disassembly_flag): ... values of this new enumeration.
+       (gdb_disassembly_flags): Define.
+       (gdb_disassembly)
+       (gdb_pretty_print_disassembler::pretty_print_insn): Use it.
+       * mi/mi-cmd-disas.c (mi_cmd_disassemble): Use
+       gdb_disassembly_flags instead of bare int.
+       * record-btrace.c (btrace_insn_history)
+       (record_btrace_insn_history, record_btrace_insn_history_range)
+       (record_btrace_insn_history_from): Use gdb_disassembly_flags
+       instead of bare int.
+       * record.c (get_insn_history_modifiers, cmd_record_insn_history):
+       Use gdb_disassembly_flags instead of bare int.
+       * target-debug.h (target_debug_print_gdb_disassembly_flags):
+       Define.
+       * target-delegates.c: Regenerate.
+       * target.c (target_insn_history, target_insn_history_from)
+       (target_insn_history_range): Use gdb_disassembly_flags instead of
+       bare int.
+       * target.h: Include "disasm.h".
+       (struct target_ops) <to_insn_history, to_insn_history_from,
+       to_insn_history_range>: Use gdb_disassembly_flags instead of bare
+       int.
+       (target_insn_history, target_insn_history_from)
+       (target_insn_history_range): Use gdb_disassembly_flags instead of
+       bare int.
+
 2017-09-04  Simon Marchi  <simon.marchi@ericsson.com>
 
        * cli/cli-script.c (build_command_line): For if/while commands,
index 7d7e16a64a8fe7a214ae088615e7e8a390fb1031..b79ceb2c3cfffa39e72b030e78df37a1cbd69f60 100644 (file)
@@ -1121,7 +1121,8 @@ list_command (char *arg, int from_tty)
 
 static void
 print_disassembly (struct gdbarch *gdbarch, const char *name,
-                  CORE_ADDR low, CORE_ADDR high, int flags)
+                  CORE_ADDR low, CORE_ADDR high,
+                  gdb_disassembly_flags flags)
 {
 #if defined(TUI)
   if (!tui_is_window_visible (DISASSEM_WIN))
@@ -1152,7 +1153,7 @@ print_disassembly (struct gdbarch *gdbarch, const char *name,
    Print a disassembly of the current function according to FLAGS.  */
 
 static void
-disassemble_current_function (int flags)
+disassemble_current_function (gdb_disassembly_flags flags)
 {
   struct frame_info *frame;
   struct gdbarch *gdbarch;
@@ -1207,7 +1208,7 @@ disassemble_command (char *arg, int from_tty)
   CORE_ADDR low, high;
   const char *name;
   CORE_ADDR pc;
-  int flags;
+  gdb_disassembly_flags flags;
   const char *p;
 
   p = arg;
index 76c4ff31a6ee7861dc60ef292421693b98462644..c3528e006ff244b062d64112907298ddb3d6f29b 100644 (file)
@@ -191,7 +191,7 @@ compare_lines (const void *mle1p, const void *mle2p)
 int
 gdb_pretty_print_disassembler::pretty_print_insn (struct ui_out *uiout,
                                                  const struct disasm_insn *insn,
-                                                 int flags)
+                                                 gdb_disassembly_flags flags)
 {
   /* parts of the symbolic representation of the address */
   int unmapped;
@@ -295,7 +295,7 @@ gdb_pretty_print_disassembler::pretty_print_insn (struct ui_out *uiout,
 static int
 dump_insns (struct gdbarch *gdbarch,
            struct ui_out *uiout, CORE_ADDR low, CORE_ADDR high,
-           int how_many, int flags, CORE_ADDR *end_pc)
+           int how_many, gdb_disassembly_flags flags, CORE_ADDR *end_pc)
 {
   struct disasm_insn insn;
   int num_displayed = 0;
@@ -338,7 +338,7 @@ do_mixed_source_and_assembly_deprecated
   (struct gdbarch *gdbarch, struct ui_out *uiout,
    struct symtab *symtab,
    CORE_ADDR low, CORE_ADDR high,
-   int how_many, int flags)
+   int how_many, gdb_disassembly_flags flags)
 {
   int newlines = 0;
   int nlines;
@@ -498,7 +498,7 @@ do_mixed_source_and_assembly (struct gdbarch *gdbarch,
                              struct ui_out *uiout,
                              struct symtab *main_symtab,
                              CORE_ADDR low, CORE_ADDR high,
-                             int how_many, int flags)
+                             int how_many, gdb_disassembly_flags flags)
 {
   const struct linetable_entry *le, *first_le;
   int i, nlines;
@@ -730,7 +730,7 @@ do_mixed_source_and_assembly (struct gdbarch *gdbarch,
 static void
 do_assembly_only (struct gdbarch *gdbarch, struct ui_out *uiout,
                  CORE_ADDR low, CORE_ADDR high,
-                 int how_many, int flags)
+                 int how_many, gdb_disassembly_flags flags)
 {
   ui_out_emit_list list_emitter (uiout, "asm_insns");
 
@@ -803,7 +803,7 @@ gdb_disassembler::print_insn (CORE_ADDR memaddr,
 
 void
 gdb_disassembly (struct gdbarch *gdbarch, struct ui_out *uiout,
-                int flags, int how_many,
+                gdb_disassembly_flags flags, int how_many,
                 CORE_ADDR low, CORE_ADDR high)
 {
   struct symtab *symtab;
index ad3e8ddbf9ba74f2cb48811f1ed04ca4a32f5365..5b79be0151850f184b0370c2807883dc0215fca8 100644 (file)
 #define DISASM_H
 
 #include "dis-asm.h"
-
-#define DISASSEMBLY_SOURCE_DEPRECATED (0x1 << 0)
-#define DISASSEMBLY_RAW_INSN   (0x1 << 1)
-#define DISASSEMBLY_OMIT_FNAME (0x1 << 2)
-#define DISASSEMBLY_FILENAME   (0x1 << 3)
-#define DISASSEMBLY_OMIT_PC    (0x1 << 4)
-#define DISASSEMBLY_SOURCE     (0x1 << 5)
-#define DISASSEMBLY_SPECULATIVE        (0x1 << 6)
+#include "common/enum-flags.h"
+
+enum gdb_disassembly_flag
+  {
+    DISASSEMBLY_SOURCE_DEPRECATED = (0x1 << 0),
+    DISASSEMBLY_RAW_INSN = (0x1 << 1),
+    DISASSEMBLY_OMIT_FNAME = (0x1 << 2),
+    DISASSEMBLY_FILENAME = (0x1 << 3),
+    DISASSEMBLY_OMIT_PC = (0x1 << 4),
+    DISASSEMBLY_SOURCE = (0x1 << 5),
+    DISASSEMBLY_SPECULATIVE = (0x1 << 6),
+  };
+DEF_ENUM_FLAGS_TYPE (enum gdb_disassembly_flag, gdb_disassembly_flags);
 
 struct gdbarch;
 struct ui_out;
@@ -87,7 +92,7 @@ struct disasm_insn
 };
 
 extern void gdb_disassembly (struct gdbarch *gdbarch, struct ui_out *uiout,
-                            int flags, int how_many,
+                            gdb_disassembly_flags flags, int how_many,
                             CORE_ADDR low, CORE_ADDR high);
 
 /* Print the instruction at address MEMADDR in debugged memory,
@@ -109,7 +114,7 @@ public:
   /* Prints the instruction INSN into UIOUT and returns the length of
      the printed instruction in bytes.  */
   int pretty_print_insn (struct ui_out *uiout, const struct disasm_insn *insn,
-                        int flags);
+                        gdb_disassembly_flags flags);
 
 private:
   /* Returns the architecture used for disassembling.  */
index fa36311f897088305fa019a535cb2bed53e865ea..d0f9b0b83ad2e6bbe9a87ced8e40c71d990257b9 100644 (file)
@@ -57,7 +57,8 @@ mi_cmd_disassemble (const char *command, char **argv, int argc)
   struct ui_out *uiout = current_uiout;
   CORE_ADDR start;
 
-  int mode, disasm_flags;
+  int mode;
+  gdb_disassembly_flags disasm_flags;
   struct symtab *s;
 
   /* Which options have we processed ... */
index d35800b78c5ec7125032033a75181184c094bb03..220b33ca2e7df06780ced3f3b7f73c915987ec03 100644 (file)
@@ -630,15 +630,16 @@ static void
 btrace_insn_history (struct ui_out *uiout,
                     const struct btrace_thread_info *btinfo,
                     const struct btrace_insn_iterator *begin,
-                    const struct btrace_insn_iterator *end, int flags)
+                    const struct btrace_insn_iterator *end,
+                    gdb_disassembly_flags flags)
 {
   struct cleanup *cleanups, *ui_item_chain;
   struct gdbarch *gdbarch;
   struct btrace_insn_iterator it;
   struct btrace_line_range last_lines;
 
-  DEBUG ("itrace (0x%x): [%u; %u)", flags, btrace_insn_number (begin),
-        btrace_insn_number (end));
+  DEBUG ("itrace (0x%x): [%u; %u)", (unsigned) flags,
+        btrace_insn_number (begin), btrace_insn_number (end));
 
   flags |= DISASSEMBLY_SPECULATIVE;
 
@@ -720,7 +721,8 @@ btrace_insn_history (struct ui_out *uiout,
 /* The to_insn_history method of target record-btrace.  */
 
 static void
-record_btrace_insn_history (struct target_ops *self, int size, int flags)
+record_btrace_insn_history (struct target_ops *self, int size,
+                           gdb_disassembly_flags flags)
 {
   struct btrace_thread_info *btinfo;
   struct btrace_insn_history *history;
@@ -740,7 +742,7 @@ record_btrace_insn_history (struct target_ops *self, int size, int flags)
     {
       struct btrace_insn_iterator *replay;
 
-      DEBUG ("insn-history (0x%x): %d", flags, size);
+      DEBUG ("insn-history (0x%x): %d", (unsigned) flags, size);
 
       /* If we're replaying, we start at the replay position.  Otherwise, we
         start at the tail of the trace.  */
@@ -772,7 +774,7 @@ record_btrace_insn_history (struct target_ops *self, int size, int flags)
       begin = history->begin;
       end = history->end;
 
-      DEBUG ("insn-history (0x%x): %d, prev: [%u; %u)", flags, size,
+      DEBUG ("insn-history (0x%x): %d, prev: [%u; %u)", (unsigned) flags, size,
             btrace_insn_number (&begin), btrace_insn_number (&end));
 
       if (size < 0)
@@ -804,7 +806,8 @@ record_btrace_insn_history (struct target_ops *self, int size, int flags)
 
 static void
 record_btrace_insn_history_range (struct target_ops *self,
-                                 ULONGEST from, ULONGEST to, int flags)
+                                 ULONGEST from, ULONGEST to,
+                                 gdb_disassembly_flags flags)
 {
   struct btrace_thread_info *btinfo;
   struct btrace_insn_history *history;
@@ -818,7 +821,7 @@ record_btrace_insn_history_range (struct target_ops *self,
   low = from;
   high = to;
 
-  DEBUG ("insn-history (0x%x): [%u; %u)", flags, low, high);
+  DEBUG ("insn-history (0x%x): [%u; %u)", (unsigned) flags, low, high);
 
   /* Check for wrap-arounds.  */
   if (low != from || high != to)
@@ -853,7 +856,8 @@ record_btrace_insn_history_range (struct target_ops *self,
 
 static void
 record_btrace_insn_history_from (struct target_ops *self,
-                                ULONGEST from, int size, int flags)
+                                ULONGEST from, int size,
+                                gdb_disassembly_flags flags)
 {
   ULONGEST begin, end, context;
 
index 16e5b03fe84658be9a37da4a243dbfaa616908e1..9ee3560155a8457f8f68fe5acee23dc2f494df40 100644 (file)
@@ -470,10 +470,10 @@ no_chunk (char *arg)
 
 /* Read instruction-history modifiers from an argument string.  */
 
-static int
+static gdb_disassembly_flags
 get_insn_history_modifiers (char **arg)
 {
-  int modifiers;
+  gdb_disassembly_flags modifiers;
   char *args;
 
   modifiers = 0;
@@ -551,13 +551,11 @@ command_size_to_target_size (unsigned int size)
 static void
 cmd_record_insn_history (char *arg, int from_tty)
 {
-  int flags, size;
-
   require_record_target ();
 
-  flags = get_insn_history_modifiers (&arg);
+  gdb_disassembly_flags flags = get_insn_history_modifiers (&arg);
 
-  size = command_size_to_target_size (record_insn_history_size);
+  int size = command_size_to_target_size (record_insn_history_size);
 
   if (arg == NULL || *arg == 0 || strcmp (arg, "+") == 0)
     target_insn_history (size, flags);
index 532e98d45dee6f0582cba6e37aa7e93abc61a9f2..7477ce68ba90c7b6d8c1099f09acde1655cf166d 100644 (file)
   target_debug_do_print (host_address_to_string (X))
 #define target_debug_print_enum_remove_bp_reason(X) \
   target_debug_do_print (plongest (X))
+#define target_debug_print_gdb_disassembly_flags(X) \
+  target_debug_do_print (plongest (X))
 
 static void
 target_debug_print_struct_target_waitstatus_p (struct target_waitstatus *status)
index 88e3e0b9940d77fca40f32ba24c550521170757c..4fc06ea7619b8b89b03fd4b96f90d45768efd218 100644 (file)
@@ -3854,20 +3854,20 @@ debug_goto_record (struct target_ops *self, ULONGEST arg1)
 }
 
 static void
-delegate_insn_history (struct target_ops *self, int arg1, int arg2)
+delegate_insn_history (struct target_ops *self, int arg1, gdb_disassembly_flags arg2)
 {
   self = self->beneath;
   self->to_insn_history (self, arg1, arg2);
 }
 
 static void
-tdefault_insn_history (struct target_ops *self, int arg1, int arg2)
+tdefault_insn_history (struct target_ops *self, int arg1, gdb_disassembly_flags arg2)
 {
   tcomplain ();
 }
 
 static void
-debug_insn_history (struct target_ops *self, int arg1, int arg2)
+debug_insn_history (struct target_ops *self, int arg1, gdb_disassembly_flags arg2)
 {
   fprintf_unfiltered (gdb_stdlog, "-> %s->to_insn_history (...)\n", debug_target.to_shortname);
   debug_target.to_insn_history (&debug_target, arg1, arg2);
@@ -3876,25 +3876,25 @@ debug_insn_history (struct target_ops *self, int arg1, int arg2)
   fputs_unfiltered (", ", gdb_stdlog);
   target_debug_print_int (arg1);
   fputs_unfiltered (", ", gdb_stdlog);
-  target_debug_print_int (arg2);
+  target_debug_print_gdb_disassembly_flags (arg2);
   fputs_unfiltered (")\n", gdb_stdlog);
 }
 
 static void
-delegate_insn_history_from (struct target_ops *self, ULONGEST arg1, int arg2, int arg3)
+delegate_insn_history_from (struct target_ops *self, ULONGEST arg1, int arg2, gdb_disassembly_flags arg3)
 {
   self = self->beneath;
   self->to_insn_history_from (self, arg1, arg2, arg3);
 }
 
 static void
-tdefault_insn_history_from (struct target_ops *self, ULONGEST arg1, int arg2, int arg3)
+tdefault_insn_history_from (struct target_ops *self, ULONGEST arg1, int arg2, gdb_disassembly_flags arg3)
 {
   tcomplain ();
 }
 
 static void
-debug_insn_history_from (struct target_ops *self, ULONGEST arg1, int arg2, int arg3)
+debug_insn_history_from (struct target_ops *self, ULONGEST arg1, int arg2, gdb_disassembly_flags arg3)
 {
   fprintf_unfiltered (gdb_stdlog, "-> %s->to_insn_history_from (...)\n", debug_target.to_shortname);
   debug_target.to_insn_history_from (&debug_target, arg1, arg2, arg3);
@@ -3905,25 +3905,25 @@ debug_insn_history_from (struct target_ops *self, ULONGEST arg1, int arg2, int a
   fputs_unfiltered (", ", gdb_stdlog);
   target_debug_print_int (arg2);
   fputs_unfiltered (", ", gdb_stdlog);
-  target_debug_print_int (arg3);
+  target_debug_print_gdb_disassembly_flags (arg3);
   fputs_unfiltered (")\n", gdb_stdlog);
 }
 
 static void
-delegate_insn_history_range (struct target_ops *self, ULONGEST arg1, ULONGEST arg2, int arg3)
+delegate_insn_history_range (struct target_ops *self, ULONGEST arg1, ULONGEST arg2, gdb_disassembly_flags arg3)
 {
   self = self->beneath;
   self->to_insn_history_range (self, arg1, arg2, arg3);
 }
 
 static void
-tdefault_insn_history_range (struct target_ops *self, ULONGEST arg1, ULONGEST arg2, int arg3)
+tdefault_insn_history_range (struct target_ops *self, ULONGEST arg1, ULONGEST arg2, gdb_disassembly_flags arg3)
 {
   tcomplain ();
 }
 
 static void
-debug_insn_history_range (struct target_ops *self, ULONGEST arg1, ULONGEST arg2, int arg3)
+debug_insn_history_range (struct target_ops *self, ULONGEST arg1, ULONGEST arg2, gdb_disassembly_flags arg3)
 {
   fprintf_unfiltered (gdb_stdlog, "-> %s->to_insn_history_range (...)\n", debug_target.to_shortname);
   debug_target.to_insn_history_range (&debug_target, arg1, arg2, arg3);
@@ -3934,7 +3934,7 @@ debug_insn_history_range (struct target_ops *self, ULONGEST arg1, ULONGEST arg2,
   fputs_unfiltered (", ", gdb_stdlog);
   target_debug_print_ULONGEST (arg2);
   fputs_unfiltered (", ", gdb_stdlog);
-  target_debug_print_int (arg3);
+  target_debug_print_gdb_disassembly_flags (arg3);
   fputs_unfiltered (")\n", gdb_stdlog);
 }
 
index 0624007cbe9fd5afdfc4e43433a8b6830dacae37..3312b8985fee52bf15f45018ed7c9ca63fc0b161 100644 (file)
@@ -3794,7 +3794,7 @@ target_goto_record (ULONGEST insn)
 /* See target.h.  */
 
 void
-target_insn_history (int size, int flags)
+target_insn_history (int size, gdb_disassembly_flags flags)
 {
   current_target.to_insn_history (&current_target, size, flags);
 }
@@ -3802,7 +3802,8 @@ target_insn_history (int size, int flags)
 /* See target.h.  */
 
 void
-target_insn_history_from (ULONGEST from, int size, int flags)
+target_insn_history_from (ULONGEST from, int size,
+                         gdb_disassembly_flags flags)
 {
   current_target.to_insn_history_from (&current_target, from, size, flags);
 }
@@ -3810,7 +3811,8 @@ target_insn_history_from (ULONGEST from, int size, int flags)
 /* See target.h.  */
 
 void
-target_insn_history_range (ULONGEST begin, ULONGEST end, int flags)
+target_insn_history_range (ULONGEST begin, ULONGEST end,
+                          gdb_disassembly_flags flags)
 {
   current_target.to_insn_history_range (&current_target, begin, end, flags);
 }
index 5971151ded91342237791bf20d79d430baa6cdec..796717f5ceb66e1a56f25d7cb548ca12f58e7c34 100644 (file)
@@ -74,6 +74,7 @@ struct inferior;
 #include "btrace.h"
 #include "record.h"
 #include "command.h"
+#include "disasm.h"
 
 #include "break-common.h" /* For enum target_hw_bp_type.  */
 
@@ -1200,7 +1201,8 @@ struct target_ops
        the current position.
        If SIZE < 0, disassemble abs (SIZE) preceding instructions; otherwise,
        disassemble SIZE succeeding instructions.  */
-    void (*to_insn_history) (struct target_ops *, int size, int flags)
+    void (*to_insn_history) (struct target_ops *, int size,
+                            gdb_disassembly_flags flags)
       TARGET_DEFAULT_NORETURN (tcomplain ());
 
     /* Disassemble SIZE instructions in the recorded execution trace around
@@ -1208,13 +1210,15 @@ struct target_ops
        If SIZE < 0, disassemble abs (SIZE) instructions before FROM; otherwise,
        disassemble SIZE instructions after FROM.  */
     void (*to_insn_history_from) (struct target_ops *,
-                                 ULONGEST from, int size, int flags)
+                                 ULONGEST from, int size,
+                                 gdb_disassembly_flags flags)
       TARGET_DEFAULT_NORETURN (tcomplain ());
 
     /* Disassemble a section of the recorded execution trace from instruction
        BEGIN (inclusive) to instruction END (inclusive).  */
     void (*to_insn_history_range) (struct target_ops *,
-                                  ULONGEST begin, ULONGEST end, int flags)
+                                  ULONGEST begin, ULONGEST end,
+                                  gdb_disassembly_flags flags)
       TARGET_DEFAULT_NORETURN (tcomplain ());
 
     /* Print a function trace of the recorded execution trace.
@@ -2509,13 +2513,15 @@ extern void target_goto_record_end (void);
 extern void target_goto_record (ULONGEST insn);
 
 /* See to_insn_history.  */
-extern void target_insn_history (int size, int flags);
+extern void target_insn_history (int size, gdb_disassembly_flags flags);
 
 /* See to_insn_history_from.  */
-extern void target_insn_history_from (ULONGEST from, int size, int flags);
+extern void target_insn_history_from (ULONGEST from, int size,
+                                     gdb_disassembly_flags flags);
 
 /* See to_insn_history_range.  */
-extern void target_insn_history_range (ULONGEST begin, ULONGEST end, int flags);
+extern void target_insn_history_range (ULONGEST begin, ULONGEST end,
+                                      gdb_disassembly_flags flags);
 
 /* See to_call_history.  */
 extern void target_call_history (int size, int flags);