User forums > General (but related to Code::Blocks)

Console for testing purposes

<< < (2/2)

BlueHazzard:
Yes, you can use the evaluation of expressions during debugging, and as far as i know it is also possible to make function calls...
You can do this in two ways: start the debugger, open the watches window and type your expresseion in the watches window,
or you start the debugger, switch to the debugger tab in the log window at the bottom. There you can add any gdb command in the Command field at the bottom
for example:
https://stackoverflow.com/questions/1354731/how-to-evaluate-functions-in-gdb

but i do not think that the experience is very pleasant

vicent:

--- Quote from: BlueHazzard on December 14, 2021, 11:22:15 am ---Yes, you can use the evaluation of expressions during debugging, and as far as i know it is also possible to make function calls...
You can do this in two ways: start the debugger, open the watches window and type your expresseion in the watches window,
or you start the debugger, switch to the debugger tab in the log window at the bottom. There you can add any gdb command in the Command field at the bottom
for example:
https://stackoverflow.com/questions/1354731/how-to-evaluate-functions-in-gdb

but i do not think that the experience is very pleasant

--- End quote ---

Dear @BlueHazzard. The first solution worked for me, although it is not as 'practical' as a true debugging console.

I am curious about this: how do you test functions you have just programmed for the first time? I mean, how do you perform some callings to these new routines, just to check that they seem to be working OK, before continuing building more code based on them?

BlueHazzard:
For functions i have not written by myself: Read documentation, when possible read the code behind the function (if simple, or shit really hits the fan) and simply use and debug the function.
For functions i have written by myself: Read the code, write tests (so other functions, that test your function automatically) and actually use the function ;)

I never used "interactive" programming languages, beside matlab/octave in university and python at work (and it was not pleasant....)

Navigation

[0] Message Index

[*] Previous page

Go to full version