Search code examples
visual-studiodebuggingprofilingbreakpointstrace

Can I format $CALLER like $FUNCTION (with full signature) in a Visual Studio "When Hit" Breakpoint?


I've been using trace points on C++ functions of interest to build a dynamic call graph in Graphviz. The syntax I'm using in the Breakpoint UI to do that is

"$CALLER" -> "$FUNCTION";

Unfortunately, the output isn't quite what i need, because while $FUNCTION expands to the full signature, $CALLER does not. Is there a way to get the signature of the caller in the same format as $FUNCTION? Without that, the node names on my call graph don't match. (I can get around that by removing the signatures for the callees after the fact, but that merges calls to overloaded functions, and isn't ideal.)

In VS 2010, there was a provision for invoking a macro when a breakpoint was hit. Is there a replacement for that in VS 2012 now that Macros are no longer supported?

Or is there a much simpler way to get this information? (I have the Performance Wizard, but I didn't think it had the same fidelity as the debugger, since it uses CPU sampling. And Intellitrace isn't supported for C++, so even if I had the Ultimate edition it wouldn't be an option.)

Thank you.


Solution

  • A good way to collect this information with Visual Studio is to use the Visual Studio Profiler in 'Instrumentation mode'. For more information, refer to MSDN.

    You should be able to configure the profiler to collect the entire call-graph and C++ collection is supported.