diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2014-05-01 09:39:51 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2014-05-01 09:45:06 -0700 |
commit | 86a80a50f2cb244e6b9ec18b93675972baa50d78 (patch) | |
tree | 6b7c1691a09a08ff6819df9335af56bcc1a4f7f1 /opcodes/i386-dis.c | |
parent | f8c2a73c881913a25c1cb5be766516a75588c7ab (diff) | |
download | gdb-86a80a50f2cb244e6b9ec18b93675972baa50d78.zip gdb-86a80a50f2cb244e6b9ec18b93675972baa50d78.tar.gz gdb-86a80a50f2cb244e6b9ec18b93675972baa50d78.tar.bz2 |
Handle prefixes before fwait
0x9b (fwait) is both an instruction and an opcode prefix. When 0x9b is
treated as an instruction, we need to handle any prefixes before it.
This patch handles it properly.
gas/testsuite/
PR binutils/16891
* gas/i386/opcode.s: Add test for fwait with prefix.
* gas/i386/opcode-intel.d: Updated.
* gas/i386/opcode-suffix.d: Likewise.
* gas/i386/opcode.d: Likewise.
opcodes/
PR binutils/16891
* i386-dis.c (print_insn): Handle prefixes before fwait.
Diffstat (limited to 'opcodes/i386-dis.c')
-rw-r--r-- | opcodes/i386-dis.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index 0e07606..c36c632 100644 --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -12548,8 +12548,14 @@ print_insn (bfd_vma pc, disassemble_info *info) if (((prefixes & PREFIX_FWAIT) && ((*codep < 0xd8) || (*codep > 0xdf)))) { + /* Handle prefixes before fwait. */ + for (i = 0; + i < (int) ARRAY_SIZE (all_prefixes) && all_prefixes[i]; + i++) + (*info->fprintf_func) (info->stream, "%s ", + prefix_name (all_prefixes[i], sizeflag)); (*info->fprintf_func) (info->stream, "fwait"); - return 1; + return i + 1; } if (*codep == 0x0f) |