- View the call stack and use the Call Stack window in the debugger
- View the call stack while in the debugger
- Display non-user code in the Call Stack window
- Switch to another stack frame (change the debugger context)
- View the source code for a function on the call stack
- Run to a specific function from the Call Stack window
- Set a breakpoint on the exit point of a function call
- Display calls to or from another thread
- Visually trace the call stack
- View the disassembly code for a function on the call stack (C#, C++, Visual Basic, F#)
- Change the optional information displayed
- Load symbols for a module (C#, C++, Visual Basic, F#)
- To load symbols
- To set the symbol path
- Просмотр стека вызовов и использование окна «Стек вызовов» в отладчике View the call stack and use the Call Stack window in the debugger
- Просмотр стека вызовов в отладчике View the call stack while in the debugger
- Отображение непользовательского кода в окне «Стек вызовов» Display non-user code in the Call Stack window
- Переключение на другой кадр стека (изменение контекста отладчика) Switch to another stack frame (change the debugger context)
- Просмотр исходного кода функции в стеке вызовов View the source code for a function on the call stack
- Выполнение кода до определенной функции из окна «Стек вызовов» Run to a specific function from the Call Stack window
- Установка точки останова в точке выхода вызова функции Set a breakpoint on the exit point of a function call
- Отображение вызовов в другой поток или из него Display calls to or from another thread
- Визуальная трассировка стека вызовов Visually trace the call stack
- Просмотр дизассемблированного кода функции в стеке вызовов (C#, C++, Visual Basic, F#) View the disassembly code for a function on the call stack (C#, C++, Visual Basic, F#)
- Включение или отключение отображения дополнительных сведений Change the optional information displayed
- Загрузка символов для модуля (C#, C++, Visual Basic, F#) Load symbols for a module (C#, C++, Visual Basic, F#)
- Чтобы загрузить символы To load symbols
- Установка пути к символам To set the symbol path
View the call stack and use the Call Stack window in the debugger
By using the Call Stack window, you can view the function or procedure calls that are currently on the stack. The Call Stack window shows the order in which methods and functions are getting called. The call stack is a good way to examine and understand the execution flow of an app.
When debugging symbols are not available for part of a call stack, the Call Stack window might not be able to display correct information for that part of the call stack, displaying instead:
[Frames below may be incorrect and/or missing, no symbols loaded for name.dll]
The Call Stack window is similar to the Debug perspective in some IDEs like Eclipse.
The dialog boxes and menu commands you see might differ from those described here, depending on your active settings or edition. To change your settings, select Import and Export Settings on the Tools menu. See Reset settings.
View the call stack while in the debugger
While debugging, in the Debug menu, select Windows > Call Stack.
A yellow arrow identifies the stack frame where the execution pointer is currently located. By default, this stack frame’s information appears in the source, Locals, Autos, Watch, and Disassembly windows. To change the debugger context to another frame on the stack, switch to another stack frame.
Display non-user code in the Call Stack window
- Right-click the Call Stack window and select Show External Code.
Non-user code is any code that is not shown when Just My Code is enabled. In managed code, non-user code frames are hidden by default. The following notation appears in place of the non-user code frames:
Switch to another stack frame (change the debugger context)
In the Call Stack window, right-click the stack frame whose code and data that you want to view.
Or, you can double-click a frame in the Call Stack window to switch to that frame.
Select Switch to Frame.
A green arrow with a curly tail appears next to the stack frame you selected. The execution pointer remains in the original frame, which is still marked with the yellow arrow. If you select Step or Continue from the Debug menu, execution will continue in the original frame, not the frame you selected.
View the source code for a function on the call stack
- In the Call Stack window, right-click the function whose source code you want to see and select Go To Source Code.
Run to a specific function from the Call Stack window
- In the Call Stack window, select the function, right-click, and then choose Run to Cursor.
Set a breakpoint on the exit point of a function call
Display calls to or from another thread
- Right-click the Call Stack window and select Include Calls To/From Other Threads.
Visually trace the call stack
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 + `).
View the disassembly code for a function on the call stack (C#, C++, Visual Basic, F#)
- In the Call Stack window, right-click the function whose disassembly code you want to see and select Go To Disassembly.
Change the optional information displayed
- Right-click in the Call Stack window and set or clear Show .
Load symbols for a module (C#, C++, Visual Basic, F#)
In the Call Stack window, you can load debugging symbols for code that does not currently have symbols loaded. These symbols can be .NET or system symbols downloaded from the Microsoft public symbol servers, or symbols in a symbol path on the computer that you are debugging.
To load symbols
In the Call Stack window, right-click the stack frame for which symbols are not loaded. The frame will be dimmed.
Point to Load Symbols and then select Microsoft Symbol Servers (if available), or browse to the symbol path.
To set the symbol path
In the Call Stack window, choose Symbol Settings from the shortcut menu.
The Options dialog box opens and the Symbols page is displayed.
Select Symbol Settings.
In the Options dialog box, click the Folder icon.
In the Symbol file (.pdb) locations box, a cursor appears.
Enter a directory pathname to the symbol location on the computer that you are debugging. For local and remote debugging, this is a path on your local computer.
Select OK to close the Options dialog box.
Просмотр стека вызовов и использование окна «Стек вызовов» в отладчике View the call stack and use the Call Stack window in the debugger
С помощью окна Стек вызовов можно просматривать вызовы функций и процедур, которые в данный момент находятся в стеке. By using the Call Stack window, you can view the function or procedure calls that are currently on the stack. В окне Стек вызовов показан порядок вызова методов и функций. The Call Stack window shows the order in which methods and functions are getting called. Стек вызовов хорошо подходит для изучения и анализа потока выполнения приложения. The call stack is a good way to examine and understand the execution flow of an app.
Если символы отладки недоступны для части стека вызовов, в окне Стек вызовов может не получиться отобразить правильные сведения об этой части стека вызовов. Вместо них будет отображаться следующая информация. When debugging symbols are not available for part of a call stack, the Call Stack window might not be able to display correct information for that part of the call stack, displaying instead:
[Frames below may be incorrect and/or missing, no symbols loaded for name.dll]
Окно Стек вызовов аналогично перспективе «Отладка» в некоторых интегрированных средах разработки, например Eclipse. The Call Stack window is similar to the Debug perspective in some IDEs like Eclipse.
Отображаемые диалоговые окна и команды меню могут отличаться от описанных здесь в зависимости от текущих параметров или выпуска. The dialog boxes and menu commands you see might differ from those described here, depending on your active settings or edition. Чтобы изменить параметры, выберите в меню Сервис пункт Импорт и экспорт параметров. To change your settings, select Import and Export Settings on the Tools menu. См. раздел Сброс параметров. See Reset settings.
Просмотр стека вызовов в отладчике View the call stack while in the debugger
Во время отладки в меню Отладка выберите Окна > Стек вызовов. While debugging, in the Debug menu, select Windows > Call Stack.
Желтая стрелка указывает на кадр стека, в котором находится указатель выполнения. A yellow arrow identifies the stack frame where the execution pointer is currently located. По умолчанию это кадр стека, сведения которого отображаются в окнах: исходного кода, Локальные, Контрольные значения, Видимые и Дизассемблированный код. By default, this stack frame’s information appears in the source, Locals, Autos, Watch, and Disassembly windows. Чтобы изменить контекст отладчика на другой кадр стека, переключитесь на другой кадр стека. To change the debugger context to another frame on the stack, switch to another stack frame.
Отображение непользовательского кода в окне «Стек вызовов» Display non-user code in the Call Stack window
- Щелкните правой кнопкой мыши в окне Стек вызовов и выберите в контекстном меню пункт Показать внешний код. Right-click the Call Stack window and select Show External Code.
Непользовательский код — это любой код, который не отображается при включении режима Только мой код. Non-user code is any code that is not shown when Just My Code is enabled. В управляемом коде кадры непользовательского кода скрыты по умолчанию. In managed code, non-user code frames are hidden by default. Вместо кадров непользовательского кода отображается следующая запись. The following notation appears in place of the non-user code frames:
Переключение на другой кадр стека (изменение контекста отладчика) Switch to another stack frame (change the debugger context)
В окне Стек вызовов щелкните правой кнопкой кадр стека, код и данные которого нужно просмотреть. In the Call Stack window, right-click the stack frame whose code and data that you want to view.
Или можно дважды щелкнуть кадр в окне Стек вызовов, чтобы переключиться на этот кадр. Or, you can double-click a frame in the Call Stack window to switch to that frame.
Выберите пункт Перейти к кадру. Select Switch to Frame.
Рядом с выбранным кадром стека появится зеленая стрелка с фигурным концом. A green arrow with a curly tail appears next to the stack frame you selected. Указатель выполнения остается в исходном кадре, который по-прежнему отмечен желтой стрелкой. The execution pointer remains in the original frame, which is still marked with the yellow arrow. При выборе команд Шаг или Продолжить в меню Отладка выполнение продолжится с исходного, а не с выбранного кадра. If you select Step or Continue from the Debug menu, execution will continue in the original frame, not the frame you selected.
Просмотр исходного кода функции в стеке вызовов View the source code for a function on the call stack
- В окне Стек вызовов щелкните правой кнопкой мыши функцию, исходный код которой нужно увидеть, и выберите пункт К исходному коду. In the Call Stack window, right-click the function whose source code you want to see and select Go To Source Code.
Выполнение кода до определенной функции из окна «Стек вызовов» Run to a specific function from the Call Stack window
- В окне Стек вызовов выберите функцию, щелкните ее правой кнопкой мыши и выберите команду Выполнить до курсора. In the Call Stack window, select the function, right-click, and then choose Run to Cursor.
Установка точки останова в точке выхода вызова функции Set a breakpoint on the exit point of a function call
Отображение вызовов в другой поток или из него Display calls to or from another thread
- Щелкните правой кнопкой мыши в окне Стек вызовов и выберите пункт Включить вызовы между потоками. Right-click the Call Stack window and select Include Calls To/From Other Threads.
Визуальная трассировка стека вызовов Visually trace the call stack
В Visual Studio Enterprise (только) можно просматривать карты кода для стека вызовов во время отладки. 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. Выберите Показать стек вызовов на карте кода (CTRL + SHIFT + ` ). Choose Show Call Stack on Code Map (Ctrl + Shift + `).
Просмотр дизассемблированного кода функции в стеке вызовов (C#, C++, Visual Basic, F#) View the disassembly code for a function on the call stack (C#, C++, Visual Basic, F#)
- В окне Стек вызовов щелкните правой кнопкой мыши функцию, дизассемблированный код которой нужно увидеть, и выберите пункт К дизассемблированному коду. In the Call Stack window, right-click the function whose disassembly code you want to see and select Go To Disassembly.
Включение или отключение отображения дополнительных сведений Change the optional information displayed
- Щелкните правой кнопкой мыши в окне Стек вызовов и установите или снимите флажок Показать . Right-click in the Call Stack window and set or clear Show .
Загрузка символов для модуля (C#, C++, Visual Basic, F#) Load symbols for a module (C#, C++, Visual Basic, F#)
В окне Стек вызовов можно загружать символы отладки для кода, для которого в данный момент нет загруженных отладочных символов. In the Call Stack window, you can load debugging symbols for code that does not currently have symbols loaded. Это могут быть символы платформы .NET или системные символы, загруженные с общедоступных серверов символов корпорации Майкрософт, или символы в каталоге символов на компьютере, на котором производится отладка. These symbols can be .NET or system symbols downloaded from the Microsoft public symbol servers, or symbols in a symbol path on the computer that you are debugging.
Чтобы загрузить символы To load symbols
В окне Стек вызовов щелкните правой кнопкой какой-либо кадр стека, для которого не загружены символы. In the Call Stack window, right-click the stack frame for which symbols are not loaded. Кадр затеняется. The frame will be dimmed.
Укажите на параметр Загрузить символы, а затем выберите Серверы символов (Майкрософт) (если доступно) или перейдите по пути к символам. Point to Load Symbols and then select Microsoft Symbol Servers (if available), or browse to the symbol path.
Установка пути к символам To set the symbol path
В окне Стек вызовов выберите пункт Параметры символов из контекстного меню. In the Call Stack window, choose Symbol Settings from the shortcut menu.
Появится диалоговое окно Параметры, открытое на странице Символы. The Options dialog box opens and the Symbols page is displayed.
Выберите Параметры символов. Select Symbol Settings.
В диалоговом окне Параметры щелкните значок «Папка». In the Options dialog box, click the Folder icon.
В поле Места размещения файлов символов (.pdb) появится курсор. In the Symbol file (.pdb) locations box, a cursor appears.
Введите путь к каталогу с символами на компьютере, на котором производится отладка. Enter a directory pathname to the symbol location on the computer that you are debugging. При локальной и удаленной отладке это путь на локальном компьютере. For local and remote debugging, this is a path on your local computer.
Нажмите кнопку OK, чтобы закрыть диалоговое окно Параметры. Select OK to close the Options dialog box.