From patchwork Sun May 5 20:57:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 32563 Received: (qmail 67279 invoked by alias); 5 May 2019 20:57:15 -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 67098 invoked by uid 89); 5 May 2019 20:57:13 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-19.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=value_type, held X-HELO: mail-wm1-f68.google.com Received: from mail-wm1-f68.google.com (HELO mail-wm1-f68.google.com) (209.85.128.68) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 05 May 2019 20:57:12 +0000 Received: by mail-wm1-f68.google.com with SMTP id o25so2223437wmf.2 for ; Sun, 05 May 2019 13:57:12 -0700 (PDT) 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=DqvnR+w5lxmKxDaKlsWID//j/wmI3tiMvsWPOL5BsAM=; b=It6H2phfBGxtsCIdKF4JITFYYH3hk8XFI+0sbt/X3A+fGiW7zCrSGHniZJQ1ZSDMLY Kk2T2SZX0mwAdwYSU6eupo1iot3XYi94Dx9HlIPwUcI2MgSo0sRC5lTYCFlcYeQKW/8P tpaphN3f+FTEMWyjvkgLmzc9NVpijLKj7ffNCG9f40nF/4ElYs+szJnJyjqWF7XESMms /THz1Ii3u/xi/Rjk5cbZBLaNM5BjDrmXh6fkduoDyXS0zE86UgTO5LCsgTmuWxXVW6LV CrfQgkMSJaiHZWkAfMk0szzV1jeD7zzenQlLT+GlojRs1hN2wnlNz8eBljeIGAXLhX/N 2QtQ== Return-Path: Received: from localhost (host109-154-100-57.range109-154.btcentralplus.com. [109.154.100.57]) by smtp.gmail.com with ESMTPSA id k2sm4643724wrg.22.2019.05.05.13.57.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 05 May 2019 13:57:09 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCH 1/3] gdb: Update type of lower bound in value_subscripted_rvalue Date: Sun, 5 May 2019 21:57:00 +0100 Message-Id: In-Reply-To: References: In-Reply-To: References: X-IsSubscribed: yes The dynamic lower (and upper) bounds of ranges are stored as type LONGEST (see union dynamic_prop_data in gdbtypes.h). In most places that range bounds are handled they are held in a LONGEST, however in value_subscripted_rvalue the bound is placed into an int. This commit changes value_subscripted_rvalue to use LONGEST, there should be no user visible changes after this commit. gdb/ChangeLog: * valarith.c (value_subscripted_rvalue): Change lowerbound parameter type from int to LONGEST. * value.h (value_subscripted_rvalue): Likewise in declaration. --- gdb/ChangeLog | 6 ++++++ gdb/valarith.c | 2 +- gdb/value.h | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/gdb/valarith.c b/gdb/valarith.c index 8d310b504a2..f4372123e67 100644 --- a/gdb/valarith.c +++ b/gdb/valarith.c @@ -182,7 +182,7 @@ value_subscript (struct value *array, LONGEST index) to doubles, but no longer does. */ struct value * -value_subscripted_rvalue (struct value *array, LONGEST index, int lowerbound) +value_subscripted_rvalue (struct value *array, LONGEST index, LONGEST lowerbound) { struct type *array_type = check_typedef (value_type (array)); struct type *elt_type = check_typedef (TYPE_TARGET_TYPE (array_type)); diff --git a/gdb/value.h b/gdb/value.h index 0756d13b6d7..d505dc9af06 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -1149,7 +1149,8 @@ extern struct value *find_function_in_inferior (const char *, extern struct value *value_allocate_space_in_inferior (int); extern struct value *value_subscripted_rvalue (struct value *array, - LONGEST index, int lowerbound); + LONGEST index, + LONGEST lowerbound); /* User function handler. */