QML JS Debugger: Break when there is an uncaught exception

This commit is contained in:
Olivier Goffart
2010-07-23 18:40:12 +02:00
parent e139238d14
commit 91b6d329fe
3 changed files with 23 additions and 8 deletions

View File

@@ -59,6 +59,7 @@
#include <QtGui/QMainWindow>
#include <QtGui/QMessageBox>
#include <QtGui/QToolTip>
#include <QtGui/QTextDocument>
#include <QtNetwork/QTcpSocket>
#include <QtNetwork/QHostAddress>
@@ -75,6 +76,7 @@
# define XSDEBUG(s) qDebug() << s
namespace Debugger {
namespace Internal {
@@ -656,6 +658,16 @@ void QmlEngine::messageReceived(const QByteArray &message)
Debugger::DebuggerUISwitcher *uiSwitcher = Debugger::DebuggerUISwitcher::instance();
uiSwitcher->setActiveLanguage("C++");
bool becauseOfexception;
stream >> becauseOfexception;
if (becauseOfexception) {
QString error;
stream >> error;
QString msg = tr("<p>An Uncaught Exception occured in <i>%1</i>:</p><p>%2</p>").arg(stackFrames.value(0).file, Qt::escape(error));
showMessageBox(QMessageBox::Information, tr("Uncaught Exception"), msg);
}
} else if (command == "RESULT") {
WatchData data;