Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@redhat.com>
To: Roland McGrath <roland@redhat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [PATCH] make gcore dump read-only sections not from files
Date: Thu, 09 Oct 2003 21:55:00 -0000	[thread overview]
Message-ID: <3F85D955.8000303@redhat.com> (raw)
In-Reply-To: <200310090244.h992io72028917@magilla.sf.frob.com>

Roland McGrath wrote:
>>I'll step up, since I wrote gcore.  I like what you're doing,
>>but I'm uncertain about the SOLIB_ADD part.  Like you, I don't
>>understand why it was the way it was, nor the implications of
>>the change.  But I think this can be done fairly easily without
>>that change.
> 
> 
> Ok.  I would sure like to know why core files work differently this way.
> It would be nice if there were any comments in the code, for example!
> The comment above update_solib_list says it's used for core files and
> attaching, which is true.  But it says nothing about why.  I don't
> understand why anything about this part of the solib handling would be
> different for core files than for running.
> 
> 
>>Does this (rewriting your main loop using ALL_OBJSECTIONS)
>>seem reasonable?
> 
> 
> Sure does.  I didn't read enough code to understand exactly what
> objfile_find_memory_regions was doing and misread it as doing less.
> 
> Along the way I noticed another difference between gcore-produced and
> kernel-produced core dumps.  The omitted segments in real core dumps
> have nonzero p_memsz but zero p_filesz, which in phdrs indicates that
> the memory is occupied but the contents are not available.  gcore's
> dumps zero the size, which gives a wrong indication of the address space.
> I changed that as well, so gcore's dumps now look more like real dumps.
> 
> This works well enough.  However, I think that making the determination
> based on the kernel-supplied indication of anonymous vs file-backed may
> make more sense.  (Linux 2.6's behavior may be changing in this regard,
> and using that as a determining factor rather than just permission
> bits.)  That would require changing the to_find_memory_regions interface
> as I described earlier.  Can you comment on that?

I'll go back and look, but meanwhile, this change is approved.

Michael


  reply	other threads:[~2003-10-09 21:55 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 [this message]
2003-10-11  1:57       ` Roland McGrath
2003-10-09 22:17     ` Michael Snyder
2003-10-11  2:20       ` Roland McGrath

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=3F85D955.8000303@redhat.com \
    --to=msnyder@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=roland@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