aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2007-10-15 19:49:53 +0000
committerDaniel Jacobowitz <drow@false.org>2007-10-15 19:49:53 +0000
commit310a98e10257728271c1d3b817f7bfeb5c3cb88f (patch)
tree6ef7e4213b3853bcf6d82f18a13ced926768ba64 /gdb
parent7cc46491b1832408d1d5472e3f0c17c8a1d78ccb (diff)
downloadgdb-310a98e10257728271c1d3b817f7bfeb5c3cb88f.zip
gdb-310a98e10257728271c1d3b817f7bfeb5c3cb88f.tar.gz
gdb-310a98e10257728271c1d3b817f7bfeb5c3cb88f.tar.bz2
* ppc-linux-nat.c (ppc_linux_read_description): New.
(_initialize_ppc_linux_nat): Set to_read_description. * ppc-tdep.h (tdesc_powerpc_e500): Declare.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/ppc-linux-nat.c29
-rw-r--r--gdb/ppc-tdep.h2
3 files changed, 37 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 38a3993..c8f1e9e 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2007-10-15 Daniel Jacobowitz <dan@codesourcery.com>
+ * ppc-linux-nat.c (ppc_linux_read_description): New.
+ (_initialize_ppc_linux_nat): Set to_read_description.
+ * ppc-tdep.h (tdesc_powerpc_e500): Declare.
+
+2007-10-15 Daniel Jacobowitz <dan@codesourcery.com>
+
* NEWS: Document target described register support for PowerPC.
* ppc-tdep.h: Remove ppc_spr constants.
(struct gdbarch_tdep): Remove regs, ppc_sr0_regnum, and
diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c
index d86c9f8..1e43640 100644
--- a/gdb/ppc-linux-nat.c
+++ b/gdb/ppc-linux-nat.c
@@ -940,6 +940,33 @@ fill_fpregset (const struct regcache *regcache,
fpregsetp, sizeof (*fpregsetp));
}
+static const struct target_desc *
+ppc_linux_read_description (struct target_ops *ops)
+{
+ if (have_ptrace_getsetevrregs)
+ {
+ struct gdb_evrregset_t evrregset;
+ int tid = TIDGET (inferior_ptid);
+
+ if (tid == 0)
+ tid = PIDGET (inferior_ptid);
+
+ if (ptrace (PTRACE_GETEVRREGS, tid, 0, &evrregset) >= 0)
+ return tdesc_powerpc_e500;
+ else
+ {
+ /* EIO means that the PTRACE_GETEVRREGS request isn't supported. */
+ if (errno == EIO)
+ return NULL;
+ else
+ /* Anything else needs to be reported. */
+ perror_with_name (_("Unable to fetch SPE registers"));
+ }
+ }
+
+ return NULL;
+}
+
void _initialize_ppc_linux_nat (void);
void
@@ -962,6 +989,8 @@ _initialize_ppc_linux_nat (void)
t->to_stopped_by_watchpoint = ppc_linux_stopped_by_watchpoint;
t->to_stopped_data_address = ppc_linux_stopped_data_address;
+ t->to_read_description = ppc_linux_read_description;
+
/* Register the target. */
linux_nat_add_target (t);
linux_nat_set_new_thread (t, ppc_linux_new_thread);
diff --git a/gdb/ppc-tdep.h b/gdb/ppc-tdep.h
index 76fcf9e..2b566df 100644
--- a/gdb/ppc-tdep.h
+++ b/gdb/ppc-tdep.h
@@ -227,4 +227,6 @@ enum {
/* Estimate for the maximum number of instrctions in a function epilogue. */
#define PPC_MAX_EPILOGUE_INSTRUCTIONS 52
+extern struct target_desc *tdesc_powerpc_e500;
+
#endif /* ppc-tdep.h */