From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 116894 invoked by alias); 26 Mar 2018 22:23:04 -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 116885 invoked by uid 89); 26 Mar 2018 22:23:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-7.4 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_1,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=ch, hundred X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 26 Mar 2018 22:23:02 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 03F07EB70F; Mon, 26 Mar 2018 22:23:01 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 84D6010AF9D4; Mon, 26 Mar 2018 22:23:00 +0000 (UTC) Subject: Re: [PATCH] Move DWARF index-related things to a separate file To: Simon Marchi , gdb-patches@sourceware.org References: <1522098518-30931-1-git-send-email-simon.marchi@ericsson.com> From: Pedro Alves Message-ID: Date: Mon, 26 Mar 2018 22:23:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1522098518-30931-1-git-send-email-simon.marchi@ericsson.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-03/txt/msg00545.txt.bz2 On 03/26/2018 10:08 PM, Simon Marchi wrote: > I want to add a DWARF index-related feature (automatically produce index > files when loading objfiles in GDB), but I don't want to add many > hundred lines to the already too big dwarf2read.c. I thought it would > be a logical split to move everything related to the DWARF index to its > own file. > > I first tried to move everything that reads and writes DWARF indices to > a separate file, but found that the "read" part is a little bit > entangled with the rest of dwarf2read.c, so the line is hard to draw > about where to split. The write part is quite isolated though, so I > moved this part to a new file, dwarf-index-write.c. Some things are > necessary to both reading and writing indices, so I placed them in > dwarf-index-common.{c,h}. The idea would be to have a > dwarf-index-read.c eventually that would use it too (for now that code > is still in dwarf2read.c). > > This required moving some things to a new dwarf2read.h header, so they > can be read by the code that writes the index. > > The patch is big in number of lines, but it's all existing code being > moved around. The only changes are that some functions are not static > anymore, a declaration is added in a .h file, and therefore the comment > is moved there. > > I built-tested it with a little and big endian target. > > This patch is also available on the users/simark/split-dwarf2read > branch. +1 for splitting dwarf2read.c. Thanks, Pedro Alves