diff options
author | mmentovai <mmentovai@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2006-10-20 01:46:38 +0000 |
---|---|---|
committer | mmentovai <mmentovai@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2006-10-20 01:46:38 +0000 |
commit | 246f4068280b5b191303ff13671e43a0522987de (patch) | |
tree | 9de2b66c7d8f0241de53669de045318d6283da7e /src/google/stack_frame.h | |
parent | Improvements for Windows client/tool-side code. r=bryner (diff) | |
download | breakpad-246f4068280b5b191303ff13671e43a0522987de.tar.xz |
Handle frame pointer omission, (#21), part 4 (final part!): FPO stackwalker.
r=bryner
- This change allows Airbag to properly walk win32 stacks produced by code
built with MSVC's frame pointer omission optimization (/Oy). This
optimization is enabled at /O1 and /O2.
- There too many interface and file format changes to list here.
http://groups.google.com/group/airbag-dev/browse_thread/thread/85ce85bfa8457ece
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@42 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/google/stack_frame.h')
-rw-r--r-- | src/google/stack_frame.h | 47 |
1 files changed, 20 insertions, 27 deletions
diff --git a/src/google/stack_frame.h b/src/google/stack_frame.h index 110dfc63..43b52dd0 100644 --- a/src/google/stack_frame.h +++ b/src/google/stack_frame.h @@ -31,58 +31,51 @@ #define GOOGLE_STACK_FRAME_H__ #include <string> -#include <vector> #include "google/airbag_types.h" namespace google_airbag { using std::string; -using std::vector; struct StackFrame { - // Initialize sensible defaults, or this will be instantiated with - // primitive members in an undetermined state. StackFrame() - : instruction() - , frame_pointer() - , module_base() - , module_name() - , function_base() - , function_name() - , source_file_name() - , source_line() {} - - // The program counter location relative to the module base + : instruction(), + module_base(), + module_name(), + function_base(), + function_name(), + source_file_name(), + source_line() {} + virtual ~StackFrame() {} + + // The program counter location as an absolute virtual address. For the + // innermost called frame in a stack, this will be an exact program counter + // or instruction pointer value. For all other frames, this will be within + // the instruction that caused execution to branch to a called function, + // but may not necessarily point to the exact beginning of that instruction. u_int64_t instruction; - // The frame pointer to this stack frame - u_int64_t frame_pointer; - - // The base address of the module + // The base address of the module. u_int64_t module_base; - // The module in which the pc resides + // The module in which the instruction resides. string module_name; // The start address of the function, may be omitted if debug symbols // are not available. u_int64_t function_base; - // The function name, may be omitted if debug symbols are not available + // The function name, may be omitted if debug symbols are not available. string function_name; - // The source file name, may be omitted if debug symbols are not available + // The source file name, may be omitted if debug symbols are not available. string source_file_name; - // The (1-based) source line number, - // may be omitted if debug symbols are not available + // The (1-based) source line number, may be omitted if debug symbols are + // not available. int source_line; - - // TODO(bryner): saved registers }; -typedef vector<StackFrame> StackFrames; - } // namespace google_airbag #endif // GOOGLE_STACK_FRAME_H__ |