diff options
author | Thays Grazia <thaystg@gmail.com> | 2021-08-28 07:36:31 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-28 07:36:31 +0300 |
commit | c22719f63841dd0a0e3b43357a5001621be4b6f1 (patch) | |
tree | 50d6b6f84ccc7b491bf9a063b7f0a79d98df4d47 | |
parent | c4f02830a50213586e7d834471b90ce38350738d (diff) |
Fix https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1384996?src=WorkItemMention&src-action=artifact_link (#347)
-rw-r--r-- | Mono.Debugging.Soft/SoftDebuggerAdaptor.cs | 2 | ||||
-rw-r--r-- | Mono.Debugging.Soft/SoftDebuggerBacktrace.cs | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/Mono.Debugging.Soft/SoftDebuggerAdaptor.cs b/Mono.Debugging.Soft/SoftDebuggerAdaptor.cs index af7818b..ae51d60 100644 --- a/Mono.Debugging.Soft/SoftDebuggerAdaptor.cs +++ b/Mono.Debugging.Soft/SoftDebuggerAdaptor.cs @@ -1743,7 +1743,7 @@ namespace Mono.Debugging.Soft var atm = attrType as TypeMirror; var tm = type as TypeMirror; - while (tm != null) { + while (tm != null && atm != null) { if (tm.GetCustomAttributes (atm, false).Any ()) return tm; diff --git a/Mono.Debugging.Soft/SoftDebuggerBacktrace.cs b/Mono.Debugging.Soft/SoftDebuggerBacktrace.cs index 4cdda11..2c1d1ee 100644 --- a/Mono.Debugging.Soft/SoftDebuggerBacktrace.cs +++ b/Mono.Debugging.Soft/SoftDebuggerBacktrace.cs @@ -175,7 +175,8 @@ namespace Mono.Debugging.Soft if (session.VirtualMachine.Version.AtLeast (2, 21)) { var ctx = GetEvaluationContext (frameIndex, session.EvaluationOptions); var hiddenAttr = session.Adaptor.GetType (ctx, "System.Diagnostics.DebuggerHiddenAttribute") as MDB.TypeMirror; - hidden = method.GetCustomAttributes (hiddenAttr, true).Any (); + if (hiddenAttr != null) + hidden = method.GetCustomAttributes (hiddenAttr, true).Any (); } if (hidden) { external = true; @@ -184,7 +185,8 @@ namespace Mono.Debugging.Soft if (!external && session.Options.ProjectAssembliesOnly && session.VirtualMachine.Version.AtLeast (2, 21)) { var ctx = GetEvaluationContext (frameIndex, session.EvaluationOptions); var nonUserCodeAttr = session.Adaptor.GetType (ctx, "System.Diagnostics.DebuggerNonUserCodeAttribute") as MDB.TypeMirror; - external = method.GetCustomAttributes (nonUserCodeAttr, true).Any (); + if (nonUserCodeAttr != null) + external = method.GetCustomAttributes (nonUserCodeAttr, true).Any (); } } |