From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: How to highlight the offending line of code with edebug Date: Fri, 23 Dec 2022 10:39:50 +0200 Message-ID: <83zgbe7bu1.fsf@gnu.org> References: <83fsd68u3f.fsf@gnu.org> <87ili2o9lc.fsf@md5i.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11913"; mail-complaints-to="usenet@ciao.gmane.io" Cc: davin.pearson@gmail.com, emacs-devel@gnu.org To: Michael Welsh Duggan Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Dec 23 09:40:30 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 1p8dbR-0002vG-8O for ged-emacs-devel@m.gmane-mx.org; Fri, 23 Dec 2022 09:40:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p8db2-0004ZB-Kt; Fri, 23 Dec 2022 03:40:04 -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 1p8db1-0004Yv-5m for emacs-devel@gnu.org; Fri, 23 Dec 2022 03:40:03 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p8db0-0007iu-Pm; Fri, 23 Dec 2022 03:40:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=z0XsEfeHd25ohIJmnLB/NkvfkV70/Mcq/zCeBxl3HL8=; b=mkQ80Ev46uCw nuhuV2A9myqC6UC0aO2g04dK0o602kswutzEJt/CMsTsYu0eGpfQeK+TR+uYoB26ewX6/9XVJ2K6M IE24Pe5/24TfxHnPptc+422myQfmZ6xFukhzkNJv7wFZ1yUL87Idhhy1I5YSGOQr3qtxYBkYqwbIz XqoU3nBriLllvKveH5N0HttEsmahipjPSsBckB9rEGBTMst9LNGE9cEa7f3Na3w2pV8uFSbxYwUKZ OEFzzVqvXQ3/H3HPUtuPkS9XQSB/CahD54gz/G/RQjgC6g2JyUsigscK8qqEBcSlc9BQEmUGoraiO w4bVrHyIzQML0ZWqcy3fmQ==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p8daz-0003di-QI; Fri, 23 Dec 2022 03:40:02 -0500 In-Reply-To: <87ili2o9lc.fsf@md5i.com> (message from Michael Welsh Duggan on Fri, 23 Dec 2022 02:36:15 -0500) 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:301814 Archived-At: > From: Michael Welsh Duggan > Cc: emacs-devel@gnu.org > Date: Fri, 23 Dec 2022 02:36:15 -0500 > > Eli Zaretskii writes: > > >> 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. Yes, that's what everyone does. But note that even after instrumenting the offending function, there's AFAIK no way of asking Edebug to kick in only when the error happens. Instead, you need to step through the function and see where it signals an error.