unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#7825: Cannot return from the debugger
@ 2011-01-11 21:32 Stefan Monnier
  2011-01-12  5:17 ` Richard Stallman
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2011-01-11 21:32 UTC (permalink / raw)
  To: 7825

Package: Emacs
Version: 24.0.50

The limitation that we "Cannot return from the debugger in an error",
is a bug: we should be able to continue (i.e. run the code of the
corresponding error handler), just as if the debugger had not been invoked.


        Stefan




In GNU Emacs 24.0.50.1 (i686-pc-linux-gnu, GTK+ Version 2.20.1)
 of 2010-11-09 on faina
Windowing system distributor `The X.Org Foundation', version 11.0.10707000
configured using `configure  'CFLAGS=-Wall -Wno-pointer-sign -DUSE_LISP_UNION_TYPE -DSYNC_INPUT -DENABLE_CHECKING -DXASSERTS -DFONTSET_DEBUG -g -O1 -I/usr/include/GNUstep' 'LDFLAGS=-L/home/monnier/src/Xaw3d' 'CPPFLAGS=-I/home/monnier/src/Xaw3d' '--enable-maintainer-mode''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: fr_CH.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Emacs-Lisp

Minor modes in effect:
  shell-dirtrack-mode: t
  diff-auto-refine-mode: t
  outline-minor-mode: t
  flyspell-mode: t
  eldoc-mode: t
  checkdoc-minor-mode: t
  electric-pair-mode: t
  electric-indent-mode: t
  url-handler-mode: t
  global-reveal-mode: t
  reveal-mode: t
  auto-insert-mode: t
  savehist-mode: t
  minibuffer-electric-default-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<select-window> <switch-frame> <select-window> <switch-frame> 
<select-window> <switch-frame> <switch-frame> <select-window> 
<switch-frame> <switch-frame> <select-window> <switch-frame> 
<select-window> <switch-frame> <switch-frame> <select-window> 
<switch-frame> <switch-frame> <select-window> <switch-frame> 
<select-window> <switch-frame> <select-window> <switch-frame> 
<switch-frame> <select-window> <switch-frame> <switch-frame> 
<select-window> <switch-frame> <switch-frame> <select-window> 
<switch-frame> <switch-frame> <select-window> <switch-frame> 
<select-window> <switch-frame> <switch-frame> <select-window> 
<switch-frame> <switch-frame> <select-window> <switch-frame> 
<select-window> <switch-frame> <select-window> <switch-frame> 
<select-window> <switch-frame> <select-window> <switch-frame> 
<select-window> <switch-frame> <select-window> <switch-frame> 
<select-window> <switch-frame> <switch-frame> <select-window> 
<switch-frame> <select-window> f C-a C-k C-y <return> 
M-< C-e C-a <help-echo> <down-mouse-1> <mouse-2> C-e 
C-c @ C-a <down-mouse-5> <mouse-5> <down-mouse-5> <mouse-5> 
<down-mouse-5> <mouse-5> <down-mouse-5> <mouse-5> <down-mouse-5> 
<mouse-5> <down-mouse-5> <mouse-5> <down-mouse-5> <mouse-5> 
<down-mouse-5> <mouse-5> <double-down-mouse-5> <double-mouse-5> 
<down-mouse-5> <mouse-5> <switch-frame> <select-window> 
<switch-frame> <select-window> <switch-frame> <select-window> 
<switch-frame> <select-window> <switch-frame> <select-window> 
<switch-frame> <select-window> <switch-frame> <select-window> 
<switch-frame> <select-window> <switch-frame> <select-window> 
<switch-frame> <switch-frame> <select-window> <switch-frame> 
<select-window> <switch-frame> <select-window> <switch-frame> 
<select-window> <down-mouse-1> <mouse-movement> <mouse-1> 
M-d m e s s a g e <down> <down> <down> <down> <down> 
<left> <left> <M-backspace> m e s s C-/ C-/ C-/ C-/ 
C-a C-M-u C-M-u C-M-u C-M-u C-M-u C-M-u C-M-u <switch-frame> 
<select-window> <switch-frame> <select-window> <switch-frame> 
<select-window> <switch-frame> <select-window> <switch-frame> 
<help-echo> <down-mouse-1> <mouse-2> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <up> <left> <right> <up> <left> 
<right> <right> <right> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> C-h f <return> 
<switch-frame> <select-window> <switch-frame> <select-window> 
<switch-frame> <select-window> <help-echo> <down-mouse-1> 
<mouse-2> <switch-frame> <select-window> <switch-frame> 
<select-window> <switch-frame> <select-window> <switch-frame> 
<select-window> <switch-frame> <select-window> <switch-frame> 
<select-window> <switch-frame> <switch-frame> <select-window> 
<switch-frame> <select-window> <switch-frame> <select-window> 
<switch-frame> <select-window> <switch-frame> <select-window> 
<switch-frame> <select-window> <switch-frame> <switch-frame> 
<switch-frame> <select-window> <switch-frame> <select-window> 
<switch-frame> <select-window> <switch-frame> <select-window> 
<switch-frame> <select-window> <switch-frame> <select-window> 
<switch-frame> <select-window> <switch-frame> <select-window> 
<switch-frame> <select-window> c <switch-frame> <switch-frame> 
<switch-frame> <select-window> <switch-frame> <switch-frame> 
<select-window> <switch-frame> <switch-frame> <select-window> 
<switch-frame> <select-window> <switch-frame> <select-window> 
<switch-frame> <select-window> <switch-frame> <select-window> 
<switch-frame> <select-window> <switch-frame> M-x r 
e p o r t - e m <tab> <return>

Recent messages:
Mark set [2 times]
Error during redisplay: (args-out-of-range 12341677 12387528)
Contacting host: bazaar.launchpad.net:80 [3 times]
Note: file is write protected
Entering debugger...
Mark set
Undo! [4 times]
Auto-saving...
Continuing.
Entering debugger...

Load-path shadows:
/usr/share/emacs23/site-lisp/bbdb/bbdb-com hides /usr/share/emacs/site-lisp/bbdb/lisp/bbdb-com
/usr/share/emacs23/site-lisp/bbdb/bbdb-ftp hides /usr/share/emacs/site-lisp/bbdb/lisp/bbdb-ftp
/usr/share/emacs23/site-lisp/bbdb/bbdb-rmail hides /usr/share/emacs/site-lisp/bbdb/lisp/bbdb-rmail
/usr/share/emacs23/site-lisp/bbdb/bbdb-mhe hides /usr/share/emacs/site-lisp/bbdb/lisp/bbdb-mhe
/usr/share/emacs23/site-lisp/bbdb/bbdb-gui hides /usr/share/emacs/site-lisp/bbdb/lisp/bbdb-gui
/usr/share/emacs23/site-lisp/bbdb/bbdb-print hides /usr/share/emacs/site-lisp/bbdb/lisp/bbdb-print
/usr/share/emacs23/site-lisp/bbdb/bbdb hides /usr/share/emacs/site-lisp/bbdb/lisp/bbdb
/usr/share/emacs23/site-lisp/bbdb/bbdb-w3 hides /usr/share/emacs/site-lisp/bbdb/lisp/bbdb-w3
/usr/share/emacs23/site-lisp/bbdb/bbdb-sc hides /usr/share/emacs/site-lisp/bbdb/lisp/bbdb-sc
/usr/share/emacs23/site-lisp/bbdb/bbdb-whois hides /usr/share/emacs/site-lisp/bbdb/lisp/bbdb-whois
/usr/share/emacs23/site-lisp/bbdb/bbdb-snarf hides /usr/share/emacs/site-lisp/bbdb/lisp/bbdb-snarf
/usr/share/emacs23/site-lisp/bbdb/bbdb-merge hides /usr/share/emacs/site-lisp/bbdb/lisp/bbdb-merge
/usr/share/emacs23/site-lisp/bbdb/bbdb-vm hides /usr/share/emacs/site-lisp/bbdb/lisp/bbdb-vm
/usr/share/emacs23/site-lisp/bbdb/bbdb-migrate hides /usr/share/emacs/site-lisp/bbdb/lisp/bbdb-migrate
/usr/share/emacs23/site-lisp/bbdb/bbdb-gnus hides /usr/share/emacs/site-lisp/bbdb/lisp/bbdb-gnus
/usr/share/emacs23/site-lisp/bbdb/bbdb-hooks hides /usr/share/emacs/site-lisp/bbdb/lisp/bbdb-hooks

Features:
(mail-extr emacsbug message sendmail rfc822 mml mml-sec mailabbrev
mailheader mm-decode mm-bodies mm-encode url-cache url-dav xml
mail-utils url-http tls url url-proxy url-privacy url-history mailcap
url-auth mail-parse rfc2231 rfc2047 rfc2045 ietf-drums url-cookie url-gw
url-expand url-methods url-util etags reftex-parse autorevert doc-view
jka-compr image-mode dired format-spec bibtex-style bibtex reftex-vcr
reftex-dcr reftex reftex-vars tex-mode shell latexenc cal-china lunar
solar cal-dst cal-bahai cal-islam cal-hebrew holidays hol-loaddefs
cal-french diary-lib diary-loaddefs mule-util cal-move cal-menu calendar
cal-loaddefs log-edit pcvs-util whitespace sort mpc skeleton smie
dabbrev modula2 parse-time autoconf autoconf-mode nroff-mode make-mode
conf-mode nxml-uchnm rng-xsd xsd-regexp rng-cmpct rng-nxml rng-valid
rng-loc rng-uri rng-parse nxml-parse rng-match rng-dt rng-util rng-pttrn
nxml-ns nxml-mode nxml-outln nxml-rap nxml-util nxml-glyph nxml-enc
xmltok sh-script completion hideif cpp cmacexp texinfo add-log
smerge-mode diff-mode cc-mode cc-fonts cc-menus cc-cmds cc-styles
cc-align cc-engine cc-vars cc-defs pcase macroexp compile bzrmerge
cl-specs debug vc-sccs vc-svn vc-cvs vc-rcs vc-dir ewoc vc vc-dispatcher
multi-isearch executable copyright xscheme warnings trace testcover
scheme byte-opt unsafep re-builder shadow inf-lisp ielm pp comint ring
gmm-utils find-func elp edebug cust-print bytecomp byte-compile cus-edit
cus-start cus-load wid-edit vc-bzr sha1 hex-util filecache server
noutline outline easy-mmode flyspell ispell eldoc checkdoc regexp-opt
thingatpt help-mode easymenu view prog-mode electric url-handlers
url-parse auth-source netrc gnus-util url-vars mm-util mail-prsvr reveal
autoinsert uniquify advice help-fns advice-preload savehist
minibuf-eldef cl cl-loaddefs proof-site proof-autoloads pg-vars
bbdb-autoloads agda2 tooltip ediff-hook vc-hooks lisp-float-type mwheel
x-win x-dnd tool-bar dnd fontset image fringe lisp-mode register page
newcomment menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock
font-lock syntax font-core frame cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs
button faces cus-face files text-properties overlay md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
make-network-process dbusbind dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)





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

* bug#7825: Cannot return from the debugger
  2011-01-11 21:32 bug#7825: Cannot return from the debugger Stefan Monnier
@ 2011-01-12  5:17 ` Richard Stallman
  2011-01-12  9:04   ` Štěpán Němec
  2011-01-12 14:53   ` Stefan Monnier
  0 siblings, 2 replies; 9+ messages in thread
From: Richard Stallman @ 2011-01-12  5:17 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 7825

    The limitation that we "Cannot return from the debugger in an error",
    is a bug: we should be able to continue (i.e. run the code of the
    corresponding error handler), just as if the debugger had not been invoked.

That is fine in theory, but it would imply that any place that can get
an error can also GC.

If we make GCPRO a no-op on all platforms, allowing those places to GC
may not require massive changes.  But lots of places in the C code
would still have to be checked for possible bugs.

I don't remember how string relocation works nowadays.  It used to be
the case that many places in the C code had char * pointers into Lisp
strings, which could be invalidated by a GC.  If this is still an
issue, then keeping such a pointer across something that reports an
error would be a bug.


-- 
Richard Stallman
President, Free Software Foundation
51 Franklin St
Boston MA 02110
USA
www.fsf.org, www.gnu.org





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

* bug#7825: Cannot return from the debugger
  2011-01-12  5:17 ` Richard Stallman
@ 2011-01-12  9:04   ` Štěpán Němec
  2011-01-12  9:41     ` Andreas Schwab
  2011-01-12 14:53   ` Stefan Monnier
  1 sibling, 1 reply; 9+ messages in thread
From: Štěpán Němec @ 2011-01-12  9:04 UTC (permalink / raw)
  To: rms; +Cc: 7825, Stefan Monnier

Richard Stallman <rms@gnu.org> writes:

>     The limitation that we "Cannot return from the debugger in an error",
>     is a bug: we should be able to continue (i.e. run the code of the
>     corresponding error handler), just as if the debugger had not been invoked.
>
> That is fine in theory, but it would imply that any place that can get
> an error can also GC.
>
> If we make GCPRO a no-op on all platforms, allowing those places to GC
> may not require massive changes.  But lots of places in the C code
> would still have to be checked for possible bugs.
>
> I don't remember how string relocation works nowadays.  It used to be
> the case that many places in the C code had char * pointers into Lisp
> strings, which could be invalidated by a GC.  If this is still an
> issue, then keeping such a pointer across something that reports an
> error would be a bug.

I'm not sure I understand what you two are saying or how that relates to
the problem at hand, but what a decent Lisp system usually does when an
error happens inside the debugger is just add another debugging layer on
the stack, i.e. start the debugger on the "newer" error; then when you
exit the inner level, you end up back debugging the outer level. Why is
that not the case in Emacs? The "Cannot return from the debugger in an
error" thing has always annoyed me, too.

  Štěpán





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

* bug#7825: Cannot return from the debugger
  2011-01-12  9:04   ` Štěpán Němec
@ 2011-01-12  9:41     ` Andreas Schwab
  2011-01-12  9:56       ` Štěpán Němec
  0 siblings, 1 reply; 9+ messages in thread
From: Andreas Schwab @ 2011-01-12  9:41 UTC (permalink / raw)
  To: Štěpán Němec; +Cc: 7825, rms, Stefan Monnier

Štěpán Němec <stepnem@gmail.com> writes:

> I'm not sure I understand what you two are saying or how that relates to
> the problem at hand, but what a decent Lisp system usually does when an
> error happens inside the debugger is just add another debugging layer on
> the stack, i.e. start the debugger on the "newer" error; then when you
> exit the inner level, you end up back debugging the outer level.

That's not returning from the debugger, that's throwing to some outer
level, i.e. the context of the error is destroyed in any case.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."





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

* bug#7825: Cannot return from the debugger
  2011-01-12  9:41     ` Andreas Schwab
@ 2011-01-12  9:56       ` Štěpán Němec
  2011-03-09 23:18         ` Glenn Morris
  0 siblings, 1 reply; 9+ messages in thread
From: Štěpán Němec @ 2011-01-12  9:56 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: 7825, rms, Stefan Monnier

Andreas Schwab <schwab@linux-m68k.org> writes:

> Štěpán Němec <stepnem@gmail.com> writes:
>
>> I'm not sure I understand what you two are saying or how that relates to
>> the problem at hand, but what a decent Lisp system usually does when an
>> error happens inside the debugger is just add another debugging layer on
>> the stack, i.e. start the debugger on the "newer" error; then when you
>> exit the inner level, you end up back debugging the outer level.
>
> That's not returning from the debugger, that's throwing to some outer
> level, i.e. the context of the error is destroyed in any case.

Yes. What I was trying to say is that when you're doing something inside
the debugger and an error occurs, another debugger (level) should be
started instead of invalidating what you had been doing. The case I bump
into most often is stepping in Edebug -- when an error occurs, it is
just displayed in the message area, followed by "Cannot return from the
debugger in an error", and that's it, no matter what your
`debug-on-error' settings were.

  Štěpán





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

* bug#7825: Cannot return from the debugger
  2011-01-12  5:17 ` Richard Stallman
  2011-01-12  9:04   ` Štěpán Němec
@ 2011-01-12 14:53   ` Stefan Monnier
  2011-01-13  3:04     ` Richard Stallman
  1 sibling, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2011-01-12 14:53 UTC (permalink / raw)
  To: rms; +Cc: 7825

>     The limitation that we "Cannot return from the debugger in an
>     error", is a bug: we should be able to continue (i.e. run the code
>     of the corresponding error handler), just as if the debugger had
>     not been invoked.

> That is fine in theory, but it would imply that any place that can get
> an error can also GC.

I'm not sure I understand: "continuing from an error" would simply throw
to the error handler up the stack, which is not fundamentally different
from what we currently do (except we currently throw up to the
"top-level" rather than some intermediate error handler).


        Stefan





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

* bug#7825: Cannot return from the debugger
  2011-01-12 14:53   ` Stefan Monnier
@ 2011-01-13  3:04     ` Richard Stallman
  0 siblings, 0 replies; 9+ messages in thread
From: Richard Stallman @ 2011-01-13  3:04 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 7825

    I'm not sure I understand: "continuing from an error" would simply throw
    to the error handler up the stack,

Sorry, I misunderstood and thought this was about continuing
or returning from the debugger.

Going to the error handler seems harmless.


-- 
Richard Stallman
President, Free Software Foundation
51 Franklin St
Boston MA 02110
USA
www.fsf.org, www.gnu.org





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

* bug#7825: Cannot return from the debugger
  2011-01-12  9:56       ` Štěpán Němec
@ 2011-03-09 23:18         ` Glenn Morris
  2011-03-10  2:10           ` Stefan Monnier
  0 siblings, 1 reply; 9+ messages in thread
From: Glenn Morris @ 2011-03-09 23:18 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 7825


I think you implemented this, didn't you? Ie, this can be closed.





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

* bug#7825: Cannot return from the debugger
  2011-03-09 23:18         ` Glenn Morris
@ 2011-03-10  2:10           ` Stefan Monnier
  0 siblings, 0 replies; 9+ messages in thread
From: Stefan Monnier @ 2011-03-10  2:10 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 7825-done

> I think you implemented this, didn't you? Ie, this can be closed.

Yes, indeed, thank you,


        Stefan





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

end of thread, other threads:[~2011-03-10  2:10 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-11 21:32 bug#7825: Cannot return from the debugger Stefan Monnier
2011-01-12  5:17 ` Richard Stallman
2011-01-12  9:04   ` Štěpán Němec
2011-01-12  9:41     ` Andreas Schwab
2011-01-12  9:56       ` Štěpán Němec
2011-03-09 23:18         ` Glenn Morris
2011-03-10  2:10           ` Stefan Monnier
2011-01-12 14:53   ` Stefan Monnier
2011-01-13  3:04     ` Richard Stallman

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).