本文整理汇总了C#中Mono.Debugging.Client.ObjectPath类的典型用法代码示例。如果您正苦于以下问题:C# ObjectPath类的具体用法?C# ObjectPath怎么用?C# ObjectPath使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ObjectPath类属于Mono.Debugging.Client命名空间,在下文中一共展示了ObjectPath类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetChildren
public ObjectValue[] GetChildren (ObjectPath path, int index, int count, EvaluationOptions options)
{
EvaluationContext cctx = ctx.WithOptions (options);
var names = new ObjectValueNameTracker (cctx);
object tdataType = null;
TypeDisplayData tdata = null;
List<ObjectValue> list = new List<ObjectValue> ();
foreach (ValueReference val in cctx.Adapter.GetMembersSorted (cctx, objectSource, type, obj, bindingFlags)) {
object decType = val.DeclaringType;
if (decType != null && decType != tdataType) {
tdataType = decType;
tdata = cctx.Adapter.GetTypeDisplayData (cctx, decType);
}
DebuggerBrowsableState state = tdata.GetMemberBrowsableState (val.Name);
if (state == DebuggerBrowsableState.Never)
continue;
ObjectValue oval = val.CreateObjectValue (options);
names.FixName (val, oval);
list.Add (oval);
}
if ((bindingFlags & BindingFlags.NonPublic) == 0) {
BindingFlags newFlags = bindingFlags | BindingFlags.NonPublic;
newFlags &= ~BindingFlags.Public;
list.Add (CreateNonPublicsNode (cctx, objectSource, type, obj, newFlags));
}
return list.ToArray ();
}
示例2: Create
static ObjectValue Create (IObjectValueSource source, ObjectPath path, string typeName)
{
var val = new ObjectValue ();
val.typeName = typeName;
val.source = source;
val.path = path;
return val;
}
示例3: Create
static ObjectValue Create (IObjectValueSource source, ObjectPath path, string typeName)
{
ObjectValue ob = new ObjectValue ();
ob.source = source;
ob.path = path;
ob.typeName = typeName;
return ob;
}
示例4: CreateElementValue
public ObjectValue CreateElementValue (ArrayElementGroup grp, ObjectPath path, int[] indices)
{
if (array != null) {
CorValRef elem = (CorValRef) GetElement (indices);
return ctx.Adapter.CreateObjectValue (ctx, grp, path, elem, ObjectValueFlags.ArrayElement);
}
else
return ObjectValue.CreateUnknown ("?");
}
示例5: CreateObjectValue
public ObjectValue CreateObjectValue (EvaluationContext ctx, IObjectValueSource source, ObjectPath path, object obj, ObjectValueFlags flags)
{
try {
return CreateObjectValueImpl (ctx, source, path, obj, flags);
} catch (Exception ex) {
ctx.WriteDebuggerError (ex);
return ObjectValue.CreateFatalError (path.LastName, ex.Message, flags);
}
}
示例6: CreateObject
public static ObjectValue CreateObject (IObjectValueSource source, ObjectPath path, string typeName, EvaluationResult value, ObjectValueFlags flags, ObjectValue[] children)
{
ObjectValue ob = Create (source, path, typeName);
ob.path = path;
ob.flags = flags | ObjectValueFlags.Object;
ob.value = value.Value;
ob.displayValue = value.DisplayValue;
if (children != null) {
ob.children = new List<ObjectValue> ();
ob.children.AddRange (children);
}
return ob;
}
示例7: GetChildren
public ObjectValue[] GetChildren(ObjectPath path, int index, int count, EvaluationOptions options)
{
List<ObjectValue> children = new List<ObjectValue>();
session.SelectThread(threadId);
if (Engine.Symbols.ScopeLocalSymbols == null)
return children.ToArray();
DEW.DebugScopedSymbol parent = null;
for (uint i = 0; i < Engine.Symbols.ScopeLocalSymbols.Symbols.Length; i++)
{
DEW.DebugScopedSymbol symbol = Engine.Symbols.ScopeLocalSymbols.Symbols[i];
if (symbol.Name == path.LastName)
{
parent = symbol;
break;
}
}
if (parent == null || parent.ChildrenCount == 0)
return children.ToArray();
for (uint i = 0; i < parent.ChildrenCount; i++)
{
DEW.DebugScopedSymbol child = parent.Children[i];
string name = child.Name;
string typename = child.TypeName;
string val = child.TextValue;
ulong offset = child.Offset;
ObjectValue ov = symbolResolver.Resolve(offset, name, typename, val, child.Parent);
if (ov == null)
{
ObjectValueFlags flags = ObjectValueFlags.Variable;
ov = ObjectValue.CreatePrimitive(this, new ObjectPath(name), typename, new EvaluationResult(val), flags);
}
if (ov != null)
children.Add(ov);
}
return children.ToArray();
}
示例8: GetChildren
public ObjectValue[] GetChildren (ObjectPath path, int index, int count, EvaluationOptions options)
{
var node = cacheRoot [path];
if(node == null)
return Backtrace.GetChildren(path, index, count, options);
ObjectValue[] children;
var t = node.NodeType;
if (t is ArrayType)
children = GetArrayChildren (node, path, index, count, options);
else if (t is ClassType || t is StructType)
children = GetClassInstanceChildren (node, path, options);
else
children = new ObjectValue[0];
return children;
}
示例9: GetChildren
public ObjectValue[] GetChildren(ObjectPath path, int index, int count, EvaluationOptions options)
{
List<ObjectValue> children = new List<ObjectValue> ();
session.SelectThread (threadId);
return children.ToArray();
/*
DDebugCommandResult res = session.RunCommand("-var-list-children", "2", path.Join("."));
ResultData cdata = res.GetObject ("children");
// The response may not contain the "children" list at all.
if (cdata == null)
return children.ToArray ();
if (index == -1) {
index = 0;
count = cdata.Count;
}
for (int n=index; n<cdata.Count && n<index+count; n++) {
ResultData data = cdata.GetObject (n);
ResultData child = data.GetObject ("child");
string name = child.GetValue ("exp");
if (name.Length > 0 && char.IsNumber (name [0]))
name = "[" + name + "]";
// C++ structures may contain typeless children named
// "public", "private" and "protected".
if (child.GetValue("type") == null) {
ObjectPath childPath = new ObjectPath (child.GetValue ("name").Split ('.'));
ObjectValue[] subchildren = GetChildren (childPath, -1, -1, options);
children.AddRange(subchildren);
} else {
ObjectValue val = CreateObjectValue (name, child);
children.Add (val);
}
}
return children.ToArray ();
*/
}
示例10: HasChildren
public bool HasChildren (ObjectPath path, EvaluationOptions options)
{
EvaluationContext cctx = ctx.WithOptions (options);
TypeDisplayData tdata = null;
object tdataType = null;
foreach (ValueReference val in cctx.Adapter.GetMembersSorted (cctx, objectSource, type, obj, bindingFlags)) {
object decType = val.DeclaringType;
if (decType != null && decType != tdataType) {
tdataType = decType;
tdata = cctx.Adapter.GetTypeDisplayData (cctx, decType);
}
DebuggerBrowsableState state = tdata.GetMemberBrowsableState (val.Name);
if (state == DebuggerBrowsableState.Never)
continue;
return true;
}
return false;
}
示例11: GetChildren
public ObjectValue[] GetChildren(ObjectPath path, int index, int count, EvaluationOptions options)
{
List<ObjectValue> children = new List<ObjectValue>();
session.SelectThread(threadId);
string expression = path.Join(".");
if (expression.Trim().Length == 0)
return children.ToArray();
List<DebugScopedSymbol> childSymbols = this.session.SymbolResolver.GetChildSymbols(expression);
if (childSymbols.Count == 0)
return children.ToArray();
for (int i = 0; i < childSymbols.Count; i++)
{
DebugScopedSymbol child = childSymbols[i];
ObjectValue ov = CreateObjectValue(child);
children.Add(ov);
}
return children.ToArray();
}
示例12: CreateUnknown
public static ObjectValue CreateUnknown (IObjectValueSource source, ObjectPath path, string typeName)
{
ObjectValue ob = Create (source, path, typeName);
ob.flags = ObjectValueFlags.Unknown | ObjectValueFlags.ReadOnly;
return ob;
}
示例13: SetRawValue
public override void SetRawValue (ObjectPath path, object value, EvaluationOptions options)
{
if (value is RawValue || value is RawValueArray || value is Array) {
base.SetRawValue (path, value, options);
return;
}
AppDomainMirror domain = null;
if (null != obj && obj is ObjectMirror)
domain = ((ObjectMirror)obj).Domain;
Value = ((SoftDebuggerAdaptor)Context.Adapter).CreateValue (Context, value, domain);
}
示例14: CreateNullObject
public static ObjectValue CreateNullObject (IObjectValueSource source, ObjectPath path, string typeName, ObjectValueFlags flags)
{
ObjectValue ob = Create (source, path, typeName);
ob.flags = flags | ObjectValueFlags.Object;
ob.value = "(null)";
ob.isNull = true;
return ob;
}
示例15: SetValue
public EvaluationResult SetValue (ObjectPath path, string value, EvaluationOptions options)
{
return MtaThread.Run (() => source.SetValue (path, value, options));
}