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
|
# Start with a fresh gdb
gdb_exit
gdb_start
#
# test default actions of gdb commands
#
load_lib gdb.exp
gdb_test "add-symbol-file" "add-symbol-file takes a file name and an address"
setup_xfail "mips-idt-*"
send "attach\n"
expect {
-re "Argument required .(process-id|program) to attach.*$prompt $"\
{ pass "attach" }
-re "You can't do that when your target is `None'.*$prompt $"\
{ pass "attach" }
-re "Don't know how to attach. Try \"help target\"..*$prompt $"\
{ pass "attach" }
-re "Kill it. .y or n." {
send "y\n"
exp_continue
}
-re "$prompt $" { fail "attach" }
timeout { fail "(timeout) attach" }
}
# FIXME: attach kills the udi connection
if [istarget "a29k-*-udi"] then {
gdb_exit
gdb_start
}
gdb_test "break" "No default breakpoint address now."
foreach i "b br bre brea" {
gdb_test $i "No default breakpoint address now." "break \"$i\" abbreviation"
}
setup_xfail "mips-idt-*" "a29k-*-udi" "h8300-*-hms"
gdb_test "backtrace" "No stack."
foreach i "bt ba bac" {
setup_xfail "mips-idt-*" "a29k-*-udi" "h8300-*-hms"
gdb_test $i "No stack." "backtrace \"$i\" abbreviation"
}
# This works on the MIPS IDT board, but confuses future tests.
if ![istarget "mips-idt-*"] then {
setup_xfail "a29k-*-udi"
gdb_test "continue" "The program is not being run."
setup_xfail "a29k-*-udi"
gdb_test "c" "The program is not being run." "continue \"c\" abbreviation"
}
# FIXME: continue kills the udi connection
if [istarget "a29k-*-udi"] then {
gdb_exit
gdb_start
}
#test call
send "call\n"
expect {
-re "The history is empty..*$prompt $"\
{ pass "call" }
-re ".*$prompt $" { fail "call" }
timeout { fail "(timeout) call" }
}
#test catch
send "catch\n"
expect {
-re "No selected frame..*$prompt $"\
{ pass "catch" }
-re ".*$prompt $" { fail "catch" }
timeout { fail "(timeout) catch" }
}
#test cd
send "cd\n"
expect {
-re "Argument required .new working directory.*$prompt $"\
{ pass "cd" }
-re ".*$prompt $" { fail "cd" }
timeout { fail "(timeout) cd" }
}
#test clear
send "clear\n"
expect {
-re "No source file specified..*$prompt $"\
{ pass "clear" }
-re ".*$prompt $" { fail "clear" }
timeout { fail "(timeout) clear" }
}
#test commands
send "commands\n"
expect {
-re "No breakpoint number 0..*$prompt $"\
{ pass "commands" }
-re ".*$prompt $" { fail "commands" }
timeout { fail "(timeout) commands" }
}
#test condition
send "condition\n"
expect {
-re "Argument required .breakpoint number.*$prompt $"\
{ pass "condition" }
-re ".*$prompt $" { fail "condition" }
timeout { fail "(timeout) condition" }
}
#test core-file
send "core-file\n"
expect {
-re "No core file now..*$prompt $"\
{ pass "core-file" }
-re "GDB can't read core files on this machine..*$prompt $"\
{ pass "core-file" }
-re ".*$prompt $" { fail "core-file" }
timeout { fail "(timeout) core-file" }
}
#test delete "d" abbreviation
send "d\n"
expect {
-re "$prompt $"\
{ pass "delete \"d\" abbreviation" }
timeout { fail "(timeout) delete \"d\" abbreviation" }
}
#test delete
send "delete\n"
expect {
-re "$prompt $"\
{ pass "delete" }
timeout { fail "(timeout) delete" }
}
#test define
send "define\n"
expect {
-re "Argument required \[(\]name of command to define\[)\]..*$prompt $"\
{ pass "define" }
timeout { fail "(timeout) define" }
}
#test delete breakpoints
send "delete breakpoints\n"
expect {
-re "$prompt $"\
{ pass "delete breakpoints" }
timeout { fail "(timeout) delete breakpoints" }
}
#test delete display
# FIXME -- need to dump full output to detailed log
send "delete display\n"
expect {
-re "delete display.*Delete all auto-display expressions.*y or n. $"\
{ send "y\n"
expect {
-re "$prompt $"\
{ pass "delete display prompt" }
timeout { fail "(timeout) delete display prompt" }
}
}
timeout { fail "(timeout) delete display prompt" }
}
#test detach
gdb_test "detach" ""
#send "detach\n"
#expect {
# -re "$prompt $"\
# { pass "detach" }
# timeout { fail "(timeout) detach" }
# }
# FIXME: continue kills the udi connection
if [istarget "a29k-*-udi"] then {
gdb_exit
gdb_start
}
if [istarget "h8300-*-hms"] then {
gdb_exit
gdb_start
}
#test directory
# FIXME -- need to dump full output to detailed log
send "directory\n"
expect {
-re "Reinitialize source path to empty.*y or n. $"\
{ send "y\n"
expect {
-re "Source directories searched: .cdir:.cwd.*$prompt $"\
{ pass "directory prompt" }
timeout { fail "(timeout) directory prompt" }
}
}
}
#test disable "dis" abbreviation
send "dis\n"
expect {
-re "$prompt $"\
{ pass "disable \"dis\" abbreviation" }
timeout { fail "(timeout) disable \"dis\" abbreviation" }
}
#test disable "disa" abbreviation
send "disa\n"
expect {
-re "$prompt $"\
{ pass "disable \"disa\" abbreviation" }
timeout { fail "(timeout) disable \"disa\" abbreviation" }
}
#test disable
send "disable\n"
expect {
-re "$prompt $"\
{ pass "disable" }
timeout { fail "(timeout) disable" }
}
#test disable breakpoints
send "disable breakpoints\n"
expect {
-re "$prompt $"\
{ pass "disable breakpoints" }
timeout { fail "(timeout) disable breakpoints" }
}
#test disable display
send "disable display\n"
expect {
-re "$prompt $"\
{ pass "disable display" }
timeout { fail "(timeout) disable display" }
}
#test disassemble
send "disassemble\n"
expect {
-re "No frame selected..*$prompt $"\
{ pass "disassemble" }
-re ".*$prompt $" { fail "disassemble" }
timeout { fail "(timeout) disassemble" }
}
#test display
send "display\n"
expect {
-re "$prompt $"\
{ pass "display" }
timeout { fail "(timeout) display" }
}
#test do
send "do\n"
expect {
-re "No stack..*$prompt $"\
{ pass "do" }
-re ".*$prompt $" { fail "do" }
timeout { fail "(timeout) do" }
}
#test document
send "document\n"
expect {
-re "Argument required .name of command to define.*$prompt $"\
{ pass "document" }
-re ".*$prompt $" { fail "document" }
timeout { fail "(timeout) document" }
}
#test down
send "down\n"
expect {
-re "No stack.*$prompt $"\
{ pass "down" }
-re ".*$prompt $" { fail "down" }
timeout { fail "(timeout) down" }
}
#test down-silently
send "down-silently\n"
expect {
-re "No stack..*$prompt $"\
{ pass "down-silently" }
-re ".*$prompt $" { fail "down-silently" }
timeout { fail "(timeout) down-silently" }
}
#test echo
send "echo\n"
expect {
-re "$prompt $"\
{ pass "echo" }
timeout { fail "(timeout) echo" }
}
#test enable breakpoints delete
send "enable breakpoints delete\n"
expect {
-re "Argument required .one or more breakpoint numbers.*$prompt $"\
{ pass "enable breakpoints delete" }
-re ".*$prompt $" { fail "enable breakpoints delete" }
timeout { fail "(timeout) enable breakpoints delete" }
}
#test enable breakpoints once
send "enable breakpoints once\n"
expect {
-re "Argument required .one or more breakpoint numbers.*$prompt $"\
{ pass "enable breakpoints once" }
-re ".*$prompt $" { fail "enable breakpoints once" }
timeout { fail "(timeout) enable breakpoints once" }
}
#test enable breakpoints
send "enable breakpoints\n"
expect {
-re "$prompt $"\
{ pass "enable breakpoints" }
timeout { fail "(timeout) enable breakpoints" }
}
#test enable delete
send "enable delete\n"
expect {
-re "Argument required .one or more breakpoint numbers.*$prompt $"\
{ pass "enable delete" }
-re ".*$prompt $" { fail "enable delete" }
timeout { fail "(timeout) enable delete" }
}
#test enable display
send "enable display\n"
expect {
-re "$prompt $"\
{ pass "enable display" }
timeout { fail "(timeout) enable display" }
}
#test enable once
send "enable once\n"
expect {
-re "Argument required .one or more breakpoint numbers.*$prompt $"\
{ pass "enable once" }
-re ".*$prompt $" { fail "enable once" }
timeout { fail "(timeout) enable once" }
}
#test enable
send "enable\n"
expect {
-re "$prompt $"\
{ pass "enable" }
timeout { fail "(timeout) enable" }
}
#test exec-file
send "exec-file\n"
expect {
-re "No exec file now..*$prompt $" {
pass "exec-file"
}
-re "exec-file.*A program is being debugged already. Kill it. .y or n.*$" {
send "n\n"
if $verbose>1 then {
send_user "\tDidn't kill program being debugged\n"
}
expect -re "$prompt $" { }
pass "exec-file"
}
-re "$prompt $" { fail "exec-file" }
timeout { fail "(timeout) exec-file" }
}
#test frame "f" abbreviation
setup_xfail "a29k-*-udi"
send "f\n"
expect {
-re "No stack..*$prompt $"\
{ pass "frame \"f\" abbreviation" }
-re ".*$prompt $" { fail "frame \"f\" abbreviation" }
timeout { fail "(timeout) frame \"f\" abbreviation" }
}
#test frame
setup_xfail "a29k-*-udi"
send "frame\n"
expect {
-re "No stack..*$prompt $"\
{ pass "frame" }
-re ".*$prompt $" { fail "frame" }
timeout { fail "(timeout) frame" }
}
#test fg
setup_xfail "a29k-*-udi"
send "fg\n"
expect {
-re "The program is not being run..*$prompt $"\
{ pass "fg" }
-re ".*$prompt $" { fail "fg" }
timeout { fail "(timeout) fg" }
}
# FIXME: fg kills the udi connection
if [istarget "a29k-*-udi"] then {
gdb_exit
gdb_start
}
#test file
send "file\n"
expect {
-re "No exec file now..*$prompt $"\
{ pass "file" }
-re ".*A program is being debugged already. Kill it. .y or n.*$" {
send "n\n"
if $verbose>1 then {
send_user "\t\tDidn't kill program being debugged\n"
}
expect -re "$prompt $" { }
pass "file"
}
-re ".*$prompt $" { fail "file" }
timeout { fail "(timeout) file" }
}
#test finish
setup_xfail "a29k-*-udi"
send "finish\n"
expect {
-re "The program is not running..*$prompt $"\
{ pass "finish" }
-re ".*$prompt $" { fail "finish" }
timeout { fail "(timeout) finish" }
}
#test forward-search
# The message here comes from the regexp library, not gdb, and so can
# vary on different systems.
send "forward-search\n"
expect {
-re "No previous regular expression.*$prompt $"\
{ pass "forward-search" }
-re "There is no previous regular expression.*$prompt $"\
{ pass "forward-search" }
-re ".*$prompt $" { fail "forward-search" }
timeout { fail "(timeout) forward-search" }
}
#test help "h" abbreviation
send "h\n"
expect {
-re "List of classes of commands:.*
running -- Running the program.*
stack -- Examining the stack.*
data -- Examining data.*
breakpoints -- Making program stop at certain points.*
files -- Specifying and examining files.*
status -- Status inquiries.*
support -- Support facilities.*
user-defined -- User-defined commands.*
aliases -- Aliases of other commands.*
obscure -- Obscure features.*
Type \"help\" followed by a class name for a list of commands in that class..*
Type \"help\" followed by command name for full documentation..*
Command name abbreviations are allowed if unambiguous..*$prompt $"\
{ pass "help \"h\" abbreviation" }
-re ".*$prompt $" { fail "help \"h\" abbreviation" }
timeout { fail "(timeout) help \"h\" abbreviation" }
}
#test help
send "help\n"
expect {
-re "List of classes of commands:.*
running -- Running the program.*
stack -- Examining the stack.*
data -- Examining data.*
breakpoints -- Making program stop at certain points.*
files -- Specifying and examining files.*
status -- Status inquiries.*
support -- Support facilities.*
user-defined -- User-defined commands.*
aliases -- Aliases of other commands.*
obscure -- Obscure features.*
Type \"help\" followed by a class name for a list of commands in that class..*
Type \"help\" followed by command name for full documentation..*
Command name abbreviations are allowed if unambiguous..*$prompt $"\
{ pass "help" }
-re ".*$prompt $" { fail "help" }
timeout { fail "(timeout) help" }
}
#test handle
send "handle\n"
expect {
-re "Argument required .signal to handle.*$prompt $"\
{ pass "handle" }
-re ".*$prompt $" { fail "handle" }
timeout { fail "(timeout) handle" }
}
#test info "i" abbreviation
send "i\n"
expect {
-re "\"info\" must be followed by the name of an info command..*
List of info subcommands:.*
Type \"help info\" followed by info subcommand name for full documentation..*
Command name abbreviations are allowed if unambiguous..*$prompt $"\
{ pass "info \"i\" abbreviation" }
-re ".*$prompt $" { fail "info \"i\" abbreviation" }
timeout { fail "(timeout) info \"i\" abbreviation" }
}
#test info
send "info\n"
expect {
-re "\"info\" must be followed by the name of an info command..*
List of info subcommands:.*
Type \"help info\" followed by info subcommand name for full documentation..*
Command name abbreviations are allowed if unambiguous..*$prompt $"\
{ pass "info" }
-re ".*$prompt $" { fail "info" }
timeout { fail "(timeout) info" }
}
#test ignore
send "ignore\n"
expect {
-re "Argument required .a breakpoint number.*$prompt $"\
{ pass "ignore" }
-re ".*$prompt $" { fail "ignore" }
timeout { fail "(timeout) ignore" }
}
#test info address
send "info address\n"
expect {
-re "Argument required..*$prompt $"\
{ pass "info address" }
-re ".*$prompt $" { fail "info address" }
timeout { fail "(timeout) info address" }
}
#test info all-registers
setup_xfail "a29k-*-udi"
send "info all-registers\n"
expect {
-re "The program has no registers now..*$prompt $"\
{ pass "info all-registers" }
-re ".*$prompt $" { fail "info all-registers" }
timeout { fail "(timeout) info all-registers" }
}
#test info args
send "info args\n"
expect {
-re "No frame selected..*$prompt $"\
{ pass "info args" }
-re ".*$prompt $" { fail "info args" }
timeout { fail "(timeout) info args" }
}
#test info bogus-gdb-command
send "info bogus-gdb-command\n"
expect {
-re "Undefined info command: \"bogus-gdb-command\". Try \"help info\"..*$prompt $"\
{ pass "info bogus-gdb-command" }
-re ".*$prompt $" { fail "info bogus-gdb-command" }
timeout { fail "(timeout) info bogus-gdb-command" }
}
#test info breakpoints
send "info breakpoints\n"
expect {
-re "No breakpoints or watchpoints..*$prompt $"\
{ pass "info breakpoints" }
-re ".*$prompt $" { fail "info breakpoints" }
timeout { fail "(timeout) info breakpoints" }
}
#test info catch
send "info catch\n"
expect {
-re "No frame selected..*$prompt $"\
{ pass "info catch" }
-re ".*$prompt $" { fail "info catch" }
timeout { fail "(timeout) info catch" }
}
#test info copying
# FIXME -- doesn't work worth a shit
#send "info copying\n"
#expect {
# -re "GNU GENERAL PUBLIC LICENSE.*\
#of preserving the free status of all derivatives of our free software and.*\
#of promoting the sharing and reuse of software generally..*$prompt $"\
# { pass "info copying" }
# timeout { fail "(timeout) info copying" }
# }
#
#
#test info display
send "info display\n"
expect {
-re "There are no auto-display expressions now..*$prompt $"\
{ pass "info display" }
-re ".*$prompt $" { fail "info display" }
timeout { fail "(timeout) info display" }
}
#test info frame "f" abbreviation
send "info f\n"
expect {
-re "No stack..*$prompt $"\
{ pass "info frame \"f\" abbreviation" }
-re "No selected frame..*$prompt $"\
{ pass "info frame \"f\" abbreviation" }
-re ".*$prompt $" { fail "info frame \"f\" abbreviation" }
timeout { fail "(timeout) info frame \"f\" abbreviation" }
}
#test info frame
send "info frame\n"
expect {
-re "No stack..*$prompt $"\
{ pass "info frame" }
-re "No selected frame..*$prompt $"\
{ pass "info frame" }
-re ".*$prompt $" { fail "info frame" }
timeout { fail "(timeout) info frame" }
}
#test info files
send "info files\n"
expect {
-re "$prompt $"\
{ pass "info files" }
timeout { fail "(timeout) info files" }
}
#test info float
send "info float\n"
expect {
-re "No floating point info available for this processor..*$prompt $"\
{ pass "info float" }
-re ".*$prompt $" { fail "info float" }
timeout { fail "(timeout) info float" }
}
#test info functions
send "info functions\n"
expect {
-re "All defined functions:.*$prompt $"\
{ pass "info functions" }
-re ".*$prompt $" { fail "info functions" }
timeout { fail "(timeout) info functions" }
}
gdb_test "info line" "No line number information.*" "info line"
#test info locals
send "info locals\n"
expect {
-re "No frame selected..*$prompt $"\
{ pass "info locals" }
-re ".*$prompt $" { fail "info locals" }
timeout { fail "(timeout) info locals" }
}
#test info program
setup_xfail "a29k-*-udi"
send "info program\n"
expect {
-re "The program being debugged is not being run..*$prompt $"\
{ pass "info program" }
-re ".*$prompt $" { fail "info program" }
timeout { fail "(timeout) info program" }
}
#test info registers
setup_xfail "a29k-*-udi"
send "info registers\n"
expect {
-re "The program has no registers now..*$prompt $"\
{ pass "info registers" }
-re ".*$prompt $" { fail "info registers" }
timeout { fail "(timeout) info registers" }
}
#test info stack "s" abbreviation
setup_xfail "a29k-*-udi"
send "info s\n"
expect {
-re "No stack..*$prompt $"\
{ pass "info stack \"s\" abbreviation" }
-re ".*$prompt $" { fail "info stack \"s\" abbreviation" }
timeout { fail "(timeout) info stack \"s\" abbreviation" }
}
#test info stack
setup_xfail "a29k-*-udi"
send "info stack\n"
expect {
-re "No stack..*$prompt $"\
{ pass "info stack" }
-re ".*$prompt $" { fail "info stack" }
timeout { fail "(timeout) info stack" }
}
#test info set
# FIXME -- needs to match the entire output
send "info set\n"
expect {
-re "confirm: Whether to confirm potentially dangerous operations is on..*
history filename: The filename in which to record the command history is .*
listsize: Number of source lines gdb will list by default is 10..*$prompt $"\
{ pass "info set" }
-re "\n$prompt $" { fail "info set" }
timeout { fail "(timeout) info set" }
}
#test info source
send "info source\n"
expect {
-re "No current source file..*$prompt $"\
{ pass "info source" }
-re ".*$prompt $" { fail "info source" }
timeout { fail "(timeout) info source" }
}
#test info sources
send "info sources\n"
expect {
-re "No symbol table is loaded. Use the \"file\" command..*$prompt $"\
{ pass "info sources" }
-re ".*$prompt $" { fail "info sources" }
timeout { fail "(timeout) info sources" }
}
#test info target
send "info target\n"
expect {
-re "$prompt $"\
{ pass "info target" }
timeout { fail "(timeout) info target" }
}
#test info terminal
send "info terminal\n"
expect {
-re "No saved terminal information..*$prompt $"\
{ pass "info terminal" }
-re ".*$prompt $" { fail "info terminal" }
timeout { fail "(timeout) info terminal" }
}
#test info types
send "info types\n"
expect {
-re "All defined types:.*$prompt $"\
{ pass "info types" }
-re ".*$prompt $" { fail "info types" }
timeout { fail "(timeout) info types" }
}
#test info variables
send "info variables\n"
expect {
-re "All defined variables:.*$prompt $"\
{ pass "info variables" }
-re ".*$prompt $" { fail "info variables" }
timeout { fail "(timeout) info variables" }
}
#test info warranty
send "info warranty\n"
expect {
-re "NO WARRANTY.*
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY.*
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN.*
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES.*
PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED.*
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF.*
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS.*
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE.*
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,.*
REPAIR OR CORRECTION..*
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING.*
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR.*
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,.*
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING.*
OUT OF THE USE OR INABILITY TO USE THE PROGRAM .INCLUDING BUT NOT LIMITED.*
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY.*
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER.*
PROGRAMS., EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE.*
POSSIBILITY OF SUCH DAMAGES..*$prompt $"\
{ pass "info warranty" }
-re ".*$prompt $" { fail "info warranty" }
timeout { fail "(timeout) info warranty" }
}
#test info watchpoints
send "info watchpoints\n"
expect {
-re "No breakpoints or watchpoints..*$prompt $"\
{ pass "info watchpoints" }
-re ".*$prompt $" { fail "info watchpoints" }
timeout { fail "(timeout) info watchpoints" }
}
#test inspect
send "inspect\n"
expect {
-re "The history is empty..*$prompt $"\
{ pass "inspect" }
-re ".*$prompt $" { fail "inspect" }
timeout { fail "(timeout) inspect" }
}
#test jump
setup_xfail "a29k-*-udi"
send "jump\n"
expect {
-re "The program is not being run..*$prompt $"\
{ pass "jump" }
-re ".*$prompt $" { fail "jump" }
timeout { fail "(timeout) jump" }
}
#test kill
send "kill\n"
expect {
-re "The program is not being run..*$prompt $"\
{ pass "kill" }
-re ".*$prompt $" { fail "kill" }
timeout { fail "(timeout) kill" }
}
#test list "l" abbreviation
send "l\n"
expect {
-re "No symbol table is loaded. Use the \"file\" command..*$prompt $"\
{ pass "list \"l\" abbreviation" }
-re ".*$prompt $" { fail "list \"l\" abbreviation" }
timeout { fail "(timeout) list \"l\" abbreviation" }
}
#test list
send "list\n"
expect {
-re "No symbol table is loaded. Use the \"file\" command..*$prompt $"\
{ pass "list" }
-re ".*$prompt $" { fail "list" }
timeout { fail "(timeout) list" }
}
#test load
# The ``takes a file name'' case is for vxgdb.
# The ``Use the "file" command'' case is for newer GDB versions which try
# to deduce the filename from the exec file.
send "load\n"
expect {
-re "You can't do that when your target is `None'.*$prompt $"\
{ pass "load" }
-re "The load command takes a file name.*$prompt $"\
{ pass "load" }
-re "Must specify at least a file name with the load command.*$prompt $"\
{ pass "load" }
-re "Use the .file. or .exec-file. command.*$prompt $"\
{ pass "load" }
-re ".*$prompt $" { fail "load" }
timeout { fail "(timeout) load" }
}
#test next "n" abbreviation
setup_xfail "a29k-*-udi"
send "n\n"
expect {
-re "The program is not being run..*$prompt $"\
{ pass "next \"n\" abbreviation" }
-re ".*$prompt $" { fail "next \"n\" abbreviation" }
timeout { fail "(timeout) next \"n\" abbreviation" }
}
#test next
setup_xfail "a29k-*-udi"
send "next\n"
expect {
-re "The program is not being run..*$prompt $"\
{ pass "next" }
-re ".*$prompt $" { fail "next" }
timeout { fail "(timeout) next" }
}
#test nexti "ni" abbreviation
setup_xfail "a29k-*-udi"
send "ni\n"
expect {
-re "The program is not being run..*$prompt $"\
{ pass "nexti \"ni\" abbreviation" }
-re ".*$prompt $" { fail "nexti \"ni\" abbreviation" }
timeout { fail "(timeout) nexti \"ni\" abbreviation" }
}
#test nexti
setup_xfail "a29k-*-udi"
send "nexti\n"
expect {
-re "The program is not being run..*$prompt $"\
{ pass "nexti" }
-re ".*$prompt $" { fail "nexti" }
timeout { fail "(timeout) nexti" }
}
#test output
send "output\n"
expect {
-re "Argument required .expression to compute.*$prompt $"\
{ pass "output" }
-re ".*$prompt $" { fail "output" }
timeout { fail "(timeout) output" }
}
#test print "p" abbreviation
send "p\n"
expect {
-re "The history is empty..*$prompt $"\
{ pass "print \"p\" abbreviation" }
-re ".*$prompt $" { fail "print \"p\" abbreviation" }
timeout { fail "(timeout) print \"p\" abbreviation" }
}
#test print
send "print\n"
expect {
-re "The history is empty..*$prompt $"\
{ pass "print" }
-re ".*$prompt $" { fail "print" }
timeout { fail "(timeout) print" }
}
#test printf
send "printf\n"
expect {
-re "Argument required .format-control string and values to print.*$prompt $"\
{ pass "printf" }
-re ".*$prompt $" { fail "printf" }
timeout { fail "(timeout) printf" }
}
# this command was removed from GDB 4.5.8
#test printsyms
#send "printsyms\n"
#expect {
# -re "printsyms takes an output file name and optional symbol file name.*$prompt $"\
# { pass "printsyms" }
# -re ".*$prompt $" { fail "printsyms" }
# timeout { fail "(timeout) printsyms" }
# }
#test ptype
send "ptype\n"
expect {
-re "The history is empty..*$prompt $"\
{ pass "ptype" }
-re ".*$prompt $" { fail "ptype" }
timeout { fail "(timeout) ptype" }
}
#test pwd
send "pwd\n"
expect {
-re "Working directory .*$prompt $"\
{ pass "pwd" }
-re ".*$prompt $" { fail "pwd" }
timeout { fail "(timeout) pwd" }
}
#test run "r" abbreviation
if [istarget "*-*-vxworks"] then {
send "set args\n"
expect -re "$prompt $" {}
gdb_test "r" "Starting program: .*
You must specify a function name to run, and arguments if any"\
"run \"r\" abbreviation"
send "set args main\n"
expect -re "$prompt $" {}
} else {
send "r\n"
expect {
-re "Starting program: .*
You can't do that when your target is `None'.*$prompt $"\
{ pass "run \"r\" abbreviation" }
-re "Starting program: .*
No executable file specified.*
Use the \"file\" or \"exec-file\" command.*$prompt $"\
{ pass "run \"r\" abbreviation" }
-re "Starting program: .*
No image loaded into target.*$prompt $"\
{ pass "run \"r\" abbreviation" }
-re "Don't know how to run. Try \"help target\"..*$prompt $"\
{ pass "run \"r\" abbreviation" }
-re ".*$prompt $" { fail "run \"r\" abbreviation" }
timeout { fail "(timeout) run \"r\" abbreviation" }
}
}
#test run
if [istarget "*-*-vxworks"] then {
send "set args\n"
expect -re "$prompt $" {}
gdb_test "run" "Starting program: .*
You must specify a function name to run, and arguments if any"
send "set args main\n"
expect -re "$prompt $" {}
} else {
send "run\n"
expect {
-re "Starting program:.*You can't do that when your target is `None'.*$prompt $" { pass "run" }
-re "Starting program: .*
No executable file specified.*
Use the \"file\" or \"exec-file\" command.*$prompt $"\
{ pass "run" }
-re "Starting program: .*
No image loaded into target.*$prompt $"\
{ pass "run" }
-re "Don't know how to run. Try \"help target\"..*$prompt $"\
{ pass "run" }
-re ".*$prompt $" { fail "run" }
timeout { fail "(timeout) run" }
}
}
#test rbreak
send "rbreak\n"
expect {
-re "$prompt $"\
{ pass "rbreak" }
timeout { fail "(timeout) rbreak" }
}
#test return
# The middle case accommodates the a29k, where doing the "ni" above causes
# an initial stack to be created.
send "return\n"
expect {
-re "No selected frame..*$prompt $"\
{ pass "return" }
-re "Make .* return now.*y or n. $" {
send "y\n"
exp_continue
}
-re ".*$prompt $" { fail "return" }
timeout { fail "(timeout) return" }
}
#test reverse-search
send "reverse-search\n"
expect {
-re "No previous regular expression.*$prompt $"\
{ pass "reverse-search" }
-re "There is no previous regular expression.*$prompt $"\
{ pass "forward-search" }
-re ".*$prompt $" { fail "reverse-search" }
timeout { fail "(timeout) reverse-search" }
}
#test step "s" abbreviation
setup_xfail "a29k-*-udi"
send "s\n"
expect {
-re "The program is not being run..*$prompt $"\
{ pass "step \"s\" abbreviation" }
-re ".*$prompt $" { fail "step \"s\" abbreviation" }
timeout { fail "(timeout) step \"s\" abbreviation" }
}
#test step
setup_xfail "a29k-*-udi"
send "step\n"
expect {
-re "The program is not being run..*$prompt $"\
{ pass "step" }
-re ".*$prompt $" { fail "step" }
timeout { fail "(timeout) step" }
}
#test search
send "search\n"
expect {
-re "No previous regular expression.*$prompt $"\
{ pass "search" }
-re "There is no previous regular expression.*$prompt $"\
{ pass "forward-search" }
-re ".*$prompt $" { fail "search" }
timeout { fail "(timeout) search" }
}
#test section
send "section\n"
expect {
-re "Must specify section name and its virtual address.*$prompt $"\
{ pass "section" }
-re ".*$prompt $" { fail "section" }
timeout { fail "(timeout) section" }
}
#test set args
send "set args\n"
expect {
-re "$prompt $"\
{ pass "set args" }
timeout { fail "(timeout) set args" }
}
#test set check "c" abbreviation
send "set c\n"
expect {
-re "\"set check\" must be followed by the name of a check subcommand..*
List of set check subcommands:.*
set check range -- Set range checking.*
set check type -- Set type checking.*
Type \"help set check\" followed by set check subcommand name for full documentation..*
Command name abbreviations are allowed if unambiguous..*$prompt $"\
{ pass "set check \"c\" abbreviation" }
-re ".*$prompt $" { fail "set check \"c\" abbreviation" }
timeout { fail "(timeout) set check \"c\" abbreviation" }
}
#test set check "ch" abbreviation
send "set ch\n"
expect {
-re "\"set check\" must be followed by the name of a check subcommand..*
List of set check subcommands:.*
set check range -- Set range checking.*
set check type -- Set type checking.*
Type \"help set check\" followed by set check subcommand name for full documentation..*
Command name abbreviations are allowed if unambiguous..*$prompt $"\
{ pass "set check \"ch\" abbreviation" }
-re ".*$prompt $" { fail "set check \"ch\" abbreviation" }
timeout { fail "(timeout) set check \"ch\" abbreviation" }
}
#test set check
send "set check\n"
expect {
-re "\"set check\" must be followed by the name of a check subcommand..*
List of set check subcommands:.*
set check range -- Set range checking.*
set check type -- Set type checking.*
Type \"help set check\" followed by set check subcommand name for full documentation..*
Command name abbreviations are allowed if unambiguous..*$prompt $"\
{ pass "set check" }
-re ".*$prompt $" { fail "set check" }
timeout { fail "(timeout) set check" }
}
#test set check range
send "set check range\n"
expect {
-re "$prompt $"\
{ pass "set check range" }
timeout { fail "(timeout) set check range" }
}
#test set check type
send "set check type\n"
expect {
-re "$prompt $"\
{ pass "set check type" }
timeout { fail "(timeout) set check type" }
}
#test set complaints
send "set complaints\n"
expect {
-re "Argument required .integer to set it to.*$prompt $"\
{ pass "set complaints" }
-re ".*$prompt $" { fail "set complaints" }
timeout { fail "(timeout) set complaints" }
}
#test set confirm
send "set confirm\n"
expect {
-re "$prompt $"\
{ pass "set confirm" }
timeout { fail "(timeout) set confirm" }
}
#test set editing
send "set editing\n"
expect {
-re "$prompt $"\
{ pass "set editing" }
timeout { fail "(timeout) set editing" }
}
#test set environment
send "set environment\n"
expect {
-re "Argument required .environment variable and value.*$prompt $"\
{ pass "set environment" }
-re ".*$prompt $" { fail "set environment" }
timeout { fail "(timeout) set environment" }
}
#test set height
send "set height\n"
expect {
-re "Argument required .integer to set it to.*$prompt $"\
{ pass "set height" }
-re ".*$prompt $" { fail "set height" }
timeout { fail "(timeout) set height" }
}
#test set history expansion
send "set history expansion\n"
expect {
-re "$prompt $"\
{ pass "set history expansion" }
timeout { fail "(timeout) set history expansion" }
}
#test set history filename
send "set history filename\n"
expect {
-re "Argument required .filename to set it to.*$prompt $" {
pass "set history filename"
}
-re ".*$prompt $" {
fail "set history filename"
}
timeout {
fail "(timeout) set history filename"
}
}
#test set history save
send "set history save\n"
expect {
-re "$prompt $"\
{ pass "set history save" }
timeout { fail "(timeout) set history save" }
}
#test set history size
send "set history size\n"
expect {
-re "Argument required .integer to set it to.*$prompt $"\
{ pass "set history size" }
-re ".*$prompt $" { fail "set history size" }
timeout { fail "(timeout) set history size" }
}
#test set history
send "set history\n"
expect {
-re "\"set history\" must be followed by the name of a history subcommand..*
List of set history subcommands:.*
set history filename -- Set the filename in which to record the command history.*
set history size -- Set the size of the command history.*
set history save -- Set saving of the history record on exit.*
set history expansion -- Set history expansion on command input.*
Type \"help set history\" followed by set history subcommand name for full documentation..*
Command name abbreviations are allowed if unambiguous..*$prompt $"\
{ pass "set history" }
-re ".*$prompt $" { fail "set history" }
timeout { fail "(timeout) set history" }
}
#test set language
send "set language\n"
expect {
-re "The currently understood settings are:.*
local or auto Automatic setting based on source file.*
c Use the C language.*
c\[+\]+ Use the C\[+\]+ language.*
modula-2 Use the Modula-2 language.*$prompt $" {
pass "set language"
}
-re ".*$prompt $" {
fail "set language"
}
timeout {
fail "(timeout) set language"
}
}
#test set listsize
send "set listsize\n"
expect {
-re "Argument required .integer to set it to.*$prompt $" {
pass "set listsize"
}
-re ".*$prompt $" { fail "set listsize" }
timeout { fail "(timeout) set listsize" }
}
#test set print "p" abbreviation
send "set p\n"
expect {
-re "\"set print\" must be followed by the name of a print subcommand..*
List of set print subcommands:.*
Type \"help set print\" followed by set print subcommand name for full documentation..*
Command name abbreviations are allowed if unambiguous..*$prompt $" {
pass "set print \"p\" abbreviation"
}
-re ".*$prompt $" { fail "set print \"p\" abbreviation" }
timeout { fail "(timeout) set print \"p\" abbreviation" }
}
#test set print "pr" abbreviation
send "set pr\n"
expect {
-re "\"set print\" must be followed by the name of a print subcommand..*
List of set print subcommands:.*
Type \"help set print\" followed by set print subcommand name for full documentation..*
Command name abbreviations are allowed if unambiguous..*$prompt $" {
pass "set print \"pr\" abbreviation"
}
-re ".*$prompt $" { fail "set print \"pr\" abbreviation" }
timeout { fail "(timeout) set print \"pr\" abbreviation" }
}
#test set print
send "set print\n"
expect {
-re "\"set print\" must be followed by the name of a print subcommand..*
List of set print subcommands:.*
Type \"help set print\" followed by set print subcommand name for full documentation..*
Command name abbreviations are allowed if unambiguous..*$prompt $" {
pass "set print"
}
-re ".*$prompt $" { fail "set print" }
timeout { fail "(timeout) set print" }
}
#test set print address
send "set print address\n"
expect {
-re "$prompt $"\
{ pass "set print address" }
timeout { fail "(timeout) set print address" }
}
#test set print array
send "set print array\n"
expect {
-re "$prompt $"\
{ pass "set print array" }
timeout { fail "(timeout) set print array" }
}
#test set print asm-demangle
send "set print asm-demangle\n"
expect {
-re "$prompt $"\
{ pass "set print asm-demangle" }
timeout { fail "(timeout) set print asm-demangle" }
}
#test set print demangle
send "set print demangle\n"
expect {
-re "$prompt $"\
{ pass "set print demangle" }
timeout { fail "(timeout) set print demangle" }
}
#test set print elements
send "set print elements\n"
expect {
-re "Argument required .integer to set it to.*$prompt $"\
{ pass "set print elements" }
-re ".*$prompt $" { fail "set print elements" }
timeout { fail "(timeout) set print elements" }
}
#test set print object
send "set print object\n"
expect {
-re "$prompt $"\
{ pass "set print object" }
timeout { fail "(timeout) set print object" }
}
#test set print pretty
send "set print pretty\n"
expect {
-re "$prompt $"\
{ pass "set print pretty" }
timeout { fail "(timeout) set print pretty" }
}
#test set print sevenbit-strings
send "set print sevenbit-strings\n"
expect {
-re "$prompt $"\
{ pass "set print sevenbit-strings" }
timeout { fail "(timeout) set print sevenbit-strings" }
}
#test set print union
send "set print union\n"
expect {
-re "$prompt $"\
{ pass "set print union" }
timeout { fail "(timeout) set print union" }
}
#test set print vtbl
send "set print vtbl\n"
expect {
-re "$prompt $"\
{ pass "set print vtbl" }
timeout { fail "(timeout) set print vtbl" }
}
# FIXME -- need a test for "set prompt"
#test set radix
send "set radix\n"
expect {
-re "Input and output radices now set to decimal 10, hex a, octal 12.*$prompt $"\
{ pass "set radix" }
-re "Argument required .integer to set it to.*$prompt $"\
{ fail "set radix (obsolete radix support)" }
-re ".*$prompt $" { fail "set radix" }
timeout { fail "(timeout) set radix" }
}
#test set symbol-reloading
send "set symbol-reloading\n"
expect {
-re "$prompt $"\
{ pass "set symbol-reloading" }
timeout { fail "(timeout) set symbol-reloading" }
}
#test set variable
send "set variable\n"
expect {
-re "Argument required .expression to compute.*$prompt $"\
{ pass "set variable" }
-re ".*$prompt $" { fail "set variable" }
timeout { fail "(timeout) set variable" }
}
#test set verbose
send "set verbose\n"
expect {
-re "$prompt $"\
{ pass "set verbose" }
timeout { fail "(timeout) set verbose" }
}
#test set width
send "set width\n"
expect {
-re "Argument required .integer to set it to.*$prompt $"\
{ pass "set width" }
-re ".*$prompt $" { fail "set width" }
timeout { fail "(timeout) set width" }
}
#test set write
# This is only supported on targets which use exec.o.
if ![istarget "rs6000-*-*"] then {
send "set write\n"
expect {
-re "set write\[\r\n\]*$prompt $"\
{ pass "set write" }
-re "$prompt $" { fail "set write" }
timeout { fail "(timeout) set write" }
}
gdb_test "set write off" ""
}
#test set
send "set\n"
expect {
-re "Argument required .expression to compute.*$prompt $"\
{ pass "set" }
-re ".*$prompt $" { fail "set" }
timeout { fail "(timeout) set" }
}
#test shell echo Hi dad!
send "shell echo Hi dad!\n"
expect {
-re "Hi dad!.*$prompt $"\
{ pass "shell echo Hi dad!" }
-re ".*$prompt $" { fail "shell echo Hi dad!" }
timeout { fail "(timeout) shell echo Hi dad!" }
}
#test show args
send "show args\n"
expect {
-re "Arguments to give program being debugged when it is started is \"\"..*$prompt $"\
{ pass "show args" }
-re ".*$prompt $" { fail "show args" }
timeout { fail "(timeout) show args" }
}
#test show check "c" abbreviation
send "show c\n"
expect {
-re "range: Range checking is \"auto; currently off\"..*
type: Type checking is \"auto; currently off\"..*$prompt $"\
{ pass "show check \"c\" abbreviation" }
-re ".*$prompt $" { fail "show check \"c\" abbreviation" }
timeout { fail "(timeout) show check \"c\" abbreviation" }
}
#test show check "ch" abbreviation
send "show ch\n"
expect {
-re "range: Range checking is \"auto; currently off\"..*
type: Type checking is \"auto; currently off\"..*$prompt $"\
{ pass "show check \"ch\" abbreviation" }
-re ".*$prompt $" { fail "show check \"ch\" abbreviation" }
timeout { fail "(timeout) show check \"ch\" abbreviation" }
}
#test show check
send "show check\n"
expect {
-re "range: Range checking is \"auto; currently off\"..*
type: Type checking is \"auto; currently off\"..*$prompt $"\
{ pass "show check" }
-re ".*$prompt $" { fail "show check" }
timeout { fail "(timeout) show check" }
}
#test show check range
send "show check range\n"
expect {
-re "Range checking is \"auto; currently off\"..*$prompt $"\
{ pass "show check range" }
-re ".*$prompt $" { fail "show check range" }
timeout { fail "(timeout) show check range" }
}
#test show check type
send "show check type\n"
expect {
-re "Type checking is \"auto; currently off\"..*$prompt $"\
{ pass "show check type" }
-re ".*$prompt $" { fail "show check type" }
timeout { fail "(timeout) show check type" }
}
#test show commands
send "show commands\n"
expect {
-re "$prompt $"\
{ pass "show commands" }
timeout { fail "(timeout) show commands" }
}
#test show complaints
send "show complaints\n"
expect {
-re "Max number of complaints about incorrect symbols is 0..*$prompt $"\
{ pass "show complaints" }
-re ".*$prompt $" { fail "show complaints" }
timeout { fail "(timeout) show complaints" }
}
#test show confirm
send "show confirm\n"
expect {
-re "Whether to confirm potentially dangerous operations is on..*$prompt $"\
{ pass "show confirm" }
-re ".*$prompt $" { fail "show confirm" }
timeout { fail "(timeout) show confirm" }
}
#test show convenience
send "show convenience\n"
expect {
-re "No debugger convenience variables now defined..*
Convenience variables have names starting with \".\";.*
use \"set\" as in \"set .foo = 5\" to define them..*$prompt $"\
{ pass "show convenience" }
-re ".*$prompt $" { fail "show convenience" }
timeout { fail "(timeout) show convenience" }
}
#test show directories
send "show directories\n"
expect {
-re "Source directories searched: .cdir:.cwd.*$prompt $"\
{ pass "show directories" }
-re ".*$prompt $" { fail "show directories" }
timeout { fail "(timeout) show directories" }
}
#test show editing
send "show editing\n"
expect {
-re "Editing of command lines as they are typed is on..*$prompt $"\
{ pass "show editing" }
-re ".*$prompt $" { fail "show editing" }
timeout { fail "(timeout) show editing" }
}
#test show height
send "show height\n"
expect {
-re "Number of lines gdb thinks are in a page is.*$prompt $"\
{ pass "show height" }
-re ".*$prompt $" { fail "show height" }
timeout { fail "(timeout) show height" }
}
#test show history expansion
send "show history expansion\n"
expect {
-re "History expansion on command input is on.*$prompt $"\
{ pass "show history expansion" }
-re ".*$prompt $" { fail "show history expansion" }
timeout { fail "(timeout) show history expansion" }
}
#test show history filename
send "show history filename\n"
expect {
-re "The filename in which to record the command history is.*.gdb_history.*$prompt $" { pass "show history filename" }
-re ".*$prompt $" { fail "show history filename" }
timeout { fail "(timeout) show history filename" }
}
#test show history save
send "show history save\n"
expect {
-re "Saving of the history record on exit is on..*$prompt $" {
pass "show history save"
}
-re ".*$prompt $" { fail "show history save" }
timeout { fail "(timeout) show history save" }
}
#test show history size
send "show history size\n"
expect {
-re "The size of the command history is.*$prompt $"\
{ pass "show history size" }
-re ".*$prompt $" { fail "show history size" }
timeout { fail "(timeout) show history size" }
}
#test show history
send "show history\n"
expect {
-re "filename: The filename in which to record the command history is.*.gdb_history.*
size: The size of the command history is.*
save: Saving of the history record on exit is o.*
expansion: History expansion on command input is o.*$prompt $"
{ pass "show history" }
-re ".*$prompt $" { fail "show history" }
timeout { fail "(timeout) show history" }
}
#test show language
send "show language\n"
expect {
-re "The current source language is \"auto; currently c\"..*$prompt $"\
{ pass "show language" }
-re ".*$prompt $" { fail "show language" }
timeout { fail "(timeout) show language" }
}
#test show listsize
send "show listsize\n"
expect {
-re "Number of source lines gdb will list by default is 10..*$prompt $"\
{ pass "show listsize" }
-re ".*$prompt $" { fail "show listsize" }
timeout { fail "(timeout) show listsize" }
}
#test show print "p" abbreviation
send "show p\n"
expect {
-re ".*$prompt $"\
{ pass "show print \"p\" abbreviation" }
timeout { fail "(timeout) show print \"p\" abbreviation" }
}
#test show print "pr" abbreviation
send "show pr\n"
expect {
-re ".*$prompt $"\
{ pass "show print \"pr\" abbreviation" }
timeout { fail "(timeout) show print \"pr\" abbreviation" }
}
#test show print
send "show print\n"
expect {
-re ".*$prompt $"\
{ pass "show print" }
timeout { fail "(timeout) show print" }
}
#test show paths
send "show paths\n"
expect {
-re "Executable and object file path:.*$prompt $"\
{ pass "show paths" }
-re ".*$prompt $" { fail "show paths" }
timeout { fail "(timeout) show paths" }
}
#test show print address
send "show print address\n"
expect {
-re "Printing of addresses is on..*$prompt $"\
{ pass "show print address" }
-re ".*$prompt $" { fail "show print address" }
timeout { fail "(timeout) show print address" }
}
#test show print array
send "show print array\n"
expect {
-re "Prettyprinting of arrays is on..*$prompt $"\
{ pass "show print array" }
-re ".*$prompt $" { fail "show print array" }
timeout { fail "(timeout) show print array" }
}
#test show print asm-demangle
send "show print asm-demangle\n"
expect {
-re "Demangling of C\[+\]+ names in disassembly listings is on..*$prompt $"\
{ pass "show print asm-demangle" }
-re ".*$prompt $" { fail "show print asm-demangle" }
timeout { fail "(timeout) show print asm-demangle" }
}
#test show print demangle
send "show print demangle\n"
expect {
-re "Demangling of encoded C\[+\]+ names when displaying symbols is on..*$prompt $"\
{ pass "show print demangle" }
-re ".*$prompt $" { fail "show print demangle" }
timeout { fail "(timeout) show print demangle" }
}
#test show print elements
send "show print elements\n"
expect {
-re "Limit on string chars or array elements to print is 200..*$prompt $"\
{ pass "show print elements" }
-re ".*$prompt $" { fail "show print elements" }
timeout { fail "(timeout) show print elements" }
}
#test show print object
send "show print object\n"
expect {
-re "Printing of object's derived type based on vtable info is on..*$prompt $"\
{ pass "show print object" }
-re ".*$prompt $" { fail "show print object" }
timeout { fail "(timeout) show print object" }
}
#test show print pretty
send "show print pretty\n"
expect {
-re "Prettyprinting of structures is on..*$prompt $"\
{ pass "show print pretty" }
-re ".*$prompt $" { fail "show print pretty" }
timeout { fail "(timeout) show print pretty" }
}
#test show print sevenbit-strings
send "show print sevenbit-strings\n"
expect {
-re "Printing of 8-bit characters in strings as .nnn is on..*$prompt $"\
{ pass "show print sevenbit-strings" }
-re ".*$prompt $" { fail "show print sevenbit-strings" }
timeout { fail "(timeout) show print sevenbit-strings" }
}
#test show print union
send "show print union\n"
expect {
-re "Printing of unions interior to structures is on..*$prompt $"\
{ pass "show print union" }
-re ".*$prompt $" { fail "show print union" }
timeout { fail "(timeout) show print union" }
}
#test show print vtbl
send "show print vtbl\n"
expect {
-re "Printing of C\[+\]+ virtual function tables is on..*$prompt $"\
{ pass "show print vtbl" }
-re ".*$prompt $" { fail "show print vtbl" }
timeout { fail "(timeout) show print vtbl" }
}
#test show prompt
# In the FAIL case, can't just look for $prompt because that will match
# the output, rather than the prompt. So look for $prompt at the start
# of a line.
send "show prompt\n"
expect {
-re "Gdb's prompt is \"$prompt \".*$prompt $"\
{ pass "show prompt" }
-re ".*\r\n$prompt $" { fail "show prompt" }
timeout { fail "(timeout) show prompt" }
}
#test show radix
send "show radix\n"
expect {
-re "Input and output radices set to decimal 10, hex a, octal 12..*$prompt $"\
{ pass "show radix" }
-re "Default input and output number radix is 10..*$prompt $"\
{ fail "show radix (obsolete radix support)" }
-re ".*$prompt $" { fail "show radix" }
timeout { fail "(timeout) show radix" }
}
#test show symbol-reloading
send "show symbol-reloading\n"
expect {
-re "Dynamic symbol table reloading multiple times in one run is on..*$prompt $"\
{ pass "show symbol-reloading" }
-re ".*$prompt $" { fail "show symbol-reloading" }
timeout { fail "(timeout) show symbol-reloading" }
}
#test show user
send "show user\n"
expect {
-re "$prompt $"\
{ pass "show user" }
timeout { fail "(timeout) show user" }
}
#test show values
send "show values\n"
expect {
-re "$prompt $"\
{ pass "show values" }
timeout { fail "(timeout) show values" }
}
#test show verbose
send "show verbose\n"
expect {
-re "Verbose printing of informational messages is on..*$prompt $"\
{ pass "show verbose" }
-re ".*$prompt $" { fail "show verbose" }
timeout { fail "(timeout) show verbose" }
}
#test show version
send "show version\n"
expect {
-re "GDB is free software and you are welcome to distribute copies of it.*
under certain conditions; type \"show copying\" to see the conditions..*
There is absolutely no warranty for GDB; type \"show warranty\" for details..*
GDB.*Copyright \[0-9\]* Free Software Foundation, Inc..*$prompt $"\
{ pass "show version" }
-re ".*$prompt $" { fail "show version" }
timeout { fail "(timeout) show version" }
}
#test show width
send "show width\n"
expect {
-re "Number of characters gdb thinks are in a line is.*$prompt $"\
{ pass "show width" }
-re ".*$prompt $" { fail "show width" }
timeout { fail "(timeout) show width" }
}
#test show write
# This is only supported on targets which use exec.o.
if ![istarget "rs6000-*-*"] then {
send "show write\n"
expect {
-re "Writing into executable and core files is off..*$prompt $"\
{ pass "show write" }
-re ".*$prompt $" { fail "show write" }
timeout { fail "(timeout) show write" }
}
}
#test show
send "show\n"
expect {
-re "confirm: Whether to confirm potentially dangerous operations is on..*
history filename: The filename in which to record the command history is .*
history size: The size of the command history is.*
history save: Saving of the history record on exit is on..*
print elements: Limit on string chars or array elements to print is 200..*
listsize: Number of source lines gdb will list by default is 10.*$prompt $"\
{ pass "show" }
-re "\n$prompt $" { fail "show" }
timeout { fail "(timeout) show" }
}
#test stepi "si" abbreviation
setup_xfail "a29k-*-udi"
send "si\n"
expect {
-re "The program is not being run..*$prompt $"\
{ pass "stepi \"si\" abbreviation" }
-re ".*$prompt $" { fail "stepi \"si\" abbreviation" }
timeout { fail "(timeout) stepi \"si\" abbreviation" }
}
#test stepi
setup_xfail "a29k-*-udi"
send "stepi\n"
expect {
-re "The program is not being run..*$prompt $"\
{ pass "stepi" }
-re ".*$prompt $" { fail "stepi" }
timeout { fail "(timeout) stepi" }
}
#test signal
setup_xfail "a29k-*-udi"
send "signal\n"
expect {
-re "The program is not being run..*$prompt $"\
{ pass "signal" }
-re ".*$prompt $" { fail "signal" }
timeout { fail "(timeout) signal" }
}
#test source
send "source\n"
expect {
-re "source command requires pathname of file to source..*$prompt"
{ pass "source" }
-re "No such file or directory.*$prompt $" { pass "source" }
-re ".*$prompt $" { fail "source" }
timeout { fail "(timeout) source" }
}
#test step "s" abbreviation
setup_xfail "a29k-*-udi"
send "s\n"
expect {
-re "The program is not being run..*$prompt $"\
{ pass "step \"s\" abbreviation" }
-re ".*$prompt $" { fail "step \"s\" abbreviation" }
timeout { fail "(timeout) step \"s\" abbreviation" }
}
#test step
setup_xfail "a29k-*-udi"
send "step\n"
expect {
-re "The program is not being run..*$prompt $"\
{ pass "step" }
-re ".*$prompt $" { fail "step" }
timeout { fail "(timeout) step" }
}
#test symbol-file
send "symbol-file\n"
expect {
-re "$prompt $"\
{ pass "symbol-file" }
timeout { fail "(timeout) symbol-file" }
}
#test target child
send "target child\n"
expect {
-re "Use the \"run\" command to start a Unix child process..*$prompt $"\
{ pass "target child (non-procfs version)" }
-re "Undefined target command: \"child\". Try \"help target\"..*$prompt $"\
{ pass "target child (procfs version)" }
-re ".*$prompt $" { fail "target child" }
timeout { fail "(timeout) target child" }
}
#test target procfs
send "target procfs\n"
expect {
-re "Use the \"run\" command to start a Unix child process..*$prompt $"\
{ pass "target procfs (procfs version)" }
-re "Undefined target command: \"procfs\". Try \"help target\"..*$prompt $"\
{ pass "target procfs (non-procfs version)" }
-re ".*$prompt $" { fail "target procfs" }
timeout { fail "(timeout) target procfs" }
}
#test target core
send "target core\n"
expect {
-re "No core file specified..*$prompt $"\
{ pass "target core" }
-re ".*A program is being debugged already. Kill it. .y or n.*$" {
send "n\n"
if $verbose>1 then {
send_user "\t\tDidn't kill program being debugged\n"
}
expect -re "$prompt $" { }
pass "target core"
}
-re "Undefined target command: \"core\". Try \"help target\"..*$prompt $"\
{ pass "target core" }
-re ".*$prompt $" { fail "target core" }
timeout { fail "(timeout) target core" }
}
#test target exec
send "target exec\n"
expect {
-re "No exec file now..*$prompt $"\
{ pass "target exec" }
-re ".*A program is being debugged already. Kill it. .y or n.*$" {
send "n\n"
if $verbose>1 then {
send_user "\t\tDidn't kill program being debugged\n"
}
expect -re "$prompt $" { }
pass "target exec"
}
-re ".*$prompt $" { fail "target exec" }
timeout { fail "(timeout) target exec" }
}
#test target remote
if ![istarget "*-*-udi*"] then {
send "target remote\n"
expect {
-re "To open a remote debug connection, you need to specify what serial.*
device is attached to the remote system .e.g. /dev/ttya.*$prompt $"\
{ pass "target remote" }
-re ".*A program is being debugged already. Kill it. .y or n.*$" {
send "n\n"
if $verbose>1 then {
send_user "\t\tDidn't kill program being debugged\n"
}
expect -re "$prompt $" { }
pass "target remote"
}
-re ".*$prompt $" { fail "target remote" }
timeout { fail "(timeout) target remote" }
}
}
#test target
send "target\n"
expect {
-re "Argument required .target name.*$prompt $"\
{ pass "target" }
-re ".*$prompt $" { fail "target" }
timeout { fail "(timeout) target" }
}
#test tbreak
send "tbreak\n"
expect {
-re "No default breakpoint address now..*$prompt $"\
{ pass "tbreak" }
-re ".*$prompt $" { fail "tbreak" }
timeout { fail "(timeout) tbreak" }
}
#test tty
send "tty\n"
expect {
-re "Argument required .terminal name for running target process.*$prompt $"\
{ pass "tty" }
-re ".*$prompt $" { fail "tty" }
timeout { fail "(timeout) tty" }
}
#test until "u" abbreviation
setup_xfail "a29k-*-udi"
send "u\n"
expect {
-re "The program is not running..*$prompt $"\
{ pass "until \"u\" abbreviation" }
-re ".*$prompt $" { fail "until \"u\" abbreviation" }
timeout { fail "(timeout) until \"u\" abbreviation" }
}
#test until
setup_xfail "a29k-*-udi"
send "until\n"
expect {
-re "The program is not running..*$prompt $"\
{ pass "until" }
-re ".*$prompt $" { fail "until" }
timeout { fail "(timeout) until" }
}
#test undisplay
# FIXME -- need to dump full output to detailed log
send "undisplay\n"
expect {
-re "Delete all auto-display expressions.*y or n. $"\
{ send "y\n"
expect {
-re "$prompt $"\
{ pass "undisplay prompt" }
timeout { fail "(timeout) (timeout) undisplay prompt" }
}
}
timeout { fail "(timeout) (timeout) undisplay prompt" }
}
#test unset environment
send "unset environment\n"
expect {
-re "Delete all environment variables?.*y or n. $"\
{ send "y\n"
expect {
-re "$prompt $"\
{ pass "unset environmentprompt" }
timeout { fail "(timeout) (timeout) unset environment prompt" }
}
}
timeout { fail "(timeout) (timeout) unset environment prompt" }
}
#test unset
send "unset\n"
expect {
-re "\"unset\" must be followed by the name of an unset subcommand..*
List of unset subcommands:.*
unset environment -- Cancel environment variable VAR for the program.*
Type \"help unset\" followed by unset subcommand name for full documentation..*
Command name abbreviations are allowed if unambiguous..*$prompt $"\
{ pass "unset" }
-re ".*$prompt $" { fail "unset" }
timeout { fail "(timeout) unset" }
}
#test up
gdb_test "up" "No stack\\." "up in default.exp"
#test up-silently
send "up-silently\n"
expect {
-re "No stack..*$prompt $"\
{ pass "up-silently" }
-re ".*$prompt $" { fail "up-silently" }
timeout { fail "(timeout) up-silently" }
}
#test watch
send "watch\n"
expect {
-re "Argument required .expression to compute.*$prompt $"\
{ pass "watch" }
-re ".*$prompt $" { fail "watch" }
timeout { fail "(timeout) watch" }
}
#test whatis
send "whatis\n"
expect {
-re "The history is empty..*$prompt $"\
{ pass "whatis" }
-re ".*$prompt $" { fail "whatis" }
timeout { fail "(timeout) whatis" }
}
#test where
setup_xfail "a29k-*-udi"
send "where\n"
expect {
-re "No stack..*$prompt $"\
{ pass "where" }
-re ".*$prompt $" { fail "where" }
timeout { fail "(timeout) where" }
}
#test x
#The case in which it prints a number is for vxgdb.
send "x\n"
expect {
-re "0x0:.*Cannot access memory at address 0x0..*$prompt $"\
{ pass "x" }
-re "0x0:.*0x\[0-9\]*.*$prompt $"\
{ pass "x" }
-re ".*$prompt $" { fail "x" }
timeout { fail "(timeout) x" }
}
|