From patchwork Mon Dec 15 13:49:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 4253 Received: (qmail 8735 invoked by alias); 15 Dec 2014 13:49:39 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 8613 invoked by uid 89); 15 Dec 2014 13:49:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 15 Dec 2014 13:49:36 +0000 Received: from svr-orw-fem-03.mgc.mentorg.com ([147.34.97.39]) by relay1.mentorg.com with esmtp id 1Y0W1k-0003z9-Rc from Yao_Qi@mentor.com ; Mon, 15 Dec 2014 05:49:32 -0800 Received: from GreenOnly (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.3.181.6; Mon, 15 Dec 2014 05:49:31 -0800 From: Yao Qi To: Ulrich Weigand CC: Jan Kratochvil , Subject: Re: [PATCH v4 12/14] add linux_infcall_mmap References: <201412151241.sBFCfZex012704@d03av02.boulder.ibm.com> Date: Mon, 15 Dec 2014 21:49:15 +0800 In-Reply-To: <201412151241.sBFCfZex012704@d03av02.boulder.ibm.com> (Ulrich Weigand's message of "Mon, 15 Dec 2014 13:41:34 +0100") Message-ID: <87egs1t44k.fsf@codesourcery.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 X-IsSubscribed: yes Ulrich Weigand writes: > /home/uweigand/dailybuild/spu-tc-2014-12-13/binutils-gdb-head/binutils-gdb/gdb/linux-tdep.c: > In function 'linux_infcall_mmap': > /home/uweigand/dailybuild/spu-tc-2014-12-13/binutils-gdb-head/binutils-gdb/gdb/linux-tdep.c:1945: > error: expected identifier before numeric constant > > on my RHEL 5 build system, presumably because ARG_MAX is defined > (to a numeric constant) by a system header. > > Can we give those more distinctive names? I got the same problem. Patch below unblocks the build. diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c index 485f5ca..6b5e475 100644 --- a/gdb/linux-tdep.c +++ b/gdb/linux-tdep.c @@ -1942,9 +1942,9 @@ linux_infcall_mmap (CORE_ADDR size, unsigned prot) CORE_ADDR retval; enum { - ARG_ADDR, ARG_LENGTH, ARG_PROT, ARG_FLAGS, ARG_FD, ARG_OFFSET, ARG_MAX + ARG_ADDR, ARG_LENGTH, ARG_PROT, ARG_FLAGS, ARG_FD, ARG_OFFSET, ARG_LAST }; - struct value *arg[ARG_MAX]; + struct value *arg[ARG_LAST]; arg[ARG_ADDR] = value_from_pointer (builtin_type (gdbarch)->builtin_data_ptr, 0); @@ -1961,7 +1961,7 @@ linux_infcall_mmap (CORE_ADDR size, unsigned prot) arg[ARG_FD] = value_from_longest (builtin_type (gdbarch)->builtin_int, -1); arg[ARG_OFFSET] = value_from_longest (builtin_type (gdbarch)->builtin_int64, 0); - addr_val = call_function_by_hand (mmap_val, ARG_MAX, arg); + addr_val = call_function_by_hand (mmap_val, ARG_LAST, arg); retval = value_as_address (addr_val); if (retval == (CORE_ADDR) -1) error (_("Failed inferior mmap call for %s bytes, errno is changed."),