gdb "not in executable format: File format not recognized"
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
gdb "not in executable format: File format not recognized"
$ gdb snmptrap
GNU gdb 6.0
Copyright 2003 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 "x86_64-pc-linux-gnu"..."/home/tcma/net-snmp-5.1.1/apps/snmptrap": not in executable format: File format not recognized
I compiled my program with the "-g" debug option:
CFLAGS = -g -O2 -Dlinux
Why I have this error?
Linux version 2.6.7-gentoo-r11 (root@rose) (gcc version 3.4.1 (Gentoo Linux 3.4.1, ssp-3.4-2, pie-8.7.6.3))
theres your problem, that file is not a compiled program, its a shell script - a list of commands for bash to run, you can open it in your favourite text editor and maybe find the path of the actual program you want to debug.
gdb "not in executable format: File format not recognized "
# gdb core
GNU gdb Red Hat Linux (6.3.0.0-1.132.EL4rh)
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"..."/opt/nms_mycaller/bin/core": not in executable format: File format not recognized
file core gives
core: ELF 32-bit LSB core file Intel 80386, version 1 (SYSV), SVR4-style, from 'rplclient'
"/opt/nms_mycaller/bin/core": not in executable format: File format not recognized
file core gives
core: ELF 32-bit LSB core file Intel 80386, version 1 (SYSV), SVR4-style, from 'rplclient'
What can be the reason?
It's a core file (a memory dump, basically, produced when a program died) -- not an executable. To load core files in GDB, first run gdb without any arguments, then use the "core <COREFILE>" command.
Also, as an aside, it probably would have been better to start a new thread on this one, rather than resurrecting a three-years-old one.
I get this error only when I try to run core file with out specifying the program name which produced the core.
I solved my error this way.
First you do a
"ulimit -c unlimited "
to generate the core
then run the program to generate the core say core.xyz
debug using
"gdb programname core.xyz"
It's a core file (a memory dump, basically, produced when a program died) -- not an executable. To load core files in GDB, first run gdb without any arguments, then use the "core <COREFILE>" command.
Also, as an aside, it probably would have been better to start a new thread on this one, rather than resurrecting a three-years-old one.
Sorry for resurrecting this old thread .
I tried as mentioned first ran gdb then used core <corefile> it gave an output as
Program terminated with signal 11, Segmentation fault.
#0 0x00a4f9b2 in ?? ()
But how can i pin point in the code where this fault is happening?
Thanks in advance
I tried as mentioned first ran gdb then used core <corefile> it gave an output as
Program terminated with signal 11, Segmentation fault.
#0 0x00a4f9b2 in ?? ()
But how can i pin point in the code where this fault is happening?
Try "bt" (backtrace), I think. But if your binary was built without debugging symbols, it's not going to make any difference, because they'll all be memory addresses and question marks.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.