1 /** 2 * Copyright (c) 2021-2024 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 LIBPANDAFILE_EXTERNAL_FILE_EXT_H 17 #define LIBPANDAFILE_EXTERNAL_FILE_EXT_H 18 19 #include <string> 20 #include <cstdint> 21 22 #ifdef __cplusplus 23 extern "C" { 24 #endif 25 26 struct MethodSymInfoExt { 27 uint64_t offset; 28 uint64_t length; 29 std::string name; 30 }; 31 32 struct PandaFileExt; 33 34 bool OpenPandafileFromMemoryExt(void *addr, const uint64_t *size, const std::string &fileName, 35 struct PandaFileExt **pandaFileExt); 36 37 bool OpenPandafileFromFdExt([[maybe_unused]] int fd, [[maybe_unused]] uint64_t offset, const std::string &fileName, 38 struct PandaFileExt **pandaFileExt); 39 40 bool QueryMethodSymByOffsetExt(struct PandaFileExt *pf, uint64_t offset, struct MethodSymInfoExt *methodInfo); 41 42 bool QueryMethodSymAndLineByOffsetExt(struct PandaFileExt *pf, uint64_t offset, struct MethodSymInfoExt *methodInfo); 43 44 using MethodSymInfoExtCallBack = void(struct MethodSymInfoExt *, void *); 45 46 void QueryAllMethodSymsExt(PandaFileExt *pf, MethodSymInfoExtCallBack callback, void *userData); 47 48 #ifdef __cplusplus 49 } // extern "C" 50 #endif 51 52 #endif // LIBPANDAFILE_EXTERNAL_FILE_EXT_H 53