diff options
Diffstat (limited to 'gdb/testsuite/gdb.base/dump.exp')
-rw-r--r-- | gdb/testsuite/gdb.base/dump.exp | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/gdb/testsuite/gdb.base/dump.exp b/gdb/testsuite/gdb.base/dump.exp index a55e5b0..67f3195 100644 --- a/gdb/testsuite/gdb.base/dump.exp +++ b/gdb/testsuite/gdb.base/dump.exp @@ -46,7 +46,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable ${op return -1 } -clean_restart $binfile +clean_restart +gdb_load $binfile gdb_test "dump mem /dev/null 0x10 0x20" "Cannot access memory at address 0x10" \ "inaccessible memory is reported" @@ -107,14 +108,7 @@ set endian [get_endianness] # Now generate some dump files. proc make_dump_file { command msg } { - global gdb_prompt - - gdb_test_multiple "${command}" "$msg" { - -re ".*\[Ee\]rror.*$gdb_prompt $" { fail $msg } - -re ".*\[Ww\]arning.*$gdb_prompt $" { fail $msg } - -re ".*\[Uu\]ndefined .*$gdb_prompt $" { fail $msg } - -re ".*$gdb_prompt $" { pass $msg } - } + gdb_test_no_output "${command}" "$msg" } make_dump_file "dump val [set intarr1.bin] intarray" \ @@ -198,7 +192,7 @@ proc capture_pointer_with_type { pointer } { # Expected output of "p ${pointer}" is like "$7 = (int (*)[32]) 0x804a0e0", # and we want to extract "(int (*)[32]) 0x804a0e0" from it via # following regexp. - if [regexp " \\(.*\\).* 0x\[0-9a-fA-F\]+" $expect_out(0,string) output_string] { + if {[regexp " \\(.*\\).* 0x\[0-9a-fA-F\]+" $expect_out(0,string) output_string]} { # OUTPUT_STRING is expected to be like "(int (*)[32]) 0x804a0e0". pass "$test" } else { @@ -267,12 +261,12 @@ make_dump_file \ proc test_restore_saved_value { restore_args msg oldval newval } { global gdb_prompt - + gdb_test "restore $restore_args" \ "Restoring .*" \ "$msg; file restored ok" if { ![string compare $oldval \ - [capture_value $newval "$msg"]] } then { + [capture_value $newval "$msg"]] } then { pass "$msg; value restored ok" } else { fail "$msg; value restored ok" @@ -404,7 +398,7 @@ test_restore_saved_value "[set intstr1.bin] binary $struct2_start" \ # # test restore with start/stop addresses. # -# For this purpose, we will restore just the third element of the array, +# For this purpose, we will restore just the third element of the array, # and check to see that adjacent elements are not modified. # # We will need the address and offset of the third and fourth elements. @@ -455,7 +449,7 @@ gdb_test "print intarray\[4\] == 0" " = 1" "element 4 not changed - 4" if {![string compare $is64bitonly "no"]} { print_zero_all - # restore with expressions + # restore with expressions test_restore_saved_value \ "[set intarr3.srec] (char*)${array2_start}-(char*)${array_start} &intarray\[3\] &intarray\[4\]" \ "array partial with expressions" 4 "intarray2\[3\]" @@ -481,7 +475,7 @@ gdb_file_cmd ${binfile} # Now fix the endianness at the correct state. gdb_test_multiple "set endian $endian" "set endianness" { - -re ".* (big|little) endian.*$gdb_prompt $" { + -re ".* (big|little) endian.*$gdb_prompt $" { pass "setting $endian endianness" } } @@ -504,10 +498,10 @@ if { ![string compare $struct_val \ proc test_reload_saved_value { filename msg oldval newval } { global gdb_prompt - + gdb_file_cmd $filename if { ![string compare $oldval \ - [capture_value $newval "$msg"]] } then { + [capture_value $newval "$msg"]] } then { pass "$msg; value restored ok" } else { fail "$msg; value restored ok" |