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_STABS,
13 MONO_DEBUG_FORMAT_DWARF2,
14 MONO_DEBUG_FORMAT_DWARF2_PLUS
17 extern MonoDebugHandle *mono_debug_handle;
18 extern GList *mono_debug_methods;
21 * This variable is intended to be set in a debugger.
23 * If it's non-zero, arch_compile_method() will insert a breakpoint next time
24 * it compiles a method.
26 * If it's positive, it acts as a counter which is decremented each time it's
27 * used. Set it to a negative value to make arch_compile_method() insert a
28 * breakpoint for each method.
30 * To use this, you should create a GDB macro like this:
33 * set mono_debug_insert_breakpoint = 1
35 * set *mono_debug_last_breakpoint_address = 0x90
40 * define reload-symbol-files
41 * call mono_debug_make_symbols ()
42 * add-symbol-file Test-debug.o
43 * add-symbol-file /tmp/corlib.o
47 extern int mono_debug_insert_breakpoint;
50 * This is set the the core address of the last inserted breakpoint. You can
51 * use this in GDB to unset the breakpoint.
54 extern gchar *mono_debug_last_breakpoint_address;
56 MonoDebugHandle* mono_debug_open_file (const char *filename, MonoDebugFormat format);
58 void mono_debug_close (MonoDebugHandle* debug);
60 void mono_debug_add_method (MonoDebugHandle* debug, MonoFlowGraph *cfg);
62 void mono_debug_add_type (MonoDebugHandle* debug, MonoClass *klass);
64 /* DEBUGGER PUBLIC FUNCTION:
66 * This is a public function which is supposed to be called from within a debugger
67 * each time the program stops. It's used to recreate the symbol file to tell the
68 * debugger about method addresses and such things. After calling this function,
69 * you must tell your debugger to reload its symbol file.
71 void mono_debug_make_symbols (void);
73 #endif /* __MONO_JIT_DEBUG_H__ */