From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12360 invoked by alias); 3 Feb 2013 02:51:14 -0000 Received: (qmail 12333 invoked by uid 22791); 3 Feb 2013 02:51:13 -0000 X-SWARE-Spam-Status: No, hits=-6.4 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 03 Feb 2013 02:51:06 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r132p5lX018997 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 2 Feb 2013 21:51:05 -0500 Received: from psique (ovpn-113-130.phx2.redhat.com [10.3.113.130]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r132p1kL025588; Sat, 2 Feb 2013 21:51:02 -0500 From: Sergio Durigan Junior To: Pedro Alves 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. References: <510AA7A3.4010702@redhat.com> <20130131230438.17941.90460.stgit@brno.lan> <20130201063725.GC30945@bubble.grove.modra.org> X-URL: http://www.redhat.com Date: Sun, 03 Feb 2013 02:51:00 -0000 In-Reply-To: <20130201063725.GC30945@bubble.grove.modra.org> (Alan Modra's message of "Fri, 1 Feb 2013 17:07:25 +1030") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes 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 X-SW-Source: 2013-02/txt/msg00049.txt.bz2 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