diff options
Diffstat (limited to 'config/gdb-comm.exp')
-rw-r--r-- | config/gdb-comm.exp | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/config/gdb-comm.exp b/config/gdb-comm.exp index b60ccca..5182847 100644 --- a/config/gdb-comm.exp +++ b/config/gdb-comm.exp @@ -73,51 +73,51 @@ proc gdb_comm_file_cmd { arg } { } remote_send host "file $arg\n" remote_expect host 60 { - -re "Reading symbols from.*done.*$gdb_prompt $" { - verbose "\t\tLoaded $arg into the $GDB" - return 0 - } - -re "has no symbol-table.*$gdb_prompt $" { - perror "$arg wasn't compiled with \"-g\"" - return -1 - } - -re "A program is being debugged already.*Kill it.*y or n. $" { - remote_send host "y\n" + -re "Reading symbols from.*done.*$gdb_prompt $" { + verbose "\t\tLoaded $arg into the $GDB" + return 0 + } + -re "has no symbol-table.*$gdb_prompt $" { + perror "$arg wasn't compiled with \"-g\"" + return -1 + } + -re "A program is being debugged already.*Kill it.*y or n. $" { + remote_send host "y\n" verbose "\t\tKilling previous program being debugged" - exp_continue - } - -re "Load new symbol table from \".*\".*y or n.*$" { - remote_send host "y\n" - remote_expect host 60 { - -re "Reading symbols from.*done.*$gdb_prompt $" { - verbose "\t\tLoaded $arg with new symbol table into $GDB" - return 0 - } - timeout { - perror "(timeout) Couldn't load $arg, other program already loaded." - return -1 - } - } - } - -re ".*No such file or directory.*$gdb_prompt $" { - perror "($arg) No such file or directory\n" - return -1 - } - -re "$gdb_prompt $" { - perror "couldn't load $arg into $GDB." - return -1 - } - timeout { - perror "couldn't load $arg into $GDB (timed out)." - return -1 - } + exp_continue + } + -re "Load new symbol table from \".*\".*y or n.*$" { + remote_send host "y\n" + remote_expect host 60 { + -re "Reading symbols from.*done.*$gdb_prompt $" { + verbose "\t\tLoaded $arg with new symbol table into $GDB" + return 0 + } + timeout { + perror "(timeout) Couldn't load $arg, other program already loaded." + return -1 + } + } + } + -re ".*No such file or directory.*$gdb_prompt $" { + perror "($arg) No such file or directory\n" + return -1 + } + -re "$gdb_prompt $" { + perror "couldn't load $arg into $GDB." + return -1 + } + timeout { + perror "couldn't load $arg into $GDB (timed out)." + return -1 + } eof { - # This is an attempt to detect a core dump, but seems not to - # work. Perhaps we need to match .* followed by eof, in which - # expect does not seem to have a way to do that. - perror "couldn't load $arg into $GDB (end of file)." - return -1 - } + # This is an attempt to detect a core dump, but seems not to + # work. Perhaps we need to match .* followed by eof, in which + # expect does not seem to have a way to do that. + perror "couldn't load $arg into $GDB (end of file)." + return -1 + } } return 0 } @@ -264,7 +264,7 @@ proc gdb_comm_load { dest prog args } { # Make sure the file we're supposed to load really exists. if {![file exists $prog]} then { perror "$prog does not exist." - return [list "untested" ""] + return [list "untested" ""] } if { [is_remote host] || ![board_info host exists fileid] } { @@ -405,7 +405,7 @@ proc gdb_comm_load { dest prog args } { gdb_comm_add_breakpoint abort set output "" - + # Now start up the program and look for our magic breakpoints. # And a whole lot of other magic stuff too. |