* arm-tdep.c (arm_make_stub_cache, arm_stub_this_id)
[deliverable/binutils-gdb.git] / opcodes / i386-dis.c
index 0e9ce49e2536807cc29b30a3917713a3a8fff2ac..24e5a393ed211e9712ea1fd71810a87f0ca5f897 100644 (file)
@@ -1,6 +1,6 @@
 /* Print i386 instructions for GDB, the GNU debugger.
    Copyright 1988, 1989, 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+   2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -1956,7 +1956,7 @@ print_insn (bfd_vma pc, disassemble_info *info)
   int i;
   char *first, *second, *third;
   int needcomma;
-  unsigned char uses_SSE_prefix;
+  unsigned char uses_SSE_prefix, uses_LOCK_prefix;
   int sizeflag;
   const char *p;
   struct dis_private priv;
@@ -2128,12 +2128,14 @@ print_insn (bfd_vma pc, disassemble_info *info)
       dp = &dis386_twobyte[*++codep];
       need_modrm = twobyte_has_modrm[*codep];
       uses_SSE_prefix = twobyte_uses_SSE_prefix[*codep];
+      uses_LOCK_prefix = (*codep & ~0x02) == 0x20;
     }
   else
     {
       dp = &dis386[*codep];
       need_modrm = onebyte_has_modrm[*codep];
       uses_SSE_prefix = 0;
+      uses_LOCK_prefix = 0;
     }
   codep++;
 
@@ -2147,7 +2149,7 @@ print_insn (bfd_vma pc, disassemble_info *info)
       oappend ("repnz ");
       used_prefixes |= PREFIX_REPNZ;
     }
-  if (prefixes & PREFIX_LOCK)
+  if (!uses_LOCK_prefix && (prefixes & PREFIX_LOCK))
     {
       oappend ("lock ");
       used_prefixes |= PREFIX_LOCK;
@@ -3993,9 +3995,16 @@ static void
 OP_C (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
 {
   int add = 0;
-  USED_REX (REX_EXTX);
   if (rex & REX_EXTX)
-    add = 8;
+    {
+      USED_REX (REX_EXTX);
+      add = 8;
+    }
+  else if (!mode_64bit && (prefixes & PREFIX_LOCK))
+    {
+      used_prefixes |= PREFIX_LOCK;
+      add = 8;
+    }
   sprintf (scratchbuf, "%%cr%d", reg + add);
   oappend (scratchbuf + intel_syntax);
 }
This page took 0.023891 seconds and 4 git commands to generate.