From: Roland McGrath <roland@redhat.com>
To: Michael Snyder <msnyder@redhat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [PATCH] make gcore dump read-only sections not from files
Date: Sat, 11 Oct 2003 02:20:00 -0000 [thread overview]
Message-ID: <200310110220.h9B2KMbd021294@magilla.sf.frob.com> (raw)
In-Reply-To: Michael Snyder's message of Thursday, 9 October 2003 15:17:14 -0700 <3F85DE6A.5040101@redhat.com>
> I guess you mean this?
Right.
> > Note that this patch makes gcore dump more regions than the Linux
> > kernel does even with my change to its behavior. In particular,
> > read-only mmap'd portions of files are dumped by gcore but not by the
> > kernel. This is a real common issue in practice, as your average
> > GNU/Linux process nowadays has the large locale-archive file mapped
> > in, and some processes may be mapping huge files in read-only. An
> > alternative change would be to change the to_find_memory_regions
> > callback interface to add a flag argument saying whether the memory
> > region came from a file. Then gcore_create_callback could simply test
> > !write && !anonymous and be wholly consistent with the kernel core
> > dumping (assuming my change to it), and the infrun.c change is not
> > required
>
> Sounds reasonable -- is it portable? A portable testcase for the
> testsuite would make the change fairly easy to evaluate / approve.
I don't understand what you mean by portable in this context. Such a
notion as anonymous vs file-backed memory is sensical across systems, so
there's nothing "anti-portable" about adding that concept into the
to_find_memory_regions function interface.
If you mean, can the information be found and reported on systems of other
Linux, then yes. That is, to_find_memory_regions is implemented only in
procfs.c and gnu-nat.c, and both of those can glean the flag from the
information they already read.
If you mean, is this choice of which regions of memory to omit from the
core dump consistent with what many kernels write in their core dumps, it's
harder to say but the answer is mostly yes. I also don't think it matters,
except in that we err on the side of omitting fewer. Linux before 2.6
omitted all read-only regions, which is what gdb did before any of my
changes. Linux 2.6 now omits only read-only regions backed by files. A
quick test on Solaris 9 suggests that this is what it's doing as well. (I
am the author and maintainer of the GNU/Hurd core writing code, so it will
do whatever I think is best anyway.)
Thanks,
Roland
prev parent reply other threads:[~2003-10-11 2:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-10-07 8:19 Roland McGrath
2003-10-09 0:30 ` Michael Snyder
2003-10-09 2:44 ` Roland McGrath
2003-10-09 21:55 ` Michael Snyder
2003-10-11 1:57 ` Roland McGrath
2003-10-09 22:17 ` Michael Snyder
2003-10-11 2:20 ` Roland McGrath [this message]
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=200310110220.h9B2KMbd021294@magilla.sf.frob.com \
--to=roland@redhat.com \
--cc=gdb-patches@sources.redhat.com \
--cc=msnyder@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