From: ernomat AT evitech DOT fi (Erno Tuomainen) Newsgroups: comp.os.msdos.djgpp Subject: Re: Debugging with DJGPP Date: Sat, 24 Jan 1998 12:18:48 GMT Organization: EVITech, Espoo/Finland. Lines: 35 Message-ID: <34cbdb2b.766244@news.freenet.hut.fi> References: <34c8017e DOT 36688673 AT news DOT freenet DOT hut DOT fi> NNTP-Posting-Host: dialin-0-02.evitech.fi Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk On Fri, 23 Jan 1998 02:38:18 GMT, ernomat AT evitech DOT fi (Erno Tuomainen) wrote: > Could someone help me with DEBUGGING in DJGPP. I recently have >stumbled into a mysterious bug in my roguelike game (Legend of >Saladir) which just doesn't seem to disappear even I have tried my >best, but without debugger to this point. Nobody helped out (yet)! So I reply to this post myself. I managed to get GDB and debug that slimy bug out. Ooh, I love GDB. After I started my game with GDB and played it a while it said that my game stopped to SIGSEGV (segment violation) at function Monster_movetotarget(). It even pointed out the particular source line which caused the error. Yeah, and there it was, when accessing a two dimensional array I had misplaced the X and Y coordinates .. :) Table was looked over boundaries and KABOOM. Yeah, that answers my question about debugging. This one was really easy to find. I had some problems when GDB couldn't find my *.CPP files, it tried to load *.CC files always. So I just had to rename the files to *.CC and it worked. And of course it must be compiled with '-g' option so that debugging does work. --- Erno Tuomainen -+- A Computer Engineering student at Helsinki/Finland + ernomat AT evitech DOT fi at www.evitech.fi/~ernomat +