[Top] [All Lists]

Re: [PATCH] Make mips-linux signal frame unwinding more robust.

Subject: Re: [PATCH] Make mips-linux signal frame unwinding more robust.
From: David Daney <>
Date: Fri, 26 Feb 2010 10:22:09 -0800
Cc: Joel Brobecker <>, "Pinski, Andrew" <>, Ralf Baechle <>, linux-mips <>
In-reply-to: <>
Original-recipient: rfc822;
References: <> <> <>
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20100120 Fedora/3.0.1-1.fc12 Thunderbird/3.0.1
On 02/25/2010 10:48 AM, David Daney wrote:
On 02/25/2010 09:47 AM, Joel Brobecker wrote:

I don't know mips-linux, but something looked funny to me: You avoid
the use of SIGFRAME_CODE_OFFSET to compute the address where the
structure is located, but you still use it to compute the frame base
address (used when building the frame ID). Is the frame base address
still a constant offset from FUNC, or does the frame ID base address
also needs to be changed.

Right, I missed that part. When it started working, I stopped patching.
I will take another look at that part.

Here is the revised patch fixing the issue Joel noted.

From the original message:

  The current signal frame unwinding code in mips-linux-tdep.c assumes
  a constant offset from the signal return trampoline to the signal
  frame. The assumption does not hold for all kernels.  Specifically
  those that have to be compiled with ICACHE_REFILLS_WORKAROUND_WAR
  set (SGI O2 for example).  In the near future, it is likely that the
  assumption will cease to hold universally, as we are attempting to
  move the signal return trampoline off the stack entirely.

  The libgcc unwinder already gets this right by using the signal
  frame's SP to locate the sigcontext.

  This patch makes gdb follow suit and find the sigcontext_base using
  the signal frame's SP rather than an offset from the trampoline.

Tested on mips64-linux with no regressions (and more than 100

OK to commit?

How about on the 7.1 branch?

2010-02-26  David Daney  <>

        * mips-linux-tdep.c: Update struct sigframe comments.
        (SIGFRAME_CODE_OFFSET): Delete macro.
        (mips_linux_o32_sigframe_init): Calculate sigcontext_base using
        this_frame's sp.
        (mips_linux_n32n64_sigframe_init): Same.

Attachment: gdb.patch
Description: Text document

<Prev in Thread] Current Thread [Next in Thread>