Search in sources :

Example 1 with IDetailedMemoryRange

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

the class ProgramHeaderEntry method asMemorySource.

IMemorySource asMemorySource() {
    IMemorySource source = null;
    if (!isEmpty()) {
        boolean isExecutable = (_flags & PF_X) != 0;
        source = new ELFMemorySource(virtualAddress, memorySize, fileOffset, reader);
    } else {
        source = new UnbackedMemorySource(virtualAddress, memorySize, "ELF ProgramHeaderEntry storage declared but data not included");
    }
    Properties memoryProps = ((IDetailedMemoryRange) source).getProperties();
    memoryProps.setProperty("IN_CORE", "" + (!isEmpty()));
    if ((_flags & PF_W) != 0) {
        memoryProps.setProperty(IDetailedMemoryRange.WRITABLE, Boolean.TRUE.toString());
    }
    if ((_flags & PF_X) != 0) {
        memoryProps.setProperty(IDetailedMemoryRange.EXECUTABLE, Boolean.TRUE.toString());
    }
    if ((_flags & PF_R) != 0) {
        memoryProps.setProperty(IDetailedMemoryRange.READABLE, Boolean.TRUE.toString());
    }
    return source;
}
Also used : IMemorySource(com.ibm.j9ddr.corereaders.memory.IMemorySource) UnbackedMemorySource(com.ibm.j9ddr.corereaders.memory.UnbackedMemorySource) IDetailedMemoryRange(com.ibm.j9ddr.corereaders.memory.IDetailedMemoryRange) Properties(java.util.Properties)

Aggregations

IDetailedMemoryRange (com.ibm.j9ddr.corereaders.memory.IDetailedMemoryRange)1 IMemorySource (com.ibm.j9ddr.corereaders.memory.IMemorySource)1 UnbackedMemorySource (com.ibm.j9ddr.corereaders.memory.UnbackedMemorySource)1 Properties (java.util.Properties)1