From patchwork Mon Jun 6 19:22:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artemiy Volkov X-Patchwork-Id: 12805 Received: (qmail 25533 invoked by alias); 6 Jun 2016 19:23:00 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 25392 invoked by uid 89); 6 Jun 2016 19:23:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:2588 X-HELO: mail-lf0-f68.google.com Received: from mail-lf0-f68.google.com (HELO mail-lf0-f68.google.com) (209.85.215.68) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 06 Jun 2016 19:22:55 +0000 Received: by mail-lf0-f68.google.com with SMTP id k192so5861438lfb.1 for ; Mon, 06 Jun 2016 12:22: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:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=BNz9b/SqIFHGFseZa9If5mYh2TuqvxYQYaRYK6kJdGM=; b=AIT7Xi/jqqB2C69GGiAKiNDTQSs/Yy32hZOM1L6dvECjxCyvjRxo5GJPaUba2QrL1S QKsC01KIUU7RC5SSGEUBQ1LVsDb9CTZJ08YHeSwzSV1HiMxpJ3e17uP7c03x7/qzy8VQ 5bpP73FfouDdjKa/nHWAIHebjexhQBMfPjghY1sdQBsWpUAVMVoA6oB5wMXBoQ/8+6f9 fLyUf8X+Gkh3opE7pstTolkS9hsQ1bhiOK5C/4WzogkzMhEHabiajMWXi1K+gXNsroSB 7kgkwwT1mVTlF1RqW1vbPcFlBmFmUB8YptF9qB52akX8tsc0brPTFVwn3yAMrBMVhVWy qJWQ== X-Gm-Message-State: ALyK8tKSb5HKpcvB8DEzzwmHGWOLINt8ItuhkxtcBt7lqe/E2Rl0k4pid6xY4JBD6O8NmQ== X-Received: by 10.25.215.161 with SMTP id q33mr1131164lfi.134.1465240972015; Mon, 06 Jun 2016 12:22:52 -0700 (PDT) Received: from localhost.localdomain (broadband-90-154-70-138.nationalcablenetworks.ru. [90.154.70.138]) by smtp.gmail.com with ESMTPSA id jv7sm1970253lbc.4.2016.06.06.12.22.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Jun 2016 12:22:51 -0700 (PDT) From: Artemiy Volkov To: gdb-patches@sourceware.org Cc: palves@redhat.com, keiths@redhat.com, Artemiy Volkov Subject: [PATCH v5 07/11] [PR gdb/14441] gdb: dwarf2read: support DW_TAG_rvalue_reference type Date: Mon, 6 Jun 2016 22:22:21 +0300 Message-Id: <20160606192225.12384-8-artemiyv@acm.org> In-Reply-To: <20160606192225.12384-1-artemiyv@acm.org> References: <1458593958-25656-1-git-send-email-artemiyv@acm.org> <20160606192225.12384-1-artemiyv@acm.org> X-IsSubscribed: yes Make gdb DWARF reader understand the DW_TAG_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). gdb/ChangeLog: 2016-06-06 Artemiy Volkov PR gdb/14441 * dwarf2read.c (process_die, read_type_die_1): Handle the DW_TAG_rvalue_reference_type DIE. (read_tag_reference_type): Add new parameter "refcode". --- gdb/dwarf2read.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index d70ecab..55e4777 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -8308,6 +8308,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; @@ -14344,16 +14345,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. */ @@ -14361,7 +14365,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) { @@ -19143,7 +19147,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);