This is the mail archive of the gdb-patches@sourceware.org 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


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


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