Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew STUBBS <andrew.stubbs@st.com>
To: Daniel Jacobowitz <drow@false.org>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [SH][PATCH] Disable ABI frame sniffer
Date: Wed, 23 Nov 2005 19:52:00 -0000	[thread overview]
Message-ID: <4384B6B5.90207@st.com> (raw)
In-Reply-To: <20051113183624.GE3599@nevyn.them.org>

Daniel Jacobowitz wrote:
>   - 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...

I don't want to mess with the OS or compiler to fix this problem so I 
have been looking into this suggestion (or at least something in GDB alone).

I started by trying to figure out why the dwarf unwinder appeared to be 
giving:

   #2  0xdeaddead in ?? ()

It turns out that this does not come from here at all - the dwarf 
sniffer rejects the frame, and yet I thought I had the SH unwinder 
disabled, so why did it still come out?

In fact, the order of events is (and apologise to all those who know 
this stuff backwards):

   dwarf sniffer
   sh sniffer
   print message
   sh 'frame this id' (where I had disabled the unwinder).

The obvious thing to do appears to be to disable it in the sh sniffer, 
but if I have that return NULL, as the dwarf unwinder does, I get an 
internal error. Not only may this sniffer never reject *any* frame, it 
is not possible to remove it altogether (i.e. not register it in the 
first place), because you still get the internal error.

I must conclude therefore that it is not currently possible to reject 
any 'frame' which precedes (from the point of view of the program) a 
frame with debug information.

My question is 'where to go from here?'

The above suggestion would require modifying the dwarf sniffer (since 
the last frame on the stack has dwarf). I can't easily see how to do 
this because the dwarf data doesn't know it is the end of the stack and 
unwinding any further seems problematic.

I could modify the sh sniffer such that it actually does something. 
However, this would require modifying frame_unwind_find_by_frame() and 
family such that it can accept a NULL answer from every sniffer.

There is, of course, the question of how to detect the end of the stack, 
short of just searching for the specific case. I could check if it is in 
memory, but that seems problematic at best - for one thing it assumes we 
know where memory is. Perhaps I could see if it is in a loaded section?

Any other suggestions?

Thanks

Andrew Stubbs


  parent reply	other threads:[~2005-11-23 18:39 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
2005-11-13 23:58               ` Jim Blandy
2005-11-23 19:52               ` Andrew STUBBS [this message]
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=4384B6B5.90207@st.com \
    --to=andrew.stubbs@st.com \
    --cc=drow@false.org \
    --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