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: "Metzger, Markus T" <markus dot t dot metzger at intel dot com>
- To: Pedro Alves <palves at redhat 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, 3 Mar 2015 10:12:45 +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>
> -----Original Message-----
> From: Pedro Alves [mailto:palves@redhat.com]
> Sent: Monday, March 2, 2015 11:08 PM
> To: Metzger, Markus T
> Cc: gdb-patches@sourceware.org; Jan Kratochvil
> Subject: Re: [PATCH] btrace: support 32-bit inferior on 64-bit host
> > 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.
Regards,
Markus.
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