From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 49422 invoked by alias); 1 Jul 2015 13:45:36 -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 49407 invoked by uid 89); 1 Jul 2015 13:45:36 -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, 01 Jul 2015 13:45:35 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 2E98C3635C2; Wed, 1 Jul 2015 13:45:34 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t61DjWol024842; Wed, 1 Jul 2015 09:45:33 -0400 Message-ID: <5593EEFC.4020909@redhat.com> Date: Wed, 01 Jul 2015 13:45:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Gary Benson , gdb-patches@sourceware.org CC: =?windows-1252?Q?C=E9dric_Buissart?= Subject: Re: [PATCH 5/5] Also look for debug files in gdb_sysroot References: <1434447768-17328-1-git-send-email-gbenson@redhat.com> <1434447768-17328-6-git-send-email-gbenson@redhat.com> In-Reply-To: <1434447768-17328-6-git-send-email-gbenson@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-07/txt/msg00026.txt.bz2 On 06/16/2015 10:42 AM, Gary Benson wrote: > This commit makes GDB look for separate debug files in gdb_sysroot if > not found in the currently searched locations. This allows for easier > analysis of core files from foreign machines using the sysroot option. > The user creates or mounts a directory containing the necessary > binaries and debuginfo and then sets GDB's sysroot to that directory > before starting their debug session. Looks fine to me, but I think this should be documented in the manual, and maybe in the online help somewhere as well? And NEWS too. Thanks, Pedro Alves > > gdb/ChangeLog: > > * gdb/symfile.c (find_separate_debug_file): In debugdir loop, > also try alternate directory prefixed with gdb_sysroot. > --- > gdb/ChangeLog | 6 ++++++ > gdb/symfile.c | 11 +++++++++++ > 2 files changed, 17 insertions(+), 0 deletions(-) > > diff --git a/gdb/symfile.c b/gdb/symfile.c > index 0cc940a..1cd99ea 100644 > --- a/gdb/symfile.c > +++ b/gdb/symfile.c > @@ -1613,6 +1613,7 @@ find_separate_debug_file (const char *dir, > > if (altdir != NULL) > { > + /* Try in the alternate directory directly. */ > debugfile = build_debug_file_name (no_prefix, debugdir, > altdir, debuglink, NULL); > if (separate_debug_file_exists (debugfile, crc32, objfile)) > @@ -1621,6 +1622,16 @@ find_separate_debug_file (const char *dir, > return debugfile; > } > xfree (debugfile); > + > + /* Try in the alternate directory in gdb_sysroot. */ > + debugfile = build_debug_file_name (gdb_sysroot, debugdir, > + altdir, debuglink, NULL); > + if (separate_debug_file_exists (debugfile, crc32, objfile)) > + { > + do_cleanups (back_to); > + return debugfile; > + } > + xfree (debugfile);