Re: [PATCH] Remote debugging without a binary (regression)

Luis Machado
2016-02-18T12:40:53Z

Hi Gary,

On 02/18/2016 10:30 AM, Gary Benson wrote:
> 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.

No problem. I'll come up with a new version of the patch and, while at
it, i'll try Pedro's suggestion for the testcase.