use of com.ibm.j9ddr.corereaders.IModuleFile in project openj9 by eclipse.
the class AIXDumpReader method loadModule.
private void loadModule(ILibraryResolver resolver, IProcess proc, long textVirtualAddress, long textSize, long dataVirtualAddress, long dataSize, String fileName, String objectName, String moduleName, boolean loadingExecutable) {
// .data range will be loaded in core. .text range will be in the module itself.
IMemoryRange data = new MemoryRange(proc.getAddressSpace(), dataVirtualAddress, dataSize, ".data");
IModule module;
IMemorySource text;
try {
LibraryDataSource library = null;
if (loadingExecutable) {
library = resolver.getLibrary(fileName, true);
} else {
library = resolver.getLibrary(fileName);
}
IModuleFile moduleFile = loadModuleFile(library, objectName);
text = moduleFile.getTextSegment(textVirtualAddress, textSize);
List<? extends ISymbol> symbols = moduleFile.getSymbols(textVirtualAddress);
List<IMemoryRange> moduleMemoryRanges = new LinkedList<IMemoryRange>();
moduleMemoryRanges.add(text);
moduleMemoryRanges.add(data);
module = new Module(proc, moduleName, symbols, moduleMemoryRanges, textVirtualAddress, moduleFile.getProperties());
} catch (Exception e) {
// Create a non-backed memory range for the text segment (so we know it exists)
text = new UnbackedMemorySource(textVirtualAddress, textSize, "Native library " + moduleName + " couldn't be found", 0, ".text");
List<IMemoryRange> moduleMemoryRanges = new LinkedList<IMemoryRange>();
moduleMemoryRanges.add(text);
moduleMemoryRanges.add(data);
// Can't find the library - put a stub in with the information we have.
module = new MissingFileModule(proc, moduleName, moduleMemoryRanges);
}
// Add .text to _memoryRanges so it becomes part of the native address space.
addMemorySource(text);
if (loadingExecutable) {
_executable = module;
_executableTextSection = text;
} else {
_modules.add(module);
}
}
Aggregations