From: Daniel Jacobowitz <drow@false.org>
To: "David S. Miller" <davem@davemloft.net>
Cc: gdb-patches@sources.redhat.com, mark.kettenis@xs4all.nl
Subject: Re: [PATCH]: Use core regset when possible in linux-nat.c
Date: Sat, 08 Apr 2006 20:34:00 -0000 [thread overview]
Message-ID: <20060408203437.GC18707@nevyn.them.org> (raw)
In-Reply-To: <20060406.150330.76592441.davem@davemloft.net>
On Thu, Apr 06, 2006 at 03:03:30PM -0700, David S. Miller wrote:
> *1: The test in corefile.exp to look at the mmap() area pointed
> to by buf2 fails due to a Linux kernel bug, it doesn't dump
> mmap() areas which have not been written to into the core
> file so gdb can't look at it. I've posted a patch to linux-kernel
> already suggesting to take away that check in the ELF core dumper.
Or, we could just change the test. I don't know...
> 2006-04-06 David S. Miller <davem@sunset.davemloft.net>
>
> * linux-nat.c (linux_nat_do_thread_registers): Use the
> regset_from_core_section infrastructure if the target
> supports it.
> * Makefile.in: Update dependencies.
Almost. I know I suggested changing the fallback case from your
original suggestion, but this isn't quite what I meant:
> - fill_fpregset (&fpregs, -1);
> + if (core_regset_p)
> + {
> + regset = gdbarch_regset_from_core_section (gdbarch, ".reg2",
> + sizeof (fpregs));
> + regset->collect_regset (regset, current_regcache, -1,
> + &fpregs, sizeof (fpregs));
> + }
> + else
> + fill_fpregset (&fpregs, -1);
> note_data = (char *) elfcore_write_prfpreg (obfd,
> note_data,
> note_size,
> &fpregs, sizeof (fpregs));
A target which only defines .reg and not .reg2 will crash here.
We'd still have to check for non-NULL; I just think that if the
target supports regset_from_core_section, and still returns NULL,
that that's a pretty good hint we have nothing to write.
The other thing that bugs me about this interface may be harder to fix
- we're still assuming the two are the same, more or less, because the
regset type is required here and we use its sizeof. A problem for
another day?
--
Daniel Jacobowitz
CodeSourcery
next prev parent reply other threads:[~2006-04-08 20:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-06 22:06 David S. Miller
2006-04-08 20:34 ` Daniel Jacobowitz [this message]
2006-04-08 21:54 ` David S. Miller
2006-05-05 20:15 ` Daniel Jacobowitz
2006-05-05 22:40 ` David S. Miller
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=20060408203437.GC18707@nevyn.them.org \
--to=drow@false.org \
--cc=davem@davemloft.net \
--cc=gdb-patches@sources.redhat.com \
--cc=mark.kettenis@xs4all.nl \
/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