[Shell] 纯文本查看 复制代码
(Theonesssssssss@Stein-Gate)[2854] ~/TCP/tcp1 - Copy (2)/client % gdb debug/./client.exe
GNU gdb (GDB) 15.1
Copyright (C) 2024 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-w64-mingw32".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from debug/./client.exe...
(gdb) b connectToServer
Breakpoint 1 at 0x140001d3c: file client.cpp, line 50.
(gdb) r
Starting program: D:\msys64\home\Theonesssssssss\TCP\tcp1 - Copy (2)\client\debug\client.exe
[New Thread 184.0x6a1c]
[New Thread 184.0x7214]
[New Thread 184.0x463c]
[New Thread 184.0x68d4]
[New Thread 184.0x7e74]
[New Thread 184.0x2680]
[New Thread 184.0x2008]
[Thread 184.0x2008 exited with code 0]
[New Thread 184.0x4b08]
[Thread 184.0x4b08 exited with code 0]
[New Thread 184.0x7c78]
[New Thread 184.0x373c]
[New Thread 184.0x6190]
warning: Connect button clicked.
Thread 1 hit Breakpoint 1, TCPClient::connectToServer (this=0x5ffd80) at client.cpp:50
warning: Source file is more recent than executable.
50 qDebug() << "Attempting to connect to server...";
(gdb) l 47,64
47
48 void TCPClient::connectToServer()
49 {
50 qDebug() << "Attempting to connect to server...";
51 socket->connectToHost("127.0.0.1", 1234); // 杩炴帴鍒版湰鍦颁富鏈虹殑1234 绔彛
52 if (socket->waitForConnected(3000)) {
53 displayArea->append("Connected to server.");
54 } else {
55 displayArea->append("Failed to connect to server. Error: " + socket->errorString());
56 }
57 }
58
59 void TCPClient::onConnectClicked()
60 {
61 qDebug() << "Connect button clicked.";
62 connectToServer(); // 杩炴帴鍒版湇鍔″櫒
63 }
64
(gdb) n
warning: Attempting to connect to server...
51 socket->connectToHost("127.0.0.1", 1234); // 杩炴帴鍒版湰鍦颁富鏈虹殑1234 绔彛
(gdb) bt
#0 TCPClient::connectToServer (this=0x5ffd80) at client.cpp:51
#1 0x00007ff779101eb8 in TCPClient::onConnectClicked (this=0x5ffd80) at client.cpp:57
#2 0x00007ff779104899 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (TCPClient::*)()>::call(void (TCPClient::*)(), TCPClient*, void**) (
f=(void (TCPClient::*)(TCPClient * const)) 0x7ff779101e46 <TCPClient::onConnectClicked()>, o=0x5ffd80, arg=0x5fbf20)
at D:/msys64/mingw64/include/QtCore/qobjectdefs_impl.h:152
#3 0x00007ff779104a8c in QtPrivate::FunctionPointer<void (TCPClient::*)()>::call<QtPrivate::List<>, void>(void (TCPClient::*)(), TCPClient*, void**) (
f=(void (TCPClient::*)(TCPClient * const)) 0x7ff779101e46 <TCPClient::onConnectClicked()>, o=0x5ffd80, arg=0x5fbf20)
at D:/msys64/mingw64/include/QtCore/qobjectdefs_impl.h:185
#4 0x00007ff77910494a in QtPrivate::QSlotObject<void (TCPClient::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1,
this_=0xe2dd00, r=0x5ffd80, a=0x5fbf20, ret=0x0)
at D:/msys64/mingw64/include/QtCore/qobjectdefs_impl.h:418
#5 0x00007ffa0d39257c in ?? () from D:\msys64\mingw64\bin\Qt5Core.dll
#6 0x00007ffa06b336c2 in ?? () from D:\msys64\mingw64\bin\Qt5Widgets.dll
#7 0x00007ffa06b352c6 in ?? () from D:\msys64\mingw64\bin\Qt5Widgets.dll
#8 0x00007ffa06b354bf in ?? () from D:\msys64\mingw64\bin\Qt5Widgets.dll
#9 0x00007ffa06a88690 in ?? () from D:\msys64\mingw64\bin\Qt5Widgets.dll
#10 0x00007ffa06a4853e in ?? () from D:\msys64\mingw64\bin\Qt5Widgets.dll
#11 0x00007ffa06a5058b in ?? () from D:\msys64\mingw64\bin\Qt5Widgets.dll
#12 0x00007ffa0d2a4298 in ?? () from D:\msys64\mingw64\bin\Qt5Core.dll
#13 0x00007ffa06a4e3ff in ?? () from D:\msys64\mingw64\bin\Qt5Widgets.dll
#14 0x00007ffa06a9f61b in ?? () from D:\msys64\mingw64\bin\Qt5Widgets.dll
#15 0x00007ffa06aa2a07 in ?? () from D:\msys64\mingw64\bin\Qt5Widgets.dll
#16 0x00007ffa06a4853e in ?? () from D:\msys64\mingw64\bin\Qt5Widgets.dll
#17 0x00007ffa0d2a4298 in ?? () from D:\msys64\mingw64\bin\Qt5Core.dll
#18 0x00007ffa04a37bd4 in ?? () from D:\msys64\mingw64\bin\Qt5Gui.dll
#19 0x00007ffa04a0eecc in ?? () from D:\msys64\mingw64\bin\Qt5Gui.dll
#20 0x00007ffa0d300b02 in ?? () from D:\msys64\mingw64\bin\Qt5Core.dll
#21 0x00007ffa0bd44185 in ?? ()
from D:\msys64\mingw64\share\qt5\plugins\platforms\qwindows.dll
#22 0x00007ffa0d2a25a3 in ?? () from D:\msys64\mingw64\bin\Qt5Core.dll
#23 0x00007ffa0d2ab3a5 in ?? () from D:\msys64\mingw64\bin\Qt5Core.dll
#24 0x00007ff7791014a3 in qMain (argc=1, argv=0xf03f80) at main.cpp:9
#25 0x00007ff779103a0f in WinMain ()
#26 0x00007ff7791012e9 in __tmainCRTStartup ()
at C:/M/B/src/mingw-w64/mingw-w64-crt/crt/crtexe.c:258
#27 0x00007ff7791013d6 in WinMainCRTStartup ()
at C:/M/B/src/mingw-w64/mingw-w64-crt/crt/crtexe.c:148
(gdb) n
152 virtual void connectToHost(const QString &hostName, quint16 port, OpenMode mode = ReadWrite, NetworkLayerProtocol protocol = AnyIPProtocol);
(gdb) n
51 socket->connectToHost("127.0.0.1", 1234); // 杩炴帴鍒版湰鍦颁富鏈虹殑1234 绔彛
(gdb) n
warning: onecore\net\netprofiles\service\src\nsp\dll\namespaceserviceprovider.cpp(613)\nlansp_c.dll!00007FFAB782F6BD: (caller: 00007FFAE0CEACF6) LogHr(1) tid(968) 8007277C No such service is known. The service cannot be found in the specified name space.
[New Thread 184.0x7cb8]
52 if (socket->waitForConnected(3000)) {
(gdb) n
TCPClient::onConnectClicked (this=0x5ffd80) at client.cpp:58
58
(gdb) n
QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (TCPClient::*)()>::call(void (TCPClient::*)(), TCPClient*, void**) (
f=(void (TCPClient::*)(TCPClient * const)) 0x7ff779101e46 <TCPClient::onConnectClicked()>, o=0x5ffd80, arg=0x5fbf20)
at D:/msys64/mingw64/include/QtCore/qobjectdefs_impl.h:153
153 }
(gdb) n
QtPrivate::FunctionPointer<void (TCPClient::*)()>::call<QtPrivate::List<>, void>(void (TCPClient::*)(), TCPClient*, void**) (
f=(void (TCPClient::*)(TCPClient * const)) 0x7ff779101e46 <TCPClient::onConnectClicked()>, o=0x5ffd80, arg=0x5fbf20)
at D:/msys64/mingw64/include/QtCore/qobjectdefs_impl.h:186
186 }
(gdb) n
QtPrivate::QSlotObject<void (TCPClient::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1, this_=0xe2dd00,
r=0x5ffd80, a=0x5fbf20, ret=0x0)
at D:/msys64/mingw64/include/QtCore/qobjectdefs_impl.h:419
419 break;
(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) n
Program not restarted.
(gdb) n
425 }
(gdb) l
420 case Compare:
421 *ret = *reinterpret_cast<Func *>(a) == static_cast<QSlotObject*>(this_)->function;
422 break;
423 case NumOperations: ;
424 }
425 }
426 public:
427 explicit QSlotObject(Func f) : QSlotObjectBase(&impl), function(f) {}
428 };
429 // implementation of QSlotObjectBase for which the slot is a functor (or lambda)
这里可以看到直接跳出来了
Run till exit from #0 0x00007ffa0bd44185 in ?? ()
from D:\msys64\mingw64\share\qt5\plugins\platforms\qwindows.dll
0x00007ffa0d2a25a3 in ?? () from D:\msys64\mingw64\bin\Qt5Core.dll
(gdb) finish
Run till exit from #0 0x00007ffa0d2a25a3 in ?? ()
from D:\msys64\mingw64\bin\Qt5Core.dll
warning: Disconnect button clicked.
warning: Disconnected from server. Attempting to reconnect...
warning: Disconnect button clicked.
[Thread 184.0x2680 exited with code 0]
[Thread 184.0x463c exited with code 0]
[Thread 184.0x6a1c exited with code 0]
[Thread 184.0x7214 exited with code 0]