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