Bug 436349 - Local variables incorrectly show as "returned" in variables view
Summary: Local variables incorrectly show as "returned" in variables view
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug (show other bugs)
Version: 8.4.0   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: 8.4.0   Edit
Assignee: Marc Khouzam CLA
QA Contact: Doug Schaefer CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-02 07:01 EDT by William Riley CLA
Modified: 2014-06-02 11:29 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description William Riley CLA 2014-06-02 07:01:50 EDT
All local variables and function parameters are shown as return values (e.g. "(test() returned)p1") after performing step return from a method with no return value.

e.g. In the code shown below setting a breakpoint as indicated, running to it, performing a step return. After that all variables are prefixed "(test() returned)"

void test(int p1)
{
	int testVar = p1;
	i = testVar + 3; //Breakpoint Here
}

int main(void)
{
    int mainVar = 0;
    while (1) {
        mainVar++;
    	i++;
    	j--;
    	test(i);
    }
  return 0;
}

Using 8.4.0 RC3 (8.4.0.201405261845) on Windows with MinGW & GDB Hardware Debugging.
Comment 1 Marc Khouzam CLA 2014-06-02 09:15:17 EDT
Wow major bug!  I can reproduce it.  I'll work on it today.

Thanks William!
Comment 2 Marc Khouzam CLA 2014-06-02 09:43:40 EDT
Fix:
  https://git.eclipse.org/r/27721

William are you able to try it out?
I'll commit in a couple of hours.
Comment 3 William Riley CLA 2014-06-02 09:57:13 EDT
(In reply to Marc Khouzam from comment #2)
> Fix:
>   https://git.eclipse.org/r/27721
> 
> William are you able to try it out?
> I'll commit in a couple of hours.

Just tried it and that fixes it.
Comment 4 Marc Khouzam CLA 2014-06-02 10:48:59 EDT
(In reply to William Riley from comment #3)
> (In reply to Marc Khouzam from comment #2)
> > Fix:
> >   https://git.eclipse.org/r/27721
> > 
> > William are you able to try it out?
> > I'll commit in a couple of hours.
> 
> Just tried it and that fixes it.

Perfect.  Thanks a lot for this.
Comment 6 Marc Khouzam CLA 2014-06-02 11:29:49 EDT
I've added a JUnit test to verify this case:
  https://git.eclipse.org/r/27735

It is a minor change and I'll commit to master once the build succeeds.