1 #ifndef __MONO_DEBUG_SYMFILE_H__
2 #define __MONO_DEBUG_SYMFILE_H__
5 #include <mono/metadata/class.h>
7 typedef struct MonoDebugSymbolFile MonoDebugSymbolFile;
8 typedef struct MonoDebugSymbolFileSection MonoDebugSymbolFileSection;
9 typedef struct MonoDebugMethodInfo MonoDebugMethodInfo;
10 typedef struct MonoDebugILOffsetInfo MonoDebugILOffsetInfo;
12 /* Machine dependent information about a method.
14 * This structure is created by the MonoDebugMethodInfoFunc callback of
15 * mono_debug_update_symbol_file (). */
16 struct MonoDebugMethodInfo {
21 guint32 *param_offsets;
23 guint32 *local_offsets;
24 guint32 num_il_offsets;
25 MonoDebugILOffsetInfo *il_offsets;
29 struct MonoDebugILOffsetInfo {
34 struct MonoDebugSymbolFile {
38 /* Pointer to the mmap()ed contents of the file. */
40 size_t raw_contents_size;
41 /* Array of MONO_DEBUG_SYMBOL_SECTION_MAX elements. */
42 MonoDebugSymbolFileSection *section_offsets;
46 struct MonoDebugSymbolFileSection {
52 #define MONO_DEBUG_SYMBOL_FILE_VERSION 5
54 /* Keep in sync with Mono.CSharp.Debugger.MonoDwarfFileWriter.Section */
55 #define MONO_DEBUG_SYMBOL_SECTION_DEBUG_INFO 0x01
56 #define MONO_DEBUG_SYMBOL_SECTION_DEBUG_ABBREV 0x02
57 #define MONO_DEBUG_SYMBOL_SECTION_DEBUG_LINE 0x03
58 #define MONO_DEBUG_SYMBOL_SECTION_MONO_RELOC_TABLE 0x04
60 #define MONO_DEBUG_SYMBOL_SECTION_MAX 0x05
62 /* Tries to load `filename' as a debugging information file, if `emit_warnings" is set,
63 * use g_warning() to signal error messages on failure, otherwise silently return NULL. */
64 MonoDebugSymbolFile *mono_debug_open_symbol_file (MonoImage *image,
66 gboolean emit_warnings);
68 /* This callback function needs to return a MonoDebugMethodInfo structure containing the
69 * machine-dependent information about method associated with the metadata_token.
70 * It's highly recommended to cache the generated data since this function can be called
71 * several times per method. */
72 typedef MonoDebugMethodInfo * (*MonoDebugMethodInfoFunc) (MonoDebugSymbolFile *symbol_file,
73 guint32 metadata_token,
76 void mono_debug_update_symbol_file (MonoDebugSymbolFile *symbol_file,
77 MonoDebugMethodInfoFunc method_info_func,
80 void mono_debug_close_symbol_file (MonoDebugSymbolFile *symbol_file);
82 #endif /* __MONO_DEBUG_SYMFILE_H__ */