DoubleLi

qq: 517712484 wx: ldbgliet

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
  4737 随笔 :: 2 文章 :: 542 评论 :: 1615万 阅读
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

参考嵌入式gdb+gdbserver调试环境搭建与使用

参考嵌入式VSCode+gdbserver图形化调试环境搭建与使用

参考VS Code + gdbserver 嵌入式arm远程调试

参考step by step 使用gdb调试Linux平台应用程序

一、软件准备

交叉编译软件gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf,把gdbserver 复制到开发板上

./gdbserver  192.168.1.190:6666  /path/helloworld
 

 192.168.1.190 开发主机的ip地址,6666 是端口,/path/helloworld 是需要调试运行的程序。

二、编译和调试

arm-linux-gnueabihf-gcc  helloworld.c -o helloworld -g

launch.json 文件配置 

 
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/helloworld",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"miDebuggerPath":"/opt/toolchain/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gdb",
"miDebuggerServerAddress": "192.168.1.145:6666"
}
]
}
 
 

①、name:调试的项目名

②、program:需要调试的应用程序可执行文件路径。

③、cwd:需要调试的应用程序源码路径。

④、miDebuggerPath:此项需要手动添加,用于指定所使用的交叉编译器 gdb路径。

⑤、miDebuggerServerAddress:此项需要手动添加,远程 gdbserver服务器地址,也就是开发板地址
 

三、在开发板上运行 

./gdbserver  192.168.1.190:6666  /path/helloworld
 

vscode 下打开helloworld.c 文件下按F5调试。文件断点,调试信息

调试过程的开发板输出

 

 
posted on   DoubleLi  阅读(373)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 展开说说关于C#中ORM框架的用法!
历史上的今天:
2014-12-12 rtsp协议详解
2014-12-12 自己动手写RTP服务器——传输所有格式的视频
2014-12-12 自己动手写RTP服务器——用RTP协议传输TS流
2014-12-12 自己动手写RTP服务器——关于RTP协议
2014-12-12 P2P直播、点播技术学习经验
2014-12-12 开源网络通信库参考
2014-12-12 一个P2P点播直播开源项目:P2PCenter
点击右上角即可分享
微信分享提示