From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6075 invoked by alias); 2 Jan 2012 16:46:10 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 6030 invoked by uid 9674); 2 Jan 2012 16:46:03 -0000 Date: Mon, 02 Jan 2012 16:46:00 -0000 Message-ID: <20120102164603.6015.qmail@sourceware.org> From: jkratoch@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] archer-jankratochvil-watchpoint3: Merge branch 'f-cleanup-fork-multifix' into archer-jankratochvil-watchpoint3 X-Git-Refname: refs/heads/archer-jankratochvil-watchpoint3 X-Git-Reftype: branch X-Git-Oldrev: 26385102b3c639bff7435c6dd1191538511b5216 X-Git-Newrev: aa04840a371c3d9c7144bd651370c83319f728b3 X-SW-Source: 2012-q1/txt/msg00001.txt.bz2 List-Id: The branch, archer-jankratochvil-watchpoint3 has been updated via aa04840a371c3d9c7144bd651370c83319f728b3 (commit) via ad779fb7f4048f24e833f624d7589ed44619ae90 (commit) via 204b4630223c1c4b0b8969e613430e62ee84e536 (commit) via 5c4f24499078aa0c166de27f4f6956a0c89a9b6f (commit) via 9aa2a5a8cab49edc6432a0f956ca97d5dcf9ad4d (commit) via e9c5fe9151d5df98df3d3dba7a937861bdd728c8 (commit) from 26385102b3c639bff7435c6dd1191538511b5216 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit aa04840a371c3d9c7144bd651370c83319f728b3 Merge: 2638510 ad779fb Author: Jan Kratochvil Date: Mon Jan 2 17:45:45 2012 +0100 Merge branch 'f-cleanup-fork-multifix' into archer-jankratochvil-watchpoint3 commit ad779fb7f4048f24e833f624d7589ed44619ae90 Author: Jan Kratochvil Date: Mon Jan 2 17:27:22 2012 +0100 . commit 204b4630223c1c4b0b8969e613430e62ee84e536 Author: Jan Kratochvil Date: Mon Jan 2 17:25:37 2012 +0100 . commit 5c4f24499078aa0c166de27f4f6956a0c89a9b6f Merge: b7ef56f 9aa2a5a Author: Jan Kratochvil Date: Mon Jan 2 17:17:26 2012 +0100 Merge branch 'f-cleanup-fork' into f-cleanup-fork-multifix Conflicts: gdb/i386-nat.c commit 9aa2a5a8cab49edc6432a0f956ca97d5dcf9ad4d Author: Jan Kratochvil Date: Mon Jan 2 17:12:14 2012 +0100 . commit e9c5fe9151d5df98df3d3dba7a937861bdd728c8 Author: Jan Kratochvil Date: Mon Jan 2 17:03:00 2012 +0100 . ----------------------------------------------------------------------- Summary of changes: gdb/i386-linux-nat.c | 4 ++-- gdb/i386-nat.c | 18 ++++++++++++++++-- gdb/testsuite/gdb.multi/watchpoint-multi.c | 2 +- gdb/testsuite/gdb.multi/watchpoint-multi.exp | 8 +++++--- gdb/testsuite/gdb.threads/watchpoint-fork-child.c | 2 +- gdb/testsuite/gdb.threads/watchpoint-fork-mt.c | 2 +- gdb/testsuite/gdb.threads/watchpoint-fork-parent.c | 2 +- gdb/testsuite/gdb.threads/watchpoint-fork-st.c | 2 +- gdb/testsuite/gdb.threads/watchpoint-fork.exp | 4 ++-- gdb/testsuite/gdb.threads/watchpoint-fork.h | 2 +- 10 files changed, 31 insertions(+), 15 deletions(-) First 500 lines of diff: diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c index 241f8ac..9e60ff4 100644 --- a/gdb/i386-linux-nat.c +++ b/gdb/i386-linux-nat.c @@ -771,8 +771,8 @@ i386_linux_prepare_to_resume (struct lwp_info *lwp) struct i386_debug_reg_state *state = i386_debug_reg_state (); int i; - /* The amd64 counterpart and description - is amd64_linux_dr_set_control. */ + /* See amd64_linux_prepare_to_resume for Linux kernel note on + i386_linux_dr_set calls ordering. */ for (i = DR_FIRSTADDR; i <= DR_LASTADDR; i++) if (state->dr_ref_count[i] > 0) diff --git a/gdb/i386-nat.c b/gdb/i386-nat.c index 11d07bc..bb31d9e 100644 --- a/gdb/i386-nat.c +++ b/gdb/i386-nat.c @@ -174,12 +174,15 @@ i386_init_dregs (struct i386_debug_reg_state *state) /* Per-inferior data key. */ static const struct inferior_data *i386_inferior_data; +/* Per-inferior data. */ struct i386_inferior_data { /* Copy of i386 hardware debug registers for performance reasons. */ struct i386_debug_reg_state state; }; +/* Per-inferior hook for register_inferior_data_with_cleanup. */ + static void i386_inferior_data_cleanup (struct inferior *inf, void *arg) { @@ -188,6 +191,9 @@ i386_inferior_data_cleanup (struct inferior *inf, void *arg) xfree (inf_data); } +/* Get data specific for INFERIOR_PTID LWP. Return special data area + for processes being detached. */ + static struct i386_inferior_data * i386_inferior_data_get (void) { @@ -203,14 +209,18 @@ i386_inferior_data_get (void) if (inf->pid != ptid_get_pid (inferior_ptid)) { + /* INFERIOR_PTID is being detached from the inferior INF. + Provide local cache specific for the detached LWP. */ + static struct i386_inferior_data detached_inf_data_local; static int detached_inf_pid = -1; if (detached_inf_pid != ptid_get_pid (inferior_ptid)) { - detached_inf_pid = ptid_get_pid (inferior_ptid); + /* Reinitialize the local cache if INFERIOR_PTID is + different from the LWP last detached. - /* Linux kernel before 2.6.33 commit + Linux kernel before 2.6.33 commit 72f674d203cd230426437cdcf7dd6f681dad8b0d will inherit hardware debug registers from parent on fork/vfork/clone. Newer Linux kernels create such tasks with @@ -225,6 +235,7 @@ i386_inferior_data_get (void) registers mirror will become zeroed in the end before detaching the forked off process. */ + detached_inf_pid = ptid_get_pid (inferior_ptid); memcpy (&detached_inf_data_local, inf_data, sizeof (detached_inf_data_local)); } @@ -235,6 +246,9 @@ i386_inferior_data_get (void) return inf_data; } +/* Get debug registers state for INFERIOR_PTID, see + i386_inferior_data_get. */ + struct i386_debug_reg_state * i386_debug_reg_state (void) { diff --git a/gdb/testsuite/gdb.multi/watchpoint-multi.c b/gdb/testsuite/gdb.multi/watchpoint-multi.c index 4ae8e3f..51697b0 100644 --- a/gdb/testsuite/gdb.multi/watchpoint-multi.c +++ b/gdb/testsuite/gdb.multi/watchpoint-multi.c @@ -1,6 +1,6 @@ /* This testcase is part of GDB, the GNU debugger. - Copyright 2010 Free Software Foundation, Inc. + Copyright 2012 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gdb/testsuite/gdb.multi/watchpoint-multi.exp b/gdb/testsuite/gdb.multi/watchpoint-multi.exp index b9955bb..d7daeec 100644 --- a/gdb/testsuite/gdb.multi/watchpoint-multi.exp +++ b/gdb/testsuite/gdb.multi/watchpoint-multi.exp @@ -1,5 +1,5 @@ -# Copyright 2010 Free Software Foundation, Inc. - +# Copyright 2012 Free Software Foundation, Inc. +# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or @@ -13,7 +13,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -if { [is_remote target] || ![isnative] } then { +if [is_remote target] { + # It is KFAIL. continue } @@ -72,6 +73,7 @@ gdb_test_multiple $test $test { } -re "There are not enough available hardware resources for this watchpoint\\.\r\n$gdb_prompt $" { untested $test + return } } diff --git a/gdb/testsuite/gdb.threads/watchpoint-fork-child.c b/gdb/testsuite/gdb.threads/watchpoint-fork-child.c index e6c39cf..7a7e07f 100644 --- a/gdb/testsuite/gdb.threads/watchpoint-fork-child.c +++ b/gdb/testsuite/gdb.threads/watchpoint-fork-child.c @@ -1,6 +1,6 @@ /* Test case for forgotten hw-watchpoints after fork()-off of a process. - Copyright 2008, 2009, 2010 Free Software Foundation, Inc. + Copyright 2012 Free Software Foundation, Inc. This file is part of GDB. diff --git a/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c b/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c index 08a5aff..bfdd89f 100644 --- a/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c +++ b/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c @@ -1,6 +1,6 @@ /* Test case for forgotten hw-watchpoints after fork()-off of a process. - Copyright 2008, 2009, 2010 Free Software Foundation, Inc. + Copyright 2012 Free Software Foundation, Inc. This file is part of GDB. diff --git a/gdb/testsuite/gdb.threads/watchpoint-fork-parent.c b/gdb/testsuite/gdb.threads/watchpoint-fork-parent.c index 82d1182..9bbf438 100644 --- a/gdb/testsuite/gdb.threads/watchpoint-fork-parent.c +++ b/gdb/testsuite/gdb.threads/watchpoint-fork-parent.c @@ -1,6 +1,6 @@ /* Test case for forgotten hw-watchpoints after fork()-off of a process. - Copyright 2008, 2009, 2010 Free Software Foundation, Inc. + Copyright 2012 Free Software Foundation, Inc. This file is part of GDB. diff --git a/gdb/testsuite/gdb.threads/watchpoint-fork-st.c b/gdb/testsuite/gdb.threads/watchpoint-fork-st.c index a7eeedd..17cc058 100644 --- a/gdb/testsuite/gdb.threads/watchpoint-fork-st.c +++ b/gdb/testsuite/gdb.threads/watchpoint-fork-st.c @@ -1,6 +1,6 @@ /* Test case for forgotten hw-watchpoints after fork()-off of a process. - Copyright 2008, 2009, 2010 Free Software Foundation, Inc. + Copyright 2012 Free Software Foundation, Inc. This file is part of GDB. diff --git a/gdb/testsuite/gdb.threads/watchpoint-fork.exp b/gdb/testsuite/gdb.threads/watchpoint-fork.exp index 117700b..2e01344 100644 --- a/gdb/testsuite/gdb.threads/watchpoint-fork.exp +++ b/gdb/testsuite/gdb.threads/watchpoint-fork.exp @@ -1,5 +1,5 @@ -# Copyright 2008, 2009, 2010 Free Software Foundation, Inc. - +# Copyright 2012 Free Software Foundation, Inc. +# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or diff --git a/gdb/testsuite/gdb.threads/watchpoint-fork.h b/gdb/testsuite/gdb.threads/watchpoint-fork.h index 31f7656..cb109fa 100644 --- a/gdb/testsuite/gdb.threads/watchpoint-fork.h +++ b/gdb/testsuite/gdb.threads/watchpoint-fork.h @@ -1,6 +1,6 @@ /* Test case for forgotten hw-watchpoints after fork()-off of a process. - Copyright 2008, 2009, 2010 Free Software Foundation, Inc. + Copyright 2012 Free Software Foundation, Inc. This file is part of GDB. hooks/post-receive -- Repository for Project Archer.