From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31265 invoked by alias); 12 Apr 2012 16:38:39 -0000 Received: (qmail 31118 invoked by uid 22791); 12 Apr 2012 16:38:38 -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 16:38:21 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q3CGcIGT013858 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 12 Apr 2012 12:38:18 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q3CGcHHl017434; Thu, 12 Apr 2012 12:38:18 -0400 Message-ID: <4F8704F9.9040309@redhat.com> Date: Thu, 12 Apr 2012 16:45: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: GDB Subject: Re: PATCH: PR gdb/13969: GDBserver doesn't check unsupported binary References: <20120411191609.GA466@intel.com> <4F86D411.4000100@redhat.com> <4F86FB82.7030308@redhat.com> In-Reply-To: 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/msg00311.txt.bz2 On 04/12/2012 05:25 PM, H.J. Lu wrote: > On Thu, Apr 12, 2012 at 8:57 AM, Pedro Alves wrote: >> On 04/12/2012 04:37 PM, H.J. Lu wrote: >> >>> It doesn't work since x32 is a 32-bit process. Although x32 >>> GDBserver can get registers of 64-bit process, it can't handle 64-bit address >> >>> in 64b-bit process, like setting break points. >> >> Oh yeah... PowerPC has PPC_PTRACE_PEEKDATA_3264/PPC_PTRACE_POKEDATA_3264 >> for that, but well, it's PowerPC specific. >> > > Also x32 siginfo is different from 64bit signfo. X32 ptrace can't get 64bit > siginfo due to address fields in siginfo. Are you certain about that? With a 64-bit debugger vs 32-bit process, PTRACE_GETSIGINFO returns the siginfo in 64-bit layout. I could see the kernel returning 64-bit siginfo for x32 too (it's a question of whether the kernel returns its native layout, or the debugger's). In the 64x32 case, GDB has to go through contortions to translate the siginfo layout (in both directions), for the $_siginfo convenience variable's support. This ends up needing to replicate what the kernel's compat layer does. IMO, a PTRACE_ method that always returned the siginfo object in the layout of the inferior would be nice. -- Pedro Alves