mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 01:39:21 +02:00
GP-0 improved dwarf source line exception handling
This commit is contained in:
parent
e0d247ca86
commit
47468598dd
2 changed files with 7 additions and 3 deletions
|
@ -305,8 +305,8 @@ public class DWARFImporter {
|
|||
try {
|
||||
sourceManager.addSourceMapEntry(source, sfa.lineNum(), addr, length);
|
||||
}
|
||||
catch (AddressOverflowException e) {
|
||||
String errorString = "AddressOverflowException for source map entry %s %d %s %x %d"
|
||||
catch (AddressOverflowException | IllegalArgumentException e) {
|
||||
String errorString = e.getClass().getName() + " for source map entry %s %d %s %x %d"
|
||||
.formatted(source.getFilename(), sfa.lineNum(), addr.toString(),
|
||||
sfa.address(), length);
|
||||
if (numSourceLineErrorReports++ < MAX_NUM_SOURCE_LINE_ERROR_REPORTS) {
|
||||
|
|
|
@ -403,14 +403,18 @@ public class GoFuncData implements StructureMarkup<GoFuncData> {
|
|||
Address startAddr = programContext.getCodeAddress(startpc);
|
||||
long len = lineEval.getPC() - startpc;
|
||||
|
||||
try {
|
||||
SourceFile sourceFile = new SourceFile(fileName);
|
||||
try {
|
||||
|
||||
sfman.addSourceFile(sourceFile);
|
||||
sfman.addSourceMapEntry(sourceFile, lineNum, startAddr, len);
|
||||
}
|
||||
catch (AddressOverflowException e) {
|
||||
Msg.error(this, "Failed to add source file mapping", e);
|
||||
}
|
||||
catch (IllegalArgumentException e) {
|
||||
// overlapping entry
|
||||
}
|
||||
}
|
||||
}
|
||||
startpc = lineEval.getPC();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue