Beispiel #1
0
        ///////////////////////////////////////////////////////////////////////

        #region Internal Methods
        internal string ToTraceString()
        {
            IStringList list = new StringPairList();

            list.Add("debug", debug.ToString());
            list.Add("args", FormatOps.WrapArgumentsOrNull(true, true, args));
            list.Add("code", code.ToString());
            list.Add("breakpointType", breakpointType.ToString());
            list.Add("breakpointName", FormatOps.WrapOrNull(breakpointName));
            list.Add("token", (token != null).ToString());
            list.Add("traceInfo", (traceInfo != null).ToString());
            list.Add("engineFlags", FormatOps.WrapOrNull(engineFlags));
            list.Add("substitutionFlags", FormatOps.WrapOrNull(substitutionFlags));
            list.Add("eventFlags", FormatOps.WrapOrNull(eventFlags));
            list.Add("expressionFlags", FormatOps.WrapOrNull(expressionFlags));
            list.Add("headerFlags", FormatOps.WrapOrNull(headerFlags));
            list.Add("clientData", FormatOps.WrapOrNull(clientData));
            list.Add("arguments", FormatOps.WrapOrNull(true, true, arguments));
            list.Add("exit", exit.ToString());

            return(list.ToString());
        }
Beispiel #2
0
 /// <summary>
 /// Sets a hardware breakpoint that suspends title execution when a particular section of memory is referenced.
 /// </summary>
 /// <param name="address">Address of the memory to watch.</param>
 /// <param name="size">The size, in bytes, of the memory to be watched.
 /// The only allowable values for this parameter are 1, 2, and 4.</param>
 /// <param name="type">Type of access to watch for.</param>
 public void SetBreakPoint(uint address, uint size, BreakpointType type)
 {
     SendCommand("break addr={0} size={1} {2}", address, type.ToString().Replace(",", ""));
 }
Beispiel #3
0
        /// <summary>
        /// Sets a hardware breakpoint that suspends title execution when a particular section of memory is referenced.
        /// </summary>
        /// <param name="address">Address of the memory to watch.</param>
        /// <param name="size">The size, in bytes, of the memory to be watched.
        /// The only allowable values for this parameter are 1, 2, and 4.</param>
        /// <param name="type">Type of access to watch for.</param>
		/// <remarks>DmSetDataBreakpoint</remarks>
        public void SetDataBreakPoint(uint address, uint size, BreakpointType type)
        {
			if (size != sizeof(byte) || size != sizeof(short) || size != sizeof(int))
				throw new ArgumentOutOfRangeException("size", size.ToString());

			bool clear = type == BreakpointType.None;

			// xboxdbg.dll only uses one breakpoint type, so multiple types shouldn't be bitted together...
			string type_str = type.ToString().Replace(",", "");

			SendCommand("break {0}=0x{1} size={2} {3}", type_str, address.ToString("X8"), size,
				clear ? "clear" : "");
        }
Beispiel #4
0
        ///////////////////////////////////////////////////////////////////////

        public StringPairList ToStringPairList()
        {
            StringPairList result = new StringPairList();

            if (variable != null)
            {
                result.Add(variable.Kind.ToString());
                result.Add((IPair <string>)null);

                if (variable.Name != null)
                {
                    result.Add("name", variable.Name);
                }
                else
                {
                    result.Add("name", String.Empty);
                }

                if (EntityOps.IsArray2(variable))
                {
                    ElementDictionary arrayValue = variable.ArrayValue;

                    if (arrayValue != null)
                    {
                        result.Add("<array>");

                        if (index != null)
                        {
                            object value;

                            if (arrayValue.TryGetValue(index, out value))
                            {
                                if (value != null)
                                {
                                    result.Add("value",
                                               StringOps.GetStringFromObject(
                                                   value, null, !(value is TraceInfo)));
                                }
                                else
                                {
                                    result.Add("value", FormatOps.DisplayNull);
                                }
                            }
                            else
                            {
                                result.Add("value", "<noValue>");
                            }
                        }
                        else
                        {
                            result.Add("value", "<noIndex>");
                        }
                    }
                    else
                    {
                        result.Add("<noArray>");
                    }
                }
                else
                {
                    object value = variable.Value;

                    if (value != null)
                    {
                        result.Add("value",
                                   StringOps.GetStringFromObject(value));
                    }
                    else
                    {
                        result.Add("value", "<noValue>");
                    }
                }

                result.Add("flags", variable.Flags.ToString());
                result.Add((IPair <string>)null);
            }

            result.Add("TraceInfo");
            result.Add((IPair <string>)null);

            if (trace != null)
            {
                result.Add("trace", trace.ToString());
            }
            else
            {
                result.Add("trace", "<noTrace>");
            }

            result.Add("breakpointType", breakpointType.ToString());

            if (frame != null)
            {
                result.Add("frame", (frame.Name != null) ?
                           frame.Name : "<noFrameName>");
            }
            else
            {
                result.Add("frame", "<noFrame>");
            }

            if (name != null)
            {
                result.Add("name", name);
            }
            else
            {
                result.Add("name", "<noName>");
            }

            if (index != null)
            {
                result.Add("index", index);
            }
            else
            {
                result.Add("index", "<noIndex>");
            }

            result.Add("flags", flags.ToString());

            if (oldValue != null)
            {
                result.Add("oldValue",
                           StringOps.GetStringFromObject(oldValue));
            }
            else
            {
                result.Add("oldValue", "<noOldValue>");
            }

            if (newValue != null)
            {
                result.Add("newValue",
                           StringOps.GetStringFromObject(newValue));
            }
            else
            {
                result.Add("newValue", "<noNewValue>");
            }

            if (oldValues != null)
            {
                result.Add("oldValues", oldValues.ToString());
            }
            else
            {
                result.Add("oldValues", "<noOldValues>");
            }

            if (newValues != null)
            {
                result.Add("newValues", newValues.ToString());
            }
            else
            {
                result.Add("newValues", "<noNewValues>");
            }

            if (list != null)
            {
                result.Add("list", list.ToString());
            }
            else
            {
                result.Add("list", "<noList>");
            }

            result.Add("cancel", cancel.ToString());
            result.Add("postProcess", postProcess.ToString());
            result.Add("returnCode", returnCode.ToString());

            return(result);
        }