This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [PATCH 1/1] Fix broken GDB build after adding Bound table support for i386.
- From: "Tedeschi, Walfred" <walfred dot tedeschi at intel dot com>
- To: "Tedeschi, Walfred" <walfred dot tedeschi at intel dot com>, Joel Brobecker <brobecker at adacore dot com>
- Cc: "eliz at gnu dot org" <eliz at gnu dot org>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Thu, 11 Jun 2015 09:53:08 +0000
- Subject: RE: [PATCH 1/1] Fix broken GDB build after adding Bound table support for i386.
- Authentication-results: sourceware.org; auth=none
- References: <1433940196-22975-1-git-send-email-walfred dot tedeschi at intel dot com> <20150610141308 dot GB11014 at adacore dot com> <AC542571535E904D8E8ADAE745D60B19444202A2 at IRSMSX102 dot ger dot corp dot intel dot com>
Joel,
I am considering using a guard on the code like bellow:
if (gdbarch_ptr_bit (gdbarch) == 64)
{
#ifdef __x86_64__
mpx_bd_mask = MPX_BD_MASK; <- Here. MPX_BD_MASK is #define MPX_BD_MASK 0xfffffff00000ULL /* select bits [47:20] */
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;
#else
error(_("operation not supported yet")
#endif
}
else
{
I consider that debugging a 64 bit application with a 32 bit debugger is not supported fully, but I might be wrong.
In any case would this be an acceptable solution?
Thanks a lot and best regards,
-Fred
-----Original Message-----
From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-owner@sourceware.org] On Behalf Of Tedeschi, Walfred
Sent: Wednesday, June 10, 2015 4:56 PM
To: Joel Brobecker
Cc: eliz@gnu.org; gdb-patches@sourceware.org
Subject: RE: [PATCH 1/1] Fix broken GDB build after adding Bound table support for i386.
Joel,
The message is this one:
----
/users/wtedesch/external/binutils-gdb/gdb/i386-tdep.c: In function 'i386_mpx_get_bt_entry':
/users/wtedesch/external/binutils-gdb/gdb/i386-tdep.c:8681:7: error: large integer implicitly truncated to unsigned type [-Werror=overflow]
----
Here is the reason:
-----
if (gdbarch_ptr_bit (gdbarch) == 64)
{
mpx_bd_mask = MPX_BD_MASK; <- Here. MPX_BD_MASK is #define MPX_BD_MASK 0xfffffff00000ULL /* select bits [47:20] */
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;
}
else
{
mpx_bd_mask = MPX_BD_MASK_32;
bd_ptr_r_shift = 12;
bd_ptr_l_shift = 2;
bt_select_r_shift = 2;
bt_select_l_shift = 4;
bt_mask = MPX_BT_MASK_32;
}
----
Thanks and regards,
-Fred
-----Original Message-----
From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-owner@sourceware.org] On Behalf Of Joel Brobecker
Sent: Wednesday, June 10, 2015 4:13 PM
To: Tedeschi, Walfred
Cc: eliz@gnu.org; gdb-patches@sourceware.org
Subject: Re: [PATCH 1/1] Fix broken GDB build after adding Bound table support for i386.
> Types used for some variables could not be used for 32 bits.
> This patch changes uses larger types to accommodate the biggest
> integer possible.
> 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): Exchange CORE_ADDR by
> ULONGEST.
>
> doc:
> gdb.textinfo (i386): Fix "@end table" end and "@table" placement.
Can you post the error messages, so we can understand why this is necessary? I'm also wondering whether you really want to return a CORE_ADDR which is the sum of 2 ULONGEST now...
--
Joel
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895 Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052