From: "Metzger, Markus T" <markus.t.metzger@intel.com>
To: Tom Tromey <tromey@redhat.com>, Pedro Alves <palves@redhat.com>
Cc: "jan.kratochvil@redhat.com" <jan.kratochvil@redhat.com>,
"gdb-patches@sourceware.org" <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 [thread overview]
Message-ID: <A78C989F6D9628469189715575E55B230AA3B958@IRSMSX104.ger.corp.intel.com> (raw)
In-Reply-To: <87ioukk0io.fsf@fleche.redhat.com>
> -----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.
>
> You can try this. I don't know whether it is complete but it's
> certainly more complete.
>
> 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 <tromey@redhat.com>
> Date: Tue Dec 17 21:28:22 2013 -0700
>
> Add target_ops argument to to_prepare_to_store
>
> 2013-12-17 Tom Tromey <tromey@redhat.com>
>
> * windows-nat.c (windows_prepare_to_store): Add 'self' argument.
> * target.h (struct target_ops) <to_prepare_to_store>: 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 <tromey@redhat.com>
>
> + * windows-nat.c (windows_prepare_to_store): Add 'self' argument.
> + * target.h (struct target_ops) <to_prepare_to_store>: 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 <tromey@redhat.com>
> +
> * target.h (struct target_ops) <to_post_attach>: 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. */
> }
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
next prev parent reply other threads:[~2013-12-20 13:07 UTC|newest]
Thread overview: 66+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-19 16:45 [PATCH v9 00/29] record-btrace: reverse Markus Metzger
2013-12-19 16:45 ` [PATCH v9 24/29] record-btrace: add record goto target methods Markus Metzger
2013-12-19 16:45 ` [PATCH v9 10/29] btrace: increase buffer size Markus Metzger
2013-12-19 16:45 ` [PATCH v9 23/29] record-btrace: provide target_find_new_threads method Markus Metzger
2013-12-19 19:32 ` Pedro Alves
2013-12-19 16:45 ` [PATCH v9 29/29] record-btrace: add (reverse-)stepping support Markus Metzger
2013-12-19 17:31 ` Eli Zaretskii
2013-12-19 20:10 ` Pedro Alves
2013-12-20 14:37 ` Metzger, Markus T
2013-12-20 14:47 ` Metzger, Markus T
2013-12-20 16:31 ` Pedro Alves
2013-12-20 16:07 ` Pedro Alves
2013-12-19 16:45 ` [PATCH v9 13/29] btrace: add replay position to btrace thread info Markus Metzger
2013-12-19 16:45 ` [PATCH v9 25/29] record-btrace: extend unwinder Markus Metzger
2013-12-19 16:45 ` [PATCH v9 22/29] record-btrace: add to_wait and to_resume target methods Markus Metzger
2013-12-19 16:45 ` [PATCH v9 21/29] record-btrace: provide xfer_partial target method Markus Metzger
2013-12-19 19:13 ` Pedro Alves
2013-12-20 13:37 ` Metzger, Markus T
2013-12-20 13:54 ` Metzger, Markus T
2013-12-20 15:56 ` Pedro Alves
2013-12-20 16:02 ` Pedro Alves
2014-01-13 17:11 ` Pedro Alves
2014-01-13 12:36 ` Metzger, Markus T
2014-01-13 16:47 ` Pedro Alves
2013-12-19 19:26 ` Pedro Alves
2013-12-20 13:32 ` Metzger, Markus T
2013-12-20 15:36 ` Pedro Alves
2013-12-19 16:45 ` [PATCH v9 04/29] gdbarch: add instruction predicate methods Markus Metzger
2013-12-19 20:19 ` Pedro Alves
2013-12-19 16:45 ` [PATCH v9 28/29] target: allow decr_pc_after_break to be defined by the target Markus Metzger
2013-12-19 19:51 ` Pedro Alves
2013-12-19 16:45 ` [PATCH v9 03/29] btrace: uppercase btrace_read_type Markus Metzger
2013-12-19 16:45 ` [PATCH v9 11/29] record-btrace: optionally indent function call history Markus Metzger
2013-12-19 18:23 ` Pedro Alves
2013-12-20 12:54 ` Metzger, Markus T
2013-12-20 16:47 ` Pedro Alves
2013-12-19 16:45 ` [PATCH v9 12/29] record-btrace: make ranges include begin and end Markus Metzger
2013-12-19 17:29 ` Eli Zaretskii
2013-12-19 16:45 ` [PATCH v9 16/29] frame, backtrace: allow targets to supply a frame unwinder Markus Metzger
2013-12-19 18:41 ` Pedro Alves
2013-12-19 16:45 ` [PATCH v9 08/29] record-btrace: fix insn range in function call history Markus Metzger
2013-12-19 16:45 ` [PATCH v9 09/29] record-btrace: start counting at one Markus Metzger
2013-12-19 17:27 ` Eli Zaretskii
2013-12-19 16:45 ` [PATCH v9 18/29] frame: do not assume unwinding will succeed Markus Metzger
2013-12-19 16:45 ` [PATCH v9 05/29] frame: add frame_is_tailcall function Markus Metzger
2013-12-19 20:19 ` Pedro Alves
2013-12-19 16:45 ` [PATCH v9 01/29] btrace, test: fix multi-line btrace tests Markus Metzger
2013-12-19 18:01 ` Pedro Alves
2013-12-19 16:45 ` [PATCH v9 27/29] record-btrace: show trace from enable location Markus Metzger
2013-12-19 16:45 ` [PATCH v9 02/29] btrace, linux: fix memory leak when reading branch trace Markus Metzger
2013-12-19 16:45 ` [PATCH v9 06/29] frame: add frame_id_build_unavailable_stack_special Markus Metzger
2013-12-19 18:12 ` Pedro Alves
2013-12-19 16:45 ` [PATCH v9 14/29] target: add ops parameter to to_prepare_to_store method Markus Metzger
2013-12-19 18:30 ` Pedro Alves
2013-12-19 21:13 ` Tom Tromey
2013-12-20 13:07 ` Metzger, Markus T [this message]
2013-12-20 15:13 ` Tom Tromey
2013-12-20 17:23 ` Pedro Alves
2013-12-19 16:45 ` [PATCH v9 17/29] frame, cfa: check unwind stop reason first Markus Metzger
2013-12-19 16:45 ` [PATCH v9 19/29] record-btrace, frame: supply target-specific unwinder Markus Metzger
2013-12-19 16:45 ` [PATCH v9 15/29] record-btrace: supply register target methods Markus Metzger
2013-12-19 16:45 ` [PATCH v9 20/29] target, breakpoint: allow insert/remove breakpoint to be forwarded Markus Metzger
2013-12-19 19:08 ` Pedro Alves
2013-12-19 16:45 ` [PATCH v9 26/29] btrace, gdbserver: read branch trace incrementally Markus Metzger
2013-12-19 16:45 ` [PATCH v9 07/29] btrace: change branch trace data structure Markus Metzger
2013-12-19 20:23 ` [PATCH v9 00/29] record-btrace: reverse Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=A78C989F6D9628469189715575E55B230AA3B958@IRSMSX104.ger.corp.intel.com \
--to=markus.t.metzger@intel.com \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@redhat.com \
--cc=palves@redhat.com \
--cc=tromey@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).