This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] target_read_aux_vector


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]