From 37f7f50449affa0e4d50deb20b422d98491ee664 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Wed, 9 Jul 2008 11:16:49 +0000 Subject: [PATCH] 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 ...". --- gdb/ChangeLog | 5 +++++ gdb/symfile.c | 10 +++++----- gdb/testsuite/ChangeLog | 4 ++++ gdb/testsuite/gdb.base/chng-syms.exp | 4 ++-- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 9bcadff69b..b85fcec29c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 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. (remote_sim_ptid): New global. (gdbsim_create_inferior): Silently add the main task to GDB's diff --git a/gdb/symfile.c b/gdb/symfile.c index d0596e6615..d98f62b670 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 27886568ce..3f837fb0dc 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,9 @@ 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. 2008-07-07 Jan Kratochvil diff --git a/gdb/testsuite/gdb.base/chng-syms.exp b/gdb/testsuite/gdb.base/chng-syms.exp index 36ba7b9317..dc54fc8500 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 $" { -- 2.11.0