2

I am trying to set up a project in VSCode or Visual Studio (both actually), to build and debug software on QNX target. So far, I can get debugging by attaching to process to work properly, however, when I am setting up debugging session to run the process:

        "customLaunchSetupCommands": [
            {
                "text": "-enable-pretty-printing",
                "ignoreFailures": true
            },
            {
                "text": "set solib-search-path <mypath on host>",
                "ignoreFailures": true
            },
            {
                "text": "file <exe on host>",
                "description": "load file",
                "ignoreFailures": false
            },
            {
                "text": "handle SIGQUIT nostop",
                "ignoreFailures": true
            },
            {
                "description": "Connect to target",
                "text": "target qnx <mytarget>",
                "ignoreFailures": false
            },
            {
                "text": "upload <exe on host> <exe on target>",
                "ignoreFailures": false
            },
            {
                "text": "run",
                "ignoreFailures": false
            }
        ],

debugging session fails: error message I get the same error in Visual Studio and VSCode. I am using gdb locally on host (ntoaarch64-gdb that came with QNX installation)

Serge
  • 1,027
  • 14
  • 21

1 Answers1

5

Had the exact same problem, after some testing with different attributes the following is working:

{
  "version": "0.2.1",
  "defaults": {},
  "configurations": [
    {
      "type": "cppdbg",
      "targetArchitecture": "arm",
      "project": "CMakeLists.txt",
      "projectTarget": "$target",
      "program": "$path-to-binary",
      "name": "$name",
      "miDebuggerPath": "C:/qnx660/host/win32/x86/usr/bin/ntoarmv7-gdb.exe",
      "MIMode": "gdb",
      "externalConsole": true,
      "launchCompleteCommand": "exec-run",
      "stopOnEntry": true,


      "setupCommands": [
        {
          "description": "setup target",
          "text": "target qnx 192.168.101.11:8000"
        },
        {
          "description": "upload",
          "text": "upload $path /tmp/test-signals"
        },
        {
          "description": "load symbols",
          "text": "file $path"
        }
      ]
    }
  ]
}

I think the most important part is to remove the run command and add "launchCompleteCommand": "exec-run".

Hope this helps someone as it was driving me crazy :)

Karamba
  • 138
  • 2
  • 15