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=0.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_BL_SPAMCOP_NET,SPF_HELO_PASS, SPF_PASS autolearn=no 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)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id AF6C21F44D for ; Thu, 21 Mar 2024 20:08:47 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; secure) header.d=ml.ruby-lang.org header.i=@ml.ruby-lang.org header.a=rsa-sha256 header.s=mail header.b=d7uZvxSa; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=jrzG6wOE; dkim-atps=neutral Received: from nue.mailmanlists.eu (localhost [127.0.0.1]) by nue.mailmanlists.eu (Postfix) with ESMTP id DCC838367A; Thu, 21 Mar 2024 20:08:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1711051720; bh=jGHlcxBJ8K2sToTI4jxtSG3tlpnYr8a3+Bi3sD/TGAc=; 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=d7uZvxSa2y5qtdgtA1dadz4r8cC0aTjyMmfkHYdmJgVRhN15AOrASfhPeREb93w8i FoccncloPZc3l7k6fg4452vz8Ea6OllPxnH3T5DuA8bMReZipK54rTBitszkLn6hIV e2j7JCMDVWX6J8ARw9keg0T+JafKTD0gOILJfM6E= Received: from s.wrqvwxzv.outbound-mail.sendgrid.net (s.wrqvwxzv.outbound-mail.sendgrid.net [149.72.154.232]) by nue.mailmanlists.eu (Postfix) with ESMTPS id 19AD983651 for ; Thu, 21 Mar 2024 20:08:36 +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=jrzG6wOE; 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=wgI0Cho6b21EKQfNo8LWkwIOOnj9E+icRayQzXtv/xc=; b=jrzG6wOE13FgisrqD5NoVwy7+W5OlAPp3oCODZjLJajRP+ewovDov0MNBv+GYWDUQUW+ hgCKL6E7FLJErByiC1Fda8NO428wm64rJ8CyBmKgb0CucCwV/t6vNQBlN+STmLMolg8BdQ YsJJAgQkrdUwQxQcMb3kakdOypkCwR9rPUM7V8bj+LPkxRIVV8TIG4kNMsnu96myWZMYY3 +wWTRALsUvGtDw8lL/GHydo2C4bxWidoXRqHyJz9CCc8KVwPPnq/C9lVT0Xzle5am2Sd2S 0fwRWGbMEFxs8Vn/V5bUkHZBOFOg8ReEA33WK8VYEQtvr67dDJ0gtw7mfGx4BQlA== Received: by recvd-7555548f4d-9kl9s with SMTP id recvd-7555548f4d-9kl9s-1-65FC93C3-3 2024-03-21 20:08:35.0600145 +0000 UTC m=+256120.247915232 Received: from herokuapp.com (unknown) by geopod-ismtpd-39 (SG) with ESMTP id 8-jvMaCdSmeWnfLo5t0ISQ for ; Thu, 21 Mar 2024 20:08:35.013 +0000 (UTC) Date: Thu, 21 Mar 2024 20:08:35 +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-Issue-Assignee: mame X-Redmine-Issue-Priority: Normal X-Redmine-Sender: Eregon 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: 93885 X-SG-EID: =?us-ascii?Q?u001=2EByjZWvxTCjdoV8K03xEuhE7KqN4thWULFLM7+oH78KY30oYB3qFthsDpL?= =?us-ascii?Q?4w4cbYa3ttBh8bAHPOnE=2FkzPba67JNu7Lnrked2?= =?us-ascii?Q?O7K9VQ=2FJax36s3YggFdFCSC1okpmkv6o10DKrCP?= =?us-ascii?Q?obrgKxpH51xO1NPCDWXwBWNBMqBbdWSmFuw98jm?= =?us-ascii?Q?73+GSjsscsnn5cUEpKa8pQggPUkcE+PqDoRSbVv?= =?us-ascii?Q?yjR7nfoeWqnXEIZo81868XDE16qwXOQbs9Bq9po?= =?us-ascii?Q?7h2nkxfUAq4z5NUKlexpr=2F02rQ=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: OQMNA3AMXZV4ABRXFZNAQLTS27WKVQK5 X-Message-ID-Hash: OQMNA3AMXZV4ABRXFZNAQLTS27WKVQK5 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:117286] [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: "Eregon (Benoit Daloze) via ruby-core" Cc: "Eregon (Benoit Daloze)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #19117 has been updated by Eregon (Benoit Daloze). Assignee changed from Eregon (Benoit Daloze) to mame (Yusuke Endoh) ---------------------------------------- Feature #19117: Include the method owner in backtraces, not just the method name https://bugs.ruby-lang.org/issues/19117#change-107412 * Author: byroot (Jean Boussier) * Status: Closed * Assignee: mame (Yusuke Endoh) * 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/