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

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);
......
......@@ -506,8 +506,8 @@ public:
setDisplayName(DebuggerPlugin::tr("Debug"));
setIcon(QIcon(QLatin1String(":/fancyactionbar/images/mode_Debug.png")));
setPriority(85);
setId(MODE_DEBUG);
setType(CC::MODE_EDIT_TYPE);
setId(QLatin1String(MODE_DEBUG));
setType(QLatin1String(CC::MODE_EDIT_TYPE));
}
~DebugMode()
......@@ -697,7 +697,7 @@ public slots:
void synchronizeBreakpoints()
{
showMessage("ATTEMPT SYNC", LogDebug);
showMessage(QLatin1String("ATTEMPT SYNC"), LogDebug);
for (int i = 0, n = m_snapshotHandler->size(); i != n; ++i) {
if (DebuggerEngine *engine = m_snapshotHandler->at(i))
engine->attemptBreakpointSynchronization();
......@@ -899,7 +899,7 @@ public slots:
if (functionName.isEmpty()) {
const QTextBlock block = cursor.block();
const QString line = block.text();
foreach (const QString &str, line.trimmed().split('(')) {
foreach (const QString &str, line.trimmed().split(QLatin1Char('('))) {
QString a;
for (int i = str.size(); --i >= 0; ) {
if (!str.at(i).isLetterOrNumber())
......@@ -1127,7 +1127,7 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(DebuggerPlugin *plugin) :
m_dummyEngine(0),
m_globalDebuggerOptions(new GlobalDebuggerOptions)
{
setObjectName("DebuggerCore");
setObjectName(QLatin1String("DebuggerCore"));
qRegisterMetaType<WatchData>("WatchData");
qRegisterMetaType<ContextData>("ContextData");
qRegisterMetaType<DebuggerStartParameters>("DebuggerStartParameters");
......@@ -1228,15 +1228,16 @@ void DebuggerPluginPrivate::maybeEnrichParameters(DebuggerStartParameters *sp)
showMessage(QString::fromLatin1("USING QTC_DEBUGGER_SYSROOT %1")
.arg(sp->sysroot), LogWarning);
}
if (sp->debugInfoLocation.isEmpty())
sp->debugInfoLocation = sp->sysroot + "/usr/lib/debug";
if (sp->debugInfoLocation.isEmpty()) {
sp->debugInfoLocation = sp->sysroot + QLatin1String("/usr/lib/debug");
}
if (sp->debugSourceLocation.isEmpty()) {
QString base = sp->sysroot + "/usr/src/debug/";
sp->debugSourceLocation.append(base + "qt5base/src/corelib");
sp->debugSourceLocation.append(base + "qt5base/src/gui");
sp->debugSourceLocation.append(base + "qt5base/src/network");
sp->debugSourceLocation.append(base + "qt5base/src/v8");
sp->debugSourceLocation.append(base + "qt5declarative/src/declarative/qml");
QString base = sp->sysroot + QLatin1String("/usr/src/debug/");
sp->debugSourceLocation.append(base + QLatin1String("qt5base/src/corelib"));
sp->debugSourceLocation.append(base + QLatin1String("qt5base/src/gui"));
sp->debugSourceLocation.append(base + QLatin1String("qt5base/src/network"));
sp->debugSourceLocation.append(base + QLatin1String("qt5base/src/v8"));
sp->debugSourceLocation.append(base + QLatin1String("qt5declarative/src/declarative/qml"));
}
}
......@@ -1256,7 +1257,8 @@ bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it,
}
DebuggerStartParameters sp;
qulonglong pid = it->toULongLong();
QString remoteChannel = it->contains('@') ? it->section('@', 0, 0) : *it;
QString remoteChannel = it->contains(QLatin1Char('@')) ?
it->section(QLatin1Char('@'), 0, 0) : *it;
uint port = 0;
int pos = remoteChannel.indexOf(QLatin1Char(':'));
if (pos != -1)
......@@ -1270,14 +1272,14 @@ bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it,
} else if (port) {
sp.startMode = AttachToRemoteServer;
sp.remoteChannel = remoteChannel;
sp.executable = it->section('@', 1, 1);
sp.executable = it->section(QLatin1Char('@'), 1, 1);
if (sp.remoteChannel.isEmpty()) {
*errorMessage = DebuggerPlugin::tr("The parameter '%1' of option "
"'%2' does not match the pattern <server:port>@<executable>@<architecture>.")
.arg(*it, option);
return false;
}
sp.remoteArchitecture = it->section('@', 2, 2);
sp.remoteArchitecture = it->section(QLatin1Char('@'), 2, 2);
sp.displayName = tr("Remote: \"%1\"").arg(sp.remoteChannel);
sp.startMessage = tr("Attaching to remote server %1.")
.arg(sp.remoteChannel);
......@@ -1317,8 +1319,8 @@ bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it,
}
DebuggerStartParameters sp;
sp.startMode = AttachCrashedExternal;
sp.crashParameter = it->section(':', 0, 0);
sp.attachPID = it->section(':', 1, 1).toULongLong();
sp.crashParameter = it->section(QLatin1Char(':'), 0, 0);
sp.attachPID = it->section(QLatin1Char(':'), 1, 1).toULongLong();
sp.displayName = tr("Crashed process %1").arg(sp.attachPID);
sp.startMessage = tr("Attaching to crashed process %1").arg(sp.attachPID);
sp.toolChainAbi = Abi::hostAbi();
......@@ -1432,21 +1434,21 @@ void DebuggerPluginPrivate::debugProject()
{
ProjectExplorerPlugin *pe = ProjectExplorerPlugin::instance();
if (Project *pro = pe->startupProject())
pe->runProject(pro, Constants::DEBUGMODE);
pe->runProject(pro, QLatin1String(Constants::DEBUGMODE));
}
void DebuggerPluginPrivate::debugProjectWithoutDeploy()
{
ProjectExplorerPlugin *pe = ProjectExplorerPlugin::instance();
if (Project *pro = pe->startupProject())
pe->runProject(pro, Constants::DEBUGMODE, true);
pe->runProject(pro, QLatin1String(Constants::DEBUGMODE), true);
}
void DebuggerPluginPrivate::debugProjectBreakMain()
{
ProjectExplorerPlugin *pe = ProjectExplorerPlugin::instance();
if (Project *pro = pe->startupProject())
pe->runProject(pro, Constants::DEBUGMODE2);
pe->runProject(pro, QLatin1String(Constants::DEBUGMODE2));
}
void DebuggerPluginPrivate::startExternalApplication()
......@@ -1568,9 +1570,9 @@ void DebuggerPluginPrivate::attachToRemoteServer(const QString &spec)
{
// spec is: server:port@executable@architecture
DebuggerStartParameters sp;
sp.remoteChannel = spec.section('@', 0, 0);
sp.executable = spec.section('@', 1, 1);
sp.remoteArchitecture = spec.section('@', 2, 2);
sp.remoteChannel = spec.section(QLatin1Char('@'), 0, 0);
sp.executable = spec.section(QLatin1Char('@'), 1, 1);
sp.remoteArchitecture = spec.section(QLatin1Char('@'), 2, 2);
sp.displayName = tr("Remote: \"%1\"").arg(sp.remoteChannel);
sp.startMode = AttachToRemoteServer;
sp.toolChainAbi = anyAbiOfBinary(sp.executable);
......@@ -1869,7 +1871,7 @@ void DebuggerPluginPrivate::requestContextMenu(ITextEditor *editor,
if (editor->property("DisassemblerView").toBool()) {
args.fileName = editor->file()->fileName();
QString line = editor->contents()
.section('\n', lineNumber - 1, lineNumber - 1);
.section(QLatin1Char('\n'), lineNumber - 1, lineNumber - 1);
BreakpointResponse needle;
needle.type = BreakpointByAddress;
needle.address = DisassemblerLine::addressFromDisassemblyLine(line);
......@@ -1966,7 +1968,7 @@ void DebuggerPluginPrivate::toggleBreakpoint()
const int lineNumber = textEditor->currentLine();
if (textEditor->property("DisassemblerView").toBool()) {
QString line = textEditor->contents()
.section('\n', lineNumber - 1, lineNumber - 1);
.section(QLatin1Char('\n'), lineNumber - 1, lineNumber - 1);
quint64 address = DisassemblerLine::addressFromDisassemblyLine(line);
toggleBreakpointByAddress(address);
} else if (lineNumber >= 0) {
......@@ -2021,7 +2023,7 @@ void DebuggerPluginPrivate::requestMark(ITextEditor *editor,
if (editor->property("DisassemblerView").toBool()) {
QString line = editor->contents()
.section('\n', lineNumber - 1, lineNumber - 1);
.section(QLatin1Char('\n'), lineNumber - 1, lineNumber - 1);
quint64 address = DisassemblerLine::addressFromDisassemblyLine(line);
toggleBreakpointByAddress(address);
} else if (editor->file()) {
......@@ -2051,7 +2053,7 @@ void DebuggerPluginPrivate::displayDebugger(DebuggerEngine *engine, bool updateE
void DebuggerPluginPrivate::startDebugger(RunControl *rc)
{
QTC_ASSERT(rc, return);
ProjectExplorerPlugin::instance()->startRunControl(rc, Constants::DEBUGMODE);
ProjectExplorerPlugin::instance()->startRunControl(rc, QLatin1String(Constants::DEBUGMODE));
}
......@@ -2421,7 +2423,7 @@ void DebuggerPluginPrivate::onModeChanged(IMode *mode)
m_mainWindow->onModeChanged(mode);
if (mode->id() != Constants::MODE_DEBUG) {
if (mode->id() != QLatin1String(Constants::MODE_DEBUG)) {
m_toolTipManager->leavingDebugMode();
return;
}
......@@ -2466,7 +2468,7 @@ void DebuggerPluginPrivate::dumpLog()
void DebuggerPluginPrivate::activatePreviousMode()
{
ModeManager *modeManager = ModeManager::instance();
if (modeManager->currentMode() == modeManager->mode(MODE_DEBUG)
if (modeManager->currentMode() == modeManager->mode(QLatin1String(MODE_DEBUG))
&& !m_previousMode.isEmpty()) {
modeManager->activateMode(m_previousMode);
m_previousMode.clear();
......@@ -2711,7 +2713,7 @@ static QString formatStartParameters(DebuggerStartParameters &sp)
if (!sp.gnuTarget.isEmpty())
str << "Gnu target: " << sp.gnuTarget << '\n';
str << "Sysroot: " << sp.sysroot << '\n';
str << "Debug Source Location: " << sp.debugSourceLocation.join(":") << '\n';
str << "Debug Source Location: " << sp.debugSourceLocation.join(QLatin1String(":")) << '\n';
str << "Symbol file: " << sp.symbolFileName << '\n';
if (sp.useServerStartScript)
str << "Using server start script: " << sp.serverStartScript;
......@@ -2871,23 +2873,23 @@ void DebuggerPluginPrivate::extensionsInitialized()
m_breakHandler = new BreakHandler;
m_breakWindow = new BreakWindow;
m_breakWindow->setObjectName(DOCKWIDGET_BREAK);
m_breakWindow->setObjectName(QLatin1String(DOCKWIDGET_BREAK));
m_breakWindow->setModel(m_breakHandler->model());
//m_consoleWindow = new ConsoleWindow;
//m_consoleWindow->setObjectName(QLatin1String("CppDebugConsole"));
m_modulesWindow = new ModulesWindow;
m_modulesWindow->setObjectName(DOCKWIDGET_MODULES);
m_modulesWindow->setObjectName(QLatin1String(DOCKWIDGET_MODULES));
m_logWindow = new LogWindow;
m_logWindow->setObjectName(DOCKWIDGET_OUTPUT);
m_logWindow->setObjectName(QLatin1String(DOCKWIDGET_OUTPUT));
m_registerWindow = new RegisterWindow;
m_registerWindow->setObjectName(DOCKWIDGET_REGISTER);
m_registerWindow->setObjectName(QLatin1String(DOCKWIDGET_REGISTER));
m_stackWindow = new StackWindow;
m_stackWindow->setObjectName(DOCKWIDGET_STACK);
m_stackWindow->setObjectName(QLatin1String(DOCKWIDGET_STACK));
m_sourceFilesWindow = new SourceFilesWindow;
m_sourceFilesWindow->setObjectName(DOCKWIDGET_SOURCE_FILES);
m_sourceFilesWindow->setObjectName(QLatin1String(DOCKWIDGET_SOURCE_FILES));
m_threadsWindow = new ThreadsWindow;
m_threadsWindow->setObjectName(DOCKWIDGET_THREADS);
m_threadsWindow->setObjectName(QLatin1String(DOCKWIDGET_THREADS));
m_returnWindow = new WatchWindow(WatchWindow::ReturnType);
m_returnWindow->setObjectName(QLatin1String("CppDebugReturn"));
m_localsWindow = new WatchWindow(WatchWindow::LocalsType);
......@@ -2896,14 +2898,14 @@ void DebuggerPluginPrivate::extensionsInitialized()
m_watchersWindow->setObjectName(QLatin1String("CppDebugWatchers"));
m_scriptConsoleWindow = new QmlJSScriptConsoleWidget;
m_scriptConsoleWindow->setWindowTitle(tr("QML Script Console"));
m_scriptConsoleWindow->setObjectName(DOCKWIDGET_QML_SCRIPTCONSOLE);
m_scriptConsoleWindow->setObjectName(QLatin1String(DOCKWIDGET_QML_SCRIPTCONSOLE));
connect(m_scriptConsoleWindow, SIGNAL(evaluateExpression(QString)),
SLOT(evaluateExpression(QString)));
// Snapshot
m_snapshotHandler = new SnapshotHandler;
m_snapshotWindow = new SnapshotWindow(m_snapshotHandler);
m_snapshotWindow->setObjectName(DOCKWIDGET_SNAPSHOTS);
m_snapshotWindow->setObjectName(QLatin1String(DOCKWIDGET_SNAPSHOTS));
m_snapshotWindow->setModel(m_snapshotHandler->model());
// Watchers
......@@ -3018,7 +3020,7 @@ void DebuggerPluginPrivate::extensionsInitialized()
m_mainWindow->createDockWidget(QmlLanguage, m_scriptConsoleWindow);
QSplitter *localsAndWatchers = new MiniSplitter(Qt::Vertical);
localsAndWatchers->setObjectName(DOCKWIDGET_WATCHERS);
localsAndWatchers->setObjectName(QLatin1String(DOCKWIDGET_WATCHERS));
localsAndWatchers->setWindowTitle(m_localsWindow->windowTitle());
localsAndWatchers->addWidget(m_localsWindow);
localsAndWatchers->addWidget(m_returnWindow);
......@@ -3045,8 +3047,8 @@ void DebuggerPluginPrivate::extensionsInitialized()
// The main "Start Debugging" action.
act = m_startAction = new QAction(this);
QIcon debuggerIcon(":/projectexplorer/images/debugger_start_small.png");
debuggerIcon.addFile(":/projectexplorer/images/debugger_start.png");
QIcon debuggerIcon(QLatin1String(":/projectexplorer/images/debugger_start_small.png"));
debuggerIcon.addFile(QLatin1String(":/projectexplorer/images/debugger_start.png"));
act->setIcon(debuggerIcon);
act->setText(tr("Start Debugging"));
connect(act, SIGNAL(triggered()), this, SLOT(debugProject()));
......@@ -3116,7 +3118,7 @@ void DebuggerPluginPrivate::extensionsInitialized()
cmd = am->registerAction(m_startAction, Constants::DEBUG, globalcontext);
cmd->setDefaultText(tr("Start Debugging"));
cmd->setDefaultKeySequence(QKeySequence(Constants::DEBUG_KEY));
cmd->setDefaultKeySequence(QKeySequence(QLatin1String(Constants::DEBUG_KEY)));
cmd->setAttribute(Command::CA_UpdateText);
mstart->addAction(cmd, CC::G_DEFAULT_ONE);
......@@ -3206,7 +3208,7 @@ void DebuggerPluginPrivate::extensionsInitialized()
cmd = am->registerAction(m_continueAction,