Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Roland McGrath <roland@redhat.com>
To: Daniel Jacobowitz <drow@mvista.com>
Cc: Elena Zannoni <ezannoni@redhat.com>, gdb@sources.redhat.com
Subject: Re: Linux kernel problem -- food for thoughts
Date: Wed, 16 Apr 2003 21:04:00 -0000	[thread overview]
Message-ID: <200304162104.h3GL4rp01982@magilla.sf.frob.com> (raw)
In-Reply-To: Daniel Jacobowitz's message of  Wednesday, 16 April 2003 10:28:11 -0400 <20030416142811.GA9574@nevyn.them.org>

> I was just thinking about this.  My reaction is:
>   - the page needs to be readable; I vaguely remember badgering Linus
> about this and getting it fixed, but it might have been someone else,
> or it might not have gotten fixed.

Or maybe you just got (or replicated) the half-assed patch I did for this,
which only went to Linus yesterday.

>   - GDB needs to get the location of the EH information from glibc
> somehow.  My instinct is to make glibc export this in a global symbol,
> just like the way we get signal numbers from linuxthreads.

Bletch.  libc isn't the source of the information.  You could have a
program that doesn't use glibc and since winds up at these PC locations.
gdb should get the information from the kernel directly somehow.

[Elena:]
> Roland (but I'll let him speak) has had a thought about creating a
> /proc/pid/vsyscall file, which then gdb could read with add-symbol-file....

I implemented this as a quick hack.  I can send the 2.5 kernel patch to
anyone who is interested.  I am pretty sure this wouldn't get integrated
into the kernel if I lobbied for it.  Since the same address is used in
every process (at least in all the kernels around now), it's also easy to
use a little program (which I wrote first) to generate the file from the
running kernel and then you can use that plain file with add-symbol-file.

This is what I recommend we use for the first development step.  That is,
when the DWARF unwinding support for x86 is enabled generically, we can try
the add-symbol-file trick (or an internal call kludged in) for the purposes
of testing and debugging the unwinding, seeing the testsuite run happily
with good backtraces, etc.  It seems unlikely to be a good real implementation.

For core files, I do think the only sensible thing will be to make the
kernel write the vsyscall page into every core dump.  Otherwise you can't
always be sure when looking at a post-mortem exactly what the PC values it
was using while alive meant at the time.  

For a live implementation not relying on a virtual ELF file, and for core
files, there remains the issue of finding the .eh_frame start address.  I
have some thoughts, and that's a relatively minor detail to be worked out
once the whole plan of using that info is agreed upon.


Thanks,
Roland


  parent reply	other threads:[~2003-04-16 21:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-16 14:19 Elena Zannoni
2003-04-16 14:28 ` Daniel Jacobowitz
2003-04-16 14:38   ` Elena Zannoni
2003-04-16 14:42     ` Daniel Jacobowitz
2003-05-22 22:24       ` disassembly in gdb? Kumar Gala
2003-05-22 22:53         ` Kevin Buettner
2003-05-22 23:15           ` Kumar Gala
2003-05-22 23:52             ` Kevin Buettner
2003-05-23 15:15               ` Andrew Cagney
2003-04-16 21:04   ` Roland McGrath [this message]
2003-04-16 20:51 ` Linux kernel problem -- food for thoughts 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=200304162104.h3GL4rp01982@magilla.sf.frob.com \
    --to=roland@redhat.com \
    --cc=drow@mvista.com \
    --cc=ezannoni@redhat.com \
    --cc=gdb@sources.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