This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 18/20] Multi-process + multiarch: GDBserver: Lynx ports
- From: Pedro Alves <palves at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Wed, 11 Apr 2012 00:49:40 +0100
- Subject: [PATCH 18/20] Multi-process + multiarch: GDBserver: Lynx ports
- References: <20120410234741.526.59368.stgit@brno.lan>
This adjusts the Lynx ports to new interfaces.
Completely untested.
2012-04-10 Pedro Alves <palves@redhat.com>
* lynx-i386-low.c (tdesc_i386): Declare.
(lynx_i386_arch_setup): Set `lynx_tdesc'.
* lynx-low.c (lynx_tdesc): New global.
(lynx_create_inferior, lynx_attach): Set the new process'es tdesc.
* lynx-low.h (struct target_desc): Forward declare.
(lynx_tdesc): Declare.
* lynx-ppc-low.c (tdesc_powerpc_32): Declare.
(lynx_ppc_arch_setup): Set `lynx_tdesc'.
---
gdb/gdbserver/lynx-i386-low.c | 2 ++
gdb/gdbserver/lynx-low.c | 4 ++++
gdb/gdbserver/lynx-low.h | 4 ++++
gdb/gdbserver/lynx-ppc-low.c | 2 ++
4 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/gdb/gdbserver/lynx-i386-low.c b/gdb/gdbserver/lynx-i386-low.c
index b619693..b217d39 100644
--- a/gdb/gdbserver/lynx-i386-low.c
+++ b/gdb/gdbserver/lynx-i386-low.c
@@ -122,6 +122,7 @@ enum lynx_i386_gdb_regnum
/* Defined in auto-generated file i386.c. */
extern void init_registers_i386 (void);
+extern struct target_desc *tdesc_i386;
/* The fill_function for the general-purpose register set. */
@@ -297,6 +298,7 @@ static void
lynx_i386_arch_setup (void)
{
init_registers_i386 ();
+ lynx_tdesc = tdesc_i386;
}
/* Description of all the x86-lynx register sets. */
diff --git a/gdb/gdbserver/lynx-low.c b/gdb/gdbserver/lynx-low.c
index aaed07d..9fbb1c9 100644
--- a/gdb/gdbserver/lynx-low.c
+++ b/gdb/gdbserver/lynx-low.c
@@ -30,6 +30,8 @@
int using_threads = 1;
+struct target_desc *lynx_tdesc;
+
/* Print a debug trace on standard output if debug_threads is set. */
static void
@@ -317,6 +319,7 @@ lynx_create_inferior (char *program, char **allargs)
}
new_process = add_process (pid, 0);
+ new_process->tdesc = lynx_tdesc;
/* Do not add the process thread just yet, as we do not know its tid.
We will add it later, during the wait for the STOP event corresponding
to the lynx_ptrace (PTRACE_TRACEME) call above. */
@@ -336,6 +339,7 @@ lynx_attach (unsigned long pid)
strerror (errno), errno);
new_process = add_process (pid, 1);
+ new_process->tdesc = lynx_tdesc;
add_thread (ptid, NULL);
return 0;
diff --git a/gdb/gdbserver/lynx-low.h b/gdb/gdbserver/lynx-low.h
index 136ec2a..60ab178 100644
--- a/gdb/gdbserver/lynx-low.h
+++ b/gdb/gdbserver/lynx-low.h
@@ -18,6 +18,7 @@
#include "server.h"
struct regcache;
+struct target_desc;
/* Some information relative to a given register set. */
@@ -50,3 +51,6 @@ struct lynx_target_ops
extern struct lynx_target_ops the_low_target;
+/* The inferior's target description. A global, since the Lynx ports
+ don't support multi-arch/multi-process. */
+extern struct target_desc *lynx_tdesc;
diff --git a/gdb/gdbserver/lynx-ppc-low.c b/gdb/gdbserver/lynx-ppc-low.c
index 95332eb..ed0a9b2 100644
--- a/gdb/gdbserver/lynx-ppc-low.c
+++ b/gdb/gdbserver/lynx-ppc-low.c
@@ -69,6 +69,7 @@ typedef struct usr_fcontext_s
/* Defined in auto-generated file powerpc-32.c. */
extern void init_registers_powerpc_32 (void);
+extern struct target_desc *tdesc_powerpc_32;
/* The fill_function for the general-purpose register set. */
@@ -164,6 +165,7 @@ static void
lynx_ppc_arch_setup (void)
{
init_registers_powerpc_32 ();
+ lynx_tdesc = tdesc_powerpc_32;
}
/* Description of all the powerpc-lynx register sets. */