Loading ...
Sorry, an error occurred while loading the content.
 

Stack Unwinding -- Linux 2.4 ----- -fomit-frame-pointer

Expand Messages
  • rath_debu
    Hello, If a program is compiled with -fomit-frame-pointer option, Is there any way by which stack unwinding can be done when we are in the system call
    Message 1 of 2 , Dec 28, 2005
      Hello,
      If a program is compiled with -fomit-frame-pointer option, Is there
      any way by which stack unwinding can be done when we are in the system
      call (overridden one in a KLM).

      If the program is compiled without this flag, I think we can use the
      frame pointer address (ebp) to retrieve the frame pointer address of
      its previous frame and the return address.

      Thanks
      Debu
    • Ranjit Mathew
      ... I don t know about the in the system call bit, but generally you can do this using DWARF-2 unwind information that newer GCCs put in for exception
      Message 2 of 2 , Jan 8, 2006
        --- In linux-bangalore-programming@yahoogroups.com, "rath_debu"
        <debashishr@n...> wrote:
        >
        > If a program is compiled with -fomit-frame-pointer option, Is there
        > any way by which stack unwinding can be done when we are in the system
        > call (overridden one in a KLM).
        >
        > If the program is compiled without this flag, I think we can use the
        > frame pointer address (ebp) to retrieve the frame pointer address of
        > its previous frame and the return address.

        I don't know about the "in the system call" bit,
        but generally you can do this using DWARF-2 unwind
        information that newer GCCs put in for exception
        handling (in languages like C++/Java) or can be
        made to put in for other languages like C by using
        -fexceptions or -funwind-tables. Instead of messing
        with unwind tables directly, you'd want to use
        a utility library like 'libunwind':

        http://www.hpl.hp.com/research/linux/libunwind/

        HTH,
        Ranjit.
      Your message has been successfully submitted and would be delivered to recipients shortly.