[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::ada

Title:DEC Ada
Notice:Ada is no longer a trademark of the US Government
Moderator:KMOOSE::CMCCUTCHEON
Created:Mon Jan 27 1986
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:3874
Total number of notes:16668

3849.0. "DEBUGGER, EXAMINE does not show whole record" by TAV02::ZVI_P (Here we are) Wed Mar 05 1997 08:27

Hi

 A customer problem: 
 
 The debugger EXAMINE command does not show all the fields of a record.

 The customer supplied a reproducer, we reproduced it on OVMS ALPHA 6.2
 with ALPDEBU05_070 (debugger patch) and ADA 3.3-7 .

 problem will be described by a log of a session.

 ORTAL_PALGY> run digital_check

         OpenVMS Alpha DEBUG Version V6.2-103R

%DEBUG-I-INITIAL, language is ADA, module set to DIGITAL_CHECK
%DEBUG-I-NOTATMAIN, type GO to get to start of main program

DBG> Go
break at routine DIGITAL_CHECK
     3: procedure digital_check is
DBG> set br %lin 25
DBG> typ 25
module DIGITAL_CHECK
    25:     For Counter in 1..20 loop
DBG> g
break at DIGITAL_CHECK.%LINE 25
    25:     For Counter in 1..20 loop
DBG> Step
stepped to DIGITAL_CHECK.BLOCK$25.%LINE 26
    26:         Data_Array(Counter) := "DROR      ";
DBG> Step
stepped to DIGITAL_CHECK.BLOCK$25.%LINE 27
    27:         Digital_Check.Unchecked_Insert(list=> Digital_List,
DBG> Step
stepped to DIGITAL_CHECK.BLOCK$25.%LINE 31
    31:     end loop;
DBG> ex digital_list
DIGITAL_CHECK.DIGITAL_LIST
    SIZE:       20
    LENGTH_ALLOCATED:   1
    LENGTH_USED:        1
    FREE_LIST_FIRST_IDX:        0
    FREE_LIST_LAST_IDX: 0
    USED_LIST_FIRST_IDX:        1
    USED_LIST_LAST_IDX: 1
    PREV_HANDLE
        (1):    0            <<<<*********** 19 more elements missing.
 
******>>>>
***>>>>>>>   Also missing are the components: 
***>>>>>>>                                    
***>>>>>>>    Next_Handle, Key_Warehouse and Data_Warehouse


DBG> sho symb/typ PREV_HANDLE
record component DIGITAL_CHECK.LIST_TYPE.PREV_HANDLE
    noncontiguous array descriptor type, 1 dimension, bounds: [1:1], size:
2 byt
es
        cell type: subrange type, size: 2 bytes, range: 0..20
            parent type: atomic type, word integer, size: 2 bytes
DBG>
          *******>>>> The debugger wrongly parses the data type ****

The definition of "Digital_List" is:

In File: DIGITAL_CHECK.ADC

    package Digital_check is new static_list(Integer_Range,
                                             Data_Type,
                                             max_list_length,
                                             minimum_free_list_size,
                                             complex_packing);
    subType Digital_List_Type is Digital_Check.List_Type;
    Integer_Range_Data : Integer_Range;
    Digital_list : Digital_List_Type;



In File: STATIC_LIST_.ADC

    type List_Type (Size : Length_Type := Length_Type'last) is record
        Length_Allocated    : Length_Type := 0; -- position of the "farest"
                                                -- element in buffer
        Length_Used         : Length_Type := 0; -- number of elements currently
                                                -- in buffer
        Free_List_First_Idx : Handle_Type := NULL_HANDLE;
        Free_List_Last_Idx  : Handle_Type := NULL_HANDLE;
        Used_List_First_Idx : Handle_Type := NULL_HANDLE;
        Used_List_Last_Idx  : Handle_Type := NULL_HANDLE;
        Prev_Handle         : Pointers_Type(1 .. Size);
        Next_Handle         : Pointers_Type(1 .. Size);

        Key_Warehouse   : Keys_Warehouse_Type(1 .. Size);
        Data_Warehouse  : Data_Warehouse_Type(1 .. Size);
    end record;
 

On OVMS VAX 6.2 with VAXDEBU05_070 and  ADA 3.3-8 this works fine:


...
DBG> ex Digital_List
DIGITAL_CHECK.DIGITAL_LIST
    SIZE:       20
    LENGTH_ALLOCATED:   1
    LENGTH_USED:        1
    FREE_LIST_FIRST_IDX:        0
    FREE_LIST_LAST_IDX: 0
    USED_LIST_FIRST_IDX:        1
    USED_LIST_LAST_IDX: 1
    PREV_HANDLE
        (1):    0
        (2):    31548
        (3):    0
        (4):    11080
        (5):    32748
        (6):    -28925
        (7):    0
        (8):    11080
        (9):    32748
        (10):   29926
        (11):   0
        (12):   11080
        (13):   32748
        (14):   -29601
        (15):   0
        (16):   11080
        (17):   32748
        (18):   29275
        (19):   0
        (20):   11080
    NEXT_HANDLE
        (1):    0
        (2):    -30234
        (3):    0
        (4):    11080
        (5):    32748
        (6):    29112
        (7):    0
        (8):    11080
        (9):    32748
        (10):   -30794
        (11):   0
        (12):   11080
        (13):   32748
        (14):   28996
        (15):   0
        (16):   11080
        (17):   32748
        (18):   -31561
        (19):   0
        (20):   11080
    KEY_WAREHOUSE
        (1):    1
        (2):    726138880
        (3):    -2092269588
        (4):    726138880
        (5):    1869185004
        (6):    726138880
        (7):    -2115403796
        (8):    726138880
        (9):    1858109420
        (10):   726138880
        (11):   2145484780
        (12):   726138880
        (13):   1848999916
        (14):   726138880
        (15):   2126479340
        (16):   726138880
        (17):   1842380780
        (18):   726138880
        (19):   -1848541204
        (20):   726138880
    DATA_WAREHOUSE
        (1)(1..10):     "DROR      "
        (2)(1..10):     "........k"
        (3)(1..10):     "..H+�.Z..."
        (4)(1..10):     "H+�.Qk..H+"
        (5)(1..10):     "�.+...H+�."
        (6)(1..10):     "Wj..H+�.x."
        (7)(1..10):     "..H+�..i.."
        (8)(1..10):     "H+�.}...H+"
        (9)(1..10):     "�.�h..H+�."
        (10)(1..10):    "...H+�.g"
        (11)(1..10):    "..H+�.�..."
        (12)(1..10):    "H+�.bg..H+"
        (13)(1..10):    "�.�...H+�."
        (14)(1..10):    "�f..H+�.."
        (15)(1..10):    "..H+�.}.."
        (16)(1..10):    "H+�.�...H+"
        (17)(1..10):    "�.<:..�.."
        (18)(1..10):    ".........."
        (19)(1..10):    "..... �.�."
        (20)(1..10):    "..�..�..&�"


 The sources are at:


$ dir ppantr::$2$DKB200:[IPMT.ADA_DBG2]

Directory PPANTR::$2$DKB200:[IPMT.ADA_DBG2]

ARRAY_STORAGE_MANAGEMENT.ADC;2
                           5/7         3-MAR-1997 10:57:46.00
ARRAY_STORAGE_MANAGEMENT_.ADC;2
                           3/7         3-MAR-1997 10:57:40.00
DIGITAL_CHECK.ADC;8
                           4/7         3-MAR-1997 11:10:49.00
HASH_TYPES_.ADC;1          2/7         3-MAR-1997 10:51:21.00
INTEGER_LNM.ADC;1          1/7         3-MAR-1997 10:49:08.00
INTEGER_LNM_.ADC;1         2/7         3-MAR-1997 10:47:24.00
IS_BLANK.ADC;1             1/7         3-MAR-1997 10:54:18.00
LIST_HANDLE_TYPES_.ADC;1
                           2/7         2-MAR-1997 16:39:56.00
LNM.ADC;1                  6/7         3-MAR-1997 10:48:54.00
LNM_.ADC;1                 3/7         3-MAR-1997 10:48:49.00
PACK_TYPES.ADC;5           9/14        3-MAR-1997 10:58:14.00
PACK_TYPES_.ADC;3         18/21        3-MAR-1997 10:58:06.00
REGULAR_HASHING.ADC;1
                           5/7         3-MAR-1997 10:46:05.00
REGULAR_HASHING_.ADC;1
                           2/7         3-MAR-1997 10:45:58.00
SEMAPHORE.ADC;1            2/7         3-MAR-1997 11:01:31.00
SEMAPHORE_.ADC;1           2/7         3-MAR-1997 11:01:26.00
STANDARD_PRINT.ADC;2
                          18/21        3-MAR-1997 10:55:06.00
STANDARD_PRINT_.ADC;2
                          10/14        3-MAR-1997 10:54:58.00
STATIC_LIST.ADC;1         95/98        2-MAR-1997 16:49:12.00
STATIC_LIST_.ADC;1        63/63        2-MAR-1997 16:40:08.00
STORAGE_HASHED_LIST.ADC;1
                          45/49        3-MAR-1997 10:51:57.00
STORAGE_HASHED_LIST_.ADC;1
                          23/28        3-MAR-1997 10:51:51.00
STORAGE_TRACE.ADC;1
                          13/14        3-MAR-1997 11:03:13.00
STORAGE_TRACE_.ADC;3
                           4/7         3-MAR-1997 11:03:05.00
STORAGE_TRACE__ADD.ADC;1
                           3/7         3-MAR-1997 11:08:11.00
STORAGE_TRACE__CONVERT_NAME.ADC;1
                           2/7         3-MAR-1997 11:06:12.00
STORAGE_TRACE__POINT.ADC;1
                           2/7         3-MAR-1997 11:07:38.00
STORAGE_TRACE__PRINT_ADDRS.ADC;1
                           7/7         3-MAR-1997 11:09:04.00
STORAGE_TRACE__PRINT_TRACE_LINE.ADC;1
                           6/7         3-MAR-1997 11:07:03.00
STORAGE_TRACE__REMOVE.ADC;1
                           3/7         3-MAR-1997 11:08:42.00
TIME_DEFAULTS_.ADC;1
                           3/7         2-MAR-1997 16:43:22.00
TIME_SERVICES.ADC;2
                          42/42        3-MAR-1997 10:54:26.00
TIME_SERVICES_.ADC;2
                          14/14        3-MAR-1997 10:53:24.00

Total of 33 files, 420/532 blocks.
$

Note: files type is ADC .

After compilation link by:

 $ acs lin/deb DIGITAL_CHECK

 DIGITAL_CHECK is the image to be created.


			Thanks
			Zvi
T.RTitleUserPersonal
Name
DateLines
3849.1Restriction; text from V3.3 release notesKMOOSE::CMCCUTCHEONCharlie McCutcheonWed Mar 05 1997 11:0652
Hi, I'm afraid this is a debugging restriction.  From the V3.3
release notes:

        5.6 Debugging Restrictions

              The following restrictions apply when you debug DEC Ada
              programs:

...
              o  A problem occurs when a record's discriminant is used
                 for the size of a record component. In the following
                 example:

                 type VAR_STRING (LEN : INTEGER) is record
                      VALUE : STRING (1..LEN);
                 end record;
                 V : VAR_STRING(10) := (10, "1234567890");

                 Given the command EXAMINE V.VALUE, the debugger
                 displays one character for V.VALUE.
                 The workaround is to give the length of the character
                 string in the debugger command line as in the following
                 example:

                 EXAMINE /asci=10 V.VALUE

...
              o  Record components following variable-sized components
                 cannot be debugged. Digital suggests that if possible
                 you reorder the components in your program for
                 debugging purposes.


In your user's program:

    type List_Type (Size : Length_Type := Length_Type'last) is record
...
        Prev_Handle         : Pointers_Type(1 .. Size);
...


This is the same documented problem, the user is using the record discrimimant
as the size of one of the record components, so the size of that component
is not known by Debug, and the offset to any following record component
is not known either.

Unfortunately, I don't see this restriction ever changing.  This requires
work from the GEM code generator group, and they are busy working on
nifty baselevels that DEC Ada may never see, so new support for this issue
is highly unlikely.

Charlie