This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Return X86_XSTATE_SSE_MASK instead of 0 in i386fbsd_core_read_xcr0


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d78bdb54ac94e1c38dc4b8f0d50b5fd202890887

commit d78bdb54ac94e1c38dc4b8f0d50b5fd202890887
Author: Yao Qi <yao.qi@linaro.org>
Date:   Mon Sep 4 11:33:56 2017 +0100

    Return X86_XSTATE_SSE_MASK instead of 0 in i386fbsd_core_read_xcr0
    
    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.

Diff:
---
 gdb/ChangeLog        | 5 +++++
 gdb/i386-fbsd-tdep.c | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 8c31c81..e965e26 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
 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
 	i386_target_description.
 	* i386-fbsd-nat.c (i386fbsd_read_description): Call
diff --git a/gdb/i386-fbsd-tdep.c b/gdb/i386-fbsd-tdep.c
index 594b8f6..baca978 100644
--- a/gdb/i386-fbsd-tdep.c
+++ b/gdb/i386-fbsd-tdep.c
@@ -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;
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]