mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8024007: Misc. cleanup of static agent code
Minor cleanup of static agent code from 8014135
Reviewed-by: dcubed, sspitsyn
This commit is contained in:
parent
7e04c1775c
commit
091edb47c5
5 changed files with 10 additions and 7 deletions
|
@ -454,6 +454,7 @@ void* os::native_java_library() {
|
|||
*/
|
||||
void* os::find_agent_function(AgentLibrary *agent_lib, bool check_lib,
|
||||
const char *syms[], size_t syms_len) {
|
||||
assert(agent_lib != NULL, "sanity check");
|
||||
const char *lib_name;
|
||||
void *handle = agent_lib->os_lib();
|
||||
void *entryName = NULL;
|
||||
|
@ -484,6 +485,7 @@ bool os::find_builtin_agent(AgentLibrary *agent_lib, const char *syms[],
|
|||
void *proc_handle;
|
||||
void *save_handle;
|
||||
|
||||
assert(agent_lib != NULL, "sanity check");
|
||||
if (agent_lib->name() == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
@ -493,14 +495,13 @@ bool os::find_builtin_agent(AgentLibrary *agent_lib, const char *syms[],
|
|||
// We want to look in this process' symbol table.
|
||||
agent_lib->set_os_lib(proc_handle);
|
||||
ret = find_agent_function(agent_lib, true, syms, syms_len);
|
||||
agent_lib->set_os_lib(save_handle);
|
||||
if (ret != NULL) {
|
||||
// Found an entry point like Agent_OnLoad_lib_name so we have a static agent
|
||||
agent_lib->set_os_lib(proc_handle);
|
||||
agent_lib->set_valid();
|
||||
agent_lib->set_static_lib(true);
|
||||
return true;
|
||||
}
|
||||
agent_lib->set_os_lib(save_handle);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue