How can I find JSNI code in Firebug or Chrome?

236 views
Skip to first unread message

walker1c

unread,
May 11, 2012, 5:41:05 AM5/11/12
to Google Web Toolkit
Hi,

I am trying to debug a JSNI method while running in Development
Mode.

Can anyone tell me how to locate the JSNI code in a Javascript
debugger? I have tried using the script search feature in both
Firebug and Chrome to look for words that are part of the JSNI code,
but neither seems to be able to find anything. I have also tried
browsing through the script files in the debuggers, but there seems to
be very little script available.

I usually avoid this problem by putting all the native Javascript into
a script file and restricting JSNI to shell methods that call
functions in the script file, but on this occasion it isn't possible.

Thanks,

Chris

Thomas Broyer

unread,
May 11, 2012, 6:31:07 AM5/11/12
to google-we...@googlegroups.com
If you have an exception in JSNI code, you can ask Chrome to "stop on all exceptions", and you'll see your JSNI code and will be able to step within it.
You can also try to "pause script execution".

monkeyboy

unread,
May 11, 2012, 7:02:05 AM5/11/12
to google-we...@googlegroups.com
If You use Chrome You can try the following (works for me anyway): First you start debugging in Development mode and put a breakpoint at the JSNI method. When the breakpoint is hit then switch to the Chrome browser and open the developers tools (Shift+Ctrl+I) then go to the scripts tab and click on the "Pause script execution" button (F8). You now should see the "Pausing..." text at the right side of that toolbar. Now switch back to the IDE and resume the execution of the app from the breakpoint. Now, Switch back to the browser et voila: You should see the javaScript code of your JSNI method and the execution is paused at the beginning of the method.

HTH

 On Friday, May 11, 2012 11:41:05 AM UTC+2, walker1c wrote:

Chris Price

unread,
May 11, 2012, 10:50:24 AM5/11/12
to google-we...@googlegroups.com
I tend to use the debugger keyword in thejsni method and then hit the
page with the developer tools open.

https://developer.mozilla.org/en/JavaScript/Reference/Statements/debugger
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-web-toolkit/-/296dIHXrCvwJ.
>
> To post to this group, send email to google-we...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-web-tool...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
Reply all
Reply to author
Forward
0 new messages