Index: syzygy/agent/common/stack_walker.cc |
diff --git a/syzygy/agent/common/stack_walker_x86.cc b/syzygy/agent/common/stack_walker.cc |
similarity index 87% |
rename from syzygy/agent/common/stack_walker_x86.cc |
rename to syzygy/agent/common/stack_walker.cc |
index 2a63172ac70f359e72a512e79f3f793398b09541..7516ac9f6b81967dab4bafd9c670a536e2a2115a 100644 |
--- a/syzygy/agent/common/stack_walker_x86.cc |
+++ b/syzygy/agent/common/stack_walker.cc |
@@ -1,4 +1,4 @@ |
-// Copyright 2015 Google Inc. All Rights Reserved. |
+// Copyright 2016 Google Inc. All Rights Reserved. |
// |
// Licensed under the Apache License, Version 2.0 (the "License"); |
// you may not use this file except in compliance with the License. |
@@ -12,18 +12,21 @@ |
// See the License for the specific language governing permissions and |
// limitations under the License. |
-#include "syzygy/agent/common/stack_walker_x86.h" |
+#include "syzygy/agent/common/stack_walker.h" |
#include <windows.h> |
-#include <winnt.h> |
+#ifndef _WIN64 |
#include "base/logging.h" |
#include "syzygy/agent/common/stack_capture.h" |
#include "syzygy/common/align.h" |
+#endif |
namespace agent { |
namespace common { |
+#ifndef _WIN64 |
+ |
namespace { |
static size_t kPointerSize = sizeof(void*); |
@@ -96,8 +99,8 @@ __forceinline bool CanAdvanceFrame(const StackFrame* frame) { |
} // namespace |
-size_t __declspec(noinline) WalkStack(size_t bottom_frames_to_skip, |
- size_t max_frame_count, |
+size_t __declspec(noinline) WalkStack(uint32_t bottom_frames_to_skip, |
+ uint32_t max_frame_count, |
void** frames, |
StackId* absolute_stack_id) { |
// Get the stack extents. |
@@ -182,5 +185,20 @@ size_t WalkStackImpl(const void* current_ebp, |
return num_frames; |
} |
+#else |
+ |
+size_t __declspec(noinline) WalkStack(uint32_t bottom_frames_to_skip, |
+ uint32_t max_frame_count, |
+ void** frames, |
+ StackId* absolute_stack_id) { |
+ // Skip one more frame for call of this function |
+ return CaptureStackBackTrace(bottom_frames_to_skip + 1, |
+ max_frame_count, |
+ frames, |
+ reinterpret_cast<PDWORD>(absolute_stack_id)); |
+} |
+ |
+#endif // !defined _WIN64 |
+ |
} // namespace common |
} // namespace agent |