From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 91900 invoked by alias); 23 Feb 2016 00:04:58 -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 90737 invoked by uid 89); 23 Feb 2016 00:04:57 -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:04:55 +0000 Received: from svr-orw-fem-03.mgc.mentorg.com ([147.34.97.39]) by relay1.mentorg.com with esmtp id 1aY0TC-0000CJ-PN from Luis_Gustavo@mentor.com ; Mon, 22 Feb 2016 16:04:50 -0800 Received: from [172.30.1.130] (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.3.224.2; Mon, 22 Feb 2016 16:04:50 -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> To: Pedro Alves , Gary Benson CC: From: Luis Machado Message-ID: <56CBA220.3000709@codesourcery.com> Date: Tue, 23 Feb 2016 00:04: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: <56CB9304.9020408@redhat.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-02/txt/msg00673.txt.bz2 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: > > $ ~/gdb/tests/threads& > [1] 2984 > $ chmod 000 ~/gdb/tests/threads > > $ gdb -q > (gdb) attach 2984 > Attaching to process 2984 > /home/pedro/gdb/tests/threads: Permission denied. > (gdb) detach > /home/pedro/gdb/mygit/src/gdb/thread.c:1010: internal-error: is_executing: Assertion `tp' failed. > A problem internal to GDB has been detected, > further debugging may prove unreliable. > Quit this debugging session? (y or n) > > Thanks, > Pedro Alves > Sounds like we're looking into a try/catch block around such functions then?