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

Side by Side Diff: experimental/visual_studio_plugin/src/MsAd7.BaseImpl/DebugProperties/RegisterSet.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;
5 using System.Collections.Generic;
6 using Microsoft.VisualStudio.Debugger.Interop;
7
8 namespace Google.MsAd7.BaseImpl.DebugProperties {
9 public class RegisterSet : DebugPropertyBase, ICloneable {
10 public RegisterSet(RegisterSetSchema schema,
11 DebugPropertyBase parent)
12 : base(
13 parent,
14 schema.Name,
15 "<typeless>",
16 null,
17 0,
18 enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_NONE,
19 null) {
20 schema_ = schema;
21
22 foreach (var registerDef in schema.Registers) {
23 var register = new Register(this, registerDef.Name);
24 registersByIndex_.Add(registerDef.Index, register);
25 registersByName_.Add(registerDef.Name, register);
26 }
27 }
28
29 public ulong this[int index] {
30 get { return Convert.ToUInt64(registersByIndex_[index].Value); }
31 set { registersByIndex_[index].Value = value; }
32 }
33
34 public ulong this[string name]{
35 get { return Convert.ToUInt64(registersByName_[name].Value); }
36 set { registersByName_[name].Value = value; }
37 }
38
39 private RegisterSetSchema schema_;
40 private readonly Dictionary<int, Register> registersByIndex_ = new Dictionar y<int, Register>();
41 private readonly Dictionary<string, Register> registersByName_ = new Diction ary<string, Register>();
42
43 #region Implementation of ICloneable
44
45 /// <summary>
46 /// Creates a new object that is a copy of the current instance.
47 /// </summary>
48 /// <returns>
49 /// A new object that is a copy of this instance.
50 /// </returns>
51 /// <filterpriority>2</filterpriority>
52 public object Clone() {
53 RegisterSet other = new RegisterSet(schema_, null);
54 foreach (KeyValuePair<int, Register> pair in registersByIndex_) {
55 other[pair.Key] = Convert.ToUInt64(pair.Value.Value);
56 }
57 return other;
58 }
59
60 #endregion
61 }
62 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698