OLD | NEW |
| (Empty) |
1 // Copyright 2009 The Native Client Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can | |
3 // be found in the LICENSE file. | |
4 using System; | |
5 using System.Diagnostics; | |
6 using Microsoft.VisualStudio; | |
7 using Microsoft.VisualStudio.Debugger.Interop; | |
8 | |
9 namespace Google.MsAd7.BaseImpl { | |
10 public class CodeContext : MemoryContext, IDebugCodeContext2 { | |
11 public CodeContext(string name, | |
12 ulong address, | |
13 ulong count, | |
14 DocumentContext docContext) | |
15 : base(name, address, count) { | |
16 docContext_ = docContext; | |
17 if (docContext_ != null) { | |
18 docContext_.AddCodeContext(this); | |
19 } | |
20 } | |
21 | |
22 public static readonly CodeContext NullContext = | |
23 new CodeContext("<No symbols available>", 0, 0, null); | |
24 | |
25 #region Implementation of IDebugCodeContext2 | |
26 | |
27 public int GetDocumentContext(out IDebugDocumentContext2 ppSrcCxt) { | |
28 Debug.WriteLine("CodeContext.GetDocumentContext"); | |
29 | |
30 ppSrcCxt = docContext_; | |
31 return VSConstants.S_OK; | |
32 } | |
33 | |
34 public int GetLanguageInfo(ref string pbstrLanguage, ref Guid pguidLanguage)
{ | |
35 Debug.WriteLine("CodeContext.GetLanguageInfo"); | |
36 | |
37 return docContext_.GetLanguageInfo(ref pbstrLanguage, ref pguidLanguage); | |
38 } | |
39 | |
40 #endregion | |
41 | |
42 #region Private Implementation | |
43 | |
44 private readonly DocumentContext docContext_; | |
45 | |
46 #endregion | |
47 } | |
48 } | |
OLD | NEW |