This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
PATCH: don't clear inferior pid after loading program via monitor
- To: gdb-patches at sources dot redhat dot com
- Subject: PATCH: don't clear inferior pid after loading program via monitor
- From: Jim Blandy <jimb at zwingli dot cygnus dot com>
- Date: Thu, 13 Sep 2001 17:50:11 -0500 (EST)
monitor.c seems to be unmaintained, so I've committed this.
2001-09-13 Jim Blandy <jimb@redhat.com>
* monitor.c (monitor_load): Don't delete symtab users, or reset
inferior_ptid.
Index: gdb/monitor.c
===================================================================
RCS file: /cvs/src/src/gdb/monitor.c,v
retrieving revision 1.29
diff -c -r1.29 monitor.c
*** gdb/monitor.c 2001/09/13 18:53:42 1.29
--- gdb/monitor.c 2001/09/13 22:45:44
***************
*** 2206,2220 ****
if (exec_bfd)
write_pc (bfd_get_start_address (exec_bfd));
! inferior_ptid = null_ptid ; /* No process now */
! /* This is necessary because many things were based on the PC at the
! time that we attached to the monitor, which is no longer valid
! now that we have loaded new code (and just changed the PC).
! Another way to do this might be to call normal_stop, except that
! the stack may not be valid, and things would get horribly
! confused... */
! clear_symtab_users ();
}
static void
--- 2206,2224 ----
if (exec_bfd)
write_pc (bfd_get_start_address (exec_bfd));
! /* There used to be code here which would clear inferior_ptid and
! call clear_symtab_users. None of that should be necessary:
! monitor targets should behave like remote protocol targets, and
! since generic_load does none of those things, this function
! shouldn't either.
! Furthermore, clearing inferior_ptid is *incorrect*. After doing
! a load, we still have a valid connection to the monitor, with a
! live processor state to fiddle with. The user can type
! `continue' or `jump *start' and make the program run. If they do
! these things, however, GDB will be talking to a running program
! while inferior_ptid is null_ptid; this makes things like
! reinit_frame_cache very confused. */
}
static void