From patchwork Wed May 30 19:03:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 27582 Received: (qmail 43680 invoked by alias); 30 May 2018 19:05:38 -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 43455 invoked by uid 89); 30 May 2018 19:05:36 -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=transfers X-HELO: sessmg23.ericsson.net Received: from sessmg23.ericsson.net (HELO sessmg23.ericsson.net) (193.180.251.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 30 May 2018 19:05:27 +0000 Received: from ESESSHC023.ericsson.se (Unknown_Domain [153.88.183.87]) by sessmg23.ericsson.net (Symantec Mail Security) with SMTP id 01.B6.10459.7E5FE0B5; Wed, 30 May 2018 21:05:11 +0200 (CEST) Received: from ESESSMR501.ericsson.se (153.88.183.108) by ESESSHC023.ericsson.se (153.88.183.87) with Microsoft SMTP Server (TLS) id 14.3.382.0; Wed, 30 May 2018 21:04:22 +0200 Received: from ESESBMB502.ericsson.se (153.88.183.169) by ESESSMR501.ericsson.se (153.88.183.108) 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:21 +0200 Received: from NAM02-CY1-obe.outbound.protection.outlook.com (153.88.183.157) by ESESBMB502.ericsson.se (153.88.183.169) 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:21 +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:18 +0000 From: Simon Marchi To: CC: Simon Marchi Subject: [pushed 01/15] Remove regcache_get_ptid Date: Wed, 30 May 2018 15:03:39 -0400 Message-ID: <1527707033-27183-2-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:o+wB1odYoXyzrZCBXs3PzZXeEFQVtzXhneBWslYdVEAOcYx97107f4SzgLHcghDUA21e/wJrgk8ht9IV3FXW7Wg+kcaqC5K2MYSfcXy5PILaw315cM38r0WmlfB3A82WKj78nk+mcz6y94hrE8pLp7fai+tzvD+thN58RDoByhZTAYr8D1pqW3PS/N8seMYpJK/+91e8vvkMX6HFh7B39JUnXcMB3vQ+f4mRfqGHgxp3fobNRJnSgw5evnzlKd6s; 25:UU8vg4dAbmYxEmflo2sQM2pAeST8lLuz9qUk1c/tditxzNVz2vqvvTmazXUCCLChrRifayQUO8TLfrtBzuICSz0Glhog38KFdCrEOrfaozxs6j9ISytlqXygtXizGleZ6QZEiUGCaXC+YS115BSyvPQabS8CpBo0wkwB7X1gaq6l6vMakr0/zD1vPrm1un8OdEOcuKGKDIn7nB+/3qSrCm77WgHdP4y3xsNwn+L9JtvRZTX+mCPPWlzs06jLdKrRt63oFUL6QgneNNuuDGHMzUIOTZ+J4fD0jAQ0HVMWJSuRRVNtDDMLH3K2EdsLj5c3BflJ/81dVMuJQIgrnuG3Qg==; 31:km90Q1ajfMhnwbYawQqk1jNR0Ahsvw8QRDsly2y+7cg5SFH+iwhyVXGoH3GYXNIumByoMZosUucy8oDHJndyo7mDmHBcZhL5T7i1i6rLQWPb45VyVj+NcyRTZFTOorE5/06l+XYko6ylbB9oPuVICsoDTJmOdauw/5atYynhrK1k/HZ/hO64tGi/+DC4FtOBqzfympQ5bCcqbYF/l4o8+v9S81FXpCZcuoQOHvL7qvs= X-MS-TrafficTypeDiagnostic: BYAPR15MB2392: X-Microsoft-Exchange-Diagnostics: 1; BYAPR15MB2392; 20:uxwjmGp7MtoGjPUEgwssyattPlvmjhgVHqEluHTT5OFDh2+mWdQL3cvjDo44klbRmCFhApfsuIEZg5HN/VpD45OAf8MEsUNqN1KmBdw0x0jehy+andxA/z/W2px6SqHg5Go6GL/zOJrNfsUnOZ5eNxlJhyCyktRV2bf1zuFw8ykY0WDrI9Vi2xvXIchfM22+YMAng0GCJf6v9tGqjd76PeOkQI9Tvp1KX+ZoBIimZZlGguEXQiD2XM+62AXNSQFFFByKOpecUZlHU5XPvTrz0M1/dc0ijl3ydryyIawy3GKDWTFJnRKSk4epWqyHABJNZdVz2LcefjBTkKorFz233ZVVP/HfDVQmd0tTRA7K8T6ielLEw38FXhd/DIO238O7/WpZSVRWwjhDX8PbyWLbgwTNGDaJx/i7oP/IZf5XnXx1buypnEQIePYJM9XPaCkKm0U2e+PzP+t5T5AHJUTfDW6XLMSRBlTVmMqZ6cNXHVxNu1593KACkz9BxK7z1F4B; 4:tSx+Igvec2OKzfpsd4mLvLgwYdUc5fiCi92Kh++mTn7txxNLIfz+wYBbdI8C/oDrcye5YqOFCAvuDFCbsPIwPdlZonGU9qnZxSVVR6coT2eZL67Qy48/ftTuOMhY8cd4pp0odfFSEzP2QTxPh0xcn2onDwJSvdz4nZEXXH6N63uyQJvdjB69cSa1BUV4mXeSJwNjWXsQf++qehO/4eG/R82WhLX+QCQIsorvhJPcBGKue7+MX8qu89A6k6bfGjgqti+e+2MJlYVZbBYK0QhF8B0TdkNO/71pk6b4jmZUg8Hs49U/5TorS4chJA0iIdBJ 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)(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)(97736004)(4326008)(16526019)(5660300001)(186003)(6116002)(3846002)(316002)(16586007)(2361001)(2351001)(48376002)(478600001)(105586002)(59450400001)(107886003)(50466002)(66066001)(106356001)(579004)(559001); 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:69D0UdOBk/VVnocFkhZIDkYE2NzfMJvKLVUM1gPYB?= =?us-ascii?Q?So+PzF5a99vpbU/N9jxfYiup38b7m74YuIjNLkMMOGlQILRzOkiGBxdJw9v7?= =?us-ascii?Q?PDybeECjRM6Aogh3SSY9zPV0OCdq0+I4Ta9Le/EUpfRRgeDw2aKxsR9NCU0u?= =?us-ascii?Q?6GC8k/SMIUQA8ciToFg3EXG32+hG55upRmplus1Y2Moi8Dvy3ubdl0B7BTIq?= =?us-ascii?Q?su2QH+WVGhMZ5quRkXuYXVeKsJAXAHt4b0CQ45M5E/pJ5ul0wCH84RiWSUJt?= =?us-ascii?Q?xQqqg0WAC1eKrG4CmW/8VeTaltk60KRsUaZZOzCQHfLtHTBZBpsKoRnCMVAg?= =?us-ascii?Q?oOn7Go5qA6EX4cre8feWgGWupZCC/q23zf+r0pLNRyls9c7iU+MJEwJ0hB4X?= =?us-ascii?Q?S/qM7SUqxtactijPMyvWpOV3puxoGuq9pLIboHJeC+ZXUMN/2jiVQK+VWYpg?= =?us-ascii?Q?CV915RjsaOeA1Iynv3tbYljBrlybxIqLJxNq2wJgTWkJ32i8Qy1P43HdzkZn?= =?us-ascii?Q?lQIjH2e8C2lvCDSokXJgpF8u6E4ykKOwSyBxEltYw3DQcKBx/gRjciNeYCKa?= =?us-ascii?Q?gZK82zfl8vht7QIqYCvOTPa4c/N71hgmZzcPFmZL70MDANbS9E3JAjrGLJCY?= =?us-ascii?Q?yuZln7uYA4sGe41/scAxFpap5QNBTC+mMmzmQ35U5woI368NhXaZsAmtoWh2?= =?us-ascii?Q?t6b58XMq5y9GEIHNW9L4owQp7Lx8nX+NxQWfeQQNvUyeJCsqgJsCDuz8VxBO?= =?us-ascii?Q?XlQyhR+VjMRgYVuSRRun3EbFE+mEMRIFXU8Mu0AvXk6JVZ3OekfHaXmd+8pB?= =?us-ascii?Q?3VyL4CeIaY2zhCP6BGPPQ1qgR+9ozTXSjeDd1UYcPeGngn+ncOCdpC4Ofbnk?= =?us-ascii?Q?xl98IbM7kOHWrWgZxwIaY6SL02ost0Pjw7kq5KptIVOFfUtVYIJtrpmaJNws?= =?us-ascii?Q?AyQHqMhNw4qD5N5fF2AYJ/nJuN6g1JfLq5V+5cWJXQqTpKaQIxyQpItBWy77?= =?us-ascii?Q?bPr6adudhm1qcGMI3Ci7dGnSUQyzXWVHXK7pkiXiSmXtgkz9/QC3JP+sFeWV?= =?us-ascii?Q?Zjqes871o84e40NbpvbLC+7Iq0etH+quuxH4ksddyqvBWmkpZOIUIFwVZLH3?= =?us-ascii?Q?n9jugLm3FMvjyHNz2cMes97FwIDfD6DS+TudURAEIv3WeNrg9d6I+wpaZd9+?= =?us-ascii?Q?f+ScZo8kalyT4jimjAlSvHHbkuCYZdCONXhdR8gFW5AaSLKCdCn5k4FHjEuJ?= =?us-ascii?Q?DFn2e32dqBtfpRqKInxy95fFq5pibx0QHavjgAEZLpyNwrBSk2jA3xcmiddd?= =?us-ascii?Q?kus8hIQ5Mrqn2QEPpr7s20aNRzTiZYBYZXqCSIs0mAHZpjkpt5kgq0+5oiX5?= =?us-ascii?Q?132N9apeWNCdQ+I5bpH1p5B8Qc=3D?= X-Microsoft-Antispam-Message-Info: C5T40wjKIl2w2nJPhHiw9acIqz+Jvty7ECKpK4VgQ213Oe0Q07DThlxlTjRrX7Ti190GD0EtfniodMw9iIfIZ9sB1mWeo++d0zuBrb1vCdztMXVdOfd/GqYE/1jxi7+n0LsrMkyKcf6SGTzl21aDXjWjwYxz7KK9Q/+ee88ij+dlC14yQYqQkX5NTxO0Pva7 X-Microsoft-Exchange-Diagnostics: 1; BYAPR15MB2392; 6:oR+abFiQRQtMk9i7kPLcvlohGV7Uhwurpj+pvE4ljX6AChIzu+jIR5Zpjf8OALTGHwPKqfU/HuHjeAv26dn65uXeQcfikI/9Mdylf8pGnY4n3hwmeNmeOvuqYxim1dS0n6fGzBkQ7C6+EwNm/cqOiJ8Doekro1BSkiWSKtimWVe8L96RJ8SRY8pO9nc/PDhxtKMxDi+/Cq+NJz9jEhcHKr9CutLd01AbGeVXBdG5Zcs8pdQJ+oqdS+y9Jwl/cd9I7ldkNAzOr1lRviZcnTkN+X8ItTAhzLfyizHUHGzlbeOI7GnywemBuE/MXCpvgsdLhzKURVzhLKTG4DaazyEXY7DSv4mB4717vNcWxprwWrxnc8YmPEnHH7KwYIchT6seExWtLeWtsBbtRcvrVo7S4Sx189w1DkIDIW9mBNf2dGArhriUWdaOfKM5ZFf55S5ayMEcjJY+o/NM+IXFvyYMRQ==; 5:OOGrD3SuUy98Y1jqsVzudBcdKazleJSJ3awIq33LrS5w2pY2WKpPZPxUW7q58meCfkvZ/dmBMH/4PqNM5q3ehcVqcXl3USUKCpC9/HKOnBsS3wmhonvP31G53xdTAadIGC1//KKRsZsEhcEHKdxYM4srK4jgdJg9ZTLjoGHeyDA=; 24:A+SwcZXP5M5GzOhNSDVZxbGSlKrH5uG6s/EAlW8xHUP/qrDc/fC1rkbHAXfdebLdER9ObHdyinkdYVmWoyUmRiqS37r74tvMkMj3k3QGnJs= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BYAPR15MB2392; 7:kK1IT7DPbuPXK3z8tqZA5+dBD0E2r4SIU1kX6zy99gLme32zHS0PK+Y2lqXmb4HPh0t4jaRSkd1qRTOhQFewTYaeW4RIjLxgejTPAT9XmRPOYRJ0o2BwarwmYx22f9NxSW+Op8qDXTeHEQXpZgHM576+IK8FrV1luC4r+DnToApmdGiHyoPeZHp07dhSmhWuWer9FrfJnFqUITIIiJALuR3Sz2IUcmzS48aWhlCApRrMqDSQwCheqyrOh/IaXmw5 X-MS-Office365-Filtering-Correlation-Id: 747f0907-de3a-42f4-e007-08d5c6602571 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2018 19:04:18.6266 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 747f0907-de3a-42f4-e007-08d5c6602571 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_get_ptid, change all callers to call the regcache method directly. gdb/ChangeLog: * regcache.h (regcache_get_ptid): Remove, update all callers to call regcache::ptid instead. * regcache.c (regcache_get_ptid): Remove. --- gdb/ChangeLog | 6 ++++++ gdb/aarch64-fbsd-nat.c | 4 ++-- gdb/aarch64-linux-nat.c | 8 ++++---- gdb/aix-thread.c | 8 ++++---- gdb/alpha-bsd-nat.c | 12 ++++++------ gdb/amd64-bsd-nat.c | 4 ++-- gdb/amd64-linux-nat.c | 8 ++++---- gdb/arm-fbsd-nat.c | 4 ++-- gdb/arm-linux-nat.c | 16 ++++++++-------- gdb/arm-nbsd-nat.c | 20 ++++++++++---------- gdb/bsd-uthread.c | 4 ++-- gdb/hppa-linux-nat.c | 4 ++-- gdb/hppa-nbsd-nat.c | 4 ++-- gdb/hppa-obsd-nat.c | 2 +- gdb/i386-bsd-nat.c | 4 ++-- gdb/i386-darwin-nat.c | 4 ++-- gdb/i386-gnu-nat.c | 4 ++-- gdb/i386-linux-nat.c | 8 ++++---- gdb/ia64-linux-nat.c | 4 ++-- gdb/linux-nat-trad.c | 4 ++-- gdb/m32r-linux-nat.c | 4 ++-- gdb/m68k-bsd-nat.c | 4 ++-- gdb/m68k-linux-nat.c | 8 ++++---- gdb/mips-fbsd-nat.c | 4 ++-- gdb/mips-linux-nat.c | 4 ++-- gdb/mips-nbsd-nat.c | 4 ++-- gdb/mips64-obsd-nat.c | 4 ++-- gdb/nto-procfs.c | 4 ++-- gdb/ppc-fbsd-nat.c | 4 ++-- gdb/ppc-linux-nat.c | 4 ++-- gdb/ppc-nbsd-nat.c | 4 ++-- gdb/ppc-obsd-nat.c | 4 ++-- gdb/procfs.c | 4 ++-- gdb/ravenscar-thread.c | 6 +++--- gdb/record-btrace.c | 6 +++--- gdb/regcache.c | 10 ---------- gdb/regcache.h | 8 ++++---- gdb/remote-sim.c | 4 ++-- gdb/remote.c | 4 ++-- gdb/rs6000-nat.c | 4 ++-- gdb/s390-linux-nat.c | 4 ++-- gdb/sh-nbsd-nat.c | 4 ++-- gdb/sol-thread.c | 4 ++-- gdb/sparc-nat.c | 4 ++-- gdb/spu-linux-nat.c | 4 ++-- gdb/spu-multiarch.c | 4 ++-- gdb/tilegx-linux-nat.c | 4 ++-- gdb/vax-bsd-nat.c | 4 ++-- gdb/windows-nat.c | 4 ++-- gdb/xtensa-linux-nat.c | 8 ++++---- 50 files changed, 135 insertions(+), 139 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 634207b..1c09d21 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ 2018-05-30 Simon Marchi + * regcache.h (regcache_get_ptid): Remove, update all callers to + call regcache::ptid instead. + * regcache.c (regcache_get_ptid): Remove. + +2018-05-30 Simon Marchi + * Makefile.in (ALL_TARGET_OBS): Add or1k-tdep.o. 2018-05-30 Pedro Alves diff --git a/gdb/aarch64-fbsd-nat.c b/gdb/aarch64-fbsd-nat.c index a506563..2d0da7f 100644 --- a/gdb/aarch64-fbsd-nat.c +++ b/gdb/aarch64-fbsd-nat.c @@ -60,7 +60,7 @@ void aarch64_fbsd_nat_target::fetch_registers (struct regcache *regcache, int regnum) { - pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache)); + pid_t pid = get_ptrace_pid (regcache->ptid ()); struct gdbarch *gdbarch = regcache->arch (); if (regnum == -1 || getregs_supplies (gdbarch, regnum)) @@ -93,7 +93,7 @@ void aarch64_fbsd_nat_target::store_registers (struct regcache *regcache, int regnum) { - pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache)); + pid_t pid = get_ptrace_pid (regcache->ptid ()); struct gdbarch *gdbarch = regcache->arch (); if (regnum == -1 || getregs_supplies (gdbarch, regnum)) diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c index 908b83a..3672a2f 100644 --- a/gdb/aarch64-linux-nat.c +++ b/gdb/aarch64-linux-nat.c @@ -208,7 +208,7 @@ fetch_gregs_from_thread (struct regcache *regcache) and arm. */ gdb_static_assert (sizeof (regs) >= 18 * 4); - tid = ptid_get_lwp (regcache_get_ptid (regcache)); + tid = ptid_get_lwp (regcache->ptid ()); iovec.iov_base = ®s; if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 32) @@ -245,7 +245,7 @@ store_gregs_to_thread (const struct regcache *regcache) /* Make sure REGS can hold all registers contents on both aarch64 and arm. */ gdb_static_assert (sizeof (regs) >= 18 * 4); - tid = ptid_get_lwp (regcache_get_ptid (regcache)); + tid = ptid_get_lwp (regcache->ptid ()); iovec.iov_base = ®s; if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 32) @@ -289,7 +289,7 @@ fetch_fpregs_from_thread (struct regcache *regcache) and arm. */ gdb_static_assert (sizeof regs >= VFP_REGS_SIZE); - tid = ptid_get_lwp (regcache_get_ptid (regcache)); + tid = ptid_get_lwp (regcache->ptid ()); iovec.iov_base = ®s; @@ -336,7 +336,7 @@ store_fpregs_to_thread (const struct regcache *regcache) /* Make sure REGS can hold all VFP registers contents on both aarch64 and arm. */ gdb_static_assert (sizeof regs >= VFP_REGS_SIZE); - tid = ptid_get_lwp (regcache_get_ptid (regcache)); + tid = ptid_get_lwp (regcache->ptid ()); iovec.iov_base = ®s; diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c index d328bdd..6f4135b 100644 --- a/gdb/aix-thread.c +++ b/gdb/aix-thread.c @@ -1365,11 +1365,11 @@ aix_thread_target::fetch_registers (struct regcache *regcache, int regno) pthdb_tid_t tid; struct target_ops *beneath = find_target_beneath (this); - if (!PD_TID (regcache_get_ptid (regcache))) + if (!PD_TID (regcache->ptid ())) beneath->fetch_registers (regcache, regno); else { - thread = find_thread_ptid (regcache_get_ptid (regcache)); + thread = find_thread_ptid (regcache->ptid ()); aix_thread_info *priv = get_aix_thread_info (thread); tid = priv->tid; @@ -1719,11 +1719,11 @@ aix_thread_target::store_registers (struct regcache *regcache, int regno) pthdb_tid_t tid; struct target_ops *beneath = find_target_beneath (this); - if (!PD_TID (regcache_get_ptid (regcache))) + if (!PD_TID (regcache->ptid ())) beneath->store_registers (regcache, regno); else { - thread = find_thread_ptid (regcache_get_ptid (regcache)); + thread = find_thread_ptid (regcache->ptid ()); aix_thread_info *priv = get_aix_thread_info (thread); tid = priv->tid; diff --git a/gdb/alpha-bsd-nat.c b/gdb/alpha-bsd-nat.c index 77271ec..e889d22 100644 --- a/gdb/alpha-bsd-nat.c +++ b/gdb/alpha-bsd-nat.c @@ -98,7 +98,7 @@ alpha_bsd_nat_target::fetch_registers (struct regcache *regcache, int regno) { struct reg gregs; - if (ptrace (PT_GETREGS, ptid_get_pid (regcache_get_ptid (regcache)), + if (ptrace (PT_GETREGS, ptid_get_pid (regcache->ptid ()), (PTRACE_TYPE_ARG3) &gregs, 0) == -1) perror_with_name (_("Couldn't get registers")); @@ -112,7 +112,7 @@ alpha_bsd_nat_target::fetch_registers (struct regcache *regcache, int regno) { struct fpreg fpregs; - if (ptrace (PT_GETFPREGS, ptid_get_pid (regcache_get_ptid (regcache)), + if (ptrace (PT_GETFPREGS, ptid_get_pid (regcache->ptid ()), (PTRACE_TYPE_ARG3) &fpregs, 0) == -1) perror_with_name (_("Couldn't get floating point status")); @@ -129,13 +129,13 @@ alpha_bsd_nat_target::store_registers (struct regcache *regcache, int regno) if (regno == -1 || getregs_supplies (regno)) { struct reg gregs; - if (ptrace (PT_GETREGS, ptid_get_pid (regcache_get_ptid (regcache)), + if (ptrace (PT_GETREGS, ptid_get_pid (regcache->ptid ()), (PTRACE_TYPE_ARG3) &gregs, 0) == -1) perror_with_name (_("Couldn't get registers")); alphabsd_fill_reg (regcache, (char *) &gregs, regno); - if (ptrace (PT_SETREGS, ptid_get_pid (regcache_get_ptid (regcache)), + if (ptrace (PT_SETREGS, ptid_get_pid (regcache->ptid ()), (PTRACE_TYPE_ARG3) &gregs, 0) == -1) perror_with_name (_("Couldn't write registers")); @@ -148,13 +148,13 @@ alpha_bsd_nat_target::store_registers (struct regcache *regcache, int regno) { struct fpreg fpregs; - if (ptrace (PT_GETFPREGS, ptid_get_pid (regcache_get_ptid (regcache)), + if (ptrace (PT_GETFPREGS, ptid_get_pid (regcache->ptid ()), (PTRACE_TYPE_ARG3) &fpregs, 0) == -1) perror_with_name (_("Couldn't get floating point status")); alphabsd_fill_fpreg (regcache, (char *) &fpregs, regno); - if (ptrace (PT_SETFPREGS, ptid_get_pid (regcache_get_ptid (regcache)), + if (ptrace (PT_SETFPREGS, ptid_get_pid (regcache->ptid ()), (PTRACE_TYPE_ARG3) &fpregs, 0) == -1) perror_with_name (_("Couldn't write floating point status")); } diff --git a/gdb/amd64-bsd-nat.c b/gdb/amd64-bsd-nat.c index 74a1842..81ba835 100644 --- a/gdb/amd64-bsd-nat.c +++ b/gdb/amd64-bsd-nat.c @@ -42,7 +42,7 @@ void amd64bsd_fetch_inferior_registers (struct regcache *regcache, int regnum) { struct gdbarch *gdbarch = regcache->arch (); - pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache)); + pid_t pid = get_ptrace_pid (regcache->ptid ()); if (regnum == -1 || amd64_native_gregset_supplies_p (gdbarch, regnum)) { @@ -115,7 +115,7 @@ void amd64bsd_store_inferior_registers (struct regcache *regcache, int regnum) { struct gdbarch *gdbarch = regcache->arch (); - pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache)); + pid_t pid = get_ptrace_pid (regcache->ptid ()); if (regnum == -1 || amd64_native_gregset_supplies_p (gdbarch, regnum)) { diff --git a/gdb/amd64-linux-nat.c b/gdb/amd64-linux-nat.c index 1cb4c2c..17de388 100644 --- a/gdb/amd64-linux-nat.c +++ b/gdb/amd64-linux-nat.c @@ -148,9 +148,9 @@ amd64_linux_nat_target::fetch_registers (struct regcache *regcache, int regnum) int tid; /* GNU/Linux LWP ID's are process ID's. */ - tid = ptid_get_lwp (regcache_get_ptid (regcache)); + tid = ptid_get_lwp (regcache->ptid ()); if (tid == 0) - tid = ptid_get_pid (regcache_get_ptid (regcache)); /* Not a threaded program. */ + tid = ptid_get_pid (regcache->ptid ()); /* Not a threaded program. */ if (regnum == -1 || amd64_native_gregset_supplies_p (gdbarch, regnum)) { @@ -226,9 +226,9 @@ amd64_linux_nat_target::store_registers (struct regcache *regcache, int regnum) int tid; /* GNU/Linux LWP ID's are process ID's. */ - tid = ptid_get_lwp (regcache_get_ptid (regcache)); + tid = ptid_get_lwp (regcache->ptid ()); if (tid == 0) - tid = ptid_get_pid (regcache_get_ptid (regcache)); /* Not a threaded program. */ + tid = ptid_get_pid (regcache->ptid ()); /* Not a threaded program. */ if (regnum == -1 || amd64_native_gregset_supplies_p (gdbarch, regnum)) { diff --git a/gdb/arm-fbsd-nat.c b/gdb/arm-fbsd-nat.c index be733ff..34b1335 100644 --- a/gdb/arm-fbsd-nat.c +++ b/gdb/arm-fbsd-nat.c @@ -64,7 +64,7 @@ getvfpregs_supplies (struct gdbarch *gdbarch, int regnum) void arm_fbsd_nat_target::fetch_registers (struct regcache *regcache, int regnum) { - pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache)); + pid_t pid = get_ptrace_pid (regcache->ptid ()); struct gdbarch *gdbarch = regcache->arch (); if (regnum == -1 || getregs_supplies (gdbarch, regnum)) @@ -98,7 +98,7 @@ arm_fbsd_nat_target::fetch_registers (struct regcache *regcache, int regnum) void arm_fbsd_nat_target::store_registers (struct regcache *regcache, int regnum) { - pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache)); + pid_t pid = get_ptrace_pid (regcache->ptid ()); struct gdbarch *gdbarch = regcache->arch (); if (regnum == -1 || getregs_supplies (gdbarch, regnum)) diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c index 30030b4..ccf812b 100644 --- a/gdb/arm-linux-nat.c +++ b/gdb/arm-linux-nat.c @@ -119,7 +119,7 @@ fetch_fpregs (struct regcache *regcache) gdb_byte fp[ARM_LINUX_SIZEOF_NWFPE]; /* Get the thread id for the ptrace call. */ - tid = ptid_get_lwp (regcache_get_ptid (regcache)); + tid = ptid_get_lwp (regcache->ptid ()); /* Read the floating point state. */ if (have_ptrace_getregset == TRIBOOL_TRUE) @@ -156,7 +156,7 @@ store_fpregs (const struct regcache *regcache) gdb_byte fp[ARM_LINUX_SIZEOF_NWFPE]; /* Get the thread id for the ptrace call. */ - tid = ptid_get_lwp (regcache_get_ptid (regcache)); + tid = ptid_get_lwp (regcache->ptid ()); /* Read the floating point state. */ if (have_ptrace_getregset == TRIBOOL_TRUE) @@ -210,7 +210,7 @@ fetch_regs (struct regcache *regcache) elf_gregset_t regs; /* Get the thread id for the ptrace call. */ - tid = ptid_get_lwp (regcache_get_ptid (regcache)); + tid = ptid_get_lwp (regcache->ptid ()); if (have_ptrace_getregset == TRIBOOL_TRUE) { @@ -237,7 +237,7 @@ store_regs (const struct regcache *regcache) elf_gregset_t regs; /* Get the thread id for the ptrace call. */ - tid = ptid_get_lwp (regcache_get_ptid (regcache)); + tid = ptid_get_lwp (regcache->ptid ()); /* Fetch the general registers. */ if (have_ptrace_getregset == TRIBOOL_TRUE) @@ -285,7 +285,7 @@ fetch_wmmx_regs (struct regcache *regcache) int ret, regno, tid; /* Get the thread id for the ptrace call. */ - tid = ptid_get_lwp (regcache_get_ptid (regcache)); + tid = ptid_get_lwp (regcache->ptid ()); ret = ptrace (PTRACE_GETWMMXREGS, tid, 0, regbuf); if (ret < 0) @@ -311,7 +311,7 @@ store_wmmx_regs (const struct regcache *regcache) int ret, regno, tid; /* Get the thread id for the ptrace call. */ - tid = ptid_get_lwp (regcache_get_ptid (regcache)); + tid = ptid_get_lwp (regcache->ptid ()); ret = ptrace (PTRACE_GETWMMXREGS, tid, 0, regbuf); if (ret < 0) @@ -350,7 +350,7 @@ fetch_vfp_regs (struct regcache *regcache) struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); /* Get the thread id for the ptrace call. */ - tid = ptid_get_lwp (regcache_get_ptid (regcache)); + tid = ptid_get_lwp (regcache->ptid ()); if (have_ptrace_getregset == TRIBOOL_TRUE) { @@ -379,7 +379,7 @@ store_vfp_regs (const struct regcache *regcache) struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); /* Get the thread id for the ptrace call. */ - tid = ptid_get_lwp (regcache_get_ptid (regcache)); + tid = ptid_get_lwp (regcache->ptid ()); if (have_ptrace_getregset == TRIBOOL_TRUE) { diff --git a/gdb/arm-nbsd-nat.c b/gdb/arm-nbsd-nat.c index 3a1ddea..3d64346 100644 --- a/gdb/arm-nbsd-nat.c +++ b/gdb/arm-nbsd-nat.c @@ -87,7 +87,7 @@ fetch_register (struct regcache *regcache, int regno) struct reg inferior_registers; int ret; - ret = ptrace (PT_GETREGS, ptid_get_pid (regcache_get_ptid (regcache)), + ret = ptrace (PT_GETREGS, ptid_get_pid (regcache->ptid ()), (PTRACE_TYPE_ARG3) &inferior_registers, 0); if (ret < 0) @@ -140,7 +140,7 @@ fetch_regs (struct regcache *regcache) int ret; int regno; - ret = ptrace (PT_GETREGS, ptid_get_pid (regcache_get_ptid (regcache)), + ret = ptrace (PT_GETREGS, ptid_get_pid (regcache->ptid ()), (PTRACE_TYPE_ARG3) &inferior_registers, 0); if (ret < 0) @@ -158,7 +158,7 @@ fetch_fp_register (struct regcache *regcache, int regno) struct fpreg inferior_fp_registers; int ret; - ret = ptrace (PT_GETFPREGS, ptid_get_pid (regcache_get_ptid (regcache)), + ret = ptrace (PT_GETFPREGS, ptid_get_pid (regcache->ptid ()), (PTRACE_TYPE_ARG3) &inferior_fp_registers, 0); if (ret < 0) @@ -188,7 +188,7 @@ fetch_fp_regs (struct regcache *regcache) int ret; int regno; - ret = ptrace (PT_GETFPREGS, ptid_get_pid (regcache_get_ptid (regcache)), + ret = ptrace (PT_GETFPREGS, ptid_get_pid (regcache->ptid ()), (PTRACE_TYPE_ARG3) &inferior_fp_registers, 0); if (ret < 0) @@ -225,7 +225,7 @@ store_register (const struct regcache *regcache, int regno) struct reg inferior_registers; int ret; - ret = ptrace (PT_GETREGS, ptid_get_pid (regcache_get_ptid (regcache)), + ret = ptrace (PT_GETREGS, ptid_get_pid (regcache->ptid ()), (PTRACE_TYPE_ARG3) &inferior_registers, 0); if (ret < 0) @@ -288,7 +288,7 @@ store_register (const struct regcache *regcache, int regno) break; } - ret = ptrace (PT_SETREGS, ptid_get_pid (regcache_get_ptid (regcache)), + ret = ptrace (PT_SETREGS, ptid_get_pid (regcache->ptid ()), (PTRACE_TYPE_ARG3) &inferior_registers, 0); if (ret < 0) @@ -336,7 +336,7 @@ store_regs (const struct regcache *regcache) inferior_registers.r_pc = pc_val | psr_val; } - ret = ptrace (PT_SETREGS, ptid_get_pid (regcache_get_ptid (regcache)), + ret = ptrace (PT_SETREGS, ptid_get_pid (regcache->ptid ()), (PTRACE_TYPE_ARG3) &inferior_registers, 0); if (ret < 0) @@ -349,7 +349,7 @@ store_fp_register (const struct regcache *regcache, int regno) struct fpreg inferior_fp_registers; int ret; - ret = ptrace (PT_GETFPREGS, ptid_get_pid (regcache_get_ptid (regcache)), + ret = ptrace (PT_GETFPREGS, ptid_get_pid (regcache->ptid ()), (PTRACE_TYPE_ARG3) &inferior_fp_registers, 0); if (ret < 0) @@ -371,7 +371,7 @@ store_fp_register (const struct regcache *regcache, int regno) break; } - ret = ptrace (PT_SETFPREGS, ptid_get_pid (regcache_get_ptid (regcache)), + ret = ptrace (PT_SETFPREGS, ptid_get_pid (regcache->ptid ()), (PTRACE_TYPE_ARG3) &inferior_fp_registers, 0); if (ret < 0) @@ -393,7 +393,7 @@ store_fp_regs (const struct regcache *regcache) regcache_raw_collect (regcache, ARM_FPS_REGNUM, (char *) &inferior_fp_registers.fpr_fpsr); - ret = ptrace (PT_SETFPREGS, ptid_get_pid (regcache_get_ptid (regcache)), + ret = ptrace (PT_SETFPREGS, ptid_get_pid (regcache->ptid ()), (PTRACE_TYPE_ARG3) &inferior_fp_registers, 0); if (ret < 0) diff --git a/gdb/bsd-uthread.c b/gdb/bsd-uthread.c index 1505cfe..9ead7c2 100644 --- a/gdb/bsd-uthread.c +++ b/gdb/bsd-uthread.c @@ -321,7 +321,7 @@ bsd_uthread_target::fetch_registers (struct regcache *regcache, int regnum) struct gdbarch *gdbarch = regcache->arch (); struct bsd_uthread_ops *uthread_ops = (struct bsd_uthread_ops *) gdbarch_data (gdbarch, bsd_uthread_data); - ptid_t ptid = regcache_get_ptid (regcache); + ptid_t ptid = regcache->ptid (); CORE_ADDR addr = ptid_get_tid (ptid); struct target_ops *beneath = find_target_beneath (this); CORE_ADDR active_addr; @@ -355,7 +355,7 @@ bsd_uthread_target::store_registers (struct regcache *regcache, int regnum) struct bsd_uthread_ops *uthread_ops = (struct bsd_uthread_ops *) gdbarch_data (gdbarch, bsd_uthread_data); struct target_ops *beneath = find_target_beneath (this); - ptid_t ptid = regcache_get_ptid (regcache); + ptid_t ptid = regcache->ptid (); CORE_ADDR addr = ptid_get_tid (ptid); CORE_ADDR active_addr; scoped_restore save_inferior_ptid = make_scoped_restore (&inferior_ptid); diff --git a/gdb/hppa-linux-nat.c b/gdb/hppa-linux-nat.c index bc6c234..39ae83f 100644 --- a/gdb/hppa-linux-nat.c +++ b/gdb/hppa-linux-nat.c @@ -233,7 +233,7 @@ fetch_register (struct regcache *regcache, int regno) return; } - tid = get_ptrace_pid (regcache_get_ptid (regcache)); + tid = get_ptrace_pid (regcache->ptid ()); errno = 0; val = ptrace (PTRACE_PEEKUSER, tid, hppa_linux_register_addr (regno, 0), 0); @@ -257,7 +257,7 @@ store_register (const struct regcache *regcache, int regno) if (gdbarch_cannot_store_register (gdbarch, regno)) return; - tid = get_ptrace_pid (regcache_get_ptid (regcache)); + tid = get_ptrace_pid (regcache->ptid ()); errno = 0; regcache_raw_collect (regcache, regno, &val); diff --git a/gdb/hppa-nbsd-nat.c b/gdb/hppa-nbsd-nat.c index 3547d65..2ffa5bc 100644 --- a/gdb/hppa-nbsd-nat.c +++ b/gdb/hppa-nbsd-nat.c @@ -170,7 +170,7 @@ void hppa_nbsd_nat_target::fetch_registers (struct regcache *regcache, int regnum) { - pid_t pid = ptid_get_pid (regcache_get_ptid (regcache)); + pid_t pid = ptid_get_pid (regcache->ptid ()); if (regnum == -1 || hppanbsd_gregset_supplies_p (regnum)) { @@ -199,7 +199,7 @@ hppa_nbsd_nat_target::fetch_registers (struct regcache *regcache, int regnum) void hppa_nbsd_nat_target::store_registers (struct regcache *regcache, int regnum) { - pid_t pid = ptid_get_pid (regcache_get_ptid (regcache)); + pid_t pid = ptid_get_pid (regcache->ptid ()); if (regnum == -1 || hppanbsd_gregset_supplies_p (regnum)) { diff --git a/gdb/hppa-obsd-nat.c b/gdb/hppa-obsd-nat.c index 43c2dcc..2ef2f7e 100644 --- a/gdb/hppa-obsd-nat.c +++ b/gdb/hppa-obsd-nat.c @@ -196,7 +196,7 @@ hppaobsd_collect_fpregset (struct regcache *regcache, void hppa_obsd_nat_target::fetch_registers (struct regcache *regcache, int regnum) { - pid_t pid = ptid_get_pid (regcache_get_ptid (regcache)); + pid_t pid = ptid_get_pid (regcache->ptid ()); if (regnum == -1 || hppaobsd_gregset_supplies_p (regnum)) { diff --git a/gdb/i386-bsd-nat.c b/gdb/i386-bsd-nat.c index f7f27ceb..cca4629 100644 --- a/gdb/i386-bsd-nat.c +++ b/gdb/i386-bsd-nat.c @@ -130,7 +130,7 @@ i386bsd_collect_gregset (const struct regcache *regcache, void i386bsd_fetch_inferior_registers (struct regcache *regcache, int regnum) { - pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache)); + pid_t pid = get_ptrace_pid (regcache->ptid ()); if (regnum == -1 || GETREGS_SUPPLIES (regnum)) { @@ -193,7 +193,7 @@ i386bsd_fetch_inferior_registers (struct regcache *regcache, int regnum) void i386bsd_store_inferior_registers (struct regcache *regcache, int regnum) { - pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache)); + pid_t pid = get_ptrace_pid (regcache->ptid ()); if (regnum == -1 || GETREGS_SUPPLIES (regnum)) { diff --git a/gdb/i386-darwin-nat.c b/gdb/i386-darwin-nat.c index e57b126..03adb20 100644 --- a/gdb/i386-darwin-nat.c +++ b/gdb/i386-darwin-nat.c @@ -59,7 +59,7 @@ static struct i386_darwin_nat_target darwin_target; void i386_darwin_nat_target::fetch_registers (struct regcache *regcache, int regno) { - thread_t current_thread = ptid_get_tid (regcache_get_ptid (regcache)); + thread_t current_thread = ptid_get_tid (regcache->ptid ()); int fetched = 0; struct gdbarch *gdbarch = regcache->arch (); @@ -176,7 +176,7 @@ void i386_darwin_nat_target::store_registers (struct regcache *regcache, int regno) { - thread_t current_thread = ptid_get_tid (regcache_get_ptid (regcache)); + thread_t current_thread = ptid_get_tid (regcache->ptid ()); struct gdbarch *gdbarch = regcache->arch (); #ifdef BFD64 diff --git a/gdb/i386-gnu-nat.c b/gdb/i386-gnu-nat.c index 8bb036d..e5195f3 100644 --- a/gdb/i386-gnu-nat.c +++ b/gdb/i386-gnu-nat.c @@ -108,7 +108,7 @@ gnu_fetch_registers (struct target_ops *ops, struct regcache *regcache, int regno) { struct proc *thread; - ptid_t ptid = regcache_get_ptid (regcache); + ptid_t ptid = regcache->ptid (); /* Make sure we know about new threads. */ inf_update_procs (gnu_current_inf); @@ -201,7 +201,7 @@ gnu_store_registers (struct target_ops *ops, { struct proc *thread; struct gdbarch *gdbarch = regcache->arch (); - ptid_t ptid = regcache_get_ptid (regcache); + ptid_t ptid = regcache->ptid (); /* Make sure we know about new threads. */ inf_update_procs (gnu_current_inf); diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c index 6538324..054638b 100644 --- a/gdb/i386-linux-nat.c +++ b/gdb/i386-linux-nat.c @@ -116,7 +116,7 @@ fetch_register (struct regcache *regcache, int regno) return; } - tid = get_ptrace_pid (regcache_get_ptid (regcache)); + tid = get_ptrace_pid (regcache->ptid ()); errno = 0; val = ptrace (PTRACE_PEEKUSER, tid, @@ -141,7 +141,7 @@ store_register (const struct regcache *regcache, int regno) if (i386_linux_gregset_reg_offset[regno] == -1) return; - tid = get_ptrace_pid (regcache_get_ptid (regcache)); + tid = get_ptrace_pid (regcache->ptid ()); errno = 0; regcache_raw_collect (regcache, regno, &val); @@ -475,7 +475,7 @@ i386_linux_nat_target::fetch_registers (struct regcache *regcache, int regno) return; } - tid = get_ptrace_pid (regcache_get_ptid (regcache)); + tid = get_ptrace_pid (regcache->ptid ()); /* Use the PTRACE_GETFPXREGS request whenever possible, since it transfers more registers in one system call, and we'll cache the @@ -552,7 +552,7 @@ i386_linux_nat_target::store_registers (struct regcache *regcache, int regno) return; } - tid = get_ptrace_pid (regcache_get_ptid (regcache)); + tid = get_ptrace_pid (regcache->ptid ()); /* Use the PTRACE_SETFPXREGS requests whenever possible, since it transfers more registers in one system call. But remember that diff --git a/gdb/ia64-linux-nat.c b/gdb/ia64-linux-nat.c index f73e17a..d095bde 100644 --- a/gdb/ia64-linux-nat.c +++ b/gdb/ia64-linux-nat.c @@ -779,7 +779,7 @@ ia64_linux_fetch_register (struct regcache *regcache, int regnum) return; } - pid = get_ptrace_pid (regcache_get_ptid (regcache)); + pid = get_ptrace_pid (regcache->ptid ()); /* This isn't really an address, but ptrace thinks of it as one. */ addr = ia64_register_addr (gdbarch, regnum); @@ -833,7 +833,7 @@ ia64_linux_store_register (const struct regcache *regcache, int regnum) if (ia64_cannot_store_register (gdbarch, regnum)) return; - pid = get_ptrace_pid (regcache_get_ptid (regcache)); + pid = get_ptrace_pid (regcache->ptid ()); /* This isn't really an address, but ptrace thinks of it as one. */ addr = ia64_register_addr (gdbarch, regnum); diff --git a/gdb/linux-nat-trad.c b/gdb/linux-nat-trad.c index ce6788c..ed75eed 100644 --- a/gdb/linux-nat-trad.c +++ b/gdb/linux-nat-trad.c @@ -45,7 +45,7 @@ linux_nat_trad_target::fetch_register (struct regcache *regcache, int regnum) return; } - pid = get_ptrace_pid (regcache_get_ptid (regcache)); + pid = get_ptrace_pid (regcache->ptid ()); size = register_size (gdbarch, regnum); buf = (gdb_byte *) alloca (size); @@ -104,7 +104,7 @@ linux_nat_trad_target::store_register (const struct regcache *regcache, || gdbarch_cannot_store_register (gdbarch, regnum)) return; - pid = get_ptrace_pid (regcache_get_ptid (regcache)); + pid = get_ptrace_pid (regcache->ptid ()); size = register_size (gdbarch, regnum); buf = (gdb_byte *) alloca (size); diff --git a/gdb/m32r-linux-nat.c b/gdb/m32r-linux-nat.c index 09a019a..9d833fa 100644 --- a/gdb/m32r-linux-nat.c +++ b/gdb/m32r-linux-nat.c @@ -202,7 +202,7 @@ fill_fpregset (const struct regcache *regcache, void m32r_linux_nat_target::fetch_registers (struct regcache *regcache, int regno) { - pid_t tid = get_ptrace_pid (regcache_get_ptid (regcache)); + pid_t tid = get_ptrace_pid (regcache->ptid ()); /* Use the PTRACE_GETREGS request whenever possible, since it transfers more registers in one system call, and we'll cache the @@ -223,7 +223,7 @@ m32r_linux_nat_target::fetch_registers (struct regcache *regcache, int regno) void m32r_linux_nat_target::store_registers (struct regcache *regcache, int regno) { - pid_t tid = get_ptrace_pid (regcache_get_ptid (regcache)); + pid_t tid = get_ptrace_pid (regcache->ptid ()); /* Use the PTRACE_SETREGS request whenever possible, since it transfers more registers in one system call. */ diff --git a/gdb/m68k-bsd-nat.c b/gdb/m68k-bsd-nat.c index af907ad..c44f736 100644 --- a/gdb/m68k-bsd-nat.c +++ b/gdb/m68k-bsd-nat.c @@ -118,7 +118,7 @@ m68kbsd_collect_fpregset (struct regcache *regcache, void m68k_bsd_nat_target::fetch_registers (struct regcache *regcache, int regnum) { - pid_t pid = ptid_get_pid (regcache_get_ptid (regcache)); + pid_t pid = ptid_get_pid (regcache->ptid ()); if (regnum == -1 || m68kbsd_gregset_supplies_p (regnum)) { @@ -147,7 +147,7 @@ m68k_bsd_nat_target::fetch_registers (struct regcache *regcache, int regnum) void m68k_bsd_nat_target::store_registers (struct regcache *regcache, int regnum) { - pid_t pid = ptid_get_pid (regcache_get_ptid (regcache)); + pid_t pid = ptid_get_pid (regcache->ptid ()); if (regnum == -1 || m68kbsd_gregset_supplies_p (regnum)) { diff --git a/gdb/m68k-linux-nat.c b/gdb/m68k-linux-nat.c index e25154c..409a4fd 100644 --- a/gdb/m68k-linux-nat.c +++ b/gdb/m68k-linux-nat.c @@ -119,7 +119,7 @@ fetch_register (struct regcache *regcache, int regno) long regaddr, val; int i; gdb_byte buf[M68K_MAX_REGISTER_SIZE]; - pid_t tid = get_ptrace_pid (regcache_get_ptid (regcache)); + pid_t tid = get_ptrace_pid (regcache->ptid ()); regaddr = 4 * regmap[regno]; for (i = 0; i < register_size (gdbarch, regno); i += sizeof (long)) @@ -167,7 +167,7 @@ store_register (const struct regcache *regcache, int regno) long regaddr, val; int i; gdb_byte buf[M68K_MAX_REGISTER_SIZE]; - pid_t tid = get_ptrace_pid (regcache_get_ptid (regcache)); + pid_t tid = get_ptrace_pid (regcache->ptid ()); regaddr = 4 * regmap[regno]; @@ -416,7 +416,7 @@ m68k_linux_nat_target::fetch_registers (struct regcache *regcache, int regno) return; } - tid = get_ptrace_pid (regcache_get_ptid (regcache)); + tid = get_ptrace_pid (regcache->ptid ()); /* Use the PTRACE_GETFPXREGS request whenever possible, since it transfers more registers in one system call, and we'll cache the @@ -469,7 +469,7 @@ m68k_linux_nat_target::store_registers (struct regcache *regcache, int regno) return; } - tid = get_ptrace_pid (regcache_get_ptid (regcache)); + tid = get_ptrace_pid (regcache->ptid ()); /* Use the PTRACE_SETFPREGS requests whenever possible, since it transfers more registers in one system call. But remember that diff --git a/gdb/mips-fbsd-nat.c b/gdb/mips-fbsd-nat.c index 04fbb2a..7761301 100644 --- a/gdb/mips-fbsd-nat.c +++ b/gdb/mips-fbsd-nat.c @@ -63,7 +63,7 @@ getfpregs_supplies (struct gdbarch *gdbarch, int regnum) void mips_fbsd_nat_target::fetch_registers (struct regcache *regcache, int regnum) { - pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache)); + pid_t pid = get_ptrace_pid (regcache->ptid ()); struct gdbarch *gdbarch = regcache->arch (); if (regnum == -1 || getregs_supplies (gdbarch, regnum)) @@ -94,7 +94,7 @@ mips_fbsd_nat_target::fetch_registers (struct regcache *regcache, int regnum) void mips_fbsd_nat_target::store_registers (struct regcache *regcache, int regnum) { - pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache)); + pid_t pid = get_ptrace_pid (regcache->ptid ()); struct gdbarch *gdbarch = regcache->arch (); if (regnum == -1 || getregs_supplies (gdbarch, regnum)) diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c index 3683107..beb0ea0 100644 --- a/gdb/mips-linux-nat.c +++ b/gdb/mips-linux-nat.c @@ -270,7 +270,7 @@ mips_linux_nat_target::mips64_regsets_fetch_registers else is_dsp = 0; - tid = get_ptrace_pid (regcache_get_ptid (regcache)); + tid = get_ptrace_pid (regcache->ptid ()); if (regno == -1 || (!is_fp && !is_dsp)) { @@ -357,7 +357,7 @@ mips_linux_nat_target::mips64_regsets_store_registers else is_dsp = 0; - tid = get_ptrace_pid (regcache_get_ptid (regcache)); + tid = get_ptrace_pid (regcache->ptid ()); if (regno == -1 || (!is_fp && !is_dsp)) { diff --git a/gdb/mips-nbsd-nat.c b/gdb/mips-nbsd-nat.c index b9fc627..4c61081 100644 --- a/gdb/mips-nbsd-nat.c +++ b/gdb/mips-nbsd-nat.c @@ -49,7 +49,7 @@ getregs_supplies (struct gdbarch *gdbarch, int regno) void mips_nbsd_nat_target::fetch_registers (struct regcache *regcache, int regno) { - pid_t pid = ptid_get_pid (regcache_get_ptid (regcache)); + pid_t pid = ptid_get_pid (regcache->ptid ()); struct gdbarch *gdbarch = regcache->arch (); if (regno == -1 || getregs_supplies (gdbarch, regno)) @@ -79,7 +79,7 @@ mips_nbsd_nat_target::fetch_registers (struct regcache *regcache, int regno) void mips_nbsd_nat_target::store_registers (struct regcache *regcache, int regno) { - pid_t pid = ptid_get_pid (regcache_get_ptid (regcache)); + pid_t pid = ptid_get_pid (regcache->ptid ()); struct gdbarch *gdbarch = regcache->arch (); if (regno == -1 || getregs_supplies (gdbarch, regno)) diff --git a/gdb/mips64-obsd-nat.c b/gdb/mips64-obsd-nat.c index 7f14b09..27e1ab6 100644 --- a/gdb/mips64-obsd-nat.c +++ b/gdb/mips64-obsd-nat.c @@ -89,7 +89,7 @@ void mips64_obsd_nat_target::fetch_registers (struct regcache *regcache, int regnum) { struct reg regs; - pid_t pid = ptid_get_pid (regcache_get_ptid (regcache)); + pid_t pid = ptid_get_pid (regcache->ptid ()); if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1) perror_with_name (_("Couldn't get registers")); @@ -104,7 +104,7 @@ static void mips64_obsd_nat_target::store_registers (struct regcache *regcache, int regnum) { struct reg regs; - pid_t pid = ptid_get_pid (regcache_get_ptid (regcache)); + pid_t pid = ptid_get_pid (regcache->ptid ()); if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1) perror_with_name (_("Couldn't get registers")); diff --git a/gdb/nto-procfs.c b/gdb/nto-procfs.c index f0ef9b9..fcd3001 100644 --- a/gdb/nto-procfs.c +++ b/gdb/nto-procfs.c @@ -917,7 +917,7 @@ nto_procfs_target::fetch_registers (struct regcache *regcache, int regno) reg; int regsize; - procfs_set_thread (regcache_get_ptid (regcache)); + procfs_set_thread (regcache->ptid ()); if (devctl (ctl_fd, DCMD_PROC_GETGREG, ®, sizeof (reg), ®size) == EOK) nto_supply_gregset (regcache, (char *) ®.greg); if (devctl (ctl_fd, DCMD_PROC_GETFPREG, ®, sizeof (reg), ®size) @@ -1393,7 +1393,7 @@ nto_procfs_target::store_registers (struct regcache *regcache, int regno) unsigned off; int len, regset, regsize, dev_set, err; char *data; - ptid_t ptid = regcache_get_ptid (regcache); + ptid_t ptid = regcache->ptid (); if (ptid_equal (ptid, null_ptid)) return; diff --git a/gdb/ppc-fbsd-nat.c b/gdb/ppc-fbsd-nat.c index 6ca4bba..89a7e6e 100644 --- a/gdb/ppc-fbsd-nat.c +++ b/gdb/ppc-fbsd-nat.c @@ -127,7 +127,7 @@ void ppc_fbsd_nat_target::fetch_registers (struct regcache *regcache, int regno) { gdb_gregset_t regs; - pid_t pid = ptid_get_lwp (regcache_get_ptid (regcache)); + pid_t pid = ptid_get_lwp (regcache->ptid ()); if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1) perror_with_name (_("Couldn't get registers")); @@ -153,7 +153,7 @@ void ppc_fbsd_nat_target::store_registers (struct regcache *regcache, int regno) { gdb_gregset_t regs; - pid_t pid = ptid_get_lwp (regcache_get_ptid (regcache)); + pid_t pid = ptid_get_lwp (regcache->ptid ()); if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1) perror_with_name (_("Couldn't get registers")); diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c index eb21f91..7606081 100644 --- a/gdb/ppc-linux-nat.c +++ b/gdb/ppc-linux-nat.c @@ -773,7 +773,7 @@ fetch_ppc_registers (struct regcache *regcache, int tid) void ppc_linux_nat_target::fetch_registers (struct regcache *regcache, int regno) { - pid_t tid = get_ptrace_pid (regcache_get_ptid (regcache)); + pid_t tid = get_ptrace_pid (regcache->ptid ()); if (regno == -1) fetch_ppc_registers (regcache, tid); @@ -2131,7 +2131,7 @@ ppc_linux_nat_target::masked_watch_num_registers (CORE_ADDR addr, CORE_ADDR mask void ppc_linux_nat_target::store_registers (struct regcache *regcache, int regno) { - pid_t tid = get_ptrace_pid (regcache_get_ptid (regcache)); + pid_t tid = get_ptrace_pid (regcache->ptid ()); if (regno >= 0) store_register (regcache, tid, regno); diff --git a/gdb/ppc-nbsd-nat.c b/gdb/ppc-nbsd-nat.c index f6e3884..037b261 100644 --- a/gdb/ppc-nbsd-nat.c +++ b/gdb/ppc-nbsd-nat.c @@ -88,7 +88,7 @@ void ppc_nbsd_nat_target::fetch_registers (struct regcache *regcache, int regnum) { struct gdbarch *gdbarch = regcache->arch (); - pid_t pid = ptid_get_pid (regcache_get_ptid (regcache)); + pid_t pid = ptid_get_pid (regcache->ptid ()); if (regnum == -1 || getregs_supplies (gdbarch, regnum)) { @@ -117,7 +117,7 @@ void ppc_nbsd_nat_target::store_registers (struct regcache *regcache, int regnum) { struct gdbarch *gdbarch = regcache->arch (); - pid_t pid = ptid_get_pid (regcache_get_ptid (regcache)); + pid_t pid = ptid_get_pid (regcache->ptid ()); if (regnum == -1 || getregs_supplies (gdbarch, regnum)) { diff --git a/gdb/ppc-obsd-nat.c b/gdb/ppc-obsd-nat.c index 4428dab..88ba0c5 100644 --- a/gdb/ppc-obsd-nat.c +++ b/gdb/ppc-obsd-nat.c @@ -82,7 +82,7 @@ void ppc_obsd_nat_target::fetch_registers (struct regcache *regcache, int regnum) { struct reg regs; - pid_t pid = ptid_get_pid (regcache_get_ptid (regcache)); + pid_t pid = ptid_get_pid (regcache->ptid ()); if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1) perror_with_name (_("Couldn't get registers")); @@ -116,7 +116,7 @@ void ppc_obsd_nat_target::store_registers (struct regcache *regcache, int regnum) { struct reg regs; - pid_t pid = ptid_get_pid (regcache_get_ptid (regcache)); + pid_t pid = ptid_get_pid (regcache->ptid ()); if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1) perror_with_name (_("Couldn't get registers")); diff --git a/gdb/procfs.c b/gdb/procfs.c index 70619f1..e01d664 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -2063,7 +2063,7 @@ procfs_target::fetch_registers (struct regcache *regcache, int regnum) { gdb_gregset_t *gregs; procinfo *pi; - ptid_t ptid = regcache_get_ptid (regcache); + ptid_t ptid = regcache->ptid (); int pid = ptid_get_pid (ptid); int tid = ptid_get_lwp (ptid); struct gdbarch *gdbarch = regcache->arch (); @@ -2112,7 +2112,7 @@ procfs_target::store_registers (struct regcache *regcache, int regnum) { gdb_gregset_t *gregs; procinfo *pi; - ptid_t ptid = regcache_get_ptid (regcache); + ptid_t ptid = regcache->ptid (); int pid = ptid_get_pid (ptid); int tid = ptid_get_lwp (ptid); struct gdbarch *gdbarch = regcache->arch (); diff --git a/gdb/ravenscar-thread.c b/gdb/ravenscar-thread.c index 5f3e179..b8630c3 100644 --- a/gdb/ravenscar-thread.c +++ b/gdb/ravenscar-thread.c @@ -416,7 +416,7 @@ void ravenscar_thread_target::fetch_registers (struct regcache *regcache, int regnum) { struct target_ops *beneath = find_target_beneath (this); - ptid_t ptid = regcache_get_ptid (regcache); + ptid_t ptid = regcache->ptid (); if (ravenscar_runtime_initialized () && is_ravenscar_task (ptid) @@ -437,7 +437,7 @@ ravenscar_thread_target::store_registers (struct regcache *regcache, int regnum) { target_ops *beneath = find_target_beneath (this); - ptid_t ptid = regcache_get_ptid (regcache); + ptid_t ptid = regcache->ptid (); if (ravenscar_runtime_initialized () && is_ravenscar_task (ptid) @@ -457,7 +457,7 @@ void ravenscar_thread_target::prepare_to_store (struct regcache *regcache) { target_ops *beneath = find_target_beneath (this); - ptid_t ptid = regcache_get_ptid (regcache); + ptid_t ptid = regcache->ptid (); if (ravenscar_runtime_initialized () && is_ravenscar_task (ptid) diff --git a/gdb/record-btrace.c b/gdb/record-btrace.c index 0f01ace..35c8421 100644 --- a/gdb/record-btrace.c +++ b/gdb/record-btrace.c @@ -1536,7 +1536,7 @@ record_btrace_target::fetch_registers (struct regcache *regcache, int regno) struct btrace_insn_iterator *replay; struct thread_info *tp; - tp = find_thread_ptid (regcache_get_ptid (regcache)); + tp = find_thread_ptid (regcache->ptid ()); gdb_assert (tp != NULL); replay = tp->btrace.replay; @@ -1572,7 +1572,7 @@ record_btrace_target::store_registers (struct regcache *regcache, int regno) struct target_ops *t; if (!record_btrace_generating_corefile - && record_is_replaying (regcache_get_ptid (regcache))) + && record_is_replaying (regcache->ptid ())) error (_("Cannot write registers while replaying.")); gdb_assert (may_write_registers != 0); @@ -1586,7 +1586,7 @@ void record_btrace_target::prepare_to_store (struct regcache *regcache) { if (!record_btrace_generating_corefile - && record_is_replaying (regcache_get_ptid (regcache))) + && record_is_replaying (regcache->ptid ())) return; this->beneath->prepare_to_store (regcache); diff --git a/gdb/regcache.c b/gdb/regcache.c index 83bcbd2..9881e92 100644 --- a/gdb/regcache.c +++ b/gdb/regcache.c @@ -223,16 +223,6 @@ reg_buffer::arch () const return m_descr->gdbarch; } -/* See regcache.h. */ - -ptid_t -regcache_get_ptid (const struct regcache *regcache) -{ - gdb_assert (!ptid_equal (regcache->ptid (), minus_one_ptid)); - - return regcache->ptid (); -} - /* Cleanup class for invalidating a register. */ class regcache_invalidator diff --git a/gdb/regcache.h b/gdb/regcache.h index d7bb8b5..7fcc43a 100644 --- a/gdb/regcache.h +++ b/gdb/regcache.h @@ -35,10 +35,6 @@ extern struct regcache *get_thread_arch_aspace_regcache (ptid_t, struct gdbarch *, struct address_space *); -/* Return REGCACHE's ptid. */ - -extern ptid_t regcache_get_ptid (const struct regcache *regcache); - enum register_status regcache_register_status (const struct regcache *regcache, int regnum); @@ -357,8 +353,12 @@ public: void collect_regset (const struct regset *regset, int regnum, void *buf, size_t size) const; + /* Return REGCACHE's ptid. */ + ptid_t ptid () const { + gdb_assert (m_ptid != minus_one_ptid); + return m_ptid; } diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c index 5fd24cb..9c89ab9 100644 --- a/gdb/remote-sim.c +++ b/gdb/remote-sim.c @@ -469,7 +469,7 @@ void gdbsim_target::fetch_registers (struct regcache *regcache, int regno) { struct gdbarch *gdbarch = regcache->arch (); - struct inferior *inf = find_inferior_ptid (regcache_get_ptid (regcache)); + struct inferior *inf = find_inferior_ptid (regcache->ptid ()); struct sim_inferior_data *sim_data = get_sim_inferior_data (inf, SIM_INSTANCE_NEEDED); @@ -538,7 +538,7 @@ void gdbsim_target::store_registers (struct regcache *regcache, int regno) { struct gdbarch *gdbarch = regcache->arch (); - struct inferior *inf = find_inferior_ptid (regcache_get_ptid (regcache)); + struct inferior *inf = find_inferior_ptid (regcache->ptid ()); struct sim_inferior_data *sim_data = get_sim_inferior_data (inf, SIM_INSTANCE_NEEDED); diff --git a/gdb/remote.c b/gdb/remote.c index e7ade41..3df9ad4 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -8281,7 +8281,7 @@ remote_target::fetch_registers (struct regcache *regcache, int regnum) int i; set_remote_traceframe (); - set_general_thread (regcache_get_ptid (regcache)); + set_general_thread (regcache->ptid ()); if (regnum >= 0) { @@ -8438,7 +8438,7 @@ remote_target::store_registers (struct regcache *regcache, int regnum) int i; set_remote_traceframe (); - set_general_thread (regcache_get_ptid (regcache)); + set_general_thread (regcache->ptid ()); if (regnum >= 0) { diff --git a/gdb/rs6000-nat.c b/gdb/rs6000-nat.c index e9f0647..689d8e8 100644 --- a/gdb/rs6000-nat.c +++ b/gdb/rs6000-nat.c @@ -191,7 +191,7 @@ fetch_register (struct regcache *regcache, int regno) struct gdbarch *gdbarch = regcache->arch (); int addr[PPC_MAX_REGISTER_SIZE]; int nr, isfloat; - pid_t pid = ptid_get_pid (regcache_get_ptid (regcache)); + pid_t pid = ptid_get_pid (regcache->ptid ()); /* Retrieved values may be -1, so infer errors from errno. */ errno = 0; @@ -250,7 +250,7 @@ store_register (struct regcache *regcache, int regno) struct gdbarch *gdbarch = regcache->arch (); int addr[PPC_MAX_REGISTER_SIZE]; int nr, isfloat; - pid_t pid = ptid_get_pid (regcache_get_ptid (regcache)); + pid_t pid = ptid_get_pid (regcache->ptid ()); /* Fetch the register's value from the register cache. */ regcache_raw_collect (regcache, regno, addr); diff --git a/gdb/s390-linux-nat.c b/gdb/s390-linux-nat.c index 3c65c5e..abb06a9 100644 --- a/gdb/s390-linux-nat.c +++ b/gdb/s390-linux-nat.c @@ -408,7 +408,7 @@ check_regset (int tid, int regset, int regsize) void s390_linux_nat_target::fetch_registers (struct regcache *regcache, int regnum) { - pid_t tid = get_ptrace_pid (regcache_get_ptid (regcache)); + pid_t tid = get_ptrace_pid (regcache->ptid ()); if (regnum == -1 || S390_IS_GREGSET_REGNUM (regnum)) fetch_regs (regcache, tid); @@ -462,7 +462,7 @@ s390_linux_nat_target::fetch_registers (struct regcache *regcache, int regnum) void s390_linux_nat_target::store_registers (struct regcache *regcache, int regnum) { - pid_t tid = get_ptrace_pid (regcache_get_ptid (regcache)); + pid_t tid = get_ptrace_pid (regcache->ptid ()); if (regnum == -1 || S390_IS_GREGSET_REGNUM (regnum)) store_regs (regcache, tid, regnum); diff --git a/gdb/sh-nbsd-nat.c b/gdb/sh-nbsd-nat.c index 6bd089e..062b522 100644 --- a/gdb/sh-nbsd-nat.c +++ b/gdb/sh-nbsd-nat.c @@ -51,7 +51,7 @@ static sh_nbsd_nat_target the_sh_nbsd_nat_target; void sh_nbsd_nat_target::fetch_registers (struct regcache *regcache, int regno) { - pid_t pid = ptid_get_pid (regcache_get_ptid (regcache)); + pid_t pid = ptid_get_pid (regcache->ptid ()); if (regno == -1 || GETREGS_SUPPLIES (regcache->arch (), regno)) { @@ -73,7 +73,7 @@ sh_nbsd_nat_target::fetch_registers (struct regcache *regcache, int regno) void sh_nbsd_nat_target::store_registers (struct regcache *regcache, int regno) { - pid_t pid = ptid_get_pid (regcache_get_ptid (regcache)); + pid_t pid = ptid_get_pid (regcache->ptid ()); if (regno == -1 || GETREGS_SUPPLIES (regcache->arch (), regno)) { diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c index 22dd8d6..1023f7d 100644 --- a/gdb/sol-thread.c +++ b/gdb/sol-thread.c @@ -488,7 +488,7 @@ sol_thread_target::fetch_registers (struct regcache *regcache, int regnum) gdb_gregset_t *gregset_p = &gregset; gdb_fpregset_t *fpregset_p = &fpregset; struct target_ops *beneath = find_target_beneath (this); - ptid_t ptid = regcache_get_ptid (regcache); + ptid_t ptid = regcache->ptid (); if (!ptid_tid_p (ptid)) { @@ -540,7 +540,7 @@ sol_thread_target::store_registers (struct regcache *regcache, int regnum) td_err_e val; prgregset_t gregset; prfpregset_t fpregset; - ptid_t ptid = regcache_get_ptid (regcache); + ptid_t ptid = regcache->ptid (); if (!ptid_tid_p (ptid)) { diff --git a/gdb/sparc-nat.c b/gdb/sparc-nat.c index 8b5c686..86a6b5a 100644 --- a/gdb/sparc-nat.c +++ b/gdb/sparc-nat.c @@ -152,7 +152,7 @@ sparc_fetch_inferior_registers (struct regcache *regcache, int regnum) These functions should instead be paramaterized with an explicit object (struct regcache, struct thread_info?) into which the LWPs registers can be written. */ - pid = get_ptrace_pid (regcache_get_ptid (regcache)); + pid = get_ptrace_pid (regcache->ptid ()); if (regnum == SPARC_G0_REGNUM) { @@ -193,7 +193,7 @@ sparc_store_inferior_registers (struct regcache *regcache, int regnum) /* NOTE: cagney/2002-12-02: See comment in fetch_inferior_registers about threaded assumptions. */ - pid = get_ptrace_pid (regcache_get_ptid (regcache)); + pid = get_ptrace_pid (regcache->ptid ()); if (regnum == -1 || sparc_gregset_supplies_p (gdbarch, regnum)) { diff --git a/gdb/spu-linux-nat.c b/gdb/spu-linux-nat.c index 45485b5..81bb5dd 100644 --- a/gdb/spu-linux-nat.c +++ b/gdb/spu-linux-nat.c @@ -516,7 +516,7 @@ spu_linux_nat_target::fetch_registers (struct regcache *regcache, int regno) /* Since we use functions that rely on inferior_ptid, we need to set and restore it. */ scoped_restore save_ptid - = make_scoped_restore (&inferior_ptid, regcache_get_ptid (regcache)); + = make_scoped_restore (&inferior_ptid, regcache->ptid ()); /* We must be stopped on a spu_run system call. */ if (!parse_spufs_run (&fd, &addr)) @@ -567,7 +567,7 @@ spu_linux_nat_target::store_registers (struct regcache *regcache, int regno) /* Since we use functions that rely on inferior_ptid, we need to set and restore it. */ scoped_restore save_ptid - = make_scoped_restore (&inferior_ptid, regcache_get_ptid (regcache)); + = make_scoped_restore (&inferior_ptid, regcache->ptid ()); /* We must be stopped on a spu_run system call. */ if (!parse_spufs_run (&fd, &addr)) diff --git a/gdb/spu-multiarch.c b/gdb/spu-multiarch.c index 5da5e4e..4a4d500 100644 --- a/gdb/spu-multiarch.c +++ b/gdb/spu-multiarch.c @@ -189,7 +189,7 @@ spu_multiarch_target::fetch_registers (struct regcache *regcache, int regno) /* Since we use functions that rely on inferior_ptid, we need to set and restore it. */ scoped_restore save_ptid - = make_scoped_restore (&inferior_ptid, regcache_get_ptid (regcache)); + = make_scoped_restore (&inferior_ptid, regcache->ptid ()); /* This version applies only if we're currently in spu_run. */ if (gdbarch_bfd_arch_info (gdbarch)->arch != bfd_arch_spu) @@ -248,7 +248,7 @@ spu_multiarch_target::store_registers (struct regcache *regcache, int regno) /* Since we use functions that rely on inferior_ptid, we need to set and restore it. */ scoped_restore save_ptid - = make_scoped_restore (&inferior_ptid, regcache_get_ptid (regcache)); + = make_scoped_restore (&inferior_ptid, regcache->ptid ()); /* This version applies only if we're currently in spu_run. */ if (gdbarch_bfd_arch_info (gdbarch)->arch != bfd_arch_spu) diff --git a/gdb/tilegx-linux-nat.c b/gdb/tilegx-linux-nat.c index 753d818..9b596c0 100644 --- a/gdb/tilegx-linux-nat.c +++ b/gdb/tilegx-linux-nat.c @@ -137,7 +137,7 @@ tilegx_linux_nat_target::fetch_registers (struct regcache *regcache, int regnum) { elf_gregset_t regs; - pid_t tid = get_ptrace_pid (regcache_get_ptid (regcache)); + pid_t tid = get_ptrace_pid (regcache->ptid ()); if (ptrace (PTRACE_GETREGS, tid, 0, (PTRACE_TYPE_ARG3) ®s) < 0) perror_with_name (_("Couldn't get registers")); @@ -153,7 +153,7 @@ tilegx_linux_nat_target::store_registers (struct regcache *regcache, int regnum) { elf_gregset_t regs; - pid_t tid = get_ptrace_pid (regcache_get_ptid (regcache)); + pid_t tid = get_ptrace_pid (regcache->ptid ()); if (ptrace (PTRACE_GETREGS, tid, 0, (PTRACE_TYPE_ARG3) ®s) < 0) perror_with_name (_("Couldn't get registers")); diff --git a/gdb/vax-bsd-nat.c b/gdb/vax-bsd-nat.c index 7f7b54a..5f67061 100644 --- a/gdb/vax-bsd-nat.c +++ b/gdb/vax-bsd-nat.c @@ -74,7 +74,7 @@ void vax_bsd_nat_target::fetch_registers (struct regcache *regcache, int regnum) { struct reg regs; - pid_t pid = ptid_get_pid (regcache_get_ptid (regcache)); + pid_t pid = ptid_get_pid (regcache->ptid ()); if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1) perror_with_name (_("Couldn't get registers")); @@ -89,7 +89,7 @@ void vax_bsd_nat_target::store_registers (struct regcache *regcache, int regnum) { struct reg regs; - pid_t pid = ptid_get_pid (regcache_get_ptid (regcache)); + pid_t pid = ptid_get_pid (regcache->ptid ()); if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1) perror_with_name (_("Couldn't get registers")); diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index 608356e..3fd8415 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -582,7 +582,7 @@ do_windows_fetch_inferior_registers (struct regcache *regcache, void windows_nat_target::fetch_registers (struct regcache *regcache, int r) { - DWORD pid = ptid_get_tid (regcache_get_ptid (regcache)); + DWORD pid = ptid_get_tid (regcache->ptid ()); windows_thread_info *th = thread_rec (pid, TRUE); /* Check if TH exists. Windows sometimes uses a non-existent @@ -611,7 +611,7 @@ do_windows_store_inferior_registers (const struct regcache *regcache, void windows_nat_target::store_registers (struct regcache *regcache, int r) { - DWORD pid = ptid_get_tid (regcache_get_ptid (regcache)); + DWORD pid = ptid_get_tid (regcache->ptid ()); windows_thread_info *th = thread_rec (pid, TRUE); /* Check if TH exists. Windows sometimes uses a non-existent diff --git a/gdb/xtensa-linux-nat.c b/gdb/xtensa-linux-nat.c index 8d9659b..57a44e3 100644 --- a/gdb/xtensa-linux-nat.c +++ b/gdb/xtensa-linux-nat.c @@ -220,7 +220,7 @@ supply_fpregset (struct regcache *regcache, static void fetch_gregs (struct regcache *regcache, int regnum) { - int tid = ptid_get_lwp (regcache_get_ptid (regcache)); + int tid = ptid_get_lwp (regcache->ptid ()); gdb_gregset_t regs; int areg; @@ -239,7 +239,7 @@ fetch_gregs (struct regcache *regcache, int regnum) static void store_gregs (struct regcache *regcache, int regnum) { - int tid = ptid_get_lwp (regcache_get_ptid (regcache)); + int tid = ptid_get_lwp (regcache->ptid ()); gdb_gregset_t regs; int areg; @@ -267,7 +267,7 @@ static int xtreg_high; static void fetch_xtregs (struct regcache *regcache, int regnum) { - int tid = ptid_get_lwp (regcache_get_ptid (regcache)); + int tid = ptid_get_lwp (regcache->ptid ()); const xtensa_regtable_t *ptr; char xtregs [XTENSA_ELF_XTREG_SIZE]; @@ -283,7 +283,7 @@ fetch_xtregs (struct regcache *regcache, int regnum) static void store_xtregs (struct regcache *regcache, int regnum) { - int tid = ptid_get_lwp (regcache_get_ptid (regcache)); + int tid = ptid_get_lwp (regcache->ptid ()); const xtensa_regtable_t *ptr; char xtregs [XTENSA_ELF_XTREG_SIZE];