This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [PATCH] NetBSD ELF core note type pretty-printing for readelf
On Wed, Jan 09, 2002 at 11:44:11AM +0000, Nick Clifton wrote:
> > + static char * get_netbsd_elfcore_note_type PARAMS ((unsigned int));
>
> The function could return a "const char *".
get_note_type() also could, then. Should I adjust that function as well?
> > + if (e_type < 32)
>
> 32 appears to be a magic constant for NetBSD core files. Please
> consider replacing it with a meaningfully named #define macro.
Yes, it's the start of the machine-dependent ptrace requests.
> > + else if (strncmp (pnote->namedata, "NetBSD-CORE", 11) == 0)
>
> Why use strncmp() rather than strcmp(). [This is ignorance on my
> part, I do not know very much about the format of the contents of core
> files.] If you must use strncmp then it might be nice to eliminate
> the magic nature of the constant 11. (I know that there are other
> places in readelf where strncmp is used in this way too. They ought
> to be changed as well).
For multi-LWP core files, the notes can have names like:
NetBSD-CORE <- for whole process
NetBSD-CORE@5 <- for lwp5 of process
NetBSD-CORE@1 <- for lwp1 of process
I want to match all of these, which the strncmp does.
> Grammar note:
>
> > + /* There are not currently any other machine-independent notes defined
> > + for NetBSD ELF core files.
>
> A better wording would be:
>
> /* As of Jan 2002 there are no other machine-independent notes
> defined for NetBSD core files.
Ok, I'll adjust this, as well.
Thanks.
--
-- Jason R. Thorpe <thorpej@wasabisystems.com>