unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#52479: 27.2; EDebugging stops when breakpoint condition can not be printed
@ 2021-12-14 13:03 Петров Андрей
  2021-12-15  5:26 ` Michael Heerdegen
  0 siblings, 1 reply; 5+ messages in thread
From: Петров Андрей @ 2021-12-14 13:03 UTC (permalink / raw)
  To: 52479

Hello, team!
The following code can reproduce the bug:


(require 'cl-lib)
(require 'eieio)

(defclass my-field ()
  ((from-types :initform nil)
   (type :initform nil)))

(defun test ()
  "Demonstrates edebug condition printing bug.
1. evaluate the buffer
2. instrument `test' function for debugging
3. add conditional breakpoint inside lambda below (see comment)
   M-x edebug-set-conditional-breakpoint [RET] root [RET]
4. Start the function for debugging
   M-x (test)
5. Continue to the breakpoint
   c

Now error: \"Apparently circular structure being printed\" is
printed and no further debugging is possible.
"
  (let* ((root (my-field))
	 (tmp root))
    (dotimes (i 100)
      (let ((a (my-field)))
	(push a (oref tmp type))
	(push tmp (oref a from-types))
	(setf tmp a)))
    (push root (oref tmp type))    
    (cl-remove root '(1 2 3 4) :test (lambda (a b) ;; <-- put cursor here and set
				       ;; conditional breakpoint with condition: root
				       (= (length (oref a from-types))) b))
    (cl-remove root '(1 2 3 4) :test (lambda (a b) (= (length (oref a from-types))) b))
    (cl-remove root '(1 2 3 4) :test (lambda (a b) (= (length (oref a from-types))) b))
    "Finished"
    ))


It hard for me to get backtraces on the example but on other
(complicated) code I got the following using recursive edit:

Debugger entered--Lisp error: (error "Apparently circular structure being printed")
  apply(debug error (error "Apparently circular structure being printed"))
  edebug(error (error "Apparently circular structure being printed"))
  signal(error ("Apparently circular structure being printed"))
  edebug-signal(error ("Apparently circular structure being printed"))
  message("Break: %s => %s" filtered (#<field field-157aa078be4c>))
  edebug--display-1(nil 0 before)
  edebug--display(nil 0 before)
  edebug-debugger(0 before nil)
  edebug-before(0)
  (edebug-after (edebug-before 0) 11 (find-inpas-paths (edebug-after 0 1 parent) (edebug-after 0 2 stop-id) (edebug-after (edebug-before 3) 10 (if (edebug-after 0 4 filtered) (edebug-after (edebug-before 5) 8 (cl-remove (edebug-after 0 6 parent) (edebug-after 0 7 context) :count 1 :test (lambda (a b) (edebug-enter ... ... ...)))) (edebug-after 0 9 context)))))
  (lambda nil (edebug-after (edebug-before 0) 11 (find-inpas-paths (edebug-after 0 1 parent) (edebug-after 0 2 stop-id) (edebug-after (edebug-before 3) 10 (if (edebug-after 0 4 filtered) (edebug-after (edebug-before 5) 8 (cl-remove (edebug-after 0 6 parent) (edebug-after 0 7 context) :count 1 :test (lambda ... ...))) (edebug-after 0 9 context))))))()
  edebug-default-enter(edebug-anon17 (#<field field-157aa078be4c>) (lambda nil (edebug-after (edebug-before 0) 11 (find-inpas-paths (edebug-after 0 1 parent) (edebug-after 0 2 stop-id) (edebug-after (edebug-before 3) 10 (if (edebug-after 0 4 filtered) (edebug-after (edebug-before 5) 8 (cl-remove ... ... :count 1 :test ...)) (edebug-after 0 9 context)))))))
  edebug-enter(edebug-anon17 (#<field field-157aa078be4c>) (lambda nil (edebug-after (edebug-before 0) 11 (find-inpas-paths (edebug-after 0 1 parent) (edebug-after 0 2 stop-id) (edebug-after (edebug-before 3) 10 (if (edebug-after 0 4 filtered) (edebug-after (edebug-before 5) 8 (cl-remove ... ... :count 1 :test ...)) (edebug-after 0 9 context)))))))
  (lambda (parent) (edebug-enter 'edebug-anon17 (list parent) #'(lambda nil (edebug-after (edebug-before 0) 11 (find-inpas-paths (edebug-after 0 1 parent) (edebug-after 0 2 stop-id) (edebug-after ... 10 ...))))))(#<field field-157aa078be4c>)
  mapcan((lambda (parent) (edebug-enter 'edebug-anon17 (list parent) #'(lambda nil (edebug-after (edebug-before 0) 11 (find-inpas-paths (edebug-after 0 1 parent) (edebug-after 0 2 stop-id) (edebug-after ... 10 ...)))))) (#<field field-157aa078be4c>))


P.S. I could not copy the text from emacs with C-c M-i according to hint:
While in the mail buffer:

  Type C-c C-c to send the bug report.
  Type C-x k RET to cancel (don’t send it).
  Type C-c M-i to copy text to your preferred mail program.   <----


Andrey Petrov.





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-12-19 15:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-14 13:03 bug#52479: 27.2; EDebugging stops when breakpoint condition can not be printed Петров Андрей
2021-12-15  5:26 ` Michael Heerdegen
2021-12-15  7:01   ` Петров Андрей
2021-12-19 13:05   ` Lars Ingebrigtsen
2021-12-19 15:50     ` Michael Heerdegen

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).