diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 1e80cfa632c9b1d91cfa8415dff803776d011a51..37e6df0718dc0ff0981a442e8f7739fb750e23af 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -85,7 +85,7 @@ namespace Internal { using namespace Debugger::Constants; //#define DEBUG_PENDING 1 -//#define DEBUG_SUBITEM 1 +#define DEBUG_SUBITEM 1 #if DEBUG_PENDING # define PENDING_DEBUG(s) qDebug() << s @@ -1283,6 +1283,9 @@ void GdbEngine::reloadStack() if (stackDepth && !m_gdbAdapter->isAdapter()) cmd += _(" 0 ") + QString::number(stackDepth); postCommand(cmd, WatchUpdate, CB(handleStackListFrames), false); + // FIXME: gdb 6.4 likes to be asked twice + if (m_gdbAdapter->isAdapter()) + postCommand(cmd, WatchUpdate, CB(handleStackListFrames), false); } void GdbEngine::handleAsyncOutput2(const GdbResultRecord &, const QVariant &cookie) @@ -3767,6 +3770,16 @@ void GdbEngine::setLocals(const QList<GdbMi> &locals) // pass through the insertData() machinery if (isIntOrFloatType(data.type) || isPointerType(data.type)) setWatchDataValue(data, item.findChild("value")); + if (isSymbianIntType(data.type)) { + setWatchDataValue(data, item.findChild("value")); + data.setHasChildren(false); + } + // Let's be a bit more bold: + //if (!hasDebuggingHelperForType(data.type)) { + // QByteArray value = item.findChild("value").data(); + // if (!value.isEmpty() && value != "{...}") + // data.setValue(decodeData(value, 0)); + //} if (!qq->watchHandler()->isExpandedIName(data.iname)) data.setChildrenUnneeded(); if (isPointerType(data.type) || data.name == __("this")) diff --git a/src/plugins/debugger/gdb/trkclient.cpp b/src/plugins/debugger/gdb/trkclient.cpp index ee3d536e4778eae1208e6452870ee35e33457cba..f315d404ad1e3782c74ccdcff84ba722e1e01907 100644 --- a/src/plugins/debugger/gdb/trkclient.cpp +++ b/src/plugins/debugger/gdb/trkclient.cpp @@ -50,7 +50,7 @@ # include <unistd.h> #endif -enum { TimerInterval = 100 }; +enum { TimerInterval = 10 }; #ifdef Q_OS_WIN diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index d8e6cca6007e089bbece02b0ba6e3cbdf8b44b5a..8e71dae9610d881cf26fb92b45e327072a151b35 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -66,7 +66,7 @@ namespace Debugger { namespace Internal { static const QString strNotInScope = - QCoreApplication::translate("Debugger::Internal::WatchData", "<not in scope>"); + QCoreApplication::translate("Debugger::Internal::WatchData", "<not in scope>"); static int watcherCounter = 0; static int generationCounter = 0; diff --git a/src/plugins/debugger/watchutils.cpp b/src/plugins/debugger/watchutils.cpp index 1663f942668593244b4412278965cc9720e6a6de..ff706a13bf62ddf3af91971b8671b5ebea09ee7f 100644 --- a/src/plugins/debugger/watchutils.cpp +++ b/src/plugins/debugger/watchutils.cpp @@ -339,6 +339,13 @@ bool isIntType(const QString &type) return types.contains(type); } +bool isSymbianIntType(const QString &type) +{ + static const QStringList types = QStringList() + << QLatin1String("TInt") << QLatin1String("TBool"); + return types.contains(type); +} + bool isIntOrFloatType(const QString &type) { static const QStringList types = QStringList() diff --git a/src/plugins/debugger/watchutils.h b/src/plugins/debugger/watchutils.h index f085179d413f2856265cc46b65bc40be04310960..395ba5f5eac9974abe2fa9694c0736752a2f0081 100644 --- a/src/plugins/debugger/watchutils.h +++ b/src/plugins/debugger/watchutils.h @@ -73,6 +73,7 @@ bool extractTemplate(const QString &type, QString *tmplate, QString *inner); QString extractTypeFromPTypeOutput(const QString &str); bool isIntOrFloatType(const QString &type); bool isIntType(const QString &type); +bool isSymbianIntType(const QString &type); enum GuessChildrenResult { HasChildren, HasNoChildren, HasPossiblyChildren }; GuessChildrenResult guessChildren(const QString &type); diff --git a/src/plugins/qtscripteditor/parser/javascript.g b/src/plugins/qtscripteditor/parser/javascript.g index d7fa027c0dd28c793fcfe36909b3b6a7efd68f59..ceb2aeb726b247a5f2fd8496fc23d3dd7cd3cfad 100644 --- a/src/plugins/qtscripteditor/parser/javascript.g +++ b/src/plugins/qtscripteditor/parser/javascript.g @@ -428,7 +428,7 @@ bool JavaScriptParser::parse(JavaScriptEnginePrivate *driver) _Lcheck_token: if (yytoken == -1 && -TERMINAL_COUNT != action_index[action]) { - yyprevlloc = yylloc; + yyprevlloc = yylloc; if (first_token == last_token) { yytoken = lexer->lex(); @@ -2119,7 +2119,12 @@ PropertyNameAndValueListOpt: PropertyNameAndValueList ; token_buffer[1].loc = yylloc = location(lexer); if (t_action(errorState, yytoken)) { - const QString msg = QString::fromUtf8("Removed token: `%1'").arg(spell[token_buffer[0].token]); + QString msg = QString::fromUtf8("Removed token"); + if (const char *tokenSpell = spell[token_buffer[0].token]) { + msg += QLatin1String(": `"); + msg += QLatin1String(tokenSpell); + msg += QLatin1Char('\''); + } diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); @@ -2149,7 +2154,12 @@ PropertyNameAndValueListOpt: PropertyNameAndValueList ; for (int *tk = tokens; *tk != EOF_SYMBOL; ++tk) { int a = t_action(errorState, *tk); if (a > 0 && t_action(a, yytoken)) { - const QString msg = QString::fromUtf8("Inserted token: `%1'").arg(spell[*tk]); + QString msg = QString::fromUtf8("Inserted token"); + if (const char *tokenSpell = spell[*tk]) { + msg += QLatin1String(": `"); + msg += QLatin1String(tokenSpell); + msg += QLatin1Char('\''); + } diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); @@ -2169,7 +2179,13 @@ PropertyNameAndValueListOpt: PropertyNameAndValueList ; for (int tk = 1; tk < TERMINAL_COUNT; ++tk) { int a = t_action(errorState, tk); if (a > 0 && t_action(a, yytoken)) { - const QString msg = QString::fromUtf8("Inserted token: `%1'").arg(spell[tk]); + QString msg = QString::fromUtf8("Inserted token"); + if (const char *tokenSpell = spell[tk]) { + msg += QLatin1String(": `"); + msg += QLatin1String(tokenSpell); + msg += QLatin1Char('\''); + } + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); @@ -2182,7 +2198,13 @@ PropertyNameAndValueListOpt: PropertyNameAndValueList ; } } - const QString msg = QString::fromUtf8("Unexpected token: `%1'").arg(spell[token_buffer[0].token]); + QString msg = QString::fromUtf8("Unexpected token"); + if (const char *tokenSpell = spell[token_buffer[0].token]) { + msg += QLatin1String(": `"); + msg += QLatin1String(tokenSpell); + msg += QLatin1Char('\''); + } + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); } diff --git a/src/plugins/qtscripteditor/parser/javascriptgrammar.cpp b/src/plugins/qtscripteditor/parser/javascriptgrammar.cpp index abe49bf93ec6d014a266a9e3cfa26f96c5fd9d71..1c46c75562f698bbd38ac229e6bbab09b0133704 100644 --- a/src/plugins/qtscripteditor/parser/javascriptgrammar.cpp +++ b/src/plugins/qtscripteditor/parser/javascriptgrammar.cpp @@ -1,17 +1,4 @@ // This file was generated by qlalr - DO NOT EDIT! -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** -** This file is part of the $MODULE$ of the Qt Toolkit. -** -** $TROLLTECH_DUAL_LICENSE$ -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -****************************************************************************/ - #include "javascriptgrammar_p.h" const char *const JavaScriptGrammar::spell [] = { diff --git a/src/plugins/qtscripteditor/parser/javascriptparser.cpp b/src/plugins/qtscripteditor/parser/javascriptparser.cpp index c7b74ad340bd7c7637ca23c65126c4b68dbff5a2..66acc68e6b187a71bc481362b1dcd588e5d35c77 100644 --- a/src/plugins/qtscripteditor/parser/javascriptparser.cpp +++ b/src/plugins/qtscripteditor/parser/javascriptparser.cpp @@ -132,7 +132,7 @@ bool JavaScriptParser::parse(JavaScriptEnginePrivate *driver) _Lcheck_token: if (yytoken == -1 && -TERMINAL_COUNT != action_index[action]) { - yyprevlloc = yylloc; + yyprevlloc = yylloc; if (first_token == last_token) { yytoken = lexer->lex(); @@ -1123,7 +1123,12 @@ case 266: { token_buffer[1].loc = yylloc = location(lexer); if (t_action(errorState, yytoken)) { - const QString msg = QString::fromUtf8("Removed token: `%1'").arg(spell[token_buffer[0].token]); + QString msg = QString::fromUtf8("Removed token"); + if (const char *tokenSpell = spell[token_buffer[0].token]) { + msg += QLatin1String(": `"); + msg += QLatin1String(tokenSpell); + msg += QLatin1Char('\''); + } diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); @@ -1153,7 +1158,12 @@ case 266: { for (int *tk = tokens; *tk != EOF_SYMBOL; ++tk) { int a = t_action(errorState, *tk); if (a > 0 && t_action(a, yytoken)) { - const QString msg = QString::fromUtf8("Inserted token: `%1'").arg(spell[*tk]); + QString msg = QString::fromUtf8("Inserted token"); + if (const char *tokenSpell = spell[*tk]) { + msg += QLatin1String(": `"); + msg += QLatin1String(tokenSpell); + msg += QLatin1Char('\''); + } diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); @@ -1173,7 +1183,13 @@ case 266: { for (int tk = 1; tk < TERMINAL_COUNT; ++tk) { int a = t_action(errorState, tk); if (a > 0 && t_action(a, yytoken)) { - const QString msg = QString::fromUtf8("Inserted token: `%1'").arg(spell[tk]); + QString msg = QString::fromUtf8("Inserted token"); + if (const char *tokenSpell = spell[tk]) { + msg += QLatin1String(": `"); + msg += QLatin1String(tokenSpell); + msg += QLatin1Char('\''); + } + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); @@ -1186,7 +1202,13 @@ case 266: { } } - const QString msg = QString::fromUtf8("Unexpected token: `%1'").arg(spell[token_buffer[0].token]); + QString msg = QString::fromUtf8("Unexpected token"); + if (const char *tokenSpell = spell[token_buffer[0].token]) { + msg += QLatin1String(": `"); + msg += QLatin1String(tokenSpell); + msg += QLatin1Char('\''); + } + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc.startLine, token_buffer[0].loc.startColumn, msg)); }