Solved Problems to debug a console application that create threads
-
Hi, my application works correctly. When I try to debug it on Linux using lldb my application does not complete the start procedure.
It stops at the point "'02", before the thread start command.
Which is the way to resolve?int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); qDebug() << "begin"; Class01 class01; QTimer::singleShot(1000, &class01, SLOT(onTimeout())); return a.exec(); }
Class01::Class01() { qDebug() << "00"; QThread01 *th01= new QThread01(); qDebug() << "01"; QThread01 *th02= new QThread01(); qDebug() << "02"; th01->start(); qDebug() << "03"; th02->start(); qDebug() << "04"; }
-
Solved using gdb by command line instead of lldb by qtcreator
-
What is QThread01?
-
It is a Qt thread. It's run method is empty.
-
@mrdebug Did you try with gdb instead of lldb?
Also, how does the stack trace look like when the app hangs? -
I can't use gdb because I obtain the error
"The selected build of GDB does not support Python scripting.
It cannot be used in Qt Creator."The app does not hang. It is only a test app to study the issue.
Here the sources
http://www.denisgottardello.it/Test01.zip -
@mrdebug said in Problems to debug a console application that create threads:
The app does not hang
The I don't understand what this means: "It stops at the point "'02", before the thread start command"
-
@mrdebug said in Problems to debug a console application that create threads:
When I try to debug it on Linux using lldb ....
-
@mrdebug
We have no idea what "It stops at the point "'02" might mean in lldb.... -
Do you want to help me? Please download the source above and run it in debug mode using lldb and send me a feedback, specifying your os.
-
@mrdebug I don't have time to set up lldb.
I asked this before: how does the stack trace look like when debugger stops? -
Solved using gdb by command line instead of lldb by qtcreator