diff options
author | Kirill Osenkov <KirillOsenkov@users.noreply.github.com> | 2021-12-21 02:20:52 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-21 02:20:52 +0300 |
commit | 2fb5dfe6b5fe79a2e740c3b665cde23ce2ee3be5 (patch) | |
tree | 996e05cceac18b981e55a2a86373b98c9d1be71b | |
parent | 5e0195104e26d763fa25e8fc1cda75964067c7d6 (diff) | |
parent | 9ec9365db53bdc02814507bc1dd21d7914eb0301 (diff) |
Merge pull request #350 from mono/dev/kirillo/catchpoint
Proper support for Catchpoint location signature
-rw-r--r-- | Mono.Debugging/Mono.Debugging.Client/Catchpoint.cs | 11 | ||||
-rw-r--r-- | Mono.Debugging/Mono.Debugging.Client/StackFrame.cs | 11 |
2 files changed, 21 insertions, 1 deletions
diff --git a/Mono.Debugging/Mono.Debugging.Client/Catchpoint.cs b/Mono.Debugging/Mono.Debugging.Client/Catchpoint.cs index 6f42cf9..a39e0f4 100644 --- a/Mono.Debugging/Mono.Debugging.Client/Catchpoint.cs +++ b/Mono.Debugging/Mono.Debugging.Client/Catchpoint.cs @@ -85,6 +85,17 @@ namespace Mono.Debugging.Client set { includeSubclasses = value; } } + /// <summary> + /// When an exception first happens, we are given the frame of the exception. + /// However by the time the user chooses "Ignore this location" in the exception dialog, + /// the current frame might be a different frame (the one with source code), + /// and not necessarily the bottom frame of the stack. + /// Make sure we remember the original frame where the exception happened + /// so that when it happens next time, we use the same frame signature to compare + /// against. + /// </summary> + public string CurrentLocationSignature { get; set; } + public HashSet<string> Ignored { get; private set; } = new HashSet<string> (StringComparer.Ordinal); public bool ShouldIgnore(string type, string locationSignature) diff --git a/Mono.Debugging/Mono.Debugging.Client/StackFrame.cs b/Mono.Debugging/Mono.Debugging.Client/StackFrame.cs index 1b1ba61..88c23f4 100644 --- a/Mono.Debugging/Mono.Debugging.Client/StackFrame.cs +++ b/Mono.Debugging/Mono.Debugging.Client/StackFrame.cs @@ -135,7 +135,16 @@ namespace Mono.Debugging.Client /// </summary> public string GetLocationSignature () { - return $"{Path.GetFileNameWithoutExtension (this.FullModuleName)}!{this.SourceLocation.MethodName}:{this.Address}"; + string methodName = this.SourceLocation.MethodName; + if (methodName != null && !methodName.Contains("!")) { + methodName = $"{Path.GetFileName (this.FullModuleName)}!{methodName}"; + } + + if (this.Address != 0) { + methodName = $"{methodName}:{Address}"; + } + + return methodName; } public string GetFullStackFrameText () |