From patchwork Mon Jun 5 16:27:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alan Hayward X-Patchwork-Id: 20804 Received: (qmail 125773 invoked by alias); 5 Jun 2017 16:27:58 -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 125760 invoked by uid 89); 5 Jun 2017 16:27:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-23.3 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, UNWANTED_LANGUAGE_BODY autolearn=ham version=3.3.2 spammy= X-HELO: EUR01-VE1-obe.outbound.protection.outlook.com Received: from mail-ve1eur01on0057.outbound.protection.outlook.com (HELO EUR01-VE1-obe.outbound.protection.outlook.com) (104.47.1.57) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 05 Jun 2017 16:27:56 +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.1143.10; Mon, 5 Jun 2017 16:27:57 +0000 Received: from AM3PR08MB0101.eurprd08.prod.outlook.com ([fe80::f0a8:fd0f:69e1:e280]) by AM3PR08MB0101.eurprd08.prod.outlook.com ([fe80::f0a8:fd0f:69e1:e280%17]) with mapi id 15.01.1143.018; Mon, 5 Jun 2017 16:27:57 +0000 From: Alan Hayward To: Yao Qi CC: "gdb-patches@sourceware.org" , nd Subject: Re: [PATCH 2/11] Add IA64_MAX_REGISTER_SIZE Date: Mon, 5 Jun 2017 16:27:57 +0000 Message-ID: <79E51549-1B65-4DA8-891A-17EF061E03A3@arm.com> References: <8637dnqils.fsf@gmail.com> <90F5717F-8685-4C74-B2E4-7317AF228034@arm.com> <86pogivp7m.fsf@gmail.com> <0CAAE3E4-1860-40FF-895E-6C6A54A4EAB6@arm.com> <86vapsqxld.fsf@gmail.com> <498D342A-2994-4664-968D-F97A80C66059@arm.com> <86mvb2p32v.fsf@gmail.com> In-Reply-To: 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:GR93XwXNdM3rFAdX30KqwJKH2AAziaSAc/GJDuaP8gIB5jJJ55n81YQ+5opsNxdAoKhhlcxKd5OUqamEIgyLTecdRonG9uQ25bKWW3meP6BMNDp+zmwaz0DLLzzVANgl/aqLw8mpNy2S0U2QwdgKR1BpUvozACKz4wsWbYG8bqDsuRdwnqPx6zMePIr5exBqSa+PzF0cYNpFfbf1RhVnZbZR+pPLHPV4nTNQfQMU2UaNqIUbfQEs8puWBip6cHmPNSYfiExsIHPpXPgMrQb861EsdEVfYJwGhah1l8yvCVULv3DBUUxvHfZnE0hEMPSJGq86lT+10q4R1/eruNZE/g== x-ms-traffictypediagnostic: AM3PR08MB0101: x-ms-office365-filtering-correlation-id: dce9ff8c-3cf5-4a45-ef16-08d4ac2fd336 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(48565401081)(201703131423075)(201703031133081)(201702281549075); SRVR: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)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(100000703101)(100105400095)(6055026)(6041248)(201703131423075)(201703011903075)(201702281528075)(201703061421075)(20161123555025)(20161123562025)(20161123558100)(20161123560025)(20161123564025)(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: 0329B15C8A x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(39410400002)(39450400003)(39850400002)(39860400002)(39400400002)(39840400002)(24454002)(377424004)(6246003)(50986999)(76176999)(5660300001)(3846002)(2950100002)(6116002)(86362001)(6916009)(575784001)(93886004)(102836003)(189998001)(6512007)(305945005)(54906002)(4326008)(38730400002)(53936002)(110136004)(54356999)(33656002)(39060400002)(7736002)(99286003)(25786009)(229853002)(6486002)(72206003)(36756003)(6506006)(1411001)(5250100002)(3660700001)(14454004)(3280700002)(508600001)(66066001)(2906002)(6436002)(8676002)(53546009)(2900100001)(82746002)(83716003)(8936002)(81166006)(15760500002); 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: <96D1EABA0352594C9472DB20B81D9E54@eurprd08.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Jun 2017 16:27:57.1240 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM3PR08MB0101 > On 27 Apr 2017, at 11:48, Alan Hayward wrote: > >> >> On 27 Apr 2017, at 11:17, Yao Qi wrote: >> >> Alan Hayward writes: >> I’ve rebased this patch due to Yao’s unit test changes. I don't have an IA64 machine to test on. Faked up a libunwind in order to build libunwind code. Tested on a --enable-targets=all and --enable-libsanitizer build using make check with board files unix and native-gdbserver. Ok to commit? Alan. 2017-06-05 Alan Hayward * ia64-tdep.c (IA64_MAX_FP_REGISTER_SIZE) Add. (ia64_register_to_value): Use IA64_MAX_FP_REGISTER_SIZE. (ia64_value_to_register): Likewise. (ia64_extract_return_value): Likewise. (ia64_store_return_value): Likewise. (ia64_push_dummy_call): Likewise. diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c index 7282acb20ac2c25e7f2c48fec3106300c385679f..d396fb81a62b0c2522900fd9cb0980aa2a5fb767 100644 --- a/gdb/ia64-tdep.c +++ b/gdb/ia64-tdep.c @@ -125,6 +125,9 @@ static CORE_ADDR ia64_find_global_pointer (struct gdbarch *gdbarch, #define NUM_IA64_RAW_REGS 462 +/* Big enough to hold a FP register in bytes. */ +#define IA64_FP_REGISTER_SIZE 16 + static int sp_regnum = IA64_GR12_REGNUM; /* NOTE: we treat the register stack registers r32-r127 as @@ -1228,7 +1231,7 @@ ia64_register_to_value (struct frame_info *frame, int regnum, int *optimizedp, int *unavailablep) { struct gdbarch *gdbarch = get_frame_arch (frame); - gdb_byte in[MAX_REGISTER_SIZE]; + gdb_byte in[IA64_FP_REGISTER_SIZE]; /* Convert to TYPE. */ if (!get_frame_register_bytes (frame, regnum, 0, @@ -1246,7 +1249,7 @@ ia64_value_to_register (struct frame_info *frame, int regnum, struct type *valtype, const gdb_byte *in) { struct gdbarch *gdbarch = get_frame_arch (frame); - gdb_byte out[MAX_REGISTER_SIZE]; + gdb_byte out[IA64_FP_REGISTER_SIZE]; convert_typed_floating (in, valtype, out, ia64_ext_type (gdbarch)); put_frame_register (frame, regnum, out); } @@ -3209,7 +3212,7 @@ ia64_extract_return_value (struct type *type, struct regcache *regcache, float_elt_type = is_float_or_hfa_type (type); if (float_elt_type != NULL) { - gdb_byte from[MAX_REGISTER_SIZE]; + gdb_byte from[IA64_FP_REGISTER_SIZE]; int offset = 0; int regnum = IA64_FR8_REGNUM; int n = TYPE_LENGTH (type) / TYPE_LENGTH (float_elt_type); @@ -3274,7 +3277,7 @@ ia64_store_return_value (struct type *type, struct regcache *regcache, float_elt_type = is_float_or_hfa_type (type); if (float_elt_type != NULL) { - gdb_byte to[MAX_REGISTER_SIZE]; + gdb_byte to[IA64_FP_REGISTER_SIZE]; int offset = 0; int regnum = IA64_FR8_REGNUM; int n = TYPE_LENGTH (type) / TYPE_LENGTH (float_elt_type); @@ -3836,7 +3839,7 @@ ia64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, len = TYPE_LENGTH (type); while (len > 0 && floatreg < IA64_FR16_REGNUM) { - gdb_byte to[MAX_REGISTER_SIZE]; + gdb_byte to[IA64_FP_REGISTER_SIZE]; convert_typed_floating (value_contents (arg) + argoffset, float_elt_type, to, ia64_ext_type (gdbarch));