Revision: 16319
Author:   [email protected]
Date:     Mon Aug 26 11:22:39 2013 UTC
Log:      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=
[email protected]

Review URL: https://codereview.chromium.org/23352004
http://code.google.com/p/v8/source/detail?r=16319

Modified:
 /branches/bleeding_edge/src/arm/macro-assembler-arm.cc
 /branches/bleeding_edge/src/flag-definitions.h
 /branches/bleeding_edge/src/ia32/macro-assembler-ia32.cc
 /branches/bleeding_edge/src/x64/macro-assembler-x64.cc

=======================================
--- /branches/bleeding_edge/src/arm/macro-assembler-arm.cc Mon Aug 19 17:46:43 2013 UTC +++ /branches/bleeding_edge/src/arm/macro-assembler-arm.cc Mon Aug 26 11:22:39 2013 UTC
@@ -2847,6 +2847,11 @@
     RecordComment("Abort message: ");
     RecordComment(msg);
   }
+
+  if (FLAG_trap_on_abort) {
+    stop(msg);
+    return;
+  }
 #endif

   mov(r0, Operand(p0));
=======================================
--- /branches/bleeding_edge/src/flag-definitions.h Mon Aug 26 07:17:12 2013 UTC +++ /branches/bleeding_edge/src/flag-definitions.h Mon Aug 26 11:22:39 2013 UTC
@@ -703,13 +703,14 @@
 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")
=======================================
--- /branches/bleeding_edge/src/ia32/macro-assembler-ia32.cc Mon Aug 19 17:46:43 2013 UTC +++ /branches/bleeding_edge/src/ia32/macro-assembler-ia32.cc Mon Aug 26 11:22:39 2013 UTC
@@ -2774,6 +2774,11 @@
     RecordComment("Abort message: ");
     RecordComment(msg);
   }
+
+  if (FLAG_trap_on_abort) {
+    int3();
+    return;
+  }
 #endif

   push(eax);
=======================================
--- /branches/bleeding_edge/src/x64/macro-assembler-x64.cc Mon Aug 19 17:46:43 2013 UTC +++ /branches/bleeding_edge/src/x64/macro-assembler-x64.cc Mon Aug 26 11:22:39 2013 UTC
@@ -524,7 +524,13 @@
     RecordComment("Abort message: ");
     RecordComment(msg);
   }
+
+  if (FLAG_trap_on_abort) {
+    int3();
+    return;
+  }
 #endif
+
   push(rax);
   movq(kScratchRegister, p0, RelocInfo::NONE64);
   push(kScratchRegister);

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to