From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 53404 invoked by alias); 17 Feb 2017 11:41:27 -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 53065 invoked by uid 89); 17 Feb 2017 11:41:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= 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; Fri, 17 Feb 2017 11:41:24 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (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 0034DC04B327; Fri, 17 Feb 2017 11:41:24 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1HBfNoH014764; Fri, 17 Feb 2017 06:41:24 -0500 Subject: Re: [PATCH 5/8] DWARF-5 basic functionality To: Jan Kratochvil , gdb-patches@sourceware.org References: <148693097396.9024.2288256732840761882.stgit@host1.jankratochvil.net> <148693100178.9024.12379587332727380536.stgit@host1.jankratochvil.net> Cc: Victor Leschuk From: Pedro Alves Message-ID: <18b01458-037f-d871-8195-19731a35d38e@redhat.com> Date: Fri, 17 Feb 2017 11:41:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <148693100178.9024.12379587332727380536.stgit@host1.jankratochvil.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-02/txt/msg00469.txt.bz2 LGTM with a couple minor nits below. On 02/12/2017 08:23 PM, Jan Kratochvil wrote: > --- a/gdb/defs.h > +++ b/gdb/defs.h > @@ -648,6 +648,10 @@ extern void store_typed_address (gdb_byte *buf, struct type *type, > > extern int watchdog; > > +/* From dwarf2read.c */ > + > +ULONGEST gdb_read_unsigned_leb128 (bfd *, const gdb_byte *, unsigned int *); Not needed anymore. > + > /* Hooks for alternate command interfaces. */ > > /* * The name of the interpreter if specified on the command line. */ > diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c > index c1e02eb..39a067d 100644 > --- a/gdb/dwarf2loc.c > +++ b/gdb/dwarf2loc.c > @@ -39,6 +39,7 @@ > #include "dwarf2-frame.h" > #include "compile/compile.h" > #include "selftest.h" > +#include "libbfd.h" We've determined this is an internal bfd header. Do we need this? > #include > #include > #include > @@ -143,6 +144,57 @@ decode_debug_loc_addresses (const gdb_byte *loc_ptr, const gdb_byte *buf_end, > return DEBUG_LOC_START_END; > } > > > +/* 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. > -/* 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 bool/true/false? > +dwarf2_rnglists_process (unsigned offset, struct dwarf2_cu *cu, > + 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"). Thanks, Pedro Alves