Skip to content

Commit 2c440e8

Browse files
committed
Fix file indexes in ClassEntry for substituted methods
1 parent ea5c36b commit 2c440e8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfInfoSectionImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ private int writeMethodDeclaration(DebugContext context, ClassEntry classEntry,
682682
String name = uniqueDebugString(range.getMethodName());
683683
log(context, " [0x%08x] name 0x%x (%s)", pos, debugStringIndex(name), name);
684684
pos = writeAttrStrp(name, buffer, pos);
685-
int fileIdx = classEntry.localFilesIdx();
685+
int fileIdx = classEntry.localFilesIdx(range.getFileEntry());
686686
log(context, " [0x%08x] file 0x%x (%s)", pos, fileIdx, range.getFileEntry().getFullName());
687687
pos = writeAttrData2((short) fileIdx, buffer, pos);
688688
String returnTypeName = range.getMethodReturnTypeName();

substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfLineSectionImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,6 @@ private int writeLineNumberTable(DebugContext context, ClassEntry classEntry, by
436436
String primaryClassName = classEntry.getTypeName();
437437
String primaryFileName = classEntry.getFileName();
438438
String file = primaryFileName;
439-
int fileIdx = 1;
440439
log(context, " [0x%08x] primary class %s", pos, primaryClassName);
441440
log(context, " [0x%08x] primary file %s", pos, primaryFileName);
442441
for (PrimaryEntry primaryEntry : classEntry.getPrimaryEntries()) {
@@ -464,6 +463,7 @@ private int writeLineNumberTable(DebugContext context, ClassEntry classEntry, by
464463
/*
465464
* Initialize and write a row for the start of the primary method.
466465
*/
466+
int fileIdx = classEntry.localFilesIdx(primaryRange.getFileEntry());
467467
pos = writeSetFileOp(context, file, fileIdx, buffer, pos);
468468
pos = writeSetBasicBlockOp(context, buffer, pos);
469469
/*

0 commit comments

Comments
 (0)