From: George Anzinger <george@mvista.com>
To: Andi Kleen <ak@muc.de>
Cc: linux-kernel@vger.kernel.org, Daniel Jacobowitz <djacobowitz@mvista.com>
Subject: Re: [PATCH]Call frame debug info for 2.6 kernel
Date: Wed, 24 Mar 2004 08:20:50 -0800 [thread overview]
Message-ID: <4061B562.4060601@mvista.com> (raw)
In-Reply-To: <20040324062548.GA96115@colin2.muc.de>
Andi Kleen wrote:
>>The long and short of it is, to do it at all, you need to have a fair
>>knowledge of dwarf2. Once you get to that, I suspect one way is as good as
>>another.
>
>
> Did you contact the gdb and binutils maintainers about the problems?
> Maybe it can be easily fixed.
>
I mentioned it to Daniel Jacobowitz.
The problem is what is needed is access to the full dwarf2 expression code.
Actually only a small sub set is needed here, but I suspect they would only do
the whole thing, and it is rather rich. I only implemented about 20% of the
opcodes.
For example, the way gdb knows that "this is the bottom of the stack" is for the
CFI address to come back as zero. Normally this is a stack address. An
expression is needed to get zero, and, at least in interrupt / trap handling,
the expression needs to be conditional. So, either a new language is invented
or access is provided to the dwarf2 language, or an abstracted version of it.
The ladder is what I did. I provided the dwarf2 opcodes with macros that
wrapped the required boiler plate around them. I set it up the way C does, i.e.
as a separate block of asm code, rather than intermixed with the assembly thing
(which would require relocs to the debug space and back as well as additional
boiler plate). This is artifact of how I figured out how to translate the
dwarf2 spec to real code, i.e. I looked at what C was doing.
The thing is, we are talking assembly code here. That means that just about
anything is possible WRT the call frame.
If I had any sway over what the binutils folks do, I would argue for allowing
dwarf2 code intermixed with inline asm in the C asm() code. At the moment this
is very hard (impossible) to do.
An example of what I would like to be able to do is to build a call frame for
the out of line part of the spin lock. It would be a very simple frame that
would just say it was called from the inline part of the spin lock.
As second example is to properly describe the "switch frame" used for context
switching. Currently x86 requires frame pointers to cover this, i.e. with frame
pointers off, gdb can not unwind tasks that are not active, even with dwarf2
frame stuff.
--
George Anzinger george@mvista.com
High-res-timers: http://sourceforge.net/projects/high-res-timers/
Preemption patch: http://www.kernel.org/pub/linux/kernel/people/rml
next prev parent reply other threads:[~2004-03-24 16:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1AR5s-75I-27@gated-at.bofh.it>
[not found] ` <1CHY0-1Uw-9@gated-at.bofh.it>
2004-03-23 2:04 ` [PATCH]Call frame debug info for 2.6 kernel Andi Kleen
2004-03-23 21:45 ` George Anzinger
2004-03-24 6:25 ` Andi Kleen
2004-03-24 16:20 ` George Anzinger [this message]
2004-03-17 21:37 Fixes for .cfi directives for x86_64 kgdb Jim Houston
2004-03-23 0:17 ` [PATCH]Call frame debug info for 2.6 kernel George Anzinger
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=4061B562.4060601@mvista.com \
--to=george@mvista.com \
--cc=ak@muc.de \
--cc=djacobowitz@mvista.com \
--cc=linux-kernel@vger.kernel.org \
/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