![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Debugging Library Unit Elaboration The Ada program linker generates an elaboration procedure. This procedure is used to elaborate all of the library units that are in the closure of the subprogram that is being linked. There is no ada code associated with the elaboration procedure but it is possible to debug this procedure in machine code using the "Disassembly" feature of the debugger. The procedure has the name __ADA_ELAB.
Begin Debugging the Program
In the Show Data dialog type in the "Expression" __ADA_ELAB, select Show Location and then select Apply. Note that there are two "_" in __ADA_ELAB.
In the debugger window lines similar to the following should have been displayed:
__ADA_ELAB Object location: 02105d4 procedure (First instruction or entry mask: 02105d4)
Select Disassembly, View > Show Command Pane. In the Command Pane type "wi 0xxxx" where 0xxxx is the address of the __ADA_ELAB procedure. For example:
wi 02105d4
The Ada elaboration procedure should now be centered in the disassembly window. The following example is in the PowerPC Assembler but your code will be similar.
mfspr r0, lr r0 <- lr -- 02105d4: __ADA_ELAB stw r0, 04(r1) r0 -> 4(r1) stwu r1, -018(r1) r1 -> -24(r1) stmw r28, 08(r1) r28..r31 -> 8(r1) addic r30, r1, 018 addic r31, r1, 08 li r28, 08 r28 <- 8 bl 020025c -> _R_unchecked_conversion.ada.qzuc3o21jq3leus7sv..IR bl 0200274 -> _R_unchecked_deallocation.ada.zfmfqhmen7bdlgw8yf..IR bl 02004d4 -> _R_v_tas.t53pujlt6key07eyp8..IR bl 02004ec -> _R_a_strings.nsilnxkztfa09hxcmg..IR bl 0200604 -> _R_a_strings.s8bm8qf0qmudmibtv7..IR bl 020078c -> _R_os_files.tr9x1bvxdn315kt6la..IR bl 0200eb4 -> _R_file_support.cc55az4qd49erfduuj..IR ...
Note that after the __ADA_ELAB prologue there is a bl instruction for each of the library level units that have an elaboration procedure. This bl is a "Branch and Link" instruction for the Power PC. Different architectures will have different instructions for a subprogram call. Put a breakpoint at the call to a library unit elaboration procedure and "Step Into" the unit to further debug.
Rational Software Corporation http://www.rational.com support@rational.com techpubs@rational.com Copyright © 1993-2002, Rational Software Corporation. All rights reserved. |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |