I would like to do something like a simple and quick general console debugger. This small lib should be embedded to the main program.
So I would like to do stuff like this while running the program in console mode:
"input: print i" "output: 15.53" "input: set color 255" "input: print color" "output: 255"
And both "i" and "color" would be pre-declared variables in-code. Its not an interpreter, just a handy way to check and modify variables contents.
GDB isn't a valid solution for my problem since I will use this code for computer graphics programs that I will code, so it need to be able to run in "Release Mode".
One very simple solution I have found so far is to just make a list of a structs that contains a void pointer, the pointer data type and a string which represents the variable name. But it wouldn't be as automatic as I imagine it could be.
Is there any way to convert a string, lets say "color", to obtain the address of the integer variable named color in C++? If not, how could I solve the problem?