【求助】linux下如何GDB调试wireshark?
刚开始接触linux系统,很多地方不明白,请教个问题:
CentOS 系统, 从网上下载的wireshark源程序,相关依赖程序都已安装
执行如下命令:
./configure CFLAGS=-g CXXFLAGS=-g
make
make install
wireshark也安装可用了,但是调试却失败了:
#gdb wireshark
not in executable format: 不可识别的文件格式
#file wireshark
wireshark: POSIX shell script text executable
对shell完全不懂啊,不知道可执行文件在哪里?怎么进入代码调试?
[解决办法]
0. 首先需要找到执行的文件.
我这里是debian仓库的二进制wireshark.没有编译过debug版本.就是一般的二进制.我发现和楼主的不太一样
zodiac1111@debian:tmp$ whereis wireshark
wireshark: /usr/bin/wireshark /etc/wireshark /usr/lib/wireshark /usr/bin/X11/wireshark \
/usr/share/wireshark /usr/share/man/man1/wireshark.1.gz
zodiac1111@debian:tmp$ file /usr/bin/wireshark
/usr/bin/wireshark: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically \
linked (uses shared libs), for GNU/Linux 2.6.26, \
BuildID[sha1]=0xe3ce93a4a82da158c7a580c31b177b08f11aff49, stripped