1 #ifndef __MONO_JIT_DEBUG_H__
2 #define __MONO_JIT_DEBUG_H__
6 #include <mono/metadata/loader.h>
7 #include <mono/jit/jit.h>
9 typedef struct _MonoDebugHandle MonoDebugHandle;
12 MONO_DEBUG_FORMAT_NONE,
13 MONO_DEBUG_FORMAT_STABS,
14 MONO_DEBUG_FORMAT_DWARF2,
15 MONO_DEBUG_FORMAT_DWARF2_PLUS
18 extern MonoDebugFormat mono_debug_format;
19 extern GList *mono_debug_methods;
22 * This variable is intended to be set in a debugger.
24 * If it's non-zero, arch_compile_method() will insert a breakpoint next time
25 * it compiles a method.
27 * If it's positive, it acts as a counter which is decremented each time it's
28 * used. Set it to a negative value to make arch_compile_method() insert a
29 * breakpoint for each method.
31 * To use this, you should create a GDB macro like this:
34 * set mono_debug_insert_breakpoint = 1
36 * set *mono_debug_last_breakpoint_address = 0x90
41 * define reload-symbol-files
42 * call mono_debug_make_symbols ()
43 * add-symbol-file Test-debug.o
44 * add-symbol-file /tmp/corlib.o
48 extern int mono_debug_insert_breakpoint;
51 * This is set the the core address of the last inserted breakpoint. You can
52 * use this in GDB to unset the breakpoint.
55 extern gchar *mono_debug_last_breakpoint_address;
57 MonoDebugHandle* mono_debug_open_file (const char *filename, MonoDebugFormat format);
59 void mono_debug_cleanup (void);
61 void mono_debug_add_image (MonoDebugHandle* debug, MonoImage *image);
63 MonoDebugHandle* mono_debug_handle_from_class (MonoClass *klass);
65 void mono_debug_add_method (MonoFlowGraph *cfg);
67 void mono_debug_add_type (MonoClass *klass);
69 /* DEBUGGER PUBLIC FUNCTION:
71 * This is a public function which is supposed to be called from within a debugger
72 * each time the program stops. It's used to recreate the symbol file to tell the
73 * debugger about method addresses and such things. After calling this function,
74 * you must tell your debugger to reload its symbol file.
76 void mono_debug_make_symbols (void);
78 void mono_debug_write_symbols (MonoDebugHandle* debug);
80 #endif /* __MONO_JIT_DEBUG_H__ */