Programming Forums
User Name Password Register
 

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

Reply
 
Thread Tools Display Modes
Old Mar 3rd, 2006, 12:12 PM   #1
crazykid48x
Programmer
 
crazykid48x's Avatar
 
Join Date: Apr 2005
Posts: 96
Rep Power: 4 crazykid48x is on a distinguished road
Debugger help (devc++)

Im trying to use a debugger for the first time. It seemed like a good idea because I was stuck on a kinda complex problem while making a game. First of all the program runs fine aside from the logic errors but everytime I try to step over my SDL_Init function I get this error: "An Access Violation (Segment Fault) raised in your program.". I really need some help on this one.
__________________
I had my portable CD player, and took it in the bathroom with me while I went to pee. And the second I whipped my penis out, the theme song to 'Rocky' started playing. I've never felt more manly than in that moment.
crazykid48x is offline   Reply With Quote
Old Mar 3rd, 2006, 12:26 PM   #2
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Step through it; an init function probably has some touchy stuff in it, maybe you'll get a clue. The Dev-Cpp debugger is not as robust as, say, VC++.
__________________
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 Mar 3rd, 2006, 12:58 PM   #3
crazykid48x
Programmer
 
crazykid48x's Avatar
 
Join Date: Apr 2005
Posts: 96
Rep Power: 4 crazykid48x is on a distinguished road
When I tried to step into it I got the same error. Mabey I should download a different debugger? Any suggestions?
__________________
I had my portable CD player, and took it in the bathroom with me while I went to pee. And the second I whipped my penis out, the theme song to 'Rocky' started playing. I've never felt more manly than in that moment.
crazykid48x is offline   Reply With Quote
Old Mar 3rd, 2006, 2:32 PM   #4
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
You say the program "runs fine" otherwise? It's still possible you have some problems. Consider that you have a buffer overflow or something that is otherwise tromping memory that doesn't belong to it. Sometimes that memory is just another variable, and you don't notice the effects (maybe it's been used and isn't needed again, or is rewritten properly). Sometimes it's something critical or something protected that will cause an error. Particularly a return address on the stack. Building a program in debug mode builds in a lot of otherwise nonexistent stuff, labels, debug bookkeeping, etc. These may allow code to function that won't function otherwise. I'd check very carefully the initialization statements in the function. The only other C/C++ debuggers I use are the ones with the MS IDEs I have, so I can't make other recommendations.
__________________
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
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 8:56 PM.

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