Ask Your Question

I want to debug from WinMain

asked 2022-10-14 02:54:14 +0000 gravatar image

I'm new to C language development, so I apologize for the basic question.

I am trying to debug in Debug mode by opening "C:\Development\wsbuild64\Wireshark.sln" in Visual Stadio2019.

Even if I set a breakpoint at an appropriate place and double-click the WinMain line in the Call Stack window, the WinMain line does not appear.

When the common dialog is displayed and closed by canceling, "qtentrypoint_win.cpp is not found" is displayed.

Searching for qtentrypoint_win.cpp under "C:\Development" does not exist.

I want to set a breakpoint in WinMain and debug it.

What should I do?

edit retag flag offensive close merge delete


Where should I check the window that is displayed first in the source code? gravatar image[email protected] ( 2022-10-14 02:59:50 +0000 )edit

Sorry for the elementary question.

I could not find API calls such as ShowWindow and CreateWindow even if I searched.

How does the Wireshark window display work?

Also, can't you check the screen in the designer?

If you can't check it in the designer, where is the screen drawing logic written? gravatar image[email protected] ( 2022-10-14 04:32:00 +0000 )edit

The place where the main window is created was the following place.



line 693,694

main_w = new(WiresharkMainWindow);



When I put the cursor on show and press Shift+F2, I got an error that "qwidget.cpp" was not found.

qwidget.cpp does not exist locally.

I want to step into Show and debug.

what should i do

Also, following the inheritance of main_w, the following error occurred.

Could not find definition for symbol 'QMainWindow'.

Where is the definition of QMainWindow mentioned gravatar image[email protected] ( 2022-10-14 07:47:13 +0000 )edit

To debug into Qt code you can install the Qt symbols and source code. There are options in the Qt maintenance tool for these items. Obviously you have to install the symbols and source code for the version of Qt you are building with.

grahamb gravatar imagegrahamb ( 2022-10-14 10:16:07 +0000 )edit

Thank you for your reply.

How do I install Qt symbols and source code? gravatar image[email protected] ( 2022-10-16 23:10:49 +0000 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2022-10-14 09:22:31 +0000

Guy Harris gravatar image

qwidget.cpp does not exist locally.

Yes, that's because it's part of the Qt toolkit, not part of Wireshark. qtentrypoint_win.cpp is also part of Qt; it contains WinMain().

I could not find API calls such as ShowWindow and CreateWindow even if I searched.

Those calls are not in Wireshark, they're in Qt. For most of the user interface code, Wireshark does not directly call the Windows API, because it also has to run on macOS (where Qt makes the macOS Cocoa API calls) and on other UN*X systems (where Qt directly makes low-level window system calls).

Where is the definition of QMainWindow mentioned

It's in Qt, not in Wireshark.

For a quick description of what Qt is, see the Wikipedia page for Qt and the Qt home page.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2022-10-14 02:54:14 +0000

Seen: 38 times

Last updated: Oct 16 '22