aboutsummaryrefslogtreecommitdiff
path: root/include/dis-asm.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/dis-asm.h')
-rw-r--r--include/dis-asm.h41
1 files changed, 37 insertions, 4 deletions
diff --git a/include/dis-asm.h b/include/dis-asm.h
index 4872920..f054450 100644
--- a/include/dis-asm.h
+++ b/include/dis-asm.h
@@ -222,6 +222,16 @@ typedef struct disassemble_info
} disassemble_info;
+/* This struct is used to pass information about valid disassembler options
+ and their descriptions from the target to the generic GDB functions that
+ set and display them. */
+
+typedef struct
+{
+ const char **name;
+ const char **description;
+} disasm_options_t;
+
/* Standard disassemblers. Disassemble one instruction at the given
target address. Return number of octets processed. */
@@ -332,14 +342,14 @@ extern void print_ppc_disassembler_options (FILE *);
extern void print_riscv_disassembler_options (FILE *);
extern void print_arm_disassembler_options (FILE *);
extern void print_arc_disassembler_options (FILE *);
-extern void parse_arm_disassembler_option (char *);
extern void print_s390_disassembler_options (FILE *);
-extern int get_arm_regname_num_options (void);
-extern int set_arm_regname_option (int);
-extern int get_arm_regnames (int, const char **, const char **, const char *const **);
extern bfd_boolean aarch64_symbol_is_valid (asymbol *, struct disassemble_info *);
extern bfd_boolean arm_symbol_is_valid (asymbol *, struct disassemble_info *);
extern void disassemble_init_powerpc (struct disassemble_info *);
+extern void disassemble_init_s390 (struct disassemble_info *);
+extern const disasm_options_t *disassembler_options_powerpc (void);
+extern const disasm_options_t *disassembler_options_arm (void);
+extern const disasm_options_t *disassembler_options_s390 (void);
/* Fetch the disassembler for a given BFD, if that support is available. */
extern disassembler_ftype disassembler (bfd *);
@@ -351,6 +361,29 @@ extern void disassemble_init_for_target (struct disassemble_info * dinfo);
/* Document any target specific options available from the disassembler. */
extern void disassembler_usage (FILE *);
+/* Remove whitespace and consecutive commas. */
+extern char *remove_whitespace_and_extra_commas (char *);
+
+/* Like STRCMP, but treat ',' the same as '\0' so that we match
+ strings like "foobar" against "foobar,xxyyzz,...". */
+extern int disassembler_options_cmp (const char *, const char *);
+
+/* A helper function for FOR_EACH_DISASSEMBLER_OPTION. */
+static inline char *
+next_disassembler_option (char *options)
+{
+ char *opt = strchr (options, ',');
+ if (opt != NULL)
+ opt++;
+ return opt;
+}
+
+/* A macro for iterating over each comma separated option in OPTIONS. */
+#define FOR_EACH_DISASSEMBLER_OPTION(OPT, OPTIONS) \
+ for ((OPT) = (OPTIONS); \
+ (OPT) != NULL; \
+ (OPT) = next_disassembler_option (OPT))
+
/* This block of definitions is for particular callers who read instructions
into a buffer before calling the instruction decoder. */