Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugging stuck when using with vscode remote development #3582

Closed
litanlitudan opened this issue May 4, 2019 · 10 comments
Closed

Debugging stuck when using with vscode remote development #3582

litanlitudan opened this issue May 4, 2019 · 10 comments

Comments

@litanlitudan
Copy link

Type: Debugger
Input information below

Please review existing issues and our documentation at https://github.com/Microsoft/vscode-cpptools/tree/master/Documentation prior to filing an issue.

Describe the bug

  • OS and Version: Local: OSX 10.14.3, Remote: Ubuntu 16.04.6 LTS
  • VS Code Version: 1.34.0
  • C/C++ Extension Version: 0.22.1
  • Other extensions you installed (and if the issue persists after disabling them):
  • A clear and concise description of what the bug is.

In $workspace folder, I have an a.out file compiled by gcc -g test.c
My debug configuration is as the following:
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/a.out",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}

To Reproduce
Please include a code sample and launch.json configuration.
Steps to reproduce the behavior:

  1. Go to launch.json and configure the file as aforementioned
  2. Click on '....'
  3. VSCode stuck

Additional context
If applicable, please include logging by adding "logging": { "engineLogging": true, "trace": true, "traceResponse": true } in your launch.json
Add any other context about the problem here including log or error messages in your Debug Console or Output windows.

@pieandcakes
Copy link
Contributor

What happens when you enable logging?

@pieandcakes pieandcakes added debugger more info needed The issue report is not actionable in its current state labels May 4, 2019
@pieandcakes pieandcakes self-assigned this May 4, 2019
@litanlitudan
Copy link
Author

Thanks for the response.
I just tried to investigate the logging, but nothing debug process related info showed up.
I guess it might be the issue that debugger cannot setup communication with c/cpp remote module.
However, for the normal intellisense, the logs do show up in the logging window.

For logging, I followed this instruction:
https://github.com/Microsoft/vscode-cpptools/blob/master/Documentation/LanguageServer/Enabling%20logging.md

@litanlitudan
Copy link
Author

These are the logs
textDocument/hover: 4
textDocument/documentHighlight: 5
cpptools/textEditorSelectionChange
textDocument/codeAction: 6
textDocument/hover: 7
textDocument/hover: 8
textDocument/hover: 9
cpptools/textEditorSelectionChange
textDocument/codeAction: 10
cpptools/textEditorSelectionChange
textDocument/codeAction: 11
textDocument/hover: 12
textDocument/documentHighlight: 13
cpptools/textEditorSelectionChange
textDocument/codeAction: 14
cpptools/textEditorSelectionChange
textDocument/codeAction: 15
cpptools/textEditorSelectionChange
textDocument/codeAction: 16

@pieandcakes
Copy link
Contributor

The logging steps are here.

@litanlitudan
Copy link
Author

Thanks for correct me the logging process.
Here is the log:
--> E (output): {"event":"output","body":{"category":"console","output":"1: (135) LaunchOptions<LocalLaunchOptions xmlns='http://schemas.microsoft.com/vstudio/MDDDebuggerOptions/2014'\n"},"seq":2,"type":"event"}
1: (135) LaunchOptions<LocalLaunchOptions xmlns='http://schemas.microsoft.com/vstudio/MDDDebuggerOptions/2014'
--> E (output): {"event":"output","body":{"category":"console","output":"1: (143) LaunchOptions ExePath='/home/tanli/745-Project/workflow/a.out'\n"},"seq":4,"type":"event"}
1: (143) LaunchOptions ExePath='/home/tanli/745-Project/workflow/a.out'
--> E (output): {"event":"output","body":{"category":"console","output":"1: (144) LaunchOptions WorkingDirectory='/home/tanli/745-Project/workflow'\n"},"seq":6,"type":"event"}
1: (144) LaunchOptions WorkingDirectory='/home/tanli/745-Project/workflow'
--> E (output): {"event":"output","body":{"category":"console","output":"1: (144) LaunchOptions ExeArguments=''\n"},"seq":8,"type":"event"}
1: (144) LaunchOptions ExeArguments=''
--> E (output): {"event":"output","body":{"category":"console","output":"1: (144) LaunchOptions MIMode='gdb'\n"},"seq":10,"type":"event"}
1: (144) LaunchOptions MIMode='gdb'
--> E (output): {"event":"output","body":{"category":"console","output":"1: (145) LaunchOptions MIDebuggerPath=''\n"},"seq":12,"type":"event"}
1: (145) LaunchOptions MIDebuggerPath=''
--> E (output): {"event":"output","body":{"category":"console","output":"1: (145) LaunchOptions WaitDynamicLibLoad='false'\n"},"seq":14,"type":"event"}
1: (145) LaunchOptions WaitDynamicLibLoad='false'
--> E (output): {"event":"output","body":{"category":"console","output":"1: (145) LaunchOptions ExternalConsole='true'\n"},"seq":16,"type":"event"}
1: (145) LaunchOptions ExternalConsole='true'
--> E (output): {"event":"output","body":{"category":"console","output":"1: (145) LaunchOptions>\n"},"seq":18,"type":"event"}
1: (145) LaunchOptions>
--> E (output): {"event":"output","body":{"category":"console","output":"1: (146) LaunchOptions \n"},"seq":20,"type":"event"}
1: (146) LaunchOptions
--> E (output): {"event":"output","body":{"category":"console","output":"1: (146) LaunchOptions -enable-pretty-printing\n"},"seq":22,"type":"event"}
1: (146) LaunchOptions -enable-pretty-printing
--> E (output): {"event":"output","body":{"category":"console","output":"1: (146) LaunchOptions \n"},"seq":24,"type":"event"}
1: (146) LaunchOptions
--> E (output): {"event":"output","body":{"category":"console","output":"1: (146) LaunchOptions\n"},"seq":26,"type":"event"}
1: (146) LaunchOptions
--> E (output): {"event":"output","body":{"category":"console","output":"1: (252) DbgCmd:echo $$ > /tmp/Microsoft-MIEngine-Pid-psxtvcq1.5mh ; cd /home/tanli/745-Project/workflow ; DbgTerm=tty ; set -o monitor ; trap 'rm /tmp/Microsoft-MIEngine-In-8k0xwyb7.bch /tmp/Microsoft-MIEngine-Out-mb38ui50.drs /tmp/Microsoft-MIEngine-Pid-psxtvcq1.5mh /tmp/Microsoft-MIEngine-Cmd-xcw12o71.k5m' EXIT ; /usr/bin/gdb --interpreter=mi --tty=$DbgTerm < /tmp/Microsoft-MIEngine-In-8k0xwyb7.bch > /tmp/Microsoft-MIEngine-Out-mb38ui50.drs & clear; pid=$! ; echo $pid > /tmp/Microsoft-MIEngine-Pid-psxtvcq1.5mh ; wait $pid; \n"},"seq":28,"type":"event"}
1: (252) DbgCmd:echo $$ > /tmp/Microsoft-MIEngine-Pid-psxtvcq1.5mh ; cd /home/tanli/745-Project/workflow ; DbgTerm=tty ; set -o monitor ; trap 'rm /tmp/Microsoft-MIEngine-In-8k0xwyb7.bch /tmp/Microsoft-MIEngine-Out-mb38ui50.drs /tmp/Microsoft-MIEngine-Pid-psxtvcq1.5mh /tmp/Microsoft-MIEngine-Cmd-xcw12o71.k5m' EXIT ; /usr/bin/gdb --interpreter=mi --tty=$DbgTerm < /tmp/Microsoft-MIEngine-In-8k0xwyb7.bch > /tmp/Microsoft-MIEngine-Out-mb38ui50.drs & clear; pid=$! ; echo $pid > /tmp/Microsoft-MIEngine-Pid-psxtvcq1.5mh ; wait $pid;
--> C (runInTerminal-30): {"command":"runInTerminal","arguments":{"kind":"external","title":"cppdbg: a.out","cwd":"","args":["sh","/tmp/Microsoft-MIEngine-Cmd-xcw12o71.k5m"],"env":{}},"seq":30,"type":"request"}
--> E (output): {"event":"output","body":{"category":"console","output":"1: (274) Wait for connection completion.\n"},"seq":32,"type":"event"}
1: (274) Wait for connection completion.

@pieandcakes
Copy link
Contributor

pieandcakes commented May 7, 2019

@litanlitudan Thank you. This seems to be an issue with your console application not existing, that can be set in VS Code. Please refer to this to help you resolve it.

The overarching issue is a VS Code issue that doesn't error when launching terminal applications : microsoft/vscode#67296

@pieandcakes pieandcakes added duplicate external and removed more info needed The issue report is not actionable in its current state labels May 7, 2019
@litanlitudan
Copy link
Author

litanlitudan commented May 7, 2019

@pieandcakes Thanks for the info. But it still doesn't work. Here is what I tried, maybe I am missing some step:

  1. check the terminal for external use, in this case, it's xterm.

Screenshot 2019-05-07 15 31 24

  1. I checked that xterm is install on the remote server, which is true. But the duegger generate the same log.

  2. I also tried different console, such as gnome-terminal, terminator... none of them work.

  3. I also try to set up such configuration in the config.json for Remote, but vscode complains that such configuration is only configurable in user.settings.

@pieandcakes
Copy link
Contributor

@litanlitudan With remote I don't know if changing that locally changes that on remote. That's a question for VSCode Team. Can you try and change externalConsole in your launch.json to false and see if that works?

@litanlitudan
Copy link
Author

@pieandcakes Yeah, debugger works after changing externalConsole to false. Yeah, I guess that should be the issue for the remote module, not the c/c++ module. Also, c/c++ module works perfectly well with external console locally. What is the difference between using integrated console or external console? Is there any performance difference? Thanks for your help anyway!

@pieandcakes pieandcakes changed the title Stuck when using with vscode remote development module Debugging stuck when using with vscode remote development May 7, 2019
@pieandcakes
Copy link
Contributor

There is no difference between integrated console and external console when debugging on Linux except that one is a separate window. With the fact that you are mixing two OSes I don't know what the problem is in your case unfortunately.

I'm going to close this for now.

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

No branches or pull requests

2 participants