Subject: bug#12500: 24.2.50; (search-failed "\n debug(") in debugger

From: Helmut Eller <[email-masked]>
Date: Mon, 24 Sep 2012 08:34:29 +0200

When stepping, the (search-forward "\n  debug(") in
debugger-setup-buffer sometimes fails.  To reproduce this 

1. eval this

  (progn
   (defun foo ()
     (debug nil 1)
     (debug nil 2))
   (setq toggle-debug-on-error t)
   (foo))

2. The debugger pops up with the message:
   Debugger entered: (1)
     foo()

3. At the line with foo(), press d (i.e. debugger-step-through).

4. Now the buffer starts with:
   Debugger entered--beginning evaluation of function call form:
   * (debug nil 2)

5. Now press c (i.e. debugger-continue) on the line with the *.

6. The debugger enters recursively with the error:
   Debugger entered--Lisp error: (search-failed "\n debug(")

In GNU Emacs 24.2.50.1 (i686-pc-linux-gnu, GTK+ Version 2.20.1)
 of 2012-09-22 on ix
Bzr revision: 110128 [email-masked]
Windowing system distributor `The X.Org Foundation', version 11.0.10707000
Configured using:
 `configure '--with-jpeg=no' '--with-gif=no' '--with-tiff=no''