dwarf.h 950 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #ifndef __sti_dwarf_dwarf_h__
  2. #define __sti_dwarf_dwarf_h__
  3. #include <stdint.h>
  4. #define DWARF_ENUM_PREFIXES \
  5. X(ACCESS) \
  6. X(AT) \
  7. X(ATE) \
  8. X(CC) \
  9. X(CFA) \
  10. X(CHILDREN) \
  11. X(DEFAULTED) \
  12. X(DS) \
  13. X(DSC) \
  14. X(END) \
  15. X(FORM) \
  16. X(ID) \
  17. X(IDX) \
  18. X(INL) \
  19. X(LANG) \
  20. X(LLE) \
  21. X(LNCT) \
  22. X(LNS) \
  23. X(MACRO) \
  24. X(OP) \
  25. X(ORD) \
  26. X(RLE) \
  27. X(SECT) \
  28. X(TAG) \
  29. X(UT) \
  30. X(VIRTUALITY) \
  31. X(VIS)
  32. #include "dwarf_enums.h"
  33. enum {
  34. #define X(prefix, name, val) DW_ ## prefix ## _ ## name = val,
  35. DWARF_ENUM_PAIRS
  36. #undef X
  37. };
  38. // LEB128: "Little-Endian Base 128"
  39. uint64_t uleb128_decode(uint8_t* in , uint8_t** end);
  40. int64_t leb128_decode(uint8_t* in , uint8_t** end);
  41. // returns the number of btyes written
  42. int uleb128_encode(uint64_t n, uint8_t* out);
  43. int leb128_encode(int64_t n, uint8_t* out);
  44. void* line_num_machine(uint8_t* raw, size_t len);
  45. void* debug_info_parse(uint8_t* raw, size_t raw_len);
  46. #endif // __sti_dwarf_dwarf_h__