]> git.saurik.com Git - apple/javascriptcore.git/blob - debugger/Debugger.h
JavaScriptCore-1218.33.tar.gz
[apple/javascriptcore.git] / debugger / Debugger.h
1 /*
2 * Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
3 * Copyright (C) 2001 Peter Kelly (pmk@post.com)
4 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved.
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 *
20 */
21
22 #ifndef Debugger_h
23 #define Debugger_h
24
25 #include <wtf/HashSet.h>
26
27 namespace JSC {
28
29 class DebuggerCallFrame;
30 class ExecState;
31 class VM;
32 class JSGlobalObject;
33 class JSValue;
34 class SourceProvider;
35
36 class JS_EXPORT_PRIVATE Debugger {
37 public:
38 virtual ~Debugger();
39
40 void attach(JSGlobalObject*);
41 virtual void detach(JSGlobalObject*);
42
43 virtual void sourceParsed(ExecState*, SourceProvider*, int errorLineNumber, const WTF::String& errorMessage) = 0;
44
45 virtual void exception(const DebuggerCallFrame&, intptr_t, int, int, bool) = 0;
46 virtual void atStatement(const DebuggerCallFrame&, intptr_t, int, int) = 0;
47 virtual void callEvent(const DebuggerCallFrame&, intptr_t, int, int) = 0;
48 virtual void returnEvent(const DebuggerCallFrame&, intptr_t, int, int) = 0;
49
50 virtual void willExecuteProgram(const DebuggerCallFrame&, intptr_t, int, int) = 0;
51 virtual void didExecuteProgram(const DebuggerCallFrame&, intptr_t, int, int) = 0;
52 virtual void didReachBreakpoint(const DebuggerCallFrame&, intptr_t, int, int) = 0;
53
54
55 void recompileAllJSFunctions(VM*);
56
57 private:
58 HashSet<JSGlobalObject*> m_globalObjects;
59 };
60
61 // This function exists only for backwards compatibility with existing WebScriptDebugger clients.
62 JS_EXPORT_PRIVATE JSValue evaluateInGlobalCallFrame(const WTF::String&, JSValue& exception, JSGlobalObject*);
63
64 } // namespace JSC
65
66 #endif // Debugger_h