Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "DSDP/DD/DSF CodingCamp ExpressionServiceExcercise"

< DSDP‎ | DD
(Existing Components)
(Existing Components)
Line 29: Line 29:
  
 
* Variable view VM (View Model) - This is the primary client of the expression service, which populates the contents of the variables view.  The view model was written against the expression service interface, and should work with a correctly implemented expression and stack services.
 
* Variable view VM (View Model) - This is the primary client of the expression service, which populates the contents of the variables view.  The view model was written against the expression service interface, and should work with a correctly implemented expression and stack services.
 +
 +
== Reference Code and Documentation ==
 +
''<code>org.eclipse.cdt.debug.mi.core.cdi.ExpressionManager</code>''
 +
This is the CDT component which creates/reads/manages GDB variable objects.  It is the closest CDI equivalent to the MI Expression service implementation and is a good reference for how to property create teh commands and interpret the command results.  However this manager does not cache results of variable reads, which in a way is the primary purpose of the expression service.
 +
 +
''MI Var Commands''
 +
In the <code>org.eclipse.dd.dsf.mi.core.command</code> package, see the commands: DsfMIVarCreate, DsfMIVarDelete, DsfMIVarEvaluateExpression, DsfMIVarSetFormat, and their corresponding MI documentation.  Also in the <code>org.eclipse.cdt.debug.mi.core.command</code> package, see: MIVarAssign, MIVarInfoExpression, MIVarInfoNumChildren, MIVarInfoType, MIVarListChildren.  These command objects will first need to be compied over into the corresponding DSF package along with their info object.
 +
 +
 +
== Design Considerations ==

Revision as of 18:49, 7 May 2007

Goals

  • Populate contents of the variables view with local variables of the selected stack frame.
  • Retrieve the sub-expressions of arrays and structs to show in Variable view.
  • Enable evaluating of expressions that user types in the Expression view.

Existing Components

  • Stack Service:
    • Interface: org.eclipse.dd.dsf.debug.service.IStack
    • MI Implementation: org.eclipse.dd.dsf.mi.service.MIStack
    • Existing functionality:
      • Retrieves list of all stack frames for a given execution context
      • Retrieves the list of function arguments for a given stack frame context
    • Missing functionality / Cleanup tasks
      • Retrieving the list of local variables for a given stack frame context
      • Simplify logic to retrieve argument data.
        • Get rid of isValid() and make the VariableDMData class immutable
      • Add tracing to the service
  • Expression Service:
    • Interface: org.eclipse.dd.dsf.debug.service.IExpressions
    • MI Implementation: org.eclipse.dd.dsf.mi.service.ExpressionService
    • Existing functionality:
      • Provided implementation was written to the interface but never tested.
      • The expression service is correctly created and shutdown during the launch sequence
    • Missing functionality:
      • As mentioned above the implementation was never tested, so it's not reliable as a reference.
      • Existing implementation does not manage the variable objects created by GDB using the "-var-create" command. Therefore all GDB variable objects that are created are leaked.
      • The expression service needs to retrieve the variable value in the number format that is specified by the client.
  • Variable view VM (View Model) - This is the primary client of the expression service, which populates the contents of the variables view. The view model was written against the expression service interface, and should work with a correctly implemented expression and stack services.

Reference Code and Documentation

org.eclipse.cdt.debug.mi.core.cdi.ExpressionManager This is the CDT component which creates/reads/manages GDB variable objects. It is the closest CDI equivalent to the MI Expression service implementation and is a good reference for how to property create teh commands and interpret the command results. However this manager does not cache results of variable reads, which in a way is the primary purpose of the expression service.

MI Var Commands In the org.eclipse.dd.dsf.mi.core.command package, see the commands: DsfMIVarCreate, DsfMIVarDelete, DsfMIVarEvaluateExpression, DsfMIVarSetFormat, and their corresponding MI documentation. Also in the org.eclipse.cdt.debug.mi.core.command package, see: MIVarAssign, MIVarInfoExpression, MIVarInfoNumChildren, MIVarInfoType, MIVarListChildren. These command objects will first need to be compied over into the corresponding DSF package along with their info object.


Design Considerations

Back to the top