debug-mono-symfile.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. /**
  2. * \file
  3. * This header is only installed for use by the debugger:
  4. * the structures and the API declared here are not supported.
  5. * Copyright 2012 Xamarin Inc (http://www.xamarin.com)
  6. * Licensed under the MIT license. See LICENSE file in the project root for full license information.
  7. */
  8. #ifndef __MONO_DEBUG_MONO_SYMFILE_H__
  9. #define __MONO_DEBUG_MONO_SYMFILE_H__
  10. #include <glib.h>
  11. #include <mono/metadata/class.h>
  12. #include <mono/metadata/reflection.h>
  13. #include <mono/metadata/mono-debug.h>
  14. #include <mono/metadata/debug-internals.h>
  15. typedef struct MonoSymbolFileOffsetTable MonoSymbolFileOffsetTable;
  16. typedef struct MonoSymbolFileLineNumberEntry MonoSymbolFileLineNumberEntry;
  17. typedef struct MonoSymbolFileMethodAddress MonoSymbolFileMethodAddress;
  18. typedef struct MonoSymbolFileDynamicTable MonoSymbolFileDynamicTable;
  19. typedef struct MonoSymbolFileSourceEntry MonoSymbolFileSourceEntry;
  20. typedef struct MonoSymbolFileMethodEntry MonoSymbolFileMethodEntry;
  21. /* Keep in sync with OffsetTable in mcs/class/Mono.CSharp.Debugger/MonoSymbolTable.cs */
  22. struct MonoSymbolFileOffsetTable {
  23. uint32_t _total_file_size;
  24. uint32_t _data_section_offset;
  25. uint32_t _data_section_size;
  26. uint32_t _compile_unit_count;
  27. uint32_t _compile_unit_table_offset;
  28. uint32_t _compile_unit_table_size;
  29. uint32_t _source_count;
  30. uint32_t _source_table_offset;
  31. uint32_t _source_table_size;
  32. uint32_t _method_count;
  33. uint32_t _method_table_offset;
  34. uint32_t _method_table_size;
  35. uint32_t _type_count;
  36. uint32_t _anonymous_scope_count;
  37. uint32_t _anonymous_scope_table_offset;
  38. uint32_t _anonymous_scope_table_size;
  39. uint32_t _line_number_table_line_base;
  40. uint32_t _line_number_table_line_range;
  41. uint32_t _line_number_table_opcode_base;
  42. uint32_t _is_aspx_source;
  43. };
  44. struct MonoSymbolFileSourceEntry {
  45. uint32_t _index;
  46. uint32_t _data_offset;
  47. };
  48. struct MonoSymbolFileMethodEntry {
  49. uint32_t _token;
  50. uint32_t _data_offset;
  51. uint32_t _line_number_table;
  52. };
  53. struct MonoSymbolFileMethodAddress {
  54. uint32_t size;
  55. const uint8_t *start_address;
  56. const uint8_t *end_address;
  57. const uint8_t *method_start_address;
  58. const uint8_t *method_end_address;
  59. const uint8_t *wrapper_address;
  60. uint32_t has_this;
  61. uint32_t num_params;
  62. uint32_t variable_table_offset;
  63. uint32_t type_table_offset;
  64. uint32_t num_line_numbers;
  65. uint32_t line_number_offset;
  66. uint8_t data [MONO_ZERO_LEN_ARRAY];
  67. };
  68. #define MONO_SYMBOL_FILE_MAJOR_VERSION 50
  69. #define MONO_SYMBOL_FILE_MINOR_VERSION 0
  70. #define MONO_SYMBOL_FILE_MAGIC 0x45e82623fd7fa614ULL
  71. MONO_BEGIN_DECLS
  72. MONO_API MonoSymbolFile *
  73. mono_debug_open_mono_symbols (MonoDebugHandle *handle,
  74. const uint8_t *raw_contents,
  75. int size,
  76. mono_bool in_the_debugger);
  77. MONO_API void
  78. mono_debug_close_mono_symbol_file (MonoSymbolFile *symfile);
  79. MONO_API mono_bool
  80. mono_debug_symfile_is_loaded (MonoSymbolFile *symfile);
  81. MONO_API MonoDebugSourceLocation *
  82. mono_debug_symfile_lookup_location (MonoDebugMethodInfo *minfo,
  83. uint32_t offset);
  84. MONO_API void
  85. mono_debug_symfile_free_location (MonoDebugSourceLocation *location);
  86. MONO_API MonoDebugMethodInfo *
  87. mono_debug_symfile_lookup_method (MonoDebugHandle *handle,
  88. MonoMethod *method);
  89. MONO_API MonoDebugLocalsInfo*
  90. mono_debug_symfile_lookup_locals (MonoDebugMethodInfo *minfo);
  91. void
  92. mono_debug_symfile_get_seq_points (MonoDebugMethodInfo *minfo, char **source_file, GPtrArray **source_file_list, int **source_files, MonoSymSeqPoint **seq_points, int *n_seq_points);
  93. MONO_END_DECLS
  94. #endif /* __MONO_SYMFILE_H__ */