native_unwinder_win.h 997 B

12345678910111213141516171819202122232425262728293031
  1. // Copyright 2019 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef BASE_PROFILER_NATIVE_UNWINDER_WIN_H_
  5. #define BASE_PROFILER_NATIVE_UNWINDER_WIN_H_
  6. #include "base/macros.h"
  7. #include "base/profiler/unwinder.h"
  8. namespace base {
  9. // Native unwinder implementation for Windows, using RtlVirtualUnwind.
  10. class NativeUnwinderWin : public Unwinder {
  11. public:
  12. NativeUnwinderWin() = default;
  13. NativeUnwinderWin(const NativeUnwinderWin&) = delete;
  14. NativeUnwinderWin& operator=(const NativeUnwinderWin&) = delete;
  15. // Unwinder:
  16. bool CanUnwindFrom(const Frame& current_frame) const override;
  17. UnwindResult TryUnwind(RegisterContext* thread_context,
  18. uintptr_t stack_top,
  19. ModuleCache* module_cache,
  20. std::vector<Frame>* stack) const override;
  21. };
  22. } // namespace base
  23. #endif // BASE_PROFILER_NATIVE_UNWINDER_WIN_H_