TryGetLocation() public méthode

public TryGetLocation ( string methodName, string methodParams, int ilOffset, Location &location ) : bool
methodName string
methodParams string
ilOffset int
location Location
Résultat bool
Exemple #1
0
        static string SymbolicateLine(string line, LocationProvider locProvider)
        {
            var match = regex.Match(line);

            if (!match.Success)
            {
                return(line);
            }

            var methodName   = match.Groups ["MethodName"].Value;
            var methodParams = ParseParametersTypes(match.Groups ["MethodParams"].Value);

            var isOffsetIL    = !string.IsNullOrEmpty(match.Groups ["IL"].Value);
            var offsetVarName = (isOffsetIL)? "IL" : "NativeOffset";
            var offset        = int.Parse(match.Groups [offsetVarName].Value, NumberStyles.HexNumber, CultureInfo.InvariantCulture);

            Location location;

            if (!locProvider.TryGetLocation(methodName, methodParams, offset, isOffsetIL, out location))
            {
                return(line);
            }

            return(line.Replace("<filename unknown>:0", string.Format("{0}:{1}", location.FileName, location.Line)));
        }
Exemple #2
0
		static string SymbolicateLine (string line, LocationProvider locProvider)
		{
			var match = regex.Match (line);
			if (!match.Success)
				return line;

			string typeFullName, methodSignature;
			var methodStr = match.Groups ["Method"].Value.Trim ();
			if (!ExtractSignatures (methodStr, out typeFullName, out methodSignature))
				return line;

			var isOffsetIL = !string.IsNullOrEmpty (match.Groups ["IL"].Value);
			var offsetVarName = (isOffsetIL)? "IL" : "NativeOffset";
			var offset = int.Parse (match.Groups [offsetVarName].Value, NumberStyles.HexNumber, CultureInfo.InvariantCulture);

			uint methodIndex = 0xffffff;
			if (!string.IsNullOrEmpty (match.Groups ["MethodIndex"].Value))
				methodIndex = uint.Parse (match.Groups ["MethodIndex"].Value, CultureInfo.InvariantCulture);

			var loc = locProvider.TryGetLocation (typeFullName, methodSignature, offset, isOffsetIL, methodIndex);
			if (loc == null)
				return line;

			return line.Replace ("<filename unknown>:0", string.Format ("{0}:{1}", loc.Document.Url, loc.StartLine));
		}
Exemple #3
0
		static string SymbolicateLine (string line, LocationProvider locProvider)
		{
			var match = regex.Match (line);
			if (!match.Success)
				return line;

			string typeFullName;
			var methodStr = match.Groups ["Method"].Value.Trim ();
			if (!TryParseMethodType (methodStr, out typeFullName))
				return line;

			var isOffsetIL = !string.IsNullOrEmpty (match.Groups ["IL"].Value);
			var offsetVarName = (isOffsetIL)? "IL" : "NativeOffset";
			var offset = int.Parse (match.Groups [offsetVarName].Value, NumberStyles.HexNumber, CultureInfo.InvariantCulture);

			uint methodIndex = 0xffffff;
			if (!string.IsNullOrEmpty (match.Groups ["MethodIndex"].Value))
				methodIndex = uint.Parse (match.Groups ["MethodIndex"].Value, CultureInfo.InvariantCulture);

			Location location;
			if (!locProvider.TryGetLocation (methodStr, typeFullName, offset, isOffsetIL, methodIndex, out location))
				return line;

			return line.Replace ("<filename unknown>:0", string.Format ("{0}:{1}", location.FileName, location.Line));
		}
Exemple #4
0
		static string SymbolicateLine (string line, LocationProvider locProvider)
		{
			var match = regex.Match (line);
			if (!match.Success)
				return line;

			var methodName = match.Groups ["MethodName"].Value;
			var methodParams = ParseParametersTypes (match.Groups ["MethodParams"].Value);
			var ilOffset = int.Parse (match.Groups ["IL"].Value, NumberStyles.HexNumber, CultureInfo.InvariantCulture);

			Location location;
			if (!locProvider.TryGetLocation (methodName, methodParams, ilOffset, out location))
				return line;

			return line.Replace ("<filename unknown>:0", string.Format ("{0}:{1}", location.FileName, location.Line));
		}
Exemple #5
0
        static string SymbolicateLine(string line, LocationProvider locProvider)
        {
            var match = regex.Match(line);

            if (!match.Success)
            {
                return(line);
            }

            string typeFullName;
            var    methodStr = match.Groups ["Method"].Value.Trim();

            if (!TryParseMethodType(methodStr, out typeFullName))
            {
                return(line);
            }

            var isOffsetIL    = !string.IsNullOrEmpty(match.Groups ["IL"].Value);
            var offsetVarName = (isOffsetIL)? "IL" : "NativeOffset";
            var offset        = int.Parse(match.Groups [offsetVarName].Value, NumberStyles.HexNumber, CultureInfo.InvariantCulture);

            uint methodIndex = 0xffffff;

            if (!string.IsNullOrEmpty(match.Groups ["MethodIndex"].Value))
            {
                methodIndex = uint.Parse(match.Groups ["MethodIndex"].Value, CultureInfo.InvariantCulture);
            }

            Location location;

            if (!locProvider.TryGetLocation(methodStr, typeFullName, offset, isOffsetIL, methodIndex, out location))
            {
                return(line);
            }

            return(line.Replace("<filename unknown>:0", string.Format("{0}:{1}", location.FileName, location.Line)));
        }
Exemple #6
0
        static string SymbolicateLine(string line, LocationProvider locProvider)
        {
            var match = regex.Match(line);

            if (!match.Success)
            {
                return(line);
            }

            string typeFullName, methodSignature;
            var    methodStr = match.Groups ["Method"].Value.Trim();

            if (!ExtractSignatures(methodStr, out typeFullName, out methodSignature))
            {
                return(line);
            }

            var isOffsetIL    = !string.IsNullOrEmpty(match.Groups ["IL"].Value);
            var offsetVarName = (isOffsetIL)? "IL" : "NativeOffset";
            var offset        = int.Parse(match.Groups [offsetVarName].Value, NumberStyles.HexNumber, CultureInfo.InvariantCulture);

            uint methodIndex = 0xffffff;

            if (!string.IsNullOrEmpty(match.Groups ["MethodIndex"].Value))
            {
                methodIndex = uint.Parse(match.Groups ["MethodIndex"].Value, CultureInfo.InvariantCulture);
            }

            var loc = locProvider.TryGetLocation(typeFullName, methodSignature, offset, isOffsetIL, methodIndex);

            if (loc == null)
            {
                return(line);
            }

            return(line.Replace("<filename unknown>:0", string.Format("{0}:{1}", loc.Document.Url, loc.StartLine)));
        }