【问题标题】:QNX gdb integration with VS or VSCodeQNX gdb 与 VS 或 VSCode 集成
【发布时间】:2020-03-31 16:32:22
【问题描述】:

我正在尝试在 VSCode 或 Visual Studio(实际上都是)中建立一个项目,以在 QNX 目标上构建和调试软件。 到目前为止,我可以通过附加到进程以正常工作来进行调试,但是,当我设置调试会话以运行进程时:

        "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
            }
        ],

调试会话失败: 我在 Visual Studio 和 VSCode 中遇到同样的错误。 我在主机上本地使用 gdb(QNX 安装附带的 ntoaarch64-gdb)

【问题讨论】:

    标签: visual-studio visual-studio-code gdb vscode-debugger qnx


    【解决方案1】:

    遇到了完全相同的问题,经过一些不同属性的测试后,以下工作正常:

    {
      "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"
            }
          ]
        }
      ]
    }
    

    我认为最重要的部分是删除运行命令并添加 "launchCompleteCommand": "exec-run"

    希望这对某人有所帮助,因为它让我发疯:)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-03-22
      • 2011-06-25
      • 2019-01-12
      • 1970-01-01
      • 1970-01-01
      • 2021-10-08
      相关资源
      最近更新 更多