From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18146 invoked by alias); 18 Mar 2015 16:07:12 -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 18134 invoked by uid 89); 18 Mar 2015 16:07:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_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, 18 Mar 2015 16:07:10 +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 B7580C40A8; Wed, 18 Mar 2015 16:07:09 +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 t2IG77jd004521; Wed, 18 Mar 2015 12:07:08 -0400 Message-ID: <5509A2AB.3020004@redhat.com> Date: Wed, 18 Mar 2015 16:07:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Ulrich Weigand CC: Wei-cheng Wang , gdb-patches@sourceware.org Subject: Re: [PATCH 1/2] Fast tracepoint for powerpc64le References: <201503181104.t2IB4bne004457@d06av02.portsmouth.uk.ibm.com> In-Reply-To: <201503181104.t2IB4bne004457@d06av02.portsmouth.uk.ibm.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-03/txt/msg00548.txt.bz2 On 03/18/2015 11:04 AM, Ulrich Weigand wrote: > Pedro Alves wrote: >> On 03/17/2015 06:12 PM, Ulrich Weigand wrote: >>> That's probably not necessary. The reason the GDB implementation >>> does it that way is that it needs to work under various different >>> circumstances, like when debugging a core file, or before the >>> dynamic linker has relocated an executable. For the gdbserver >>> implementation, we should never need to handle such conditions, >>> so we are able to simply read the target address from memory. >>> >> >> Maybe not cores today, but why doesn't gdbserver have to >> handle the case of connecting before the executable has been >> relocated? >> >> I also wonder about all the break-interp.exp corner cases. > > gdbserver would access function descriptors only for the > __nptl_create_event etc. routines. These are looked up > only after a libthread_db td_ta_new_p call succeeds, which > should only be true if libpthread has been loaded (and > relocated) in the inferior. If it hasn't been yet at the > time gdbserver attaches, the whole thread initialization > sequence is defered until after the new_objfile event that > happens after libpthread *was* loaded and relocated. > Am I missing something here? You're missing the case of statically linked threaded programs. AFAICS, on x86-64, libthread_db.so is loaded successfully on initial connection, and if I hack gdbserver to use __nptl_create_event events, I see it setting the breakpoint already on initial connection. Thanks, Pedro Alves