From patchwork Thu May 9 22:22:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 32623 Received: (qmail 26322 invoked by alias); 9 May 2019 22:22:25 -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 26274 invoked by uid 89); 9 May 2019 22:22:24 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.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=11498, lowerbound, UD:gdbtypes.h, gdbtypesh X-HELO: mail-wr1-f53.google.com Received: from mail-wr1-f53.google.com (HELO mail-wr1-f53.google.com) (209.85.221.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 09 May 2019 22:22:23 +0000 Received: by mail-wr1-f53.google.com with SMTP id v11so5125773wru.5 for ; Thu, 09 May 2019 15:22:23 -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=UiGgi/xbPAaGfmogKeF2q+0YwIabdH7hbspjNAsL3jbyPXMFcQHodz/XGYFPHyG92U WLkVSg1MNXydQ2KE6FxBTCMzjX1OJ1RwZPPhTUftsd0CkqRY2sJjqdGPiu1ljNTubXUY ByH23bLI0ZWKb1oMhRUuU2OP9MEYmpYdO+5TESRbdRsIbi7SJ5G9xRTfZp7JP0G/DQsA kgG4iz7TyCt/nafGIL9+n0FJuGmS1Ni/PRm8km+pnaAyqY6DnC5oQOK3laq52+uHBUiZ W9Ci/7jLecudoUq2x5lfgqysVEs3ktTAEpyTbj2Oz+HwAUxOTM88kBvFl9fAkUfuRQqQ gqbA== Return-Path: Received: from localhost (host109-154-100-57.range109-154.btcentralplus.com. [109.154.100.57]) by smtp.gmail.com with ESMTPSA id z5sm9793932wre.70.2019.05.09.15.22.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 May 2019 15:22:20 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCHv2 1/5] gdb: Update type of lower bound in value_subscripted_rvalue Date: Thu, 9 May 2019 23:22:12 +0100 Message-Id: <02c025ff922b72df0a820b2ab56524073dce625b.1557439866.git.andrew.burgess@embecosm.com> 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. */