From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 100773 invoked by alias); 1 Jul 2015 13:35:19 -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 100763 invoked by uid 89); 1 Jul 2015 13:35:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=no 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:35:13 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 02708B82D8; Wed, 1 Jul 2015 13:35:11 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t61DZAtD029379; Wed, 1 Jul 2015 09:35:10 -0400 Message-ID: <5593EC8E.3020603@redhat.com> Date: Wed, 01 Jul 2015 13:35: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 4/5] Add "target:" filename handling to find_separate_debug_file References: <1434447768-17328-1-git-send-email-gbenson@redhat.com> <1434447768-17328-5-git-send-email-gbenson@redhat.com> In-Reply-To: <1434447768-17328-5-git-send-email-gbenson@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-07/txt/msg00025.txt.bz2 On 06/16/2015 10:42 AM, Gary Benson wrote: > This commit updates find_separate_debug_file to handle filenames > prefixed with "target:". The same-directory and DEBUG_SUBDIRECTORY > locations are checked with the prefix if supplied. The debugdir > location is checked both with and without the prefix if one is > supplied. This makes GDB able to fetch separate debug files from > remote targets and from inferiors in containers. > + /* Try the same location but without TARGET_SYSROOT_PREFIX > + (i.e. on the local filesystem). */ > + debugfile = build_debug_file_name (no_prefix, debugdir, dir, > + debuglink, NULL); Given that we have a CRC to match, shouldn't we try the local filesystem first, avoiding the (potentially slow) remote fetching in the case the files on the container/remote are the same of the host's? (which I think happens often with containers). And I guess we could skip the "target:" attempt if target_filesystem_is_local() ? Fetching (big) debug info files from slow remote targets will I think lead to the desire for file chunk caching in gdb. But I think slow debug info beats no debug info. (Speaking of caching, AFAICS, gdb_bfd_crc/get_file_crc always read in the whole file and do the crc check locally. It seems really silly to read in the _whole_ file out of the target in get_file_crc, but not cache the file's contents for subsequent same-file accesses... And we could try pushing the CRC calculation to the target side as well. But guess with build id validation we'll just not care about this whole CRC path anymore.) Thanks, Pedro Alves