This is the mail archive of the gdb@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH] remote_detach() and inferior_pid



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");
  }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]