I am using Visual Studio to debug a large multithreaded C++ application. I am trying to find out what thread ran a function I am interested in.
I have more than 40 threads, some with really lengthy call stacks. So, manually inspecting individual call stacks to see if they contain my function is really tedious.
I was wondering if Visual Studio supports searching call stacks like it supports searching source files. Could you please tell me how to search call stacks in VS?
In Visual Studio Enterprise (only), you can view code maps for the call stack while debugging. In the Call Stack window, open the shortcut menu. Choose Show Call Stack on Code Map (Ctrl + Shift + `).
To grab the text of the call stack, right-click in the Call Stack window and choose Select All. This will select all the calls on the stack. Right-click and choose Copy to copy their text. You can paste this call stack text anywhere you want.
Call stack is set of lines, which is usually read from top to bottom - meaning moving from current locations to callers. The bottom line was executed first. The top line is executed last and it is the current routine.
No, I don't know of any way to search the call stack from within Visual Studio's viewer window.
I use a rather low-tech solution for this: with the Call Stack window focused, Ctrl+A, Ctrl+C. Switch to a text editor with the desired search wrangling features, and then Ctrl+V. Yup, good old copy-and-paste. It works. Obtaining a textual representation of the call stack has several other advantages, including the ability to save different call stacks, diff them, and post them to Stack Overflow questions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With