Re: Getting a stack trace on segmentation faults
lee_merrill_at_yahoo.com
Date: 10/13/05
- Previous message: Tauno Voipio: "Re: OS Case study - off-topic?"
- In reply to: John Reiser: "Re: Getting a stack trace on segmentation faults"
- Next in thread: Nix: "Re: Getting a stack trace on segmentation faults"
- Reply: Nix: "Re: Getting a stack trace on segmentation faults"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 13 Oct 2005 10:36:44 -0700
You might consider using the custom gcc macro for return addresses:
if ( __builtin_frame_address(frame_number))
retAddr = __builtin_return_address(frame_number);
to print return addresses up the stack. Care is needed, for this macro
can cause an exception if the frame number is not a valid frame, which
is why a test is needed. Also, you are in the kernel, you can call
dump_stack() to dump the stack. And you could also find the last frame
via __builtin_frame_address, and then dump all the stack between the
current stack pointer and the last frame, with maybe the current
registers set as well.
Lee
- Previous message: Tauno Voipio: "Re: OS Case study - off-topic?"
- In reply to: John Reiser: "Re: Getting a stack trace on segmentation faults"
- Next in thread: Nix: "Re: Getting a stack trace on segmentation faults"
- Reply: Nix: "Re: Getting a stack trace on segmentation faults"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|