This is the mail archive of the
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: Luis Machado <lgustavo at codesourcery dot com>
- Cc: Pedro Alves <palves at redhat dot com>, gdb-patches at sourceware dot org
- Date: Tue, 23 Feb 2016 11:27:21 +0000
- Subject: Re: [PATCH v2] Fix logic in exec_file_locate_attach
- Authentication-results: sourceware.org; auth=none
- References: <56C736ED dot 9040505 at codesourcery dot com> <20160222104034 dot GA31531 at blade dot nx> <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>
Luis Machado wrote:
> On 02/22/2016 09:13 PM, Pedro Alves wrote:
> > On 02/23/2016 12:04 AM, Luis Machado wrote:
> > >On 02/22/2016 08:00 PM, Pedro Alves wrote:
> > > > On 02/22/2016 10:49 PM, Luis Machado wrote:
> > > > > On 02/22/2016 07:00 PM, Luis Machado wrote:
> > > > > > My idea was to guard both exec_file_attach and
> > > > > > symbol_file_add_main. We can't have anything in that
> > > > > > function throwing an error that won't be caught, otherwise
> > > > > > the above connection attempt will fail.
> > > > >
> > > > > For the record, you patch does fix the case of native GDB
> > > > > trying to attach to a process without pre-loading a symbol
> > > > > file. We get a multi-frame backtrace as expected.
> > > > >
> > > > > It is the gdb/gdbserver case that still seems to be broken.
> > > >
> > > > Native is also broken as well for unexpectedly aborting the
> > > > attach sequence midway. While "bt" doesn't show it, "detach"
> > > > does trip on it:
> > >
> > > Sounds like we're looking into a try/catch block around such
> > > functions then?
> > Yes, I think so. Probably best to make it two separate
> > try/catches, in case the file can't be loaded as executable but
> > succeeds as symbol file, for some reason.
> Ok. I have the code in place, but i'm still crafting the testcase
> for both native / remote cases. Should have something later this
I hadn't considered user interrupts.
Pedro, are you ok if I commit my v2 patch
as a fix for the sysroot-escaping behaviour we saw?