[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Length of backtrace displayed by ruby

Sylvain Joyeux

4/4/2006 3:26:00 PM

Is there a way to remove the maximum backtrace length displayed by the
interpreter when an exception terminates the process ? It makes the backtrace
totally useless in situations where it is long *and* the interesting calls
are in the middle.

Thanks

Sylvain


8 Answers

Yukihiro Matsumoto

4/4/2006 3:33:00 PM

0

Hi,

In message "Re: Length of backtrace displayed by ruby"
on Wed, 5 Apr 2006 00:25:52 +0900, Sylvain Joyeux <sylvain.joyeux@polytechnique.org> writes:

|Is there a way to remove the maximum backtrace length displayed by the
|interpreter when an exception terminates the process ? It makes the backtrace
|totally useless in situations where it is long *and* the interesting calls
|are in the middle.

Not yet. Do you (or anybody else) have any good API suggestion?

matz.


Ara.T.Howard

4/4/2006 3:46:00 PM

0

Jim Weirich

4/4/2006 5:26:00 PM

0

Sylvain Joyeux wrote:
> Is there a way to remove the maximum backtrace length displayed by the
> interpreter when an exception terminates the process ? It makes the
> backtrace
> totally useless in situations where it is long *and* the interesting
> calls
> are in the middle.

IIRC, this only happens when the exception is handled by the top level
interpreter. If you catch the exception yourself at the top level you
can print out whatever you want, including the full stack trace.

--
-- Jim Weirich

--
Posted via http://www.ruby-....


Christian Neukirchen

4/4/2006 9:18:00 PM

0

Yukihiro Matsumoto <matz@ruby-lang.org> writes:

> Hi,
>
> In message "Re: Length of backtrace displayed by ruby"
> on Wed, 5 Apr 2006 00:25:52 +0900, Sylvain Joyeux <sylvain.joyeux@polytechnique.org> writes:
>
> |Is there a way to remove the maximum backtrace length displayed by the
> |interpreter when an exception terminates the process ? It makes the backtrace
> |totally useless in situations where it is long *and* the interesting calls
> |are in the middle.
>
> Not yet. Do you (or anybody else) have any good API suggestion?
>
> matz.

How about giving a full backtrace with ruby -d?

--
Christian Neukirchen <chneukirchen@gmail.com> http://chneuk...


Stephen Kellett

4/4/2006 9:45:00 PM

0

In message <Pine.LNX.4.62.0604040944090.5852@harp.ngdc.noaa.gov>,
ara.t.howard@noaa.gov writes
>On Wed, 5 Apr 2006, Yukihiro Matsumoto wrote:
>> Not yet. Do you (or anybody else) have any good API suggestion?
>
> Exception.backtrace_display_limit = 42

Exception.setFilter(regularExpression)

where the matching items are removed from the backtrace.

Stephen
--
Stephen Kellett
Object Media Limited http://www.objmedia.demon.co.uk/sof...
Computer Consultancy, Software Development
Windows C++, Java, Assembler, Performance Analysis, Troubleshooting

Ara.T.Howard

4/4/2006 10:12:00 PM

0

Sylvain Joyeux

4/5/2006 5:44:00 AM

0

> IIRC, this only happens when the exception is handled by the top level
> interpreter. If you catch the exception yourself at the top level you
> can print out whatever you want, including the full stack trace.
Yes, that's what I did as a workaround. But you have to do it for every
thread and every fork (which in my case is 4 different places)
--
Sylvain Joyeux


Stephen Kellett

4/5/2006 9:30:00 AM

0

In message <Pine.LNX.4.62.0604041611040.5852@harp.ngdc.noaa.gov>,
ara.t.howard@noaa.gov writes
>> Exception.setFilter(regularExpression)
>>
>> where the matching items are removed from the backtrace.
>
>what would be matched?
>
> e.to_s, e.message.to_s, or e.backtrace.any?{|b|}

Class and method name was what I was thinking of.
--
Stephen Kellett
Object Media Limited http://www.objmedia.demon.co.uk/sof...
Computer Consultancy, Software Development
Windows C++, Java, Assembler, Performance Analysis, Troubleshooting