From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31546 invoked by alias); 20 Dec 2013 13:07:05 -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 31537 invoked by uid 89); 20 Dec 2013 13:07:04 -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_PASS autolearn=ham version=3.3.2 X-HELO: mga09.intel.com Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 20 Dec 2013 13:07:03 +0000 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 20 Dec 2013 05:03:12 -0800 X-ExtLoop1: 1 Received: from irsmsx102.ger.corp.intel.com ([163.33.3.155]) by orsmga001.jf.intel.com with ESMTP; 20 Dec 2013 05:06:57 -0800 Received: from irsmsx104.ger.corp.intel.com ([169.254.5.135]) by IRSMSX102.ger.corp.intel.com ([169.254.2.114]) with mapi id 14.03.0123.003; Fri, 20 Dec 2013 13:06:34 +0000 From: "Metzger, Markus T" To: Tom Tromey , Pedro Alves CC: "jan.kratochvil@redhat.com" , "gdb-patches@sourceware.org" Subject: RE: [PATCH v9 14/29] target: add ops parameter to to_prepare_to_store method Date: Fri, 20 Dec 2013 13:07:00 -0000 Message-ID: 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> <87ioukk0io.fsf@fleche.redhat.com> In-Reply-To: <87ioukk0io.fsf@fleche.redhat.com> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2013-12/txt/msg00829.txt.bz2 > -----Original Message----- > From: Tom Tromey [mailto:tromey@redhat.com] > Sent: Thursday, December 19, 2013 10:13 PM > 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. >=20 > You can try this. I don't know whether it is complete but it's > certainly more complete. >=20 > Tom Thanks, Tom. I'll drop my patch and take yours. Do you plan to commit this soon? Regards, Markus. > commit 1f51251857caf3522c45701ea2c47b4d43a4f60d > Author: Tom Tromey > Date: Tue Dec 17 21:28:22 2013 -0700 >=20 > Add target_ops argument to to_prepare_to_store >=20 > 2013-12-17 Tom Tromey >=20 > * 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. >=20 > 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 >=20 > + * 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, > } >=20 > static void > -go32_prepare_to_store (struct regcache *regcache) > +go32_prepare_to_store (struct target_ops *self, struct regcache > *regcache) > { > } >=20 > 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 p= id) > program being debugged. */ >=20 > static void > -inf_child_prepare_to_store (struct regcache *regcache) > +inf_child_prepare_to_store (struct target_ops *self, > + struct regcache *regcache) > { > } >=20 > 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. */ >=20 > 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 =3D=3D -1, from the c= ontents > of REGISTERS. */ > static void > -procfs_prepare_to_store (struct regcache *regcache) > +procfs_prepare_to_store (struct target_ops *self, struct regcache > *regcache) > { > } >=20 > 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 re= gnum); > static void ravenscar_store_registers (struct target_ops *ops, > struct regcache *regcache, int re= gnum); > -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 s= tep, > enum gdb_signal siggnal); > static void ravenscar_mourn_inferior (struct target_ops *ops); > @@ -303,14 +304,15 @@ ravenscar_store_registers (struct target_ops *ops, > } >=20 > static void > -ravenscar_prepare_to_store (struct regcache *regcache) > +ravenscar_prepare_to_store (struct target_ops *self, > + struct regcache *regcache) > { > struct target_ops *beneath =3D find_target_beneath (&ravenscar_ops); >=20 > 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 =3D 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. */ >=20 > static void > -record_full_core_prepare_to_store (struct regcache *regcache) > +record_full_core_prepare_to_store (struct target_ops *self, > + struct regcache *regcache) > { > } >=20 > 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. */ >=20 > 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); >=20 > static void mips_set_register (int regno, ULONGEST value); >=20 > -static void mips_prepare_to_store (struct regcache *regcache); > +static void mips_prepare_to_store (struct target_ops *self, > + struct regcache *regcache); >=20 > static int mips_fetch_word (CORE_ADDR addr, unsigned int *valp); >=20 > @@ -2064,7 +2065,7 @@ mips_fetch_registers (struct target_ops *ops, > registers, so this function doesn't have to do anything. */ >=20 > static void > -mips_prepare_to_store (struct regcache *regcache) > +mips_prepare_to_store (struct target_ops *self, struct regcache > *regcache) > { > } >=20 > 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); >=20 > -static void gdbsim_prepare_to_store (struct regcache *regcache); > +static void gdbsim_prepare_to_store (struct target_ops *self, > + struct regcache *regcache); >=20 > static void gdbsim_files_info (struct target_ops *target); >=20 > @@ -1052,7 +1053,7 @@ gdbsim_wait (struct target_ops *ops, > debugged. */ >=20 > 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); >=20 > static void remote_files_info (struct target_ops *ignore); >=20 > -static void remote_prepare_to_store (struct regcache *regcache); > +static void remote_prepare_to_store (struct target_ops *self, > + struct regcache *regcache); >=20 > static void remote_open (char *name, int from_tty); >=20 > @@ -6415,7 +6416,7 @@ remote_fetch_registers (struct target_ops *ops, > first. */ >=20 > 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 =3D 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; >=20 > static void debug_to_open (char *, int); >=20 > -static void debug_to_prepare_to_store (struct regcache *); > +static void debug_to_prepare_to_store (struct target_ops *self, > + struct regcache *); >=20 > static void debug_to_files_info (struct target_ops *); >=20 > @@ -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) > } >=20 > 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); >=20 > 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 *); >=20 > /* Transfer LEN bytes of memory between GDB address MYADDR and > target address MEMADDR. If WRITE, transfer them to the target, e= lse > @@ -1031,7 +1031,7 @@ extern void target_store_registers (struct regcache > *regcache, int regs); > debugged. */ >=20 > #define target_prepare_to_store(regcache) \ > - (*current_target.to_prepare_to_store) (regcache) > + (*current_target.to_prepare_to_store) (¤t_target, regcache) >=20 > /* Determine current address space of thread PTID. */ >=20 > 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) > } >=20 > 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. */ > } Intel GmbH Dornacher Strasse 1 85622 Feldkirchen/Muenchen, Deutschland Sitz der Gesellschaft: Feldkirchen bei Muenchen Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk Registergericht: Muenchen HRB 47456 Ust.-IdNr./VAT Registration No.: DE129385895 Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052