home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / gdb-4.9 / gdb / testsuite / gdb.t00 / default.exp < prev    next >
Encoding:
Text File  |  1993-05-12  |  63.4 KB  |  2,515 lines

  1. #
  2. # test default actions of gdb commands
  3. #
  4.  
  5. load_lib gdb.exp
  6.  
  7. gdb_test "add-symbol-file" "add-symbol-file takes a file name and an address"
  8.  
  9. setup_xfail "mips-idt-*"
  10. send "attach\n"
  11. expect {
  12.     -re "Argument required \(process-id to attach\).*$prompt $"\
  13.             { pass "attach" }
  14.     -re "You can't do that when your target is `None'.*$prompt $"\
  15.             { pass "attach" }
  16.     -re "Don't know how to attach.  Try \"help target\"..*$prompt $"\
  17.             { pass "attach" }
  18.     -re "Kill it\? \(y or n\)" {
  19.     send "y\n"
  20.     continue -expect
  21.     }
  22.     -re "$prompt $" { fail "attach" }
  23.     timeout { fail "(timeout) attach" }
  24. }
  25.  
  26. # FIXME: attach kills the udi connection
  27. if [istarget "a29k-*-udi"] then {
  28.     gdb_exit
  29.     gdb_start
  30. }
  31.  
  32. gdb_test "break" "No default breakpoint address now."
  33. foreach i "b br bre brea" {
  34.     gdb_test $i "No default breakpoint address now." "break \"$i\" abbreviation"
  35.     }
  36.  
  37. setup_xfail "mips-idt-*" "a29k-*-udi"
  38. gdb_test "backtrace" "No stack."
  39. foreach i "bt ba bac" {
  40.     setup_xfail "mips-idt-*" "a29k-*-udi"
  41.     gdb_test $i "No stack." "backtrace \"$i\" abbreviation"
  42. }
  43.  
  44. # This works on the MIPS IDT board, but confuses future tests.
  45. if ![istarget "mips-idt-*"] then {
  46.     setup_xfail "a29k-*-udi"
  47.     gdb_test "continue" "The program is not being run."
  48.     setup_xfail "a29k-*-udi"
  49.     gdb_test "c" "The program is not being run." "continue \"c\" abbreviation"
  50. }
  51.  
  52. # FIXME: continue kills the udi connection
  53. if [istarget "a29k-*-udi"] then {
  54.     gdb_exit
  55.     gdb_start
  56. }
  57.  
  58. #test call
  59. send "call\n"
  60. expect {
  61.     -re "The history is empty..*$prompt $"\
  62.             { pass "call" }
  63.     -re ".*$prompt $"    { fail "call" }
  64.     timeout        { fail "(timeout) call" }
  65.     }
  66.  
  67.  
  68. #test catch
  69. send "catch\n"
  70. expect {
  71.     -re "No selected frame..*$prompt $"\
  72.             { pass "catch" }
  73.     -re ".*$prompt $"    { fail "catch" }
  74.     timeout        { fail "(timeout) catch" }
  75.     }
  76.  
  77.  
  78. #test cd
  79. send "cd\n"
  80. expect {
  81.     -re "Argument required \(new working directory\)..*$prompt $"\
  82.             { pass "cd" }
  83.     -re ".*$prompt $"    { fail "cd" }
  84.     timeout        { fail "(timeout) cd" }
  85.     }
  86.  
  87.  
  88. #test clear
  89. send "clear\n"
  90. expect {
  91.     -re "No source file specified..*$prompt $"\
  92.             { pass "clear" }
  93.     -re ".*$prompt $"    { fail "clear" }
  94.     timeout        { fail "(timeout) clear" }
  95.     }
  96.  
  97.  
  98. #test commands
  99. send "commands\n"
  100. expect {
  101.     -re "No breakpoint number 0..*$prompt $"\
  102.             { pass "commands" }
  103.     -re ".*$prompt $"    { fail "commands" }
  104.     timeout        { fail "(timeout) commands" }
  105.     }
  106.  
  107.  
  108. #test condition
  109. send "condition\n"
  110. expect {
  111.     -re "Argument required \(breakpoint number\)..*$prompt $"\
  112.             { pass "condition" }
  113.     -re ".*$prompt $"    { fail "condition" }
  114.     timeout        { fail "(timeout) condition" }
  115.     }
  116.  
  117.  
  118. #test core-file
  119. send "core-file\n"
  120. expect {
  121.     -re "No core file now..*$prompt $"\
  122.             { pass "core-file" }
  123.     -re "GDB can't read core files on this machine..*$prompt $"\
  124.             { pass "core-file" }
  125.     -re ".*$prompt $"    { fail "core-file" }
  126.     timeout        { fail "(timeout) core-file" }
  127.     }
  128.  
  129.  
  130. #test delete "d" abbreviation
  131. send "d\n"
  132. expect {
  133.     -re "$prompt $"\
  134.             { pass "delete \"d\" abbreviation" }
  135.     timeout        { fail "(timeout) delete \"d\" abbreviation" }
  136.     }
  137.  
  138.  
  139. #test delete
  140. send "delete\n"
  141. expect {
  142.     -re "$prompt $"\
  143.             { pass "delete" }
  144.     timeout        { fail "(timeout) delete" }
  145.     }
  146.  
  147.  
  148. #test define
  149. send "define\n"
  150. expect {
  151.     -re "Argument required \(name of command to define\)..*$prompt $"\
  152.             { pass "define" }
  153.     timeout        { fail "(timeout) define" }
  154.     }
  155.  
  156.  
  157. #test delete breakpoints
  158. send "delete breakpoints\n"
  159. expect {
  160.     -re "$prompt $"\
  161.             { pass "delete breakpoints" }
  162.     timeout        { fail "(timeout) delete breakpoints" }
  163.     }
  164.  
  165.  
  166. #test delete display
  167. # FIXME -- need to dump full output to detailed log
  168. send "delete display\n"
  169. expect {
  170.     -re "Delete all auto-display expressions\? \(y or n\) $"\
  171.         { send "y\n"
  172.         expect {
  173.             -re "$prompt $"\
  174.             { pass "delete display prompt" }
  175.             timeout        { fail "(timeout) delete display prompt" }
  176.             }
  177.         }
  178.     timeout        { fail "(timeout) delete display prompt" }
  179.  
  180.     }
  181.  
  182.  
  183. #test detach
  184. gdb_test "detach" ""
  185. #send "detach\n"
  186. #expect {
  187. #    -re "$prompt $"\
  188. #            { pass "detach" }
  189. #    timeout        { fail "(timeout) detach" }
  190. #    }
  191.  
  192. # FIXME: continue kills the udi connection
  193. if [istarget "a29k-*-udi"] then {
  194.     gdb_exit
  195.     gdb_start
  196. }
  197.  
  198. #test directory
  199. # FIXME -- need to dump full output to detailed log
  200. send "directory\n"
  201. expect {
  202.     -re "Reinitialize source path to empty\? \(y or n\) $"\
  203.         { send "y\n"
  204.         expect {
  205.             -re "Source directories searched: .cdir:.cwd.*$prompt $"\
  206.             { pass "directory prompt" }
  207.             timeout        { fail "(timeout) directory prompt" }
  208.             }
  209.         }
  210.     }
  211.  
  212.  
  213. #test disable "dis" abbreviation
  214. send "dis\n"
  215. expect {
  216.     -re "$prompt $"\
  217.             { pass "disable \"dis\" abbreviation" }
  218.     timeout        { fail "(timeout) disable \"dis\" abbreviation" }
  219.     }
  220.  
  221.  
  222. #test disable "disa" abbreviation
  223. send "disa\n"
  224. expect {
  225.     -re "$prompt $"\
  226.             { pass "disable \"disa\" abbreviation" }
  227.     timeout        { fail "(timeout) disable \"disa\" abbreviation" }
  228.     }
  229.  
  230.  
  231. #test disable
  232. send "disable\n"
  233. expect {
  234.     -re "$prompt $"\
  235.             { pass "disable" }
  236.     timeout        { fail "(timeout) disable" }
  237.     }
  238.  
  239.  
  240. #test disable breakpoints
  241. send "disable breakpoints\n"
  242. expect {
  243.     -re "$prompt $"\
  244.             { pass "disable breakpoints" }
  245.     timeout        { fail "(timeout) disable breakpoints" }
  246.     }
  247.  
  248.  
  249. #test disable display
  250. send "disable display\n"
  251. expect {
  252.     -re "$prompt $"\
  253.             { pass "disable display" }
  254.     timeout        { fail "(timeout) disable display" }
  255.     }
  256.  
  257.  
  258. #test disassemble
  259. send "disassemble\n"
  260. expect {
  261.     -re "No frame selected..*$prompt $"\
  262.             { pass "disassemble" }
  263.     -re ".*$prompt $"    { fail "disassemble" }
  264.     timeout        { fail "(timeout) disassemble" }
  265.     }
  266.  
  267.  
  268. #test display
  269. send "display\n"
  270. expect {
  271.     -re "$prompt $"\
  272.             { pass "display" }
  273.     timeout        { fail "(timeout) display" }
  274.     }
  275.  
  276.  
  277. #test do
  278. send "do\n"
  279. expect {
  280.     -re "No stack..*$prompt $"\
  281.             { pass "do" }
  282.     -re ".*$prompt $"    { fail "do" }
  283.     timeout        { fail "(timeout) do" }
  284.     }
  285.  
  286.  
  287. #test document
  288. send "document\n"
  289. expect {
  290.     -re "Argument required \(name of command to define\)..*$prompt $"\
  291.             { pass "document" }
  292.     -re ".*$prompt $"    { fail "document" }
  293.     timeout        { fail "(timeout) document" }
  294.     }
  295.  
  296.  
  297. #test down
  298. send "down\n"
  299. expect {
  300.     -re "No stack..*$prompt $"\
  301.             { pass "down" }
  302.     -re ".*$prompt $"    { fail "down" }
  303.     timeout        { fail "(timeout) down" }
  304.     }
  305.  
  306.  
  307. #test down-silently
  308. send "down-silently\n"
  309. expect {
  310.     -re "No stack..*$prompt $"\
  311.             { pass "down-silently" }
  312.     -re ".*$prompt $"    { fail "down-silently" }
  313.     timeout        { fail "(timeout) down-silently" }
  314.     }
  315.  
  316.  
  317. #test echo
  318. send "echo\n"
  319. expect {
  320.     -re "$prompt $"\
  321.             { pass "echo" }
  322.     timeout        { fail "(timeout) echo" }
  323.     }
  324.  
  325.  
  326. #test enable breakpoints delete
  327. send "enable breakpoints delete\n"
  328. expect {
  329.     -re "Argument required \(one or more breakpoint numbers\)..*$prompt $"\
  330.             { pass "enable breakpoints delete" }
  331.     -re ".*$prompt $"    { fail "enable breakpoints delete" }
  332.     timeout        { fail "(timeout) enable breakpoints delete" }
  333.     }
  334.  
  335.  
  336. #test enable breakpoints once
  337. send "enable breakpoints once\n"
  338. expect {
  339.     -re "Argument required \(one or more breakpoint numbers\)..*$prompt $"\
  340.             { pass "enable breakpoints once" }
  341.     -re ".*$prompt $"    { fail "enable breakpoints once" }
  342.     timeout        { fail "(timeout) enable breakpoints once" }
  343.     }
  344.  
  345.  
  346. #test enable breakpoints
  347. send "enable breakpoints\n"
  348. expect {
  349.     -re "$prompt $"\
  350.             { pass "enable breakpoints" }
  351.     timeout        { fail "(timeout) enable breakpoints" }
  352.     }
  353.  
  354.  
  355. #test enable delete
  356. send "enable delete\n"
  357. expect {
  358.     -re "Argument required \(one or more breakpoint numbers\)..*$prompt $"\
  359.             { pass "enable delete" }
  360.     -re ".*$prompt $"    { fail "enable delete" }
  361.     timeout        { fail "(timeout) enable delete" }
  362.     }
  363.  
  364.  
  365. #test enable display
  366. send "enable display\n"
  367. expect {
  368.     -re "$prompt $"\
  369.             { pass "enable display" }
  370.     timeout        { fail "(timeout) enable display" }
  371.     }
  372.  
  373.  
  374. #test enable once
  375. send "enable once\n"
  376. expect {
  377.     -re "Argument required \(one or more breakpoint numbers\)..*$prompt $"\
  378.             { pass "enable once" }
  379.     -re ".*$prompt $"    { fail "enable once" }
  380.     timeout        { fail "(timeout) enable once" }
  381.     }
  382.  
  383.  
  384. #test enable
  385. send "enable\n"
  386. expect {
  387.     -re "$prompt $"\
  388.             { pass "enable" }
  389.     timeout        { fail "(timeout) enable" }
  390.     }
  391.  
  392.  
  393. #test exec-file
  394. send "exec-file\n"
  395. expect {
  396.     -re "No exec file now..*$prompt $" {
  397.     pass "exec-file"
  398.     }
  399.     -re "exec-file.*A program is being debugged already.  Kill it\? \(y or n\).*$" {
  400.     send "n\n"
  401.     if $verbose>1 then {
  402.         send_user "\tDidn't kill program being debugged\n"
  403.     }
  404.     expect -re "$prompt $" { }
  405.     pass "exec-file"
  406.     }
  407.     -re "$prompt $"    { fail "exec-file" }
  408.     timeout        { fail "(timeout) exec-file" }
  409.     }
  410.  
  411.  
  412. #test frame "f" abbreviation
  413. setup_xfail "a29k-*-udi"
  414. send "f\n"
  415. expect {
  416.     -re "No stack..*$prompt $"\
  417.             { pass "frame \"f\" abbreviation" }
  418.     -re ".*$prompt $"    { fail "frame \"f\" abbreviation" }
  419.     timeout        { fail "(timeout) frame \"f\" abbreviation" }
  420.     }
  421.  
  422.  
  423. #test frame
  424. setup_xfail "a29k-*-udi"
  425. send "frame\n"
  426. expect {
  427.     -re "No stack..*$prompt $"\
  428.             { pass "frame" }
  429.     -re ".*$prompt $"    { fail "frame" }
  430.     timeout        { fail "(timeout) frame" }
  431.     }
  432.  
  433.  
  434. #test fg
  435. setup_xfail "a29k-*-udi"
  436. send "fg\n"
  437. expect {
  438.     -re "The program is not being run..*$prompt $"\
  439.             { pass "fg" }
  440.     -re ".*$prompt $"    { fail "fg" }
  441.     timeout        { fail "(timeout) fg" }
  442.     }
  443.  
  444. # FIXME: fg kills the udi connection
  445. if [istarget "a29k-*-udi"] then {
  446.     gdb_exit
  447.     gdb_start
  448. }
  449.  
  450. #test file
  451. send "file\n"
  452. expect {
  453.     -re "No exec file now..*$prompt $"\
  454.             { pass "file" }
  455.     -re ".*A program is being debugged already.  Kill it\? \(y or n\).*$" {
  456.         send "n\n"
  457.         if $verbose>1 then {
  458.         send_user "\t\tDidn't kill program being debugged\n"
  459.         }
  460.         expect -re "$prompt $" { }
  461.         pass "file"
  462.     }
  463.     -re ".*$prompt $"    { fail "file" }
  464.     timeout        { fail "(timeout) file" }
  465.     }
  466.  
  467.  
  468. #test finish
  469. setup_xfail "a29k-*-udi"
  470. send "finish\n"
  471. expect {
  472.     -re "The program is not running..*$prompt $"\
  473.             { pass "finish" }
  474.     -re ".*$prompt $"    { fail "finish" }
  475.     timeout        { fail "(timeout) finish" }
  476.     }
  477.  
  478.  
  479. #test forward-search
  480. # The message here comes from the regexp library, not gdb, and so can
  481. # vary on different systems.
  482. send "forward-search\n"
  483. expect {
  484.     -re "No previous regular expression.*$prompt $"\
  485.             { pass "forward-search" }
  486.     -re "There is no previous regular expression.*$prompt $"\
  487.             { pass "forward-search" }
  488.     -re ".*$prompt $"    { fail "forward-search" }
  489.     timeout        { fail "(timeout) forward-search" }
  490.     }
  491.  
  492.  
  493. #test help "h" abbreviation
  494. send "h\n"
  495. expect {
  496.     -re "List of classes of commands:.*
  497. running -- Running the program.*
  498. stack -- Examining the stack.*
  499. data -- Examining data.*
  500. breakpoints -- Making program stop at certain points.*
  501. files -- Specifying and examining files.*
  502. status -- Status inquiries.*
  503. support -- Support facilities.*
  504. user-defined -- User-defined commands.*
  505. aliases -- Aliases of other commands.*
  506. obscure -- Obscure features.*
  507. Type \"help\" followed by a class name for a list of commands in that class..*
  508. Type \"help\" followed by command name for full documentation..*
  509. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  510.             { pass "help \"h\" abbreviation" }
  511.     -re ".*$prompt $"    { fail "help \"h\" abbreviation" }
  512.     timeout        { fail "(timeout) help \"h\" abbreviation" }
  513.     }
  514.  
  515.  
  516. #test help
  517. send "help\n"
  518. expect {
  519.     -re "List of classes of commands:.*
  520. running -- Running the program.*
  521. stack -- Examining the stack.*
  522. data -- Examining data.*
  523. breakpoints -- Making program stop at certain points.*
  524. files -- Specifying and examining files.*
  525. status -- Status inquiries.*
  526. support -- Support facilities.*
  527. user-defined -- User-defined commands.*
  528. aliases -- Aliases of other commands.*
  529. obscure -- Obscure features.*
  530. Type \"help\" followed by a class name for a list of commands in that class..*
  531. Type \"help\" followed by command name for full documentation..*
  532. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  533.             { pass "help" }
  534.     -re ".*$prompt $"    { fail "help" }
  535.     timeout        { fail "(timeout) help" }
  536.     }
  537.  
  538.  
  539. #test handle
  540. send "handle\n"
  541. expect {
  542.     -re "Argument required \(signal to handle\)..*$prompt $"\
  543.             { pass "handle" }
  544.     -re ".*$prompt $"    { fail "handle" }
  545.     timeout        { fail "(timeout) handle" }
  546.     }
  547.  
  548.  
  549. #test info "i" abbreviation 
  550. send "i\n"
  551. expect {
  552.     -re "\"info\" must be followed by the name of an info command..*
  553. List of info subcommands:.*
  554. info set -- Show all GDB settings.*\
  555. info files -- Names of targets and files being debugged.*\
  556. info target -- Names of targets and files being debugged.*\
  557. info sources -- Source files in the program.*\
  558. info types -- All type names.*\
  559. info functions -- All function names.*\
  560. info variables -- All global and static variable names.*\
  561. info catch -- Exceptions that can be caught in the current stack frame.*\
  562. info args -- Argument variables of current stack frame.*\
  563. info locals -- Local variables of current stack frame.*\
  564. info frame -- All about selected stack frame.*\
  565. info stack -- Backtrace of the stack.*\
  566. info line -- Core addresses of the code for a source line.*\
  567. info source -- Information about the current source file.*\
  568. (info sharedlibrary -- Status of loaded shared object libraries.*)?\
  569. info display -- Expressions to display when program stops.*\
  570. info address -- Describe where variable VAR is stored.*\
  571. info signals -- What debugger does when program gets various signals.*\
  572. info terminal -- Print inferior's saved terminal status.*\
  573. info float -- Print the status of the floating point unit.*\
  574. info program -- Execution status of the program.*\
  575. info all-registers -- List of all registers and their contents.*\
  576. info registers -- List of integer registers and their contents.*\
  577. info warranty -- Various kinds of warranty you do not have.*\
  578. info copying -- Conditions for redistributing copies of GDB.*\
  579. info watchpoints -- Synonym for ``info breakpoints''.*\
  580. info breakpoints -- Status of user-settable breakpoints.*\
  581. Type \"help info\" followed by info subcommand name for full documentation..*
  582. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  583.             { pass "info \"i\" abbreviation" }
  584.     -re ".*$prompt $"    { fail "info \"i\" abbreviation" }
  585.     timeout        { fail "(timeout) info \"i\" abbreviation" }
  586.     }
  587.  
  588.  
  589. #test info
  590. send "info\n"
  591. expect {
  592.     -re "\"info\" must be followed by the name of an info command..*
  593. List of info subcommands:.*
  594. info set -- Show all GDB settings.*\
  595. info files -- Names of targets and files being debugged.*\
  596. info target -- Names of targets and files being debugged.*\
  597. info sources -- Source files in the program.*\
  598. info types -- All type names.*\
  599. info functions -- All function names.*\
  600. info variables -- All global and static variable names.*\
  601. info catch -- Exceptions that can be caught in the current stack frame.*\
  602. info args -- Argument variables of current stack frame.*\
  603. info locals -- Local variables of current stack frame.*\
  604. info frame -- All about selected stack frame.*\
  605. info stack -- Backtrace of the stack.*\
  606. info line -- Core addresses of the code for a source line.*\
  607. info source -- Information about the current source file.*\
  608. (info sharedlibrary -- Status of loaded shared object libraries.*)?\
  609. info display -- Expressions to display when program stops.*\
  610. info address -- Describe where variable VAR is stored.*\
  611. info signals -- What debugger does when program gets various signals.*\
  612. info terminal -- Print inferior's saved terminal status.*\
  613. info float -- Print the status of the floating point unit.*\
  614. info program -- Execution status of the program.*\
  615. info all-registers -- List of all registers and their contents.*\
  616. info registers -- List of integer registers and their contents.*\
  617. info warranty -- Various kinds of warranty you do not have.*\
  618. info copying -- Conditions for redistributing copies of GDB.*\
  619. info watchpoints -- Synonym for ``info breakpoints''.*\
  620. info breakpoints -- Status of user-settable breakpoints.*\
  621. Type \"help info\" followed by info subcommand name for full documentation..*
  622. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  623.             { pass "info" }
  624.     -re ".*$prompt $"    { fail "info" }
  625.     timeout        { fail "(timeout) info" }
  626.     }
  627.  
  628.  
  629. #test ignore
  630. send "ignore\n"
  631. expect {
  632.     -re "Argument required \(a breakpoint number\)..*$prompt $"\
  633.             { pass "ignore" }
  634.     -re ".*$prompt $"    { fail "ignore" }
  635.     timeout        { fail "(timeout) ignore" }
  636.     }
  637.  
  638.  
  639. #test info address
  640. send "info address\n"
  641. expect {
  642.     -re "Argument required..*$prompt $"\
  643.             { pass "info address" }
  644.     -re ".*$prompt $"    { fail "info address" }
  645.     timeout        { fail "(timeout) info address" }
  646.     }
  647.  
  648.  
  649. #test info all-registers
  650. setup_xfail "a29k-*-udi"
  651. send "info all-registers\n"
  652. expect {
  653.     -re "The program has no registers now..*$prompt $"\
  654.             { pass "info all-registers" }
  655.     -re ".*$prompt $"    { fail "info all-registers" }
  656.     timeout        { fail "(timeout) info all-registers" }
  657.     }
  658.  
  659.  
  660. #test info args
  661. send "info args\n"
  662. expect {
  663.     -re "No frame selected..*$prompt $"\
  664.             { pass "info args" }
  665.     -re ".*$prompt $"    { fail "info args" }
  666.     timeout        { fail "(timeout) info args" }
  667.     }
  668.  
  669.  
  670. #test info bogus-gdb-command
  671. send "info bogus-gdb-command\n"
  672. expect {
  673.     -re "Undefined info command: \"bogus-gdb-command\".  Try \"help info\"..*$prompt $"\
  674.             { pass "info bogus-gdb-command" }
  675.     -re ".*$prompt $"    { fail "info bogus-gdb-command" }
  676.     timeout        { fail "(timeout) info bogus-gdb-command" }
  677.     }
  678.  
  679.  
  680. #test info breakpoints
  681. send "info breakpoints\n"
  682. expect {
  683.     -re "No breakpoints or watchpoints..*$prompt $"\
  684.             { pass "info breakpoints" }
  685.     -re ".*$prompt $"    { fail "info breakpoints" }
  686.     timeout        { fail "(timeout) info breakpoints" }
  687.     }
  688.  
  689.  
  690. #test info catch
  691. send "info catch\n"
  692. expect {
  693.     -re "No frame selected..*$prompt $"\
  694.             { pass "info catch" }
  695.     -re ".*$prompt $"    { fail "info catch" }
  696.     timeout        { fail "(timeout) info catch" }
  697.     }
  698.  
  699.  
  700. #test info copying
  701. # FIXME -- doesn't work worth a shit
  702. #send "info copying\n"
  703. #expect {
  704. #    -re "GNU GENERAL PUBLIC LICENSE.*\
  705. #of preserving the free status of all derivatives of our free software and.*\
  706. #of promoting the sharing and reuse of software generally..*$prompt $"\
  707. #            { pass "info copying" }
  708. #    timeout        { fail "(timeout) info copying" }
  709. #    }
  710. #
  711. #
  712.  
  713. #test info display
  714. send "info display\n"
  715. expect {
  716.     -re "There are no auto-display expressions now..*$prompt $"\
  717.             { pass "info display" }
  718.     -re ".*$prompt $"    { fail "info display" }
  719.     timeout        { fail "(timeout) info display" }
  720.     }
  721.  
  722.  
  723. #test info frame "f" abbreviation
  724. send "info f\n"
  725. expect {
  726.     -re "No inferior or core file..*$prompt $"\
  727.             { pass "info frame \"f\" abbreviation" }
  728.     -re "No selected frame..*$prompt $"\
  729.             { pass "info frame \"f\" abbreviation" }
  730.     -re ".*$prompt $"    { fail "info frame \"f\" abbreviation" }
  731.     timeout        { fail "(timeout) info frame \"f\" abbreviation" }
  732.     }
  733.  
  734.  
  735. #test info frame
  736. send "info frame\n"
  737. expect {
  738.     -re "No inferior or core file..*$prompt $"\
  739.             { pass "info frame" }
  740.     -re "No selected frame..*$prompt $"\
  741.             { pass "info frame" }
  742.     -re ".*$prompt $"    { fail "info frame" }
  743.     timeout        { fail "(timeout) info frame" }
  744.     }
  745.  
  746.  
  747. #test info files
  748. send "info files\n"
  749. expect {
  750.     -re "$prompt $"\
  751.             { pass "info files" }
  752.     timeout        { fail "(timeout) info files" }
  753.     }
  754.  
  755.  
  756. #test info float
  757. send "info float\n"
  758. expect {
  759.     -re "No floating point info available for this processor..*$prompt $"\
  760.             { pass "info float" }
  761.     -re ".*$prompt $"    { fail "info float" }
  762.     timeout        { fail "(timeout) info float" }
  763.     }
  764.  
  765.  
  766. #test info functions
  767. send "info functions\n"
  768. expect {
  769.     -re "All defined functions:.*$prompt $"\
  770.             { pass "info functions" }
  771.     -re ".*$prompt $"    { fail "info functions" }
  772.     timeout        { fail "(timeout) info functions" }
  773.     }
  774.  
  775.  
  776. #test info line
  777. send "info line\n"
  778. expect {
  779.     -re "No source file specified..*$prompt $"\
  780.             { pass "info line" }
  781.     -re ".*$prompt $"    { fail "info line" }
  782.     timeout        { fail "(timeout) info line" }
  783.     }
  784.  
  785.  
  786. #test info locals
  787. send "info locals\n"
  788. expect {
  789.     -re "No frame selected..*$prompt $"\
  790.             { pass "info locals" }
  791.     -re ".*$prompt $"    { fail "info locals" }
  792.     timeout        { fail "(timeout) info locals" }
  793.     }
  794.  
  795.  
  796. #test info program
  797. setup_xfail "a29k-*-udi"
  798. send "info program\n"
  799. expect {
  800.     -re "The program being debugged is not being run..*$prompt $"\
  801.             { pass "info program" }
  802.     -re ".*$prompt $"    { fail "info program" }
  803.     timeout        { fail "(timeout) info program" }
  804.     }
  805.  
  806.  
  807. #test info registers
  808. setup_xfail "a29k-*-udi"
  809. send "info registers\n"
  810. expect {
  811.     -re "The program has no registers now..*$prompt $"\
  812.             { pass "info registers" }
  813.     -re ".*$prompt $"    { fail "info registers" }
  814.     timeout        { fail "(timeout) info registers" }
  815.     }
  816.  
  817.  
  818. #test info stack "s" abbreviation
  819. setup_xfail "a29k-*-udi"
  820. send "info s\n"
  821. expect {
  822.     -re "No stack..*$prompt $"\
  823.             { pass "info stack \"s\" abbreviation" }
  824.     -re ".*$prompt $"    { fail "info stack \"s\" abbreviation" }
  825.     timeout        { fail "(timeout) info stack \"s\" abbreviation" }
  826.     }
  827.  
  828.  
  829. #test info stack
  830. setup_xfail "a29k-*-udi"
  831. send "info stack\n"
  832. expect {
  833.     -re "No stack..*$prompt $"\
  834.             { pass "info stack" }
  835.     -re ".*$prompt $"    { fail "info stack" }
  836.     timeout        { fail "(timeout) info stack" }
  837.     }
  838.  
  839.  
  840. #test info set
  841. # FIXME -- needs to match the entire output
  842. send "info set\n"
  843. expect {
  844.     -re "confirm:  Whether to confirm potentially dangerous operations is on..*
  845. history filename:  The filename in which to record the command history is .*
  846. listsize:  Number of source lines gdb will list by default is 10..*$prompt $"\
  847.             { pass "info set" }
  848.     -re "\n$prompt $"    { fail "info set" }
  849.     timeout        { fail "(timeout) info set" }
  850.     }
  851.  
  852.  
  853. #test info source
  854. send "info source\n"
  855. expect {
  856.     -re "No current source file..*$prompt $"\
  857.             { pass "info source" }
  858.     -re ".*$prompt $"    { fail "info source" }
  859.     timeout        { fail "(timeout) info source" }
  860.     }
  861.  
  862.  
  863. #test info sources
  864. send "info sources\n"
  865. expect {
  866.     -re "No symbol table is loaded.  Use the \"file\" command..*$prompt $"\
  867.             { pass "info sources" }
  868.     -re ".*$prompt $"    { fail "info sources" }
  869.     timeout        { fail "(timeout) info sources" }
  870.     }
  871.  
  872.  
  873. #test info target
  874. send "info target\n"
  875. expect {
  876.     -re "$prompt $"\
  877.             { pass "info target" }
  878.     timeout        { fail "(timeout) info target" }
  879.     }
  880.  
  881.  
  882. #test info terminal
  883. send "info terminal\n"
  884. expect {
  885.     -re "No saved terminal information..*$prompt $"\
  886.             { pass "info terminal" }
  887.     -re ".*$prompt $"    { fail "info terminal" }
  888.     timeout        { fail "(timeout) info terminal" }
  889.     }
  890.  
  891.  
  892. #test info types
  893. send "info types\n"
  894. expect {
  895.     -re "All defined types:.*$prompt $"\
  896.             { pass "info types" }
  897.     -re ".*$prompt $"    { fail "info types" }
  898.     timeout        { fail "(timeout) info types" }
  899.     }
  900.  
  901.  
  902. #test info variables
  903. send "info variables\n"
  904. expect {
  905.     -re "All defined variables:.*$prompt $"\
  906.             { pass "info variables" }
  907.     -re ".*$prompt $"    { fail "info variables" }
  908.     timeout        { fail "(timeout) info variables" }
  909.     }
  910.  
  911.  
  912. #test info warranty
  913. send "info warranty\n"
  914. expect {
  915.     -re "NO WARRANTY.*
  916.   11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY.*
  917. FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN.*
  918. OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES.*
  919. PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED.*
  920. OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF.*
  921. MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS.*
  922. TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE.*
  923. PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,.*
  924. REPAIR OR CORRECTION..*
  925.   12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING.*
  926. WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR.*
  927. REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,.*
  928. INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING.*
  929. OUT OF THE USE OR INABILITY TO USE THE PROGRAM \(INCLUDING BUT NOT LIMITED.*
  930. TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY.*
  931. YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER.*
  932. PROGRAMS\), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE.*
  933. POSSIBILITY OF SUCH DAMAGES..*$prompt $"\
  934.             { pass "info warranty" }
  935.     -re ".*$prompt $"    { fail "info warranty" }
  936.     timeout        { fail "(timeout) info warranty" }
  937.     }
  938.  
  939.  
  940. #test info watchpoints
  941. send "info watchpoints\n"
  942. expect {
  943.     -re "No breakpoints or watchpoints..*$prompt $"\
  944.             { pass "info watchpoints" }
  945.     -re ".*$prompt $"    { fail "info watchpoints" }
  946.     timeout        { fail "(timeout) info watchpoints" }
  947.     }
  948.  
  949.  
  950. #test inspect
  951. send "inspect\n"
  952. expect {
  953.     -re "The history is empty..*$prompt $"\
  954.             { pass "inspect" }
  955.     -re ".*$prompt $"    { fail "inspect" }
  956.     timeout        { fail "(timeout) inspect" }
  957.     }
  958.  
  959.  
  960. #test jump
  961. setup_xfail "a29k-*-udi"
  962. send "jump\n"
  963. expect {
  964.     -re "The program is not being run..*$prompt $"\
  965.             { pass "jump" }
  966.     -re ".*$prompt $"    { fail "jump" }
  967.     timeout        { fail "(timeout) jump" }
  968.     }
  969.  
  970.  
  971. #test kill
  972. send "kill\n"
  973. expect {
  974.     -re "The program is not being run..*$prompt $"\
  975.             { pass "kill" }
  976.     -re ".*$prompt $"    { fail "kill" }
  977.     timeout        { fail "(timeout) kill" }
  978.     }
  979.  
  980.  
  981. #test list "l" abbreviation
  982. send "l\n"
  983. expect {
  984.     -re "No symbol table is loaded.  Use the \"file\" command..*$prompt $"\
  985.             { pass "list \"l\" abbreviation" }
  986.     -re ".*$prompt $"    { fail "list \"l\" abbreviation" }
  987.     timeout        { fail "(timeout) list \"l\" abbreviation" }
  988.     }
  989.  
  990.  
  991. #test list
  992. send "list\n"
  993. expect {
  994.     -re "No symbol table is loaded.  Use the \"file\" command..*$prompt $"\
  995.             { pass "list" }
  996.     -re ".*$prompt $"    { fail "list" }
  997.     timeout        { fail "(timeout) list" }
  998.     }
  999.  
  1000.  
  1001. #test load
  1002. #the ``takes a file name'' case is for vxgdb
  1003. send "load\n"
  1004. expect {
  1005.     -re "You can't do that when your target is `None'.*$prompt $"\
  1006.             { pass "load" }
  1007.     -re "The load command takes a file name.*$prompt $"\
  1008.             { pass "load" }
  1009.     -re "Must specify at least a file name with the load command.*$prompt $"\
  1010.             { pass "load" }
  1011.     -re ".*$prompt $"    { fail "load" }
  1012.     timeout        { fail "(timeout) load" }
  1013.     }
  1014.  
  1015.  
  1016. #test next "n" abbreviation
  1017. setup_xfail "a29k-*-udi"
  1018. send "n\n"
  1019. expect {
  1020.     -re "The program is not being run..*$prompt $"\
  1021.             { pass "next \"n\" abbreviation" }
  1022.     -re ".*$prompt $"    { fail "next \"n\" abbreviation" }
  1023.     timeout        { fail "(timeout) next \"n\" abbreviation" }
  1024.     }
  1025.  
  1026.  
  1027. #test next
  1028. setup_xfail "a29k-*-udi"
  1029. send "next\n"
  1030. expect {
  1031.     -re "The program is not being run..*$prompt $"\
  1032.             { pass "next" }
  1033.     -re ".*$prompt $"    { fail "next" }
  1034.     timeout        { fail "(timeout) next" }
  1035.     }
  1036.  
  1037.  
  1038. #test nexti "ni" abbreviation
  1039. setup_xfail "a29k-*-udi"
  1040. send "ni\n"
  1041. expect {
  1042.     -re "The program is not being run..*$prompt $"\
  1043.             { pass "nexti \"ni\" abbreviation" }
  1044.     -re ".*$prompt $"    { fail "nexti \"ni\" abbreviation" }
  1045.     timeout        { fail "(timeout) nexti \"ni\" abbreviation" }
  1046.     }
  1047.  
  1048.  
  1049. #test nexti
  1050. setup_xfail "a29k-*-udi"
  1051. send "nexti\n"
  1052. expect {
  1053.     -re "The program is not being run..*$prompt $"\
  1054.             { pass "nexti" }
  1055.     -re ".*$prompt $"    { fail "nexti" }
  1056.     timeout        { fail "(timeout) nexti" }
  1057.     }
  1058.  
  1059.  
  1060. #test output
  1061. send "output\n"
  1062. expect {
  1063.     -re "Argument required \(expression to compute\)..*$prompt $"\
  1064.             { pass "output" }
  1065.     -re ".*$prompt $"    { fail "output" }
  1066.     timeout        { fail "(timeout) output" }
  1067.     }
  1068.  
  1069.  
  1070. #test print "p" abbreviation
  1071. send "p\n"
  1072. expect {
  1073.     -re "The history is empty..*$prompt $"\
  1074.             { pass "print \"p\" abbreviation" }
  1075.     -re ".*$prompt $"    { fail "print \"p\" abbreviation" }
  1076.     timeout        { fail "(timeout) print \"p\" abbreviation" }
  1077.     }
  1078.  
  1079.  
  1080. #test print
  1081. send "print\n"
  1082. expect {
  1083.     -re "The history is empty..*$prompt $"\
  1084.             { pass "print" }
  1085.     -re ".*$prompt $"    { fail "print" }
  1086.     timeout        { fail "(timeout) print" }
  1087.     }
  1088.  
  1089.  
  1090. #test printf
  1091. send "printf\n"
  1092. expect {
  1093.     -re "Argument required \(format-control string and values to print\)..*$prompt $"\
  1094.             { pass "printf" }
  1095.     -re ".*$prompt $"    { fail "printf" }
  1096.     timeout        { fail "(timeout) printf" }
  1097.     }
  1098.  
  1099.  
  1100. # this command was removed from GDB 4.5.8
  1101. #test printsyms
  1102. #send "printsyms\n"
  1103. #expect {
  1104. #    -re "printsyms takes an output file name and optional symbol file name.*$prompt $"\
  1105. #            { pass "printsyms" }
  1106. #    -re ".*$prompt $"    { fail "printsyms" }
  1107. #    timeout        { fail "(timeout) printsyms" }
  1108. #    }
  1109.  
  1110. #test ptype
  1111. send "ptype\n"
  1112. expect {
  1113.     -re "The history is empty..*$prompt $"\
  1114.             { pass "ptype" }
  1115.     -re ".*$prompt $"    { fail "ptype" }
  1116.     timeout        { fail "(timeout) ptype" }
  1117.     }
  1118.  
  1119.  
  1120. #test pwd
  1121. send "pwd\n"
  1122. expect {
  1123.     -re "Working directory .*$prompt $"\
  1124.             { pass "pwd" }
  1125.     -re ".*$prompt $"    { fail "pwd" }
  1126.     timeout        { fail "(timeout) pwd" }
  1127.     }
  1128.  
  1129.  
  1130. #test run "r" abbreviation
  1131. if [istarget "*-*-vxworks"] then {
  1132.     send "set args\n"
  1133.     expect -re "$prompt $" {}
  1134.     gdb_test "r" "Starting program: .*
  1135. You must specify a function name to run, and arguments if any"\
  1136.         "run \"r\" abbreviation"
  1137.     send "set args main\n"
  1138.     expect -re "$prompt $" {}
  1139. } else {
  1140.     send "r\n"
  1141.     expect {
  1142.         -re "Starting program:  .*
  1143. You can't do that when your target is `None'.*$prompt $"\
  1144.             { pass "run \"r\" abbreviation" }
  1145.         -re "Starting program:  .*
  1146. No executable file specified.*
  1147. Use the \"file\" or \"exec-file\" command.*$prompt $"\
  1148.             { pass "run \"r\" abbreviation" }
  1149.         -re "Starting program:  .*
  1150. No image loaded into target.*$prompt $"\
  1151.             { pass "run \"r\" abbreviation" }
  1152.         -re "Don't know how to run.  Try \"help target\"..*$prompt $"\
  1153.             { pass "run \"r\" abbreviation" }
  1154.         -re ".*$prompt $"    { fail "run \"r\" abbreviation" }
  1155.         timeout        { fail "(timeout) run \"r\" abbreviation" }
  1156.     }
  1157. }
  1158.  
  1159. #test run
  1160. if [istarget "*-*-vxworks"] then {
  1161.     send "set args\n"
  1162.     expect -re "$prompt $" {}
  1163.     gdb_test "run" "Starting program: .*
  1164. You must specify a function name to run, and arguments if any"
  1165.     send "set args main\n"
  1166.     expect -re "$prompt $" {}
  1167. } else {
  1168.     send "run\n"
  1169.     expect {
  1170.         -re "Starting program:.*You can't do that when your target is `None'.*$prompt $" { pass "run" }
  1171.         -re "Starting program:  .*
  1172. No executable file specified.*
  1173. Use the \"file\" or \"exec-file\" command.*$prompt $"\
  1174.             { pass "run" }
  1175.         -re "Starting program:  .*
  1176. No image loaded into target.*$prompt $"\
  1177.             { pass "run" }
  1178.         -re "Don't know how to run.  Try \"help target\"..*$prompt $"\
  1179.             { pass "run" }
  1180.         -re ".*$prompt $"    { fail "run" }
  1181.         timeout        { fail "(timeout) run" }
  1182.     }
  1183. }
  1184.  
  1185. #test rbreak
  1186. send "rbreak\n"
  1187. expect {
  1188.     -re "$prompt $"\
  1189.             { pass "rbreak" }
  1190.     timeout        { fail "(timeout) rbreak" }
  1191.     }
  1192.  
  1193.  
  1194. #test return
  1195. send "return\n"
  1196. expect {
  1197.     -re "No selected frame..*$prompt $"\
  1198.             { pass "return" }
  1199.     -re ".*$prompt $"    { fail "return" }
  1200.     timeout        { fail "(timeout) return" }
  1201.     }
  1202.  
  1203.  
  1204. #test reverse-search
  1205. send "reverse-search\n"
  1206. expect {
  1207.     -re "No previous regular expression.*$prompt $"\
  1208.             { pass "reverse-search" }
  1209.     -re "There is no previous regular expression.*$prompt $"\
  1210.             { pass "forward-search" }
  1211.     -re ".*$prompt $"    { fail "reverse-search" }
  1212.     timeout        { fail "(timeout) reverse-search" }
  1213.     }
  1214.  
  1215.  
  1216. #test step "s" abbreviation
  1217. setup_xfail "a29k-*-udi"
  1218. send "s\n"
  1219. expect {
  1220.     -re "The program is not being run..*$prompt $"\
  1221.             { pass "step \"s\" abbreviation" }
  1222.     -re ".*$prompt $"    { fail "step \"s\" abbreviation" }
  1223.     timeout        { fail "(timeout) step \"s\" abbreviation" }
  1224.     }
  1225.  
  1226.  
  1227. #test step
  1228. setup_xfail "a29k-*-udi"
  1229. send "step\n"
  1230. expect {
  1231.     -re "The program is not being run..*$prompt $"\
  1232.             { pass "step" }
  1233.     -re ".*$prompt $"    { fail "step" }
  1234.     timeout        { fail "(timeout) step" }
  1235.     }
  1236.  
  1237.  
  1238. #test search
  1239. send "search\n"
  1240. expect {
  1241.     -re "No previous regular expression.*$prompt $"\
  1242.             { pass "search" }
  1243.     -re "There is no previous regular expression.*$prompt $"\
  1244.             { pass "forward-search" }
  1245.     -re ".*$prompt $"    { fail "search" }
  1246.     timeout        { fail "(timeout) search" }
  1247.     }
  1248.  
  1249.  
  1250. #test section
  1251. send "section\n"
  1252. expect {
  1253.     -re "Must specify section name and its virtual address.*$prompt $"\
  1254.             { pass "section" }
  1255.     -re ".*$prompt $"    { fail "section" }
  1256.     timeout        { fail "(timeout) section" }
  1257.     }
  1258.  
  1259.  
  1260. #test set args
  1261. send "set args\n"
  1262. expect {
  1263.     -re "$prompt $"\
  1264.             { pass "set args" }
  1265.     timeout        { fail "(timeout) set args" }
  1266.     }
  1267.  
  1268.  
  1269. #test set check "c" abbreviation
  1270. send "set c\n"
  1271. expect {
  1272.     -re "\"set check\" must be followed by the name of a check subcommand..*
  1273. List of set check subcommands:.*
  1274. set check range -- Set range checking.*
  1275. set check type -- Set type checking.*
  1276. Type \"help set check\" followed by set check subcommand name for full documentation..*
  1277. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  1278.             { pass "set check \"c\" abbreviation" }
  1279.     -re ".*$prompt $"    { fail "set check \"c\" abbreviation" }
  1280.     timeout        { fail "(timeout) set check \"c\" abbreviation" }
  1281.     }
  1282.  
  1283.  
  1284. #test set check "ch" abbreviation
  1285. send "set ch\n"
  1286. expect {
  1287.     -re "\"set check\" must be followed by the name of a check subcommand..*
  1288. List of set check subcommands:.*
  1289. set check range -- Set range checking.*
  1290. set check type -- Set type checking.*
  1291. Type \"help set check\" followed by set check subcommand name for full documentation..*
  1292. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  1293.             { pass "set check \"ch\" abbreviation" }
  1294.     -re ".*$prompt $"    { fail "set check \"ch\" abbreviation" }
  1295.     timeout        { fail "(timeout) set check \"ch\" abbreviation" }
  1296.     }
  1297.  
  1298.  
  1299. #test set check
  1300. send "set check\n"
  1301. expect {
  1302.     -re "\"set check\" must be followed by the name of a check subcommand..*
  1303. List of set check subcommands:.*
  1304. set check range -- Set range checking.*
  1305. set check type -- Set type checking.*
  1306. Type \"help set check\" followed by set check subcommand name for full documentation..*
  1307. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  1308.             { pass "set check" }
  1309.     -re ".*$prompt $"    { fail "set check" }
  1310.     timeout        { fail "(timeout) set check" }
  1311.     }
  1312.  
  1313.  
  1314. #test set check range
  1315. send "set check range\n"
  1316. expect {
  1317.     -re "$prompt $"\
  1318.             { pass "set check range" }
  1319.     timeout        { fail "(timeout) set check range" }
  1320.     }
  1321.  
  1322.  
  1323. #test set check type
  1324. send "set check type\n"
  1325. expect {
  1326.     -re "$prompt $"\
  1327.             { pass "set check type" }
  1328.     timeout        { fail "(timeout) set check type" }
  1329.     }
  1330.  
  1331.  
  1332. #test set complaints
  1333. send "set complaints\n"
  1334. expect {
  1335.     -re "Argument required \(integer to set it to.\)..*$prompt $"\
  1336.             { pass "set complaints" }
  1337.     -re ".*$prompt $"    { fail "set complaints" }
  1338.     timeout        { fail "(timeout) set complaints" }
  1339.     }
  1340.  
  1341.  
  1342. #test set confirm
  1343. send "set confirm\n"
  1344. expect {
  1345.     -re "$prompt $"\
  1346.             { pass "set confirm" }
  1347.     timeout        { fail "(timeout) set confirm" }
  1348.     }
  1349.  
  1350.  
  1351. #test set editing
  1352. send "set editing\n"
  1353. expect {
  1354.     -re "$prompt $"\
  1355.             { pass "set editing" }
  1356.     timeout        { fail "(timeout) set editing" }
  1357.     }
  1358.  
  1359.  
  1360.  
  1361. #test set environment
  1362. send "set environment\n"
  1363. expect {
  1364.     -re "Argument required \(environment variable and value\)..*$prompt $"\
  1365.             { pass "set environment" }
  1366.     -re ".*$prompt $"    { fail "set environment" }
  1367.     timeout        { fail "(timeout) set environment" }
  1368.     }
  1369.  
  1370.  
  1371. #test set height
  1372. send "set height\n"
  1373. expect {
  1374.     -re "Argument required \(integer to set it to.\)..*$prompt $"\
  1375.             { pass "set height" }
  1376.     -re ".*$prompt $"    { fail "set height" }
  1377.     timeout        { fail "(timeout) set height" }
  1378.     }
  1379.  
  1380.  
  1381. #test set history expansion
  1382. send "set history expansion\n"
  1383. expect {
  1384.     -re "$prompt $"\
  1385.             { pass "set history expansion" }
  1386.     timeout        { fail "(timeout) set history expansion" }
  1387.     }
  1388.  
  1389.  
  1390. #test set history filename
  1391. send "set history filename\n"
  1392. expect {
  1393.     -re "Argument required \(filename to set it to.\)..*$prompt $"\
  1394.             { pass "set history filename" }
  1395.     -re ".*$prompt $"    { fail "set history filename" }
  1396.     timeout        { fail "(timeout) set history filename" }
  1397.     }
  1398.  
  1399.  
  1400. #test set history save
  1401. send "set history save\n"
  1402. expect {
  1403.     -re "$prompt $"\
  1404.             { pass "set history save" }
  1405.     timeout        { fail "(timeout) set history save" }
  1406.     }
  1407.  
  1408.  
  1409. #test set history size
  1410. send "set history size\n"
  1411. expect {
  1412.     -re "Argument required \(integer to set it to.\)..*$prompt $"\
  1413.             { pass "set history size" }
  1414.     -re ".*$prompt $"    { fail "set history size" }
  1415.     timeout        { fail "(timeout) set history size" }
  1416.     }
  1417.  
  1418.  
  1419. #test set history
  1420. send "set history\n"
  1421. expect {
  1422.     -re "\"set history\" must be followed by the name of a history subcommand..*
  1423. List of set history subcommands:.*
  1424. set history filename -- Set the filename in which to record the command history.*
  1425. set history size -- Set the size of the command history.*
  1426. set history save -- Set saving of the history record on exit.*
  1427. set history expansion -- Set history expansion on command input.*
  1428. Type \"help set history\" followed by set history subcommand name for full documentation..*
  1429. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  1430.             { pass "set history" }
  1431.     -re ".*$prompt $"    { fail "set history" }
  1432.     timeout        { fail "(timeout) set history" }
  1433.     }
  1434.  
  1435.  
  1436. #test set language
  1437. send "set language\n"
  1438. expect {
  1439.     -re "The currently understood settings are:.*\
  1440. local or auto    Automatic setting based on source file.*\
  1441. c                Use the C language.*\
  1442. c\+\+              Use the C\+\+ language.*\
  1443. modula-2         Use the Modula-2 language.*$prompt $"\
  1444.             { pass "set language" }
  1445.     -re ".*$prompt $"    { fail "set language" }
  1446.     timeout        { fail "(timeout) set language" }
  1447.     }
  1448.  
  1449.  
  1450. #test set listsize
  1451. send "set listsize\n"
  1452. expect {
  1453.     -re "Argument required \(integer to set it to.\)..*$prompt $"\
  1454.             { pass "set listsize" }
  1455.     -re ".*$prompt $"    { fail "set listsize" }
  1456.     timeout        { fail "(timeout) set listsize" }
  1457.     }
  1458.  
  1459.  
  1460. #test set print "p" abbreviation
  1461. send "set p\n"
  1462. expect {
  1463.     -re "\"set print\" must be followed by the name of a print subcommand..*\
  1464. List of set print subcommands:.*\
  1465. set print address -- Set printing of addresses.*\
  1466. set print array -- Set prettyprinting of arrays.*\
  1467. set print union -- Set printing of unions interior to structures.*\
  1468. set print pretty -- Set prettyprinting of structures.*\
  1469. set print repeats -- Set threshold for repeated print elements.*\
  1470. set print elements -- Set limit on string chars or array elements to print.*\
  1471. set print asm-demangle -- Set demangling of C\+\+ names in disassembly listings.*\
  1472. set print sevenbit-strings -- Set printing of 8-bit characters in strings as .nnn.*\
  1473. set print demangle -- Set demangling of encoded C\+\+ names when displaying symbols.*\
  1474. set print object -- Set printing of object's derived type based on vtable info.*\
  1475. set print vtbl -- Set printing of C\+\+ virtual function tables.*\
  1476. Type \"help set print\" followed by set print subcommand name for full documentation..*\
  1477. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  1478.             { pass "set print \"p\" abbreviation" }
  1479.     -re ".*$prompt $"    { fail "set print \"p\" abbreviation" }
  1480.     timeout        { fail "(timeout) set print \"p\" abbreviation" }
  1481.     }
  1482.  
  1483.  
  1484. #test set print "pr" abbreviation
  1485. send "set pr\n"
  1486. expect {
  1487.     -re "\"set print\" must be followed by the name of a print subcommand..*\
  1488. List of set print subcommands:.*\
  1489. set print address -- Set printing of addresses.*\
  1490. set print array -- Set prettyprinting of arrays.*\
  1491. set print union -- Set printing of unions interior to structures.*\
  1492. set print pretty -- Set prettyprinting of structures.*\
  1493. set print repeats -- Set threshold for repeated print elements.*\
  1494. set print elements -- Set limit on string chars or array elements to print.*\
  1495. set print asm-demangle -- Set demangling of C\+\+ names in disassembly listings.*\
  1496. set print sevenbit-strings -- Set printing of 8-bit characters in strings as .nnn.*\
  1497. set print demangle -- Set demangling of encoded C\+\+ names when displaying symbols.*\
  1498. set print object -- Set printing of object's derived type based on vtable info.*\
  1499. set print vtbl -- Set printing of C\+\+ virtual function tables.*\
  1500. Type \"help set print\" followed by set print subcommand name for full documentation..*\
  1501. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  1502.             { pass "set print \"pr\" abbreviation" }
  1503.     -re ".*$prompt $"    { fail "set print \"pr\" abbreviation" }
  1504.     timeout        { fail "(timeout) set print \"pr\" abbreviation" }
  1505.     }
  1506.  
  1507.  
  1508. #test set print
  1509. send "set print\n"
  1510. expect {
  1511.     -re "\"set print\" must be followed by the name of a print subcommand..*\
  1512. List of set print subcommands:.*\
  1513. set print address -- Set printing of addresses.*\
  1514. set print array -- Set prettyprinting of arrays.*\
  1515. set print union -- Set printing of unions interior to structures.*\
  1516. set print pretty -- Set prettyprinting of structures.*\
  1517. set print repeats -- Set threshold for repeated print elements.*\
  1518. set print elements -- Set limit on string chars or array elements to print.*\
  1519. set print asm-demangle -- Set demangling of C\+\+ names in disassembly listings.*\
  1520. set print sevenbit-strings -- Set printing of 8-bit characters in strings as .nnn.*\
  1521. set print demangle -- Set demangling of encoded C\+\+ names when displaying symbols.*\
  1522. set print object -- Set printing of object's derived type based on vtable info.*\
  1523. set print vtbl -- Set printing of C\+\+ virtual function tables.*\
  1524. Type \"help set print\" followed by set print subcommand name for full documentation..*\
  1525. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  1526.             { pass "set print" }
  1527.     -re ".*$prompt $"    { fail "set print" }
  1528.     timeout        { fail "(timeout) set print" }
  1529.     }
  1530.  
  1531.  
  1532. #test set print address
  1533. send "set print address\n"
  1534. expect {
  1535.     -re "$prompt $"\
  1536.             { pass "set print address" }
  1537.     timeout        { fail "(timeout) set print address" }
  1538.     }
  1539.  
  1540.  
  1541. #test set print array
  1542. send "set print array\n"
  1543. expect {
  1544.     -re "$prompt $"\
  1545.             { pass "set print array" }
  1546.     timeout        { fail "(timeout) set print array" }
  1547.     }
  1548.  
  1549.  
  1550. #test set print asm-demangle
  1551. send "set print asm-demangle\n"
  1552. expect {
  1553.     -re "$prompt $"\
  1554.             { pass "set print asm-demangle" }
  1555.     timeout        { fail "(timeout) set print asm-demangle" }
  1556.     }
  1557.  
  1558.  
  1559. #test set print demangle
  1560. send "set print demangle\n"
  1561. expect {
  1562.     -re "$prompt $"\
  1563.             { pass "set print demangle" }
  1564.     timeout        { fail "(timeout) set print demangle" }
  1565.     }
  1566.  
  1567.  
  1568. #test set print elements
  1569. send "set print elements\n"
  1570. expect {
  1571.     -re "Argument required \(integer to set it to.\)..*$prompt $"\
  1572.             { pass "set print elements" }
  1573.     -re ".*$prompt $"    { fail "set print elements" }
  1574.     timeout        { fail "(timeout) set print elements" }
  1575.     }
  1576.  
  1577.  
  1578. #test set print object
  1579. send "set print object\n"
  1580. expect {
  1581.     -re "$prompt $"\
  1582.             { pass "set print object" }
  1583.     timeout        { fail "(timeout) set print object" }
  1584.     }
  1585.  
  1586.  
  1587. #test set print pretty
  1588. send "set print pretty\n"
  1589. expect {
  1590.     -re "$prompt $"\
  1591.             { pass "set print pretty" }
  1592.     timeout        { fail "(timeout) set print pretty" }
  1593.     }
  1594.  
  1595.  
  1596. #test set print sevenbit-strings
  1597. send "set print sevenbit-strings\n"
  1598. expect {
  1599.     -re "$prompt $"\
  1600.             { pass "set print sevenbit-strings" }
  1601.     timeout        { fail "(timeout) set print sevenbit-strings" }
  1602.     }
  1603.  
  1604.  
  1605. #test set print union
  1606. send "set print union\n"
  1607. expect {
  1608.     -re "$prompt $"\
  1609.             { pass "set print union" }
  1610.     timeout        { fail "(timeout) set print union" }
  1611.     }
  1612.  
  1613.  
  1614. #test set print vtbl
  1615. send "set print vtbl\n"
  1616. expect {
  1617.     -re "$prompt $"\
  1618.             { pass "set print vtbl" }
  1619.     timeout        { fail "(timeout) set print vtbl" }
  1620.     }
  1621.  
  1622.  
  1623. # FIXME -- need a test for "set prompt"
  1624. #test set radix
  1625. send "set radix\n"
  1626. expect {
  1627.     -re "Argument required \(integer to set it to.\)..*$prompt $"\
  1628.             { pass "set radix" }
  1629.     -re ".*$prompt $"    { fail "set radix" }
  1630.     timeout        { fail "(timeout) set radix" }
  1631.     }
  1632.  
  1633.  
  1634. #test set symbol-reloading
  1635. send "set symbol-reloading\n"
  1636. expect {
  1637.     -re "$prompt $"\
  1638.             { pass "set symbol-reloading" }
  1639.     timeout        { fail "(timeout) set symbol-reloading" }
  1640.     }
  1641.  
  1642.  
  1643. #test set variable
  1644. send "set variable\n"
  1645. expect {
  1646.     -re "Argument required \(expression to compute\)..*$prompt $"\
  1647.             { pass "set variable" }
  1648.     -re ".*$prompt $"    { fail "set variable" }
  1649.     timeout        { fail "(timeout) set variable" }
  1650.     }
  1651.  
  1652.  
  1653. #test set verbose
  1654. send "set verbose\n"
  1655. expect {
  1656.     -re "$prompt $"\
  1657.             { pass "set verbose" }
  1658.     timeout        { fail "(timeout) set verbose" }
  1659.     }
  1660.  
  1661.  
  1662. #test set width
  1663. send "set width\n"
  1664. expect {
  1665.     -re "Argument required \(integer to set it to.\)..*$prompt $"\
  1666.             { pass "set width" }
  1667.     -re ".*$prompt $"    { fail "set width" }
  1668.     timeout        { fail "(timeout) set width" }
  1669.     }
  1670.  
  1671.  
  1672. #test set write
  1673. # This is only supported on targets which use exec.o.
  1674. if ![istarget "rs6000-*-*"] then {
  1675.     send "set write\n"
  1676.     expect {
  1677.     -re "set write\r?\n?$prompt $"\
  1678.             { pass "set write" }
  1679.     -re "$prompt $" { fail "set write" }
  1680.     timeout        { fail "(timeout) set write" }
  1681.     }
  1682.     gdb_test "set write off" ""
  1683. }
  1684.  
  1685. #test set
  1686. send "set\n"
  1687. expect {
  1688.     -re "Argument required \(expression to compute\)..*$prompt $"\
  1689.             { pass "set" }
  1690.     -re ".*$prompt $"    { fail "set" }
  1691.     timeout        { fail "(timeout) set" }
  1692.     }
  1693.  
  1694.  
  1695. #test shell echo Hi dad!
  1696. send "shell echo Hi dad!\n"
  1697. expect {
  1698.     -re "Hi dad!.*$prompt $"\
  1699.             { pass "shell echo Hi dad!" }
  1700.     -re ".*$prompt $"    { fail "shell echo Hi dad!" }
  1701.     timeout        { fail "(timeout) shell echo Hi dad!" }
  1702.     }
  1703.  
  1704.  
  1705. #test show args
  1706. send "show args\n"
  1707. expect {
  1708.     -re "Arguments to give program being debugged when it is started is \"\"..*$prompt $"\
  1709.             { pass "show args" }
  1710.     -re ".*$prompt $"    { fail "show args" }
  1711.     timeout        { fail "(timeout) show args" }
  1712.     }
  1713.  
  1714.  
  1715. #test show check "c" abbreviation
  1716. send "show c\n"
  1717. expect {
  1718.     -re "range:  Range checking is \"auto; currently off\"..*
  1719. type:  Type checking is \"auto; currently off\"..*$prompt $"\
  1720.             { pass "show check \"c\" abbreviation" }
  1721.     -re ".*$prompt $"    { fail "show check \"c\" abbreviation" }
  1722.     timeout        { fail "(timeout) show check \"c\" abbreviation" }
  1723.     }
  1724.  
  1725.  
  1726. #test show check "ch" abbreviation
  1727. send "show ch\n"
  1728. expect {
  1729.     -re "range:  Range checking is \"auto; currently off\"..*
  1730. type:  Type checking is \"auto; currently off\"..*$prompt $"\
  1731.             { pass "show check \"ch\" abbreviation" }
  1732.     -re ".*$prompt $"    { fail "show check \"ch\" abbreviation" }
  1733.     timeout        { fail "(timeout) show check \"ch\" abbreviation" }
  1734.     }
  1735.  
  1736.  
  1737. #test show check
  1738. send "show check\n"
  1739. expect {
  1740.     -re "range:  Range checking is \"auto; currently off\"..*
  1741. type:  Type checking is \"auto; currently off\"..*$prompt $"\
  1742.             { pass "show check" }
  1743.     -re ".*$prompt $"    { fail "show check" }
  1744.     timeout        { fail "(timeout) show check" }
  1745.     }
  1746.  
  1747.  
  1748. #test show check range
  1749. send "show check range\n"
  1750. expect {
  1751.     -re "Range checking is \"auto; currently off\"..*$prompt $"\
  1752.             { pass "show check range" }
  1753.     -re ".*$prompt $"    { fail "show check range" }
  1754.     timeout        { fail "(timeout) show check range" }
  1755.     }
  1756.  
  1757.  
  1758. #test show check type
  1759. send "show check type\n"
  1760. expect {
  1761.     -re "Type checking is \"auto; currently off\"..*$prompt $"\
  1762.             { pass "show check type" }
  1763.     -re ".*$prompt $"    { fail "show check type" }
  1764.     timeout        { fail "(timeout) show check type" }
  1765.     }
  1766.  
  1767.  
  1768. #test show commands
  1769. send "show commands\n"
  1770. expect {
  1771.     -re "$prompt $"\
  1772.             { pass "show commands" }
  1773.     timeout        { fail "(timeout) show commands" }
  1774.     }
  1775.  
  1776.  
  1777. #test show complaints
  1778. send "show complaints\n"
  1779. expect {
  1780.     -re "Max number of complaints about incorrect symbols is 0..*$prompt $"\
  1781.             { pass "show complaints" }
  1782.     -re ".*$prompt $"    { fail "show complaints" }
  1783.     timeout        { fail "(timeout) show complaints" }
  1784.     }
  1785.  
  1786.  
  1787. #test show confirm
  1788. send "show confirm\n"
  1789. expect {
  1790.     -re "Whether to confirm potentially dangerous operations is on..*$prompt $"\
  1791.             { pass "show confirm" }
  1792.     -re ".*$prompt $"    { fail "show confirm" }
  1793.     timeout        { fail "(timeout) show confirm" }
  1794.     }
  1795.  
  1796.  
  1797. #test show convenience
  1798. send "show convenience\n"
  1799. expect {
  1800.     -re "No debugger convenience variables now defined..*
  1801. Convenience variables have names starting with \".\";.*
  1802. use \"set\" as in \"set .foo = 5\" to define them..*$prompt $"\
  1803.             { pass "show convenience" }
  1804.     -re ".*$prompt $"    { fail "show convenience" }
  1805.     timeout        { fail "(timeout) show convenience" }
  1806.     }
  1807.  
  1808.  
  1809. #test show directories
  1810. send "show directories\n"
  1811. expect {
  1812.     -re "Source directories searched: .cdir:.cwd.*$prompt $"\
  1813.             { pass "show directories" }
  1814.     -re ".*$prompt $"    { fail "show directories" }
  1815.     timeout        { fail "(timeout) show directories" }
  1816.     }
  1817.  
  1818.  
  1819. #test show editing
  1820. send "show editing\n"
  1821. expect {
  1822.     -re "Editing of command lines as they are typed is on..*$prompt $"\
  1823.             { pass "show editing" }
  1824.     -re ".*$prompt $"    { fail "show editing" }
  1825.     timeout        { fail "(timeout) show editing" }
  1826.     }
  1827.  
  1828.  
  1829. #test show height
  1830. send "show height\n"
  1831. expect {
  1832.     -re "Number of lines gdb thinks are in a page is.*$prompt $"\
  1833.             { pass "show height" }
  1834.     -re ".*$prompt $"    { fail "show height" }
  1835.     timeout        { fail "(timeout) show height" }
  1836.     }
  1837.  
  1838.  
  1839. #test show history expansion
  1840. send "show history expansion\n"
  1841. expect {
  1842.     -re "History expansion on command input is on..*$prompt $"\
  1843.             { pass "show history expansion" }
  1844.     -re ".*$prompt $"    { fail "show history expansion" }
  1845.     timeout        { fail "(timeout) show history expansion" }
  1846.     }
  1847.  
  1848.  
  1849. #test show history filename
  1850. send "show history filename\n"
  1851. expect {
  1852.     -re "The filename in which to record the command history is.*\
  1853. .*.gdb_history\"..*$prompt $"\
  1854.             { pass "show history filename" }
  1855.     -re ".*$prompt $"    { fail "show history filename" }
  1856.     timeout        { fail "(timeout) show history filename" }
  1857.     }
  1858.  
  1859.  
  1860. #test show history save
  1861. send "show history save\n"
  1862. expect {
  1863.     -re "Saving of the history record on exit is on..*$prompt $"\
  1864.             { pass "show history save" }
  1865.     -re ".*$prompt $"    { fail "show history save" }
  1866.     timeout        { fail "(timeout) show history save" }
  1867.     }
  1868.  
  1869.  
  1870. #test show history size
  1871. send "show history size\n"
  1872. expect {
  1873.     -re "The size of the command history is.*$prompt $"\
  1874.             { pass "show history size" }
  1875.     -re ".*$prompt $"    { fail "show history size" }
  1876.     timeout        { fail "(timeout) show history size" }
  1877.     }
  1878.  
  1879.  
  1880. #test show history
  1881. send "show history\n"
  1882. expect {
  1883.     -re "filename:  The filename in which to record the command history is \".*.gdb_history\"..*\
  1884. size:  The size of the command history is.*\
  1885. save:  Saving of the history record on exit is o.*\
  1886. expansion:  History expansion on command input is o.*$prompt $"\
  1887.             { pass "show history" }
  1888.     -re ".*$prompt $"    { fail "show history" }
  1889.     timeout        { fail "(timeout) show history" }
  1890.     }
  1891.  
  1892.  
  1893. #test show language
  1894. send "show language\n"
  1895. expect {
  1896.     -re "The current source language is \"auto; currently c\"..*$prompt $"\
  1897.             { pass "show language" }
  1898.     -re ".*$prompt $"    { fail "show language" }
  1899.     timeout        { fail "(timeout) show language" }
  1900.     }
  1901.  
  1902.  
  1903. #test show listsize
  1904. send "show listsize\n"
  1905. expect {
  1906.     -re "Number of source lines gdb will list by default is 10..*$prompt $"\
  1907.             { pass "show listsize" }
  1908.     -re ".*$prompt $"    { fail "show listsize" }
  1909.     timeout        { fail "(timeout) show listsize" }
  1910.     }
  1911.  
  1912.  
  1913. #test show print "p" abbreviation
  1914. send "show p\n"
  1915. expect {
  1916.     -re ".*\
  1917. address:  Printing of addresses is o.*\
  1918. array:  Prettyprinting of arrays is o.*\
  1919. union:  Printing of unions interior to structures is o.*\
  1920. pretty:  Prettyprinting of structures is o.*\
  1921. repeats:  Threshold for repeated print elements is \[0-9\]*.*\
  1922. elements:  Limit on string chars or array elements to print is \[0-9\]*.*\
  1923. asm-demangle:  Demangling of C\+\+ names in disassembly listings is o.*\
  1924. sevenbit-strings:  Printing of 8-bit characters in strings as .nnn is o.*\
  1925. demangle:  Demangling of encoded C\+\+ names when displaying symbols is o.*\
  1926. object:  Printing of object's derived type based on vtable info is o.*\
  1927. vtbl:  Printing of C\+\+ virtual function tables is o.*\
  1928. $prompt $"\
  1929.             { pass "show print \"p\" abbreviation" }
  1930.     -re ".*$prompt $"    { fail "show print \"p\" abbreviation" }
  1931.     timeout        { fail "(timeout) show print \"p\" abbreviation" }
  1932.     }
  1933.  
  1934.  
  1935. #test show print "pr" abbreviation
  1936. send "show pr\n"
  1937. expect {
  1938.     -re ".*\
  1939. address:  Printing of addresses is o.*\
  1940. array:  Prettyprinting of arrays is o.*\
  1941. union:  Printing of unions interior to structures is o.*\
  1942. pretty:  Prettyprinting of structures is o.*\
  1943. elements:  Limit on string chars or array elements to print is \[0-9\]*.*\
  1944. asm-demangle:  Demangling of C\+\+ names in disassembly listings is o.*\
  1945. sevenbit-strings:  Printing of 8-bit characters in strings as .nnn is o.*\
  1946. demangle:  Demangling of encoded C\+\+ names when displaying symbols is o.*\
  1947. object:  Printing of object's derived type based on vtable info is o.*\
  1948. vtbl:  Printing of C\+\+ virtual function tables is o.*\
  1949. $prompt $"\
  1950.             { pass "show print \"pr\" abbreviation" }
  1951.     -re ".*$prompt $"    { fail "show print \"pr\" abbreviation" }
  1952.     timeout        { fail "(timeout) show print \"pr\" abbreviation" }
  1953.     }
  1954.  
  1955.  
  1956.  
  1957. #test show print
  1958. send "show print\n"
  1959. expect {
  1960.     -re ".*\
  1961. address:  Printing of addresses is o.*\
  1962. array:  Prettyprinting of arrays is o.*\
  1963. union:  Printing of unions interior to structures is o.*\
  1964. pretty:  Prettyprinting of structures is o.*\
  1965. repeats:  Threshold for repeated print elements is \[0-9\]*.*\
  1966. elements:  Limit on string chars or array elements to print is \[0-9\]*.*\
  1967. asm-demangle:  Demangling of C\+\+ names in disassembly listings is o.*\
  1968. sevenbit-strings:  Printing of 8-bit characters in strings as .nnn is o.*\
  1969. demangle:  Demangling of encoded C\+\+ names when displaying symbols is o.*\
  1970. object:  Printing of object's derived type based on vtable info is o.*\
  1971. vtbl:  Printing of C\+\+ virtual function tables is o.*\
  1972. $prompt $"\
  1973.             { pass "show print" }
  1974.     -re ".*$prompt $"    { fail "show print" }
  1975.     timeout        { fail "(timeout) show print" }
  1976.     }
  1977.  
  1978.  
  1979. #test show paths
  1980. send "show paths\n"
  1981. expect {
  1982.     -re "Executable and object file path:.*$prompt $"\
  1983.             { pass "show paths" }
  1984.     -re ".*$prompt $"    { fail "show paths" }
  1985.     timeout        { fail "(timeout) show paths" }
  1986.     }
  1987.  
  1988.  
  1989. #test show print address
  1990. send "show print address\n"
  1991. expect {
  1992.     -re "Printing of addresses is on..*$prompt $"\
  1993.             { pass "show print address" }
  1994.     -re ".*$prompt $"    { fail "show print address" }
  1995.     timeout        { fail "(timeout) show print address" }
  1996.     }
  1997.  
  1998.  
  1999. #test show print array
  2000. send "show print array\n"
  2001. expect {
  2002.     -re "Prettyprinting of arrays is on..*$prompt $"\
  2003.             { pass "show print array" }
  2004.     -re ".*$prompt $"    { fail "show print array" }
  2005.     timeout        { fail "(timeout) show print array" }
  2006.     }
  2007.  
  2008.  
  2009. #test show print asm-demangle
  2010. send "show print asm-demangle\n"
  2011. expect {
  2012.     -re "Demangling of C\+\+ names in disassembly listings is on..*$prompt $"\
  2013.             { pass "show print asm-demangle" }
  2014.     -re ".*$prompt $"    { fail "show print asm-demangle" }
  2015.     timeout        { fail "(timeout) show print asm-demangle" }
  2016.     }
  2017.  
  2018.  
  2019. #test show print demangle
  2020. send "show print demangle\n"
  2021. expect {
  2022.     -re "Demangling of encoded C\+\+ names when displaying symbols is on..*$prompt $"\
  2023.             { pass "show print demangle" }
  2024.     -re ".*$prompt $"    { fail "show print demangle" }
  2025.     timeout        { fail "(timeout) show print demangle" }
  2026.     }
  2027.  
  2028.  
  2029. #test show print elements
  2030. send "show print elements\n"
  2031. expect {
  2032.     -re "Limit on string chars or array elements to print is 200..*$prompt $"\
  2033.             { pass "show print elements" }
  2034.     -re ".*$prompt $"    { fail "show print elements" }
  2035.     timeout        { fail "(timeout) show print elements" }
  2036.     }
  2037.  
  2038.  
  2039. #test show print object
  2040. send "show print object\n"
  2041. expect {
  2042.     -re "Printing of object's derived type based on vtable info is on..*$prompt $"\
  2043.             { pass "show print object" }
  2044.     -re ".*$prompt $"    { fail "show print object" }
  2045.     timeout        { fail "(timeout) show print object" }
  2046.     }
  2047.  
  2048.  
  2049. #test show print pretty
  2050. send "show print pretty\n"
  2051. expect {
  2052.     -re "Prettyprinting of structures is on..*$prompt $"\
  2053.             { pass "show print pretty" }
  2054.     -re ".*$prompt $"    { fail "show print pretty" }
  2055.     timeout        { fail "(timeout) show print pretty" }
  2056.     }
  2057.  
  2058.  
  2059. #test show print sevenbit-strings
  2060. send "show print sevenbit-strings\n"
  2061. expect {
  2062.     -re "Printing of 8-bit characters in strings as .nnn is on..*$prompt $"\
  2063.             { pass "show print sevenbit-strings" }
  2064.     -re ".*$prompt $"    { fail "show print sevenbit-strings" }
  2065.     timeout        { fail "(timeout) show print sevenbit-strings" }
  2066.     }
  2067.  
  2068.  
  2069. #test show print union
  2070. send "show print union\n"
  2071. expect {
  2072.     -re "Printing of unions interior to structures is on..*$prompt $"\
  2073.             { pass "show print union" }
  2074.     -re ".*$prompt $"    { fail "show print union" }
  2075.     timeout        { fail "(timeout) show print union" }
  2076.     }
  2077.  
  2078.  
  2079. #test show print vtbl
  2080. send "show print vtbl\n"
  2081. expect {
  2082.     -re "Printing of C\+\+ virtual function tables is on..*$prompt $"\
  2083.             { pass "show print vtbl" }
  2084.     -re ".*$prompt $"    { fail "show print vtbl" }
  2085.     timeout        { fail "(timeout) show print vtbl" }
  2086.     }
  2087.  
  2088.  
  2089. #test show prompt
  2090. send "show prompt\n"
  2091. expect {
  2092.     -re "Gdb's prompt is \"$prompt \".*$prompt $"\
  2093.             { pass "show prompt" }
  2094.     -re ".*$prompt $"    { fail "show prompt" }
  2095.     timeout        { fail "(timeout) show prompt" }
  2096.     }
  2097.  
  2098.  
  2099. #test show radix
  2100. send "show radix\n"
  2101. expect {
  2102.     -re "Default input and output number radix is 10..*$prompt $"\
  2103.             { pass "show radix" }
  2104.     -re ".*$prompt $"    { fail "show radix" }
  2105.     timeout        { fail "(timeout) show radix" }
  2106.     }
  2107.  
  2108.  
  2109. #test show symbol-reloading
  2110. send "show symbol-reloading\n"
  2111. expect {
  2112.     -re "Dynamic symbol table reloading multiple times in one run is on..*$prompt $"\
  2113.             { pass "show symbol-reloading" }
  2114.     -re ".*$prompt $"    { fail "show symbol-reloading" }
  2115.     timeout        { fail "(timeout) show symbol-reloading" }
  2116.     }
  2117.  
  2118.  
  2119. #test show user
  2120. send "show user\n"
  2121. expect {
  2122.     -re "$prompt $"\
  2123.             { pass "show user" }
  2124.     timeout        { fail "(timeout) show user" }
  2125.     }
  2126.  
  2127.  
  2128. #test show values
  2129. send "show values\n"
  2130. expect {
  2131.     -re "$prompt $"\
  2132.             { pass "show values" }
  2133.     timeout        { fail "(timeout) show values" }
  2134.     }
  2135.  
  2136.  
  2137. #test show verbose
  2138. send "show verbose\n"
  2139. expect {
  2140.     -re "Verbose printing of informational messages is on..*$prompt $"\
  2141.             { pass "show verbose" }
  2142.     -re ".*$prompt $"    { fail "show verbose" }
  2143.     timeout        { fail "(timeout) show verbose" }
  2144.     }
  2145.  
  2146.  
  2147. #test show version
  2148. send "show version\n"
  2149. expect {
  2150.     -re "GDB is free software and you are welcome to distribute copies of it.*
  2151.  under certain conditions; type \"show copying\" to see the conditions..*
  2152. There is absolutely no warranty for GDB; type \"show warranty\" for details..*
  2153. GDB.*Copyright \[0-9\]* Free Software Foundation, Inc..*$prompt $"\
  2154.             { pass "show version" }
  2155.     -re ".*$prompt $"    { fail "show version" }
  2156.     timeout        { fail "(timeout) show version" }
  2157.     }
  2158.  
  2159.  
  2160. #test show width
  2161. send "show width\n"
  2162. expect {
  2163.     -re "Number of characters gdb thinks are in a line is.*$prompt $"\
  2164.             { pass "show width" }
  2165.     -re ".*$prompt $"    { fail "show width" }
  2166.     timeout        { fail "(timeout) show width" }
  2167.     }
  2168.  
  2169.  
  2170. #test show write
  2171. # This is only supported on targets which use exec.o.
  2172. if ![istarget "rs6000-*-*"] then {
  2173.     send "show write\n"
  2174.     expect {
  2175.     -re "Writing into executable and core files is off..*$prompt $"\
  2176.             { pass "show write" }
  2177.     -re ".*$prompt $"    { fail "show write" }
  2178.     timeout        { fail "(timeout) show write" }
  2179.     }
  2180. }
  2181.  
  2182. #test show
  2183. send "show\n"
  2184. expect {
  2185.     -re "confirm:  Whether to confirm potentially dangerous operations is on..*
  2186. history filename:  The filename in which to record the command history is .*
  2187. history size:  The size of the command history is.*
  2188. history save:  Saving of the history record on exit is on..*
  2189. print elements:  Limit on string chars or array elements to print is 200..*
  2190. listsize:  Number of source lines gdb will list by default is 10.*$prompt $"\
  2191.             { pass "show" }
  2192.     -re "\n$prompt $"    { fail "show" }
  2193.     timeout        { fail "(timeout) show" }
  2194.     }
  2195.  
  2196.  
  2197. #test stepi "si" abbreviation
  2198. setup_xfail "a29k-*-udi"
  2199. send "si\n"
  2200. expect {
  2201.     -re "The program is not being run..*$prompt $"\
  2202.             { pass "stepi \"si\" abbreviation" }
  2203.     -re ".*$prompt $"    { fail "stepi \"si\" abbreviation" }
  2204.     timeout        { fail "(timeout) stepi \"si\" abbreviation" }
  2205.     }
  2206.  
  2207.  
  2208. #test stepi
  2209. setup_xfail "a29k-*-udi"
  2210. send "stepi\n"
  2211. expect {
  2212.     -re "The program is not being run..*$prompt $"\
  2213.             { pass "stepi" }
  2214.     -re ".*$prompt $"    { fail "stepi" }
  2215.     timeout        { fail "(timeout) stepi" }
  2216.     }
  2217.  
  2218.  
  2219. #test signal
  2220. setup_xfail "a29k-*-udi"
  2221. send "signal\n"
  2222. expect {
  2223.     -re "The program is not being run..*$prompt $"\
  2224.             { pass "signal" }
  2225.     -re ".*$prompt $"    { fail "signal" }
  2226.     timeout        { fail "(timeout) signal" }
  2227.     }
  2228.  
  2229.  
  2230. #test source
  2231. send "source\n"
  2232. expect {
  2233.     -re "source command requires pathname of file to source..*$prompt"
  2234.             { pass "source" }
  2235.     -re "No such file or directory.*$prompt $" { pass "source" }
  2236.     -re ".*$prompt $"    { fail "source" }
  2237.     timeout        { fail "(timeout) source" }
  2238.     }
  2239.  
  2240. #test step "s" abbreviation
  2241. setup_xfail "a29k-*-udi"
  2242. send "s\n"
  2243. expect {
  2244.     -re "The program is not being run..*$prompt $"\
  2245.             { pass "step \"s\" abbreviation" }
  2246.     -re ".*$prompt $"    { fail "step \"s\" abbreviation" }
  2247.     timeout        { fail "(timeout) step \"s\" abbreviation" }
  2248.     }
  2249.  
  2250.  
  2251. #test step
  2252. setup_xfail "a29k-*-udi"
  2253. send "step\n"
  2254. expect {
  2255.     -re "The program is not being run..*$prompt $"\
  2256.             { pass "step" }
  2257.     -re ".*$prompt $"    { fail "step" }
  2258.     timeout        { fail "(timeout) step" }
  2259.     }
  2260.  
  2261.  
  2262. #test symbol-file
  2263. send "symbol-file\n"
  2264. expect {
  2265.     -re "$prompt $"\
  2266.             { pass "symbol-file" }
  2267.     timeout        { fail "(timeout) symbol-file" }
  2268.     }
  2269.  
  2270.  
  2271. #test target child
  2272. send "target child\n"
  2273. expect {
  2274.     -re "Use the \"run\" command to start a Unix child process..*$prompt $"\
  2275.         { pass "target child (non-procfs version)" }
  2276.     -re "Undefined target command: \"child\".  Try \"help target\"..*$prompt $"\
  2277.         { pass "target child (procfs version)" }
  2278.     
  2279.     -re ".*$prompt $"    { fail "target child" }
  2280.     timeout        { fail "(timeout) target child" }
  2281.     }
  2282.  
  2283.  
  2284. #test target procfs
  2285. send "target procfs\n"
  2286. expect {
  2287.     -re "Use the \"run\" command to start a Unix child process..*$prompt $"\
  2288.         { pass "target procfs (procfs version)" }
  2289.     -re "Undefined target command: \"procfs\".  Try \"help target\"..*$prompt $"\
  2290.         { pass "target procfs (non-procfs version)" }
  2291.     
  2292.     -re ".*$prompt $"    { fail "target procfs" }
  2293.     timeout        { fail "(timeout) target procfs" }
  2294.     }
  2295.  
  2296.  
  2297. #test target core
  2298. send "target core\n"
  2299. expect {
  2300.     -re "No core file specified..*$prompt $"\
  2301.             { pass "target core" }
  2302.     -re ".*A program is being debugged already.  Kill it\? \(y or n\).*$" {
  2303.         send "n\n"
  2304.         if $verbose>1 then {
  2305.         send_user "\t\tDidn't kill program being debugged\n"
  2306.         }
  2307.         expect -re "$prompt $" { }
  2308.         pass "target core"
  2309.     }
  2310.     -re "Undefined target command: \"core\".  Try \"help target\"..*$prompt $"\
  2311.             { pass "target core" }
  2312.     -re ".*$prompt $"    { fail "target core" }
  2313.     timeout        { fail "(timeout) target core" }
  2314.     }
  2315.  
  2316.  
  2317. #test target exec
  2318. send "target exec\n"
  2319. expect {
  2320.     -re "No exec file now..*$prompt $"\
  2321.             { pass "target exec" }
  2322.     -re ".*A program is being debugged already.  Kill it\? \(y or n\).*$" {
  2323.         send "n\n"
  2324.         if $verbose>1 then {
  2325.         send_user "\t\tDidn't kill program being debugged\n"
  2326.         }
  2327.         expect -re "$prompt $" { }
  2328.         pass "target exec"
  2329.     }
  2330.     -re ".*$prompt $"    { fail "target exec" }
  2331.     timeout        { fail "(timeout) target exec" }
  2332.     }
  2333.  
  2334.  
  2335. #test target remote
  2336. send "target remote\n"
  2337. expect {
  2338.     -re "To open a remote debug connection, you need to specify what serial.*
  2339. device is attached to the remote system \(e.g. /dev/ttya\)..*$prompt $"\
  2340.             { pass "target remote" }
  2341.     -re ".*A program is being debugged already.  Kill it\? \(y or n\).*$" {
  2342.         send "n\n"
  2343.         if $verbose>1 then {
  2344.         send_user "\t\tDidn't kill program being debugged\n"
  2345.         }
  2346.         expect -re "$prompt $" { }
  2347.         pass "target remote"
  2348.     }
  2349.     -re ".*$prompt $"    { fail "target remote" }
  2350.     timeout        { fail "(timeout) target remote" }
  2351.     }
  2352.  
  2353.  
  2354. #test target
  2355. send "target\n"
  2356. expect {
  2357.     -re "Argument required \(target name\)..*$prompt $"\
  2358.             { pass "target" }
  2359.     -re ".*$prompt $"    { fail "target" }
  2360.     timeout        { fail "(timeout) target" }
  2361.     }
  2362.  
  2363.  
  2364. #test tbreak
  2365. send "tbreak\n"
  2366. expect {
  2367.     -re "No default breakpoint address now..*$prompt $"\
  2368.             { pass "tbreak" }
  2369.     -re ".*$prompt $"    { fail "tbreak" }
  2370.     timeout        { fail "(timeout) tbreak" }
  2371.     }
  2372.  
  2373.  
  2374. #test tty
  2375. send "tty\n"
  2376. expect {
  2377.     -re "Argument required \(terminal name for running target process\)..*$prompt $"\
  2378.             { pass "tty" }
  2379.     -re ".*$prompt $"    { fail "tty" }
  2380.     timeout        { fail "(timeout) tty" }
  2381.     }
  2382.  
  2383.  
  2384. #test until "u" abbreviation
  2385. setup_xfail "a29k-*-udi"
  2386. send "u\n"
  2387. expect {
  2388.     -re "The program is not running..*$prompt $"\
  2389.             { pass "until \"u\" abbreviation" }
  2390.     -re ".*$prompt $"    { fail "until \"u\" abbreviation" }
  2391.     timeout        { fail "(timeout) until \"u\" abbreviation" }
  2392.     }
  2393.  
  2394.  
  2395. #test until
  2396. setup_xfail "a29k-*-udi"
  2397. send "until\n"
  2398. expect {
  2399.     -re "The program is not running..*$prompt $"\
  2400.             { pass "until" }
  2401.     -re ".*$prompt $"    { fail "until" }
  2402.     timeout        { fail "(timeout) until" }
  2403.     }
  2404.  
  2405.  
  2406. #test undisplay
  2407. # FIXME -- need to dump full output to detailed log
  2408. send "undisplay\n"
  2409. expect {
  2410.     -re "Delete all auto-display expressions\? \(y or n\) $"\
  2411.         { send "y\n"
  2412.         expect {
  2413.             -re "\gdb\) $"\
  2414.             { pass "undisplay prompt" }
  2415.             timeout        { fail "(timeout) (timeout) undisplay prompt" }
  2416.             }
  2417.         }
  2418.     timeout        { fail "(timeout) (timeout) undisplay prompt" }
  2419.     }
  2420.  
  2421.  
  2422. #test unset environment
  2423. send "unset environment\n"
  2424. expect {
  2425.     -re "Delete all environment variables\? \(y or n\) $"\
  2426.         { send "y\n"
  2427.         expect {
  2428.             -re "\gdb\) $"\
  2429.             { pass "unset environmentprompt" }
  2430.             timeout        { fail "(timeout) (timeout) unset environment prompt" }
  2431.             }
  2432.         }
  2433.     timeout        { fail "(timeout) (timeout) unset environment prompt" }
  2434.     }
  2435.  
  2436.  
  2437.  
  2438. #test unset
  2439. send "unset\n"
  2440. expect {
  2441.     -re "\"unset\" must be followed by the name of an unset subcommand..*
  2442. List of unset subcommands:.*
  2443. unset environment -- Cancel environment variable VAR for the program.*
  2444. Type \"help unset\" followed by unset subcommand name for full documentation..*
  2445. Command name abbreviations are allowed if unambiguous..*$prompt $"\
  2446.             { pass "unset" }
  2447.     -re ".*$prompt $"    { fail "unset" }
  2448.     timeout        { fail "(timeout) unset" }
  2449.     }
  2450.  
  2451.  
  2452. #test up
  2453. send "up\n"
  2454. expect {
  2455.     -re "No stack..*$prompt $"\
  2456.             { pass "up" }
  2457.     -re ".*$prompt $"    { fail "up" }
  2458.     timeout        { fail "(timeout) up" }
  2459.     }
  2460.  
  2461.  
  2462. #test up-silently
  2463. send "up-silently\n"
  2464. expect {
  2465.     -re "No stack..*$prompt $"\
  2466.             { pass "up-silently" }
  2467.     -re ".*$prompt $"    { fail "up-silently" }
  2468.     timeout        { fail "(timeout) up-silently" }
  2469.     }
  2470.  
  2471.  
  2472. #test watch
  2473. send "watch\n"
  2474. expect {
  2475.     -re "Argument required \(expression to compute\)..*$prompt $"\
  2476.             { pass "watch" }
  2477.     -re ".*$prompt $"    { fail "watch" }
  2478.     timeout        { fail "(timeout) watch" }
  2479.     }
  2480.  
  2481.  
  2482. #test whatis
  2483. send "whatis\n"
  2484. expect {
  2485.     -re "The history is empty..*$prompt $"\
  2486.             { pass "whatis" }
  2487.     -re ".*$prompt $"    { fail "whatis" }
  2488.     timeout        { fail "(timeout) whatis" }
  2489.     }
  2490.  
  2491.  
  2492. #test where
  2493. setup_xfail "a29k-*-udi"
  2494. send "where\n"
  2495. expect {
  2496.     -re "No stack..*$prompt $"\
  2497.             { pass "where" }
  2498.     -re ".*$prompt $"    { fail "where" }
  2499.     timeout        { fail "(timeout) where" }
  2500.     }
  2501.  
  2502.  
  2503. #test x
  2504. #The case in which it prints a number is for vxgdb.
  2505. send "x\n"
  2506. expect {
  2507.     -re "0x0:.*Cannot access memory at address 0x0..*$prompt $"\
  2508.             { pass "x" }
  2509.     -re "0x0:.*0x\[0-9\]*.*$prompt $"\
  2510.             { pass "x" }
  2511.     -re ".*$prompt $"    { fail "x" }
  2512.     timeout        { fail "(timeout) x" }
  2513.     }
  2514.  
  2515.