From patchwork Wed Jun 21 09:35:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alan Hayward X-Patchwork-Id: 21162 Received: (qmail 51461 invoked by alias); 21 Jun 2017 09:36: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 51451 invoked by uid 89); 21 Jun 2017 09:35:59 -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, MIME_BASE64_BLANKS, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy=HTo:D*cadence.com, Maxim, maxim X-HELO: EUR02-AM5-obe.outbound.protection.outlook.com Received: from mail-eopbgr00050.outbound.protection.outlook.com (HELO EUR02-AM5-obe.outbound.protection.outlook.com) (40.107.0.50) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 21 Jun 2017 09:35:57 +0000 Received: from AM3PR08MB0101.eurprd08.prod.outlook.com (10.160.211.19) by AM3PR08MB0101.eurprd08.prod.outlook.com (10.160.211.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1178.14; Wed, 21 Jun 2017 09:35:54 +0000 Received: from AM3PR08MB0101.eurprd08.prod.outlook.com ([fe80::9063:8caa:1bc4:156f]) by AM3PR08MB0101.eurprd08.prod.outlook.com ([fe80::9063:8caa:1bc4:156f%14]) with mapi id 15.01.1178.023; Wed, 21 Jun 2017 09:35:54 +0000 From: Alan Hayward To: Yao Qi , "jcmvbkbc@gmail.com" , "larue@cadence.com" CC: "maxim2405@gmail.com" , "gdb-patches@sourceware.org" , nd Subject: Re: [PATCH 10/11] Add XTENSA_MAX_REGISTER_SIZE Date: Wed, 21 Jun 2017 09:35:54 +0000 Message-ID: <634078F3-1AE6-458C-8184-549175C95BB7@arm.com> References: <86y3vfp308.fsf@gmail.com> <868tmosdi0.fsf@gmail.com> <49176F63-F5C5-43C2-A21D-A7642F4ACB80@arm.com> <3966B257-0F47-49C3-A1C1-F901D8E731AC@arm.com> <86h8zla5ui.fsf@gmail.com> In-Reply-To: <86h8zla5ui.fsf@gmail.com> authentication-results: gmail.com; dkim=none (message not signed) header.d=none; gmail.com; dmarc=none action=none header.from=arm.com; x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM3PR08MB0101; 7:/DVgeYAT4aQnUfnxkrJ/yTcCDA4kGGt55dfMBiP139El2eaZw6JROgIrSYD/EQZlqVbegSVj1I2iYPA2qA6Ayq7nr8zM0ADbNfPCJmJTBmA9KZNcP+ph4+UL+VtXuHZO+yAOjpR2oahOv3sPb92d3mxU0JJxknH5b669/WWgbImBisaKakcIWtUZmIoKkmWrlgDkwbg6K8w7CuC/aplpjgsz1ftdtnZAPcGom7EtVhCKNC616747FwXQPw8cFyz623ex6k8TH8FlOkTs6ooTxnKosLg+vOB6ed1EF6yAE5oztAFtHpNXCcA5yvwrJpcQEvh0h09JfipkpUMpGR1fUOV2b0h6Ga3eAZWI/e/izTg6Lf9VUKuN6qRcD6+l0CZcgJ+Vv+mUJaQSRj/rBcbp2ctXXmI5qBBkAmAPRT39TV4dgNhH3joCOsbDLNg413f46TsuQOmpa7kxYEPJ+UudVAH3uj+XJ0SEet3PPRUomszuqfd3zxPGKlrM+tI/cK1VHxS25Fu0qPNZlYYThpkuZerUrP72AeIpWLWw2wl+eANIQZ9OJ5zhD1SMuwSjRugtSABOE0ik+R5x6OsO0zqJIOvkzGh9hipdYXyE2ohNCqS/sBEZpyp7sjLkPr8u4RtLy+9FS4jyP72VAOcGE3BVNKDQiXQjpjVv2jL9zHfiWbiwku7c0ZRqvZG0VOzyUL5bI6+seq8U9F8QhdCRXmCh0TVxurnKERK5UraebXiEzjBboS17x4rAT6P0byeh2I1Y4sNTqLdT7l4d0lEDon/C4GUl4TjUEm41T4371xMDULo= x-ms-office365-filtering-correlation-id: b28006b8-c47f-4c0c-810f-08d4b888e9ba x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(48565401081)(201703131423075)(201703031133081)(201702281549075); SRVR:AM3PR08MB0101; x-ms-traffictypediagnostic: AM3PR08MB0101: nodisclaimer: True x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(180628864354917); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(10201501046)(3002001)(93006095)(93001095)(6055026)(6041248)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123558100)(20161123564025)(20161123562025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:AM3PR08MB0101; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:AM3PR08MB0101; x-forefront-prvs: 0345CFD558 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(39410400002)(39400400002)(39850400002)(39450400003)(39840400002)(39860400002)(76104003)(24454002)(377424004)(66066001)(7736002)(36756003)(6486002)(229853002)(478600001)(2950100002)(72206003)(2906002)(3660700001)(86362001)(3280700002)(14454004)(3846002)(81166006)(8936002)(4326008)(99286003)(189998001)(2501003)(6506006)(8666007)(8676002)(54906002)(6512007)(39060400002)(25786009)(5660300001)(102836003)(6116002)(305945005)(2900100001)(82746002)(6436002)(38730400002)(33656002)(5250100002)(6246003)(50986999)(83716003)(93886004)(2201001)(54356999)(76176999)(53936002)(53546010); DIR:OUT; SFP:1101; SCL:1; SRVR:AM3PR08MB0101; H:AM3PR08MB0101.eurprd08.prod.outlook.com; FPR:; SPF:None; MLV:ovrnspm; PTR:InfoNoRecords; LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-ID: <259B1D1F64548B40909CE95691924576@eurprd08.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jun 2017 09:35:54.1365 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM3PR08MB0101 X-IsSubscribed: yes Adding Woody and Max, the xtensa maintainers. Patch is to remove uses of MAX_REGISTER_SIZE in xtensa-tdep.c Re-pasted patch to end of email for convenience. > On 12 Jun 2017, at 10:54, Yao Qi wrote: > > Alan Hayward writes: > >> I don't have a XTENSA machine to test on. >> Tested on a --enable-targets=all and asan build using >> make check with board files unix, native-gdbserver and unittest >> >> Ok to commit? >> >> Alan. >> >> 2017-06-08 Alan Hayward >> >> * xtensa-tdep.c (XTENSA_MAX_REGISTER_SIZE): Add. >> (xtensa_register_write_masked): Use XTENSA_MAX_REGISTER_SIZE. >> (xtensa_register_read_masked): Likewise. > > Hi Maxim, > What do you think about this patch? > > -- > Yao (齐尧) diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c index f9e858473a409ff082d30f9ff474d48da63903e3..f875f20d32b68abc37e3db37ab3e6053918536e5 100644 --- a/gdb/xtensa-tdep.c +++ b/gdb/xtensa-tdep.c @@ -120,6 +120,9 @@ static unsigned int xtensa_debug_level = 0; #define PS_WOE (1<<18) #define PS_EXC (1<<4) +/* Big enough to hold the size of the largest register in bytes. */ +#define XTENSA_MAX_REGISTER_SIZE 64 + static int windowing_enabled (struct gdbarch *gdbarch, unsigned int ps) { @@ -370,7 +373,7 @@ static void xtensa_register_write_masked (struct regcache *regcache, xtensa_register_t *reg, const gdb_byte *buffer) { - unsigned int value[(MAX_REGISTER_SIZE + 3) / 4]; + unsigned int value[(XTENSA_MAX_REGISTER_SIZE + 3) / 4]; const xtensa_mask_t *mask = reg->mask; int shift = 0; /* Shift for next mask (mod 32). */ @@ -454,7 +457,7 @@ static enum register_status xtensa_register_read_masked (struct regcache *regcache, xtensa_register_t *reg, gdb_byte *buffer) { - unsigned int value[(MAX_REGISTER_SIZE + 3) / 4]; + unsigned int value[(XTENSA_MAX_REGISTER_SIZE + 3) / 4]; const xtensa_mask_t *mask = reg->mask; int shift = 0;