From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 43079 invoked by alias); 11 Apr 2017 23:51:16 -0000 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 Received: (qmail 43061 invoked by uid 89); 11 Apr 2017 23:51:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=5-7 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 11 Apr 2017 23:51:14 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8A9347AEAA for ; Tue, 11 Apr 2017 23:51:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8A9347AEAA Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=palves@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 8A9347AEAA Received: from cascais.lan (ovpn04.gateway.prod.ext.phx2.redhat.com [10.5.9.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1ECA07B8C0 for ; Tue, 11 Apr 2017 23:51:13 +0000 (UTC) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 0/8] Fix removing inferiors from within "thread apply" commands Date: Tue, 11 Apr 2017 23:51:00 -0000 Message-Id: <1491954673-29172-1-git-send-email-palves@redhat.com> X-SW-Source: 2017-04/txt/msg00294.txt.bz2 It took a bit more work than I envisioned, but ... ... this series aims at fixing the issues mentioned here: https://sourceware.org/ml/gdb-patches/2017-04/msg00137.html Those are addressed by the last patch in this series (patch 8). That patch however exposed a couple other latent problems, which are fixed by the first two patches in this series. Patch 3 ("C++fy thread_apply_all_command"), I wrote because I first thought we'd also have to bump the refcounts of all inferiors in "thread apply all". That's actually not necessary, but still that's a useful patch for getting rid of cleanups, so I included it here. Patch 4 increases coverage of a regression test for a related bug. I had noticed that we weren't making sure that GDB reverts back to no thread selected in that test. And patch 3 made me realize that that test also didn't exercise "thread apply $some_thread", which goes via a different path, so I fixed it too. Patches 5-7 are preparatory/cleanup work for patch 8. Tested on x86_64 Fedora 23, native and gdbserver. Pedro Alves (8): watch_command_1: Fix dangling frame access Fix follow-fork latent bug C++fy thread_apply_all_command Improve coverage of the PR threads/13217 regression test GC inferior.c:init_inferior_list Make inferior a class with cdtors, and use new/delete Make inferior::detaching a bool, and introduce scoped_restore::release() Fix removing inferiors from within "thread apply" commands gdb/Makefile.in | 6 +- gdb/breakpoint.c | 34 +++-- gdb/common/scoped_restore.h | 36 +++-- gdb/inferior.c | 52 ++----- gdb/inferior.h | 110 +++++++++------ gdb/infrun.c | 13 +- gdb/testsuite/gdb.threads/threadapply.exp | 166 +++++++++++++++++++++- gdb/testsuite/lib/gdb.exp | 19 +++ gdb/thread.c | 222 ++++++++++++++++-------------- gdb/unittests/scoped_restore-selftests.c | 110 +++++++++++++++ 10 files changed, 556 insertions(+), 212 deletions(-) create mode 100644 gdb/unittests/scoped_restore-selftests.c -- 2.5.5