diff --git a/src/MIDebugEngine/Engine.Impl/DebuggedProcess.cs b/src/MIDebugEngine/Engine.Impl/DebuggedProcess.cs index 5375744d9..011ff4f28 100755 --- a/src/MIDebugEngine/Engine.Impl/DebuggedProcess.cs +++ b/src/MIDebugEngine/Engine.Impl/DebuggedProcess.cs @@ -1234,8 +1234,13 @@ private async Task HandleBreakModeEvent(ResultEventArgs results, BreakRequest br } else { - // not one of our breakpoints, so stop with a message - _callback.OnException(thread, "Unknown breakpoint", "", 0); + // This is not one of our breakpoints, so stop with a message. Possibly it + // was set by the user via "-exec break ...", so display the available + // information. + string desc = String.Format(CultureInfo.CurrentCulture, + ResourceStrings.UnknownBreakpoint, + bkptno, addr); + _callback.OnException(thread, desc, "", 0); } } } @@ -1263,8 +1268,40 @@ private async Task HandleBreakModeEvent(ResultEventArgs results, BreakRequest br } else { - // not one of our breakpoints, so stop with a message - _callback.OnException(thread, "Unknown watchpoint", "", 0); + // This is not one of our watchpoints, so stop with a message. Possibly it + // was set by the user via "-exec watch ...", so display the available + // information. + string desc = string.Empty; + string exp = wpt.TryFindString("exp"); + if (string.IsNullOrEmpty(exp)) { + desc = String.Format(CultureInfo.CurrentCulture, + ResourceStrings.UnknownWatchpoint, + bkptno, addr); + } + else + { + desc = String.Format(CultureInfo.CurrentCulture, + ResourceStrings.UnknownWatchpointWithExpression, + bkptno, exp, addr); + } + var value = results.Results.TryFind("value"); + if (value != null) { + string oldValue = value.TryFindString("old"); + if (!string.IsNullOrEmpty(oldValue)) { + desc += "\n"; + desc += String.Format(CultureInfo.CurrentCulture, + ResourceStrings.UnknownWatchpointOldValue, + oldValue); + } + string newValue = value.TryFindString("new"); + if (!string.IsNullOrEmpty(newValue)) { + desc += "\n"; + desc += String.Format(CultureInfo.CurrentCulture, + ResourceStrings.UnknownWatchpointNewValue, + newValue); + } + } + _callback.OnException(thread, desc, "", 0); } } } diff --git a/src/MIDebugEngine/ResourceStrings.Designer.cs b/src/MIDebugEngine/ResourceStrings.Designer.cs index c22a37e02..a084c9a27 100755 --- a/src/MIDebugEngine/ResourceStrings.Designer.cs +++ b/src/MIDebugEngine/ResourceStrings.Designer.cs @@ -355,6 +355,15 @@ internal static string ThreadExited { } } + /// + /// Looks up a localized string similar to Hit breakpoint {0} at 0x{1:x}.. + /// + internal static string UnknownBreakpoint { + get { + return ResourceManager.GetString("UnknownBreakpoint", resourceCulture); + } + } + /// /// Looks up a localized string similar to [Unknown/Just-In-Time compiled code]. /// @@ -364,6 +373,42 @@ internal static string UnknownCode { } } + /// + /// Looks up a localized string similar to Hit watchpoint {0} at 0x{1:x}.. + /// + internal static string UnknownWatchpoint { + get { + return ResourceManager.GetString("UnknownWatchpoint", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to New value = {0}. + /// + internal static string UnknownWatchpointNewValue { + get { + return ResourceManager.GetString("UnknownWatchpointNewValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Old value = {0}. + /// + internal static string UnknownWatchpointOldValue { + get { + return ResourceManager.GetString("UnknownWatchpointOldValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Hit watchpoint {0}: {1} at 0x{2:x}.. + /// + internal static string UnknownWatchpointWithExpression { + get { + return ResourceManager.GetString("UnknownWatchpointWithExpression", resourceCulture); + } + } + /// /// Looks up a localized string similar to Unsupported Breakpoint Type. /// diff --git a/src/MIDebugEngine/ResourceStrings.resx b/src/MIDebugEngine/ResourceStrings.resx index 3d4a30fa0..fc9111daf 100755 --- a/src/MIDebugEngine/ResourceStrings.resx +++ b/src/MIDebugEngine/ResourceStrings.resx @@ -270,4 +270,24 @@ See https://aka.ms/miengine-gdb-troubleshooting for details. Exception{0} thrown at 0x{1:X} in {2}. 0 = optional exception name, 1 = address, 2 = exception file + + Hit breakpoint {0} at 0x{1:x}. + 0 = breakpoint number, 1 = address + + + Hit watchpoint {0} at 0x{1:x}. + 0 = watchpoint number, 1 = address + + + Hit watchpoint {0}: {1} at 0x{2:x}. + 0 = watchpoint number, 1 = expression, 2 = address + + + Old value = {0} + 0 = old value of watchpoint + + + New value = {0} + 0 = new value of watchpoint + \ No newline at end of file