aboutsummaryrefslogtreecommitdiff
path: root/opcodes/s390-mkopc.c
diff options
context:
space:
mode:
authorAndreas Krebbel <krebbel@linux.vnet.ibm.com>2017-05-29 12:34:56 +0200
committerAndreas Krebbel <krebbel@linux.vnet.ibm.com>2017-05-30 10:22:25 +0200
commita09f2586017aeed82fa07c8bfea6c75859295bd9 (patch)
tree8e64265ebd74205ae47c7a8dde8db8f64dac8592 /opcodes/s390-mkopc.c
parentbfcfbe611b4d7e650236f8b8ba7d0706cfe6a0b7 (diff)
downloadgdb-a09f2586017aeed82fa07c8bfea6c75859295bd9.zip
gdb-a09f2586017aeed82fa07c8bfea6c75859295bd9.tar.gz
gdb-a09f2586017aeed82fa07c8bfea6c75859295bd9.tar.bz2
S/390: Improve error checking for optional operands
So far we only had an instruction flag which made an arbitrary number of operands optional. This limits error checking capabilities for instructions marked that way. With this patch the optparm flag only allows a single optional parameter and another one is added (optparm2) allowing 2 optional arguments. Hopefully we won't need more than that in the future. So far there will be only a single use of optparm2. gas/ChangeLog: 2017-05-30 Andreas Krebbel <krebbel@linux.vnet.ibm.com> * config/tc-s390.c (md_gather_operands): Support new optparm2 instruction flag. include/ChangeLog: 2017-05-30 Andreas Krebbel <krebbel@linux.vnet.ibm.com> * opcode/s390.h: Add new instruction flags optparm2. opcodes/ChangeLog: 2017-05-30 Andreas Krebbel <krebbel@linux.vnet.ibm.com> * s390-dis.c (s390_print_insn_with_opcode): Support new optparm2 instruction flag. * s390-mkopc.c (main): Recognize the new instruction flag when parsing instruction list.
Diffstat (limited to 'opcodes/s390-mkopc.c')
-rw-r--r--opcodes/s390-mkopc.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/opcodes/s390-mkopc.c b/opcodes/s390-mkopc.c
index 68c55a9..0d4c9df 100644
--- a/opcodes/s390-mkopc.c
+++ b/opcodes/s390-mkopc.c
@@ -411,12 +411,16 @@ main (void)
&& (str[7] == 0 || str[7] == ',')) {
flag_bits |= S390_INSTR_FLAG_OPTPARM;
str += 7;
+ } else if (strncmp (str, "optparm2", 8) == 0
+ && (str[8] == 0 || str[8] == ',')) {
+ flag_bits |= S390_INSTR_FLAG_OPTPARM2;
+ str += 8;
} else if (strncmp (str, "htm", 3) == 0
- && (str[3] == 0 || str[3] == ',')) {
+ && (str[3] == 0 || str[3] == ',')) {
flag_bits |= S390_INSTR_FLAG_HTM;
str += 3;
} else if (strncmp (str, "vx", 2) == 0
- && (str[2] == 0 || str[2] == ',')) {
+ && (str[2] == 0 || str[2] == ',')) {
flag_bits |= S390_INSTR_FLAG_VX;
str += 2;
} else {