From patchwork Wed May 30 19:03:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 27571 Received: (qmail 38952 invoked by alias); 30 May 2018 19:04:45 -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 38904 invoked by uid 89); 30 May 2018 19:04:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.2 spammy=arise, fake X-HELO: sessmg22.ericsson.net Received: from sessmg22.ericsson.net (HELO sessmg22.ericsson.net) (193.180.251.58) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 30 May 2018 19:04:34 +0000 Received: from ESESSHC007.ericsson.se (Unknown_Domain [153.88.183.39]) by sessmg22.ericsson.net (Symantec Mail Security) with SMTP id 8F.66.24558.FB5FE0B5; Wed, 30 May 2018 21:04:31 +0200 (CEST) Received: from ESESBMB505.ericsson.se (153.88.183.172) by ESESSHC007.ericsson.se (153.88.183.39) with Microsoft SMTP Server (TLS) id 14.3.382.0; Wed, 30 May 2018 21:04:30 +0200 Received: from ESESBMB505.ericsson.se (153.88.183.172) by ESESBMB505.ericsson.se (153.88.183.172) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Wed, 30 May 2018 21:04:30 +0200 Received: from NAM02-CY1-obe.outbound.protection.outlook.com (153.88.183.157) by ESESBMB505.ericsson.se (153.88.183.172) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3 via Frontend Transport; Wed, 30 May 2018 21:04:29 +0200 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=simon.marchi@ericsson.com; Received: from elxacz23q12.ca.am.ericsson.se (192.75.88.130) by BYAPR15MB2392.namprd15.prod.outlook.com (2603:10b6:a02:8d::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.797.11; Wed, 30 May 2018 19:04:26 +0000 From: Simon Marchi To: CC: Simon Marchi Subject: [pushed 10/15] Remove regcache_cooked_write Date: Wed, 30 May 2018 15:03:48 -0400 Message-ID: <1527707033-27183-11-git-send-email-simon.marchi@ericsson.com> In-Reply-To: <1527707033-27183-1-git-send-email-simon.marchi@ericsson.com> References: <1527707033-27183-1-git-send-email-simon.marchi@ericsson.com> MIME-Version: 1.0 X-ClientProxiedBy: SN6PR0102CA0010.prod.exchangelabs.com (2603:10b6:805:1::23) To BYAPR15MB2392.namprd15.prod.outlook.com (2603:10b6:a02:8d::11) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:BYAPR15MB2392; X-Microsoft-Exchange-Diagnostics: 1; BYAPR15MB2392; 3:WaSnzCpADSiMVgXo/BF43/MbAEjhiLzG1lZqpCUIWoFNcwVZjO1eEROqSi51+eQmtMUOATpX1z+bxhphlmzjoUf074mG37Zrx9tqQYb3YprlVWSAFITLNrhSoh6azwpwrvNFKGupbnDYJ4Lx+c59+yzh5LLQUJQQ4/yKQ+vcy+RZldneVnXpfzH02W9Zl08nLoRVWP4Ok8V1gO1EZyA21DxwQ+U58DeSmyv071a0aQe2K6cGpNjQvwVYdjQvYx+g; 25:/2a7+L14YS8sohw03V7DRuFnBwlnarjqXbWGcuL3qRvr68M2lGCHnkD9fhkzlQDaFUJ+qMjL7ydSm8afgmSfubceMvkbO8HQoUfJOoOMHiysQbX2nZQE13SykoWy7Yl9T2taUnqp/M0Gkf6E6C663tiSVMb5acU79+/c2Ir+63RkLDEp3Ripw5sBJPEJfSkgF8JAZ+qPWsulOTLPtTms+ENk6lNFW66NoSRcLnIV4/ZgRZJ3PdqSwK2SRRXoUbsYEzgvVc+RbHcQR+ajLG+pCMAS7MbqLiyRXJP/Vkbfp5eONm1bO/Qf5xUGYZ4KSOMOq/LQzkyPxoItb7YD3sNAvw==; 31:JL9pE7ZrRnHXn2P4HIIELAplHHG7MQP6GrGYAQCXNlKjHz80oHuVjTJzs/GTsExrp3GOkIuwV4yRdv98aIkY7fUzk0BlITiOYy6wcK8e/k2TQ0N61rAonu94fp2BNNwYBLJgeIRUDuJ3uPvuy2Uo/mFIrByIz1MuHPWeWdhu+j0paN50xsmqgJ7S1bMQ/n8goGsEnkTVMbj2x6cp02Ket8XOmsqjAhCFzWVT0dCrec4= X-MS-TrafficTypeDiagnostic: BYAPR15MB2392: X-Microsoft-Exchange-Diagnostics: 1; BYAPR15MB2392; 20:1VlVD/u5uDBuMFv/P+sdFtqQ5XF/mGKPfuHUin03pIvhwxTkWKSFdSHzwwNoJHR/uNDtTDdK4rGRmrF2TgtP9F6O41CJCFSAAK+HATPnpMCStilOzQ9he7vDE56MebagKaEJZ8yLKDJav6i9FOHR640txF6zVI8qeQpvMUNHJlnj+iIDWHF8KlyvcxTuxY12k3ni4DOtYZCyrmEku/+Wi7BjHSjv7QeP6AUDVMjUuAY1K5qKvQSvRS+SGWFEQvcAVsL7Ekan6CmhIJcFjhBuE1R1Jy+6AmSeH2F6pjD4qJ9XtF9EbigxFxj5UAsyryBV2gvUV93y0Nf1G8D53kDnIXgsM8z+ePG/wUWkbwePUSs1ccp7lOUVmKaAvzw+HMdAOsKkQ+TMXy/MyGD63kQG/xr/GuGadM08jRafwcF54aAvLt4Zr9Kfdub+WVZ8oZk86B0d5Rb9Qv3VgNfDj2WHUr35570dnTEbda7yQJh7vIKOKKtuwbIOfBrPgp7E/5fL; 4:FdP7D+4ba6NeWqbXbGrRwe4XJyQ2ci4lrlHB8vgg1pUIRcx8BDzTNv3gi91EBxxel5MzfseX9I86Oul8shhuULoU/dU4lptXGKdxwYPXuknLP9Mn3ncFc2F9XZx9dxZViJhBddTlqLK8DbY5Q/QKR13RVrHaDGYGOuYNssiK1/NFGyw5gqqtpJbQ8PBN0Z1Jn8USGpFhc271lgZBTvqfXTTXIxsK68D2y9271ssp+Nj+7MdUvI6foi0I/brEsl9oJarpgcPkRzy3LFq356LVERwlpAjpOBdqATohQteHtTZv30oFkR8sgXmb5kwtLUnm X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(37575265505322); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3231254)(944501410)(52105095)(3002001)(93006095)(93001095)(149027)(150027)(6041310)(20161123562045)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:BYAPR15MB2392; BCL:0; PCL:0; RULEID:; SRVR:BYAPR15MB2392; X-Forefront-PRVS: 0688BF9B46 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(346002)(366004)(39860400002)(39380400002)(376002)(57704003)(54534003)(199004)(189003)(50226002)(6512007)(486006)(8936002)(81156014)(6486002)(25786009)(26005)(68736007)(8676002)(81166006)(51416003)(86362001)(575784001)(52116002)(956004)(2616005)(44832011)(76176011)(476003)(53946003)(446003)(11346002)(6666003)(6916009)(305945005)(386003)(6506007)(47776003)(53936002)(2906002)(36756003)(7736002)(16200700003)(97736004)(4326008)(16526019)(5660300001)(186003)(6116002)(3846002)(316002)(16586007)(2361001)(2351001)(48376002)(478600001)(105586002)(59450400001)(107886003)(50466002)(66066001)(106356001)(569006); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR15MB2392; H:elxacz23q12.ca.am.ericsson.se; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: ericsson.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BYAPR15MB2392; 23:z/2pdIAPnG5FLYvsQMko84tgZiEPaZmgIlfocrCGc?= =?us-ascii?Q?oRW8NRbMYrAsR2lcTo9gh0njORLjd8liPdlT87nxr66BQqnHaS7x6bnd6kSp?= =?us-ascii?Q?Yv0Z8SIYZVCeNuUQQDdpeft9u5tqjyOMdczhi+xcuKG7RLSq2dw3sI7zdzFL?= =?us-ascii?Q?nnK+hoJqe36Md2c4BXeLTI2hp0HuG/JPkJYjXBbVmQhRlXwZm7+kMvTWL3rC?= =?us-ascii?Q?ipXSUrM8zvK9sQSz0Me6Bs/c0f8n/zmowqEn97cqzc2N5LR4H6eMhBaLcnbT?= =?us-ascii?Q?vPDAFccfLaBmHF5vJjNQrzARZ/u5kPyxZruA0dzcR1AqbUtfvhpxSsg++Xmf?= =?us-ascii?Q?cVXQ4b/34rSHkGwaXVnM/KaDLUiDBtGBQpGHXvfHyzaUyIO56O4ePRaD4zIV?= =?us-ascii?Q?hTWR0HpascyO7s5bqwEGThKM37XjLeoL86TMy8RkaX73BPrsRso7NcjdAK2W?= =?us-ascii?Q?H/uFGQ6BYOU+nT0pXtEehNUOTvBbvARlSZgSIqhWwslv4GbrCRW5pYaMdSfh?= =?us-ascii?Q?TG8yUlD1Ja1zLe0Bp5GcLO1fXSIzznGh0llbyAUnbv0SiRTrupcZAhWBrWuW?= =?us-ascii?Q?U6TVlVsWnw+M18mLvfRdOC6qDF7Ro2o2DV1YBrLLpTfqijt5wsH8Gd433G/6?= =?us-ascii?Q?DGrhuEbzHw0e+GNaHxeUmBUA6s+15qpwAeX/NjB3dKBGBEr0USumtrykA0Mw?= =?us-ascii?Q?81MU9H70CM8tL/cT6BFJdHJpKpDIX/2TNcymobYACo+TfPNxZCrvXDQR1Pa9?= =?us-ascii?Q?v4bdG4iKsDofvc6uZA8UdY13ACWTbaI2ad4KPKFLrIeb5Rzaln6/mjlVfSoM?= =?us-ascii?Q?Clmz2yQlqOmnJMQdbjN0tEPJQFSe+v++8RrWshuZdvhUXpO8xIHit4i8HN54?= =?us-ascii?Q?1ZaG39KOqo+viVn9myqLFzR11lJb5H5XDxGpUViDQkQ85o2ady+6q0BYMVjj?= =?us-ascii?Q?0wyQyAqtFhny+vfsZYJLnQ1huZrSV8+yWyonLeUF0RVtfS6Ay4sTGDvGkhwm?= =?us-ascii?Q?5sQUZhUccqY/JgLM4627Oer7pNEd6VitlP902hvKyP3hjHjV/DBQChmfyspa?= =?us-ascii?Q?iVQqP/xrzToyfctcyv9vn97OsnXJD4tcAko7N5vPpIPf6MqTq5LW44Wa2cS4?= =?us-ascii?Q?LmN54cXSZM6WU0d8PI+FwnoaHM3420+YvtFJmZKZkts+/E/l66X20IYhtMD3?= =?us-ascii?Q?yDkPBQ0eBrGczaha9wdbvYse86zRZDEFKgu1YJJ8oiW0h/E9Bv70z/npJKd9?= =?us-ascii?Q?OymV0H5piHCXc2YBVuqJsHdHk+o3wzp2t04uYsYMvm8fU/5l503gjrAFEY5Z?= =?us-ascii?Q?kkF38wAt45QOmicx1yRG2rgOTE84B4mjXDwzH4QVEzeybxlA3P7YzL8xYjAI?= =?us-ascii?Q?EI+YxU80/GhbfrIa6uA/XJsIT0McafW7+DMPEAEG4B2GZzvR8X+Eqquxqn3c?= =?us-ascii?Q?0g1dF0Pag=3D=3D?= X-Microsoft-Antispam-Message-Info: 2WCo0v7TXtnWoTGgMGS12l0eTfCWPX980JcYkKa2yhQVGdo2D6OG4xGGDtasLiuM72FcdU1AZ+MXAMXzeZlJlLRCrLV6RBVE+61JT1E8eFoRKP0DbB8FwYiV8LMO1Vh70v/T21BCNgjm+2yZIX8Hupu1sTBg/mL//fvkFci0zA6g0pHnBithedFL6jCYwFqr X-Microsoft-Exchange-Diagnostics: 1; BYAPR15MB2392; 6:074WZM4RzK8jQiiCrp2MmXOK/Nf274vR44FadLQptUFeZD4P0s44xUW4I2mrJoVdR8ODiYbuvnA3aaW9CrOsfCCpbi17WQ/fzmGUzEAnGQrRco6brtVf56HcWt8bEeoc98J5Wk8BaP0/7KZNSqkThoBpQ59wxruPRjE43Nz2tNQPIXciwnOM6XHKAYY9d7ZU7c5tpZaX/MzHPYDlUHkFM2AgGbMDs65sJb2w9h3JN+9VMaEocEQSQdyjaM0uG2dVXe1W+1nFJooyY0PO5O6ydqZ1dpLqhs05u9H3JSo1Q5YD5eCXTYhCYKbBUDoP6zQnm6VjVgB9FQJQ6z/+QYp+FGLluvZcQmxlYD78ADozNMuBrNQz5NBuBZnCHswy4oKFnk/Q9CxRgWDeuvk2EuUIoM8W+ZcTyBqgZB/AWZ1ACbAw1LR7I4+CEL90SuiDHKHpil3FZJruW4ZhFP+BSG4duQ==; 5:bV4QY99LPtK5E8AYucp6up0EdnaAtFpxebqmo6yHvVOOJ5BOuATRAd2wK4Uu6jQl20bcWZTbLUp1pXCInDTMrSRe8mWyvxnxm7HQDZ99agLlY5q8QPEWuG0FOZVDVb4eP+wGC9MqYZH9zvgmEwKYyXemvQLBfqev+Vv5rx1KKy0=; 24:FBaLNP75hyTNntq9ildcV/jE11xq8jDCYuXi2HRMVrYeA/Kog9VeIOD+mTdROy6lj3GmCcyN8Hqn8qdJkUn2wkMc7pScxg5iKeIbknaOsz8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BYAPR15MB2392; 7:2NRS1pz1wSxd8YgG7+EQESjJZ/KvkStypF+GRZU9rnnTiWo0m7gGHxJ5hpMCixmuvfWj5d3bFddq77CHIKmc1FYhSUqlAl1F322ZKsBQCl64EEVZVC6ElTVGWcUmoUW+w4cchGvbq124CL2zvqtKI6cbBtw0KW0aoBBYS+LynbYwAr397UY1ZsYugTUBnVJl6kDIqkIAwlrDnducwYdPvd/P/CXj4hQlwhelikE23LdyZbTG6GBlG0OmqAhYIqZD X-MS-Office365-Filtering-Correlation-Id: bbf2012f-a95d-49dd-9730-08d5c6602a55 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2018 19:04:26.7674 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bbf2012f-a95d-49dd-9730-08d5c6602a55 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 92e84ceb-fbfd-47ab-be52-080c6b87953f X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR15MB2392 X-OriginatorOrg: ericsson.com X-IsSubscribed: yes Remove regcache_cooked_write, update callers to use regcache::cooked_write. gdb/ChangeLog: * regcache.h (regcache_cooked_write): Remove, update callers to use regcache::cooked_write. * regcache.c (regcache_cooked_write): Remove. --- gdb/ChangeLog | 6 ++ gdb/aarch64-tdep.c | 14 ++-- gdb/alpha-tdep.c | 18 ++--- gdb/amd64-tdep.c | 6 +- gdb/amd64-windows-tdep.c | 8 +-- gdb/arc-tdep.c | 2 +- gdb/arm-tdep.c | 19 +++-- gdb/avr-tdep.c | 2 +- gdb/bfin-tdep.c | 2 +- gdb/cris-tdep.c | 4 +- gdb/frame.c | 2 +- gdb/frv-tdep.c | 6 +- gdb/hppa-tdep.c | 14 ++-- gdb/i386-darwin-tdep.c | 4 +- gdb/i386-tdep.c | 4 +- gdb/ia64-tdep.c | 4 +- gdb/m32c-tdep.c | 26 +++---- gdb/m68k-tdep.c | 6 +- gdb/microblaze-tdep.c | 4 +- gdb/nds32-tdep.c | 16 ++--- gdb/nios2-tdep.c | 6 +- gdb/or1k-tdep.c | 6 +- gdb/ppc-sysv-tdep.c | 180 +++++++++++++++++++--------------------------- gdb/record-full.c | 3 +- gdb/regcache.c | 7 -- gdb/regcache.h | 13 +--- gdb/riscv-tdep.c | 14 ++-- gdb/rs6000-aix-tdep.c | 22 +++--- gdb/rs6000-lynx178-tdep.c | 22 +++--- gdb/s390-tdep.c | 15 ++-- gdb/sparc-tdep.c | 24 +++---- gdb/sparc64-tdep.c | 35 +++++---- gdb/spu-tdep.c | 8 +-- gdb/tic6x-tdep.c | 18 +++-- gdb/vax-tdep.c | 10 +-- gdb/xtensa-tdep.c | 6 +- 36 files changed, 246 insertions(+), 310 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index d0cc45a..2d1dfb6 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ 2018-05-30 Simon Marchi + * regcache.h (regcache_cooked_write): Remove, update callers to + use regcache::cooked_write. + * regcache.c (regcache_cooked_write): Remove. + +2018-05-30 Simon Marchi + * regcache.h (regcache_invalidate): Remove, update callers to use detached_regcache::invalidate instead. * regcache.c (regcache_invalidate): Remove. diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c index 6f4878a..ef9b71c 100644 --- a/gdb/aarch64-tdep.c +++ b/gdb/aarch64-tdep.c @@ -1271,7 +1271,7 @@ pass_in_v (struct gdbarch *gdbarch, /* PCS C.1, the argument is allocated to the least significant bits of V register. */ memcpy (reg, buf, len); - regcache_cooked_write (regcache, regnum, reg); + regcache->cooked_write (regnum, reg); if (aarch64_debug) { @@ -1931,7 +1931,7 @@ aarch64_store_return_value (struct type *type, struct regcache *regs, int len = TYPE_LENGTH (type); memcpy (buf, valbuf, len > V_REGISTER_SIZE ? V_REGISTER_SIZE : len); - regcache_cooked_write (regs, AARCH64_V0_REGNUM, buf); + regs->cooked_write (AARCH64_V0_REGNUM, buf); } else if (TYPE_CODE (type) == TYPE_CODE_INT || TYPE_CODE (type) == TYPE_CODE_CHAR @@ -1948,7 +1948,7 @@ aarch64_store_return_value (struct type *type, struct regcache *regs, LONGEST val = unpack_long (type, valbuf); store_signed_integer (tmpbuf, X_REGISTER_SIZE, byte_order, val); - regcache_cooked_write (regs, AARCH64_X0_REGNUM, tmpbuf); + regs->cooked_write (AARCH64_X0_REGNUM, tmpbuf); } else { @@ -1960,7 +1960,7 @@ aarch64_store_return_value (struct type *type, struct regcache *regs, while (len > 0) { - regcache_cooked_write (regs, regno++, valbuf); + regs->cooked_write (regno++, valbuf); len -= X_REGISTER_SIZE; valbuf += X_REGISTER_SIZE; } @@ -1986,7 +1986,7 @@ aarch64_store_return_value (struct type *type, struct regcache *regs, } memcpy (tmpbuf, valbuf, len); - regcache_cooked_write (regs, regno, tmpbuf); + regs->cooked_write (regno, tmpbuf); valbuf += len; } } @@ -1997,7 +1997,7 @@ aarch64_store_return_value (struct type *type, struct regcache *regs, gdb_byte buf[V_REGISTER_SIZE]; memcpy (buf, valbuf, TYPE_LENGTH (type)); - regcache_cooked_write (regs, AARCH64_V0_REGNUM, buf); + regs->cooked_write (AARCH64_V0_REGNUM, buf); } else { @@ -2012,7 +2012,7 @@ aarch64_store_return_value (struct type *type, struct regcache *regs, { memcpy (tmpbuf, valbuf, len > X_REGISTER_SIZE ? X_REGISTER_SIZE : len); - regcache_cooked_write (regs, regno++, tmpbuf); + regs->cooked_write (regno++, tmpbuf); len -= X_REGISTER_SIZE; valbuf += X_REGISTER_SIZE; } diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c index d55f3c6..408bedc 100644 --- a/gdb/alpha-tdep.c +++ b/gdb/alpha-tdep.c @@ -453,10 +453,10 @@ alpha_push_dummy_call (struct gdbarch *gdbarch, struct value *function, /* Load the argument registers. */ for (i = 0; i < required_arg_regs; i++) { - regcache_cooked_write (regcache, ALPHA_A0_REGNUM + i, - arg_reg_buffer + i*ALPHA_REGISTER_SIZE); - regcache_cooked_write (regcache, ALPHA_FPA0_REGNUM + i, - arg_reg_buffer + i*ALPHA_REGISTER_SIZE); + regcache->cooked_write (ALPHA_A0_REGNUM + i, + arg_reg_buffer + i * ALPHA_REGISTER_SIZE); + regcache->cooked_write (ALPHA_FPA0_REGNUM + i, + arg_reg_buffer + i * ALPHA_REGISTER_SIZE); } /* Finally, update the stack pointer. */ @@ -552,11 +552,11 @@ alpha_store_return_value (struct type *valtype, struct regcache *regcache, { case 4: alpha_lds (gdbarch, raw_buffer, valbuf); - regcache_cooked_write (regcache, ALPHA_FP0_REGNUM, raw_buffer); + regcache->cooked_write (ALPHA_FP0_REGNUM, raw_buffer); break; case 8: - regcache_cooked_write (regcache, ALPHA_FP0_REGNUM, valbuf); + regcache->cooked_write (ALPHA_FP0_REGNUM, valbuf); break; case 16: @@ -576,12 +576,12 @@ alpha_store_return_value (struct type *valtype, struct regcache *regcache, { case 8: /* ??? This isn't correct wrt the ABI, but it's what GCC does. */ - regcache_cooked_write (regcache, ALPHA_FP0_REGNUM, valbuf); + regcache->cooked_write (ALPHA_FP0_REGNUM, valbuf); break; case 16: - regcache_cooked_write (regcache, ALPHA_FP0_REGNUM, valbuf); - regcache_cooked_write (regcache, ALPHA_FP0_REGNUM + 1, valbuf + 8); + regcache->cooked_write (ALPHA_FP0_REGNUM, valbuf); + regcache->cooked_write (ALPHA_FP0_REGNUM + 1, valbuf + 8); break; case 32: diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c index 9a1e68e..975c907 100644 --- a/gdb/amd64-tdep.c +++ b/gdb/amd64-tdep.c @@ -1010,7 +1010,7 @@ amd64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, if (struct_return) { store_unsigned_integer (buf, 8, byte_order, struct_addr); - regcache_cooked_write (regcache, AMD64_RDI_REGNUM, buf); + regcache->cooked_write (AMD64_RDI_REGNUM, buf); } /* Store return address. */ @@ -1020,10 +1020,10 @@ amd64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, /* Finally, update the stack pointer... */ store_unsigned_integer (buf, 8, byte_order, sp); - regcache_cooked_write (regcache, AMD64_RSP_REGNUM, buf); + regcache->cooked_write (AMD64_RSP_REGNUM, buf); /* ...and fake a frame pointer. */ - regcache_cooked_write (regcache, AMD64_RBP_REGNUM, buf); + regcache->cooked_write (AMD64_RBP_REGNUM, buf); return sp + 16; } diff --git a/gdb/amd64-windows-tdep.c b/gdb/amd64-windows-tdep.c index 7e0c086..83a7f2f 100644 --- a/gdb/amd64-windows-tdep.c +++ b/gdb/amd64-windows-tdep.c @@ -145,7 +145,7 @@ amd64_windows_store_arg_in_reg (struct regcache *regcache, gdb_assert (TYPE_LENGTH (type) <= 8); memset (buf, 0, sizeof buf); memcpy (buf, valbuf, std::min (TYPE_LENGTH (type), (unsigned int) 8)); - regcache_cooked_write (regcache, regno, buf); + regcache->cooked_write (regno, buf); } /* Push the arguments for an inferior function call, and return @@ -262,7 +262,7 @@ amd64_windows_push_dummy_call const int arg_regnum = amd64_windows_dummy_call_integer_regs[0]; store_unsigned_integer (buf, 8, byte_order, struct_addr); - regcache_cooked_write (regcache, arg_regnum, buf); + regcache->cooked_write (arg_regnum, buf); } /* Reserve some memory on the stack for the integer-parameter @@ -276,10 +276,10 @@ amd64_windows_push_dummy_call /* Update the stack pointer... */ store_unsigned_integer (buf, 8, byte_order, sp); - regcache_cooked_write (regcache, AMD64_RSP_REGNUM, buf); + regcache->cooked_write (AMD64_RSP_REGNUM, buf); /* ...and fake a frame pointer. */ - regcache_cooked_write (regcache, AMD64_RBP_REGNUM, buf); + regcache->cooked_write (AMD64_RBP_REGNUM, buf); return sp + 16; } diff --git a/gdb/arc-tdep.c b/gdb/arc-tdep.c index 286a289..fad9170 100644 --- a/gdb/arc-tdep.c +++ b/gdb/arc-tdep.c @@ -664,7 +664,7 @@ arc_push_dummy_call (struct gdbarch *gdbarch, struct value *function, /* Note we don't use write_unsigned here, since that would convert the byte order, but we are already in the correct byte order. */ - regcache_cooked_write (regcache, arg_reg, data); + regcache->cooked_write (arg_reg, data); data += ARC_REGISTER_SIZE; total_space -= ARC_REGISTER_SIZE; diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index abb1a88..3ea0e79 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -3804,8 +3804,7 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct value *function, reg_char, reg_scaled + i); regnum = user_reg_map_name_to_regnum (gdbarch, name_buf, strlen (name_buf)); - regcache_cooked_write (regcache, regnum, - val + i * unit_length); + regcache->cooked_write (regnum, val + i * unit_length); } } continue; @@ -8099,7 +8098,7 @@ arm_store_return_value (struct type *type, struct regcache *regs, case ARM_FLOAT_FPA: target_float_convert (valbuf, type, buf, arm_ext_type (gdbarch)); - regcache_cooked_write (regs, ARM_F0_REGNUM, buf); + regs->cooked_write (ARM_F0_REGNUM, buf); break; case ARM_FLOAT_SOFT_FPA: @@ -8107,10 +8106,9 @@ arm_store_return_value (struct type *type, struct regcache *regs, /* ARM_FLOAT_VFP can arise if this is a variadic function so not using the VFP ABI code. */ case ARM_FLOAT_VFP: - regcache_cooked_write (regs, ARM_A1_REGNUM, valbuf); + regs->cooked_write (ARM_A1_REGNUM, valbuf); if (TYPE_LENGTH (type) > 4) - regcache_cooked_write (regs, ARM_A1_REGNUM + 1, - valbuf + INT_REGISTER_SIZE); + regs->cooked_write (ARM_A1_REGNUM + 1, valbuf + INT_REGISTER_SIZE); break; default: @@ -8135,7 +8133,7 @@ arm_store_return_value (struct type *type, struct regcache *regs, LONGEST val = unpack_long (type, valbuf); store_signed_integer (tmpbuf, INT_REGISTER_SIZE, byte_order, val); - regcache_cooked_write (regs, ARM_A1_REGNUM, tmpbuf); + regs->cooked_write (ARM_A1_REGNUM, tmpbuf); } else { @@ -8147,7 +8145,7 @@ arm_store_return_value (struct type *type, struct regcache *regs, while (len > 0) { - regcache_cooked_write (regs, regno++, valbuf); + regs->cooked_write (regno++, valbuf); len -= INT_REGISTER_SIZE; valbuf += INT_REGISTER_SIZE; } @@ -8166,7 +8164,7 @@ arm_store_return_value (struct type *type, struct regcache *regs, { memcpy (tmpbuf, valbuf, len > INT_REGISTER_SIZE ? INT_REGISTER_SIZE : len); - regcache_cooked_write (regs, regno++, tmpbuf); + regs->cooked_write (regno++, tmpbuf); len -= INT_REGISTER_SIZE; valbuf += INT_REGISTER_SIZE; } @@ -8213,8 +8211,7 @@ arm_return_value (struct gdbarch *gdbarch, struct value *function, regnum = user_reg_map_name_to_regnum (gdbarch, name_buf, strlen (name_buf)); if (writebuf) - regcache_cooked_write (regcache, regnum, - writebuf + i * unit_length); + regcache->cooked_write (regnum, writebuf + i * unit_length); if (readbuf) regcache->cooked_read (regnum, readbuf + i * unit_length); } diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c index 2629d54..d7895af 100644 --- a/gdb/avr-tdep.c +++ b/gdb/avr-tdep.c @@ -953,7 +953,7 @@ avr_return_value (struct gdbarch *gdbarch, struct value *function, if (writebuf != NULL) { for (i = 0; i < TYPE_LENGTH (valtype); i++) - regcache_cooked_write (regcache, lsb_reg + i, writebuf + i); + regcache->cooked_write (lsb_reg + i, writebuf + i); } if (readbuf != NULL) diff --git a/gdb/bfin-tdep.c b/gdb/bfin-tdep.c index a2b3464..da62130 100644 --- a/gdb/bfin-tdep.c +++ b/gdb/bfin-tdep.c @@ -647,7 +647,7 @@ bfin_store_return_value (struct type *type, while (len > 0) { - regcache_cooked_write (regs, regno++, valbuf); + regs->cooked_write (regno++, valbuf); len -= 4; valbuf += 4; } diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c index 5fa79ef..a0fb3b2 100644 --- a/gdb/cris-tdep.c +++ b/gdb/cris-tdep.c @@ -849,7 +849,7 @@ cris_push_dummy_call (struct gdbarch *gdbarch, struct value *function, /* Data passed by value. Fits in available register(s). */ for (i = 0; i < reg_demand; i++) { - regcache_cooked_write (regcache, argreg, val); + regcache->cooked_write (argreg, val); argreg++; val += 4; } @@ -862,7 +862,7 @@ cris_push_dummy_call (struct gdbarch *gdbarch, struct value *function, { if (argreg <= ARG4_REGNUM) { - regcache_cooked_write (regcache, argreg, val); + regcache->cooked_write (argreg, val); argreg++; val += 4; } diff --git a/gdb/frame.c b/gdb/frame.c index c0f6e64..89f48ae 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -1365,7 +1365,7 @@ put_frame_register (struct frame_info *frame, int regnum, break; } case lval_register: - regcache_cooked_write (get_current_regcache (), realnum, buf); + get_current_regcache ()->cooked_write (realnum, buf); break; default: error (_("Attempt to assign to an unmodifiable value.")); diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c index 7adffc4..1eed441 100644 --- a/gdb/frv-tdep.c +++ b/gdb/frv-tdep.c @@ -1327,12 +1327,12 @@ frv_store_return_value (struct type *type, struct regcache *regcache, bfd_byte val[4]; memset (val, 0, sizeof (val)); memcpy (val + (4 - len), valbuf, len); - regcache_cooked_write (regcache, 8, val); + regcache->cooked_write (8, val); } else if (len == 8) { - regcache_cooked_write (regcache, 8, valbuf); - regcache_cooked_write (regcache, 9, (bfd_byte *) valbuf + 4); + regcache->cooked_write (8, valbuf); + regcache->cooked_write (9, (bfd_byte *) valbuf + 4); } else internal_error (__FILE__, __LINE__, diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index 5fe7851..1f3581e 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -820,17 +820,15 @@ hppa32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, int fpLreg = 72 + (param_ptr - 36) / 4 * 2; int fpreg = 74 + (param_ptr - 32) / 8 * 4; - regcache_cooked_write (regcache, grreg, param_val); - regcache_cooked_write (regcache, fpLreg, param_val); + regcache->cooked_write (grreg, param_val); + regcache->cooked_write (fpLreg, param_val); if (param_len > 4) { - regcache_cooked_write (regcache, grreg + 1, - param_val + 4); + regcache->cooked_write (grreg + 1, param_val + 4); - regcache_cooked_write (regcache, fpreg, param_val); - regcache_cooked_write (regcache, fpreg + 1, - param_val + 4); + regcache->cooked_write (fpreg, param_val); + regcache->cooked_write (fpreg + 1, param_val + 4); } } } @@ -1167,7 +1165,7 @@ hppa32_return_value (struct gdbarch *gdbarch, struct value *function, if (readbuf != NULL) regcache->cooked_read (reg, readbuf + b); if (writebuf != NULL) - regcache_cooked_write (regcache, reg, writebuf + b); + regcache->cooked_write (reg, writebuf + b); reg++; } return RETURN_VALUE_REGISTER_CONVENTION; diff --git a/gdb/i386-darwin-tdep.c b/gdb/i386-darwin-tdep.c index 21f0a4c..5a1807a 100644 --- a/gdb/i386-darwin-tdep.c +++ b/gdb/i386-darwin-tdep.c @@ -227,10 +227,10 @@ i386_darwin_push_dummy_call (struct gdbarch *gdbarch, struct value *function, /* Finally, update the stack pointer... */ store_unsigned_integer (buf, 4, byte_order, sp); - regcache_cooked_write (regcache, I386_ESP_REGNUM, buf); + regcache->cooked_write (I386_ESP_REGNUM, buf); /* ...and fake a frame pointer. */ - regcache_cooked_write (regcache, I386_EBP_REGNUM, buf); + regcache->cooked_write (I386_EBP_REGNUM, buf); /* MarkK wrote: This "+ 8" is all over the place: (i386_frame_this_id, i386_sigtramp_frame_this_id, diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index cdb5fc8..158344f 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -2755,10 +2755,10 @@ i386_push_dummy_call (struct gdbarch *gdbarch, struct value *function, /* Finally, update the stack pointer... */ store_unsigned_integer (buf, 4, byte_order, sp); - regcache_cooked_write (regcache, I386_ESP_REGNUM, buf); + regcache->cooked_write (I386_ESP_REGNUM, buf); /* ...and fake a frame pointer. */ - regcache_cooked_write (regcache, I386_EBP_REGNUM, buf); + regcache->cooked_write (I386_EBP_REGNUM, buf); /* MarkK wrote: This "+ 8" is all over the place: (i386_frame_this_id, i386_sigtramp_frame_this_id, diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c index 7eb84ff..a24e5cb 100644 --- a/gdb/ia64-tdep.c +++ b/gdb/ia64-tdep.c @@ -3277,7 +3277,7 @@ ia64_store_return_value (struct type *type, struct regcache *regcache, { target_float_convert (valbuf + offset, float_elt_type, to, ia64_ext_type (gdbarch)); - regcache_cooked_write (regcache, regnum, to); + regcache->cooked_write (regnum, to); offset += TYPE_LENGTH (float_elt_type); regnum++; } @@ -3834,7 +3834,7 @@ ia64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, target_float_convert (value_contents (arg) + argoffset, float_elt_type, to, ia64_ext_type (gdbarch)); - regcache_cooked_write (regcache, floatreg, to); + regcache->cooked_write (floatreg, to); floatreg++; argoffset += TYPE_LENGTH (float_elt_type); len -= TYPE_LENGTH (float_elt_type); diff --git a/gdb/m32c-tdep.c b/gdb/m32c-tdep.c index 2825efb..b7cba1c 100644 --- a/gdb/m32c-tdep.c +++ b/gdb/m32c-tdep.c @@ -511,13 +511,13 @@ m32c_cat_write (struct m32c_reg *reg, struct regcache *cache, if (gdbarch_byte_order (reg->arch) == BFD_ENDIAN_BIG) { - regcache_cooked_write (cache, reg->rx->num, buf); - regcache_cooked_write (cache, reg->ry->num, buf + high_bytes); + cache->cooked_write (reg->rx->num, buf); + cache->cooked_write (reg->ry->num, buf + high_bytes); } else { - regcache_cooked_write (cache, reg->rx->num, buf + low_bytes); - regcache_cooked_write (cache, reg->ry->num, buf); + cache->cooked_write (reg->rx->num, buf + low_bytes); + cache->cooked_write (reg->ry->num, buf); } return REG_VALID; @@ -571,17 +571,17 @@ m32c_r3r2r1r0_write (struct m32c_reg *reg, struct regcache *cache, if (gdbarch_byte_order (reg->arch) == BFD_ENDIAN_BIG) { - regcache_cooked_write (cache, tdep->r0->num, buf + len * 3); - regcache_cooked_write (cache, tdep->r1->num, buf + len * 2); - regcache_cooked_write (cache, tdep->r2->num, buf + len * 1); - regcache_cooked_write (cache, tdep->r3->num, buf); + cache->cooked_write (tdep->r0->num, buf + len * 3); + cache->cooked_write (tdep->r1->num, buf + len * 2); + cache->cooked_write (tdep->r2->num, buf + len * 1); + cache->cooked_write (tdep->r3->num, buf); } else { - regcache_cooked_write (cache, tdep->r0->num, buf); - regcache_cooked_write (cache, tdep->r1->num, buf + len * 1); - regcache_cooked_write (cache, tdep->r2->num, buf + len * 2); - regcache_cooked_write (cache, tdep->r3->num, buf + len * 3); + cache->cooked_write (tdep->r0->num, buf); + cache->cooked_write (tdep->r1->num, buf + len * 1); + cache->cooked_write (tdep->r2->num, buf + len * 2); + cache->cooked_write (tdep->r3->num, buf + len * 3); } return REG_VALID; @@ -2092,7 +2092,7 @@ m32c_push_dummy_call (struct gdbarch *gdbarch, struct value *function, && arg_size == 2 && i < num_prototyped_args && m32c_reg_arg_type (arg_type)) - regcache_cooked_write (regcache, tdep->r2->num, arg_bits); + regcache->cooked_write (tdep->r2->num, arg_bits); /* Everything else goes on the stack. */ else diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c index 432c37c..a6e9b58 100644 --- a/gdb/m68k-tdep.c +++ b/gdb/m68k-tdep.c @@ -525,7 +525,7 @@ m68k_push_dummy_call (struct gdbarch *gdbarch, struct value *function, if (struct_return) { store_unsigned_integer (buf, 4, byte_order, struct_addr); - regcache_cooked_write (regcache, tdep->struct_value_regnum, buf); + regcache->cooked_write (tdep->struct_value_regnum, buf); } /* Store return address. */ @@ -535,10 +535,10 @@ m68k_push_dummy_call (struct gdbarch *gdbarch, struct value *function, /* Finally, update the stack pointer... */ store_unsigned_integer (buf, 4, byte_order, sp); - regcache_cooked_write (regcache, M68K_SP_REGNUM, buf); + regcache->cooked_write (M68K_SP_REGNUM, buf); /* ...and fake a frame pointer. */ - regcache_cooked_write (regcache, M68K_FP_REGNUM, buf); + regcache->cooked_write (M68K_FP_REGNUM, buf); /* DWARF2/GCC uses the stack address *before* the function call as a frame's CFA. */ diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c index f503590..9bac864 100644 --- a/gdb/microblaze-tdep.c +++ b/gdb/microblaze-tdep.c @@ -573,13 +573,13 @@ microblaze_store_return_value (struct type *type, struct regcache *regcache, { gdb_assert (len == 8); memcpy (buf, valbuf, 8); - regcache_cooked_write (regcache, MICROBLAZE_RETVAL_REGNUM+1, buf + 4); + regcache->cooked_write (MICROBLAZE_RETVAL_REGNUM+1, buf + 4); } else /* ??? Do we need to do any sign-extension here? */ memcpy (buf + 4 - len, valbuf, len); - regcache_cooked_write (regcache, MICROBLAZE_RETVAL_REGNUM, buf); + regcache->cooked_write (MICROBLAZE_RETVAL_REGNUM, buf); } static enum return_value_convention diff --git a/gdb/nds32-tdep.c b/gdb/nds32-tdep.c index 35375fb..b616cc9 100644 --- a/gdb/nds32-tdep.c +++ b/gdb/nds32-tdep.c @@ -1587,13 +1587,11 @@ nds32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, switch (len) { case 4: - regcache_cooked_write (regcache, - tdep->fs0_regnum + foff, val); + regcache->cooked_write (tdep->fs0_regnum + foff, val); foff++; break; case 8: - regcache_cooked_write (regcache, - NDS32_FD0_REGNUM + (foff >> 1), val); + regcache->cooked_write (NDS32_FD0_REGNUM + (foff >> 1), val); foff += 2; break; default: @@ -1830,9 +1828,9 @@ nds32_store_return_value (struct gdbarch *gdbarch, struct type *type, if (abi_use_fpr && calling_use_fpr) { if (len == 4) - regcache_cooked_write (regcache, tdep->fs0_regnum, valbuf); + regcache->cooked_write (tdep->fs0_regnum, valbuf); else if (len == 8) - regcache_cooked_write (regcache, NDS32_FD0_REGNUM, valbuf); + regcache->cooked_write (NDS32_FD0_REGNUM, valbuf); else internal_error (__FILE__, __LINE__, _("Cannot store return value of %d bytes " @@ -1849,7 +1847,7 @@ nds32_store_return_value (struct gdbarch *gdbarch, struct type *type, } else if (len == 4) { - regcache_cooked_write (regcache, NDS32_R0_REGNUM, valbuf); + regcache->cooked_write (NDS32_R0_REGNUM, valbuf); } else if (len < 8) { @@ -1867,8 +1865,8 @@ nds32_store_return_value (struct gdbarch *gdbarch, struct type *type, } else { - regcache_cooked_write (regcache, NDS32_R0_REGNUM, valbuf); - regcache_cooked_write (regcache, NDS32_R0_REGNUM + 1, valbuf + 4); + regcache->cooked_write (NDS32_R0_REGNUM, valbuf); + regcache->cooked_write (NDS32_R0_REGNUM + 1, valbuf + 4); } } } diff --git a/gdb/nios2-tdep.c b/gdb/nios2-tdep.c index e1cbd97..91b4381 100644 --- a/gdb/nios2-tdep.c +++ b/gdb/nios2-tdep.c @@ -228,13 +228,13 @@ nios2_store_return_value (struct gdbarch *gdbarch, struct type *valtype, /* Return values of up to 8 bytes are returned in $r2 $r3. */ if (len <= register_size (gdbarch, NIOS2_R2_REGNUM)) - regcache_cooked_write (regcache, NIOS2_R2_REGNUM, valbuf); + regcache->cooked_write (NIOS2_R2_REGNUM, valbuf); else { gdb_assert (len <= (register_size (gdbarch, NIOS2_R2_REGNUM) + register_size (gdbarch, NIOS2_R3_REGNUM))); - regcache_cooked_write (regcache, NIOS2_R2_REGNUM, valbuf); - regcache_cooked_write (regcache, NIOS2_R3_REGNUM, valbuf + 4); + regcache->cooked_write (NIOS2_R2_REGNUM, valbuf); + regcache->cooked_write (NIOS2_R3_REGNUM, valbuf + 4); } } diff --git a/gdb/or1k-tdep.c b/gdb/or1k-tdep.c index 329615f..c5104e3 100644 --- a/gdb/or1k-tdep.c +++ b/gdb/or1k-tdep.c @@ -297,7 +297,7 @@ or1k_return_value (struct gdbarch *gdbarch, struct value *functype, else memcpy (buf, writebuf, rv_size); - regcache_cooked_write (regcache, OR1K_RV_REGNUM, buf); + regcache->cooked_write (OR1K_RV_REGNUM, buf); free (buf); } @@ -330,8 +330,8 @@ or1k_return_value (struct gdbarch *gdbarch, struct value *functype, memcpy (buf_hi, writebuf, rv_size - bpw); memcpy (buf_lo, writebuf + bpw, bpw); - regcache_cooked_write (regcache, OR1K_RV_REGNUM, buf_hi); - regcache_cooked_write (regcache, OR1K_RV_REGNUM + 1, buf_lo); + regcache->cooked_write (OR1K_RV_REGNUM, buf_hi); + regcache->cooked_write (OR1K_RV_REGNUM + 1, buf_lo); free (buf_lo); free (buf_hi); diff --git a/gdb/ppc-sysv-tdep.c b/gdb/ppc-sysv-tdep.c index 04f9447..42dc63c 100644 --- a/gdb/ppc-sysv-tdep.c +++ b/gdb/ppc-sysv-tdep.c @@ -139,9 +139,8 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct type *regtype = register_type (gdbarch, tdep->ppc_fp0_regnum + freg); target_float_convert (val, type, regval, regtype); - regcache_cooked_write (regcache, - tdep->ppc_fp0_regnum + freg, - regval); + regcache->cooked_write (tdep->ppc_fp0_regnum + freg, + regval); } freg++; } @@ -176,12 +175,9 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, { if (write_pass) { - regcache_cooked_write (regcache, - tdep->ppc_fp0_regnum + freg, - val); - regcache_cooked_write (regcache, - tdep->ppc_fp0_regnum + freg + 1, - val + 8); + regcache->cooked_write (tdep->ppc_fp0_regnum + freg, val); + regcache->cooked_write (tdep->ppc_fp0_regnum + freg + 1, + val + 8); } freg += 2; } @@ -221,12 +217,10 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, greg++; if (write_pass) { - regcache_cooked_write (regcache, - tdep->ppc_gp0_regnum + greg + 0, - val + 0); - regcache_cooked_write (regcache, - tdep->ppc_gp0_regnum + greg + 1, - val + 4); + regcache->cooked_write (tdep->ppc_gp0_regnum + greg + 0, + val + 0); + regcache->cooked_write (tdep->ppc_gp0_regnum + greg + 1, + val + 4); } greg += 2; } @@ -253,18 +247,14 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, { if (write_pass) { - regcache_cooked_write (regcache, - tdep->ppc_gp0_regnum + greg + 0, - val + 0); - regcache_cooked_write (regcache, - tdep->ppc_gp0_regnum + greg + 1, - val + 4); - regcache_cooked_write (regcache, - tdep->ppc_gp0_regnum + greg + 2, - val + 8); - regcache_cooked_write (regcache, - tdep->ppc_gp0_regnum + greg + 3, - val + 12); + regcache->cooked_write (tdep->ppc_gp0_regnum + greg + 0, + val + 0); + regcache->cooked_write (tdep->ppc_gp0_regnum + greg + 1, + val + 4); + regcache->cooked_write (tdep->ppc_gp0_regnum + greg + 2, + val + 8); + regcache->cooked_write (tdep->ppc_gp0_regnum + greg + 3, + val + 12); } greg += 4; } @@ -292,8 +282,7 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, else p = val; - regcache_cooked_write (regcache, - tdep->ppc_fp0_regnum + freg, p); + regcache->cooked_write (tdep->ppc_fp0_regnum + freg, p); } freg++; @@ -322,10 +311,9 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, if (write_pass) { - regcache_cooked_write (regcache, - tdep->ppc_fp0_regnum + freg, val); - regcache_cooked_write (regcache, - tdep->ppc_fp0_regnum + freg + 1, val + 8); + regcache->cooked_write (tdep->ppc_fp0_regnum + freg, val); + regcache->cooked_write (tdep->ppc_fp0_regnum + freg + 1, + val + 8); } } else @@ -370,7 +358,7 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, = register_type (gdbarch, regnum); target_float_convert (elval, eltype, regval, regtype); - regcache_cooked_write (regcache, regnum, regval); + regcache->cooked_write (regnum, regval); } freg++; } @@ -402,10 +390,8 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, if (write_pass) { int regnum = tdep->ppc_gp0_regnum + greg; - regcache_cooked_write (regcache, - regnum + 0, elval + 0); - regcache_cooked_write (regcache, - regnum + 1, elval + 4); + regcache->cooked_write (regnum + 0, elval + 0); + regcache->cooked_write (regnum + 1, elval + 4); } greg += 2; } @@ -419,9 +405,8 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, if (greg <= 10) { if (write_pass) - regcache_cooked_write (regcache, - tdep->ppc_gp0_regnum + greg, - word); + regcache->cooked_write (tdep->ppc_gp0_regnum + greg, + word); greg++; } else @@ -450,9 +435,8 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, if (vreg <= 13) { if (write_pass) - regcache_cooked_write (regcache, - tdep->ppc_vr0_regnum + vreg, - elval); + regcache->cooked_write (tdep->ppc_vr0_regnum + vreg, + elval); vreg++; } else @@ -474,8 +458,7 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, if (vreg <= 13) { if (write_pass) - regcache_cooked_write (regcache, - tdep->ppc_vr0_regnum + vreg, val); + regcache->cooked_write (tdep->ppc_vr0_regnum + vreg, val); vreg++; } else @@ -501,8 +484,7 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, if (greg <= 10) { if (write_pass) - regcache_cooked_write (regcache, - tdep->ppc_ev0_regnum + greg, val); + regcache->cooked_write (tdep->ppc_ev0_regnum + greg, val); greg++; } else @@ -552,8 +534,7 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, if (greg <= 10) { if (write_pass) - regcache_cooked_write (regcache, - tdep->ppc_gp0_regnum + greg, word); + regcache->cooked_write (tdep->ppc_gp0_regnum + greg, word); greg++; } else @@ -636,7 +617,7 @@ get_decimal_float_return_value (struct gdbarch *gdbarch, struct type *valtype, else p = writebuf; - regcache_cooked_write (regcache, tdep->ppc_fp0_regnum + 1, p); + regcache->cooked_write (tdep->ppc_fp0_regnum + 1, p); } if (readbuf != NULL) { @@ -657,8 +638,8 @@ get_decimal_float_return_value (struct gdbarch *gdbarch, struct type *valtype, for (i = 0; i < 2; i++) { if (writebuf != NULL) - regcache_cooked_write (regcache, tdep->ppc_fp0_regnum + 2 + i, - writebuf + i * 8); + regcache->cooked_write (tdep->ppc_fp0_regnum + 2 + i, + writebuf + i * 8); if (readbuf != NULL) regcache->cooked_read (tdep->ppc_fp0_regnum + 2 + i, readbuf + i * 8); @@ -720,7 +701,7 @@ do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type, gdb_byte regval[PPC_MAX_REGISTER_SIZE]; struct type *regtype = register_type (gdbarch, tdep->ppc_fp0_regnum); target_float_convert (writebuf, type, regval, regtype); - regcache_cooked_write (regcache, tdep->ppc_fp0_regnum + 1, regval); + regcache->cooked_write (tdep->ppc_fp0_regnum + 1, regval); } return RETURN_VALUE_REGISTER_CONVENTION; } @@ -738,9 +719,8 @@ do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type, } if (writebuf) { - regcache_cooked_write (regcache, tdep->ppc_fp0_regnum + 1, writebuf); - regcache_cooked_write (regcache, tdep->ppc_fp0_regnum + 2, - writebuf + 8); + regcache->cooked_write (tdep->ppc_fp0_regnum + 1, writebuf); + regcache->cooked_write (tdep->ppc_fp0_regnum + 2, writebuf + 8); } return RETURN_VALUE_REGISTER_CONVENTION; } @@ -761,13 +741,10 @@ do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type, } if (writebuf) { - regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 3, writebuf); - regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 4, - writebuf + 4); - regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 5, - writebuf + 8); - regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 6, - writebuf + 12); + regcache->cooked_write (tdep->ppc_gp0_regnum + 3, writebuf); + regcache->cooked_write (tdep->ppc_gp0_regnum + 4, writebuf + 4); + regcache->cooked_write (tdep->ppc_gp0_regnum + 5, writebuf + 8); + regcache->cooked_write (tdep->ppc_gp0_regnum + 6, writebuf + 12); } return RETURN_VALUE_REGISTER_CONVENTION; } @@ -787,10 +764,8 @@ do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type, { /* A long long, double or _Decimal64 stored in the 32 bit r3/r4. */ - regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 3, - writebuf + 0); - regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 4, - writebuf + 4); + regcache->cooked_write (tdep->ppc_gp0_regnum + 3, writebuf + 0); + regcache->cooked_write (tdep->ppc_gp0_regnum + 4, writebuf + 4); } return RETURN_VALUE_REGISTER_CONVENTION; } @@ -849,7 +824,7 @@ do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type, { target_float_convert (writebuf + offset, eltype, regval, regtype); - regcache_cooked_write (regcache, regnum, regval); + regcache->cooked_write (regnum, regval); } if (readbuf != NULL) { @@ -895,7 +870,7 @@ do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type, int regnum = tdep->ppc_vr0_regnum + 2 + i; if (writebuf != NULL) - regcache_cooked_write (regcache, regnum, writebuf + offset); + regcache->cooked_write (regnum, writebuf + offset); if (readbuf != NULL) regcache->cooked_read (regnum, readbuf + offset); } @@ -915,7 +890,7 @@ do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type, if (writebuf) { /* Altivec places the return value in "v2". */ - regcache_cooked_write (regcache, tdep->ppc_vr0_regnum + 2, writebuf); + regcache->cooked_write (tdep->ppc_vr0_regnum + 2, writebuf); } return RETURN_VALUE_REGISTER_CONVENTION; } @@ -936,14 +911,10 @@ do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type, } if (writebuf) { - regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 3, - writebuf + 0); - regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 4, - writebuf + 4); - regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 5, - writebuf + 8); - regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 6, - writebuf + 12); + regcache->cooked_write (tdep->ppc_gp0_regnum + 3, writebuf + 0); + regcache->cooked_write (tdep->ppc_gp0_regnum + 4, writebuf + 4); + regcache->cooked_write (tdep->ppc_gp0_regnum + 5, writebuf + 8); + regcache->cooked_write (tdep->ppc_gp0_regnum + 6, writebuf + 12); } return RETURN_VALUE_REGISTER_CONVENTION; } @@ -960,7 +931,7 @@ do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type, if (readbuf) regcache->cooked_read (tdep->ppc_ev0_regnum + 3, readbuf); if (writebuf) - regcache_cooked_write (regcache, tdep->ppc_ev0_regnum + 3, writebuf); + regcache->cooked_write (tdep->ppc_ev0_regnum + 3, writebuf); return RETURN_VALUE_REGISTER_CONVENTION; } if (broken_gcc && TYPE_LENGTH (type) <= 8) @@ -985,11 +956,11 @@ do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type, { memset (regvals, 0, sizeof regvals); memcpy (regvals + offset, writebuf, len); - regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 3, - regvals + 0 * tdep->wordsize); + regcache->cooked_write (tdep->ppc_gp0_regnum + 3, + regvals + 0 * tdep->wordsize); if (len > tdep->wordsize) - regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 4, - regvals + 1 * tdep->wordsize); + regcache->cooked_write (tdep->ppc_gp0_regnum + 4, + regvals + 1 * tdep->wordsize); } return RETURN_VALUE_REGISTER_CONVENTION; @@ -1017,11 +988,11 @@ do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type, gdb_byte regvals[PPC_MAX_REGISTER_SIZE * 2]; memset (regvals, 0, sizeof regvals); memcpy (regvals, writebuf, TYPE_LENGTH (type)); - regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 3, - regvals + 0 * tdep->wordsize); + regcache->cooked_write (tdep->ppc_gp0_regnum + 3, + regvals + 0 * tdep->wordsize); if (TYPE_LENGTH (type) > tdep->wordsize) - regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 4, - regvals + 1 * tdep->wordsize); + regcache->cooked_write (tdep->ppc_gp0_regnum + 4, + regvals + 1 * tdep->wordsize); } return RETURN_VALUE_REGISTER_CONVENTION; } @@ -1305,8 +1276,8 @@ ppc64_sysv_abi_push_val (struct gdbarch *gdbarch, while (len >= tdep->wordsize) { if (argpos->regcache && argpos->greg <= 10) - regcache_cooked_write (argpos->regcache, - tdep->ppc_gp0_regnum + argpos->greg, val); + argpos->regcache->cooked_write (tdep->ppc_gp0_regnum + argpos->greg, + val); argpos->greg++; len -= tdep->wordsize; val += tdep->wordsize; @@ -1363,7 +1334,7 @@ ppc64_sysv_abi_push_freg (struct gdbarch *gdbarch, gdb_byte regval[PPC_MAX_REGISTER_SIZE]; target_float_convert (val, type, regval, regtype); - regcache_cooked_write (argpos->regcache, regnum, regval); + argpos->regcache->cooked_write (regnum, regval); } argpos->freg++; @@ -1397,9 +1368,9 @@ ppc64_sysv_abi_push_freg (struct gdbarch *gdbarch, { int regnum = tdep->ppc_fp0_regnum + argpos->freg; - regcache_cooked_write (argpos->regcache, regnum, val); + argpos->regcache->cooked_write (regnum, val); if (argpos->freg <= 12) - regcache_cooked_write (argpos->regcache, regnum + 1, val + 8); + argpos->regcache->cooked_write (regnum + 1, val + 8); } argpos->freg += 2; @@ -1417,8 +1388,8 @@ ppc64_sysv_abi_push_freg (struct gdbarch *gdbarch, int lopart = gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG ? 8 : 0; int hipart = gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG ? 0 : 8; - regcache_cooked_write (argpos->regcache, regnum, val + hipart); - regcache_cooked_write (argpos->regcache, regnum + 1, val + lopart); + argpos->regcache->cooked_write (regnum, val + hipart); + argpos->regcache->cooked_write (regnum + 1, val + lopart); } argpos->freg += 2; @@ -1435,8 +1406,7 @@ ppc64_sysv_abi_push_vreg (struct gdbarch *gdbarch, const bfd_byte *val, struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); if (argpos->regcache && argpos->vreg <= 13) - regcache_cooked_write (argpos->regcache, - tdep->ppc_vr0_regnum + argpos->vreg, val); + argpos->regcache->cooked_write (tdep->ppc_vr0_regnum + argpos->vreg, val); argpos->vreg++; } @@ -1810,7 +1780,7 @@ ppc64_sysv_abi_return_value_base (struct gdbarch *gdbarch, struct type *valtype, if (writebuf != NULL) { target_float_convert (writebuf, valtype, regval, regtype); - regcache_cooked_write (regcache, regnum, regval); + regcache->cooked_write (regnum, regval); } if (readbuf != NULL) { @@ -1850,8 +1820,8 @@ ppc64_sysv_abi_return_value_base (struct gdbarch *gdbarch, struct type *valtype, if (writebuf != NULL) { - regcache_cooked_write (regcache, regnum, writebuf); - regcache_cooked_write (regcache, regnum + 1, writebuf + 8); + regcache->cooked_write (regnum, writebuf); + regcache->cooked_write (regnum + 1, writebuf + 8); } if (readbuf != NULL) { @@ -1872,8 +1842,8 @@ ppc64_sysv_abi_return_value_base (struct gdbarch *gdbarch, struct type *valtype, if (writebuf != NULL) { - regcache_cooked_write (regcache, regnum, writebuf + hipart); - regcache_cooked_write (regcache, regnum + 1, writebuf + lopart); + regcache->cooked_write (regnum, writebuf + hipart); + regcache->cooked_write (regnum + 1, writebuf + lopart); } if (readbuf != NULL) { @@ -1891,7 +1861,7 @@ ppc64_sysv_abi_return_value_base (struct gdbarch *gdbarch, struct type *valtype, int regnum = tdep->ppc_vr0_regnum + 2 + index; if (writebuf != NULL) - regcache_cooked_write (regcache, regnum, writebuf); + regcache->cooked_write (regnum, writebuf); if (readbuf != NULL) regcache->cooked_read (regnum, readbuf); return 1; @@ -1996,7 +1966,7 @@ ppc64_sysv_abi_return_value (struct gdbarch *gdbarch, struct value *function, int regnum = tdep->ppc_gp0_regnum + 3; if (writebuf != NULL) - regcache_cooked_write (regcache, regnum, writebuf); + regcache->cooked_write (regnum, writebuf); if (readbuf != NULL) regcache->cooked_read (regnum, readbuf); return RETURN_VALUE_REGISTER_CONVENTION; @@ -2078,7 +2048,7 @@ ppc64_sysv_abi_return_value (struct gdbarch *gdbarch, struct value *function, memcpy (regval + tdep->wordsize - len, writebuf, len); else memcpy (regval, writebuf + offset, len); - regcache_cooked_write (regcache, regnum, regval); + regcache->cooked_write (regnum, regval); } if (readbuf != NULL) { diff --git a/gdb/record-full.c b/gdb/record-full.c index 8c0534e..bf65701 100644 --- a/gdb/record-full.c +++ b/gdb/record-full.c @@ -834,8 +834,7 @@ record_full_exec_insn (struct regcache *regcache, entry->u.reg.num); regcache->cooked_read (entry->u.reg.num, reg.data ()); - regcache_cooked_write (regcache, entry->u.reg.num, - record_full_get_loc (entry)); + regcache->cooked_write (entry->u.reg.num, record_full_get_loc (entry)); memcpy (record_full_get_loc (entry), reg.data (), entry->u.reg.len); } break; diff --git a/gdb/regcache.c b/gdb/regcache.c index 4dce978..0e2d040 100644 --- a/gdb/regcache.c +++ b/gdb/regcache.c @@ -772,13 +772,6 @@ regcache::raw_write (int regnum, const gdb_byte *buf) } void -regcache_cooked_write (struct regcache *regcache, int regnum, - const gdb_byte *buf) -{ - regcache->cooked_write (regnum, buf); -} - -void regcache::cooked_write (int regnum, const gdb_byte *buf) { gdb_assert (regnum >= 0); diff --git a/gdb/regcache.h b/gdb/regcache.h index 64e4cd7..4be1ae1 100644 --- a/gdb/regcache.h +++ b/gdb/regcache.h @@ -50,14 +50,6 @@ extern void regcache_raw_write_unsigned (struct regcache *regcache, extern LONGEST regcache_raw_get_signed (struct regcache *regcache, int regnum); -/* Transfer of pseudo-registers. The read variants return a register - status, as an indication of when a ``cooked'' register was - constructed from valid, invalid or unavailable ``raw'' - registers. */ - -void regcache_cooked_write (struct regcache *regcache, int rawnum, - const gdb_byte *buf); - /* Read register REGNUM from REGCACHE and return a new value. This will call mark_value_bytes_unavailable as appropriate. */ @@ -304,8 +296,6 @@ public: read-only register cache. */ void restore (readonly_detached_regcache *src); - void cooked_write (int regnum, const gdb_byte *buf); - /* Update the value of raw register REGNUM (in the range [0..NUM_REGS)) and transfer its value to core-gdb. */ @@ -314,6 +304,9 @@ public: template> void raw_write (int regnum, T val); + /* Transfer of pseudo-registers. */ + void cooked_write (int regnum, const gdb_byte *buf); + template> void cooked_write (int regnum, T val); diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c index 6943121..1545671 100644 --- a/gdb/riscv-tdep.c +++ b/gdb/riscv-tdep.c @@ -2103,7 +2103,7 @@ riscv_push_dummy_call (struct gdbarch *gdbarch, gdb_byte buf[sizeof (LONGEST)]; store_unsigned_integer (buf, call_info.xlen, byte_order, struct_addr); - regcache_cooked_write (regcache, RISCV_A0_REGNUM, buf); + regcache->cooked_write (RISCV_A0_REGNUM, buf); } for (i = 0; i < nargs; ++i) @@ -2124,9 +2124,7 @@ riscv_push_dummy_call (struct gdbarch *gdbarch, gdb_assert (info->argloc[0].c_length <= info->length); memset (tmp, 0, sizeof (tmp)); memcpy (tmp, info->contents, info->argloc[0].c_length); - regcache_cooked_write (regcache, - info->argloc[0].loc_data.regno, - tmp); + regcache->cooked_write (info->argloc[0].loc_data.regno, tmp); second_arg_length = ((info->argloc[0].c_length < info->length) ? info->argloc[1].c_length : 0); @@ -2163,9 +2161,7 @@ riscv_push_dummy_call (struct gdbarch *gdbarch, gdb_assert (second_arg_length <= call_info.xlen); memset (tmp, 0, sizeof (tmp)); memcpy (tmp, second_arg_data, second_arg_length); - regcache_cooked_write (regcache, - info->argloc[1].loc_data.regno, - tmp); + regcache->cooked_write (info->argloc[1].loc_data.regno, tmp); } break; @@ -2251,7 +2247,7 @@ riscv_return_value (struct gdbarch *gdbarch, regcache->cooked_read (regnum, readbuf); if (writebuf) - regcache_cooked_write (regcache, regnum, writebuf); + regcache->cooked_write (regnum, writebuf); /* A return value in register can have a second part in a second register. */ @@ -2271,7 +2267,7 @@ riscv_return_value (struct gdbarch *gdbarch, if (writebuf) { writebuf += info.argloc[1].c_offset; - regcache_cooked_write (regcache, regnum, writebuf); + regcache->cooked_write (regnum, writebuf); } break; diff --git a/gdb/rs6000-aix-tdep.c b/gdb/rs6000-aix-tdep.c index bb9e6be..8e69c46 100644 --- a/gdb/rs6000-aix-tdep.c +++ b/gdb/rs6000-aix-tdep.c @@ -250,7 +250,7 @@ rs6000_push_dummy_call (struct gdbarch *gdbarch, struct value *function, gdb_assert (len <= 8); target_float_convert (value_contents (arg), type, reg_val, reg_type); - regcache_cooked_write (regcache, fp_regnum, reg_val); + regcache->cooked_write (fp_regnum, reg_val); ++f_argno; } @@ -266,9 +266,7 @@ rs6000_push_dummy_call (struct gdbarch *gdbarch, struct value *function, ((char *) value_contents (arg)) + argbytes, (len - argbytes) > reg_size ? reg_size : len - argbytes); - regcache_cooked_write (regcache, - tdep->ppc_gp0_regnum + 3 + ii, - word); + regcache->cooked_write (tdep->ppc_gp0_regnum + 3 + ii, word); ++ii, argbytes += reg_size; if (ii >= 8) @@ -284,7 +282,7 @@ rs6000_push_dummy_call (struct gdbarch *gdbarch, struct value *function, memset (word, 0, reg_size); memcpy (word, value_contents (arg), len); - regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 3 +ii, word); + regcache->cooked_write (tdep->ppc_gp0_regnum + 3 +ii, word); } ++argno; } @@ -366,9 +364,8 @@ ran_out_of_registers_for_arguments: gdb_assert (len <= 8); - regcache_cooked_write (regcache, - tdep->ppc_fp0_regnum + 1 + f_argno, - value_contents (arg)); + regcache->cooked_write (tdep->ppc_fp0_regnum + 1 + f_argno, + value_contents (arg)); ++f_argno; } @@ -422,7 +419,7 @@ rs6000_return_value (struct gdbarch *gdbarch, struct value *function, if (readbuf) regcache->cooked_read (tdep->ppc_vr0_regnum + 2, readbuf); if (writebuf) - regcache_cooked_write (regcache, tdep->ppc_vr0_regnum + 2, writebuf); + regcache->cooked_write (tdep->ppc_vr0_regnum + 2, writebuf); return RETURN_VALUE_REGISTER_CONVENTION; } @@ -458,7 +455,7 @@ rs6000_return_value (struct gdbarch *gdbarch, struct value *function, if (writebuf) { target_float_convert (writebuf, valtype, regval, regtype); - regcache_cooked_write (regcache, tdep->ppc_fp0_regnum + 1, regval); + regcache->cooked_write (tdep->ppc_fp0_regnum + 1, regval); } return RETURN_VALUE_REGISTER_CONVENTION; @@ -510,9 +507,8 @@ rs6000_return_value (struct gdbarch *gdbarch, struct value *function, } if (writebuf) { - regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 3, writebuf); - regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 4, - writebuf + 4); + regcache->cooked_write (tdep->ppc_gp0_regnum + 3, writebuf); + regcache->cooked_write (tdep->ppc_gp0_regnum + 4, writebuf + 4); } return RETURN_VALUE_REGISTER_CONVENTION; diff --git a/gdb/rs6000-lynx178-tdep.c b/gdb/rs6000-lynx178-tdep.c index 37ac617..13eed3a 100644 --- a/gdb/rs6000-lynx178-tdep.c +++ b/gdb/rs6000-lynx178-tdep.c @@ -112,7 +112,7 @@ rs6000_lynx178_push_dummy_call (struct gdbarch *gdbarch, gdb_assert (len <= 8); target_float_convert (value_contents (arg), type, reg_val, reg_type); - regcache_cooked_write (regcache, fp_regnum, reg_val); + regcache->cooked_write (fp_regnum, reg_val); ++f_argno; } @@ -128,9 +128,7 @@ rs6000_lynx178_push_dummy_call (struct gdbarch *gdbarch, ((char *) value_contents (arg)) + argbytes, (len - argbytes) > reg_size ? reg_size : len - argbytes); - regcache_cooked_write (regcache, - tdep->ppc_gp0_regnum + 3 + ii, - word); + regcache->cooked_write (tdep->ppc_gp0_regnum + 3 + ii, word); ++ii, argbytes += reg_size; if (ii >= 8) @@ -146,7 +144,7 @@ rs6000_lynx178_push_dummy_call (struct gdbarch *gdbarch, memset (word, 0, reg_size); memcpy (word, value_contents (arg), len); - regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 3 +ii, word); + regcache->cooked_write (tdep->ppc_gp0_regnum + 3 +ii, word); } ++argno; } @@ -229,9 +227,8 @@ ran_out_of_registers_for_arguments: gdb_assert (len <= 8); - regcache_cooked_write (regcache, - tdep->ppc_fp0_regnum + 1 + f_argno, - value_contents (arg)); + regcache->cooked_write (tdep->ppc_fp0_regnum + 1 + f_argno, + value_contents (arg)); ++f_argno; } @@ -283,7 +280,7 @@ rs6000_lynx178_return_value (struct gdbarch *gdbarch, struct value *function, if (readbuf) regcache->cooked_read (tdep->ppc_vr0_regnum + 2, readbuf); if (writebuf) - regcache_cooked_write (regcache, tdep->ppc_vr0_regnum + 2, writebuf); + regcache->cooked_write (tdep->ppc_vr0_regnum + 2, writebuf); return RETURN_VALUE_REGISTER_CONVENTION; } @@ -319,7 +316,7 @@ rs6000_lynx178_return_value (struct gdbarch *gdbarch, struct value *function, if (writebuf) { target_float_convert (writebuf, valtype, regval, regtype); - regcache_cooked_write (regcache, tdep->ppc_fp0_regnum + 1, regval); + regcache->cooked_write (tdep->ppc_fp0_regnum + 1, regval); } return RETURN_VALUE_REGISTER_CONVENTION; @@ -371,9 +368,8 @@ rs6000_lynx178_return_value (struct gdbarch *gdbarch, struct value *function, } if (writebuf) { - regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 3, writebuf); - regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 4, - writebuf + 4); + regcache->cooked_write (tdep->ppc_gp0_regnum + 3, writebuf); + regcache->cooked_write (tdep->ppc_gp0_regnum + 4, writebuf + 4); } return RETURN_VALUE_REGISTER_CONVENTION; diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c index 8a82fb9..eaf1550 100644 --- a/gdb/s390-tdep.c +++ b/gdb/s390-tdep.c @@ -1800,12 +1800,10 @@ s390_handle_arg (struct s390_arg_state *as, struct value *arg, { if (write_mode) { - regcache_cooked_write (as->regcache, - S390_R0_REGNUM + as->gr, - value_contents (arg)); - regcache_cooked_write (as->regcache, - S390_R0_REGNUM + as->gr + 1, - value_contents (arg) + word_size); + as->regcache->cooked_write (S390_R0_REGNUM + as->gr, + value_contents (arg)); + as->regcache->cooked_write (S390_R0_REGNUM + as->gr + 1, + value_contents (arg) + word_size); } as->gr += 2; } @@ -2018,9 +2016,8 @@ s390_register_return_value (struct gdbarch *gdbarch, struct type *type, /* Double word: in r2 and r3. */ if (in != NULL) { - regcache_cooked_write (regcache, S390_R2_REGNUM, in); - regcache_cooked_write (regcache, S390_R3_REGNUM, - in + word_size); + regcache->cooked_write (S390_R2_REGNUM, in); + regcache->cooked_write (S390_R3_REGNUM, in + word_size); } else { diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c index b3b3dcb..40d213f 100644 --- a/gdb/sparc-tdep.c +++ b/gdb/sparc-tdep.c @@ -685,9 +685,9 @@ sparc32_store_arguments (struct regcache *regcache, int nargs, { int regnum = SPARC_O0_REGNUM + element; - regcache_cooked_write (regcache, regnum, valbuf); + regcache->cooked_write (regnum, valbuf); if (len > 4 && element < 5) - regcache_cooked_write (regcache, regnum + 1, valbuf + 4); + regcache->cooked_write (regnum + 1, valbuf + 4); } /* Always store the argument in memory. */ @@ -1463,20 +1463,20 @@ sparc32_store_return_value (struct type *type, struct regcache *regcache, { /* Floating return values. */ memcpy (buf, valbuf, len); - regcache_cooked_write (regcache, SPARC_F0_REGNUM, buf); + regcache->cooked_write (SPARC_F0_REGNUM, buf); if (len > 4) - regcache_cooked_write (regcache, SPARC_F1_REGNUM, buf + 4); + regcache->cooked_write (SPARC_F1_REGNUM, buf + 4); if (len > 8) { - regcache_cooked_write (regcache, SPARC_F2_REGNUM, buf + 8); - regcache_cooked_write (regcache, SPARC_F3_REGNUM, buf + 12); + regcache->cooked_write (SPARC_F2_REGNUM, buf + 8); + regcache->cooked_write (SPARC_F3_REGNUM, buf + 12); } if (len > 16) { - regcache_cooked_write (regcache, SPARC_F4_REGNUM, buf + 16); - regcache_cooked_write (regcache, SPARC_F5_REGNUM, buf + 20); - regcache_cooked_write (regcache, SPARC_F6_REGNUM, buf + 24); - regcache_cooked_write (regcache, SPARC_F7_REGNUM, buf + 28); + regcache->cooked_write (SPARC_F4_REGNUM, buf + 16); + regcache->cooked_write (SPARC_F5_REGNUM, buf + 20); + regcache->cooked_write (SPARC_F6_REGNUM, buf + 24); + regcache->cooked_write (SPARC_F7_REGNUM, buf + 28); } } else @@ -1488,14 +1488,14 @@ sparc32_store_return_value (struct type *type, struct regcache *regcache, { gdb_assert (len == 8); memcpy (buf, valbuf, 8); - regcache_cooked_write (regcache, SPARC_O1_REGNUM, buf + 4); + regcache->cooked_write (SPARC_O1_REGNUM, buf + 4); } else { /* ??? Do we need to do any sign-extension here? */ memcpy (buf + 4 - len, valbuf, len); } - regcache_cooked_write (regcache, SPARC_O0_REGNUM, buf); + regcache->cooked_write (SPARC_O0_REGNUM, buf); } } diff --git a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c index ed1aaff..dea8e4d 100644 --- a/gdb/sparc64-tdep.c +++ b/gdb/sparc64-tdep.c @@ -1226,7 +1226,7 @@ sparc64_store_floating_fields (struct regcache *regcache, struct type *type, len = 8; } for (int n = 0; n < (len + 3) / 4; n++) - regcache_cooked_write (regcache, regnum + n, valbuf + n * 4); + regcache->cooked_write (regnum + n, valbuf + n * 4); } else if (sparc64_floating_p (type) || (sparc64_complex_floating_p (type) && len <= 16)) @@ -1239,7 +1239,7 @@ sparc64_store_floating_fields (struct regcache *regcache, struct type *type, gdb_assert ((element % 2) == 0); regnum = gdbarch_num_regs (gdbarch) + SPARC64_Q0_REGNUM + element / 2; - regcache_cooked_write (regcache, regnum, valbuf); + regcache->cooked_write (regnum, valbuf); } else if (len == 8) { @@ -1247,7 +1247,7 @@ sparc64_store_floating_fields (struct regcache *regcache, struct type *type, regnum = gdbarch_num_regs (gdbarch) + SPARC64_D0_REGNUM + element + bitpos / 64; - regcache_cooked_write (regcache, regnum, valbuf + (bitpos / 8)); + regcache->cooked_write (regnum, valbuf + (bitpos / 8)); } else { @@ -1255,7 +1255,7 @@ sparc64_store_floating_fields (struct regcache *regcache, struct type *type, gdb_assert (bitpos % 32 == 0 && bitpos >= 0 && bitpos < 128); regnum = SPARC_F0_REGNUM + element * 2 + bitpos / 32; - regcache_cooked_write (regcache, regnum, valbuf + (bitpos / 8)); + regcache->cooked_write (regnum, valbuf + (bitpos / 8)); } } else if (sparc64_structure_or_union_p (type)) @@ -1285,7 +1285,7 @@ sparc64_store_floating_fields (struct regcache *regcache, struct type *type, struct type *subtype = check_typedef (TYPE_FIELD_TYPE (type, 0)); if (sparc64_floating_p (subtype) && TYPE_LENGTH (subtype) == 4) - regcache_cooked_write (regcache, SPARC_F1_REGNUM, valbuf); + regcache->cooked_write (SPARC_F1_REGNUM, valbuf); } } } @@ -1506,7 +1506,7 @@ sparc64_store_arguments (struct regcache *regcache, int nargs, { regnum = SPARC_O0_REGNUM + element; if (len > 8 && element < 5) - regcache_cooked_write (regcache, regnum + 1, valbuf + 8); + regcache->cooked_write (regnum + 1, valbuf + 8); } if (element < 16) @@ -1522,11 +1522,10 @@ sparc64_store_arguments (struct regcache *regcache, int nargs, if (len == 16) { if (regnum < gdbarch_num_regs (gdbarch) + SPARC64_D30_REGNUM) - regcache_cooked_write (regcache, regnum + 1, valbuf + 8); + regcache->cooked_write (regnum + 1, valbuf + 8); if (regnum < gdbarch_num_regs (gdbarch) + SPARC64_D10_REGNUM) - regcache_cooked_write (regcache, - SPARC_O0_REGNUM + element + 1, - valbuf + 8); + regcache->cooked_write (SPARC_O0_REGNUM + element + 1, + valbuf + 8); } } } @@ -1574,7 +1573,7 @@ sparc64_store_arguments (struct regcache *regcache, int nargs, if (regnum != -1) { - regcache_cooked_write (regcache, regnum, valbuf); + regcache->cooked_write (regnum, valbuf); /* If we're storing the value in a floating-point register, also store it in the corresponding %0 register(s). */ @@ -1586,14 +1585,14 @@ sparc64_store_arguments (struct regcache *regcache, int nargs, { gdb_assert (element < 6); regnum = SPARC_O0_REGNUM + element; - regcache_cooked_write (regcache, regnum, valbuf); + regcache->cooked_write (regnum, valbuf); } else if (regnum >= SPARC64_Q0_REGNUM && regnum <= SPARC64_Q8_REGNUM) { gdb_assert (element < 5); regnum = SPARC_O0_REGNUM + element; - regcache_cooked_write (regcache, regnum, valbuf); - regcache_cooked_write (regcache, regnum + 1, valbuf + 8); + regcache->cooked_write (regnum, valbuf); + regcache->cooked_write (regnum + 1, valbuf + 8); } } } @@ -1715,7 +1714,7 @@ sparc64_store_return_value (struct type *type, struct regcache *regcache, memset (buf, 0, sizeof (buf)); memcpy (buf, valbuf, len); for (i = 0; i < ((len + 7) / 8); i++) - regcache_cooked_write (regcache, SPARC_O0_REGNUM + i, buf + i * 8); + regcache->cooked_write (SPARC_O0_REGNUM + i, buf + i * 8); if (TYPE_CODE (type) != TYPE_CODE_UNION) sparc64_store_floating_fields (regcache, type, buf, 0, 0); } @@ -1724,7 +1723,7 @@ sparc64_store_return_value (struct type *type, struct regcache *regcache, /* Floating return values. */ memcpy (buf, valbuf, len); for (i = 0; i < len / 4; i++) - regcache_cooked_write (regcache, SPARC_F0_REGNUM + i, buf + i * 4); + regcache->cooked_write (SPARC_F0_REGNUM + i, buf + i * 4); } else if (TYPE_CODE (type) == TYPE_CODE_ARRAY) { @@ -1734,7 +1733,7 @@ sparc64_store_return_value (struct type *type, struct regcache *regcache, memset (buf, 0, sizeof (buf)); memcpy (buf, valbuf, len); for (i = 0; i < ((len + 7) / 8); i++) - regcache_cooked_write (regcache, SPARC_O0_REGNUM + i, buf + i * 8); + regcache->cooked_write (SPARC_O0_REGNUM + i, buf + i * 8); } else { @@ -1744,7 +1743,7 @@ sparc64_store_return_value (struct type *type, struct regcache *regcache, /* ??? Do we need to do any sign-extension here? */ memset (buf, 0, 8); memcpy (buf + 8 - len, valbuf, len); - regcache_cooked_write (regcache, SPARC_O0_REGNUM, buf); + regcache->cooked_write (SPARC_O0_REGNUM, buf); } } diff --git a/gdb/spu-tdep.c b/gdb/spu-tdep.c index 1d0766e..d8a2107 100644 --- a/gdb/spu-tdep.c +++ b/gdb/spu-tdep.c @@ -1362,7 +1362,7 @@ spu_value_to_regcache (struct regcache *regcache, int regnum, { while (len >= 16) { - regcache_cooked_write (regcache, regnum++, in); + regcache->cooked_write (regnum++, in); in += 16; len -= 16; } @@ -1413,7 +1413,7 @@ spu_push_dummy_call (struct gdbarch *gdbarch, struct value *function, /* Set the return address. */ memset (buf, 0, sizeof buf); store_unsigned_integer (buf, 4, byte_order, SPUADDR_ADDR (bp_addr)); - regcache_cooked_write (regcache, SPU_LR_REGNUM, buf); + regcache->cooked_write (SPU_LR_REGNUM, buf); /* If STRUCT_RETURN is true, then the struct return address (in STRUCT_ADDR) will consume the first argument-passing register. @@ -1422,7 +1422,7 @@ spu_push_dummy_call (struct gdbarch *gdbarch, struct value *function, { memset (buf, 0, sizeof buf); store_unsigned_integer (buf, 4, byte_order, SPUADDR_ADDR (struct_addr)); - regcache_cooked_write (regcache, regnum++, buf); + regcache->cooked_write (regnum++, buf); } /* Fill in argument registers. */ @@ -1490,7 +1490,7 @@ spu_push_dummy_call (struct gdbarch *gdbarch, struct value *function, CORE_ADDR sp_slot = extract_unsigned_integer (buf + 4*i, 4, byte_order); store_unsigned_integer (buf + 4*i, 4, byte_order, sp_slot + sp_delta); } - regcache_cooked_write (regcache, SPU_RAW_SP_REGNUM, buf); + regcache->cooked_write (SPU_RAW_SP_REGNUM, buf); return sp; } diff --git a/gdb/tic6x-tdep.c b/gdb/tic6x-tdep.c index b2db026..842fe3f 100644 --- a/gdb/tic6x-tdep.c +++ b/gdb/tic6x-tdep.c @@ -764,19 +764,19 @@ tic6x_store_return_value (struct type *valtype, struct regcache *regcache, regcache_cooked_write_part (regcache, TIC6X_A4_REGNUM, 4 - len, len, valbuf); else - regcache_cooked_write (regcache, TIC6X_A4_REGNUM, valbuf); + regcache->cooked_write (TIC6X_A4_REGNUM, valbuf); } else if (len <= 8) { if (byte_order == BFD_ENDIAN_BIG) { - regcache_cooked_write (regcache, TIC6X_A4_REGNUM, valbuf + 4); - regcache_cooked_write (regcache, TIC6X_A5_REGNUM, valbuf); + regcache->cooked_write (TIC6X_A4_REGNUM, valbuf + 4); + regcache->cooked_write (TIC6X_A5_REGNUM, valbuf); } else { - regcache_cooked_write (regcache, TIC6X_A4_REGNUM, valbuf); - regcache_cooked_write (regcache, TIC6X_A5_REGNUM, valbuf + 4); + regcache->cooked_write (TIC6X_A4_REGNUM, valbuf); + regcache->cooked_write (TIC6X_A5_REGNUM, valbuf + 4); } } } @@ -961,7 +961,7 @@ tic6x_push_dummy_call (struct gdbarch *gdbarch, struct value *function, regcache_cooked_write_part (regcache, arg_regs[argreg], 4 - len, len, val); else - regcache_cooked_write (regcache, arg_regs[argreg], val); + regcache->cooked_write (arg_regs[argreg], val); } else { @@ -988,16 +988,14 @@ tic6x_push_dummy_call (struct gdbarch *gdbarch, struct value *function, padding in the LSBs of the lower (even) register. */ if (byte_order == BFD_ENDIAN_BIG) { - regcache_cooked_write (regcache, - arg_regs[argreg] + 1, val); + regcache->cooked_write (arg_regs[argreg] + 1, val); regcache_cooked_write_part (regcache, arg_regs[argreg], 0, len - 4, val + 4); } else { - regcache_cooked_write (regcache, arg_regs[argreg], - val); + regcache->cooked_write (arg_regs[argreg], val); regcache_cooked_write_part (regcache, arg_regs[argreg] + 1, 0, len - 4, val + 4); diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c index a1783ec..de07fdb 100644 --- a/gdb/vax-tdep.c +++ b/gdb/vax-tdep.c @@ -133,7 +133,7 @@ vax_store_arguments (struct regcache *regcache, int nargs, /* Update the argument pointer. */ store_unsigned_integer (buf, 4, byte_order, sp); - regcache_cooked_write (regcache, VAX_AP_REGNUM, buf); + regcache->cooked_write (VAX_AP_REGNUM, buf); return sp; } @@ -180,8 +180,8 @@ vax_push_dummy_call (struct gdbarch *gdbarch, struct value *function, /* Update the stack pointer and frame pointer. */ store_unsigned_integer (buf, 4, byte_order, sp); - regcache_cooked_write (regcache, VAX_SP_REGNUM, buf); - regcache_cooked_write (regcache, VAX_FP_REGNUM, buf); + regcache->cooked_write (VAX_SP_REGNUM, buf); + regcache->cooked_write (VAX_FP_REGNUM, buf); /* Return the saved (fake) frame pointer. */ return fp; @@ -236,9 +236,9 @@ vax_return_value (struct gdbarch *gdbarch, struct value *function, { /* Read the contents to R0 and (if necessary) R1. */ memcpy (buf, writebuf, len); - regcache_cooked_write (regcache, VAX_R0_REGNUM, buf); + regcache->cooked_write (VAX_R0_REGNUM, buf); if (len > 4) - regcache_cooked_write (regcache, VAX_R1_REGNUM, buf + 4); + regcache->cooked_write (VAX_R1_REGNUM, buf + 4); } return RETURN_VALUE_REGISTER_CONVENTION; diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c index 3785c44..1f87b9c 100644 --- a/gdb/xtensa-tdep.c +++ b/gdb/xtensa-tdep.c @@ -1846,7 +1846,7 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, if (struct_return) { store_unsigned_integer (buf, REGISTER_SIZE, byte_order, struct_addr); - regcache_cooked_write (regcache, ARG_1ST (gdbarch), buf); + regcache->cooked_write (ARG_1ST (gdbarch), buf); } for (i = 0; i < nargs; i++) @@ -1888,7 +1888,7 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, v = v >> ((REGISTER_SIZE - n) * TARGET_CHAR_BIT); store_unsigned_integer (buf, REGISTER_SIZE, byte_order, v); - regcache_cooked_write (regcache, r, buf); + regcache->cooked_write (r, buf); cp += REGISTER_SIZE; n -= REGISTER_SIZE; @@ -1897,7 +1897,7 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, else while (n > 0) { - regcache_cooked_write (regcache, r, cp); + regcache->cooked_write (r, cp); cp += REGISTER_SIZE; n -= REGISTER_SIZE;