Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Searching call stacks in Visual Studio [duplicate]

Tags:

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?

like image 678
The Vivandiere Avatar asked Jun 06 '16 15:06

The Vivandiere


People also ask

How do I view call stack in Visual Studio?

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 + `).

How do I copy a call stack in Visual Studio?

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.

How do you read a call stack?

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.


1 Answers

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.

like image 128
Cody Gray Avatar answered Sep 28 '22 02:09

Cody Gray