#include <opagent.h>
int op_write_native_code( | hdl, | |
symbol_name, | ||
vma, | ||
code, | ||
code_size) ; |
op_agent_thdl
;char const *symbol_name
;uint64_tvma
;void const *code
;const unsigned intcode_size
;
hdl :
Handle returned from an earlier call to
op_open_agent()
symbol_name :
The name of the symbol being dynamically compiled.
This name can (and should) contain all necessary information to disambiguate it from
symbols of the same name; e.g., class, method signature.
vma :
Virtual memory address of the executable code
code :
Pointer to the location of the compiled code.
Theoretically, this may be a different location from
that given by the vma argument. For some JIT compilers,
obtaining the code may be impractical. For this (or any other)
reason, the agent can choose to pass NULL for this paraemter.
If NULL is passed, no code will be copied into the JIT dump
file.
code_size :
Size of the compiled code
Returns 0 on success; -1 otherwise. If -1 is returned, errno
is set
to indicate the nature of the error.
errno
is set to EINVAL if an invalid op_agent_t
handle is passed. For a list of other possible errno
values, see the man pages for:
gettimeofday, fwrite