v8  6.2.414(node9.11.2)
V8 is Google's open source JavaScript engine
v8-debug.h
Go to the documentation of this file.
1 // Copyright 2008 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef V8_V8_DEBUG_H_
6 #define V8_V8_DEBUG_H_
7 
8 #include "v8.h" // NOLINT(build/include)
9 
15 namespace v8 {
16 
17 // Debug events which can occur in the V8 JavaScript engine.
18 enum DebugEvent {
19  Break = 1,
20  Exception = 2,
24 };
25 
27  public:
32  class ClientData {
33  public:
34  virtual ~ClientData() {}
35  };
36 
37 
41  class Message {
42  public:
46  virtual bool IsEvent() const = 0;
47  virtual bool IsResponse() const = 0;
48  virtual DebugEvent GetEvent() const = 0;
49 
54  virtual bool WillStartRunning() const = 0;
55 
61  virtual Local<Object> GetExecutionState() const = 0;
62  virtual Local<Object> GetEventData() const = 0;
63 
67  virtual Local<String> GetJSON() const = 0;
68 
74  virtual Local<Context> GetEventContext() const = 0;
75 
83  virtual ClientData* GetClientData() const = 0;
84 
85  virtual Isolate* GetIsolate() const = 0;
86 
87  virtual ~Message() {}
88  };
89 
93  class EventDetails {
94  public:
98  virtual DebugEvent GetEvent() const = 0;
99 
104  virtual Local<Object> GetExecutionState() const = 0;
105  virtual Local<Object> GetEventData() const = 0;
106 
112  virtual Local<Context> GetEventContext() const = 0;
113 
118  virtual Local<Value> GetCallbackData() const = 0;
119 
123  virtual ClientData* GetClientData() const = 0;
124 
125  virtual Isolate* GetIsolate() const = 0;
126 
127  virtual ~EventDetails() {}
128  };
129 
138  typedef void (*EventCallback)(const EventDetails& event_details);
139 
143  typedef void (*MessageHandler)(const Message& message);
144 
145  V8_DEPRECATED("No longer supported", static bool SetDebugEventListener(
146  Isolate* isolate, EventCallback that,
147  Local<Value> data = Local<Value>()));
148 
149  // Schedule a debugger break to happen when JavaScript code is run
150  // in the given isolate.
151  V8_DEPRECATED("No longer supported",
152  static void DebugBreak(Isolate* isolate));
153 
154  // Remove scheduled debugger break in given isolate if it has not
155  // happened yet.
156  V8_DEPRECATED("No longer supported",
157  static void CancelDebugBreak(Isolate* isolate));
158 
159  // Check if a debugger break is scheduled in the given isolate.
160  V8_DEPRECATED("No longer supported",
161  static bool CheckDebugBreak(Isolate* isolate));
162 
163  // This is now a no-op.
164  V8_DEPRECATED("No longer supported",
165  static void SetMessageHandler(Isolate* isolate,
166  MessageHandler handler));
167 
168  // This is now a no-op.
169  V8_DEPRECATED("No longer supported",
170  static void SendCommand(Isolate* isolate,
171  const uint16_t* command, int length,
172  ClientData* client_data = NULL));
173 
192  V8_DEPRECATED("No longer supported",
193  static MaybeLocal<Value> Call(
195  Local<Value> data = Local<Value>()));
196 
197  // This is now a no-op.
198  V8_DEPRECATED("No longer supported",
199  static void ProcessDebugMessages(Isolate* isolate));
200 
208  V8_DEPRECATED("Use v8-inspector",
209  static Local<Context> GetDebugContext(Isolate* isolate));
210 
216  "No longer supported",
217  static MaybeLocal<Context> GetDebuggedContext(Isolate* isolate));
218 
224  V8_DEPRECATED("No longer supported",
225  static void SetLiveEditEnabled(Isolate* isolate, bool enable));
226 
232  V8_DEPRECATED("No longer supported",
233  static MaybeLocal<Array> GetInternalProperties(
234  Isolate* isolate, Local<Value> value));
235 
241  V8_DEPRECATED("No longer supported",
242  static bool IsTailCallEliminationEnabled(Isolate* isolate));
243  V8_DEPRECATED("No longer supported",
244  static void SetTailCallEliminationEnabled(Isolate* isolate,
245  bool enabled));
246 };
247 
248 
249 } // namespace v8
250 
251 
252 #undef EXPORT
253 
254 
255 #endif // V8_V8_DEBUG_H_
virtual ~Message()
Definition: v8-debug.h:87
DebugEvent
Definition: v8-debug.h:18
virtual ~EventDetails()
Definition: v8-debug.h:127
Definition: libplatform.h:12
#define V8_DEPRECATED(message, declarator)
Definition: v8config.h:325
virtual ~ClientData()
Definition: v8-debug.h:34
#define V8_EXPORT
Definition: v8.h:56
Definition: v8.h:112