Jump to page: 1 2
Thread overview
TracedException - exception with stacktrace information
Jan 26, 2007
Thomas Kuehne
Jan 26, 2007
Sean Kelly
Jan 26, 2007
kris
tracing all Exceptions (Re: TracedException - exception with stacktrace information)
Jan 27, 2007
Thomas Kuehne
Feb 07, 2007
Dejan Lekic
Feb 07, 2007
torhu
Feb 07, 2007
Charlie
Feb 07, 2007
Lars Ivar Igesund
Feb 08, 2007
Derek Parnell
Feb 08, 2007
Bill Baxter
January 26, 2007
Flectioned now includes a TracedException class that provides stack trace information.

sample:
# import cn.kuehne.flectioned;
#
# class MyException : TracedException{
#    this(char[] message){
#       super(message);
#    }
# }
#
# void foo(int i){
#    if(i > 0) {
#       foo(i - 1);
#    } else {
#       throw new MyException("message");
#    }
# }
#
# void main(){
#    foo(2);
# }

# Error: (sample.MyException) message
#    0xFC8967F0   0x804F612   void sample.foo(int)
#    0xFC8967F8   0x804F5F1   void sample.foo(int)
#    0xFC896800   0x804F5F1   void sample.foo(int)
#    0xFC896808   0x804F629   int main(char[][])
#    0xFC896838   0x8050E7F   extern(C) int main(int, char**)

Flectioned:
http://flectioned.kuehne.cn

Thomas


January 26, 2007
Thomas Kuehne wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Flectioned now includes a TracedException class that provides stack
> trace information.
> 
> sample:
> # import cn.kuehne.flectioned;
> # # class MyException : TracedException{
> #    this(char[] message){
> #       super(message);
> #    }
> # }
> # # void foo(int i){
> #    if(i > 0) {
> #       foo(i - 1);
> #    } else {
> #       throw new MyException("message");
> #    }
> # }
> # # void main(){
> #    foo(2);
> # }
> 
> # Error: (sample.MyException) message
> #    0xFC8967F0   0x804F612   void sample.foo(int)
> #    0xFC8967F8   0x804F5F1   void sample.foo(int)
> #    0xFC896800   0x804F5F1   void sample.foo(int)
> #    0xFC896808   0x804F629   int main(char[][])
> #    0xFC896838   0x8050E7F   extern(C) int main(int, char**)
> 
> Flectioned:
> http://flectioned.kuehne.cn

Well I'm sold.  Great work!


Sean
January 26, 2007
Thomas Kuehne wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Flectioned now includes a TracedException class that provides stack
> trace information.
> 
> sample:
> # import cn.kuehne.flectioned;
> # # class MyException : TracedException{
> #    this(char[] message){
> #       super(message);
> #    }
> # }
> # # void foo(int i){
> #    if(i > 0) {
> #       foo(i - 1);
> #    } else {
> #       throw new MyException("message");
> #    }
> # }
> # # void main(){
> #    foo(2);
> # }
> 
> # Error: (sample.MyException) message
> #    0xFC8967F0   0x804F612   void sample.foo(int)
> #    0xFC8967F8   0x804F5F1   void sample.foo(int)
> #    0xFC896800   0x804F5F1   void sample.foo(int)
> #    0xFC896808   0x804F629   int main(char[][])
> #    0xFC896838   0x8050E7F   extern(C) int main(int, char**)
> 
> Flectioned:
> http://flectioned.kuehne.cn
> 
> Thomas

This is just awesome! Very nice, thomasK :)
January 27, 2007
If you compile with -version=TraceAllExceptions all Exceptions(object.Exception and derived classes) will be traced.

sample:
# import cn.kuehne.flectioned;
# import std.utf, std.stdio;
#
# void main(){
#    try{
#       toUTF16("a\xFFb"c);
#    }catch(Exception e){
#	writefln("(%s) %s", e.classinfo.name, e);
#       foreach(step; TracedException.retraced[e]){
#          writefln("%s", step);
#       }
#    }
# }

dmd -version=TraceAllExceptions sample.d && ./sample

# (std.utf.UtfException) 4invalid UTF-8 sequence
# 0xFFCA5438      0x8061716       dchar std.utf.decode(char[], uint*)
# 0xFFCA546C      0x8061E09       wchar[] std.utf.toUTF16(char[])
# 0xFFCA54A8      0x804ADF6       int main(char[][])
# 0xFFCA54D8      0x80513AF       extern(C) int main(int, char**)

Flectioned:
http://flectioned.kuehne.cn

PAX users:
Please set NOMPROTECT e.g. via "paxctl -m sample".

Thomas


February 07, 2007
Good work Mr. Kuehne!
I would like to see this in phobos (I hope Mr. Bright is reading this thread :)
February 07, 2007
Dejan Lekic wrote:
> Good work Mr. Kuehne!
> I would like to see this in phobos (I hope Mr. Bright is reading this thread :)

It sure would be nice to have a stack trace printed by default.  Most of the time I fire up windbg with D, it's to trace an Access Violation. This would make debugging D apps ten times faster.  And much less painful.

Why not incorporate that backtrace patch someone posted into Phobos?
February 07, 2007
Shinh's only works on win32 , its still very useful , but this code works on linux + win32.

I'd really love to see this for tango also.

Charlie

torhu wrote:
> Dejan Lekic wrote:
>> Good work Mr. Kuehne!
>> I would like to see this in phobos (I hope Mr. Bright is reading this thread :)
> 
> It sure would be nice to have a stack trace printed by default.  Most of the time I fire up windbg with D, it's to trace an Access Violation. This would make debugging D apps ten times faster.  And much less painful.
> 
> Why not incorporate that backtrace patch someone posted into Phobos?
February 07, 2007
Charlie wrote:

> Shinh's only works on win32 , its still very useful , but this code works on linux + win32.
> 
> I'd really love to see this for tango also.
> 
> Charlie

We are planning to add this in the 0.96 timeframe, but are dependant on Thomas porting it to Tango for us :)

-- 
Lars Ivar Igesund
blog at http://larsivi.net
DSource & #D: larsivi
Dancing the Tango
February 08, 2007
"torhu" <fake@address.dude> wrote in message news:eqd3ss$f6e$1@digitaldaemon.com...

> Why not incorporate that backtrace patch someone posted into Phobos?

Because nothing that anyone writes for Phobos ever seems to make it in.  :\

(A notable exception would be std.cpuid.)


February 08, 2007
On Wed, 7 Feb 2007 19:37:15 -0500, Jarrett Billingsley wrote:

> "torhu" <fake@address.dude> wrote in message news:eqd3ss$f6e$1@digitaldaemon.com...
> 
>> Why not incorporate that backtrace patch someone posted into Phobos?
> 
> Because nothing that anyone writes for Phobos ever seems to make it in.  :\
> 
> (A notable exception would be std.cpuid.)

Well... I did manage to get a change to the GC incorporated (setting array.length = 0 no longer invalidates the allocated RAM), so keep on lobbying <G>.

-- 
Derek
(skype: derek.j.parnell)
Melbourne, Australia
"Justice for David Hicks!"
8/02/2007 11:39:33 AM
« First   ‹ Prev
1 2