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 [94.130.110.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 1FE181F44D for ; Tue, 13 Feb 2024 18:02:26 +0000 (UTC) Received: from nue.mailmanlists.eu (localhost [127.0.0.1]) by nue.mailmanlists.eu (Postfix) with ESMTP id A013682963; Tue, 13 Feb 2024 18:02:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1707847338; bh=UigF25ilTcsOocNX0zV6i/9UtOEN81Mie9Uz/SWwWr0=; 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=gT1RqZQpJDOfzipdKx9anOpLPP+dMAke62buYo7PDaHuz8ZLJMvDEmYOp+mnaMRn3 3IpWZfy14O7WpE+PdXHHXIOD8oyxf/lTuqxffl5r3MdwC7VDjVCAaLDI7QITeVHCQY k7Uw1KmFmokAU0E4WClXlzGc4M1f86w1mEgbtK0s= Received: from wrqvtvtt.outbound-mail.sendgrid.net (wrqvtvtt.outbound-mail.sendgrid.net [149.72.120.119]) by nue.mailmanlists.eu (Postfix) with ESMTPS id F21D4828DA for ; Tue, 13 Feb 2024 18:02:15 +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=WKwdyL5N; 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=QehU3stYpqVPrZwafcoOORxs1O6P68Lil8lOGCXWzoA=; b=WKwdyL5NyRMilhMeq2TyC7yuWRMOeFBvaTLJi40ajgyfOG7pj1/WAq0wxcsTUpM+8zJx V6BRpvrK2orLQjQ1Eizw9DPDwRCV96Hp7yGg24SUWWk9k0UwlKPiKcZOqABVENGpLonDhK OU4V2hzkoZ1YWtr0Ua6yRIkCsLCq+vTrLqpfVShE3xXYkr0RujqsP6ypvjuPc/u70GbS0l fIc8sg2bH5f0Wdj41awaBp6QOH+Rbt7YY3sVUSFJ1JqkRJWUwtblNer/E2Wj5a99Mtvq0W uu66S4bVFcvvo14wYd+1EB++nUXjBaLRN3AvGR7d2yYee8N+XNw+nsahWarr1H5w== Received: by filterdrecv-58bfc74dd6-dgkl4 with SMTP id filterdrecv-58bfc74dd6-dgkl4-1-65CBAEA6-89 2024-02-13 18:02:14.895892267 +0000 UTC m=+1655138.930005530 Received: from herokuapp.com (unknown) by geopod-ismtpd-22 (SG) with ESMTP id xCkjpmfYQP-60C0bE30iSw for ; Tue, 13 Feb 2024 18:02:14.841 +0000 (UTC) Date: Tue, 13 Feb 2024 18:02:14 +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: ko1 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: 93261 X-SG-EID: =?us-ascii?Q?YkmFGMrQnymZs=2F4gaHJnvrsFPAGAfVipS20r=2FEutHlZKBkOXJV3+2vYlfF3wrB?= =?us-ascii?Q?u+wzn1=2FYobjg0PO+JI9qcf5=2F0MIFubTS=2F9Tkahv?= =?us-ascii?Q?Urc4tMW76xTCrHykx7Tw=2FN1Z22z4h9Ohzq=2FbA=2FU?= =?us-ascii?Q?79WPVv5AlkQImh5MPhydH9YAoW+YlWaJVfMv3CI?= =?us-ascii?Q?uFqfiwrLmEepQJ=2FecwWWmhzgIUY+J3+IZ9fJDXC?= =?us-ascii?Q?pZmB2cH2TURdQBcUwx6GH5ANWUtqxHU7H6o8BRA?= =?us-ascii?Q?DEJHPt4DgnUM58dKNltTQ=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== Message-ID-Hash: QH3P2SVGXZAG53HXTCP6GH5AFSPT4PG4 X-Message-ID-Hash: QH3P2SVGXZAG53HXTCP6GH5AFSPT4PG4 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:116705] [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: "ko1 (Koichi Sasada) via ruby-core" Cc: "ko1 (Koichi Sasada)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #19117 has been updated by ko1 (Koichi Sasada). It should be: ``` /Users/byroot/.gem/ruby/3.2.2/gems/activerecord-7.1.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:30:in ActiveRecord::Foo::Bar#checkin: wrong number of arguments (given 0, expected 1) (ArgumentError) ``` (I'm not sure the correct class name...) I meant that it may be easy to find method names by adding class name without using quotation marks. ---------------------------------------- Feature #19117: Include the method owner in backtraces, not just the method name https://bugs.ruby-lang.org/issues/19117#change-106721 * Author: byroot (Jean Boussier) * Status: Open * 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/