From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Louis Newsgroups: gmane.emacs.help Subject: Re: Running until first unhandled error. Date: Wed, 4 Jan 2023 11:53:32 +0300 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12113"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.2.9+54 (af2080d) (2022-11-21) Cc: help-gnu-emacs@gnu.org To: Davin Pearson Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jan 04 10:42:28 2023 Return-path: Envelope-to: geh-help-gnu-emacs@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 1pD0I0-0002vm-Aw for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 04 Jan 2023 10:42:28 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pD0Gm-00031c-Gw; Wed, 04 Jan 2023 04:41:12 -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 1pD0Gk-00031G-Va for help-gnu-emacs@gnu.org; Wed, 04 Jan 2023 04:41:11 -0500 Original-Received: from stw1.rcdrun.com ([217.170.207.13]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pD0Gj-0006JQ-95 for help-gnu-emacs@gnu.org; Wed, 04 Jan 2023 04:41:10 -0500 Original-Received: from localhost ([::ffff:197.239.10.238]) (AUTH: PLAIN admin, TLS: TLS1.3,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 0000000000055D52.0000000063B549B6.00006121; Wed, 04 Jan 2023 02:41:10 -0700 Mail-Followup-To: Davin Pearson , help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=217.170.207.13; envelope-from=bugs@gnu.support; helo=stw1.rcdrun.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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:142118 Archived-At: * Davin Pearson [2023-01-04 07:27]: > I am trying to get edebug online instead of checkpointing every > second line of code and in every buffer like so to narrow down > the source of the bug, i.e. an unhandled error message. > > (message "&foo:100:") > (defun foo () > (message "&foo:101:") > (setq abc 123) > (message "&foo:102:") > (foo) > (message "&foo:103:") > (bar) > (message "&foo:104:") > (setq def 456) > (message "&foo:105:") > ) > (message "&foo:106:") > > I eval a buffer using > > (progn > (mark-whole-buffer) > (eval-buffer)) You need not mark whole buffer if you wish to eval buffer. > and it enters me into the *Debugger* as it should. > > What I want to do is to run until the next unhandled error message, > but none of the *Debugger* keys seem to do this. Please see Edebug menu. > Here are my edebug settings for you to help me debug > my code: > > (progn > (require 'debug) > (require 'edebug) > (setq edebug-all-defs t) > (setq edebug-all-forms t) > (setq edebug-on-error t) > (edebug-eval-top-level-form) > ) The above is too general, it is causing more problems than it should. No comment for above. I can tell that if there is function to debug, I use this workflow: 1. Go to `defun' or after and press C-u M-C-x as that immediately marks the function for edebug 2. When execution location comes to that function, I find myself in the function, then I press `n' to evaluate expressions one by one. 3. I may discover other function which is giving the error, at that time, go to other function and repeat steps 1, and remove the first function eventually with {M-x edebug-remove-instrumentation RET name-of-first-function RET} 4. I repeat this process until I find what is wrong. -- Jean Take action in Free Software Foundation campaigns: https://www.fsf.org/campaigns In support of Richard M. Stallman https://stallmansupport.org/