Index: mi-file.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-file.exp,v retrieving revision 1.7 diff -u -p -r1.7 mi-file.exp --- mi-file.exp 12 Sep 2006 20:11:42 -0000 1.7 +++ mi-file.exp 13 Dec 2006 22:34:53 -0000 @@ -45,6 +45,18 @@ mi_delete_breakpoints mi_gdb_reinitialize_dir $srcdir/$subdir mi_gdb_load ${binfile} +if [target_info exists use_gdb_stub] { + + # When debugging a stub, we can't depend on the current file + # being the default file set by select_source_symtab. + # When the gdb host connects to the stub, the stub will already be + # running the target program stopped at a function + # that probably isn't the one with main. We force + # the file with main to be the current, so the following tests work. + + mi_run_to_main +} + proc test_file_list_exec_source_file {} { global srcfile global srcdir