From: Pedro Alves <palves@redhat.com>
To: "Luis Machado" <luis.machado@linaro.org>,
"Jirka Koutný" <koutnji2@gmail.com>,
gdb@gnu.org
Subject: Re: mode processor mode switch
Date: Thu, 16 Jan 2020 18:52:00 -0000 [thread overview]
Message-ID: <ac1c8bc2-7aaf-4980-f249-1178de843b43@redhat.com> (raw)
In-Reply-To: <763defc1-90ae-ceda-61db-493ec81ca36d@linaro.org>
On 1/16/20 2:51 PM, Luis Machado wrote:
> Hi,
>
> On 1/14/20 8:58 AM, Jirka Koutný wrote:
>> Hello,
>>
>> I have a 32-bit elf executable which at some point switches to long mode
>> (kernel is 64-bit). Is there a way to tell gdb about the .code32/64
>> directives? Because expectedly the switch messes up disassembly and
>> stepping.
>>
>> Thank you
>> Jirka
>>
>
> Unfortunately i don't think there is a good way to achieve this with the current implementation.
>
> You could teach GDB about the quirks in the architecture, but it sounds better to have a more general solution.
>
> I'm working on making this more flexible though, since i have a need to make the architecture information per-thread, at least the target description with the registers and types.
>
For x86-64 in particular, I think the ideal solution would be for
the remote target to always report the widest mode it supports,
which would be 64-bit, and then do the 32-bit/16-bit modes
presentation all on the gdb side (i.e., user-visible 32-bit on
top of 64-bit description). Mode switching would not change the remote
target description. This is unlike the current architecture where a
remote server reports a 32-bit description for a 32-bit process even
if the remote server is actually running on a 64-bit machine.
Thanks,
Pedro Alves
next prev parent reply other threads:[~2020-01-16 18:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-14 11:59 Jirka Koutný
2020-01-16 14:52 ` Luis Machado
2020-01-16 18:52 ` Pedro Alves [this message]
2020-01-17 21:46 ` John Baldwin
2020-01-21 12:56 ` Jirka Koutný
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=ac1c8bc2-7aaf-4980-f249-1178de843b43@redhat.com \
--to=palves@redhat.com \
--cc=gdb@gnu.org \
--cc=koutnji2@gmail.com \
--cc=luis.machado@linaro.org \
/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