public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Mark Kettenis <kettenis@chello.nl>
To: cagney@redhat.com
Cc: gdb@sources.redhat.com
Subject: Unwinding dummy frames on the i386
Date: Fri, 07 Mar 2003 20:59:00 -0000	[thread overview]
Message-ID: <200303072059.h27KxgX1029877@elgar.kettenis.dyndns.org> (raw)

Hi Andrew,

After you committed the unwind_dummy_id stuff, I'm having some
problems getting the i386 target working again.

I tried using generic_save_dummy_frame on this target.  This works
fine if we're unwinding from a normal frame into a dummy frame.
However, if we're unwinding from a sentinel frame, things start to get
a bit difficult.  This basically happens if we've hit the special
breakpoint upon return from the called function.  On the i386
returning from a function pops the return address from the stack.
Since the return address was pushed by GDB an accounted for in the
stack pointer passed to generic_save_dummy_frame_tos(), things don't
match up.  This fixable in i386_unwind_dummy_id(), however things are
a bit more complicated.

If a function returns a struct, the caller is supposed to push as a
"hidden" parameter the address of a bit of memory where the called
function is supposed to store the struct.  This extra push is again
accounted for in the stack pointer passed to
i386_save_dummy_frame_tos().  However, since the called function is
supposed to remove this address from the stack, again things don't
match up for the unwind-from-sentinel case.  I don't see a clean way
to fixup this.

For now I've worked around this by having my own do-nothing
i386_save_dummy_frame_tos(), and having i386_unwind_dummy_id() return
contents of the (saved) frame pointer register for the frame's base.
Is there a better way to solve this?

Mark

             reply	other threads:[~2003-03-07 20:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-07 20:59 Mark Kettenis [this message]
2003-03-07 22:13 ` Andrew Cagney
2003-03-08 11:42   ` Mark Kettenis
2003-03-08 15:20     ` Andrew Cagney
2003-03-08 17:32       ` Mark Kettenis

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=200303072059.h27KxgX1029877@elgar.kettenis.dyndns.org \
    --to=kettenis@chello.nl \
    --cc=cagney@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).