From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 110956 invoked by alias); 19 Feb 2017 21:26:36 -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 110941 invoked by uid 89); 19 Feb 2017 21:26:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=studied, sk:gdb_rea, wish X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 19 Feb 2017 21:26:35 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5658B3B755; Sun, 19 Feb 2017 21:26:35 +0000 (UTC) Received: from host1.jankratochvil.net (ovpn-116-221.ams2.redhat.com [10.36.116.221]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1JLQW5X022976 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 19 Feb 2017 16:26:34 -0500 Date: Sun, 19 Feb 2017 21:26:00 -0000 From: Jan Kratochvil To: Pedro Alves Cc: gdb-patches@sourceware.org, Victor Leschuk Subject: Re: [PATCH 5/8] DWARF-5 basic functionality Message-ID: <20170219212630.GC1291@host1.jankratochvil.net> References: <148693097396.9024.2288256732840761882.stgit@host1.jankratochvil.net> <148693100178.9024.12379587332727380536.stgit@host1.jankratochvil.net> <18b01458-037f-d871-8195-19731a35d38e@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <18b01458-037f-d871-8195-19731a35d38e@redhat.com> User-Agent: Mutt/1.7.1 (2016-10-04) X-IsSubscribed: yes X-SW-Source: 2017-02/txt/msg00521.txt.bz2 On Fri, 17 Feb 2017 12:41:22 +0100, Pedro Alves wrote: > > +ULONGEST gdb_read_unsigned_leb128 (bfd *, const gdb_byte *, unsigned int *); > > Not needed anymore. Yes, dropped. > > +#include "libbfd.h" > > We've determined this is an internal bfd header. > Do we need this? No, a mistake, dropped. > > +/* Expected enum dwarf_unit_type for read_comp_unit_head. */ > > +enum class RCUH_Kind { COMPILE, TYPE }; > > RCUH_Kind -> rcuh_kind. We only use uppercase type names > in template type parameter names. Done. > > -/* Call CALLBACK from DW_AT_ranges attribute value OFFSET. > > +/* Call CALLBACK from DW_AT_ranges attribute value OFFSET > > + reading .debug_rnglists. > > + Return 1 if the attributes are present and valid, otherwise, return 0. */ > > + > > +static int > > +dwarf2_rnglists_process (unsigned offset, struct dwarf2_cu *cu, > > bool/true/false? It is just a variant of dwarf2_ranges_process which still does use int from the C days of GDB. Its return value is also passed as a return value of dwarf2_ranges_process. Using bool here would need to refactor dwarf2_ranges_process first. And then one can rather refactor it all to a virtual class and after more refactoring to a different debugger. So I have kept it as it was. Otherwise specify which level of refactorization do you wish. > > + std::function > + CORE_ADDR range_end)> callback) > > Same comment about std::function. (and I had forgotten to suggest > that callback should probably be a universal reference / "&&callback"). That is OK, I have already noticed you had studied a lot of C++ schoolbooks before you permitted GDB to use C++. Jan