forked from rolandoam/JavaScriptCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJSCDebugger.h
More file actions
68 lines (55 loc) · 1.41 KB
/
JSCDebugger.h
File metadata and controls
68 lines (55 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//
// JSCDebugger.h
// JavaScriptCore
//
// Created by Rolando Abarca on 1/26/12.
// Copyright (c) 2012 Zynga Inc. All rights reserved.
//
#ifndef JavaScriptCore_JSCDebugger_h
#define JavaScriptCore_JSCDebugger_h
namespace JSCDebug {
class JSCDebugger;
};
typedef enum {
kDebuggerContinue = 0,
kDebuggerStep,
kDebuggerStepInto,
kDebuggerStepOut
} DebuggerState;
class JSCDebuggerDelegate {
public:
virtual ~JSCDebuggerDelegate() {};
/**
* got an exception
*/
virtual void didReachException(const char *scriptURL, JSValueRef exception, int lineNumber) = 0;
/**
* we're about to pause the JS VM
*/
virtual void shouldPauseJS() = 0;
/**
* the debugger paused execution - pause anything on the other side
* (mainly threads if there's any)
*/
virtual void didPause(DebuggerState *state) = 0;
/**
* should return the global context
*/
virtual JSGlobalContextRef getGlobalContext() = 0;
/**
* should return a JSArray containing all scripts
*/
virtual JSValueRef getAllScripts() = 0;
};
class JSCDebuggerController {
private:
JSGlobalContextRef m_globalContext;
JSCDebug::JSCDebugger *m_debugger;
public:
JSCDebuggerController(JSGlobalContextRef globalContext, JSCDebuggerDelegate *delegate);
~JSCDebuggerController();
long setBreakpoint(const char *scriptURL, int lineNumber);
void removeBreakpoint(long breakpointId);
void evaluateInCurrentFrame(const char *script);
};
#endif