This is the mail archive of the
gdb@sourceware.cygnus.com
mailing list for the GDB project.
[PATCH] remote_detach() and inferior_pid
- To: gdb at sourceware dot cygnus dot com
- Subject: [PATCH] remote_detach() and inferior_pid
- From: Elena Zannoni <ezannoni at cygnus dot com>
- Date: Tue, 15 Feb 2000 10:35:23 -0500 (EST)
After a 'detach' from a remote target, if a file command is
done, gdb errors out in symbol_file_command(), because it calls
reinit_frame_cache(), which in turn calls get_current_frame() when
there is no stack. (The error message comes from get_current_frame()).
This happens because remote_detach() (and remote_async_detach()) do
not reset inferior_pid to 0. Is there a reason for this being this
way?
OK to check in the following patch?
Thanks
Elena
Index: remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.4
diff -c -r1.4 remote.c
*** remote.c 2000/02/09 08:52:47 1.4
--- remote.c 2000/02/15 15:18:07
***************
*** 2115,2120 ****
--- 2115,2121 ----
remote_send (buf, PBUFSIZ);
pop_target ();
+ inferior_pid = 0;
if (from_tty)
puts_filtered ("Ending remote debugging.\n");
***************
*** 2140,2145 ****
--- 2141,2147 ----
SERIAL_ASYNC (remote_desc, NULL, 0);
pop_target ();
+ inferior_pid = 0;
if (from_tty)
puts_filtered ("Ending remote debugging.\n");
}