This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 19/22] [GDBserver] Multi-process + multi-arch: SPU
- From: Pedro Alves <palves at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Thu, 30 May 2013 13:15:52 +0100
- Subject: [PATCH 19/22] [GDBserver] Multi-process + multi-arch: SPU
- References: <20130530121335 dot 15047 dot 12654 dot stgit at brno dot lan>
This adjusts the SPU port to new interfaces.
Built (--host=spu) on PowerPC Fedora 16. Otherwise not tested.
2013-05-30 Pedro Alves <palves@redhat.com>
* spu-low.c (tdesc_spu): Declare.
(spu_create_inferior, spu_attach): Set the new process'es tdesc.
---
gdb/gdbserver/spu-low.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/gdb/gdbserver/spu-low.c b/gdb/gdbserver/spu-low.c
index deaa115..6e3974a 100644
--- a/gdb/gdbserver/spu-low.c
+++ b/gdb/gdbserver/spu-low.c
@@ -56,7 +56,7 @@ int using_threads = 0;
/* Defined in auto-generated file reg-spu.c. */
void init_registers_spu (void);
-
+extern const struct target_desc *tdesc_spu;
/* Fetch PPU register REGNO. */
static CORE_ADDR
@@ -266,6 +266,7 @@ spu_create_inferior (char *program, char **allargs)
{
int pid;
ptid_t ptid;
+ struct process_info *proc;
pid = fork ();
if (pid < 0)
@@ -287,7 +288,8 @@ spu_create_inferior (char *program, char **allargs)
_exit (0177);
}
- add_process (pid, 0);
+ proc = add_process (pid, 0);
+ proc->tdesc = tdesc_spu;
ptid = ptid_build (pid, pid, 0);
add_thread (ptid, NULL);
@@ -299,6 +301,7 @@ int
spu_attach (unsigned long pid)
{
ptid_t ptid;
+ struct process_info *proc;
if (ptrace (PTRACE_ATTACH, pid, 0, 0) != 0)
{
@@ -308,7 +311,8 @@ spu_attach (unsigned long pid)
_exit (0177);
}
- add_process (pid, 1);
+ proc = add_process (pid, 1);
+ proc->tdesc = tdesc_spu;
ptid = ptid_build (pid, pid, 0);
add_thread (ptid, NULL);
return 0;