Kdbg is a graphical debugger – more precisely, it is the graphical interface for the excellent gdb debugger. I like a lot Microsoft Visual C++ 6.0 for its debugging abilities but Kdbg is just as good. So how do we use it?
First you need to compile your c/c++ source with “-g”(this is very important). E.g
gcc test.c -g
where test.c is the name of your source. You can after that odd your usual “-o” flags … as usual (this is meant to be a simple simple guide, so I’ll skip whatever is not required)
Next, invoke the Kdbg debugger as follows:
OnceKdbg is open, set your breakpoints on the lines required and click start and step over, step into,… as appropriate. It works like a charm.
For those who don’t know, KDevelop is a very nice IDE and according to me even better than Ms Visual C++.
So if you use KDevelop , debugging should be pretty easy – it’s done by itself. However, for Input/Output console applications, there’s a small twist. By default, if there’s some input to be done, the debugger will halt and won’t move even if u bang your head against it. The solution is quite simple though.
Go to: Project -> Project Options -> Debugger tab and check “Enable separate terminal for application IO”.
That should do it.