aboutsummaryrefslogtreecommitdiff
path: root/opcodes
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2020-06-25 09:27:21 +0200
committerJan Beulich <jbeulich@suse.com>2020-06-25 09:27:21 +0200
commit589958d6ff391321f081228368ec6096bfad0e09 (patch)
tree93b02ae765086bcdc2c452fe97b0df8bb6ea2cc8 /opcodes
parent0b9404fd37c99dc322ae0502d8af6f7c07eb558d (diff)
downloadgdb-589958d6ff391321f081228368ec6096bfad0e09.zip
gdb-589958d6ff391321f081228368ec6096bfad0e09.tar.gz
gdb-589958d6ff391321f081228368ec6096bfad0e09.tar.bz2
x86: fix SYSRET disassembly, improve {,V}CVTSI2S{S,D} and PTWRITE
SYSRET can't use the same macro as IRET, since there's no 16-bit operand size form of it. Re-use LQ for it instead. Doing so made obvious that outside of 64-bit mode {,V}CVTSI2S{S,D} and PTWRITE should have an 'l' suffix printed only in suffix-always mode.
Diffstat (limited to 'opcodes')
-rw-r--r--opcodes/ChangeLog6
-rw-r--r--opcodes/i386-dis.c14
2 files changed, 14 insertions, 6 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index ba0febe..a973b26 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,9 @@
+2020-06-25 Jan Beulich <jbeulich@suse.com>
+
+ * i386-dis.c: Adjust description of "LQ" macro.
+ (dis386_twobyte): Use LQ for sysret.
+ (putop): Adjust handling of LQ.
+
2020-06-22 Nelson Chu <nelson.chu@sifive.com>
* riscv-opc.c: Move the structures and functions to bfd/elfxx-riscv.c.
diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c
index 441866d..28a9058 100644
--- a/opcodes/i386-dis.c
+++ b/opcodes/i386-dis.c
@@ -2290,8 +2290,9 @@ struct dis386 {
"XZ" => print 'x', 'y', or 'z' if suffix_always is true or no
register operands and no broadcast.
"XW" => print 's', 'd' depending on the VEX.W bit (for FMA)
- "LQ" => print 'l' ('d' in Intel mode) or 'q' for memory operand
- or suffix_always is true
+ "LQ" => print 'l' ('d' in Intel mode) or 'q' for memory
+ operand or no operand at all in 64bit mode, or if suffix_always
+ is true.
"LB" => print "abs" in 64bit mode and behave as 'B' otherwise
"LS" => print "abs" in 64bit mode and behave as 'S' otherwise
"LV" => print "abs" for 64bit operand and behave as 'S' otherwise
@@ -2606,7 +2607,7 @@ static const struct dis386 dis386_twobyte[] = {
{ Bad_Opcode },
{ "syscall", { XX }, 0 },
{ "clts", { XX }, 0 },
- { "sysret%LP", { XX }, 0 },
+ { "sysret%LQ", { XX }, 0 },
/* 08 */
{ "invd", { XX }, 0 },
{ PREFIX_TABLE (PREFIX_0F09) },
@@ -13066,7 +13067,7 @@ putop (const char *in_template, int sizeflag)
SAVE_LAST (*p);
break;
}
- if (intel_syntax
+ if ((intel_syntax && need_modrm)
|| (modrm.mod == 3 && !(sizeflag & SUFFIX_ALWAYS)))
break;
if ((rex & REX_W))
@@ -13074,8 +13075,9 @@ putop (const char *in_template, int sizeflag)
USED_REX (REX_W);
*obufp++ = 'q';
}
- else
- *obufp++ = 'l';
+ else if((address_mode == mode_64bit && need_modrm)
+ || (sizeflag & SUFFIX_ALWAYS))
+ *obufp++ = intel_syntax? 'd' : 'l';
}
break;
case 'R':