microsoft / microsoft/vscode-cpptools

Unable to debug embedded remote targets using arm-none-eabi-gdb on Windows (path issues)

オープン
#706 コメント 3 件 リアクション 0 件 担当者 1 名 GitHub で見る

@pieandcakes がすでに取り組んでいます。

2017年5月10日 から。

debugger embedded
主要言語
TypeScript
スター
6.2k
フォーク
1.7k
平均マージ
14時間 46分
マージ済み PR(30日)
61

説明

This is very similar to issue #328 however the problems I am experiencing are on Windows.

I am using the Atmel Studio 7 arm-none-eabi-gdb.exe found in my:

C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\arm\arm-gnu-toolchain\bin

However I believe there's a problem with spaces in the path, as even when escaping the path like this:

"miDebuggerPath": "C:\\Program Files (x86)\\Atmel\\Studio\\7.0\\toolchain\\arm\\arm-gnu-toolchain\\binarm-none-eabi-gdb.exe",

I will receive an error:

Unable to start debugging. The value of miDebuggerPath is invalid

So I moved the exe to my project path:

"miDebuggerPath": "C:\\workspace\\opendps\\opendps\\arm-none-eabi-gdb.exe",

I used the sample launch.json in issue #328 as a template and created this one:

{
    "version": "0.2.0",
    "configurations": [

        {
            "name": "Debug",
            "type": "cppdbg",
            "request": "launch",
            "miDebuggerPath": "C:\\workspace\\opendps\\opendps\\arm-none-eabi-gdb.exe",
            "targetArchitecture": "arm",
            "program": "C:\\workspace\\opendps\\opendps\\opendps.elf",

            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                },
            {
                "text": "file 'C:\\workspace\\opendps\\opendps\\opendps.elf'"
            },
            {
                "text": "target remote 192.168.8.130:3333"
            },
            {
                "text": "monitor reset init"
            }
                
            ],
            "externalConsole": false,
            "cwd": "C:\\workspace\\opendps\\opendps\\"
            }
    ]
}

Notice I have OpenOCD running on a Ubuntu VM (in VMWare not WSL)... when debugging with F5 with the above VSCode returns this error:

Unable to start debugging. Unexpected GDB output from command "-interpreter-exec console "file 'C:\\workspace\\opendps\\opendps\\opendps.elf'"". C:workspaceopendpsopend...

Note how the path is mashed without slash delimiters at the end of the error. No additional information is available. Debug window is blank. See attached.

vscodegdb_error

for reference, I am using the code found here: https://github.com/kanflo/opendps and I otherwise have the Ubuntu version of arm-none-eabi-gdb debugging properly with the given elf file from within the VM. I am also able to use the Atmel Studio arm-none-eabi-gdb.exe from within a DOS window to connect to the OpenOCD server and debug successfully. So the problem seems to be specific to VSCode.

edit: The Windows / Atmel Studioarm-none-eabi-gdb.exe --versionreturns:

GNU gdb (Atmel build: 487) 7.10.1.20160210-cvs
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-w64-mingw32 --target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".

edit 2: it seems that if windows paths are instead entered using forward slashes, instead of escaped backslashes, the error does not occur, even with spaces in the path:

"miDebuggerPath": "C:/Program Files (x86)/Atmel/Studio/7.0/toolchain/arm/arm-gnu-toolchain/bin/arm-none-eabi-gdb.exe",

I'm not sure if this is as intended so I will not close this issue at this time. The docs here:

https://code.visualstudio.com/docs/languages/cpp#_debugging
and
https://github.com/Microsoft/vscode-cpptools/blob/master/launch.md

seem to indicate that either forward slashes (for Linux) and escaped backslashes (for Windows) should work.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。