Hi Luis,
Luis Machado wrote:
The following patch guards such a call to prevent those errors
from disrupting a potential debugging session, and display only
a warning.
After looking into this it seems your patch is the right way to
go. There is a separate bug in exec_file_locate_attach in that
in some cases the sysroot is ignored, but fixing that will not
remove the need for what you are proposing.
My only nit is that I would prefer the TRY-CATCH block smaller,
covering just exec_file_locate_attach, like so:
/* If no main executable is currently open then attempt to
open the file that was executed to create this inferior. */
if (try_open_exec && get_exec_file (0) == NULL)
{
/* exec_file_locate_attach may throw an error...
TRY
{
exec_file_locate_attach (pid, 1);
}
CATCH...
Other than that I am ok with this change.
Thanks for tracking this down.