diff options
author | Pedro Alves <pedro@codesourcery.com> | 2011-12-20 10:40:10 +0000 |
---|---|---|
committer | Pedro Alves <pedro@codesourcery.com> | 2011-12-20 10:40:10 +0000 |
commit | dc8a0875bb4a7079afa16d88d34e5b2a6bd3430c (patch) | |
tree | ef26fe32cc19058dd80976c7e1fd96df6e3be2ba /gdb/i386-linux-nat.c | |
parent | efb82700e6079a181006d710c56faab88d9ab7b1 (diff) | |
download | gdb-dc8a0875bb4a7079afa16d88d34e5b2a6bd3430c.tar.gz |
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/i386-linux-nat.c')
-rw-r--r-- | gdb/i386-linux-nat.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c index 190979b8a66..45279135a28 100644 --- a/gdb/i386-linux-nat.c +++ b/gdb/i386-linux-nat.c @@ -715,6 +715,9 @@ i386_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; @@ -758,6 +761,12 @@ i386_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 (); |