Unity 6 - Line numbers

Abierto
#2,025 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 3 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
28/100
Tipo de issue
Nueva funcionalidad
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
csharp, unity

Línea de trabajo

Comienza con src/Sentry.Unity/Il2CppEventProcessor.cs y src/Sentry.Unity/Integrations/UnityApplicationLoggingIntegration.cs; después, compara el comportamiento de los stacktraces de excepciones de Unity 6 descrito aquí con el flujo de procesamiento existente. La tarea estará terminada cuando los stacktraces de Unity 6 conserven la información del método, el archivo y la línea, mientras el SDK evita el procesamiento innecesario de IL2CPP cuando los nuevos datos estén disponibles.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Errors Improvement Unity

Context

To provide line numbers we're added the IL2CppEventProcessor. The main responsibility of this processor is to call into the IL2CPP backend, get the native stacktrace and match it with the managed one and fix instruction addresses. With those Sentry is able to serverside symbolicate the issue.

Unity 6

What's New

Unity 6 introduced a new option to the IL2CPP configuration and exception can now include method name, file name, and line number.

Image

Triggering a NullReferenceException and logging is via exception.toString() results in the following logs

System.NullReferenceException: Object reference not set to an instance of an object.
  at BugFarmButtons.ThrowNull () [0x00000] in /Users/bitfox/Workspace/sentry-unity/samples/unity-of-bugs/Assets/Scripts/BugFarmButtons.cs:24 
  at UnityEngine.Events.UnityEvent.Invoke () [0x00000] in <00000000000000000000000000000000>:0 
  at System.Collections.Generic.Enumerable.EnumerableIList`1[T]..ctor (System.Collections.Generic.IList`1[T] list) [0x00000] in /Users/bitfox/Workspace/sentry-unity/src/sentry-dotnet/modules/Ben.Demystifier/src/Ben.Demystifier/Enumerable/EnumerableIList.cs:15 
  at UnityEngine.EventSystems.StandaloneInputModule.ReleaseMouse (UnityEngine.EventSystems.PointerEventData pointerEvent, UnityEngine.GameObject currentOverGo) [0x00000] in ./Library/PackageCache/com.unity.ugui@03407c6d8751/Runtime/UGUI/EventSystem/InputModules/StandaloneInputModule.cs:192 
  at UnityEngine.EventSystems.StandaloneInputModule.ProcessMouseEvent (System.Int32 id) [0x00000] in ./Library/PackageCache/com.unity.ugui@03407c6d8751/Runtime/UGUI/EventSystem/InputModules/StandaloneInputModule.cs:554 
  at UnityEngine.EventSystems.StandaloneInputModule.ProcessMouseEvent () [0x00000] in ./Library/PackageCache/com.unity.ugui@03407c6d8751/Runtime/UGUI/EventSystem/InputModules/StandaloneInputModule.cs:534 
  at UnityEngine.EventSystems.StandaloneInputModule.Process () [0x00000] in ./Library/PackageCache/com.unity.ugui@03407c6d8751/Runtime/UGUI/EventSystem/InputModules/StandaloneInputModule.cs:282 

What does this enable
Line numbers for Debug.LogError

Events captured via Debug.LogError automatically contain line numbers as these are parsed from the stringified stacktrace in the ApplicationLoggingIntegration.

Image

Line numbers for unhandled exceptions

In Unity 6 and newer, with this option enabled, the SDK no longer needs to go register the IL2CPP processor to calling into the IL2CPP backend. This also means, stacktraces and linenumbers work without debug symbol upload.
Note, that this most likely comes at a cost to performance.

Notes

It is not required to opt-in having stacktraces in the player settings. The exception itself has the proper stacktrace with line numbers.

Image

Lenguaje dominante
C#
Estrellas
294
Forks
63
Merge medio
3 d 17 h
PR fusionados (30 d)
26

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de getsentry/sentry-unity

Todos los issues de getsentry/sentry-unity

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.