2002-03-20 Martin Baulig <martin@gnome.org>
[mono.git] / mcs / class / Mono.CSharp.Debugger / IMonoSymbolWriter.cs
1 //
2 // System.Diagnostics.SymbolStore/IMonoSymbolWriter.cs
3 //
4 // Author:
5 //   Martin Baulig (martin@gnome.org)
6 //
7 // This interface is derived from System.Diagnostics.SymbolStore.ISymbolWriter.
8 //
9 // (C) 2002 Ximian, Inc.  http://www.ximian.com
10 //
11
12 using System;
13 using System.Reflection;
14 using System.Reflection.Emit;
15 using System.Diagnostics.SymbolStore;
16 using System.Collections;
17 using System.IO;
18         
19 namespace Mono.CSharp.Debugger
20 {
21         public interface IMonoSymbolWriter : ISymbolWriter
22         {
23                 // The ISymbolWriter interface has an `IntPtr emitter' argument which
24                 // seems to be a pointer an unmanaged interface containing the actual
25                 // symbol writer. I was unable to find any documentation about how
26                 // exactly this is used - but it seems to be in some proprietary,
27                 // undocumented DLL.
28                 //
29                 // Since I want this interface to be usable on the Windows platform as
30                 // well, I added this custom constructor. You should use this version
31                 // of `Initialize' to make sure you're actually using this implementation.
32                 void Initialize (string filename);
33
34                 // This is some kind of a hack - there isn't any way yet to get the
35                 // method name and source file back from a token.
36                 void OpenMethod (SymbolToken token, MethodInfo method_info, string source_file);
37         }
38
39         public interface ISourceFile
40         {
41                 string FileName {
42                         get;
43                 }
44
45                 ISourceMethod[] Methods {
46                         get;
47                 }
48
49                 void AddMethod (ISourceMethod method);
50         }
51
52         public interface ISourceMethod
53         {
54                 ISourceLine[] Lines {
55                         get;
56                 }
57
58                 void AddLine (ISourceLine line);
59
60                 ILocalVariable[] Locals {
61                         get;
62                 }
63
64                 void AddLocal (ILocalVariable local);
65
66                 int FirstLine {
67                         get;
68                 }
69
70                 int LastLine {
71                         get;
72                 }
73
74                 int CodeSize {
75                         get;
76                 }
77
78                 int Token {
79                         get;
80                 }
81
82                 MethodInfo MethodInfo {
83                         get;
84                 }
85
86                 ISourceFile SourceFile {
87                         get;
88                 }
89         }
90
91         public interface ISourceLine
92         {
93                 int Offset {
94                         get;
95                 }
96
97                 int Line {
98                         get;
99                 }
100         }
101
102         public interface ILocalVariable
103         {
104                 string Name {
105                         get;
106                 }
107
108                 int Index {
109                         get;
110                 }
111         }
112 }