From: Daniel Jacobowitz <drow@false.org>
To: Andrew STUBBS <andrew.stubbs@st.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [SH][PATCH] Disable ABI frame sniffer
Date: Sun, 13 Nov 2005 18:57:00 -0000 [thread overview]
Message-ID: <20051113183624.GE3599@nevyn.them.org> (raw)
In-Reply-To: <4374863D.60601@st.com>
On Fri, Nov 11, 2005 at 11:53:33AM +0000, Andrew STUBBS wrote:
> >See Mark's reply for more on this. Had you said what your problem
> >really was, we could have saved a couple of back-and-forth exchanges;
> >I'm extremely familiar with the problem of finding clean ways to
> >terminate the backtrace.
>
> OK, I'm listening. If we can get it so that both the 0xdeadbeef frames
> (one which comes from the dwarf unwinder - see my posting yesterday) are
> ignored then that would be a bonus.
What we need is to examine the alternatives for cleanly marking the end
of a stack frame - there are quite a few - and find one which will work
for your situation.
Here's the easiest, in that it only requires changing one of the three
pieces of software involved (runtime, compiler, debugger):
Instead of whatever C language routine you use to start threads, start
them using an assembly wrapper. Have it set up a non-unwindable frame
using DWARF2 CFI as mentioned in one of my earlier postings in this
thread. You can do this easily by marking the return address column as
undefined. Then have it call the C thread start routine. GDB will
cleanly terminate the backtrace right there You'll have one more frame
in your stack, but it will be a real frame.
Other alternatives:
- Add a GCC attribute to mark a function as "never called directly,
not backtraceable" in the CFI. Annotate the runtime library to
mark the thread start routine with this attribute. I'm not real
fond of this solution, though.
- Add a way for a sniffer to indicate "I do recognize how to unwind
this frame, but I recognize it as the end of the stack" to solve
the current off-by-one problem. This could be quite nice...
--
Daniel Jacobowitz
CodeSourcery, LLC
next prev parent reply other threads:[~2005-11-13 18:36 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-09 18:08 Andrew STUBBS
2005-11-10 0:17 ` Andreas Schwab
2005-11-10 3:30 ` Daniel Jacobowitz
2005-11-10 12:27 ` Andrew STUBBS
2005-11-10 14:24 ` Daniel Jacobowitz
2005-11-10 4:27 ` Daniel Jacobowitz
2005-11-10 13:36 ` Andrew STUBBS
2005-11-10 14:34 ` Daniel Jacobowitz
2005-11-10 23:09 ` Andrew STUBBS
2005-11-10 23:13 ` Andrew STUBBS
2005-11-11 0:10 ` Mark Kettenis
2005-11-11 10:31 ` Daniel Jacobowitz
2005-11-11 18:21 ` Andrew STUBBS
2005-11-11 10:35 ` Daniel Jacobowitz
2005-11-11 20:09 ` Andrew STUBBS
2005-11-13 18:57 ` Daniel Jacobowitz [this message]
2005-11-13 23:58 ` Jim Blandy
2005-11-23 19:52 ` Andrew STUBBS
2005-11-24 22:48 ` Andrew STUBBS
2005-11-24 23:42 ` Mark Kettenis
2005-11-10 11:11 ` Eli Zaretskii
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=20051113183624.GE3599@nevyn.them.org \
--to=drow@false.org \
--cc=andrew.stubbs@st.com \
--cc=gdb-patches@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