+2003-04-16 Kevin Buettner <kevinb@redhat.com>
+
+ * gdb.base/args.exp: Invoke gdb_load for simulator targets.
+
2003-04-16 Elena Zannoni <ezannoni@redhat.com>
* gdb.base/completion.exp: Make 'info func mark' complete on 'info
return;
}
+# No loading needs to be done when the target is `exec'. Some targets
+# require that the program be loaded, however.
+proc args_load {} {
+ global binfile
+ if [target_info exists is_simulator] {
+ gdb_load ${binfile}
+ }
+}
+
set testfile "args"
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
+args_load
gdb_test "run" \
"Starting program.*args(\\.exe)? 1 3.*3\r\n.*args\r\n1\r\n3.*Program exited normally." \
"correct args printed"
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
+args_load
gdb_test "run" \
"Starting program.*args(\\.exe)? 1 \\\\'\\\\' 3.*4\r\n.*args\r\n1\r\n''\r\n3.*Program exited normally." \
"correct args printed, one empty"
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
+args_load
gdb_test "run" \
"Starting program.*args(\\.exe)? 1 \\\\'\\\\' \\\\'\\\\' 3.*5\r\n.*args\r\n1\r\n''\r\n''\r\n3.*Program exited normally." \
"correct args printed, two empty"