microsoft / microsoft/vscode-cpptools

[Feature Request] Separate SetupCommands for before and after debuggee info passed to gdb

Open
#2,745 6 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

debugger embedded Feature Request
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

I'm trying to pass some extra commands after the launch of GDB. These commands are working if I enter them manually in the debug console of Visual Studio, prefixed with "-exec", after GDB started. I'd like to use setupCommands to do it automatically with the launch.json file. Here is what my file looks like :

{
            //General
            "name": "PyraDebug",
            "type": "cppdbg",
            "request": "launch",
            "program": "/Users/Squarp/Code/pyrapro/build/pyrapro/pyrapro.elf",
            "targetArchitecture": "ARM",
            "launchCompleteCommand": "None",            
            "cwd": "${workspaceFolder}",            
            "externalConsole": false,       
        
            //GDB Server
            "MIMode": "gdb",
            "miDebuggerServerAddress": "localhost:3333",
            "miDebuggerPath": "/Users/Squarp/Code/opt/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-gdb",
            "miDebuggerArgs": "",
            "stopAtEntry": true,
            "serverLaunchTimeout": 2000,
            "setupCommands": [
                {"text": "monitor reset halt"},
                {"text": "load"},
                {"text":"continue"}
            ],
            "customLaunchSetupCommands": [],
            "logging": { "engineLogging": true, "trace": true, "traceResponse": true } 

            //Tasks
            // "preLaunchTask": "rebuild"
            

        }

And the error :

Unable to start debugging. Unexpected GDB output from command "-interpreter-exec console "monitor reset halt"". "monitor" command not supported by this target.

Those commands are pretty classic, I tried many things but I'm stuck now. Everything is working fine if I enter those in Terminal.

Any help would be greatly appreciated.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue does not name a repository file or test; start by tracing how cppdbg launch.json setupCommands are processed and how GDB startup output is handled. Compare the requested before- and after-debuggee stages with the existing customLaunchSetupCommands behavior. Done means launch configurations can place commands in the requested stages without breaking current GDB setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
vscode
Domain
devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.