1 /* 2 * Copyright (c) 2021-2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (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 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 #ifndef DFX_UNWIND_REMOTE_H 16 #define DFX_UNWIND_REMOTE_H 17 18 #ifdef __clang__ 19 #pragma clang diagnostic push 20 #pragma clang diagnostic ignored "-Wextern-c-compat" 21 #endif 22 23 #include <map> 24 #include <memory> 25 26 #include "dfx_define.h" 27 #include "dfx_dump_request.h" 28 #include "dfx_process.h" 29 #include "nocopyable.h" 30 #include "unwinder.h" 31 32 namespace OHOS { 33 namespace HiviewDFX { 34 class DfxUnwindRemote final { 35 public: 36 static DfxUnwindRemote &GetInstance(); 37 ~DfxUnwindRemote() = default; 38 39 bool UnwindProcess(std::shared_ptr<ProcessDumpRequest> request, std::shared_ptr<DfxProcess> process, 40 std::shared_ptr<Unwinder> unwinder); 41 void UnwindThreadFallback(std::shared_ptr<DfxProcess> process, std::shared_ptr<DfxThread> thread, 42 std::shared_ptr<Unwinder> unwinder); 43 44 private: 45 DfxUnwindRemote() = default; 46 DISALLOW_COPY_AND_MOVE(DfxUnwindRemote); 47 }; 48 } // namespace HiviewDFX 49 } // namespace OHOS 50 51 #endif // DFX_UNWIND_REMOTE_H 52