diff options
Diffstat (limited to 'gdb/amd64-linux-nat.c')
-rw-r--r-- | gdb/amd64-linux-nat.c | 9 |
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 (); |