Skip to content

Commit

Permalink
Move mapping function to aix specific file.
Browse files Browse the repository at this point in the history
  • Loading branch information
suchismith1993 committed Nov 15, 2023
1 parent 6e1694a commit 3c10798
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions src/hotspot/share/prims/jvmtiAgent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,16 +320,6 @@ static void* load_agent_from_absolute_path(JvmtiAgent* agent, bool vm_exit_on_er
AIX_ONLY(if (library != nullptr) save_library_signature(agent, agent->name());)
return library;
}
static void mapAlternateName(char* buffer,const char *extension)
{
unsigned long end=strlen(buffer);
while(end>0 && buffer[end]!='.')
{
end--;
}
buffer[end]='\0';
strcat(buffer,extension);
}

// Agents with relative paths are loaded from the standard dll directory.
static void* load_agent_from_relative_path(JvmtiAgent* agent, bool vm_exit_on_error) {
Expand All @@ -349,16 +339,16 @@ static void* load_agent_from_relative_path(JvmtiAgent* agent, bool vm_exit_on_er
AIX_ONLY(save_library_signature(agent, &buffer[0]);)
return library;
}
AIX_ONLY(
if (library == nullptr){
mapAlternateName(buffer,AIX_EXTENSION);
#ifdef AIX
if (library == nullptr) {
os::Aix::mapAlternateName(buffer,AIX_EXTENSION);
library=os::dll_load(&buffer[0], &ebuf[0], sizeof ebuf);
if(library!=nullptr){
if(library!=nullptr) {
save_library_signature(agent, &buffer[0]);
return library;
}
}
)
#endif
if (vm_exit_on_error) {
vm_exit(agent, " on the library path, with error: ", missing_module_error_msg);
}
Expand Down

0 comments on commit 3c10798

Please sign in to comment.