User forums > Using Code::Blocks

how to see the value of local variable when debugging?

(1/1)

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!

--- End quote ---

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

Navigation

[0] Message Index

Go to full version