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