microsoft / VSLinux

VS extension for C++ Linux development
205 stars 34 forks source link

embedded arm development - gdb doesn't connect to openocd and returns monitor errors #361

Closed TerryFogg closed 5 years ago

TerryFogg commented 5 years ago

Visual Studio 15.9.4 openocd 0.10.0 STM32F769I-DISCO board.

Cannot start debug session, error "monitor\" command not supported by this target.\n"

I have captured the following log of the debug session. I get the error "monitor\" command not supported by this target.\n"

This is the same error you get at the gdb command line if you type "monitor" without first submitting the following command "target remote localhost:3333"

I can't see any place in the log below where this occurs?

Any help appreciated.

5: (501420) LaunchOptions{ 5: (501420) LaunchOptions "type": "cppdbg", 5: (501420) LaunchOptions "name": "nanobooter.elf", 5: (501420) LaunchOptions "project": "Build\nanobooter.elf", 5: (501420) LaunchOptions "cwd": "C:\nf-interpreter", 5: (501420) LaunchOptions "program": "C:\nf-interpreter\BUILD\nanobooter.elf", 5: (501420) LaunchOptions "MIMode": "gdb", 5: (501420) LaunchOptions "externalConsole": true, 5: (501420) LaunchOptions "inheritEnvironments": [ 5: (501420) LaunchOptions "gcc_arm" 5: (501420) LaunchOptions ], 5: (501420) LaunchOptions "miDebuggerPath": "C:/Program Files (x86)/GNU Tools Arm Embedded/7 2018-q2-update/bin/arm-none-eabi-gdb.exe", 5: (501420) LaunchOptions "targetArchitecture": "arm", 5: (501420) LaunchOptions "setupCommands": [ 5: (501420) LaunchOptions { 5: (501420) LaunchOptions "text": "-environment-cd C:\nf-interpreter\Build" 5: (501420) LaunchOptions }, 5: (501420) LaunchOptions { 5: (501420) LaunchOptions "text": "-file-exec-and-symbols c:/nf-interpreter/build/nanobooter.elf", 5: (501420) LaunchOptions "description": "load file", 5: (501420) LaunchOptions "ignoreFailures": false 5: (501420) LaunchOptions }, 5: (501420) LaunchOptions { 5: (501420) LaunchOptions "text": "-enable-pretty-printing", 5: (501420) LaunchOptions "ignoreFailures": false 5: (501420) LaunchOptions }, 5: (501420) LaunchOptions { 5: (501420) LaunchOptions "text": "monitor reset halt ", 5: (501420) LaunchOptions "ignoreFailures": false 5: (501420) LaunchOptions } 5: (501420) LaunchOptions ], 5: (501420) LaunchOptions "showDisplayString": true, 5: (501420) LaunchOptions "miDebuggerServerAddress": "localhost:3333", 5: (501420) LaunchOptions "launchCompleteCommand": "None", 5: (501420) LaunchOptions "debugServerPath": "C:\nf-support\Tools\openocd\bin\openocd.exe", 5: (501420) LaunchOptions "debugServerArgs": "-s \"C:\nf-support\Tools\openocd\bin\scripts/\" -f interface/stlink-v2-1.cfg -f board/stm32f7discovery.cfg", 5: (501420) LaunchOptions "serverStarted": "Info\ :\ [\w\d\.]*:\ hardware", 5: (501420) LaunchOptions "filterStderr": true, 5: (501420) LaunchOptions "filterStdout": true, 5: (501420) LaunchOptions "target": "C:\nf-interpreter\Build\nanobooter.elf" 5: (501420) LaunchOptions} 5: (501420) Starting: "C:\nf-support\Tools\openocd\bin\openocd.exe" -s "C:\nf-support\Tools\openocd\bin\scripts/" -f interface/stlink-v2-1.cfg -f board/stm32f7discovery.cfg 5: (501489) Starting: "C:/Program Files (x86)/GNU Tools Arm Embedded/7 2018-q2-update/bin/arm-none-eabi-gdb.exe" --interpreter=mi 5: (501489) DebuggerPid=19664 5: (501535) ->=thread-group-added,id="i1" 5: (501535) ->~"GNU gdb (GNU Tools for Arm Embedded Processors 7-2018-q2-update) 8.1.0.20180315-git\n" 5: (501535) ->~"Copyright (C) 2018 Free Software Foundation, Inc.\n" 5: (501542) ->~"License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law. Type \"show copying\"\nand \"show warranty\" for details.\n" 5: (501542) ->~"This GDB was configured as \"--host=i686-w64-mingw32 --target=arm-none-eabi\".\nType \"show configuration\" for configuration details." 5: (501542) ->~"\nFor bug reporting instructions, please see:\n" 5: (501542) ->~"http://www.gnu.org/software/gdb/bugs/.\n" 5: (501542) ->~"Find the GDB manual and other documentation resources online at:\nhttp://www.gnu.org/software/gdb/documentation/.\n" 5: (501542) ->~"For help, type \"help\".\n" 5: (501542) ->~"Type \"apropos word\" to search for commands related to \"word\".\n" 5: (501542) ->(gdb) 5: (501542) <-1001-gdb-set target-async on 5: (501542) ->1001^done 5: (501542) ->(gdb) 5: (501542) 1001: elapsed time 0 5: (501542) ->&"\n" 5: (501542) <-1002-environment-cd C:\nf-interpreter\Build 5: (501542) ->^done 5: (501542) ->(gdb) 5: (501542) ->1002^done 5: (501542) ->(gdb) 5: (501542) 1002: elapsed time 0 5: (501542) <-1003-file-exec-and-symbols c:/nf-interpreter/build/nanobooter.elf 5: (501542) ->&"\n" 5: (501542) ->^done 5: (501542) ->(gdb) 5: (501573) ->1003^done 5: (501573) ->(gdb) 5: (501573) 1003: elapsed time 31 5: (501573) <-1004-enable-pretty-printing 5: (501573) ->&"\n" 5: (501573) ->^done 5: (501573) ->(gdb) 5: (501573) ->1004^done 5: (501573) ->(gdb) 5: (501573) 1004: elapsed time 0 5: (501573) ->&"\n" 5: (501573) <-1005-interpreter-exec console "monitor reset halt" 5: (501573) ->^done 5: (501573) ->(gdb) 5: (501573) ->&"\"monitor\" command not supported by this target.\n" 5: (501573) ->1005^error,msg="\"monitor\" command not supported by this target." 5: (501573) ->(gdb) 5: (501573) 1005: elapsed time 0 5: (501573) ->&"\n" 5: (501573) ->^done 5: (501573) ->(gdb) 5: (501573) <--gdb-exit 5: (501589) ->^exit 5: (501589) <-logout 5: (501589) <-logout

itodirel commented 5 years ago

@yuehuang010 @paulmaybee could you take a look?

TerryFogg commented 5 years ago

I re-read my issue, and I see I didn't mention I was using Visual Studio 2017 edition with a CMake project and a launch.vs.json file

TerryFogg commented 5 years ago

Of course, this may not be the correct place to raise this issue?

paulmaybee commented 5 years ago

can you attach you launch.vs.json?

yuehuang010 commented 5 years ago

If you started the server manually first, then try using starting GDB. Does that help?

itodirel commented 5 years ago

please reopen if still an issue, we'd be happy to help; and if this is still a problem, please open a issue for us on the Developer Community

We retired this issue list, here on Github. We now adopted and using the Developer Community (https://developercommunity.visualstudio.com/spaces/62/index.html), for Cross Plat and Linux experiences (and C++ all up generally), which we are actively monitoring. Please use the Developer Community, to report issues or suggestions for bugs or new experiences. Further discussions on this thread here on Github might be unmonitored. If there is further comments or context in this current issue, please create a new issue on the Developer Community and mention it there. For existing issues which we can reproduce, or anything that is actionable to us, we will provide an update right here, in this thread. For new suggestions or issues, which at this time are in our roadmap, or we believe and have evidence that it will broadly and/or significantly benefit everyone, we will open a suggestion ticket, with the issue or suggestion, and link it here.