Menu

#444 problems with watches

open
nobody
None
5
2012-09-26
2004-11-18
aditsu
No

I have this program:

include <iostream>

include<vector>

using namespace std;

void f()
{
string s="hi";
cout<<s<<endl;
}

int main()
{
string s="abc";
f();
}

I put a breakpoint on the first line in main, start
debugging, and when it stops there, I watch "s" (by
hovering it with the mouse). After I press next, I can
see "abc" in the debug pane. Perfect so far.
Then I press step into, and I can still see "abc",
instead of the local "hi". After finishing the
execution, I start debugging again. Now I can just see
"not found in current context" and "?" in the debug pane.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.