2009-01-09 00:50:21 +03:00
|
|
|
/* vim: set shiftwidth=4 tabstop=8 autoindent cindent expandtab: */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2009-01-09 00:50:21 +03:00
|
|
|
|
|
|
|
/* interface to expose information about calls to NS_DebugBreak */
|
|
|
|
|
2015-05-07 08:28:37 +03:00
|
|
|
#include "nsISupports.idl"
|
2009-01-09 00:50:21 +03:00
|
|
|
|
2015-05-07 08:28:37 +03:00
|
|
|
/**
|
|
|
|
* For use by consumers in scripted languages (JavaScript, Java, Python,
|
|
|
|
* Perl, ...).
|
|
|
|
*
|
|
|
|
* @note C/C++ consumers who are planning to use the nsIDebug2 interface with
|
|
|
|
* the "@mozilla.org/xpcom;1" contract should use NS_DebugBreak from xpcom
|
|
|
|
* glue instead.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
[scriptable, uuid(9641dc15-10fb-42e3-a285-18be90a5c10b)]
|
|
|
|
interface nsIDebug2 : nsISupports
|
2009-01-09 00:50:21 +03:00
|
|
|
{
|
2009-01-13 22:50:40 +03:00
|
|
|
/**
|
|
|
|
* Whether XPCOM was compiled with DEBUG defined. This often
|
|
|
|
* correlates to whether other code (e.g., Firefox, XULRunner) was
|
|
|
|
* compiled with DEBUG defined.
|
|
|
|
*/
|
|
|
|
readonly attribute boolean isDebugBuild;
|
|
|
|
|
2009-01-09 00:50:21 +03:00
|
|
|
/**
|
|
|
|
* The number of assertions since process start.
|
|
|
|
*/
|
|
|
|
readonly attribute long assertionCount;
|
2012-06-28 22:57:52 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether a debugger is currently attached.
|
|
|
|
* Supports Windows + Mac
|
|
|
|
*/
|
|
|
|
readonly attribute bool isDebuggerAttached;
|
2015-05-07 08:28:37 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Show an assertion and trigger nsIDebug2.break().
|
|
|
|
*
|
|
|
|
* @param aStr assertion message
|
|
|
|
* @param aExpr expression that failed
|
|
|
|
* @param aFile file containing assertion
|
|
|
|
* @param aLine line number of assertion
|
|
|
|
*/
|
|
|
|
void assertion(in string aStr,
|
|
|
|
in string aExpr,
|
|
|
|
in string aFile,
|
|
|
|
in long aLine);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Show a warning.
|
|
|
|
*
|
|
|
|
* @param aStr warning message
|
|
|
|
* @param aFile file containing assertion
|
|
|
|
* @param aLine line number of assertion
|
|
|
|
*/
|
|
|
|
void warning(in string aStr,
|
|
|
|
in string aFile,
|
|
|
|
in long aLine);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request to break into a debugger.
|
|
|
|
*
|
|
|
|
* @param aFile file containing break request
|
|
|
|
* @param aLine line number of break request
|
|
|
|
*/
|
|
|
|
void break(in string aFile,
|
|
|
|
in long aLine);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request the process to trigger a fatal abort.
|
|
|
|
*
|
|
|
|
* @param aFile file containing abort request
|
|
|
|
* @param aLine line number of abort request
|
|
|
|
*/
|
|
|
|
void abort(in string aFile,
|
|
|
|
in long aLine);
|
2017-03-31 19:08:57 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Request the process to trigger a fatal panic!() from Rust code.
|
|
|
|
*
|
|
|
|
* @param aMessage the string to pass to panic!().
|
|
|
|
*/
|
|
|
|
void rustPanic(in string aMessage);
|
2009-01-09 00:50:21 +03:00
|
|
|
};
|