tracing all Exceptions (Re: TracedException - exception with	stacktrace information)
    Thomas Kuehne 
    thomas-dloop at kuehne.cn
       
    Sat Jan 27 11:20:00 PST 2007
    
    
  
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
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
-----BEGIN PGP SIGNATURE-----
iD8DBQFFu7GnLK5blCcjpWoRAnyJAJ0QbFVAIzbv8a6vofTd79DGzGatiQCfSS0u
YnidjSMrL+bkMesMygmm4L8=
=17ni
-----END PGP SIGNATURE-----
    
    
More information about the Digitalmars-d-announce
mailing list