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

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

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

permanent link

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
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×1,620

question asked: 18 Jun '12, 02:45

question was seen: 3,756 times

last updated: 18 Jun '12, 11:36

p​o​w​e​r​e​d by O​S​Q​A