diff --git a/.github/workflows/Build-And-Test.yml b/.github/workflows/Build-And-Test.yml index de23cd5b0..e3c6db89b 100644 --- a/.github/workflows/Build-And-Test.yml +++ b/.github/workflows/Build-And-Test.yml @@ -172,6 +172,7 @@ jobs: run: dotnet build ${{ github.workspace }}/src/MIDebugEngine-Unix.sln - run: | + sudo apt update sudo apt-get install gdb g++ -y which g++ which gdb 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/Engine.Impl/Variables.cs b/src/MIDebugEngine/Engine.Impl/Variables.cs index fd0da0ebf..d420beb3d 100644 --- a/src/MIDebugEngine/Engine.Impl/Variables.cs +++ b/src/MIDebugEngine/Engine.Impl/Variables.cs @@ -368,6 +368,12 @@ public enum NodeType private string StripFormatSpecifier(string exp, out string formatSpecifier) { formatSpecifier = null; // will be used with -var-set-format + + if (EngineUtils.IsConsoleExecCmd(exp, out string _, out string _)) + { + return exp; + } + int lastComma = exp.LastIndexOf(','); if (lastComma <= 0) return exp; diff --git a/src/MIDebugEngine/Natvis.Impl/Natvis.cs b/src/MIDebugEngine/Natvis.Impl/Natvis.cs index 5bc7cede3..eb15f85c1 100755 --- a/src/MIDebugEngine/Natvis.Impl/Natvis.cs +++ b/src/MIDebugEngine/Natvis.Impl/Natvis.cs @@ -426,7 +426,8 @@ internal IVariableInformation[] Expand(IVariableInformation variable) internal IVariableInformation GetVariable(string expr, AD7StackFrame frame) { IVariableInformation variable; - if (expr.EndsWith(",viz", StringComparison.Ordinal)) + if (!EngineUtils.IsConsoleExecCmd(expr, out string _, out string _) + && expr.EndsWith(",viz", StringComparison.Ordinal)) { expr = expr.Substring(0, expr.Length - 4); variable = new VariableInformation(expr, expr, frame.ThreadContext, frame.Engine, frame.Thread); 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 diff --git a/src/MIDebugPackage/MIDebugPackage.csproj b/src/MIDebugPackage/MIDebugPackage.csproj index f7f9c4f1e..67e436c68 100755 --- a/src/MIDebugPackage/MIDebugPackage.csproj +++ b/src/MIDebugPackage/MIDebugPackage.csproj @@ -58,7 +58,6 @@ - Always true diff --git a/src/MIDebugPackage/MIDebugPackagePackage.cs b/src/MIDebugPackage/MIDebugPackagePackage.cs index 0623ee658..c28fe9162 100644 --- a/src/MIDebugPackage/MIDebugPackagePackage.cs +++ b/src/MIDebugPackage/MIDebugPackagePackage.cs @@ -31,10 +31,7 @@ namespace Microsoft.MIDebugPackage /// // This attribute tells the PkgDef creation utility (CreatePkgDef.exe) that this class is // a package. - [PackageRegistration(UseManagedResourcesOnly = true)] - // This attribute is used to register the information needed to show this package - // in the Help/About dialog of Visual Studio. - [InstalledProductRegistration("#110", "#112", "1.0", IconResourceID = 400)] + [PackageRegistration(UseManagedResourcesOnly = true)] // This attribute is needed to let the shell know that this package exposes some menus. [ProvideMenuResource("Menus.ctmenu", 1)] [Guid(GuidList.guidMIDebugPackagePkgString)] diff --git a/src/MIDebugPackage/Resources/Package.ico b/src/MIDebugPackage/Resources/Package.ico deleted file mode 100644 index 449296f49..000000000 Binary files a/src/MIDebugPackage/Resources/Package.ico and /dev/null differ diff --git a/src/MIDebugPackage/VSPackage.resx b/src/MIDebugPackage/VSPackage.resx index 4e8035774..1af7de150 100644 --- a/src/MIDebugPackage/VSPackage.resx +++ b/src/MIDebugPackage/VSPackage.resx @@ -117,14 +117,4 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Microsoft MI-Based Debugger - - - Provides support for connecting Visual Studio to MI compatible debuggers - - - - Resources\Package.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - \ No newline at end of file