mbeddr / mbeddr.core

The mbeddr core. An extensible C
Eclipse Public License 2.0
225 stars 77 forks source link

CStub Import Crash #87

Closed danielstieger closed 12 years ago

danielstieger commented 12 years ago

Versuche c:/cygwin/usr/include/stdio.h zu importieren. Kann stdio.h beim File Dialog nicht auswählen - nehme ich halt ganzes Verzeichnis stattdessen. Richtig?

Folgende NullPointer Exception tritt dann auf:

Error during dispatching of java.awt.event.MouseEvent[MOUSE_RELEASED,(710,183),absolute(702,175),button=1,modifiers=Button1,clickCount=1] on frame0 java.lang.NullPointerException at java.io.File.(Unknown Source) at com.mbeddr.core.modules.runtime.include.ParseUtil.substitueWithPathVariables(ParseUtil.java:1048) at com.mbeddr.core.cstubs.editor.HeaderImportSpec_Editor$4.run(HeaderImportSpec_Editor.java:363) at jetbrains.mps.ide.smodel.WorkbenchModelAccess$CommandRunnable$1.run(WorkbenchModelAccess.java:784) at jetbrains.mps.ide.smodel.WorkbenchModelAccess$4.run(WorkbenchModelAccess.java:157) at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:844) at jetbrains.mps.ide.smodel.WorkbenchModelAccess.runWriteAction(WorkbenchModelAccess.java:164) at jetbrains.mps.ide.smodel.WorkbenchModelAccess$CommandRunnable.run(WorkbenchModelAccess.java:780) at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:115) at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:91) at jetbrains.mps.ide.smodel.WorkbenchModelAccess.runWriteActionInCommand(WorkbenchModelAccess.java:614) at jetbrains.mps.ide.smodel.WorkbenchModelAccess.runWriteActionInCommand(WorkbenchModelAccess.java:609) at jetbrains.mps.ide.smodel.WorkbenchModelAccess.runWriteActionInCommand(WorkbenchModelAccess.java:604) at com.mbeddr.core.cstubs.editor.HeaderImportSpec_Editor$2.actionPerformed(HeaderImportSpec_Editor.java:361) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.setPressed(Unknown Source) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source) at java.awt.Component.processMouseEvent(Unknown Source) at javax.swing.JComponent.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source)

matzat commented 12 years ago

Die NPE wurde behoben.

Bzgl. des Imports des /usr/include/ Verzeichnisses gibt es aufgrund der Größe noch einige Probleme.

Man könnte aber die interessanten Header in ein eigenes Verzeichnis kopieren und dann nur das Verzeichnis parsen.

danielstieger commented 12 years ago

Ok, with your new version i get ... (or is my import procedure wrong?)

ava.lang.NullPointerException at java.util.regex.Matcher.getTextLength(Unknown Source) at java.util.regex.Matcher.reset(Unknown Source) at java.util.regex.Matcher.(Unknown Source) at java.util.regex.Pattern.matcher(Unknown Source) at com.mbeddr.core.modules.runtime.include.ParseUtil.reSubstitueWithPathVariables(ParseUtil.java:1028) at com.mbeddr.core.cstubs.editor.HeaderImportSpec_Editor$3.run(HeaderImportSpec_Editor.java:350) at jetbrains.mps.ide.smodel.WorkbenchModelAccess$2.run(WorkbenchModelAccess.java:115) at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:757) at jetbrains.mps.ide.smodel.WorkbenchModelAccess.runReadAction(WorkbenchModelAccess.java:111) at com.mbeddr.core.cstubs.editor.HeaderImportSpec_Editor$2.actionPerformed(HeaderImportSpec_Editor.java:346) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.setPressed(Unknown Source) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source) at java.awt.Component.processMouseEvent(Unknown Source) at javax.swing.JComponent.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$000(Unknown Source) at java.awt.EventQueue$1.run(Unknown Source) at java.awt.EventQueue$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source) at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue$2.run(Unknown Source) at java.awt.EventQueue$2.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:652) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:501) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:404) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:368) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source)

matzat commented 12 years ago

Can you post the include path?

danielstieger commented 12 years ago

ok, seems the file open dialogue does not work correctly. When entering path c:/cygwin/usr/include2 directly in the text field and useing "(re) import headers" button, stdio.h gets imported ... using "..." button to select directory results in crash

bkolb commented 12 years ago

hm. looks like windows issue. maybe some problem with / and \?

matzat commented 12 years ago

ok, i will check the dialogue on windows...

matzat commented 12 years ago

issue fixed again. last commit doesn't cotain the right changes...

bkolb commented 12 years ago

can we close this?

matzat commented 12 years ago

yes we can...

matzat commented 12 years ago

done