microsoft / microsoft/vscode-cpptools
BP cannot stop program in cygwin environment
Open
Nobody has claimed this yet.
debugger
more info needed
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 1.7k
- Avg merge
- 14h 46m
- Merged PRs (30d)
- 61
Description
Environment
- OS and version:
- Microsoft Windows [Version 10.0.19044.1645]
- VS Code:
- 1.66.2
- C/C++ extension:
- v1.1.0
- OS and version of remote machine (if applicable):
- 3.3.4-2
- GDB / LLDB version:
- gdb 10.2-1
- gcc 11.2.0
- g++ 11.2.0
Bug Summary and Steps to Reproduce
Bug Summary:
- Install latest C/C++ Extension Pack into VS Code
- Install latest Cygwin with gcc, g++
- create a cpp file as follows:
#include <iostream>
using namespace std;
int main(void)
{
cout << "Hello Wrold!!!" << endl;
return 0
}
- Add BP in the line cout
- Click "Start Debuging" button on the top-right
- The program will not be stopped and run with "Hello World" in the console
Debugger Configurations
launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"targetArchitecture": "x86",
"program": "${workspaceFolder}/${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"miDebuggerPath": "c:\\cygwin64\\bin\\gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "set disassembly-flavor as Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
],
"preLaunchTask": "complie"
}
]
}
tasks.json:
{
"version": "2.0.0",
"tasks": [
{
"label": "complie",
"type": "cppbuild",
"command": "g++",
"args": [
"-fdiagnostics-color=always",
"-g",
"${file}",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe"
],
"presentation": {
"reveal": "silent"
},
"problemMatcher": {
"owner": "cpp",
"fileLocation": [
"relative",
"${workspaceRoot}"
],
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
},
"options": {
"cwd": "${workspaceFolder}"
},
"group": {
"kind": "build",
"isDefault": true
},
"detail": "c:\\cygwin64\\bin\\g++.exe"
}
]
}
Debugger Logs
DEBUG CONSOLE:
=thread-group-added,id="i1"
GNU gdb (GDB) (Cygwin 10.2-1) 10.2
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-cygwin".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
=cmd-param-changed,param="pagination",value="off"
[New Thread 12460.0x56e0]
[New Thread 12460.0x3d28]
=library-unloaded,id="/cygdrive/c/windows/System32/umppc15005.dll",target-name="/cygdrive/c/windows/System32/umppc15005.dll",host-name="/cygdrive/c/windows/System32/umppc15005.dll",thread-group="i1"
[New Thread 12460.0x5004]
[New Thread 12460.0x53f4]
Thread 1 "test_c" hit Breakpoint 1, main () at C:\Users\yi.liu\Desktop\MyProjects\C_CPP\test_c.c:5
Loaded '/cygdrive/c/windows/SYSTEM32/ntdll.dll'. Symbols loaded.
Loaded '/cygdrive/c/windows/System32/KERNEL32.DLL'. Symbols loaded.
Loaded '/cygdrive/c/windows/System32/KERNELBASE.dll'. Symbols loaded.
Loaded '/usr/bin/cygwin1.dll'. Symbols loaded.
Loaded '/cygdrive/c/windows/System32/advapi32.dll'. Symbols loaded.
Loaded '/cygdrive/c/windows/System32/msvcrt.dll'. Symbols loaded.
Loaded '/cygdrive/c/windows/System32/sechost.dll'. Symbols loaded.
Loaded '/cygdrive/c/windows/System32/RPCRT4.dll'. Symbols loaded.
Loaded '/cygdrive/c/windows/SYSTEM32/CRYPTBASE.DLL'. Symbols loaded.
Loaded '/cygdrive/c/windows/System32/bcryptPrimitives.dll'. Symbols loaded.
Loaded '/cygdrive/c/windows/System32/umppc15005.dll'. Symbols loaded.
Loaded '/cygdrive/c/windows/system32/netapi32.dll'. Symbols loaded.
Loaded '/cygdrive/c/windows/SYSTEM32/LOGONCLI.DLL'. Symbols loaded.
Loaded '/cygdrive/c/windows/System32/ucrtbase.dll'. Symbols loaded.
Loaded '/cygdrive/c/windows/SYSTEM32/NETUTILS.DLL'. Symbols loaded.
Loaded '/cygdrive/c/windows/SYSTEM32/SAMCLI.DLL'. Symbols loaded.
Loaded '/cygdrive/c/windows/SYSTEM32/SAMLIB.dll'. Symbols loaded.
Loaded '/cygdrive/c/windows/System32/wldap32.dll'. Symbols loaded.
Loaded '/cygdrive/c/windows/System32/WS2_32.DLL'. Symbols loaded.
Loaded '/cygdrive/c/windows/system32/mswsock.dll'. Symbols loaded.
Loaded '/cygdrive/c/windows/SYSTEM32/SspiCli.dll'. Symbols loaded.
Loaded '/cygdrive/c/windows/System32/user32.dll'. Symbols loaded.
Loaded '/cygdrive/c/windows/System32/win32u.dll'. Symbols loaded.
Loaded '/cygdrive/c/windows/System32/GDI32.dll'. Symbols loaded.
Loaded '/cygdrive/c/windows/System32/gdi32full.dll'. Symbols loaded.
Loaded '/cygdrive/c/windows/System32/msvcp_win.dll'. Symbols loaded.
Loaded '/cygdrive/c/windows/System32/IMM32.DLL'. Symbols loaded.
[Thread 12460.0x346c exited with code 0]
[Thread 12460.0x3d28 exited with code 0]
[Thread 12460.0x56e0 exited with code 0]
[Thread 12460.0x53f4 exited with code 0]
[Inferior 1 (process 12460) exited normally]
The program 'C:\Users\Administrator\Desktop\MyProjects\C_CPP/test_c.exe' has exited with code 0 (0x00000000).
Other Extensions
- CMake v0.0.17
- CMake Tools v1.10.5
- Doxygen Documentation Generator v1.4.0
- Jenkinsfile Support v0.1.0
- Remote - Containers v0.231.6
- Remote-SSH v0.78.0
- Remote-SSH Editing Configuration Files v0.80.0
- Remote-WSL v0.66.0
- vscode-icons v11.11.0
Additional Information
vscode's settings.json
{
"terminal.integrated.profiles.windows": {
"C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe (migrated)": {
"path": "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
"args": []
}
},
"terminal.integrated.defaultProfile.windows": "Windows PowerShell",
"editor.fontFamily": "'Inconsolata', 'Fira Code', monospace",
"workbench.iconTheme": "vscode-icons",
"editor.suggestSelection": "first",
"debug.console.fontFamily": "'Inconsolata', 'Fira Code', monospace",
"debug.console.fontSize": 16,
"scm.inputFontFamily": "'Fira Code Medium', 'Courier New', monospace",
"terminal.integrated.fontFamily": "'Inconsolata', 'Fira Code', monospace",
"terminal.integrated.fontSize": 16,
"json.maxItemsComputed": 1e+240,
"javascript.updateImportsOnFileMove.enabled": "always",
"explorer.confirmDelete": false,
"workbench.editor.showTabs": true,
"workbench.editor.enablePreview": true,
"workbench.editor.pinnedTabSizing": "compact",
"[javascript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"workbench.colorTheme": "Default Light+",
"files.associations": {
"*.cjson": "jsonc",
"*.wxss": "css",
"*.wxs": "javascript"
},
"emmet.includeLanguages": {
"wxml": "html"
},
"remote.SSH.remotePlatform": {
"app-nlu-releng": "linux",
"jenkins-slave-05.crg.cerence.net": "linux"
},
"security.workspace.trust.untrustedFiles": "open",
"settingsSync.ignoredSettings": [
"-C_Cpp.default.includePath"
],
"C_Cpp.default.includePath": [
"C:\\cygwin64\\usr\\include"
],
"editor.fontSize": 16,
"workbench.startupEditor": "none",
"editor.fontLigatures": false,
"editor.fontWeight": 600,
"debug.onTaskErrors": "showErrors",
"debug.allowBreakpointsEverywhere": true,
"C_Cpp.debugShortcut": true,
"debug.showInlineBreakpointCandidates": false,
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the breakpoint behavior with the provided launch.json and tasks.json under Windows and Cygwin, then compare the debugger log's breakpoint hit with the reported continued execution. Trace the Cygwin/GDB debugging entry point responsible for stopping at breakpoints. Done means the breakpoint reliably pauses the program and the stop behavior matches the report.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100