4. op_write_debug_line_info

Write debug information about compiled code to a JIT dump file.
#include <opagent.h>
int op_write_debug_line_info(hdl,  
 code,  
 nr_entry,  
 compile_map); 
op_agent_thdl;
void const *code;
size_tnr_entry;
struct debug_line_info const *compile_map;
 

Description

Add debug line information to a piece of code. An op_write_native_code() with the same code pointer should have occurred before this call. It's not necessary to provide one lineno information entry per machine instruction; the array can contain hole.

Parameters

hdl : Handle returned from an earlier call to op_open_agent()

code : Pointer to the location of the code with debug info

nr_entry : Number of entries in compile_map

compile_map : Array of struct debug_line_info. See the JVMTI agent library implementation for an example of what information should be retrieved from a VM to fill out this data structure.

Return value

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, ftell, fwrite