unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* backtrace sets print-level to 3
@ 2010-09-29 22:52 Lars Magne Ingebrigtsen
  2010-09-29 22:54 ` Lars Magne Ingebrigtsen
  2010-09-30  9:19 ` Eli Zaretskii
  0 siblings, 2 replies; 10+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-09-29 22:52 UTC (permalink / raw)
  To: emacs-devel

I often get backtraces that are so truncated that I can't really use
them for anything.  Andreas pointed out that Fbacktrace sets print-level
to 3:

------
DEFUN ("backtrace", Fbacktrace, Sbacktrace, 0, 0, "",
       doc: /* Print a trace of Lisp function calls currently active.

[...]

  XSETFASTINT (Vprint_level, 3);
------

Is there any particular reason for this?  I can understand not wanting
them to be infinitely long, but 3 is very restrictive...

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

* Re: backtrace sets print-level to 3
  2010-09-29 22:52 backtrace sets print-level to 3 Lars Magne Ingebrigtsen
@ 2010-09-29 22:54 ` Lars Magne Ingebrigtsen
  2010-09-30  9:19 ` Eli Zaretskii
  1 sibling, 0 replies; 10+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-09-29 22:54 UTC (permalink / raw)
  To: emacs-devel

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> Is there any particular reason for this?  I can understand not wanting
> them to be infinitely long, but 3 is very restrictive...

It also ends with:

  Vprint_level = Qnil;

So printing a backtrace nixes out the value the user set to that value?   

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

* Re: backtrace sets print-level to 3
  2010-09-29 22:52 backtrace sets print-level to 3 Lars Magne Ingebrigtsen
  2010-09-29 22:54 ` Lars Magne Ingebrigtsen
@ 2010-09-30  9:19 ` Eli Zaretskii
  2010-09-30  9:42   ` Lars Magne Ingebrigtsen
  1 sibling, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2010-09-30  9:19 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: emacs-devel

> From: Lars Magne Ingebrigtsen <larsi@gnus.org>
> Date: Thu, 30 Sep 2010 00:52:41 +0200
> 
> I often get backtraces that are so truncated that I can't really use
> them for anything.  Andreas pointed out that Fbacktrace sets print-level
> to 3:

Can you show an example of this limitation in action?  I don't recall
having any problems with Lisp backtraces, they are certainly longer
than 3 levels.  Maybe I'm missing something.



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

* Re: backtrace sets print-level to 3
  2010-09-30  9:19 ` Eli Zaretskii
@ 2010-09-30  9:42   ` Lars Magne Ingebrigtsen
  2010-09-30 11:15     ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-09-30  9:42 UTC (permalink / raw)
  To: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

> Can you show an example of this limitation in action?  I don't recall
> having any problems with Lisp backtraces, they are certainly longer
> than 3 levels.  Maybe I'm missing something.

The following backtrace was posted on the Gnus mailing list, and all
those dots seem to indicate....  something...  I assumed print-level,
since print-length was nil:

  nnimap-insert-partial-structure((("text" "plain" ("charset" "iso-8859-1") NIL NIL "quoted-printable" 57 2 NIL "1" NIL NIL) ("message" "rfc822" NIL NIL NIL "7bit" 16383 ("Tue, 28 Sep 2010 07:40:57 -0700 (PDT)" "LinkedIn Network Updates, 9/28/2010" ... ... ... ... NIL NIL NIL "<213149815.58720010.1285684857650.JavaMail.app@ech3-cdn43.prod>") (... ... "alternative" ... NIL NIL NIL) "2" NIL ("inline" NIL) NIL NIL) "mixed" ("boundary" "=-=-=") NIL NIL NIL) (("1" "Her er problemartikkelen jeg nevnte p=E5 gnus-gruppa:\n\n")))


-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

* Re: backtrace sets print-level to 3
  2010-09-30  9:42   ` Lars Magne Ingebrigtsen
@ 2010-09-30 11:15     ` Eli Zaretskii
  2010-09-30 11:20       ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2010-09-30 11:15 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: emacs-devel

> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD
> 	autolearn=unavailable version=3.3.1
> From: Lars Magne Ingebrigtsen <larsi@gnus.org>
> Date: Thu, 30 Sep 2010 11:42:44 +0200
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > Can you show an example of this limitation in action?  I don't recall
> > having any problems with Lisp backtraces, they are certainly longer
> > than 3 levels.  Maybe I'm missing something.
> 
> The following backtrace was posted on the Gnus mailing list, and all
> those dots seem to indicate....  something...  I assumed print-level,
> since print-length was nil:
> 
>   nnimap-insert-partial-structure((("text" "plain" ("charset" "iso-8859-1") NIL NIL "quoted-printable" 57 2 NIL "1" NIL NIL) ("message" "rfc822" NIL NIL NIL "7bit" 16383 ("Tue, 28 Sep 2010 07:40:57 -0700 (PDT)" "LinkedIn Network Updates, 9/28/2010" ... ... ... ... NIL NIL NIL "<213149815.58720010.1285684857650.JavaMail.app@ech3-cdn43.prod>") (... ... "alternative" ... NIL NIL NIL) "2" NIL ("inline" NIL) NIL NIL) "mixed" ("boundary" "=-=-=") NIL NIL NIL) (("1" "Her er problemartikkelen jeg nevnte p=E5 gnus-gruppa:\n\n")))

What about eval-expression-print-length?  Could it be that it's the
one that causes the ellipsis?

Anyway, I just did a little experiment in today's bzr:

  emacs -Q
  Type (frame-parameter 'foo)
  Go to the right paren and type C-j

and got this backtrace:

Debugger entered--Lisp error: (wrong-number-of-arguments frame-parameter 1)
  (frame-parameter (quote foo))
  eval((frame-parameter (quote foo)))
  eval-last-sexp-1(t)
  eval-last-sexp(t)
  eval-print-last-sexp()
  call-interactively(eval-print-last-sexp nil nil)

This is more than 3 levels, and actually is a full backtrace, right
upto call-interactively.  So it looks like there's no stack depth
limitation at work here.



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

* Re: backtrace sets print-level to 3
  2010-09-30 11:15     ` Eli Zaretskii
@ 2010-09-30 11:20       ` Lars Magne Ingebrigtsen
  2010-09-30 12:12         ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-09-30 11:20 UTC (permalink / raw)
  To: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

> and got this backtrace:
>
> Debugger entered--Lisp error: (wrong-number-of-arguments frame-parameter 1)
>   (frame-parameter (quote foo))
>   eval((frame-parameter (quote foo)))
>   eval-last-sexp-1(t)
>   eval-last-sexp(t)
>   eval-print-last-sexp()
>   call-interactively(eval-print-last-sexp nil nil)
>
> This is more than 3 levels, and actually is a full backtrace, right
> upto call-interactively.  So it looks like there's no stack depth
> limitation at work here.

Is there anything there with more than three levels, though?

(frame-parameter '(1 (2 (3 (4)))))

Debugger entered--Lisp error: (wrong-number-of-arguments frame-parameter 1)
  (frame-parameter (quote (1 ...)))
  eval((frame-parameter (quote (1 ...))))
  eval-last-sexp-1(nil)
  eval-last-sexp(nil)
  call-interactively(eval-last-sexp nil nil)


-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

* Re: backtrace sets print-level to 3
  2010-09-30 11:20       ` Lars Magne Ingebrigtsen
@ 2010-09-30 12:12         ` Eli Zaretskii
  2010-09-30 12:35           ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2010-09-30 12:12 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: emacs-devel

> From: Lars Magne Ingebrigtsen <larsi@gnus.org>
> Date: Thu, 30 Sep 2010 13:20:50 +0200
> 
> > This is more than 3 levels, and actually is a full backtrace, right
> > upto call-interactively.  So it looks like there's no stack depth
> > limitation at work here.
> 
> Is there anything there with more than three levels, though?
> 
> (frame-parameter '(1 (2 (3 (4)))))
> 
> Debugger entered--Lisp error: (wrong-number-of-arguments frame-parameter 1)
>   (frame-parameter (quote (1 ...)))
>   eval((frame-parameter (quote (1 ...))))
>   eval-last-sexp-1(nil)
>   eval-last-sexp(nil)
>   call-interactively(eval-last-sexp nil nil)

You lost me.  What "levels" do you mean?  I meant the stack levels.

Anyway, it might be relevant that debug.el binds print-level and
pint-length to fixed numbers, see debugger-setup-buffer.



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

* Re: backtrace sets print-level to 3
  2010-09-30 12:12         ` Eli Zaretskii
@ 2010-09-30 12:35           ` Lars Magne Ingebrigtsen
  2010-09-30 13:12             ` Drew Adams
  0 siblings, 1 reply; 10+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-09-30 12:35 UTC (permalink / raw)
  To: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

>> (frame-parameter '(1 (2 (3 (4)))))
>> 
>> Debugger entered--Lisp error: (wrong-number-of-arguments frame-parameter 1)
>>   (frame-parameter (quote (1 ...)))
>>   eval((frame-parameter (quote (1 ...))))
>>   eval-last-sexp-1(nil)
>>   eval-last-sexp(nil)
>>   call-interactively(eval-last-sexp nil nil)
>
> You lost me.  What "levels" do you mean?  I meant the stack levels.

I meant print-level, which says how deep you recurse before you start
printing "...".  I think 3 is way too shallow to actually allow
debugging, as shown by the backtrace above.

> Anyway, it might be relevant that debug.el binds print-level and
> pint-length to fixed numbers, see debugger-setup-buffer.

debug.el binds print-level to 8, which is then overridden by Fbacktrace
to 3, and then set to nil.

I think I'll just fix Fbacktrace to 1) restore the previous value upon
exit instead of setting it to Qnil, and 2) use 8 instead of 3.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

* RE: backtrace sets print-level to 3
  2010-09-30 12:35           ` Lars Magne Ingebrigtsen
@ 2010-09-30 13:12             ` Drew Adams
  2010-10-01 13:12               ` Štěpán Němec
  0 siblings, 1 reply; 10+ messages in thread
From: Drew Adams @ 2010-09-30 13:12 UTC (permalink / raw)
  To: 'Lars Magne Ingebrigtsen', emacs-devel

> I think I'll just fix Fbacktrace to 1) restore the previous value upon
> exit instead of setting it to Qnil, and 2) use 8 instead of 3.

The print-(level|length) of backtraces should be under user control, i.e., at
the Lisp level or, better, interactively (e.g. option).  It should not be
hard-coded.

If we are not using the global values of `print-level' and `print-length' or,
better, similar-acting variables (options?) that are specific to backtraces, why
not?  How can a user control this aspect of the bactrace output appearance?




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

* Re: backtrace sets print-level to 3
  2010-09-30 13:12             ` Drew Adams
@ 2010-10-01 13:12               ` Štěpán Němec
  0 siblings, 0 replies; 10+ messages in thread
From: Štěpán Němec @ 2010-10-01 13:12 UTC (permalink / raw)
  To: Drew Adams; +Cc: 'Lars Magne Ingebrigtsen', emacs-devel

"Drew Adams" <drew.adams@oracle.com> writes:

>> I think I'll just fix Fbacktrace to 1) restore the previous value upon
>> exit instead of setting it to Qnil, and 2) use 8 instead of 3.
>
> The print-(level|length) of backtraces should be under user control, i.e., at
> the Lisp level or, better, interactively (e.g. option).  It should not be
> hard-coded.
>
> If we are not using the global values of `print-level' and `print-length' or,
> better, similar-acting variables (options?) that are specific to backtraces,
> why
> not?  How can a user control this aspect of the bactrace output appearance?

+1 

I've been missing something like that, too. The current restriction
seems arbitrary and makes the `debug' backtraces much less useful than
they could be.

Štěpán



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

end of thread, other threads:[~2010-10-01 13:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-29 22:52 backtrace sets print-level to 3 Lars Magne Ingebrigtsen
2010-09-29 22:54 ` Lars Magne Ingebrigtsen
2010-09-30  9:19 ` Eli Zaretskii
2010-09-30  9:42   ` Lars Magne Ingebrigtsen
2010-09-30 11:15     ` Eli Zaretskii
2010-09-30 11:20       ` Lars Magne Ingebrigtsen
2010-09-30 12:12         ` Eli Zaretskii
2010-09-30 12:35           ` Lars Magne Ingebrigtsen
2010-09-30 13:12             ` Drew Adams
2010-10-01 13:12               ` Štěpán Němec

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