all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kevin Rodgers <kevin.rodgers@ihs.com>
Subject: Re: debug-on-call
Date: Tue, 18 Feb 2003 11:15:22 -0700	[thread overview]
Message-ID: <3E52783A.2070408@ihs.com> (raw)
In-Reply-To: 87adhconnz.fsf@jidanni.org

[-- Attachment #1: Type: text/plain, Size: 1883 bytes --]

Dan Jacobson wrote:

>>>>>>"K" == Kevin Rodgers <kevin.rodgers@ihs.com> writes:
>>>>>>
> 
> K> Dan Jacobson wrote:
> 
>>>I wanted to have emacs stop if it ever called a function, but no:
>>>debug-on-entry: Function base64-encode-region is a primitive
>>>
>>>I don't need to debug inside that function. All I wanted was to see a
>>>backtrace so I can tell the layers of stuff calling that function.
>>>
> 
> K> (defadvice base64-encode-region (before debug activate)
> K>    "Debug (when called from an Emacs Lisp function)."
> K>    (debug))
> 
> OK, maybe this could be the guts of the new debug-on-call function, or
> at least documented as what to do when debug-on-entry isn't usable...


Please find attached a tentative user (i.e. non-integrated) implementation.

> Of course an antidote should also be provided to turn it off.


Yep, but I haven't gotten that far yet.


> P.S. Kev, your References:
> <mailman.1280.1044050572.21513.bug-gnu-emacs@gnu.org> does not give my
> original post the fame and glory of its original Message-ID causing
> its thread to be broken 'in many newsreaders'.


That's odd, google finds it under that Message-ID.  I used

	http://www.google.com/advanced_group_search?hl=en

to find

	From: Dan Jacobson <jidanni@dman.ddts.net>
	Newsgroups: gnu.emacs.bug
	Subject: debug-on-call
	Date: 01 Feb 2003 03:03:22 +0800
	Lines: 23
	Sender: news <news@main.gmane.org>
	Approved: bug-gnu-emacs@gnu.org
	Message-ID: <mailman.1280.1044050572.21513.bug-gnu-emacs@gnu.org>
	Reply-To: Dan Jacobson <jidanni@dman.ddts.net>
	NNTP-Posting-Host: monty-python.gnu.org

> Did you try reading
> this group via NNTP of gmane.org for maximal comfort?
 
I primarily read gnu.emacs.bug and only check gmane.emacs.bug (both via

NNTPSERVER=news.cis.dfn.de) to make sure I don't miss any articles.


-- 
<a href="mailto:&lt;kevin.rodgers&#64;ihs.com&gt;">Kevin Rodgers</a>

[-- Attachment #2: debug-primitive-on-entry.el --]
[-- Type: text/plain, Size: 777 bytes --]

(defadvice debug-on-entry (around advise-primitive activate)
  "If an error is signalled because FUNCTION is a primitive, query the user
whether to debug Lisp calls via `defadvice'."
  (condition-case condition-data
      ad-do-it
    (error (let ((error-message (format "Function %s is a primitive"
					(ad-get-arg 0))))
	     (if (and (equal (car (cdr condition-data)) error-message)
		      (interactive-p)
		      (yes-or-no-p
		       (concat error-message
			       "; debug Lisp calls via defadvice? ")))
		 (eval `(defadvice ,(ad-get-arg 0) (before debug activate)
			  "Debug (when called from an Emacs Lisp function)."
			  (debug)))
	       (signal 'error (cdr condition-data)))))))

;; (defadvice cancel-debug-on-entry (around advise-primitive activate)
;;   ...)

[-- Attachment #3: Type: text/plain, Size: 148 bytes --]

_______________________________________________
Bug-gnu-emacs mailing list
Bug-gnu-emacs@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-gnu-emacs

  reply	other threads:[~2003-02-18 18:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.1280.1044050572.21513.bug-gnu-emacs@gnu.org>
2003-02-03 16:52 ` debug-on-call Kevin Rodgers
2003-02-04  1:11   ` debug-on-call Dan Jacobson
2003-02-18 18:15     ` Kevin Rodgers [this message]
2003-02-19  2:48       ` message id got changed by mailman? Dan Jacobson
2003-02-19 22:09         ` Kevin Rodgers
2003-02-22  1:24           ` Dan Jacobson
2003-02-04 15:42   ` debug-on-call Richard Stallman
     [not found]   ` <mailman.1383.1044374904.21513.bug-gnu-emacs@gnu.org>
2003-02-13 19:25     ` debug-on-call Alexander Pohoyda
2003-01-31 19:03 debug-on-call Dan Jacobson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3E52783A.2070408@ihs.com \
    --to=kevin.rodgers@ihs.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.