Added 3 new files
[mono.git] / mono / mini / debug-private.h
1 /*
2  * This is a copy of mono/mono/jit/debug-private.h.
3  *
4  * Please do *not* modify this copy here, if you need to make changes, do them
5  * in the original and then copy it over again.
6  *
7  * All mini-specific stuff is in debug-mini.c.
8  */
9
10 #ifndef __MONO_JIT_DEBUG_PRIVATE_H__
11 #define __MONO_JIT_DEBUG_PRIVATE_H__
12
13 #include <mono/metadata/debug-mono-symfile.h>
14
15 #include "debug.h"
16
17 typedef struct _AssemblyDebugInfo AssemblyDebugInfo;
18
19 typedef enum {
20         MONO_DEBUG_FLAGS_NONE                   = 0,
21         // Don't run the assembler.
22         MONO_DEBUG_FLAGS_DONT_ASSEMBLE          = (1 << 1),
23         // Install the generated *.il files in the assembly dir.
24         MONO_DEBUG_FLAGS_INSTALL_IL_FILES       = (1 << 2),
25         // Don't update the *.il files.
26         MONO_DEBUG_FLAGS_DONT_UPDATE_IL_FILES   = (1 << 3),
27         // Don't create any new *.il files.
28         MONO_DEBUG_FLAGS_DONT_CREATE_IL_FILES   = (1 << 4),
29         // Don't fallback to normal dwarf2.
30         MONO_DEBUG_FLAGS_DONT_FALLBACK          = (1 << 5),
31         // Don't precompile image.
32         MONO_DEBUG_FLAGS_DONT_PRECOMPILE        = (1 << 6),
33         // Update symbol file on exit.
34         MONO_DEBUG_FLAGS_UPDATE_ON_EXIT         = (1 << 7)
35 } MonoDebugFlags;
36
37 typedef struct {
38         AssemblyDebugInfo *info;
39         gchar *name;
40         int source_file;
41         guint32 method_number;
42         guint32 start_line;
43         guint32 first_line;
44         guint32 last_line;
45 } DebugMethodInfo;
46
47 typedef struct {
48         MonoMethod *method;
49         const guint8 *code_start;
50         guint32 code_size;
51 } DebugWrapperInfo;
52
53 struct _AssemblyDebugInfo {
54         MonoDebugFormat format;
55         MonoDebugHandle *handle;
56         MonoSymbolFile *symfile;
57         char *name;
58         char *ilfile;
59         char *filename;
60         char *objfile;
61         int always_create_il;
62         int source_file;
63         int total_lines;
64         int *mlines;
65         int *moffsets;
66         int nmethods;
67         GHashTable *methods;
68         GHashTable *wrapper_methods;
69         MonoImage *image;
70         gpointer _priv;
71 };
72
73 struct _MonoDebugHandle {
74         MonoDebugFormat format;
75         MonoDebugFlags flags;
76         char *name;
77         char *filename;
78         char *objfile;
79         char *producer_name;
80         GHashTable *type_hash;
81         GPtrArray *source_files;
82         int next_idx;
83         int next_klass_idx;
84         int dirty;
85         GHashTable *images;
86         FILE *f;
87 };
88
89 guint32               mono_debug_get_type                   (MonoDebugHandle* debug, MonoClass *klass);
90
91 void                  mono_debug_write_stabs                (MonoDebugHandle *debug);
92
93 void                  mono_debug_write_dwarf2               (MonoDebugHandle *debug);
94
95 void                  mono_debug_codegen_breakpoint         (guint8 **buf);
96
97 void                  mono_debug_codegen_ret                (guint8 **buf);
98
99 MonoDebugMethodInfo *_mono_debug_lookup_method              (MonoMethod *method);
100
101 gint32               _mono_debug_address_from_il_offset     (MonoDebugMethodInfo *minfo, guint32 il_offset);
102
103 AssemblyDebugInfo   *_mono_debug_get_image                  (MonoDebugHandle* debug, MonoImage *image);
104
105 void                 _mono_debug_generate_line_number       (MonoDebugMethodInfo *minfo, guint32 address,
106                                                              guint32 offset, int debug);
107
108 extern MonoDebugHandle *mono_debug_handle;
109 extern gboolean mono_debug_initialized;
110
111 #endif /* __MONO_JIT_DEBUG_PRIVATE_H__ */