From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19727 invoked by alias); 23 Jul 2013 12:57:33 -0000 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 Received: (qmail 19699 invoked by uid 89); 23 Jul 2013 12:57:31 -0000 X-Spam-SWARE-Status: No, score=-4.7 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_DNSWL_MED,RCVD_IN_HOSTKARMA_W,RDNS_NONE,SPF_PASS autolearn=ham version=3.3.1 Received: from Unknown (HELO e28smtp02.in.ibm.com) (122.248.162.2) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 23 Jul 2013 12:57:30 +0000 Received: from /spool/local by e28smtp02.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 23 Jul 2013 18:18:20 +0530 Received: from d28dlp03.in.ibm.com (9.184.220.128) by e28smtp02.in.ibm.com (192.168.1.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 23 Jul 2013 18:18:18 +0530 Received: from d28relay04.in.ibm.com (d28relay04.in.ibm.com [9.184.220.61]) by d28dlp03.in.ibm.com (Postfix) with ESMTP id 630FA1258052 for ; Tue, 23 Jul 2013 18:26:42 +0530 (IST) Received: from d28av03.in.ibm.com (d28av03.in.ibm.com [9.184.220.65]) by d28relay04.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r6NCvDnK24510662 for ; Tue, 23 Jul 2013 18:27:13 +0530 Received: from d28av03.in.ibm.com (loopback [127.0.0.1]) by d28av03.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r6NCvGGG022107 for ; Tue, 23 Jul 2013 22:57:17 +1000 Received: from d23ml188.in.ibm.com (d23ml188.in.ibm.com [9.182.8.144]) by d28av03.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id r6NCvGTi022090; Tue, 23 Jul 2013 22:57:16 +1000 In-Reply-To: <201307230901.r6N91Tfu005129@glazunov.sibelius.xs4all.nl> References: <201307230901.r6N91Tfu005129@glazunov.sibelius.xs4all.nl> Subject: Re: [PATCH 3/5] powerpc64-aix inf-ptrace patch X-KeepSent: C9A62BB4:E1D080B4-65257BB1:00459CFE; type=4; name=$KeepSent To: Mark Kettenis Cc: gdb-patches@sourceware.org, mark.kettenis@xs4all.nl, tromey@redhat.com Message-ID: From: Raunaq 12 Date: Tue, 23 Jul 2013 12:57:00 -0000 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13072312-5816-0000-0000-0000090C9016 X-SW-Source: 2013-07/txt/msg00532.txt.bz2 Thanks a lot for the feedback Mark. > No this will break other systems. Instead, make sure PTRACE_TYPE_ARG3 > gets defined to the proper type of the 3rd argument of ptrace64 when > you choose to use it. I'd expect that if you add the autoconf check I > mentioned you could simply change the #ifdef PTRACE_TYPE_ARG5 in > gdb_ptrace.h to something like: > > #ifdef PTRACE_TYPE_ARG5 > # ifdef HAVE_PTRACE64 > # define ptrace(request, pid, addr, data) \ > ptrace64 (request, pid, addr, data, 0) > # undef PTRACE_TYPE_ARG3 > # define PTRACE_TYPE_ARG3 long long > # else > # define ptrace(request, pid, addr, data) \ > ptrace (request, pid, addr, data, 0) > # endif > #endif The above suggestion of defining PTRACE_TYPE_ARG3 in gdb_ptrace.h works very fine. Thanks for that I can add an autoconf check like - AC_CHECK_FUNCS(ptrace64) and then in gdb_ptrace.h i can add - #ifdef PTRACE_TYPE_ARG5 # if defined (__64BIT__) && defined (HAVE_PTRACE64) # .... Note:- ptrace64 is defined in both 32 and 64 bit mode. But we need to use ptrace64 only when we compile gdb in 64 BIT mode hence the __64BIT__ check. Or I can also use the AC_CHECK_SIZEOF(long) to check if we are in 64 bit mode. Which do you suggest? or, is there a better way of checking this ?