向调试器加载核心文件

使用核心模式检查 Linux 和 Unix 系统上崩溃进程生成的核心文件(崩溃转储),如果系统设置允许这样做的话。

获取核心文件

要在 Unix 系统上启用转储核心文件,请在启动应用程序的 shell 中输入以下命令:

ulimit -c unlimited

附加到核心文件

在核心模式下启动调试器:

  1. 进入Debug >Start Debugging ,然后选择Load Core File

    加载核心文件对话框

  2. Kit 中,选择用于创建核心文件的二进制文件的构建和运行工具包。如果内核文件来自非Qt Creator 构建的二进制文件或非由Qt Creator 启动的进程,请选择与指定设备、工具链、调试器和系统根所用设置尽可能匹配的工具包。
  3. Core file 中,指定要检查的核心文件。
  4. Executable of symbol file 中,指定一个包含与核心文件相对应的调试信息的文件。通常是可执行文件或.debug 文件(如果调试信息与可执行文件分开存储)。
  5. Override start script 中,指定要运行的脚本文件,而不是默认的启动脚本。
  6. Override SysRoot 中,指定要使用的sysroot 的路径,而不是默认的sysroot

为获得更好的效果,请使用一个配置正确的项目,该项目应包含崩溃应用程序的源代码。

附加到最新的核心文件

在 Linux 系统上,Qt Creator 使用systemd 崩溃处理提供的coredumpctl 命令获取核心文件。更多信息,请参阅systemd-coredump

要附加到最新的核心文件,请访问Debug >Start Debugging ,然后选择Load Last Core File

另请参阅 "如何:调试"、"调试"、"调试器"、"调试器"和 "工具包"。

Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.