Recommended way to get seed context for asynchronous DoStackSnapshot

Locked Recommended way to get seed context for asynchronous DoStackSnapshot

All Replies

  • Thursday, May 10, 2012 4:04 AM
    Moderator
     
     Proposed Answer
  • Thursday, May 10, 2012 8:43 AM
     
     
    Ok, I will use RtlVirtualUnwind / RtlLookupFunctionEntry  instead of DoStackSnapshot on 64 bit Windows. But on 32 bit windows?
  • Thursday, May 10, 2012 11:32 AM
     
     
    The same.

    Ghost,
    Call me ghost for short, Thanks
    To get the better answer, it should be a better question.

  • Thursday, May 10, 2012 11:48 AM
     
     
    I think RtlVirtualUnwind is only available on x64. Am I wrong?
  • Friday, May 11, 2012 2:51 AM
     
     

    Hi ICorthomas,

    You can try the general definition and check the result.

    Have a nice day.


    Ghost,
    Call me ghost for short, Thanks
    To get the better answer, it should be a better question.

  • Friday, July 27, 2012 4:40 PM
    Owner
     
     Answered

    Hi, Thomas.  I believe you're correct that the Rtl* functions for unwinding are unavailable on x86.  It's probably best to write your own lightweight native stackwalker on x86.  Typically, you'll get fine results by doing a simple ebp-walk (this is how ETW stack events work), and can test each frame to see if it's managed via GetFunctionFromIP.

    More info about mixed-mode stackwalking here: http://blogs.msdn.com/b/davbr/archive/2005/10/06/profiler-stack-walking-basics-and-beyond.aspx

    Thanks,
    Dave