From d70f562108ed1c014ca0408160d5a4ab029b0ca2 Mon Sep 17 00:00:00 2001 From: Nikita Romanov Date: Thu, 30 May 2024 21:01:02 +0400 Subject: [PATCH] `watch` window enhancements --- src/DotNet.Meteor.Debug/DebugSession.cs | 2 +- src/DotNet.Meteor.Debug/Extensions/ServerExtensions.cs | 3 +++ src/Mono.Debugger | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/DotNet.Meteor.Debug/DebugSession.cs b/src/DotNet.Meteor.Debug/DebugSession.cs index 2a4cff4..ca3f6d6 100644 --- a/src/DotNet.Meteor.Debug/DebugSession.cs +++ b/src/DotNet.Meteor.Debug/DebugSession.cs @@ -371,7 +371,7 @@ public class DebugSession : Session { throw new ProtocolException($"command handled by {launchAgent}"); } - var expression = arguments.Expression.TrimEnd(';'); + var expression = arguments.TrimExpression(); var frame = frameHandles.Get(arguments.FrameId ?? 0, null); if (frame == null) throw new ProtocolException("no active stackframe"); diff --git a/src/DotNet.Meteor.Debug/Extensions/ServerExtensions.cs b/src/DotNet.Meteor.Debug/Extensions/ServerExtensions.cs index 80c7583..0053723 100644 --- a/src/DotNet.Meteor.Debug/Extensions/ServerExtensions.cs +++ b/src/DotNet.Meteor.Debug/Extensions/ServerExtensions.cs @@ -93,6 +93,9 @@ public static class ServerExtensions { return targetDirectory; } } + public static string TrimExpression(this DebugProtocol.EvaluateArguments args) { + return args.Expression?.TrimEnd(';')?.Replace("?.", "."); + } public static T DoSafe(Func handler, Action finalizer = null) { try { diff --git a/src/Mono.Debugger b/src/Mono.Debugger index 08b53e0..34c1280 160000 --- a/src/Mono.Debugger +++ b/src/Mono.Debugger @@ -1 +1 @@ -Subproject commit 08b53e0c54fb13f0325ef814c1c02d84ce97ad25 +Subproject commit 34c1280f00bf6c74392d97fb9a21475d7d4af3e9