# HG changeset patch # User swamyv # Date 1232055009 28800 # Node ID fc14734c5aecb9b48964fe2ade156994600d7d19 # Parent 8db2b3e46c3800316a3ff0229c34c54a287d6c9d# Parent 37b3ca07152277fc7a8cf389274bea172dd847f2 Merge diff -r 37b3ca071522 -r fc14734c5aec agent/src/os/linux/ps_core.c --- a/agent/src/os/linux/ps_core.c Wed Jan 14 20:14:19 2009 -0500 +++ b/agent/src/os/linux/ps_core.c Thu Jan 15 13:30:09 2009 -0800 @@ -238,8 +238,8 @@ // Ignore the rest of the FileMapHeader. We don't need those fields here. }; -static bool read_int(struct ps_prochandle* ph, uintptr_t addr, int* pvalue) { - int i; +static bool read_jboolean(struct ps_prochandle* ph, uintptr_t addr, jboolean* pvalue) { + jboolean i; if (ps_pdread(ph, (psaddr_t) addr, &i, sizeof(i)) == PS_OK) { *pvalue = i; return true; @@ -295,7 +295,7 @@ int fd = -1, m = 0; uintptr_t base = 0, useSharedSpacesAddr = 0; uintptr_t sharedArchivePathAddrAddr = 0, sharedArchivePathAddr = 0; - int useSharedSpaces = 0; + jboolean useSharedSpaces = 0; map_info* mi = 0; memset(classes_jsa, 0, sizeof(classes_jsa)); @@ -306,12 +306,15 @@ return false; } - if (read_int(ph, useSharedSpacesAddr, &useSharedSpaces) != true) { + // Hotspot vm types are not exported to build this library. So + // using equivalent type jboolean to read the value of + // UseSharedSpaces which is same as hotspot type "bool". + if (read_jboolean(ph, useSharedSpacesAddr, &useSharedSpaces) != true) { print_debug("can't read the value of 'UseSharedSpaces' flag\n"); return false; } - if (useSharedSpaces == 0) { + if ((int)useSharedSpaces == 0) { print_debug("UseSharedSpaces is false, assuming -Xshare:off!\n"); return true; } diff -r 37b3ca071522 -r fc14734c5aec agent/src/os/solaris/proc/saproc.cpp --- a/agent/src/os/solaris/proc/saproc.cpp Wed Jan 14 20:14:19 2009 -0500 +++ b/agent/src/os/solaris/proc/saproc.cpp Thu Jan 15 13:30:09 2009 -0800 @@ -502,8 +502,8 @@ }; static bool -read_int(struct ps_prochandle* ph, psaddr_t addr, int* pvalue) { - int i; +read_jboolean(struct ps_prochandle* ph, psaddr_t addr, jboolean* pvalue) { + jboolean i; if (ps_pread(ph, addr, &i, sizeof(i)) == PS_OK) { *pvalue = i; return true; @@ -575,10 +575,13 @@ } // read the value of the flag "UseSharedSpaces" - int value = 0; - if (read_int(ph, useSharedSpacesAddr, &value) != true) { + // Since hotspot types are not available to build this library. So + // equivalent type "jboolean" is used to read the value of "UseSharedSpaces" + // which is same as hotspot type "bool". + jboolean value = 0; + if (read_jboolean(ph, useSharedSpacesAddr, &value) != true) { THROW_NEW_DEBUGGER_EXCEPTION_("can't read 'UseSharedSpaces' flag", 1); - } else if (value == 0) { + } else if ((int)value == 0) { print_debug("UseSharedSpaces is false, assuming -Xshare:off!\n"); return 1; }