Vscode-cpptools: trying to replicate a gdbinit file

Created on 29 Jan 2018  路  2Comments  路  Source: microsoft/vscode-cpptools

I have the following gdbinit that I'm trying to replicate in a launch.json file:

#*****************************************************************************
#Connect To the tartget using OpenOCD
#*****************************************************************************
target remote | e:/openocd-0.10.0/bin/openocd.exe -c "gdb_port pipe; log_output openocd.log" -f cc3200.cfg

#*****************************************************************************
# Load the binary
#*****************************************************************************
load

#*****************************************************************************
# Initialize the SP and PC values from the application's 
# vector table
#*****************************************************************************
set $sp = g_pfnVectors[0]
set $pc = g_pfnVectors[1]

#*****************************************************************************
# Set break point at main and run to main
#*****************************************************************************
break main
continue

the above is supposed to be used in called from the command prompt with arm-none-eabi-gdb -x gdbinit nanoCLR.elf. And it works just fine: the image is loaded and after sending a continue command the target starts to do it's thing.

I would like to be able to either: 1) start a debug session from VS Code (I can't find a way to do that) or 2) replicate the above in the launch.json.
So far I have

        {
            "MIMode": "gdb",
            "name": "CC3200 Launchpad nanoCLR",
            "type": "cppdbg",
            "request": "launch",

            "logging": {
                "engineLogging": true,
                "traceResponse": true
            },

            "setupCommands": [
                {"text": "target remote | e:/openocd-0.10.0/bin/openocd.exe -c \"gdb_port pipe; log_output openocd.log\" -f E:/TI/CC3200SDK_1.3.0/cc3200-sdk/tools/gcc_scripts/cc3200.cfg"},
                {"text": "monitor reset halt"},
                {"text": "file e:/GitHub/nf-interpreter/build/nanoCLR.elf"},
                {"text": "load"},
                {"text": "set $sp = g_pfnVectors[0]"},
                {"text": "set $pc = g_pfnVectors[1]"},
                {"text": "continue"},
            ],

            "customLaunchSetupCommands": [
            ],

            "miDebuggerPath": "E:/GNU_Tools_ARM_Embedded/6-2017-q2-update/bin/arm-none-eabi-gdb.exe",
            "targetArchitecture": "ARM",
            "program": "${workspaceRoot}/build/nanoCLR.elf",

            "launchCompleteCommand": "None",
            "serverStarted": "Info\\ :\\ [\\w\\d\\.]*:\\ hardware",
            "externalConsole": false,
            "filterStderr": true,
            "cwd": "${cwd}"
        } 

Which doesn't work because the last continue there breaks the execution with the error
Unexpected GDB output from command "-interpreter-exec console "continue"". Unexpected ResultClass from MI Debugger. Expected 'done' but received 'running'.

Any help is appreciated.

debugger

Most helpful comment

@josesimoes for your last continue, can you add "ignoreFailures": true to the object and then you might be ok? We expect that a successful command would give us done and not running. Alternatively, if you change launchCompleteCommands to continue it should do the same continue command.

All 2 comments

@josesimoes for your last continue, can you add "ignoreFailures": true to the object and then you might be ok? We expect that a successful command would give us done and not running. Alternatively, if you change launchCompleteCommands to continue it should do the same continue command.

@pieandcakes you are THE man!! That "ignoreFailures": true did it.
I'm now able to debug that target!

Thank you very much. 馃槂

Was this page helpful?
0 / 5 - 0 ratings