Skip to content

Commit 1298477

Browse files
Always include debugger support.
Motivation: we do not have test coverage for debuggersupport=off. [email protected] Review URL: https://codereview.chromium.org/256653004 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@20969 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
1 parent bebfe57 commit 1298477

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+57
-494
lines changed

Makefile

-4
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,6 @@ endif
9696
ifeq ($(optdebug), on)
9797
GYPFLAGS += -Dv8_optimized_debug=2
9898
endif
99-
# debuggersupport=off
100-
ifeq ($(debuggersupport), off)
101-
GYPFLAGS += -Dv8_enable_debugger_support=0
102-
endif
10399
# unalignedaccess=on
104100
ifeq ($(unalignedaccess), on)
105101
GYPFLAGS += -Dv8_can_use_unaligned_accesses=true

build/features.gypi

-5
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131
'variables': {
3232
'v8_compress_startup_data%': 'off',
3333

34-
'v8_enable_debugger_support%': 1,
35-
3634
'v8_enable_disassembler%': 0,
3735

3836
'v8_enable_gdbjit%': 0,
@@ -64,9 +62,6 @@
6462
},
6563
'target_defaults': {
6664
'conditions': [
67-
['v8_enable_debugger_support==1', {
68-
'defines': ['ENABLE_DEBUGGER_SUPPORT',],
69-
}],
7065
['v8_enable_disassembler==1', {
7166
'defines': ['ENABLE_DISASSEMBLER',],
7267
}],

samples/lineprocessor.cc

-14
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@
2727

2828
#include <v8.h>
2929

30-
#ifdef ENABLE_DEBUGGER_SUPPORT
3130
#include <v8-debug.h>
32-
#endif // ENABLE_DEBUGGER_SUPPORT
3331

3432
#include <fcntl.h>
3533
#include <string.h>
@@ -109,7 +107,6 @@ bool RunCppCycle(v8::Handle<v8::Script> script,
109107
bool report_exceptions);
110108

111109

112-
#ifdef ENABLE_DEBUGGER_SUPPORT
113110
v8::Persistent<v8::Context> debug_message_context;
114111

115112
void DispatchDebugMessages() {
@@ -132,7 +129,6 @@ void DispatchDebugMessages() {
132129

133130
v8::Debug::ProcessDebugMessages();
134131
}
135-
#endif // ENABLE_DEBUGGER_SUPPORT
136132

137133

138134
int RunMain(int argc, char* argv[]) {
@@ -144,11 +140,9 @@ int RunMain(int argc, char* argv[]) {
144140
v8::Handle<v8::Value> script_name;
145141
int script_param_counter = 0;
146142

147-
#ifdef ENABLE_DEBUGGER_SUPPORT
148143
int port_number = -1;
149144
bool wait_for_connection = false;
150145
bool support_callback = false;
151-
#endif // ENABLE_DEBUGGER_SUPPORT
152146

153147
MainCycleType cycle_type = CycleInCpp;
154148

@@ -162,15 +156,13 @@ int RunMain(int argc, char* argv[]) {
162156
cycle_type = CycleInCpp;
163157
} else if (strcmp(str, "--main-cycle-in-js") == 0) {
164158
cycle_type = CycleInJs;
165-
#ifdef ENABLE_DEBUGGER_SUPPORT
166159
} else if (strcmp(str, "--callback") == 0) {
167160
support_callback = true;
168161
} else if (strcmp(str, "--wait-for-connection") == 0) {
169162
wait_for_connection = true;
170163
} else if (strcmp(str, "-p") == 0 && i + 1 < argc) {
171164
port_number = atoi(argv[i + 1]); // NOLINT
172165
i++;
173-
#endif // ENABLE_DEBUGGER_SUPPORT
174166
} else if (strncmp(str, "--", 2) == 0) {
175167
printf("Warning: unknown flag %s.\nTry --help for options\n", str);
176168
} else if (strcmp(str, "-e") == 0 && i + 1 < argc) {
@@ -218,7 +210,6 @@ int RunMain(int argc, char* argv[]) {
218210
// Enter the newly created execution environment.
219211
v8::Context::Scope context_scope(context);
220212

221-
#ifdef ENABLE_DEBUGGER_SUPPORT
222213
debug_message_context.Reset(isolate, context);
223214

224215
v8::Locker locker(isolate);
@@ -230,7 +221,6 @@ int RunMain(int argc, char* argv[]) {
230221
if (port_number != -1) {
231222
v8::Debug::EnableAgent("lineprocessor", port_number, wait_for_connection);
232223
}
233-
#endif // ENABLE_DEBUGGER_SUPPORT
234224

235225
bool report_exceptions = true;
236226

@@ -275,9 +265,7 @@ bool RunCppCycle(v8::Handle<v8::Script> script,
275265
v8::Local<v8::Context> context,
276266
bool report_exceptions) {
277267
v8::Isolate* isolate = context->GetIsolate();
278-
#ifdef ENABLE_DEBUGGER_SUPPORT
279268
v8::Locker lock(isolate);
280-
#endif // ENABLE_DEBUGGER_SUPPORT
281269

282270
v8::Handle<v8::String> fun_name =
283271
v8::String::NewFromUtf8(isolate, "ProcessLine");
@@ -435,9 +423,7 @@ v8::Handle<v8::String> ReadLine() {
435423

436424
char* res;
437425
{
438-
#ifdef ENABLE_DEBUGGER_SUPPORT
439426
v8::Unlocker unlocker(v8::Isolate::GetCurrent());
440-
#endif // ENABLE_DEBUGGER_SUPPORT
441427
res = fgets(buffer, kBufferSize, stdin);
442428
}
443429
v8::Isolate* isolate = v8::Isolate::GetCurrent();

src/api.cc

-5
Original file line numberDiff line numberDiff line change
@@ -6809,8 +6809,6 @@ Local<Value> Exception::Error(v8::Handle<v8::String> raw_message) {
68096809

68106810
// --- D e b u g S u p p o r t ---
68116811

6812-
#ifdef ENABLE_DEBUGGER_SUPPORT
6813-
68146812
bool Debug::SetDebugEventListener2(EventCallback2 that, Handle<Value> data) {
68156813
i::Isolate* isolate = i::Isolate::Current();
68166814
EnsureInitializedForIsolate(isolate, "v8::Debug::SetDebugEventListener2()");
@@ -6975,9 +6973,6 @@ void Debug::SetLiveEditEnabled(Isolate* isolate, bool enable) {
69756973
}
69766974

69776975

6978-
#endif // ENABLE_DEBUGGER_SUPPORT
6979-
6980-
69816976
Handle<String> CpuProfileNode::GetFunctionName() const {
69826977
i::Isolate* isolate = i::Isolate::Current();
69836978
const i::ProfileNode* node = reinterpret_cast<const i::ProfileNode*>(this);

src/arm/assembler-arm-inl.h

-4
Original file line numberDiff line numberDiff line change
@@ -323,14 +323,12 @@ void RelocInfo::Visit(Isolate* isolate, ObjectVisitor* visitor) {
323323
visitor->VisitExternalReference(this);
324324
} else if (RelocInfo::IsCodeAgeSequence(mode)) {
325325
visitor->VisitCodeAgeSequence(this);
326-
#ifdef ENABLE_DEBUGGER_SUPPORT
327326
} else if (((RelocInfo::IsJSReturn(mode) &&
328327
IsPatchedReturnSequence()) ||
329328
(RelocInfo::IsDebugBreakSlot(mode) &&
330329
IsPatchedDebugBreakSlotSequence())) &&
331330
isolate->debug()->has_break_points()) {
332331
visitor->VisitDebugTarget(this);
333-
#endif
334332
} else if (RelocInfo::IsRuntimeEntry(mode)) {
335333
visitor->VisitRuntimeEntry(this);
336334
}
@@ -350,14 +348,12 @@ void RelocInfo::Visit(Heap* heap) {
350348
StaticVisitor::VisitExternalReference(this);
351349
} else if (RelocInfo::IsCodeAgeSequence(mode)) {
352350
StaticVisitor::VisitCodeAgeSequence(heap, this);
353-
#ifdef ENABLE_DEBUGGER_SUPPORT
354351
} else if (heap->isolate()->debug()->has_break_points() &&
355352
((RelocInfo::IsJSReturn(mode) &&
356353
IsPatchedReturnSequence()) ||
357354
(RelocInfo::IsDebugBreakSlot(mode) &&
358355
IsPatchedDebugBreakSlotSequence()))) {
359356
StaticVisitor::VisitDebugTarget(heap, this);
360-
#endif
361357
} else if (RelocInfo::IsRuntimeEntry(mode)) {
362358
StaticVisitor::VisitRuntimeEntry(this);
363359
}

src/arm/assembler-arm.cc

-2
Original file line numberDiff line numberDiff line change
@@ -3175,9 +3175,7 @@ void Assembler::RecordComment(const char* msg) {
31753175
void Assembler::RecordConstPool(int size) {
31763176
// We only need this for debugger support, to correctly compute offsets in the
31773177
// code.
3178-
#ifdef ENABLE_DEBUGGER_SUPPORT
31793178
RecordRelocInfo(RelocInfo::CONST_POOL, static_cast<intptr_t>(size));
3180-
#endif
31813179
}
31823180

31833181

src/arm/builtins-arm.cc

-2
Original file line numberDiff line numberDiff line change
@@ -376,14 +376,12 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
376376
Label rt_call, allocated;
377377
if (FLAG_inline_new) {
378378
Label undo_allocation;
379-
#ifdef ENABLE_DEBUGGER_SUPPORT
380379
ExternalReference debug_step_in_fp =
381380
ExternalReference::debug_step_in_fp_address(isolate);
382381
__ mov(r2, Operand(debug_step_in_fp));
383382
__ ldr(r2, MemOperand(r2));
384383
__ tst(r2, r2);
385384
__ b(ne, &rt_call);
386-
#endif
387385

388386
// Load the initial map and verify that it is in fact a map.
389387
// r1: constructor function

src/arm/debug-arm.cc

-5
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
namespace v8 {
3636
namespace internal {
3737

38-
#ifdef ENABLE_DEBUGGER_SUPPORT
3938
bool BreakLocationIterator::IsDebugBreakAtReturn() {
4039
return Debug::IsDebugBreakAtReturn(rinfo());
4140
}
@@ -329,10 +328,6 @@ const bool Debug::kFrameDropperSupported = false;
329328

330329
#undef __
331330

332-
333-
334-
#endif // ENABLE_DEBUGGER_SUPPORT
335-
336331
} } // namespace v8::internal
337332

338333
#endif // V8_TARGET_ARCH_ARM

src/arm/macro-assembler-arm.cc

-2
Original file line numberDiff line numberDiff line change
@@ -1335,15 +1335,13 @@ void MacroAssembler::IsObjectNameType(Register object,
13351335
}
13361336

13371337

1338-
#ifdef ENABLE_DEBUGGER_SUPPORT
13391338
void MacroAssembler::DebugBreak() {
13401339
mov(r0, Operand::Zero());
13411340
mov(r1, Operand(ExternalReference(Runtime::kDebugBreak, isolate())));
13421341
CEntryStub ces(isolate(), 1);
13431342
ASSERT(AllowThisStubCall(&ces));
13441343
Call(ces.GetCode(), RelocInfo::DEBUG_BREAK);
13451344
}
1346-
#endif
13471345

13481346

13491347
void MacroAssembler::PushTryHandler(StackHandler::Kind kind,

src/arm/macro-assembler-arm.h

-2
Original file line numberDiff line numberDiff line change
@@ -630,12 +630,10 @@ class MacroAssembler: public Assembler {
630630
Register scratch,
631631
Label* fail);
632632

633-
#ifdef ENABLE_DEBUGGER_SUPPORT
634633
// ---------------------------------------------------------------------------
635634
// Debugger Support
636635

637636
void DebugBreak();
638-
#endif
639637

640638
// ---------------------------------------------------------------------------
641639
// Exception handling

src/arm64/assembler-arm64-inl.h

-4
Original file line numberDiff line numberDiff line change
@@ -825,14 +825,12 @@ void RelocInfo::Visit(Isolate* isolate, ObjectVisitor* visitor) {
825825
visitor->VisitCell(this);
826826
} else if (mode == RelocInfo::EXTERNAL_REFERENCE) {
827827
visitor->VisitExternalReference(this);
828-
#ifdef ENABLE_DEBUGGER_SUPPORT
829828
} else if (((RelocInfo::IsJSReturn(mode) &&
830829
IsPatchedReturnSequence()) ||
831830
(RelocInfo::IsDebugBreakSlot(mode) &&
832831
IsPatchedDebugBreakSlotSequence())) &&
833832
isolate->debug()->has_break_points()) {
834833
visitor->VisitDebugTarget(this);
835-
#endif
836834
} else if (RelocInfo::IsRuntimeEntry(mode)) {
837835
visitor->VisitRuntimeEntry(this);
838836
}
@@ -850,14 +848,12 @@ void RelocInfo::Visit(Heap* heap) {
850848
StaticVisitor::VisitCell(heap, this);
851849
} else if (mode == RelocInfo::EXTERNAL_REFERENCE) {
852850
StaticVisitor::VisitExternalReference(this);
853-
#ifdef ENABLE_DEBUGGER_SUPPORT
854851
} else if (heap->isolate()->debug()->has_break_points() &&
855852
((RelocInfo::IsJSReturn(mode) &&
856853
IsPatchedReturnSequence()) ||
857854
(RelocInfo::IsDebugBreakSlot(mode) &&
858855
IsPatchedDebugBreakSlotSequence()))) {
859856
StaticVisitor::VisitDebugTarget(heap, this);
860-
#endif
861857
} else if (RelocInfo::IsRuntimeEntry(mode)) {
862858
StaticVisitor::VisitRuntimeEntry(this);
863859
}

src/arm64/assembler-arm64.cc

-4
Original file line numberDiff line numberDiff line change
@@ -2673,12 +2673,10 @@ bool Assembler::ShouldEmitVeneer(int max_reachable_pc, int margin) {
26732673

26742674

26752675
void Assembler::RecordVeneerPool(int location_offset, int size) {
2676-
#ifdef ENABLE_DEBUGGER_SUPPORT
26772676
RelocInfo rinfo(buffer_ + location_offset,
26782677
RelocInfo::VENEER_POOL, static_cast<intptr_t>(size),
26792678
NULL);
26802679
reloc_info_writer.Write(&rinfo);
2681-
#endif
26822680
}
26832681

26842682

@@ -2812,9 +2810,7 @@ void Assembler::RecordDebugBreakSlot() {
28122810
void Assembler::RecordConstPool(int size) {
28132811
// We only need this for debugger support, to correctly compute offsets in the
28142812
// code.
2815-
#ifdef ENABLE_DEBUGGER_SUPPORT
28162813
RecordRelocInfo(RelocInfo::CONST_POOL, static_cast<intptr_t>(size));
2817-
#endif
28182814
}
28192815

28202816

src/arm64/builtins-arm64.cc

-2
Original file line numberDiff line numberDiff line change
@@ -370,13 +370,11 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
370370
Label rt_call, allocated;
371371
if (FLAG_inline_new) {
372372
Label undo_allocation;
373-
#if ENABLE_DEBUGGER_SUPPORT
374373
ExternalReference debug_step_in_fp =
375374
ExternalReference::debug_step_in_fp_address(isolate);
376375
__ Mov(x2, Operand(debug_step_in_fp));
377376
__ Ldr(x2, MemOperand(x2));
378377
__ Cbnz(x2, &rt_call);
379-
#endif
380378
// Load the initial map and verify that it is in fact a map.
381379
Register init_map = x2;
382380
__ Ldr(init_map,

src/arm64/debug-arm64.cc

-4
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ namespace internal {
3838

3939
#define __ ACCESS_MASM(masm)
4040

41-
42-
#ifdef ENABLE_DEBUGGER_SUPPORT
4341
bool BreakLocationIterator::IsDebugBreakAtReturn() {
4442
return Debug::IsDebugBreakAtReturn(rinfo());
4543
}
@@ -386,8 +384,6 @@ void Debug::GenerateFrameDropperLiveEdit(MacroAssembler* masm) {
386384

387385
const bool Debug::kFrameDropperSupported = false;
388386

389-
#endif // ENABLE_DEBUGGER_SUPPORT
390-
391387
} } // namespace v8::internal
392388

393389
#endif // V8_TARGET_ARCH_ARM64

src/arm64/macro-assembler-arm64.cc

-2
Original file line numberDiff line numberDiff line change
@@ -3186,15 +3186,13 @@ void MacroAssembler::LoadContext(Register dst, int context_chain_length) {
31863186
}
31873187

31883188

3189-
#ifdef ENABLE_DEBUGGER_SUPPORT
31903189
void MacroAssembler::DebugBreak() {
31913190
Mov(x0, 0);
31923191
Mov(x1, ExternalReference(Runtime::kDebugBreak, isolate()));
31933192
CEntryStub ces(isolate(), 1);
31943193
ASSERT(AllowThisStubCall(&ces));
31953194
Call(ces.GetCode(), RelocInfo::DEBUG_BREAK);
31963195
}
3197-
#endif
31983196

31993197

32003198
void MacroAssembler::PushTryHandler(StackHandler::Kind kind,

src/arm64/macro-assembler-arm64.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -1278,12 +1278,11 @@ class MacroAssembler : public Assembler {
12781278
MacroAssembler* masm_;
12791279
};
12801280

1281-
#ifdef ENABLE_DEBUGGER_SUPPORT
12821281
// ---------------------------------------------------------------------------
12831282
// Debugger Support
12841283

12851284
void DebugBreak();
1286-
#endif
1285+
12871286
// ---------------------------------------------------------------------------
12881287
// Exception handling
12891288

0 commit comments

Comments
 (0)