Debugger

compared with
Current by Vaclav Pech
on Mar 06, 2012 15:35.

Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (18)

View Page History

{anchor:nodes to trace}

h4. Nodes to trace and breakpoints

Suppose you have a language, let's call it *highLevelLanguage*, which generates code on some *lowLevelLanguage*, which in turn is generated directly into text (there can be several other languages between *highLevelLanguage* and *lowLevelLanguage*, it does not really metter). Suppose that the text generated from *lowLevelLanguage* is essentially java, and you whant to have your *highLevelLanguage* integrated with java debugger. See the following explanatory table:

|| || *lowLevelLanguage* is *baseLanguage* || *lowLevelLanguage* is not *baseLanguage* ||
| *highLevelLanguage* extends *baseLanguage* \\
|*highLevelLanguage* extends *baseLanguage*\\(uses concepts {{Statement}},{{Expression}}, {{BaseMethodDeclaration}} etc) | Do not have to do anything. | Specify traceable concepts for *lowLevelLanguage*. |
| *highLevelLanguage* does not extend *baseLanguage* | Specify breakpointable concepts for *highLevelLanguage*. | Specify traceable concepts for *lowLevelLanguage*. \\Specify breakpointable concepts in {{DebugInfoInitializer}} for *highLevelLanguage*.|
Specify breakpointable concepts in {{DebugInfoInitializer}} for *highLevelLanguage*. |

h4. Startup of a run configuration under java debugger

{anchor:custom viewers}

h4. Custom viewers


The viewer for a specific type is defined in a {{custom viewer}} root. In the following table {{custom viewer}} parts are described:
||Part||Description|| || Part || Description ||
|*for type*|A | *for type* | A type for which this viewer is intended. |
|*can wrap*|An | *can wrap* | An additional filter for viewed objects. |
|*get presentation*|A | *get presentation* | A string representation of an object. |
| *get custom watchables* | Subvalues of this object. Result of this funtion must be of type {{watchable list}}. |

Custom Viewers language introduces two new types: {{watchable list}} and {{watchable}}.

{anchor:traceable nodes}

h4. Traceable Nodes


Concepts {{TraceableConcept}}, {{ScopeConcept}} and {{UnitConcept}} of language {{jetbrains.mps.lang.traceable}} are used for that purpose. To save some information into {{trace.info}} file, user should derive from one of those concepts and implement the specific behavior method. The concepts are described in the table below.
||Concept||Description||Behavior || Concept || Description || Behavior method to implement||Example|| implement || Example ||
|{{TraceableConcept}}|Concepts | {{TraceableConcept}} | Concepts for which location in text is saved and for which breakpoints could be created. | {{getTraceableProperty}} -- some property to be saved into {{trace.info}} file.|!positionInfo.png!| file. | !positionInfo.png! |
|{{ScopeConcept}}|Concepts | {{ScopeConcept}} | Concepts which have some local variables, visible in the scope. | {{getScopeVariables}} -- variable declarations in the scope.|!scopeInfo.png!| scope. | !scopeInfo.png! |
|{{UnitConcept}}|Concepts | {{UnitConcept}} | Concepts which are generated into separate units, like classes or inner classes in java. | {{getUnitName}} -- name of the generated unit.|!unitInfo.png!| unit. | !unitInfo.png! |

{{trace.info}} files are created on the last stage of generation -- while generating text. So the decsribed concepts are only to be used in languages generated into text.