Search in sources :

Example 1 with LayoutDecisionMap

use of com.oracle.objectfile.LayoutDecisionMap in project graal by oracle.

the class DwarfARangesSectionImpl method getOrDecideContent.

@Override
public byte[] getOrDecideContent(Map<ObjectFile.Element, LayoutDecisionMap> alreadyDecided, byte[] contentHint) {
    ObjectFile.Element textElement = getElement().getOwner().elementForName(".text");
    LayoutDecisionMap decisionMap = alreadyDecided.get(textElement);
    if (decisionMap != null) {
        Object valueObj = decisionMap.getDecidedValue(LayoutDecision.Kind.VADDR);
        if (valueObj != null && valueObj instanceof Number) {
            /*
                 * This may not be the final vaddr for the text segment but it will be close enough
                 * to make debug easier i.e. to within a 4k page or two.
                 */
            debugTextBase = ((Number) valueObj).longValue();
        }
    }
    return super.getOrDecideContent(alreadyDecided, contentHint);
}
Also used : LayoutDecisionMap(com.oracle.objectfile.LayoutDecisionMap) ObjectFile(com.oracle.objectfile.ObjectFile)

Example 2 with LayoutDecisionMap

use of com.oracle.objectfile.LayoutDecisionMap in project graal by oracle.

the class DwarfLineSectionImpl method getOrDecideContent.

@Override
public byte[] getOrDecideContent(Map<ObjectFile.Element, LayoutDecisionMap> alreadyDecided, byte[] contentHint) {
    ObjectFile.Element textElement = getElement().getOwner().elementForName(".text");
    LayoutDecisionMap decisionMap = alreadyDecided.get(textElement);
    if (decisionMap != null) {
        Object valueObj = decisionMap.getDecidedValue(LayoutDecision.Kind.VADDR);
        if (valueObj != null && valueObj instanceof Number) {
            /*
                 * This may not be the final vaddr for the text segment but it will be close enough
                 * to make debug easier i.e. to within a 4k page or two.
                 */
            debugTextBase = ((Number) valueObj).longValue();
        }
    }
    return super.getOrDecideContent(alreadyDecided, contentHint);
}
Also used : LayoutDecisionMap(com.oracle.objectfile.LayoutDecisionMap) ObjectFile(com.oracle.objectfile.ObjectFile)

Aggregations

LayoutDecisionMap (com.oracle.objectfile.LayoutDecisionMap)2 ObjectFile (com.oracle.objectfile.ObjectFile)2