ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: [Wireshark-dev] Not hitting some breakpoints with CLion macOS

From: Jan Venekamp <jan@xxxxxxxxxxxx>
Date: Sat, 8 Dec 2018 00:20:05 +0100
Hi,

Taking my first steps into Wireshark development, I have successfully made a first attempt at writing and running a dissector plugin.

However, I am running into some problems while debugging. It seems that some breakpoint are not hit.

First some observations:
Wireshark #332df92, CLion 2018.3.1, macOS 10.13.6.
In order to successfully build I have to:
- Dissable these in CMakeLists.txt: -Wextra-semi -Wcomma
- Add the following option to cmake (using qt5 from Homebrew): -DCMAKE_CXX_FLAGS:STRING=-I/usr/local/opt/qt5/include
Full cmake command:
/Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS:STRING=-I/usr/local/opt/qt5/include -G "CodeBlocks - Unix Makefiles" /Users/jan/ews/c/wireshark

Then I can build with with CLion and run the wireshark executable. When I put a breakpoint on the proto_register function of the plugin I am writing it hits just fine and I am able to step through the code. The same goes for other plugins. So for example a breakpoint in proto_register_wimax in plugins/epan/wimax/packet-wmx.c hits. Or setting a breakpoint in main in ui/qt/main.cpp will also hit.

However, when I set a breakpoint in proto_register_ulp (or other functions) in epan/dissectors/packet-ulp.c it won't hit. I do not understand, Is there something I am missing here? I would really like to step through the code of some of these dissectors.

Any help would be greatly appreciated.

Kind regards,
Jan Venekamp