I am trying to understand how to write an app by learning the sphinx3_decode code. However, I couldn't find a way to debug the code. Check the compilation and make file, the "-g" for debug build is there. However, gdb does not recognize the executable as a debug program.
-- ----------- Here is what I got from running gdb------------------ [programs]$ gdb sphinx3_decode
GNU gdb Red Hat Linux (6.3.0.0-1.63rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"..."/home/.../workspace/sphinx3/src/programs/sphinx3_decode": not in executable format: File format not recognized
(gdb) run
Starting program:
No executable file specified.
Use the "file" or "exec-file" command.
(gdb) b 5
No symbol table is loaded. Use the "file" command.
(gdb) quit
------------ excerpt from the compilation log--------------------
I am trying to understand how to write an app by learning the sphinx3_decode code. However, I couldn't find a way to debug the code. Check the compilation and make file, the "-g" for debug build is there. However, gdb does not recognize the executable as a debug program.
-- ----------- Here is what I got from running gdb------------------
[programs]$ gdb sphinx3_decode
GNU gdb Red Hat Linux (6.3.0.0-1.63rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"..."/home/.../workspace/sphinx3/src/programs/sphinx3_decode": not in executable format: File format not recognized
(gdb) run
Starting program:
No executable file specified.
Use the "file" or "exec-file" command.
(gdb) b 5
No symbol table is loaded. Use the "file" command.
(gdb) quit
------------ excerpt from the compilation log--------------------
/bin/sh ../../libtool --mode=link gcc -g -O3 -Wall -L/home/machine1/cmuspeech/tutorial/sphinx3/../sphinxbase/src/libsphinxfe -L/home/machine1/cmuspeech/tutorial/sphinx3/../sphinxbase/src/libsphinxad -L/home/machine1/cmuspeech/tutorial/sphinx3/../sphinxbase/src/libsphinxbase -o sphinx3_cfg2fsg main_cfg2fsg.o ../../src/libs3decoder/libs3decoder.la -lsphinxbase -lsphinxad -lm
gcc -g -O3 -Wall -o .libs/sphinx3_cfg2fsg main_cfg2fsg.o -L/home/machine1/cmuspeech/tutorial/sphinx3/../sphinxbase/src/libsphinxfe -L/home/machine1/cmuspeech/tutorial/sphinx3/../sphinxbase/src/libsphinxad -L/home/machine1/cmuspeech/tutorial/sphinx3/../sphinxbase/src/libsphinxbase ../../src/libs3decoder/.libs/libs3decoder.a /home/machine1/cmuspeech/tutorial/sphinx3/../sphinxbase/src/libsphinxbase/.libs/libsphinxbase.so /home/machine1/cmuspeech/tutorial/sphinx3/../sphinxbase/src/libsphinxad/.libs/libsphinxad.so /home/machine1/cmuspeech/tutorial/sphinxbase/src/libsphinxbase/.libs/libsphinxbase.so -lasound -lpthread -lblas -llapack -lm -Wl,--rpath -Wl,/usr/local/lib
creating sphinx3_cfg2fsg
You are a genius!! It works. :)
Google is the best linux expert in such situations :)
Actually you need to run
libtool gdb ./sphinx3_decode
since libtool hides the binary in .libs and replaces it by the script.