Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Sep 8th, 2005, 6:47 PM   #1
linuxpimp20
Hobbyist Programmer
 
Join Date: May 2005
Location: ma
Posts: 130
Rep Power: 4 linuxpimp20 is on a distinguished road
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.
linuxpimp20 is offline   Reply With Quote
Old Sep 8th, 2005, 7:24 PM   #2
L7Sqr
Hobbyist Programmer
 
Join Date: Jun 2005
Location: here
Posts: 137
Rep Power: 0 L7Sqr is an unknown quantity at this point
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]
L7Sqr is offline   Reply With Quote
Old Sep 8th, 2005, 7:51 PM   #3
linuxpimp20
Hobbyist Programmer
 
Join Date: May 2005
Location: ma
Posts: 130
Rep Power: 4 linuxpimp20 is on a distinguished road
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.
linuxpimp20 is offline   Reply With Quote
Old Sep 8th, 2005, 9:47 PM   #4
L7Sqr
Hobbyist Programmer
 
Join Date: Jun 2005
Location: here
Posts: 137
Rep Power: 0 L7Sqr is an unknown quantity at this point
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]
L7Sqr is offline   Reply With Quote
Old Sep 9th, 2005, 6:14 AM   #5
linuxpimp20
Hobbyist Programmer
 
Join Date: May 2005
Location: ma
Posts: 130
Rep Power: 4 linuxpimp20 is on a distinguished road
i did open up kDbg and played with that a bit but read it is just a front end of gdb
linuxpimp20 is offline   Reply With Quote
Old Sep 9th, 2005, 7:07 AM   #6
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
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
DaWei is offline   Reply With Quote
Old Sep 9th, 2005, 8:37 AM   #7
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
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."
Infinite Recursion is offline   Reply With Quote
Old Sep 9th, 2005, 8:55 AM   #8
Polyphemus_
Expert Programmer
 
Polyphemus_'s Avatar
 
Join Date: Aug 2005
Location: Rotterdam, the Netherlands
Posts: 942
Rep Power: 4 Polyphemus_ is on a distinguished road
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.
Polyphemus_ is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 9:34 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC