dwarf_extractor.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 *dwar_extractor_handle_t;
  17. struct AOTCompContext;
  18. typedef struct AOTCompContext AOTCompContext;
  19. struct AOTFuncContext;
  20. typedef struct AOTFuncContext AOTFuncContext;
  21. dwar_extractor_handle_t
  22. create_dwarf_extractor(aot_comp_data_t comp_data, char *file_name);
  23. LLVMMetadataRef
  24. dwarf_gen_file_info(AOTCompContext *comp_ctx);
  25. LLVMMetadataRef
  26. dwarf_gen_comp_unit_info(AOTCompContext *comp_ctx);
  27. LLVMMetadataRef
  28. dwarf_gen_func_info(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx);
  29. LLVMMetadataRef
  30. dwarf_gen_location(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
  31. uint64_t vm_offset);
  32. LLVMMetadataRef
  33. dwarf_gen_func_ret_location(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx);
  34. void
  35. dwarf_get_func_name(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
  36. char *name, int len);
  37. #ifdef __cplusplus
  38. }
  39. #endif
  40. #endif