This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Remote debugging without a binary (regression)
- From: Gary Benson <gbenson at redhat dot com>
- To: Luis Machado <lgustavo at codesourcery dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 18 Feb 2016 12:30:32 +0000
- Subject: Re: [PATCH] Remote debugging without a binary (regression)
- Authentication-results: sourceware.org; auth=none
- References: <1455200365-5270-1-git-send-email-lgustavo at codesourcery dot com>
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.
Cheers,
Gary
--
http://gbenson.net/