Re: Getting a stack trace on segmentation faults

lee_merrill_at_yahoo.com
Date: 10/13/05

  • Next message: agrafi_at_gmail.com: "multiple sendmsg and single user-kernel switch"
    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


  • Next message: agrafi_at_gmail.com: "multiple sendmsg and single user-kernel switch"