Mail Archives: djgpp/1997/02/24/23:37:17
Alan Wilson wrote:
>
> I'm fairly new to DJGPP and programming and I've seen several posts
> regarding something called a debugger. What is a debugger? And what does it
> do? Does DJGPP come with one? Rhide? EMACS? Is it necessary to use one?
>
> If anyone could answer these questions, it would clear up alot of things
> with me. Thanks!
>
> Alan Wilson
A debugger is tool for (as the name implies) removing bugs from
programs.
Normally, if there is a problem with a program, you watch it crash, and
wonder what went wrong. Some people (myself included) put printf()
statements everywhere to figure out exactly what line crashed, and why.
Debuggers are much better. You can load your compiled code and "step"
through it, watching the values of variables and keeping track of
everything
that is happening, as the program runs. This allows errors to be caught
very easily.
In addition to the DJGPP compiler, there is also a package called GDB,
which is the Gnu Debugger. (Available from the same place.) This is not
the easiest debugger to use if you've never done anything like this
before.
A better option, (though I've never used it) is RHIDE. RHIDE is actually
a "devlopment environment." It handles editing, compiling (by calling
the
compiler) and other tasks. It also has integrated debugging features.
It may not be necessary to use a debugger for simple programs, but once
you are writing reasonably complex software, simple techniques no longer
work. (for example: I just finished writing a UNIX shell, which is
similar
to COMMAND.COM in DOS. It reads input from the user, and then starts
other
programs etc... The debugger was necessary to catch subtle logic errors
I
had made.)
Hope this helps.
Brian
- Raw text -