Results 1 to 3 of 3
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 05-28-2008 #1Just 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.
- 06-10-2008 #2Just 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?
- 06-12-2008 #3Just 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'.


Reply With Quote
