From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 33270 invoked by alias); 26 Mar 2018 19:12:06 -0000 Mailing-List: contact elfutils-devel-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: elfutils-devel-owner@sourceware.org Received: (qmail 32856 invoked by uid 89); 26 Mar 2018 19:12:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.4 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS autolearn=ham version=3.3.2 spammy=DIE, gotten, stand, wish X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: gnu.wildebeest.org Received: from wildebeest.demon.nl (HELO gnu.wildebeest.org) (212.238.236.112) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 26 Mar 2018 19:12:04 +0000 Received: from librem.wildebeest.org (deer0x01.wildebeest.org [172.31.17.131]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id DB750302BB32; Mon, 26 Mar 2018 21:12:01 +0200 (CEST) Received: by librem.wildebeest.org (Postfix, from userid 1000) id 707BF14243C; Mon, 26 Mar 2018 21:12:01 +0200 (CEST) Date: Mon, 26 Mar 2018 19:12:00 -0000 From: Mark Wielaard To: Sasha Da Rocha Pinheiro Cc: "elfutils-devel@sourceware.org" Subject: Re: Read .debug_line without .debug_info Message-ID: <20180326191201.GC9061@wildebeest.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Spam-Flag: NO X-IsSubscribed: yes X-SW-Source: 2018-q1/txt/msg00109.txt.bz2 Hi Sasha, On Mon, Mar 26, 2018 at 04:41:06PM +0000, Sasha Da Rocha Pinheiro wrote: > is it possible to read contents of .debug_line section without the > presence of a .debug_info section? No, because .debug_line sections need some information from the CU which comes from the .debug_info. In particular the directory table starts with the compilation directory which can only be gotten from the CU (DW_AT_comp_dir). The files in the file list (which don't have an explicit dir associated) are all given relative to that comp dir. A line table can only be gotten through a CU DIE (from the .debug_info). But DWARF5 did make some changes that mean the .debug_line tables can stand on their own (and have their own .debug_line_str section for the dir and file names). I am about to post patches for that. But I haven't thought about adding an interface to iterate through the line tables without associated CUs. It would be nice if that also worked for pre-DWARF5 line tables. But how to represent the missing information? > We have CUDA binaries being generated with only .debug_line, and we > wish to use that. Is it possible to do that with libdw? Not at the moment. Sorry. > If not, any ideas of how to construct a minimum .debug_info in order > to read it? At the moment you need a minimal CU DIE with a DW_AT_stmt_list pointing to the line table, a DW_AT_name for the primary source file and a DW_AT_comp_dir for the compilation directory to resolve any relative file. Cheers, Mark