From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 76836 invoked by alias); 23 Jun 2016 20:19:43 -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 76819 invoked by uid 89); 23 Jun 2016 20:19:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.3 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_SOFTFAIL autolearn=no version=3.3.2 spammy=Different X-Spam-User: qpsmtpd, 2 recipients X-HELO: bigwig.baldwin.cx Received: from bigwig.baldwin.cx (HELO bigwig.baldwin.cx) (96.47.65.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Thu, 23 Jun 2016 20:19:32 +0000 Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id F1F9EB917; Thu, 23 Jun 2016 16:19:29 -0400 (EDT) From: John Baldwin To: Pedro Alves Cc: gdb-patches@sourceware.org, binutils@sourceware.org Subject: Re: [PATCH 5/6] Add a new gdbarch method to print a single AUXV entry. Date: Thu, 23 Jun 2016 20:19:00 -0000 Message-ID: <3040586.J8ddLNj11U@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.3-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <17933b55-b3e1-51e3-3494-fa35b8cd71fd@redhat.com> References: <20160616060202.63470-1-jhb@FreeBSD.org> <20160616060202.63470-6-jhb@FreeBSD.org> <17933b55-b3e1-51e3-3494-fa35b8cd71fd@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-IsSubscribed: yes X-SW-Source: 2016-06/txt/msg00383.txt.bz2 On Tuesday, June 21, 2016 12:40:16 AM Pedro Alves wrote: > On 06/16/2016 07:02 AM, John Baldwin wrote: > > Different platforms have different meanings for auxiliary vector > > entries. The 'print_auxv' gdbarch method allows an architecture > > to output a suitable description for platform-specific entries. > > > > A fprint_single_auxv function is split out of fprint_target_auxv. > > This function outputs the description of a single auxiliary vector > > entry to the specified file using caller-supplied formatting and > > strings to describe the vector type. > > > > The existing switch on auxiliary vector types is moved out of > > fprint_target_auxv into a new default_print_auxv function. > > default_print_auxv chooses an appropriate format and description > > and calls fprint_single_auxv to describe a single vector entry. > > > > fprint_target_auxv now invokes the gdbarch 'print_auxv' function > > on each vector entry. If the function is not present or returns > > zero, default_printf_auxv is called to output a description for > > the vector. > > I like the idea. Though, I think we can simplify this. How about: > > - make default_print_auxv be the default gdbarch_print_auxv > implementation, in gdbarch.sh. > > - make fprint_target_auxv calls gdbarch_print_auxv unconditionally. > > - remove the support for gdbarch_print_auxv returning 0. Instead, > implementations that want to defer to default_print_auxv simply > call it directly. > > > Also, I think it'd be a bit less confusing to rename things like this: > > gdbarch_print_auxv -> gdbarch_print_auxv_entry > default_print_auxv -> default_print_auxv_entry > fprint_single_auxv -> fprint_auxv_entry > > This way methods that print a single entry are consistently named, > and not so easily confused with methods that print the whole table, > like fprint_target_auxv. Agreed, thanks. I've made these changes along with the auxv_format enum rename and the other issues you've pointed out. Will be posting a v2 series with those fixes in a bit. -- John Baldwin