aboutsummaryrefslogtreecommitdiff
path: root/opcodes
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2003-07-18 11:34:41 +0000
committerNick Clifton <nickc@redhat.com>2003-07-18 11:34:41 +0000
commit31e0f3cd45f5e24eb497bcbb1eec8e22b387ed9c (patch)
tree7f4a6c5fe2608e2f29d8599219254119482133e1 /opcodes
parent278a7cf7f0a800f2d1ed8bc3609c78a83cf2efb8 (diff)
downloadgdb-31e0f3cd45f5e24eb497bcbb1eec8e22b387ed9c.zip
gdb-31e0f3cd45f5e24eb497bcbb1eec8e22b387ed9c.tar.gz
gdb-31e0f3cd45f5e24eb497bcbb1eec8e22b387ed9c.tar.bz2
* objdump.c (main) :Accept multiple -M switch.
* doc/binutils.texi: Document that multiple -M switches are accepted and that a single -M switch can contain comma separated options. * arm-dis.c (parse_arm_disassembler_option): Do not expect option string to be NUL terminated. (parse_disassembler_options): Allow options to be space or comma separated.
Diffstat (limited to 'opcodes')
-rw-r--r--opcodes/ChangeLog7
-rw-r--r--opcodes/arm-dis.c36
2 files changed, 24 insertions, 19 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index f1a11ad..73c1902 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,10 @@
+2003-07-18 Nick Clifton <nickc@redhat.com>
+
+ * arm-dis.c (parse_arm_disassembler_option): Do not expect
+ option string to be NUL terminated.
+ (parse_disassembler_options): Allow options to be space or
+ comma separated.
+
2003-07-17 Nick Clifton <nickc@redhat.com>
* po/es.po: New Spanish translation.
diff --git a/opcodes/arm-dis.c b/opcodes/arm-dis.c
index 2c9e385..97ec842 100644
--- a/opcodes/arm-dis.c
+++ b/opcodes/arm-dis.c
@@ -27,6 +27,7 @@
#include "coff/internal.h"
#include "libcoff.h"
#include "opintl.h"
+#include "safe-ctype.h"
/* FIXME: This shouldn't be done here. */
#include "elf-bfd.h"
@@ -1152,51 +1153,48 @@ parse_arm_disassembler_option (option)
option += 10;
for (i = NUM_ARM_REGNAMES; i--;)
- if (streq (option, regnames[i].name))
+ if (strneq (option, regnames[i].name, strlen (regnames[i].name)))
{
regname_selected = i;
break;
}
if (i < 0)
+ /* XXX - should break 'option' at following delimiter. */
fprintf (stderr, _("Unrecognised register name set: %s\n"), option);
}
- else if (streq (option, "force-thumb"))
+ else if (strneq (option, "force-thumb", 11))
force_thumb = 1;
- else if (streq (option, "no-force-thumb"))
+ else if (strneq (option, "no-force-thumb", 14))
force_thumb = 0;
else
+ /* XXX - should break 'option' at following delimiter. */
fprintf (stderr, _("Unrecognised disassembler option: %s\n"), option);
return;
}
-/* Parse the string of disassembler options, spliting it at whitespaces. */
+/* Parse the string of disassembler options, spliting it at whitespaces
+ or commas. (Whitespace separators supported for backwards compatibility). */
static void
parse_disassembler_options (options)
char * options;
{
- char * space;
-
if (options == NULL)
return;
- do
+ while (*options)
{
- space = strchr (options, ' ');
-
- if (space)
- {
- * space = '\0';
- parse_arm_disassembler_option (options);
- * space = ' ';
- options = space + 1;
- }
- else
- parse_arm_disassembler_option (options);
+ parse_arm_disassembler_option (options);
+
+ /* Skip forward to next seperator. */
+ while ((*options) && (! ISSPACE (*options)) && (*options != ','))
+ ++ options;
+ /* Skip forward past seperators. */
+ while (ISSPACE (*options) || (*options == ','))
+ ++ options;
}
- while (space);
}
/* NOTE: There are no checks in these routines that