Path: blob/master/src/hotspot/os/aix/loadlib_aix.hpp
40930 views
/*1* Copyright (c) 2012, 2013 SAP SE. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/232425// Loadlib_aix.cpp contains support code for analysing the memory26// layout of loaded binaries in ones own process space.27//28// It is needed, among other things, to provide dladdr(3), which is29// missing on AIX.3031#ifndef OS_AIX_LOADLIB_AIX_HPP32#define OS_AIX_LOADLIB_AIX_HPP3334#include <stddef.h>3536class outputStream;3738// Struct holds information about a single loaded library module.39// Note that on AIX, a single library can be spread over multiple40// uintptr_t ranges on a module base, eg.41// libC.a(shr3_64.o) or libC.a(shrcore_64.o).4243// Note: all pointers to strings (path, member) point to strings which are immortal.44struct loaded_module_t {4546// Points to the full path of the lodaed module, e.g.47// "/usr/lib/libC.a".48const char* path;4950// Host library name without path51const char* shortname;5253// Points to the object file (AIX specific stuff)54// e.g "shrcore_64.o".55const char* member;5657// Text area from, to58const void* text;59size_t text_len;6061// Data area from, to62const void* data;63size_t data_len;6465// True if this module is part of the vm.66bool is_in_vm;6768};6970// This class is a singleton holding a map of all loaded binaries71// in the AIX process space.72class LoadedLibraries73// : AllStatic (including allocation.hpp just for AllStatic is overkill.)74{7576public:7778// Rebuild the internal module table. If an error occurs, internal module79// table remains untouched.80static bool reload();8182// Check whether the given address points into the text segment of a83// loaded module. Return true if this is the case.84// Optionally, information about the module is returned (info)85static bool find_for_text_address (86const void* p,87loaded_module_t* info // Optional, leave NULL if not needed.88);8990// Check whether the given address points into the data segment of a91// loaded module. Return true if this is the case.92// Optionally, information about the module is returned (info)93static bool find_for_data_address (94const void* p,95loaded_module_t* info // Optional, leave NULL if not needed.96);9798// Output debug info99static void print(outputStream* os);100101};102103#endif // OS_AIX_LOADLIB_AIX_HPP104105106