From: Joel Brobecker <brobecker@adacore.com>
To: "Tedeschi, Walfred" <walfred.tedeschi@intel.com>
Cc: "eliz@gnu.org" <eliz@gnu.org>,
"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [PATCH 1/1] Fix broken GDB build after adding Bound table support for i386.
Date: Thu, 11 Jun 2015 16:18:00 -0000 [thread overview]
Message-ID: <20150611161806.GC11014@adacore.com> (raw)
In-Reply-To: <AC542571535E904D8E8ADAE745D60B194442976E@IRSMSX104.ger.corp.intel.com>
> 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?
First, my understanding of the the general principles used in
the GDB project:
For native compilers, we would indeed generally say 32bit GDB can only
debug 32bit applications, but not as an absolute rule. That limitation
is usually not because of GDB but rather because of a limitation in
the underlying systems which don't support 64bit debugging from 32bit
programs.
In your case, we are in a slightly different situation, however, as
we are in what we call "target" (-tdep) code, rather than "native"
(-nat). In that case, if it is difficult to support 32bit debugging
64bit app + something of little interest, then we can indeed consider
keeping that scenario unsupported. But we should otherwise try looking
at whether we can support it.
Now, looking more specifically at your situation, it seems to me
that supporting 64bit target if CORE_ADDR is 32bit is going to be,
erm, hard. So, something along the lines above would indeed be
the best we can do. You have to be careful to conditionalize on
something else that __x86_64__, though, as the host's CPU might
not be an x86/x86_64...
--
Joel
prev parent reply other threads:[~2015-06-11 16:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-10 12:46 Walfred Tedeschi
2015-06-10 12:51 ` Tedeschi, Walfred
2015-06-10 14:13 ` Joel Brobecker
2015-06-10 14:56 ` Tedeschi, Walfred
2015-06-11 9:53 ` Tedeschi, Walfred
2015-06-11 16:18 ` Joel Brobecker [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150611161806.GC11014@adacore.com \
--to=brobecker@adacore.com \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=walfred.tedeschi@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox