From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 91228 invoked by alias); 4 Nov 2015 18:19:27 -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 91214 invoked by uid 89); 4 Nov 2015 18:19:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 04 Nov 2015 18:19:25 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 7C45A8C1C1; Wed, 4 Nov 2015 18:19:24 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tA4IJNuZ030069; Wed, 4 Nov 2015 13:19:23 -0500 Message-ID: <563A4C2A.2010601@redhat.com> Date: Wed, 04 Nov 2015 18:19:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Antoine Tremblay , gdb-patches@sourceware.org Subject: Re: [PATCH 04/10] Remove support for thread events without TRACE_EVENT_CLONE in GDBServer. References: <1446138583-13268-1-git-send-email-antoine.tremblay@ericsson.com> <1446138583-13268-5-git-send-email-antoine.tremblay@ericsson.com> In-Reply-To: <1446138583-13268-5-git-send-email-antoine.tremblay@ericsson.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-11/txt/msg00150.txt.bz2 On 10/29/2015 05:09 PM, Antoine Tremblay wrote: > This patch removes support for thread events if TRACE_EVENT_CLONE is not > supported in GDBServer. (I had never seen it spelled without the leading P(RACE_EVENT_CLONE). Is that a typo? (subject too).) > > Before, on systems that did not support PTRACE_EVENT_CLONE, both GDB and > GDBServer coordinated with libthread_db.so to insert breakpoints at magic > locations in libpthread.so, in order to break at thread creation and thread > death. > > Simple software single stepping support was implemented to step over these > breakpoints in case there was no hardware single stepping support. However, > these simple software single stepping implementations were not fit for any other > use as discussed in : > https://sourceware.org/ml/gdb-patches/2015-04/msg01110.html > > These too simple implementations conflict with ongoing work to make proper > implementations of software single stepping in GDBServer. > > The problem is that if some implementations are correct and others are not and > only there for the thread magic breakpoint, we can't enable features based > solely software single step support since some would be broken. > > To keep the incorrect implementations and allow the new proper ones at the same > time we would need to implement fallback code and it quickly becomes ugly and > confusing with multiple checks for legacy software single step or proper > software single step. > > However, PTRACE_EVENT_CLONE was first introduced in Linux 2.5.46, > released in November 2002. > > So I think it's reasonable to just remove support for kernels that don't support > PTRACE_EVENT_CLONE, and sidestep the libthread_db breakpoints issues entirely. > > This thread on the mailling list discusses the issue : > https://sourceware.org/ml/gdb/2015-10/msg00078.html > > No regressions, tested on ubuntu 14.04 ARMv7 and x86. > With gdbserver-{native,extended} / { -marm -mthumb } > > gdb/gdbserver/ChangeLog: > > * linux-low.c (linux_look_up_symbols): Don't call > linux_supports_traceclone. > * linux-low.h (thread_db_init): Remove use_events argument. > * thread-db.c (thread_db_use_event): Remove global variable. > (struct thread_db) : Remove field. > (thread_db_create_event): Remove function. > (thread_db_enable_reporting): Likewise. > (find_one_thread): Don't check for thread_db_use_events. > (attach_thread): Likewise. > (thread_db_load_search): Remove td_thr_event_enable_p initialization. > (try_thread_db_load_1): Don't check for thread_db_use_events. > (thread_db_init): Remove use_events argument. > (thread_db_init): Remove thread events handling. LGTM. Thanks, Pedro Alves