GP-0 improved dwarf source line exception handling

This commit is contained in:
James 2025-01-30 02:20:43 +00:00
parent e0d247ca86
commit 47468598dd
2 changed files with 7 additions and 3 deletions

View file

@ -305,8 +305,8 @@ public class DWARFImporter {
try { try {
sourceManager.addSourceMapEntry(source, sfa.lineNum(), addr, length); sourceManager.addSourceMapEntry(source, sfa.lineNum(), addr, length);
} }
catch (AddressOverflowException e) { catch (AddressOverflowException | IllegalArgumentException e) {
String errorString = "AddressOverflowException for source map entry %s %d %s %x %d" String errorString = e.getClass().getName() + " for source map entry %s %d %s %x %d"
.formatted(source.getFilename(), sfa.lineNum(), addr.toString(), .formatted(source.getFilename(), sfa.lineNum(), addr.toString(),
sfa.address(), length); sfa.address(), length);
if (numSourceLineErrorReports++ < MAX_NUM_SOURCE_LINE_ERROR_REPORTS) { if (numSourceLineErrorReports++ < MAX_NUM_SOURCE_LINE_ERROR_REPORTS) {

View file

@ -403,14 +403,18 @@ public class GoFuncData implements StructureMarkup<GoFuncData> {
Address startAddr = programContext.getCodeAddress(startpc); Address startAddr = programContext.getCodeAddress(startpc);
long len = lineEval.getPC() - startpc; long len = lineEval.getPC() - startpc;
SourceFile sourceFile = new SourceFile(fileName);
try { try {
SourceFile sourceFile = new SourceFile(fileName);
sfman.addSourceFile(sourceFile); sfman.addSourceFile(sourceFile);
sfman.addSourceMapEntry(sourceFile, lineNum, startAddr, len); sfman.addSourceMapEntry(sourceFile, lineNum, startAddr, len);
} }
catch (AddressOverflowException e) { catch (AddressOverflowException e) {
Msg.error(this, "Failed to add source file mapping", e); Msg.error(this, "Failed to add source file mapping", e);
} }
catch (IllegalArgumentException e) {
// overlapping entry
}
} }
} }
startpc = lineEval.getPC(); startpc = lineEval.getPC();