If you don't have a stack trace, here's a trick I often use to
bring clarity:
1) find the "ret" instruction following the crash location
2) count the amount of data popped off the stack between crash
and ret
3) add that much to stack pointer
4) set eip to the ret instruction
5) single-step
6) repeat, until you're back in your own application
Sometimes it can be hard to figure out the correct offset for
esp. Then you can instead walk up the stack, looking for pointers
that look like they point into your code, and drag those values
into the disassembly view to figure out if you guessed right or
not.
All of this is vastly simpler if you set your memory display
window to show 4 longwords to the line (and anchor it at esp).
Cheers,
/ h+
> -----Original Message-----
> From: gam...@li...
> [mailto:gam...@li...]On Behalf Of
> Ignacio Castaño
> Sent: Tuesday, February 12, 2002 3:18 PM
> To: gam...@li...
> Subject: [GD-Windows] handling task switch
>
>
> Hi again,
> I have the code for reloading resources and restarting devices
> ready, and it
> works fine. However, when I run it in response to WM_ACTIVATEAPP,
> it doesn't
> work, and produces a very strange crash. The vc debugger doesn't provide a
> stack trace at all, just a invalid call at an unknown dir. Maybe I'm not
> using the correct message... where should I handle the task switch? in
> WM_ACTIVATE? WM_KILLFOCUS?
>
> Any hints would be appreciated.
>
>
> Ignacio Castaño
> ca...@as...
>
>
>
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>
>
> _______________________________________________
> Gamedevlists-windows mailing list
> Gam...@li...
> https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows
> Archives:
> http://sourceforge.net/mailarchive/forum.php?forum_id=555
>
|