1 /* 2 * Copyright (c) 2025 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 16 #ifndef DUMP_INFO_H 17 #define DUMP_INFO_H 18 19 #include <csignal> 20 #include <set> 21 #include <string> 22 #include "dfx_process.h" 23 #include "dfx_dump_request.h" 24 #include "unwinder.h" 25 26 namespace OHOS { 27 namespace HiviewDFX { 28 29 class DumpInfo { 30 public: ~DumpInfo()31 virtual ~DumpInfo() {} SetDumpInfo(const std::shared_ptr<DumpInfo> & dumpInfo)32 virtual void SetDumpInfo(const std::shared_ptr<DumpInfo>& dumpInfo) {} 33 virtual void Print(DfxProcess& process, const ProcessDumpRequest& request, Unwinder& unwinder) = 0; 34 virtual int UnwindStack(DfxProcess& process, const ProcessDumpRequest& request, Unwinder& unwinder) = 0; 35 virtual void Symbolize(DfxProcess& process, Unwinder& unwinder) = 0; GetMemoryValues(std::set<uintptr_t> & memoryValues)36 virtual void GetMemoryValues(std::set<uintptr_t>& memoryValues) {}; 37 }; 38 } 39 } 40 #endif