Thursday, April 5, 2012

GDB: Debugging old style

 With the rise of IDE and RAD tools as Eclipse or Visual Studio, tools that made the history of computer science tends to disappear. Probably this is cause by senior programmers prefer to address young programmers toward this IDE tools, more usable and easy. Sometimes, you don't have an IDE, or you don't want to create a project for some simple exercises but, you will need a debugger in either way.

GDB is the debugger. You can do everything you do in a IDE debugger using the command line and GDB. In fact, often IDE maps debugger buttons into GDB instructions and format the outcome properly.

Below you can find two link, the former is a short tutorial while the latter is the official guide to GDB.


http://www.cs.cmu.edu/~gilpin/tutorial/

The official Guide can be found @

http://sourceware.org/gdb/current/onlinedocs/gdb.pdf.gz

P.s. Yesterday i was traveling and a guy next to me was programming an IPhone APP. He was stucked on an error, trying to resolve it using print instruction or logging. Because XCode uses GDB for debugging, I said to him to run a backtrace command in the GDB to see what's going on and I gave him the guide you can find here. I told him to read just the Sample session chapter (around 5-6 pages) to understand how to use minimally GDB.
He doesn't have listen my advice and, for not read 5-6 pages, he spend more than an hour on that bug using his method and probably he will continue to use it.

Sometimes you have to put aside proud and listen other people because anyone can teach you something because everyone have a different view of  the same problem.

No comments:

Post a Comment