Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: hongxing on October 18, 2005, 02:03:14 am

Title: how to see the value of local variable when debugging?
Post by: hongxing on October 18, 2005, 02:03:14 am
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!

Title: Re: how to see the value of local variable when debugging?
Post by: Ceniza on October 18, 2005, 03:41:03 am
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.
Title: Re: how to see the value of local variable when debugging?
Post by: 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!
Title: Re: how to see the value of local variable when debugging?
Post by: sethjackson on October 18, 2005, 05:03:02 pm
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'.