mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-01-21 15:33:33 +08:00
* remote-fileio.c (remote_fileio_reset): New.
* remote-fileio.h (remote_fileio_reset): Prototype. * remote.c (extended_remote_restart, remote_open_1): Call it.
This commit is contained in:
parent
1dd41f16d1
commit
ad9a8f3f00
@ -1,6 +1,10 @@
|
||||
2006-06-08 Nathan Sidwell <nathan@codesourcery.com>
|
||||
|
||||
* gdb/remote.c (remote_open_1): Do preopen tasks before
|
||||
* remote-fileio.c (remote_fileio_reset): New.
|
||||
* remote-fileio.h (remote_fileio_reset): Prototype.
|
||||
* remote.c (extended_remote_restart, remote_open_1): Call it.
|
||||
|
||||
* remote.c (remote_open_1): Do preopen tasks before
|
||||
irreversably destroying state.
|
||||
|
||||
2006-06-08 Daniel Jacobowitz <dan@codesourcery.com>
|
||||
|
@ -1355,6 +1355,28 @@ do_remote_fileio_request (struct ui_out *uiout, void *buf_arg)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Close any open descriptors, and reinitialize the file mapping. */
|
||||
|
||||
void
|
||||
remote_fileio_reset (void)
|
||||
{
|
||||
int ix;
|
||||
|
||||
for (ix = 0; ix != remote_fio_data.fd_map_size; ix++)
|
||||
{
|
||||
int fd = remote_fio_data.fd_map[ix];
|
||||
|
||||
if (fd >= 0)
|
||||
close (fd);
|
||||
}
|
||||
if (remote_fio_data.fd_map)
|
||||
{
|
||||
free (remote_fio_data.fd_map);
|
||||
remote_fio_data.fd_map = NULL;
|
||||
remote_fio_data.fd_map_size = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
remote_fileio_request (char *buf)
|
||||
{
|
||||
|
@ -1818,6 +1818,8 @@ extended_remote_restart (void)
|
||||
xsnprintf (rs->buf, get_remote_packet_size (), "R%x", 0);
|
||||
putpkt (rs->buf);
|
||||
|
||||
remote_fileio_reset ();
|
||||
|
||||
/* Now query for status so this looks just like we restarted
|
||||
gdbserver from scratch. */
|
||||
putpkt ("?");
|
||||
@ -2073,6 +2075,7 @@ remote_open_1 (char *name, int from_tty, struct target_ops *target,
|
||||
|
||||
unpush_target (target);
|
||||
|
||||
remote_fileio_reset ();
|
||||
reopen_exec_file ();
|
||||
reread_symbols ();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user