From: | George Neuner <gneuner2@comcast.net> |
Newsgroups: | comp.compilers |
Date: | Sat, 21 Feb 2009 17:29:52 -0500 |
Organization: | A noiseless patient Spider |
References: | 09-02-021 09-02-037 09-02-076 09-02-082 09-02-089 09-02-095 09-02-103 |
Keywords: | VM, debug |
Posted-Date: | 21 Feb 2009 18:57:18 EST |
On Sat, 21 Feb 2009 05:38:11 +1000, "cr88192" <cr88192@hotmail.com>
wrote:
>a related issue is that, my code can be linked with code produced by GCC (or
>MSVC, which has something similar), and GCC has this issue: many people
>think it good practice to compile code with '-fomit-frame-pointer', which
>may, technically, break some assumptions that could be made by my compiler
>(such as if directly implementing exception unwinding, ...), and sadly, is
>common practice within many of the system APIs (as evidenced by gdb's
>inability to produce backtraces, ...).
Whether it's a "good practice" is arguable, but omitting the frame
pointer increases function call speed, slightly reduces stack usage
and provides another general address register to use.
Stack tracing can be done without a frame pointer ... the debugger
knows the function call sequence and the compiler's debug information
provides the argument and local variable layout at function entry and
may also incrementally provide info on other automatic variables at
entry into local subscopes. From that starting point the debugger has
to track the code position and monitor the stack pointer to build up a
picture of what's currently on the stack. GDB doesn't do it.
George
Return to the
comp.compilers page.
Search the
comp.compilers archives again.