summaryrefslogtreecommitdiff
path: root/gdb/gdbserver/linux-low.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2008-02-27 03:31:05 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2008-02-27 03:31:05 +0000
commit5c856ad70c736af8ce32e59c9dcd91022bc79fe2 (patch)
tree1c69e9327612ea6b94e7644370839dd79c8bf0ef /gdb/gdbserver/linux-low.c
parentb17e6ec7f9ac5bf837bd0dc64f6cc2839a80f5be (diff)
downloadgdb-5c856ad70c736af8ce32e59c9dcd91022bc79fe2.tar.gz
* configure.srv [s390x-*-linux*]: Set srv_regobj to include both
reg-s390.o and reg-s390x.o. * linux-low.c (new_inferior): New global variable. (linux_create_inferior, linux_attach): Set it. (linux_wait_for_process): Call the_low_target.arch_setup after the target has stopped for the first time. (initialize_low): Do not call the_low_target.arch_setup. * linux-s390-low.c (s390_get_pc): Support bi-arch operation. (s390_set_pc): Likewise. (s390_arch_setup): New function. (the_low_target): Use s390_arch_setup as arch_setup routine. * regcache.c (realloc_register_cache): New function. (set_register_cache): Call it for each existing regcache.
Diffstat (limited to 'gdb/gdbserver/linux-low.c')
-rw-r--r--gdb/gdbserver/linux-low.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index d5a8fb41fe8..732aafbc80f 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -107,6 +107,11 @@ static int thread_db_active;
static int must_set_ptrace_flags;
+/* This flag is true iff we've just created or attached to a new inferior
+ but it has not stopped yet. As soon as it does, we need to call the
+ low target's arch_setup callback. */
+static int new_inferior;
+
static void linux_resume_one_process (struct inferior_list_entry *entry,
int step, int signal, siginfo_t *info);
static void linux_resume (struct thread_resume *resume_info);
@@ -291,6 +296,7 @@ linux_create_inferior (char *program, char **allargs)
new_process = add_process (pid);
add_thread (pid, new_process, pid);
must_set_ptrace_flags = 1;
+ new_inferior = 1;
return pid;
}
@@ -350,6 +356,8 @@ linux_attach (unsigned long pid)
process = (struct process_info *) find_inferior_id (&all_processes, pid);
process->stop_expected = 0;
+ new_inferior = 1;
+
return 0;
}
@@ -616,6 +624,16 @@ retry:
(*childp)->last_status = *wstatp;
+ /* Architecture-specific setup after inferior is running.
+ This needs to happen after we have attached to the inferior
+ and it is stopped for the first time, but before we access
+ any inferior registers. */
+ if (new_inferior)
+ {
+ the_low_target.arch_setup ();
+ new_inferior = 0;
+ }
+
if (debug_threads
&& WIFSTOPPED (*wstatp))
{
@@ -2072,7 +2090,6 @@ initialize_low (void)
set_target_ops (&linux_target_ops);
set_breakpoint_data (the_low_target.breakpoint,
the_low_target.breakpoint_len);
- the_low_target.arch_setup ();
linux_init_signals ();
linux_test_for_tracefork ();
}