Bug Type: Debugger
- OS: Windows 10
- VS Code Version: 1.57.0
- C/C++ Extension Version: 1.5.0-Insiders
- GDB Version: 10.2 (via MSYS2)
- GCC Version 10.2.0 (via MSYS2)
The Problem
When I try to debug an executable, the debug console has the following error
ERROR: Unable to start debugging. Unexpected GDB output from command "-exec-run". Error creating process /usr/bin/C:\\Checked_Out\\PIC_Drivers\\LIN_Master_Slave/C:\Checked_Out\PIC_Drivers\LIN_Master_Slave/test_ceedling/build/test/out/foo.out, (error 2).
Note that the path listed is a concatenation of paths (Msys2 GDB path, workspaceFolder, and the actual path to the executable).
The break point (set on print line in foo.c) is ignored.
To Reproduce
launch.json
"configurations": [
{
"name": "Debug Test",
"type": "cppdbg",
"request": "launch",
//"preLaunchTask": "Ceedling test",
"program": "${workspaceFolder}/test_ceedling/build/test/out/${fileBasenameNoExtension}.out",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"logging": {
"engineLogging": true
},
"MIMode": "gdb",
"miDebuggerPath": "C:/msys64/usr/bin/gdb.exe",
// "sourceFileMap": {
// "\\c":"C:\\"
// },
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
C:\Checked_Out\PIC_Drivers\LIN_Master_Slave\test_ceedling\test\drivers_lin\foo.c
Compiled via gcc -g -o .\test_ceedling\build\test\out\foo.out .\test_ceedling\test\drivers_lin\foo.c
int main(){
printf("Howdy\n");
return 1;
}
Command Printed on Terminal window when starting debug
& 'c:\Users\XXXXX\.vscode\extensions\ms-vscode.cpptools-1.5.0-insiders\debugAdapters\bin\WindowsDebugLauncher.exe' '--stdin=Microsoft-MIEngine-In-mjmxer35.qfv' '--stdout=Microsoft-MIEngine-Out-rwzy3jm4.ibe' '--stderr=Microsoft-MIEngine-Error-5sf3fcqh.013' '--pid=Microsoft-MIEngine-Pid-psyrrdnu.5fu' '--dbgExe=C:/msys64/usr/bin/gdb.exe' '--interpreter=mi'
Debug Console Output
1: (255) Wait for connection completion.
1: (694) ->=thread-group-added,id="i1"
1: (696) ->~"GNU gdb (GDB) 10.2\n"
1: (696) ->~"Copyright (C) 2021 Free Software Foundation, Inc.\n"
1: (696) ->~"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law."
1: (696) ->~"\nType \"show copying\" and \"show warranty\" for details.\n"
1: (696) ->~"This GDB was configured as \"x86_64-pc-msys\".\n"
1: (697) ->~"Type \"show configuration\" for configuration details.\n"
1: (697) ->~"For bug reporting instructions, please see:\n"
1: (697) ->~"<https://www.gnu.org/software/gdb/bugs/>.\n"
1: (698) ->~"Find the GDB manual and other documentation resources online at:\n <http://www.gnu.org/software/gdb/documentation/>."
1: (698) ->~"\n\n"
1: (698) ->~"For help, type \"help\".\n"
1: (698) ->~"Type \"apropos word\" to search for commands related to \"word\".\n"
1: (710) ->(gdb)
1: (714) <-1001-gdb-set target-async on
1: (716) ->1001^done
1: (716) ->(gdb)
1: (716) ->&"\n"
1: (716) ->^done
1: (716) ->(gdb)
1: (718) 1001: elapsed time 4
1: (731) <-1002-enable-pretty-printing
1: (734) ->1002^done
1: (734) ->(gdb)
1: (734) 1002: elapsed time 3
1: (735) ->&"\n"
1: (735) ->^done
1: (735) ->(gdb)
1: (735) <-1003-interpreter-exec console "set pagination off"
1: (736) ->=cmd-param-changed,param="pagination",value="off"
1: (736) ->1003^done
1: (736) 1003: elapsed time 0
1: (736) <-1004-gdb-set auto-solib-add on
1: (736) ->(gdb)
1: (736) ->&"\n"
1: (736) ->^done
1: (737) ->(gdb)
1: (738) ->1004^done
1: (738) 1004: elapsed time 1
1: (738) ->(gdb)
1: (738) ->&"\n"
1: (738) ->^done
1: (738) ->(gdb)
1: (738) <-1005-gdb-set solib-search-path C:\\Checked_Out\\PIC_Drivers\\LIN_Master_Slave/test_ceedling/build/test/out;
1: (740) ->1005^done
1: (740) 1005: elapsed time 2
1: (740) ->(gdb)
1: (740) <-1006-environment-cd C:\\Checked_Out\\PIC_Drivers\\LIN_Master_Slave
1: (740) ->&"\n"
1: (740) ->^done
1: (741) ->(gdb)
1: (742) ->1006^done
1: (742) 1006: elapsed time 1
1: (742) ->(gdb)
1: (743) ->&"\n"
1: (743) ->^done
1: (743) ->(gdb)
1: (747) <-1007-interpreter-exec console "show configuration"
1: (748) ->~"This GDB was configured as follows:\n configure --host="
1: (748) ->~"x86_64-pc-msys --target=x86_64-pc-msys\n"
1: (748) ->~" --with-auto-load-dir=$debugdir:$datadir/auto-load\n --with-auto-load-safe-path="
1: (748) ->~"$debugdir:$datadir/auto-load\n"
1: (748) ->~" --with-expat\n"
1: (749) ->~" --with-gdb-datadir=/usr/share/gdb (relocatable)\n"
1: (749) ->~" --with-jit-reader-dir=/usr/lib/gdb (relocatable)\n"
1: (749) ->~" --without-libunwind-ia64\n"
1: (749) ->~" --with-lzma\n"
1: (749) ->~" --without-babeltrace\n"
1: (749) ->~" --without-intel-pt\n"
1: (749) ->~" --with-mpfr\n"
1: (749) ->~" --without-xxhash\n"
1: (749) ->~" --with-python=/usr (relocatable)\n"
1: (749) ->~" --with-python-libdir=/usr/lib (relocatable)\n"
1: (750) ->~" --without-debuginfod\n"
1: (750) ->~" --without-guile\n"
1: (750) ->~" --disable-source-highlight\n"
1: (750) ->~" --with-separate-debug-dir=/usr/lib/debug (relocatable)\n"
1: (750) ->~" --with-system-gdbinit=/etc/gdbinit\n"
1: (750) ->~"\n(\"Relocatable\" means the directory can be moved with the GDB installation\ntree, and GDB will still find it.)\n"
1: (750) ->1007^done
1: (750) ->(gdb)
1: (750) 1007: elapsed time 3
1: (751) ->&"\n"
1: (751) ->^done
1: (751) ->(gdb)
1: (752) <-1008-file-exec-and-symbols C:\\Checked_Out\\PIC_Drivers\\LIN_Master_Slave/test_ceedling/build/test/out/foo.out
1: (770) ->1008^done
1: (770) ->(gdb)
1: (770) 1008: elapsed time 17
1: (770) ->&"\n"
1: (770) <-1009-interpreter-exec console "show architecture"
1: (770) ->^done
1: (770) ->(gdb)
1: (773) ->~"The target architecture is set to \"auto\" (currently \"i386:x86-64\").\n"
1: (773) ->1009^done
1: (773) 1009: elapsed time 2
1: (773) ->(gdb)
1: (773) ->&"\n"
1: (773) ->^done
1: (773) ->(gdb)
1: (774) <-1010-exec-arguments 2>CON 1>CON <CON
1: (777) ->1010^done
1: (777) 1010: elapsed time 2
1: (777) <-1011-break-insert -f main
1: (777) ->(gdb)
1: (777) ->&"\n"
1: (777) ->^done
1: (777) ->(gdb)
1: (783) ->1011^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0000000100401088",func="main",file=".\\test_ceedling\\test\\drivers_lin\\foo.c",fullname="/c/Checked_Out/PIC_Drivers/LIN_Master_Slave/test_ceedling/test/drivers_lin/foo.c",line="2",thread-groups=["i1"],times="0",original-location="main"}
1: (783) ->(gdb)
1: (783) ->&"\n"
1: (783) ->^done
1: (784) ->(gdb)
1: (791) 1011: elapsed time 14
1: (801) Send Event AD7EngineCreateEvent
1: (805) Send Event AD7ProgramCreateEvent
1: (838) ShellPid=3104
1: (870) DebuggerPid=67832
1: (913) <-1012-break-insert -f foo.c:3
1: (921) ->&"No source file named foo.c.\n"
1: (921) ->1012^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="<PENDING>",pending="foo.c:3",times="0",original-location="foo.c:3"}
1: (921) 1012: elapsed time 7
1: (921) ->(gdb)
1: (921) ->&"\n"
1: (921) ->^done
1: (921) ->(gdb)
1: (931) Send Event AD7BreakpointErrorEvent
1: (978) Send Event AD7LoadCompleteEvent
=thread-group-added,id="i1"
GNU gdb (GDB) 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-msys".
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"
1: (985) <-1013-exec-run
1: (990) ->1013^error,msg="Error creating process /usr/bin/C:\\\\Checked_Out\\\\PIC_Drivers\\\\LIN_Master_Slave/C:\\Checked_Out\\PIC_Drivers\\LIN_Master_Slave/test_ceedling/build/test/out/foo.out, (error 2)."
1: (990) 1013: elapsed time 5
1: (990) ->(gdb)
1: (990) ->&"\n"
1: (990) ->^done
1: (990) ->(gdb)
1: (993) Send Event AD7MessageEvent
ERROR: Unable to start debugging. Unexpected GDB output from command "-exec-run". Error creating process /usr/bin/C:\\Checked_Out\\PIC_Drivers\\LIN_Master_Slave/C:\Checked_Out\PIC_Drivers\LIN_Master_Slave/test_ceedling/build/test/out/foo.out, (error 2).
1: (1005) <--gdb-exit
1: (1006) ->^exit
1: (1015) Send Event AD7ProgramDestroyEvent
The program 'C:\Checked_Out\PIC_Drivers\LIN_Master_Slave\test_ceedling\build\test\out\foo.out' has exited with code 42 (0x0000002a).
1: (1021) Shell exited, stop debugging
Bug Type: Debugger
The Problem
When I try to debug an executable, the debug console has the following error
ERROR: Unable to start debugging. Unexpected GDB output from command "-exec-run". Error creating process /usr/bin/C:\\Checked_Out\\PIC_Drivers\\LIN_Master_Slave/C:\Checked_Out\PIC_Drivers\LIN_Master_Slave/test_ceedling/build/test/out/foo.out, (error 2).Note that the path listed is a concatenation of paths (Msys2 GDB path, workspaceFolder, and the actual path to the executable).
The break point (set on print line in foo.c) is ignored.
To Reproduce
launch.json
C:\Checked_Out\PIC_Drivers\LIN_Master_Slave\test_ceedling\test\drivers_lin\foo.c
Compiled via
gcc -g -o .\test_ceedling\build\test\out\foo.out .\test_ceedling\test\drivers_lin\foo.cCommand Printed on Terminal window when starting debug
& 'c:\Users\XXXXX\.vscode\extensions\ms-vscode.cpptools-1.5.0-insiders\debugAdapters\bin\WindowsDebugLauncher.exe' '--stdin=Microsoft-MIEngine-In-mjmxer35.qfv' '--stdout=Microsoft-MIEngine-Out-rwzy3jm4.ibe' '--stderr=Microsoft-MIEngine-Error-5sf3fcqh.013' '--pid=Microsoft-MIEngine-Pid-psyrrdnu.5fu' '--dbgExe=C:/msys64/usr/bin/gdb.exe' '--interpreter=mi'Debug Console Output