X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmetadata%2Fmono-debug.h;h=839ae2c547f00a2ea1a8f37cc956c9a95bbf5843;hb=aa3de31b70d1c5826d67147696423cdd9c334d41;hp=8d6385e9a90e95f8160a0718c5500a85aaba7643;hpb=8ef4e4703172fd32ada3f74b22df5203b4683493;p=mono.git diff --git a/mono/metadata/mono-debug.h b/mono/metadata/mono-debug.h index 8d6385e9a90..839ae2c547f 100644 --- a/mono/metadata/mono-debug.h +++ b/mono/metadata/mono-debug.h @@ -6,11 +6,12 @@ #ifndef __MONO_DEBUG_H__ #define __MONO_DEBUG_H__ -#include /* GHashTable dep below */ #include #include #include +MONO_BEGIN_DECLS + typedef struct _MonoSymbolTable MonoSymbolTable; typedef struct _MonoDebugDataTable MonoDebugDataTable; @@ -27,6 +28,7 @@ typedef struct _MonoDebugMethodAddressList MonoDebugMethodAddressList; typedef struct _MonoDebugClassEntry MonoDebugClassEntry; typedef struct _MonoDebugMethodInfo MonoDebugMethodInfo; +typedef struct _MonoDebugLocalsInfo MonoDebugLocalsInfo; typedef struct _MonoDebugSourceLocation MonoDebugSourceLocation; typedef struct _MonoDebugList MonoDebugList; @@ -34,6 +36,7 @@ typedef struct _MonoDebugList MonoDebugList; typedef enum { MONO_DEBUG_FORMAT_NONE, MONO_DEBUG_FORMAT_MONO, + /* Deprecated, the mdb debugger is not longer supported. */ MONO_DEBUG_FORMAT_DEBUGGER } MonoDebugFormat; @@ -48,7 +51,7 @@ struct _MonoDebugList { }; struct _MonoSymbolTable { - guint64 magic; + uint64_t magic; uint32_t version; uint32_t total_size; @@ -86,6 +89,8 @@ struct _MonoDebugMethodJitInfo { MonoDebugVarInfo *params; uint32_t num_locals; MonoDebugVarInfo *locals; + MonoDebugVarInfo *gsharedvt_info_var; + MonoDebugVarInfo *gsharedvt_locals_var; }; struct _MonoDebugMethodAddressList { @@ -100,6 +105,8 @@ struct _MonoDebugSourceLocation { uint32_t il_offset; }; +MONO_API mono_bool mono_debug_enabled (void); + /* * These bits of the MonoDebugLocalInfo's "index" field are flags specifying * where the variable is actually stored. @@ -120,6 +127,15 @@ struct _MonoDebugSourceLocation { /* The variable is dead. */ #define MONO_DEBUG_VAR_ADDRESS_MODE_DEAD 0x30000000 +/* Same as REGOFFSET, but do an indirection */ +#define MONO_DEBUG_VAR_ADDRESS_MODE_REGOFFSET_INDIR 0x40000000 + +/* gsharedvt local */ +#define MONO_DEBUG_VAR_ADDRESS_MODE_GSHAREDVT_LOCAL 0x50000000 + +/* variable is a vt address */ +#define MONO_DEBUG_VAR_ADDRESS_MODE_VTADDR 0x60000000 + struct _MonoDebugVarInfo { uint32_t index; uint32_t offset; @@ -130,65 +146,57 @@ struct _MonoDebugVarInfo { }; #define MONO_DEBUGGER_MAJOR_VERSION 81 -#define MONO_DEBUGGER_MINOR_VERSION 5 +#define MONO_DEBUGGER_MINOR_VERSION 6 #define MONO_DEBUGGER_MAGIC 0x7aff65af4253d427ULL -extern MonoSymbolTable *mono_symbol_table; -extern MonoDebugFormat mono_debug_format; -extern GHashTable *mono_debug_handles; -extern int32_t mono_debug_debugger_version; -extern int32_t _mono_debug_using_mono_debugger; +MONO_API void mono_debug_init (MonoDebugFormat format); +MONO_API void mono_debug_open_image_from_memory (MonoImage *image, const mono_byte *raw_contents, int size); +MONO_API void mono_debug_cleanup (void); -void mono_debug_list_add (MonoDebugList **list, const void* data); -void mono_debug_list_remove (MonoDebugList **list, const void* data); +MONO_API void mono_debug_close_image (MonoImage *image); -void mono_debug_init (MonoDebugFormat format); -void mono_debug_open_image_from_memory (MonoImage *image, const mono_byte *raw_contents, int size); -void mono_debug_cleanup (void); +MONO_API void mono_debug_domain_unload (MonoDomain *domain); +MONO_API void mono_debug_domain_create (MonoDomain *domain); -void mono_debug_close_image (MonoImage *image); - -void mono_debug_domain_unload (MonoDomain *domain); -void mono_debug_domain_create (MonoDomain *domain); - -mono_bool mono_debug_using_mono_debugger (void); - -MonoDebugMethodAddress * +MONO_API MonoDebugMethodAddress * mono_debug_add_method (MonoMethod *method, MonoDebugMethodJitInfo *jit, MonoDomain *domain); -MonoDebugMethodInfo * +MONO_API void +mono_debug_remove_method (MonoMethod *method, MonoDomain *domain); + +MONO_API MonoDebugMethodInfo * mono_debug_lookup_method (MonoMethod *method); -MonoDebugMethodAddressList * +MONO_API MonoDebugMethodAddressList * mono_debug_lookup_method_addresses (MonoMethod *method); -MonoDebugMethodJitInfo* +MONO_API MonoDebugMethodJitInfo* mono_debug_find_method (MonoMethod *method, MonoDomain *domain); -void +MONO_API void mono_debug_free_method_jit_info (MonoDebugMethodJitInfo *jit); -void +MONO_API void mono_debug_add_delegate_trampoline (void* code, int size); -int -mono_debug_lookup_locals (MonoMethod *method, char ***names, int **indexes); +MONO_API MonoDebugLocalsInfo* +mono_debug_lookup_locals (MonoMethod *method); /* * Line number support. */ -MonoDebugSourceLocation * +MONO_API MonoDebugSourceLocation * mono_debug_lookup_source_location (MonoMethod *method, uint32_t address, MonoDomain *domain); -int32_t +MONO_API int32_t mono_debug_il_offset_from_address (MonoMethod *method, MonoDomain *domain, uint32_t native_offset); -void +MONO_API void mono_debug_free_source_location (MonoDebugSourceLocation *location); -char * +MONO_API char * mono_debug_print_stack_frame (MonoMethod *method, uint32_t native_offset, MonoDomain *domain); /* @@ -197,10 +205,12 @@ mono_debug_print_stack_frame (MonoMethod *method, uint32_t native_offset, MonoDo * These methods are used by the JIT while running inside the Mono Debugger. */ -int mono_debugger_method_has_breakpoint (MonoMethod *method); -int mono_debugger_insert_breakpoint (const char *method_name, mono_bool include_namespace); +MONO_API int mono_debugger_method_has_breakpoint (MonoMethod *method); +MONO_API int mono_debugger_insert_breakpoint (const char *method_name, mono_bool include_namespace); + +MONO_API void mono_set_is_debugger_attached (mono_bool attached); +MONO_API mono_bool mono_is_debugger_attached (void); -void mono_set_is_debugger_attached (mono_bool attached); -mono_bool mono_is_debugger_attached (void); +MONO_END_DECLS #endif /* __MONO_DEBUG_H__ */