Welcome to Linux Forums!

With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.

Linux Forum ArticlesLinux ForumsLinux Forum DownloadsLinux Hosts
Home|Register|FAQ|Member List|Calendar|Unanswered Posts|Forum Rules|Today's Posts|Advanced Search|
SEARCH FOR IN
Go Back   Linux Forums > GNU Linux Zone > The Linux Kernel
Reload this Page Stack unwind through a signal frame?
Linux Forums
Linux Forums
Welcome To The Linux Forums!
Welcome to Linux Forums. We pride ourselves in being one of the largest Linux communities on the web, we encourage you to REGISTER on our forums and participate in the community. There are over 150,000 members ready to answer your questions. JOINING US today will allow you to make new posts, get support, send messages to other members and submit downloads to our downloads directory and many other great features!

The Linux Kernel Compiling, theory, programming or other discussion about the linux kernel

Reply
 
Thread Tools Display Modes
Old 05-28-2008   #1 (permalink)
kf
Just Joined!
 
Join Date: Aug 2005
Posts: 4
Stack unwind through a signal frame?

Not sure if this is the right forum, but ....

I'm using Suse Linux 10 on x86-64. I've written some routines to unwind the stack using the DWARF information stored in the relevant elf binaries. However, when I hit an RIP value of 0 I'm not certain if I'm at the start of the stack or at a signal stack frame. In the case of the signal stack frame, I can see what looks like a sigcontext on the stack but don't know how to get to it programmatically. So the question is:-
i. How do you recognise a signal stack frame as opposed to an ordinary stack frame ?
ii. How is the signal stack laid out so I can access the faulting context ?

Thanks in advance.
kf is offline   Reply With Quote
Old 06-10-2008   #2 (permalink)
felPmy
Just Joined!
 
Join Date: Jun 2008
Posts: 39
What version (10.0?), what kernel version (x86_64 or i386), uname -r? Are you able to post the relevant parts of the code? Are running the code in gdb?
felPmy is offline   Reply With Quote
Old 06-12-2008   #3 (permalink)
kf
Just Joined!
 
Join Date: Aug 2005
Posts: 4
Borrowed from gdb.

To determine if I'm unwinding through a signal frame on the stack I check the return address of each stack frame. If it's in the signal trampoline then it's a signal frame. The signal trampoline is identified by the symbol '__restore_rt'. This is what gdb seems to do, so I borrowed it. It's working ok for now, it just feels 'hacky'.
kf is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT. The time now is 01:59 AM.




© 2000 - 2008 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.0.0