nsIDebug 编辑

xpcom/base/nsIDebug.idlScriptable Provides debugging support for scripted languages, such as JavaScript, Java, Python, Perl, and so forth. Inherits from: nsISupports Last changed in Gecko 1.7

Note: C/C++ consumers who are planning to use the nsIDebug interface with the @mozilla.org/xpcom;1 contract should use NS_DebugBreak() from XPCOM glue instead, or alternatively the NS_ABORT, NS_ASSERTION, NS_BREAK, and NS_WARNING macros, which also call NS_DebugBreak() if used in a debugging build.

Method overview

void abort(in string aFile, in long aLine);
void assertion(in string aStr, in string aExpr, in string aFile, in long aLine);
void break(in string aFile, in long aLine);
void warning(in string aStr, in string aFile, in long aLine);

Methods

abort()

Requests the process to trigger a fatal abort.

void abort(
  in string aFile,
  in long aLine
);
Parameters
aFile
File containing abort request.
aLine
Line number of abort request.

assertion()

Shows an assertion and triggers optional behavior based on the XPCOM_DEBUG_BREAK environment variable, defaulting to calling break() on Windows and OS/2 and warning on other platforms.

void assertion(
  in string aStr,
  in string aExpr,
  in string aFile,
  in long aLine
);
Parameters
aStr
assertion message.
aExpr
Expression that failed.
aFile
File containing assertion.
aLine
Line number of assertion.

break()

Requests the software break into a debugger. If no debugger is running then this usually results in a program crash. However, on Windows a dialog is first presented giving the user the option of aborting, breaking, or ignoring the request. The dialog can be suppressed by use of the windbgdlg registry key. This allows the debugger to be attached before the software break.

void break(
  in string aFile,
  in long aLine
);
Parameters
aFile
File containing break request.
aLine
Line number of break request.

warning()

Shows a warning.

void warning(
  in string aStr,
  in string aFile,
  in long aLine
);
Parameters
aStr
warning message.
aFile
File containing warning.
aLine
Line number of warning.

See also

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:67 次

字数:4720

最后编辑:7年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文