Line data Source code
1 : /**
2 : * Copyright (c) 2025 Huawei Technologies Co., Ltd.
3 : * This program is free software, you can redistribute it and/or modify it under the terms and conditions of
4 : * CANN Open Software License Agreement Version 2.0 (the "License").
5 : * Please refer to the License for details. You may not use this file except in compliance with the License.
6 : * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
7 : * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
8 : * See LICENSE in the root of the software repository for the full text of the License.
9 : */
10 : #ifndef ADUMP_COMMON_COREDUMP_INTERFACE_H
11 : #define ADUMP_COMMON_COREDUMP_INTERFACE_H
12 :
13 : #include <cstdint>
14 : #include <memory>
15 :
16 : namespace Adx {
17 :
18 : class PcFixerInterface;
19 : class RegisterInterface;
20 : class DumpCore;
21 :
22 : // Coredump 特性下的平台差异处理。仅支持 coredump 的平台(V2/V4)注册此接口;
23 : // 不支持的平台(如 DC)不注册,CoredumpManager::Get() 返回 nullptr。
24 : class CoredumpInterface {
25 : public:
26 22 : virtual ~CoredumpInterface() = default;
27 :
28 : virtual std::unique_ptr<PcFixerInterface> CreatePcFixer() const = 0;
29 : virtual std::shared_ptr<RegisterInterface> CreateRegister() const = 0;
30 : virtual void DumpRegister(DumpCore& core, uint8_t coreType, uint16_t coreId) const = 0;
31 : virtual uint16_t ConvertCoreId(uint8_t coreType, uint16_t coreId) const = 0;
32 : };
33 :
34 : } // namespace Adx
35 : #endif // ADUMP_COMMON_COREDUMP_INTERFACE_H
|