How can I navigate the call stack in Visual Studio

2020-06-01 07:11发布

问题:

My current solution is to hit AltD, W, C, which navigates via the menus to the call stack, and then I can use the arrows to navigate. But once I press Enter on a particular frame, I have to repeat again.

Is there a more fluid way to navigate the call stack with just my keyboard?

ReSharper oriented answers are OK for me if you have one!

回答1:

I use the VS2010 default keyboard mapping scheme and by pressing Ctrl+Alt+C brings up the call stack window in which I can use the arrow keys to navigate.

The macro name is Debug.CallStack



回答2:

Here is a dorky AutoHotkey script that will navigate up and down the call stack using CtrlAltNumPadUp and CtrlAltNumPadDown.

SetTitleMatchMode 2 ; Allow for partial matches in window titles
#IfWinActive, (Debugging) ; Only work while VS is debugging
  ^!Numpad2:: ; Navigate down Call Stack in Visual Studio
    Send ^!c
    Send {Down}
    Send {Enter}
  return
  ^!Numpad8:: ; Navigate up Call Stack in Visual Studio
    Send ^!c
    Send {Up}
    Send {Enter}
  return
#IfWinActive


回答3:

Call Stack view in Visual Studio can be brought up with Ctrl+Alt+C or Alt+7. That allows navigating the stack with and as well as performing "Switch To Frame" action with Enter⏎.

Unfortunately, switching to a frame moves focus to the editor window, so the above sequence of actions has to be done again if you want to switch to another frame.