Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[ptp-dev] Null pointer exception when looking for function definition


I have the following program
#include <stdio.h>
int i;
int main(int argc, char *argv[])
{
          printf("Hello\n");
          sub();
}

int sub()
{
        i = 0;
        printf("In sub.\n");
}

If I select the reference to sub() and hit F3, the definition of sub() is highlighted. If I select the first reference to printf() and hit F3, I get the following exception

org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NullPointerException)
at org.eclipse.swt.SWT.error(SWT.java:3777)
at org.eclipse.swt.SWT.error(SWT.java:3695)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3800)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3425)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2198)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:488)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
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:386)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
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)
Caused by: java.lang.NullPointerException
at org.eclipse.cdt.internal.core.model.CModelManager.createTranslationUnitFrom(CModelManager.java:473)
at org.eclipse.cdt.core.model.CoreModel.createTranslationUnitFrom(CoreModel.java:92)
at org.eclipse.cdt.internal.ui.util.EditorUtility.getEditorInputForLocation(EditorUtility.java:350)
at org.eclipse.cdt.internal.ui.util.EditorUtility.openInEditor(EditorUtility.java:298)
at org.eclipse.ptp.internal.rdt.ui.search.actions.OpenDeclarationsAction$1.run(OpenDeclarationsAction.java:203)
at org.eclipse.ptp.internal.rdt.ui.search.actions.OpenDeclarationsAction.runInUIThread(OpenDeclarationsAction.java:289)
at org.eclipse.ptp.internal.rdt.ui.search.actions.OpenDeclarationsAction.open(OpenDeclarationsAction.java:199)
at org.eclipse.ptp.internal.rdt.ui.search.actions.OpenDeclarationsAction.access$2(OpenDeclarationsAction.java:198)
at org.eclipse.ptp.internal.rdt.ui.search.actions.OpenDeclarationsAction$2.run(OpenDeclarationsAction.java:240)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:133)
... 22 more

Dave

Back to the top