When I try to run the debugger I get this error:
Starting the debuggee failed: No executable specified, use `target exec'
I have been struggling with this for hours now.
I have removed any spaces from my project name.
I have tried downloading a different mingw version from here: https://sourceforge.net/projects/mingw-w64/files/mingw-w64/
I have the codeblocks-20.03mingw-setup.exe version installed.
I have Windows 10 64bit.
This is the log I get:
Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: C:\as\asdf\
Adding source dir: C:\as\asdf\
Adding file: C:\as\asdf\bin\Debug\asdf.exe
Changing directory to: C:/as/asdf/.
Set variable: PATH=.;C:\Program Files\CodeBlocks\MinGW\bin;C:\Program Files\CodeBlocks\MinGW;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Python27;C:\Python27\Scripts;C:\Program Files\Python39\Scripts;C:\Program Files\Python39;C:\Program Files (x86)\Intel\iCLS Client;C:\Program Files\Intel\iCLS Client;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Git\cmd;C:\Program Files (x86)\GitExtensions;C:\Program Files (x86)\Microsoft VS Code\bin;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\PuTTY;C:\Program Files (x86)\nodejs;C:\Program Files (x86)\Bitvise SSH Client;C:\Users\Pouria\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\Nmap;D:\Program Files\_bin\UnixUtils;D:\Program Files\_bin;D:\Program Files\_bin\aliases;C:\Users\Pouria\AppData\Local\Programs\Fiddler;C:\Users\Pouria\AppData\Roaming\npm;D:\Program Files\hashcat-6.1.1;D:\Program Files\ffmpeg-4.3.1-win32-shared\bin;D:\Program Files\ImageMagick-7.0.10;D:\wamp\bin\php\php7.2.4;D:\Personal Folder\Pouria\My Documents\_0NirLauncher\SysInternals;D:\Program Files\Arduino-cli;C:\Program Files (x86)\GnuWin32\bin
Starting debugger: C:\mingw64\bin\gdb.exe -nx -fullname -quiet -args C:/as/asdf/bin/Debug/asdf.exe
done
Setting breakpoints
Debugger name and version: GNU gdb (GDB) 8.1
Starting the debuggee failed: No executable specified, use `target exec'.
Debugger finished with status 0
Can you share your project file?
Is C:\as\asdf\bin\Debug\asdf.exe present?
Have you changed something in the project settings?
Just to be safe I created a new project with just the sample "Hello world" code.
Here is the project file
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="sample" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
<Target title="Debug">
<Option output="bin/Debug/sample" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Debug/" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
<Add option="-g" />
</Compiler>
</Target>
<Target title="Release">
<Option output="bin/Release/sample" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Release/" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
<Add option="-O2" />
</Compiler>
<Linker>
<Add option="-s" />
</Linker>
</Target>
</Build>
<Compiler>
<Add option="-Wall" />
<Add option="-fexceptions" />
</Compiler>
<Unit filename="main.cpp" />
<Extensions>
<lib_finder disable_auto="1" />
</Extensions>
</Project>
</CodeBlocks_project_file>
- Yes the file "C:\sample\bin\Debug\sample.exe" exists
- I have not changed anything in the project settings. It's the default new project.
The log when I click debug:
Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: C:\sample\
Adding source dir: C:\sample\
Adding file: C:\sample\bin\Debug\sample.exe
Changing directory to: C:/sample/.
Set variable: PATH=.;C:\Program Files\CodeBlocks\MinGW\bin;C:\Program Files\CodeBlocks\MinGW;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Python27;C:\Python27\Scripts;C:\Program Files\Python39\Scripts;C:\Program Files\Python39;C:\Program Files (x86)\Intel\iCLS Client;C:\Program Files\Intel\iCLS Client;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Git\cmd;C:\Program Files (x86)\GitExtensions;C:\Program Files (x86)\Microsoft VS Code\bin;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\PuTTY;C:\Program Files (x86)\nodejs;C:\Program Files (x86)\Bitvise SSH Client;C:\Users\Pouria\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\Nmap;D:\Program Files\_bin\UnixUtils;D:\Program Files\_bin;D:\Program Files\_bin\aliases;C:\Users\Pouria\AppData\Local\Programs\Fiddler;C:\Users\Pouria\AppData\Roaming\npm;D:\Program Files\hashcat-6.1.1;D:\Program Files\ffmpeg-4.3.1-win32-shared\bin;D:\Program Files\ImageMagick-7.0.10;D:\wamp\bin\php\php7.2.4;D:\Personal Folder\Pouria\My Documents\_0NirLauncher\SysInternals;D:\Program Files\Arduino-cli;C:\Program Files (x86)\GnuWin32\bin
Starting debugger: C:\Program Files\CodeBlocks\MinGW\bin\gdb.exe -nx -fullname -quiet -args C:/sample/bin/Debug/sample.exe
done
Setting breakpoints
Debugger name and version: GNU gdb (GDB) 8.1
Starting the debuggee failed: No executable specified, use `target exec'.
Debugger finished with status 0
Can you enable full debug logging in "Settings->Debugger->Common->full debug log" and post the debug log again here?
ps. thank you for posting the log from the beginning :)
Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: C:\sample\
Adding source dir: C:\sample\
Adding file: C:\sample\bin\Debug\sample.exe
Changing directory to: C:/sample/.
Set variable: PATH=.;C:\CodeBlocks32\CodeBlocks\MinGW\bin;C:\CodeBlocks32\CodeBlocks\MinGW;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Python27;C:\Python27\Scripts;C:\Program Files\Python39\Scripts;C:\Program Files\Python39;C:\Program Files (x86)\Intel\iCLS Client;C:\Program Files\Intel\iCLS Client;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Git\cmd;C:\Program Files (x86)\GitExtensions;C:\Program Files (x86)\Microsoft VS Code\bin;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\PuTTY;C:\Program Files (x86)\nodejs;C:\Program Files (x86)\Bitvise SSH Client;C:\Users\Pouria\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\Nmap;D:\Program Files\_bin\UnixUtils;D:\Program Files\_bin;D:\Program Files\_bin\aliases;C:\Users\Pouria\AppData\Local\Programs\Fiddler;C:\Users\Pouria\AppData\Roaming\npm;D:\Program Files\hashcat-6.1.1;D:\Program Files\ffmpeg-4.3.1-win32-shared\bin;D:\Program Files\ImageMagick-7.0.10;D:\wamp\bin\php\php7.2.4;D:\Personal Folder\Pouria\My Documents\_0NirLauncher\SysInternals;D:\Program Files\Arduino-cli;C:\Program Files (x86)\GnuWin32\bin
[debug]Command-line: C:\Program Files\CodeBlocks\MinGW\bin\gdb.exe -nx -fullname -quiet -args C:/sample/bin/Debug/sample.exe
[debug]Working dir : C:\sample
Starting debugger: C:\Program Files\CodeBlocks\MinGW\bin\gdb.exe -nx -fullname -quiet -args C:/sample/bin/Debug/sample.exe
done
[debug]> set prompt >>>>>>cb_gdb:
Setting breakpoints
[debug]Reading symbols from C:/sample/bin/Debug/sample.exe...done.
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 8.1
[debug]Copyright (C) 2018 Free Software Foundation, Inc.
[debug]License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
[debug]This is free software: you are free to change and redistribute it.
[debug]There is NO WARRANTY, to the extent permitted by law. Type "show copying"
[debug]and "show warranty" for details.
[debug]This GDB was configured as "x86_64-w64-mingw32".
[debug]Type "show configuration" for configuration details.
[debug]For bug reporting instructions, please see:
[debug]<http://www.gnu.org/software/gdb/bugs/>.
[debug]Find the GDB manual and other documentation resources online at:
[debug]<http://www.gnu.org/software/gdb/documentation/>.
[debug]For help, type "help".
[debug]Type "apropos word" to search for commands related to "word".
[debug]>>>>>>cb_gdb:
[debug]> set confirm off
Debugger name and version: GNU gdb (GDB) 8.1
[debug]>>>>>>cb_gdb:
[debug]> set width 0
[debug]>>>>>>cb_gdb:
[debug]> set height 0
[debug]>>>>>>cb_gdb:
[debug]> set breakpoint pending on
[debug]>>>>>>cb_gdb:
[debug]> set print asm-demangle on
[debug]>>>>>>cb_gdb:
[debug]> set unwindonsignal on
[debug]>>>>>>cb_gdb:
[debug]> set print elements 200
[debug]>>>>>>cb_gdb:
[debug]> set new-console on
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor att
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> target exec
[debug]No executable file now.
[debug]>>>>>>cb_gdb:
[debug]> directory C:/sample/
[debug]Source directories searched: C:/sample;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]No executable specified, use `target exec'.
[debug]Starting program:
[debug]>>>>>>cb_gdb:
Starting the debuggee failed: No executable specified, use `target exec'.
[debug]> quit
Debugger finished with status 0
Also, have you seen this: https://stackoverflow.com/questions/67045842/how-do-you-debug-using-codeblocks-20-03-the-mingw-version ?
I have but I did not have a prior mingw installation.
But just to be sure I downloaded mingw64 and used the gdb.exe that came with it, but it also gave me the same error.
I even found a gdb.exe with version 10 somehow, but that also gave me the same error.
So now you have a "working" GDB as in should.
Can you do the following:
1) Zip up your project file and the main.cpp and attach it as a zip file.
2) Can you also zip up the following file and attach the zip: C:\Users\<your user name>\AppData\Roaming\CodeBlocks\default.conf
3) Can you also include the output from the following Codeblocks dialog as text: a) Select the Help->About menu b) Click on the information tab
c) Select the text in the information tab and copy it into the response post.
BTW Nothing to do with C::B, but your path indicates you have a number of different things installed that you may want to check out for upgrades and also check the path to see what gets found before other apps in the path as you have multiple Unix utils in different directories. I have been burnt in the past with the path having old unix utilities before the newer ones....
I've attached the files.
And here's the info:
Name : Code::Blocks
Version : 20.03-r11983
SDK Version : 2.0.0
Scintilla Version: 3.7.5
Author : The Code::Blocks Team
E-mail : info@codeblocks.org
Website : http://www.codeblocks.org
wxWidgets Library (wxMSW port)
Version 3.1.3 (Unicode: wchar_t, debug level: 1),
compiled at Nov 1 2019 18:53:26
Runtime version of toolkit used is 10.0.
I think the problem lies with the gdb itself tho.
I'm not familiar with how it works, but when I try to invoke it directly using CMD and outside of C::B I still get the same message.
Namely, when I run this:
"C:\Program Files\CodeBlocks\MinGW\bin\gdb.exe" -nx -fullname -quiet -args C:/sample/bin/Debug/sample.exe
gdb starts and says:
Reading symbols from C:/sample/bin/Debug/sample.exe...
(gdb)
And then when I enter "target exec" I get this response:
(gdb) target exec
No executable file now.
(gdb)
I'm not sure but I think it fails to "import" the exe file or whatever.