RE: Call stack
"Mat Noguchi (BUNGIE)" <[email protected]> Wed, 9 Feb 2005 11:23:08 -0800
| Newsgroups | gmane.games.devel.windows |
|---|---|
| Message-ID | <1B678752C03CB44AAA5D9C90991EFEEC04DF4939@RED-MSG-42.redmond.corp.microsoft.com> |
__try
{
RaiseException(0,0,0,0);
}
__except(some_function(GetExceptionCode(), GetExceptionInformation())
{
}
GetExceptionInformation() will return a pointer that you can get the
current thread CONTEXT from.
MSN
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of
Grills, Jeff
Sent: Wednesday, February 09, 2005 11:11 AM
To: [email protected]
Subject: RE: [GD-Windows] Call stack
I went through three months of harassing MS about this, providing them
with a sample app that reproduced the problem, and still they didn't
figure out what the problem was. And here it is, the real reason, just
like Dan said:
if (!GetThreadContext(GetCurrentThread(), &context))
It sure would have been nice it this routine had failed. Looking at the
docs for GetThreadContext(), MS claims the following:
If you call GetThreadContext for the current thread, the
function returns successfully; however, the context returned is not
valid.
Nice, an API with a silent failure.
I really need to be able to capture call stacks at runtime from the
running thread. We have a warning system used when the game detects but
recovers from an error (usually caused by faulty data coming from our
own staff), and call stacks have proven vital to fixing those problems.
Good thing I broke down and wrote my own routine to capture the call
stack - it was only 25 lines of code, and much faster than StackWalk,
too.
j
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of
Daniel Vogel
Sent: Wednesday, February 09, 2005 12:50 PM
To: [email protected]
Subject: RE: [GD-Windows] Call stack
> with the SP2 upgrade. StackWalk won't walk the whole stack -
> it just gives up after returning 2 call stack frames. I've
I attached the code of our stack walking implementation (sorry for the
formatting, notepad didn't like our usage of tabs). It works fine for
walking the stack after a crash as we have easy access to all the
information we need to feed StackWalk64.
> the stack. I have plenty of cases in the engine where I
> capture a call stack for debugging later if something else
IMO StackWalk64 is mostly useless for this case as you cannot call
GetThreadContext on a running thread.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/debug/b
ase/getthreadcontext.asp
I assume you're doing this as that's exactly what we did with our proxy
malloc and it broke with SP2 as well.
-- Daniel, Epic Games Inc.
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=ick
_______________________________________________
Gamedevlists-windows mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_idU5
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
Gamedevlists-windows mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_idU5