From patchwork Wed Apr 9 20:27:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mateusz Tabaka <8tab@wp.pl> X-Patchwork-Id: 469 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx23.g.dreamhost.com (mx2.sub5.homie.mail.dreamhost.com [208.113.200.128]) by wilcox.dreamhost.com (Postfix) with ESMTP id 2EF4636005B for ; Wed, 9 Apr 2014 13:28:03 -0700 (PDT) Received: by homiemail-mx23.g.dreamhost.com (Postfix, from userid 14314964) id CBE756264070E; Wed, 9 Apr 2014 13:28:02 -0700 (PDT) X-Original-To: gdb@patchwork.siddhesh.in Delivered-To: x14314964@homiemail-mx23.g.dreamhost.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by homiemail-mx23.g.dreamhost.com (Postfix) with ESMTPS id 9E53C62633119 for ; Wed, 9 Apr 2014 13:28:02 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:subject :content-type:content-transfer-encoding; q=dns; s=default; b=Lfr lXUER6XFLYJpgpP1zBq+7b3hTteho2Iil2lyys44geXNwZ/uptpO2saPCaMQGuVe 5S8H3c5nVamPf662+08eORCii0KaHOLAEV0YmHRgk9CtINyQEWO1F9H7SRVFYwwW zUh50jnY8+XCBkgKDMYzY5bhjMSBg9JD3ROBUGDE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:subject :content-type:content-transfer-encoding; s=default; bh=zhS4oJuYJ MjM0uWCj8pica4VUng=; b=AUpB5b1ILpHIVDY5iKzdGnfpX5XVgWowwSXOEihlG 04XixDF0ri9NnxEWJdcB/feBfycFcA/5FU5uGQQZd5TqSOt87vC6fKq6i/jsfn81 DTlAbKMZ1lZT2tgJFbScji/8iIeCmhhSuhifIP8RFKtsVeOMj7ZY27s0x6HCZFfQ Zc= Received: (qmail 22137 invoked by alias); 9 Apr 2014 20:28:00 -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 22126 invoked by uid 89); 9 Apr 2014 20:27:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.6 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx4.wp.pl Received: from mx4.wp.pl (HELO mx4.wp.pl) (212.77.101.12) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 09 Apr 2014 20:27:58 +0000 Received: (wp-smtpd smtp.wp.pl 8763 invoked from network); 9 Apr 2014 22:27:53 +0200 Received: from 89-71-30-223.dynamic.chello.pl (HELO [192.168.0.21]) (8tab@[89.71.30.223]) (envelope-sender <8tab@wp.pl>) by smtp.wp.pl (WP-SMTPD) with CAMELLIA256-SHA encrypted SMTP for ; 9 Apr 2014 22:27:53 +0200 Message-ID: <5345AD48.7080505@wp.pl> Date: Wed, 09 Apr 2014 22:27:52 +0200 From: Mateusz Tabaka <8tab@wp.pl> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: gdb-patches@sourceware.org Subject: Search debugfile directly in debug-file-directory if specified X-WP-AV: skaner antywirusowy poczty Wirtualnej Polski S. A. X-WP-SPAM: NO 0000000 [wXPk] X-IsSubscribed: yes X-DH-Original-To: gdb@patchwork.siddhesh.in Hi, When I set debug-file-directory, searching for debuglink doesn't work when it is located directly in that directory (/debuglink). This patch fixes this issue. Thanks, Mateusz. ChangeLog: 2014-04-09 Mateusz Tabaka <8tab@wp.pl> * symfile.c: search debugfile directly in debug-file-directory if specified diff --git a/gdb/symfile.c b/gdb/symfile.c index 64a83c6..559ca95 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -1534,6 +1534,17 @@ find_separate_debug_file (const char *dir, return debugfile; } } + /* If debugfile doesn't exists in all of above paths, + try "/" */ + strcpy (debugfile, debugdir); + strcat (debugfile, "/"); + strcat (debugfile, debuglink); + + if (separate_debug_file_exists (debugfile, crc32, objfile)) + { + do_cleanups (back_to); + return debugfile; + } } do_cleanups (back_to);