mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-24 17:35:35 +02:00
From: Davasam, Sunil K
Sent: Monday, August 28, 2006 9:57 PM To: Treggiari, Leo; Sennikovsky, Mikhail Cc: Monteleone, Robert; Davasam, Sunil K Subject: Issue with CDT dwarf reader.. Hi, I found an issue with CDT dwarf reader. The method read_unsigned_leb128() contains a bug. Due to this bug, if the control reaches to this method, it goes in infinite loop and Eclipse hangs. This bug is exposed during the Intel Compiler integration testing into Eclipse/CDT. If the user tries to expand the debug binary (built by Intel Compiler) in C/C++ Projects view, Eclipse hangs. Even though I found this problem during the Intel Compiler integration testing, I think that the problem will appear when ever the control reaches this method. According to DWARF standard, algorithm to decode an unsigned LEB128 number: result = 0; shift = 0; size = number of bits in signed integer; while(true) { byte = next byte in input; result |= (low order 7 bits of byte << shift); shift += 7; /* sign bit of byte is second high order bit (0x40) */ if (high order bit of byte == 0) break; } if ((shift <size) && (sign bit of byte is set)) /* sign extend */ result |= - (1 << shift); -- But in the implementation, it is reading the same bits again and again. Here I attached a patch that fixes the problem. Please check in the patch to CDT. I hope you have permission to check in to cdt core package. The method is defined in the following location. Method: read_unsigned_leb128 Line : 213 File : utils/org/eclipse/cdt/utils/debug/dwarf/DwarfReader.java Package: org.eclipse.cdt.core Thanks & Regards, Sunil
This commit is contained in:
parent
937e249087
commit
778c379f88
1 changed files with 1 additions and 1 deletions
|
@ -218,7 +218,7 @@ public class DwarfReader extends Dwarf implements ISymbolReader {
|
|||
|
||||
m_leb128Size = 0;
|
||||
while (true) {
|
||||
b = (short) data[offset];
|
||||
b = (short) data[offset++];
|
||||
if (b == -1)
|
||||
break; //throw new IOException("no more data");
|
||||
m_leb128Size++;
|
||||
|
|
Loading…
Add table
Reference in a new issue