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] Fix broken GDB build after adding Bound table support for i386.


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

commit 966f0aefa6a96df2c45ec36a7ecc02419e3842db
Author: Walfred Tedeschi <walfred.tedeschi@intel.com>
Date:   Fri Jun 12 09:42:16 2015 +0200

    Fix broken GDB build after adding Bound table support for i386.
    
    Types used for some variables could not be used for 32 bits, causing a
    compilation failure.
    This patch adds a cast to force a quite compilation, but at the same
    time it bails out in the case that the cast performed is not safe, i.e.
    in the case where the debuggee is 64bit and debugger is 32bit.
    
    Documentation was also affected, once a different version of texinfo the
    docs could not be build.
    
    2015-06-10  Walfred Tedeschi  <walfred.tedeschi@intel.com>
    
    	* i386-tdep.c (i386_mpx_get_bt_entry): Add a cast for mpx_bd_mask
    	and bt_mask to CORE_ADDR.
    
    doc:
    	* gdb.textinfo (i386): Fix "@end table" end and "@table" placement.

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

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 9075fcc..c5730cc 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2015-06-10  Walfred Tedeschi  <walfred.tedeschi@intel.com>
+
+	* i386-tdep.c (i386_mpx_get_bt_entry): Add a cast for mpx_bd_mask
+	and bt_mask to CORE_ADDR.
+
 2015-06-11  Gary Benson <gbenson@redhat.com>
 
 	* nat/linux-namespaces.c (mnsh_send_message): Use pulongest.
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index 9264cfa..71f4508 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,8 @@
+2015-06-10  Walfred Tedeschi  <walfred.tedeschi@intel.com>
+
+	* gdb.textinfo (i386): Fix "@end table" end and "@table" placement.
+
+
 2015-06-10  Gary Benson <gbenson@redhat.com>
 
 	* gdb.texinfo (Remote Configuration): Document the
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index f502143..65c9d4f 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -22131,6 +22131,7 @@ be returned in a register.
 @kindex show struct-convention
 Show the current setting of the convention to return @code{struct}s
 from functions.
+@end table
 
 
 @subsubsection Intel(R) @dfn{Memory Protection Extensions} (MPX).
@@ -22172,6 +22173,7 @@ the bounds pointer's value along with its bounds.  Evaluating and changing
 bounds located in bound tables is therefore interesting while investigating
 bugs on MPX context.  @value{GDBN} provides commands for this purpose:
 
+@table @code
 @item show mpx bound @var{pointer}
 @kindex show mpx bound
 Display bounds of the given @var{pointer}.
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 133021f..42d0346 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -8678,12 +8678,15 @@ i386_mpx_get_bt_entry (CORE_ADDR ptr, CORE_ADDR bd_base)
 
   if (gdbarch_ptr_bit (gdbarch) == 64)
     {
-      mpx_bd_mask = MPX_BD_MASK;
+      mpx_bd_mask = (CORE_ADDR) MPX_BD_MASK;
       bd_ptr_r_shift = 20;
       bd_ptr_l_shift = 3;
       bt_select_r_shift = 3;
       bt_select_l_shift = 5;
-      bt_mask = MPX_BT_MASK;
+      bt_mask = (CORE_ADDR) MPX_BT_MASK;
+
+      if ( sizeof (CORE_ADDR) == 4)
+	error (_("operation not supported"));
     }
   else
     {


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