Skip to content

MIMode doesn't use RemoteGdbTarget functionality when setup by .gdbinit #1546

Description

@boardmanus

In order to make our debugging environment reusable across multiple systems and projects, we make heavy use of .gdbinit and the python support that allows. In this way, the environment can be determined without having to add custom details to a users launch configuration. We can just set the launch configuration generically, and it will works for everyone in the project without changes. It also makes the launch configuration easy to configure, as the appropriate gdb environment is automatically selected and configured, and all the custom details are internal. eg;

    {
      "name": "Debug App,
      "type": "cppdbg",
      "request": "launch",
      "cwd": "${workspaceFolder}",
      "program": "${workspaceFolder}/build/debug-linux-armv8-static/app",
      "args": [],
      "stopAtEntry": true,
      "externalConsole": false,
      "MIMode": "gdb",
      "miDebuggerPath": "${workspaceFolder}/debug/gdb_wrapper.sh",
      "miDebuggerArgs": "build/debug-linux-armv8-static/app",
    },

This all works great, apart from the fact that when the gdb_wrapper.sh and .gdbinit connect to a remote target, and MIEngine assumes it is a local connection because no miDebuggerServerAddress was provided. This results in the Pause UI using the incorrect method to break into the application. The launch configuration is committed in the git repo, and the server address is custom to the user, so we don't want to provide it.

Would it be possible to add a field that tells the MIEngine that a remote target was used, even though it was configured by the cppdbg plugin, but rather by gdb?

In the snippet above, I know I'm debugging a remote armv8 application, and so if something like "forceRemoteConnection": true, could be specified, and the MIEngine used that in IsRemoteGdbTarget(), then the cppdbg debug UI would work in this generic case.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions