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/processor/stack_frame_info.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/processor/stack_frame_info.h')
-rw-r--r-- | src/processor/stack_frame_info.h | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/src/processor/stack_frame_info.h b/src/processor/stack_frame_info.h index 5901b970..4b5e5534 100644 --- a/src/processor/stack_frame_info.h +++ b/src/processor/stack_frame_info.h @@ -46,13 +46,20 @@ namespace google_airbag { struct StackFrameInfo { public: - StackFrameInfo() : valid(false), + enum Validity { + VALID_NONE = 0, + VALID_PARAMETER_SIZE = 1, + VALID_ALL = -1 + }; + + StackFrameInfo() : valid(VALID_NONE), prolog_size(0), epilog_size(0), parameter_size(0), saved_register_size(0), local_size(0), max_stack_size(0), + allocates_base_pointer(0), program_string() {} StackFrameInfo(u_int32_t set_prolog_size, @@ -61,18 +68,27 @@ struct StackFrameInfo { u_int32_t set_saved_register_size, u_int32_t set_local_size, u_int32_t set_max_stack_size, + int set_allocates_base_pointer, const std::string set_program_string) - : valid(true), + : valid(VALID_ALL), prolog_size(set_prolog_size), epilog_size(set_epilog_size), parameter_size(set_parameter_size), saved_register_size(set_saved_register_size), local_size(set_local_size), max_stack_size(set_max_stack_size), + allocates_base_pointer(set_allocates_base_pointer), program_string(set_program_string) {} - // True when the contents of the structure are valid. - bool valid; + // Clears the StackFrameInfo object so that users will see it as though + // it contains no information. + void Clear() { valid = VALID_NONE; program_string.erase(); } + + // Identifies which fields in the structure are valid. This is of + // type Validity, but it is defined as an int because it's not + // possible to OR values into an enumerated type. Users must check + // this field before using any other. + int valid; // These values come from IDiaFrameData. u_int32_t prolog_size; @@ -81,6 +97,10 @@ struct StackFrameInfo { u_int32_t saved_register_size; u_int32_t local_size; u_int32_t max_stack_size; + + // Only one of allocates_base_pointer or program_string will be valid. + // If program_string is empty, use allocates_base_pointer. + bool allocates_base_pointer; std::string program_string; }; |