![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
Join Date: May 2005
Location: ma
Posts: 130
Rep Power: 4
![]() |
Curious about Debugging
Im a beginner programmer and interested in how people go about debugging their programs? Do you have a favorite debugging program. Is there much debugging you can do without the help of third party tools? Any other thoughts or comments on debugging? thanks for ay replies in advance.
|
|
|
|
|
|
#2 |
|
Hobbyist Programmer
Join Date: Jun 2005
Location: here
Posts: 137
Rep Power: 0
![]() |
I use gdb, but much less now.
I was turned on to a new tool called valgrind not to long ago. Very powerful tool. (Linux specific) I assume by your name the Linux issue will not be a problem. Also, I dont think it falls under the heading 'debugging', but unit testing is a major help when working on a project. You can do your own unit testing or use third party software, either way your end product will benefit.
__________________
"...and though our kids are blessed their parents let them shoulder all the blame." - The Quiet Things That No One Ever Knows [BrandNew] |
|
|
|
|
|
#3 |
|
Hobbyist Programmer
Join Date: May 2005
Location: ma
Posts: 130
Rep Power: 4
![]() |
yeah i've messed around with gdb a little bit but don't know much about debugging so i didn't know how to use it to it's full potential.
|
|
|
|
|
|
#4 |
|
Hobbyist Programmer
Join Date: Jun 2005
Location: here
Posts: 137
Rep Power: 0
![]() |
It's nice to know your way around a debugger (gdb, for example), but it is better to not have to rely on one.
![]() If you get teh basic functionality of a particular debugger down, stick with it. Each one has something appealing to someone (how's that for not saying much). But they will all do essentially the same thing. There is google for when you really need to hack at it...
__________________
"...and though our kids are blessed their parents let them shoulder all the blame." - The Quiet Things That No One Ever Knows [BrandNew] |
|
|
|
|
|
#5 |
|
Hobbyist Programmer
Join Date: May 2005
Location: ma
Posts: 130
Rep Power: 4
![]() |
i did open up kDbg and played with that a bit but read it is just a front end of gdb
|
|
|
|
|
|
#6 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Generally speaking, the state of your machine at any given point is the result of its immediately preceding history. Information is key. It lives in your variables and it's reflected in the status provided by functions you use. Ignore these at your peril. A debugger is a history-recording and information-gathering device. Pick a good tool and learn to use it. You'll be more productive.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#7 |
|
Programming Guru
![]() ![]() ![]() |
I use the compiler to catch my errors and gives me a line number, sometimes way off base, but it gives me a general idea. I haven't used a valid debugger since about 98, but I probably should pick up GDB or something... I agree with the production time being lost due to debugging.
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
|
|
#8 |
|
Expert Programmer
Join Date: Aug 2005
Location: Rotterdam, the Netherlands
Posts: 942
Rep Power: 4
![]() |
I always debug my code by hand... when something doesn't work, I first search where the error takes place, using this nice little macro:
#define dbg_brp() printf("Breakpoint at %s:%i", __FILE__, __LINE__); getchar()and after that i just print all the values the wrong code refers to. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|