aboutsummaryrefslogtreecommitdiff
path: root/gdb/=rt-changes
blob: 1eda81c8df43ca480875bad00f2eb8f993a7f94d (plain)
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
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
From: zs01#@andrew.cmu.edu (Zalman Stern)
Date: Sun, 24 May 87 03:20:57 edt
To: rms@prep.ai.mit.edu
Subject: RT diffs for gdb version 2.1

Here are the new files, followed by the diffs to old files. The first file below
is ITCMODS which is my attempt to document some of our changes. Unfortunately,
it has not been maintained particularly well and notably does not include info
about our changes to support the HIGH-C compiler. One big change we put in was
to use a number of initialize routines instead of the "linked list of object
modules" that is used on other machines. The RT object file format appears to
have a variable size header before the code, making it very difficult
(impossible?) to get the initialization stuff to work. If you have any
questions, don't hesitate to send me mail.

-Z-

Only in .: ITCMODS

blockframe.c:
    set_current_frame now takes an extra argument.
    RT specific code for interpreting and caching of trace table entries.
    Added initialize routine.

breakpoint.c:
    Added new_breakpoint_commands flag to prevent incorrect interpretation of command lists containing a continue statement.
    Modified do_breakpoint_commands to know about new_breakpoint_commands.
    Modified clear_breakpoint_commands to set new_breakpoint_commands.
    Added initialize routine.

core.c:
    RT specific code to find the uarea.
    RT specific code to indicate the start of the data segment.
    set_current_frame now takes an extra argument.
    Added initialize routine.

dbxread.c:
    Added support for the Camphor dynamic loading system. (All under #ifdef CAMPHOR).
    Fix for multiple declarations of register variables (i.e. they are declared twice). The fix munges the incorrect declaration (i.e. the one which is not register).
    set_rel_command to set relocation offset for camphor loaded files. (Under #ifdef CAMPHOR).
    add_file_command to append a file's symbols to the current symbol table instead of replacing it. (Under #ifdef CAMPHOR).
    RT specific code to deal with function names being _.foo instead of _foo.
    Added initialize routine.

    Feb 8, 1987 Zalman Stern.
        Added test in symbol_file_command to see if file was compiled with debugging. If not print an error message instead of dumping core.
        Added same test in add_file_command and made it run through BZPATH, CLASSPATH, and PATH in that order (Under #ifdef CAMPHOR).

environ.c:
    Fixed error in calculating new size of a reallocated environment.

eval.c:
    Added initialize routine.

expread.y:
    Moved alloca call out of variable initializations.

findvar.c:
    Added initialize routine.

firstfile.c:
    Added main initialization driver routine.

frame.h:
    Added RT specific declarations to hold frame information, and to deal with trace table caching.

ibm032-pinsn.c:
    New file, contains RT disassembler.

ibm032-opcode.h:
    New file, contains RT opcode definitions.

infcmd.c
    Changed code to use csh instead of sh to avoid the anoyance of the environment bug.
    Added initialize routine.

inflow.c:
    Added initialize routine.

infrun.c:
    set_current_frame now takes an extra argument.
    Added some code to deal with stopping in the middle of a camphor link. (Under #ifdef CAMPHOR).
    Added RT specific code to get the return values from the right registers. Replaces code that was there for RT.
    RT specific code to do a "POP_DUMMY_FRAME." Dummy frames are to store more complete state than a normal frame. Makes calling a function in inferior more reliable. Perhaps this should be expanded to other machine types.
    Added initialize routine.

    Feb 9, 1987 Zalman Stern.
        Added call to select_frame after popping a stack dummy frame in normal_stop. This fixes the bug where you could not print variables without doing a "frame 0" after printing an expression with a function call in it.

iniitialize.h:
    Changed file to use #ifdef's for machine type. Allows one to use same sources for different machines.

m-ibm032.h:
    New file, contains RT specific macros and variables.

param.h:
    Changed file to use #ifdef's for machine type. Allows one to use same sources for different machines.

pinsn.c:
    Changed file to use #ifdef's for machine type. Allows one to use same sources for different machines.

printcmd.c:
    Moved alloca calls out of variable initialization.
    Added initialize routine.

source.c:
    Added initialize routine.

stack.c:
    Added initialize routine.

symmisc.c:
    Added initialize routine.

symtab.c:
    RT specific code to deal with function names being _.foo instead of _foo.
    Added initialize routine.

utils.c:
    Added comment.

valarith.c:
    Added initialize routine.

valops.c:
    Added initialize routine.

valprint.c:
    Added initialize routine.

values.c:
    Added initialize routine.

Only in .: ibm032-opcode.h

/* The opcode table consists of a 256 element array containing an
 * instruction mnemonic and an instruction type field. This can be
 * indexed directly by the first eight bits of an RT instruction.
 * The instruction type consists of a type field and some flags. 
 * In addition to this, there is an ifdef'd out "instruction" table
 * at the end of the file. This is an alphabetical listing of the instructions
 * containing mnemonic, opcode, and type. This is useful for modification
 * purposes. There is also some code in the ifdef to convert the
 * instruction table into an opcode table.
 */

/* Various useful bit masks. */
#define ibm032_typeMask		0x0f /* Mask to get actual type info out of instruction type. */
#define LOW4			0x0f
#define HIGH4			0xf0
#define LOW16			0x0000ffff
#define HIGH16			0xffff0000
#define LOW20			0x000fffff
#define LOW24			0x00ffffff

/* Instruction types consist of a type id in the low 4 bits and flags above that. */

/* Flags. */
#define ibm032_conditional 	0x10
#define ibm032_negative		0x20

/* Format types. */
#define ibm032_JI	0x0	/* Jump immediate. */
#define ibm032_X	0x1	/* ??? */

/* These next ones are in a special bit position. Do not change their defines. */
#define ibm032_DS0	0x2	/* Data short with no shift for immediate value. */
#define ibm032_DS1	0x3	/* Data short with 1 bit shift for immediate value. */
#define ibm032_DS2	0x4	/* Data short with 2 bit shift for immediate value */
#define ibm032_DSShiftOffset	ibm032_DS0 /* Offset to get shift value from ibm032_DS? types. */

#define ibm032_RR	0x5	/* R format where second argument is a register */
#define ibm032_RI	0x6	/* R format where second argument is 4 bit immediate. */
#define ibm032_BI	0x7	/* Branch immediate. */
#define ibm032_BA	0x8	/* Branch absolute. */
#define ibm032_D	0x9	/* Data. */

/* What an instruction looks like. */
struct ibm032_opcode {
    char *mnemonic; /* the name. NULL indicates illegal instruction. */
    int type; /* See above. */
};

#define MAXOPCODES 256 /* Pretty well hardwired. */

#ifndef BUILDTABLE
/* The actual data. */
struct ibm032_opcode ibm032_opcodes[] = {
    {"j%s",		ibm032_JI | ibm032_conditional | ibm032_negative},
    {"j%s",		ibm032_JI | ibm032_conditional | ibm032_negative},
    {"j%s",		ibm032_JI | ibm032_conditional | ibm032_negative},
    {"j%s",		ibm032_JI | ibm032_conditional | ibm032_negative},
    {"j%s",		ibm032_JI | ibm032_conditional | ibm032_negative},
    {"j%s",		ibm032_JI | ibm032_conditional | ibm032_negative},
    {"j%s",		ibm032_JI | ibm032_conditional | ibm032_negative},
    {"j%s",		ibm032_JI | ibm032_conditional | ibm032_negative},
    {"j%s",		ibm032_JI | ibm032_conditional},
    {"j%s",		ibm032_JI | ibm032_conditional},
    {"j%s",		ibm032_JI | ibm032_conditional},
    {"j%s",		ibm032_JI | ibm032_conditional},
    {"j%s",		ibm032_JI | ibm032_conditional},
    {"j%s",		ibm032_JI | ibm032_conditional},
    {"j%s",		ibm032_JI | ibm032_conditional},
    {"j%s",		ibm032_JI | ibm032_conditional},
    {"stcs",		ibm032_DS0},
    {"stcs",		ibm032_DS0},
    {"stcs",		ibm032_DS0},
    {"stcs",		ibm032_DS0},
    {"stcs",		ibm032_DS0},
    {"stcs",		ibm032_DS0},
    {"stcs",		ibm032_DS0},
    {"stcs",		ibm032_DS0},
    {"stcs",		ibm032_DS0},
    {"stcs",		ibm032_DS0},
    {"stcs",		ibm032_DS0},
    {"stcs",		ibm032_DS0},
    {"stcs",		ibm032_DS0},
    {"stcs",		ibm032_DS0},
    {"stcs",		ibm032_DS0},
    {"stcs",		ibm032_DS0},
    {"sths",		ibm032_DS1},
    {"sths",		ibm032_DS1},
    {"sths",		ibm032_DS1},
    {"sths",		ibm032_DS1},
    {"sths",		ibm032_DS1},
    {"sths",		ibm032_DS1},
    {"sths",		ibm032_DS1},
    {"sths",		ibm032_DS1},
    {"sths",		ibm032_DS1},
    {"sths",		ibm032_DS1},
    {"sths",		ibm032_DS1},
    {"sths",		ibm032_DS1},
    {"sths",		ibm032_DS1},
    {"sths",		ibm032_DS1},
    {"sths",		ibm032_DS1},
    {"sths",		ibm032_DS1},
    {"sts",		ibm032_DS2},
    {"sts",		ibm032_DS2},
    {"sts",		ibm032_DS2},
    {"sts",		ibm032_DS2},
    {"sts",		ibm032_DS2},
    {"sts",		ibm032_DS2},
    {"sts",		ibm032_DS2},
    {"sts",		ibm032_DS2},
    {"sts",		ibm032_DS2},
    {"sts",		ibm032_DS2},
    {"sts",		ibm032_DS2},
    {"sts",		ibm032_DS2},
    {"sts",		ibm032_DS2},
    {"sts",		ibm032_DS2},
    {"sts",		ibm032_DS2},
    {"sts",		ibm032_DS2},
    {"lcs",		ibm032_DS0},
    {"lcs",		ibm032_DS0},
    {"lcs",		ibm032_DS0},
    {"lcs",		ibm032_DS0},
    {"lcs",		ibm032_DS0},
    {"lcs",		ibm032_DS0},
    {"lcs",		ibm032_DS0},
    {"lcs",		ibm032_DS0},
    {"lcs",		ibm032_DS0},
    {"lcs",		ibm032_DS0},
    {"lcs",		ibm032_DS0},
    {"lcs",		ibm032_DS0},
    {"lcs",		ibm032_DS0},
    {"lcs",		ibm032_DS0},
    {"lcs",		ibm032_DS0},
    {"lcs",		ibm032_DS0},
    {"lhas",		ibm032_DS1},
    {"lhas",		ibm032_DS1},
    {"lhas",		ibm032_DS1},
    {"lhas",		ibm032_DS1},
    {"lhas",		ibm032_DS1},
    {"lhas",		ibm032_DS1},
    {"lhas",		ibm032_DS1},
    {"lhas",		ibm032_DS1},
    {"lhas",		ibm032_DS1},
    {"lhas",		ibm032_DS1},
    {"lhas",		ibm032_DS1},
    {"lhas",		ibm032_DS1},
    {"lhas",		ibm032_DS1},
    {"lhas",		ibm032_DS1},
    {"lhas",		ibm032_DS1},
    {"lhas",		ibm032_DS1},
    {"cas",		ibm032_X},
    {"cas",		ibm032_X},
    {"cas",		ibm032_X},
    {"cas",		ibm032_X},
    {"cas",		ibm032_X},
    {"cas",		ibm032_X},
    {"cas",		ibm032_X},
    {"cas",		ibm032_X},
    {"cas",		ibm032_X},
    {"cas",		ibm032_X},
    {"cas",		ibm032_X},
    {"cas",		ibm032_X},
    {"cas",		ibm032_X},
    {"cas",		ibm032_X},
    {"cas",		ibm032_X},
    {"cas",		ibm032_X},
    {"ls",		ibm032_DS2},
    {"ls",		ibm032_DS2},
    {"ls",		ibm032_DS2},
    {"ls",		ibm032_DS2},
    {"ls",		ibm032_DS2},
    {"ls",		ibm032_DS2},
    {"ls",		ibm032_DS2},
    {"ls",		ibm032_DS2},
    {"ls",		ibm032_DS2},
    {"ls",		ibm032_DS2},
    {"ls",		ibm032_DS2},
    {"ls",		ibm032_DS2},
    {"ls",		ibm032_DS2},
    {"ls",		ibm032_DS2},
    {"ls",		ibm032_DS2},
    {"ls",		ibm032_DS2},
    {0,			0},
    {0,			0},
    {0,			0},
    {0,			0},
    {0,			0},
    {0,			0},
    {0,			0},
    {0,			0},
    {"b%s",		ibm032_BI | ibm032_conditional | ibm032_negative},
    {"b%sx",		ibm032_BI | ibm032_conditional | ibm032_negative},
    {"bala",		ibm032_BA},
    {"balax",		ibm032_BA},
    {"bali",		ibm032_BI},
    {"balix",		ibm032_BI},
    {"b%s",		ibm032_BI | ibm032_conditional},
    {"b%sx",		ibm032_BI | ibm032_conditional},
    {"ais",		ibm032_RI},
    {"inc",		ibm032_RI},
    {"sis",		ibm032_RI},
    {"dec",		ibm032_RI},
    {"cis",		ibm032_RI},
    {"clrsb",		ibm032_RI},
    {"mfs",		ibm032_RR},
    {"setsb",		ibm032_RI},
    {"clrbu",		ibm032_RI},
    {"clrbl",		ibm032_RI},
    {"setbu",		ibm032_RI},
    {"setbl",		ibm032_RI},
    {"mftbiu",		ibm032_RI},
    {"mftbil",		ibm032_RI},
    {"mttbiu",		ibm032_RI},
    {"mttbil",		ibm032_RI},
    {"sari",		ibm032_RI},
    {"sari16",		ibm032_RI},
    {0,			0},
    {0,			0},
    {"lis",		ibm032_RI},
    {0,			0},
    {0,			0},
    {0,			0},
    {"sri",		ibm032_RI},
    {"sri16",		ibm032_RI},
    {"sli",		ibm032_RI},
    {"sli16",		ibm032_RI},
    {"srpi",		ibm032_RI},
    {"srpi16",		ibm032_RI},
    {"slpi",		ibm032_RI},
    {"slpi16",		ibm032_RI},
    {"sar",		ibm032_RR},
    {"exts",		ibm032_RR},
    {"sf",		ibm032_RR},
    {"cl",		ibm032_RR},
    {"c",		ibm032_RR},
    {"mts",		ibm032_RR},
    {"d",		ibm032_RR},
    {0,			0},
    {"sr",		ibm032_RR},
    {"srp",		ibm032_RR},
    {"sl",		ibm032_RR},
    {"slp",		ibm032_RR},
    {"mftb",		ibm032_RR},
    {"tgte",		ibm032_RR},
    {"tlt",		ibm032_RR},
    {"mttb",		ibm032_RR},
    {"svc",		ibm032_D},
    {"ai",		ibm032_D},
    {"cal16",		ibm032_D},
    {"oiu",		ibm032_D},
    {"oil",		ibm032_D},
    {"nilz",		ibm032_D},
    {"nilo",		ibm032_D},
    {"xil",		ibm032_D},
    {"cal",		ibm032_D},
    {"lm",		ibm032_D},
    {"lha",		ibm032_D},
    {"ior",		ibm032_D},
    {"ti",		ibm032_D},
    {"l",		ibm032_D},
    {"lc",		ibm032_D},
    {"tsh",		ibm032_D},
    {"lps",		ibm032_D},
    {"aei",		ibm032_D},
    {"sfi",		ibm032_D},
    {"cli",		ibm032_D},
    {"ci",		ibm032_D},
    {"niuz",		ibm032_D},
    {"niuo",		ibm032_D},
    {"xiu",		ibm032_D},
    {"cau",		ibm032_D},
    {"stm",		ibm032_D},
    {"lh",		ibm032_D},
    {"iow",		ibm032_D},
    {"sth",		ibm032_D},
    {"st",		ibm032_D},
    {"stc",		ibm032_D},
    {0,			0},
    {"abs",		ibm032_RR},
    {"a",		ibm032_RR},
    {"s",		ibm032_RR},
    {"o",		ibm032_RR},
    {"twoc",		ibm032_RR},
    {"n",		ibm032_RR},
    {"m",		ibm032_RR},
    {"x",		ibm032_RR},
    {"b%sr",		ibm032_RR | ibm032_conditional | ibm032_negative},
    {"b%srx",		ibm032_RR | ibm032_conditional | ibm032_negative},
    {0,			0},
    {"lhs",		ibm032_RR},
    {"balr",		ibm032_RR},
    {"balrx",		ibm032_RR},
    {"b%sr",		ibm032_RR | ibm032_conditional},
    {"b%srx",		ibm032_RR | ibm032_conditional},
    {"wait",		ibm032_RR},
    {"ae",		ibm032_RR},
    {"se",		ibm032_RR},
    {"ca16",		ibm032_RR},
    {"onec",		ibm032_RR},
    {"clz",		ibm032_RR},
    {0,			0},
    {0,			0},
    {0,			0},
    {"mc03",		ibm032_RR},
    {"mc13",		ibm032_RR},
    {"mc23",		ibm032_RR},
    {"mc33",		ibm032_RR},
    {"mc30",		ibm032_RR},
    {"mc31",		ibm032_RR},
    {"mc32",		ibm032_RR},
};

#else
struct ibm032_opcode ibm032_opcodes[MAXOPCODES];

struct ibm032_instruction {
    char *mnemonic; /* Mnemonic for this instruction */
    char opcode; /* Numerical value of opcode. */
    int type; /* This instructions format. */
};

struct ibm032_instruction ibm032_instructions[] =
{
 {"a",		0xe1, ibm032_RR},
 {"abs",	0xe0, ibm032_RR},
 {"ae",		0xf1, ibm032_RR},
 {"aei",	0xd1, ibm032_D},
 {"ai",		0xc1, ibm032_D},
 {"ais",	0x90, ibm032_RI},
 {"bala",	0x8a, ibm032_BA},
 {"balax",	0x8b, ibm032_BA},
 {"bali",	0x8c, ibm032_BI},
 {"balix",	0x8d, ibm032_BI},
 {"balr",	0xec, ibm032_RR},
 {"balrx",	0xed, ibm032_RR},
 {"b%s",	0x8e, ibm032_BI | ibm032_conditional},
 {"b%sr",	0xee, ibm032_RR | ibm032_conditional},
 {"b%srx",	0xef, ibm032_RR | ibm032_conditional},
 {"b%sx",	0x8f, ibm032_BI | ibm032_conditional},
 {"b%s",	0x88, ibm032_BI | ibm032_conditional | ibm032_negative},
 {"b%sr",	0xe8, ibm032_RR | ibm032_conditional | ibm032_negative},
 {"b%srx",	0xe9, ibm032_RR | ibm032_conditional | ibm032_negative},
 {"b%sx",	0x89, ibm032_BI | ibm032_conditional | ibm032_negative},
 {"c",		0xb4, ibm032_RR},
 {"cal",	0xc8, ibm032_D},
 {"cal16",	0xc2, ibm032_D},
 {"cas",	0x60, ibm032_X},
 {"cau",	0xd8, ibm032_D},
 {"ca16",	0xf3, ibm032_RR},
 {"ci",		0xd4, ibm032_D},
 {"cis",	0x94, ibm032_RI},
 {"cl",		0xb3, ibm032_RR},
 {"cli",	0xd3, ibm032_D},
 {"clrbl",	0x99, ibm032_RI},
 {"clrbu",	0x98, ibm032_RI},
 {"clrsb",	0x95, ibm032_RI},
 {"clz",	0xf5, ibm032_RR},
 {"d",		0xb6, ibm032_RR},
 {"dec",	0x93, ibm032_RI},
 {"exts",	0xb1, ibm032_RR},
 {"inc",	0x91, ibm032_RI},
 {"ior",	0xcb, ibm032_D},
 {"iow",	0xdb, ibm032_D},

 {"j%s",	0x08, ibm032_JI | ibm032_conditional},
 {"j%s",	0x00, ibm032_JI | ibm032_conditional | ibm032_negative},

 {"l",		0xcd, ibm032_D},
 {"lc",		0xce, ibm032_D},
 {"lcs",	0x40, ibm032_DS0},
 {"lh",		0xda, ibm032_D},
 {"lha",	0xca, ibm032_D},
 {"lhas",	0x50, ibm032_DS1},
 {"lhs",	0xeb, ibm032_RR},
 {"lis",	0xa4, ibm032_RI},
 {"lm",		0xc9, ibm032_D},
 {"lps",	0xd0, ibm032_D},
 {"ls",		0x70, ibm032_DS2},
 {"m",		0xe6, ibm032_RR},
 {"mc03",	0xf9, ibm032_RR},
 {"mc13",	0xfa, ibm032_RR},
 {"mc23",	0xfb, ibm032_RR},
 {"mc33",	0xfc, ibm032_RR},
 {"mc30",	0xfd, ibm032_RR},
 {"mc31",	0xfe, ibm032_RR},
 {"mc32",	0xff, ibm032_RR},
 {"mfs",	0x96, ibm032_RR},
 {"mftb",	0xbc, ibm032_RR},
 {"mftbil",	0x9d, ibm032_RI},
 {"mftbiu",	0x9c, ibm032_RI},
 {"mts",	0xb5, ibm032_RR},
 {"mttb",	0xbf, ibm032_RR},
 {"mttbil",	0x9f, ibm032_RI},
 {"mttbiu",	0x9e, ibm032_RI},
 {"n",		0xe5, ibm032_RR},

 {"nilo",	0xc6, ibm032_D},
 {"nilz",	0xc5, ibm032_D},
 {"niuo",	0xd6, ibm032_D},
 {"niuz",	0xd5, ibm032_D},
 {"o",		0xe3, ibm032_RR},
 {"oil",	0xc4, ibm032_D},
 {"oiu",	0xc3, ibm032_D},
 {"onec",	0xf4, ibm032_RR},
 {"s",		0xe2, ibm032_RR},
 {"sar",	0xb0, ibm032_RR},
 {"sari",	0xa0, ibm032_RI},
 {"sari16",	0xa1, ibm032_RI},
 {"se",		0xf2, ibm032_RR},
 {"setbl",	0x9b, ibm032_RI},
 {"setbu",	0x9a, ibm032_RI},
 {"setsb",	0x97, ibm032_RI},
 {"sf",		0xb2, ibm032_RR},

 {"sfi",	0xd2, ibm032_D},

 {"sis",	0x92, ibm032_RI},
 {"sl",		0xba, ibm032_RR},
 {"sli",	0xaa, ibm032_RI},
 {"sli16",	0xab, ibm032_RI},
 {"slp",	0xbb, ibm032_RR},
 {"slpi",	0xae, ibm032_RI},
 {"slpi16",	0xaf, ibm032_RI},
 {"sr",		0xb8, ibm032_RR},
 {"sri",	0xa8, ibm032_RI},
 {"sri16",	0xa9, ibm032_RI},
 {"srp",	0xb9, ibm032_RR},
 {"srpi",	0xac, ibm032_RI},
 {"srpi16",	0xad, ibm032_RI},

 {"st",		0xdd, ibm032_D},

 {"stc",	0xde, ibm032_D},
 {"stcs",	0x10, ibm032_DS0},
 {"sth",	0xdc, ibm032_D},
 {"sths",	0x20, ibm032_DS1},
 {"stm",	0xd9, ibm032_D},
 {"sts",	0x30, ibm032_DS2},
 {"svc",	0xc0, ibm032_D},
 {"tgte",	0xbd, ibm032_RR},
 {"ti",		0xcc, ibm032_D},
 {"tlt",	0xbe, ibm032_RR},
 {"tsh",	0xcf, ibm032_D},
 {"twoc",	0xe4, ibm032_RR},
 {"wait",	0xf0, ibm032_RR},
 {"x",		0xe7, ibm032_RR},
 {"xil",	0xc7, ibm032_D},
 {"xiu",	0xd7, ibm032_D}
};

/* Code to generate the packed opcode table from the instructions table. */

#include <stdio.h>

char *typeNames[] = {
    "ibm032_JI",
    "ibm032_X",
    "ibm032_DS0",
    "ibm032_DS1",
    "ibm032_DS2",
    "ibm032_RR",
    "ibm032_RI",
    "ibm032_BI",
    "ibm032_BA",
    "ibm032_D"
};

main()
{

    int i, j, opcode, type;

    for (j = (sizeof(ibm032_instructions) / sizeof(struct ibm032_instruction)); j >= 0; j--) {
        opcode = ibm032_instructions[j].opcode;
        switch (ibm032_instructions[j].type & ibm032_typeMask) {
            case ibm032_JI:
                i = 7;
                break;
            case ibm032_X:
            case ibm032_DS0:
            case ibm032_DS1:
            case ibm032_DS2:
                i = 15;
                break;
            case ibm032_RR:
            case ibm032_RI:
            default:
                i = 0;
                break;
        }
        for (;i >= 0; i--) {
            ibm032_opcodes[opcode + i].mnemonic = ibm032_instructions[j].mnemonic;
            ibm032_opcodes[opcode + i].type = ibm032_instructions[j].type;
        }
    }

    printf("struct ibm032_opcode ibm032_opcodes[] = {\n");
    for ( j = 0; j < 256; j++) {
        type = ibm032_opcodes[j].type;      
        if (ibm032_opcodes[j].mnemonic != NULL)
            printf("    {\"%s\",\t\t%s%s%s},\n", ibm032_opcodes[j].mnemonic,
                   typeNames[type & ibm032_typeMask],
                   (type & ibm032_conditional) ? " | ibm032_conditional" : "",
                   (type & ibm032_negative) ? " | ibm032_negative" : "");
        else
            printf("    {0,\t\t\t0},\n");
    }
    printf("};\n");
}
#endif /* BUILDTABLE */

Only in .: ibm032-pinsn.c

/* Print ibm032 instructions for GDB, the GNU debugger.
   Copyright (C) 1986 Free Software Foundation, Inc.

GDB is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY.  No author or distributor accepts responsibility to anyone
for the consequences of using it or for whether it serves any
particular purpose or works at all, unless he says so in writing.
Refer to the GDB General Public License for full details.

Everyone is granted permission to copy, modify and redistribute GDB,
but only under the conditions described in the GDB General Public
License.  A copy of this license is supposed to have been given to you
along with GDB so you can know your rights and responsibilities.  It
should be in a file named COPYING.  Among other things, the copyright
notice and this notice must be preserved on all copies.

In other words, go ahead and share GDB, but don't try to stop
anyone else from sharing it farther.  Help stamp out software hoarding!
*/

#include <stdio.h>

#include "defs.h"
#include "param.h"
#include "symtab.h"
#include "ibm032-opcode.h"

/* ibm032 instructions are never longer than this many bytes.  */
#define MAXLEN 4

extern char *reg_names[];

static char *mapCondition();


/* Print the ibm032 instruction at address MEMADDR in debugged memory,
   on STREAM.  Returns length of the instruction, in bytes.  */

int
print_insn (memaddr, stream)
     CORE_ADDR memaddr;
     FILE *stream;
{
  unsigned char buffer[MAXLEN];
  int opcodeIndex, instructionBits, type;
  char *mnemonic;

  read_memory (memaddr, buffer, MAXLEN);
  instructionBits = (buffer[0] << 24) + (buffer[1] << 16) + (buffer[2] << 8) + buffer[3]; /* Get it into an int for easy use. */

  if ((mnemonic = ibm032_opcodes[opcodeIndex = buffer[0]].mnemonic) == NULL)
    {
      fprintf (stream, "0%o", (instructionBits & HIGH16) >> 16);
      return 2;
    }
  type = ibm032_opcodes[opcodeIndex].type;
  if (!(type & ibm032_conditional)) {
    fprintf (stream, "%s", mnemonic);

    switch (type) {

      int displacement; /* Used for sign extensions. */
      char *sign;

      case ibm032_X:
        fprintf(stream, "\t%s, %s(%s)", reg_names[buffer[0] & LOW4], (buffer[1] & HIGH4) ? (reg_names[(buffer[1] & HIGH4) >> 4]) : "", reg_names[buffer[1] & LOW4]);
        return 2;
      case ibm032_DS0:
      case ibm032_DS1:
      case ibm032_DS2:
        fprintf(stream, "\t%s, %x", reg_names[(buffer[1] & HIGH4) >> 4], (buffer[0] & LOW4) << (ibm032_opcodes[opcodeIndex].type - ibm032_DSShiftOffset)); /* Hacked to shift imediate field. */
        if (buffer[1] & LOW4)
          fprintf(stream, "(%s)", reg_names[buffer[1] & LOW4]);
        return 2;
      case ibm032_RR:
        fprintf(stream, "\t%s, %s", reg_names[(buffer[1] & HIGH4) >> 4], reg_names[buffer[1] & 0x0f]);
        return 2;
      case ibm032_RI:
        fprintf(stream, "\t%s, %x", reg_names[(buffer[1] & HIGH4) >> 4], buffer[1] & LOW4);
        return 2;
      case ibm032_BI:
        fprintf(stream, "\t%s, ", reg_names[(buffer[1] & HIGH4) >> 4]);
        displacement = (instructionBits & LOW20);
        if ((displacement & (1 << 19)) != 0) /* Cover sign extension. */
            displacement |= 0xfff00000;
        print_address(memaddr + (displacement * 2), stream); /* Need sign extension. */
        return 4;
      case ibm032_BA:
        print_address((instructionBits & LOW24) & ~1, stream);
        return 4;
      case ibm032_D:
        displacement = (instructionBits & LOW16);
        if ((displacement & (1 << 15)) != 0) { /* Cover sign extension. */
          displacement = - (displacement | 0xffff0000);
          sign = "-";
        }
        else
          sign = "";
        fprintf(stream, "\t%s, %s, %s%x", reg_names[(buffer[1] & HIGH4) >> 4], reg_names[buffer[1] & LOW4], sign, displacement);
        return 4;
    }
  }
  else { /* Conditional branches are hacked. */
    switch (type & 0x0f) {

      int displacement;

      case ibm032_JI:
        fprintf(stream, ibm032_opcodes[opcodeIndex].mnemonic, mapCondition(type & ibm032_negative, buffer[0] & LOW4));
      putc('\t', stream);
      print_address((buffer[1] << 1) + memaddr, stream);
      return 2;
    case ibm032_BI:
      fprintf(stream, ibm032_opcodes[opcodeIndex].mnemonic, mapCondition(type & ibm032_negative, (buffer[1] & HIGH4) >> 4));
      putc('\t', stream);
        displacement = (instructionBits & LOW20);
        if ((displacement & (1 << 19)) != 0) /* Cover sign extension. */
            displacement |= 0xfff00000;
        print_address((displacement * 2) + memaddr, stream);
      return 4;
    case ibm032_RR:
      fprintf(stream, ibm032_opcodes[opcodeIndex].mnemonic, mapCondition(type & ibm032_negative, (buffer[1] & HIGH4) >> 4));
      fprintf(stream, "\t%s", reg_names[buffer[1] & LOW4]);
      return 2;   
    }
  }
}

/* Converts a 4 bit "conditional specifier" into a semi-meaningful name. */
static char *mapCondition(negative, conditionBits)
    int conditionBits;
{

    char *condition;

    if (negative)
        switch (conditionBits) {
            case 0x8:
                condition = "";
                break;
            case 0x9:
                condition = "ge";
                break;
            case 0xa:
                condition = "ne";
                break;
            case 0xb:
                condition = "le";
                break;
            case 0xc:
                condition = "nc";
                break;
            case 0xd: /* Reserved. */
                condition = "notbogus";
                break;
            case 0xe:
                 condition = "no";
                break;
            case 0xf:
                condition = "ntb";
                break;
            default:
                condition = "notbogus";
                break;
        }
    else
        switch (conditionBits) {
            case 0x8:
                condition = "nop";
                break;
            case 0x9:
                condition = "lt";
                break;
            case 0xa:
                condition = "eq";
                break;
            case 0xb:
                condition = "gt";
                break;
            case 0xc:
                condition = "c";
                break;
            case 0xd: /* Reserved. */
                condition = "bogus";
                break;
            case 0xe:
                condition = "o";
                break;
            case 0xf:
                condition = "tb";
                break;
            default:
                condition = "bogus";
                break;
        }
    return condition;
}

Only in .: m-ibm032.h

/* Parameters for execution on an IBM RT, for GDB, the GNU debugger.
   Copyright (C) 1986 Free Software Foundation, Inc.

GDB is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY.  No author or distributor accepts responsibility to anyone
for the consequences of using it or for whether it serves any
particular purpose or works at all, unless he says so in writing.
Refer to the GDB General Public License for full details.

Everyone is granted permission to copy, modify and redistribute GDB,
but only under the conditions described in the GDB General Public
License.  A copy of this license is supposed to have been given to you
along with GDB so you can know your rights and responsibilities.  It
should be in a file named COPYING.  Among other things, the copyright
notice and this notice must be preserved on all copies.

In other words, go ahead and share GDB, but don't try to stop
anyone else from sharing it farther.  Help stamp out software hoarding!
*/

/* Define this if the C compiler puts an underscore at the front
   of external names before giving them to the linker.  */

#define NAMES_HAVE_UNDERSCORE

/* Offset from address of function to start of its code.
   Zero on most machines.  */

#define FUNCTION_START_OFFSET 0

/* Advance PC across any function entry prologue instructions
   to reach some "real" code.  */

#define SKIP_PROLOGUE(pc)   \
{ register int op = read_memory_integer (pc, 1) & 0x00ff; \
    if (op == 0xd9) { \
	pc += 4; \
	op = read_memory_integer (pc, 2); \
	if ((op & 0xff00) == 0xc100) { /* pcc prolog add r1, number */ \
	    pc += 4; \
	    op = read_memory_integer (pc, 1) & 0x00ff; \
	    if (op == 0x6e) { 			/* cas r14, 0 */ \
		pc += 2; \
		op = read_memory_integer (pc, 2) & 0xffff; \
		if (op == 0xc8d1) pc += 4; /* cal r13, junk(r1) */ \
	    } \
	} \
	else if ((op & 0xffff) == 0x6e00) { /* hc prolog cas r14, 0 */ \
	    pc += 4; \
	    op = read_memory_integer(pc, 1) & 0xff; \
	    if (op == 0x6d) { /* cas r13 junk, probably */ \
		pc += 2; \
		op = read_memory_integer(pc, 2) & 0xffff; \
		if (op == 0xc811) pc += 4; /* cal r1,  foo(r1) */	\
	    } \
	} \
    } \
    while (1) { \
	/* now watch for st, sth, stc, and short versions thereof, cas instructions and exts */ \
	/* which are all used to store the parameters from r2-r5 onto the stack or into reg vars */ \
	op = read_memory_integer (pc, 2); \
	if ((op & 0xff00) == 0x3000 && (op & 0xf0) >= 0x20 && (op & 0xf0) <= 0x50) pc += 2; \
	else if ((op & 0xff00) == 0x2300 && (op & 0xf0) >= 0x20 && (op & 0xf0) <= 0x50) pc += 2; \
	else if ((op & 0xff00) == 0x1b00 && (op & 0xf0) >= 0x20 && (op & 0xf0) <= 0x50) pc += 2; \
	else if ((op & 0xff00) == 0x6c00 && (op & 0xf0) >= 0x20 && (op & 0xf0) <= 0x50) pc += 2; \
	else if ((op & 0xff00) == 0xb100) pc += 2; /* extend sign */ \
	else if ((op & 0xff00) == 0xdd00 && (op & 0xf0) >= 0x20 && (op & 0xf0) <= 0x50) pc += 4; \
	else break; \
    } \
}

/* Immediately after a function call, return the saved pc.
   Can't go through the frames for this because on some machines
   the new frame is not set up until the new function executes
   some instructions.  */

#define SAVED_PC_AFTER_CALL(frame) \
read_register (15)

/* This is the amount to subtract from u.u_ar0
   to get the offset in the core file of the register values.  */

#define KERNEL_U_ADDR (0x20000000 - NBPG * (UPAGES))

/* Address of end of stack space.  */

/* extra page is for the "red zone" */
#define STACK_END_ADDR (0x20000000 - NBPG * (UPAGES+1))

/* Stack grows downward.  */

#define INNER_THAN <

/* Sequence of bytes for breakpoint instruction.  */

#define BREAKPOINT {0xbd, 0x00}

/* Amount PC must be decremented by after a breakpoint.
   This is often the number of bytes in BREAKPOINT
   but not always.  */

#define DECR_PC_AFTER_BREAK 0

/* Nonzero if instruction at PC is a return instruction.  */

#define ABOUT_TO_RETURN(pc) (read_memory_integer (pc, 1) & 0x00ff == 0xc9)

/* Return 1 if P points to an invalid floating point value.  */

#define INVALID_FLOAT(p) 0   /* Just a first guess; not checked */

/* Say how long (ordinary) registers are.  */

#define REGISTER_TYPE long

/* Number of machine registers */

#define NUM_REGS 18

/* Initializer for an array of names of registers.
   There should be NUM_REGS strings in this initializer.  */

#define REGISTER_NAMES {"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", "iar", "mq"}

/* Register numbers of various important registers.
   Note that some of these values are "real" register numbers,
   and correspond to the general registers of the machine,
   and some are "phony" register numbers which are too large
   to be actual register numbers as far as the user is concerned
   but do serve to get the desired values when passed to read_register.  */

#define FP_REGNUM 13		/* Contains address of executing stack frame */
#define SP_REGNUM 1		/* Contains address of top of stack */
#define PS_REGNUM 17		/* Contains processor status */
#define PC_REGNUM 16		/* Contains program counter */

#define REGISTER_U_ADDR(addr, blockend, regno)		\
{ addr = blockend + regno * 4; }

/* Total amount of space needed to store our copies of the machine's
   register state, the array `registers'.  */
#define REGISTER_BYTES (NUM_REGS*4)

/* Index within `registers' of the first byte of the space for
   register N.  */

#define REGISTER_BYTE(N) ((N) * 4)

/* Number of bytes of storage in the actual machine representation
   for register N.  On the vax, all regs are 4 bytes.  */

#define REGISTER_RAW_SIZE(N) 4

/* Number of bytes of storage in the program's representation
   for register N.  On the vax, all regs are 4 bytes.  */

#define REGISTER_VIRTUAL_SIZE(N) 4

/* Largest value REGISTER_RAW_SIZE can have.  */

#define MAX_REGISTER_RAW_SIZE 4

/* Largest value REGISTER_VIRTUAL_SIZE can have.  */

#define MAX_REGISTER_VIRTUAL_SIZE 4

/* Nonzero if register N requires conversion
   from raw format to virtual format.  */

#define REGISTER_CONVERTIBLE(N) 0

/* Convert data from raw format for register REGNUM
   to virtual format for register REGNUM.  */

#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,FROM,TO)	\
  bcopy ((FROM), (TO), 4);

/* Convert data from virtual format for register REGNUM
   to raw format for register REGNUM.  */

#define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO)	\
  bcopy ((FROM), (TO), 4);

/* Return the GDB type object for the "standard" data type
   of data in register N.  */

#define REGISTER_VIRTUAL_TYPE(N) builtin_type_int

/* Describe the pointer in each stack frame to the previous stack frame
   (its caller).  */

/* FRAME_CHAIN takes a frame's nominal address
   and produces the frame's chain-pointer.

   FRAME_CHAIN_COMBINE takes the chain pointer and the frame's nominal address
   and produces the nominal address of the caller frame.

   However, if FRAME_CHAIN_VALID returns zero,
   it means the given frame is the outermost one and has no caller.
   In that case, FRAME_CHAIN_COMBINE is not used.  */

/* In the case of the Sun, the frame's nominal address
   is the address of a 4-byte word containing the calling frame's address.  */

#define FRAME_CHAIN(thisframe)  (rt_prev_frame(thisframe))

#define FRAME_CHAIN_VALID(chain, thisframe) \
  (chain >= 0x10000000 && chain < 0x20000000)

#define FRAME_CHAIN_COMBINE(chain, thisframe) (chain)

/* Define other aspects of the stack frame.  */

#define FRAME_SAVED_PC(frame) (rt_frame_reg(frame, 15))

#define FRAME_ARGS_ADDRESS(fi) (rt_frame_args(fi.frame))

#define FRAME_LOCALS_ADDRESS(fi) (fi.frame)

/* Return number of args passed to a frame.
   Can return -1, meaning no way to tell.  */

#define FRAME_NUM_ARGS(val, fi)  \
{register struct rt_frame *tf; \
    tf = get_cached_frame(fi.frame); \
    val = -1; \
    if (tf) val = tf->nParms;\
}

/* Return number of bytes at start of arglist that are not really args.  */

#define FRAME_ARGS_SKIP 0

/* Put here the code to store, into a struct frame_saved_regs,
   the addresses of the saved registers of frame described by FRAME_INFO.
   This includes special registers such as pc and fp saved in special
   ways in the stack frame.  sp is even more special:
   the address we return for it IS the sp for the next frame.  */

#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs)		\
{ register int regnum;							\
  register struct rt_frame *tf;			\
  register CORE_ADDR next_addr;						\
  bzero (&(frame_saved_regs), sizeof (frame_saved_regs));			\
  tf = get_cached_frame((frame_info).frame);					\
  if (tf) {											\
    for(regnum = tf->firstReg; regnum < 16; regnum++) {		\
      (frame_saved_regs).regs[regnum] = tf->firstRLoc+ 4*(regnum - tf->firstReg); \
    } \
  } \
}


/* Things needed for making the inferior call functions.  */

/* Push an empty stack frame, to record the current PC, etc.  */

#define PUSH_DUMMY_FRAME \
{ register CORE_ADDR sp = read_register (SP_REGNUM);\
  register int regnum;				    \
  sp = push_word (sp, read_register (PC_REGNUM));   \
  for (regnum = 15; regnum >= 0; regnum--)  \
    sp = push_word (sp, read_register (regnum));    \
  write_register (FP_REGNUM, sp+64);		    \
  write_register (SP_REGNUM, sp);  }

/* discard special frame pushed by PUSH_DUMMY_FRAME */
#define POP_DUMMY_FRAME \
    {register CORE_ADDR sp; \
    register int regnum; \
    sp = read_register(FP_REGNUM)-64; \
    for(regnum = 0; regnum < 16;regnum++) { \
	write_register(regnum, read_memory_integer(sp, 4)); \
	sp += 4; \
    } \
    /* now get the pc */ \
    write_register(PC_REGNUM, read_memory_integer(sp, 4)); \
    sp += 4; \
    }

/* Discard from the stack the innermost frame, restoring all registers.  */
/* THIS ROUTINE DOES NOT SET R1 (SP_REGNUM) CORRECTLY */
/* REALLY MUST CONSULT TRACE TBL TO FIND OUT FRAME SIZE */
#define POP_FRAME  \
{ register CORE_ADDR fp = read_register (FP_REGNUM);		 \
  register int regnum;						 \
  register struct rt_frame *tf;			\
  tf = (struct rt_frame *) get_cached_frame(fp);			\
  if (tf) {							\
    for(regnum = tf->firstReg; regnum < 16; regnum++) {		\
	write_register(regnum,				\
	    read_memory_integer (tf->firstRLoc + 4*(regnum-tf->firstReg), 4)	\
	    );	\
    }		\
    write_register(PC_REGNUM, read_register(15));		\
    write_register(SP_REGNUM, tf->firstRLoc + 4*(16-tf->firstReg) + 36);	\
  }		\
}

/* This sequence of words is the instructions
     ls		r2,0(r1)			2 bytes		pick up args
     ls		r3,4(r1)			2 bytes		pick up args
     ls		r4,8(r1)			2 bytes		pick up args
     ls		r5,c(r1)			2 bytes		pick up args
     cal	r1,16(r1)			4 bytes		fix up ap (==sp)
     cal16	r15,<low>			4 bytes		do call
     oiu	r15,<high>(r15)	4
     lr		r0,r15			2
     ls		r15,0(r15)			2
     balr	r15				2
     bpt					2			get back to gdb
     <4 byte trace table>		4

This is 16 bytes.
*/

#define CALL_DUMMY {0x70217131, 0x72417351, 0xc8110010, 0xc2f06969, \
    0xc3ff6969, 0x60f070ff, 0xecffbd00, 0xdf7fdf00}

#define CALL_DUMMY_LENGTH 32

#define CALL_DUMMY_START_OFFSET 0

/* Insert the specified number of args and function address
   into a call sequence of the above form stored at DUMMYNAME.  */

#define FIX_CALL_DUMMY(dummyname, fun, nargs)     \
{ *((short *)(((char *)dummyname)+14)) = fun&0xffff; \
*((short *)(((char *)dummyname)+18)) = (fun>>16)&0xffff; \
}

/* Interface definitions for kernel debugger KDB.  */

/* Map machine fault codes into signal numbers.
   First subtract 0, divide by 4, then index in a table.
   Faults for which the entry in this table is 0
   are not handled by KDB; the program's own trap handler
   gets to handle then.  */

#define FAULT_CODE_ORIGIN 0
#define FAULT_CODE_UNITS 4
#define FAULT_TABLE    \
{ 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \
  0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \
  0, 0, 0, 0, 0, 0, 0, 0, \
  SIGILL }

/* Start running with a stack stretching from BEG to END.
   BEG and END should be symbols meaningful to the assembler.
   This is used only for kdb, which we do not support. */

#define INIT_STACK(beg, end)  \
{  }

/* Push the frame pointer register on the stack.  */
#define PUSH_FRAME_PTR \
{ }

/* Copy the top-of-stack to the frame pointer register.  */
#define POP_FRAME_PTR \
{ }

/* After KDB is entered by a fault, push all registers
   that GDB thinks about (all NUM_REGS of them),
   so that they appear in order of ascending GDB register number.
   The fault code will be on the stack beyond the last register.  */

#define PUSH_REGISTERS        \
{ }

/* Assuming the registers (including processor status) have been
   pushed on the stack in order of ascending GDB register number,
   restore them and return to the address in the saved PC register.  */

#define POP_REGISTERS          \
{ }

Only in .: m-ibm032init.h

/* This is how the size of an individual .o file's text segment
   is rounded on a sun.  */

#define FILEADDR_ROUND(addr) ((addr + 3) & -4)

diff -c ../../gnu/gdb/blockframe.c ./blockframe.c
*** ../../gnu/gdb/blockframe.c	Sat Apr  4 22:06:18 1987
--- ./blockframe.c	Mon Apr 27 01:06:06 1987
***************
*** 53,62 ****
  }
  
  void
! set_current_frame (frame)
       FRAME frame;
  {
    current_frame = frame;
  }
  
  /* Return the frame that called FRAME.
--- 53,67 ----
  }
  
  void
! set_current_frame (frame, validp)
       FRAME frame;
+      int validp;
  {
    current_frame = frame;
+ #ifdef ibm032
+   if (validp)
+     recache_frames();
+ #endif
  }
  
  /* Return the frame that called FRAME.
***************
*** 291,301 ****
       CORE_ADDR pc;
  {
    register int i;
  
    /* Note that the last thing in the vector is always _etext.  */
    for (i = 0; i < misc_function_count; i++)
      {
!       if (pc < misc_function_vector[i].address)
  	return i - 1;
      }
    return -1;
--- 296,309 ----
       CORE_ADDR pc;
  {
    register int i;
+   register long j;
  
    /* Note that the last thing in the vector is always _etext.  */
    for (i = 0; i < misc_function_count; i++)
      {
!       if ((j = misc_function_vector[i].address) < 0)
!         continue;
!       if (pc < j)
  	return i - 1;
      }
    return -1;
***************
*** 325,333 ****
--- 333,610 ----
      }
  }
  
+ #ifdef ibm032
+ /* RT frame format:
+     arg 3	these are not really here, but are in regs
+     arg 2
+     arg 1
+     arg 0
+     resvd 20 bytes
+     rn to r15	saved regs
+     floating regs (at first assume 0 bytes, fix later)
+     locals
+ 
+ N.B. r13 points 64 bytes below the end of the locals.
+ */
+ 
+ /*
+  * Routine for ibm032 stack trace.  Called after a new frame has been set.  Do an entire stack
+  * trace, and squirrel away the information.  We need to do this since the ibm032 (rt) does
+  * not have enough info in a known place off of the frame ptr (r13) to do anything useful.
+  * Instead, one also requires the pc, and can then perform various operations to find
+  * out how that procedure built its frame, and thus, to decode it.  However, since this is
+  * fairly slow, we only do it after a set_current_frame operation has been performed.
+ */
+ 
+ #define rtTTSize 50
+ static struct rtTTCache {
+     CORE_ADDR lbound;		/* lowest address so far known as using this trace table */
+     CORE_ADDR ttaddr;		/* address of the last '0xdf' in the trace table */
+     char ttype;				/* type of the trace table -- 0 == unused */
+ } ttcache[rtTTSize];
+ short ttptr = 0;
+ 
+ #define rtSize	50
+ static struct rt_frame rtFrames[rtSize];
+ static int rtCount;
+ static CORE_ADDR rt_next_frame, rt_next_pc;
+ 
+ static struct rtTTCache *ttfind (addr)
+     CORE_ADDR addr; {
+     register int i;
+     register struct rtTTCache *tp;
+     for(i=0,tp=ttcache;i<rtTTSize;i++,tp++) {
+ 	if (addr >= tp->lbound && addr <= tp->ttaddr) return tp;
+     }
+     return 0;
+ }
+ 
+ static ttadd(lowaddr, ttaddr, type)
+     register CORE_ADDR lowaddr, ttaddr;
+     char type; {
+     register struct rtTTCache *tp;
+     if (tp = ttfind(ttaddr)) {
+ 	/* possibly increase the bound on this cache element */
+ 	if (lowaddr < tp->lbound) tp->lbound = lowaddr;
+     }
+     else {
+ 	/* add a new element */
+ 	tp = &ttcache[ttptr++];
+ 	tp->lbound = lowaddr;
+ 	tp->ttaddr = ttaddr;
+ 	tp->ttype = type;
+ 	if (ttptr >= rtTTSize) ttptr = 0;	/* keep it in bounds */
+     }
+ }
+ 
+ /* this routine scans for a trace table, and returns 4 bytes: 0 0 <n params> <first saved reg> */
+ rt_num_regs (pc, tf)
+ register struct rt_frame *tf;
+ CORE_ADDR pc; {
+     register state = 0;
+     register long newpc = pc;
+     register int tc;
+     short nparms, firstreg;
+     short ttype;
+     short optx;
+     long offset;
+     char offtype;
+     struct rtTTCache *tp;
+     CORE_ADDR frame;
+ 
+     frame = tf->frame;
+     /* first see if it is in our ttcache */
+     if (tp = ttfind(pc)) {
+ 	state = 3;
+ 	ttype = tp->ttype;
+ 	newpc = tp->ttaddr;
+     }
+     else {
+ 	/* state machine to look for 'df' 'xx' 'df' */
+ 	while (1) {
+ 	    tc = read_memory_integer(newpc, 2);
+ 	    if (state == 0 && (tc&0xff00) == 0xdf00) {
+ 		state = 1;
+ 		ttype = tc & 0xff;
+ 	    }
+ 	    else if (state == 1 && (tc & 0xff00) == 0xdf00) {
+ 		state = 3;
+ 		break;
+ 	    }
+ 	    else state = 0;
+ 	    if (newpc - pc > 20000) break;
+ 	    newpc += 2;
+ 	}
+ 	if (state == 3) ttadd(pc, newpc, ttype);	/* add to cache */
+     }
+     if (state != 3) {
+ 	printf("No trace table for pc %x, making one up.\n", pc);
+ 	tf->nParms = 0;
+ 	tf->firstReg = 12;
+ 	tf->firstRLoc = frame+64;
+ 	rt_next_pc = read_memory_integer(frame+64+12, 4);
+ 	rt_next_frame = read_memory_integer(frame+64+4, 4);
+ 	return 0;
+     }
+     /* otherwise newpc is pointing at the last 'df' in the trace table */
+     else if (ttype == 3) {
+ 	/* funny trace table found by OBSERVATION (not doc) to be in program prolog */
+ 	return -1;		/* special value checked by recache_frames */
+     }
+     else if (ttype == 2) {
+ 	/* assembly: no registers were saved */
+ 	tf->nParms = 0;
+ 	tf->firstReg = 16;
+ 	tf->firstRLoc = 0;
+ 	rt_next_pc = read_register(15);		/* where we go back to */
+ 	rt_next_frame = frame;
+ 	tf->frame -= 100;		/* hack to eliminate duplicate tags */
+ 	return 0;
+     }
+     else if (ttype == 0x7f) {
+ 	/* special machine state frame saved by STACK_DUMMY */
+ 	tf->nParms = 0;
+ 	tf->firstReg = 16;
+ 	tf->firstRLoc = 0;
+ 	rt_next_pc = read_memory_integer(frame + 64 - 64, 4);
+ 	rt_next_frame = read_memory_integer(frame -64 + 13*4, 4);
+ 	return 0;
+     }
+     else {
+ 	/* C program, I hope */
+ 	nparms = (read_memory_integer(newpc+2, 1) >> 4) & 0x0f;
+ 	firstreg = ((tc=read_memory_integer(newpc+1, 1)) >> 4) & 0x0f;
+ 	optx = ((tc&4)? 1 : 0);	/* flags says if floating registers described */
+ 	offtype = read_memory_integer(newpc+optx+3, 1) & 0xff;
+ 	if ((offtype & 0xc0) == 0) {
+ 	    /* 6 bits of local offset */
+ 	    offset = offtype & 0x3f;
+ 	}
+ 	else if ((offtype & 0xc0) == 0x40) {
+ 	    /* 14 bits of local offset */
+ 	    offset = (offtype & 0x3f) << 8;
+ 	    offset += (read_memory_integer(newpc+optx+4, 1) & 0xff);
+ 	}
+ 	else if ((offtype & 0xc0) == 0x80) {
+ 	    /* 22 bits of local offset */
+ 	    offset = (offtype & 0x3f) << 8;
+ 	    offset += (read_memory_integer(newpc+optx+4, 1) & 0xff);
+ 	    offset <<= 8;
+ 	    offset += (read_memory_integer(newpc+optx+5, 1) & 0xff);
+ 	}
+ 	else if ((offtype & 0xc0) == 0xc0) {
+ 	    /* 30 bits of local offset */
+ 	    offset = (offtype & 0x3f) << 8;
+ 	    offset += (read_memory_integer(newpc+optx+4, 1) & 0xff);
+ 	    offset <<= 8;
+ 	    offset += (read_memory_integer(newpc+optx+5, 1) & 0xff);
+ 	    offset <<= 8;
+ 	    offset += (read_memory_integer(newpc+optx+6, 1) & 0xff);
+ 	}
+ 	offset <<= 2;
+ 	tf->nParms = nparms;
+ 	tf->firstReg = firstreg;
+ 	tf->firstRLoc = frame	/* initial frame location */
+ 	    + offset				/* to top of frame */
+ 	    - 36				/* pascal static link, incomings args and linkage */
+ 	    - (4*(16-firstreg));	/* space used by general regs */
+ 	rt_next_pc = read_memory_integer(tf->firstRLoc + 4*(15-firstreg), 4);
+ 	rt_next_frame = read_memory_integer(tf->firstRLoc + 4*(13-firstreg), 4);
+ 	return 0;
+     }
+ }
+ 
+ recache_frames() {
+     register long i, j;
+     long pc;
+     CORE_ADDR curfp;
+     struct rt_frame *tf;
+ 
+     pc = read_pc();
+     curfp = current_frame;
+     rtCount = 0;
+     /* these next special cases can only occur with frame #0; others can't make calls
+         in these intermediate states.
+     */
+     /* if pc points at br or brx, we're doing a return, so set the pc to the target */
+     i=read_memory_integer(pc, 2);
+     if ((i & 0xfe00) == 0xe800) {
+ 	/* we're looking at a br or brx instruction */
+ 	pc = read_register(i&0x0f);
+     }
+     /* also, if pc points at d9xx or c111 we're in the middle of a frame push, and should
+        use r15 for the pc.
+    */
+    if ((i & 0xff00) == 0xd900 || (i & 0xffff) == 0xc111) {
+ 	pc = read_register(15);
+    }
+     while (1) {
+ 	if (curfp <= 0x10000000 || curfp >= 0x20000000) break;
+ 	if (pc > 0x20000000) break;
+ 	/* otherwise try to add a new frame structure */
+ 	if (rtCount >= rtTTSize) break;
+ 	tf = &rtFrames[rtCount++];
+ 	tf->frame = curfp;
+ 	tf->pc = pc;
+ 	i = rt_num_regs(pc, tf);
+ 	if (i<0) {	/* exceptional values */
+ 	    rtCount--;		/* last frame was bogus */
+ 	    break;
+ 	}
+ 	/* now setup for next iteration */
+ 	pc = rt_next_pc;
+ 	curfp = rt_next_frame;
+     }
+ }
+ 
+ struct rt_frame *get_cached_frame(aframe)
+ CORE_ADDR aframe; {
+     register int i;
+     for(i=0;i<rtCount;i++) {
+ 	if (rtFrames[i].frame == aframe) return &rtFrames[i];
+     }
+     return 0;
+ }
+ 
+ long rt_prev_frame(frame)
+ register CORE_ADDR frame; {
+     register int i;
+     for(i=0;i<rtCount-1;i++) {
+ 	if (rtFrames[i].frame == frame) return rtFrames[i+1].frame;
+     }
+     return 0;
+ }
+ 
+ long rt_frame_reg(frame, reg)
+ CORE_ADDR frame;
+ register long reg; {
+     register struct rt_frame *tf;
+     tf = get_cached_frame(frame);
+     if (tf == 0) return 0;
+     if (tf->firstReg > reg) return 0;	/* didn't save this one! */
+     return read_memory_integer(tf->firstRLoc + 4 * (reg - tf->firstReg), 4);
+ }
+ 
+ long rt_frame_args(frame)
+ CORE_ADDR frame; {
+     register struct rt_frame *tf;
+     tf = get_cached_frame(frame);
+     if (!tf) return 0;
+     return tf->firstRLoc + 20 + 4*(16 - tf->firstReg);
+ }
+ #endif
+ 
+ blockinitialize() {initialize();}
+ 
  static
  initialize ()
  {
+ #ifdef ibm032
+ #ifdef CAMPHOR
+   add_com ("recache-frames", class_stack, recache_frames,
+       "Tell debugger to recompute PC/RT stack frame cache\n");
+ #endif
+ #endif
  }
  
  END_FILE
diff -c ../../gnu/gdb/breakpoint.c ./breakpoint.c
*** ../../gnu/gdb/breakpoint.c	Sat Apr  4 22:22:44 1987
--- ./breakpoint.c	Sun Apr 26 23:02:20 1987
***************
*** 94,99 ****
--- 94,100 ----
     of last breakpoint hit.  */
  
  struct command_line *breakpoint_commands;
+ char new_breakpoint_commands = 0; /* Zalman Stern, ITC 1/12/1987 */
  
  START_FILE
  
***************
*** 203,210 ****
      {
        execute_command (breakpoint_commands->line, 0);
        /* If command was "cont", breakpoint_commands is 0 now.  */
!       if (breakpoint_commands)
  	breakpoint_commands = breakpoint_commands->next;
      }
    clear_momentary_breakpoints ();
  }
--- 204,213 ----
      {
        execute_command (breakpoint_commands->line, 0);
        /* If command was "cont", breakpoint_commands is 0 now.  */
!       if (breakpoint_commands && !new_breakpoint_commands) /* Zalman Stern, ITC 1/12/1987 */
  	breakpoint_commands = breakpoint_commands->next;
+       else /* Zalman Stern, ITC 1/12/1987 */
+         new_breakpoint_commands = 0; /* Zalman Stern, ITC 1/12/1987 */
      }
    clear_momentary_breakpoints ();
  }
***************
*** 215,220 ****
--- 218,225 ----
  void
  clear_breakpoint_commands ()
  {
+   if (breakpoint_commands != 0) /* Zalman Stern, ITC 1/12/1987 */
+     new_breakpoint_commands = 1; /* Zalman Stern, ITC 1/12/1987 */
    breakpoint_commands = 0;
    breakpoint_auto_delete (0);
  }
***************
*** 921,926 ****
--- 926,933 ----
  struct cmd_list_element *enablelist;
  
  extern struct cmd_list_element *cmdlist;
+ 
+ breakinitialize() {initialize();}
  
  static
  initialize ()
diff -c ../../gnu/gdb/command.c ./command.c
*** ../../gnu/gdb/command.c	Sat Apr  4 22:24:07 1987
--- ./command.c	Sat Apr 25 17:18:15 1987
***************
*** 94,100 ****
  You are forbidden to forbid anyone else to use, share and improve
  what you give them.   Help stamp out software-hoarding!  */
  
- 
  #include "command.h"
  #include <stdio.h>
  
--- 94,99 ----
***************
*** 388,394 ****
      {
        if (nfound > 1 && allow_unknown >= 0)
  	{
! 	  *p = 0;
  	  ambbuf[0] = 0;
  	  for (c = list; c; c = c->next)
  	    if (!strncmp (*line, c->name, p - *line))
--- 387,393 ----
      {
        if (nfound > 1 && allow_unknown >= 0)
  	{
!           *p = 0;
  	  ambbuf[0] = 0;
  	  for (c = list; c; c = c->next)
  	    if (!strncmp (*line, c->name, p - *line))
diff -c ../../gnu/gdb/core.c ./core.c
*** ../../gnu/gdb/core.c	Sat Apr  4 22:27:23 1987
--- ./core.c	Mon Apr 27 13:20:47 1987
***************
*** 163,172 ****
  	int reg_offset;
  
  	/* 4.2bsd-style core dump */
  	val = myread (corechan, &u, sizeof u);
  	if (val < 0)
! 	  perror_with_name (filename);
  	data_start = exec_data_start;
  	data_end = data_start + NBPG * u.u_dsize;
  	stack_start = stack_end - NBPG * u.u_ssize;
  	data_offset = NBPG * UPAGES;
--- 163,180 ----
  	int reg_offset;
  
  	/* 4.2bsd-style core dump */
+ #ifdef ibm032
+ 	/* on ibm032, uarea is at the far end of the u pages */
+ 	lseek(corechan, UPAGES*NBPG - sizeof(u), 0);
+ #endif
  	val = myread (corechan, &u, sizeof u);
  	if (val < 0)
! 	  perror_with_name (execfile);
! #ifdef ibm032
! 	data_start = 0x10000000;
! #else
  	data_start = exec_data_start;
+ #endif
  	data_end = data_start + NBPG * u.u_dsize;
  	stack_start = stack_end - NBPG * u.u_ssize;
  	data_offset = NBPG * UPAGES;
***************
*** 208,214 ****
  	  corefile = concat (dirname, "/", filename);
  	}
  
!       set_current_frame (read_register (FP_REGNUM));
        select_frame (get_current_frame (), 0);
        validate_files ();
      }
--- 216,222 ----
  	  corefile = concat (dirname, "/", filename);
  	}
  
!       set_current_frame (read_register (FP_REGNUM), 1);
        select_frame (get_current_frame (), 0);
        validate_files ();
      }
***************
*** 523,528 ****
--- 531,539 ----
  
  #endif /* not NEW_SUN_CORE */
  
+ 
+ coreinitialize() {initialize();}
+ 
  static
  initialize ()
  {
diff -c ../../gnu/gdb/dbxread.c ./dbxread.c
*** ../../gnu/gdb/dbxread.c	Sat Apr  4 22:29:54 1987
--- ./dbxread.c	Fri May 15 15:52:24 1987
***************
*** 28,33 ****
--- 28,36 ----
  #include "initialize.h"
  #include "symtab.h"
  #include "param.h"
+ #ifdef CAMPHOR
+ #include "value.h"
+ #endif
  
  static void add_symbol_to_list ();
  static void read_dbx_symtab ();
***************
*** 89,94 ****
--- 92,109 ----
    int prev_line_number;
  };
  
+ /*  When dealing with dynamically loaded objects, the symbol table in the sym file
+     does not match where we actually load the files.  Thus, gdb has to relocate those
+     symbols during dbxread.  This is only used by the camphor support code, and
+     probably should be under an ifdef camphor.  */
+ 
+ struct dlreloc
+   {
+     long text;
+     long data;
+     long bss;
+   } dlreloc;
+ 
  static struct subfile *subfiles;
  
  static struct subfile *current_subfile;
***************
*** 1015,1020 ****
--- 1030,1037 ----
    register int i, nbl;
    register struct blockvector *bv;
    register struct block *b;
+   int j;
+   struct symbol *ts1, *ts2;
  
    for (s = symtab_list; s; s = s->next)
      {
***************
*** 1025,1034 ****
--- 1042,1238 ----
  	  b = BLOCKVECTOR_BLOCK (bv, i);
  	  qsort (&BLOCK_SYM (b, 0), BLOCK_NSYMS (b),
  		 sizeof (struct symbol *), compare_symbols);
+           /* Register parms have two decls, but the register one is the only one of interest */
+ 	  /* So, trash the name of the bad one, since binary srch could get either.  Yucko. */
+ 	  /* doing name this way enables symbol freeing code to keep working */
+           for(j=1;j<BLOCK_NSYMS(b);j++)
+ 	     {
+ 		ts1 = BLOCK_SYM(b,j-1);
+                 ts2 = BLOCK_SYM(b, j);
+ 		if (SYMBOL_NAMESPACE(ts1) == VAR_NAMESPACE
+ 		 && SYMBOL_NAMESPACE(ts2) == VAR_NAMESPACE
+ 		 && strcmp(SYMBOL_NAME(ts1), SYMBOL_NAME(ts2)) == 0)
+ 		  {if (SYMBOL_CLASS(ts1) == LOC_REGISTER)
+ 		    {SYMBOL_CLASS(ts2) = LOC_REGISTER;
+ 		    SYMBOL_TYPE(ts2) = SYMBOL_TYPE(ts1);
+ 		    SYMBOL_VALUE(ts2) = SYMBOL_VALUE(ts1);
+ 		    }
+ 		  else if (SYMBOL_CLASS(ts2) == LOC_REGISTER )
+ 		    {SYMBOL_CLASS(ts1) = LOC_REGISTER;
+ 		    SYMBOL_TYPE(ts1) = SYMBOL_TYPE(ts2);
+ 		    SYMBOL_VALUE(ts1) = SYMBOL_VALUE(ts2);
+ 		    }
+ #ifdef notdef
+ 		  else printf("Check out def of symbol %s\n", SYMBOL_NAME(ts1));
+ #endif
+ 		  }
+ 	     }
  	}
      }
  }
  
+ 
+ #ifdef CAMPHOR
+ set_rel_command(exp)
+       char *exp;
+ {
+   struct expression *expr = (struct expression *) parse_c_expression (exp);
+   register value val;
+   register long temp;
+   register struct cleanup *old_chain
+     = make_cleanup (free_current_contents, &expr);
+   val = evaluate_expression (expr);
+   temp = value_as_long (val);
+   dlreloc.text = dlreloc.data = dlreloc.bss = temp;
+   printf("Relocation for all segs set to %x.\n", temp);
+   do_cleanups (old_chain);
+ }
+ 
+ void
+ add_file_command (name)
+      char *name;
+ {
+   register int desc;
+   struct exec hdr;
+   struct nlist *nlist;
+   char *stringtab;
+   long buffer;
+   register int val;
+   extern void close ();
+   struct cleanup *old_chain;
+   int in_this_dir = 1;
+   struct symtab *symtab_temp;
+ 
+   dont_repeat ();
+ 
+   if (name == 0)
+     error_no_arg ("file to add symbols from");
+ 
+   if (symtab_list && !query ("Add more symbols from \"%s\"? ", name))
+     error ("Not confirmed.");
+ 
+   if (symfile)
+     free (symfile);
+   symfile = 0;
+ 
+   desc = open (name, 0);
+   if (desc < 0)
+     {
+       if ((desc = openp (getenv ("BZPATH"), name, 0, 0)) < 0)
+         if ((desc = openp (getenv ("CLASSPATH"), name, 0, 0)) < 0)
+           desc = openp (getenv ("PATH"), name, 0, 0);
+ 
+       in_this_dir = 0;
+     }
+   if (desc < 0)
+     perror_with_name (name);
+ 
+   old_chain = make_cleanup (close, desc);
+ 
+   val = myread (desc, &hdr, sizeof hdr);
+   if (val < 0)
+     perror_with_name (name);
+ 
+   if (N_BADMAG (hdr))
+     error ("File \"%s\" not in executable format.", name);
+ 
+   if (hdr.a_syms == 0)
+     {
+       free_all_symtabs ();		/* check this */
+       return;
+     }
+ 
+   /* Now read the string table, all at once.  */
+   val = lseek (desc, N_SYMOFF (hdr) + hdr.a_syms, 0);
+   if (val < 0)
+     perror_with_name (name);
+   val = myread (desc, &buffer, sizeof buffer);
+   if (val < 0)
+     perror_with_name (name);
+   stringtab = (char *) alloca (buffer);
+   bcopy (&buffer, stringtab, sizeof buffer);
+   val = myread (desc, stringtab + sizeof buffer, buffer - sizeof buffer);
+   if (val < 0)
+     perror_with_name (name);
+ 
+ #ifdef READ_GDB_SYMSEGS
+   /* That puts us at the symsegs.  Read them.  */
+   symseg_chain = read_symsegs (desc, name);
+   hash_symsegs ();
+ #else
+   /* Where people are using the 4.2 ld program, must not check for
+      symsegs, because that ld puts randonm garbage at the end of
+      the output file and that would trigger an error message.  */
+   symseg_chain = 0;
+ #endif
+ 
+   /* Position to read the symbol table.  Do not read it all at once. */
+   val = lseek (desc, N_SYMOFF (hdr), 0);
+   if (val < 0)
+     perror_with_name (name);
+ 
+   printf ("Reading symbol data from %s...", name);
+   fflush (stdout);
+ 
+   init_misc_functions ();
+   make_cleanup (discard_misc_bunches, 0);
+   init_header_files ();
+   make_cleanup (free_header_files, 0);
+ 
+  /* Remember symtab_list to check if the added file had any dbx info in it. */
+   symtab_temp = symtab_list;
+ 
+   /* Now that the symbol table data of the executable file are all in core,
+      process them and define symbols accordingly.  Closes desc.  */
+ 
+   read_dbx_symtab (desc, stringtab, hdr.a_syms / sizeof (struct nlist));
+ 
+   if (symtab_list == symtab_temp) {
+     printf("\n%s not compiled with -g, debugging posibilities are limited.\n", name);
+     fflush(stdout);
+   }
+   else {
+ 
+   /* Sort symbols alphabetically within each block.  */
+ 
+     sort_syms ();
+ 
+   /* Go over the misc functions and install them in vector.  */
+ 
+     condense_misc_bunches ();
+ 
+   /* Make a default for file to list.  */
+ 
+     select_source_symtab (symtab_list);
+   }
+ 
+   do_cleanups (old_chain);
+ 
+   /* Free the symtabs made by read_symsegs, but not their contents,
+      which have been copied into symtabs on symtab_list.  */
+   while (symseg_chain)
+     {
+       register struct symtab *s = symseg_chain->next;
+       free (symseg_chain);
+       symseg_chain = s;
+     }
+ 
+   if (in_this_dir && name[0] != '/')
+     {
+       char dirname[MAXPATHLEN];
+ 
+       getwd (dirname);
+       symfile = concat (dirname, "/",
+ 			savestring (name, strlen (name)));
+     }
+   else
+     symfile = savestring (name, strlen (name));
+ 
+   printf ("done.\n");
+   fflush (stdout);
+ }
+ #endif
+ 
  /* This is the symbol-file command.  Read the file, analyze its symbols,
     and add a struct symtab to symtab_list.  */
  
***************
*** 1047,1052 ****
--- 1251,1263 ----
  
    dont_repeat ();
  
+ #ifdef CAMPHOR
+   /* this command does not deal with automatically relocated stuff */
+   dlreloc.text = 0;
+   dlreloc.data = 0;
+   dlreloc.bss = 0;
+ #endif
+ 
    if (name == 0)
      error_no_arg ("file to read symbols from");
  
***************
*** 1130,1151 ****
  
    read_dbx_symtab (desc, stringtab, hdr.a_syms / sizeof (struct nlist));
  
    /* Sort symbols alphabetically within each block.  */
  
!   sort_syms ();
  
    /* Go over the misc functions and install them in vector.  */
  
!   condense_misc_bunches ();
  
    /* Don't allow char * to have a typename (else would get caddr_t.)  */
  
!   TYPE_NAME (lookup_pointer_type (builtin_type_char)) = 0;
  
    /* Make a default for file to list.  */
  
!   select_source_symtab (symtab_list);
  
    symfile = savestring (name, strlen (name));
  
    do_cleanups (old_chain);
--- 1341,1372 ----
  
    read_dbx_symtab (desc, stringtab, hdr.a_syms / sizeof (struct nlist));
  
+   /* Check to make sure file was compiled with -g. */
+ 
+   if (symtab_list == NULL) {
+     printf("\n%s not compiled with -g, debugging posibilities are limited.\n", name);
+     fflush(stdout);
+   }
+   else {
+ 
    /* Sort symbols alphabetically within each block.  */
  
!     sort_syms ();
  
    /* Go over the misc functions and install them in vector.  */
  
!     condense_misc_bunches ();
  
    /* Don't allow char * to have a typename (else would get caddr_t.)  */
  
!     TYPE_NAME (lookup_pointer_type (builtin_type_char)) = 0;
  
    /* Make a default for file to list.  */
  
!     select_source_symtab (symtab_list);
  
+   }
+ 
    symfile = savestring (name, strlen (name));
  
    do_cleanups (old_chain);
***************
*** 1204,1209 ****
--- 1425,1440 ----
      {
        fread (&buf, sizeof buf, 1, stream);
        namestring = buf.n_un.n_strx ? buf.n_un.n_strx + stringtab : 0;
+ #ifdef CAMPHOR
+       if ((buf.n_type & N_TYPE) == N_UNDF) {
+ 	  /* don't screw around with undefined symbols */
+       }
+       else {
+ 	if ((buf.n_type & N_TYPE) == N_TEXT) buf.n_value += dlreloc.text;
+ 	else if ((buf.n_type & N_TYPE) == N_DATA) buf.n_value += dlreloc.data;
+ 	else if ((buf.n_type & N_TYPE) == N_BSS) buf.n_value += dlreloc.bss;
+       }
+ #endif
        if (buf.n_type & N_STAB)
  	process_one_symbol (buf.n_type, buf.n_desc,
  			    buf.n_value, namestring);
***************
*** 1356,1361 ****
--- 1587,1596 ----
      }
  }
  
+ #ifdef ibm032
+ static  char hcState;		/* two different, incompatible compilers for the RT */
+ #endif
+   
  static void
  process_one_symbol (type, desc, value, name)
       int type, desc;
***************
*** 1363,1369 ****
       char *name;
  {
    register struct context_stack *new;
!   
    /* Something is wrong if we see real data before
       seeing a source file name.  */
    
--- 1598,1633 ----
       char *name;
  {
    register struct context_stack *new;
!   char tname[256];
!   /* Now, there are two compilers for the RT, and they are seriously incompatible.
!       pcc is just like normal c compilers: stabs for a block occur before the LBRAC
!       stab for that same block.  Thus this code squirrels them away in the context
!       and when the RBRAC is hit, restores local_symbols as of the time the LBRAC
!       was encountered, and adds these symbosl to the block that just ended.
!       
!       However, with the HC compiler, those symbols occur *after* the LBRAC symbol
!       declaring the block's start.  Totally incompatible, of course.  One expects no
!       less from IBM.  For hc compiled  programs, we use the symbols in local_symbols
!       *before* the RBRAC command pops the context stack.
!       
!       Amazingly enough, when we complained to IBM/Palo Alto about this incompatibility,
!       they claimed that Mark Linton (original author of dbx) liked the new way better, and
!       that he didn't even know that pcc used a different order.  Sorta explains some things
!       about dbx, n'est-ce pas?  Furthermore, of course, IBM  doesn't want to change
!       either pcc or hc.
! 
!       Anyway, hc and pcc compiled .o files often co-exist in programs.  How do we
!       tell which is which?  Stupid heuristic which doesn't work with programs
!       with no top-level locals or parameters: after seeing a function's start, if we see
!       an LBRAC before seeing a variable, then we are using hc, otherwise it is pcc.
!       Stupid heuristics are better than none, so we use it.
!       
!       The variable hcState is used to keep track of this crap.
!       0 ==> saw function symbol
!       1 ==> saw lbrac in state 0, this is hc.
!       2 ==> saw symbol in state 0, this is pcc.
!   */
! 
    /* Something is wrong if we see real data before
       seeing a source file name.  */
    
***************
*** 1384,1389 ****
--- 1648,1656 ----
  	 also the end of the lexical context for the previous function.  */
        new = context_stack;
        within_function = 1;
+ #ifdef ibm032
+       hcState = 0;
+ #endif
        if (new)
  	{
  	  /* Make a block for the local symbols within.  */
***************
*** 1400,1406 ****
--- 1667,1679 ----
        new->locals = 0;
        new->old_blocks = pending_blocks;
        new->start_addr = value;
+ #ifdef ibm032
+       strcpy(tname, ".");
+       strcat(tname, name);
+       new->name = define_symbol(value, tname);
+ #else
        new->name = define_symbol (value, name);
+ #endif
        local_symbols = 0;
        break;
  
***************
*** 1407,1412 ****
--- 1680,1688 ----
      case N_LBRAC:
        /* This "symbol" just indicates the start of an inner lexical
  	 context within a function.  */
+ #ifdef ibm032
+       if (hcState == 0) hcState = 1;
+ #endif
        new = (struct context_stack *) xmalloc (sizeof (struct context_stack));
        new->depth = desc;
        new->next = context_stack;
***************
*** 1422,1430 ****
        /* This "symbol" just indicates the end of an inner lexical
  	 context that was started with N_RBRAC.  */
        new = context_stack;
        if (new == 0 || desc != new->depth)
  	error ("Invalid symbol data: N_LBRAC/N_RBRAC symbol mismatch, symtab pos %d.", symnum);
-       local_symbols = new->locals;
        context_stack = new->next;
        /* If this is not the outermost LBRAC...RBRAC pair in the
  	 function, its local symbols preceded it, and are the ones
--- 1698,1711 ----
        /* This "symbol" just indicates the end of an inner lexical
  	 context that was started with N_RBRAC.  */
        new = context_stack;
+ #ifdef ibm032
+       if (hcState == 2)	/* pcc */
+ 	  local_symbols = new->locals;
+ #else
+       local_symbols = new->locals;
+ #endif
        if (new == 0 || desc != new->depth)
  	error ("Invalid symbol data: N_LBRAC/N_RBRAC symbol mismatch, symtab pos %d.", symnum);
        context_stack = new->next;
        /* If this is not the outermost LBRAC...RBRAC pair in the
  	 function, its local symbols preceded it, and are the ones
***************
*** 1443,1448 ****
--- 1724,1733 ----
  			new->start_addr + last_source_start_addr,
  			value + last_source_start_addr);
  	}
+ #ifdef ibm032
+       if (hcState == 1 && context_stack->next)	/* hc */
+         local_symbols = new->locals;		/* now we get them */
+ #endif
        free (new);
        break;
  
***************
*** 1493,1498 ****
--- 1778,1786 ----
        break;
  
      default:
+ #ifdef ibm032
+       if (hcState == 0) hcState = 2;
+ #endif
        if (name)
  	define_symbol (value, name);
      }
***************
*** 1553,1558 ****
--- 1841,1849 ----
  	 Dbx data never actually contains 'l'.  */
      case 'l':
        SYMBOL_CLASS (sym) = LOC_LOCAL;
+ #ifdef ibm032
+       if (hcState == 1) value += 1000000;		/* temporary hack until rel 3 pcc matches hc */
+ #endif
        SYMBOL_VALUE (sym) = value;
        SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
        add_symbol_to_list (sym, &local_symbols);
***************
*** 1572,1577 ****
--- 1863,1875 ----
        add_symbol_to_list (sym, &local_symbols);
        break;
  
+     case 'R':
+       SYMBOL_CLASS (sym) = LOC_REGISTER;
+       SYMBOL_VALUE (sym) = value;
+       SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
+       add_symbol_to_list (sym, &local_symbols);
+       break;
+ 
      case 'S':
        /* Static symbol at top level of file */
        SYMBOL_CLASS (sym) = LOC_STATIC;
***************
*** 1616,1622 ****
        break;
  
      default:
!       error ("Invalid symbol data: unknown symbol-type code `%c' at symtab pos %d.", deftype, symnum);
      }
    return sym;
  }
--- 1914,1928 ----
        break;
  
      default:
!       printf ("Unknown symbol-type code '%c' in dbx symbol table, assuming local.\n", deftype);
!       SYMBOL_CLASS (sym) = LOC_LOCAL;
! #ifdef ibm032
!       if (hcState == 1) value += 1000000;		/* temporary hack until rel 3 pcc matches hc */
! #endif
!       SYMBOL_VALUE (sym) = value;
!       SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
!       add_symbol_to_list (sym, &local_symbols);      
!       break;
      }
    return sym;
  }
***************
*** 1741,1746 ****
--- 2047,2056 ----
  	(*pp) += 5;
        else if (!strncmp (*pp, "r(0,1);0;", 9))
  	(*pp) += 9;
+ #if 1
+       else if ((**pp == 'r') && (!strncmp(*pp + 2, ";0;", 3)))
+         (*pp) += 5;
+ #endif
        else break;
  
        TYPE_CODE (type) = TYPE_CODE_ARRAY;
***************
*** 1980,1986 ****
       rather than -128 which is what I would like.
       So use n1 != 0 to prevent char from being taken as unsigned.  */
  
!   else if (n2 == 0 && n1 == 1)
      {
        /* an unsigned type */
        if (n3 == (1 << (8 * sizeof (int))))
--- 2290,2296 ----
       rather than -128 which is what I would like.
       So use n1 != 0 to prevent char from being taken as unsigned.  */
  
!   if (n2 == 0)
      {
        /* an unsigned type */
        if (n3 == (1 << (8 * sizeof (int))))
***************
*** 1989,1994 ****
--- 2299,2306 ----
  	return builtin_type_unsigned_short;
        if (n3 == (1 << (8 * sizeof (char))))
  	return builtin_type_unsigned_char;
+       if (n3 == (1 << (8 * sizeof (char) - 1)))
+ 	return builtin_type_char;
      }
    else
      {
***************
*** 2002,2007 ****
--- 2314,2321 ----
        if (n3 == (1 << (8 * sizeof (char) - 1)))
  	return builtin_type_char;
      }
+    if (n2 == 0 && n3 == 1)
+     return builtin_type_void;
    error ("Invalid symbol data: range type spec %s at symtab pos %d.",
  	 errp - 1, symnum);
  }
***************
*** 2033,2040 ****
--- 2347,2364 ----
  
    /* Read the digits, as far as they go.  */
  
+ #if 0 /* Yet another "Compiler sucks" fix. */
    while ((c = *p++) >= '0' && c <= '9')
+ #else
+   while (((c = *p++) >= '0' && c <= '9') || ((end != '\n') && (c == '\n')))
+ #endif
      {
+ #if 1
+       if (c == '\n') {
+         printf("Ignoring bogus newline in stabs entry. Your compiler should be fixed.\n");
+         continue;
+       }
+ #endif
        n *= 10;
        n += c - '0';
      }
***************
*** 2050,2060 ****
--- 2374,2392 ----
    return n * sign;
  }
  
+ dbxinitialize() {initialize();}
+ 
  static
  initialize ()
  {
    symfile = 0;
  
+ #ifdef CAMPHOR
+   add_com ("add-file", class_files, add_file_command,
+            "Add a new symbol table (in dbx format) from file FILE.");
+   add_com("set-rel", class_files, set_rel_command,
+            "Set relocation for add-file command to NUMBER.");
+ #endif
    add_com ("symbol-file", class_files, symbol_file_command,
  	   "Load symbol table (in dbx format) from executable file FILE.");
  }
diff -c ../../gnu/gdb/environ.c ./environ.c
*** ../../gnu/gdb/environ.c	Sat Apr  4 22:31:16 1987
--- ./environ.c	Sun Apr 26 23:48:05 1987
***************
*** 129,135 ****
  
    if (e->allocated < i)
      {
!       e->allocated = max (i, e->allocated + 10);
        e->vector = (char **) xrealloc (e->vector,
  				      (e->allocated + 1) * sizeof (char *));
      }
--- 129,136 ----
  
    if (e->allocated < i)
      {
!       e->allocated = i + 10;
        e->vector = (char **) xrealloc (e->vector,
  				      (e->allocated + 1) * sizeof (char *));
      }
diff -c ../../gnu/gdb/eval.c ./eval.c
*** ../../gnu/gdb/eval.c	Sat Apr  4 22:32:36 1987
--- ./eval.c	Mon Apr 27 00:01:27 1987
***************
*** 546,551 ****
--- 546,553 ----
      }
  }
  
+ evalinitialize() {initialize();}
+ 
  static
  initialize ()
  { }
diff -c ../../gnu/gdb/expread.y ./expread.y
*** ../../gnu/gdb/expread.y	Sat Apr  4 22:35:27 1987
--- ./expread.y	Sun Apr 26 23:56:51 1987
***************
*** 650,655 ****
--- 650,656 ----
  	    ;
  	  else
  	    {
+ 	      /*N.B. error does a longjmp, so we do not have to worry about storage */
  	      err_copy = (char *) alloca (olen + 1);
  	      bcopy (lexptr, err_copy, olen);
  	      err_copy[olen] = 0;
***************
*** 945,953 ****
  {
    register int len = sizeof (struct expression) +
  				    expr->nelts * sizeof (union exp_element);
!   register struct expression *temp
!     = (struct expression *) alloca (len);
    register int inpos = expr->nelts, outpos = 0;
  
    /* Copy the original expression into temp.  */
    bcopy (expr, temp, len);
--- 946,955 ----
  {
    register int len = sizeof (struct expression) +
  				    expr->nelts * sizeof (union exp_element);
!   register struct expression *temp;
    register int inpos = expr->nelts, outpos = 0;
+ 
+   temp = (struct expression *) alloca(len);
  
    /* Copy the original expression into temp.  */
    bcopy (expr, temp, len);
diff -c ../../gnu/gdb/findvar.c ./findvar.c
*** ../../gnu/gdb/findvar.c	Sat Apr  4 22:36:38 1987
--- ./findvar.c	Mon Apr 27 00:01:44 1987
***************
*** 359,364 ****
--- 359,366 ----
    return value_cast (lookup_pointer_type (SYMBOL_TYPE (var)),
  		     value_from_long (builtin_type_long, addr));
  }
+ 
+ findinitialize() {initialize();}
  
  static
  initialize ()
diff -c ../../gnu/gdb/firstfile.c ./firstfile.c
*** ../../gnu/gdb/firstfile.c	Sat Apr  4 22:37:06 1987
--- ./firstfile.c	Mon Apr 27 00:02:06 1987
***************
*** 125,130 ****
--- 125,152 ----
  static initialize_dummy_1 ();
  static initialize_dummy_2 ();
  
+ initialize_all_files() {
+     blockinitialize();
+     breakinitialize();
+     coreinitialize();
+     dbxinitialize();
+     evalinitialize();
+     findinitialize();
+     infcmdinitialize();
+     inflowinitialize();
+     infruninitialize();
+     symmiscinitialize();
+     symtabinitialize();
+     valarithinitialize();
+     valopsinitialize();
+     valprintinitialize();
+     valuesinitialize();
+     printcmdinitialize();
+     sourceinitialize();
+     stackinitialize();
+ }
+ 
+ #if 0
  initialize_all_files ()
  {
    initialize_next_file ((char *) initialize_dummy_2
***************
*** 148,153 ****
--- 170,176 ----
  initialize_dummy_2 ()
  {
  }
+ #endif
  
  /* This makes the function initialize_next_file.  */
  
diff -c ../../gnu/gdb/frame.h ./frame.h
*** ../../gnu/gdb/frame.h	Sat Apr  4 22:37:22 1987
--- ./frame.h	Mon Apr 27 00:02:14 1987
***************
*** 20,25 ****
--- 20,35 ----
  
  /* Note that frame.h requires param.h! */
  
+ #ifdef ibm032
+ struct rt_frame {
+     CORE_ADDR frame;		/* frame address */
+     CORE_ADDR pc;			/* pc we called from */
+     CORE_ADDR firstRLoc;	/* loc'n of first saved general reg */
+     short nParms;			/* number of parameters to this frame */
+     short firstReg;			/* the reg stored at 64(fp) */
+ };
+ #endif
+ 
  #define FRAME CORE_ADDR
  
  struct frame_info
***************
*** 62,64 ****
--- 72,77 ----
  extern struct block *get_selected_block ();
  extern struct symbol *get_frame_function ();
  extern struct symbol *get_pc_function ();
+ #ifdef ibm032
+ extern struct rt_frame *get_cached_frame();
+ #endif
diff -c ../../gnu/gdb/infcmd.c ./infcmd.c
*** ../../gnu/gdb/infcmd.c	Sat Apr  4 22:47:22 1987
--- ./infcmd.c	Mon Apr 27 00:07:53 1987
***************
*** 39,45 ****
  /* String containing arguments to give to the program,
     with a space added at the front.  Just a space means no args.  */
  
! static char *inferior_args;
  
  /* Pid of our debugged inferior, or 0 if no inferior now.  */
  
--- 39,45 ----
  /* String containing arguments to give to the program,
     with a space added at the front.  Just a space means no args.  */
  
! static char *inferior_args = NULL;
  
  /* Pid of our debugged inferior, or 0 if no inferior now.  */
  
***************
*** 112,119 ****
  set_args_command (args)
       char *args;
  {
!   free (inferior_args);
!   if (!args) args = "";
    inferior_args = concat (" ", args, "");
  }
  
--- 112,121 ----
  set_args_command (args)
       char *args;
  {
!   if (inferior_args != NULL)
!     free (inferior_args);
!   if (!args)
!     args = "";
    inferior_args = concat (" ", args, "");
  }
  
***************
*** 171,177 ****
        signal (SIGINT, SIG_DFL);  */
  
        ptrace (0);
!       execle ("/bin/sh", "sh", "-c", allargs, 0,
  	      environ_vector (inferior_environ));
  
        fprintf (stderr, "Cannot exec /bin/sh: %s.\n",
--- 173,180 ----
        signal (SIGINT, SIG_DFL);  */
  
        ptrace (0);
! 
!       execle ("/bin/csh", "csh", "-f", "-c", allargs, 0,
  	      environ_vector (inferior_environ));
  
        fprintf (stderr, "Cannot exec /bin/sh: %s.\n",
***************
*** 473,478 ****
--- 476,482 ----
  
        retbuf[0] = stop_r0;
        retbuf[1] = stop_r1;
+ 
        val = value_being_returned (value_type, retbuf);
        printf ("Value returned is $%d = ", record_latest_value (val));
        value_print (val, stdout);
***************
*** 705,710 ****
--- 709,716 ----
    printf ("Contents are relative to selected stack frame.\n");
  }
  
+ infcmdinitialize() {initialize();}
+ 
  static
  initialize ()
  {
diff -c ../../gnu/gdb/inflow.c ./inflow.c
*** ../../gnu/gdb/inflow.c	Sat Apr  4 22:56:34 1987
--- ./inflow.c	Mon Apr 27 00:12:10 1987
***************
*** 188,194 ****
    inferior_pid = 0;
    mark_breakpoints_out ();
    if (have_core_file_p ())
!     set_current_frame (read_register (FP_REGNUM));
  }
  
  /* Resume execution of the inferior process.
--- 188,194 ----
    inferior_pid = 0;
    mark_breakpoints_out ();
    if (have_core_file_p ())
!     set_current_frame (read_register (FP_REGNUM), 1);
  }
  
  /* Resume execution of the inferior process.
***************
*** 266,271 ****
--- 266,274 ----
    char buf[MAX_REGISTER_RAW_SIZE];
    register int i;
  
+ #ifdef ibm032
+   offset += UPAGES*NBPG - sizeof(u);	/* ibm032: ustruct at end of uarea */
+ #endif
    offset = ptrace (3, inferior_pid, offset, 0) - KERNEL_U_ADDR;
    for (regno = 0; regno < NUM_REGS; regno++)
      {
***************
*** 291,296 ****
--- 294,303 ----
    register unsigned int regaddr;
    char buf[80];
  
+ #ifdef ibm032
+   offset += UPAGES*NBPG - sizeof(u);	/* ibm032: ustruct at end of uarea */
+ #endif
+ 
    offset = ptrace (3, inferior_pid, offset, 0) - KERNEL_U_ADDR;
  
    if (regno >= 0)
***************
*** 340,347 ****
    register int count
      = (((memaddr + len) - addr) + sizeof (int) - 1) / sizeof (int);
    /* Allocate buffer of that many longwords.  */
!   register int *buffer = (int *) alloca (count * sizeof (int));
  
    /* Read all the longwords */
    for (i = 0; i < count; i++, addr += sizeof (int))
      buffer[i] = ptrace (1, inferior_pid, addr, 0);
--- 347,355 ----
    register int count
      = (((memaddr + len) - addr) + sizeof (int) - 1) / sizeof (int);
    /* Allocate buffer of that many longwords.  */
!   register int *buffer;
  
+   buffer = (int *) alloca(count * sizeof(int));
    /* Read all the longwords */
    for (i = 0; i < count; i++, addr += sizeof (int))
      buffer[i] = ptrace (1, inferior_pid, addr, 0);
***************
*** 367,377 ****
    register int count
      = (((memaddr + len) - addr) + sizeof (int) - 1) / sizeof (int);
    /* Allocate buffer of that many longwords.  */
!   register int *buffer = (int *) alloca (count * sizeof (int));
    extern int errno;
  
    /* Fill start and end extra bytes of buffer with existing memory data.  */
  
    buffer[0] = ptrace (1, inferior_pid, addr, 0);
    if (count > 1)
      buffer[count - 1]
--- 375,386 ----
    register int count
      = (((memaddr + len) - addr) + sizeof (int) - 1) / sizeof (int);
    /* Allocate buffer of that many longwords.  */
!   register int *buffer;
    extern int errno;
  
    /* Fill start and end extra bytes of buffer with existing memory data.  */
  
+   buffer = (int *) alloca (count * sizeof (int));
    buffer[0] = ptrace (1, inferior_pid, addr, 0);
    if (count > 1)
      buffer[count - 1]
***************
*** 388,397 ****
      {
        errno = 0;
        ptrace (4, inferior_pid, addr, buffer[i]);
!       if (errno)
  	return 1;
      }
- 
    return 0;
  }
  
--- 397,406 ----
      {
        errno = 0;
        ptrace (4, inferior_pid, addr, buffer[i]);
!       if (errno) {
  	return 1;
+ 	}
      }
    return 0;
  }
  
***************
*** 421,426 ****
--- 430,437 ----
      }
  }
  
+ inflowinitialize() {initialize();}
+ 
  static
  initialize ()
  {
diff -c ../../gnu/gdb/infrun.c ./infrun.c
*** ../../gnu/gdb/infrun.c	Sat Apr  4 22:57:15 1987
--- ./infrun.c	Mon Apr 27 00:17:40 1987
***************
*** 257,263 ****
        pc_changed = 0;
        fetch_inferior_registers ();
        stop_pc = read_pc ();
!       set_current_frame (read_register (FP_REGNUM));
        stop_frame = get_current_frame ();
        stop_sp = read_register (SP_REGNUM);
        another_trap = 0;
--- 257,271 ----
        pc_changed = 0;
        fetch_inferior_registers ();
        stop_pc = read_pc ();
! #ifdef CAMPHOR
!       /* if we're not going to stop, don't bother with a stack trace */
!       if (WIFSTOPPED(w) && !signal_stop[WSTOPSIG(w)])
! 	  set_current_frame(read_register(FP_REGNUM), 0);
!       else
! 	  set_current_frame(read_register(FP_REGNUM), 1);
! #else
!       set_current_frame (read_register (FP_REGNUM), 1);
! #endif
        stop_frame = get_current_frame ();
        stop_sp = read_register (SP_REGNUM);
        another_trap = 0;
***************
*** 688,700 ****
  
    /* Save the function value return registers
       We might be about to restore their previous contents.  */
!   stop_r0 = read_register (0);
!   stop_r1 = read_register (1);
  
    if (stop_stack_dummy)
      {
        /* Pop the empty frame that contains the stack dummy.  */
        POP_FRAME;
        select_frame (read_register (FP_REGNUM), 0);
      }
  }
--- 696,717 ----
  
    /* Save the function value return registers
       We might be about to restore their previous contents.  */
! #ifdef ibm032
!     stop_r0 = read_register (2);
!     stop_r1 = read_register (3);
! #else
!     stop_r0 = read_register (0);
!     stop_r1 = read_register (1);
! #endif
  
    if (stop_stack_dummy)
      {
        /* Pop the empty frame that contains the stack dummy.  */
+ #ifdef ibm032
+       POP_DUMMY_FRAME;
+ #else
        POP_FRAME;
+ #endif
        select_frame (read_register (FP_REGNUM), 0);
      }
  }
***************
*** 841,846 ****
--- 858,865 ----
    printf ("\nUse the \"handle\" command to change these tables.\n");
  }
  
+ infruninitialize() {initialize();}
+ 
  static
  initialize ()
  {
diff -c ../../gnu/gdb/initialize.h ./initialize.h
*** ../../gnu/gdb/initialize.h	Sat Apr  4 22:58:27 1987
--- ./initialize.h	Sun May 24 00:19:21 1987
***************
*** 103,109 ****
--- 103,120 ----
     of the end of one object file's text to the start of the next
     object file's text.  */
  
+ /* Changed to use ifdefs on the machine type.  David Nichols, 11/28/86 */
+ #ifdef ibm032
+ #include "m-ibm032init.h"
+ #endif
+ 
+ #ifdef vax
  #include "m-vaxinit.h"
+ #endif
+ 
+ #ifdef sun
+ #include "m-suninit.h"
+ #endif
  
  /* This is used to make a file's initialization function.
     It calls another function named `initialize', which must
diff -c ../../gnu/gdb/main.c ./main.c
*** ../../gnu/gdb/main.c	Sat Apr  4 23:11:59 1987
--- ./main.c	Mon Apr 27 00:27:21 1987
***************
*** 236,241 ****
--- 236,243 ----
    if (*p)
      {
        c = lookup_cmd (&p, cmdlist, "", 0);
+       if (c->function == 0)
+ 	error ("That is not a command, just a help topic.");
        if (c->class == (int) class_user)
  	{
  	  if (*p)
***************
*** 457,463 ****
  
  /* Add an element to the list of commands.  */
  
! void
  add_com (name, class, fun, doc)
       char *name;
       int class;
--- 459,465 ----
  
  /* Add an element to the list of commands.  */
  
! struct cmd_list_element *
  add_com (name, class, fun, doc)
       char *name;
       int class;
***************
*** 464,470 ****
       void (*fun) ();
       char *doc;
  {
!   add_cmd (name, class, fun, doc, &cmdlist);
  }
  
  /* Add an alias or abbreviation command to the list of commands.  */
--- 466,473 ----
       void (*fun) ();
       char *doc;
  {
! 
!   return add_cmd (name, class, fun, doc, &cmdlist);
  }
  
  /* Add an alias or abbreviation command to the list of commands.  */
***************
*** 547,552 ****
--- 550,556 ----
  
    if (c && c->class == (int) class_user)
      free_command_lines (&c->function);
+ 
  
    add_com (comname, class_user, cmds,
  	   (c && c->class == (int) class_user)
diff -c ../../gnu/gdb/param.h ./param.h
*** ../../gnu/gdb/param.h	Sat Apr  4 23:15:44 1987
--- ./param.h	Mon Apr 27 00:28:17 1987
***************
*** 1 ****
--- 1,19 ----
+ /* Changed to use ifdefs so we don't have to edit it all the time.
+ David Nichols
+ 28 November 1986 */
+ 
+ #ifdef vax
  #include "m-vax.h"
+ #endif
+ 
+ #ifdef ibm032
+ #include "m-ibm032.h"
+ #endif
+ 
+ #ifdef sun
+ #ifdef mc68020
+ #include "m-sun3.h"
+ #else
+ #include "m-sun2.h"
+ #endif
+ #endif
diff -c ../../gnu/gdb/pinsn.c ./pinsn.c
*** ../../gnu/gdb/pinsn.c	Sat Apr  4 23:15:58 1987
--- ./pinsn.c	Mon Apr 27 00:28:36 1987
***************
*** 1 ****
--- 1,15 ----
+ /* Changed to use ifdefs so we don't have to edit this.
+ David Nichols
+ 28 Nov 1986 */
+ 
+ #ifdef ibm032
+ #include "ibm032-pinsn.c"
+ #endif
+ 
+ #ifdef vax
  #include "vax-pinsn.c"
+ #endif
+ 
+ #ifdef sun
+ #include "m68k-pinsn.c"
+ #endif
diff -c ../../gnu/gdb/printcmd.c ./printcmd.c
*** ../../gnu/gdb/printcmd.c	Sat Apr  4 23:17:03 1987
--- ./printcmd.c	Mon Apr 27 00:30:52 1987
***************
*** 797,804 ****
       CORE_ADDR frame;
       FILE *stream;
  {
!   char *space = (char *) alloca (TYPE_LENGTH (SYMBOL_TYPE (var)));
    value val = read_var_value (var, frame);
    value_print (val, stream);
  }
  
--- 797,805 ----
       CORE_ADDR frame;
       FILE *stream;
  {
!   char *space;
    value val = read_var_value (var, frame);
+   space = (char *) alloca (TYPE_LENGTH (SYMBOL_TYPE (var)));
    value_print (val, stream);
  }
  
***************
*** 883,888 ****
--- 884,891 ----
      }
  }
  
+ printcmdinitialize() {initialize();}
+ 
  static
  initialize ()
  {
diff -c ../../gnu/gdb/source.c ./source.c
*** ../../gnu/gdb/source.c	Sat Apr  4 23:17:55 1987
--- ./source.c	Mon Apr 27 00:31:25 1987
***************
*** 276,282 ****
    if (get_exec_file () != 0 && exec_mtime < st.st_mtime)
      printf ("Source file is more recent than executable.\n");
  
!   data = (char *) alloca (st.st_size);
    myread (desc, data, st.st_size, s->filename);
    end = data + st.st_size;
    p = data;
--- 276,283 ----
    if (get_exec_file () != 0 && exec_mtime < st.st_mtime)
      printf ("Source file is more recent than executable.\n");
  
!   data = (char *) alloca(st.st_size);
! 
    myread (desc, data, st.st_size, s->filename);
    end = data + st.st_size;
    p = data;
***************
*** 530,535 ****
--- 531,538 ----
      printf ("Line number %d is out of range for \"%s\".\n",
  	    sal.line, sal.symtab->filename);
  }
+ 
+ sourceinitialize() {initialize();}
  
  static
  initialize ()
diff -c ../../gnu/gdb/stack.c ./stack.c
*** ../../gnu/gdb/stack.c	Sun Apr  5 00:28:05 1987
--- ./stack.c	Mon Apr 27 00:31:50 1987
***************
*** 511,516 ****
--- 511,517 ----
  
    print_stack_frame (selected_frame, selected_frame_level, 1);
  }
+ 
  
  static void
  return_command (retval_exp)
***************
*** 538,543 ****
--- 539,546 ----
    frame_command ("0", 1);
  }
  
+ stackinitialize() {initialize();}
+ 
  static
  initialize ()
  {
diff -c ../../gnu/gdb/symmisc.c ./symmisc.c
*** ../../gnu/gdb/symmisc.c	Sun Apr  5 00:33:16 1987
--- ./symmisc.c	Mon Apr 27 00:37:46 1987
***************
*** 504,509 ****
--- 504,511 ----
    return i;
  }
  
+ symmiscinitialize() {initialize();}
+ 
  static
  initialize ()
  {
diff -c ../../gnu/gdb/symtab.c ./symtab.c
*** ../../gnu/gdb/symtab.c	Sun Apr  5 00:35:45 1987
--- ./symtab.c	Mon Apr 27 00:38:19 1987
***************
*** 71,78 ****
    strcpy (copy, name);
    strcat (copy, ".c");
    for (s = symtab_list; s; s = s->next)
!     if (!strcmp (copy, s->filename))
        return s;
  
    return 0;
  }
--- 71,79 ----
    strcpy (copy, name);
    strcat (copy, ".c");
    for (s = symtab_list; s; s = s->next)
!     if (!strcmp (copy, s->filename)) {
        return s;
+     }
  
    return 0;
  }
***************
*** 703,709 ****
    register struct symbol *sym;
    register CORE_ADDR pc;
    register int i;
!   char *copy;
  
    /* Defaults have defaults.  */
  
--- 704,710 ----
    register struct symbol *sym;
    register CORE_ADDR pc;
    register int i;
!   char *copy, *dotcopy;
  
    /* Defaults have defaults.  */
  
***************
*** 818,825 ****
--- 819,847 ----
    /* Look up that token as a function.
       If file specified, use that file's per-file block to start with.  */
  
+ #ifdef ibm032
+   /* RT has stupid dots in front of function names (_.foo), and worse, has bogus _foo
+       symbol to confuse us, too.
+   */
+   if (*copy != '.') {
+       dotcopy = (char *) alloca (strlen(copy)+2);	/* one for the null and one for the dot */
+       dotcopy[0] = '.';
+       strcpy(dotcopy+1, copy);
+       sym = lookup_symbol (dotcopy, s ? BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), 1) : 0,
+ 			   VAR_NAMESPACE);
+       }
+   else {
+       sym = 0;
+       dotcopy = 0;
+   }
+   if (!sym || SYMBOL_CLASS(sym) != LOC_BLOCK) {
+       sym = lookup_symbol (copy, s ? BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), 1) : 0,
+ 	   VAR_NAMESPACE);
+   }
+ #else
    sym = lookup_symbol (copy, s ? BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), 1) : 0,
  		       VAR_NAMESPACE);
+ #endif
  
    if (sym && SYMBOL_CLASS (sym) == LOC_BLOCK)
      {
***************
*** 835,840 ****
--- 857,875 ----
    if (sym)
      error ("%s is not a function.", copy);
  
+ #ifdef ibm032
+   /* try the dot version first */
+   if (dotcopy) for (i = 0; i < misc_function_count; i++)
+     if (!strcmp (misc_function_vector[i].name, dotcopy))
+       {
+ 	value.symtab = 0;
+ 	value.line = 0;
+ 	value.pc = misc_function_vector[i].address + FUNCTION_START_OFFSET;
+ 	if (funfirstline)
+ 	  SKIP_PROLOGUE (value.pc);
+ 	return value;
+       }
+ #endif
    for (i = 0; i < misc_function_count; i++)
      if (!strcmp (misc_function_vector[i].name, copy))
        {
***************
*** 1027,1032 ****
--- 1062,1069 ----
  
    return type;
  }
+ 
+ symtabinitialize() {initialize();}
  
  static
  initialize ()
diff -c ../../gnu/gdb/utils.c ./utils.c
*** ../../gnu/gdb/utils.c	Sun Apr  5 00:40:01 1987
--- ./utils.c	Mon Apr 27 00:40:01 1987
***************
*** 151,156 ****
--- 151,157 ----
    else
      err = "unknown error";
  
+   /* ibm032: no core leak or other problems 'cause we alway call error -> longjmps away */
    combined = (char *) alloca (strlen (err) + strlen (string) + 3);
    strcpy (combined, string);
    strcat (combined, ": ");
diff -c ../../gnu/gdb/valarith.c ./valarith.c
*** ../../gnu/gdb/valarith.c	Sun Apr  5 00:40:44 1987
--- ./valarith.c	Fri May 22 20:18:46 1987
***************
*** 239,245 ****
    COERCE_ARRAY (arg1);
  
    len = TYPE_LENGTH (VALUE_TYPE (arg1));
!   p = VALUE_CONTENTS (arg1);
  
    while (--len >= 0)
      {
--- 239,245 ----
    COERCE_ARRAY (arg1);
  
    len = TYPE_LENGTH (VALUE_TYPE (arg1));
!   p = (char *) VALUE_CONTENTS (arg1);
  
    while (--len >= 0)
      {
***************
*** 281,288 ****
  	   && ((len = TYPE_LENGTH (VALUE_TYPE (arg1)))
  	       == TYPE_LENGTH (VALUE_TYPE (arg2))))
      {
!       p1 = VALUE_CONTENTS (arg1);
!       p2 = VALUE_CONTENTS (arg2);
        while (--len >= 0)
  	{
  	  if (*p1++ != *p2++)
--- 281,288 ----
  	   && ((len = TYPE_LENGTH (VALUE_TYPE (arg1)))
  	       == TYPE_LENGTH (VALUE_TYPE (arg2))))
      {
!       p1 = (char *) VALUE_CONTENTS (arg1);
!       p2 = (char *) VALUE_CONTENTS (arg2);
        while (--len >= 0)
  	{
  	  if (*p1++ != *p2++)
***************
*** 348,353 ****
--- 348,355 ----
    return value_from_long (VALUE_TYPE (arg1), ~ value_as_long (arg1));
  }
  
+ valarithinitialize() {initialize();}
+ 
  static
  initialize ()
  {
diff -c ../../gnu/gdb/valops.c ./valops.c
*** ../../gnu/gdb/valops.c	Sun Apr  5 00:41:32 1987
--- ./valops.c	Fri May 22 20:13:02 1987
***************
*** 174,180 ****
    /* Return a value just like TOVAL except with the contents of FROMVAL.  */
  
    val = allocate_value (type);
!   bcopy (toval, val, VALUE_CONTENTS (val) - (char *) val);
    bcopy (VALUE_CONTENTS (fromval), VALUE_CONTENTS (val), TYPE_LENGTH (type));
  
    return val;
--- 174,180 ----
    /* Return a value just like TOVAL except with the contents of FROMVAL.  */
  
    val = allocate_value (type);
!   bcopy (toval, val, (char *) VALUE_CONTENTS (val) - (char *) val);
    bcopy (VALUE_CONTENTS (fromval), VALUE_CONTENTS (val), TYPE_LENGTH (type));
  
    return val;
***************
*** 413,419 ****
--- 413,427 ----
        }
      else if (code == TYPE_CODE_PTR)
        {
+ #ifdef ibm032
+ 	/* apparently '_a' pseudoprocedure has lval_memory as its lval type */
+ 	if (VALUE_LVAL(function) == lval_memory) 
+ 	  funaddr = VALUE_ADDRESS(function);
+ 	else
+           funaddr = value_as_long (function);
+ #else
  	funaddr = value_as_long (function);
+ #endif
  	if (TYPE_CODE (TYPE_TARGET_TYPE (ftype))
  	    == TYPE_CODE_FUNC)
  	  value_type = TYPE_TARGET_TYPE (TYPE_TARGET_TYPE (ftype));
***************
*** 429,439 ****
  	else
  	  /* Handle integer used as address of a function.  */
  	  funaddr = value_as_long (function);
- 
  	value_type = builtin_type_int;
        }
!     else
        error ("Invalid data type for function to be called.");
  
      /* Create a call sequence customized for this function
         and the number of arguments for it.  */
--- 437,447 ----
  	else
  	  /* Handle integer used as address of a function.  */
  	  funaddr = value_as_long (function);
  	value_type = builtin_type_int;
        }
!     else {
        error ("Invalid data type for function to be called.");
+     }
  
      /* Create a call sequence customized for this function
         and the number of arguments for it.  */
***************
*** 590,595 ****
--- 598,605 ----
    return value_field (arg1, i);
  }
  
+ valopsinitialize() {initialize();}
+ 
  static
  initialize ()
  { }
diff -c ../../gnu/gdb/valprint.c ./valprint.c
*** ../../gnu/gdb/valprint.c	Sun Apr  5 00:42:28 1987
--- ./valprint.c	Mon Apr 27 00:40:56 1987
***************
*** 529,534 ****
--- 529,536 ----
    print_max = atoi (arg);
  }
  
+ valprintinitialize() {initialize();}
+ 
  static
  initialize ()
  {
diff -c ../../gnu/gdb/value.h ./value.h
*** ../../gnu/gdb/value.h	Sun Apr  5 00:43:44 1987
--- ./value.h	Fri May 22 20:03:32 1987
***************
*** 37,43 ****
      short repeated;
      short repetitions;
      short regno;
!     char contents[1];
    };
  
  typedef struct value *value;
--- 37,43 ----
      short repeated;
      short repetitions;
      short regno;
!     long contents[1]; /* Forces alignment... */
    };
  
  typedef struct value *value;
diff -c ../../gnu/gdb/values.c ./values.c
*** ../../gnu/gdb/values.c	Sun Apr  5 00:45:14 1987
--- ./values.c	Fri May 22 20:12:40 1987
***************
*** 338,344 ****
       int offset, bitpos, bitsize;
       value newval;
  {
!   register char *addr = VALUE_CONTENTS (var->value) + offset;
    if (bitsize)
      modify_field (addr, value_as_long (newval),
  		  bitpos, bitsize);
--- 338,344 ----
       int offset, bitpos, bitsize;
       value newval;
  {
!   register char *addr = (char *) VALUE_CONTENTS (var->value) + offset;
    if (bitsize)
      modify_field (addr, value_as_long (newval),
  		  bitpos, bitsize);
***************
*** 733,738 ****
--- 733,740 ----
    write_register (1, retbuf[1]);
  }
  
+ valuesinitialize() {initialize();}
+ 
  static
  initialize ()
  {