From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id 2CC14388F043 for ; Mon, 11 May 2020 15:14:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2CC14388F043 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tdevries@suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id CF1F0AB76; Mon, 11 May 2020 15:14:46 +0000 (UTC) Date: Mon, 11 May 2020 17:14:42 +0200 From: Tom de Vries To: gdb-patches@sourceware.org Cc: Tom Tromey , Simon Marchi Subject: [committed][gdb/symtab] Save modules in .debug_names Message-ID: <20200511151441.GA19472@delia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-19.5 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 15:14:49 -0000 Hi, When running test-case gdb.fortran/info-modules.exp with target board debug-names, I run into: ... FAIL: gdb.fortran/info-modules.exp: info modules: check for entry \ 'info-types-2.f90', '18', 'mod2' ... In more detail, comparing the behaviour of the executable without and with .debug_names section, we have: ... -$ gdb -batch info-modules -ex "info modules" +$ gdb -batch info-modules.debugnames -ex "info modules" All defined modules: -File /data/gdb_versions/devel/src/gdb/testsuite/gdb.fortran/info-types-2.f90: -18: mod2 - File /data/gdb_versions/devel/src/gdb/testsuite/gdb.fortran/info-types.f90: 16: mod1 ... This is due to the fact that the .debug_names section does not contain DW_TAG_module entries. Fix this in debug_names::psymbol_tag. Build and tested on x86_64-linux with target board debug-names. Committed to trunk. Thanks, - Tom [gdb/symtab] Save modules in .debug_names gdb/ChangeLog: 2020-05-11 Tom de Vries * dwarf2/index-write.c (debug_names::psymbol_tag): Handle MODULE_DOMAIN. --- gdb/dwarf2/index-write.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gdb/dwarf2/index-write.c b/gdb/dwarf2/index-write.c index fc42816b1e..eabfe5d682 100644 --- a/gdb/dwarf2/index-write.c +++ b/gdb/dwarf2/index-write.c @@ -1209,6 +1209,8 @@ class debug_names } case STRUCT_DOMAIN: return DW_TAG_structure_type; + case MODULE_DOMAIN: + return DW_TAG_module; default: return 0; }