private PlaceholderLocalSymbol LookupPlaceholder(string name) { if (name.StartsWith("0x", StringComparison.OrdinalIgnoreCase)) { var valueText = name.Substring(2); ulong address; if (!ulong.TryParse(valueText, NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture, out address)) { // Invalid value should have been caught by Lexer. throw ExceptionUtilities.UnexpectedValue(valueText); } return(new ObjectAddressLocalSymbol(_containingMethod, name, this.Compilation.GetSpecialType(SpecialType.System_Object), address)); } AliasKind kind; string id; int index; if (!PseudoVariableUtilities.TryParseVariableName(name, caseSensitive: true, kind: out kind, id: out id, index: out index)) { return(null); } var typeName = PseudoVariableUtilities.GetTypeName(_inspectionContext, kind, id, index); if (typeName == null) { return(null); } return(CreatePlaceholderLocal(_typeNameDecoder, _containingMethod, new Alias(kind, id, id, typeName))); }
private PlaceholderLocalSymbol LookupPlaceholder(string name) { if (name.StartsWith("0x", StringComparison.OrdinalIgnoreCase)) { var valueText = name.Substring(2); ulong address; if (!ulong.TryParse(valueText, NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture, out address)) { // Invalid value should have been caught by Lexer. throw ExceptionUtilities.UnexpectedValue(valueText); } return(new ObjectAddressLocalSymbol(_containingMethod, name, this.Compilation.GetSpecialType(SpecialType.System_Object), address)); } PseudoVariableKind kind; string id; int index; if (!PseudoVariableUtilities.TryParseVariableName(name, caseSensitive: true, kind: out kind, id: out id, index: out index)) { return(null); } var typeName = PseudoVariableUtilities.GetTypeName(_inspectionContext, kind, id, index); if (typeName == null) { return(null); } Debug.Assert(typeName.Length > 0); var type = _typeNameDecoder.GetTypeSymbolForSerializedType(typeName); Debug.Assert((object)type != null); switch (kind) { case PseudoVariableKind.Exception: return(new ExceptionLocalSymbol(_containingMethod, id, type, ExpressionCompilerConstants.GetExceptionMethodName)); case PseudoVariableKind.StowedException: return(new ExceptionLocalSymbol(_containingMethod, id, type, ExpressionCompilerConstants.GetStowedExceptionMethodName)); case PseudoVariableKind.ReturnValue: return(new ReturnValueLocalSymbol(_containingMethod, id, type, index)); case PseudoVariableKind.ObjectId: return(new ObjectIdLocalSymbol(_containingMethod, type, id, isWritable: false)); case PseudoVariableKind.DeclaredLocal: return(new ObjectIdLocalSymbol(_containingMethod, type, id, isWritable: true)); default: throw ExceptionUtilities.UnexpectedValue(kind); } }