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;
}
2018-01-24 17:04:36 +00:00
.mapi-codeblock {
display: block;
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);
}
2016-08-03 10:59:49 +00:00
.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;
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 >
2017-06-07 13:16:24 +00:00
< table class = "mapi-parameters" > < tbody > < tr > < td > < i > domain< / i > < / td > < td > Domain that you want to look up< / td > < / tr > < tr > < td > < i > addr< / i > < / td > < td > Points to an address with JITed code.< / 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
2016-08-03 10:59:49 +00:00
2017-06-07 13:16:24 +00:00
code or a trampoline) or a valid pointer to a < code > MonoJitInfo*< / code > .< / div >
2016-08-03 10:59:49 +00:00
< div class = "mapi-section" > Description< / div >
2018-01-24 17:04:36 +00:00
< 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 >
2016-08-03 10:59:49 +00:00
< / 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 >
2017-06-07 13:16:24 +00:00
< table class = "mapi-parameters" > < tbody > < tr > < td > < i > ji< / i > < / td > < td > the JIT information handle< / td > < / tr > < / tbody > < / table > < div class = "mapi-section" > Return value< / div >
< div > Starting address with the native code.
2016-08-03 10:59:49 +00:00
< / div >
< div class = "mapi-section" > Description< / div >
2018-01-24 17:04:36 +00:00
< 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 >
2016-08-03 10:59:49 +00:00
< / 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 >
2017-06-07 13:16:24 +00:00
< table class = "mapi-parameters" > < tbody > < tr > < td > < i > ji< / i > < / td > < td > the JIT information handle< / td > < / tr > < / tbody > < / table > < div class = "mapi-section" > Return value< / div >
< div > Starting address with the native code.
2016-08-03 10:59:49 +00:00
< / div >
< div class = "mapi-section" > Description< / div >
2018-01-24 17:04:36 +00:00
< 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 >
2016-08-03 10:59:49 +00:00
< / 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 >
2017-06-07 13:16:24 +00:00
< table class = "mapi-parameters" > < tbody > < tr > < td > < i > ji< / i > < / td > < td > the JIT information handle< / td > < / tr > < / tbody > < / table > < div class = "mapi-section" > Return value< / div >
< div > The < code > MonoMethod< / code > that represents the code tracked
2016-08-03 10:59:49 +00:00
by < i > ji< / i > .< / div >
< div class = "mapi-section" > Description< / div >
2018-01-24 17:04:36 +00:00
< div >
< p / >
Use this function to get the < code > MonoMethod*< / code > that backs
the < i > ji< / i > object.
< p / > < / div >
2016-08-03 10:59:49 +00:00
< / 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 >
2017-06-07 13:16:24 +00:00
< table class = "mapi-parameters" > < tbody > < tr > < td > < i > ip< / i > < / td > < td > an instruction pointer address< / td > < / tr > < / tbody > < / table > < div class = "mapi-section" > Return value< / div >
< div > the name of the method at address < i > ip< / i > .
2016-08-03 10:59:49 +00:00
< / div >
< div class = "mapi-section" > Description< / div >
2018-01-24 17:04:36 +00:00
< div >
< p / >
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:
< p / >
(gdb) print mono_pmip ($pc)
< p / > < / div >
2016-08-03 10:59:49 +00:00
< / 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 >
2017-06-07 13:16:24 +00:00
< div class = "mapi-prototype" > MONO_ATTR_USED void
2015-04-26 19:10:23 +01:00
mono_print_method_from_ip (void *ip)
< / div >
2016-08-03 10:59:49 +00:00
< p / >
< div class = "mapi-section" > Parameters< / div >
2017-06-07 13:16:24 +00:00
< table class = "mapi-parameters" > < tbody > < tr > < td > < i > ip< / i > < / td > < td > an instruction pointer address< / td > < / tr > < / tbody > < / table > < div class = "mapi-section" > Description< / div >
2018-01-24 17:04:36 +00:00
< div >
< p / >
This method is used from a debugger to get the name of the
method at address < i > ip< / i > .
< p / >
This prints the name of the method at address < i > ip< / i > in the standard
output. Unlike < code > mono_pmip< / code > which returns a string, this routine
prints the value on the standard output.< / div >
2016-08-03 10:59:49 +00:00
< / 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 >
2017-06-07 13:16:24 +00:00
< div class = "mapi-prototype" > void
mono_print_thread_dump (void *sigctx)
< / div >
2016-08-03 10:59:49 +00:00
< p / >
2017-06-07 13:16:24 +00:00
< div class = "mapi-section" > Description< / div >
2018-01-24 17:04:36 +00:00
< div >
< p / >
Print information about the current thread to stdout.
< i > sigctx< / i > can be < code > NULL< / code > , allowing this to be called from gdb.< / div >
2016-08-03 10:59:49 +00:00
< / 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 >
2018-01-24 17:04:36 +00:00
< div >
< p / >
Ask all threads except the current to print their stacktrace to stdout.< / div >
2016-08-03 10:59:49 +00:00
< / 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 >
2018-01-24 17:04:36 +00:00
< div >
< p / >
Initialize global variables used by this module.< / div >
2016-08-03 10:59:49 +00:00
< / 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 >
2018-01-24 17:04:36 +00:00
< div >
< p / >
Free all resources used by this module.< / div >
2016-08-03 10:59:49 +00:00
< / 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 >
2017-06-07 13:16:24 +00:00
< div class = "mapi-prototype" > gint32
mono_environment_exitcode_get (void)
< / div >
2016-08-03 10:59:49 +00:00
< 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 >
2017-06-07 13:16:24 +00:00
< div class = "mapi-prototype" > void
mono_environment_exitcode_set (gint32 value)
< / div >
2016-08-03 10:59:49 +00:00
< 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 >
2017-06-07 13:16:24 +00:00
< div class = "mapi-prototype" > void
mono_install_runtime_cleanup (MonoDomainFunc func)
< / div >
2016-08-03 10:59:49 +00:00
< p / >
< / div > <!-- mapi - description -->
< / div > <!-- height container -->
< / div > <!-- class=mapi -->
< a name = "api:mono_runtime_set_shutting_down" > < / a >
< div class = "mapi" >
2017-06-07 13:16:24 +00:00
< div class = "mapi-entry mapi-strike" > < code > mono_runtime_set_shutting_down< / code > < / div > < br / > < div class = 'mapi-deprecated' > < b > Deprecated:< / b > This function can break the shutdown sequence.< / div >
2016-08-03 10:59:49 +00:00
< 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 >
2018-01-24 17:04:36 +00:00
< div >
< p / >
Invoked by < code > System.Environment.Exit< / code > to flag that the runtime
is shutting down.< / div >
2016-08-03 10:59:49 +00:00
< / div > <!-- mapi - description -->
< / div > <!-- height container -->