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
19 extern MonoDebugFormat mono_debug_format;
20 extern GList *mono_debug_methods;
23 * This variable is intended to be set in a debugger.
25 * If it's non-zero, arch_compile_method() will insert a breakpoint next time
26 * it compiles a method.
28 * If it's positive, it acts as a counter which is decremented each time it's
29 * used. Set it to a negative value to make arch_compile_method() insert a
30 * breakpoint for each method.
32 * To use this, you should create a GDB macro like this:
35 * set mono_debug_insert_breakpoint = 1
37 * set *mono_debug_last_breakpoint_address = 0x90
42 * define reload-symbol-files
43 * call mono_debug_make_symbols ()
44 * add-symbol-file Test-debug.o
45 * add-symbol-file /tmp/corlib.o
49 extern int mono_debug_insert_breakpoint;
52 * This is set the the core address of the last inserted breakpoint. You can
53 * use this in GDB to unset the breakpoint.
56 extern gchar *mono_debug_last_breakpoint_address;
58 MonoDebugHandle* mono_debug_open (MonoAssembly *assembly, MonoDebugFormat format,
61 void mono_debug_cleanup (void);
63 void mono_debug_add_image (MonoDebugHandle* debug, MonoImage *image);
65 MonoDebugHandle* mono_debug_handle_from_class (MonoClass *klass);
67 void mono_debug_add_method (MonoFlowGraph *cfg);
69 void mono_debug_add_type (MonoClass *klass);
71 gchar * mono_debug_source_location_from_address (MonoMethod *method, guint32 address,
72 guint32 *line_number);
74 gint32 mono_debug_il_offset_from_address (MonoMethod *method, gint32 address);
76 gint32 mono_debug_address_from_il_offset (MonoMethod *method, gint32 il_offset);
78 /* DEBUGGER PUBLIC FUNCTION:
80 * This is a public function which is supposed to be called from within a debugger
81 * each time the program stops. It's used to recreate the symbol file to tell the
82 * debugger about method addresses and such things. After calling this function,
83 * you must tell your debugger to reload its symbol file.
85 void mono_debug_make_symbols (void);
87 void mono_debug_write_symbols (MonoDebugHandle* debug);
89 #endif /* __MONO_JIT_DEBUG_H__ */