Author Topic: Why do I get "Starting the debuggee failed: No executable file specified."?  (Read 14628 times)

Offline crobar

  • Multiple posting newcomer
  • *
  • Posts: 15
I have a makefile based project I would like to debug. when I attempt to do so I get the debug log below and the error  "Starting the debuggee failed: No executable file specified.". The place were I would expect the program name to be is empty, there are no spaces in the file name (I gather this causes problems from other forum posts). The program runs exactly as expected when I just run it from code::block without debugging.

Could anyone explain what I might be doing wrong?


Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
all
Adding source dir: /home/rcrozier/src/qucs_git_crobarcro/qucs-core/
Adding source dir: /home/rcrozier/src/qucs_git_crobarcro/qucs-core/
Adding file: /home/rcrozier/build/qucs_git_crobarcro/src/qucsator
Changing directory to: /home/rcrozier/src/qucs_git_crobarcro/qucs-core/.
Set variable: LD_LIBRARY_PATH=.:

[debug]Command-line: /usr/bin/gdb -nx -fullname -quiet  -args /home/rcrozier/build/qucs_git_crobarcro/src/qucsator
[debug]Working dir : /home/rcrozier/src/qucs_git_crobarcro/qucs-core

Starting debugger: /usr/bin/gdb -nx -fullname -quiet  -args /home/rcrozier/build/qucs_git_crobarcro/src/qucsator
done

[debug]"/home/rcrozier/build/qucs_git_crobarcro/src/qucsator": not in executable format: File format not recognised
[debug](gdb)
[debug]> set prompt >>>>>>cb_gdb:

Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints

[debug]>>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
[debug]Copyright (C) 2014 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-linux-gnu".
[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 (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.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 0
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor intel
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> source /usr/share/codeblocks/scripts/stl-views-1.0.3.gdb
[debug]>>>>>>cb_gdb:
[debug]> directory /home/rcrozier/src/qucs_git_crobarcro/qucs-core/
[debug]Source directories searched: /home/rcrozier/src/qucs_git_crobarcro/qucs-core:$cdir:$cwd
[debug]>>>>>>cb_gdb:
[debug]> set args -i ~/Documents/qucsator_hang_bug.net
[debug]>>>>>>cb_gdb:
[debug]> break "/home/rcrozier/src/qucs_git_crobarcro/qucs-core/src/components/tswitch.cpp:244"
[debug]No symbol table is loaded.  Use the "file" command.
[debug]Breakpoint 2 ("/home/rcrozier/src/qucs_git_crobarcro/qucs-core/src/components/tswitch.cpp:244") pending.
[debug]>>>>>>cb_gdb:
[debug]> break "/home/rcrozier/src/qucs_git_crobarcro/qucs-core/src/ucs.cpp:78"
[debug]No symbol table is loaded.  Use the "file" command.
[debug]Breakpoint 3 ("/home/rcrozier/src/qucs_git_crobarcro/qucs-core/src/ucs.cpp:78") pending.
[debug]>>>>>>cb_gdb:
[debug]Using terminal's PID as console PID 15375, TTY /dev/pts/5
[debug]> tty /dev/pts/5
[debug]Queued:[tty /dev/pts/5]
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]No executable file specified.
[debug]Use the "file" or "exec-file" command.
[debug]Starting program:  -i ~/Documents/qucsator_hang_bug.net
[debug]>>>>>>cb_gdb:

Starting the debuggee failed: No executable file specified.

[debug]> quit

Debugger finished with status 0

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
i think you have to set your output file (code blocks does not know how your output file is called, if you use custom makefiles)
Project->Properties->Build Targets->Output Filename

Set this for your debug target...

greetings

Offline crobar

  • Multiple posting newcomer
  • *
  • Posts: 15
i think you have to set your output file (code blocks does not know how your output file is called, if you use custom makefiles)
Project->Properties->Build Targets->Output Filename

Set this for your debug target...

greetings

Actually I only have one target 'all', but I had already set the option Project->Properties->Build Targets->Output Filename for this target (remember the program runs fine when I just use the 'run' option). However, just to be sure I created a 'Debug target, but it makes no difference. Thanks though.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
First:
please use code-tags, if you post log-content or sources, it's much more readable.

Is the filename mentioned in the log really the executable ?
Can you run it through gdb on a console ?
What shows "file <exename>" ?

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
On windows i had the same problem by using different compiler and debugger versions
ex. mingw64 compiler but tdm gdb

Is the filename mentioned in the log really the executable ?
Can you run it through gdb on a console ?
What shows "file <exename>" ?
is a good idea...

Offline crobar

  • Multiple posting newcomer
  • *
  • Posts: 15
Yes, sorry I'll use the right code tags next time (I realised I messed this up just after posting and saw other peoples posts with the proper code tags)

However, I think I've found the root of the problem. This program is a thin wrapper for a shared library. Its built using autotools, and before installing, the executable is not in fact the binary (as you suggest), but is actually a shell script created by libtool which sets up lib dirs and things. I expect this is the problem. I'm not sure yet if there is any way to get around this, my first attempt will be to actually install the program somewhere and run it from there.

Offline crobar

  • Multiple posting newcomer
  • *
  • Posts: 15
For future googlers I can confirm this is the solution, I configured my project with

Code
configure <blan blah> --prefix=/opt

After building did
Code
make install

Then changed Project->Properties->Build Targets->Output Filename to /opt/bin/<executeable name> (in my case /opt/bin/qucsator)

Debugging now works as expected.

Thanks for the help everyone.