This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [PATCH] btrace: support 32-bit inferior on 64-bit host

> -----Original Message-----
> From: Pedro Alves []
> Sent: Monday, March 2, 2015 11:08 PM
> To: Metzger, Markus T
> Cc:; 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.


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]