From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8368 invoked by alias); 9 Jul 2014 14:18:55 -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 8288 invoked by uid 89); 9 Jul 2014 14:18:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 09 Jul 2014 14:18:52 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s69EIl6Y005643 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 9 Jul 2014 10:18:47 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s69EIk9b025178; Wed, 9 Jul 2014 10:18:46 -0400 Message-ID: <53BD4F45.4090000@redhat.com> Date: Wed, 09 Jul 2014 14:18:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Adrian Sendroiu , "gdb-patches@sourceware.org" Subject: Re: [PATCH] call observer_notify_new_objfile after the attach command References: <7e50a9e5f62f49c39dfaff1a57487393@BLUPR03MB136.namprd03.prod.outlook.com> In-Reply-To: <7e50a9e5f62f49c39dfaff1a57487393@BLUPR03MB136.namprd03.prod.outlook.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-07/txt/msg00188.txt.bz2 On 07/09/2014 02:51 PM, Adrian Sendroiu wrote: > When debugging a remote bare-metal target which implements the gdb protocol, > using target extended-remote + attach, gdb will not send the qSymbol packet, > even if a file was previously specified using file or symbol-file. > > Normally gdb would call remote_check_symbols in several places: the solib > inferior hook, the add_vsyscall_page hook or if the executable file changed > in the time passed between the file and the attach commands. Since none of these > conditions hold in the above scenario (no shared libraries are used and no > vsyscall page is present), gdb won't send a qSymbol packet. > > To fix this problem this patch calls observer_notify_new_objfile after the attach > command is completed, if such a symbol file is present. But, if no new objfile was (re)loaded, then why call the new_objfile observer? That's a bit backwards as it makes the core assume what a particular observer wants to do with the event/subject. If remote.c is interested in doing something when the attach is complete, then we can look for such a hook. And it turns out one already exists -- target_post_attach. So it seems like remote.c should call remote_check_symbols from its target_post_attach method ? That's not that different in principle from the remote_check_symbols call in remote_start_remote. -- Pedro Alves