Return X86_XSTATE_SSE_MASK instead of 0 in i386fbsd_core_read_xcr0
authorYao Qi <yao.qi@linaro.org>
Mon, 4 Sep 2017 10:33:56 +0000 (11:33 +0100)
committerYao Qi <yao.qi@linaro.org>
Mon, 4 Sep 2017 10:33:56 +0000 (11:33 +0100)
i386fbsd_core_read_xcr0 reads the value of xcr0 from the corefile.  If
it fails, returns 0.  This makes its caller {i386,amd64}_target_description
has to handle this special value.  IMO, i386fbsd_core_read_xcr0 should
return the default xcr0 in case of error.

gdb:

2017-09-04  Yao Qi  <yao.qi@linaro.org>

* i386-fbsd-tdep.c (i386fbsd_core_read_xcr0): Return
X86_XSTATE_SSE_MASK instead of 0.

gdb/ChangeLog
gdb/i386-fbsd-tdep.c

index 8c31c8134feda311ccf23adfedab0a6a0680b62c..e965e26d739d3e24b00d33685c8a79d09e53c5ec 100644 (file)
@@ -1,3 +1,8 @@
+2017-09-04  Yao Qi  <yao.qi@linaro.org>
+
+       * i386-fbsd-tdep.c (i386fbsd_core_read_xcr0): Return
+       X86_XSTATE_SSE_MASK instead of 0.
+
 2017-09-04  Yao Qi  <yao.qi@linaro.org>
 
        * amd64-fbsd-nat.c (amd64fbsd_read_description): Call
index 594b8f6f0a4f620d16daf2e9d852a55224367c51..baca978612d64d415ca613fb07054526d83d27d1 100644 (file)
@@ -248,14 +248,14 @@ i386fbsd_core_read_xcr0 (bfd *abfd)
            {
              warning (_("Couldn't read `xcr0' bytes from "
                         "`.reg-xstate' section in core file."));
-             return 0;
+             return X86_XSTATE_SSE_MASK;
            }
 
          xcr0 = bfd_get_64 (abfd, contents);
        }
     }
   else
-    xcr0 = 0;
+    xcr0 = X86_XSTATE_SSE_MASK;
 
   return xcr0;
 }