Commit c8bdc106 authored by olivf@chromium.org's avatar olivf@chromium.org

Add a trap_on_abort flag

By setting this flag assertions behind --debug-code will trigger a
breakpoint instead of a call into Abort. This eases debugging, as the
call site is less cluttered and the backtrace starts where it should.

BUG=
R=mstarzinger@chromium.org

Review URL: https://codereview.chromium.org/23352004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16319 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 10a45702
......@@ -2847,6 +2847,11 @@ void MacroAssembler::Abort(BailoutReason reason) {
RecordComment("Abort message: ");
RecordComment(msg);
}
if (FLAG_trap_on_abort) {
stop(msg);
return;
}
#endif
mov(r0, Operand(p0));
......
......@@ -703,13 +703,14 @@ DEFINE_bool(stress_compaction, false,
DEFINE_bool(enable_slow_asserts, false,
"enable asserts that are slow to execute")
// codegen-ia32.cc / codegen-arm.cc
// codegen-ia32.cc / codegen-arm.cc / macro-assembler-*.cc
DEFINE_bool(print_source, false, "pretty print source code")
DEFINE_bool(print_builtin_source, false,
"pretty print source code for builtins")
DEFINE_bool(print_ast, false, "print source AST")
DEFINE_bool(print_builtin_ast, false, "print source AST for builtins")
DEFINE_string(stop_at, "", "function name where to insert a breakpoint")
DEFINE_bool(trap_on_abort, false, "replace aborts by breakpoints")
// compiler.cc
DEFINE_bool(print_builtin_scopes, false, "print scopes for builtins")
......
......@@ -2774,6 +2774,11 @@ void MacroAssembler::Abort(BailoutReason reason) {
RecordComment("Abort message: ");
RecordComment(msg);
}
if (FLAG_trap_on_abort) {
int3();
return;
}
#endif
push(eax);
......
......@@ -524,7 +524,13 @@ void MacroAssembler::Abort(BailoutReason reason) {
RecordComment("Abort message: ");
RecordComment(msg);
}
if (FLAG_trap_on_abort) {
int3();
return;
}
#endif
push(rax);
movq(kScratchRegister, p0, RelocInfo::NONE64);
push(kScratchRegister);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment