Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do you map a native to IL instruction pointer in-process
    primarykey
    data
    text
    <p>When using the unmanaged API for the .NET framework to profile a .NET process in-process, is it possible to look up the IL instruction pointer that correlates to the native instruction pointer provided to the StackSnapshotCallback function?</p> <p>As is probably obvious, I am taking a snapshot of the current stack, and would like to provide file and line number information in the stack dump. The <em>Managed Stack Explorer</em> does this by querying <code>ISymUnmanagedMethod::GetSequencePoints</code>. This is great, but the sequence points are associated to offsets, and I have so far assumed these are offsets from the beginning of the method ( in intermediate language ).</p> <p>In a follow-up comment to his blog post <a href="http://blogs.msdn.com/davbr/archive/2005/10/06/478006.aspx#513551" rel="nofollow noreferrer">Profiler stack walking: Basics and beyond</a>, David Broman indicates that this mapping can be achieved using <code>ICorDebugCode::GetILToNativeMapping</code>. However, this is not ideal as getting this interface requires attaching to my process from another, debugger process.</p> <p>I would like to avoid that step because I would like to continue to be able to run my application from within the visual studio debugger while I am taking these snapshots. It makes it easier to click on the line number in the output window and go to the code in question.</p> <p>The functionality is possible.... you can spit out a line-numbered stack trace at will inside of managed code, the only question, is it accessible. Also, I don't want to use the <code>System::Diagnostics::StackTrace</code> or <code>System::Environment::StackTrace</code> functionality because, for performance reasons, I need to delay the actual dump of the stack.... so saving the cost for resolution of method names and code location for later is desirable... along with the ability to intermix native and managed frames.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload