From 9e65d1402e03f941b7b18d085b132d55a28aecb3 Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Fri, 7 Jan 2022 12:50:19 -0800 Subject: Remove the LocalUnwinder object. This object is no longer needed, and is actually slower than using the Unwinder object. Bug: 120606663 Test: All unit tests pass. Change-Id: I1b0e53b1f12fc5ac92c6b0e167ded5e906c7962d --- libunwindstack/include/unwindstack/LocalUnwinder.h | 86 ---------------------- 1 file changed, 86 deletions(-) delete mode 100644 libunwindstack/include/unwindstack/LocalUnwinder.h (limited to 'libunwindstack/include/unwindstack/LocalUnwinder.h') diff --git a/libunwindstack/include/unwindstack/LocalUnwinder.h b/libunwindstack/include/unwindstack/LocalUnwinder.h deleted file mode 100644 index b3dbb4f..0000000 --- a/libunwindstack/include/unwindstack/LocalUnwinder.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (C) 2018 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef _LIBUNWINDSTACK_LOCAL_UNWINDER_H -#define _LIBUNWINDSTACK_LOCAL_UNWINDER_H - -#include -#include -#include - -#include -#include -#include - -#include -#include -#include - -namespace unwindstack { - -// Forward declarations. -class Elf; -class MapInfo; - -struct LocalFrameData { - LocalFrameData(std::shared_ptr& map_info, uint64_t pc, uint64_t rel_pc, - const std::string& function_name, uint64_t function_offset) - : map_info(map_info), - pc(pc), - rel_pc(rel_pc), - function_name(function_name), - function_offset(function_offset) {} - - std::shared_ptr map_info; - uint64_t pc; - uint64_t rel_pc; - std::string function_name; - uint64_t function_offset; -}; - -// This is a specialized class that should only be used for doing local unwinds. -// The Unwind call can be made as multiple times on the same object, and it can -// be called by multiple threads at the same time. -// It is designed to be used in debugging circumstances to get a stack trace -// as fast as possible. -class LocalUnwinder { - public: - LocalUnwinder() = default; - LocalUnwinder(const std::vector& skip_libraries) : skip_libraries_(skip_libraries) {} - ~LocalUnwinder() = default; - - bool Init(); - - bool Unwind(std::vector* frame_info, size_t max_frames); - - bool ShouldSkipLibrary(const std::string& map_name); - - std::shared_ptr GetMapInfo(uint64_t pc); - - ErrorCode LastErrorCode() { return last_error_.code; } - uint64_t LastErrorAddress() { return last_error_.address; } - - private: - pthread_rwlock_t maps_rwlock_; - std::unique_ptr maps_ = nullptr; - std::shared_ptr process_memory_; - std::vector skip_libraries_; - ErrorData last_error_; -}; - -} // namespace unwindstack - -#endif // _LIBUNWINDSTACK_LOCAL_UNWINDER_H -- cgit v1.2.3