Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 329152

Summary: Debug apparently out of sync
Product: [Tools] CDT Reporter: psdasilva
Component: cdt-debugAssignee: cdt-debug-inbox <cdt-debug-inbox>
Status: RESOLVED NOT_ECLIPSE QA Contact: Ken Ryall <ken.ryall>
Severity: normal    
Priority: P3 CC: cdtdoug, jamesblackburn+eclipse, pawel.1.piech
Version: 8.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Snapshot before stepping.
none
After stepping ("if" condition failled) none

Description psdasilva CLA 2010-10-31 00:20:15 EDT
Build Identifier: 20100917-0705

In the attached fragment of code condition at line 846. So, debugger should go to line 856 or perhaps 852 but it goes to line 851! Inserting dummy statements before 851 debugger always goes to the last line before '}'.

This seems to begin to happen after upgrading gcc to 4.4.4 or eclipse from 3.5.1 to 3.5.2. Not sure.

I am using:
Gentoo Linux;
gcc 4.4.4
gdb 7.0.1 (I have also tried with 7.2)
eclipse cdt current version.


Reproducible: Always
Comment 1 psdasilva CLA 2010-10-31 00:21:30 EDT
Created attachment 182108 [details]
Snapshot before stepping.
Comment 2 psdasilva CLA 2010-10-31 00:23:02 EDT
Created attachment 182109 [details]
After stepping ("if" condition failled)
Comment 3 psdasilva CLA 2010-10-31 00:25:33 EDT
(In reply to comment #0)

> In the attached fragment of code condition at line 846.
Should be:
In the attached fragment of code, condition at line 846 fails.
Comment 4 James Blackburn CLA 2011-02-24 09:34:19 EST
You're debugging optimised code.  The compiler's optimiser reorders instructions so that there's no longer a one-to-one correspondence with the C.  Build -O0 if you want an easier debugging experience.