RE: [AL] Debugging

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


Thanks for your advice. I wasn't meaning to get you guys to debug my code; I
should be able to do that :-) I was just really probing for Allegro
debugging techniques, and detailing problems I've had using debuggers with
Allegro.

> -----Original Message-----
> From: allegro-owner@xxxxxxxxxx
> [mailto:allegro-owner@xxxxxxxxxx Behalf Of Derek Van Tonder
> Sent: 18 September 2001 20:13
> To: 'allegro@xxxxxxxxxx'
> Subject: RE: [AL] Debugging
>
>
> Well Chris, we can't really help if you give us that little
> info. Is the game open source? Upload it to a server somewhere
> and half the people on this list might be able to spot your
> mistake straight away. Here are a few things for you to
> try out:
>
> 1. Check every single pointer, ESPECIALLY bitmap pointers,
> every time you use them. Use ASSERT for this, because it will
> compile away in optimized (-Ox) code...
> 2. Compile with -g3.
> 3. This goes with point 1: set all pointers to NULL after you
> free them. Here is a handy macro for you:
>
> #define free_ex(ptr) { _ASSERT(ptr); if (ptr) free(ptr); ptr = NULL; }
>
> Use that instead of LIBC 'free', maybe it'll help you track
> down the problem. I work as a game developer company, and we use stuff
> like that, it saves time.
>
> Your problems sound to me like you're reading/writing freed up
> memory or something.
>
>
> 	Backup not found: (P)anic (E)ject (I)nfluence with hammer
> ..:: Derek Van Tonder ::..
> ..:: derek@xxxxxxxxxx ::..
>
>
> -----Original Message-----
> From: Chris Graham [mailto:chris_graham@xxxxxxxxxx]
> Sent: Monday, September 16, 2002 8:05 AM
> To: allegro@xxxxxxxxxx
> Subject: [AL] Debugging
>
>
> 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? I don't really have any
> experience using C++ debuggers, so I don't know what I am doing really.
>
> This is the sort of thing I do under Linux..
>  "gdb sttr"
>  "run"
>  "continue"
>  "continue"
>  "continue"
>  <CRASH!!>
>
> When I run my game outside of gdb then I don't get any useful
> debug output,
> although I did compile with -g. I just get told there was a
> segfault, and I
> don't get anything else, not even a core dump.
>
> Please Help!
>
> Thanks in advance,
>
> Chris Graham
>



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