This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 19/20] Multi-process + multiarch: GDBserver: QNX NTO port
- From: Pedro Alves <palves at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Wed, 11 Apr 2012 00:49:47 +0100
- Subject: [PATCH 19/20] Multi-process + multiarch: GDBserver: QNX NTO port
- References: <20120410234741.526.59368.stgit@brno.lan>
This adjusts the QNX NTO port to new interfaces.
Completely untested.
2012-04-10 Pedro Alves <palves@redhat.com>
* nto-low.c (nto_tdesc): New global.
(do_attach): Set the new process'es tdesc.
* nto-low.h (struct target_desc): Forward declare.
(nto_tdesc): Declare.
* nto-x86-low.c (tdesc_i386): Declare.
(nto_x86_arch_setup): Set `nto_tdesc'.
---
gdb/gdbserver/nto-low.c | 6 +++++-
gdb/gdbserver/nto-low.h | 6 ++++++
gdb/gdbserver/nto-x86-low.c | 2 ++
3 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/gdb/gdbserver/nto-low.c b/gdb/gdbserver/nto-low.c
index eabee10..2f131b4 100644
--- a/gdb/gdbserver/nto-low.c
+++ b/gdb/gdbserver/nto-low.c
@@ -34,6 +34,8 @@
extern int using_threads;
int using_threads = 1;
+struct target_desc *nto_tdesc;
+
static void
nto_trace (const char *fmt, ...)
{
@@ -202,11 +204,13 @@ do_attach (pid_t pid)
&& (status.flags & _DEBUG_FLAG_STOPPED))
{
ptid_t ptid;
+ struct process_info *proc;
kill (pid, SIGCONT);
ptid = ptid_build (status.pid, status.tid, 0);
the_low_target.arch_setup ();
- add_process (status.pid, 1);
+ proc = add_process (status.pid, 1);
+ proc->tdesc = nto_tdesc;
TRACE ("Adding thread: pid=%d tid=%ld\n", status.pid,
ptid_get_lwp (ptid));
nto_find_new_threads (&nto_inferior);
diff --git a/gdb/gdbserver/nto-low.h b/gdb/gdbserver/nto-low.h
index cb2fb25..7536334 100644
--- a/gdb/gdbserver/nto-low.h
+++ b/gdb/gdbserver/nto-low.h
@@ -19,6 +19,8 @@
#ifndef NTO_LOW_H
#define NTO_LOW_H
+struct target_desc;
+
enum regset_type
{
NTO_REG_GENERAL,
@@ -40,5 +42,9 @@ struct nto_target_ops
extern struct nto_target_ops the_low_target;
+/* The inferior's target description. A global, since the NTO ports
+ don't support multi-arch/multi-process. */
+extern struct target_desc *nto_tdesc;
+
#endif
diff --git a/gdb/gdbserver/nto-x86-low.c b/gdb/gdbserver/nto-x86-low.c
index 3ad857a..e336f36 100644
--- a/gdb/gdbserver/nto-x86-low.c
+++ b/gdb/gdbserver/nto-x86-low.c
@@ -28,6 +28,7 @@
/* Definition auto generated from reg-i386.dep. */
extern void init_registers_i386 ();
extern struct reg *regs_i386;
+extern struct target_desc *tdesc_i386;
const unsigned char x86_breakpoint[] = { 0xCC };
#define x86_breakpoint_len 1
@@ -91,6 +92,7 @@ nto_x86_arch_setup (void)
{
init_registers_i386 ();
the_low_target.num_regs = 16;
+ nto_tdesc = tdesc_i386;
}
struct nto_target_ops the_low_target =