mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-29 16:38:05 +08:00
Use ordinary calling convention for clean_restart
clean_restart accepts a single optional argument. Rather than using {args} and handling the argument by hand, change it to use Tcl's own argument-checking.
This commit is contained in:
@ -7437,20 +7437,16 @@ proc build_executable { testname executable {sources ""} {options {debug}} } {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Starts fresh GDB binary and loads an optional executable into GDB.
|
# Starts fresh GDB binary and loads an optional executable into GDB.
|
||||||
# Usage: clean_restart [executable]
|
# Usage: clean_restart [EXECUTABLE]
|
||||||
# EXECUTABLE is the basename of the binary.
|
# EXECUTABLE is the basename of the binary.
|
||||||
# Return -1 if starting gdb or loading the executable failed.
|
# Return -1 if starting gdb or loading the executable failed.
|
||||||
|
|
||||||
proc clean_restart { args } {
|
proc clean_restart {{executable ""}} {
|
||||||
global srcdir
|
global srcdir
|
||||||
global subdir
|
global subdir
|
||||||
global errcnt
|
global errcnt
|
||||||
global warncnt
|
global warncnt
|
||||||
|
|
||||||
if { [llength $args] > 1 } {
|
|
||||||
error "bad number of args: [llength $args]"
|
|
||||||
}
|
|
||||||
|
|
||||||
gdb_exit
|
gdb_exit
|
||||||
|
|
||||||
# This is a clean restart, so reset error and warning count.
|
# This is a clean restart, so reset error and warning count.
|
||||||
@ -7470,8 +7466,7 @@ proc clean_restart { args } {
|
|||||||
|
|
||||||
gdb_reinitialize_dir $srcdir/$subdir
|
gdb_reinitialize_dir $srcdir/$subdir
|
||||||
|
|
||||||
if { [llength $args] >= 1 } {
|
if {$executable != ""} {
|
||||||
set executable [lindex $args 0]
|
|
||||||
set binfile [standard_output_file ${executable}]
|
set binfile [standard_output_file ${executable}]
|
||||||
return [gdb_load ${binfile}]
|
return [gdb_load ${binfile}]
|
||||||
}
|
}
|
||||||
|
@ -1008,20 +1008,16 @@ proc mi_run_with_cli {args} {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Starts fresh GDB binary and loads an optional executable into GDB.
|
# Starts fresh GDB binary and loads an optional executable into GDB.
|
||||||
# Usage: mi_clean_restart [executable]
|
# Usage: mi_clean_restart [EXECUTABLE]
|
||||||
# EXECUTABLE is the basename of the binary.
|
# EXECUTABLE is the basename of the binary.
|
||||||
# Return -1 if starting gdb or loading the executable failed.
|
# Return -1 if starting gdb or loading the executable failed.
|
||||||
|
|
||||||
proc mi_clean_restart { args } {
|
proc mi_clean_restart {{executable ""}} {
|
||||||
global srcdir
|
global srcdir
|
||||||
global subdir
|
global subdir
|
||||||
global errcnt
|
global errcnt
|
||||||
global warncnt
|
global warncnt
|
||||||
|
|
||||||
if { [llength $args] > 1 } {
|
|
||||||
error "bad number of args: [llength $args]"
|
|
||||||
}
|
|
||||||
|
|
||||||
gdb_exit
|
gdb_exit
|
||||||
|
|
||||||
# This is a clean restart, so reset error and warning count.
|
# This is a clean restart, so reset error and warning count.
|
||||||
@ -1034,8 +1030,7 @@ proc mi_clean_restart { args } {
|
|||||||
|
|
||||||
mi_gdb_reinitialize_dir $srcdir/$subdir
|
mi_gdb_reinitialize_dir $srcdir/$subdir
|
||||||
|
|
||||||
if { [llength $args] >= 1 } {
|
if {$executable != ""} {
|
||||||
set executable [lindex $args 0]
|
|
||||||
set binfile [standard_output_file ${executable}]
|
set binfile [standard_output_file ${executable}]
|
||||||
return [mi_gdb_load ${binfile}]
|
return [mi_gdb_load ${binfile}]
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user