# 调试

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/zh-cn/help/clion/llms.txt).

在调试会话期间，调试器会干预您的程序执行，并向您提供有关底层运行情况的信息。 观看此视频，了解在 CLion 中调试的基础知识：

[Video](https://www.youtube.com/v/5wGsRdumueU)

> **Tip:**
> 在我们的 [CLion 调试器](https://www.youtube.com/playlist?list=PLQ176FUIyIUawCufBKmmWkRq2t5sl1xsM)播放列表中找到更多视频。

Procedure: 一般调试程序

1. 配置 [调试配置文件](debug-profiles.html)。

2. 对于 CMake 项目，选择所需的 [CMake 配置文件](cmake-profile.html)。

3. 如有必要，创建或修改现有的 [运行/调试配置](run-debug-configuration.html)。

4. 在代码中放置 [断点](using-breakpoints.html)。

5. 点击   调试 <配置名称>  按钮 ![调试](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.startDebugger_dark.svg)或使用其他选项 [启动调试会话](starting-the-debugger-session.html#start-debugging)。

> **Tip:**
> 根据需要 [暂停或恢复](starting-the-debugger-session.html#pause)会话。

> **Tip:**
> 在调试会话期间，您可以 [逐步执行代码](stepping-through-the-program.html)、 [计算表达式](examining-suspended-program.html#evaluating-expressions)、动态更改值、 [设置监视](examining-suspended-program.html#watches)和 [监视点](using-watchpoints.html)。

启动调试会话后，标记 [调试工具窗口](debug-tool-window.html)的 ![调试](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.startDebugger.svg)图标会切换为 ![活动调试器图标](https://resources.jetbrains.com/help/img/idea/2026.3/所有断点](using-breakpoints.html#breakpoint-properties)  |  `Ctrl+Shift+F8` (Windows), `⌘ ⇧ F8` (macOS), `⌘ ⇧ F8` (IntelliJ IDEA Classic (macOS)), `⌘ ⇧ F8` (macOS System Shortcuts), `Ctrl+Shift+F8` (XWin), `Ctrl+Shift+F8` (GNOME), `Ctrl+Shift+F8` (KDE), `Ctrl+Shift+F8` (Emacs), `Ctrl+Shift+F8` (Sublime Text), `⌘ ⇧ F8` (Sublime Text (macOS)), `⌘ ⇧ F8` (Xcode), `Alt+F9` (Visual Studio), `⌥ F9` (Visual Studio (macOS)), `Alt+F9` (ReSharper), `⌥ F9` (ReSharper (macOS)), `Ctrl+Shift+F8` (QtCreator), `⌘ ⇧ F8` (QtCreator (macOS)), `Ctrl+Shift+F8` (NetBeans), `Ctrl+Shift+F8` (Eclipse), `⌘ ⇧ F8` (Eclipse (macOS))  |
|  在插入符号处调试代码  |  `Shift+F9` (Windows), `⌃ D` (macOS), `⇧ F9` (IntelliJ IDEA Classic (macOS)), `⌥ ⇧ D` (macOS System Shortcuts), `Shift+F9` (XWin), `Shift+F9` (GNOME), `Shift+F9` (KDE), `Shift+F9` (Emacs), `Shift+F9` (Sublime Text), `⌃ D` (Sublime Text (macOS)), `⌘ R` (Xcode), `Alt+F5` (Visual Studio), `⌥ F5` (Visual Studio (macOS)), `Alt+F5` (ReSharper), `⌥ F5` (ReSharper (macOS)), `F5` (QtCreator), `⌘ Y` (QtCreator (macOS)), `Ctrl+F5` (NetBeans), `Alt+Shift+D` (Eclipse), `⌘ F11` (Eclipse (macOS))（在  `main` 方法内），或 `Alt+Shift+F9` (Windows), `⌃ ⌥ D` (macOS), `⌥ ⇧ F9` (IntelliJ IDEA Classic (macOS)), `⌃ ⌥ D` (macOS System Shortcuts), `Alt+Shift+F9` (XWin), `Alt+Shift+F9` (GNOME), `Alt+Shift+F9` (KDE), `Alt+Shift+F9` (Emacs), `Alt+Shift+F9` (Sublime Text), `⌃ ⌥ D` (Sublime Text (macOS)), `⌘ ⌥ R` (Xcode), `Alt+Shift+F9` (Visual Studio), `⌃ ⌥ D` (Visual Studio (macOS)), `Alt+Shift+F9` (ReSharper), `⌃ ⌥ D` (ReSharper (macOS)), `Alt+Shift+F9` (QtCreator), `⌃ ⌥ D` (QtCreator (macOS)), `Alt+Shift+F9` (NetBeans), `Alt+Shift+F9` (Eclipse), `⌃ ⌥ D` (Eclipse (macOS))  |

## See also

### 概念

[Run/Debug Configurations](run-debug-configuration.html) [断点](using-breakpoints.html) [调试配置文件](debug-profiles.html) [Agentic 调试](agentic-debugging.html)

### 参考

[调试工具窗口](debug-tool-window.html)

### 外部链接

[Webinar Recording: CLion Ask Me Anything Session: Debugger](https://www.youtube.com/watch?v=Kz5NQiji9YU5&t=244s) [Video playlist: CLion Debugger](https://www.youtube.com/playlist?list=PLQ176FUIyIUawCufBKmmWkRq2t5sl1xsM) [CLion Debugging - Fundamentals](https://blog.jetbrains.com/clion/2020/10/clion-debugging-part-1-fundamentals) [CLion Debugging Beyond the Basics - Part 1 - Suspended](https://blog.jetbrains.com/clion/2021/03/clion-debugging-beyond-the-basics-part-1-suspended) [CLion Debugging Beyond the Basics - Part 2 - Dynamic](https://blog.jetbrains.com/clion/2021/03/clion-debugging-beyond-the-basics-part-2-dynamic) [CLion Debugging Beyond the Basics - Part 3 - Beyond Local](https://blog.jetbrains.com/clion/2021/05/clion-debugging-beyond-the-basics-part-3-beyond-local)

