From: Pedro Alves <palves@redhat.com>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: John Baldwin <jhb@freebsd.org>, Alan Modra <amodra@gmail.com>,
Ulrich Weigand <Ulrich.Weigand@de.ibm.com>,
Binutils <binutils@sourceware.org>,
GDB <gdb@sourceware.org>
Subject: Re: Are ppc*_elf_write_core_note Os-specific?
Date: Tue, 19 Jan 2016 22:52:00 -0000 [thread overview]
Message-ID: <569EBE31.9070902@redhat.com> (raw)
In-Reply-To: <CAMe9rOqYLnZZXe9wyDDh_aOh1XT-nNBKmrDN+tXu4j9WFw81Fg@mail.gmail.com>
On 01/19/2016 09:20 PM, H.J. Lu wrote:
> On Tue, Jan 19, 2016 at 12:54 PM, Pedro Alves <palves@redhat.com> 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
next prev parent reply other threads:[~2016-01-19 22:52 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1736699.V7zq9VJIrx@ralph.baldwin.cx>
[not found] ` <20160119001819.GB17028@bubble.grove.modra.org>
2016-01-19 3:14 ` Alan Modra
2016-01-19 10:26 ` Pedro Alves
2016-01-19 16:41 ` H.J. Lu
2016-01-19 19:01 ` John Baldwin
2016-01-19 19:08 ` H.J. Lu
2016-01-19 19:32 ` John Baldwin
2016-01-19 19:35 ` H.J. Lu
2016-01-19 20:29 ` John Baldwin
2016-01-19 20:54 ` Pedro Alves
2016-01-19 21:20 ` H.J. Lu
2016-01-19 21:24 ` H.J. Lu
2016-01-19 22:52 ` Pedro Alves [this message]
2016-01-20 3:07 ` Alan Modra
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=569EBE31.9070902@redhat.com \
--to=palves@redhat.com \
--cc=Ulrich.Weigand@de.ibm.com \
--cc=amodra@gmail.com \
--cc=binutils@sourceware.org \
--cc=gdb@sourceware.org \
--cc=hjl.tools@gmail.com \
--cc=jhb@freebsd.org \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).