From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21258 invoked by alias); 18 May 2016 16:07:52 -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 21247 invoked by uid 89); 18 May 2016 16:07:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1854, Notice X-HELO: mail-qk0-f169.google.com Received: from mail-qk0-f169.google.com (HELO mail-qk0-f169.google.com) (209.85.220.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 18 May 2016 16:07:42 +0000 Received: by mail-qk0-f169.google.com with SMTP id n62so26441296qkc.2 for ; Wed, 18 May 2016 09:07:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=cphNJXhzD0bGmTk6wFREmSqe8Vze36mHFA5GCbTivj4=; b=YGx6TwF+/2rekOFGl77LnA4MTHYimWWbswBh0mBTweXDG1fm8N7upDRwKxYrZhm2/7 ZLUt3/SQv4E5SP/4mUgrw6ru1sOBpRMXp87KSvljAiEkgrkdPqW1+ztmqbuDkcE+sfej vyhdwcDuFmBmdUYyJnpygS2vnwZJNhZyISMjWeOjXAZCxZt7ye5FKV+s4KSpa4rl3pqm /Kjlae91hU8fT/3YFv62Q16XWiHRzMYTxWmZS+Zkn6PK7CGklJswetuQntUdFQzbItys fqB7osW9DnrZZbj+5Uag3Td9Z39ppT/o6tbvIbbVuro6pQ3Nt/tPKkSDY7uHC2YZSMeu bM6A== X-Gm-Message-State: AOPr4FUfx/Q+bdXezhymtr12YKPYUr0rTyvZA6CPrNhWL+ywX7hMYffsBzoZ06PFKUXTdG2qVjxrrnZjRlMMAsrk X-Received: by 10.55.201.145 with SMTP id m17mr8362780qkl.85.1463587659856; Wed, 18 May 2016 09:07:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.55.16.211 with HTTP; Wed, 18 May 2016 09:07:00 -0700 (PDT) In-Reply-To: <54fedd9c-e207-934a-0df8-bbab519591b4@redhat.com> References: <2918b01b-cb93-bda1-df66-96d3aba983ad@redhat.com> <1463582858-11127-1-git-send-email-martin.galvan@tallertechnologies.com> <54fedd9c-e207-934a-0df8-bbab519591b4@redhat.com> From: Martin Galvan Date: Wed, 18 May 2016 16:07:00 -0000 Message-ID: Subject: Re: [PING 2][PATCH][PR gdb/19893] Fix handling of synthetic C++ references To: Pedro Alves Cc: gdb-patches , Daniel Gutson Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2016-05/txt/msg00305.txt.bz2 On Wed, May 18, 2016 at 12:48 PM, Pedro Alves wrote: > On 05/18/2016 03:47 PM, Martin Galvan wrote: > >> * gdb.dwarf2/implref.exp: Rename to... >> * gdb.dwarf2/implref-const.exp: ...this. > > Were there changes other than renaming? Please tweak > your git config settings to detect renames / do "git diff -M". Yeah, there were. Will add it to the changelog. >> +static struct value * >> +fetch_const_value_from_synthetic_pointer (sect_offset die, LONGEST byte_offset, > Missing intro comment, which should leave no doubt on why is the function > named "const value", but then returns a non-const value. I meant it was a DW_AT_const_value, which (AFAIK) isn't necessarily represented by a const struct value in gdb. > But you can actually remove the "result" local and call "return" directly > in both branches. Yeah, I just like it when functions have a single return statement. Will change it :) >> +# This matches e.g. '{10, 1, 2, 3, 4}' >> +set new_contents [format {\{%d[\d,\s]+\}} ${first_value}] > > Why not match exactly "{10, 1, 2, 3, 4}" ? The idea was to let the test maintainer alter the array (e.g. add more/different elements) whenever possible without having to touch the TCL file as well. But if it's ok to assume it won't change then I can simplify the regex a bit. >> + /* Else, we have a synthetic reference. Don't print '@address'; we'll >> + show '' instead through valprint_check_validity. >> + Notice however that 'set print object on' will still show '@address'. > > Is that a bug, or desirable? I don't think it's a bug (the address that'll be shown is the referenced variable's, not something like 0x0). If you ask me, I think we can just leave it as a (documented) corner case. Thanks for the feedback!