问题
I have switched to Linux Mint from Windows 7 and now I am using Geany to write C programs in it.
As I mentioned in the question that I want to execute my program line by line in Geany. During execution is there a way where I can see the value of variables in Geany?.
I am using Geany because it's light weight and it has an integrated terminal, compiler, scribble, etc. which is very simple to use...
回答1:
Install Geany Debugger Plugin and then you can easily execute your program line by line.
Step 1:
Install Optional Add Ons:
- Graphical GDB Front end for geany
set of plugins for geany
from Ubuntu Software centre or anything you have which do similar job
2.Step 2:
Go to Main Menu
> Tools
> Plugin Manager
3.Step 3: Set Debugger to active by ticking the checkbox and then click O.K.
Now, you may see Debug option at the bottom of geany:
4.Step 4: Now, I think rest of the debugging is easy - just select the file and load it in the debugger and there you'll have all the options including breakpoints and executing line by line.
Note:
Don't forget that now you have got debug terminal, you can straight away use any of the gdb's (I am thinking you have GDB debugger) commmands. By the way, don't forget to check out the reference links for complete detail (especially the 2nd and 5th).
Reference:
1. http://plugins.geany.org/debugger.html
2. http://ubuntuforums.org/showthread.php?t=1400668
3. http://betterexplained.com/articles/debugging-with-gdb/
4. Line by line c - c++ code debugging in Linux ubuntu
5. http://www.yolinux.com/TUTORIALS/GDB-Commands.html
来源:https://stackoverflow.com/questions/31635366/how-to-execute-my-c-program-line-by-line-in-geany-as-in-turbo-c