From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17487 invoked by alias); 28 Nov 2012 00:41:21 -0000 Received: (qmail 17477 invoked by uid 22791); 28 Nov 2012 00:41:20 -0000 X-SWARE-Spam-Status: No, hits=-7.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,MISSING_HEADERS,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS,TW_BT 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; Wed, 28 Nov 2012 00:41:11 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qAS0f7vA026765 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 27 Nov 2012 19:41:07 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qAS0f47r025084; Tue, 27 Nov 2012 19:41:05 -0500 Message-ID: <50B55DA0.1040909@redhat.com> Date: Wed, 28 Nov 2012 00:41:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 CC: markus.t.metzger@intel.com, gdb-patches@sourceware.org, markus.t.metzger@gmail.com, jan.kratochvil@redhat.com, tromey@redhat.com, kettenis@gnu.org Subject: Re: [patch v4 02/13] thread, btrace: add generic branch trace support References: <1354013351-14791-1-git-send-email-markus.t.metzger@intel.com> <1354013351-14791-3-git-send-email-markus.t.metzger@intel.com> <50B5072E.4070709@redhat.com> <50B508A1.9090800@gmail.com> In-Reply-To: <50B508A1.9090800@gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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: 2012-11/txt/msg00787.txt.bz2 [Sorry, I had to rush out in a hurry before, and didn't trim the previous reply. I was just having trouble myself finding the real reply among all the quoting, so here it is again:] >> >> /* The first block ends at the current pc. */ >> if (!VEC_empty (btrace_block_s, btp->btrace)) >> { >> struct frame_info *frame = get_current_frame (); > > This get_current_frame call here looks fishy. This function takes a > btrace_thread_info, and its callers work with a thread_info directly, > which indicates that they may work with some current thread other than > the thread passed in as argument. > >> >> if (frame) >> { > > What's this check supposed to mean? get_current_frame never > returns NULL. > >> struct btrace_block *head = >> VEC_index (btrace_block_s, btp->btrace, 0); > >> >> if (head && !head->end) >> head->end = get_frame_pc (frame); I meant to suggest bypassing frames, and using regcache_read_pc instead. -- Pedro Alves