From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13188 invoked by alias); 7 Oct 2003 01:53:18 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 13181 invoked from network); 7 Oct 2003 01:53:18 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 7 Oct 2003 01:53:18 -0000 Received: from drow by nevyn.them.org with local (Exim 4.22 #1 (Debian)) id 1A6h2L-0004rn-Tx for ; Mon, 06 Oct 2003 21:53:17 -0400 Date: Tue, 07 Oct 2003 01:53:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sources.redhat.com Subject: Re: [PATCH] target_read_aux_vector Message-ID: <20031007015317.GB18589@nevyn.them.org> Mail-Followup-To: gdb-patches@sources.redhat.com References: <200310070148.h971m8Wd011747@magilla.sf.frob.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200310070148.h971m8Wd011747@magilla.sf.frob.com> User-Agent: Mutt/1.5.1i X-SW-Source: 2003-10/txt/msg00148.txt.bz2 On Mon, Oct 06, 2003 at 06:48:08PM -0700, Roland McGrath wrote: > This patch adds target_read_aux_vector to read the auxv information as a > whole block (there is no code here that interprets its contents). It also > makes ELF core file writing (gcore) use this to produce an NT_AUXV note. > I have only tested the linux-proc.c code in actuality, but the procfs.c > (Solaris) and corelow.c code is so simple it would be hard for it to be > wrong. > > The function signature used here is a little goofy if you ask me. But I > modelled it on target_make_corefile_notes, which is another recent addition > and so I assume it is in the style that gdb folk prefer. I would be happy > to change the signature if there is a different preference. I made the > malloc'd-ness of the returned pointer part of the interface rather than > having it call make_cleanup and magically know that's the right scope as > the to_make_corefile_notes implementations do. > > The one way I've tested this is that "gcore" used on Linux 2.6 du jour > produces an NT_AUXV note in the core file matching what a kernel-written > dump has. The Solaris additions should make it do the same there as well. > > The core_ops implementation of target_read_aux_vector is not presently > used at all, because you can't do gcore when examining a core file. > (Incidentally, I think gdb should support that. Doing that and comparing > what gdb wrote to the original core file is a good test of both core file > reading and core file writing.) It would be used by the tdep code looking > for AT_SYSINFO_EHDR, as we have been discussing here. > > I am not happy that the identical function is duplicated in procfs.c and > linux-proc.c; but I did not see any place for common code that is usable > for both flavors of /proc filesystem. The to_make_corefile_notes hooks in > those two files are close to identical as well. > > > Comments? Yes, comments would be nice :) Just trivially: summary comments before new functions. And two spaces after full stops. I have no substantive comments on this code. Let's see if anyone else does though. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer