From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 61998 invoked by alias); 23 Feb 2016 00:16:01 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 61971 invoked by uid 89); 23 Feb 2016 00:16:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=detach X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 23 Feb 2016 00:16:00 +0000 Received: from svr-orw-fem-04.mgc.mentorg.com ([147.34.97.41]) by relay1.mentorg.com with esmtp id 1aY0dw-0002dM-Rz from Luis_Gustavo@mentor.com ; Mon, 22 Feb 2016 16:15:56 -0800 Received: from [172.30.1.130] (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.3.224.2; Mon, 22 Feb 2016 16:15:56 -0800 Reply-To: Luis Machado Subject: Re: [PATCH v2] Fix logic in exec_file_locate_attach References: <20160219102447.GA29870@blade.nx> <1455880879-310-1-git-send-email-gbenson@redhat.com> <56C736ED.9040505@codesourcery.com> <20160222104034.GA31531@blade.nx> <56CAF2E3.7050607@codesourcery.com> <20160222135109.GA2256@blade.nx> <56CB8506.3010602@codesourcery.com> <56CB9095.9090908@codesourcery.com> <56CB9304.9020408@redhat.com> <56CBA220.3000709@codesourcery.com> <56CBA443.6010106@redhat.com> To: Pedro Alves , Gary Benson CC: From: Luis Machado Message-ID: <56CBA4BA.7050905@codesourcery.com> Date: Tue, 23 Feb 2016 00:16:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <56CBA443.6010106@redhat.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-02/txt/msg00675.txt.bz2 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. > > Thanks, > Pedro Alves > Ok. I have the code in place, but i'm still crafting the testcase for both native / remote cases. Should have something later this week.