From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (wildebeest.demon.nl [212.238.236.112]) by sourceware.org (Postfix) with ESMTPS id D8B953857816 for ; Fri, 2 Jul 2021 21:59:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D8B953857816 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org Received: from reform (deer0x00.wildebeest.org [172.31.17.130]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 1CFF5302FBA6; Fri, 2 Jul 2021 23:59:40 +0200 (CEST) Received: by reform (Postfix, from userid 1000) id 717222E80EF2; Fri, 2 Jul 2021 23:59:39 +0200 (CEST) Date: Fri, 2 Jul 2021 23:59:39 +0200 From: Mark Wielaard To: Nick Gasson Cc: elfutils-devel@sourceware.org Subject: Re: [PATCH] libdwfl: add dwfl_local_find_debuginfo callback Message-ID: References: <20210613032702.48229-1-nick@nickg.me.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210613032702.48229-1-nick@nickg.me.uk> X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jul 2021 21:59:44 -0000 Hi Nick, Sorry for the late reply. On Sun, Jun 13, 2021 at 11:27:02AM +0800, Nick Gasson via Elfutils-devel wrote: > This patch adds a variant of dwfl_standard_find_debuginfo that only > searches the local filesystem and does not fall back to debuginfod. > > In my application I am using libdw to decode stack traces where some of > the loaded DSOs are generated on-the-fly by LLVM. If these don't have > debug information I want the find_debuginfo callback to fail immediately > and not fall back to debuginfod which will never succeed. Similarly if > the main executable is stripped. I supposed I could unset the > DEBUGINFOD_URLS environment variable before calling into libdw, but that > seems a bit hacky and liable to break in the future if the debuginfod > client loads the URLs from a different place. I don't think the (un)setting of DEBUGINFOD_URLS will ever change. It is API now. But I can see a need for this. I wonder if we can use the Dwfl_Callbacks debuginfo_path for this instead of introducing a dwfl_standard_find_debuginfo variant. That might make things a bit more configurable. Something like the following maybe: - If the last path element is "@" then the debuginfo client won't be used. - If the last path element is "@{URLs}" (space separated) then the debuginfo client will be used with to given URLs. - If there is no path element starting with @ then the default debuginfo client will be used after all local searches failed (or not when DEBUGINFOD_URLS isn't set). Does that sound helpful? Does it make sense to make things configurable like this? Thanks, Mark