Set gdb to capture subprocess in vscode or visual studio remote development

Use vscode or visual studio for remote development, especially when developing components such as python plug-ins, you need to debug so/dll. At this time, set gdb to capture the subprocess to debug correctly. You need to add gdb options in the debug configuration file, as follows:

{
  "version": "0.2.1",
  "defaults": {},
  "configurations": [
    {
      "type": "cppgdb",
      "name": "pseudo_launch",
      "project": "CMakeLists.txt",
      "projectTarget": "pseudo_launch",
      "comment": "Learn how to configure remote debugging. For more info, see http://aka.ms/vslinuxdebug",
      "debuggerConfiguration": "gdb",
      "MIMode": "gdb",
      "args": [],
      "env": {},
      "cwd": "/root/.vs/doctotext/41b8d2f8-5097-4451-8ec1-f3c03ecbf211/out/build/Linux-GCC-Debug/",
      "setupCommands": [
        {
          "text": "-gdb-set follow-fork-mode child" // 捕获子进程
        }
      ]
    }
  ]
}

Guess you like

Origin blog.csdn.net/znsoft/article/details/130975979