diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2007-05-06 18:55:41 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@de.ibm.com> | 2007-05-06 18:55:41 +0000 |
commit | f399b0f7d6172ad47649be7b40e2f00d33cc2e43 (patch) | |
tree | 422a15b6bbff62da6d0390efd9538766449724aa /gdb | |
parent | bc214dc4fa9cdf464e424998ee6b6c0899f5cd12 (diff) | |
download | gdb-f399b0f7d6172ad47649be7b40e2f00d33cc2e43.tar.gz |
* target.h (struct target_ops): Add REGCACHE parameter to
to_prepare_to_store.
(target_prepare_to_store): Likewise.
* target.c (debug_to_prepare_to_store): Add REGCACHE parameter.
(update_current_target): Adapt prepare_to_store de_fault rule.
* regcache.c (regcache_raw_write): Pass regcache to
target_prepare_to_store.
* inftarg.c (child_prepare_to_store): Add REGCACHE parameter.
Do not call CHILD_PREPARE_TO_STORE.
* gnu-nat.c (gnu_prepare_to_store): Likewise.
* procfs.c (procfs_prepare_to_store): Likewise.
* inf-child.c (inf_child_prepare_to_store): Add REGCACHE parameter.
* go32-nat.c (go32_prepare_to_store): Likewise.
* monitor.c (monitor_prepare_to_store): Likewise.
* nto-procfs.c (procfs_prepare_to_store): Likewise.
* remote-m32r-sdi.c (m32r_prepare_to_store): Likewise.
* remote-mips.c (mips_prepare_to_store): Likewise.
* remote-sim.c (gdbsim_prepare_to_store): Likewise.
* win32-nat.c (win32_prepare_to_store): Likewise.
* remote.c (remote_prepare_to_store): Add REGCACHE parameter.
Use it instead of current_regcache.
* hpux-thread.c (hpux_thread_prepare_to_store): Add REGCACHE
parameter. Pass it on to next target.
* sol-thread.c (sol_thread_prepare_to_store): Likewise.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 32 | ||||
-rw-r--r-- | gdb/gnu-nat.c | 5 | ||||
-rw-r--r-- | gdb/go32-nat.c | 4 | ||||
-rw-r--r-- | gdb/hpux-thread.c | 4 | ||||
-rw-r--r-- | gdb/inf-child.c | 2 | ||||
-rw-r--r-- | gdb/inftarg.c | 7 | ||||
-rw-r--r-- | gdb/monitor.c | 2 | ||||
-rw-r--r-- | gdb/nto-procfs.c | 2 | ||||
-rw-r--r-- | gdb/procfs.c | 7 | ||||
-rw-r--r-- | gdb/regcache.c | 2 | ||||
-rw-r--r-- | gdb/remote-m32r-sdi.c | 2 | ||||
-rw-r--r-- | gdb/remote-mips.c | 4 | ||||
-rw-r--r-- | gdb/remote-sim.c | 4 | ||||
-rw-r--r-- | gdb/remote.c | 6 | ||||
-rw-r--r-- | gdb/sol-thread.c | 4 | ||||
-rw-r--r-- | gdb/target.c | 8 | ||||
-rw-r--r-- | gdb/target.h | 6 | ||||
-rw-r--r-- | gdb/win32-nat.c | 2 |
18 files changed, 63 insertions, 40 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a24b284c236..2420767d92a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,37 @@ 2007-05-06 Ulrich Weigand <uweigand@de.ibm.com> + * target.h (struct target_ops): Add REGCACHE parameter to + to_prepare_to_store. + (target_prepare_to_store): Likewise. + * target.c (debug_to_prepare_to_store): Add REGCACHE parameter. + (update_current_target): Adapt prepare_to_store de_fault rule. + + * regcache.c (regcache_raw_write): Pass regcache to + target_prepare_to_store. + + * inftarg.c (child_prepare_to_store): Add REGCACHE parameter. + Do not call CHILD_PREPARE_TO_STORE. + * gnu-nat.c (gnu_prepare_to_store): Likewise. + * procfs.c (procfs_prepare_to_store): Likewise. + + * inf-child.c (inf_child_prepare_to_store): Add REGCACHE parameter. + * go32-nat.c (go32_prepare_to_store): Likewise. + * monitor.c (monitor_prepare_to_store): Likewise. + * nto-procfs.c (procfs_prepare_to_store): Likewise. + * remote-m32r-sdi.c (m32r_prepare_to_store): Likewise. + * remote-mips.c (mips_prepare_to_store): Likewise. + * remote-sim.c (gdbsim_prepare_to_store): Likewise. + * win32-nat.c (win32_prepare_to_store): Likewise. + + * remote.c (remote_prepare_to_store): Add REGCACHE parameter. + Use it instead of current_regcache. + + * hpux-thread.c (hpux_thread_prepare_to_store): Add REGCACHE + parameter. Pass it on to next target. + * sol-thread.c (sol_thread_prepare_to_store): Likewise. + +2007-05-06 Ulrich Weigand <uweigand@de.ibm.com> + * target.h (struct regcache): Add forward declaration. (struct target_ops): Add REGCACHE parameter to to_fetch_registers and to_store_registers target operations. diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c index 4e8b82eb42f..80ceb9075ad 100644 --- a/gdb/gnu-nat.c +++ b/gdb/gnu-nat.c @@ -2207,11 +2207,8 @@ gnu_terminal_init_inferior (void) that registers contains all the registers from the program being debugged. */ static void -gnu_prepare_to_store (void) +gnu_prepare_to_store (struct regcache *regcache) { -#ifdef CHILD_PREPARE_TO_STORE - CHILD_PREPARE_TO_STORE (); -#endif } static void diff --git a/gdb/go32-nat.c b/gdb/go32-nat.c index b4b86728aa1..a794c61b8ff 100644 --- a/gdb/go32-nat.c +++ b/gdb/go32-nat.c @@ -177,7 +177,7 @@ static ptid_t go32_wait (ptid_t ptid, static void go32_fetch_registers (struct regcache *, int regno); static void store_register (const struct regcache *, int regno); static void go32_store_registers (struct regcache *, int regno); -static void go32_prepare_to_store (void); +static void go32_prepare_to_store (struct regcache *); static int go32_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write, struct mem_attrib *attrib, @@ -519,7 +519,7 @@ go32_store_registers (struct regcache *regcache, int regno) } static void -go32_prepare_to_store (void) +go32_prepare_to_store (struct regcache *regcache) { } diff --git a/gdb/hpux-thread.c b/gdb/hpux-thread.c index f65208cce97..71fe9f98e0e 100644 --- a/gdb/hpux-thread.c +++ b/gdb/hpux-thread.c @@ -390,9 +390,9 @@ hpux_thread_store_registers (struct regcache *regcache, int regno) debugged. */ static void -hpux_thread_prepare_to_store (void) +hpux_thread_prepare_to_store (struct regcache *regcache) { - deprecated_child_ops.to_prepare_to_store (); + deprecated_child_ops.to_prepare_to_store (regcache); } static int diff --git a/gdb/inf-child.c b/gdb/inf-child.c index 00bb7fd640e..a30d519558a 100644 --- a/gdb/inf-child.c +++ b/gdb/inf-child.c @@ -66,7 +66,7 @@ inf_child_post_attach (int pid) program being debugged. */ static void -inf_child_prepare_to_store (void) +inf_child_prepare_to_store (struct regcache *regcache) { } diff --git a/gdb/inftarg.c b/gdb/inftarg.c index 3f0467fbde1..6b9d3d78078 100644 --- a/gdb/inftarg.c +++ b/gdb/inftarg.c @@ -46,7 +46,7 @@ extern struct exception_event_record extern void _initialize_inftarg (void); -static void child_prepare_to_store (void); +static void child_prepare_to_store (struct regcache *); #ifndef CHILD_WAIT static ptid_t child_wait (ptid_t, struct target_waitstatus *); @@ -259,11 +259,8 @@ child_detach (char *args, int from_tty) debugged. */ static void -child_prepare_to_store (void) +child_prepare_to_store (struct regcache *regcache) { -#ifdef CHILD_PREPARE_TO_STORE - CHILD_PREPARE_TO_STORE (); -#endif } /* Print status information about what we're accessing. */ diff --git a/gdb/monitor.c b/gdb/monitor.c index 00695b8e1cb..494df39d0fd 100644 --- a/gdb/monitor.c +++ b/gdb/monitor.c @@ -1367,7 +1367,7 @@ monitor_store_registers (struct regcache *regcache, int regno) debugged. */ static void -monitor_prepare_to_store (void) +monitor_prepare_to_store (struct regcache *regcache) { /* Do nothing, since we can store individual regs */ } diff --git a/gdb/nto-procfs.c b/gdb/nto-procfs.c index 34ae3cd9618..57bfd87597a 100644 --- a/gdb/nto-procfs.c +++ b/gdb/nto-procfs.c @@ -1109,7 +1109,7 @@ procfs_kill_inferior (void) /* Store register REGNO, or all registers if REGNO == -1, from the contents of REGISTERS. */ static void -procfs_prepare_to_store (void) +procfs_prepare_to_store (struct regcache *regcache) { } diff --git a/gdb/procfs.c b/gdb/procfs.c index 788a661c6cd..606466ec4ef 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -123,7 +123,7 @@ static void procfs_files_info (struct target_ops *); static void procfs_fetch_registers (struct regcache *, int); static void procfs_store_registers (struct regcache *, int); static void procfs_notice_signals (ptid_t); -static void procfs_prepare_to_store (void); +static void procfs_prepare_to_store (struct regcache *); static void procfs_kill_inferior (void); static void procfs_mourn_inferior (void); static void procfs_create_inferior (char *, char *, char **, int); @@ -3732,11 +3732,8 @@ procfs_fetch_registers (struct regcache *regcache, int regnum) from the program being debugged. */ static void -procfs_prepare_to_store (void) +procfs_prepare_to_store (struct regcache *regcache) { -#ifdef CHILD_PREPARE_TO_STORE - CHILD_PREPARE_TO_STORE (); -#endif } /* Store register REGNUM back into the inferior. If REGNUM is -1, do diff --git a/gdb/regcache.c b/gdb/regcache.c index 15e4dba0441..c54585c98cd 100644 --- a/gdb/regcache.c +++ b/gdb/regcache.c @@ -669,7 +669,7 @@ regcache_raw_write (struct regcache *regcache, int regnum, regcache->descr->sizeof_register[regnum]) == 0)) return; - target_prepare_to_store (); + target_prepare_to_store (regcache); memcpy (register_buffer (regcache, regnum), buf, regcache->descr->sizeof_register[regnum]); regcache->register_valid_p[regnum] = 1; diff --git a/gdb/remote-m32r-sdi.c b/gdb/remote-m32r-sdi.c index 110855a21ef..a4452de547d 100644 --- a/gdb/remote-m32r-sdi.c +++ b/gdb/remote-m32r-sdi.c @@ -1014,7 +1014,7 @@ m32r_store_register (struct regcache *regcache, int regno) debugged. */ static void -m32r_prepare_to_store (void) +m32r_prepare_to_store (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 dcbc15c5471..5c2954db247 100644 --- a/gdb/remote-mips.c +++ b/gdb/remote-mips.c @@ -98,7 +98,7 @@ static int mips_map_regno (int regno); static void mips_fetch_registers (struct regcache *regcache, int regno); -static void mips_prepare_to_store (void); +static void mips_prepare_to_store (struct regcache *regcache); static void mips_store_registers (struct regcache *regcache, int regno); @@ -1946,7 +1946,7 @@ mips_fetch_registers (struct regcache *regcache, int regno) registers, so this function doesn't have to do anything. */ static void -mips_prepare_to_store (void) +mips_prepare_to_store (struct regcache *regcache) { } diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c index 425d1a69253..0a13713c14c 100644 --- a/gdb/remote-sim.c +++ b/gdb/remote-sim.c @@ -91,7 +91,7 @@ static void gdbsim_resume (ptid_t ptid, int step, enum target_signal siggnal); static ptid_t gdbsim_wait (ptid_t ptid, struct target_waitstatus *status); -static void gdbsim_prepare_to_store (void); +static void gdbsim_prepare_to_store (struct regcache *regcache); static void gdbsim_files_info (struct target_ops *target); @@ -734,7 +734,7 @@ gdbsim_wait (ptid_t ptid, struct target_waitstatus *status) debugged. */ static void -gdbsim_prepare_to_store (void) +gdbsim_prepare_to_store (struct regcache *regcache) { /* Do nothing, since we can store individual regs */ } diff --git a/gdb/remote.c b/gdb/remote.c index 2c31c82e008..8e7999d6583 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -89,7 +89,7 @@ static void build_remote_gdbarch_data (void); static void remote_files_info (struct target_ops *ignore); -static void remote_prepare_to_store (void); +static void remote_prepare_to_store (struct regcache *regcache); static void remote_fetch_registers (struct regcache *regcache, int regno); @@ -3730,7 +3730,7 @@ remote_fetch_registers (struct regcache *regcache, int regnum) first. */ static void -remote_prepare_to_store (void) +remote_prepare_to_store (struct regcache *regcache) { struct remote_arch_state *rsa = get_remote_arch_state (); int i; @@ -3744,7 +3744,7 @@ remote_prepare_to_store (void) /* Make sure all the necessary registers are cached. */ for (i = 0; i < NUM_REGS; i++) if (rsa->regs[i].in_g_packet) - regcache_raw_read (current_regcache, rsa->regs[i].regnum, buf); + regcache_raw_read (regcache, rsa->regs[i].regnum, buf); break; case PACKET_ENABLE: break; diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c index 722e253b84d..16e3463c8ad 100644 --- a/gdb/sol-thread.c +++ b/gdb/sol-thread.c @@ -649,9 +649,9 @@ sol_thread_store_registers (struct regcache *regcache, int regnum) program being debugged. */ static void -sol_thread_prepare_to_store (void) +sol_thread_prepare_to_store (struct regcache *regcache) { - procfs_ops.to_prepare_to_store (); + procfs_ops.to_prepare_to_store (regcache); } /* Transfer LEN bytes between GDB address MYADDR and target address diff --git a/gdb/target.c b/gdb/target.c index fd833decb91..bbd97fa1806 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -110,7 +110,7 @@ static void debug_to_fetch_registers (struct regcache *, int); static void debug_to_store_registers (struct regcache *, int); -static void debug_to_prepare_to_store (void); +static void debug_to_prepare_to_store (struct regcache *); static void debug_to_files_info (struct target_ops *); @@ -509,7 +509,7 @@ update_current_target (void) (void (*) (struct regcache *, int)) noprocess); de_fault (to_prepare_to_store, - (void (*) (void)) + (void (*) (struct regcache *)) noprocess); de_fault (deprecated_xfer_memory, (int (*) (CORE_ADDR, gdb_byte *, int, int, struct mem_attrib *, struct target_ops *)) @@ -2195,9 +2195,9 @@ debug_to_store_registers (struct regcache *regcache, int regno) } static void -debug_to_prepare_to_store (void) +debug_to_prepare_to_store (struct regcache *regcache) { - debug_target.to_prepare_to_store (); + debug_target.to_prepare_to_store (regcache); fprintf_unfiltered (gdb_stdlog, "target_prepare_to_store ()\n"); } diff --git a/gdb/target.h b/gdb/target.h index ad4e437b49d..33820443716 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -326,7 +326,7 @@ struct target_ops ptid_t (*to_wait) (ptid_t, struct target_waitstatus *); void (*to_fetch_registers) (struct regcache *, int); void (*to_store_registers) (struct regcache *, int); - void (*to_prepare_to_store) (void); + void (*to_prepare_to_store) (struct regcache *); /* Transfer LEN bytes of memory between GDB address MYADDR and target address MEMADDR. If WRITE, transfer them to the target, else @@ -606,8 +606,8 @@ extern void target_disconnect (char *, int); that REGISTERS contains all the registers from the program being debugged. */ -#define target_prepare_to_store() \ - (*current_target.to_prepare_to_store) () +#define target_prepare_to_store(regcache) \ + (*current_target.to_prepare_to_store) (regcache) extern DCACHE *target_dcache; diff --git a/gdb/win32-nat.c b/gdb/win32-nat.c index 922cc286195..b52edd0bdf8 100644 --- a/gdb/win32-nat.c +++ b/gdb/win32-nat.c @@ -2039,7 +2039,7 @@ win32_kill_inferior (void) } static void -win32_prepare_to_store (void) +win32_prepare_to_store (struct regcache *regcache) { /* Do nothing, since we can store individual regs */ } |