Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,22 @@
import java.util.List;
import java.util.Map;

import com.oracle.objectfile.debugentry.range.PrimaryRange;
import com.oracle.objectfile.debugentry.range.Range;
import com.oracle.objectfile.debugentry.range.SubRange;
import com.oracle.objectfile.debuginfo.DebugInfoProvider.DebugFileInfo;
import jdk.vm.ci.meta.ResolvedJavaType;
import org.graalvm.collections.EconomicMap;
import org.graalvm.compiler.debug.DebugContext;

import com.oracle.objectfile.debugentry.range.PrimaryRange;
import com.oracle.objectfile.debugentry.range.Range;
import com.oracle.objectfile.debugentry.range.SubRange;
import com.oracle.objectfile.debuginfo.DebugInfoProvider;
import com.oracle.objectfile.debuginfo.DebugInfoProvider.DebugCodeInfo;
import com.oracle.objectfile.debuginfo.DebugInfoProvider.DebugLocationInfo;
import com.oracle.objectfile.debuginfo.DebugInfoProvider.DebugFileInfo;
import com.oracle.objectfile.debuginfo.DebugInfoProvider.DebugLocalValueInfo;
import com.oracle.objectfile.debuginfo.DebugInfoProvider.DebugLocationInfo;
import com.oracle.objectfile.debuginfo.DebugInfoProvider.DebugTypeInfo.DebugTypeKind;
import com.oracle.objectfile.elf.dwarf.DwarfDebugInfo;

import jdk.vm.ci.meta.ResolvedJavaType;

/**
* An abstract class which indexes the information presented by the DebugInfoProvider in an
* organization suitable for use by subclasses targeting a specific binary format.
Expand Down Expand Up @@ -349,13 +350,15 @@ public void installDebugInfo(DebugInfoProvider debugInfoProvider) {
}));

debugInfoProvider.dataInfoProvider().forEach(debugDataInfo -> debugDataInfo.debugContext((debugContext) -> {
String provenance = debugDataInfo.getProvenance();
String typeName = debugDataInfo.getTypeName();
String partitionName = debugDataInfo.getPartition();
/* Address is heap-register relative pointer. */
long address = debugDataInfo.getAddress();
long size = debugDataInfo.getSize();
debugContext.log(DebugContext.INFO_LEVEL, "Data: address 0x%x size 0x%x type %s partition %s provenance %s ", address, size, typeName, partitionName, provenance);
if (debugContext.isLogEnabled(DebugContext.INFO_LEVEL)) {
String provenance = debugDataInfo.getProvenance();
String typeName = debugDataInfo.getTypeName();
String partitionName = debugDataInfo.getPartition();
/* Address is heap-register relative pointer. */
long address = debugDataInfo.getAddress();
long size = debugDataInfo.getSize();
debugContext.log(DebugContext.INFO_LEVEL, "Data: address 0x%x size 0x%x type %s partition %s provenance %s ", address, size, typeName, partitionName, provenance);
}
}));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2528,63 +2528,53 @@ public Type getType() {
}

private class NativeImageDebugDataInfo implements DebugDataInfo {
HostedClass hostedClass;
ImageHeapPartition partition;
long offset;
long address;
long size;
String typeName;
String provenance;
private final NativeImageHeap.ObjectInfo objectInfo;

@SuppressWarnings("try")
@Override
public void debugContext(Consumer<DebugContext> action) {
try (DebugContext.Scope s = debugContext.scope("DebugDataInfo", provenance)) {
try (DebugContext.Scope s = debugContext.scope("DebugDataInfo")) {
action.accept(debugContext);
} catch (Throwable e) {
throw debugContext.handle(e);
}
}

/* Accessors. */

NativeImageDebugDataInfo(ObjectInfo objectInfo) {
hostedClass = objectInfo.getClazz();
partition = objectInfo.getPartition();
offset = objectInfo.getOffset();
address = objectInfo.getAddress();
size = objectInfo.getSize();
provenance = objectInfo.toString();
typeName = hostedClass.toJavaName();
this.objectInfo = objectInfo;
}

/* Accessors. */
@Override
public String getProvenance() {
return provenance;
return objectInfo.toString();
}

@Override
public String getTypeName() {
return typeName;
return objectInfo.getClazz().toJavaName();
}

@Override
public String getPartition() {
ImageHeapPartition partition = objectInfo.getPartition();
return partition.getName() + "{" + partition.getSize() + "}@" + partition.getStartOffset();
}

@Override
public long getOffset() {
return offset;
return objectInfo.getOffset();
}

@Override
public long getAddress() {
return address;
return objectInfo.getAddress();
}

@Override
public long getSize() {
return size;
return objectInfo.getSize();
}
}

Expand Down