I am new to debugging and I need to how to use the debugger in geany IDE. Is there any documentation or a video available in the internet related to the geany debugger? I have surfed everywhere but I couldn't find anything understandable. Can anyone help me out?
3 Answers
I have come across this problem myself.
- Compiler: gcc
- Debugger: gdb
- Editor: geany
Assuming you have installed gcc
and gdb
by this.
Install gcc and gdb
sudo apt install gcc gdb
To install geany:
sudo apt install geany
To install the plugins for geany:
sudo apt install geany-plugins
Restart geany if open now.
To activate the debugger in geany: menu->tools->plugin manager , checkbox the debugger.
Change the build commands to include the -g flag:
menu->build->build commands
Set the compile command to:
gcc -g -Wall -c "%f"
Set the build command to:
gcc -g -Wall -o "%e" "%f"
And now you can set breakpoints in your code by clicking next to the line numbers. You will see a red square.
In the menu->view->show message window You will have a tab called debug.
Click the debug tab then click the target tab.
Choose your target(if you build "example.c" and set output to "example" which you would normally run with "./example" you would choose "example" as target.
On the right side of that window you can start the debugging.
-
2I've followed those instructions but I don't have any tab called "debug".– shahar_mMar 6, 2017 at 6:49
-
-
I don't see debug option in plugin manager even after
geany-plugins
installation. Dec 23, 2020 at 7:28 -
@AbinashDash OK, geany-debugger plugins is not exist in some distro like my debian 10. I compile it from source to use it. geany.org/download/releases– EsmaeelEJan 22, 2021 at 14:15
-
Hi if you right click on the messages tab it comes up with a list with it on. @shahar_m Jun 5, 2023 at 20:53
As stated in the documentation most the the controls offered by this plugin are pretty standards (Breakpoints, Watches).
However this page may help you to start using the debugger: http://geanydbg.sourceforge.net/walkthrough.htm.
-
I have some experience in the Dev C++ debugger and I know how breakpoints and watches work but I can't understand what are environmental variable,Target and autos. I followed the procedure here http://geanydbg.sourceforge.net/walkthrough.htm but it didn’t work. Apr 26, 2014 at 11:37
OK I found something that works here in this forum but still the step into button is still a little buggy :P Will update when I get it correct.