Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
Qt Creator 4.7.0-rc1
-
None
-
-
ef0cf8d1e0befb6f2b6072e843ccfb76abfb6572
Description
This bug persists at least from Qt Creator 4.0.82 till 4.8.0-beta1. Please, look at this piece of code from "plugins/debugger/gdb/gdbengine.cpp":
void GdbEngine::handleFileExecAndSymbols(const DebuggerResponse &response)
{
CHECK_STATE(EngineSetupRequested);
if (isRemoteEngine()) {
if (response.resultClass == ResultDone) {
callTargetRemote();
} else {
QString reason = response.data["msg"].data();
QString msg = tr("Reading debug information failed:") + '\n' + reason;
if (reason.endsWith("No such file or directory.")) {
showMessage("INFERIOR STARTUP: BINARY NOT FOUND");
showMessage(msg, StatusBar);
callTargetRemote(); // Proceed nevertheless.
} else {
notifyInferiorSetupFailedHelper(msg);
}
}
} else if (isCoreEngine()) {
QString core = runParameters().coreFile;
if (response.resultClass == ResultDone) {
showMessage(tr("Symbols found."), StatusBar);
handleInferiorPrepared();
} else {
QString msg = tr("No symbols found in the core file \"%1\".").arg(core)
+ ' ' + tr("This can be caused by a path length limitation "
"in the core file.")
+ ' ' + tr("Try to specify the binary in "
"Debug > Start Debugging > Load Core File.");
notifyInferiorSetupFailedHelper(msg);
}
} else if (isPlainEngine()) {
if (response.resultClass == ResultDone) {
handleInferiorPrepared();
} else {
QString msg = response.data["msg"].data();
// Extend the message a bit in unknown cases.
if (!msg.endsWith("File format not recognized"))
msg = tr("Starting executable failed:") + '\n' + msg;
notifyInferiorSetupFailedHelper(msg);
}
}
}
What do the conditional statements highlighted with red do? They check messages if they match some ENGLISH patterns. But these messages are NOT ENGLISH in localized versions of the Qt Creator! Therefore, such conditions never can be true.
This piece of code is not alone example of such ill approach to investigate task results in Creator source code (for an example, search for "endsWith" through the code of all plugins)
But I have stumbled namely over GdbEngine::handleFileExecAndSymbols() for a number of releases.
If someone finds more civilized way to check task results, it will be highly appreciated. Thanks in advance.