Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@cygnus.com>
To: thorpej@wasabisystems.com, msnyder@cygnus.com
Cc: Eli Zaretskii <eliz@is.elta.co.il>, gdb-patches@sources.redhat.com
Subject: Re: [RFC] New command 'gcore'
Date: Wed, 12 Dec 2001 17:17:00 -0000	[thread overview]
Message-ID: <3C18018E.9080902@cygnus.com> (raw)
In-Reply-To: <20011212152813.J28715@dr-evil.shagadelic.org>

Cool feature of the month comes to mind.  Once this is working all sorts of things are possible.


> Yah, gcore is cool, but it generally requires support from the kernel
> in one way or another:
> 
> 	* You need to know which chunks of the address space are
> 	  actually mapped, and the protection of those regions.


ac131313@nettle$ cat /proc/$$/maps
01800000-01880000 r-xp 00000000 0a:05 10177
018b0000-018c5000 rwxp 00070000 0a:05 10177
018c5000-018e7000 rwxp 00000000 00:00 0
418b0000-418c5000 rwxp 00000000 0a:05 93269
418c5000-418c8000 rwxp 00000000 00:00 0
418c8000-418d0000 rw-p 00000000 00:00 0
418d0000-418d2000 r-xp 00000000 0a:05 87796
41911000-41913000 rwxp 00001000 0a:05 87796
41913000-419a6000 r-xp 00000000 0a:05 87369
419e5000-419f2000 rwxp 00092000 0a:05 87369
419f2000-419ff000 rwxp 00000000 00:00 0
7dfff000-7fdff000 ---p 00000000 00:00 0
7fdff000-7fff0000 rwxp 00000000 00:00 0
7fff0000-7ffff000 rwxp 00000000 00:00 0

The wonders of procfs!


More seriously, the target vector would need an enhancement to include 
an address spaces iterator.


> 	* You need to know if a given chunk of the address space
> 	  should be dumped, even if it is mapped (consider a
> 	  memory-mapped device where reads produce side-effects).


That one is more interesting.  I suspect it might be best to punt this 
and leave finding the solution to those with the problem :-)

I would note that there is now a memory attribute framework so GDB might 
be able to extract some of the information from that.  A remote target 
might use a remote query (or just suck the memory it knows is relevant). 
  However, if I were Michael, I'd just get a basic proof of concept done.


> 	* You need to know how many LWPs there are, and need to
> 	  be able to iterate over them.


Hmm. Yes, good point.

To be more exact.  On a target such as Solaris where there is an N:M 
relationship between (N) threads and (M) LWPs, a LWP iterator would be 
needed.

Andrew




  reply	other threads:[~2001-12-13  1:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-12 14:17 Michael Snyder
2001-12-12 15:05 ` Eli Zaretskii
2001-12-12 15:29   ` Jason R Thorpe
2001-12-12 17:17     ` Andrew Cagney [this message]
2001-12-12 17:35       ` Jason R Thorpe
2001-12-12 17:48         ` Andrew Cagney
2001-12-12 18:06           ` Jason R Thorpe
2001-12-13 10:50             ` Andrew Cagney
2001-12-12 15:35 ` Kevin Buettner
2001-12-13 11:17   ` Michael Snyder
2001-12-26 12:32   ` Michael Snyder

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=3C18018E.9080902@cygnus.com \
    --to=ac131313@cygnus.com \
    --cc=eliz@is.elta.co.il \
    --cc=gdb-patches@sources.redhat.com \
    --cc=msnyder@cygnus.com \
    --cc=thorpej@wasabisystems.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