執行運算式評估工具Implement an expression evaluator
重要
在 Visual Studio 2015 中,這種執行運算式評估工具的方法已被取代。In Visual Studio 2015, this way of implementing expression evaluators is deprecated. 如需有關執行 CLR 運算式評估工具的詳細資訊,請參閱 clr 運算式評估 工具和 Managed 運算式評估工具範例。For information about implementing CLR expression evaluators, see CLR expression evaluators and Managed expression evaluator sample.
評估運算式是偵錯工具引擎 (DE) 、符號提供者 (SP) 、系結器物件,以及運算式評估工具 (EE) 之間的複雜相互作用。Evaluating an expression is a complex interplay among the debug engine (DE), the symbol provider (SP), the binder object, and the expression evaluator (EE). 這四個元件是由一個元件所執行並由另一個元件所使用的介面所連接。These four components are connected by interfaces that are implemented by one component and consumed by another.
EE 會採用字串形式的 DE 運算式,並加以剖析或評估。The EE takes an expression from the DE in the form of a string and parses or evaluates it. 此 EE 會執行下列介面,這些介面會由 DE 所耗用:The EE runs the following interfaces, which are consumed by the DE:
IDebugParsedExpressionIDebugParsedExpression
EE 會呼叫由 DE 提供的系結器物件,以取得符號和物件的值。The EE calls the binder object, supplied by the DE, to get the value of symbols and objects. EE 會取用下列介面,這些介面會由 DE 來執行:The EE consumes the following interfaces, which are implemented by the DE:
-
EE 會執行 IDebugProperty2。The EE runs IDebugProperty2.
IDebugProperty2
提供用來描述運算式評估結果的機制,例如區域變數、基本或要 Visual Studio 的物件,然後在 [ 區域變數]、 [監看 式] 或 [即時運算 ] 視窗中 顯示適當的資訊。IDebugProperty2
provides the mechanism for describing the result of an expression evaluation, such as a local variable, a primitive, or an object to Visual Studio, which then displays the appropriate information in the Locals, Watch, or Immediate window.當您要求資訊時,會將 SP 指定給 EE。The SP is given to the EE by the DE when it asks for information. SP 會執行描述位址和欄位的介面,例如下列介面及其衍生項:The SP runs interfaces that describe addresses and fields, such as the following interfaces and their derivatives:
-
EE 會取用所有這些介面。The EE consumes all of these interfaces.
本節內容In this section
運算式評估工具執行策略 定義運算式評估工具 (EE) 實行策略的三步驟處理。Expression evaluator implementation strategy Defines a three-step process for the expression evaluator (EE) implementation strategy.