1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-02 14:45:25 +02:00
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
..
org.eclipse.cdt.core From: Davasam, Sunil K 2006-08-31 10:25:42 +00:00
org.eclipse.cdt.core.aix Updated copyright dates to reflect latest in CVS. 2006-06-23 17:52:45 +00:00
org.eclipse.cdt.core.linux Updated copyright dates to reflect latest in CVS. 2006-06-23 17:52:45 +00:00
org.eclipse.cdt.core.linux.ia64 Updated the about.html files. 2006-05-24 13:51:50 +00:00
org.eclipse.cdt.core.linux.ppc Updated the about.html files. 2006-05-24 13:51:50 +00:00
org.eclipse.cdt.core.linux.x86 Updated the about.html files. 2006-05-24 13:51:50 +00:00
org.eclipse.cdt.core.linux.x86_64 Updated the about.html files. 2006-05-24 13:51:50 +00:00
org.eclipse.cdt.core.macosx Updated the about.html files. 2006-05-24 13:51:50 +00:00
org.eclipse.cdt.core.qnx Updated copyright dates to reflect latest in CVS. 2006-06-23 17:52:45 +00:00
org.eclipse.cdt.core.solaris Updated copyright dates to reflect latest in CVS. 2006-06-23 17:52:45 +00:00
org.eclipse.cdt.core.tests Added support for nested classes. Changed the way member owners are done. 2006-08-02 14:36:41 +00:00
org.eclipse.cdt.core.win32 Updated copyright dates to reflect latest in CVS. 2006-06-23 17:52:45 +00:00
org.eclipse.cdt.ui Add C refactoring action group to common navigator 2006-08-30 10:34:40 +00:00
org.eclipse.cdt.ui.tests Add testsuite for package 'viewsupport' to automated ui-tests. 2006-08-31 08:46:27 +00:00