Теперь я собираюсь собрать и запустить свой первый проект CMake — простую cpp-программу «Hello world». Строится нормально, но когда приходит время его запускать, этого не происходит. Я вижу, как окно появляется и исчезает за долю секунды, и я вижу следующий отчет на вкладке консоли отладки. Кстати, x86_64 — это правильное предположение.
Код: Выделить всё
=thread-group-added,id="i1"
GNU gdb (GDB) 14.2
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
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:
.
Find the GDB manual and other documentation resources online at:
.
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 28868.0x567c]
[New Thread 28868.0x6c44]
[Thread 28868.0x7360 exited with code 3221225781]
[Thread 28868.0x6c44 exited with code 3221225781]
ERROR: Unable to start debugging. Unexpected GDB output from command "-exec-run". During startup program exited with code 0xc0000135.
The program 'C:\Users\com\Downloads\Prog24\Hello2\build\TestProgram.exe' has exited with code 0 (0x00000000).
Код: Выделить всё
Warning: Debuggee TargetArchitecture not detected, assuming x86_64.
=cmd-param-changed,param="pagination",value="off"
[Thread 10136.0x710c exited with code 3221225781]
[New Thread 10136.0x3138]
ERROR: Unable to start debugging. GDB exited unexpectedly.
The program 'C:\Users\com\Downloads\Prog24\Hello2\build\TestProgram.exe' has exited with code 0 (0x00000000).
ERROR: During startup program exited with code 0xc0000135.
Это знакомый сценарий? Что я каким-то образом установил не тот вариант GDB? Вот launch.json, и совершенно не важно, включена или опущена строка miDebuggerPath. Кстати, если я вызову gdb для целевого объекта вручную, а затем наберу для него «r», программа будет работать нормально.
Код: Выделить всё
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug",
"type": "cppdbg",
"request": "launch",
"program": "${command:cmake.launchTargetPath}",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [
{
"name": "PATH",
"value": "$PATH:${command:cmake.launchTargetDirectory}"
}
],
"externalConsole": true,
"MIMode": "gdb",
"miDebuggerPath": "c:/msys64/usr/bin/gdb.exe",
"preLaunchTask": "CMake: build",
"postDebugTask": ""
}
]
}
Подробнее здесь: https://stackoverflow.com/questions/796 ... d-exec-run
Мобильная версия