From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17102 invoked by alias); 13 Apr 2012 16:23:23 -0000 Received: (qmail 17092 invoked by uid 22791); 13 Apr 2012 16:23:21 -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; Fri, 13 Apr 2012 16:23:06 +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 q3DGN1er023394 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 13 Apr 2012 12:23:01 -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 q3DGN0nm000837; Fri, 13 Apr 2012 12:23:00 -0400 Message-ID: <4F8852E3.9030003@redhat.com> Date: Fri, 13 Apr 2012 16:28: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: Will Deacon CC: "gdb-patches@sourceware.org" Subject: Re: [PATCH] gdbserver: ARM: add support for uclinux References: <1334308067-2285-1-git-send-email-will.deacon@arm.com> <4F883EE5.8080407@redhat.com> <20120413155949.GC4605@mudshark.cambridge.arm.com> In-Reply-To: <20120413155949.GC4605@mudshark.cambridge.arm.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/msg00369.txt.bz2 On 04/13/2012 04:59 PM, Will Deacon wrote: > On Fri, Apr 13, 2012 at 03:57:41PM +0100, Pedro Alves wrote: >> On 04/13/2012 10:07 AM, Will Deacon wrote: >> >>> When debugging a uclinux target, it is necessary to retrieve the text >>> and data offsets of the running program in order for symbol resolution >>> to work correctly. >>> >>> This patch defines PT_{TEXT,DATA,TEXT_END}_ADDR for ARM, which can be >>> issued as `magic' addresses to the PTRACE_PEEKUSER request in order to >>> retrieve the child offsets. >> >> >> Is this for older kernels? I see these defined in >> arch/arm/include/asm/ptrace.h in current mainline. > > Actually, it's for bleeding-edge kernels (3.4-rc2) since the ptrace request > has been broken until recently (it would return -EIO). > > Although the #defines are exported in the kernel headers, they don't seem to > be picked up by sys/ptrace.h, which is why I followed the same path as the > other architectures here. An alternative would be to include asm/ptrace.h > directly and introduce guards for the other architectures to avoid duplicate > #defines... I think that'd be good. We already include asm/ptrace.h in many of the linux native files: $ grep asm/ptrace * -rn | grep -v ChangeLog amd64-linux-nat.c:39: because the latter redefines FS and GS for no apparent amd64-linux-nat.c:45:#include gdbserver/linux-ppc-low.c:25:#include gdbserver/linux-ia64-low.c:32:#include gdbserver/linux-mips-low.c:53:#include gdbserver/linux-tic6x-low.c:37:#include gdbserver/linux-m68k-low.c:157:#include gdbserver/linux-bfin-low.c:25:#include gdbserver/linux-sh-low.c:30:#include gdbserver/linux-s390-low.c:26:#include hppa-linux-nat.c:32:#include ia64-linux-nat.c:39:#include mips-linux-nat.c:66: These ``addresses'' are normally defined in . ppc-linux-nat.c:80: ppc kernel's asm/ptrace.h defines PTRACE_GETVRREGS and s390-nat.c:34:#include spu-linux-nat.c:33:#include So it probably doesn't hurt to include it in linux-low.c. Want to give it a try? -- Pedro Alves