From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2820 invoked by alias); 19 Dec 2013 21:13:09 -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 2810 invoked by uid 89); 19 Dec 2013 21:13:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 19 Dec 2013 21:13:08 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rBJLD6Vl026710 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 19 Dec 2013 16:13:06 -0500 Received: from barimba (ovpn-113-93.phx2.redhat.com [10.3.113.93]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id rBJLD3sY019663 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 19 Dec 2013 16:13:04 -0500 From: Tom Tromey To: Pedro Alves Cc: Markus Metzger , jan.kratochvil@redhat.com, gdb-patches@sourceware.org Subject: Re: [PATCH v9 14/29] target: add ops parameter to to_prepare_to_store method References: <1387471499-29444-1-git-send-email-markus.t.metzger@intel.com> <1387471499-29444-15-git-send-email-markus.t.metzger@intel.com> <52B33B4E.8070409@redhat.com> Date: Thu, 19 Dec 2013 21:13:00 -0000 In-Reply-To: <52B33B4E.8070409@redhat.com> (Pedro Alves's message of "Thu, 19 Dec 2013 18:30:38 +0000") Message-ID: <87ioukk0io.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2013-12/txt/msg00810.txt.bz2 >>>>> "Pedro" == Pedro Alves writes: Pedro> There are more sites that need updating. E.g., go32-nat.c, Pedro> nto-procfs.c, windows-nat.c, possibly others. Try grepping Pedro> for to_prepare_to_store. [...] Pedro> There should be a noprocess() call after the loop here. You can try this. I don't know whether it is complete but it's certainly more complete. Tom commit 1f51251857caf3522c45701ea2c47b4d43a4f60d Author: Tom Tromey Date: Tue Dec 17 21:28:22 2013 -0700 Add target_ops argument to to_prepare_to_store 2013-12-17 Tom Tromey * windows-nat.c (windows_prepare_to_store): Add 'self' argument. * target.h (struct target_ops) : Add argument. (target_prepare_to_store): Add argument. * target.c (debug_to_prepare_to_store): Add argument. (update_current_target): Update. * remote.c (remote_prepare_to_store): Add 'self' argument. * remote-sim.c (gdbsim_prepare_to_store): Add 'self' argument. * remote-mips.c (mips_prepare_to_store): Add 'self' argument. * remote-m32r-sdi.c (m32r_prepare_to_store): Add 'self' argument. * record-full.c (record_full_core_prepare_to_store): Add 'self' argument. * ravenscar-thread.c (ravenscar_prepare_to_store): Add argument. * nto-procfs.c (procfs_prepare_to_store): Add 'self' argument. * monitor.c (monitor_prepare_to_store): Add 'self' argument. * inf-child.c (inf_child_prepare_to_store): Add 'self' argument. * go32-nat.c (go32_prepare_to_store): Add 'self' argument. diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 9cbb85f..fd7605d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,25 @@ 2013-12-17 Tom Tromey + * windows-nat.c (windows_prepare_to_store): Add 'self' argument. + * target.h (struct target_ops) : Add + argument. + (target_prepare_to_store): Add argument. + * target.c (debug_to_prepare_to_store): Add argument. + (update_current_target): Update. + * remote.c (remote_prepare_to_store): Add 'self' argument. + * remote-sim.c (gdbsim_prepare_to_store): Add 'self' argument. + * remote-mips.c (mips_prepare_to_store): Add 'self' argument. + * remote-m32r-sdi.c (m32r_prepare_to_store): Add 'self' argument. + * record-full.c (record_full_core_prepare_to_store): Add 'self' + argument. + * ravenscar-thread.c (ravenscar_prepare_to_store): Add argument. + * nto-procfs.c (procfs_prepare_to_store): Add 'self' argument. + * monitor.c (monitor_prepare_to_store): Add 'self' argument. + * inf-child.c (inf_child_prepare_to_store): Add 'self' argument. + * go32-nat.c (go32_prepare_to_store): Add 'self' argument. + +2013-12-17 Tom Tromey + * target.h (struct target_ops) : Add argument. (target_post_attach): Add argument. * target.c (debug_to_post_attach): Add argument. diff --git a/gdb/go32-nat.c b/gdb/go32-nat.c index caf595c..ef6ceef 100644 --- a/gdb/go32-nat.c +++ b/gdb/go32-nat.c @@ -246,7 +246,8 @@ static void go32_fetch_registers (struct target_ops *ops, static void store_register (const struct regcache *, int regno); static void go32_store_registers (struct target_ops *ops, struct regcache *, int regno); -static void go32_prepare_to_store (struct regcache *); +static void go32_prepare_to_store (struct target_ops *self, + struct regcache *); static int go32_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len, int write, struct mem_attrib *attrib, @@ -598,7 +599,7 @@ go32_store_registers (struct target_ops *ops, } static void -go32_prepare_to_store (struct regcache *regcache) +go32_prepare_to_store (struct target_ops *self, struct regcache *regcache) { } diff --git a/gdb/inf-child.c b/gdb/inf-child.c index 77853e8..de36417 100644 --- a/gdb/inf-child.c +++ b/gdb/inf-child.c @@ -100,7 +100,8 @@ inf_child_post_attach (struct target_ops *self, int pid) program being debugged. */ static void -inf_child_prepare_to_store (struct regcache *regcache) +inf_child_prepare_to_store (struct target_ops *self, + struct regcache *regcache) { } diff --git a/gdb/monitor.c b/gdb/monitor.c index 70064ba..4292f47 100644 --- a/gdb/monitor.c +++ b/gdb/monitor.c @@ -1427,7 +1427,7 @@ monitor_store_registers (struct target_ops *ops, debugged. */ static void -monitor_prepare_to_store (struct regcache *regcache) +monitor_prepare_to_store (struct target_ops *self, struct regcache *regcache) { /* Do nothing, since we can store individual regs. */ } diff --git a/gdb/nto-procfs.c b/gdb/nto-procfs.c index bbc071f..308b398 100644 --- a/gdb/nto-procfs.c +++ b/gdb/nto-procfs.c @@ -1231,7 +1231,7 @@ procfs_kill_inferior (struct target_ops *ops) /* Store register REGNO, or all registers if REGNO == -1, from the contents of REGISTERS. */ static void -procfs_prepare_to_store (struct regcache *regcache) +procfs_prepare_to_store (struct target_ops *self, struct regcache *regcache) { } diff --git a/gdb/ravenscar-thread.c b/gdb/ravenscar-thread.c index 9ef265d..0d60277 100644 --- a/gdb/ravenscar-thread.c +++ b/gdb/ravenscar-thread.c @@ -62,7 +62,8 @@ static void ravenscar_fetch_registers (struct target_ops *ops, struct regcache *regcache, int regnum); static void ravenscar_store_registers (struct target_ops *ops, struct regcache *regcache, int regnum); -static void ravenscar_prepare_to_store (struct regcache *regcache); +static void ravenscar_prepare_to_store (struct target_ops *self, + struct regcache *regcache); 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); @@ -303,14 +304,15 @@ ravenscar_store_registers (struct target_ops *ops, } static void -ravenscar_prepare_to_store (struct regcache *regcache) +ravenscar_prepare_to_store (struct target_ops *self, + struct regcache *regcache) { struct target_ops *beneath = find_target_beneath (&ravenscar_ops); if (!ravenscar_runtime_initialized () || ptid_equal (inferior_ptid, base_magic_null_ptid) || ptid_equal (inferior_ptid, ravenscar_running_thread ())) - beneath->to_prepare_to_store (regcache); + beneath->to_prepare_to_store (beneath, regcache); else { struct gdbarch *gdbarch = get_regcache_arch (regcache); diff --git a/gdb/record-full.c b/gdb/record-full.c index dedb264..9e8ac1e 100644 --- a/gdb/record-full.c +++ b/gdb/record-full.c @@ -1969,7 +1969,8 @@ record_full_core_fetch_registers (struct target_ops *ops, /* "to_prepare_to_store" method for prec over corefile. */ static void -record_full_core_prepare_to_store (struct regcache *regcache) +record_full_core_prepare_to_store (struct target_ops *self, + struct regcache *regcache) { } diff --git a/gdb/remote-m32r-sdi.c b/gdb/remote-m32r-sdi.c index 43f3772..a57e76f 100644 --- a/gdb/remote-m32r-sdi.c +++ b/gdb/remote-m32r-sdi.c @@ -1013,7 +1013,7 @@ m32r_store_register (struct target_ops *ops, debugged. */ static void -m32r_prepare_to_store (struct regcache *regcache) +m32r_prepare_to_store (struct target_ops *self, struct regcache *regcache) { /* Do nothing, since we can store individual regs. */ if (remote_debug) diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c index 9ba72bf..cefbda7 100644 --- a/gdb/remote-mips.c +++ b/gdb/remote-mips.c @@ -90,7 +90,8 @@ static int mips_map_regno (struct gdbarch *, int); static void mips_set_register (int regno, ULONGEST value); -static void mips_prepare_to_store (struct regcache *regcache); +static void mips_prepare_to_store (struct target_ops *self, + struct regcache *regcache); static int mips_fetch_word (CORE_ADDR addr, unsigned int *valp); @@ -2064,7 +2065,7 @@ mips_fetch_registers (struct target_ops *ops, registers, so this function doesn't have to do anything. */ static void -mips_prepare_to_store (struct regcache *regcache) +mips_prepare_to_store (struct target_ops *self, struct regcache *regcache) { } diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c index 59ea2a1..9f1e5eb 100644 --- a/gdb/remote-sim.c +++ b/gdb/remote-sim.c @@ -81,7 +81,8 @@ static void gdbsim_close (struct target_ops *self); static void gdbsim_detach (struct target_ops *ops, const char *args, int from_tty); -static void gdbsim_prepare_to_store (struct regcache *regcache); +static void gdbsim_prepare_to_store (struct target_ops *self, + struct regcache *regcache); static void gdbsim_files_info (struct target_ops *target); @@ -1052,7 +1053,7 @@ gdbsim_wait (struct target_ops *ops, debugged. */ static void -gdbsim_prepare_to_store (struct regcache *regcache) +gdbsim_prepare_to_store (struct target_ops *self, struct regcache *regcache) { /* Do nothing, since we can store individual regs. */ } diff --git a/gdb/remote.c b/gdb/remote.c index c9ce3fb..aaed11c 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -98,7 +98,8 @@ static void async_handle_remote_sigint_twice (int); static void remote_files_info (struct target_ops *ignore); -static void remote_prepare_to_store (struct regcache *regcache); +static void remote_prepare_to_store (struct target_ops *self, + struct regcache *regcache); static void remote_open (char *name, int from_tty); @@ -6415,7 +6416,7 @@ remote_fetch_registers (struct target_ops *ops, first. */ static void -remote_prepare_to_store (struct regcache *regcache) +remote_prepare_to_store (struct target_ops *self, struct regcache *regcache) { struct remote_arch_state *rsa = get_remote_arch_state (); int i; diff --git a/gdb/target.c b/gdb/target.c index db665a4..69f8c52 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -91,7 +91,8 @@ static struct target_ops debug_target; static void debug_to_open (char *, int); -static void debug_to_prepare_to_store (struct regcache *); +static void debug_to_prepare_to_store (struct target_ops *self, + struct regcache *); static void debug_to_files_info (struct target_ops *); @@ -719,7 +720,7 @@ update_current_target (void) (void (*) (struct target_ops *, int)) target_ignore); de_fault (to_prepare_to_store, - (void (*) (struct regcache *)) + (void (*) (struct target_ops *, struct regcache *)) noprocess); de_fault (deprecated_xfer_memory, (int (*) (CORE_ADDR, gdb_byte *, int, int, @@ -4383,9 +4384,9 @@ target_call_history_range (ULONGEST begin, ULONGEST end, int flags) } static void -debug_to_prepare_to_store (struct regcache *regcache) +debug_to_prepare_to_store (struct target_ops *self, struct regcache *regcache) { - debug_target.to_prepare_to_store (regcache); + debug_target.to_prepare_to_store (&debug_target, regcache); fprintf_unfiltered (gdb_stdlog, "target_prepare_to_store ()\n"); } diff --git a/gdb/target.h b/gdb/target.h index a1b1e94..583fcd5 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -388,7 +388,7 @@ struct target_ops void (*to_fetch_registers) (struct target_ops *, struct regcache *, int); void (*to_store_registers) (struct target_ops *, struct regcache *, int) TARGET_DEFAULT (noprocess ()); - void (*to_prepare_to_store) (struct regcache *); + void (*to_prepare_to_store) (struct target_ops *, struct regcache *); /* Transfer LEN bytes of memory between GDB address MYADDR and target address MEMADDR. If WRITE, transfer them to the target, else @@ -1031,7 +1031,7 @@ extern void target_store_registers (struct regcache *regcache, int regs); debugged. */ #define target_prepare_to_store(regcache) \ - (*current_target.to_prepare_to_store) (regcache) + (*current_target.to_prepare_to_store) (¤t_target, regcache) /* Determine current address space of thread PTID. */ diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index e2b3a57..3942f6f 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -2459,7 +2459,7 @@ windows_kill_inferior (struct target_ops *ops) } static void -windows_prepare_to_store (struct regcache *regcache) +windows_prepare_to_store (struct target_ops *self, struct regcache *regcache) { /* Do nothing, since we can store individual regs. */ }