consulo / consulo-unity3d

Frameworks: Unity3D
Apache License 2.0
103 stars 10 forks source link

Unity debugger breaks with generic classes #193

Open TCROC opened 3 years ago

TCROC commented 3 years ago

The example repo demonstrating the issue can be found here: https://github.com/TCROC/ConsuloBug-UnityDebuggerMissAndNull

There are several issues so they will be listed below:

  1. Breakpoints in generic classes are not hit

image

  1. Static variables in generic classes are not evaluated

image

  1. Attempting to hover over instance variables in a generic object results in this IDE Fatal Error:

image

image

Exception have null message
mono.debugger.InvalidFieldIdException
    at consulo.dotnet.mono//mono.debugger.JDWPException.asUncheckedException(JDWPException.java:60)
    at consulo.dotnet.mono//mono.debugger.FieldMirror.value(FieldMirror.java:53)
    at consulo.dotnet.mono//consulo.dotnet.mono.debugger.proxy.MonoFieldProxy.getValue(MonoFieldProxy.java:60)
    at consulo.csharp//consulo.csharp.ide.debugger.expressionEvaluator.FieldEvaluator.invoke(FieldEvaluator.java:48)
    at consulo.csharp//consulo.csharp.ide.debugger.expressionEvaluator.FieldEvaluator.invoke(FieldEvaluator.java:32)
    at consulo.csharp//consulo.csharp.ide.debugger.expressionEvaluator.FieldOrPropertyEvaluator.invokeFieldOrProperty(FieldOrPropertyEvaluator.java:160)
    at consulo.csharp//consulo.csharp.ide.debugger.expressionEvaluator.FieldOrPropertyEvaluator.evaluate(FieldOrPropertyEvaluator.java:126)
    at consulo.csharp//consulo.csharp.ide.debugger.CSharpEvaluateContext.evaluate(CSharpEvaluateContext.java:93)
    at consulo.csharp//consulo.csharp.ide.debugger.CSharpDebuggerProvider.evaluate(CSharpDebuggerProvider.java:146)
    at consulo.dotnet//consulo.dotnet.debugger.DotNetDebuggerEvaluator.evaluate(DotNetDebuggerEvaluator.java:101)
    at com.intellij//com.intellij.xdebugger.impl.evaluate.quick.XValueHint.evaluateAndShowHint(XValueHint.java:165)
    at com.intellij//com.intellij.xdebugger.impl.evaluate.quick.common.AbstractValueHint.invokeHint(AbstractValueHint.java:178)
    at com.intellij//com.intellij.xdebugger.impl.evaluate.quick.common.ValueLookupManager.showHint(ValueLookupManager.java:170)
    at com.intellij//com.intellij.xdebugger.impl.evaluate.quick.common.ValueLookupManager.lambda$requestHint$0(ValueLookupManager.java:123)
    at com.intellij//com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
    at com.intellij//com.intellij.util.Alarm$Request.runSafely(Alarm.java:351)
    at com.intellij//com.intellij.util.Alarm$Request.run(Alarm.java:338)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at com.intellij//com.intellij.util.concurrency.SchedulingWrapper$MyScheduledFutureTask.run(SchedulingWrapper.java:229)
    at consulo.platform.desktop//com.intellij.openapi.application.DesktopTransactionGuardImpl$2.run(DesktopTransactionGuardImpl.java:321)
    at com.intellij//com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.doRun(LaterInvocator.java:455)
    at com.intellij//com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:438)
    at com.intellij//com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:422)
    at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
    at com.intellij//com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:793)
    at com.intellij//com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:704)
    at com.intellij//com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:394)
    at com.intellij//com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:703)
    at com.intellij//com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:393)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

However, evaluating the entire generic variable does work:

image

OS: Ubuntu 18.04 consulo.log Unity Version: 2019.4.14f1 Unity Consulo UPM Version: 2.4.0

About Info

 Consulo:
  version = 2020.12
  build number = 2810
  build date = December 7, 2020
 Plugins:
  com.intellij = 2810
  com.intellij.git = 1238
  com.intellij.xml = 2659
  com.intellij.properties = 2763
  consulo.dotnet = 3288
  consulo.dotnet.mono = 3839
  consulo.csharp = 4837
  consulo.javascript = 3070
  consulo.java = 4359
  com.intellij.uiDesigner = 5399
  consulo.nunit = 4369
  consulo.platform.desktop = 2810
  mobi.hsz.idea.gitignore = 393
  org.jetbrains.idea.maven = 5327
  org.jetbrains.plugins.yaml = 2129
  consulo.devkit = 8583
  consulo.unity3d = 7526
 JVM:
  vendor = JetBrains s.r.o
  version = 11.0.4
  runtimeVersion = 11.0.4+10-b304.77
  locale = en_US
 JVM Env:
  __idea.mac.env.lock = unlocked
  awt.toolkit = sun.awt.X11.XToolkit
  java.specification.version = 11
  sun.cpu.isalist = 
  sun.jnu.encoding = UTF-8
  log4j.shutdownHookEnabled = false
  sun.arch.data.model = 64
  consulo.properties.file = /home/t-croc/Applications/Consulo/consulo.properties
  sun.font.fontmanager = sun.awt.X11FontManager
  idea.properties.file = /home/t-croc/Applications/Consulo/consulo.properties
  java.vendor.url = https://www.jetbrains.com/
  consulo.home.path = /home/t-croc/Applications/Consulo/platform/build2810
  sun.java2d.uiScale.enabled = true
  log4j2.messageFactory = org.apache.logging.log4j.message.SimpleMessageFactory
  sun.io.useCanonCaches = false
  sun.boot.library.path = /home/t-croc/Applications/Consulo/platform/build2810/jre/lib
  jna.tmpdir = /home/t-croc/.consulo_settings/system/tmp
  sun.java.command = consulo.desktop.bootstrap/consulo.desktop.boot.main.Main /home/t-croc/dev/Projects/Consulo/Bugs/ConsuloBug-UnityDebuggerMissAndNull/Assets/Scenes/TestScript.cs
  jdk.debug = release
  sun.awt.exception.handler = com.intellij.openapi.application.impl.AWTExceptionHandler
  java.specification.vendor = Oracle Corporation
  jdk.module.path = /home/t-croc/Applications/Consulo/platform/build2810/boot
  java.version.date = 2019-07-16
  java.home = /home/t-croc/Applications/Consulo/platform/build2810/jre
  file.separator = /
  java.vm.compressedOopsMode = 32-bit
  line.separator = \n
  java.specification.name = Java Platform API Specification
  java.vm.specification.vendor = Oracle Corporation
  idea.home.path = /home/t-croc/Applications/Consulo/platform/build2810
  jdk.module.main.class = consulo.desktop.boot.main.Main
  awt.useSystemAAFontSettings = lcd
  sun.management.compiler = HotSpot 64-Bit Tiered Compilers
  jb.restart.code = 88
  java.runtime.version = 11.0.4+10-b304.77
  user.name = t-croc
  javax.swing.rebaseCssSizeMap = true
  sun.java2d.pmoffscreen = false
  sun.awt.noerasebackground = true
  file.encoding = UTF-8
  sun.java2d.noddraw = true
  jnidispatch.path = /home/t-croc/.consulo_settings/system/tmp/jna14265549084658617442.tmp
  idea.popup.weight = heavy
  jna.loaded = true
  java.io.tmpdir = /tmp
  java.version = 11.0.4
  java.vm.specification.name = Java Virtual Machine Specification
  java.awt.printerjob = sun.print.PSPrinterJob
  sun.os.patch.level = unknown
  consulo.vm.options.file = /home/t-croc/Applications/Consulo/consulo64.vmoptions
  java.library.path = /home/t-croc/Applications/Consulo/platform/build2810/bin:/tmp/.mount_UnityHCsoWl1/usr/lib::/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib
  java.vendor = JetBrains s.r.o
  io.netty.processId = 34297
  sun.io.unicode.encoding = UnicodeLittle
  java.rmi.server.disableHttp = true
  io.netty.machineId = 28:f0:76:ff:fe:16:65:0e
  java.util.concurrent.ForkJoinPool.common.parallelism = 8
  sun.desktop = gnome
  java.class.path = 
  sun.awt.enableExtraMouseButtons = true
  java.vm.vendor = JetBrains s.r.o
  consulo.module.path.boot = true
  java.util.Arrays.useLegacyMergeSort = true
  user.timezone = America/New_York
  jb.vmOptionsFile = /home/t-croc/Applications/Consulo/consulo64.vmoptions
  idea.no.launcher = false
  swing.bufferPerWindow = false
  os.name = Linux
  java.vm.specification.version = 11
  sun.java.launcher = SUN_STANDARD
  user.country = US
  sun.cpu.endian = little
  user.home = /home/t-croc
  user.language = en
  idea.cycle.buffer.size = 1024
  java.awt.graphicsenv = sun.awt.X11GraphicsEnvironment
  jdk.module.main = consulo.desktop.bootstrap
  idea.max.intellisense.filesize = 2500
  sun.java2d.d3d = false
  java.net.preferIPv4Stack = true
  path.separator = :
  idea.use.default.antialiasing.in.editor = false
  os.version = 5.4.0-56-generic
  jna.nosys = true
  java.runtime.name = OpenJDK Runtime Environment
  sun.nio.ch.bugLevel = 
  java.vm.name = OpenJDK 64-Bit Server VM
  jna.platform.library.path = /usr/lib/x86_64-linux-gnu:/lib/x86_64-linux-gnu:/lib64:/usr/lib:/lib:/usr/lib/i386-linux-gnu:/lib/i386-linux-gnu:/lib32:/usr/lib32
  java.vendor.url.bug = https://youtrack.jetbrains.com
  java.util.concurrent.ForkJoinPool.common.threadFactory = consulo.bootstrap.concurrent.IdeaForkJoinWorkerThreadFactory
  user.dir = /home/t-croc/dev/Projects/Consulo/Bugs/ConsuloBug-UnityDebuggerMissAndNull
  os.arch = amd64
  io.netty.serviceThreadPrefix = Netty 
  idea.dynamic.classpath = false
  java.vm.info = mixed mode
  java.vm.version = 11.0.4+10-b304.77
  java.rmi.server.hostname = localhost
  sun.awt.datatransfer.timeout = 2000
  java.class.version = 55.0
 OS:
  name = Linux
  version = 5.4.0-56-generic
  arch = amd64
 Env:
  PATH = /tmp/.mount_UnityHCsoWl1:/tmp/.mount_UnityHCsoWl1/usr/sbin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/home/t-croc/.dotnet/tools:/usr/local/bin:/usr/local/sbin:/opt/local/bin:/opt/local/sbin
  XAUTHORITY = /run/user/1000/gdm/Xauthority
  XMODIFIERS = @im=ibus
  XDG_DATA_DIRS = /tmp/.mount_UnityHCsoWl1/usr/share/:./share/:/usr/share/gnome:/usr/local/share/:/usr/share/:/usr/share/ubuntu:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop:/usr/share/gnome/:/usr/local/share/:/usr/share/
  GDMSESSION = ubuntu
  MANDATORY_PATH = /usr/share/gconf/ubuntu.mandatory.path
  TEXTDOMAINDIR = /usr/share/locale/
  GTK_IM_MODULE = ibus
  DBUS_SESSION_BUS_ADDRESS = unix:path=/run/user/1000/bus
  DEFAULTS_PATH = /usr/share/gconf/ubuntu.default.path
  XDG_CURRENT_DESKTOP = Unity
  APPIMAGE = /home/t-croc/Applications/UnityHub.AppImage
  SSH_AGENT_PID = 1623
  LD_LIBRARY_PATH = /home/t-croc/Applications/Consulo/platform/build2810/bin:/tmp/.mount_UnityHCsoWl1/usr/lib:
  QT4_IM_MODULE = xim
  SESSION_MANAGER = local/tcroc-Z390-UD:@/tmp/.ICE-unix/1527,unix/tcroc-Z390-UD:/tmp/.ICE-unix/1527
  USERNAME = t-croc
  LOGNAME = t-croc
  PWD = /home/t-croc/dev/Projects/Consulo/Bugs/ConsuloBug-UnityDebuggerMissAndNull
  IM_CONFIG_PHASE = 2
  GJS_DEBUG_TOPICS = JS ERROR;JS LOG
  SHELL = /bin/bash
  CHROME_DESKTOP = UnityHub.desktop
  GIO_LAUNCHED_DESKTOP_FILE = /home/t-croc/.local/share/applications/alacarte-made-1.desktop
  GNOME_DESKTOP_SESSION_ID = this-is-deprecated
  GTK_MODULES = gail:atk-bridge
  CLUTTER_IM_MODULE = xim
  __GL_SYNC_TO_VBLANK = 0
  TEXTDOMAIN = im-config
  ALL_JVM_ARGS = --add-opens=java.desktop/sun.awt=consulo.container.impl --add-opens=java.desktop/sun.awt.image=consulo.container.impl --add-opens=java.desktop/sun.java2d=consulo.container.impl --add-opens=java.desktop/sun.font=consulo.container.impl --add-opens=java.desktop/java.awt=consulo.container.impl --add-opens=java.desktop/javax.swing=consulo.container.impl --add-opens=java.desktop/javax.swing.plaf.basic=consulo.container.impl --add-opens=java.base/java.lang=consulo.container.impl --add-opens=java.desktop/javax.swing.text.html=consulo.container.impl --add-opens=java.desktop/java.awt.peer=consulo.container.impl  -Xms512m -Xmx1500m -XX:ReservedCodeCacheSize=240m -ea -Dsun.io.useCanonCaches=false -Djava.net.preferIPv4Stack=true -XX:+UseCodeCacheFlushing -XX:+UseConcMarkSweepGC -XX:SoftRefLRUPolicyMSPerMB=50 -XX:+HeapDumpOnOutOfMemoryError -Dawt.useSystemAAFontSettings=lcd  -Djb.vmOptionsFile="/home/t-croc/Applications/Consulo/consulo64.vmoptions" -Dconsulo.vm.options.file="/home/t-croc/Applications/Consulo/consulo64.vmoptions" -p "/home/t-croc/Applications/Consulo/platform/build2810/boot" -Dconsulo.module.path.boot=true -Dconsulo.home.path="/home/t-croc/Applications/Consulo/platform/build2810" -Didea.home.path="/home/t-croc/Applications/Consulo/platform/build2810" -Didea.properties.file="/home/t-croc/Applications/Consulo/consulo.properties" -Dconsulo.properties.file="/home/t-croc/Applications/Consulo/consulo.properties"   
  APPDIR = /tmp/.mount_UnityHCsoWl1
  XDG_SESSION_DESKTOP = ubuntu
  CONSULO_HOME = /home/t-croc/Applications/Consulo/platform/build2810
  SHLVL = 0
  QT_IM_MODULE = xim
  XDG_CONFIG_DIRS = /etc/xdg/xdg-ubuntu:/etc/xdg
  LANG = en_US.UTF-8
  XDG_SESSION_ID = 3
  XDG_SESSION_TYPE = x11
  JDK = /home/t-croc/Applications/Consulo/platform/build2810/jre
  DISPLAY = :1
  ROOT_DIR = /home/t-croc/Applications/Consulo
  OWD = /home/t-croc
  MAIN_CLASS_NAME = -m consulo.desktop.bootstrap/consulo.desktop.boot.main.Main
  GDK_BACKEND = x11
  GPG_AGENT_INFO = /run/user/1000/gnupg/S.gpg-agent:0:1
  ARGV0 = /home/t-croc/Applications/UnityHub.AppImage
  DESKTOP_SESSION = ubuntu
  USER = t-croc
  XDG_MENU_PREFIX = gnome-
  GIO_LAUNCHED_DESKTOP_FILE_PID = 12038
  QT_ACCESSIBILITY = 1
  WINDOWPATH = 2
  GJS_DEBUG_OUTPUT = stderr
  SSH_AUTH_SOCK = /run/user/1000/keyring/ssh
  XDG_SEAT = seat0
  NO_AT_BRIDGE = 1
  GSETTINGS_SCHEMA_DIR = /tmp/.mount_UnityHCsoWl1/usr/share/glib-2.0/schemas:
  GNOME_SHELL_SESSION_MODE = ubuntu
  XDG_VTNR = 2
  XDG_RUNTIME_DIR = /run/user/1000
  HOME = /home/t-croc
TCROC commented 3 years ago

The Unity project structure in the repo should look like this:

image

And the output shows that Unity is able to compile the script correctly.

image