From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16847 invoked by alias); 6 Dec 2010 11:11:51 -0000 Received: (qmail 16837 invoked by uid 22791); 6 Dec 2010 11:11:50 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,TW_QE,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 06 Dec 2010 11:11:44 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oB6BBgHE008258 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 6 Dec 2010 06:11:42 -0500 Received: from host0.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id oB6BBbDA003779 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 6 Dec 2010 06:11:41 -0500 Received: from host0.dyn.jankratochvil.net (host0.dyn.jankratochvil.net [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.4/8.14.4) with ESMTP id oB6BBaOl027601 for ; Mon, 6 Dec 2010 12:11:36 +0100 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.4/8.14.4/Submit) id oB6BBZbM027595 for gdb-patches@sourceware.org; Mon, 6 Dec 2010 12:11:35 +0100 Date: Mon, 06 Dec 2010 11:11:00 -0000 From: Jan Kratochvil To: gdb-patches@sourceware.org Subject: [patch 0/4] hw watchpoints across fork() + multi-inf Message-ID: <20101206111135.GA27176@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-12/txt/msg00041.txt.bz2 Hi, this is an Archer branch archer-jankratochvil-watchpoint3 being posted here since 2007 and (different impl.) present in Fedora: [patch] Fix disarmed hw watchpoints after inferior's fork() http://sourceware.org/ml/gdb-patches/2007-10/msg00367.html http://sourceware.org/ml/gdb-patches/2007-11/msg00454.html http://sourceware.org/ml/gdb-patches/2008-01/msg00042.html [patch 4/4] Fix hw watchpoints: across fork() http://sourceware.org/ml/gdb-patches/2009-08/msg00258.html http://sourceware.org/ml/gdb-patches/2009-11/msg00353.html problem #1: Disarmed watchpoints - watchpoints are not caught after fork(). problem #2: Leftover watchpoints - there will be a core file from the child. (on very recent Linux kernels it no longer crashes - see [patch 3/4]) echo 'int v;main(){fork();v++;}'|gcc -g -x c -;(ulimit -c unlimited;./gdb -nx ./a.out -ex start -ex 'watch v' -ex c -ex q) Only (part of) the main testcase remained; the code did not expect multi-inferior and for multi-inferior it would have to be reimplemented later anyway. Therefore at least this patch also fixes hw watchpoints to be multi-inferior capable/compatible. Currently the hw watchpoints are made specific to one inferior. There is no way to create a single watchpoint across-all-inferiors. Currently they were set globally but they SIGTRAP various way in multi-inferior mode. More of this per-inferior differentiation is probably in the scope of Tom Tromey's multi-inferior breakpoints work. The hw watchpoints are now tracked per-PID. While one can create breakpoints/watchpoints also per-TID (by the "thread" keyword) this is currently (inefficiently) implemented only by GDB evaluation while the breakpoints/watchpoints are still global per-PID, for all TIDs. I do not try to target this performance optimization in this patch. This is only linux-nat fix; gdbserver FAILs on these testcases now. Still remains a problem of hw watchpoints being silently ignored in some virtual machines, at least: * qemu-system-x86_64 0.9.1-6.fc9.x86_64 * qemu-kvm kvm-65-7.fc9.x86_64 + kernel-2.6.25.9-76.fc9.x86_64. There should be a runtime test to verify the watchpoints work, like linux-nat.c has already some other runtime tests. But that would be an unrelated patch. The ppc part is only tested on non-BookE (=DABR) machine (RHEL-6). It fixes there some new testcases but still many `set follow-fork-mode child' FAIL but I find it as an unrelated problem: Error in re-setting breakpoint 1: reading register r31 (#31): No such process.^M No regressions on {x86_64,x86_64-m32,i686}-fedora14-linux-gnu. Thanks, Jan