microsoft / microsoft/vscode-cpptools

vscode debug error:Unable to start debugging. Unexpected GDB output from command "-exec-run". During startup program exited with code 0xc0000139.

Open
#13,126 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug debugger help wanted
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Environment
  • OS and version: win11
  • VS Code:
  • C/C++ extension:14.2.0
  • OS and version of remote machine (if applicable):
  • GDB / LLDB version:15.2
Bug Summary and Steps to Reproduce

Bug Summary: when I applied the vscode to debug my code, I get error messager :Unable to start debugging. Unexpected GDB output from command "-exec-run". During startup program exited with code 0xc0000139.

info:
I found that if there are 'std::list li={6,7,8,9};' and 'SigLF.push_back(1.0)' in my code. I see error:Unable to start debugging. Unexpected GDB output from command "-exec-run". During startup program exited with code 0xc0000139.
But, if I comment these code, I can debug my code.

Debugger Configurations
tasks.json:
'
{
	"version": "2.0.0",
	"tasks": [
		{
			"type": "shell",
            "label": "compile",
            "command": "g++",
            "args": [
                "-g",
                "${file}",
                "-o",
                "${fileDirname}\\${fileBasenameNoExtension}.exe"
            ],
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            }
		}
	]
}
'

launch.json:
'
{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "C/C++",
            "type": "cppdbg",
            "request": "launch",
            "program": "${fileDirname}/${fileBasenameNoExtension}.exe",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "miDebuggerPath": "gdb.exe",
            "preLaunchTask": "compile",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
        }


    ]
}
'
Debugger Logs
=thread-group-added,id="i1"
GNU gdb (GDB) 15.2
Copyright (C) 2024 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-w64-mingw32".
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".
Warning: Debuggee TargetArchitecture not detected, assuming x86_64.
=cmd-param-changed,param="pagination",value="off"
[New Thread 33576.0x9550]
[New Thread 33576.0x6e74]
[New Thread 33576.0xaf84]
[Thread 33576.0xaf84 exited with code 3221225785]
[Thread 33576.0xcb4 exited with code 3221225785]
[Thread 33576.0x9550 exited with code 3221225785]
ERROR: Unable to start debugging. Unexpected GDB output from command "-exec-run". During startup program exited with code 0xc0000139.
The program 'c:\zy_temp\c_test\output\test_code.exe' has exited with code 0 (0x00000000).
Other Extensions

No response

Additional Information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure with the provided tasks.json and launch.json configurations on Windows 11, using GDB 15.2 and the logged -exec-run command. Compare runs with and without std::list and SigLF.push_back(1.0); done means identifying whether the failure is caused by the extension, debugger, toolchain, or configuration and establishing a verified resolution.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, vscode
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.