2016-08-03 10:59:49 +00:00
<?xml version="1.0" encoding="utf-8"?>
2015-04-26 19:10:23 +01:00
< html xmlns = "http://www.w3.org/1999/xhtml" >
< head >
2016-08-03 10:59:49 +00:00
< title > mono-api-jit.html< / title >
< style type = "text/css" >
.mapi-docs {
line-height: 1.5;
padding-left: 2em;
padding-right: 2em;
}
.mapi-docs p {
max-width: 60em;
}
.mapi-docs .mapi-body {
max-width: 60em;
}
.mapi-docs code {
border: 1px solid rgba(214,214,214,1);
background-color: rgba(249,249,249,1);
padding: 0.1em 0.5em;
}
.mapi-description code {
font-family: "Consolas", "Courier", monospace;
border: 1px solid rgba(214,214,214,1);
background-color: rgba(249,249,249,1);
padding: 0.1em 0.2em;
}
.mapi-header {
padding: 0 0 5pt 5pt;
margin: 10pt;
white-space: pre;
font-family: monospace;
border: 1px solid rgba(233,233,233,1);
background-color: rgba(249,249,249,1);
}
.mapi-code {
padding: 5pt 5pt;
margin: 10pt;
white-space: pre;
font-family: monospace;
border: 1px solid rgba(233,233,233,1);
background-color: rgba(249,249,249,1);
}
.mapi-code:first-line {
line-height: 0px;
}
.mapi-entry code {
border: none;
background-color: transparent;
}
2015-04-26 19:10:23 +01:00
2016-08-03 10:59:49 +00:00
.mapi-parameters {
border-collapse: collapse;
border-spacing: 0;
empty-cells: hide;
border: 0;
margin: 5px 0 26px;
}
.mapi-parameters td {
border: 1px solid rgba(214,214,214,1);
border-left-style: none;
padding: 5px 25px 5px 10px;
}
.mapi-parameters tr>td:last-child {
border-right: 0;
}
.mapi-parameters td:first-of-type {
text-align: right;
padding: 7px;
vertical-align: top;
word-break: normal;
width: 40px;
}
.mapi-parameters tr:last-child>td {
border-bottom: 0;
}
.mapi-parameters tr:first-child>td {
border-top: 0;
}
.mapi-parameters tr td:first-of-type {
text-align: right;
padding: 7px;
vertical-align: top;
word-break: normal;
width: 40px;
}
.mapi {
left: -25px;
margin: 0;
padding: 13px 25px 0;
position: relative;
width: 100%;
}
.mapi-description {
background: rgba(249,249,249,1);
border-bottom: 1px solid rgba(233,233,233,1);
left: -25px;
margin: 0;
padding: 13px 25px 0;
position: relative;
width: 100%;
}
.mapi-entry {
background: transparent;
}
.mapi-docs {
}
.mapi-prototype {
border-left: 5px solid rgba(205,233,244,1);
padding: .5em;
margin-top: 5pt;
margin-bottom: 5pt;
font-family: "Consolas", "Courier", monospace;
display: block;
overflow: auto;
background-color: #f9f9f9;
}
.mapi-declaration {
margin-top: 21px;
}
.mapi-section {
font-size: smaller;
font-weight: bold;
margin-top: 21px;
line-height: 1.5;
}
.mapi-strike {
text-decoration: line-through;
}
.mapi-deprecated {
color: red;
}
.mapi-ptr-container {
background: white;
border-bottom: 1px solid rgba(233,233,233,1);
left: -25px;
padding-left: 25px;
padding-right: 25px;
padding-bottom: 13px;
position: relative;
width: 100%;
}
.mapi-ptr {
background: rgba(249,249,249,1);
border-left: 1px solid rgba(233,233,233,1);
border-top: 1px solid rgba(233,233,233,1);
height: 12px;
left: 37px;
top: -7px;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
position: absolute;
width: 12px;
}
.mapi-height-container {
left: -25px;
padding: 0 25px;
position: relative;
width: 100%;
}
2015-04-26 19:10:23 +01:00
< / style >
< / head >
< body >
2016-08-03 10:59:49 +00:00
< div class = "mapi-docs" >
2015-04-26 19:10:23 +01:00
< h2 > Synopsis< / h2 >
2016-08-03 10:59:49 +00:00
< p / > These functions are used to get some runtime information
from the Just in Time compiler and also to control some
aspects of the initialization and shutdown of the runtime.
< div class = "mapi-header" >
typedef struct _MonoJitInfo MonoJitInfo;
MonoJitInfo* < a href = "#api:mono_jit_info_table_find" > mono_jit_info_table_find< / a > (MonoDomain *domain,
char *addr);
int < a href = "#api:mono_jit_info_get_code_size" > mono_jit_info_get_code_size< / a > (MonoJitInfo* ji);
gpointer < a href = "#api:mono_jit_info_get_code_start" > mono_jit_info_get_code_start< / a > (MonoJitInfo* ji);
MonoMethod* < a href = "#api:mono_jit_info_get_method" > mono_jit_info_get_method< / a > (MonoJitInfo* ji);
2015-04-26 19:10:23 +01:00
G_GNUC_UNUSED char * < a href = "#api:mono_pmip" > mono_pmip< / a > (void *ip);
void < a href = "#api:mono_print_method_from_ip" > mono_print_method_from_ip< / a > (void *ip);
2016-08-03 10:59:49 +00:00
< a href = "#api:mono_print_thread_dump" > mono_print_thread_dump< / a >
2015-04-26 19:10:23 +01:00
void < a href = "#api:mono_threads_request_thread_dump" > mono_threads_request_thread_dump< / a > (void);
2016-08-03 10:59:49 +00:00
void < a href = "#api:mono_assemblies_init" > mono_assemblies_init< / a > (void);
void < a href = "#api:mono_assemblies_cleanup" > mono_assemblies_cleanup< / a > (void);
< a href = "#api:mono_environment_exitcode_get" > mono_environment_exitcode_get< / a >
< a href = "#api:mono_environment_exitcode_set" > mono_environment_exitcode_set< / a >
< a href = "#api:mono_install_runtime_cleanup" > mono_install_runtime_cleanup< / a >
void < a href = "#api:mono_runtime_set_shutting_down" > mono_runtime_set_shutting_down< / a > (void);
< a href = "#api:mono_security_set_core_clr_platform_callback" > mono_security_set_core_clr_platform_callback< / a >
2015-04-26 19:10:23 +01:00
< / div >
2016-08-03 10:59:49 +00:00
< h3 > Just-in-Time Compiled Method Information< / h3 >
< p / > Use the `MonoJitInfo` API to get data about a JITed
method. These APIs are typically used by profiler modules
added to Mono.
< a name = "api:mono_jit_info_table_find" > < / a >
< div class = "mapi" >
< div class = "mapi-entry " > < code > mono_jit_info_table_find< / code > < / div >
< div class = "mapi-height-container" >
< div class = "mapi-ptr-container" > < / div >
< div class = "mapi-description" >
< div class = "mapi-ptr" > < / div >
< div class = "mapi-declaration mapi-section" > Syntax< / div >
< div class = "mapi-prototype" > MonoJitInfo*
mono_jit_info_table_find (MonoDomain *domain, char *addr)
< / div >
< p / >
< div class = "mapi-section" > Parameters< / div >
< table class = "mapi-parameters" > < tbody > < tr > < td > < i > domain< / i > < td > Domain that you want to look up< / td > < / td > < / tr > < tr > < td > < i > addr< / i > < td > Points to an address with JITed code.< / td > < / td > < / tr > < / tbody > < / table > < div class = "mapi-section" > Return value< / div >
< div > < code > NULL< / code > if the address does not belong to JITed code (it might be native
code or a trampoline) or a valid pointer to a < code > MonoJitInfo*< / code > .< / div >
< div class = "mapi-section" > Description< / div >
< div > < p / >
Use this function to obtain a < code > MonoJitInfo*< / code > object that can be used to get
some statistics. You should provide both the < i > domain< / i > on which you will be
performing the probe, and an address. Since application domains can share code
the same address can be in use by multiple domains at once.
< p / >
This does not return any results for trampolines.
< p / > < / div >
< / div > <!-- mapi - description -->
< / div > <!-- height container -->
< / div > <!-- class=mapi -->
< a name = "api:mono_jit_info_get_code_size" > < / a >
< div class = "mapi" >
< div class = "mapi-entry " > < code > mono_jit_info_get_code_size< / code > < / div >
< div class = "mapi-height-container" >
< div class = "mapi-ptr-container" > < / div >
< div class = "mapi-description" >
< div class = "mapi-ptr" > < / div >
< div class = "mapi-declaration mapi-section" > Syntax< / div >
< div class = "mapi-prototype" > int
mono_jit_info_get_code_size (MonoJitInfo* ji)
< / div >
< p / >
< div class = "mapi-section" > Parameters< / div >
< table class = "mapi-parameters" > < tbody > < tr > < td > < i > ji< / i > < td > the JIT information handle< / td > < / td > < / tr > < / tbody > < / table > < div class = "mapi-section" > Return value< / div >
< div > Starting address with the native code.
< / div >
< div class = "mapi-section" > Description< / div >
< div > < p / >
Use this function to get the code size for the method described by
the < i > ji< / i > object. You can use this plus the < code > mono_jit_info_get_code_start< / code >
to determine the start and end of the native code.
< p / > < / div >
< / div > <!-- mapi - description -->
< / div > <!-- height container -->
< / div > <!-- class=mapi -->
< a name = "api:mono_jit_info_get_code_start" > < / a >
< div class = "mapi" >
< div class = "mapi-entry " > < code > mono_jit_info_get_code_start< / code > < / div >
< div class = "mapi-height-container" >
< div class = "mapi-ptr-container" > < / div >
< div class = "mapi-description" >
< div class = "mapi-ptr" > < / div >
< div class = "mapi-declaration mapi-section" > Syntax< / div >
< div class = "mapi-prototype" > gpointer
mono_jit_info_get_code_start (MonoJitInfo* ji)
< / div >
< p / >
< div class = "mapi-section" > Parameters< / div >
< table class = "mapi-parameters" > < tbody > < tr > < td > < i > ji< / i > < td > the JIT information handle< / td > < / td > < / tr > < / tbody > < / table > < div class = "mapi-section" > Return value< / div >
< div > Starting address with the native code.
< / div >
< div class = "mapi-section" > Description< / div >
< div > < p / >
Use this function to get the starting address for the method described by
the < i > ji< / i > object. You can use this plus the < code > mono_jit_info_get_code_size< / code >
to determine the start and end of the native code.
< p / > < / div >
< / div > <!-- mapi - description -->
< / div > <!-- height container -->
< / div > <!-- class=mapi -->
< a name = "api:mono_jit_info_get_method" > < / a >
< div class = "mapi" >
< div class = "mapi-entry " > < code > mono_jit_info_get_method< / code > < / div >
< div class = "mapi-height-container" >
< div class = "mapi-ptr-container" > < / div >
< div class = "mapi-description" >
< div class = "mapi-ptr" > < / div >
< div class = "mapi-declaration mapi-section" > Syntax< / div >
< div class = "mapi-prototype" > MonoMethod*
mono_jit_info_get_method (MonoJitInfo* ji)
< / div >
< p / >
< div class = "mapi-section" > Parameters< / div >
< table class = "mapi-parameters" > < tbody > < tr > < td > < i > ji< / i > < td > the JIT information handle< / td > < / td > < / tr > < / tbody > < / table > < div class = "mapi-section" > Return value< / div >
< div > The MonoMethod that represents the code tracked
by < i > ji< / i > .< / div >
< div class = "mapi-section" > Description< / div >
< div > < p / >
Use this function to get the `MonoMethod *` that backs
the < i > ji< / i > object.
< p / > < / div >
< / div > <!-- mapi - description -->
< / div > <!-- height container -->
2015-04-26 19:10:23 +01:00
< h3 > Useful Debugging Functions< / h3 >
< p / > These functions are useful when running the Mono VM inside
a debugger.
2016-08-03 10:59:49 +00:00
< / div > <!-- class=mapi -->
< a name = "api:mono_pmip" > < / a >
< div class = "mapi" >
< div class = "mapi-entry " > < code > mono_pmip< / code > < / div >
< div class = "mapi-height-container" >
< div class = "mapi-ptr-container" > < / div >
< div class = "mapi-description" >
< div class = "mapi-ptr" > < / div >
2015-04-26 19:10:23 +01:00
2016-08-03 10:59:49 +00:00
< div class = "mapi-declaration mapi-section" > Syntax< / div >
< div class = "mapi-prototype" > G_GNUC_UNUSED char *
2015-04-26 19:10:23 +01:00
mono_pmip (void *ip)
< / div >
2016-08-03 10:59:49 +00:00
< p / >
< div class = "mapi-section" > Parameters< / div >
< table class = "mapi-parameters" > < tbody > < tr > < td > < i > ip< / i > < td > an instruction pointer address< / td > < / td > < / tr > < / tbody > < / table > < div class = "mapi-section" > Return value< / div >
< div > the name of the method at address < i > ip< / i > .
< / div >
< div class = "mapi-section" > Description< / div >
< div > < p / >
2015-04-26 19:10:23 +01:00
This method is used from a debugger to get the name of the
method at address < i > ip< / i > . This routine is typically invoked from
a debugger like this:
2016-08-03 10:59:49 +00:00
< p / >
2015-04-26 19:10:23 +01:00
(gdb) print mono_pmip ($pc)
2016-08-03 10:59:49 +00:00
< p / > < / div >
< / div > <!-- mapi - description -->
< / div > <!-- height container -->
< / div > <!-- class=mapi -->
2015-04-26 19:10:23 +01:00
2016-08-03 10:59:49 +00:00
< a name = "api:mono_print_method_from_ip" > < / a >
< div class = "mapi" >
< div class = "mapi-entry " > < code > mono_print_method_from_ip< / code > < / div >
< div class = "mapi-height-container" >
< div class = "mapi-ptr-container" > < / div >
< div class = "mapi-description" >
< div class = "mapi-ptr" > < / div >
2015-04-26 19:10:23 +01:00
2016-08-03 10:59:49 +00:00
< div class = "mapi-declaration mapi-section" > Syntax< / div >
< div class = "mapi-prototype" > #ifdef __GNUC__
2015-04-26 19:10:23 +01:00
/* Prevent the linker from optimizing this away in embedding setups to help debugging */
2017-04-10 11:41:01 +00:00
__attribute__ ((__used__))
2015-04-26 19:10:23 +01:00
#endif
void
mono_print_method_from_ip (void *ip)
< / div >
2016-08-03 10:59:49 +00:00
< p / >
< div class = "mapi-section" > Parameters< / div >
< table class = "mapi-parameters" > < tbody > < tr > < td > < i > ip< / i > < td > an instruction pointer address< / td > < / td > < / tr > < / tbody > < / table > < div class = "mapi-section" > Description< / div >
< div > < p / >
2015-04-26 19:10:23 +01:00
This method is used from a debugger to get the name of the
method at address < i > ip< / i > .
2016-08-03 10:59:49 +00:00
< p / >
2015-04-26 19:10:23 +01:00
This prints the name of the method at address < i > ip< / i > in the standard
output. Unlike mono_pmip which returns a string, this routine
2016-08-03 10:59:49 +00:00
prints the value on the standard output.< / div >
< / div > <!-- mapi - description -->
< / div > <!-- height container -->
< / div > <!-- class=mapi -->
2015-04-26 19:10:23 +01:00
2016-08-03 10:59:49 +00:00
< a name = "api:mono_print_thread_dump" > < / a >
< div class = "mapi" >
< div class = "mapi-entry " > < code > mono_print_thread_dump< / code > < / div >
< div class = "mapi-height-container" >
< div class = "mapi-ptr-container" > < / div >
< div class = "mapi-description" >
< div class = "mapi-ptr" > < / div >
2015-04-26 19:10:23 +01:00
2016-08-03 10:59:49 +00:00
< div class = "mapi-declaration mapi-section" > Syntax< / div >
< div class = "mapi-prototype" > mono_print_thread_dump< / div >
< p / >
< / div > <!-- mapi - description -->
< / div > <!-- height container -->
< / div > <!-- class=mapi -->
2015-04-26 19:10:23 +01:00
2016-08-03 10:59:49 +00:00
< a name = "api:mono_threads_request_thread_dump" > < / a >
< div class = "mapi" >
< div class = "mapi-entry " > < code > mono_threads_request_thread_dump< / code > < / div >
< div class = "mapi-height-container" >
< div class = "mapi-ptr-container" > < / div >
< div class = "mapi-description" >
< div class = "mapi-ptr" > < / div >
2015-04-26 19:10:23 +01:00
2016-08-03 10:59:49 +00:00
< div class = "mapi-declaration mapi-section" > Syntax< / div >
< div class = "mapi-prototype" > void
2015-04-26 19:10:23 +01:00
mono_threads_request_thread_dump (void)
< / div >
2016-08-03 10:59:49 +00:00
< p / >
< div class = "mapi-section" > Description< / div >
< div > < p / >
Ask all threads except the current to print their stacktrace to stdout.< / div >
< / div > <!-- mapi - description -->
< / div > <!-- height container -->
2015-04-26 19:10:23 +01:00
2016-08-03 10:59:49 +00:00
< h3 > Advanced< / h3 >
2015-04-26 19:10:23 +01:00
2016-08-03 10:59:49 +00:00
< / div > <!-- class=mapi -->
2015-04-26 19:10:23 +01:00
2016-08-03 10:59:49 +00:00
< a name = "api:mono_assemblies_init" > < / a >
< div class = "mapi" >
< div class = "mapi-entry " > < code > mono_assemblies_init< / code > < / div >
< div class = "mapi-height-container" >
< div class = "mapi-ptr-container" > < / div >
< div class = "mapi-description" >
< div class = "mapi-ptr" > < / div >
< div class = "mapi-declaration mapi-section" > Syntax< / div >
< div class = "mapi-prototype" > void
mono_assemblies_init (void)
< / div >
< p / >
< div class = "mapi-section" > Description< / div >
< div > < p / >
Initialize global variables used by this module.< / div >
< / div > <!-- mapi - description -->
< / div > <!-- height container -->
< / div > <!-- class=mapi -->
< a name = "api:mono_assemblies_cleanup" > < / a >
< div class = "mapi" >
< div class = "mapi-entry " > < code > mono_assemblies_cleanup< / code > < / div >
< div class = "mapi-height-container" >
< div class = "mapi-ptr-container" > < / div >
< div class = "mapi-description" >
< div class = "mapi-ptr" > < / div >
< div class = "mapi-declaration mapi-section" > Syntax< / div >
< div class = "mapi-prototype" > void
mono_assemblies_cleanup (void)
< / div >
< p / >
< div class = "mapi-section" > Description< / div >
< div > < p / >
Free all resources used by this module.< / div >
< / div > <!-- mapi - description -->
< / div > <!-- height container -->
< / div > <!-- class=mapi -->
< a name = "api:mono_environment_exitcode_get" > < / a >
< div class = "mapi" >
< div class = "mapi-entry " > < code > mono_environment_exitcode_get< / code > < / div >
< div class = "mapi-height-container" >
< div class = "mapi-ptr-container" > < / div >
< div class = "mapi-description" >
< div class = "mapi-ptr" > < / div >
< div class = "mapi-declaration mapi-section" > Syntax< / div >
< div class = "mapi-prototype" > mono_environment_exitcode_get< / div >
< p / >
< / div > <!-- mapi - description -->
< / div > <!-- height container -->
< / div > <!-- class=mapi -->
< a name = "api:mono_environment_exitcode_set" > < / a >
< div class = "mapi" >
< div class = "mapi-entry " > < code > mono_environment_exitcode_set< / code > < / div >
< div class = "mapi-height-container" >
< div class = "mapi-ptr-container" > < / div >
< div class = "mapi-description" >
< div class = "mapi-ptr" > < / div >
< div class = "mapi-declaration mapi-section" > Syntax< / div >
< div class = "mapi-prototype" > mono_environment_exitcode_set< / div >
< p / >
< / div > <!-- mapi - description -->
< / div > <!-- height container -->
< / div > <!-- class=mapi -->
< a name = "api:mono_install_runtime_cleanup" > < / a >
< div class = "mapi" >
< div class = "mapi-entry " > < code > mono_install_runtime_cleanup< / code > < / div >
< div class = "mapi-height-container" >
< div class = "mapi-ptr-container" > < / div >
< div class = "mapi-description" >
< div class = "mapi-ptr" > < / div >
< div class = "mapi-declaration mapi-section" > Syntax< / div >
< div class = "mapi-prototype" > mono_install_runtime_cleanup< / div >
< p / >
< / div > <!-- mapi - description -->
< / div > <!-- height container -->
< / div > <!-- class=mapi -->
< a name = "api:mono_runtime_set_shutting_down" > < / a >
< div class = "mapi" >
< div class = "mapi-entry " > < code > mono_runtime_set_shutting_down< / code > < / div >
< div class = "mapi-height-container" >
< div class = "mapi-ptr-container" > < / div >
< div class = "mapi-description" >
< div class = "mapi-ptr" > < / div >
< div class = "mapi-declaration mapi-section" > Syntax< / div >
< div class = "mapi-prototype" > void
mono_runtime_set_shutting_down (void)
< / div >
< p / >
< div class = "mapi-section" > Description< / div >
< div > < p / >
Invoked by System.Environment.Exit to flag that the runtime
is shutting down.
< p / >
Deprecated. This function can break the shutdown sequence.< / div >
< / div > <!-- mapi - description -->
< / div > <!-- height container -->
< / div >
< / div > < / body >
2015-04-26 19:10:23 +01:00
< / html >