First time here? Check out the FAQ!
THIS IS A TEST INSTANCE. Feel free to ask and answer questions, but take care to avoid triggering too many notifications.
0

I want to debug from WinMain

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?

m.kitagawa@tashiro-t.co.jp's avatar
1
[email protected]
asked 2022-10-14 02:54:14 +0000
edit flag offensive 0 remove flag close merge delete

Comments

Where should I check the window that is displayed first in the source code?

m.kitagawa@tashiro-t.co.jp's avatar [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?

m.kitagawa@tashiro-t.co.jp's avatar [email protected] (2022-10-14 04:32:00 +0000) edit

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

==========================================

main.cpp

line 693,694

main_w = new(WiresharkMainWindow);

main_w->show();

==========================================

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

m.kitagawa@tashiro-t.co.jp's avatar [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's avatar grahamb (2022-10-14 10:16:07 +0000) edit

Thank you for your reply.

How do I install Qt symbols and source code?

m.kitagawa@tashiro-t.co.jp's avatar [email protected] (2022-10-16 23:10:49 +0000) edit
add a comment see more comments

1 Answer

0

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.

Guy Harris's avatar
19.9k
Guy Harris
answered 2022-10-14 09:22:31 +0000
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer