[PATCH] remote_detach() and inferior_pid
Elena Zannoni
ezannoni@cygnus.com
Sat Apr 1 00:00:00 GMT 2000
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");
}
More information about the Gdb
mailing list