From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 85424 invoked by alias); 19 Jan 2016 22:52:38 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 85403 invoked by uid 89); 19 Jan 2016 22:52:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=OSspecific, OS-specific, ideally, motivation X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 19 Jan 2016 22:52:37 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id AE7C6742; Tue, 19 Jan 2016 22:52:35 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u0JMqXw3027209; Tue, 19 Jan 2016 17:52:34 -0500 Message-ID: <569EBE31.9070902@redhat.com> Date: Tue, 19 Jan 2016 22:52:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: "H.J. Lu" CC: John Baldwin , Alan Modra , Ulrich Weigand , Binutils , GDB Subject: Re: Are ppc*_elf_write_core_note Os-specific? References: <1736699.V7zq9VJIrx@ralph.baldwin.cx> <1866442.mSXmZIT7y1@ralph.baldwin.cx> <1502134.K9IMtmAub2@ralph.baldwin.cx> <569EA298.8070303@redhat.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-01/txt/msg00041.txt.bz2 On 01/19/2016 09:20 PM, H.J. Lu wrote: > On Tue, Jan 19, 2016 at 12:54 PM, Pedro Alves wrote: >> Can this be made to work along the lines of 70a38d42c5b3 ? >> > > Probably. See: > > https://sourceware.org/git/?p=binutils-gdb.git;a=patch;h=0b1b9b0935de0f6d97540d80dfb698444cb07072 > The thing is that GDB always knows the target ABI/OS it wants the core note to be generated for, so there should be no need to go through the bfd target vector to generate an OS-specific note, or to stuff everything through a crippling varargs interface such as elf_backend_write_core_note's. Instead, bfd can export OS-specific variants of the note generation functions, and GDB can call those directly. By avoiding the varargs-style strangling of elf_backend_write_core_note, it's also MUCH easier to pass down note-specific info. The original motivation of 70a38d42c5b3 (elfcore_write_linux_prpsinfo*) was so that we could fill in all fields of the Linux prpsinfo structure. (Note how elfcore_write_prpsinfo only takes a few parameters; it's missing a lot of others bits.) The gdb-side counterpart of 70a38d42c5b3 is b3ac9c77560a. All the Linux-specific NT_PRPSINFO handling in the different elf_backend_write_core_note implementations in bfd are dead code, I think, since GDB always calls elfcore_write_linux_prpsinfo* directly, and only GDB calls the elfcore_write_pr* functions. I think that ideally we'd give the same treatment to elfcore_write_prstatus; it's just that nobody ever did the leg work. Thanks, Pedro Alves