+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 {
+ pass "$msg; value restored ok"
+ } else {
+ fail "$msg; value restored ok"
+ }
+}
+
+# srec format can not be loaded for 64-bit-only platforms
+if ![string compare $is64bitonly "no"] then {
+ test_reload_saved_value "[set intarr1.srec]" "reload array as value, srec" \
+ $array_val "\*$array_ptr_type"
+ test_reload_saved_value "[set intstr1.srec]" "reload struct as value, srec" \
+ $struct_val "\*$struct_ptr_type"
+ test_reload_saved_value "[set intarr2.srec]" "reload array as memory, srec" \
+ $array_val "\*$array_ptr_type"
+ test_reload_saved_value "[set intstr2.srec]" "reload struct as memory, srec" \
+ $struct_val "\*$struct_ptr_type"
+}
+
+# ihex format can not be loaded for 64-bit-only platforms
+if ![string compare $is64bitonly "no"] then {
+
+ test_reload_saved_value "[set intarr1.ihex]" \
+ "reload array as value, intel hex" \
+ $array_val "\*$array_ptr_type"
+ test_reload_saved_value "[set intstr1.ihex]" \
+ "reload struct as value, intel hex" \
+ $struct_val "\*$struct_ptr_type"
+ test_reload_saved_value "[set intarr2.ihex]" \
+ "reload array as memory, intel hex" \
+ $array_val "\*$array_ptr_type"
+ test_reload_saved_value "[set intstr2.ihex]" \
+ "reload struct as memory, intel hex" \
+ $struct_val "\*$struct_ptr_type"
+}
+
+# tekhex format can not be loaded for 64-bit-only platforms
+if ![string compare $is64bitonly "no"] then {
+ test_reload_saved_value "[set intarr1.tekhex]" \
+ "reload array as value, tekhex" \
+ $array_val "\*$array_ptr_type"
+ test_reload_saved_value "[set intstr1.tekhex]" \
+ "reload struct as value, tekhex" \
+ $struct_val "\*$struct_ptr_type"
+ test_reload_saved_value "[set intarr2.tekhex]" \
+ "reload array as memory, tekhex" \
+ $array_val "\*$array_ptr_type"
+ test_reload_saved_value "[set intstr2.tekhex]" \
+ "reload struct as memory, tekhex" \
+ $struct_val "\*$struct_ptr_type"
+}
+
+# clean up files