This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] btrace: support 32-bit inferior on 64-bit host
- From: Pedro Alves <palves at redhat dot com>
- To: "Metzger, Markus T" <markus dot t dot metzger at intel dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Date: Tue, 03 Mar 2015 10:53:58 +0000
- Subject: Re: [PATCH] btrace: support 32-bit inferior on 64-bit host
- Authentication-results: sourceware.org; auth=none
- References: <1423473177-28369-1-git-send-email-markus dot t dot metzger at intel dot com> <54F4DF52 dot 3080309 at redhat dot com> <A78C989F6D9628469189715575E55B231E6EEF36 at IRSMSX104 dot ger dot corp dot intel dot com>
On 03/03/2015 10:12 AM, Metzger, Markus T wrote:
>> From: Pedro Alves [mailto:palves@redhat.com]
>>> Use the machine field in struct utsname provided by a uname call to
>>> determine whether we are running on a 64-bit host.
>>
>> Does this correctly handle the case of 32-bit GDB on 64-bit system
>> debugging _32-bit_ inferior? Based on e.g..
>>
>> $ uname -m
>> x86_64
>> $ i386 uname -m
>> i686
>>
>> I'd guess "no".
>
> The man page of i386 (setarch) says:
>
> "This utility currently only affects the output of uname -m. For example, on an
> AMD64 system, running 'setarch i386 program' will cause 'program' to see i686 (or other
> relevant arch) instead of x86_64 as machine type."
>
> When I compile GDB on a 32-bit system and then run it on a 64-bit system, the uname
> call reports "x86_64".
>
> When I run GDB under i386, this changes to "i686" - no matter where I built GDB.
>
> I'd say it is working for our purpose.
Sounds good then, thanks for confirming. Patch is OK with the
suggested changes.
Thanks,
Pedro Alves