| OLD | NEW |
| 1 // Copyright 2013 Google Inc. All Rights Reserved. | 1 // Copyright 2013 Google Inc. All Rights Reserved. |
| 2 // | 2 // |
| 3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
| 5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
| 6 // | 6 // |
| 7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 // | 8 // |
| 9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
| 10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 // See the License for the specific language governing permissions and | 12 // See the License for the specific language governing permissions and |
| 13 // limitations under the License. | 13 // limitations under the License. |
| 14 | 14 |
| 15 #include "syzygy/agent/common/stack_capture.h" | 15 #include "syzygy/agent/common/stack_capture.h" |
| 16 | 16 |
| 17 #include <algorithm> | 17 #include <algorithm> |
| 18 | 18 |
| 19 #include "base/logging.h" | 19 #include "base/logging.h" |
| 20 #include "syzygy/agent/common/stack_walker_x86.h" | 20 #include "syzygy/agent/common/stack_walker.h" |
| 21 #include "syzygy/core/address_space.h" | 21 #include "syzygy/core/address_space.h" |
| 22 | 22 |
| 23 // http://blogs.msdn.com/oldnewthing/archive/2004/10/25/247180.aspx | 23 // http://blogs.msdn.com/oldnewthing/archive/2004/10/25/247180.aspx |
| 24 extern "C" IMAGE_DOS_HEADER __ImageBase; | 24 extern "C" IMAGE_DOS_HEADER __ImageBase; |
| 25 | 25 |
| 26 namespace agent { | 26 namespace agent { |
| 27 namespace common { | 27 namespace common { |
| 28 | 28 |
| 29 // The number of bottom frames to skip per stack trace. | 29 // The number of bottom frames to skip per stack trace. |
| 30 size_t StackCapture::bottom_frames_to_skip_ = | 30 size_t StackCapture::bottom_frames_to_skip_ = |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 relative_stack_id_ = FinalizeStackId(relative_stack_id_, num_frames_); | 209 relative_stack_id_ = FinalizeStackId(relative_stack_id_, num_frames_); |
| 210 | 210 |
| 211 // We could end up with the value 0, in which case we set it to something | 211 // We could end up with the value 0, in which case we set it to something |
| 212 // else, as 0 is considered uninitialized. | 212 // else, as 0 is considered uninitialized. |
| 213 if (!relative_stack_id_) | 213 if (!relative_stack_id_) |
| 214 relative_stack_id_ = ~relative_stack_id_; | 214 relative_stack_id_ = ~relative_stack_id_; |
| 215 } | 215 } |
| 216 | 216 |
| 217 } // namespace common | 217 } // namespace common |
| 218 } // namespace agent | 218 } // namespace agent |
| OLD | NEW |