From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4532 invoked by alias); 12 Apr 2012 20:58:51 -0000 Received: (qmail 4427 invoked by uid 22791); 12 Apr 2012 20:58:49 -0000 X-SWARE-Spam-Status: No, hits=-7.2 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 12 Apr 2012 20:58:34 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q3CKwVdo025412 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 12 Apr 2012 16:58:31 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q3CKwUlI004012; Thu, 12 Apr 2012 16:58:30 -0400 Message-ID: <4F8741F6.50105@redhat.com> Date: Thu, 12 Apr 2012 21:26:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 MIME-Version: 1.0 To: "H.J. Lu" CC: "H.J. Lu" , GDB Subject: Re: PATCH: Convert siginfo for x32 in gdbserver References: <20120412172000.GA7985@intel.com> <20120412202551.GA5901@intel.com> In-Reply-To: <20120412202551.GA5901@intel.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-04/txt/msg00326.txt.bz2 On 04/12/2012 09:25 PM, H.J. Lu wrote: > +/* Is this process 64-bit? */ > +static int linux_is_elf64; > #endif /* __x86_64__ */ > > /* Convert a native/host siginfo object, into/from the siginfo in the > @@ -934,6 +1111,21 @@ x86_siginfo_fixup (siginfo_t *native, void *inf, int direction) > > return 1; > } > + /* No fixup for native x32 GDB. */ > + else if (!linux_is_elf64 && sizeof (void *) == 8) > + { > + if (sizeof (siginfo_t) != sizeof (compat_x32_siginfo_t)) > + fatal ("unexpected difference in siginfo"); > + > + if (direction == 0) > + compat_x32_siginfo_from_siginfo ((struct compat_x32_siginfo *) inf, > + native); > + else > + siginfo_from_compat_x32_siginfo (native, > + (struct compat_x32_siginfo *) inf); > + > + return 1; > + } > #endif > > return 0; > @@ -1138,6 +1330,7 @@ x86_arch_setup (void) > /* Amd64 has 16 xmm regs. */ > num_xmm_registers = 16; > > + linux_is_elf64 = is_elf64; > x86_linux_update_xmltarget (); > return; > } This new global is buggy in that in extended-remote mode (gdbserver --multi): you can start a 64-bit inferior, kill it, then start a 32-bit inferior. So clear it also in the 32-bit inferior case. Okay with that change. This new flag should be made a per-inferior flag, probably as a new process->private->is_elf64 flag, but the status quo is that there are other similar globals, so I'm okay with a new one, and I'll fix them all in the ongoing multi-process+multi-arch series. Thanks. -- Pedro Alves