1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-25 18:05:33 +02:00
cdt/core/org.eclipse.cdt.core
Oleg Krasilnikov 778c379f88 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
2006-08-31 10:25:42 +00:00
..
.settings Fix preferences to use -source 1.4 2006-07-03 17:52:34 +00:00
browser fix copyrights 2006-08-25 19:46:29 +00:00
META-INF Propogate PDOM changes to support search down the PDOM hierarchy. 2006-08-25 01:46:32 +00:00
model/org/eclipse/cdt ICElements except ITranslationUnit, ICFolder, ... do not adapt to IResource any more. 2006-08-23 14:50:51 +00:00
parser/org/eclipse/cdt Propogate PDOM changes to support search down the PDOM hierarchy. 2006-08-25 01:46:32 +00:00
schema Integrated indexing into PDOM. Also change the names of a couple of things, such as PDOM which used to be PDOMDatabase. Cleaned up the indexing setting so that it is a ProjectScope preference instead of a ICExtension. Conversion should happen automagically. 2006-03-30 21:59:22 +00:00
src/org/eclipse/cdt Make the warning vs error discrimination pick up on warning like keywords 2006-08-17 21:19:04 +00:00
utils/org/eclipse/cdt From: Davasam, Sunil K 2006-08-31 10:25:42 +00:00
.classpath Add position trackers, includes test cases. 2006-07-03 13:01:05 +00:00
.cvsignore undo accidental commit 2004-05-28 14:58:41 +00:00
.options Added tracing option for PDOM timing so it doesn't print it out all the time. 2005-12-01 23:01:58 +00:00
.project
about.html Updated the about.html files. 2006-05-24 13:51:50 +00:00
build.properties update copyrights 2006-06-14 12:16:17 +00:00
ChangeLog Make the warning vs error discrimination pick up on warning like keywords 2006-08-17 21:19:04 +00:00
ChangeLog-2003 Separate the entries from 2003 to 2004. 2004-01-24 20:46:18 +00:00
plugin.properties update copyrights 2006-06-14 12:16:17 +00:00
plugin.xml Fix for 132201, prefer content types with a case-sensitive match. 2006-07-11 15:08:57 +00:00