1 /* vim: set shiftwidth=4 tabstop=8 autoindent cindent expandtab: */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 /* interface to expose information about calls to NS_DebugBreak */
8 #include
"nsISupports.idl"
11 * @note C/C++ consumers who are planning to use the nsIDebug2 interface with
12 * the "@mozilla.org/xpcom;1" contract should use NS_DebugBreak from xpcom
17 [builtinclass
, scriptable
, uuid(9641dc15
-10fb
-42e3
-a285
-18be90a5c10b
)]
18 interface nsIDebug2
: nsISupports
21 * Whether XPCOM was compiled with DEBUG defined. This often
22 * correlates to whether other code (e.g., Firefox, XULRunner) was
23 * compiled with DEBUG defined.
25 readonly attribute
boolean isDebugBuild
;
28 * The number of assertions since process start.
30 readonly attribute
long assertionCount
;
33 * Whether a debugger is currently attached.
34 * Supports Windows + Mac
36 readonly attribute
boolean isDebuggerAttached
;
39 * Show an assertion and trigger nsIDebug2.break().
41 * @param aStr assertion message
42 * @param aExpr expression that failed
43 * @param aFile file containing assertion
44 * @param aLine line number of assertion
46 void assertion
(in string aStr
,
54 * @param aStr warning message
55 * @param aFile file containing assertion
56 * @param aLine line number of assertion
58 void warning
(in string aStr
,
63 * Request to break into a debugger.
65 * @param aFile file containing break request
66 * @param aLine line number of break request
68 void break
(in string aFile
,
72 * Request the process to trigger a fatal abort.
74 * @param aFile file containing abort request
75 * @param aLine line number of abort request
77 void abort
(in string aFile
,
81 * Request the process to trigger a fatal panic!() from Rust code.
83 * @param aMessage the string to pass to panic!().
85 void rustPanic
(in string aMessage
);
88 * Request the process to log a message for a target and level from Rust code.
90 * @param aTarget the string representing the log target.
91 * @param aMessage the string representing the log message.
93 void rustLog
(in string aTarget
,
97 * Cause an Out of Memory Crash.