RE: [AL] Debugging

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Thanks. I'll try that.

> -----Original Message-----
> From: allegro-owner@xxxxxxxxxx
> [mailto:allegro-owner@xxxxxxxxxx Behalf Of Hein Zelle
> Sent: 18 September 2001 20:12
> To: allegro@xxxxxxxxxx
> Subject: Re: [AL] Debugging
>
>
> Chris Graham wrote:
> > Hi,
> >
> > I've got a number of bugs in my very large Allegro game, under
> Windows, it
> > tends to freeze the computer or just exit without any info, and
> under Linux
> > it tends to Segfault, without any info. If I try to use Ms VC++
> features to
> > debug my game, the computer just hangs, and if I try to use gdb, the
> > computer just goes crazy (keymapping goes haywire, funny beeps when you
> > press the wrong keys). Is this something common to all graphical allegro
> > programs; something to do with the debuggers not working with
> > DirectX/SVGALib? How can I get around this?
>
> nicely programmed allegro programs should *in theory* not confuse the
> debugger, but everything is possible when allegro takes over keyboard,
> timers, video, sound and mouse. I'm not surprised it won't work that
> way.
>
> The typical way I get around it is in dos (djgpp) or linux (gcc):
> linux is easiest. Make sure your shell allows the production of
> coredumps (limit coredumpsize) when a program crashes. Run your
> program, let it crash.
>
> Now run: gdb prog core
>
> If you compiled everything with debug information and linked with the
> debug version of allegro (not strictly necessary) you should get a
> nice stack trace using 'bt', which will allow you to step through each
> frame and inspect the variables at each point, usually pointing out
> quickly which pointer was NULL, or invalid, or what sort of other
> problem you're having. Takes some practice, but usually works. Once I
> find out on what line of code it crashes and why, I try to put lots of
> debug statements in the code before the offending line, to find out
> where things started to go wrong.
>
> Good luck!
> 	Hein Zelle
>
> >-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-<
>  Hein Zelle                     hein@xxxxxxxxxx
> 	                        http://www.icce.rug.nl/~hein
> >-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-<
>



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/