【问题标题】:How to debug an ARM Linux device with VSCode on a Windows host如何在 Windows 主机上使用 VSCode 调试 ARM Linux 设备
【发布时间】:2022-12-15 20:10:33
【问题描述】:

我尝试在 Windows 主机(无 WSL)上使用 VSCode 中的本机调试远程调试 ARM Linux 嵌入式设备。

宿主launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "gdb",
            "request": "attach",
            "name": "gdb",
            "executable": "${workspaceRoot}\\myprogram\\myprogram ",
            "stopAtConnect": true,
            "target": "192.168.xxx.xxx:2000",
            "remote": true,
            "cwd": "${workspaceRoot}/myprogram", 
            "gdbpath": "C:\\msys64\\mingw64\\bin\\gdb-multiarch.exe",
            "debugger_args": ["-iex", "set osabi none"],
        }
    ]
}

目标

debarm:~# gdbserver --version                                         
GNU gdbserver (GDB) 7.0.1-debian                                      
Copyright (C) 2009 Free Software Foundation, Inc.                     
gdbserver is free software, covered by the GNU General Public License.
This gdbserver was configured as "arm-linux-gnueabi"                  
debarm:~# gdbserver :2000 --attach 1966                               
Attached; pid = 1966                                                  
Listening on port 2000                                                
Remote debugging from host 192.168.xxx.xxx

然而,步进给warning: Remote failure reply: E01类似于:GDB remote debugging fails with error E01

我也试过 https://developer.arm.com/downloads/-/gnu-rmarm-none-eabi-gdb.exe 但它给出了同样的问题。

我还尝试了来自https://releases.linaro.org/components/toolchain/binaries/latest-5/arm-linux-gnueabi/arm-linux-gnueabi-gdb.exe,但它给出了Error while reading shared library symbols for target:/lib/ld-linux.so.3

对于这种方法的问题有什么建议吗?

【问题讨论】:

  • 你看到this answer了吗?
  • 是的,看到了,但现在你提到了,我检查了以下内容;目标上的 uname --m 给出了 armv5tejl,当我将 set architecture armv5tej 添加到主机 debugger_args 时,问题仍然存在。
  • This answer表明使用的gdb只能调试intel架构。如果输入set architecturearmv5tej是否在有效参数列表中?
  • 是的,gdb-multiarch.exe 中的set architecture 列出了 armv5tej

标签: visual-studio-code arm gdb cross-platform gdbserver


【解决方案1】:

与 Linaro arm-linux-gnueabi-gdb.exe 一起工作并在 launch.json 中将 "-iex", "set auto-solib-add 0" 添加到 debugger_args

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-07-26
    • 2018-07-29
    • 2016-10-19
    • 2021-04-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-08-03
    相关资源
    最近更新 更多