27
27
28
28
#include < v8.h>
29
29
30
- #ifdef ENABLE_DEBUGGER_SUPPORT
31
30
#include < v8-debug.h>
32
- #endif // ENABLE_DEBUGGER_SUPPORT
33
31
34
32
#include < fcntl.h>
35
33
#include < string.h>
@@ -109,7 +107,6 @@ bool RunCppCycle(v8::Handle<v8::Script> script,
109
107
bool report_exceptions);
110
108
111
109
112
- #ifdef ENABLE_DEBUGGER_SUPPORT
113
110
v8::Persistent<v8::Context> debug_message_context;
114
111
115
112
void DispatchDebugMessages () {
@@ -132,7 +129,6 @@ void DispatchDebugMessages() {
132
129
133
130
v8::Debug::ProcessDebugMessages ();
134
131
}
135
- #endif // ENABLE_DEBUGGER_SUPPORT
136
132
137
133
138
134
int RunMain (int argc, char * argv[]) {
@@ -144,11 +140,9 @@ int RunMain(int argc, char* argv[]) {
144
140
v8::Handle <v8::Value> script_name;
145
141
int script_param_counter = 0 ;
146
142
147
- #ifdef ENABLE_DEBUGGER_SUPPORT
148
143
int port_number = -1 ;
149
144
bool wait_for_connection = false ;
150
145
bool support_callback = false ;
151
- #endif // ENABLE_DEBUGGER_SUPPORT
152
146
153
147
MainCycleType cycle_type = CycleInCpp;
154
148
@@ -162,15 +156,13 @@ int RunMain(int argc, char* argv[]) {
162
156
cycle_type = CycleInCpp;
163
157
} else if (strcmp (str, " --main-cycle-in-js" ) == 0 ) {
164
158
cycle_type = CycleInJs;
165
- #ifdef ENABLE_DEBUGGER_SUPPORT
166
159
} else if (strcmp (str, " --callback" ) == 0 ) {
167
160
support_callback = true ;
168
161
} else if (strcmp (str, " --wait-for-connection" ) == 0 ) {
169
162
wait_for_connection = true ;
170
163
} else if (strcmp (str, " -p" ) == 0 && i + 1 < argc) {
171
164
port_number = atoi (argv[i + 1 ]); // NOLINT
172
165
i++;
173
- #endif // ENABLE_DEBUGGER_SUPPORT
174
166
} else if (strncmp (str, " --" , 2 ) == 0 ) {
175
167
printf (" Warning: unknown flag %s.\n Try --help for options\n " , str);
176
168
} else if (strcmp (str, " -e" ) == 0 && i + 1 < argc) {
@@ -218,7 +210,6 @@ int RunMain(int argc, char* argv[]) {
218
210
// Enter the newly created execution environment.
219
211
v8::Context::Scope context_scope (context);
220
212
221
- #ifdef ENABLE_DEBUGGER_SUPPORT
222
213
debug_message_context.Reset (isolate, context);
223
214
224
215
v8::Locker locker (isolate);
@@ -230,7 +221,6 @@ int RunMain(int argc, char* argv[]) {
230
221
if (port_number != -1 ) {
231
222
v8::Debug::EnableAgent (" lineprocessor" , port_number, wait_for_connection);
232
223
}
233
- #endif // ENABLE_DEBUGGER_SUPPORT
234
224
235
225
bool report_exceptions = true ;
236
226
@@ -275,9 +265,7 @@ bool RunCppCycle(v8::Handle<v8::Script> script,
275
265
v8::Local<v8::Context> context,
276
266
bool report_exceptions) {
277
267
v8::Isolate* isolate = context->GetIsolate ();
278
- #ifdef ENABLE_DEBUGGER_SUPPORT
279
268
v8::Locker lock (isolate);
280
- #endif // ENABLE_DEBUGGER_SUPPORT
281
269
282
270
v8::Handle <v8::String> fun_name =
283
271
v8::String::NewFromUtf8 (isolate, " ProcessLine" );
@@ -435,9 +423,7 @@ v8::Handle<v8::String> ReadLine() {
435
423
436
424
char * res;
437
425
{
438
- #ifdef ENABLE_DEBUGGER_SUPPORT
439
426
v8::Unlocker unlocker (v8::Isolate::GetCurrent ());
440
- #endif // ENABLE_DEBUGGER_SUPPORT
441
427
res = fgets (buffer, kBufferSize , stdin);
442
428
}
443
429
v8::Isolate* isolate = v8::Isolate::GetCurrent ();
0 commit comments