From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gateway36.websitewelcome.com (gateway36.websitewelcome.com [192.185.187.5]) by sourceware.org (Postfix) with ESMTPS id 2A9353858D35 for ; Wed, 5 Aug 2020 20:14:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2A9353858D35 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=tom@tromey.com Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway36.websitewelcome.com (Postfix) with ESMTP id AF902400C8F42 for ; Wed, 5 Aug 2020 14:38:37 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id 3PoGkjd82CjCV3PoGkh8eH; Wed, 05 Aug 2020 15:14:48 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=mF5jsEsbIswnIDCYrHTEg/HCQI/U4vIR6ImhmE8LCZM=; b=HM1TtQA9Nw5MXGQOm9OAaOH//j mtl11gnNelR1K3V8KAHisvpBN0RhSDTcLZFHtCMXH8EVUdQaYbOF8A3QCm7Sp0S0ZFCuLL8A7PIlS hZFthYAxTmOXwq7POySZpvfhE; Received: from 75-166-101-103.hlrn.qwest.net ([75.166.101.103]:37678 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1k3PoG-0048VU-4n; Wed, 05 Aug 2020 14:14:48 -0600 From: Tom Tromey To: Caroline Tice via Gdb-patches Cc: Simon Marchi , Caroline Tice , Eric Christopher , Tom Tromey Subject: Re: [PATCH, v3] Add code for processing version 5 DWP files (for use with DWARF v5) References: <5e77197d-dbb3-5718-bfe8-e263c4006a06@simark.ca> X-Attribution: Tom Date: Wed, 05 Aug 2020 14:14:47 -0600 In-Reply-To: (Caroline Tice via Gdb-patches's message of "Wed, 29 Jul 2020 14:05:03 -0700") Message-ID: <873650onns.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 75.166.101.103 X-Source-L: No X-Exim-ID: 1k3PoG-0048VU-4n X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 75-166-101-103.hlrn.qwest.net (murgatroyd) [75.166.101.103]:37678 X-Source-Auth: tom+tromey.com X-Email-Count: 1 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-3029.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, JMQ_SPF_NEUTRAL, RCVD_IN_ABUSEAT, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_NEUTRAL, TXREP autolearn=no 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: Wed, 05 Aug 2020 20:14:51 -0000 >>>>> "Caroline" == Caroline Tice via Gdb-patches writes: Caroline> The changes to include/dwarf2.h were accepted by binutils and have Caroline> gone in, so I've removed those changes from this patch. Thank you for the patch. I read it and I have a few minor nits, plus one actual bug. Caroline> - if (version == 2) Caroline> + if ((version == 2) || (version == 5)) Please remove the extra parentheses on this line. Caroline> + else // version == 5 gdb still only uses /* */-style comments. Caroline> + int i; This should be local to the for loop: Caroline> + for (i = 0; i < nr_columns; ++i) ... for (int i = ...) Caroline> + htab->section_pool.v5.sizes = Caroline> + htab->section_pool.v5.offsets + (sizeof (uint32_t) The '=' should go at the start of the second line here. Caroline> +static struct dwo_unit * Caroline> +create_dwo_unit_in_dwp_v5 (struct dwarf2_per_objfile *dwarf2_per_objfile, Caroline> + struct dwp_file *dwp_file, Caroline> + uint32_t unit_index, Caroline> + const char *comp_dir, Caroline> + ULONGEST signature, int is_debug_types) Caroline> +{ ... Caroline> + const struct dwp_hash_table *dwp_htab = Caroline> + is_debug_types ? dwp_file->tus : dwp_file->cus; '=' on the wrong line. Caroline> + int i; This should also be in the 'for' loop below. Caroline> + memset (§ions, 0, sizeof (sections)); Can this just be struct virtual_v2_or_v5_dwo_sections sections {}; ? gdb is moving more to a C++-y style where variables are declared near their first use. Caroline> + dwo_file->dwo_name = obstack_strdup (&objfile->objfile_obstack, Caroline> + virtual_dwo_name); Here we use objfile::intern now instead. This matters because it puts the string into the per-BFD object rather than the objfile obstack, so that sharing works correctly. I suspect this approach could cause crashes in some multi-inferior scenarios. Caroline> + dwo_unit = OBSTACK_ZALLOC (&objfile->objfile_obstack, struct dwo_unit); These were also moved to the per-BFD obstack during the big sharing series. The other site doing this now looks like: dwo_unit = OBSTACK_ZALLOC (&per_objfile->per_bfd->obstack, struct dwo_unit); Caroline> + dwo_unit->section = Caroline> + XOBNEW (&objfile->objfile_obstack, struct dwarf2_section_info); Likewise. Caroline> + else // version == 5 Comment style. Tom