From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: poffice@blade.nagaokaut.ac.jp Delivered-To: poffice@blade.nagaokaut.ac.jp Received: from kankan.nagaokaut.ac.jp (kankan.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (Postfix) with ESMTP id C42F319A042C for ; Tue, 1 Sep 2015 17:51:57 +0900 (JST) Received: from funfun.nagaokaut.ac.jp (funfun.nagaokaut.ac.jp [133.44.2.201]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id 1731CB5D861 for ; Tue, 1 Sep 2015 18:13:08 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by funfun.nagaokaut.ac.jp (Postfix) with ESMTP id 480F197A82C for ; Tue, 1 Sep 2015 18:13:10 +0900 (JST) Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by voscc.nagaokaut.ac.jp (Postfix) with ESMTP id 1A3A095241E for ; Tue, 1 Sep 2015 18:13:05 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id DB57612061D; Tue, 1 Sep 2015 18:13:05 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from o10.shared.sendgrid.net (o10.shared.sendgrid.net [173.193.132.135]) by neon.ruby-lang.org (Postfix) with ESMTPS id E86981204DC for ; Tue, 1 Sep 2015 18:13:02 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.me; h=from:to:references:subject:mime-version:content-type:content-transfer-encoding:list-id; s=smtpapi; bh=UMawmrFgdU6VgsN70SQInXCl/88=; b=flmiX1c7A2UF0fkgdY T8ENe/nD0Oe6NTVbqkEyLoDx9hSuaxmVDm6ku6oqQ1J5VbuxwyWvaUgPDoK6ATY5 CB2yag0qYpT39BEtIEF77VZmxnIiHdOSH66ffuyB2xc7O/lrcAvuTY6NG8JCKsOl IkRqeKPQtg39vNv1njIa5dnvs= Received: by filter0571p1mdw1.sendgrid.net with SMTP id filter0571p1mdw1.27546.55E56C189 2015-09-01 09:12:56.091229977 +0000 UTC Received: from herokuapp.com (ec2-54-145-114-227.compute-1.amazonaws.com [54.145.114.227]) by ismtpd0005p1iad1.sendgrid.net (SG) with ESMTP id TVlpp00FQFKleLn_mrtRiQ Tue, 01 Sep 2015 09:12:56.146 +0000 (UTC) Date: Tue, 01 Sep 2015 09:12:56 +0000 From: os97673@gmail.com To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Redmine-MailingListIntegration-Message-Ids: 45260 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 11348 X-Redmine-Issue-Author: os97673 X-Redmine-Issue-Assignee: ko1 X-Redmine-Sender: os97673 X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS7gWMovP4tstqddB69b5L+8rDusWekh1pxHjb 9JAiQj+2paRuBFURmd9yp/q3mUepZtXD9xmifaZAbv/QJBIRSjZDNDm9ZyxCSEWGaB7emE8SmGU49k OrAFel12vHLDQJfJ3pUliFMn88UCAiHtkHqV X-ML-Name: ruby-core X-Mail-Count: 70645 Subject: [ruby-core:70645] [Ruby trunk - Feature #11348] TracePoint API needs events for fiber's switching X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #11348 has been updated by Oleg Sukhodolsky. Koichi Sasada wrote: > > f1.resume # stopped at the line > > f1.resume # want to stop here after step over > > Only for this purpose, how about to stop every fiber switching? It is true that the program enter newline! I'm not sure I've completely understand you suggestion :( Could you please clarify? I've provided the example ask how to guarantee that we will not stop somewhere inside f1's implementation. ---------------------------------------- Feature #11348: TracePoint API needs events for fiber's switching https://bugs.ruby-lang.org/issues/11348#change-54046 * Author: Oleg Sukhodolsky * Status: Feedback * Priority: Normal * Assignee: Koichi Sasada ---------------------------------------- as discussed in https://github.com/deivid-rodriguez/byebug/issues/153 current implementation of byebug/debase has problem with stepping when Enumarator/Fiber is used. The problem is that Fiber completely replaces stack (w/o any events) while the gems assume that any stack modification has corresponding call/return event. It would be nice to receive events for Fiber's switching (at least) to be able to track stack for every fiber independently. Also I think it would be nice to discuss the API before adding it because different set of event will allow to implement different debugger's capabilities. E.g. plain :fiber-changed (event about every fiber switch) will only allow us to handle every fiber independently (like threads are handled) while debugger's user may expect that step into on enumerator.next will step into enumerator's code and step out from that code should go to the place where enumerator.next has been called. So, perhaps we should have different events for Fiber#resume and Fiber#yield, but I'm not sure and would like to here other opinions. Here are two tests which can be used to play with (one for Enumerator, another for Fiber) ~~~ruby triangular_numbers = Enumerator.new do |yielder| number = 0 count = 1 loop do number += count count += 1 yielder.yield number end end print triangular_numbers.next, " " 5.times do print triangular_numbers.next, " " end ~~~ ~~~ruby fiber = Fiber.new do number = 0 count = 1 loop do number += count count += 1 Fiber.yield number end end print fiber.resume, " " 5.times do print fiber.resume, " " end ~~~ -- https://bugs.ruby-lang.org/