Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <dan@codesourcery.com>
To: "Ján Stanček" <jan.stancek@gmail.com>
Cc: gdb-patches@sourceware.org
Subject: Re: patch: fix stack unwind through uClibc syscall() on mips
Date: Mon, 05 Apr 2010 15:51:00 -0000	[thread overview]
Message-ID: <20100405155102.GA23667@caradoc.them.org> (raw)
In-Reply-To: <737ad3551003271055o91a78i3f5ff305b927e441@mail.gmail.com>

On Sat, Mar 27, 2010 at 06:55:18PM +0100, Ján Stanček wrote:
> uClibc syscall() is macro which modifies stack before syscall
> instruction, gdb is only looking at function prologue and misses the
> stack modification made in syscall(). Because of this unwind doesn't
> work. Attached is a patch, which is looking at actual $pc and $pc-4,
> and in case of syscall it modifies $sp, so mip32_scan_prologue finds
> correct values.
> 
> Description of bug is also available here:
> http://www.listware.net/201003/gnu-gdb/26893.html

Have you considered just annotating the syscall routine with DWARF-2
tables?  That's how GLIBC solves this problem.  And it doesn't take up
any space in a stripped binary.

[Hmm, good wiki topic?]

It looks like this patch detects the syscall instruction followed by a
single instruction that adjusts sp.  It will break if the opposite
SP adjustment was already found by the prologue analyzer.

-- 
Daniel Jacobowitz
CodeSourcery


  parent reply	other threads:[~2010-04-05 15:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-27 17:55 Ján Stanček
2010-04-05 15:45 ` Joel Brobecker
2010-04-06 18:55   ` Ján Stanček
2010-04-07 17:11     ` Joel Brobecker
2010-04-05 15:51 ` Daniel Jacobowitz [this message]
2010-04-06 20:03   ` Ján Stanček

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=20100405155102.GA23667@caradoc.them.org \
    --to=dan@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.stancek@gmail.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