查看调用堆栈跟踪

当正在调试的应用程序被中断时,Qt Creator 会以调用堆栈跟踪的形式显示导致当前位置的嵌套函数调用。该堆栈跟踪由调用堆栈帧建立,每个帧代表一个特定函数。对于每个函数,Qt Creator 会尝试检索相应源文件的文件名和行号。这些数据显示在Stack 视图中。

堆栈视图

由于通向当前位置的调用堆栈可能源于或经过没有调试信息的代码,因此并非所有堆栈帧都有相应的源位置。没有相应源位置的堆栈帧会显示为灰色。

如果选择了有已知源位置的帧,文本编辑器就会跳转到相应位置,并更新本地表达式视图,让人以为应用程序在进入函数前就已中断。

加载 QML 堆栈

要找出导致Qt Quick 应用程序崩溃的 QML 文件,请在Stack 视图的上下文菜单中选择Load QML Stack 。调试器会尝试从停止的可执行文件中检索 JavaScript 堆栈,并在找到任何框架时将其预置到 C++ 框架中。您可以在 QML 栈中选择一个框架,在编辑器中打开 QML 文件。

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

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.