[rfa/remote] Reread symbols on 'target remote'

Daniel Jacobowitz
2004-02-28T17:39:56Z

Right now chng-syms.exp fails for remote targets, because "run" causes the
executable to be reread but "target remote" doesn't. I thought I'd already
submitted a patch for this, a year or two ago, but I can't find it in my
archives anywhere. This patch just adds a matching check to remote_open_1.

This patch, and another I'm about to send separately, fix chng-syms.exp for
gdbserver targets.

OK?

--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer

2004-02-28 Daniel Jacobowitz <drow@mvista.com>

* remote.c (remote_open_1): Reopen the exec file and reread symbols
if necessary.

Index: gdb/remote.c
===================================================================
RCS file: /big/fsf/rsync/src-cvs/src/gdb/remote.c,v
retrieving revision 1.129
diff -u -p -r1.129 remote.c
--- gdb/remote.c 15 Feb 2004 15:22:06 -0000 1.129
+++ gdb/remote.c 27 Feb 2004 22:36:05 -0000
@@ -2146,6 +2146,9 @@ remote_open_1 (char *name, int from_tty,
if (!async_p)
wait_forever_enabled_p = 1;

+ reopen_exec_file ();
+ reread_symbols ();
+
target_preopen (from_tty);

unpush_target (target);