Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Sergio Durigan Junior <sergiodj@redhat.com>
To: Pedro Alves <palves@redhat.com>
Cc: binutils@sourceware.org, jan.kratochvil@redhat.com,
	hongjiu.lu@intel.com,        gdb-patches@sourceware.org
Subject: Re: [PATCH 1/2] New entry points for writing Linux NT_PRPSINFO notes.
Date: Sun, 03 Feb 2013 02:51:00 -0000	[thread overview]
Message-ID: <m3zjzmrtyj.fsf@redhat.com> (raw)
In-Reply-To: <20130201063725.GC30945@bubble.grove.modra.org> (Alan Modra's	message of "Fri, 1 Feb 2013 17:07:25 +1030")

On Friday, February 01 2013, Alan Modra wrote:

> On Thu, Jan 31, 2013 at 11:04:38PM +0000, Pedro Alves wrote:
>> 	* Makefile.in (SOURCE_HFILES): Add `elf-linux-psinfo.h'.
>> 	* elf-bfd.h (elf_internal_linux_prpsinfo): New structure
>> 	declaration.
>> 	(elfcore_write_linux_prpsinfo32, elfcore_write_linux_prpsinfo64)
>> 	(elfcore_write_ppc32_linux_prpsinfo32): New declarations.
>> 	* elf-linux-psinfo.h: New file.
>> 	* elf.c: Include elf-linux-psinfo.h.
>> 	(elfcore_write_linux_prpsinfo32, elfcore_write_linux_prpsinfo64):
>> 	New functions.
>> 	* elf32-ppc.c: Include `elf-linux-psinfo.h'.
>> 	(elf_external_ppc_linux_prpsinfo32): New structure declaration.
>> 	(PPC_LINUX_PRPSINFO32_SWAP_FIELDS): New macro.
>> 	(elfcore_write_ppc_linux_prpsinfo32): New function.
>
> Looks good to me.

Thanks Pedro for the patch, and Alan for the review.

I know the patch has been approved, but just for the record I would like
to emit my opinion about it.  As I said to Pedro offlist, I would take
his suggestion of "getting rid of the middle man" a little bit further:
I would have created those Linux-specific functions for handling the
PRPSINFO note inside GDB, and not inside BFD.  I think this is a little
better because:

1) It does not contribute to the mess that is going on inside this area
of BFD, by just leaving things as-is, without introducing more
specialized functions that will have to be maintained later, and

2) As Pedro said in the message, it could make use of the already
existing GDB target sniffer, which would allow us to extend this later
to other targets without having to worry about making more and more
functions on bfd/elf-bfd.h.

I know that this approach has the drawback of putting some low level
logic that should be in BFD inside GDB, but IMO it's a small price to
pay.  Those functions inside GDB would still call `elfcore_write_note'
and make the byte swapping just as the `elf_write_linux_prpsinfo*' in
this patch, so the writing mechanism would still be inside BFD.

Anyway, I just would like to keep my opinion registered, in case we
choose to tackle this problem again in the future.

BTW, I plan to commit this patch as soon as the GDB side of it gets
approved, but I don't have write permission to the binutils repository
yet.  Alan (or some other binutils maintainer reading this), is it OK if
I send a message to overseers Ccing you asking for write permission?

Thanks,

-- 
Sergio


  reply	other threads:[~2013-02-03  2:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-30  6:53 [PATCH 1/3] Implement new Linux target vectors on BFD Sergio Durigan Junior
2013-01-30  9:16 ` Alan Modra
2013-01-30 16:43   ` Sergio Durigan Junior
2013-01-31 17:19     ` Pedro Alves
2013-01-31 23:04       ` [PATCH 1/2] New entry points for writing Linux NT_PRPSINFO notes Pedro Alves
2013-02-01  6:37         ` Alan Modra
2013-02-03  2:51           ` Sergio Durigan Junior [this message]
2013-02-04 18:31           ` Sergio Durigan Junior
2013-01-31 23:05       ` [PATCH 2/2] Put more info in NT_PRPSINFO Linux notes Pedro Alves
2013-02-03 21:05         ` Sergio Durigan Junior
2013-02-04 16:36           ` Pedro Alves
2013-02-04 18:41             ` Sergio Durigan Junior
2013-01-30 16:44   ` [PATCH 1/3] Implement new Linux target vectors on BFD H.J. Lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3zjzmrtyj.fsf@redhat.com \
    --to=sergiodj@redhat.com \
    --cc=binutils@sourceware.org \
    --cc=gdb-patches@sourceware.org \
    --cc=hongjiu.lu@intel.com \
    --cc=jan.kratochvil@redhat.com \
    --cc=palves@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox