Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 329152 - Debug apparently out of sync
Summary: Debug apparently out of sync
Status: RESOLVED NOT_ECLIPSE
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug (show other bugs)
Version: 8.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: cdt-debug-inbox@eclipse.org CLA
QA Contact: Ken Ryall CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-31 00:20 EDT by psdasilva CLA
Modified: 2011-02-24 09:34 EST (History)
3 users (show)

See Also:


Attachments
Snapshot before stepping. (49.05 KB, image/jpeg)
2010-10-31 00:21 EDT, psdasilva CLA
no flags Details
After stepping ("if" condition failled) (51.52 KB, image/jpeg)
2010-10-31 00:23 EDT, psdasilva CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.