Hi Pedro, > I'm left wondering if generic_mourn_inferior wouldn't be a better place > for this. That is, at the tail end of mourning, instead of before mourning, > which e.g., has a better change of not triggering a file reopen. > generic_mourn_inferior already calls reopen_exec_file, which > conditionaly calls bfd_cache_close_all. Looks like generic_mourn_inferior is not necessarily called at the end of the execution of the program. Lots of targets actually call it at the end of their own mourn_inferior, but it is conceivable that some may not. But you do have a point. How about the following patch instead? Instead of closing all descriptors before calling the mourn_inferior routine, it does it after. 2009-04-08 Joel Brobecker * target.c (target_mourn_inferior): Call bfd_cache_close_all after having executed the target mourn_inferior routine. Tested on x86-windows. -- Joel