Converting GWT Compiled JS to Readable JS

2010-02-22 Thread Mark
Hi guys, In order to track exceptions in our GWT application (client-side), we hook a global exception handler in our EntryPoint. Our exception handler builds the stack trace from the exception and sends it to our server (we have a GWT servlet to receive error messages). Now, our problem is that

Re: Converting GWT Compiled JS to Readable JS

2010-02-24 Thread Mark
Any ideas, everyone? I'm currently stuck on this. :( On Feb 22, 8:06 pm, Mark wrote: > Hi guys, > > In order to track exceptions in our GWT application (client-side), we > hook a global exception handler in our EntryPoint. Our exception > handler builds the stack trace from the exception and sen

Re: Converting GWT Compiled JS to Readable JS

2010-02-25 Thread Chris Lercher
Hi, so what you basically want to have is that gwtc saves a dictionary file during compilation that can later be used to undo the name substitution. And possibly also recreate the line numbers etc. (something that some Java obfuscators can do, e.g. I've used this functionality with Zelix Klassmast

Re: Converting GWT Compiled JS to Readable JS

2010-02-26 Thread Mark
Hi Chris, > so what you basically want to have is that gwtc saves a dictionary > file during compilation that can later be used to undo the name > substitution. And possibly also recreate the line numbers etc. > (something that some Java obfuscators can do, e.g. I've used this > functionality wit

Re: Converting GWT Compiled JS to Readable JS

2010-02-26 Thread Chris Lercher
While I have no idea about the Gwtc source code, I just browsed a little bit around in the gwt source, and I think a first attempt could be to create a dictionary by hooking into com.google.gwt.dev.js.ast.JsName.setShortIdent() This is just a wild guess, and it probably won't work very well, becau

Re: Converting GWT Compiled JS to Readable JS

2010-02-26 Thread Fabiano
It's quite complicated, and very very rough, you can add a local final string, or a local unique final numerical identifier to the critical methods (or all methods) and adding this information to the stacktarce string. something similar to: public int mymethod( long thing){ static final int l

Re: Converting GWT Compiled JS to Readable JS

2010-02-26 Thread Fabiano
I think I have posted twice but I try again to be safe: This solution sucks but you can try adding an unique identifier to your methods example: public int myMethod(long thing){ static final int localID = 33;//33 is unique identifier for Mymethod This could be a String as well, but you lost ob

Re: Converting GWT Compiled JS to Readable JS

2010-02-26 Thread Fabiano
ERROR, I cannot declare static variables into the method, please forgot about the errors above, I find very difficult to write valid code without an IDE Regards public int myMethod(long thing){ final int localID = 33;//33 is unique identifier for Mymethod This could be a String as well, but yo

Re: Converting GWT Compiled JS to Readable JS

2010-02-26 Thread Fabiano
@Chris to make things clear, my : "It's quite complicated, and very very rough," is a comment about my own proposal. -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com.

Re: Converting GWT Compiled JS to Readable JS

2010-02-26 Thread Fabiano
Another idea.. you have simply yo implement a printStackTrace method with 2 arguments in a utility class: public void printStackTrace(Exception e, int localID){ String stackTraceNew = e.getStackTrace+" ID "+localID; e.setStackTrace(stackNewTrace); e.printStackTrace(); }; you

Re: Converting GWT Compiled JS to Readable JS

2010-02-26 Thread Thomas Broyer
On 25 fév, 13:38, Chris Lercher wrote: > Hi, > > so what you basically want to have is that gwtc saves a dictionary > file during compilation that can later be used to undo the name > substitution. And possibly also recreate the line numbers etc. > (something that some Java obfuscators can do, e

Re: Converting GWT Compiled JS to Readable JS

2010-02-26 Thread Chris Lercher
On Feb 26, 5:30 pm, Thomas Broyer wrote: > Something like the -compileReport > -XsoycDetailed?http://code.google.com/webtoolkit/doc/latest/DevGuideCompileReport.html > (the page is about the -compileReport, what you're looking for is the - > XsoycDetailed which is only briefly described) Hey, I

Re: Converting GWT Compiled JS to Readable JS

2010-02-26 Thread Chris Lercher
> PS It's great, that the files are using the hash names of the > *.cash.html files, so they can be archived very easily. Did I really write "cash.html"? I need more coffee ;) -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to thi

Re: Converting GWT Compiled JS to Readable JS

2010-02-26 Thread Fabiano
On Feb 26, 5:30 pm, Thomas Broyer wrote: > On 25 fév, 13:38, Chris Lercher wrote: > Something like the -compileReport > -XsoycDetailed?http://code.google.com/webtoolkit/doc/latest/DevGuideCompileReport.html > (the page is about the -compileReport, what you're looking for is the - > XsoycDetaile

Re: Converting GWT Compiled JS to Readable JS

2010-02-27 Thread Ladislav Gazo
do you know if there is a tool that will "translate" the stack into readable form? Or is somebody going to implement it? On 26. Feb, 17:43 h., Chris Lercher wrote: > On Feb 26, 5:30 pm, Thomas Broyer wrote: > > > Something like the -compileReport > > -XsoycDetailed?http://code.google.com/webtoo

Re: Converting GWT Compiled JS to Readable JS

2010-02-27 Thread Chris Lercher
I don't know of such a tool. But if a simple search and replace on the StackTrace isn't good enough (it might not be, because the obfuscated names are very short), then there's an ANTLR grammar for parsing stack traces here: http://www.antlr.org/grammar/1205078833386/StackTraceText.g Otherwise, it

Re: Converting GWT Compiled JS to Readable JS

2010-03-01 Thread Mark
Thanks for the replies, guys. Very much helpful. :) I've started going around -compileReport and the soyc and it looks like these are what I need! I'm now implementing a crude version of our stack trace converter. :) Just one hurdle encountered so far: Stack traces from Chrome and Firefox have d

Re: Converting GWT Compiled JS to Readable JS

2010-03-02 Thread Thomas Broyer
On Mar 1, 12:35 pm, Mark wrote: > Thanks for the replies, guys. Very much helpful. :) > > I've started going around -compileReport and the soyc and it looks > like these are what I need! I'm now implementing a crude version of > our stack trace converter. :) > > Just one hurdle encountered so fa

Re: Converting GWT Compiled JS to Readable JS

2010-03-09 Thread Mark
Hi Thomas, Sorry for the late reply; other work caught up. The link you provided looks very interesting. This is probably what we need. Will take a detailed look on this. On Mar 2, 9:38 pm, Thomas Broyer wrote: > On Mar 1, 12:35 pm, Mark wrote: > > > Thanks for the replies, guys. Very much he