GNU Binutils with patches for OS216
Revision | f91db59bc309719799096b0a12c0a07e51f68e05 (tree) |
---|---|
Zeit | 2006-06-13 22:09:18 |
Autor | Nathan Sidwell <nathan@code...> |
Commiter | Nathan Sidwell |
gdb/testsuite/
* lib/gdb.exp (gdb_load_cmd): New.
@@ -1,3 +1,8 @@ | ||
1 | +2006-06-13 Nathan Sidwell <nathan@codesourcery.com> | |
2 | + | |
3 | + gdb/testsuite/ | |
4 | + * lib/gdb.exp (gdb_load_cmd): New. | |
5 | + | |
1 | 6 | 2006-06-12 Nathan Sidwell <nathan@codesourcery.com> |
2 | 7 | |
3 | 8 | gdb/ |
@@ -1867,6 +1867,50 @@ proc gdb_exit { } { | ||
1867 | 1867 | } |
1868 | 1868 | |
1869 | 1869 | # |
1870 | +# gdb_load_cmd -- load a file into the debugger. | |
1871 | +# ARGS - additional args to load command. | |
1872 | +# return a -1 if anything goes wrong. | |
1873 | +# | |
1874 | +proc gdb_load_cmd { args } { | |
1875 | + global gdb_prompt | |
1876 | + | |
1877 | + if [target_info exists gdb_load_timeout] { | |
1878 | + set loadtimeout [target_info gdb_load_timeout] | |
1879 | + } else { | |
1880 | + set loadtimeout 1600 | |
1881 | + } | |
1882 | + send_gdb "load $args\n" | |
1883 | + verbose "Timeout is now $timeout seconds" 2 | |
1884 | + gdb_expect $loadtimeout { | |
1885 | + -re "Loading section\[^\r\]*\r\n" { | |
1886 | + exp_continue | |
1887 | + } | |
1888 | + -re "Start address\[\r\]*\r\n" { | |
1889 | + exp_continue | |
1890 | + } | |
1891 | + -re "Transfer rate\[\r\]*\r\n" { | |
1892 | + exp_continue | |
1893 | + } | |
1894 | + -re "Memory access error\[^\r\]*\r\n" { | |
1895 | + perror "Failed to load program" | |
1896 | + return -1 | |
1897 | + } | |
1898 | + -re "$gdb_prompt $" { | |
1899 | + return 0 | |
1900 | + } | |
1901 | + -re "(.*)\r\n$gdb_prompt " { | |
1902 | + perror "Unexpected reponse from 'load' -- $expect_out(1,string)" | |
1903 | + return -1 | |
1904 | + } | |
1905 | + timeout { | |
1906 | + perror "Timed out trying to load $arg." | |
1907 | + return -1 | |
1908 | + } | |
1909 | + } | |
1910 | + return -1 | |
1911 | +} | |
1912 | + | |
1913 | +# | |
1870 | 1914 | # gdb_load -- load a file into the debugger. |
1871 | 1915 | # Many files in config/*.exp override this procedure. |
1872 | 1916 | # |