From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 121959 invoked by alias); 24 May 2016 14:08:05 -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 121932 invoked by uid 89); 24 May 2016 14:08:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=thousand, pictures X-HELO: mail-qg0-f54.google.com Received: from mail-qg0-f54.google.com (HELO mail-qg0-f54.google.com) (209.85.192.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 24 May 2016 14:07:54 +0000 Received: by mail-qg0-f54.google.com with SMTP id e93so7528464qgf.2 for ; Tue, 24 May 2016 07:07:54 -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=6NwVCd6b6VN0e2GCdQOEsA4fLZ8LcseLHku/wmy4aH4=; b=J/9BTzCl3dc6lhyUZiyQNy4iXDZ6uSwEexcIcfvMCwvBhW9PjtISSHfeYQDPPjYilT Dj5oU9BbYxBSnPclTNl3EhjDSlj2LiGIktIKM8iBvE+mKuktigvL4BK055QY5ZZC4sva 8THKEEEyjiQGeeLp8gMs50GC8KXPSuKd4lZqqjqHD8hixNBKLbgjYq77p1zjjpZED/zP GHAeVIzzx3aZdWjaPuTitJcTe+aCsYkZSp1OxvoIDZN+Q1sxqCiYVF3JCS4jRYCOQcrz dkIj4JUwJOpmGeaQH4Okp0GLZH4J8t1hQ9OuSVFHhceRu4N0KMPiQr/oNtHqfjHthzXC sPAg== X-Gm-Message-State: ALyK8tKKtRL1Jmqec33MnrvV/iFqsEhynW3/QNZZPXMbOC2WZqnIO+AoYeBl3UHKtN6JXCdp0zsPzE/DRkunzmN6 X-Received: by 10.141.6.130 with SMTP id i124mr3587299qhd.26.1464098872496; Tue, 24 May 2016 07:07:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.55.16.211 with HTTP; Tue, 24 May 2016 07:07:12 -0700 (PDT) In-Reply-To: <04d07644-c6ed-88ae-f1de-cba46e875f2d@redhat.com> References: <1464019228-11131-1-git-send-email-martin.galvan@tallertechnologies.com> <04d07644-c6ed-88ae-f1de-cba46e875f2d@redhat.com> From: Martin Galvan Date: Tue, 24 May 2016 14:08:00 -0000 Message-ID: Subject: Re: [PATCH v2][PR gdb/19893] Fix handling of synthetic C++ references To: Pedro Alves Cc: gdb-patches Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2016-05/txt/msg00422.txt.bz2 Thanks for the answer! On Tue, May 24, 2016 at 7:46 AM, Pedro Alves wrote: > ... I still don't know what to think of this -- I simply don't understand it whether > you're doing this because it makes sense, or because doing otherwise would be hard > to do? >From a consistency point of view, it's probably not the right thing. All of the synthetic pointer cases I've tested always show "" instead of "@address". As for how to fix it, yeah, it would be hard. Or at least I don't know how to do it off the top of my head. I'd have to make value_addr not return a not_lval when passing it a synthetic ref, which I'm not sure it's right either. I *could*, however, manually call value->location.computed.funcs->check_synthetic_pointer in generic_val_print_ref instead of using value_bits_synthetic_pointer, thus avoiding the check for lval_computed. But that's a bit ugly IMHO. > - Can you show an example output? (set print object on/off, etc. whatever might be > handy to clearly explain that that is about). > Pictures are really worth a thousand words. :-) Sure: (gdb) set print object off (gdb) print ref $3 = (S &) : { a = 0, b = 1, c = 2 } (gdb) set print object on (gdb) print ref $4 = (S &) @0x601038: { a = 0, b = 1, c = 2 } Here, 0x601038 is the address of the structure 'ref' is referencing. This is consistent with the output for non-synthetic references, where the referenced value's address is shown. > - Is this covered by any testcase? I looked for "object" in the whole patch and > didn't seem to find it. Not that I know of. Should I add a test for this to implref-struct?