From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Welsh Duggan Newsgroups: gmane.emacs.devel Subject: Re: How to highlight the offending line of code with edebug Date: Fri, 23 Dec 2022 02:36:15 -0500 Message-ID: <87ili2o9lc.fsf@md5i.com> References: <83fsd68u3f.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29393"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: emacs-devel@gnu.org To: Davin Pearson Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Dec 23 08:36:52 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p8cbr-0007SY-At for ged-emacs-devel@m.gmane-mx.org; Fri, 23 Dec 2022 08:36:51 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p8cbM-0002WK-7w; Fri, 23 Dec 2022 02:36:20 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p8cbK-0002Vo-VY for emacs-devel@gnu.org; Fri, 23 Dec 2022 02:36:19 -0500 Original-Received: from md5i.com ([75.151.244.229]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p8cbJ-0005vr-DB for emacs-devel@gnu.org; Fri, 23 Dec 2022 02:36:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=md5i.com; s=dkim; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=8uAnEt89zstsPjH+76zDj1Hr6sKEVTyEaG2HvG7hOxY=; b=vjRmGYkwDtQbfOGiijlUgaKG/a 0zvtfNU+4oTixmeRdCpbokz+uxlc4Z7jeHCrfMTbqi/L2ANhCJTk78RCdhK93DSMuIN0eu/LfrqN1 7+ZXGkOjfRzbKm2SQNZN1Kfhs; Original-Received: from abode ([192.168.177.1]:57276 helo=miko) by md5i.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1p8cbH-00BXp3-1z; Fri, 23 Dec 2022 02:36:15 -0500 In-Reply-To: <83fsd68u3f.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 23 Dec 2022 09:20:04 +0200") Received-SPF: pass client-ip=75.151.244.229; envelope-from=mwd@md5i.com; helo=md5i.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:301811 Archived-At: Eli Zaretskii writes: >> From: Davin Pearson >> Date: Fri, 23 Dec 2022 10:13:33 +1300 >> >> When I write the following code: >> >> (progn >> (setq edebug-on-error t) >> (setq edebug-all-defs t)) >> >> (defun foo () >> tomcat >> ) >> (foo) >> >> How do I invoke the edebug debugger when you get an error: > > I don't think you can. Edebug requires that you instrument the > function(s) you want to debug in advance. An approach to this is to use `M-x toggle-debug-on-error` and then run the offending command. That will get you a backtrace with which you can determine what function it is actually failing within. Then you can instrument that function with edebug, toggle debug-on-error again, and run again. -- Michael Welsh Duggan (md5i@md5i.com)