This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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: Unwinding on Sparc/Solaris: MD_FALLBACK_FRAME_STATE_FOR


On Thu, Jan 23, 2003 at 01:04:42PM -0500, Geert Bosch wrote:
> I am trying to get GCC to correctly unwind through
> SPARC/Solaris signal frames. When the GCC unwinder encounters
> a frame without unwind info, it will execute the code
> given by the MD_FALLBACK_FRAME_STATE_FOR macro, which
> is not defined yet.
> 
> The problem however is finding out what signal frames look like
> and where the information to unwind through them can be found,
> such as saved stack pointer, return address etc.
> Since GDB can display a correct backtrace when breaking in
> a signal handler, I have looked there for inspiration.
> The GDB 5.1 code to handle this are in gdb/sparc-tdep.c,
> function sparc_init_extra_frame_info and sparc_frame_saved_pc.
> However, most of the 3212 lines in this file seem related to tracing
> through these frames without DWARF info, and it's a bit of a mess
> that I have not been able to untangle.

sparc_frame_saved_pc is a good place to start; what it tells me is
that generally there is a pointer in %o2 to the sigcontext structure. 
You can then look in Solaris headers to find the struct sigcontext.
The PC should be the fourth word, in 32-bit mode at least, to guess
from the comments in GDB.  I don't know what else you need to unwind in
MD_FALLBACK_FRAME_STATE_FOR but it should all be in the struct
sigcontext.


-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


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