aboutsummaryrefslogtreecommitdiff
path: root/opcodes
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2006-03-03 15:57:43 +0000
committerNick Clifton <nickc@redhat.com>2006-03-03 15:57:43 +0000
commitc7d41dc5a0b485f667749ea4f2285397b85273cf (patch)
tree523ade31a72ecef19155f7c6b039c66d91cb6c39 /opcodes
parent4cdc7696f5ce43e61bb7e234ed10b2ad03fca9e8 (diff)
downloadgdb-c7d41dc5a0b485f667749ea4f2285397b85273cf.zip
gdb-c7d41dc5a0b485f667749ea4f2285397b85273cf.tar.gz
gdb-c7d41dc5a0b485f667749ea4f2285397b85273cf.tar.bz2
Fix parseing functions to return an error message if the parse failed
Diffstat (limited to 'opcodes')
-rw-r--r--opcodes/ChangeLog6
-rw-r--r--opcodes/xc16x-asm.c56
-rw-r--r--opcodes/xc16x-dis.c12
3 files changed, 50 insertions, 24 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index fee24b1..8d9094a 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,9 @@
+2006-03-03 Shrirang Khisti <shrirangk@kpitcummins.com)
+
+ * xc16x-asm.c: Regenerate.
+ * xc16x-dis.c: Regenerate.
+ * xc16x-ibld.c: Regenerate.
+
2006-02-27 Carlos O'Donell <carlos@codesourcery.com>
* po/Make-in: Add html target.
diff --git a/opcodes/xc16x-asm.c b/opcodes/xc16x-asm.c
index eb3a0e5..63d7318 100644
--- a/opcodes/xc16x-asm.c
+++ b/opcodes/xc16x-asm.c
@@ -58,8 +58,11 @@ parse_hash (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
long *valuep ATTRIBUTE_UNUSED)
{
if (**strp == '#')
- ++*strp;
- return NULL;
+ {
+ ++*strp;
+ return NULL;
+ }
+ return _("Missing '#' prefix");
}
/* Handle '.' prefixes (i.e. skip over them). */
@@ -71,11 +74,14 @@ parse_dot (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
long *valuep ATTRIBUTE_UNUSED)
{
if (**strp == '.')
- ++*strp;
- return NULL;
+ {
+ ++*strp;
+ return NULL;
+ }
+ return _("Missing '.' prefix");
}
-/* Handle '.' prefixes (i.e. skip over them). */
+/* Handle 'pof:' prefixes (i.e. skip over them). */
static const char *
parse_pof (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
@@ -83,12 +89,15 @@ parse_pof (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
int opindex ATTRIBUTE_UNUSED,
long *valuep ATTRIBUTE_UNUSED)
{
- if (!strncasecmp (*strp, "pof:", 4))
- *strp += 4;
- return NULL;
+ if (strncasecmp (*strp, "pof:", 4) == 0)
+ {
+ *strp += 4;
+ return NULL;
+ }
+ return _("Missing 'pof:' prefix");
}
-/* Handle '.' prefixes (i.e. skip over them). */
+/* Handle 'pag:' prefixes (i.e. skip over them). */
static const char *
parse_pag (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
@@ -96,33 +105,44 @@ parse_pag (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
int opindex ATTRIBUTE_UNUSED,
long *valuep ATTRIBUTE_UNUSED)
{
- if (!strncasecmp (*strp, "pag:", 4))
- *strp += 4;
- return NULL;
+ if (strncasecmp (*strp, "pag:", 4) == 0)
+ {
+ *strp += 4;
+ return NULL;
+ }
+ return _("Missing 'pag:' prefix");
}
/* Handle 'sof' prefixes (i.e. skip over them). */
+
static const char *
parse_sof (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
const char **strp,
int opindex ATTRIBUTE_UNUSED,
long *valuep ATTRIBUTE_UNUSED)
{
- if (!strncasecmp (*strp, "sof:", 4))
- *strp += 4;
- return NULL;
+ if (strncasecmp (*strp, "sof:", 4) == 0)
+ {
+ *strp += 4;
+ return NULL;
+ }
+ return _("Missing 'sof:' prefix");
}
/* Handle 'seg' prefixes (i.e. skip over them). */
+
static const char *
parse_seg (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
const char **strp,
int opindex ATTRIBUTE_UNUSED,
long *valuep ATTRIBUTE_UNUSED)
{
- if (!strncasecmp (*strp, "seg:", 4))
- *strp += 4;
- return NULL;
+ if (strncasecmp (*strp, "seg:", 4) == 0)
+ {
+ *strp += 4;
+ return NULL;
+ }
+ return _("Missing 'seg:' prefix");
}
/* -- */
diff --git a/opcodes/xc16x-dis.c b/opcodes/xc16x-dis.c
index 5d60879..6efc89b 100644
--- a/opcodes/xc16x-dis.c
+++ b/opcodes/xc16x-dis.c
@@ -72,7 +72,7 @@ static int read_insn
} \
while (0)
-/* Handle '.' prefixes as operands. */
+/* Print a 'pof:' prefix to an operand. */
static void
print_pof (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
@@ -84,7 +84,7 @@ print_pof (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
{
}
-/* Handle '.' prefixes as operands. */
+/* Print a 'pag:' prefix to an operand. */
static void
print_pag (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
@@ -96,7 +96,7 @@ print_pag (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
{
}
-/* Handle '.' prefixes as operands. */
+/* Print a 'sof:' prefix to an operand. */
static void
print_sof (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
@@ -111,7 +111,7 @@ print_sof (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
info->fprintf_func (info->stream, "sof:");
}
-/* Handle '.' prefixes as operands. */
+/* Print a 'seg:' prefix to an operand. */
static void
print_seg (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
@@ -126,7 +126,7 @@ print_seg (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
info->fprintf_func (info->stream, "seg:");
}
-/* Handle '#' prefixes as operands. */
+/* Print a '#' prefix to an operand. */
static void
print_hash (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
@@ -141,7 +141,7 @@ print_hash (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
info->fprintf_func (info->stream, "#");
}
-/* Handle '.' prefixes as operands. */
+/* Print a '.' prefix to an operand. */
static void
print_dot (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,