From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13984 invoked by alias); 9 Sep 2015 10:35:20 -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 13903 invoked by uid 89); 9 Sep 2015 10:35:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_20,KAM_LAZY_DOMAIN_SECURITY,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mga11.intel.com Received: from mga11.intel.com (HELO mga11.intel.com) (192.55.52.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 09 Sep 2015 10:35:16 +0000 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 09 Sep 2015 03:35:15 -0700 X-ExtLoop1: 1 Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga001.fm.intel.com with ESMTP; 09 Sep 2015 03:35:14 -0700 Received: from ulvlx001.iul.intel.com (ulvlx001.iul.intel.com [172.28.207.17]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id t89AZDk8004753; Wed, 9 Sep 2015 11:35:13 +0100 Received: from ulvlx001.iul.intel.com (localhost [127.0.0.1]) by ulvlx001.iul.intel.com with ESMTP id t89AZD5b000605; Wed, 9 Sep 2015 12:35:13 +0200 Received: (from mmetzger@localhost) by ulvlx001.iul.intel.com with œ id t89AZCXF000601; Wed, 9 Sep 2015 12:35:13 +0200 From: Markus Metzger To: palves@redhat.com Cc: gdb-patches@sourceware.org Subject: [PATCH 11/17] btrace: async Date: Wed, 09 Sep 2015 10:35:00 -0000 Message-Id: <1441794909-32718-12-git-send-email-markus.t.metzger@intel.com> In-Reply-To: <1441794909-32718-1-git-send-email-markus.t.metzger@intel.com> References: <1441794909-32718-1-git-send-email-markus.t.metzger@intel.com> X-IsSubscribed: yes X-SW-Source: 2015-09/txt/msg00105.txt.bz2 The record btrace target runs synchronous with GDB. That is, GDB steps resumed threads in record btrace's to_wait method. Without GDB calling to_wait, nothing happens 'on the target'. Check for further expected events in to_wait before reporting the current event and mark record btrace's async event handler in async mode. 2015-09-09 Markus Metzger gdb/ * record-btrace.c (record_btrace_maybe_mark_async_event): New. (record_btrace_wait): Call record_btrace_maybe_mark_async_event. --- gdb/record-btrace.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/gdb/record-btrace.c b/gdb/record-btrace.c index a38faf3..119bf92 100644 --- a/gdb/record-btrace.c +++ b/gdb/record-btrace.c @@ -2240,6 +2240,29 @@ record_btrace_step_thread (struct thread_info *tp) typedef struct thread_info * tp_t; DEF_VEC_P (tp_t); +/* Announce further events if necessary. */ + +static void +record_btrace_maybe_mark_async_event (const VEC (tp_t) *moving, + const VEC (tp_t) *no_history) +{ + int more_moving, more_no_history; + + more_moving = !VEC_empty (tp_t, moving); + more_no_history = !VEC_empty (tp_t, no_history); + + if (!more_moving && !more_no_history) + return; + + if (more_moving) + DEBUG ("movers pending"); + + if (more_no_history) + DEBUG ("no-history pending"); + + mark_async_event_handler (record_btrace_async_inferior_event_handler); +} + /* The to_wait method of target record-btrace. */ static ptid_t @@ -2355,6 +2378,10 @@ record_btrace_wait (struct target_ops *ops, ptid_t ptid, ALL_NON_EXITED_THREADS (tp) record_btrace_cancel_resume (tp); + /* In async mode, we need to announce further events. */ + if (target_is_async_p ()) + record_btrace_maybe_mark_async_event (moving, no_history); + /* Start record histories anew from the current position. */ record_btrace_clear_histories (&eventing->btrace); -- 1.8.3.1