* linux-low.c (fetch_register, usr_store_inferior_registers): Handle

left-padded registers.
	* linux-low.h (struct linux_target_ops): Add left_pad_xfer.
	* linux-ppc64-low.c (the_low_target): Set left_pad_xfer.
This commit is contained in:
Daniel Jacobowitz 2005-07-13 14:48:58 +00:00
parent e27b69eef7
commit 5a1f5858d4
4 changed files with 27 additions and 2 deletions

View file

@ -1,3 +1,10 @@
2005-07-13 Daniel Jacobowitz <dan@codesourcery.com>
* linux-low.c (fetch_register, usr_store_inferior_registers): Handle
left-padded registers.
* linux-low.h (struct linux_target_ops): Add left_pad_xfer.
* linux-ppc64-low.c (the_low_target): Set left_pad_xfer.
2005-07-01 Steve Ellcey <sje@cup.hp.com>
* configure.ac (BFD_NEED_DECLARATION): Replace with AC_CHECK_DECLS.

View file

@ -1126,6 +1126,11 @@ fetch_register (int regno)
goto error_exit;
}
}
if (the_low_target.left_pad_xfer
&& register_size (regno) < sizeof (PTRACE_XFER_TYPE))
supply_register (regno, (buf + sizeof (PTRACE_XFER_TYPE)
- register_size (regno)));
else
supply_register (regno, buf);
error_exit:;
@ -1168,6 +1173,11 @@ usr_store_inferior_registers (int regno)
& - sizeof (PTRACE_XFER_TYPE);
buf = alloca (size);
memset (buf, 0, size);
if (the_low_target.left_pad_xfer
&& register_size (regno) < sizeof (PTRACE_XFER_TYPE))
collect_register (regno, (buf + sizeof (PTRACE_XFER_TYPE)
- register_size (regno)));
else
collect_register (regno, buf);
for (i = 0; i < size; i += sizeof (PTRACE_XFER_TYPE))
{

View file

@ -64,6 +64,9 @@ struct linux_target_ops
int (*stopped_by_watchpoint) (void);
CORE_ADDR (*stopped_data_address) (void);
/* Whether to left-pad registers for PEEKUSR/POKEUSR if they are smaller
than an xfer unit. */
int left_pad_xfer;
};
extern struct linux_target_ops the_low_target;

View file

@ -109,4 +109,9 @@ struct linux_target_ops the_low_target = {
NULL,
0,
ppc_breakpoint_at,
NULL,
NULL,
NULL,
NULL,
1
};