Debugger.cs 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. //
  2. // System.Diagnostics.Debugger.cs
  3. //
  4. // Author:
  5. // John R. Hicks ([email protected])
  6. //
  7. // (C) 2001
  8. //
  9. //
  10. // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
  11. //
  12. // Permission is hereby granted, free of charge, to any person obtaining
  13. // a copy of this software and associated documentation files (the
  14. // "Software"), to deal in the Software without restriction, including
  15. // without limitation the rights to use, copy, modify, merge, publish,
  16. // distribute, sublicense, and/or sell copies of the Software, and to
  17. // permit persons to whom the Software is furnished to do so, subject to
  18. // the following conditions:
  19. //
  20. // The above copyright notice and this permission notice shall be
  21. // included in all copies or substantial portions of the Software.
  22. //
  23. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  24. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  25. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  26. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  27. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  28. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  29. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  30. //
  31. using System;
  32. namespace System.Diagnostics
  33. {
  34. /// <summary>
  35. /// Enables communication with a debugger.
  36. /// </summary>
  37. [MonoTODO]
  38. public sealed class Debugger
  39. {
  40. private static bool isAttached;
  41. /// <summary>
  42. /// Represents the default category of a message with a constant.
  43. /// </summary>
  44. public static readonly string DefaultCategory = "";
  45. /// <summary>
  46. /// Returns a Boolean indicating whether a debugger is attached to a process.
  47. /// </summary>
  48. /// <value>
  49. /// true if debugger is attached; otherwise, false.
  50. /// </value>
  51. public static bool IsAttached
  52. {
  53. get
  54. {
  55. return isAttached;
  56. }
  57. }
  58. /// <summary>
  59. /// Causes a breakpoint to be signaled to an attached debugger.
  60. /// </summary>
  61. [MonoTODO]
  62. public static void Break()
  63. {
  64. throw new NotImplementedException();
  65. }
  66. /// <summary>
  67. /// Checks to see if logging is enabled by an attached debugger.
  68. /// </summary>
  69. [MonoTODO]
  70. public static bool IsLogging()
  71. {
  72. // Return false. DefaultTraceListener invokes this method, so throwing
  73. // a NotImplementedException wouldn't be appropriate.
  74. return false;
  75. }
  76. /// <summary>
  77. /// Launches and attaches a debugger to the process.
  78. /// </summary>
  79. [MonoTODO]
  80. public static bool Launch()
  81. {
  82. throw new NotImplementedException();
  83. }
  84. /// <summary>
  85. /// Posts a message for the attached debugger.
  86. /// </summary>
  87. /// <param name="level">
  88. /// A description of the importance of this message
  89. /// </param>
  90. /// <param name="category">
  91. /// A string describing the category of this message.
  92. /// </param>
  93. /// <param name="message">
  94. /// A string representing the message to show.
  95. /// </param>
  96. [MonoTODO]
  97. public static void Log(int level, string category, string message)
  98. {
  99. // Do nothing. DefaultTraceListener invokes this method, so throwing
  100. // a NotImplementedException wouldn't be appropriate.
  101. }
  102. public Debugger()
  103. {
  104. isAttached = false;
  105. }
  106. }
  107. }