Debug Facilities
I added debug facilities in [2594]. It allows to explore internal structures at some stages of source processing. To activate it you need to build gela with assertions activated. If you use gnat use:
bmake DEBUG_FLAGS="-gnata"
Then use option -A to enable debug output. Option has format -AStage:Check:Action.
Stages
Stage defined as enumeration type Execution_Point in specification of package Asis.Gela.Debug. It has follow values of now:
| Stage | Description | Package | Continue |
| Pre_Normalize | Just after parsing the source | Asis.Gela.Normalizer | |
| Post_Normalize | After remove LR(1) syntax corrections | Asis.Gela.Normalizer | |
| Set_Resolved | When Corresponding_Name_Definition_List is set. (In name resolution and in overload resolution) | Asis.Gela.Element_Utils | List of names |
| Overload_Up | Down-to-up pass in overload resolution | Asis.Gela.Overloads.Walk | Collected set of interpretation |
| Overload | Each overload resolution complete context | Asis.Gela.Overloads | Chosen overall interpretation |
| Overload_Down | Up-to-down pass in overload resolution | Asis.Gela.Overloads.Walk | Propagated interpretation |
| Lookup | Lookup a name | Asis.Gela.Visibility | Current tree of declarative region in xml |
Checks
Check restrict set of elements to explore. See type Condition_Kinds in body of package Asis.Gela.Debug. If check has argument it separated by ':'
| Check | Description | Argument |
| None | Disable all elements | |
| Any | Enable all elements | |
| Hash | Enable element with given Hash | Hash |
| Parent | Enable element with given Hash and its children | Hash |
Actions
Action defines performed action for chosen elements. Defined in type Action_Kinds in body of package Asis.Gela.Debug.
| Action | Description |
| Debug_Image | Print Debug_Image of element |
| Hash | Print Debug_Image and Hash |
| Continue | Print stage provided data, see Continue column in stage table |
Example
-APost_Normalize:Hash:1234:Debug_Image