aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2005-07-13 14:48:58 +0000
committerDaniel Jacobowitz <drow@false.org>2005-07-13 14:48:58 +0000
commit5a1f5858d43f5e99d8faa000263051a89ede63d4 (patch)
treeb8a13e08a7b1fe2a2b086c3a0ec710e223e9bc94 /gdb
parente27b69eef792a7c63c802498fbaf18469dd8babc (diff)
downloadfsf-binutils-gdb-5a1f5858d43f5e99d8faa000263051a89ede63d4.zip
fsf-binutils-gdb-5a1f5858d43f5e99d8faa000263051a89ede63d4.tar.gz
fsf-binutils-gdb-5a1f5858d43f5e99d8faa000263051a89ede63d4.tar.bz2
* 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.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/gdbserver/ChangeLog7
-rw-r--r--gdb/gdbserver/linux-low.c14
-rw-r--r--gdb/gdbserver/linux-low.h3
-rw-r--r--gdb/gdbserver/linux-ppc64-low.c5
4 files changed, 27 insertions, 2 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 71a799d..19d5e52 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -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.
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index fbc3033..904ff6b 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -1126,7 +1126,12 @@ fetch_register (int regno)
goto error_exit;
}
}
- supply_register (regno, buf);
+ 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,7 +1173,12 @@ usr_store_inferior_registers (int regno)
& - sizeof (PTRACE_XFER_TYPE);
buf = alloca (size);
memset (buf, 0, size);
- collect_register (regno, buf);
+ 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))
{
errno = 0;
diff --git a/gdb/gdbserver/linux-low.h b/gdb/gdbserver/linux-low.h
index 22ed57d..79b1bb7 100644
--- a/gdb/gdbserver/linux-low.h
+++ b/gdb/gdbserver/linux-low.h
@@ -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;
diff --git a/gdb/gdbserver/linux-ppc64-low.c b/gdb/gdbserver/linux-ppc64-low.c
index 6a8c17d..00374e7 100644
--- a/gdb/gdbserver/linux-ppc64-low.c
+++ b/gdb/gdbserver/linux-ppc64-low.c
@@ -109,4 +109,9 @@ struct linux_target_ops the_low_target = {
NULL,
0,
ppc_breakpoint_at,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ 1
};