Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(392)

Side by Side Diff: experimental/visual_studio_plugin/src/MsAd7.BaseImpl/MemoryContext.cs

Issue 10928195: First round of dead file removal (Closed) Base URL: https://github.com/samclegg/nativeclient-sdk.git@master
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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.Diagnostics;
5 using Microsoft.VisualStudio;
6 using Microsoft.VisualStudio.Debugger.Interop;
7
8 namespace Google.MsAd7.BaseImpl {
9 public class MemoryContext : IDebugMemoryContext2 {
10 public MemoryContext(string name, ulong address, ulong count) {
11 name_ = name;
12 address_ = address;
13 count_ = count;
14 }
15
16 public MemoryContext(string name, ulong address)
17 : this(name, address, 0) {}
18
19 public ulong Address {
20 get { return address_; }
21 }
22
23 public ulong Count {
24 get { return count_; }
25 }
26
27 public string Name {
28 get { return name_; }
29 }
30
31 #region Implementation of IDebugMemoryContext2
32
33 public int GetName(out string pbstrName) {
34 Debug.WriteLine("MemoryContext.GetName");
35 pbstrName = name_;
36 return VSConstants.S_OK;
37 }
38
39 public int GetInfo(enum_CONTEXT_INFO_FIELDS dwFields, CONTEXT_INFO[] pinfo) {
40 Debug.WriteLine("MemoryContext.GetInfo");
41
42 pinfo[0].bstrAddress = Address.ToString("X");
43 pinfo[0].bstrAddressAbsolute = pinfo[0].bstrAddress;
44 pinfo[0].bstrAddressOffset = pinfo[0].bstrAddress;
45 pinfo[0].bstrFunction = "";
46 pinfo[0].bstrModuleUrl = "";
47 pinfo[0].dwFields = enum_CONTEXT_INFO_FIELDS.CIF_ALLFIELDS;
48
49 return VSConstants.S_OK;
50 }
51
52 public int Add(ulong dwCount, out IDebugMemoryContext2 ppMemCxt) {
53 Debug.WriteLine("MemoryContext.Add");
54 ppMemCxt = new MemoryContext(name_, address_ + dwCount, count_);
55 return VSConstants.S_OK;
56 }
57
58 public int Subtract(ulong dwCount, out IDebugMemoryContext2 ppMemCxt) {
59 Debug.WriteLine("MemoryContext.Subtract");
60 ppMemCxt = new MemoryContext(name_, address_ - dwCount, count_);
61 return VSConstants.S_OK;
62 }
63
64 public int Compare(enum_CONTEXT_COMPARE Compare,
65 IDebugMemoryContext2[] rgpMemoryContextSet,
66 uint dwMemoryContextSetLen,
67 out uint pdwMemoryContext) {
68 Debug.WriteLine("MemoryContext.Compare");
69
70 // TODO(ilewis):
71 // must implement at least CONTEXT_EQUAL, CONTEXT_LESS_THAN,
72 // CONTEXT_GREATER_THAN and CONTEXT_SAME_SCOPE. (MSDN)
73 pdwMemoryContext = uint.MaxValue;
74 return VSConstants.S_OK;
75 }
76
77 #endregion
78
79 #region Private Implementation
80
81 private readonly ulong address_;
82 private readonly ulong count_;
83 private readonly string name_;
84
85 #endregion
86 }
87 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698