From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9441 invoked by alias); 8 Aug 2011 14:01:01 -0000 Received: (qmail 9427 invoked by uid 22791); 8 Aug 2011 14:01:00 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO glazunov.sibelius.xs4all.nl) (83.163.83.176) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 08 Aug 2011 14:00:41 +0000 Received: from glazunov.sibelius.xs4all.nl (kettenis@localhost [127.0.0.1]) by glazunov.sibelius.xs4all.nl (8.14.3/8.14.3) with ESMTP id p78DxF4Y007591; Mon, 8 Aug 2011 15:59:15 +0200 (CEST) Received: (from kettenis@localhost) by glazunov.sibelius.xs4all.nl (8.14.3/8.14.3/Submit) id p78DxCkE017785; Mon, 8 Aug 2011 15:59:13 +0200 (CEST) Date: Mon, 08 Aug 2011 14:01:00 -0000 Message-Id: <201108081359.p78DxCkE017785@glazunov.sibelius.xs4all.nl> From: Mark Kettenis To: yao@codesourcery.com CC: vapier@gentoo.org, gdb-patches@sourceware.org In-reply-to: <4E3FDEF3.5070200@codesourcery.com> (message from Yao Qi on Mon, 08 Aug 2011 21:04:51 +0800) Subject: Re: [RFA 4/8] New port: TI C6x: Read loadmap from gdbserver References: <4E263865.2070100@codesourcery.com> <4E2CF0C6.2060504@codesourcery.com> <201108072030.02712.vapier@gentoo.org> <4E3F4E05.6010409@codesourcery.com> <201108080828.p788SSjq018524@glazunov.sibelius.xs4all.nl> <4E3FDEF3.5070200@codesourcery.com> 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: 2011-08/txt/msg00143.txt.bz2 > Date: Mon, 08 Aug 2011 21:04:51 +0800 > From: Yao Qi > > On 08/08/2011 04:28 PM, Mark Kettenis wrote: > > Now the kernel vs. libc headers issue has always been a contentious > > one on Linux. But I think you should use the PTRACE_-prefixed names > > in your code since those are the "official" Linux names, since Linux > > was intended to be System V compatible. The PT_-prefixed names are > > really only for compatibility with BSD (So I don't really understand > > why people keep adding them for ptrace(2) requests that no BSD variant > > ever had). > > Mark, thanks for pointing this out. If we want to use PTRACE_GETDSBT > here, we should include "asm/ptrace.h" in linux-low.c, which I am > hesitant to do. Current convention in linux-low.c, AFAICT, is about > target-independent code, and so "asm/ptrace.h" is not included. I don't > want to break this convention to include "asm/ptrace.h", but I am not > insist on this. If you believe it is safe to include "asm/ptrace.h", I > am fine with it. Bleah. Assuming your TI C6x system's libc headers are somewhat similar to my amd64 system I see your problem. The header file uses an enum for the PTRACE_XXX values, and only has #defines for the PT_XXX values. I think you have two choices: 1. Add a configure test for PTRACE_GETDSBT. 2. s/PTRACE_/PT_/g everywehere in your diff. Personally I'd prefer choice #2, since we already have to many configure checks ;).