Unity 6 - Line numbers

Aperta
#2,025 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
28/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
csharp, unity

Direzione di ricerca

Inizia da src/Sentry.Unity/Il2CppEventProcessor.cs e src/Sentry.Unity/Integrations/UnityApplicationLoggingIntegration.cs, quindi confronta il comportamento degli stacktrace delle eccezioni di Unity 6 descritto qui con il flusso di elaborazione esistente. Il lavoro sarà completato quando gli stacktrace di Unity 6 manterranno le informazioni su metodo, file e riga, mentre l’SDK eviterà l’elaborazione IL2CPP non necessaria quando i nuovi dati saranno disponibili.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
C#
Stelle
295
Fork
63
Merge medio
3g 17h
PR unite (30g)
26

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di getsentry/sentry-unity

Tutte le issue di getsentry/sentry-unity

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.