Message ID | 5345AD48.7080505@wp.pl |
---|---|
State | Changes Requested, archived |
Headers |
Return-Path: <x14314964@homiemail-mx23.g.dreamhost.com> 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 <siddhesh@wilcox.dreamhost.com>; 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 <gdb@patchwork.siddhesh.in>; 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: <gdb-patches.sourceware.org> List-Unsubscribe: <mailto:gdb-patches-unsubscribe-gdb=patchwork.siddhesh.in@sourceware.org> List-Subscribe: <mailto:gdb-patches-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-help@sourceware.org>, <http://sourceware.org/ml/#faqs> 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 <gdb-patches@sourceware.org>; 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 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 |
Commit Message
Mateusz Tabaka
April 9, 2014, 8:27 p.m. UTC
Hi, When I set debug-file-directory, searching for debuglink doesn't work when it is located directly in that directory (<debug-file-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
Comments
Hello, > Hi, When I set debug-file-directory, searching for debuglink doesn't > work when it is located directly in that directory > (<debug-file-directory>/debuglink). This patch fixes this issue. > ChangeLog: > 2014-04-09 Mateusz Tabaka <8tab@wp.pl> > > * symfile.c: search debugfile directly in > debug-file-directory if specified Thanks for the patch. I am not a specialist of this area, but it seems to me that, after reading the GDB documentation at: https://www.sourceware.org/gdb/current/onlinedocs/gdb/Separate-Debug-Files.html ... that the current behavior is as documented. See the example the documentation provides about the various alternatives that GDB searches for. Sometimes, a case can be made for extending a bit the behavior to accomodate other situations, but I am having trouble seeing the benefits in your case. Why not put the debuglink file in <debug-file-directory>/.debug/<debuglink>? A couple of comments, while looking at your patch: - The ChangeLog entry needs to be adjusted a bit to provide the name of the subprogram where the change was made. Lines should try to be within 70 chars, with a maximum length of 80 chars, and should all be indented by a tab. - Comments should be sentences starting with a capital letter, and ending with a period (you forgot the period). Thank you. > > > 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 "<debug-file-directory>/<debuglink>" */ > + 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);
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 "<debug-file-directory>/<debuglink>" */ + 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);