From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7709 invoked by alias); 19 Jan 2016 18:54:22 -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 7641 invoked by uid 89); 19 Jan 2016 18:54:22 -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,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=sk:type_co X-HELO: mail-lf0-f65.google.com Received: from mail-lf0-f65.google.com (HELO mail-lf0-f65.google.com) (209.85.215.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 19 Jan 2016 18:54:14 +0000 Received: by mail-lf0-f65.google.com with SMTP id n70so30063646lfn.1 for ; Tue, 19 Jan 2016 10:54:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=+XQIvXnDeEnqWmqcLhY6rpOLLa9V89obhKhfLRMOD/Y=; b=ObOraTqQpRS9lEGmDGJciliPOlyTpNuOs5tr1lh77E8z6nTJAuu2CYL8VwgH7a8w0o xqywj60BUCp8dx8YeqFflJPKmUS7iOz3z4WTrLg3JAMGshrhHMq/3DS0hOFFZF42nZKM T1dzXCcn1hfUmtFUe4IHOzLtIIhkg7bDjlAm+K1lBWOh1JRhMLydbtDVlyt9YhdfnwP4 RqaowKqn6WWVYikhP6h+bxklxLwqKicfxD8BtRT/fmlXmRb/tOB4Q1pgfN+Fs/SpjgxQ +3tv+OTPOn/xe4LyiH3ysc/LFoabIXlrotCObq4Re6ly5TVfebiGvGk1lhdoZIHB/5fE tI0A== X-Gm-Message-State: ALoCoQmppcSAm323W50fi69SeLuzqjEaB2DbNJ23pkcXeomXIYgeRpsAnvIXGL5fz9v3jc7fzvQzCUny4pw2hvisPuz1QQvutw== X-Received: by 10.25.156.198 with SMTP id f189mr11572639lfe.70.1453229651055; Tue, 19 Jan 2016 10:54:11 -0800 (PST) Received: from arch.smware.local ([37.204.1.155]) by smtp.gmail.com with ESMTPSA id p66sm4247278lfe.42.2016.01.19.10.54.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Jan 2016 10:54:09 -0800 (PST) From: Artemiy Volkov To: gdb-patches@sourceware.org Cc: palves@redhat.com, Artemiy Volkov Subject: [PATCH v2 07/11] [PR gdb/14441] gdb: dwarf2read: support DW_AT_rvalue_reference type Date: Tue, 19 Jan 2016 18:55:00 -0000 Message-Id: <1453229609-20159-8-git-send-email-artemiyv@acm.org> In-Reply-To: <1453229609-20159-1-git-send-email-artemiyv@acm.org> References: <1450661481-31178-1-git-send-email-artemiyv@acm.org> <1453229609-20159-1-git-send-email-artemiyv@acm.org> X-IsSubscribed: yes X-SW-Source: 2016-01/txt/msg00458.txt.bz2 Make gdb DWARF reader understand DW_AT_rvalue_reference type tag. Handling of this tag is done in the existing read_tag_reference_type() function, to which we add a new parameter representing the kind of reference type (lvalue vs rvalue). ./ChangeLog: 2016-01-19 Artemiy Volkov * gdb/dwarf2read.c (process_die): Handle the DW_AT_rvalue_reference_type DIE. (read_tag_reference_type): Likewise. (read_type_die_1): Likewise. --- gdb/dwarf2read.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index d2a3a50..9f589b8 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -8294,6 +8294,7 @@ process_die (struct die_info *die, struct dwarf2_cu *cu) case DW_TAG_pointer_type: case DW_TAG_ptr_to_member_type: case DW_TAG_reference_type: + case DW_TAG_rvalue_reference_type: case DW_TAG_string_type: break; @@ -14320,16 +14321,19 @@ read_tag_ptr_to_member_type (struct die_info *die, struct dwarf2_cu *cu) return set_die_type (die, type, cu); } -/* Extract all information from a DW_TAG_reference_type DIE and add to +/* Extract all information from a DW_TAG_{rvalue_,}reference_type DIE and add to the user defined type vector. */ static struct type * -read_tag_reference_type (struct die_info *die, struct dwarf2_cu *cu) +read_tag_reference_type (struct die_info *die, struct dwarf2_cu *cu, + enum type_code refcode) { struct comp_unit_head *cu_header = &cu->header; struct type *type, *target_type; struct attribute *attr; + gdb_assert (refcode == TYPE_CODE_REF || refcode == TYPE_CODE_RVALUE_REF); + target_type = die_type (die, cu); /* The die_type call above may have already set the type for this DIE. */ @@ -14337,7 +14341,7 @@ read_tag_reference_type (struct die_info *die, struct dwarf2_cu *cu) if (type) return type; - type = lookup_lvalue_reference_type (target_type); + type = lookup_reference_type (target_type, refcode); attr = dwarf2_attr (die, DW_AT_byte_size, cu); if (attr) { @@ -19115,7 +19119,10 @@ read_type_die_1 (struct die_info *die, struct dwarf2_cu *cu) this_type = read_tag_ptr_to_member_type (die, cu); break; case DW_TAG_reference_type: - this_type = read_tag_reference_type (die, cu); + this_type = read_tag_reference_type (die, cu, TYPE_CODE_REF); + break; + case DW_TAG_rvalue_reference_type: + this_type = read_tag_reference_type (die, cu, TYPE_CODE_RVALUE_REF); break; case DW_TAG_const_type: this_type = read_tag_const_type (die, cu); -- 2.7.0