Commit 30f07d92 by Olivier Hainque Committed by Arnaud Charlet

s-mastop-irix.adb (Pop_Frame): Revert shorcuts avoiding calls to exc_unwind...

2005-06-14  Olivier Hainque  <hainque@adacore.com>
	    Eric Botcazou  <ebotcazou@adacore.com>

	* s-mastop-irix.adb (Pop_Frame): Revert shorcuts avoiding calls to
	exc_unwind, now that we are generating proper .debug_frame output for
	that target.

	* tracebak.c: Remove the mips-irix section, as we are now using the
	s-mastop based unwinder again.
	Under SPARC/Solaris, take into account the stack bias to compute the
	frame offset.  The stack bias is 0 for the V8 ABI and 2047 for the V9
	ABI.

From-SVN: r101012
parent fe93f42f
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
-- B o d y -- -- B o d y --
-- (Version for IRIX/MIPS) -- -- (Version for IRIX/MIPS) --
-- -- -- --
-- Copyright (C) 1999-2004 Free Software Foundation, Inc. -- -- Copyright (C) 1999-2005 Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -295,21 +295,7 @@ package body System.Machine_State_Operations is ...@@ -295,21 +295,7 @@ package body System.Machine_State_Operations is
procedure Exc_Unwind (Scp : Sigcontext_Ptr; Fde : Long_Integer := 0); procedure Exc_Unwind (Scp : Sigcontext_Ptr; Fde : Long_Integer := 0);
pragma Import (C, Exc_Unwind, "exc_unwind"); pragma Import (C, Exc_Unwind, "exc_unwind");
-- ??? Calling exc_unwind in the current setup does not work and pragma Linker_Options ("-lexc");
-- triggers the emission of system warning messages. Why it does
-- not work remains to be investigated. Part of the problem is
-- probably a section naming issue (e.g. .eh_frame/.debug_frame).
-- Instead of letting the call take place for nothing and emit
-- messages we don't expect, we just arrange things to pretend it
-- occurred and failed.
-- ??? Until this is fixed, we shall document that the backtrace
-- computation facility does not work, and we inhibit the pragma below
-- because we arrange for the call not to be emitted and the linker
-- complains when a library is linked in but resolves nothing.
-- pragma Linker_Options ("-lexc");
begin begin
-- exc_unwind is apparently not thread-safe under IRIX, so protect it -- exc_unwind is apparently not thread-safe under IRIX, so protect it
...@@ -319,11 +305,7 @@ package body System.Machine_State_Operations is ...@@ -319,11 +305,7 @@ package body System.Machine_State_Operations is
Lock_Task.all; Lock_Task.all;
if False then Exc_Unwind (Scp);
Exc_Unwind (Scp);
else
Scp.SC_PC := 0;
end if;
Unlock_Task.all; Unlock_Task.all;
......
...@@ -242,7 +242,7 @@ struct layout ...@@ -242,7 +242,7 @@ struct layout
#define BASE_SKIP 1 #define BASE_SKIP 1
/*-------------------------- Sparc Solaris -----------------------------*/ /*-------------------------- SPARC Solaris -----------------------------*/
#elif defined (sun) && defined (sparc) #elif defined (sun) && defined (sparc)
...@@ -257,8 +257,14 @@ struct layout ...@@ -257,8 +257,14 @@ struct layout
void *return_address; void *return_address;
}; };
#ifdef __arch64__
#define STACK_BIAS 2047 /* V9 ABI */
#else
#define STACK_BIAS 0 /* V8 ABI */
#endif
#define FRAME_LEVEL 0 #define FRAME_LEVEL 0
#define FRAME_OFFSET (14 * (sizeof (void*))) #define FRAME_OFFSET (14 * sizeof (void*) + STACK_BIAS)
#define PC_ADJUST 0 #define PC_ADJUST 0
#define STOP_FRAME(CURRENT, TOP_STACK) \ #define STOP_FRAME(CURRENT, TOP_STACK) \
((CURRENT)->return_address == 0|| (CURRENT)->next == 0 \ ((CURRENT)->return_address == 0|| (CURRENT)->next == 0 \
...@@ -324,12 +330,22 @@ struct layout ...@@ -324,12 +330,22 @@ struct layout
|| ((*((ptr) - 1) & 0xff) == 0xff) \ || ((*((ptr) - 1) & 0xff) == 0xff) \
|| (((*(ptr) & 0xd0ff) == 0xd0ff)))) || (((*(ptr) & 0xd0ff) == 0xd0ff))))
/*------------------------------- mips-irix -------------------------------*/ /*----------------------------- x86_64 ---------------------------------*/
#elif defined (__mips) && defined (__sgi) #elif defined (__x86_64__)
#define USE_GCC_UNWINDER #define USE_GCC_UNWINDER
#define PC_ADJUST -8 /* The generic unwinder is not used for this target because it is based
on frame layout assumptions that are not reliable on this target (the
rbp register is very likely used for something else than storing the
frame pointer in optimized code). Hence, we use the GCC unwinder
based on DWARF 2 call frame information, although it has the drawback
of not being able to unwind through frames compiled without DWARF 2
information.
*/
#define PC_ADJUST -2
/* The minimum size of call instructions on this architecture is 2 bytes */
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment