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.h38
1 files changed, 14 insertions, 24 deletions
diff --git a/include/dis-asm.h b/include/dis-asm.h
index c3e0199..d97ce05 100644
--- a/include/dis-asm.h
+++ b/include/dis-asm.h
@@ -239,9 +239,9 @@ typedef struct disassemble_info
size_t buffer_length;
/* This variable may be set by the instruction decoder. It suggests
- the number of bytes objdump should display on a single line. If
- the instruction decoder sets this, it should always set it to
- the same value in order to get reasonable looking output. */
+ the number of bytes objdump should display on a single line. If
+ the instruction decoder sets this, it should always set it to
+ the same value in order to get reasonable looking output. */
int bytes_per_line;
/* The next two variables control the way objdump displays the raw data. */
@@ -287,7 +287,13 @@ typedef struct disassemble_info
zero if unknown. */
bfd_vma target2; /* Second target address for dref2 */
- /* Command line options specific to the target disassembler. */
+ /* Command line options specific to the target disassembler.
+ Note that if this string contains multiple comma-separated
+ options, then it must not be in read-only memory. Commas may be
+ temporarily modified by the target disassembler when parsing
+ options. The string is const in the sense that on return from
+ the target disassembler the string will be exactly the same as
+ on entry. */
const char *disassembler_options;
/* If non-zero then try not disassemble beyond this address, even if
@@ -429,26 +435,10 @@ 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 const char *
-next_disassembler_option (const char *options)
-{
- const 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))
-
+/* Iterate over each comma separated option in disassembler_options. */
+extern bool for_each_disassembler_option (struct disassemble_info *,
+ bool (*) (const char *, void *),
+ void *);
/* This block of definitions is for particular callers who read instructions
into a buffer before calling the instruction decoder. */