关于ARM核心板远程调试的配置

桌面系统环境:Ubuntu 18.04.6 LTS

QtCreator:Qt Creator 4.11.1

Qt Kits:Qt5.14.2

核心板型号:英码 MED3568 

1. 在QtCreator中操作,工具 - Kits - Debuggers,点击 Add

新增加一个 arm-gdb,添加刚安装好的 gdb-multiarch(安装方法 sudo apt-get update后,直接 sudo apt-get install gdb-multiarch即可)

 

2. 在QtCreator中操作,工具 - 设备 - 设备,点击 添加(将交叉编译好的gdbserver程序放到设备的/usr/bin下)

 

 3. 检查 QtCreator中的项目,Qt编译好的程序,会自动通过SSH部署到 设备上

 

4. 获取设备运行环境,此步需要在SSH配置好后获取,需要输入SSH的密码。

如果不获取,设备运行环境,gdb调试会出现如下错误,说明Qt在启动远程调试时,没有找到设备上的运行环境,程序无法加载相关库:

error: XDG_RUNTIME_DIR not set in the environment.
Failed to create wl_display (No such file or directory)
qt.qpa.plugin: Could not load the Qt platform plugin "wayland" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland.

can't find linker symbol for virtual table for `Widget' value

 

 

5. 结果,在Qt启动调试时,会自动将程序部署到设备上,进行调试

 

 

 

 

如出现如下问题:

 

在Pro中添加:

# 解决 Qt this does not seem to be a Debug build
QMAKE_CXXFLAGS += -g

 

posted @ 2022-11-04 14:01  果园2018  阅读(1066)  评论(0编辑  收藏  举报