1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-21 21:52:10 +02:00

Bug 530194: Don't assume that dwarf headers have valid positions

In cases where the dwarf headers say there is data at a position that
does not exist, the position call throws an exception. Prior to this
patch that exception, being a runtime exception, can cause the whole
IDE to exit in the case that the standalone debugger is used.

Change-Id: I7e12667890490a49ecd63785ea2cc7c02c08679d
This commit is contained in:
Jonah Graham 2020-11-03 10:33:09 -05:00
parent 35530c50ef
commit 213088e43a

View file

@ -298,7 +298,11 @@ public class DwarfReader extends Dwarf implements ISymbolReader, ICompileOptions
ByteBuffer data = dwarfSections.get(DWARF_DEBUG_LINE);
if (data != null) {
try {
data.position(cuStmtList);
try {
data.position(cuStmtList);
} catch (IllegalArgumentException e) {
throw new IOException(CCorePlugin.getResourceString("Util.exception.noData")); //$NON-NLS-1$
}
/* Read line table header:
*
@ -384,7 +388,7 @@ public class DwarfReader extends Dwarf implements ISymbolReader, ICompileOptions
leb128 = read_unsigned_leb128(data);
}
} catch (IOException e) {
e.printStackTrace();
CCorePlugin.log("Failed to parse part of dwarf header", e); //$NON-NLS-1$
}
}
}