Community
Participate
Working Groups
To reproduce: (1) Set a breakpoint then open the DSF Disassembly View from the menu, or (2) Refresh View from the DSF Disassembly View context menu Observations (file DisassemblyDocument.java): - In getSourcePosition(), the fSource field of the SourceFileInfo structure is not yet initialized (value null), causing the NPE - The SourceFileInfo structure is populated by a SourceReadingJob that is guaranteed (in that case) to execute after getSourcePosition() tries to access the fSource field (not good) Here's a trace: eclipse.buildId=I20080409-1425 java.version=1.5.0_13 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_CA Framework arguments: -product org.eclipse.sdk.ide Command-line arguments: -product org.eclipse.sdk.ide -data /home/francois/Eclipse/workspaces/DSF/../runtime-DSF -dev file:/home/francois/Eclipse/workspaces/DSF/.metadata/.plugins/org.eclipse.pde.core/DSF/dev.properties -debug /home/francois/Eclipse/workspaces/DSF/.metadata/.plugins/org.eclipse.pde.core/DSF/.options -os linux -ws gtk -arch x86 Error Fri Apr 25 17:05:21 EDT 2008 Unhandled event loop exception java.lang.NullPointerException at org.eclipse.dd.dsf.debug.internal.ui.disassembly.model.DisassemblyDocument.getSourcePosition(DisassemblyDocument.java:546) at org.eclipse.dd.dsf.debug.internal.ui.disassembly.model.DisassemblyDocument.getSourcePosition(DisassemblyDocument.java:515) at org.eclipse.dd.dsf.debug.internal.ui.disassembly.model.BreakpointsAnnotationModel.createPositionFromSourceLine(BreakpointsAnnotationModel.java:177) at org.eclipse.dd.dsf.debug.internal.ui.disassembly.model.BreakpointsAnnotationModel.createPositionFromBreakpoint(BreakpointsAnnotationModel.java:154) at org.eclipse.dd.dsf.debug.internal.ui.disassembly.model.BreakpointsAnnotationModel.addBreakpointAnnotation(BreakpointsAnnotationModel.java:133) at org.eclipse.dd.dsf.debug.internal.ui.disassembly.model.BreakpointsAnnotationModel.addBreakpoints(BreakpointsAnnotationModel.java:78) at org.eclipse.dd.dsf.debug.internal.ui.disassembly.model.BreakpointsAnnotationModel.catchupWithBreakpoints(BreakpointsAnnotationModel.java:73) at org.eclipse.dd.dsf.debug.internal.ui.disassembly.model.BreakpointsAnnotationModel.access$1(BreakpointsAnnotationModel.java:70) at org.eclipse.dd.dsf.debug.internal.ui.disassembly.model.BreakpointsAnnotationModel$1.run(BreakpointsAnnotationModel.java:221) at org.eclipse.swt.widgets.Display.timerProc(Display.java:3824) at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method) at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:1504) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2980) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2375) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2339) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2205) at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:478) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:473) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193) 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:362) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:175) 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:585) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504) at org.eclipse.equinox.launcher.Main.run(Main.java:1236) at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Created attachment 98132 [details] Fix for NPE (+committed, +logged) This patch fixes the NPE by simply returning null when fSource is null. This happens when the source has not been loaded yet. The breakpoint annotation will be added later in this case.
Thanks Anton. Your patch works fine. I will commit it. BR, /fc
Francois, Same here, you can verify it.
Closing out 1.0 bugs.