File: NativePointerType.cs

package info (click to toggle)
mono-debugger 0.60%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 9,556 kB
  • ctags: 22,787
  • sloc: ansic: 99,407; cs: 42,429; sh: 9,192; makefile: 376
file content (65 lines) | stat: -rw-r--r-- 1,437 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
using System;

namespace Mono.Debugger.Languages.Native
{
	internal class NativePointerType : TargetPointerType
	{
		public NativePointerType (Language language, string name, int size)
			: base (language, name, size)
		{ }

		public NativePointerType (Language language, string name,
					  TargetType target_type, int size)
			: this (language, name, size)
		{
			this.target_type = target_type;
		}

		TargetType target_type;

		public override bool HasClassType {
			get { return false; }
		}

		public override TargetClassType ClassType {
			get { throw new InvalidOperationException (); }
		}

		public override bool IsTypesafe {
			get { return false; }
		}

		public override bool HasStaticType {
			get { return target_type != null; }
		}

		public override bool IsArray {
			get { return true; }
		}

		public override TargetType StaticType {
			get {
				if (target_type == null)
					throw new InvalidOperationException ();

				return target_type;
			}
		}

		protected override TargetObject DoGetObject (TargetMemoryAccess target, TargetLocation location)
		{
			return new NativePointerObject (this, location);
		}

		public override TargetPointerObject GetObject (TargetAddress address)
		{
			return new NativePointerObject (this, new AbsoluteTargetLocation (address));
		}

		public override string ToString ()
		{
			return String.Format ("{0} [{1}:{2}:{3}]", GetType (),
					      Name, Size, target_type);
		}
	}
}