Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GR-54697] Implement debuginfo generation at image-runtime. #10522

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
6428e75
Implementation for GDB JIT compilation interface
dominikmascherbauer Jun 26, 2024
8853448
Add a LocalVariableTable to SubstrateMethod
dominikmascherbauer Jun 26, 2024
8ff2d55
Create a test to manually trigger runtime compilation
dominikmascherbauer Jun 26, 2024
f2ee654
Create Initial Runtime Debug Info Implementation
dominikmascherbauer Jul 29, 2024
f9b8aef
Rework Runtime Debug Info Generation
dominikmascherbauer Sep 17, 2024
ce9464e
Implement the GDB JIT interface in System Java
dominikmascherbauer Oct 28, 2024
5938cc2
Refactor and rework gdb-debughelpers
dominikmascherbauer Oct 29, 2024
2207fea
Rework Debug Info Generation to create a Shared base for AOT and Runt…
dominikmascherbauer Nov 20, 2024
75e3ca0
Fix concurrency problems and some cleanup
dominikmascherbauer Dec 2, 2024
929f78a
Add some logging, Create more local info based on frame values, Bugfi…
dominikmascherbauer Dec 5, 2024
3dae547
Remove some constraints from logging in dwarf sections, Split up Debu…
dominikmascherbauer Dec 9, 2024
f111560
Cleanup, Refactoring and some Bugfixes
dominikmascherbauer Dec 10, 2024
68dee18
More Code Cleanup, Remove unused code, merge BFD Name providers
dominikmascherbauer Dec 12, 2024
d08b8e5
Code Cleanup and fix some issues with concurrency
dominikmascherbauer Dec 16, 2024
3b3f664
Add, update and fix copyright headers, fix style issues
dominikmascherbauer Dec 17, 2024
35a6d0f
Code cleanup and fix style issues
dominikmascherbauer Dec 19, 2024
93fc01a
Bugfix in handle release for GDB JIT compilation interface
dominikmascherbauer Jan 7, 2025
b4546fe
Updates and fixes of gdb-debughelpers for shared library supports
dominikmascherbauer Jan 10, 2025
a77914f
Add testing for runtime compilations
dominikmascherbauer Jan 10, 2025
2d16637
Update debug info provider to keep multi method info
dominikmascherbauer Jan 10, 2025
a0bb620
Fix style issue
dominikmascherbauer Jan 13, 2025
05969df
Bugfixes, fix style issue and add copyright headers
dominikmascherbauer Jan 14, 2025
7b88a7f
Bugfixes, Code Cleanup and fix style issue
dominikmascherbauer Jan 15, 2025
ce26fe1
Code cleanup, Add comments
dominikmascherbauer Jan 17, 2025
06ef6ab
Fix style issues
dominikmascherbauer Jan 17, 2025
c4c5130
Fix style issues, Add native image config for runtimedebuginfotest
dominikmascherbauer Jan 21, 2025
a6101eb
Add changelog entry
dominikmascherbauer Jan 21, 2025
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
Prev Previous commit
Next Next commit
Rework Debug Info Generation to create a Shared base for AOT and Runt…
…ime Debug Info

Rework debug entries

Remove separate Runtime Debuginfo sections
  • Loading branch information
dominikmascherbauer committed Jan 21, 2025
commit 2207fead084318318350058f789cc5e8568418ef
3 changes: 2 additions & 1 deletion substratevm/mx.substratevm/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -1948,8 +1948,9 @@
"com.oracle.objectfile",
"com.oracle.objectfile.io",
"com.oracle.objectfile.debuginfo",
"com.oracle.objectfile.debugentry",
"com.oracle.objectfile.debugentry.range",
"com.oracle.objectfile.macho",
"com.oracle.objectfile.runtime",
],

"requiresConcealed" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
import java.util.function.Consumer;
import java.util.stream.StreamSupport;

import com.oracle.objectfile.runtime.RuntimeDebugInfoProvider;
import com.oracle.objectfile.debuginfo.DebugInfoProvider;
import com.oracle.objectfile.elf.ELFObjectFile;
import com.oracle.objectfile.macho.MachOObjectFile;
Expand Down Expand Up @@ -220,16 +219,12 @@ public static Format getNativeFormat() {
}

private static ObjectFile getNativeObjectFile(int pageSize, boolean runtimeDebugInfoGeneration) {
switch (ObjectFile.getNativeFormat()) {
case ELF:
return new ELFObjectFile(pageSize, runtimeDebugInfoGeneration);
case MACH_O:
return new MachOObjectFile(pageSize);
case PECOFF:
return new PECoffObjectFile(pageSize);
default:
throw new AssertionError("Unreachable");
}
return switch (ObjectFile.getNativeFormat()) {
case ELF -> new ELFObjectFile(pageSize, runtimeDebugInfoGeneration);
case MACH_O -> new MachOObjectFile(pageSize);
case PECOFF -> new PECoffObjectFile(pageSize);
default -> throw new AssertionError("Unreachable");
};
}

public static ObjectFile getNativeObjectFile(int pageSize) {
Expand Down Expand Up @@ -1181,11 +1176,6 @@ public void installDebugInfo(@SuppressWarnings("unused") DebugInfoProvider debug
// do nothing by default
}


public void installRuntimeDebugInfo(@SuppressWarnings("unused") RuntimeDebugInfoProvider runtimeDebugInfoProvider) {
// do nothing by default
}

protected static Iterable<LayoutDecision> allDecisions(final Map<Element, LayoutDecisionMap> decisions) {
return () -> StreamSupport.stream(decisions.values().spliterator(), false)
.flatMap(layoutDecisionMap -> StreamSupport.stream(layoutDecisionMap.spliterator(), false)).iterator();
Expand Down Expand Up @@ -1834,7 +1824,7 @@ public final SymbolTable getOrCreateSymbolTable() {
* Temporary storage for a debug context installed in a nested scope under a call. to
* {@link #withDebugContext}
*/
private DebugContext debugContext = DebugContext.disabled(null);
protected DebugContext debugContext = DebugContext.disabled(null);

/**
* Allows a task to be executed with a debug context in a named subscope bound to the object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,54 +26,28 @@

package com.oracle.objectfile.debugentry;

import com.oracle.objectfile.debuginfo.DebugInfoProvider.DebugArrayTypeInfo;
import com.oracle.objectfile.debuginfo.DebugInfoProvider.DebugTypeInfo;
import com.oracle.objectfile.debuginfo.DebugInfoProvider.DebugTypeInfo.DebugTypeKind;

import jdk.graal.compiler.debug.DebugContext;
import jdk.vm.ci.meta.ResolvedJavaType;

public class ArrayTypeEntry extends StructureTypeEntry {
private TypeEntry elementType;
private int baseSize;
private int lengthOffset;

public ArrayTypeEntry(String typeName, int size) {
super(typeName, size);
}

@Override
public DebugTypeKind typeKind() {
return DebugTypeKind.ARRAY;
private final TypeEntry elementType;
private final LoaderEntry loader;

public ArrayTypeEntry(String typeName, int size, long classOffset, long typeSignature,
long compressedTypeSignature, long layoutTypeSignature, long compressedLayoutTypeSignature,
TypeEntry elementType, LoaderEntry loader) {
super(typeName, size, classOffset, typeSignature, compressedTypeSignature, layoutTypeSignature, compressedLayoutTypeSignature);
this.elementType = elementType;
this.loader = loader;
}

@Override
public void addDebugInfo(DebugInfoBase debugInfoBase, DebugTypeInfo debugTypeInfo, DebugContext debugContext) {
super.addDebugInfo(debugInfoBase, debugTypeInfo, debugContext);
DebugArrayTypeInfo debugArrayTypeInfo = (DebugArrayTypeInfo) debugTypeInfo;
ResolvedJavaType eltType = debugArrayTypeInfo.elementType();
this.elementType = debugInfoBase.lookupTypeEntry(eltType);
this.baseSize = debugArrayTypeInfo.baseSize();
this.lengthOffset = debugArrayTypeInfo.lengthOffset();
/* Add details of fields and field types */
debugArrayTypeInfo.fieldInfoProvider().forEach(debugFieldInfo -> this.processField(debugFieldInfo, debugInfoBase, debugContext));
if (debugContext.isLogEnabled()) {
debugContext.log("typename %s element type %s base size %d length offset %d%n", typeName, this.elementType.getTypeName(), baseSize, lengthOffset);
}
public boolean isArray() {
return true;
}

public TypeEntry getElementType() {
return elementType;
}

public String getLoaderId() {
TypeEntry type = elementType;
while (type.isArray()) {
type = ((ArrayTypeEntry) type).elementType;
}
if (type.isClass()) {
return ((ClassEntry) type).getLoaderId();
}
return "";
return (loader != null ? loader.loaderId() : "");
}
}
Loading