microsoft / microsoft/vscode-cpptools

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

Offen
#706 3 Kommentare 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

@pieandcakes arbeitet bereits daran.

Seit 10.5.2017.

debugger embedded
Vorherrschende Sprache
TypeScript
Sterne
6.2k
Forks
1.7k
Ø Merge
14 Std. 46 Min.
Gemergte PRs (30 T.)
61

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.