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 Google.MsAd7.BaseImpl.Interfaces; | |
7 using Google.MsAd7.BaseImpl.Interfaces.SimpleSymbolTypes; | |
8 using Microsoft.VisualStudio.Debugger.Interop; | |
9 | |
10 namespace Google.MsAd7.BaseImpl.DebugProperties { | |
11 class Variable : DebugPropertyBase { | |
12 public Variable(DebugPropertyBase parent, | |
13 Symbol sym, | |
14 enum_DBG_ATTRIB_FLAGS attributes, | |
15 ISimpleDebugger dbg) | |
16 : base(parent, sym.Name, sym.TypeOf.Name, null, sym.Offset, attributes,
dbg) { | |
17 symbol_ = sym; | |
18 } | |
19 | |
20 protected override void RefreshValue(ref object value) | |
21 { | |
22 var result = new byte[symbol_.TypeOf.SizeOf]; | |
23 Debug.WriteLine("RefreshValue, variable=" + symbol_.Name + | |
24 " Address: " + String.Format("{0,4:X}", Address)); | |
25 Dbg.GetMemory(Address, result, (uint) result.Length); | |
26 value = result; | |
27 } | |
28 | |
29 public override string FormatValue() | |
30 { | |
31 return Dbg.Symbols.SymbolValueToString( | |
32 symbol_.Key, new ArraySegment<byte>((byte[]) Value)); | |
33 } | |
34 | |
35 private Symbol symbol_; | |
36 } | |
37 } | |
OLD | NEW |