This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

wireshark not in executable format: File format not recognized

0

I followed standard procedure , autogen.sh , configure then make .. And somehow executable was not produced instead a shell script was made up , that's why getting this error below in gdb :-

I want to make executable , in order to debug via gdb .. what i am missing?

[[email protected] wireshark-1.7.1]# gdb ./wireshark GNU gdb Fedora (6.8-1.fc9)

Copyright (C) 2008 Free Software Foundation, Inc.

License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html

This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details.

This GDB was configured as "i386-redhat-linux-gnu"...

"/root/wireshark/wireshark-1.7.1/wireshark": not in executable format: File format not recognized (gdb) run

asked 18 Jun '12, 02:45

yogeshg's gravatar image

yogeshg
41222326
accept rate: 0%

edited 18 Jun '12, 02:47

What is the output of these commands?

file /root/wireshark/wireshark-1.7.1/wireshark
ldd /root/wireshark/wireshark-1.7.1/wireshark

Regards
Kurt

(18 Jun '12, 03:01) Kurt Knochner ♦

/root/wireshark/wireshark-1.7.1/wireshark: Bourne shell script text executable

and

[[email protected] wireshark-1.7.1]# ldd /root/wireshark/wireshark-1.7.1/wireshark not a dynamic executable

thanks.

(18 Jun '12, 03:04) yogeshg

Bourne shell script text executable

O.K. you see, why you can't debug that? ;-)

It's just a wrapper script for the wireshark binary, which is in .libs/lt-wireshark. Run the script like this and you will see the path on your system:

sh -x /root/wireshark/wireshark-1.7.1/wireshark

So, run gdb:

gdb /root/wireshark/wireshark-1.7.1/wireshark/.libs/lt-wireshark

or add gdb to the wrapper script.

UPDATE: or even better: see answer below

(18 Jun '12, 03:34) Kurt Knochner ♦

I ain't enough comfortable with shell scripting, moreover i was interested in seeing what and which functions get called. Thanks anyways

(18 Jun '12, 03:55) yogeshg

One Answer:

1

Run wireshark through libtool, like this:

libtool --mode=execute gdb /root/wireshark/wireshark-1.7.1/wireshark

see here: http://wiki.wireshark.org/Development/Tips

Regards
Kurt

answered 18 Jun '12, 03:43

Kurt%20Knochner's gravatar image

Kurt Knochner ♦
24.8k1039237
accept rate: 15%

You are saviour!

(18 Jun '12, 03:50) yogeshg