From patchwork Thu Jun 21 09:38:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Hayward X-Patchwork-Id: 27975 Received: (qmail 14907 invoked by alias); 21 Jun 2018 09:38: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 14892 invoked by uid 89); 21 Jun 2018 09:38:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy=ints X-HELO: EUR01-HE1-obe.outbound.protection.outlook.com Received: from mail-he1eur01on0064.outbound.protection.outlook.com (HELO EUR01-HE1-obe.outbound.protection.outlook.com) (104.47.0.64) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 21 Jun 2018 09:38:56 +0000 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Alan.Hayward@arm.com; Received: from C02TF0U7HF1T.manchester.arm.com (217.140.96.140) by AM4PR0802MB2131.eurprd08.prod.outlook.com (2603:10a6:200:5c::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.863.16; Thu, 21 Jun 2018 09:38:52 +0000 From: Alan Hayward To: gdb-patches@sourceware.org Cc: nd@arm.com, Alan Hayward Subject: [PATCH v2 1/3] Use unsigned ints in regcache_map_entry Date: Thu, 21 Jun 2018 10:38:00 +0100 Message-Id: <20180621093802.79342-2-alan.hayward@arm.com> In-Reply-To: <20180621093802.79342-1-alan.hayward@arm.com> References: <20180621093802.79342-1-alan.hayward@arm.com> MIME-Version: 1.0 X-ClientProxiedBy: CWLP265CA0232.GBRP265.PROD.OUTLOOK.COM (2603:10a6:401:4f::28) To AM4PR0802MB2131.eurprd08.prod.outlook.com (2603:10a6:200:5c::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 0a930085-12a4-49a9-2eb3-08d5d75acce7 X-MS-TrafficTypeDiagnostic: AM4PR0802MB2131: NoDisclaimer: True X-Exchange-Antispam-Report-Test: UriScan:(180628864354917); X-MS-Exchange-SenderADCheck: 1 X-Forefront-PRVS: 07106EF9B9 Received-SPF: None (protection.outlook.com: arm.com does not designate permitted sender hosts) SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2018 09:38:52.5823 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0a930085-12a4-49a9-2eb3-08d5d75acce7 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0802MB2131 X-IsSubscribed: yes All current uses of regcache_map_entry use static hard coded values. Update transfer_regset which uses those values. 2018-06-21 Alan Hayward * regcache.c (transfer_regset): Use unsigned ints. * regcache.h (regcache_map_entry): Likewise. --- gdb/regcache.c | 4 ++-- gdb/regcache.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gdb/regcache.c b/gdb/regcache.c index 25436bb456..6276b149a2 100644 --- a/gdb/regcache.c +++ b/gdb/regcache.c @@ -988,14 +988,14 @@ regcache::transfer_regset (const struct regset *regset, void *out_buf, size_t size) const { const struct regcache_map_entry *map; - int offs = 0, count; + unsigned int offs = 0, count; for (map = (const struct regcache_map_entry *) regset->regmap; (count = map->count) != 0; map++) { int regno = map->regno; - int slot_size = map->size; + unsigned int slot_size = map->size; if (slot_size == 0 && regno != REGCACHE_MAP_SKIP) slot_size = m_descr->sizeof_register[regno]; diff --git a/gdb/regcache.h b/gdb/regcache.h index 74ac8583bc..35c41888a7 100644 --- a/gdb/regcache.h +++ b/gdb/regcache.h @@ -83,9 +83,9 @@ extern void regcache_write_pc (struct regcache *regcache, CORE_ADDR pc); struct regcache_map_entry { - int count; + unsigned int count; int regno; - int size; + unsigned int size; }; /* Special value for the 'regno' field in the struct above. */