From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on starla X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Received: from nue.mailmanlists.eu (nue.mailmanlists.eu [IPv6:2a01:4f8:1c0c:6b10::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id DBB611F44D for ; Sat, 17 Feb 2024 03:50:21 +0000 (UTC) Received: from nue.mailmanlists.eu (localhost [127.0.0.1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 31B6282A6F; Sat, 17 Feb 2024 03:50:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1708141813; bh=oVA1OWZ1Z0e8r+XfrhiDRuXNcJD8CToiH73ttsc6/Bw=; h=Date:References:To:Reply-To:Subject:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From:Cc:From; b=Cn47O3/Fb91FILwZostDDc6vsNGmpZB9kD3ImEPkU566Rep5zBpcODs1mHZ2wIjxe GE1jDX2VG1Ch3F3lx/Kn3+m9SSq5DCoU1odsVuxANb4qQE5sQIZ7q6vSRbL75z1fry ssLtMvUw4mIcZSivld9RhQOEKlU81E+bkcRMxEK4= Received: from wrqvtvvn.outbound-mail.sendgrid.net (wrqvtvvn.outbound-mail.sendgrid.net [149.72.120.130]) by nue.mailmanlists.eu (Postfix) with ESMTPS id 056EE828D7 for ; Sat, 17 Feb 2024 03:50:09 +0000 (UTC) Authentication-Results: nue.mailmanlists.eu; dkim=pass (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=cpQ7XxkN; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ruby-lang.org; h=from:references:subject:mime-version:content-type: content-transfer-encoding:list-id:to:cc:content-type:from:subject:to; s=s1; bh=N65l85qR8J7JPq9CHDOE6Q5h8kl502yDGVs/Ch47TR0=; b=cpQ7XxkNAQZa8kM7291VIjKhGKVJ2OoavqytJ87PwhrD8Ri/uPAM81ZipRAP3EcIbUL0 r5UKFRDj3TZ51F86sESowR0wxCLQW0+tmRn23YohKEl+s1AZVT11ofFgpJY2qDcwZwGFCs 29VjL1UNdC9cKjDSCljvAFvH49hnvJJFRqiXLuSmuMpXWd0/u0Ms6/2GdHwf7vK4nWXspi GQ23QVmI1faUi4qV9HjrDDljw+IvaFgum/k/jL/wWWQOvP6dwsW3PXvxL5qwR0aIpNO83v eL8+RCUJIfdRC+DpB8iCZhlUK5Hr0um1L9U4owvHyfkmzxPrXs9dY9VdRtn4Mr+A== Received: by filterdrecv-655bd866f5-c4wvc with SMTP id filterdrecv-655bd866f5-c4wvc-1-65D02CF0-F 2024-02-17 03:50:08.623085625 +0000 UTC m=+718409.325344735 Received: from herokuapp.com (unknown) by geopod-ismtpd-2 (SG) with ESMTP id wJpIaWZnQ6CUy3bzQzKnzw for ; Sat, 17 Feb 2024 03:50:08.605 +0000 (UTC) Date: Sat, 17 Feb 2024 03:50:08 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Feature X-Redmine-Issue-Id: 19117 X-Redmine-Issue-Author: byroot X-Redmine-Sender: mame 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-Redmine-MailingListIntegration-Message-Ids: 93368 X-SG-EID: =?us-ascii?Q?YbSlef6ZOa=2FS=2FuqSxXRzl42MttQDxKOujGe43WuBjI7JKMg2OkmRsyzG5za6L9?= =?us-ascii?Q?e1flZkYZ9OViVy5Lc4acvpZqsS1d52RaHAsOZCN?= =?us-ascii?Q?XIsHDGAnp56=2F5c2GkhdCJP08DunrWVG4vue0Vi8?= =?us-ascii?Q?JVFi4e31rN=2FeaToRW87+9sGOZ2LTMjhzBEQdYm=2F?= =?us-ascii?Q?=2FE54KhFMd2MG1J=2FrPoZYDEydfay6D7SuDI0Sxsd?= =?us-ascii?Q?qrgIg21ZgTwflAR5dLzNFKtOnniT03LX5eWixT=2F?= =?us-ascii?Q?xFiOG3conLuCjUqPNwpkA=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== Message-ID-Hash: HTHOVCYICMSZBSSPQYIOJXG5TI3TQ3V2 X-Message-ID-Hash: HTHOVCYICMSZBSSPQYIOJXG5TI3TQ3V2 X-MailFrom: bounces+313651-b711-ruby-core=ml.ruby-lang.org@em5188.ruby-lang.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list Reply-To: Ruby developers Subject: [ruby-core:116812] [Ruby master Feature#19117] Include the method owner in backtraces, not just the method name List-Id: Ruby developers Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "mame (Yusuke Endoh) via ruby-core" Cc: "mame (Yusuke Endoh)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #19117 has been updated by mame (Yusuke Endoh). No one seems to want to treat `rescue in` and `ensure in` as a regression. I think that we should discuss further improvements in a separate ticket. ---------------------------------------- Feature #19117: Include the method owner in backtraces, not just the method name https://bugs.ruby-lang.org/issues/19117#change-106837 * Author: byroot (Jean Boussier) * Status: Closed * Priority: Normal * Target version: 3.4 ---------------------------------------- ``` module Foo class Bar def inspect 1 + '1' end end end p Foo::Bar.new ``` This code produce the following backtrace: ``` /tmp/foo.rb:4:in `+': String can't be coerced into Integer (TypeError) from /tmp/foo.rb:4:in `inspect' from /tmp/foo.rb:9:in `p' from /tmp/foo.rb:9:in `
' ``` This works, but on large codebases and large backtraces the method name isn't always all that revealing, most of the time you need to open many of the locations listed in the backtrace to really understand what is going on. I propose that we also include the owner name: ``` /tmp/foo.rb:4:in `Integer#+': String can't be coerced into Integer (TypeError) from /tmp/foo.rb:4:in `Foo::Bar#inspect' from /tmp/foo.rb:9:in `Kernel#p' from /tmp/foo.rb:9:in `
' ``` I believe that in many case it would allow to much better understand the backtrace without having to jump back and forth between it and the source code. This is inspired by @ivoanjo 's `backtracie` gem: https://github.com/ivoanjo/backtracie -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/