Change gdb.base to use clean_restart more consistently.
# Regression test for expression evaluation of address space qualifiers
# in C and C++.
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
+clean_restart
gdb_test_no_output "set language c"
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
+clean_restart
# Helper to test the -a option to alias.
# Aliases that are abbreviations of commands (e.g. r -> run)
if { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] == "" } {
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
- gdb_load ${binfile}
+ clean_restart $binfile
if {![runto_main]} {
return
}
#
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-
+clean_restart
gdb_test "print !1" ".\[0-9\]* = 0" "print value of !1"
# First test normal `file'-command loaded $FILE with symbols.
- gdb_exit
- gdb_start
+ clean_restart
# Clear it to never find any separate debug infos in $debug_root.
gdb_test_no_output "set debug-file-directory"
- gdb_reinitialize_dir $srcdir/$subdir
gdb_load $file
# Print the "PIE (Position Independent Executable) displacement" message.
# without symbols. SYMBOL_OBJFILE is not available and only
# EXEC_BFD must be used.
- gdb_exit
- gdb_start
+ clean_restart
# Clear it to never find any separate debug infos in $debug_root.
gdb_test_no_output "set debug-file-directory"
- gdb_reinitialize_dir $srcdir/$subdir
# Print the "PIE (Position Independent Executable)
# displacement" message.
# Now let's try setting a large number of checkpoints (>600)
#
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart $binfile
runto_main
gdb_breakpoint $break1_loc
return
}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
+clean_restart
set testname "file [file tail $ofile]"
if {[gdb_file_cmd $ofile] == 0} {
pass $testname
return -1
}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
+clean_restart
gdb_file_cmd ${binfile}
gdb_test_no_output "set listsize 1"
gdb_test "detach" "Detaching from program: .*$escapedbinfile, .*" "detach, $pass"
}
-# Start with a fresh gdb
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart $binfile
global pass
set pass "one"
gdb_test "p (_Decimal32) 4" " = 4"
}
-# Start with a fresh gdb.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
+clean_restart
test_dfp_literals_accepted
test_dfp_arithmetic_expressions
gdb_test "kill" ".*" "kill again"
gdb_test "detach" ".*" "detach again"
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
- gdb_load ${binfile}
+ clean_restart $binfile
}
# Ok, on to real life
}
with_test_prefix "without format" {
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
+ clean_restart
gdb_test "dprintf pendfunc" "Format string required" "missing ,FMT"
gdb_test "dprintf pendfunc," "Format string required" "missing FMT"
}
with_test_prefix "without symbols" {
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
+ clean_restart
gdb_test \
"dprintf pendfunc1, \"x=%d\\n\", x" \
return -1
}
-# Start with a fresh gdb.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
+clean_restart $binfile
gdb_test "dump mem /dev/null 0x10 0x20" "Cannot access memory at address 0x10" \
"inaccessible memory is reported"
# Now start a fresh gdb session, and reload the saved value files.
-gdb_exit
-gdb_start
+clean_restart
gdb_file_cmd ${binfile}
# Now fix the endianness at the correct state.
set oldtimeout $timeout
set timeout [expr "$timeout + 60"]
-# Start with a fresh gdb.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart $binfile
gdb_test_no_output "set print sevenbit-strings"
gdb_test_no_output "set print address off"
gdb_test_no_output "set width 0"
return -1
}
-# Start with a fresh gdb.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart $binfile
gdb_load_shlib ${lib_sl}
if {![runto_main]} {
}
}
-# Start with a fresh gdb
-
-gdb_exit
clean_restart $binfile
do_exec_tests
# Initialize GDB after getting the line number, to make sure
# symbols aren't loaded.
-gdb_exit
-gdb_start
-gdb_load ${binfile}
+clean_restart $binfile
set msg "set breakpoint by full path before loading symbols - built absolute"
if { [gdb_breakpoint [standard_output_file tmp-${srcfile}]:${line} {no-message}] != 0 } {
return -1
}
-gdb_exit
-gdb_start
-gdb_load ${binfile}
+clean_restart $binfile
set msg "set breakpoint by full path before loading symbols - built relative"
if { [gdb_breakpoint [standard_output_file tmp-${srcfile}]:${line} {no-message}] != 0 } {
}
}
-gdb_exit
-gdb_start
-gdb_load ${binfile}
+clean_restart $binfile
set msg "set breakpoint by full path before loading symbols - built other"
if { [gdb_breakpoint [standard_output_file tmp-${srcfile}]:${line} {no-message}] != 0 } {
}
# Now restart gdb and load the corefile.
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart $binfile
set core_loaded [gdb_core_cmd "$corefile" "re-load generated corefile"]
if { $core_loaded == -1 } {
return -1
}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart $binfile
set bp_location [gdb_get_line_number "set breakpoint here" ${new_srcfile}]
return -1
}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart $binfile
set bp_location [gdb_get_line_number "set breakpoint here" $new_srcfile]
gdb_continue_to_end "first session"
}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load $binfile
+clean_restart $binfile
# Try exercising the "minimal" language a bit...
"second use of \"list +INVALID\""
}
-# Start with a fresh gdb.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
+clean_restart
gdb_file_cmd ${binfile}
gdb_test_no_output "set width 0"
return -1
}
-# Start with a fresh gdb.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
+clean_restart
gdb_test_multiple "break pendfunc1" "set pending breakpoint" {
-re ".*Make breakpoint pending.*y or \\\[n\\\]. $" {
".*Breakpoint.*pendfunc1.*at.*pendshr.c:$pendfunc1_loc.*y = x \\+ 4.*" \
"run to resolved breakpoint 1 (without symbols)"
-# Restart with a fresh gdb.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
+clean_restart
with_test_prefix "second load" {
gdb_load ${binfile}
return -1
}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
+clean_restart
with_test_prefix "observer mode off" {
proc test_load_core { print_symbol_loading } {
global binfile binfile_lib gcorefile srcdir subdir
with_test_prefix "core ${print_symbol_loading}" {
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
+ clean_restart
gdb_test_no_output "set print symbol-loading $print_symbol_loading"
if { ${print_symbol_loading} != "off" } {
gdb_test "file $binfile" "Reading symbols from.*" "file"
}
-# Start with a fresh gdb.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
+clean_restart
gdb_test "print \$pc" "No registers\\."
set env(GDBHISTFILE) "${srcdir}/${subdir}/gdb_history"
set env(GDBHISTSIZE) "10"
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
+ clean_restart
operate_and_get_next "Simple operate-and-get-next, two" \
"p 7" ".* = 7" \
return -1
}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
+clean_restart
#Check that invalid options are rejected.
foreach x {"-raednow" "readnow" "foo" "-readnow s"} {
# Now use a variable as an offset to add-symbol-file, and check that
# the functions' addresses change.
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
+clean_restart
gdb_test_no_output "set \$offset = 0x10000"
# Now try loading the object as an exec-file; we should be able to print
# the values of variables after we do this.
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
+clean_restart
gdb_file_cmd ${binfile}
# Check the values of the variables.
# Try the same, but this time with a breakpoint. We need to exit
# GDB to make sure that we havn't loaded the full symbols yet when
# we test the breakpoint insertion.
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart $binfile
set test "breakpoint inside included file"
gdb_test_multiple "break sep-proc.c:$location" "$test" {
global srcdir subdir binfile srcfile timeout gdb_prompt
global bp_location6 decimal hex
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
+ clean_restart
gdb_test_no_output "set debug-file-directory ${test_different_dir}" \
"set separate debug location"
gdb_load ${binfile}
remote_exec build "cp ${debugfile} [standard_output_file sepdebug2.debug]"
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
+ clean_restart
set escapedobjdirsubdir [string_to_regexp [standard_output_file {}]]
return -1
}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart $binfile
gdb_load_shlib $libobj
if {![runto_main]} {
return -1
}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart $binfile
gdb_load_shlib $binfile_lib
# Set a breakpoint in the binary.
}
with_test_prefix $testopts {
- gdb_exit
- gdb_start
- gdb_reinitialize_dir $srcdir/$subdir
- gdb_load ${binfile}
+ clean_restart $binfile
gdb_load_shlib $lib1
gdb_load_shlib $lib2
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
+clean_restart
# Do a bunch of testing of the set/unset/show substitute-path
# commands that do not require the presence of an executable.
return -1
}
-# Start with a fresh gdb.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart $binfile
gdb_load_shlib $lib_sl
gdb_load_shlib $lib_sl2
return -1
}
-# Start with a fresh gdb.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart $binfile
gdb_load_shlib $lib_sl
runto_main