diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2009-03-03 18:28:41 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-03 18:28:41 -0800 |
commit | 648161bb0edfc3d43db63caed5cc5213bc6cb78f (patch) | |
tree | 4b825dc642cb6eb9a060e54bf8d69288fbee4904 /JavaScriptCore/debugger | |
parent | a65af38181ac7d34544586bdb5cd004de93897ad (diff) | |
download | external_webkit-648161bb0edfc3d43db63caed5cc5213bc6cb78f.zip external_webkit-648161bb0edfc3d43db63caed5cc5213bc6cb78f.tar.gz external_webkit-648161bb0edfc3d43db63caed5cc5213bc6cb78f.tar.bz2 |
auto import from //depot/cupcake/@135843
Diffstat (limited to 'JavaScriptCore/debugger')
-rw-r--r-- | JavaScriptCore/debugger/Debugger.cpp | 54 | ||||
-rw-r--r-- | JavaScriptCore/debugger/Debugger.h | 59 | ||||
-rw-r--r-- | JavaScriptCore/debugger/DebuggerCallFrame.cpp | 82 | ||||
-rw-r--r-- | JavaScriptCore/debugger/DebuggerCallFrame.h | 67 |
4 files changed, 0 insertions, 262 deletions
diff --git a/JavaScriptCore/debugger/Debugger.cpp b/JavaScriptCore/debugger/Debugger.cpp deleted file mode 100644 index a52a542..0000000 --- a/JavaScriptCore/debugger/Debugger.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2008 Apple Inc. All rights reserved. - * Copyright (C) 1999-2001 Harri Porten (porten@kde.org) - * Copyright (C) 2001 Peter Kelly (pmk@post.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#include "config.h" -#include "Debugger.h" - -#include "JSGlobalObject.h" - -namespace JSC { - -Debugger::Debugger() -{ -} - -Debugger::~Debugger() -{ - HashSet<JSGlobalObject*>::iterator end = m_globalObjects.end(); - for (HashSet<JSGlobalObject*>::iterator it = m_globalObjects.begin(); it != end; ++it) - (*it)->setDebugger(0); -} - -void Debugger::attach(JSGlobalObject* globalObject) -{ - ASSERT(!globalObject->debugger()); - globalObject->setDebugger(this); - m_globalObjects.add(globalObject); -} - -void Debugger::detach(JSGlobalObject* globalObject) -{ - ASSERT(m_globalObjects.contains(globalObject)); - m_globalObjects.remove(globalObject); - globalObject->setDebugger(0); -} - -} // namespace JSC diff --git a/JavaScriptCore/debugger/Debugger.h b/JavaScriptCore/debugger/Debugger.h deleted file mode 100644 index 4a6a9b3..0000000 --- a/JavaScriptCore/debugger/Debugger.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (C) 1999-2001 Harri Porten (porten@kde.org) - * Copyright (C) 2001 Peter Kelly (pmk@post.com) - * Copyright (C) 2008 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifndef Debugger_h -#define Debugger_h - -#include "protect.h" - -namespace JSC { - - class DebuggerCallFrame; - class ExecState; - class JSGlobalObject; - class SourceCode; - class UString; - - class Debugger { - public: - Debugger(); - virtual ~Debugger(); - - void attach(JSGlobalObject*); - void detach(JSGlobalObject*); - - virtual void sourceParsed(ExecState*, const SourceCode&, int errorLine, const UString& errorMsg) = 0; - virtual void exception(const DebuggerCallFrame&, intptr_t sourceID, int lineno) = 0; - virtual void atStatement(const DebuggerCallFrame&, intptr_t sourceID, int lineno) = 0; - virtual void callEvent(const DebuggerCallFrame&, intptr_t sourceID, int lineno) = 0; - virtual void returnEvent(const DebuggerCallFrame&, intptr_t sourceID, int lineno) = 0; - - virtual void willExecuteProgram(const DebuggerCallFrame&, intptr_t sourceID, int lineno) = 0; - virtual void didExecuteProgram(const DebuggerCallFrame&, intptr_t sourceID, int lineno) = 0; - virtual void didReachBreakpoint(const DebuggerCallFrame&, intptr_t sourceID, int lineno) = 0; - - private: - HashSet<JSGlobalObject*> m_globalObjects; - }; - -} // namespace JSC - -#endif // Debugger_h diff --git a/JavaScriptCore/debugger/DebuggerCallFrame.cpp b/JavaScriptCore/debugger/DebuggerCallFrame.cpp deleted file mode 100644 index ae62cd3..0000000 --- a/JavaScriptCore/debugger/DebuggerCallFrame.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (C) 2008 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" -#include "DebuggerCallFrame.h" - -#include "JSFunction.h" -#include "CodeBlock.h" -#include "Machine.h" -#include "Parser.h" - -namespace JSC { - -const UString* DebuggerCallFrame::functionName() const -{ - if (!m_callFrame->codeBlock()) - return 0; - - JSFunction* function = static_cast<JSFunction*>(m_callFrame->callee()); - if (!function) - return 0; - return &function->name(&m_callFrame->globalData()); -} - -DebuggerCallFrame::Type DebuggerCallFrame::type() const -{ - if (m_callFrame->callee()) - return FunctionType; - - return ProgramType; -} - -JSObject* DebuggerCallFrame::thisObject() const -{ - if (!m_callFrame->codeBlock()) - return 0; - - // FIXME: Why is it safe to assume this is an object? - return asObject(m_callFrame->thisValue()); -} - -JSValue* DebuggerCallFrame::evaluate(const UString& script, JSValue*& exception) const -{ - if (!m_callFrame->codeBlock()) - return noValue(); - - int errLine; - UString errMsg; - SourceCode source = makeSource(script); - RefPtr<EvalNode> evalNode = m_callFrame->scopeChain()->globalData->parser->parse<EvalNode>(m_callFrame, m_callFrame->dynamicGlobalObject()->debugger(), source, &errLine, &errMsg); - if (!evalNode) - return Error::create(m_callFrame, SyntaxError, errMsg, errLine, source.provider()->asID(), source.provider()->url()); - - return m_callFrame->scopeChain()->globalData->machine->execute(evalNode.get(), m_callFrame, thisObject(), m_callFrame->scopeChain(), &exception); -} - -} // namespace JSC diff --git a/JavaScriptCore/debugger/DebuggerCallFrame.h b/JavaScriptCore/debugger/DebuggerCallFrame.h deleted file mode 100644 index 8326b20..0000000 --- a/JavaScriptCore/debugger/DebuggerCallFrame.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (C) 2008 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef DebuggerCallFrame_h -#define DebuggerCallFrame_h - -#include "ExecState.h" - -namespace JSC { - - class DebuggerCallFrame { - public: - enum Type { ProgramType, FunctionType }; - - DebuggerCallFrame(CallFrame* callFrame) - : m_callFrame(callFrame) - , m_exception(noValue()) - { - } - - DebuggerCallFrame(CallFrame* callFrame, JSValue* exception) - : m_callFrame(callFrame) - , m_exception(exception) - { - } - - JSGlobalObject* dynamicGlobalObject() const { return m_callFrame->dynamicGlobalObject(); } - const ScopeChainNode* scopeChain() const { return m_callFrame->scopeChain(); } - const UString* functionName() const; - Type type() const; - JSObject* thisObject() const; - JSValue* evaluate(const UString&, JSValue*& exception) const; - JSValue* exception() const { return m_exception; } - - private: - CallFrame* m_callFrame; - JSValue* m_exception; - }; - -} // namespace JSC - -#endif // DebuggerCallFrame_h |