aboutsummaryrefslogtreecommitdiff
path: root/opcodes/i386-dis.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2005-11-07 00:19:12 +0000
committerAlan Modra <amodra@gmail.com>2005-11-07 00:19:12 +0000
commit3e7d61b225eae88144dfaff1ba52d2452766074f (patch)
tree5ebcb516561c9d515796d5f25d613bd5d91a40b1 /opcodes/i386-dis.c
parenta1a90f039670f8480a780b725af87b34d39f27e9 (diff)
downloadgdb-3e7d61b225eae88144dfaff1ba52d2452766074f.zip
gdb-3e7d61b225eae88144dfaff1ba52d2452766074f.tar.gz
gdb-3e7d61b225eae88144dfaff1ba52d2452766074f.tar.bz2
* i386-dis.c (ckprefix): Handle rex on fwait. Don't print
ignored rex prefixes here. (print_insn): Instead, handle them similarly to fwait followed by non-fp insns.
Diffstat (limited to 'opcodes/i386-dis.c')
-rw-r--r--opcodes/i386-dis.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c
index a3b205a..47455e3 100644
--- a/opcodes/i386-dis.c
+++ b/opcodes/i386-dis.c
@@ -1814,7 +1814,7 @@ ckprefix (void)
/* fwait is really an instruction. If there are prefixes
before the fwait, they belong to the fwait, *not* to the
following instruction. */
- if (prefixes)
+ if (prefixes || rex)
{
prefixes |= PREFIX_FWAIT;
codep++;
@@ -1828,8 +1828,8 @@ ckprefix (void)
/* Rex is ignored when followed by another prefix. */
if (rex)
{
- oappend (prefix_name (rex, 0));
- oappend (" ");
+ rex_used = rex;
+ return;
}
rex = newrex;
codep++;
@@ -2117,13 +2117,14 @@ print_insn (bfd_vma pc, disassemble_info *info)
FETCH_DATA (info, codep + 1);
two_source_ops = (*codep == 0x62) || (*codep == 0xc8);
- if ((prefixes & PREFIX_FWAIT)
- && ((*codep < 0xd8) || (*codep > 0xdf)))
+ if (((prefixes & PREFIX_FWAIT)
+ && ((*codep < 0xd8) || (*codep > 0xdf)))
+ || (rex && rex_used))
{
const char *name;
- /* fwait not followed by floating point instruction. Print the
- first prefix, which is probably fwait itself. */
+ /* fwait not followed by floating point instruction, or rex followed
+ by other prefixes. Print the first prefix. */
name = prefix_name (priv.the_buffer[0], priv.orig_sizeflag);
if (name == NULL)
name = INTERNAL_DISASSEMBLER_ERROR;