* 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.
This commit is contained in:
Ulrich Weigand
2007-05-06 18:55:41 +00:00
parent 56be38147c
commit 316f20603a
19 changed files with 64 additions and 41 deletions

View File

@ -1,3 +1,35 @@
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> 2007-05-06 Ulrich Weigand <uweigand@de.ibm.com>
* target.h (struct regcache): Add forward declaration. * target.h (struct regcache): Add forward declaration.

View File

@ -2207,11 +2207,8 @@ gnu_terminal_init_inferior (void)
that registers contains all the registers from the program being that registers contains all the registers from the program being
debugged. */ debugged. */
static void 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 static void

View File

@ -177,7 +177,7 @@ static ptid_t go32_wait (ptid_t ptid,
static void go32_fetch_registers (struct regcache *, int regno); static void go32_fetch_registers (struct regcache *, int regno);
static void store_register (const 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_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, static int go32_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len,
int write, int write,
struct mem_attrib *attrib, struct mem_attrib *attrib,
@ -519,7 +519,7 @@ go32_store_registers (struct regcache *regcache, int regno)
} }
static void static void
go32_prepare_to_store (void) go32_prepare_to_store (struct regcache *regcache)
{ {
} }

View File

@ -390,9 +390,9 @@ hpux_thread_store_registers (struct regcache *regcache, int regno)
debugged. */ debugged. */
static void 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 static int

View File

@ -66,7 +66,7 @@ inf_child_post_attach (int pid)
program being debugged. */ program being debugged. */
static void static void
inf_child_prepare_to_store (void) inf_child_prepare_to_store (struct regcache *regcache)
{ {
} }

View File

@ -46,7 +46,7 @@ extern struct exception_event_record
extern void _initialize_inftarg (void); extern void _initialize_inftarg (void);
static void child_prepare_to_store (void); static void child_prepare_to_store (struct regcache *);
#ifndef CHILD_WAIT #ifndef CHILD_WAIT
static ptid_t child_wait (ptid_t, struct target_waitstatus *); static ptid_t child_wait (ptid_t, struct target_waitstatus *);
@ -259,11 +259,8 @@ child_detach (char *args, int from_tty)
debugged. */ debugged. */
static void 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. */ /* Print status information about what we're accessing. */

View File

@ -1367,7 +1367,7 @@ monitor_store_registers (struct regcache *regcache, int regno)
debugged. */ debugged. */
static void static void
monitor_prepare_to_store (void) monitor_prepare_to_store (struct regcache *regcache)
{ {
/* Do nothing, since we can store individual regs */ /* Do nothing, since we can store individual regs */
} }

View File

@ -1109,7 +1109,7 @@ procfs_kill_inferior (void)
/* Store register REGNO, or all registers if REGNO == -1, from the contents /* Store register REGNO, or all registers if REGNO == -1, from the contents
of REGISTERS. */ of REGISTERS. */
static void static void
procfs_prepare_to_store (void) procfs_prepare_to_store (struct regcache *regcache)
{ {
} }

View File

@ -123,7 +123,7 @@ static void procfs_files_info (struct target_ops *);
static void procfs_fetch_registers (struct regcache *, int); static void procfs_fetch_registers (struct regcache *, int);
static void procfs_store_registers (struct regcache *, int); static void procfs_store_registers (struct regcache *, int);
static void procfs_notice_signals (ptid_t); 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_kill_inferior (void);
static void procfs_mourn_inferior (void); static void procfs_mourn_inferior (void);
static void procfs_create_inferior (char *, char *, char **, int); 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. */ from the program being debugged. */
static void 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 /* Store register REGNUM back into the inferior. If REGNUM is -1, do

View File

@ -669,7 +669,7 @@ regcache_raw_write (struct regcache *regcache, int regnum,
regcache->descr->sizeof_register[regnum]) == 0)) regcache->descr->sizeof_register[regnum]) == 0))
return; return;
target_prepare_to_store (); target_prepare_to_store (regcache);
memcpy (register_buffer (regcache, regnum), buf, memcpy (register_buffer (regcache, regnum), buf,
regcache->descr->sizeof_register[regnum]); regcache->descr->sizeof_register[regnum]);
regcache->register_valid_p[regnum] = 1; regcache->register_valid_p[regnum] = 1;

View File

@ -1014,7 +1014,7 @@ m32r_store_register (struct regcache *regcache, int regno)
debugged. */ debugged. */
static void static void
m32r_prepare_to_store (void) m32r_prepare_to_store (struct regcache *regcache)
{ {
/* Do nothing, since we can store individual regs */ /* Do nothing, since we can store individual regs */
if (remote_debug) if (remote_debug)

View File

@ -98,7 +98,7 @@ static int mips_map_regno (int regno);
static void mips_fetch_registers (struct regcache *regcache, 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); 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. */ registers, so this function doesn't have to do anything. */
static void static void
mips_prepare_to_store (void) mips_prepare_to_store (struct regcache *regcache)
{ {
} }

View File

@ -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 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); static void gdbsim_files_info (struct target_ops *target);
@ -734,7 +734,7 @@ gdbsim_wait (ptid_t ptid, struct target_waitstatus *status)
debugged. */ debugged. */
static void static void
gdbsim_prepare_to_store (void) gdbsim_prepare_to_store (struct regcache *regcache)
{ {
/* Do nothing, since we can store individual regs */ /* Do nothing, since we can store individual regs */
} }

View File

@ -89,7 +89,7 @@ static void build_remote_gdbarch_data (void);
static void remote_files_info (struct target_ops *ignore); 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); static void remote_fetch_registers (struct regcache *regcache, int regno);
@ -3730,7 +3730,7 @@ remote_fetch_registers (struct regcache *regcache, int regnum)
first. */ first. */
static void static void
remote_prepare_to_store (void) remote_prepare_to_store (struct regcache *regcache)
{ {
struct remote_arch_state *rsa = get_remote_arch_state (); struct remote_arch_state *rsa = get_remote_arch_state ();
int i; int i;
@ -3744,7 +3744,7 @@ remote_prepare_to_store (void)
/* Make sure all the necessary registers are cached. */ /* Make sure all the necessary registers are cached. */
for (i = 0; i < NUM_REGS; i++) for (i = 0; i < NUM_REGS; i++)
if (rsa->regs[i].in_g_packet) 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; break;
case PACKET_ENABLE: case PACKET_ENABLE:
break; break;

View File

@ -649,9 +649,9 @@ sol_thread_store_registers (struct regcache *regcache, int regnum)
program being debugged. */ program being debugged. */
static void 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 /* Transfer LEN bytes between GDB address MYADDR and target address

View File

@ -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_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 *); static void debug_to_files_info (struct target_ops *);
@ -509,7 +509,7 @@ update_current_target (void)
(void (*) (struct regcache *, int)) (void (*) (struct regcache *, int))
noprocess); noprocess);
de_fault (to_prepare_to_store, de_fault (to_prepare_to_store,
(void (*) (void)) (void (*) (struct regcache *))
noprocess); noprocess);
de_fault (deprecated_xfer_memory, de_fault (deprecated_xfer_memory,
(int (*) (CORE_ADDR, gdb_byte *, int, int, struct mem_attrib *, struct target_ops *)) (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 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"); fprintf_unfiltered (gdb_stdlog, "target_prepare_to_store ()\n");
} }

View File

@ -326,7 +326,7 @@ struct target_ops
ptid_t (*to_wait) (ptid_t, struct target_waitstatus *); ptid_t (*to_wait) (ptid_t, struct target_waitstatus *);
void (*to_fetch_registers) (struct regcache *, int); void (*to_fetch_registers) (struct regcache *, int);
void (*to_store_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 /* Transfer LEN bytes of memory between GDB address MYADDR and
target address MEMADDR. If WRITE, transfer them to the target, else 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 that REGISTERS contains all the registers from the program being
debugged. */ debugged. */
#define target_prepare_to_store() \ #define target_prepare_to_store(regcache) \
(*current_target.to_prepare_to_store) () (*current_target.to_prepare_to_store) (regcache)
extern DCACHE *target_dcache; extern DCACHE *target_dcache;

View File

@ -2039,7 +2039,7 @@ win32_kill_inferior (void)
} }
static void static void
win32_prepare_to_store (void) win32_prepare_to_store (struct regcache *regcache)
{ {
/* Do nothing, since we can store individual regs */ /* Do nothing, since we can store individual regs */
} }

View File

@ -2039,7 +2039,7 @@ win32_kill_inferior (void)
} }
static void static void
win32_prepare_to_store (void) win32_prepare_to_store (struct regcache *regcache)
{ {
/* Do nothing, since we can store individual regs */ /* Do nothing, since we can store individual regs */
} }