diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2014-06-10 11:16:41 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2014-06-10 11:16:41 -0700 |
commit | d9949a367352c66b7d90ca32bdbd5cac38c14b53 (patch) | |
tree | 8bbc891473c457672adac2583baa5520e1e8fb8f /opcodes | |
parent | b71c404358dbc78d3e84c4299c6139c5291ac441 (diff) | |
download | gdb-d9949a367352c66b7d90ca32bdbd5cac38c14b53.zip gdb-d9949a367352c66b7d90ca32bdbd5cac38c14b53.tar.gz gdb-d9949a367352c66b7d90ca32bdbd5cac38c14b53.tar.bz2 |
Only print prefixes before fwait
gas/testsuite/
* gas/i386/prefix.s: Add another fwait test.
* gas/i386/prefix.d: Updated.
opcodes/
* i386-dis.c (fwait_prefix): New.
(ckprefix): Set fwait_prefix.
(print_insn): Properly print prefixes before fwait.
Diffstat (limited to 'opcodes')
-rw-r--r-- | opcodes/ChangeLog | 6 | ||||
-rw-r--r-- | opcodes/i386-dis.c | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 6e3d6c9..581e5db 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,9 @@ +2014-06-10 H.J. Lu <hongjiu.lu@intel.com> + + * i386-dis.c (fwait_prefix): New. + (ckprefix): Set fwait_prefix. + (print_insn): Properly print prefixes before fwait. + 2014-06-07 Alan Modra <amodra@gmail.com> * ppc-opc.c (UISIGNOPT): Define and use with cmpli. diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index 3c48428..24406f3 100644 --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -2883,6 +2883,7 @@ static int last_data_prefix; static int last_addr_prefix; static int last_rex_prefix; static int last_seg_prefix; +static int fwait_prefix; /* The PREFIX_REPZ/PREFIX_REPNZ/PREFIX_DATA prefix is mandatory. */ static int mandatory_prefix; /* The active segment register prefix. */ @@ -11631,6 +11632,7 @@ ckprefix (void) last_addr_prefix = -1; last_rex_prefix = -1; last_seg_prefix = -1; + fwait_prefix = -1; active_seg_prefix = 0; for (i = 0; i < (int) ARRAY_SIZE (all_prefixes); i++) all_prefixes[i] = 0; @@ -11720,6 +11722,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. */ + fwait_prefix = i; if (prefixes || rex) { prefixes |= PREFIX_FWAIT; @@ -12569,8 +12572,7 @@ print_insn (bfd_vma pc, disassemble_info *info) && ((*codep < 0xd8) || (*codep > 0xdf)))) { /* Handle prefixes before fwait. */ - for (i = 0; - i < (int) ARRAY_SIZE (all_prefixes) && all_prefixes[i]; + for (i = 0; i < fwait_prefix && all_prefixes[i]; i++) (*info->fprintf_func) (info->stream, "%s ", prefix_name (all_prefixes[i], sizeflag)); |