aboutsummaryrefslogtreecommitdiff
path: root/gdb/amd64-linux-nat.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2011-12-20 10:40:15 +0000
committerPedro Alves <palves@redhat.com>2011-12-20 10:40:15 +0000
commit6e012a6c38c5bb8f44669653d86fa8382ffd0922 (patch)
tree9ebec7606f2b36764bd1b0b686c7451c47733cc2 /gdb/amd64-linux-nat.c
parent87c31f06224db060e86fab624a9cc3580c01621d (diff)
downloadgdb-6e012a6c38c5bb8f44669653d86fa8382ffd0922.zip
gdb-6e012a6c38c5bb8f44669653d86fa8382ffd0922.tar.gz
gdb-6e012a6c38c5bb8f44669653d86fa8382ffd0922.tar.bz2
2011-12-20 Pedro Alves <alves.ped@gmail.com>
Jan Kratochvil <jan.kratochvil@redhat.com> * linux-nat.c (add_lwp): Don't call linux_nat_new_thread on the first LWP. * amd64-linux-nat.c (update_debug_registers_callback): Instantiate `lwp->arch_private' if NULL. (amd64_linux_prepare_to_resume): Do nothing if `lwp->arch_private' is NULL. * i386-linux-nat.c (update_debug_registers_callback): Instantiate `lwp->arch_private' if NULL. (i386_linux_prepare_to_resume): Do nothing if `lwp->arch_private' is NULL.
Diffstat (limited to 'gdb/amd64-linux-nat.c')
-rw-r--r--gdb/amd64-linux-nat.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/amd64-linux-nat.c b/gdb/amd64-linux-nat.c
index 288160b..865b971 100644
--- a/gdb/amd64-linux-nat.c
+++ b/gdb/amd64-linux-nat.c
@@ -343,6 +343,9 @@ amd64_linux_dr_get_status (void)
static int
update_debug_registers_callback (struct lwp_info *lwp, void *arg)
{
+ if (lwp->arch_private == NULL)
+ lwp->arch_private = XCNEW (struct arch_lwp_info);
+
/* The actual update is done later just before resuming the lwp, we
just mark that the registers need updating. */
lwp->arch_private->debug_registers_changed = 1;
@@ -386,6 +389,12 @@ amd64_linux_prepare_to_resume (struct lwp_info *lwp)
{
int clear_status = 0;
+ /* NULL means this is the main thread still going through the shell,
+ or, no watchpoint has been set yet. In that case, there's
+ nothing to do. */
+ if (lwp->arch_private == NULL)
+ return;
+
if (lwp->arch_private->debug_registers_changed)
{
struct i386_debug_reg_state *state = i386_debug_reg_state ();