'Codeblocks Debugging - variables not showing in watches window
I have just started using codeblocks and have set up my UI to have the watches window in the bottom right of UI. I set my break point and run my program in debug mode. I can step through the lines of code with the buttons on my menu toolbar but there are no variables showing in my watches window. I read somewhere that you can right click and add global variables, but I also don't have that functionality. All I have in my watches window is a button that when I click a message pops up reading:
"Click the button to see the value. Hold ctrl to see the raw output string returned by the debugger. Hold shift to see the debugging representation of the CBWatch object."
This button doesn't even seem to do anything either though.
How do I get varibles to display?
Solution 1:[1]
When you run the debug mode (the one activated by the red play button). The application will execute as usually until it finds a breakpoint. After that breakpoint you must click the 'step forward' buttons. If you want to 'watch' the behaviour of variables, then you should click on the 'Debuggin window' button (the one with a bug which is near to the 'stop debugger')
Then activate the 'watches' and a new window will appear. In this window you can even add specific variables you want to track.
Solution 2:[2]
I am assuming you can see the watches window already. All you need to do is type the variable name in the grid(inside the window).Only the variable name, the rest(data type etc) is automatically detected.
Solution 3:[3]
Go to Debug -> Debugging windows -> Watches
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Nana89 |
| Solution 2 | Dèsjardins |
| Solution 3 | Minh Trung |
