Léon Pelletier
Léon Pelletier

Reputation: 2731

Getting a detailed callstack log

Is this possible in Visual Studio to generate a text list of the methods that are being called, and possibly execution time [of returned methods]? I know about a lot of approaches to profile an application, but I think that having a clear - even if long - callstack would be helpful in improving launch performances.

Upvotes: 1

Views: 60

Answers (1)

shoosh
shoosh

Reputation: 78914

Here's a code project article about this It basically boils down to using the GetThreadContext() to capture the context of the current thread and then using StackWalk64() to walk the stack. Alternatively you can also use CaptureStackBackTrace().
These functions will only get you the list of addresses that make the stack. To get the names of the functions and line numbers you'll need to use functions from dbghelp.dll like SymGetModuleInfo64()

Upvotes: 1

Related Questions