繁体   English   中英

Visual Studio Code安装和配置以进行调试

[英]Visual Studio Code setup and configuration for debug

我正在尝试启动调试会话。 不幸的是,gnome-terminal无法启动,出现了一些dbus错误。 但是,xterm可以正常工作。 我无法获得Visual Studio代码以使用Xterm。 我已附上我的配置和其他附加信息。 任何帮助表示赞赏。

用户设置:

   {  
      "workbench.colorTheme":"Quiet Light",
      "editor.fontSize":14,
      "julia.executablePath":"/usr/local/bin/julia",
      "files.associations": {  
         "*.jl":"julia"
      },
      "editor.fontFamily":"'DejaVu Sans Mono'",
      "editor.fontWeight":"bold",
      "editor.suggestFontSize":11,
      "clang.executable":"/clang/bin",
      "clang.cxxflags":[  
         "--std=c++11"
      ],
      "terminal.external.linuxExec":"/bin/xterm"
   }

调试设置

{  
   "name":"test",
   "type":"cppdbg",
   "request":"launch",
   "program":"${workspaceFolder}/a.out",
   "args":[],
   "stopAtEntry":false,
   "cwd":"${workspaceFolder}/build",
   "environment":[  
      {  
         "Name":"LD_LIBRARY_PATH",
         "Value":"/opt/gcc-7.3.0/lib64"
      }
   ],
   "externalConsole":false,
   "MIMode":"gdb",
   "miDebuggerPath":"/usr/bin/gdb",
   "logging":{  
      "engineLogging":true
   },
   "setupCommands":[  
      {  
         "description":"Enable pretty-printing for gdb",
         "text":"-enable-pretty-printing",
         "ignoreFailures":true
      }
   ]
}

从启动调试:

: (207) LaunchOptions<LocalLaunchOptions xmlns='http://schemas.microsoft.com/vstudio/MDDDebuggerOptions/2014'
1: (221) LaunchOptions ExePath='a.out'
1: (221) LaunchOptions WorkingDirectory='build'
1: (221) LaunchOptions ExeArguments='2018 0 2 0 5 2018 0 2 10'
1: (221) LaunchOptions MIMode='gdb'
1: (221) LaunchOptions MIDebuggerPath='/usr/bin/gdb'
1: (221) LaunchOptions WaitDynamicLibLoad='false'
1: (221) LaunchOptions>
1: (221) LaunchOptions 
1: (221) LaunchOptions -enable-pretty-printing
1: (221) LaunchOptions 
1: (221) LaunchOptions 
....................................
.............................................
1: (221) LaunchOptions
1: (301) TempFile=/tmp/Microsoft-MIEngine-fifo-o7umkzct.ydv
1: (301) TempFile=/tmp/Microsoft-MIEngine-fifo-rchtx3yv.2pf
1: (301) TempFile=/tmp/Microsoft-MIEngine-fifo-t6pq9ig2.q4j
1: (357) term-stderr:Option "--title" is deprecated and might be removed in a later version of gnome-terminal.
1: (364) term-stderr:Error constructing proxy for org.gnome.Terminal:/org/gnome/Terminal/Factory0: Error spawning command line 'dbus-launch --autolaunch=36e4fff9ca604cbc9c6743ae4bf5904b --binary-syntax --close-stderr': Child process exited with code 1

显然,除非缺少gnome终端,否则VS Code cpp-tools不会选择xterm。

https://github.com/Microsoft/vscode-cpptools/issues/1940

正如WardenGnaw在cpp-tools问题页面上发布的那样:

“ cpptools扩展使用MIEngine。如果gnome终端不存在,则MIEngine仅选择XTERM。”

https://github.com/Microsoft/MIEngine/blob/3d6454f4c2405a7dbf7d14f8c1a4882eb3fea66d/src/MICore/TerminalLauncher.cs#L179

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM