mono-api-debug.html

### Mono Debugger Interface

These are methods that are invoked by the debugger at runtime.
`mono_debugger_insert_breakpoint`
Syntax
mono_debugger_insert_breakpoint

`mono_debugger_method_has_breakpoint`
Syntax
mono_debugger_method_has_breakpoint

### Debugging Symbols

`mono_debug_open_mono_symbols`
Syntax
MonoSymbolFile* mono_debug_open_mono_symbols (MonoDebugHandle *handle, const uint8_t *raw_contents, int size, gboolean in_the_debugger)

`mono_debug_symfile_free_location`
Syntax
void mono_debug_symfile_free_location (MonoDebugSourceLocation *location)

Description

Free a `MonoDebugSourceLocation` returned by `mono_debug_symfile_lookup_location`
`mono_debug_symfile_is_loaded`
Syntax
mono_bool mono_debug_symfile_is_loaded (MonoSymbolFile *symfile)

`mono_debug_symfile_lookup_locals`
Syntax
MonoDebugLocalsInfo* mono_debug_symfile_lookup_locals (MonoDebugMethodInfo *minfo)

Description

Return information about the local variables of minfo from the symbol file. Return `NULL` if no information can be found. The result should be freed using `mono_debug_symfile_free_locals`.
`mono_debug_symfile_lookup_location`
Syntax
MonoDebugSourceLocation* mono_debug_symfile_lookup_location (MonoDebugMethodInfo *minfo, uint32_t offset)

Parameters

minfo | A `MonoDebugMethodInfo` which can be retrieved by `mono_debug_lookup_method`.
offset | IL offset within the corresponding method's CIL code.

Description

This function is similar to `mono_debug_lookup_location`, but we already looked up the method and also already did the native address -> IL offset mapping.
`mono_debug_symfile_lookup_method`
Syntax
MonoDebugMethodInfo* mono_debug_symfile_lookup_method (MonoDebugHandle *handle, MonoMethod *method)

### Internal Debugging

`mono_debug_add_delegate_trampoline`
Syntax
void mono_debug_add_delegate_trampoline (gpointer code, int size)

`mono_debug_close_image`
Syntax
void mono_debug_close_image (MonoImage *image)

`mono_debug_domain_create`
Syntax
void mono_debug_domain_create (MonoDomain *domain)

`mono_debug_domain_unload`
Syntax
mono_debug_domain_unload

`mono_debug_enabled`
Syntax
mono_bool mono_debug_enabled (void)

Description

Returns true is debug information is enabled. This doesn't relate if a debugger is present or not.
`mono_debug_free_method_jit_info`
Syntax
mono_debug_free_method_jit_info

`mono_debug_free_source_location`
Syntax
void mono_debug_free_source_location (MonoDebugSourceLocation *location)

Parameters

location | A `MonoDebugSourceLocation`

Description
Frees the location.
`mono_debug_lookup_locals`
Syntax
mono_debug_lookup_locals

`mono_debug_lookup_method`
Syntax
MonoDebugMethodInfo* mono_debug_lookup_method (MonoMethod *method)

Description

Lookup symbol file information for the method method. The returned `MonoDebugMethodInfo` is a private structure, but it can be passed to `mono_debug_symfile_lookup_location`.
`mono_debug_lookup_method_addresses`
Syntax
mono_debug_lookup_method_addresses

`mono_debug_lookup_source_location`
Syntax
MonoDebugSourceLocation* mono_debug_lookup_source_location (MonoMethod *method, guint32 address, MonoDomain *domain)

Parameters

address | Native offset within the method's machine code.

Description
Lookup the source code corresponding to the machine instruction located at native offset address within method. The returned `MonoDebugSourceLocation` contains both file / line number information and the corresponding IL offset. It must be freed by `mono_debug_free_source_location`.
`mono_debug_open_image_from_memory`
Syntax
mono_debug_open_image_from_memory

`mono_debug_print_stack_frame`
Syntax
gchar* mono_debug_print_stack_frame (MonoMethod *method, guint32 native_offset, MonoDomain *domain)

Parameters

native_offset | Native offset within the method's machine code.

Description
Conventient wrapper around `mono_debug_lookup_source_location` which can be used if you only want to use the location to print a stack frame.
`mono_debug_remove_method`
Syntax
mono_debug_remove_method

`mono_debug_il_offset_from_address`
Syntax
gint32 mono_debug_il_offset_from_address (MonoMethod *method, MonoDomain *domain, guint32 native_offset)

Description

Compute the IL offset corresponding to native_offset inside the native code of method in domain.
`mono_debug_add_method`
Syntax
MonoDebugMethodAddress* mono_debug_add_method (MonoMethod *method, MonoDebugMethodJitInfo *jit, MonoDomain *domain)

`mono_debug_close_mono_symbol_file`
Syntax
void mono_debug_close_mono_symbol_file (MonoSymbolFile *symfile)