From patchwork Wed Mar 6 18:15:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 31747 Received: (qmail 36295 invoked by alias); 6 Mar 2019 18:15:59 -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 35986 invoked by uid 89); 6 Mar 2019 18:15:57 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.2 required=5.0 tests=BAYES_00, DNS_FROM_AHBL_RHSBL, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS, TIME_LIMIT_EXCEEDED autolearn=unavailable version=3.3.1 spammy= X-HELO: mail-wr1-f43.google.com Received: from mail-wr1-f43.google.com (HELO mail-wr1-f43.google.com) (209.85.221.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 06 Mar 2019 18:15:27 +0000 Received: by mail-wr1-f43.google.com with SMTP id t18so14527273wrx.2 for ; Wed, 06 Mar 2019 10:15:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=z47dGN2/LlnsANm1gLR7r6WFTH2XyxSx2oenhN86gFo=; b=gl64fx3N4acQLxdphuG0vFKwUG8h/tRKHxi58Y144QL2a6VmEt3yFw6EXsADaNfPvp Zv+OlTwtL3QDwz/JRsQalCpE1LRBojzGa8G6rpntC2vIoBmQy4hdv/+NOQwNWUgJfaE/ 8BEBQLdlXLZeASou585J4KM8yxFXA2jHgSmRmWOc+Zh1yuOwluIfe4ieXFTT+2C4fdDv +0bFJsrAp6fB0wtL2jqQDk6zqIBJqep69ZPX/H8s3W6c5kW7vz8JsAM2KG1jDWHSOn/f EwnF4+QkxqzoNKANmXWu/Z5Dcu0q2gXNJrPpIrw5HcgClm2vq+ah5sOeE/w+9mSgrRPE TOng== Return-Path: Received: from localhost (host86-142-70-198.range86-142.btcentralplus.com. [86.142.70.198]) by smtp.gmail.com with ESMTPSA id d2sm3919849wrq.94.2019.03.06.10.15.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Mar 2019 10:15:20 -0800 (PST) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PUSHED 08/11] gdb/fortran: Add builtin 8-byte integer type with (kind=8) support Date: Wed, 6 Mar 2019 18:15:01 +0000 Message-Id: <36471cc72cd087daf4eff62b4ab26213917fac2c.1551895529.git.andrew.burgess@embecosm.com> In-Reply-To: References: In-Reply-To: References: X-IsSubscribed: yes Add a new builtin type, an 8-byte integer, and allow GDB to parse 'integer (kind=8)', returning the new 8-byte integer. gdb/ChangeLog: * f-exp.y (convert_to_kind_type): Handle integer (kind=8). * f-lang.c (build_fortran_types): Setup builtin_integer_s8. * f-lang.h (struct builtin_f_type): Add builtin_integer_s8 field. gdb/testsuite/ChangeLog: * gdb.fortran/type-kinds.exp: Test new integer type kind. --- gdb/ChangeLog | 6 ++++++ gdb/f-exp.y | 2 ++ gdb/f-lang.c | 4 ++++ gdb/f-lang.h | 1 + gdb/testsuite/ChangeLog | 4 ++++ gdb/testsuite/gdb.fortran/type-kinds.exp | 1 + 6 files changed, 18 insertions(+) diff --git a/gdb/f-exp.y b/gdb/f-exp.y index 980ee4b4adb..d256ff14c1e 100644 --- a/gdb/f-exp.y +++ b/gdb/f-exp.y @@ -865,6 +865,8 @@ convert_to_kind_type (struct type *basetype, int kind) return parse_f_type (pstate)->builtin_integer_s2; else if (kind == 4) return parse_f_type (pstate)->builtin_integer; + else if (kind == 8) + return parse_f_type (pstate)->builtin_integer_s8; } error (_("unsupported kind %d for type %s"), diff --git a/gdb/f-lang.c b/gdb/f-lang.c index 34ebfd9de6b..f27eb0d45da 100644 --- a/gdb/f-lang.c +++ b/gdb/f-lang.c @@ -375,6 +375,10 @@ build_fortran_types (struct gdbarch *gdbarch) = arch_integer_type (gdbarch, gdbarch_short_bit (gdbarch), 0, "integer*2"); + builtin_f_type->builtin_integer_s8 + = arch_integer_type (gdbarch, gdbarch_long_long_bit (gdbarch), 0, + "integer*8"); + builtin_f_type->builtin_logical_s2 = arch_boolean_type (gdbarch, gdbarch_short_bit (gdbarch), 1, "logical*2"); diff --git a/gdb/f-lang.h b/gdb/f-lang.h index 5afafb1a051..746c11fd9f1 100644 --- a/gdb/f-lang.h +++ b/gdb/f-lang.h @@ -66,6 +66,7 @@ struct builtin_f_type struct type *builtin_character; struct type *builtin_integer; struct type *builtin_integer_s2; + struct type *builtin_integer_s8; struct type *builtin_logical; struct type *builtin_logical_s1; struct type *builtin_logical_s2; diff --git a/gdb/testsuite/gdb.fortran/type-kinds.exp b/gdb/testsuite/gdb.fortran/type-kinds.exp index c679bc504f9..198ac58baf4 100644 --- a/gdb/testsuite/gdb.fortran/type-kinds.exp +++ b/gdb/testsuite/gdb.fortran/type-kinds.exp @@ -54,6 +54,7 @@ proc test_basic_parsing_of_type_kinds {} { test_cast_1_to_type_kind "integer" "2" "1" "2" test_cast_1_to_type_kind "integer" "4" "1" "4" + test_cast_1_to_type_kind "integer" "8" "1" "8" } proc test_parsing_invalid_type_kinds {} {