• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            posts - 319, comments - 22, trackbacks - 0, articles - 11
              C++博客 :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

            Managed Expressions in C++ (VC 2010 調試)

            Posted on 2012-04-24 21:39 RTY 閱讀(606) 評論(0)  編輯 收藏 引用 所屬分類: C/C++Windows
            Expand
            MSDN

            Managed Expressions in C++

            Visual Studio 2010
            This topic has not yet been rated - Rate this topic

             

            This topic applies to:

            Edition

            Visual Basic

            C#

            F#

            C++

            Web Developer

            Express

            Topic does not applyTopic does not applyTopic does not applyTopic appliesTopic does not apply

            Pro, Premium, and Ultimate

            Topic does not applyTopic does not applyTopic does not applyTopic appliesTopic does not apply

            The managed expression evaluator accepts most expressions written in Visual C++. The following topics offer specific information and discuss some of the expression types that are not supported:

            • Identifiers and Types

            • Function Evaluation

            • Operators

            • Overloaded Operators

            • Strings

            • Casts

            • Object Comparison and Assignment

            • typeof and sizeof Operators

            • Boxing

            • Property Evaluation

            The expression evaluator ignores access qualifiers, publicprotectedinternal, and private. You can call a private method from the Watch window, for example.

            The expression evaluator performs all evaluations in an implicit unsafe context, whether the code being executed is safe or unsafe.

            The debugger uses autoexpand rules to display the contents of a data type in meaningful form. If you need to, you can add custom autoexpand elements to display your own custom data types. For more information, see Displaying Elements of a Custom Data Type.

            Debugger expressions can use any identifier visible within the current scope. If the debugger is halted in function magh, for example, you can use any identifier visible withinmagh, including constants, variable names, and function names.

            The debugger can correctly display any variable of a primitiveenum, or intrinsic type. For variables of class type, the debugger correctly displays the value based on the derived-most type. If you have an object leo of type lion, derived from type cat, you can evaluate leo.clawlength and get the correct value for an object of type lion.

            You can assign a new value to any left-hand-side expression that is an l-value of a primitive type. Assignments to class and array types are not supported.

            The debugger supports the evaluation of functions, including overloaded functions. Therefore, you can enter either of the following expressions, and the debugger will call the correct version of the overloaded function:

            kanga () kanga (roo) 

            Evaluating a function in the debugger actually calls and executes the code for that function. If the function has side effects, such as allocating memory or changing the value of a global variable, evaluating the function in a debugger window will change the state of your program, which can produce unexpected results.

            When you set a breakpoint on an overloaded function, the location of the breakpoint depends on how you specify the function. If you specify only the function name, the debugger will set one breakpoint on each overload of that function name. If you specify the complete signature, the function name and full argument list, the debugger sets one breakpoint on the specified overload.

            The debugger correctly evaluates most built-in operators, including:

            • Relational operators: (expr1 >expr2expr1 < expr2expr1 <= expr2expr1 => expr2expr1 == expr2expr1 != expr2).

            • Boolean operators: (expr1 && expr2expr1 || expr2).

            • Conditional operator: (expr1 ? expr2 : expr3) .

            • Arithmetical operators: ( expr1 + expr2expr1 - expr2,expr1 * expr2expr1 / expr2expr1 % expr2).

            • Bitwise operators: (expr1 & expr2expr1 ^ expr2expr1 | expr2expr1 ~ expr2).

            • Shift operators. Examples: (expr1 >> expr2expr1 << expr2expr1 >>> expr2).

            • Assignment operators: ( lvalue = expr2lvalue *= expr2lvalue /= expr2lvalue %= expr2lvalue += expr2lvalue -= expr2lvalue <<= expr2lvalue>>=expr2lvalue &= expr2lvalue ^= expr2lvalue |= expr2 ).

            • Unary operators. Examples: ( + expr1, - expr1expr1++, ++ expr1expr1--, -- expr1 ).

            You can use the comma operator to enter a series of expressions: expr1expr2,expr3.

            Most overloaded operators work in the debugger.

            Overloaded infix operators +, -, /, %, and & work:

            • expr1 + expr2

            • expr1 expr2

            • expr1 / expr2

            • expr1 % expr2

            • expr1 & expr2

            Overloaded infix operators =, &&, &, ||, |, and ^ do not work:

            • expr1 = expr2

            • expr1 && expr2

            • expr1 & expr2

            • expr1 || expr2

            • expr1 | expr2

            • expr1 ^ expr2

            Overloaded relational operators ==, !=, >, <, >=, and <= do not work for C++:

            • expr1 == expr2

            • expr1 != expr2

            • expr1 > expr2

            • expr1 < expr2

            • expr1 >= expr2

            • expr1 <= expr2

            Overloaded infix operators |, ^, <<, >>, >, <, >=, and <= do not work:

            • expr1 | expr2

            • expr1 ^ expr2

            • expr1 << expr2

            • expr1 >> expr2

            • expr1 > expr2

            • expr1 < expr2

            • expr1 >= expr2

            • expr1 <= expr2

            Overloaded prefix operators +, -, ++, --, !, and ~ work:

            • + expr1

            • - expr1

            • ++ expr1

            • -- expr1

            • ! expr1

            • ~ expr1

            Overloaded suffix operators ++ and -- work:

            • expr1++

            • expr1--

            The overload operator [] works:

            • x[expr2]

            The C++ expression evaluator uses C#-style syntax for multidimensional arrays. For example:

            c[0,0]

            Using normal C++ syntax generates an error:

            c[0][0] error: index '0' out of bound for pointer/array 'c'

            The debugger recognizes the indexed operator when it is used with strings as well as arrays. So, for example, you can enter:

            "hello world"[0]

            The Watch window will display the correct value:

            'h'

            Simple cast expressions work in the debugger:

            (A)x

            Casts that involve pointers will not work in the debugger:

            User-defined casts do not work in the debugger for Visual C++.

            Object comparison and assignment in the debugger does not work for Visual C++.

            The debugger supports the typeof and sizeof operator by transforming it into the equivalent .NET Framework function.

            typeof ( expression )

            is transformed into:

            System.Type.GetType(expression )

            The debugger then evaluates this transformed expression.

            The debugger does not support the sizeof operator.

            The debugger expression evaluator does not support boxing and unboxing in Visual C++. For more information, see Boxing and Unboxing. If you have an integer variable ithat has been converted into an object through boxing, the debugger will evaluate i as an integer, not as an object. The results may not be what you expect.

            The debugger can evaluate properties in any variable window. However, evaluating a property in the debugger can have side effects that produce unexpected and undesired results. To protect against side effects caused by accidental evaluation, you can turn property evaluation off in the Options dialog box.

            You cannot call WebMethods from debugger windows.

            Did you find this helpful?  
            Community Content Add
            Annotations FAQ
            Advertisement
            性高湖久久久久久久久| 国产精品成人久久久久三级午夜电影 | 一级做a爰片久久毛片人呢| 国产成人久久精品二区三区| 欧美一级久久久久久久大| 久久天天躁狠狠躁夜夜躁2014| 久久精品人人做人人爽电影蜜月 | 久久免费看黄a级毛片| 久久久久亚洲AV无码网站| 久久国产香蕉视频| 一本一道久久综合狠狠老| 国内精品久久久久久久影视麻豆| 久久精品国产精品亚洲精品 | 亚洲精品美女久久777777| 99久久精品久久久久久清纯| 亚洲综合日韩久久成人AV| 精品久久久久久无码国产| AV狠狠色丁香婷婷综合久久| 日韩久久无码免费毛片软件| 久久99国产精一区二区三区| 午夜精品久久久久久毛片| 国内精品久久国产| 久久九九久精品国产免费直播| 996久久国产精品线观看| 久久久久亚洲AV片无码下载蜜桃| 久久精品99无色码中文字幕| 久久精品无码一区二区三区| 久久99热只有频精品8| 久久亚洲AV成人无码| 亚洲日本久久久午夜精品| 久久久久九国产精品| 国产亚州精品女人久久久久久 | 久久亚洲精品无码aⅴ大香| 久久久久久噜噜精品免费直播| 国产高潮国产高潮久久久91| 91性高湖久久久久| 久久精品国产福利国产琪琪| 午夜精品久久久久久久无码| 亚洲国产香蕉人人爽成AV片久久 | 久久天堂电影网| 99久久www免费人成精品|