yinxianwei / chromedevtools

Automatically exported from code.google.com/p/chromedevtools
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Exception when debugging local files (Juno) #74

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
SDK/Debugger version: Version: 0.3.6.201207090605
ChromeDevTools SDK WIP Backends: 0.1.8.201207090606
Eclipse version: (Juno JEE)
    Eclipse IDE for Java EE Developers: 1.5.0.20120614-1633
    Eclipse Platform: 4.2.0.v20120608-135145-9JF7BHV8FyMteji0Oi_ePMz0xuZ8TVo7lV0z0ecb 
Google Chrome/V8 Embedder + version: 21.0.1180.89 m
[For WebKit (WIP) protocol] Backend version: (WK@118685)
   Google Chrome/Chromium: 21.0.1180.*
   WebKit revision: 118685
OS + version: Windows 7 SP1 (versoin 6.1 build 7601)

What steps will reproduce the problem?
1. Install the plugin (all 3 sub components)
2. Create new WebKit Protocol Debug configuration
3. Add source folder above the "Default" 
4. Install breakpoint in local file (x.js)
5. Launch browser, breakpoint hits 

What is the expected result?

Breakpoints opens the x.js file, not in x.js.chromium without an issue

What happens instead?

It seems that it tries to open x.js (local source) instead of x.js.chromium (VM 
source) however it throws this exception

java.lang.StringIndexOutOfBoundsException: String index out of range: -2
    at java.lang.String.substring(String.java:1937)
    at org.chromium.debug.ui.PluginUtil.stripChromiumExtension(PluginUtil.java:80)
    at org.chromium.debug.ui.editors.JsEditor.setPartName(JsEditor.java:41)
    at org.eclipse.ui.texteditor.AbstractTextEditor.initializeTitle(AbstractTextEditor.java:4120)
    at org.eclipse.ui.texteditor.AbstractTextEditor.doSetInput(AbstractTextEditor.java:4224)
    at org.eclipse.ui.texteditor.StatusTextEditor.doSetInput(StatusTextEditor.java:237)
    at org.eclipse.ui.texteditor.AbstractDecoratedTextEditor.doSetInput(AbstractDecoratedTextEditor.java:1480)
    at org.eclipse.ui.editors.text.TextEditor.doSetInput(TextEditor.java:169)
    at org.eclipse.ui.texteditor.AbstractTextEditor$19.run(AbstractTextEditor.java:3209)
    at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
    at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)
    at org.eclipse.ui.internal.WorkbenchWindow$13.run(WorkbenchWindow.java:1666)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:1663)
    at org.eclipse.ui.texteditor.AbstractTextEditor.internalInit(AbstractTextEditor.java:3227)
    at org.eclipse.ui.texteditor.AbstractTextEditor.init(AbstractTextEditor.java:3254)
    at org.eclipse.ui.internal.EditorReference.initialize(EditorReference.java:324)
    at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:288)
    at sun.reflect.GeneratedMethodAccessor42.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
    at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:857)
    at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:837)
    at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:111)
    at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:318)
    at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:240)
    at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:161)
    at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:102)
    at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:71)
    at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:53)
    at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:141)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:889)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:623)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:725)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:696)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:690)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:675)
    at org.eclipse.e4.ui.internal.workbench.PartServiceImpl$1.handleEvent(PartServiceImpl.java:90)
    at org.eclipse.e4.ui.services.internal.events.UIEventHandler$1.run(UIEventHandler.java:41)
    at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:180)
    at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150)
    at org.eclipse.swt.widgets.Display.syncExec(Display.java:4687)
    at org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:187)
    at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:38)
    at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:197)
    at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:197)
    at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
    at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
    at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:135)
    at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:78)
    at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:39)
    at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:81)
    at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:57)
    at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
    at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElement(ElementContainerImpl.java:171)
    at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.showElementInWindow(ModelServiceImpl.java:418)
    at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.bringToTop(ModelServiceImpl.java:385)
    at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.delegateBringToTop(PartServiceImpl.java:578)
    at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.bringToTop(PartServiceImpl.java:314)
    at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.showPart(PartServiceImpl.java:962)
    at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:3071)
    at org.eclipse.ui.internal.WorkbenchPage.access$21(WorkbenchPage.java:2996)
    at org.eclipse.ui.internal.WorkbenchPage$8.run(WorkbenchPage.java:2978)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2974)
    at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2933)
    at org.eclipse.debug.internal.ui.sourcelookup.SourceLookupFacility$1.run(SourceLookupFacility.java:352)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.debug.internal.ui.sourcelookup.SourceLookupFacility.openEditor(SourceLookupFacility.java:362)
    at org.eclipse.debug.internal.ui.sourcelookup.SourceLookupFacility.openEditor(SourceLookupFacility.java:276)
    at org.eclipse.debug.internal.ui.sourcelookup.SourceLookupFacility.display(SourceLookupFacility.java:219)
    at org.eclipse.debug.ui.DebugUITools.displaySource(DebugUITools.java:994)
    at org.eclipse.debug.internal.ui.elements.adapters.StackFrameSourceDisplayAdapter$SourceDisplayJob.runInUIThread(StackFrameSourceDisplayAdapter.java:157)
    at org.eclipse.ui.progress.UIJob$1.run(UIJob.java:95)
    at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
    at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4144)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1022)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:916)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:585)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:540)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1438)

Please provide any additional information below. If possible, attach a
(reduced) test-case.

thanks to the "Chrome/V8 Breakpoints" in "Run / Breakpoint Types" comment, I 
finally managed to get it to at least recognize breakpoints set with my local 
file, however I wanted also to edit and debug the local file and not the remote 
one, so I followed the instructions and added the local sources, above the 
"Default" source lookup, but then I got the JS error.

Is it possible to put a breakpoint, edit and publish to the VM from the same 
local file? for now all I got is a convenience of putting the breakpoint, so I 
can debug in the Chromium JS editor, but if I need to edit, I have to go back 
to the local file (e.g. can't debug and edit in the same file) without this, 
it's almost the same as putting the breakpoint directly in chrome... (although 
pushing changes directly without refresh is a great feature as it self)

Original issue reported on code.google.com by Ehrann.M...@gmail.com on 2 Sep 2012 at 4:21

GoogleCodeExporter commented 8 years ago
small typo on my behalf:
"then I got the JS error." should read "then I got the Java error."

Original comment by Ehrann.M...@gmail.com on 2 Sep 2012 at 4:26

GoogleCodeExporter commented 8 years ago
Thank you for the very accurate report.

Original comment by peter.ry...@gmail.com on 2 Sep 2012 at 4:33

GoogleCodeExporter commented 8 years ago
Update - this only seems to happen to a file named main.js 
I have no clue why...

other files seems to work well...

Original comment by Ehrann.M...@gmail.com on 2 Sep 2012 at 4:38

GoogleCodeExporter commented 8 years ago
As absurd as it sounds, the cause of out of range by 2 positions problem is 
that your file name is 2 characters shorter than we ever tried.

I suggest that you try with longer file names. The program will go on doing 
something wrong inside, but hopefully you will move on.

Original comment by peter.ry...@gmail.com on 2 Sep 2012 at 4:39

GoogleCodeExporter commented 8 years ago
As to your question:
yes, there should be possible to edit, set breakpoints, step over and push live 
edits all from your local files. Thank you for the feedback such as this report.

What might be also important is what editor you are using for your sources. Is 
it from any plugin you have installed in Eclipse? Or it is a standard common 
plain text editor.

Original comment by peter.ry...@gmail.com on 2 Sep 2012 at 4:45

GoogleCodeExporter commented 8 years ago
Ok, reading your comment about "main.js" – we definitely tried this name. My 
guess about name length might be void then (I meant "x.js" from your example 
originally).

Anyway, let me take a look at the code somewhat later.

Original comment by peter.ry...@gmail.com on 2 Sep 2012 at 4:50

GoogleCodeExporter commented 8 years ago
I'm using the default JSDT javascript editor
issue reproduces also when I manual try to open main.js using the new "JS 
Editor" that comes with the plugin...

regarding comment #5 - glad to hear, my question is - all of this is done via 
the "JS Editor" that comes with the plugin? or via my "regular" editor (plain 
text / JSDT)
it does work nicely with JSDT by the way, but then hovering a variable doesn't 
do much

p.s. the quickest way to reproduce is just to open main.js with the JS editor 
that comes with the plugin

not sure if it helps, but the file full path is  "WebContent/js/main.js"

Original comment by Ehrann.M...@gmail.com on 2 Sep 2012 at 5:26

GoogleCodeExporter commented 8 years ago
JSDT editor is going to improve adoption of chromedevtools breakpoints (disable 
and properties actions) per https://bugs.eclipse.org/bugs/show_bug.cgi?id=389133

Original comment by peter.ry...@gmail.com on 10 Sep 2012 at 10:46

GoogleCodeExporter commented 8 years ago
Fixed in 0.3.8

Original comment by peter.ry...@gmail.com on 4 Oct 2012 at 8:35