在 VxWorks 设备上调试 C++ 应用程序

注意: 将所有依赖库放在 SD 卡上。从其他位置(如挂载的 NFS 目录)调试不起作用。

Qt Creator 调试程序只将应用程序二进制文件和其他可部署文件复制到 SD 卡的根目录。它不会保留或创建 SD 卡上的目录结构。

要调试 Qt 应用程序,请在 VxWorks 源代码构建 (VSB) 配置中添加以下一行:

vxprj vsb config -s -add "_WRS_CONFIG_TCF_GDB_RSP=y"

要在设备上自动启动 GDB 服务器,请在 VxWorks 映像项目 (VIP) 配置中添加以下几行:

"INCLUDE_DEBUG_AGENT"
"INCLUDE_DEBUG_AGENT_START"
"INCLUDE_STANDALONE_SYM_TBL"

更多信息,请参阅Qt for VxWorks

设置调试:

  1. 为项目激活 VxWorks 工具包。
  2. 转到Projects >Run
  3. Run Settings 中,设置PriorityStack size

    VxWorks 的运行设置

  4. Environment 中,将LD_LIBRARY_PATH 变量设置为 SD 卡上库的位置。如果 SD 卡的路径不是/sd0a ,请将VX_SDCARD_PATH 设置为正确的位置。

要开始调试,请按F5或选择Debug >Start Debugging >Start Debugging of Startup Project

另请参阅 为项目激活工具包为 VxWorks 设备创建工具包调试VxWorks 版 Qt

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.