亲宝软件园·资讯

展开

VSCode Arm 远程调试环境 VSCode 搭建 Arm 远程调试环境的步骤详解

Young 人气:0

简介

前提条件:

本次搭建的环境:

连接远程主机

Remote Development

首先安装 Remote Development 插件,安装完成之后:

如上图所示,输入:Remote-SSH:Connect to Host->Configure SSH Hosts->选择一个config,配置信息:

# Read more about SSH config files: https://linux.die.net/man/5/ssh_config
Host Server
    HostName 10.10.1.111
    User name

其中:

输入完毕后保存,左侧会出现配置好的信息,右键登陆,可能需要密码:

插件安装

连接到 server 后会发现,安装的插件分为两栏,可以在远程服务器安装需要的插件:

远程主机命令行

Ctrl + ~ 打开终端窗口,VS Code 连接到远程主机后,就可以直接使用终端窗口在远程主机上执行终端命令。

arm 远程调试

VSCode 配置

配置 gdb 的配置文件 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": [
 
  {
   "type": "cppdbg",	
   "request": "launch",
   "name": "Debug for test", 
   "skipFiles": [
    "<node_internals>/**"
   ],
   "args": [],
   "program": "${workspaceFolder}/build/bin/test.debug",
   "stopAtEntry": false,
   "cwd": "${workspaceFolder}",
   "externalConsole": true, 
   "MIMode": "gdb",
   "setupCommands": [
    {
     "description": "Enable pretty-printing for gdb",
     "text": "-enable-pretty-printing",
     "ignoreFailures": true
    }
   ], 
   "miDebuggerPath":"/opt/hisi-linux/x86-arm/aarch64-himix100-linux/bin/aarch64-himix100-linux-gdb",
   "miDebuggerServerAddress": "192.168.172.110:1234"
  }
 ]
}

arm 上运行 gdb server

./gdbserver :1234 test.debug

开始调试

VSCode 按 F5 开始调试:

断点设置,变量、栈查看:

总结

加载全部内容

相关教程
猜你喜欢
用户评论