Last updated on August 29, 2020 by Adrien Brochard
If you read my post on GDB, you know how important and useful a debugger I think can be for a C/C++ program. However, if a command line debugger like GDB sounds more like a problem than a solution to you, you might be more interested in Nemiver. Nemiver is a GTK+-based standalone graphical debugger for C/C++ programs, using GDB as its back-end. Admirable for its speed and stability, Nemiver is a very reliable debugger filled with goodies.
For Debian based distributions, it should be pretty straightforward:
$ sudo apt-get install nemiver
For Arch Linux:
$ sudo pacman -S nemiver
$ sudo yum install nemiver
If you prefer compiling yourself, the latest sources are available from GNOME website.
As a bonus, it integrates very well with the GNOME environment.
Start Nemiver with the command:
You can also summon it with an executable with:
$ nemiver [path to executable to debug]
Note that Nemiver will be much more helpful if the executable is compiled in debug mode (the
-g flag with
A good thing is that Nemiver is really fast to load, so you should instantly see the main screen in the default layout.
By default, a breakpoint has been placed in the first line of the main function. This gives you the time to recognize the basic debugger functions:
But maybe my personal favorite is the option "
Run to cursor" which makes the program run until a precise line under your cursor, and is by default mapped to
Next, the breakpoints are also easy to use. The quick way to lay a breakpoint at a line is using
F8. But Nemiver also has a more complex menu under
Debug which allows you to set up a breakpoint at a particular function, line number, location of binary file, or even at an event like an exception, a fork, or an exec.
You can also watch a variable by tracking it. In
Debug you can inspect an expression by giving its name and examining it. It is then possible to add it to the list of controlled variable for easy access. This is probably one of the most useful aspects as I have never been a huge fan of hovering over a variable to get its value. Note that hovering does work though. And to make it even better, Nemiver is capable of watching a
struct, and giving you the values of all the member variables.
Talking about easy access to information, I also really appreciate the layout of the program. By default, the code is in the upper half and the tabs in the lower part. This grants you access to a terminal for output, a context tracker, a breakpoints list, register addresses, memory map, and variable control. But note that under
Layout you can select different layouts, including a dynamic one for you to modify.
And naturally, once you set up all your breakpoints, watch-points, and layout, you can save your session under
File for easy retrieval in case you close Nemiver.
So far, we talked about the basic features of Nemiver, i.e., what you need to get started and debug simple programs immediately. If you have more advanced needs, and especially more complex programs, you might be more interested in some of these features mentioned here.
Nemiver allows you to attach to a running process for debugging. Under the
File menu, you can filter the list of running processes, and connect to a process.
Nemiver supports remote-debugging, where you set up a lightweight debug server on a remote machine, and launch Nemiver from another machine to debug a remote target hosted by the debug server. Remote debugging can be useful if you cannot run full-fledged Nemiver or GDB on the remote machine for some reason. Under the
File menu, specify the binary, shared library location, and the address and port.
In case you compiled Nemiver yourself, you can specify a new location for GDB under
Debug. This option can be useful if you want to use a custom version of GDB in Nemiver for some reason.
Nemiver is capable of following a child or parent process in case your program forks. To enable this feature, go to
To conclude, Nemiver is probably my favorite program for debugging without an IDE. It even beats GDB in my opinion, and command line programs generally have a good grip on me. So if you have never used it, I really recommend it. I can only congratulate the team behind it for giving us such a reliable and stable program.
What do you think of Nemiver? Would you consider it for standalone debugging? Or do you still stick to an IDE? Let us know in the comments.