1 // Copyright 2021 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef BASE_PROFILER_FRAME_POINTER_UNWINDER_H_
6 #define BASE_PROFILER_FRAME_POINTER_UNWINDER_H_
10 #include "base/base_export.h"
11 #include "base/profiler/unwinder.h"
12 #include "build/build_config.h"
14 #if BUILDFLAG(IS_APPLE)
15 #include <os/availability.h>
20 // Native unwinder implementation for platforms that have frame pointers:
21 // * iOS, ARM64 and X86_64,
25 #if BUILDFLAG(IS_APPLE)
26 API_AVAILABLE(ios(12))
28 FramePointerUnwinder : public Unwinder {
30 FramePointerUnwinder();
32 FramePointerUnwinder(const FramePointerUnwinder&) = delete;
33 FramePointerUnwinder& operator=(const FramePointerUnwinder&) = delete;
36 bool CanUnwindFrom(const Frame& current_frame) const override;
37 UnwindResult TryUnwind(RegisterContext* thread_context,
39 std::vector<Frame>* stack) override;
44 #endif // BASE_PROFILER_FRAME_POINTER_UNWINDER_H_