nsIDebug2.idl 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  4. /* interface to expose information about calls to NS_DebugBreak */
  5. #include "nsISupports.idl"
  6. /**
  7. * For use by consumers in scripted languages (JavaScript, Java, Python,
  8. * Perl, ...).
  9. *
  10. * @note C/C++ consumers who are planning to use the nsIDebug2 interface with
  11. * the "@mozilla.org/xpcom;1" contract should use NS_DebugBreak from xpcom
  12. * glue instead.
  13. *
  14. */
  15. [scriptable, uuid(9641dc15-10fb-42e3-a285-18be90a5c10b)]
  16. interface nsIDebug2 : nsISupports
  17. {
  18. /**
  19. * Whether XPCOM was compiled with DEBUG defined. This often
  20. * correlates to whether other code (e.g., Firefox, XULRunner) was
  21. * compiled with DEBUG defined.
  22. */
  23. readonly attribute boolean isDebugBuild;
  24. /**
  25. * The number of assertions since process start.
  26. */
  27. readonly attribute long assertionCount;
  28. /**
  29. * Whether a debugger is currently attached.
  30. * Supports Windows + Mac
  31. */
  32. readonly attribute bool isDebuggerAttached;
  33. /**
  34. * Show an assertion and trigger nsIDebug2.break().
  35. *
  36. * @param aStr assertion message
  37. * @param aExpr expression that failed
  38. * @param aFile file containing assertion
  39. * @param aLine line number of assertion
  40. */
  41. void assertion(in string aStr,
  42. in string aExpr,
  43. in string aFile,
  44. in long aLine);
  45. /**
  46. * Show a warning.
  47. *
  48. * @param aStr warning message
  49. * @param aFile file containing assertion
  50. * @param aLine line number of assertion
  51. */
  52. void warning(in string aStr,
  53. in string aFile,
  54. in long aLine);
  55. /**
  56. * Request to break into a debugger.
  57. *
  58. * @param aFile file containing break request
  59. * @param aLine line number of break request
  60. */
  61. void break(in string aFile,
  62. in long aLine);
  63. /**
  64. * Request the process to trigger a fatal abort.
  65. *
  66. * @param aFile file containing abort request
  67. * @param aLine line number of abort request
  68. */
  69. void abort(in string aFile,
  70. in long aLine);
  71. };