From: Pedro Alves Date: Wed, 9 Jul 2008 11:16:49 +0000 (+0000) Subject: gdb/ X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4487aabf2e89820ee5243a62c3d7ea9c0c5353f4;p=binutils-gdb.git gdb/ 2008-07-09 Pedro Alves * symfile.c (load_command): Reopen the exec file and reread symbols before anything else. gdb/testsuite/ 2008-07-09 Pedro Alves * gdb.base/chng-syms.exp: Don't expect "No symbol ...". --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 9bcadff69b6..b85fcec29ca 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2008-07-09 Pedro Alves + + * symfile.c (load_command): Reopen the exec file and reread + symbols before anything else. + 2008-07-09 Pedro Alves * remote-sim.c: Include gdbthread.h. diff --git a/gdb/symfile.c b/gdb/symfile.c index d0596e66150..d98f62b670c 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -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 diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 27886568cee..3f837fb0dc6 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2008-07-09 Pedro Alves + + * gdb.base/chng-syms.exp: Don't expect "No symbol ...". + 2008-07-09 Pedro Alves * gdb.base/fullname.exp: Restore pwd if compiling failed. diff --git a/gdb/testsuite/gdb.base/chng-syms.exp b/gdb/testsuite/gdb.base/chng-syms.exp index 36ba7b93170..dc54fc85005 100644 --- a/gdb/testsuite/gdb.base/chng-syms.exp +++ b/gdb/testsuite/gdb.base/chng-syms.exp @@ -105,10 +105,10 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb 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 $" {