Re: Getting a stack trace on segmentation faults
Date: 10/13/05

  • Next message: "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.


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

    Relevant Pages

    • Re: [OT] [Question]activities of stack pointer and frame pointer when function called
      ... >>I suspect you don't understand what as stack frame is. ... A function stack frame is a method to keep track of function ... At the point of creation the caller is ... When the callee returns to its ...
    • Re: [PATCH 2/2] function-graph: add stack frame test
      ... In case gcc does something funny with the stack frames, ... frame of the parent function, and will test that frame on exit. ... This modifies the parameters of one of the functions that the arch ... movl 0xc, %edx ...
    • Re: What is a stack frame?
      ... There is no need for a separate "this frame" pointer. ... In any case, the more general term, which covers what a C compiler ... hardware-provided stack to implement the stack-like data structure ... manner since the current stack frame is "deformed" by alloca. ...
    • stack frames missing using VS2005 and WM5 kdmp
      ... Dump Viewer' or windbg I can see all the frames. ... I'm having another weird problem in windbg. ... View->Call Stack shows me the full stack, ... But, if I double-click on any other stack frame, it takes me to ...
    • Re: LPC900/80C51 Compiler Toolchain
      ... Although the fixed-size frame optimization is orthogonal to removing ... storing stack arguments is less important in such cases. ... storing data at (SP + offset) takes exactly the same time ... up and uses up another 2 registers. ...