1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
|
/***************************************************************************
* (c) Copyright 1988 - 1993 HEWLETT-PACKARD COMPANY. All rights reserved. *
***************************************************************************/
/***************************************************************************
* This program is "free" software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; Version 2, June 1991.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this include file; if not, write to the Free Software Foundation,
* Inc, 675 Mass Ave, Cambridge, MA 02139, USA
*
***************************************************************************/
/***************************************************************************
*
* Hewlett-Packard Company will not respond to external queries regarding
* the distribution or content of this include file. The University of
* Utah Center for Software Science (CSS) is the contact point for its
* distribution. CSS distributes this file under the terms of the GNU
* General Public License, as above: WITHOUT ANY WARRANTY. CSS makes NO
* WARRANTY as to the file's accuracy or timeliness. This file is NOT
* SUPPORTED by CSS.
*
* The current distributed version of this file is available by
* anonymous ftp from jaguar.cs.utah.edu in dist/hpux-symtab.h.
* The GNU General Public License is in dist/COPYING.
* Email may be directed to pa-gdb-bugs@cs.utah.edu.
*
***************************************************************************/
#ifndef _SYMTAB_INCLUDED /* allow multiple inclusions */
#define _SYMTAB_INCLUDED
/*
*
* SYMBOLIC DEBUG FORMAT ACD
* $Revision$
*
*
*
* ---- 1. INTRODUCTION
*
*
* This document describes the current format for data tables which
* appear in HP-UX / HPE object files (a.out files). These tables
* will be generated by the compilers, fixed up by the linker, and
* used by various programs (primarily the symbolic debugger(s)) to
* reconstruct information about the program. The form of this
* document is a C include file annotated with comments.
*
* On PA-RISC, a major goal was that the linker need not know
* anything about the format. To this end, it was decided that the
* debug information be composed of several unloadable subspaces
* within an unloadable space (named $DEBUG$), and that link time
* updates to the debug information be made through the standard
* mechanism of a list of fixups. The linker will perform the
* required fixups for the debug spaces, and subspaces from
* separate compilation units will be concatenated. However, at
* exec time, the loader would know that the debug space is not to
* be loaded.
*
* Similarly, on the series 300, several debug tables are present
* in the a.out format which are not loaded at exec time. Debug
* tables are simply concatenated into larger tables at link time
* and all fixups are then performed by pxdb.
*/
/*
* ---- 2. SUMMARY OF STRUCTURES
*
*
* The debug information consists of six tables: a header table
* and five special tables. The header table will contain one
* header record for each compilation unit. Each header record
* identifies the size (in bytes) of the five tables generated by
* that compilation unit. Two of the tables are very similar. The
* GNTT and LNTT both contain name and type information (NTT for
* Name and Type Table). The GNTT contains information about
* globals, and is thus limited to variables, types, and constants.
* The LNTT is for information about locals. The LNTT must
* therefore contain scoping information such as procedure nesting,
* begin-end blocks, etc. The GNTT and LNTT are both DNTTs (Debug
* Name and Type Tables), so the prefix DNTT is attached to objects
* (like a DNTTPOINTER) that are relevant to both the GNTT and
* LNTT. The SLT contains information relating source (or listing)
* lines to code addresses. The SLT and LNTT contain pointers
* between the two tables, so that the scoping information
* contained in the LNTT can also be used with the SLT. The VT
* contains ascii strings (such as variable names) and the values
* of named constants. The five tables are summarized below:
*
*
* Table Abbr Contains Points into
* ============= ==== ========================= ===============
* Global symbols GNTT global name-and-type info GNTT
* Local symbols LNTT local name-and-type info GNTT,LNTT,SLT,VT
* source line SLT source/listing line info LNTT,SLT
* value VT names and constants -
* xref XT File offsets and Attributes XT,VT
*
*
* The pointers needed within the debug tables are in fact indexes
* into the tables. The GNTT, LNTT, and SLT each consist of a series
* of equal-sized entries. Some DNTT entries begin a data structure
* and some are extension entries. Some SLT entries are "special"
* (point back to the LNTT), others are "assist" (point forward in
* the SLT), but most are "normal" (point to code).
*
* There can be pointers from the LNTT to the GNTT, as it is common
* to have local variables of a global type. However, there are
* never pointers from the GNTT to the LNTT, as global variables
* are never of a local type.
*
* The tables are defined to be as machine-independent as possible,
* but the debugger may need to "know" some facts about the system
* and language it is dealing with.
*
* The GNTT and LNTT are the only tables that require fixups to be
* generated by the compiler and acted upon by the linker. There
* are other fixups to be done, but these are all done by the pre-
* processor.
*/
/*
* ---- 3. LOW-LEVEL TYPE DECLARATIONS
*/
/*
* Code or data address:
*
* For the series 300:
*
* A virtual Address
*
* For PA-RISC:
*
* A PA-RISC short pointer.
*
*/
#if __cplusplus
#define public global
#endif
typedef long ADDRESS;
typedef unsigned long ADRT, *pADRT;
/*
* Language types:
*
* Sizeof (LANGTYPE) = 4 bits, for a maximum of 16 possible
* language types.
*/
typedef unsigned int LANGTYPE;
#define LANG_UNKNOWN 0
#define LANG_C 1
#define LANG_HPF77 2
#define LANG_HPPASCAL 3
#define LANG_HPMODCAL 4
#define LANG_HPCOBOL 5
#define LANG_HPBASIC 6
#define LANG_HPADA 7
#ifdef CPLUSPLUS
#define LANG_CPLUSPLUS 8
#endif
/*
* Location types:
*
* 32-bit, machine-dependent and context-dependent specifiers of
* variable storage location.
*/
typedef unsigned long STATTYPE; /* static-type location */
typedef long DYNTYPE; /* dynamic-type location */
typedef unsigned long REGTYPE; /* register-type location */
#define STATNIL (-1) /* no location for STATTYPE */
/*
* Loc type Series 300 PA-RISC
* ======== ================ ===============
*
* STATTYPE Absolute address A PA-RISC
* into process short pointer.
* space (could be
* code or data).
*
*
* DYNTYPE A6-register- SP-register
* relative byte relative byte
* offset (+/-). offset (+/-)
*
* REGTYPE Register number Register number
* (see below). (see below).
*
* All location types are always byte (not word) pointers when they
* address memory, and they always point to the first byte
* containing the object, skipping any padding bytes. For example,
* if in Pascal a CHAR is allocated in the last byte of a whole
* word, the pointer is to that byte. (In C, four different CHAR
* variables might be packed into one word.)
*/
/*
* Meaning of STATTYPE for CONST entries:
*
* Sizeof (LOCDESCTYPE) = 3 bits, for a maximum of 8 possible
* desctypes.
*/
typedef unsigned int LOCDESCTYPE;
#define LOC_IMMED 0 /* immediate constant */
#define LOC_PTR 1 /* standard STATTYPE */
#define LOC_VT 2 /* value table byte offset */
/*
* Register numbers for REGTYPE (Series 300 only):
*/
#define REG_D0 0
#define REG_D1 1
#define REG_D2 2
#define REG_D3 3
#define REG_D4 4
#define REG_D5 5
#define REG_D6 6
#define REG_D7 7
#define REG_A0 8
#define REG_A1 9
#define REG_A2 10
#define REG_A3 11
#define REG_A4 12
#define REG_A5 13
#define REG_A6 14
#define REG_A7 15
#define REG_FP0 16
#define REG_FP1 17
#define REG_FP2 18
#define REG_FP3 19
#define REG_FP4 20
#define REG_FP5 21
#define REG_FP6 22
#define REG_FP7 23
#define REG_FPA0 24
#define REG_FPA1 25
#define REG_FPA2 26
#define REG_FPA3 27
#define REG_FPA4 28
#define REG_FPA5 29
#define REG_FPA6 30
#define REG_FPA7 31
#define REG_FPA8 32
#define REG_FPA9 33
#define REG_FPA10 34
#define REG_FPA11 35
#define REG_FPA12 36
#define REG_FPA13 37
#define REG_FPA14 38
#define REG_FPA15 39
/*
* generic floating point registers;
* actual register determined at runtime
*/
#define REG_FGEN0 40
#define REG_FGEN1 41
#define REG_FGEN2 42
#define REG_FGEN3 43
#define REG_FGEN4 44
#define REG_FGEN5 45
#define REG_FGEN6 46
#define REG_FGEN7 47
#define REG_FGEN8 48
#define REG_FGEN9 49
#define REG_FGEN10 50
#define REG_FGEN11 51
#define REG_FGEN12 52
#define REG_FGEN13 53
#define REG_FGEN14 54
#define REG_FGEN15 55
/*
* Basetypes:
*
* Sizeof (BASETYPE) = 5 bits, for a maximum of 32 possible
* basetypes.
*/
typedef unsigned int BASETYPE;
#define T_UNDEFINED 0 /* unheard of */
#define T_BOOLEAN 1 /* true/false or LOGICAL */
#define T_CHAR 2 /* ASCII, signed if used as int */
#define T_INT 3 /* signed integer */
#define T_UNS_INT 4 /* unsigned integer */
#define T_REAL 5 /* binary or decimal real */
#define T_COMPLEX 6 /* pair of reals */
#define T_STRING200 7 /* Series 300 string type */
#define T_LONGSTRING200 8 /* Series 300 long string type */
#define T_TEXT 9 /* for Pascal TEXT file */
#define T_FLABEL 10 /* for any program labels */
#define T_FTN_STRING_SPEC 11 /* PA-RISC FORTRAN string type */
#define T_MOD_STRING_SPEC 12 /* PA-RISC Modcal/Pascal string */
#define T_PACKED_DECIMAL 13 /* packed decimal */
#define T_REAL_3000 14 /* HP3000 format real */
#define T_MOD_STRING_3000 15 /* HP3000 Modcal/Pascal string */
#define T_ANYPTR 16 /* Pascal any-pointer */
#define T_GLOBAL_ANYPTR 17 /* Pascal global any-pointer */
#define T_LOCAL_ANYPTR 18 /* Pascal local any-pointer */
#define T_COMPLEXS3000 19 /* HP3000 format complex */
#define T_FTN_STRING_S300_COMPAT 20 /* 9000/s300 compatible fortran string */
#define T_FTN_STRING_VAX_COMPAT 21 /* VAX compatible fortran string */
#define T_BOOLEAN_S300_COMPAT 22 /* 9000/s300 compatible fortran logical */
#define T_BOOLEAN_VAX_COMPAT 23 /* VAX compatible fortran logical */
#define T_WIDE_CHAR 24 /* ANSI/C wchar_t pseudo-type */
#define T_LONG 25 /* signed long */
#define T_UNS_LONG 26 /* unsigned long */
#define T_DOUBLE 27 /* binary or decimal double */
#ifdef TEMPLATES
#define T_TEMPLATE_ARG 28 /* template argument immediate type */
#endif /* TEMPLATES */
/* THE HIGHEST BASE_TYPE ALLOWABLE is 31 (see DNTTP_IMMEDIATE) */
/*
* The string types are reserved for cases where the language has
* an explicit string type separate from "array of char".
*
* The ANSI/C wchar_t typedef defines a special base-type to
* the debugger. The interpretation of wide-characters during
* input or display (i.e. their mapping to/from "external"
* characters) is defined by the ANSI/C functions mbtowc() and
* wctomb(), the "multi-byte" translation functions.
*
* T_FLABEL is used for CONSTs which are actually FORTRAN labels.
* The T_FLABEL is needed for the following: in FORTRAN there is
* the ASSIGN statement (ASSIGN <label> TO <integer variable>),
* which places the address of the statement prefixed with the
* label <label> into the integer variable. This integer variable
* can then be used as a label (e.g. GOTO <integer variable>).
* The user may wish to display the contents of the integer variable
* as a label. The DNTT LABEL entry is not sufficient, as the label
* need not be on an executable statement (e.g. a FORMAT statement),
* and the DNTT LABEL can only be used with executable statements.
*
* The bitlength in a DNTT entry further qualifies the basetype.
* Here is a summary of the legal values for bitlength. See the
* appropriate sections below for details.
*
* T_UNDEFINED any probably treat as int
* T_BOOLEAN 1 one-bit value
* 16,32 FORTRAN LOGICAL
* T_CHAR 1..8 size of char (really can be < 8 bits in C)
* T_INT 2..n probably n <= 64; incl. sign bit
* T_UNS_INT 1..n probably n <= 64
* T_REAL 32 short binary
* 64 long binary
* 128 extended real
* T_COMPLEX 64 two short binaries
* 128 two long binaries
* 192 two decimals
* T_STRING200 n * 8 maximum allocated memory, including
* length byte and/or terminator byte
* T_FTN_STRING_SPEC (to be determined)
* T_MOD_STRING_SPEC (to be determined)
* T_TEXT n size of the element buffer only
* T_FLABEL n * 8 size of the format label
* T_PACKED_DECIMAL (to be determined)
* T_WIDE_CHAR 32 determined by HP's NLS/Ansi-C committees
*/
typedef unsigned int BITS;
/*
* DNTT pointer:
*/
struct DNTTP_IMMEDIATE {
BITS extension: 1; /* always set to 1 */
BITS immediate: 1; /* always set to 1 */
BITS global: 1; /* always set to 0 */
BASETYPE type: 5; /* immediate basetype */
BITS bitlength: 24; /* immediate bitlength */
};
/*
* Note that for type T_TEMPLATE_ARG bitlength is an positioning
* index into the chain of DNTT_TEMPLATE_ARG hanging out of
* the DNTT_TEMPLATE arglist field.
*/
struct DNTTP_NONIMMED {
BITS extension: 1; /* always set to 1 */
BITS immediate: 1; /* always set to 0 */
BITS global: 1; /* 1 => GNTT, 0 => LNTT */
BITS index: 29; /* DNTT table index */
};
typedef union {
struct DNTTP_IMMEDIATE dntti;
struct DNTTP_NONIMMED dnttp;
long word; /* for generic access */
} DNTTPOINTER; /* one word */
#define DNTTNIL (-1)
/*
* A DNTTPOINTER of DNTTNIL means a nil pointer. In the DNTT
* immediate case there is always at least one zero bit (the global
* bit) to distinguish that case from nil pointer (-1). In the
* non-immediate, non-nil case DNTTPOINTER is the block index, base
* zero, of another DNTT entry; the global bit indicates which table
* it is an index into, the GNTT or LNTT. Each block is 12 bytes.
*
* Extension bits really have nothing to do with DNTT pointers, but
* are needed for constructing the DNTT. See the next section.
*
* Bitlength is the MINIMUM (packed) size of the object. In lieu
* of other information (i.e., outside of a structure or array),
* the object is assumed to be right-justified in the minimum
* number of whole bytes required to hold the bitlength. An
* immediate DNTTPOINTER is only allowed if the type is a simple
* BASETYPE. Otherwise, a separate DNTT entry must be used.
*/
/*
* SLT pointer:
*
* Signed entry index, base zero, into the source line table.
* Each entry is eight bytes.
*/
typedef long SLTPOINTER;
#define SLTNIL (-1)
/*
* VT pointer:
*
* Unsigned byte offset into the value table. Note that VTNIL
* is not actually a nil pointer, but rather a pointer to a nil
* string (see section 6).
*/
typedef long VTPOINTER;
#define VTNIL 0
/*
* XREF pointer:
*
* Signed entry index, base zero, into the cross reference table.
* Each entry is four bytes.
*/
typedef long XREFPOINTER;
#define XREFNIL (-1)
/*
* Values for "declaration" fields describing packing method
*/
#define DECLNORMAL 0
#define DECLPACKED 1
#define DECLCRUNCHED 2
/*
* ---- 4. DEBUG HEADER
*/
/*
* The header table is composed of five word header records. For
* each compilation unit, the compiler must generate a header
* record, indicating the length (in bytes) of the five tables
* (GNTT, LNTT, SLT, VT and XT) produced for that compilation unit.
*/
struct XDB_header {
long gntt_length;
long lntt_length;
long slt_length;
long vt_length;
long xt_length;
};
#define extension_header 0x80000000
/*
* The purpose of the header record is as follows: the five tables
* are each contained in a separate subspace on PA-RISC or in a
* separate section of the a.out file on the series 300. Therefore
* at link time, the tables from different compilation units will
* be con- catenated separately, GNTTs to GNTTS, SLTs to SLTs, etc.
* However, the preprocessor requires the number of compilation
* units, and the size of each of the five tables produced by each
* compilation unit. The header records supply this size
* information, and the number of header records equals the number
* of compilation units.
*
* For PA-RISC, the header_extension flag (MSB) is set in the
* gntt_length word in each header-record by the HP-UX 3.1+ s800 C
* compiler to indicate the header contains an xt_length and is 5
* words long. This bit is used to distinguish SOM's that were
* created with the pre-SA compiler (HP-UX 3.0, /bin/cc vers.
* A.00.15 or earlier) from SOM's that contain an $XT$ subspace.
*
* For PA-RISC, pxdb and xdb version A.02.xx can be used on
* >>all<< SOM's (4 or 5 word XDB headers) that have not already
* been pxdb'd. Earlier versions of either are completely
* incompatible with SOM's containing an $XT$ (HP-UXS 3.1 or later)
* because of the header-length.
*
* For the series 300, the header_extension flag is not used (i.e.
* the gntt_length occupies a full 32 bits).
*/
/*
* ---- 5. DEBUG SYMBOL TABLE (DNTT) ENTRY FORMAT
*/
/*
* The DNTT consists of a series of three-word blocks. Each block
* starts with an "extension bit". Each structure in the union
* "dnttentry" begins in an "initial block" with a bit which is
* always zero. If a structure is more than three words (one
* block) long, it occupies one or more additional "extension
* blocks", each of which starts with a bit set to one to
* distinguish it from an initial block.
*
* Note well that every DNTTPOINTER has a high bit of one and that
* every DNTT structure bigger than one block is carefully arranged
* so that a DNTTPOINTER resides in the fourth and seventh words.
* (The extension bit is in the DNTTPOINTER to avoid wasting space
* due to structure packing rules.)
*/
#define DNTTBLOCKSIZE 12
/* The second field in each structure is "kind", which acts like a
* Pascal variant tag to denote the type of the structure. The
* "unused" fields are just included for clarity. The whole union
* "dnttentry" is declared after the definition of KINDTYPE and all
* the various structures (below).
*/
typedef int KINDTYPE;
#define K_NIL (-1) /* guaranteed illegal value */
#define K_SRCFILE 0
#define K_MODULE 1
#define K_FUNCTION 2
#define K_ENTRY 3
#define K_BEGIN 4
#define K_END 5
#define K_IMPORT 6
#define K_LABEL 7
#define K_WITH 27
#define K_COMMON 28
#define K_FPARAM 8
#define K_SVAR 9
#define K_DVAR 10
#define K_CONST 12
#define K_TYPEDEF 13
#define K_TAGDEF 14
#define K_POINTER 15
#define K_ENUM 16
#define K_MEMENUM 17
#define K_SET 18
#define K_SUBRANGE 19
#define K_ARRAY 20
#define K_STRUCT 21
#define K_UNION 22
#define K_FIELD 23
#define K_VARIANT 24
#define K_FILE 25
#define K_FUNCTYPE 26
#define K_COBSTRUCT 29
#define K_XREF 30
#define K_SA 31
#define K_MACRO 32
#define K_BLOCKDATA 33
#define K_MODIFIER 45 /* used for C too so we can qualify type */
#ifdef CPLUSPLUS
#define K_CLASS_SCOPE 34
#define K_REFERENCE 35
#define K_PTRMEM 36
#define K_PTRMEMFUNC 37
#define K_CLASS 38
#define K_GENFIELD 39
#define K_VFUNC 40
#define K_MEMACCESS 41
#define K_INHERITANCE 42
#define K_FRIEND_CLASS 43
#define K_FRIEND_FUNC 44
#define K_OBJECT_ID 46
#define K_MEMFUNC 47
#ifdef TEMPLATES
#define K_TEMPLATE 48
#define K_TEMPL_ARG 49
#define K_FUNC_TEMPLATE 50
#define K_LINK 51
#endif /* TEMPLATES */
#endif
#ifdef CPLUSPLUS
#ifdef TEMPLATES
#define K_MAX K_LINK
#else /* TEMPLATES */
#define K_MAX K_MEMFUNC
#endif /* TEMPLATES */
#else
#define K_MAX K_BLOCKDATA
#endif
/*
* ---- 5.1. FILE-CLASS ("FILE") DNTT ENTRIES
*/
struct DNTT_SRCFILE {
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* always K_SRCFILE */
LANGTYPE language: 4; /* type of language */
BITS unused: 17;
/*1*/ VTPOINTER name; /* name of source/listing file */
/*2*/ SLTPOINTER address; /* code and text locations */
}; /* three words */
/*
* One SRCFILE is emitted for the start of each source file, the
* start of each included file, and the return from each included
* file. Additional SRCFILE entries must also be output before each
* DNTT_FUNC entry. This guarantees the debuggers know which file a
* function came from. Specifically, the rules are as follows:
*
* Definitions:
* Source block: contiguous block of one or more lines of text in a
* source-file, bounded by beginning or end-of-file or include
* directives (conceptually identical to the "basic block" in
* optimizer jargon). No distinction is made between blocks
* that contain compilable code and those that don't.
*
* Code segment: contiguous LINEAR block of DNTT (and associated
* SLT) entries that are generated from the same "source block".
* "SLT_SRC" is used here to actually refer to an SLT_SPEC entry
* of type SLT_SRCFILE. Same goes for SLT_FUNC.
*
* 1. One DNTT_SRCFILE and SLT_SRC must be emitted at the head of each
* code segment to facilitate reading backwards through the DNTT or
* SLT tables from any point in the segment to determine the
* enclosing source file. If the source-file changes within the
* body of a function/subprogram, a DNTT_SRCFILE/SLT_SRC pair must
* be emitted prior to any additional DNTT or SLT entries generated
* by the remainder of that function/subprogram.
*
* 2. One DNTT_SRCFILE/SLT_SRC pair is always emitted *immediately*
* before any DNTT_FUNC/SLT_FUNC. Exception: a DNTT_SA and
* associated DNTT_XREF may appear between a DNTT_FUNC and it's
* preceding DNTT_SRCFILE. There can be nothing between the
* SLT_SRC and the SLT_FUNC. The DNTT_SRCFILE (preceding the
* DNTT_FUNC) must name the file containing the functions
* declaration. The SLT_FUNC must contain the line number of the
* line in the function's declaration where the function's name
* appears. This line number must match the line number that
* appears in the XT record denoting the function's declaration.
* The SLT_END associated with the SLT_FUNC must contain the line
* number of the source line containing the scope-closing token
* (i.e. "}" or "end").
*
* 3. One DNTT_SRCFILE/SLT_SRC pair must be emitted for a source file
* that otherwise would not be mentioned in the DNTT i.e. source
* files that do not generate a code segment. This is required for
* Static analysis only.
*
*
* "address" points to a special SLT entry (for the line number
* only), but the code location is known from context in the SLT. *
*
* NOTE: Listing files and listing file line numbers may be used in
* place of source files and source file line numbers. A
* special compiler option will designate which is generated
* by the compiler.
*
* SRCFILE names are exactly as seen by the compiler, i.e. they
* may be relative, absolute, or whatever. C include file names
* must be given as absolute paths if found "in the usual place",
* i.e., /usr/include/...
*/
/*
* ---- 5.2. CODE-CLASS ("SCOPING") DNTT ENTRIES
*/
struct DNTT_MODULE {
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* always K_MODULE */
BITS unused: 21;
/*1*/ VTPOINTER name; /* name of module */
/*2*/ VTPOINTER alias; /* alternate name, if any */
/*3*/ DNTTPOINTER dummy; /* 4th word must be DNTTPOINTER */
/*4*/ SLTPOINTER address; /* code and text locations */
}; /* five words */
/*
* One MODULE is emitted for the start of each Pascal/Modcal module
* or C source file (C sources are considered a nameless module).
* "address" points to a special SLT entry, but the code location
* is known from context in the SLT.
*
* In the case of languages that do not support modules (such as
* FORTRAN) a DNTT_MODULE and DNTT_END pair are not used. Every
* MODULE must have a matching END (see below). If a Pascal/Modcal
* module has a module body (some code), the latter must be represented
* by a FUNCTION-END pair as well (see below).
*
* For items within a module, the public bit is true if that item
* is exported by the module. If the public bit of an item is set,
* that item is visible within any module or procedure that imports
* the module containing the item. If the public bit of an item
* is not set, then the item is only visible within the module.
*
* The "dummy" field exists only because the first word of each
* extension block must be a DNTTPOINTER; it is important only
* that the extension bit of the DNTTPOINTER be set.
*
* The MODULE DNTT should be used only in the LNTT.
*/
#ifdef TEMPLATES
struct DNTT_LINK
{
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* always K_LINK */
BITS linkKind: 4; /* always LINK_UNKNOWN */
BITS unused: 17;
/*1*/ long future1; /* expansion */
/*2*/ DNTTPOINTER ptr1; /* link from template */
/*3*/ DNTTPOINTER ptr2; /* to expansion */
/*4*/ long future[2];
};
#if 1
struct DNTT_TFUNC_LINK
{
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* always K_LINK */
BITS linkKind: 4; /* always LINK_FUNC_TEMPLATE */
BITS unused: 17;
/*1*/ long args; /* expansion */
/*2*/ DNTTPOINTER pTemplate; /* link from template */
/*3*/ DNTTPOINTER pExpansion; /* to expansion */
/*4*/ long future[2];
};
#endif /* 0 */
/* temporary until we get a new cfront */
#if 0
struct DNTT_TFUNC_LINK
{
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* always K_LINK */
BITS linkKind: 4; /* always LINK_FUNC_TEMPLATE */
BITS unused: 17;
/*2*/ DNTTPOINTER pTemplate; /* link from template */
/*3*/ DNTTPOINTER pExpansion; /* to expansion */
/*1*/ long args; /* expansion */
/*4*/ long future[2];
};
#endif /* 0 */
/*
* Note the linkKind bit. The idea is that we might have other
* LINKs in the future that share the same format but where we would
* call the fields another name. It's hard to debug a program
* where fields are called link_word1 and link_word2.
*/
#define LINK_UNKNOWN 0
#define LINK_FUNC_TEMPLATE 1
struct DNTT_FUNC_TEMPLATE {
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* K_FUNC_TEMPLATE */
BITS public: 1; /* 1 => globally visible */
LANGTYPE language: 4; /* type of language */
BITS level: 5; /* nesting level (top level = 0)*/
BITS optimize: 2; /* level of optimization */
BITS varargs: 1; /* ellipses. Pascal/800 later */
BITS info: 4; /* lang-specific stuff; F_xxxx */
#ifdef CPLUSPLUS
BITS inlined: 1;
BITS localloc: 1; /* 0 at top, 1 at end of block */
BITS unused: 2;
#else
BITS unused: 4;
#endif
/*1*/ VTPOINTER name; /* name of function */
/*2*/ VTPOINTER alias; /* alternate name, if any */
/*3*/ DNTTPOINTER firstparam; /* first FPARAM, if any */
/*4*/ DNTTPOINTER retval; /* return type, if any */
/*5*/ DNTTPOINTER arglist; /* ptr to argument list */
}; /* nine words */
/*
* DNTT_FUNC_TEMPLATEs only appear in the GNTT. Functions and
* classes templates cannot be local. (Their instantions may be).
*/
#endif /* TEMPLATES */
struct DNTT_FUNC {
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* K_FUNCTION, K_ENTRY, */
/* K_BLOCKDATA, or K_MEMFUNC */
BITS public: 1; /* 1 => globally visible */
LANGTYPE language: 4; /* type of language */
BITS level: 5; /* nesting level (top level = 0)*/
BITS optimize: 2; /* level of optimization */
BITS varargs: 1; /* ellipses. Pascal/800 later */
BITS info: 4; /* lang-specific stuff; F_xxxx */
#ifdef CPLUSPLUS
BITS inlined: 1;
BITS localloc: 1; /* 0 at top, 1 at end of block */
#ifdef TEMPLATES
BITS expansion: 1; /* 1 = function expansion */
BITS unused: 1;
#else /* TEMPLATES */
BITS unused: 2;
#endif /* TEMPLATES */
#else
BITS unused: 4;
#endif
/*1*/ VTPOINTER name; /* name of function */
/*2*/ VTPOINTER alias; /* alternate name, if any */
/*3*/ DNTTPOINTER firstparam; /* first FPARAM, if any */
/*4*/ SLTPOINTER address; /* code and text locations */
/*5*/ ADDRESS entryaddr; /* address of entry point */
/*6*/ DNTTPOINTER retval; /* return type, if any */
/*7*/ ADDRESS lowaddr; /* lowest address of function */
/*8*/ ADDRESS hiaddr; /* highest address of function */
}; /* nine words */
/*
* Additional function semantics: Values for DNTT_FUNC.info
*/
/* In command-line C proc-call... */
#define F_ARGMODE_COMPAT_C 0 /* all real params passed as double */
#define F_ARGMODE_ANSI_C 1 /* floats-is-floats but PASS as dbl */
#define F_ARGMODE_ANSI_C_PROTO 2 /* all real params passed as declared */
/* special DNTT_FUNC semantics */
#define F_ARGMODE_BLKDATA 3 /* Fortran "block data" construct */
/* NOT A FUNCTION! */
/* F_ARGMODE_BLKDATA is retained for backward compatability only */
#ifdef CPLUSPLUS
#define CPP_OVERLOADED 0x1 /* overloaded function */
#define CPP_MEMBERFUNC 0x2 /* member function */
#define CPP_INLINE 0x4 /* inline function */
#define CPP_OPERATOR 0x8 /* operator function */
#endif
/*
* Struct DNTT_FUNC is used for dfunc and dentry, and dblockdata types.
* One FUNCTION or ENTRY is emitted for each formal function
* declaration (with a body) or secondary entry point,
* respectively. They are not emitted for bodyless declarations
* (FORWARD, EXTERNAL, "int x ();" etc.). A dblockdata is emitted for
* Fortran BLOCK DATA constructs only.
*
* "address" always points to a special SLT entry.
*
* For FUNCTION types, the "entryaddr" field is the code address of
* the primary entry point of the function. The "lowaddr" field is
* the lowest code address of the function. The "hiaddr" field
* is the highest code address of the function. This both gives
* the size of the function and helps in mapping code locations
* to functions when there are anonymous (non-debuggable) functions
* present. These three fields should be filled in by the generation
* of fixups.
*
* For ENTRY types, the "entryaddr" field points to the proper code
* location for calling the function at the secondary entrypoint,
* and the "lowaddr" and "hiaddr" fields are nil (zero). For a
* FORTRAN subroutine with alternate entries, DNTT_DVARs are required
* to represent the parameters, see the DNTT_FPARAM definition for
* the details.
*
* For BLOCKDATA types, the "public" bit should be set to 1, the
* "level", "optimize", "varargs" and "info" fields should all be 0.
* The "firstparam" field should be DNTTNIL. The "entryaddr" and
* "lowaddr" fields should be 0, and the "highaddr" field should be
* FFFFFFFC (-4). The "retval" field should be set to T_UNDEFINED,
* with length 0. An SLT_FUNCTION/SNT_END pair should be emitted
* for each DNTT_FUNC (BLOCKDATA).
*
* Every FUNCTION or BLOCKDATA must have a matching END (see below).
*
* For languages in which a functions return value is set by assigning
* the value to the function name (such as FORTRAN & Pascal), a DVAR
* entry should also be emitted for the function. The address of this
* DVAR for the function should be the address of the answer spot for
* the function. This will allow the user to display the current
* return value while the function is executing.
*
* The "varargs" field indicates whether the function was declared as
* having a variable-length parameter list. This is currently possible
* only via ANSI/C function-prototype "ellipses" (...). The "info" field
* provides additional language-specific characteristics of the function
* and/or its parameter-list.
*
* The localloc (local variables location) is currently only used
* in the following context: If the function
* language is LANG_CPLUSPLUS, then 0 means that locals are
* at the beginning of the block, and 1 means that locals appears
* at the end of a block. For all other languages
* this bit is not used.
*
* The FUNCTION DNTT should be used only in the LNTT.
*/
struct DNTT_BEGIN {
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* always K_BEGIN */
#ifdef CPLUSPLUS
BITS classflag: 1; /* beginning of class def'n */
BITS unused: 20;
#else
BITS unused: 21;
#endif
/*1*/ SLTPOINTER address; /* code and text locations */
}; /* two words */
/*
* BEGINs are emitted as required to open a new (nested) scope for
* any type of variable or label, at any level within MODULE-END
* and FUNCTION-END pairs. Every BEGIN must have a matching END
* (see below). "address" points to a special SLT entry, but the
* code location is known from context in the SLT. Because a DNTT
* BEGIN-END is used to indicate a new scope, the Pascal BEGIN-
* END pair does not produce a DNTT BEGIN-END, while the C { }
* construct does.
*
* The BEGIN DNTT should be used only in the LNTT.
*/
struct DNTT_COMMON {
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* always K_COMMON */
BITS unused: 21;
/*1*/ VTPOINTER name; /* name of common block */
/*2*/ VTPOINTER alias; /* alternate name, if any */
}; /* three words */
/*
* COMMONs are used to indicate that a group of variables are members
* of a given FORTRAN common block. For each common block, a DNTT_
* COMMON is emitted, followed by a DNTT_SVAR for each member of the
* common block, and finally a DNTT_END. If type information is
* required for a member of the common block (such as an array), it
* may also be within the DNTT_COMMON, DNTT_END pair.
*
* The COMMON DNTT should be used only in the LNTT.
*/
struct DNTT_WITH {
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* always K_WITH */
BITS addrtype: 2; /* 0 => STATTYPE */
/* 1 => DYNTYPE */
/* 2 => REGTYPE */
BITS indirect: 1; /* 1 => pointer to object */
BITS longaddr: 1; /* 1 => in long pointer space */
BITS nestlevel: 6; /* # of nesting levels back */
BITS unused: 11;
/*1*/ long location; /* where stored (allocated) */
/*2*/ SLTPOINTER address;
/*3*/ DNTTPOINTER type; /* type of with expression */
/*4*/ VTPOINTER name; /* name of with expression */
/*5*/ unsigned long offset; /* byte offset from location */
}; /* six words */
/*
* WITHs are emitted to open a with scope. Like a BEGIN, a
* WITH requires a matching END to close the scope. A single WITH
* statement possessing more than one record expression, should
* be handled as multiple nested withs with only one expression
* each. The "addrtype" field indicates the addressing mode used
* for the record expression, and along with the "indirect" field,
* tells how to interpret the "location" and "offset" fields. Thus,
* depending upon the value of "addrtype", "location" may contain
* a short pointer, an offset from the local frame pointer, or a
* register number. If "nestlevel" is non-zero and "addrtype" is
* DYNTYPE, the address for the record expression is computed by
* tracing back "nestlevel" static links and using "location" as
* an offset from the frame pointer at that level. (This situation
* occurs only on the FOCUS architecture.) The use of the
* "offset" field is the same as for the DNTT_SVAR entry (see below).
* The "type" field is the type of the record expression. The "name"
* field is the symbolic representation of the record expression
* (ex. "p[i]^"). "address" points to a special SLT, but the code
* location is known from context in the SLT.
*
* The WITH DNTT should be used only in the LNTT.
*/
struct DNTT_END {
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* always K_END */
KINDTYPE endkind: 10; /* DNTT kind closing scope for */
#ifdef CPLUSPLUS
BITS classflag: 1; /* end of class def'n */
BITS unused: 10;
#else
BITS unused: 11;
#endif
/*1*/ SLTPOINTER address; /* code and text locations */
/*2*/ DNTTPOINTER beginscope; /* start of scope */
}; /* three words */
/*
* ENDs are emitted as required to close a scope started by a
* MODULE, FUNCTION, WITH, COMMON, or BEGIN (but not an ENTRY).
* Each points back to the DNTT entry that opened the scope.
* "endkind" indicates which kind of DNTT entry is associated with
* the END and is filled in by the preprocessor. "address" points
* to a special SLT entry, but the code location is known from context
* in the SLT.
*
* The END DNTT should be used only in the LNTT.
*/
struct DNTT_IMPORT {
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* always K_IMPORT */
BITS explicit: 1; /* module directly imported */
BITS unused: 20;
/*1*/ VTPOINTER module; /* module imported from */
/*2*/ VTPOINTER item; /* name of item imported */
}; /* three words */
/*
* Within a module, there is one IMPORT entry for each imported
* module, function, or variable. The item field is nil when an
* entire module is imported. Used only by Pascal/Modcal. Note
* that exported functions and variables have their public bits set.
*
* The "explicit" flag indicates the module was directly imported.
* When not set, the module was imported by an imported module.
*
* The IMPORT DNTT should be used only in the LNTT.
*/
struct DNTT_LABEL {
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* always K_LABEL */
BITS unused: 21;
/*1*/ VTPOINTER name; /* name of label */
/*2*/ SLTPOINTER address; /* code and text locations */
}; /* three words */
/*
* One LABEL is emitted for each source program statement label,
* referencing the matching physical line (SLT entry). An SLT
* pointer is used, instead of just a linenumber, so a code
* location is known for setting a breakpoint. This is the only
* case of SLTPOINTER that points to a normal (not special) SLT
* entry.
*
* If a label appears at the very end of a function (after all
* executable code), a normal SLT entry must be emitted for it
* anyway. In this case the SLT entry points to an exit (return)
* instruction.
*
* Numeric labels are named as the equivalent character string with
* no leading zeroes, except in those languages where the leading
* zeroes are significant (i.e. COBOL).
*
* The LABEL DNTT should be used only in the LNTT.
*/
/*
* ---- 5.3. STORAGE-CLASS ("NAME") DNTT ENTRIES
*/
struct DNTT_FPARAM {
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* always K_FPARAM */
BITS regparam: 1; /* 1 => REGTYPE, not DYNTYPE */
BITS indirect: 1; /* 1 => pass by reference */
BITS longaddr: 1; /* 1 => in long pointer space */
BITS copyparam: 1; /* 1 => Copied to a local */
/* only for fortran strings */
#ifdef CPLUSPLUS
BITS dflt: 1; /* default parameter value? */
BITS unused: 16;
#else
BITS unused: 17;
#endif
/*1*/ VTPOINTER name; /* name of parameter */
/*2*/ DYNTYPE location; /* where stored */
/*3*/ DNTTPOINTER type; /* type information */
/*4*/ DNTTPOINTER nextparam; /* next FPARAM, if any */
/*5*/ int misc; /* assorted uses */
}; /* six words */
/*
* FPARAMs are chained together in parameter list order (left to
* right) from every FUNCTION, ENTRY, or FUNCTYPE (see below), one
* for each parameter, whether or not the type is explicitly
* declared. For unnamed parameters, the FPARAM name is "*".
*
* "regparam" implies that the storage location given is to be
* interpreted as a REGTYPE, not a DYNTYPE, that is, the parameter
* was passed in a register.
*
* "indirect" implies that the storage location given contains a
* data pointer to the parameter described, not the parameter
* itself, due to a call by reference (Pascal VAR, for instance).
* In the case where a call-by-value parameter is too big to be
* passed in the parameter list (e.g., a copied-value parameter in
* Pascal), the "location" must be given as the actual (post-copy)
* location of the parameter.
*
* "longaddr" is meaningful only for varparams, and indicates that
* the storage location given contains a 64 bit PA-RISC long
* pointer. The long pointer could be in 2 consecutive words, or
* in the case of a regparam, two consecutive registers.
*
* "copyparam" implies that the parameter has been copied to a local,
* and thus the location is relative to the sp of the current procedure,
* not the sp of the previous procdeure.
*
* "misc" is for assorted values. Current uses are:
* (1) if the parameter is of type T_FTN_STRING_S300
* then the "misc" field contains the SP relative
* offset of the word containing the length of
* the string
*
* In the case of a FORTRAN routine with alternate entries, DNTT
* DVARs also must be emited for each parameter. The reason is
* that with FORTRAN alternate entries, the same parameter can
* be in two different entry's parameter lists, in a different
* location (ex. the parameter "x" in "subroutine a(x,y,z)" and
* "entry b(v,w,x)") and yet they both represent the same parameter.
* Thus in order to insure a consistant address for such parameters,
* the compiler allocates a local temporary, and the prologue code
* for each entry copies the parameters into the local temps. So, to
* insure that the debugger can find the parameters, a DNTT DVAR
* must be generated for each temporary, with the name of the DVAR
* being the name of the FPARAM for which the temp. was allocated.
*
* The FPARAM DNTT should be used only in the LNTT.
*/
struct DNTT_SVAR {
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* always K_SVAR */
BITS public: 1; /* 1 => globally visible */
BITS indirect: 1; /* 1 => pointer to object */
BITS longaddr: 1; /* 1 => in long pointer space */
#ifdef CPLUSPLUS
BITS staticmem: 1; /* 1 => member of a class */
BITS a_union: 1; /* 1 => anonymous union member */
BITS unused: 16;
#else
BITS unused: 18;
#endif
/*1*/ VTPOINTER name; /* name of object (variable) */
/*2*/ STATTYPE location; /* where stored (allocated) */
/*3*/ DNTTPOINTER type; /* type information */
/*4*/ unsigned long offset; /* post indirection byte offset */
/*5*/ unsigned long displacement; /* pre indirection byte offset */
}; /* six words */
struct DNTT_DVAR {
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* always K_DVAR */
BITS public: 1; /* 1 => globally visible */
BITS indirect: 1; /* 1 => pointer to object */
BITS regvar: 1; /* 1 => REGTYPE, not DYNTYPE */
#ifdef CPLUSPLUS
BITS a_union: 1; /* 1 => anonymous union member */
BITS unused: 17;
#else
BITS unused: 18;
#endif
/*1*/ VTPOINTER name; /* name of object (variable) */
/*2*/ DYNTYPE location; /* where stored (allocated) */
/*3*/ DNTTPOINTER type; /* type information */
/*4*/ unsigned long offset; /* post indirection byte offset */
/* for use in cobol structures */
}; /* five words */
/*
* SVARs describe static variables (with respect to storage, not
* visibility) and DVARs describe dynamic variables, and also
* describe register variables. Note that SVARs have an extra
* word, "offset", not needed for the other types. This provides
* for direct data which is indexed from a base, and indirect data
* which is accessed through a pointer, then indexed.
* The "location" field of an SVAR will require a fixup. An
* example of when the offset field can be useful, is a FORTRAN
* common block. In a common block declaration such as "common
* /marx/ groucho, harpo, chico", the symbol "marx" is the only
* global symbol. If "marx" is accessed indirectly, then the
* address of "harpo" would contain the address of "marx" in the
* location field (with the indirect bit on), and the offset of
* "harpo" from "marx" in the offset field. If "marx" is not
* indirect, then location field can be filled in by a fixup of the
* form address(marx) + offset of harpo, and the offset field is
* not needed.
*
* The compilers must emit SVARs even for data objects the linker
* does not know about by name, such as variables in common blocks.
*
* As in the FPARAM entry, the longaddr field indicates the use
* of a PA-RISC long pointer, and is valid only if the indirect
* flag is true. The "regvar" field also has the same meaning as in
* the FPARAM case.
*
* For languages in which a functions return value is set by assigning
* the value to the function name (such as FORTRAN & Pascal), a DVAR
* entry should also be emitted for the function. The address of this
* DVAR for the function should be the address of the answer spot for
* the function. This will allow the user to display the current
* return value while the function is executing.
*
* For a FORTRAN subroutine with alternate entries, DNTT_DVARs are
* required to represent the parameters, see the DNTT_FPARAM
* definition for the details.
*
* The SVAR can be used in both the GNTT and LNTT, while the DVAR
* is only applicable to the LNTT.
*/
struct DNTT_CONST {
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* always K_CONST */
BITS public: 1; /* 1 => globally visible */
BITS indirect: 1; /* 1 => pointer to object */
LOCDESCTYPE locdesc: 3; /* meaning of location field */
#ifdef CPLUSPLUS
BITS classmem: 1; /* 1 => member of a class */
BITS unused: 15;
#else
BITS unused: 16;
#endif
/*1*/ VTPOINTER name; /* name of object */
/*2*/ STATTYPE location; /* where stored */
/*3*/ DNTTPOINTER type; /* type information */
/*4*/ unsigned long offset; /* post indirection byte offset */
/*5*/ unsigned long displacement; /* pre indirection byte offset */
}; /* six words */
/*
* The value of locdesc determines the meaning of location.
* Compilers are free to use any of the three types (LOC_IMMED,
* LOC_PTR, LOC_VT) as feasible and appropriate. They might, for
* example, merely dump all CONST values into the VT, with some
* redundancy, if they could do no better. Ideally, each compiler
* would use all three types according to whether the constant is
* stored in an immediate instruction (so a copy is needed here),
* in code or data space, or nowhere else, respectively.
*
* If locdesc == LOC_PTR, CONST is very much like an SVAR, and the
* indirect and offset values are relevant.
*
* The CONST DNTT can be used in both the GNTT and LNTT.
*/
/*
* ---- 5.4. TYPE-CLASS ("TYPE") DNTT ENTRIES
*/
struct DNTT_TYPE {
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* either K_TYPEDEF or K_TAGDEF */
BITS public: 1; /* 1 => globally visible */
BITS typeinfo: 1; /* 1 => type info available */
BITS unused: 19;
/*1*/ VTPOINTER name; /* name of type or tag */
/*2*/ DNTTPOINTER type; /* type information */
}; /* three words */
/*
* The DNTT_TYPE type is used for dtype and dtag entries. TYPEDEFs
* are just a way of remembering names associated with types
* declared in Pascal, via "type" sections, or in C, via "typedef"s.
* TAGDEFs are used for C "struct", "union", and "enum" tags, which
* may be named identically to "typedef"s in the same scope.
* TAGDEFs always point at STRUCTs, UNIONs, or ENUMs (see below),
* and provide a way to "hang" a name onto a subtree.
*
* Note that named types point directly to the underlying
* structures, not to intervening TYPEDEFs or TAGDEFs. Type
* information in TYPEDEFs and TAGDEFs point to the same structures
* independent of named instantiations of the types.
*
* For example:
* +
* typedef struct S { + typedef enum E { ... } EEE;
* ... +
* } *pS; +
*
* would generate something like this (shown graphically)
*
* TYPEDEF "pS" + TYPEDEF "EEE"
* | + |
* POINTER + TAG "E"
* | + |
* TAG "S" + ENUM
* | + |
* STRUCT + :
* | + :
* : +
* : +
*
* Note also that variables (of a named non-base type) must point to
* TYPEDEF or TAGDEF dntt, and not the underlying structures. If
* this is not done, the removal of duplicate global information is
* impossible.
*
* The "typeinfo" flag only applies to TAGDEFs. When not set, it is
* used to indicate that an underlying struct, union, or enum is
* named, but the actual type is not declared. In general,
* "typeinfo" will be set to 1. It will be set to a 0 if the type
* subtree is not available. Consider the C file:
*
* typedef struct s *Sptr;
* main(){}
*
* which is a valid compilation unit with "struct s" defined in
* another file. For this case, the "typeinfo" for TAGDEF "s" will
* be set to 0, and "type" points to a "nil" DNTT_STRUCT (i.e. a
* DNTT_STRUCT entry with its "firstfield", "vartagfield", and
* "varlist" fields set to DNTTNIL and its "declaration" and
* "bitlength" fields set to 0). Graphically:
*
* TYPEDEF "Sptr"
* |
* POINTER
* |
* TAG "s"
* |
* STRUCT
* \---<firstfield>---> DNTTNIL
* \--<vartagfield>--> DNTTNIL
* \-<varlist>------> DNTTNIL
* \- other fields > all set to 0
*
*
* Thus, whenever "typeinfo" is 0, "type" must point to an
* appropriate DNTT entry which has all its fields correctly NIL'ed.
* This applies to *named* DNTT_STRUCT's, DNTT_UNION's, and
* DNTT_ENUM's.
*
* The TYPEDEF and TAGDEF DNTTs may be used in both the GNTT and
* LNTT.
*
*/
struct DNTT_POINTER {
/*0*/ BITS extension: 1; /* always zero */
#ifdef CPLUSPLUS
KINDTYPE kind: 10; /* K_POINTER or K_REFERENCE */
#else
KINDTYPE kind: 10; /* always K_POINTER */
#endif
BITS unused: 21;
/*1*/ DNTTPOINTER pointsto; /* type of object */
/*2*/ unsigned long bitlength; /* size of pointer, not object */
}; /* three words */
struct DNTT_ENUM {
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* always K_ENUM */
BITS unused: 21;
/*1*/ DNTTPOINTER firstmem; /* first MEMENUM (member) */
/*2*/ unsigned long bitlength; /* packed size */
}; /* three words */
struct DNTT_MEMENUM {
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* always K_MEMENUM */
#ifdef CPLUSPLUS
BITS classmem: 1; /* 1 => member of a class */
BITS unused: 20;
#else
BITS unused: 21;
#endif
/*1*/ VTPOINTER name; /* name of member */
/*2*/ unsigned long value; /* equivalent number */
/*3*/ DNTTPOINTER nextmem; /* next MEMENUM, else ENUM type */
}; /* four words */
/*
* Each ENUM begins a chain of (name, value) pairs. The nextmem
* field of the last memenum, should be DNTT NIL. The POINTER,
* ENUM, and MEMENUM DNTTs can all be used in both the GNTT and
* LNTT.
*/
struct DNTT_SET {
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* always K_SET */
BITS declaration: 2; /* normal, packed, or crunched */
BITS unused: 19;
/*1*/ DNTTPOINTER subtype; /* type implies bounds of set */
/*2*/ unsigned long bitlength; /* packed size */
}; /* three words */
struct DNTT_SUBRANGE {
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* always K_SUBRANGE */
BITS dyn_low: 2; /* >0 => nonconstant low bound */
BITS dyn_high: 2; /* >0 => nonconstant high bound */
BITS unused: 17;
/*1*/ long lowbound; /* meaning depends on subtype */
/*2*/ long highbound; /* meaning depends on subtype */
/*3*/ DNTTPOINTER subtype; /* immediate type or ENUM */
/*4*/ unsigned long bitlength; /* packed size */
}; /* five words */
struct DNTT_ARRAY {
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* always K_ARRAY */
BITS declaration: 2; /* normal, packed, or crunched */
BITS dyn_low: 2; /* >0 => nonconstant low bound */
BITS dyn_high: 2; /* >0 => nonconstant high bound */
BITS arrayisbytes: 1; /* 1 => array size is in bytes */
BITS elemisbytes: 1; /* 1 => elem. size is in bytes */
BITS elemorder: 1; /* 0 => in increasing order */
BITS justified: 1; /* 0 => left justified */
BITS unused: 11;
/*1*/ unsigned long arraylength; /* size of whole array */
/*2*/ DNTTPOINTER indextype; /* how to index the array */
/*3*/ DNTTPOINTER elemtype; /* type of each array element */
/*4*/ unsigned long elemlength; /* size of one element */
}; /* five words */
/*
* The dyn_low and dyn_high fields are non-zero only if the
* DNTT_SUBRANGE is defining the range of an array index, otherwise
* they are always zero. The dyn_low and dyn_high bits are
* duplicated in the DNTT_SUBRANGE defining the range of the array
* index (so sllic can fix the pointers). "dyn_low" indicates
* whether the lower bound for the subscript of the array is
* dynamic. If the dyn_low field is zero, then the lowbound field
* of the DNTT_SUBRANGE entry, pointed to by the indextype field in
* the DNTT_ARRAY entry, is interpreted as a constant lower bound.
* If the dyn_low field is 1, then the lowbound field of the DNTT
* SUBRANGE is interpreted as a DYNTYPE giving a local address where
* the lower bound can be found. If the dyn_low field is 2, then
* the lowbound field of the DNTT_SUBRANGE is interpreted as a
* DNTTPOINTER to a variable whose value is the lower bound (needed
* if the lower bound is a static variable). The dyn_low value of 3
* is not used. The "dyn_high" bit has a similar meaning relating
* to the upper bound. If an upper bound for an array parameter is
* not given (like assumed size arrays in FORTRAN, or "char foo[]"
* in C) then the upper bound in the DNTT_SUBRANGE should be the
* largest integer that fits in a long integer, so that any value
* the user can give is legal.
*
* "arrayisbytes" indicates that the field "arraylength" contains
* the length in bytes rather then bits. This is needed on PA-RISC
* where an array could be up to 2**32 bytes. A value of zero for
* bitsize will be used to represent 2**32.
*
* "elemisbytes" indicates that the field "elemlength" contains the
* elem. length in bytes rather then bits. The "elemlength" field
* contains the not the "true" size of an array element, but the
* size allocated to each element within the array (the "true" size
* plus any wasted bits on the left or right). As an example for a
* Pascal array of a 13 bit structure, the array element size might
* equal 16, with the justified field equal to 0 to indicate the
* structure is left justified within the 16 bits. The "true" size
* of the structure would be found in the size field of the
* DNTT_STRUCT pointed to by the "elemtype" field of the DNTT_ARRAY.
*
* "indextype" typically points to a SUBRANGE for bounds.
* "elemtype" may point to another ARRAY for multi-dimensional
* arrays. Row or column precedence in the language is reflected in
* the order of the ARRAY entries on the chain. For example, in
* Pascal, which is row-precedent, an array declared [1..2, 3..4,
* 5..6] would result in "array 1..2 of array 3..4 of array 5..6 of
* ...". The same declaration in FORTRAN, which is
* column-precedent, would result in "array 5..6 of array 3..4 of
* array 1..2 of ...". This makes index-to-address conversion much
* easier. Either way an expression handler must know the
* precedence for the language.
*
* The SET, SUBRANGE, and ARRAY DNTTs can be used in both the GNTT
* and LNTT.
*/
struct DNTT_STRUCT {
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* always K_STRUCT */
BITS declaration: 2; /* normal, packed, or crunched */
BITS unused: 19;
/*1*/ DNTTPOINTER firstfield; /* first FIELD, if any */
/*2*/ DNTTPOINTER vartagfield; /* variant tag FIELD, or type */
/*3*/ DNTTPOINTER varlist; /* first VARIANT, if any */
/*4*/ unsigned long bitlength; /* total at this level */
}; /* five words */
/*
* The "declaration", "vartagfield", and "varlist" fields apply to
* Pascal/Modcal records only and are nil for record structures in
* other languages. If there is a tag, then the "vartagfield" points
* to the FIELD DNTT describing the tag. Otherwise, the "vartagfield"
* points to the tag type.
*
* The STRUCT DNTT may be used in both the GNTT and LNTT.
*/
struct DNTT_UNION {
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* always K_UNION */
BITS unused: 21;
/*1*/ DNTTPOINTER firstfield; /* first FIELD entry */
/*2*/ unsigned long bitlength; /* total at this level */
}; /* three words */
/*
* This type supports C unions only and is not used otherwise.
*
* Since STRUCTUREs and UNIONs are not packable inside of outer
* STRUCTUREs and UNIONs, their bitlengths tell their actual (not
* necessarily packed) size, according only as to how they are
* internally packed.
*
* The STRUCT DNTT may be used in both the GNTT and LNTT.
*/
struct DNTT_FIELD {
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* always K_FIELD */
#ifdef CPLUSPLUS
BITS visibility:2; /* pub = 0, prot = 1, priv = 2 */
BITS a_union: 1; /* 1 => anonymous union member */
#ifdef TEMPLATES
BITS staticMem: 1; /* 1 -> static member of a template */
BITS unused: 17;
#else /* TEMPLATES */
BITS unused: 18;
#endif /* TEMPLATES */
#else
BITS unused: 21;
#endif
/*1*/ VTPOINTER name; /* name of field, if any */
/*2*/ unsigned long bitoffset; /* of object itself in STRUCT */
/*3*/ DNTTPOINTER type; /* type information */
/*4*/ unsigned long bitlength; /* size at this level */
/*5*/ DNTTPOINTER nextfield; /* next FIELD in STRUCT, if any */
}; /* six words */
/*
* This type describes the fields in Pascal records and C
* structures and unions. The bitoffset is from the start of the
* STRUCT or UNION that started the chain, to the start of the
* object itself, ignoring any padding. Note that bitoffset
* does not have to be on a byte boundary. For unions, each
* bitoffset should be zero since all fields overlap.
*
* The bitlength field is the same as that of the type except for C
* bit fields, which may be a different size than the base type.
*
* The FIELD DNTT can be used in both the GNTT and LNTT.
*/
struct DNTT_VARIANT {
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* always K_VARIANT */
BITS unused: 21;
/*1*/ long lowvarvalue; /* meaning depends on vartype */
/*2*/ long hivarvalue; /* meaning depends on vartype */
/*3*/ DNTTPOINTER varstruct; /* this variant STRUCT, if any */
/*4*/ unsigned long bitoffset; /* of variant, in outer STRUCT */
/*5*/ DNTTPOINTER nextvar; /* next VARIANT, if any */
}; /* six words */
/*
* "varstruct" points to the STRUCT which in turn describes the
* contents of the variant. The latter might in turn point to
* VARIANTs of its own, and to FIELDs which point to other STRUCTs.
* "lowvarvalue" and "hivarvalue" are the range of values for which
* this variant applys; more than one dntt VARIANT may be necessary
* to describe the range (e.g., 'a'..'n','q':). A type field is un-
* necessary, as the type can be obtained from the "vartagfield"
* field of the STRUCT DNTT.
*
* The VARIANT DNTT can be used in both the GNTT and LNTT.
*/
struct DNTT_FILE {
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* always K_FILE */
BITS ispacked: 1; /* 1 => file is packed */
BITS unused: 20;
/*1*/ unsigned long bitlength; /* of whole element buffer */
/*2*/ unsigned long bitoffset; /* of current element in buffer */
/*3*/ DNTTPOINTER elemtype; /* type and size of of element */
}; /* four words */
/*
* Pascal/Modcal is the only language of interest with built-in file
* buffering. For Pascal/Modcal files, the symbol table tells the file
* element type, the sizes of the current element (via "elemtype")
* and the whole buffer (via "bitlength"), and the locations of the
* element buffer (from the parent "NAME" entry) and the element
* itself within the buffer, following header information (from
* "bitoffset").
*
* The FILE DNTT can be used in both the GNTT and LNTT.
*/
struct DNTT_FUNCTYPE {
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* always K_FUNCTYPE */
BITS varargs: 1; /* func-proto ellipses. */
BITS info: 4; /* lang-specific stuff; F_xxxx */
BITS unused: 16;
/*1*/ unsigned long bitlength; /* size of function pointer */
/*2*/ DNTTPOINTER firstparam; /* first FPARAM, if any */
/*3*/ DNTTPOINTER retval; /* return type, if any */
}; /* four words */
/*
* This type supports function variables in a limited way,
* including the parameter types (if any) and the return value type
* (if any).
*
* See DNTT_FUNC for discussion of various fields.
*
* The FUNCTYPE DNTT can be used in both the GNTT and LNTT.
*/
struct DNTT_COBSTRUCT {
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* always K_COBSTRUCT */
BITS hasoccurs: 1; /* descendant has OCCURS clause */
BITS istable: 1; /* is a table item? */
BITS unused: 19;
/*1*/ DNTTPOINTER parent; /* next higher data item */
/*2*/ DNTTPOINTER child; /* 1st descendant data item */
/*3*/ DNTTPOINTER sibling; /* next data item at this level */
/*4*/ DNTTPOINTER synonym; /* next data item w/ same name */
/*5*/ BITS catusage: 6; /* category or usage of item */
BITS pointloc: 8; /* location of decimal point */
BITS numdigits:10; /* number of digits */
BITS unused2: 8;
/*6*/ DNTTPOINTER table; /* array entry describing table */
/*7*/ VTPOINTER editpgm; /* name of edit subprogram */
/*8*/ unsigned long bitlength; /* size of item in bits */
}; /* nine words */
/*
* This entry is used to describe COBOL data items and table items.
* A Cobol variable will begin with a DNTT_SVAR, DNTT_DVAR, or DNTT_
* FPARAM whose "type" field is a DNTTPOINTER to a DNTT_COBSTRUCT.
*
* "parent", "child", "sibling", and "synonym" are DNTTPOINTER to
* other DNTT_SVAR, DNTT_DVAR, or DNTT_FPARAMs having these particular
* relationships with the current DNTT_COBSTRUCT (or are set to DNTTNIL
* if no such relationship exists).
*
* "hasoccurs" is set to 1 if the descendent of this COBOL element
* (pointed to by "child") has an OCCURS ... DEPENDING ON clause.
*
* "istable" is set to 1 if this COBOL data item is a table. In this
* case, "table" will point to a DNTT_ARRAY entry describing the table.
*
* The COBSTRUCT DNTT can be used in both the GNTT and LNTT.
*/
/*
* Used for C too so pulled out of ifdef CPLUSPLUS.
*/
struct DNTT_MODIFIER {
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* always K_MODIFIER */
BITS m_const: 1; /* const */
BITS m_static: 1; /* static */
BITS m_void: 1; /* void */
BITS m_volatile: 1; /* volatile */
BITS m_duplicate: 1; /* duplicate */
BITS unused: 16;
/*1*/ DNTTPOINTER type; /* subtype */
}; /* two words */
#ifdef CPLUSPLUS
struct DNTT_GENFIELD {
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* always K_GENFIELD */
BITS visibility: 2; /* pub = 0, prot = 1, priv = 2 */
BITS a_union: 1; /* 1 => anonymous union member */
BITS unused: 18;
/*1*/ DNTTPOINTER field; /* pointer to field or qualifier */
/*2*/ DNTTPOINTER nextfield; /* pointer to next field */
}; /* three words */
struct DNTT_MEMACCESS {
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* always K_MEMACCESS */
BITS unused: 21;
/*1*/ DNTTPOINTER classptr; /* pointer to base class */
/*2*/ DNTTPOINTER field; /* pointer field */
}; /* three words */
struct DNTT_VFUNC {
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* always K_VFUNCTION */
BITS pure: 1; /* pure virtual function ? */
BITS unused: 20;
/*1*/ DNTTPOINTER funcptr; /* function name */
/*2*/ unsigned long vtbl_offset; /* offset into vtbl for virtual */
}; /* three words */
struct DNTT_CLASS_SCOPE {
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* always K_CLASS_SCOPE */
BITS unused: 21;
/*1*/ SLTPOINTER address; /* pointer to SLT entry */
/*2*/ DNTTPOINTER type; /* pointer to class type DNTT */
}; /* three words */
struct DNTT_FRIEND_CLASS {
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* always K_FRIEND_CLASS */
BITS unused: 21;
/*1*/ DNTTPOINTER classptr; /* pointer to class DNTT */
/*2*/ DNTTPOINTER next; /* next DNTT_FRIEND */
}; /* three words */
struct DNTT_FRIEND_FUNC {
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* always K_FRIEND_FUNC */
BITS unused: 21;
/*1*/ DNTTPOINTER funcptr; /* pointer to function */
/*2*/ DNTTPOINTER classptr; /* pointer to class DNTT */
/*3*/ DNTTPOINTER next; /* next DNTT_FRIEND */
}; /* four words */
struct DNTT_CLASS {
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* always K_CLASS */
BITS abstract: 1; /* is this an abstract class? */
BITS class_decl: 2; /* 0=class,1=union,2=struct */
#ifdef TEMPLATES
BITS expansion: 1; /* 1=template expansion */
BITS unused: 17;
#else /* TEMPLATES */
BITS unused: 18;
#endif /* TEMPLATES */
/*1*/ DNTTPOINTER memberlist; /* ptr to chain of K_[GEN]FIELDs */
/*2*/ unsigned long vtbl_loc; /* offset in obj of ptr to vtbl */
/*3*/ DNTTPOINTER parentlist; /* ptr to K_INHERITANCE list */
/*4*/ unsigned long bitlength; /* total at this level */
/*5*/ DNTTPOINTER identlist; /* ptr to chain of class ident's */
/*6*/ DNTTPOINTER friendlist; /* ptr to K_FRIEND list */
#ifdef TEMPLATES
/*7*/ DNTTPOINTER templateptr; /* ptr to template */
/*8*/ DNTTPOINTER nextexp; /* ptr to next expansion */
#else /* TEMPLATES */
/*7*/ unsigned long future2;
/*8*/ unsigned long future3;
#endif /* TEMPLATES */
};
/* nine words */
#ifdef TEMPLATES
struct DNTT_TEMPLATE {
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* always K_TEMPLATE */
BITS abstract: 1; /* is this an abstract class? */
BITS class_decl: 2; /* 0=class,1=union,2=struct */
BITS unused: 18;
/*1*/ DNTTPOINTER memberlist; /* ptr to chain of K_[GEN]FIELDs */
/*2*/ long unused2; /* offset in obj of ptr to vtbl */
/*3*/ DNTTPOINTER parentlist; /* ptr to K_INHERITANCE list */
/*4*/ unsigned long bitlength; /* total at this level */
/*5*/ DNTTPOINTER identlist; /* ptr to chain of class ident's */
/*6*/ DNTTPOINTER friendlist; /* ptr to K_FRIEND list */
/*7*/ DNTTPOINTER arglist; /* ptr to argument list */
/*8*/ DNTTPOINTER expansions; /* ptr to expansion list */
};
/*
* DNTT_TEMPLATEs only appear in the GNTT. Functions and
* classes templates cannot be local. (Their instantions may be).
*/
struct DNTT_TEMPL_ARG {
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* always K_TEMPL_ARG */
BITS usagetype:1; /* 0 type-name 1 expression */
BITS unused: 20;
/*1*/ VTPOINTER name; /* name of argument */
/*2*/ DNTTPOINTER type; /* for non type arguments */
/*3*/ DNTTPOINTER nextarg; /* Next argument if any */
/*4*/ long unused2[2];
}; /* 6 words */
/*
* Pxdb fills in the prevexp, and nextexp in the
* DNTT_CLASS. Pxdb also fills in the expansions field in the
* DNTT_TEMPLATE.
*/
#endif /* TEMPLATES */
struct DNTT_PTRMEM {
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* K_PTRMEM or K_PTRMEMFUNC */
BITS unused: 21;
/*1*/ DNTTPOINTER pointsto; /* pointer to class DNTT */
/*2*/ DNTTPOINTER memtype; /* type of member */
}; /* three words */
struct DNTT_INHERITANCE {
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* K_INHERITANCE */
BITS Virtual: 1; /* virtual base class ? */
BITS visibility: 2; /* pub = 0, prot = 1, priv = 2 */
BITS unused: 18;
/*1*/ DNTTPOINTER classname; /* first parent class, if any */
/*2*/ unsigned long offset; /* offset to start of base class */
/*3*/ DNTTPOINTER next; /* pointer to next K_INHERITANCE */
}; /* four words */
struct DNTT_OBJECT_ID {
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* K_OBJECT_ID */
BITS unused: 21;
/*1*/ unsigned long object_ident; /* object identifier */
/*2*/ unsigned long offset; /* offset to start of base class */
/*3*/ DNTTPOINTER next; /* pointer to next K_OBJECT_ID */
/*4*/ unsigned long segoffset; /* for linker fixup */
}; /* five words */
#endif
/*
* DNTT_XREF ENTRY:
* This entry is used to retrieve cross-reference information from
* the XREF Table (XT). A DNTT_XREF entry immediately follows the
* DNTT_SVAR, DNTT_DVAR, DNTT_TYPE, etc. entry to which it pertains.
*
* The XREFPOINTER points into the XT table where the information
* about the previous DNTT entry is contained. If no entries are
* generated in the XT table, the xreflist field should contain
* XREFNIL. The language field contains the source language
* (LANG_xxx) value of the DNTT object.
*
* The XREF DNTT can be used in both the GNTT and LNTT.
*/
struct DNTT_XREF {
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* always K_XREF */
BITS language: 4; /* language of DNTT object */
BITS unused: 17;
/*1*/ XREFPOINTER xreflist; /* index into XREF subspace */
/*2*/ long extra; /* free */
}; /* three words */
/*
* DNTT_SA ENTRY:
* This entry is used with static analysis info. It supplies the
* name and kind for a few special cases not currently handled by a
* DNTT_SVAR, DNTT_DVAR, DNTT_TYPE, etc. It is used for a local
* entity that has a global scope.
*
* Example: a function, has a DNTT_FUNCTION entry in the LNTT;
* but it can be seen globally, thus a K_SA will be emitted in
* the GNTT, with the functions name and a base_kind of K_FUNCTION;
* the DNTT_XREF will follow the DNTT_SA, not the DNTT_FUNCTION.
*
* The DNTT_SA is also used for C macros.
*
* The XREF DNTT can be used in both the GNTT and LNTT.
*/
struct DNTT_SA {
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* always K_SA */
KINDTYPE base_kind:10; /* K_FUNCTION, K_LABEL, etc */
BITS unused: 11;
/*1*/ VTPOINTER name;
/*2*/ long extra; /* free */
}; /* three words */
/*
* ---- 5.5. OVERALL DNTT ENTRY FORMAT
*/
/*
* Generic entry for easy access:
*/
struct DNTT_GENERIC { /* rounded up to whole number of blocks */
unsigned long word [9];
};
struct DNTT_BLOCK { /* easy way to deal with one block */
/*0*/ BITS extension: 1; /* always zero */
KINDTYPE kind: 10; /* kind of dnttentry */
BITS unused: 21;
/*1*/ unsigned long word [2];
};
/*
* Overall format:
*/
union dnttentry {
struct DNTT_SRCFILE dsfile;
struct DNTT_MODULE dmodule;
struct DNTT_FUNC dfunc;
struct DNTT_FUNC dentry;
struct DNTT_FUNC dblockdata;
struct DNTT_BEGIN dbegin;
struct DNTT_END dend;
struct DNTT_IMPORT dimport;
struct DNTT_LABEL dlabel;
struct DNTT_WITH dwith;
struct DNTT_COMMON dcommon;
struct DNTT_FPARAM dfparam;
struct DNTT_SVAR dsvar;
struct DNTT_DVAR ddvar;
struct DNTT_CONST dconst;
struct DNTT_TYPE dtype;
struct DNTT_TYPE dtag;
struct DNTT_POINTER dptr;
struct DNTT_ENUM denum;
struct DNTT_MEMENUM dmember;
struct DNTT_SET dset;
struct DNTT_SUBRANGE dsubr;
struct DNTT_ARRAY darray;
struct DNTT_STRUCT dstruct;
struct DNTT_UNION dunion;
struct DNTT_FIELD dfield;
struct DNTT_VARIANT dvariant;
struct DNTT_FILE dfile;
struct DNTT_FUNCTYPE dfunctype;
struct DNTT_COBSTRUCT dcobstruct;
#ifdef CPLUSPLUS
struct DNTT_CLASS_SCOPE dclass_scope;
struct DNTT_POINTER dreference;
struct DNTT_PTRMEM dptrmem;
struct DNTT_PTRMEM dptrmemfunc;
struct DNTT_CLASS dclass;
struct DNTT_GENFIELD dgenfield;
struct DNTT_VFUNC dvfunc;
struct DNTT_MEMACCESS dmemaccess;
struct DNTT_INHERITANCE dinheritance;
struct DNTT_FRIEND_CLASS dfriend_class;
struct DNTT_FRIEND_FUNC dfriend_func;
struct DNTT_MODIFIER dmodifier;
struct DNTT_OBJECT_ID dobject_id;
struct DNTT_FUNC dmemfunc;
#ifdef TEMPLATES
struct DNTT_TEMPLATE dtemplate;
struct DNTT_TEMPL_ARG dtempl_arg;
struct DNTT_FUNC_TEMPLATE dfunctempl;
struct DNTT_LINK dlink; /* generic */
struct DNTT_TFUNC_LINK dtflink;
#endif /* TEMPLATES */
#endif
struct DNTT_XREF dxref;
struct DNTT_SA dsa;
struct DNTT_GENERIC dgeneric;
struct DNTT_BLOCK dblock;
};
/*
* ---- 6. SOURCE LINE TABLE (SLT) ENTRY FORMAT
*/
/*
* Type of SLT special entry:
*
* Sizeof (SLTTYPE) = 4 bits, for a maximum of 16 possible special
* slttypes. Note that SLT_NIL is the same as SLTNIL.
*/
typedef unsigned int SLTTYPE;
#define SLT_NIL SLTNIL
#define SLT_NORMAL 0 /* note that the field is unsigned */
#define SLT_SRCFILE 1
#define SLT_MODULE 2
#define SLT_FUNCTION 3
#define SLT_ENTRY 4
#define SLT_BEGIN 5
#define SLT_END 6
#define SLT_WITH 7
#define SLT_EXIT 8
#define SLT_ASSIST 9
#define SLT_MARKER 10
#ifdef CPLUSPLUS
#define SLT_CLASS_SCOPE 11
#endif
struct SLT_NORM {
SLTTYPE sltdesc: 4; /* always zero */
BITS line: 28; /* where in source text */
ADDRESS address; /* where in function */
}; /* two words */
struct SLT_SPEC {
SLTTYPE sltdesc: 4; /* special entry type */
BITS line: 28; /* where in source text */
DNTTPOINTER backptr; /* where in DNTT */
}; /* two words */
struct SLT_ASST {
SLTTYPE sltdesc: 4; /* always nine */
BITS unused: 28;
SLTPOINTER address; /* first SLT normal */
}; /* two words */
struct SLT_GENERIC {
unsigned long word[2];
}; /* two words */
union sltentry {
struct SLT_NORM snorm;
struct SLT_SPEC sspec;
struct SLT_ASST sasst;
struct SLT_GENERIC sgeneric;
}; /* two words */
#define SLTBLOCKSIZE 8
#define SLT_LN_PROLOGUE 0x0fffffff
/*
* This table consists of a series of entries, each of which is
* either normal, special, or assist according to the sltdesc field
* of the first word. Normal entries contain an address (actually
* a code offset relative to the beginning of the current function)
* and a source/listing line (by line number). Listing line numbers
* may be used in place of source line numbers based upon a compiler
* option. This will also be reflected in the DNTT_SRCFLE entries.
* Special entries also provide a line number (where something was
* declared) and point back to the DNTT which references them. This
* is used for quick determination of scope, including source/listing
* file, after an interrupt. Even if there are multiple source/listing
* files, all source/listing line information is accumulated in this
* one table.
*
* The SLT was originally designed to be unnested, even for those
* languages whose LNTT must reflect their nesting. The debuggers
* depend upon this. For those languages that are nested the SLT
* must now be nested and an SLT_ASST must immediately follow each
* SLT_SPEC of type FUNC. The "address" field will be filled in by
* the compiler back-ends to point forward to the first SLT_NORM in
* the FUNC's scope. The "firstnorm" is set to one if this SLT_NORM
* is the first SLT_NORM looking sequentially forward in the SLT.
*
* The one exception to the normal/special/assist rule is the EXIT SLT.
* The EXIT SLT is used to identify exit points for a routine. The
* EXIT SLT is a special only in the sense that the sltdesc field
* is not equal to SLT_NORMAL. However, it contains a line number
* and address like a normal SLT. The EXIT SLT is used in place of
* a NORMAL SLT for all exit statements (such as "return" in C and
* FORTRAN, or the "end" of a procedure body in Pascal).
*
* The SLT_MARKER is for use in "Chunk-Per-Som". The address field
* contains a new base address (replacing the current procedure's
* low-address field. This new base address will be added to succeding
* SLT_NORMALs and SLT_EXITs to produce an absolute address.
*
* To distinguish prologue (function setup) code emitted at the END
* of a function from the last line (normal SLT) of the function, a
* normal SLT entry with a line number of SLT_LN_PRLOGUE is used.
* Such SLT entries are only emitted if there is trailing prologue
* code, and they are always the last SLT emitted for the function
* except for the special SLT entry for the function END. For com-
* pilers that emit the prologue code before the main body, no
* special prologue SLT entry is required.
*
* One SLT entry is emitted for (the FIRST physical line of) each
* executable statement, for each construct that generates a DNTT
* entry which points to an SLT entry, and for the prologue code,
* if any. The user cannot set a breakpoint without a corresponding
* SLT entry. Compilers must emit multiple SLT entries for parts
* of a composite statement (such as FOR) and for multiple statements
* appearing on one source line.
*
* For compatibility, the high bits of DNTTPOINTERs in SLT entries
* are also set to 1, even though they are not needed here.
*
* The global bit on DNTTPOINTERs in SLT entries should always be 0,
* as the LNTT contains all the scoping information.
*/
/*
* ---- 7. VALUE TABLE (VT) ENTRY FORMAT
*
*
* This table contains symbol names plus values for DNTT_CONST
* entries of type LOC_VT. All strings are null-terminated, as in C.
* There are no restrictions on the lengths of values nor the order
* in which they may appear. All symbol names are exactly as given
* by the user, e.g. there are no prepended underscores.
*
* CONST values are not (and need not be) terminated in any way.
* They may be forced to word boundaries if necessary, with
* resulting wasted bytes.
*
* The first byte of the table must be zero (a null string
* terminator), so that the null VTPOINTER results in a null name.
*/
/*
* ---- 8. XREF TABLE (XT) ENTRY FORMAT
*
* This table contains static information about each named object in
* a compilation unit. It consists of a collection of of lists,
* each list associated with a DNTT object via the DNTT_XREF that
* follows the object. The DNTT_XREF contains an XREFPOINTER which
* is an offset into the XT table, and denotes the beginning of the
* reference list.
*
* Each list is actually one or more of linear sub-list that are
* linked together. Each sublist begins with an XREFNAME entry,
* which names a (current) source file. Following the XREFNAME is
* one or more XREFINFO entries, one for each appearance of the
* object's name in the current file. These entries list what type
* of reference and the line no. within the file. Column numbers
* are currently unsupported. The XREFINFO1 structure is normally
* used. The XREFINFO2A/B structure pair is only used for compilers
* which support line numbers greater than 16 bits long. An
* XREFLINK marks the end of a sublist, so a typical sequence looks
* like:
*
* XREFNAME, XREFINFO1, XREFINFO1, ... , XREFLINK
*
* Note that all elements of a sublist must appear in sequence
* (linearly). If the list must be continued, the XREFLINK serves
* as a continuation pointer from one sublist to the next, and
* contains another offset into the XT where the next sublist is
* found for the same named object. If there is no additional
* sublist, the XREFLINK contains a 0 index, denoting the end of the
* current list.
*
* Lists for the same named object may appear in different
* compilation units. It is the responsibility of PXDB to link
* these together.
*
*/
#define XTBLOCKSIZE 4
#define XINFO1 0
#define XINFO2 1
#define XLINK 2
#define XNAME 3
struct XREFINFO1 {
BITS tag: 3; /* always XINFO1 */
BITS definition: 1; /* True => definition */
BITS declaration: 1; /* True => declaration */
BITS modification: 1; /* True => modification */
BITS use: 1; /* True => use */
BITS call: 1; /* True => call */
BITS column: 8; /* Unsigned Byte for Column within line */
BITS line: 16; /* Unsigned 16-bits for line # relative */
/* to beginning of current inlude file. */
};
struct XREFINFO2A {
/* first word */
BITS tag: 3; /* always XINFO2A */
BITS definition: 1; /* True => definition */
BITS declaration: 1; /* True => declaration */
BITS modification: 1; /* True => modification */
BITS use: 1; /* True => use */
BITS call: 1; /* True => call */
BITS extra: 16; /* ? */
BITS column: 8; /* ? */
};
struct XREFINFO2B {
/* second word */
BITS line: 32; /* Unsigned 32-bits for line # relative */
/* to beginning of current file. */
};
struct XREFLINK {
BITS tag: 3; /* always XLINK for XREFLINK */
BITS next: 29; /* index of next list. If */
/* zero then this is the end of line. */
/* a.k.a. continuation pointer */
};
struct XREFNAME {
BITS tag: 3; /* always XNAME for XREFNAME */
BITS filename: 29; /* VTPOINTER to file name */
};
union xrefentry {
struct XREFINFO1 xrefshort;
struct XREFINFO2A xreflong;
struct XREFINFO2B xrefline;
struct XREFLINK xlink;
struct XREFNAME xfname;
};
/*
* ---- 9. ORDERING OF TABLE ENTRIES
*
*
* LNTT and SLT entries must be emitted and kept in source file
* order wherever possible. As a minimum, named LNTT entries must
* be emitted and kept within the proper scope, though some
* compilers may emit them at the end of a scope instead of the
* beginning. In general, the debugger must know the emission
* rules for the language it is dealing with, and search the LNTT
* accordingly, or else always search in both directions.
*
* Items in the GNTT are all global, so the public bit must always
* be set. Within the LNTT, the public bit indicates that the item
* is exported by the module in which it resides, and is visible
* within a module or procedure that imports the containing module.
*
* Compilers and linkers are encouraged to make multiple references
* to DNTT, SLT, and VT entries (even chains of DNTT entries) where
* possible to reduce redundancy with no loss of data. They are
* also encouraged to emit entries grouped so that related entries
* are physically close, as long as no scope rules are violated.
*
* SLT entries must be emitted in sorted line number order within
* each file, except for special SLT entries for ENTRYs and
* FUNCTIONs only. They may be out of line number order (due to
* nested functions, etc.) so long as the next normal SLT entry is
* the proper place to breakpoint the entity. For example, there
* can be numerous ENTRY types after a FUNCTION, all referring to
* the same code location. (If there are no normal SLT entries
* before the next FUNCTION or MODULE entry and a SLT_ASST does not
* immediately follow the SLT_SPEC for a FUNC, the entity has no
* breakpointable locations.)
*
* SLT entries must be sorted in ascending code address order
* WITHIN EACH MODULE or FUNCTION body. It is impossible to
* require that they be sorted both by file line number and code
* address because function object code may be emitted or linked
* out of source order in a segment.
*
* It is reasonable to expect sequential SLT entries may have the
* same line numbers or code locations (but not both, as that would
* be redundant). This might be due to multiple statements on one
* source line or several scope levels starting at one place in the
* code.
*
* Thus, for nested languages like Pascal and Modcal, the LNTT
* entries must be nested to reflect the program's scope. The SLT
* entries should also be nested with an SLT_ASST entry following
* each SLT_SPEC of type FUNC.
*/
/*
* ---- 10. LINKER CONSIDERATIONS
*
* As stated earlier, all fixups to the debug information are
* done through the generation of a list of fixups for the GNTT
* and LNTT subspaces within the debug space. Other than these
* fixups, the only other task for the linker is the concatenation
* of the debug spaces from separate compilation units.
*/
/*
* --- 11. PREPROCESSOR
*/
/*
* The preprocessor (PXDB) which must be run on the debug info in
* the executable program file massages this debug info so that the
* debugger may start up and run more efficiently. Some of the
* tasks performed by PXDB are: remove duplicate global type and
* variable information from the GNTT, append the GNTT onto the end
* of the LNTT and place both back in the LNTT section, build quick
* look-up tables for files, procedures, modules, and paragraphs
* (for Cobol), placing these in the GNTT section, and reconstruct
* the header appearing in the header section to access this
* information.
*
* This post-PXDB header is as follows:
*/
struct PXDB_header {
int pd_entries; /* # of entries in function look-up table */
int fd_entries; /* # of entries in file look-up table */
int md_entries; /* # of entries in module look-up table */
BITS pxdbed : 1; /* 1 => file has been preprocessed */
BITS bighdr : 1; /* 1 => this header contains 'time' word */
BITS sa_header : 1;/* 1 => created by SA version of pxdb */
/* used for version check in xdb */
#ifdef CPLUSPLUS
BITS inlined: 1; /* one or more functions have been inlined */
BITS spare:12;
short version; /* pxdb header version */
#else /* CPLUSPLUS */
BITS spare:29;
#endif /* CPLUSPLUS */
int globals; /* index into the DNTT where GNTT begins */
BITS time; /* modify time of file before being pxdbed */
int pg_entries; /* # of entries in label look-up table */
int functions; /* actual number of functions */
int files; /* actual number of files */
#ifdef CPLUSPLUS
int cd_entries; /* # of entries in class look-up table */
int aa_entries; /* # of entries in addr alias look-up table */
int oi_entries; /* # of entries in object id look-up table */
#endif
};
#define PXDB_VERSION_CPLUSPLUS 1
#define PXDB_VERSION_7_4 2
#define PXDB_VERSION_CPP_30 3
#define PXDB_VERSION_2_1 1
/*
* The structures for the quick look-up tables in the
* post-PXDB GNTT section are:
*/
/*
* Source File Descriptor:
*
* An element of the source file quick look-up table
*/
typedef struct FDS {
long isym; /* first symbol for file */
ADRT adrStart; /* mem adr of start of file's code */
ADRT adrEnd; /* mem adr of end of file's code */
char *sbFile; /* name of source file */
BITS fHasDecl: 1; /* do we have a .d file? */
BITS fWarned: 1; /* have warned about age problems? */
unsigned short ilnMac; /* lines in file (0 if don't know) */
int ipd; /* first proc for file, in PD [] */
BITS *rgLn; /* line pointer array, if any */
} FDR, *pFDR;
/*
* Procedure Descriptor:
*
* An element of the procedure quick look-up table
*/
typedef struct PDS {
long isym; /* first symbol for proc */
ADRT adrStart; /* memory adr of start of proc */
ADRT adrEnd; /* memory adr of end of proc */
char *sbAlias; /* alias name of procedure */
char *sbProc; /* real name of procedure */
ADRT adrBp; /* address of entry breakpoint */
ADRT adrExitBp; /* address of exit breakpoint */
#ifdef CPLUSPLUS
int icd; /* member of this class */
#else /* CPLUSPLUS */
BITS inst; /* instruction at entry */
#endif /* CPLUSPLUS */
#ifdef TEMPLATES
BITS ipd; /* index of template for this function */
#else /* TEMPLATES */
BITS instExit; /* instruction at exit */
#endif /* TEMPLATES */
#ifdef CPLUSPLUS
#ifdef TEMPLATES
BITS unused: 6;
BITS fTemplate: 1; /* function template */
BITS fExpansion: 1; /* function expansion */
BITS linked : 1; /* linked with other expansions */
#else /* TEMPLATES */
BITS unused: 9;
#endif /* TEMPLATES */
BITS duplicate: 1; /* clone of another procedure */
BITS overloaded:1; /* overloaded function */
BITS member: 1; /* class member function */
BITS constructor:1; /* constructor function */
BITS destructor:1; /* destructor function */
BITS Static: 1; /* static function */
BITS Virtual: 1; /* virtual function */
BITS constant: 1; /* constant function */
BITS pure: 1; /* pure (virtual) function */
BITS language: 4; /* procedure's language */
BITS inlined: 1; /* function has been inlined */
BITS Operator: 1; /* operator function */
BITS stub: 1; /* bodyless function */
#else
BITS unused1: 18;
BITS language: 4; /* procedure's language */
BITS unused2: 3;
#endif
BITS optimize: 2; /* optimization level */
BITS level: 5; /* nesting level (top=0) */
} PDR, *pPDR;
/*
* Module Descriptor:
*
* An element of the module quick reference table
*/
typedef struct MDS {
long isym; /* first symbol for module */
ADRT adrStart; /* adr of start of mod. */
ADRT adrEnd; /* adr of end of mod. */
char *sbAlias; /* alias name of module */
char *sbMod; /* real name of module */
BITS imports: 1; /* module have any imports? */
BITS vars_in_front: 1; /* module globals in front? */
BITS vars_in_gaps: 1; /* module globals in gaps? */
BITS unused : 29;
BITS unused2; /* space for future stuff */
} MDR, *pMDR;
/*
* Paragraph Descriptor:
*
* An element of the paragraph quick look-up table
*/
typedef struct PGS {
long isym; /* first symbol for label */
ADRT adrStart; /* memory adr of start of label */
ADRT adrEnd; /* memory adr of end of label */
char *sbLab; /* name of label */
BITS inst; /* Used in xdb to store inst @ bp */
BITS sect: 1; /* true = section, false = parag. */
BITS unused: 31; /* future use */
} PGR, *pPGR;
#ifdef CPLUSPLUS
/*
* Class Descriptor:
*
* An element of the class quick look-up table
*/
typedef struct CDS {
char *sbClass; /* name of class */
long isym; /* class symbol (tag) */
BITS type : 2; /* 0=class, 1=union, 2=struct */
#ifdef TEMPLATES
BITS fTemplate : 1;/* class template */
BITS expansion : 1;/* template expansion */
BITS unused :28;
#else /* TEMPLATES */
BITS unused : 30;
#endif /* TEMPLATES */
SLTPOINTER lowscope; /* beginning of defined scope */
SLTPOINTER hiscope; /* end of defined scope */
} CDR, *pCDR;
/*
* Address Alias Entry
*
* An element of the address alias quick look-up table
*/
typedef struct AAS {
ADRT low;
ADRT high;
int index;
BITS unused : 31;
BITS alternate : 1; /* alternate unnamed aliases? */
} AAR, *pAAR;
/*
* Object Identification Entry
*
* An element of the object identification quick look-up table
*/
typedef struct OIS {
ADRT obj_ident; /* class identifier */
long isym; /* class symbol */
long offset; /* offset to object start */
} OIR, *pOIR;
#endif /*CPLUSPLUS*/
#if __cplusplus
#undef public
#endif
#endif /* _SYMTAB_INCLUDED */
|