diff options
author | Daniel Jacobowitz <dan@debian.org> | 2007-10-15 19:49:53 +0000 |
---|---|---|
committer | Daniel Jacobowitz <dan@debian.org> | 2007-10-15 19:49:53 +0000 |
commit | cacc86640743ef7fd309b48a3e860419440a0ae6 (patch) | |
tree | 2c7f8ab1f01a1c9b6a5549a89d4335818c5a23af /gdb/ppc-linux-nat.c | |
parent | f0b15d92f8c3b56749b1365fc05b6151bcb17aee (diff) | |
download | gdb-cacc86640743ef7fd309b48a3e860419440a0ae6.tar.gz |
* 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/ppc-linux-nat.c')
-rw-r--r-- | gdb/ppc-linux-nat.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c index d86c9f85573..1e43640b516 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); |