On Sunday, August 3, 2014 11:56:49 PM UTC+2, Magnus wrote:
To debug the JavaScript in your browser you can either use your browsers dev tools or try using the experimental SDBG plugin for eclipse. When you use your browsers dev tools then you have to set breakpoints inside the browser, when you use SDBG you can set them in eclipse. It is important to understand that in both cases you are debugging JavaScript and not Java.Indeed, when I open the dev tools in chrome (F12) and go to the "Sources" tab, I can open a lot of JS code and I can set breakpoints there. But I cannot see which JS code corresponds to the Java code that I want to analyze.
This is because you need Source Maps. It's possible to get them to work in "prod mode", as can be seen on gwtproject.org, but it requires few tricks at build and packaging time. The easiest way is to use Super Dev Mode, which sets everything up automatically.
A quick note: on gwtproject.org, open Chrome dev tools, go to the Sources tab, hit Ctrl+O and select GWTProjectEntryPoint.java. You can then set breakpoints in the Java code and see them being hit (some might require you reload the page).
Even if I compile in "pretty" mode, I cannot see any correspondence. I think you have to know JS
Let's be honest: if you think you can build a web app without knowing JS, you're lying to yourself.
You can do many things with GWT without knowing JS, but you'll eventually have to know about it.
With the help of SourceMaps (supported in IE11, FF, Chrome and I think latest Opera) the JavaScript will be mapped back to Java statements so you can more easily understand which Java code corresponds to the JavaScript code.How does this work? Can you open Java sources and set breakpoints there then?
Yes.
Is this the preferred way of debugging GWT code in SDM?
Yes (not only the "preferred way", but The way)
Will the eclipse integrated debugging return with a later GWT version?
DevMode won't come back in browsers that killed support for it.
But if you're looking for Eclipse integration (rather than running Java code in the JVM rather than compiled to JS), then have a look at SDBG. https://sdbg.github.io/
In any case, you won't get "watch expressions" (or similar) working.
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment