From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 121511 invoked by alias); 8 Mar 2017 16:42:17 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 121109 invoked by uid 89); 8 Mar 2017 16:42:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.6 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=beneath 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, 08 Mar 2017 16:42:11 +0000 Received: from ESESSHC007.ericsson.se (Unknown_Domain [153.88.183.39]) by (Symantec Mail Security) with SMTP id 57.1D.18508.F5430C85; Wed, 8 Mar 2017 17:42:07 +0100 (CET) Received: from EUR03-AM5-obe.outbound.protection.outlook.com (153.88.183.145) by oa.msg.ericsson.com (153.88.183.39) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 8 Mar 2017 17:42:06 +0100 Authentication-Results: sourceware.org; dkim=none (message not signed) header.d=none;sourceware.org; dmarc=none action=none header.from=ericsson.com; Received: from elxcz23q12-y4.ca.am.ericsson.se (192.75.88.130) by DB5PR07MB1717.eurprd07.prod.outlook.com (2603:10a6:0:12::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.961.8; Wed, 8 Mar 2017 16:42:05 +0000 From: Simon Marchi To: CC: Simon Marchi Subject: [PATCH 7/7] Pass ptid to to_prepare_to_store Date: Wed, 08 Mar 2017 16:42:00 -0000 Message-ID: <20170308164140.7281-8-simon.marchi@ericsson.com> In-Reply-To: <20170308164140.7281-1-simon.marchi@ericsson.com> References: <20170308164140.7281-1-simon.marchi@ericsson.com> MIME-Version: 1.0 Content-Type: text/plain X-ClientProxiedBy: MWHPR21CA0024.namprd21.prod.outlook.com (2603:10b6:300:6e::34) To DB5PR07MB1717.eurprd07.prod.outlook.com (2603:10a6:0:12::22) X-MS-Office365-Filtering-Correlation-Id: 2a563424-0770-4faf-f7f0-08d466420e7a X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:DB5PR07MB1717; X-Microsoft-Exchange-Diagnostics: 1;DB5PR07MB1717;3:Wo0UtU0cPhRvP+k5cgAaL6Qq+rMrH2J3gD2w7bnyxElrhmHkvOA7N4/loM2SZWeSMVYmPaRWgw0biu5H+3A0qLMr5KWQDyhgWw77b+t7lnXiMN9+q4UMopj8BJJoNPtnPwR4iiW1XPFJxzv9X0XtT7SRgqu/3izPSWgaw/+hwVLOLJ8yY1NT7MmqMVaOHd2QeycXi3eC8dZgUHbzwt3MHFrm4A7N/yMk8IwhbIVeozUFS/6QD2XHtnGbX7TV4qFFuvY3GqfnlbsPgrOpt3fSXw==;25:npzcFErwf6pw/vR65uTxTPhEw5s8fIdOOYIOCLaNf5GQL+oh73Qxr596ecD2bXG7LOk5CInspDi310T+aHPL2arDUwKJKg6FSTrQH0rOkkbJHm8YCzo8oeT/tEh6/1oruSjbGA0P5/v7eo8E2xzfG05sZ/wQkHZCDdkh9/mQpltDEH2QHXQ3D/LhoplxRu/KBgz/Her3Wue8HGkD2wze8GGv3Z9GwWpd4jGukTl77CeuG/1ylxbU82n2pRhrrwmwxja/rPEEJXERomjteo+FYevjkP7OA3GBSmuHKXRWuGbIG/KaTlOB80iMZ6IEs4iok+0tKxRWAU9//SG3/XUCqPAHXy/pyjd2IhSeFzTO6rijAW7phSnEsWgtNBJc5HPPck4MggruA/h7GNKy9PdLeJXwOylFb8qbN5bGqKGLW2E3nlR7jjNxf2j0BffmssLvk5RCt5wGn48nyrzPGgdVYA== X-Microsoft-Exchange-Diagnostics: 1;DB5PR07MB1717;31:ryjYfFmDJSOEXBw1hY01xHveTTWSi2nMYfA9AyJ8O0YnnxxqcPrdfCOAsVCChLSzinEfUMzORvUVRiMtwv5k2quBA0hXkRFUET/uiAziatlRVXiaziz6dHL++W1Wtym7RUdu1Ln2twULVPrgOz9iS4h6S9uJdy7OtskUi5ck8pX4+u8BB+n2+T+MW0x26btz7JlYfAW3D8Bywszxa2qqLlQncFQnmmJGlzg14dc7pwRXQ66FYwoK8uaHsJxVsUZm;20:KHr2Tnt52djKpcFLNfAVxerM+0xwHo8itV3oDTcj/v8Ns1lR0rQo0iWTVKQuOUQrtiouRX59hyRF2608f+w8Idkik3GXHlcdr/AFpL5nmjtgoINVT0FIeW+MUlkXKdKTImt5PGp6Xaq6KCElqQiubUhGUw1v6Iu0+Sa9g1QCLeCHZAc0jI0e73EqnGdeyn8VoieBKl+vY3rzUZb/9SiXEAz2tcQXhF3elOJL6rnE3kC/v8mTouoxJ/zpR7TObYNuaO8zCIxu4wNyjVZFbKIRapUIlPoJN+Ito1IKFcpeEqKkKic2T/7gsLgVg76hYspekSvTvC3EbbQGvSLsReKdujR6qyOvyKWCyYAP1U6QN6Tp7Dk/M/BSsyL3XJ81TTd/FkliV04n9dOTRa7UQQnJKGXzKiYHBPFxtSG3uaHFnxrvP3cpZ62Z8EQdEFeCkhrlOkyVeWu1i36RRjXPn5O9u7k9H2CrOwcmh0XDv5jKU9ghCGzWszt8l/WK+XuJsZM2 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6041248)(20161123558025)(20161123560025)(20161123564025)(20161123555025)(20161123562025)(6072148);SRVR:DB5PR07MB1717;BCL:0;PCL:0;RULEID:;SRVR:DB5PR07MB1717; X-Microsoft-Exchange-Diagnostics: 1;DB5PR07MB1717;4:GwmVb5O07NNBXZT/g5+HSr1Ik+JeX8Nz2P+8TFT+xJ4ks8h8dUzAgAE+P9oaD4tto7B04lb2Eceqw6akT0smPoVF5ikT9k9d30bTQ0kwH0NA2irAFKmk0N25K89nykLmbJ8lZGHnhZ+JVMKGuei5xKmdenPVDN1a75rcllv5xxOkbYVk/tThetmMuWEbKFFf1HuKgGVlp4FOlSfLfH5L9PDl5mR9tAiJC99D/qNRrb89KSaTxTrCF3JrkwtupMhmphQs3QiDKvXsJanPj24IqWbHKj6l4g7Tgjr30EdXzmrtKhSmO8+ctYqxFCPCqBHb/GKm6dkX8FHVTd5LT+TbmPI32xsMrPV4vZfSi317qF23JMroyTxp1/RnWxFPkhu9helmS/OL8aQBWq5xY+KEBeW/GYlLfKipMLwBRz5UPVBt6iU8CTyCNoH7FQU5mxuCCfKrqEn9JQv2epazA9RTGvwV3fXnQzN6qFMZD4QV3SDQ8Wogv6UEuP/UrphvMJrgzgwiWP8qyLegJQLvQlRM7di266RZIXXy1HPq7claAlKtJd8ZTNd7dXaCpdZOcvQa1vo2IQNggSHjHCb6MgE0RhjQ5soTe3lu/o7SYRXVnEI= X-Forefront-PRVS: 02408926C4 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(39450400003)(6116002)(107886003)(38730400002)(53936002)(5003940100001)(110136004)(48376002)(81166006)(8676002)(189998001)(76176999)(50226002)(6512007)(4326008)(3846002)(5660300001)(47776003)(50986999)(6486002)(6506006)(66066001)(2950100002)(6666003)(305945005)(36756003)(2351001)(2906002)(86362001)(1076002)(33646002)(50466002)(7736002)(5890100001)(42186005);DIR:OUT;SFP:1101;SCL:1;SRVR:DB5PR07MB1717;H:elxcz23q12-y4.ca.am.ericsson.se;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;DB5PR07MB1717;23:pOxqI/rlE6LgtZn/9vfAoJZs825sv9arMRQTClh1EGH0+G6HHROClp2xxNIHqrG+B7xvpnmIeQmrt1HmNoZwN/myBdEd9gfe1VVtovMTq6pHMTyeeCdaTDd2rgoBwGXlFTDslr50faH7yY7SzGPLTT2B/PxDzilvqKNYqfJk7vi+wCFy6C/vDIB0Qy+DDXkCwp8ZbUD1m+1D4Kk+l1g2sStjg0iToH/bNkuv+FDq3HpdiCU8iTLwPTPX6Ih1aiHSjw4Ucggt7iRU+qw8MYW4rItkhWVioVqcfjM0M1afrDJxvTbLUuCdz/cIdKnAU8PzUM/irDwI0BJZJZePwySVnS+gqEvyO9dzAPD0AJrVm0ailT/n22segzEvByYCDisazsKmBjAoq+xqkUdl0sA8F9QMNQqJI+S5JX8LYoPElmSFzzoEYtx+ybyX/adV5vSdesgKIvE5Y5TslAvzNuH+p6aChh28JmEzph11GQ8cLMNYRppz6rjwljcVE9a8/EnGaY9QbTT473mc8kT0FYCrYkmvbMU5uQSYfdLDsOc7WbRfkc6JNApshFx1Eepz60H0Z0o2fzbZYEU3mJBcw+XMgiyzOpYVazMIN1XsUWIRSkq2KaCYCLXis8ElWCTMl3E02WGua/xz9PIJXazKkIdgXI/w9hkegCgPu6OUZqP6f2wIHQEXpzXvPalJg8BNgXJqgea3p1FJH13ptfDNvQt281fZeLPj96MMceLSbWPFBeE+2tidZchtHfHIUpmtFenDg9DDoP6Sp3VsON4ML0EM6J5CpdwBifB6GDk7PPlB9JULPuq/iWG8FsyRUw2N17Qtof5YvYBeqUNvt4whWsic1ccyrfO35t3fIsbz4IYM3aKbTnTmM9cI+x1Vr/5cVMi/cCyecgNBdphdXqFlz1FB7kItNRweM9eIpnOmYOi0gppK4WIgkyGS9qKZFf4aiL/W X-Microsoft-Exchange-Diagnostics: 1;DB5PR07MB1717;6:QQgYnG2ifBBOtkqNUxy+2wYW3cvZGw/xAsUbD/GBlYOdGEmiHPHweSXobVnLGLKf8VX5RQE+ecSaE8mMatOjIFAEt9EZpvO69uA/jSQOmDTzP2uB1/O4mjbrhCf5liR+UoSCazEMmERUZnqaFlysg+yTDnmcBKEMhwcv+XEY6qJyBYVrUK8416ftQcagAzwt9B3U3cmlXQBBOFiqiNV8d3B6vrtogRyrFH3wxvmnyzCYQqbkFSPExVqmyjKa483WC4VepNpaLXpkGM9dB9p9Vv23V4JTU2c4arJlxqt1Rgm7hLOozclK3yXdWy3v59G7xcKck68BmJPnj1YfL02QXMIcwFLyZSCgVfPOaoJYVXt5JcaQ4YLD66Zu3i7O1ajqJX4dgkm0+J9iCA7MT6vV2g==;5:Hknyyk8JBqyR5qqpEgAet2X0oKS+CM10BaZwjVD8bqD/lfSD+KCLaPjesmtRWEKbxOCvSq0tZwSpTfC6hifdyZYokK0mDLmzbUT9JNGPDsW5xkcavcdUWHk1PeCb7CPnhBKGVv7L9RTurU/GCNlcyA==;24:1Kiqqo9hU8WwT6yCLzSuozm4g8uyoEn5B7gxGoAfX3nNuHqwCyhVlm5OjQh4MBg09Xogj4uhcObDkWZ3c5ShYO1azZOnPL83uSZ0Ta6gys8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DB5PR07MB1717;7:DEXmMi346ujzOItCVtBJj1CboOisQT6ln3gFGERpK8HFPu6kxVHArbarYDtFzVhwf+wB0FNUDgyIqTqevQL76HQasT0U+duMkt4ydI+QdFg2VVNooe9jd6AQfPsOeYCHgZeyRk7kfp/oIxIig/8e55tAEKLqHqHoElhxWlcGor7hQdEOctCvWakF3sewVwCOmwTVTyVWCaz3Sji/hWh3OPTa7BYanjxR1tzY/1vIxfMeLOGKI7E5lkSf/cU933gwFuTPz3uLxpHyX5l6X5g1zq41RNQvkNxAjnkAfHgMFhYg+iC432yK8EWe2VamJAwcCvbERHzZbQXfhSLpu5z50g== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Mar 2017 16:42:05.4615 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR07MB1717 X-OriginatorOrg: ericsson.com X-IsSubscribed: yes X-SW-Source: 2017-03/txt/msg00104.txt.bz2 In the same vein as to_fetch_registers and to_store_registers, we can update to_prepare_to_store to take the ptid of the thread whose register we want to store as a parameter, rather than reading it from inferior_ptid. gdb/ChangeLog: * target.h (struct target_ops) : Add ptid_t parameter. (target_prepare_to_store): Likewise. * target-delegates.c: Re-generate. * inf-child.c (inf_child_prepare_to_store): Add ptid parameter. * ppc-ravenscar-thread.c (ppc_ravenscar_generic_prepare_to_store): Likewise. * ravenscar-thread.c (ravenscar_prepare_to_store): Add ptid parameter and use it instead of inferior_ptid. * ravenscar-thread.h (struct ravenscar_arch_ops) : Add ptid parameter. * record-btrace.c (record_btrace_prepare_to_store): Add ptid parameter and use it instead of inferior_ptid. * record-full.c (record_full_core_prepare_to_store): Add ptid parameter. * regcache.c (regcache_raw_write): Pass ptid to target_prepare_to_store. * remote-sim.c (gdbsim_prepare_to_store): Add ptid parameter. * remote.c (remote_prepare_to_store): Add ptid parameter. * sparc-ravenscar-thread.c (sparc_ravenscar_prepare_to_store): Add ptid parameter. --- gdb/inf-child.c | 3 ++- gdb/ppc-ravenscar-thread.c | 2 +- gdb/ravenscar-thread.c | 14 ++++++++------ gdb/ravenscar-thread.h | 2 +- gdb/record-btrace.c | 7 ++++--- gdb/record-full.c | 3 ++- gdb/regcache.c | 2 +- gdb/remote-sim.c | 6 ++++-- gdb/remote.c | 6 ++++-- gdb/sparc-ravenscar-thread.c | 5 +++-- gdb/target-delegates.c | 12 +++++++----- gdb/target.h | 6 +++--- 12 files changed, 40 insertions(+), 28 deletions(-) diff --git a/gdb/inf-child.c b/gdb/inf-child.c index 0f128c4905..e5bf2f9ecf 100644 --- a/gdb/inf-child.c +++ b/gdb/inf-child.c @@ -111,7 +111,8 @@ inf_child_post_attach (struct target_ops *self, int pid) static void inf_child_prepare_to_store (struct target_ops *self, - struct regcache *regcache) + struct regcache *regcache, + ptid_t ptid) { } diff --git a/gdb/ppc-ravenscar-thread.c b/gdb/ppc-ravenscar-thread.c index 1e4eb03cf1..078182e6f5 100644 --- a/gdb/ppc-ravenscar-thread.c +++ b/gdb/ppc-ravenscar-thread.c @@ -173,7 +173,7 @@ ppc_ravenscar_generic_fetch_registers thread. */ static void -ppc_ravenscar_generic_prepare_to_store (struct regcache *regcache) +ppc_ravenscar_generic_prepare_to_store (struct regcache *regcache, ptid_t ptid) { /* Nothing to do. */ } diff --git a/gdb/ravenscar-thread.c b/gdb/ravenscar-thread.c index 0660d03a5e..27554573d1 100644 --- a/gdb/ravenscar-thread.c +++ b/gdb/ravenscar-thread.c @@ -58,7 +58,8 @@ static char *ravenscar_extra_thread_info (struct target_ops *self, struct thread_info *tp); static int ravenscar_thread_alive (struct target_ops *ops, ptid_t ptid); static void ravenscar_prepare_to_store (struct target_ops *self, - struct regcache *regcache); + struct regcache *regcache, + ptid_t ptid); static void ravenscar_resume (struct target_ops *ops, ptid_t ptid, int step, enum gdb_signal siggnal); static void ravenscar_mourn_inferior (struct target_ops *ops); @@ -302,21 +303,22 @@ ravenscar_store_registers (struct target_ops *ops, static void ravenscar_prepare_to_store (struct target_ops *self, - struct regcache *regcache) + struct regcache *regcache, + ptid_t ptid) { struct target_ops *beneath = find_target_beneath (self); if (!ravenscar_runtime_initialized () - || ptid_equal (inferior_ptid, base_magic_null_ptid) - || ptid_equal (inferior_ptid, ravenscar_running_thread ())) - beneath->to_prepare_to_store (beneath, regcache); + || ptid_equal (ptid, base_magic_null_ptid) + || ptid_equal (ptid, ravenscar_running_thread ())) + beneath->to_prepare_to_store (beneath, regcache, ptid); else { struct gdbarch *gdbarch = get_regcache_arch (regcache); struct ravenscar_arch_ops *arch_ops = gdbarch_ravenscar_ops (gdbarch); - arch_ops->to_prepare_to_store (regcache); + arch_ops->to_prepare_to_store (regcache, ptid); } } diff --git a/gdb/ravenscar-thread.h b/gdb/ravenscar-thread.h index 2df88981a5..ab2f9a7c82 100644 --- a/gdb/ravenscar-thread.h +++ b/gdb/ravenscar-thread.h @@ -26,7 +26,7 @@ struct ravenscar_arch_ops { void (*to_fetch_registers) (struct regcache *, ptid_t, int); void (*to_store_registers) (struct regcache *, ptid_t, int); - void (*to_prepare_to_store) (struct regcache *); + void (*to_prepare_to_store) (struct regcache *, ptid_t); }; #endif /* !defined (RAVENSCAR_THREAD_H) */ diff --git a/gdb/record-btrace.c b/gdb/record-btrace.c index 6c16148a25..6674eac8a1 100644 --- a/gdb/record-btrace.c +++ b/gdb/record-btrace.c @@ -1481,16 +1481,17 @@ record_btrace_store_registers (struct target_ops *ops, static void record_btrace_prepare_to_store (struct target_ops *ops, - struct regcache *regcache) + struct regcache *regcache, + ptid_t ptid) { struct target_ops *t; if (!record_btrace_generating_corefile - && record_btrace_is_replaying (ops, inferior_ptid)) + && record_btrace_is_replaying (ops, ptid)) return; t = ops->beneath; - t->to_prepare_to_store (t, regcache); + t->to_prepare_to_store (t, regcache, ptid); } /* The branch trace frame cache. */ diff --git a/gdb/record-full.c b/gdb/record-full.c index c55fb41b01..220e996e3d 100644 --- a/gdb/record-full.c +++ b/gdb/record-full.c @@ -2065,7 +2065,8 @@ record_full_core_fetch_registers (struct target_ops *ops, static void record_full_core_prepare_to_store (struct target_ops *self, - struct regcache *regcache) + struct regcache *regcache, + ptid_t ptid) { } diff --git a/gdb/regcache.c b/gdb/regcache.c index c8eb200fa2..1b017502b6 100644 --- a/gdb/regcache.c +++ b/gdb/regcache.c @@ -949,7 +949,7 @@ regcache_raw_write (struct regcache *regcache, int regnum, chain_before_save_inferior = save_inferior_ptid (); inferior_ptid = regcache->ptid; - target_prepare_to_store (regcache); + target_prepare_to_store (regcache, regcache->ptid); regcache_raw_set_cached_value (regcache, regnum, buf); /* Register a cleanup function for invalidating the register after it is diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c index b7ecdbb05f..81626f3135 100644 --- a/gdb/remote-sim.c +++ b/gdb/remote-sim.c @@ -82,7 +82,8 @@ static void gdbsim_detach (struct target_ops *ops, const char *args, int from_tty); static void gdbsim_prepare_to_store (struct target_ops *self, - struct regcache *regcache); + struct regcache *regcache, + ptid_t ptid); static void gdbsim_files_info (struct target_ops *target); @@ -1060,7 +1061,8 @@ gdbsim_wait (struct target_ops *ops, debugged. */ static void -gdbsim_prepare_to_store (struct target_ops *self, struct regcache *regcache) +gdbsim_prepare_to_store (struct target_ops *self, struct regcache *regcache, + ptid_t ptid) { /* Do nothing, since we can store individual regs. */ } diff --git a/gdb/remote.c b/gdb/remote.c index b7ffa4a28f..e4c4717e45 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -106,7 +106,8 @@ static int getpkt_or_notif_sane (char **buf, long *sizeof_buf, static void remote_files_info (struct target_ops *ignore); static void remote_prepare_to_store (struct target_ops *self, - struct regcache *regcache); + struct regcache *regcache, + ptid_t ptid); static void remote_open_1 (const char *, int, struct target_ops *, int extended_p); @@ -7755,7 +7756,8 @@ remote_fetch_registers (struct target_ops *ops, struct regcache *regcache, first. */ static void -remote_prepare_to_store (struct target_ops *self, struct regcache *regcache) +remote_prepare_to_store (struct target_ops *self, struct regcache *regcache, + ptid_t ptid) { struct remote_arch_state *rsa = get_remote_arch_state (); int i; diff --git a/gdb/sparc-ravenscar-thread.c b/gdb/sparc-ravenscar-thread.c index 4e63ec5a3c..9d340d2289 100644 --- a/gdb/sparc-ravenscar-thread.c +++ b/gdb/sparc-ravenscar-thread.c @@ -25,7 +25,8 @@ #include "ravenscar-thread.h" #include "sparc-ravenscar-thread.h" -static void sparc_ravenscar_prepare_to_store (struct regcache *regcache); +static void sparc_ravenscar_prepare_to_store (struct regcache *regcache, + ptid_t ptid); /* Register offsets from a referenced address (exempli gratia the Thread_Descriptor). The referenced address depends on the register @@ -141,7 +142,7 @@ sparc_ravenscar_fetch_registers (struct regcache *regcache, ptid_t ptid, thread. */ static void -sparc_ravenscar_prepare_to_store (struct regcache *regcache) +sparc_ravenscar_prepare_to_store (struct regcache *regcache, ptid_t ptid) { /* Nothing to do. */ } diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c index 3f1c236d8f..26534382b7 100644 --- a/gdb/target-delegates.c +++ b/gdb/target-delegates.c @@ -216,27 +216,29 @@ debug_store_registers (struct target_ops *self, struct regcache *arg1, ptid_t ar } static void -delegate_prepare_to_store (struct target_ops *self, struct regcache *arg1) +delegate_prepare_to_store (struct target_ops *self, struct regcache *arg1, ptid_t arg2) { self = self->beneath; - self->to_prepare_to_store (self, arg1); + self->to_prepare_to_store (self, arg1, arg2); } static void -tdefault_prepare_to_store (struct target_ops *self, struct regcache *arg1) +tdefault_prepare_to_store (struct target_ops *self, struct regcache *arg1, ptid_t arg2) { noprocess (); } static void -debug_prepare_to_store (struct target_ops *self, struct regcache *arg1) +debug_prepare_to_store (struct target_ops *self, struct regcache *arg1, ptid_t arg2) { fprintf_unfiltered (gdb_stdlog, "-> %s->to_prepare_to_store (...)\n", debug_target.to_shortname); - debug_target.to_prepare_to_store (&debug_target, arg1); + debug_target.to_prepare_to_store (&debug_target, arg1, arg2); fprintf_unfiltered (gdb_stdlog, "<- %s->to_prepare_to_store (", debug_target.to_shortname); target_debug_print_struct_target_ops_p (&debug_target); fputs_unfiltered (", ", gdb_stdlog); target_debug_print_struct_regcache_p (arg1); + fputs_unfiltered (", ", gdb_stdlog); + target_debug_print_ptid_t (arg2); fputs_unfiltered (")\n", gdb_stdlog); } diff --git a/gdb/target.h b/gdb/target.h index d6c07ad44d..4a0749de86 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -474,7 +474,7 @@ struct target_ops void (*to_store_registers) (struct target_ops *, struct regcache *, ptid_t, int) TARGET_DEFAULT_NORETURN (noprocess ()); - void (*to_prepare_to_store) (struct target_ops *, struct regcache *) + void (*to_prepare_to_store) (struct target_ops *, struct regcache *, ptid_t) TARGET_DEFAULT_NORETURN (noprocess ()); void (*to_files_info) (struct target_ops *) @@ -1401,8 +1401,8 @@ extern void target_store_registers (struct regcache *regcache, ptid_t ptid, that REGISTERS contains all the registers from the program being debugged. */ -#define target_prepare_to_store(regcache) \ - (*current_target.to_prepare_to_store) (¤t_target, regcache) +#define target_prepare_to_store(regcache, ptid) \ + (*current_target.to_prepare_to_store) (¤t_target, regcache, ptid) /* Determine current address space of thread PTID. */ -- 2.11.0