News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

how to see the value of local variable when debugging?

Started by hongxing, October 18, 2005, 02:03:14 AM

Previous topic - Next topic

hongxing

I add my local variable to watch window, when debugging, how to see its valuse?
my code is:
int main()
{
    int i;
    ...
    i++;  // <----debug to here, how to see value of i ?
    ...
}

thanks!


Ceniza

Debug -> Edit watches... -> Add

In the dialog put the name of the variable you want to "watch" and click OK.

Now, in the Management dock click on the Watches tab and it'll be there with its value.

hongxing

I added, but when debugging, can not see its value in the wach window.
my environment is suse linux enterprise 9, app type is console app.

thanks!

sethjackson

Quote from: hongxing on October 18, 2005, 11:38:13 AM
I added, but when debugging, can not see its value in the wach window.
my environment is suse linux enterprise 9, app type is console app.

thanks!

Well you could position the cursor right by the variable. Then right click and select (while you are running the debugger) Watch 'variable_name'.