Commit a92e38f4 authored by Friedemann Kleint's avatar Friedemann Kleint Committed by hjk

Debugger: Compile with QT_NO_CAST_FROM_ASCII.

(except gdbmi.cpp, name_demangler.cpp). Remove some unneeded
conversions, change some maps to take QByteArray keys.

Change-Id: I010f1251998a441fe5c8c87901b1e0c277c0391c
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent ec493900
......@@ -337,7 +337,7 @@ void BreakHandler::saveBreakpoints()
map.insert(_("message"), data.message);
list.append(map);
}
debuggerCore()->setSessionValue("Breakpoints", list);
debuggerCore()->setSessionValue(QLatin1String("Breakpoints"), list);
//qDebug() << "SAVED BREAKPOINTS" << this << list.size();
}
......@@ -345,7 +345,7 @@ void BreakHandler::loadBreakpoints()
{
QTC_ASSERT(debuggerCore(), return);
//qDebug() << "LOADING BREAKPOINTS...";
QVariant value = debuggerCore()->sessionValue("Breakpoints");
QVariant value = debuggerCore()->sessionValue(QLatin1String("Breakpoints"));
QList<QVariant> list = value.toList();
//clear();
foreach (const QVariant &var, list) {
......
......@@ -79,9 +79,9 @@ QByteArray BreakpointModelId::toByteArray() const
QString BreakpointModelId::toString() const
{
if (!isValid())
return "<invalid bkpt>";
return QLatin1String("<invalid bkpt>");
if (isMinor())
return QString("%1.%2").arg(m_majorPart).arg(m_minorPart);
return QString::fromLatin1("%1.%2").arg(m_majorPart).arg(m_minorPart);
return QString::number(m_majorPart);
}
......@@ -148,9 +148,9 @@ QByteArray BreakpointResponseId::toByteArray() const
QString BreakpointResponseId::toString() const
{
if (!isValid())
return "<invalid bkpt>";
return QLatin1String("<invalid bkpt>");
if (isMinor())
return QString("%1.%2").arg(m_majorPart).arg(m_minorPart);
return QString::fromLatin1("%1.%2").arg(m_majorPart).arg(m_minorPart);
return QString::number(m_majorPart);
}
......
......@@ -276,7 +276,7 @@ void BreakpointDialog::getParts(unsigned partsMask, BreakpointParameters *data)
if (partsMask & AddressPart)
data->address = m_ui.lineEditAddress->text().toULongLong(0, 0);
if (partsMask & ExpressionPart)
data->expression = m_ui.lineEditExpression->text().toUtf8();
data->expression = m_ui.lineEditExpression->text();
if (partsMask & ConditionPart)
data->condition = m_ui.lineEditCondition->text().toUtf8();
......
......@@ -1049,7 +1049,7 @@ void CdbEngine::handleAddWatch(const CdbExtensionCommandPtr &reply)
watchHandler()->insertData(item);
showMessage(QString::fromLatin1("Unable to add watch item '%1'/'%2': %3").
arg(QString::fromAscii(item.iname), QString::fromAscii(item.exp),
reply->errorMessage), LogError);
QString::fromLocal8Bit(reply->errorMessage)), LogError);
}
}
......@@ -1263,12 +1263,14 @@ void CdbEngine::handleJumpToLineAddressResolution(const CdbBuiltinCommandPtr &cm
return;
// Evaluate expression: 5365511549 = 00000001`3fcf357d
// Set register 'rip' to hex address and goto lcoation
QString answer = QString::fromAscii(cmd->reply.front()).trimmed();
QByteArray answer = cmd->reply.front().trimmed();
const int equalPos = answer.indexOf(" = ");
if (equalPos == -1)
return;
answer.remove(0, equalPos + 3);
answer.remove(QLatin1Char('`'));
const int apPos = answer.indexOf('`');
if (apPos != -1)
answer.remove(apPos, 1);
bool ok;
const quint64 address = answer.toLongLong(&ok, 16);
if (ok && address) {
......@@ -2844,7 +2846,7 @@ void CdbEngine::handleStackTrace(const CdbExtensionCommandPtr &command)
parseStackTrace(data, false);
postCommandSequence(command->commandSequence);
} else {
showMessage(command->errorMessage, LogError);
showMessage(QString::fromLocal8Bit(command->errorMessage), LogError);
}
}
......@@ -2854,7 +2856,7 @@ void CdbEngine::handleExpression(const CdbExtensionCommandPtr &command)
if (command->success) {
value = command->reply.toInt();
} else {
showMessage(command->errorMessage, LogError);
showMessage(QString::fromLocal8Bit(command->errorMessage), LogError);
}
// Is this a conditional breakpoint?
if (command->cookie.isValid() && qVariantCanConvert<ConditionalBreakPointCookie>(command->cookie)) {
......
......@@ -54,36 +54,6 @@
namespace Debugger {
namespace Internal {
static QChar charForChannel(int channel)
{
switch (channel) {
case LogDebug: return 'd';
case LogWarning: return 'w';
case LogError: return 'e';
case LogInput: return '<';
case LogOutput: return '>';
case LogStatus: return 's';
case LogTime: return 't';
case LogMisc:
default: return ' ';
}
}
static int channelForChar(QChar c)
{
switch (c.unicode()) {
case 'd': return LogDebug;
case 'w': return LogWarning;
case 'e': return LogError;
case '<': return LogInput;
case '>': return LogOutput;
case 's': return LogStatus;
case 't': return LogTime;
default: return LogMisc;
}
}
/////////////////////////////////////////////////////////////////////
//
// ConsoleHighlighter
......@@ -101,7 +71,7 @@ private:
void highlightBlock(const QString &text)
{
QTextCharFormat format;
switch (channelForChar(text.isEmpty() ? QChar() : text.at(0))) {
switch (LogWindow::channelForChar(text.isEmpty() ? QChar() : text.at(0))) {
case LogInput:
format.setForeground(Qt::blue);
setFormat(1, text.size(), format);
......@@ -235,7 +205,7 @@ public:
int n = 0;
// cut time string
if (line.size() > 18 && line.at(0) == '[')
if (line.size() > 18 && line.at(0) == QLatin1Char('['))
line = line.mid(18);
//qDebug() << line;
......@@ -273,7 +243,7 @@ ConsoleWindow::ConsoleWindow(QWidget *parent)
: QWidget(parent)
{
setWindowTitle(tr("Console"));
setObjectName("Console");
setObjectName(QLatin1String("Console"));
m_console = new Console(this);
m_console->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
......@@ -302,14 +272,14 @@ void ConsoleWindow::showOutput(int channel, const QString &output)
//cursor.movePosition(QTextCursor::End);
//bool atEnd = oldCursor.position() == cursor.position();
foreach (QString line, output.split('\n')) {
foreach (QString line, output.split(QLatin1Char('\n'))) {
// FIXME: QTextEdit asserts on really long lines...
const int n = 30000;
if (line.size() > n) {
line.truncate(n);
line += QLatin1String(" [...] <cut off>");
}
m_console->appendPlainText(charForChannel(channel) + line + '\n');
m_console->appendPlainText(LogWindow::charForChannel(channel) + line + QLatin1Char('\n'));
}
QTextCursor cursor = m_console->textCursor();
cursor.movePosition(QTextCursor::End);
......
......@@ -1063,7 +1063,7 @@ void TypeFormatsDialog::addTypeFormats(const QString &type0,
const QStringList &typeFormats, int current)
{
QString type = type0;
type.replace("__", "::");
type.replace(QLatin1String("__"), QLatin1String("::"));
int pos = 2;
if (type.startsWith(QLatin1Char('Q')))
pos = 0;
......
......@@ -612,7 +612,7 @@ void DebuggerEngine::gotoLocation(const Location &loc)
// Called from RunControl.
void DebuggerEngine::handleStartFailed()
{
showMessage("HANDLE RUNCONTROL START FAILED");
showMessage(QLatin1String("HANDLE RUNCONTROL START FAILED"));
d->m_runControl = 0;
d->m_progress.setProgressValue(900);
d->m_progress.reportCanceled();
......@@ -622,7 +622,7 @@ void DebuggerEngine::handleStartFailed()
// Called from RunControl.
void DebuggerEngine::handleFinished()
{
showMessage("HANDLE RUNCONTROL FINISHED");
showMessage(QLatin1String("HANDLE RUNCONTROL FINISHED"));
d->m_runControl = 0;
d->m_progress.setProgressValue(1000);
d->m_progress.reportFinished();
......@@ -1094,20 +1094,30 @@ void DebuggerEngine::slaveEngineStateChanged(DebuggerEngine *slaveEngine,
Q_UNUSED(state);
}
static inline QString msgStateChanged(DebuggerState oldState, DebuggerState newState,
bool forced, bool master)
{
QString result;
QTextStream str(&result);
str << "State changed";
if (forced)
str << " BY FORCE";
str << " from " << DebuggerEngine::stateName(oldState) << '(' << oldState
<< ") to " << DebuggerEngine::stateName(newState) << '(' << newState << ')';
if (master)
str << " [master]";
return result;
}
void DebuggerEngine::setState(DebuggerState state, bool forced)
{
if (isStateDebugging()) {
qDebug() << "STATUS CHANGE: " << this
<< " FROM " << stateName(d->m_state) << " TO " << stateName(state)
<< isMasterEngine();
}
const QString msg = msgStateChanged(d->m_state, state, forced, isMasterEngine());
if (isStateDebugging())
qDebug("%s", qPrintable(msg));
DebuggerState oldState = d->m_state;
d->m_state = state;
QString msg = _("State changed%5 from %1(%2) to %3(%4).")
.arg(stateName(oldState)).arg(oldState).arg(stateName(state)).arg(state)
.arg(forced ? " BY FORCE" : "");
if (!forced && !isAllowedTransition(oldState, state))
qDebug() << "*** UNEXPECTED STATE TRANSITION: " << this << msg;
......@@ -1727,7 +1737,7 @@ void DebuggerEnginePrivate::handleAutoTestLine(int line)
QString name = s.section(QLatin1Char(' '), 1, 1);
if (name.isEmpty()) {
reportTestError(_("'Check' needs arguments."), line);
} else if (name.contains(QChar('.'))) {
} else if (name.contains(QLatin1Char('.'))) {
m_engine->showMessage(_("variable %1 found in line %2 contains '.', but 'Expand' is not implemented yet.").arg(name).arg(line));
} else {
QByteArray iname = "local." + name.toLatin1();
......@@ -1751,7 +1761,7 @@ void DebuggerEnginePrivate::handleAutoTestLine(int line)
QString name = s.section(QLatin1Char(' '), 1, 1);
if (name.isEmpty()) {
reportTestError(_("'CheckType' needs arguments."), line);
} else if (name.contains(QChar('.'))) {
} else if (name.contains(QLatin1Char('.'))) {
m_engine->showMessage(_("variable %1 found in line %2 contains '.', but 'Expand' is not implemented yet.").arg(name).arg(line));
} else {
QByteArray iname = "local." + name.toLatin1();
......
......@@ -286,7 +286,7 @@ void DebuggerMainWindow::setEngineDebugLanguages(DebuggerLanguages languages)
void DebuggerMainWindow::onModeChanged(IMode *mode)
{
d->m_inDebugMode = (mode && mode->id() == Constants::MODE_DEBUG);
d->m_inDebugMode = (mode && mode->id() == QLatin1String(Constants::MODE_DEBUG));
setDockActionsVisible(d->m_inDebugMode);
// Hide all the debugger windows if mode is different.
......@@ -427,7 +427,7 @@ QDockWidget *DebuggerMainWindow::createDockWidget(const DebuggerLanguage &langua
ActionManager *am = ICore::instance()->actionManager();
QAction *toggleViewAction = dockWidget->toggleViewAction();
Command *cmd = am->registerAction(toggleViewAction,
Core::Id("Debugger." + widget->objectName()), globalContext);
Core::Id(QLatin1String("Debugger.") + widget->objectName()), globalContext);
cmd->setAttribute(Command::CA_Hide);
d->m_viewsMenu->addAction(cmd);
......@@ -646,17 +646,17 @@ void DebuggerMainWindowPrivate::setSimpleDockWidgetArrangement()
}
QDockWidget *toolBarDock = q->toolBarDockWidget();
QDockWidget *breakDock = q->dockWidget(DOCKWIDGET_BREAK);
QDockWidget *stackDock = q->dockWidget(DOCKWIDGET_STACK);
QDockWidget *watchDock = q->dockWidget(DOCKWIDGET_WATCHERS);
QDockWidget *snapshotsDock = q->dockWidget(DOCKWIDGET_SNAPSHOTS);
QDockWidget *threadsDock = q->dockWidget(DOCKWIDGET_THREADS);
QDockWidget *outputDock = q->dockWidget(DOCKWIDGET_OUTPUT);
QDockWidget *qmlInspectorDock = q->dockWidget(DOCKWIDGET_QML_INSPECTOR);
QDockWidget *scriptConsoleDock = q->dockWidget(DOCKWIDGET_QML_SCRIPTCONSOLE);
QDockWidget *modulesDock = q->dockWidget(DOCKWIDGET_MODULES);
QDockWidget *registerDock = q->dockWidget(DOCKWIDGET_REGISTER);
QDockWidget *sourceFilesDock = q->dockWidget(DOCKWIDGET_SOURCE_FILES);
QDockWidget *breakDock = q->dockWidget(QLatin1String(DOCKWIDGET_BREAK));
QDockWidget *stackDock = q->dockWidget(QLatin1String(DOCKWIDGET_STACK));
QDockWidget *watchDock = q->dockWidget(QLatin1String(DOCKWIDGET_WATCHERS));
QDockWidget *snapshotsDock = q->dockWidget(QLatin1String(DOCKWIDGET_SNAPSHOTS));
QDockWidget *threadsDock = q->dockWidget(QLatin1String(DOCKWIDGET_THREADS));
QDockWidget *outputDock = q->dockWidget(QLatin1String(DOCKWIDGET_OUTPUT));
QDockWidget *qmlInspectorDock = q->dockWidget(QLatin1String(DOCKWIDGET_QML_INSPECTOR));
QDockWidget *scriptConsoleDock = q->dockWidget(QLatin1String(DOCKWIDGET_QML_SCRIPTCONSOLE));
QDockWidget *modulesDock = q->dockWidget(QLatin1String(DOCKWIDGET_MODULES));
QDockWidget *registerDock = q->dockWidget(QLatin1String(DOCKWIDGET_REGISTER));
QDockWidget *sourceFilesDock = q->dockWidget(QLatin1String(DOCKWIDGET_SOURCE_FILES));
QTC_ASSERT(breakDock, return);
QTC_ASSERT(stackDock, return);
......
This diff is collapsed.
......@@ -185,7 +185,7 @@ DebuggerRunControlPrivate::DebuggerRunControlPrivate(DebuggerRunControl *parent,
DebuggerRunControl::DebuggerRunControl(RunConfiguration *runConfiguration,
const DebuggerStartParameters &sp,
const QPair<DebuggerEngineType, DebuggerEngineType> &masterSlaveEngineTypes)
: RunControl(runConfiguration, Constants::DEBUGMODE),
: RunControl(runConfiguration, QLatin1String(Constants::DEBUGMODE)),
d(new DebuggerRunControlPrivate(this, runConfiguration))
{
connect(this, SIGNAL(finished()), SLOT(handleFinished()));
......@@ -229,7 +229,7 @@ QString DebuggerRunControl::displayName() const
QIcon DebuggerRunControl::icon() const
{
return QIcon(ProjectExplorer::Constants::ICON_DEBUG_SMALL);
return QIcon(QLatin1String(ProjectExplorer::Constants::ICON_DEBUG_SMALL));
}
void DebuggerRunControl::setCustomEnvironment(Utils::Environment env)
......@@ -551,7 +551,7 @@ static inline bool canUseEngine(DebuggerEngineType et,
// Enabled?
if ((et & cmdLineEnabledEngines) == 0) {
result->errorDetails.push_back(DebuggerPlugin::tr("The debugger engine '%1' is disabled.").
arg(engineTypeName(et)));
arg(QLatin1String(engineTypeName(et))));
return false;
}
// Configured.
......@@ -636,7 +636,7 @@ DEBUGGER_EXPORT ConfigurationCheck checkDebugConfiguration(const DebuggerStartPa
const QString msg = DebuggerPlugin::tr(
"The preferred debugger engine for debugging binaries of type '%1' is not available.\n"
"The debugger engine '%2' will be used as a fallback.\nDetails: %3").
arg(sp.toolChainAbi.toString(), engineTypeName(usableType),
arg(sp.toolChainAbi.toString(), QLatin1String(engineTypeName(usableType)),
result.errorDetails.join(QString(QLatin1Char('\n'))));
debuggerCore()->showMessage(msg, LogWarning);
showMessageBox(QMessageBox::Warning, DebuggerPlugin::tr("Warning"), msg);
......@@ -669,8 +669,8 @@ DebuggerRunControlFactory::DebuggerRunControlFactory(QObject *parent,
bool DebuggerRunControlFactory::canRun(RunConfiguration *runConfiguration, const QString &mode) const
{
// return mode == ProjectExplorer::Constants::DEBUGMODE;
return (mode == Constants::DEBUGMODE || mode == Constants::DEBUGMODE2)
return (mode == QLatin1String(Constants::DEBUGMODE)
|| mode == QLatin1String(Constants::DEBUGMODE2))
&& qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration);
}
......@@ -768,8 +768,8 @@ static DebuggerStartParameters localStartParameters(RunConfiguration *runConfigu
sp.environment.set(optimizerKey, _("1"));
}
Utils::QtcProcess::addArg(&sp.processArgs, QString("-qmljsdebugger=port:%1,block").arg(
sp.qmlServerPort));
Utils::QtcProcess::addArg(&sp.processArgs,
QString::fromLatin1("-qmljsdebugger=port:%1,block").arg(sp.qmlServerPort));
}
// FIXME: If it's not yet build this will be empty and not filled
......@@ -784,11 +784,12 @@ static DebuggerStartParameters localStartParameters(RunConfiguration *runConfigu
RunControl *DebuggerRunControlFactory::create
(RunConfiguration *runConfiguration, const QString &mode)
{
QTC_ASSERT(mode == Constants::DEBUGMODE || mode == Constants::DEBUGMODE2, return 0);
QTC_ASSERT(mode == QLatin1String(Constants::DEBUGMODE)
|| mode == QLatin1String(Constants::DEBUGMODE2), return 0);
DebuggerStartParameters sp = localStartParameters(runConfiguration);
if (sp.startMode == NoStartMode)
return 0;
if (mode == Constants::DEBUGMODE2)
if (mode == QLatin1String(Constants::DEBUGMODE2))
sp.breakOnMain = true;
return create(sp, runConfiguration);
}
......
......@@ -794,7 +794,7 @@ DebuggerToolTipWidget *DebuggerToolTipWidget::loadSessionDataI(QXmlStreamReader
if (debugToolTips)
qDebug() << "Creating tooltip " << context << " from " << creationDate << offset;
DebuggerToolTipWidget *rc = 0;
if (className == "Debugger::Internal::DebuggerToolTipWidget")
if (className == QLatin1String("Debugger::Internal::DebuggerToolTipWidget"))
rc = new DebuggerToolTipWidget;
if (rc) {
rc->setContext(context);
......
......@@ -306,7 +306,7 @@ void DisassemblerAgent::setContentsToEditor(const DisassemblerLines &contents)
EditorManager *editorManager = EditorManager::instance();
if (!d->editor) {
QString titlePattern = "Disassembler";
QString titlePattern = QLatin1String("Disassembler");
d->editor = qobject_cast<ITextEditor *>(
editorManager->openEditorWithContents(
Core::Constants::K_DEFAULT_TEXT_EDITOR_ID,
......
......@@ -62,7 +62,7 @@ void DisassemblerLine::fromString(const QString &unparsed)
if (addr.size() >= 9 && addr.at(8) == QLatin1Char('`'))
addr.remove(8, 1);
if (addr.endsWith(':')) // clang
if (addr.endsWith(QLatin1Char(':'))) // clang
addr.chop(1);
if (addr.startsWith(QLatin1String("0x")))
addr.remove(0, 2);
......@@ -151,28 +151,28 @@ void DisassemblerLines::appendUnparsed(const QString &unparsed)
QString line = unparsed.trimmed();
if (line.isEmpty())
return;
if (line.startsWith("Current language:"))
if (line.startsWith(QLatin1String("Current language:")))
return;
if (line.startsWith("Dump of assembler")) {
if (line.startsWith(QLatin1String("Dump of assembler"))) {
m_lastFunction.clear();
return;
}
if (line.startsWith("The current source"))
if (line.startsWith(QLatin1String("The current source")))
return;
if (line.startsWith("End of assembler")) {
if (line.startsWith(QLatin1String("End of assembler"))) {
m_lastFunction.clear();
return;
}
if (line.startsWith("=> "))
if (line.startsWith(QLatin1String("=> ")))
line = line.mid(3);
if (line.startsWith("0x")) {
if (line.startsWith(QLatin1String("0x"))) {
// Address line.
int pos1 = line.indexOf('<') + 1;
int posc = line.indexOf(':');
int pos1 = line.indexOf(QLatin1Char('<')) + 1;
int posc = line.indexOf(QLatin1Char(':'));
DisassemblerLine dl;
if (pos1 && line.indexOf("<UNDEFINED> instruction:") == -1) {
int pos2 = line.indexOf('+', pos1);
int pos3 = line.indexOf('>', pos1);
if (pos1 && line.indexOf(QLatin1String("<UNDEFINED> instruction:")) == -1) {
int pos2 = line.indexOf(QLatin1Char('+'), pos1);
int pos3 = line.indexOf(QLatin1Char('>'), pos1);
if (pos1 < pos2 && pos2 < pos3) {
QString function = line.mid(pos1, pos2 - pos1);
if (function != m_lastFunction) {
......
......@@ -54,6 +54,7 @@
#include <dlfcn.h>
#endif
#include <cctype>
#define PRECONDITION QTC_CHECK(!hasPython())
......@@ -144,11 +145,11 @@ QString DumperHelper::toString(bool debug) const
return rc;
}
const QString nameSpace = m_qtNamespace.isEmpty()
? QCoreApplication::translate("QtDumperHelper", "<none>") : m_qtNamespace;
? QCoreApplication::translate("QtDumperHelper", "<none>") : QLatin1String(m_qtNamespace);
return QCoreApplication::translate("QtDumperHelper",
"%n known types, Qt version: %1, Qt namespace: %2 Dumper version: %3",
0, QCoreApplication::CodecForTr,
m_nameTypeMap.size()).arg(qtVersionString(), nameSpace).arg(m_dumperVersion);
m_nameTypeMap.size()).arg(QLatin1String(qtVersionString()), nameSpace).arg(m_dumperVersion);
}
DumperHelper::Type DumperHelper::simpleType(const QByteArray &simpleType) const
......@@ -475,13 +476,13 @@ DumperHelper::SpecialSizeType DumperHelper::specialSizeType(const QByteArray &ty
return SpecialSizeCount;
}
static inline bool isInteger(const QString &n)
static inline bool isInteger(const QByteArray &n)
{
const int size = n.size();
if (!size)
return false;
for (int i = 0; i < size; i++)
if (!n.at(i).isDigit())
if (!std::isdigit(n.at(i)))
return false;
return true;
}
......@@ -506,12 +507,12 @@ void DumperHelper::evaluationParameters(const WatchData &data,
for (int i = 0; i != inners.size(); ++i)
inners[i] = inners[i].simplified();
QString outertype = td.isTemplate ? td.tmplate : data.type;
QByteArray outertype = td.isTemplate ? td.tmplate : data.type;
// adjust the data extract
if (outertype == m_qtNamespace + "QWidget")
outertype = m_qtNamespace + "QObject";
QString inner = td.inner;
QByteArray inner = td.inner;
const QByteArray zero = "0";
extraArgs.clear();
......@@ -644,13 +645,13 @@ void DumperHelper::evaluationParameters(const WatchData &data,
}
inBuffer->clear();
inBuffer->append(outertype.toUtf8());
inBuffer->append(outertype);
inBuffer->append('\0');
inBuffer->append(data.iname);
inBuffer->append('\0');
inBuffer->append(data.exp);
inBuffer->append('\0');
inBuffer->append(inner.toUtf8());
inBuffer->append(inner);
inBuffer->append('\0');
inBuffer->append(data.iname);
inBuffer->append('\0');
......@@ -860,8 +861,8 @@ void GdbEngine::updateSubItemClassic(const WatchData &data0)
// Try automatic dereferentiation
data.exp = "(*(" + data.exp + "))";
data.type = data.type + '.'; // FIXME: fragile HACK to avoid recursion
if (data.value.startsWith("0x"))
data.value = "@" + data.value;
if (data.value.startsWith(QLatin1String("0x")))
data.value.insert(0, QLatin1Char('@'));
insertData(data);
} else {
data.setChildrenUnneeded();
......@@ -1201,7 +1202,7 @@ void GdbEngine::handleStackListArgumentsClassic(const GdbResponse &response)
} else {
// Seems to occur on "RedHat 4 based Linux" gdb 7.0.1:
// ^error,msg="Cannot access memory at address 0x0"
showMessage(_("UNEXPECTED RESPONSE: ") + response.toString());
showMessage(_("UNEXPECTED RESPONSE: ") + QLatin1String(response.toString()));
}
}
......@@ -1239,7 +1240,7 @@ void GdbEngine::handleStackListLocalsClassic(const GdbResponse &response)
if (!m_resultVarName.isEmpty()) {
WatchData rd;
rd.iname = "return.0";
rd.name = "return";
rd.name = QLatin1String("return");
rd.exp = m_resultVarName;
list.append(rd);
}
......@@ -1310,10 +1311,10 @@ void GdbEngine::handleDebuggingHelperVersionCheckClassic(const GdbResponse &resp
if (response.resultClass == GdbResultDone) {
QString value = _(response.data.findChild("value").data());
QString debuggeeQtVersion = value.section(QLatin1Char('"'), 1, 1);
QString dumperQtVersion = m_dumperHelper.qtVersionString();
QString dumperQtVersion = QLatin1String(m_dumperHelper.qtVersionString());
if (debuggeeQtVersion.isEmpty()) {
showMessage(_("DUMPER VERSION CHECK SKIPPED, NO qVersion() OUTPUT IN")
+ response.toString());
+ QLatin1String(response.toString()));
} else if (dumperQtVersion.isEmpty()) {
showMessage(_("DUMPER VERSION CHECK SKIPPED, NO VERSION STRING"));
} else if (dumperQtVersion != debuggeeQtVersion) {
......@@ -1328,7 +1329,7 @@ void GdbEngine::handleDebuggingHelperVersionCheckClassic(const GdbResponse &resp
+ dumperQtVersion);
}
} else {
showMessage("DUMPER VERSION CHECK NOT COMPLETED");
showMessage(QLatin1String("DUMPER VERSION CHECK NOT COMPLETED"));
}
}
......@@ -1354,7 +1355,7 @@ void GdbEngine::handleVarListChildrenHelperClassic(const GdbMi &item,
//iname += '.' + exp;
postCommand(cmd, WatchUpdate,
CB(handleVarListChildrenClassic), QVariant::fromValue(data));
} else if (!startsWithDigit(exp)
} else if (!startsWithDigit(QLatin1String(exp))
&& item.findChild("numchild").data() == "0") {
// Happens for structs without data, e.g. interfaces.
WatchData data;
......@@ -1393,7 +1394,7 @@ void GdbEngine::handleVarListChildrenHelperClassic(const GdbMi &item,
data.setChildrenUnneeded();
data.name = _(exp);
if (data.type == data.name) {
if (data.name == QLatin1String(data.type)) {
if (isPointerType(parent.type)) {
data.exp = "*(" + parent.exp + ')';
data.name = _("*") + parent.name;
......
......@@ -167,7 +167,7 @@ CodaGdbAdapter::~CodaGdbAdapter()
SymbianUtils::SymbianDeviceManager::instance()->releaseCodaDevice(m_codaDevice);
cleanup();
logMessage("Shutting down.\n");
logMessage(QLatin1String("Shutting down.\n"));
}
void CodaGdbAdapter::setVerbose(const QVariant &value)
......@@ -375,7 +375,7 @@ void CodaGdbAdapter::codaEvent(const CodaEvent &e)
}
break;
case CodaEvent::LoggingWriteEvent: // TODO: Not tested yet.
showMessage(e.toString() + '\n', AppOutput);
showMessage(e.toString() + QLatin1Char('\n'), AppOutput);