Merge remote-tracking branch 'public/master'
[mono.git] / mcs / class / Mono.Debugger.Soft / Mono.Debugger.Soft / Location.cs
1 using System;
2
3 namespace Mono.Debugger.Soft
4 {
5         public class Location : Mirror
6         {
7                 MethodMirror method;
8                 //long native_addr;
9                 int il_offset;
10                 string source_file;
11                 int line_number;
12                 byte[] hash;
13                 int column_number;
14                 
15                 internal Location (VirtualMachine vm, MethodMirror method, long native_addr, int il_offset, string source_file, int line_number, int column_number, byte[] hash) : base (vm, 0) {
16                         this.method = method;
17                         //this.native_addr = native_addr;
18                         this.il_offset = il_offset;
19                         this.source_file = source_file;
20                         this.line_number = line_number;
21                         this.hash = hash;
22                         this.column_number = column_number;
23                 }
24
25                 public MethodMirror Method {
26                         get {
27                                 return method;
28                         }
29                 }
30
31                 public int ILOffset {
32                         get {
33                                 return il_offset;
34                         }
35                 }
36
37                 public string SourceFile {
38                         get {
39                                 return source_file;
40                         }
41             }
42
43                 public int LineNumber {
44                         get {
45                                 return line_number;
46                         }
47             }
48
49                 // Since protocol version 2.19, 0 in earlier protocol versions
50                 public int ColumnNumber {
51                         get {
52                                 return column_number;
53                         }
54             }
55
56                 // MD5 hash of source file
57                 // Since protocol version 2.14, null in earlier protocol versions
58                 public byte[] SourceFileHash {
59                         get {
60                                 return hash;
61                         }
62                 }
63
64                 public override string ToString () {
65                         return String.Format ("{0}+0x{1:x} at {2}:{3}", Method.FullName, ILOffset, SourceFile, LineNumber);
66                 }
67     }
68 }