Search in sources :

Example 1 with ILibraryResolver

use of com.ibm.j9ddr.corereaders.ILibraryResolver in project openj9 by eclipse.

the class AIXDumpReader method executablePathHint.

// Passback of executable path. If we couldn't load the executable the first time, try again now.
public void executablePathHint(String path) {
    if (_executable instanceof MissingFileModule) {
        // Check the hint points at the same file name
        try {
            if (!getFileName(_executable.getName()).equals(getFileName(path))) {
                return;
            }
        } catch (CorruptDataException e1) {
            return;
        }
        // Remove placeholder memory source
        _process.removeMemorySource(_executableTextSection);
        // Remember the current placeholder in case this one fails too
        IModule currentExecutable = _executable;
        IMemorySource currentExecutableTextSection = _executableTextSection;
        ILibraryResolver resolver = LibraryResolverFactory.getResolverForCoreFile(this.coreFile);
        IProcess proc = getProcess();
        try {
            seek(_loaderOffset);
            readInt();
            // Ignore flags
            readLoaderInfoFlags();
            // Ignore dataOffset
            readAddress();
            long textVirtualAddress = readAddress();
            long textSize = readAddress();
            long dataVirtualAddress = readAddress();
            long dataSize = readAddress();
            // Disregard fileName from core
            readString();
            String fileName = path;
            String objectName = readString();
            String moduleName = fileName;
            if (0 < objectName.length()) {
                moduleName += "(" + objectName + ")";
            }
            loadModule(resolver, proc, textVirtualAddress, textSize, dataVirtualAddress, dataSize, fileName, objectName, moduleName, true);
        } catch (IOException e) {
        // TODO handle
        }
        // If the executable is still a MissingFileModule, the hint didn't work
        if (_executable instanceof MissingFileModule) {
            _process.removeMemorySource(_executableTextSection);
            _executableTextSection = currentExecutableTextSection;
            _process.addMemorySource(_executableTextSection);
            _executable = currentExecutable;
        }
    }
}
Also used : IMemorySource(com.ibm.j9ddr.corereaders.memory.IMemorySource) IModule(com.ibm.j9ddr.corereaders.memory.IModule) ILibraryResolver(com.ibm.j9ddr.corereaders.ILibraryResolver) CorruptDataException(com.ibm.j9ddr.CorruptDataException) IOException(java.io.IOException) IProcess(com.ibm.j9ddr.corereaders.memory.IProcess) MissingFileModule(com.ibm.j9ddr.corereaders.memory.MissingFileModule)

Aggregations

CorruptDataException (com.ibm.j9ddr.CorruptDataException)1 ILibraryResolver (com.ibm.j9ddr.corereaders.ILibraryResolver)1 IMemorySource (com.ibm.j9ddr.corereaders.memory.IMemorySource)1 IModule (com.ibm.j9ddr.corereaders.memory.IModule)1 IProcess (com.ibm.j9ddr.corereaders.memory.IProcess)1 MissingFileModule (com.ibm.j9ddr.corereaders.memory.MissingFileModule)1 IOException (java.io.IOException)1