gdb/ 2008-07-04 Pedro Alves * symfile.c (load_command): Reopen the exec file and reread symbols before anything else. gdb/testsuite/ 2008-07-04 Pedro Alves * gdb.base/chng-syms.exp: Don't expect "No symbol ...". --- gdb/symfile.c | 10 +++++----- gdb/testsuite/gdb.base/chng-syms.exp | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) Index: src/gdb/symfile.c =================================================================== --- src.orig/gdb/symfile.c 2008-07-04 15:53:26.000000000 +0100 +++ src/gdb/symfile.c 2008-07-04 15:53:48.000000000 +0100 @@ -1708,6 +1708,11 @@ find_sym_fns (bfd *abfd) static void load_command (char *arg, int from_tty) { + /* The user might be reloading because the binary has changed. Take + this opportunity to check. */ + reopen_exec_file (); + reread_symbols (); + if (arg == NULL) { char *parg; @@ -1745,11 +1750,6 @@ load_command (char *arg, int from_tty) } } - /* The user might be reloading because the binary has changed. Take - this opportunity to check. */ - reopen_exec_file (); - reread_symbols (); - target_load (arg, from_tty); /* After re-loading the executable, we don't really know which Index: src/gdb/testsuite/gdb.base/chng-syms.exp =================================================================== --- src.orig/gdb/testsuite/gdb.base/chng-syms.exp 2008-07-04 15:53:26.000000000 +0100 +++ src/gdb/testsuite/gdb.base/chng-syms.exp 2008-07-04 15:53:48.000000000 +0100 @@ -105,10 +105,10 @@ if { [gdb_compile "${srcdir}/${subdir}/ gdb_run_cmd gdb_expect { - -re ".*No symbol .var1..*Program exited normally.*$gdb_prompt $" { + -re ".*Program exited normally.*$gdb_prompt $" { pass "running with invalidated bpt condition after executable changes" } - -re "No symbol .var1..*Breakpoint .*,( 0x.* in)? (\[^ \]*)exit .*$gdb_prompt $" { + -re ".*Breakpoint .*,( 0x.* in)? (\[^ \]*)exit .*$gdb_prompt $" { pass "running with invalidated bpt condition after executable changes" } -re "$gdb_prompt $" {