proc test_break {mi_mode} {
global srcdir subdir binfile
- mi_gdb_exit
-
if {$mi_mode == "separate"} {
set start_ops "separate-mi-tty"
} else {
set start_ops ""
}
- if [mi_gdb_start $start_ops] {
+ if [mi_clean_restart $binfile $start_ops ] {
return
}
- mi_delete_breakpoints
- mi_gdb_reinitialize_dir $srcdir/$subdir
- mi_gdb_load ${binfile}
-
test_tbreak_creation_and_listing
test_ignore_count
mi_delete_breakpoints
mi_gdb_reinitialize_dir $srcdir/$subdir
- mi_gdb_reinitialize_dir $srcdir/$subdir
mi_gdb_load ${bin}
# Useful for debugging:
global mi_gdb_prompt
global decimal
- gdb_exit
- if [mi_gdb_start $args] {
+ if [mi_clean_restart "" $args] {
return
}
return
}
- mi_gdb_exit
-
if {$mi_mode == "separate"} {
set start_ops "separate-mi-tty"
} else {
set start_ops ""
}
- if [mi_gdb_start $start_ops] {
+ if [mi_clean_restart ${binfile} $start_ops] {
return
}
"567\\^done" \
"hw watchpoints toggle"
- mi_delete_breakpoints
- mi_gdb_reinitialize_dir $srcdir/$subdir
- mi_gdb_load ${binfile}
-
mi_runto callee4
test_watchpoint_creation_and_listing
#test_rwatch_creation_and_listing
global gdb_spawn_id gdb_main_spawn_id mi_spawn_id inferior_spawn_id
global gdb_prompt mi_gdb_prompt
- mi_gdb_exit
-
- if {[mi_gdb_start "separate-mi-tty"] != 0} {
+ if {[mi_clean_restart $binfile "separate-mi-tty"] != 0} {
fail "could not start gdb"
return
}
- mi_delete_breakpoints
- mi_gdb_reinitialize_dir $srcdir/$subdir
- mi_gdb_load $binfile
-
# Start a synchronous run/continue on the MI UI.
set test "send synchronous execution command"
if {$sync_command == "run"} {
set any "\[^\r\n\]*"
- mi_gdb_exit
-
save_vars { GDBFLAGS } {
if { $mode == "non-stop" } {
set GDBFLAGS [concat $GDBFLAGS " -ex \"set non-stop 1\""]
}
- if { [mi_gdb_start "separate-mi-tty"] != 0 } {
+ if { [mi_clean_restart $binfile "separate-mi-tty"] != 0 } {
return -1
}
}
- mi_delete_breakpoints
- mi_gdb_reinitialize_dir $srcdir/$subdir
- mi_gdb_load $binfile
-
if { [mi_runto_main] < 0 } {
return -1
}
# EXECUTABLE is the basename of the binary.
# Return -1 if starting gdb or loading the executable failed.
-proc mi_clean_restart {{executable ""}} {
+proc mi_clean_restart {{executable ""} {flags {}}} {
global srcdir
global subdir
global errcnt
set errcnt 0
set warncnt 0
- if {[mi_gdb_start]} {
+ if {[mi_gdb_start $flags]} {
return -1
}