From patchwork Wed Jul 9 13:51:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Sendroiu X-Patchwork-Id: 1982 Received: (qmail 11675 invoked by alias); 9 Jul 2014 13:51:10 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 11658 invoked by uid 89); 9 Jul 2014 13:51:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: na01-bn1-obe.outbound.protection.outlook.com Received: from mail-bn1lp0145.outbound.protection.outlook.com (HELO na01-bn1-obe.outbound.protection.outlook.com) (207.46.163.145) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 09 Jul 2014 13:51:08 +0000 Received: from BLUPR03MB136.namprd03.prod.outlook.com (10.255.212.27) by BLUPR03MB134.namprd03.prod.outlook.com (10.255.212.14) with Microsoft SMTP Server (TLS) id 15.0.974.11; Wed, 9 Jul 2014 13:51:03 +0000 Received: from BLUPR03MB136.namprd03.prod.outlook.com ([169.254.1.19]) by BLUPR03MB136.namprd03.prod.outlook.com ([169.254.1.19]) with mapi id 15.00.0974.002; Wed, 9 Jul 2014 13:51:03 +0000 From: Adrian Sendroiu To: "gdb-patches@sourceware.org" Subject: [PATCH] call observer_notify_new_objfile after the attach command Date: Wed, 9 Jul 2014 13:51:03 +0000 Message-ID: <7e50a9e5f62f49c39dfaff1a57487393@BLUPR03MB136.namprd03.prod.outlook.com> x-microsoft-antispam: BCL:0;PCL:0;RULEID: x-forefront-prvs: 0267E514F9 x-forefront-antispam-report: SFV:NSPM; SFS:(6009001)(199002)(189002)(106356001)(83322001)(99286002)(46102001)(79102001)(21056001)(33646001)(2656002)(77982001)(85806002)(95666004)(76482001)(50986999)(107886001)(107046002)(87936001)(77096002)(83072002)(99396002)(54356999)(2351001)(85852003)(105586002)(92566001)(66066001)(80022001)(110136001)(31966008)(101416001)(64706001)(74662001)(74502001)(20776003)(76576001)(81342001)(81542001)(86362001)(4396001)(229853001)(85306003)(74316001)(108616002)(24736002); DIR:OUT; SFP:; SCL:1; SRVR:BLUPR03MB134; H:BLUPR03MB136.namprd03.prod.outlook.com; FPR:; MLV:sfv; PTR:InfoNoRecords; MX:1; LANG:en; MIME-Version: 1.0 X-OriginatorOrg: freescale.com 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. --- gdb/infcmd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gdb/infcmd.c b/gdb/infcmd.c index 14736a5..e491b5d 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -2368,11 +2368,15 @@ attach_command_post_wait (char *args, int from_tty, int async_exec) exec_file_attach (full_exec_path, from_tty); symbol_file_add_main (full_exec_path, from_tty); } + else if (symfile_objfile) + observer_notify_new_objfile(symfile_objfile); } else { reopen_exec_file (); reread_symbols (); + + observer_notify_new_objfile(symfile_objfile); } /* Take any necessary post-attaching actions for this platform. */