OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [gdb-5.0/] [gdb/] [testsuite/] [gdb.base/] [default.exp] - Diff between revs 107 and 1765

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.