This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2] Fix logic in exec_file_locate_attach
- From: Gary Benson <gbenson at redhat dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: Luis Machado <lgustavo at codesourcery dot com>, gdb-patches at sourceware dot org
- Date: Tue, 23 Feb 2016 12:15:02 +0000
- Subject: Re: [PATCH v2] Fix logic in exec_file_locate_attach
- Authentication-results: sourceware.org; auth=none
- References: <56CAF2E3 dot 7050607 at codesourcery dot com> <20160222135109 dot GA2256 at blade dot nx> <56CB8506 dot 3010602 at codesourcery dot com> <56CB9095 dot 9090908 at codesourcery dot com> <56CB9304 dot 9020408 at redhat dot com> <56CBA220 dot 3000709 at codesourcery dot com> <56CBA443 dot 6010106 at redhat dot com> <56CBA4BA dot 7050905 at codesourcery dot com> <20160223112721 dot GA22369 at blade dot nx> <56CC45F3 dot 1090104 at redhat dot com>
Pedro Alves wrote:
> On 02/23/2016 11:27 AM, Gary Benson wrote:
> > I hadn't considered user interrupts.
>
> But there's nothing about user interrupts in either of:
>
> https://sourceware.org/ml/gdb-patches/2016-02/msg00511.html
>
> or:
>
> https://sourceware.org/ml/gdb-patches/2016-02/msg00671.html
>
> That is about gdb managing to figure out the file name of the
> running program, but then trying to open the file, and that failing
> and throwing.
Sure. But up until now I've been thinking my way through the cases in
the exec_file_locate_attach in terms of file accessibility checks, and
the possibility of user interrupts makes that irrelevent.
I'm not averse to TRY..CATCH, in fact I think the suggestion of two
separate TRY..CATCH blocks around exec_file_attach the symbol file
one is the correct solution.
But, there is a separate issue, which is that if you run gdbserver on
some executable, and GDB has a sysroot set, and that executable does
not exist in GDB's sysroot but does exist on GDB's root filesystem,
then GDB will open the file from its root filesystem:
gdb -ex "set sysroot /xxx" -ex "target remote | gdbserver - /bin/ls"
...
Reading symbols from /bin/ls...(no debugging symbols found)...done.
My v2 patch stops that. So... can I commit it?
Cheers,
Gary
--
http://gbenson.net/