Visit Mozilla.org

XPCOM DEBUG BREAK

From MDC


[edit] Summary

Environment variable

Control the behavior of failed assertions (NS_ASSERTION and friends).

If you've given the --enable-crash-on-assert switch to configure, this environment variable is ignored.

Values:

  • warn - This is equivalent to the default of simply spitting an error message to stderr and ringing the bell. (I think this is the default on Mac and Linux.)
  • stack - In addition to ringing the bell and printing a warning, a stack trace is written to stderr.
  • suspend - The process-group is sent a SIGSTOP signal. This suspends all threads so that you can attach to the process with the debugger before the conditions that caused the assertion disappear.
  • abort - This makes NS_ASSERTION act like assert(3)—an assertion failure calls abort—and is equivalent to building with --enable-crash-on-assert.
  • trap or break - Break into the debugger. The precise behavior here is platform-dependent, but it just does "the usual thing" for each platform. If the process is not being debugged, it will probably crash. (?) break is just a synonym for trap.
  • stack-and-abort - The combination platter. Prints a warning, rings the bell, dumps the stack, and aborts. (new in Mozilla 1.9 since August 2007)

[edit] Syntax

Assuming you're using bash:

export XPCOM_DEBUG_BREAK=stack

[edit] See also