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

How can i add debug symbols to wireshark?

0

I am debugging wireshark using gdb. How can i add debug symbols to wireshark?

asked 08 Nov '12, 04:14

Akhil's gravatar image

Akhil
53272831
accept rate: 0%


One Answer:

0

As you would do with any other program, by adding option '-g' to the gcc compiler.

gcc -g

However, you don't have to care about that, as the standard build process will add '-g' to the CFLAGS variable and thus your compiled binary will have debug symbols, unless you change the build process.

You can check if there are debug symbols with the following command:

nm --debug-syms wireshark/.libs/wireshark

Regards
Kurt

answered 10 Nov '12, 03:09

Kurt%20Knochner's gravatar image

Kurt Knochner ♦
24.8k1039237
accept rate: 15%

edited 10 Nov '12, 03:56

The nm command will work only if the nm on the system is the GNU binutils version of nm or a compatible version; not all versions of nm support the --debug-syms option.

(10 Nov '12, 17:20) Guy Harris ♦♦

The output of the command nm --debug-syms wireshark/.libs/wireshark is as follows:

00000000005206a0 T pcap_findalldevs
000000000052f360 T pcap_fopen_offline
0000000000530430 T pcap_free
0000000000520df0 T pcap_free_datalinks
0000000000521980 T pcap_freealldevs
0000000000522600 T pcap_freecode
0000000000530400 T pcap_get_debug
0000000000520c30 T pcap_get_selectable_fd

What does that mean: debug symbols present or not?

(11 Nov '12, 20:04) Akhil

debug symbols present

(11 Nov '12, 22:58) Kurt Knochner ♦

Thanks Kurt

(12 Nov '12, 00:28) Akhil