This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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 sigcontext 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
improvements).

OK to commit?

How about on the 7.1 branch?


2010-02-26 David Daney <ddaney.caviumnetworks.com>


	* 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]