saproc.cpp revision 579
0N/A#include "salibproc.h"
0N/A#include <thread_db.h>
0N/A#include <demangle.h>
0N/A#define THROW_NEW_DEBUGGER_EXCEPTION_(str, value) { throwNewDebuggerException(env, str); return value; }
0N/Astatic int _libsaproc_debug = 0;
0N/A if (_libsaproc_debug) {
0N/A// libthread.so dlopen handle, thread agent ptr and function pointers
0N/A (*p_td_init_t)(void);
0N/A // dlclose libthread_db.so
0N/A if (libthread_db_handle != 0) {
0N/A if (p_ps_prochandle != 0L) {
0N/A struct FileMapHeader* pheader = (struct FileMapHeader*) env->GetLongField(this_obj, p_file_map_header_ID);
0N/A if (sa_ignore_threaddb) { \
0N/A if (sa_ignore_threaddb) { \
0N/Astatic void init_alt_root() {
0N/A alt_root_len = 0;
0N/A if (_libsaproc_debug) {
0N/A if (alt_root_len > 0) {
0N/A if (_libsaproc_debug) {
0N/A if (_libsaproc_debug) {
0N/A if (_libsaproc_debug) {
0N/A if (alt_root_len > 0) {
0N/A if (_libsaproc_debug) {
0N/A struct ps_prochandle* ph = (struct ps_prochandle*) env->GetLongField(this_obj, p_ps_prochandle_ID);
0N/A void* libthread_db_handle = 0;
0N/A p_td_thr_get_info_t p_td_thr_get_info = (p_td_thr_get_info_t) env->GetLongField(this_obj, p_td_thr_get_info_ID);
0N/A jobject threadProxy = env->CallObjectMethod(this_obj, getThreadForThreadId_ID, (jlong)(uintptr_t) thrinfo.ti_tid);
0N/A// Refer to filemap.hpp.
0N/A// Refer to CompactingPermGenGen::n_regions in compactingPermGenGen.hpp
0N/A// Refer to FileMapInfo::_current_version in filemap.hpp
0N/Astruct FileMapHeader {
0N/A struct space_info {
0N/A struct ps_prochandle* ph = (struct ps_prochandle*) env->GetLongField(this_obj, p_ps_prochandle_ID);
0N/A if (useSharedSpacesAddr == 0) {
0N/A if (sharedArchivePathAddrAddr == 0) {
0N/A if (read_string(ph, (psaddr_t)sharedArchivePathAddr, classes_jsa, sizeof(classes_jsa)) != true) {
0N/A if (n != sizeof(struct FileMapHeader)) {
0N/A if (_libsaproc_debug) {
0N/A for (int m = 0; m < NUM_SHARED_MAPS; m++) {
0N/Astatic const char* proc_arg_grab_errmsgs[] = {
0N/Astatic void attach_internal(JNIEnv* env, jobject this_obj, jstring cmdLine, jboolean isProcess) {
0N/A struct ps_prochandle* ph = proc_arg_grab(cmdLine_cstr, (isProcess? PR_ARG_PIDS : PR_ARG_CORES), PGRAB_FORCE, &gcode);
0N/A int data_model;
0N/A if (!sa_ignore_threaddb) {
0N/A if (!sa_ignore_threaddb) {
0N/A if (!sa_ignore_threaddb) {
0N/A if (!sa_ignore_threaddb) {
0N/AJNIEXPORT void JNICALL Java_sun_jvm_hotspot_debugger_proc_ProcDebuggerLocal_attach0__Ljava_lang_String_2
0N/AJNIEXPORT void JNICALL Java_sun_jvm_hotspot_debugger_proc_ProcDebuggerLocal_attach0__Ljava_lang_String_2Ljava_lang_String_2
0N/AJNIEXPORT jint JNICALL Java_sun_jvm_hotspot_debugger_proc_ProcDebuggerLocal_getRemoteProcessAddressSize0
0N/A return getpagesize();
0N/AJNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debugger_proc_ProcDebuggerLocal_getThreadIntegerRegisterSet0
0N/A p_td_ta_map_id2thr_t p_td_ta_map_id2thr = (p_td_ta_map_id2thr_t) env->GetLongField(this_obj, p_td_ta_map_id2thr_ID);
0N/A td_thragent_t* p_td_thragent_t = (td_thragent_t*) env->GetLongField(this_obj, p_td_thragent_t_ID);
0N/A if (p_td_thragent_t == 0) {
0N/A p_td_thr_getgregs_t p_td_thr_getgregs = (p_td_thr_getgregs_t) env->GetLongField(this_obj, p_td_thr_getgregs_ID);
0N/A CHECK_EXCEPTION_(0);
0N/A td_thragent_t* p_td_thragent_t = (td_thragent_t*) env->GetLongField(this_obj, p_td_thragent_t_ID);
0N/A if (p_td_thragent_t == 0) {
0N/A p_td_ta_thr_iter_t p_td_ta_thr_iter = (p_td_ta_thr_iter_t) env->GetLongField(this_obj, p_td_ta_thr_iter_ID);
0N/A CHECK_EXCEPTION_(0);
0N/A CHECK_EXCEPTION_(0);
0N/AJNIEXPORT jbyteArray JNICALL Java_sun_jvm_hotspot_debugger_proc_ProcDebuggerLocal_readBytesFromProcess0
0N/A CHECK_EXCEPTION_(0);
0N/A CHECK_EXCEPTION_(0);
0N/A struct FileMapHeader* pheader = (struct FileMapHeader*) env->GetLongField(this_obj, p_file_map_header_ID);
0N/A for (int m = 0; m < NUM_SHARED_MAPS; m++) {
0N/A return jbyteArray(0);
0N/A return jbyteArray(0);
0N/AJNIEXPORT void JNICALL Java_sun_jvm_hotspot_debugger_proc_ProcDebuggerLocal_writeBytesToProcess0
0N/A CHECK_EXCEPTION_(0);
0N/A CHECK_EXCEPTION_(0);
0N/A if (symbol_addr == 0) {
0N/A CHECK_EXCEPTION_(0);
0N/A return env->CallObjectMethod(this_obj, createClosestSymbol_ID, resSym, (address - sym.st_value));
0N/A if (_libsaproc_debug) {
0N/A if (libproc_handle == 0)
0N/A THROW_NEW_DEBUGGER_EXCEPTION("can't load libproc.so, if you are using Solaris 5.7 or below, copy libproc.so from 5.8!");
0N/A void (*set_hook)(find_file_hook_t) = (void(*)(find_file_hook_t))dlsym(libproc_handle, "Pset_find_file_hook");
0N/A "createSenderFrame", "(Lsun/jvm/hotspot/debugger/proc/ProcCFrame;JJ)Lsun/jvm/hotspot/debugger/proc/ProcCFrame;");