void QScriptEngineAgentPrivate::exceptionThrow(const JSC::DebuggerCallFrame& frame, intptr_t sourceID, bool hasHandler)
{
    JSC::CallFrame *oldFrame = engine->currentFrame;
    engine->currentFrame = frame.callFrame();
    QScriptValue value(engine->scriptValueFromJSCValue(frame.exception()));
    q_ptr->exceptionThrow(sourceID, value, hasHandler);
    engine->currentFrame = oldFrame;
    engine->setCurrentException(value);
};
void QScriptEngineAgentPrivate::exceptionCatch(const JSC::DebuggerCallFrame& frame, intptr_t sourceID)
{
    JSC::CallFrame *oldFrame = engine->currentFrame;
    engine->currentFrame = frame.callFrame();
    QScriptValue value(engine->scriptValueFromJSCValue(frame.exception()));
    q_ptr->exceptionCatch(sourceID, value);
    engine->currentFrame = oldFrame;
    engine->clearCurrentException();
}
예제 #3
0
void QScriptEngineAgentPrivate::exceptionThrow(const JSC::DebuggerCallFrame& frame, intptr_t sourceID, bool hasHandler)
{
    JSC::CallFrame *oldFrame = engine->currentFrame;
    int oldAgentLineNumber = engine->agentLineNumber;
    engine->currentFrame = frame.callFrame();
    QScriptValue value(engine->scriptValueFromJSCValue(frame.exception()));
    engine->agentLineNumber = value.property(QLatin1String("lineNumber")).toInt32();
    q_ptr->exceptionThrow(sourceID, value, hasHandler);
    engine->agentLineNumber = oldAgentLineNumber;
    engine->currentFrame = oldFrame;
    engine->setCurrentException(value);
};
void QScriptEngineAgentPrivate::atStatement(const JSC::DebuggerCallFrame& frame, intptr_t sourceID, int lineno/*, int column*/)
{
    QScript::UStringSourceProviderWithFeedback *source = engine->loadedScripts.value(sourceID);
    if (!source) {
        // QTBUG-6108: We don't have the source for this script, so ignore.
        return;
    }
//    column = source->columnNumberFromOffset(column);
    int column = 1;
    JSC::CallFrame *oldFrame = engine->currentFrame;
    int oldAgentLineNumber = engine->agentLineNumber;
    engine->currentFrame = frame.callFrame();
    engine->agentLineNumber = lineno;
    q_ptr->positionChange(sourceID, lineno, column);
    engine->currentFrame = oldFrame;
    engine->agentLineNumber = oldAgentLineNumber;
}
void QScriptEngineAgentPrivate::didReachBreakpoint(const JSC::DebuggerCallFrame& frame,
                                                   intptr_t sourceID, int lineno/*, int column*/)
{
    if (q_ptr->supportsExtension(QScriptEngineAgent::DebuggerInvocationRequest)) {
        QScript::UStringSourceProviderWithFeedback *source = engine->loadedScripts.value(sourceID);
        if (!source) {
            // QTBUG-6108: We don't have the source for this script, so ignore.
            return;
        }
//        column = source->columnNumberFromOffset(column);
        int column = 1;
        JSC::CallFrame *oldFrame = engine->currentFrame;
        int oldAgentLineNumber = engine->agentLineNumber;
        engine->currentFrame = frame.callFrame();
        engine->agentLineNumber = lineno;
        QList<QVariant> args;
        args << qint64(sourceID) << lineno << column;
        q_ptr->extension(QScriptEngineAgent::DebuggerInvocationRequest, args);
        engine->currentFrame = oldFrame;
        engine->agentLineNumber = oldAgentLineNumber;
    }
};