1 #ifndef __MONO_JIT_DEBUG_H__
2 #define __MONO_JIT_DEBUG_H__
6 #include <mono/metadata/debug-symfile.h>
7 #include <mono/metadata/loader.h>
8 #include <mono/jit/jit.h>
10 typedef struct _MonoDebugHandle MonoDebugHandle;
13 MONO_DEBUG_FORMAT_NONE,
14 MONO_DEBUG_FORMAT_STABS,
15 MONO_DEBUG_FORMAT_DWARF2,
16 MONO_DEBUG_FORMAT_DWARF2_PLUS,
17 MONO_DEBUG_FORMAT_MONO
20 extern MonoDebugFormat mono_debug_format;
21 extern GList *mono_debug_methods;
24 * This variable is intended to be set in a debugger.
26 * If it's non-zero, arch_compile_method() will insert a breakpoint next time
27 * it compiles a method.
29 * If it's positive, it acts as a counter which is decremented each time it's
30 * used. Set it to a negative value to make arch_compile_method() insert a
31 * breakpoint for each method.
33 * To use this, you should create a GDB macro like this:
36 * set mono_debug_insert_breakpoint = 1
38 * set *mono_debug_last_breakpoint_address = 0x90
43 * define reload-symbol-files
44 * call mono_debug_make_symbols ()
45 * add-symbol-file Test-debug.o
46 * add-symbol-file /tmp/corlib.o
50 extern int mono_debug_insert_breakpoint;
53 * This is set the the core address of the last inserted breakpoint. You can
54 * use this in GDB to unset the breakpoint.
57 extern gchar *mono_debug_last_breakpoint_address;
59 MonoDebugHandle* mono_debug_open (MonoAssembly *assembly, MonoDebugFormat format,
62 void mono_debug_cleanup (void);
64 void mono_debug_add_image (MonoDebugHandle* debug, MonoImage *image);
66 MonoDebugHandle* mono_debug_handle_from_class (MonoClass *klass);
68 void mono_debug_add_method (MonoFlowGraph *cfg);
70 void mono_debug_add_type (MonoClass *klass);
72 gchar * mono_debug_source_location_from_address (MonoMethod *method, guint32 address,
73 guint32 *line_number);
75 gint32 mono_debug_il_offset_from_address (MonoMethod *method, gint32 address);
77 gint32 mono_debug_address_from_il_offset (MonoMethod *method, gint32 il_offset);
79 /* DEBUGGER PUBLIC FUNCTION:
81 * This is a public function which is supposed to be called from within a debugger
82 * each time the program stops. It's used to recreate the symbol file to tell the
83 * debugger about method addresses and such things. After calling this function,
84 * you must tell your debugger to reload its symbol file.
86 void mono_debug_make_symbols (void);
88 void mono_debug_write_symbols (MonoDebugHandle* debug);
91 * Do not use this function unless you know exactly what you're doing.
93 * Returns a pointer to a region of memory within the JIT's address space. The Mono
94 * Debugger uses this data to get information about the symbol files.
96 gconstpointer mono_debugger_internal_get_symbol_files (void);
98 #endif /* __MONO_JIT_DEBUG_H__ */