I have a QT4 application which wraps libssh2 in order to communicate with the embedded devices on the network. The following snippet is making me crazy for a while.
SSHClient ssh_client(host, 22);
try {
ssh_client.connect_to_host(USERNAME, PASSWORD);
ssh_client.receive_file(file_name, file_path);
} catch(const SSHException &excp) {
qDebug() << "test";
emit console(excp.what());
return;
}
I put breakpoints to qDebug() << "test";
and emit console(excp.what());
in debugger, however, they never get hit even though an SSHException is thrown. If i put a breakpoint to the return;
statement, it stops with no problem.
The output is also strange. qDebug() << "test"
does what it is supposed to do, but, emit console(excp.what());
is not emitting a signal. And when the control reaches to the return;
statement, it returns, again with no problem.