tracing

hi everybody,,,
iam programming c++ under linux \ ubuntu,,
i use the terminal to compile and execute my programes by using :
1
2
make filename.cpp
./filename


i have some problem with values,, can i trace these values by using terminal only??

THANKS IN ADVANCE

:)
what values?? what kind of tracing you want??
are you talking about debug logging by your programming?
i want to watch values of variables by traceing each line ,, this feature i used to use in microsoft visual studio ..................

for example :
1
2
int x=0;
x=2;


after compilation finish ,, and i can execute the code line by line in a way that i can see the variable (x) change from value 0 to 2


i hope it is clear now,,,

thanks :)
i don't know if my reply will sent twice !!!!!!!!!!!!! anyway

i want to trace the code (after compilation it ) line by line,, in such way that i can watch value for each variable after executing that line,,
for example :
1
2
int x=0;
x=2;


after compilation this code ,, can i execute it by tracing the lines,, so i can watch the varaible ( x ) changing from ( 0 ) to ( 2 ).....

this feature is allowed in microsoft visual studio,,,,,,,,,,,,,,,,,,,,,

i hope this was clear and thanks :)
aah.. you mean you want to debug your code???

compile with -ggdb and you will be able to debug using gdb.

g++ -ggdb file.cpp

after compilation, do gdb a.out or whatever is the output file name.

study about gdb.



thanks :)
You can also use just -g instead of -ggdb
yes you are correct..

-ggdb give some other debugging options/formats also.. but -g option will be appropriate..
Topic archived. No new replies allowed.