dwarf_extractor.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * Copyright (C) 2021 Ant Group. All rights reserved.
  3. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. */
  5. #ifndef _DWARF_EXTRACTOR_H_
  6. #define _DWARF_EXTRACTOR_H_
  7. #include "llvm-c/DebugInfo.h"
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11. typedef unsigned int LLDBLangType;
  12. #define LLDB_TO_LLVM_LANG_TYPE(lldb_lang_type) \
  13. (LLVMDWARFSourceLanguage)(((lldb_lang_type) > 0 ? (lldb_lang_type)-1 : 1))
  14. struct AOTCompData;
  15. typedef struct AOTCompData *aot_comp_data_t;
  16. typedef void *dwarf_extractor_handle_t;
  17. struct AOTCompContext;
  18. typedef struct AOTCompContext AOTCompContext;
  19. struct AOTFuncContext;
  20. typedef struct AOTFuncContext AOTFuncContext;
  21. dwarf_extractor_handle_t
  22. create_dwarf_extractor(aot_comp_data_t comp_data, char *file_name);
  23. LLVMMetadataRef
  24. dwarf_gen_file_info(const AOTCompContext *comp_ctx);
  25. LLVMMetadataRef
  26. dwarf_gen_comp_unit_info(const AOTCompContext *comp_ctx);
  27. LLVMMetadataRef
  28. dwarf_gen_func_info(const AOTCompContext *comp_ctx,
  29. const AOTFuncContext *func_ctx);
  30. LLVMMetadataRef
  31. dwarf_gen_location(const AOTCompContext *comp_ctx,
  32. const AOTFuncContext *func_ctx, uint64_t vm_offset);
  33. LLVMMetadataRef
  34. dwarf_gen_func_ret_location(const AOTCompContext *comp_ctx,
  35. const AOTFuncContext *func_ctx);
  36. void
  37. dwarf_get_func_name(const AOTCompContext *comp_ctx,
  38. const AOTFuncContext *func_ctx, char *name, int len);
  39. #ifdef __cplusplus
  40. }
  41. #endif
  42. #endif