Author Topic: [SOLVED] Debugger fails to start  (Read 30660 times)

Offline neonBdragon

  • Single posting newcomer
  • *
  • Posts: 7
[SOLVED] Debugger fails to start
« on: April 10, 2018, 03:54:57 pm »
Hello, I yesterday I updated my old version of codeblocks (version 16.01) to codeblocks 17.12 and for some reason my debugger will fails to start.

Every time I attempt to debug one of my projects I would get this error message.
Code
Starting the debuggee failed: No executable specified, use `target exec'.

[debug]> quit

Debugger finished with status 0


I checked my compiler and debugger paths and they are both going to MinGW folder that installed with codeblocks.
Code
Toolchain executable path- E:\Program Files (x86)\CodeBlocks\MinGW
Debugger executable path- E:\Program Files (x86)\CodeBlocks\MinGW\bin\gdb32.exe

I'm not sure what I did in between me updating to the newer version to cause this, but if anyone could help me it would be much appreciated.

Here is my full debug log.
Code
Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: E:\myStuff\Programming\C++\Practice\codeBlocks\DataCleaner\
Adding source dir: E:\myStuff\Programming\C++\Practice\codeBlocks\DataCleaner\
Adding file: E:\myStuff\Programming\C++\Practice\codeBlocks\DataCleaner\bin\Debug\DataCleaner.exe
Changing directory to: E:/myStuff/Programming/C++/Practice/codeBlocks/DataCleaner/.
Set variable: PATH=.;E:\Program Files (x86)\CodeBlocks\MinGW\bin;E:\Program Files (x86)\CodeBlocks\MinGW;E:\C mingw32\bin;E:\C mingw32;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:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files\dotnet;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Program Files\MySQL\MySQL Utilities 1.6;E:\Program Files\Git\cmd;E:\Program Files\nodejs;C:\Users\mackimus\AppData\Local\Programs\Python\Python36-32\Scripts;C:\Users\mackimus\AppData\Local\Programs\Python\Python36-32;C:\Users\mackimus\AppData\Local\Microsoft\WindowsApps;E:\Program Files\Java\jdk1.8.0_121\bin;E:\Program Files\Java\jre1.8.0_121\bin;E:\Program Files\Microsoft VS Code\bin;E:\Program Files\LLVM\bin;C:\Program Files\MySQL\MySQL Server 5.7\bin;C:\Program Files\Microsoft VS Code\bin;C:\Users\mackimus\AppData\Roaming\npm;E:\Program Files\mingw-w64\x86_64-7.1.0-posix-seh-rt_v5-rev2\mingw64\bin

[debug]Command-line: E:\Program Files (x86)\CodeBlocks\MinGW\bin\gdb32.exe -nx -fullname -quiet  -args E:/myStuff/Programming/C++/Practice/codeBlocks/DataCleaner/bin/Debug/DataCleaner.exe
[debug]Working dir : E:\myStuff\Programming\C++\Practice\codeBlocks\DataCleaner

Starting debugger: E:\Program Files (x86)\CodeBlocks\MinGW\bin\gdb32.exe -nx -fullname -quiet  -args E:/myStuff/Programming/C++/Practice/codeBlocks/DataCleaner/bin/Debug/DataCleaner.exe
done

[debug]> set prompt >>>>>>cb_gdb:

Setting breakpoints

[debug]"E:/myStuff/Programming/C++/Practice/codeBlocks/DataCleaner/bin/Debug/DataCleaner.exe": not in executable format: File format not recognized
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 7.9.1
[debug]Copyright (C) 2015 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 "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) 7.9.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]> directory E:/myStuff/Programming/C++/Practice/codeBlocks/DataCleaner/
[debug]Source directories searched: E:/myStuff/Programming/C++/Practice/codeBlocks/DataCleaner;$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

« Last Edit: April 11, 2018, 12:38:54 am by neonBdragon »

Offline sodev

  • Regular
  • ***
  • Posts: 497
Re: Debugger fails to start
« Reply #1 on: April 10, 2018, 04:17:49 pm »
Code
[debug]"E:/myStuff/Programming/C++/Practice/codeBlocks/DataCleaner/bin/Debug/DataCleaner.exe": not in executable format: File format not recognized

Check if ur program actually got compiled and works, if it does, probably a mismatch of compiler and gdb. I can see 3 different MinGW on your path, one beeing 64 Bit and that gdb seems to be 32 Bit.

Offline neonBdragon

  • Single posting newcomer
  • *
  • Posts: 7
Re: Debugger fails to start
« Reply #2 on: April 10, 2018, 04:40:23 pm »
Code
[debug]"E:/myStuff/Programming/C++/Practice/codeBlocks/DataCleaner/bin/Debug/DataCleaner.exe": not in executable format: File format not recognized

Check if ur program actually got compiled and works, if it does, probably a mismatch of compiler and gdb. I can see 3 different MinGW on your path, one beeing 64 Bit and that gdb seems to be 32 Bit.

My program compiles and run fine. So, if my problem is due to having 3 different MinGW on my path. Do you know how to remove a MinGW from a path in codeblocks?

Offline neonBdragon

  • Single posting newcomer
  • *
  • Posts: 7
Re: Debugger fails to start
« Reply #3 on: April 10, 2018, 04:49:52 pm »
Code
[debug]"E:/myStuff/Programming/C++/Practice/codeBlocks/DataCleaner/bin/Debug/DataCleaner.exe": not in executable format: File format not recognized

Check if ur program actually got compiled and works, if it does, probably a mismatch of compiler and gdb. I can see 3 different MinGW on your path, one beeing 64 Bit and that gdb seems to be 32 Bit.

Okay, I moved that folder that had that 64-bit compiler on it to a different location on my drive, and that error message went away. Unfortunately, a new debugger error message appeared concerning threads.

Code
Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: E:\myStuff\Programming\C++\Practice\codeBlocks\DataCleaner\
Adding source dir: E:\myStuff\Programming\C++\Practice\codeBlocks\DataCleaner\
Adding file: E:\myStuff\Programming\C++\Practice\codeBlocks\DataCleaner\bin\Debug\DataCleaner.exe
Changing directory to: E:/myStuff/Programming/C++/Practice/codeBlocks/DataCleaner/.
Set variable: PATH=.;E:\Program Files (x86)\CodeBlocks\MinGW\bin;E:\Program Files (x86)\CodeBlocks\MinGW;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:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files\dotnet;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Program Files\MySQL\MySQL Utilities 1.6;E:\Program Files\Git\cmd;E:\Program Files\nodejs;C:\Users\mackimus\AppData\Local\Programs\Python\Python36-32\Scripts;C:\Users\mackimus\AppData\Local\Programs\Python\Python36-32;C:\Users\mackimus\AppData\Local\Microsoft\WindowsApps;E:\Program Files\Java\jdk1.8.0_121\bin;E:\Program Files\Java\jre1.8.0_121\bin;E:\Program Files\Microsoft VS Code\bin;E:\Program Files\LLVM\bin;C:\Program Files\MySQL\MySQL Server 5.7\bin;C:\Program Files\Microsoft VS Code\bin;C:\Users\mackimus\AppData\Roaming\npm

[debug]Command-line: E:\Program Files (x86)\CodeBlocks\MinGW\bin\gdb32.exe -nx -fullname -quiet  -args E:/myStuff/Programming/C++/Practice/codeBlocks/DataCleaner/bin/Debug/DataCleaner.exe
[debug]Working dir : E:\myStuff\Programming\C++\Practice\codeBlocks\DataCleaner

Starting debugger: E:\Program Files (x86)\CodeBlocks\MinGW\bin\gdb32.exe -nx -fullname -quiet  -args E:/myStuff/Programming/C++/Practice/codeBlocks/DataCleaner/bin/Debug/DataCleaner.exe
done

[debug]> set prompt >>>>>>cb_gdb:

Setting breakpoints

[debug]Reading symbols from E:/myStuff/Programming/C++/Practice/codeBlocks/DataCleaner/bin/Debug/DataCleaner.exe...
[debug]done.
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 7.9.1
[debug]Copyright (C) 2015 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 "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) 7.9.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]> directory E:/myStuff/Programming/C++/Practice/codeBlocks/DataCleaner/
[debug]Source directories searched: E:/myStuff/Programming/C++/Practice/codeBlocks/DataCleaner;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]Starting program: E:\myStuff\Programming\C++\Practice\codeBlocks\DataCleaner\bin\Debug\DataCleaner.exe

Child process PID: 18144

[debug][New Thread 18144.0xf34]
[debug][Inferior 1 (process 18144) exited with code 01]
[debug]>>>>>>cb_gdb:

[Inferior 1 (process 18144) exited with code 01]

[debug]> quit

Debugger finished with status 0


Offline sodev

  • Regular
  • ***
  • Posts: 497
Re: Debugger fails to start
« Reply #4 on: April 10, 2018, 04:55:49 pm »
The path variable comes from windows, you cannot easily modify that from CodeBlocks, you can maybe overwrite it to be empty, but its better to clean your path variable in windows.

But i don't think this has an effect on CodeBlocks, better check your settings again, are you really compiling your program with the toolchain you think you are? Check the build log to be sure.

Offline sodev

  • Regular
  • ***
  • Posts: 497
Re: Debugger fails to start
« Reply #5 on: April 10, 2018, 04:58:59 pm »
I don't see an error message there, i just see that your program terminates with exit code 1 :).

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debugger fails to start
« Reply #6 on: April 10, 2018, 05:00:00 pm »
This happens when the dynamic loader doesn't find a dll.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline neonBdragon

  • Single posting newcomer
  • *
  • Posts: 7
Re: Debugger fails to start
« Reply #7 on: April 10, 2018, 11:59:11 pm »
This happens when the dynamic loader doesn't find a dll.
Is there some way for me to provide the path of the dll to the dynamic loader?

Offline neonBdragon

  • Single posting newcomer
  • *
  • Posts: 7
Re: Debugger fails to start
« Reply #8 on: April 11, 2018, 12:02:07 am »
The path variable comes from windows, you cannot easily modify that from CodeBlocks, you can maybe overwrite it to be empty, but its better to clean your path variable in windows.

But i don't think this has an effect on CodeBlocks, better check your settings again, are you really compiling your program with the toolchain you think you are? Check the build log to be sure.
I rebuilt my program and the log said I am using mingw32.

Here are some lines from the build log.
Code
mingw32-g++.exe -Wall -fexceptions -Weffc++ -g -Weffc++ -g -Iinclude -c E:\myStuff\Programming\C++\Practice\codeBlocks\DataCleaner\main.cpp -o obj\Debug\main.o
mingw32-g++.exe -Wall -fexceptions -Weffc++ -g -Weffc++ -g -Iinclude -c E:\myStuff\Programming\C++\Practice\codeBlocks\DataCleaner\src\jsonParser.cpp -o obj\Debug\src\jsonParser.o
mingw32-g++.exe  -o bin\Debug\DataCleaner.exe obj\Debug\main.o obj\Debug\src\jsonParser.o   
In file included from E:\myStuff\Programming\C++\Practice\codeBlocks\DataCleaner\main.cpp:3:0:


Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debugger fails to start
« Reply #9 on: April 11, 2018, 12:06:52 am »
Is there some way for me to provide the path of the dll to the dynamic loader?
Yes, you have to modify the path env variable...
But first you need to know which dll is failing to load. This is the hard part!
Try to start the exe from explorer and see if there is an error message.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline neonBdragon

  • Single posting newcomer
  • *
  • Posts: 7
Re: Debugger fails to start
« Reply #10 on: April 11, 2018, 12:37:55 am »
I don't see an error message there, i just see that your program terminates with exit code 1 :).

Actually, I think the multiple compilers in my path was the error because my debugger works all of sudden. Thank you.
« Last Edit: April 11, 2018, 12:40:30 am by neonBdragon »

Offline neonBdragon

  • Single posting newcomer
  • *
  • Posts: 7
Re: Debugger fails to start
« Reply #11 on: April 11, 2018, 12:40:08 am »
Is there some way for me to provide the path of the dll to the dynamic loader?
Yes, you have to modify the path env variable...
But first you need to know which dll is failing to load. This is the hard part!
Try to start the exe from explorer and see if there is an error message.

I do not see an error message when I attempt to start the exe.