Pass down debugger factory

This commit is contained in:
Yoshi Askharoun
2025-07-29 00:06:38 -05:00
parent 83916964dd
commit d56d55dce8
4 changed files with 29 additions and 12 deletions
+12 -3
View File
@@ -28,7 +28,7 @@ namespace ZuneHost.Wpf
// Construct a single string of args. Be sure to skip executing path.
var args = Environment.GetCommandLineArgs().Skip(1);
#if DEBUG
args = args.Concat(new[] { $"-uixdebuguri", });
//args = args.Concat(new[] { $"-uixdebuguri", });
#endif
string strArgs = string.Join(" ", args.ToArray());
@@ -75,7 +75,11 @@ namespace ZuneHost.Wpf
IrisApp.DebugSettings.DataMappingModels.CollectionChanged += DataMappingModels_CollectionChanged;
}
// Set decompiler breakponts
// Set decompiler breakpoints
IrisApp.DebugSettings.Breakpoints.Add(new("clr-res://ZuneShell!AddToCollection.uix", 325, true));
IrisApp.DebugSettings.Breakpoints.Add(new("clr-res://ZuneShell!Styles.uix", 0x83, true));
IrisApp.DebugSettings.Breakpoints.Add(new("clr-res://ZuneShell!NowPlayingLand.uix", 2104, 28, true));
IrisApp.DebugSettings.Breakpoints.Add(new("clr-res://ZuneShell!NowPlayingLand.uix", 0x336C, true));
IrisApp.DebugSettings.Breakpoints.Add(new("clr-res://ZuneShell!QuickplayStrip.uix", 172, 25, false));
IrisApp.DebugSettings.Breakpoints.Add(new("clr-res://ZuneMarketplaceResources!SelectionActions.uix", 121, 14, false));
IrisApp.DebugSettings.Breakpoints.Add(new("clr-res://ZuneShell!Quickplay.uix", 917, 62, false));
@@ -89,7 +93,12 @@ namespace ZuneHost.Wpf
UIXControls.Helpers.AddUIXControlsClrRedirect();
};
Microsoft.Zune.Shell.ZuneApplication.Launch(strArgs, hWnd);
Microsoft.Zune.Shell.ZuneApplication.Launch(strArgs, hWnd, () =>
{
var debugger = new Microsoft.Iris.Debug.InProcDebugger();
//debugger.InterpreterExecute += Bridge_InterpreterStep;
return debugger;
});
}));
zuneThread.Start();
}
+10 -6
View File
@@ -5,6 +5,7 @@
// Assembly location: C:\Program Files\Zune\ZuneShell.dll
using Microsoft.Iris;
using Microsoft.Iris.Debug;
using Microsoft.Win32;
using Microsoft.Zune.Configuration;
using Microsoft.Zune.Util;
@@ -15,7 +16,9 @@ namespace Microsoft.Zune.Shell
{
internal class StandAlone
{
public static Hashtable Startup(string[] args, string defaultCommandLineSwitch)
public static Hashtable Startup(string[] args, string defaultCommandLineSwitch) => Startup(args, defaultCommandLineSwitch, null);
public static Hashtable Startup(string[] args, string defaultCommandLineSwitch, Func<IDebuggerServer> debuggerFactory)
{
WindowSize windowSize = new WindowSize(1012, 693);
string textDirectionOption = null;
@@ -62,23 +65,24 @@ namespace Microsoft.Zune.Shell
catch (FormatException) { }
break;
case "uixdebuguri":
Application.DebugSettings.DebugConnectionUri = commandLineArgument.Value ?? Iris.Debug.DebugRemoting.DEFAULT_TCP_URI.OriginalString;
var debugConnectionUri = commandLineArgument.Value ?? DebugRemoting.DEFAULT_TCP_URI.OriginalString;
debuggerFactory = () => new Iris.Debug.SystemNet.NetDebuggerServer(debugConnectionUri);
break;
case "uixtrace":
try
{
int idx = commandLineArgument.Value.IndexOf(':');
byte level;
Iris.Debug.TraceCategory cat;
TraceCategory cat;
if (idx != -1)
{
level = byte.Parse(commandLineArgument.Value.Substring(idx + 1));
cat = (Iris.Debug.TraceCategory)Enum.Parse(typeof(Iris.Debug.TraceCategory), commandLineArgument.Value.Substring(0, idx));
cat = (TraceCategory)Enum.Parse(typeof(TraceCategory), commandLineArgument.Value.Substring(0, idx));
}
else
{
level = 1;
cat = (Iris.Debug.TraceCategory)Enum.Parse(typeof(Iris.Debug.TraceCategory), commandLineArgument.Value);
cat = (TraceCategory)Enum.Parse(typeof(TraceCategory), commandLineArgument.Value);
}
Application.DebugSettings.TraceSettings.SetCategoryLevel(cat, level);
}
@@ -126,7 +130,7 @@ namespace Microsoft.Zune.Shell
Application.IsRTL = true;
}
Application.Initialize();
Application.Initialize(debuggerFactory);
Application.Window.InitialClientSize = windowSize;
#if WINDOWS
@@ -5,6 +5,7 @@
// Assembly location: C:\Program Files\Zune\ZuneShell.dll
using Microsoft.Iris;
using Microsoft.Iris.Debug;
using Microsoft.Win32;
using Microsoft.Zune.Configuration;
using Microsoft.Zune.Messaging;
@@ -431,11 +432,14 @@ namespace Microsoft.Zune.Shell
}
[STAThread]
public static int Launch(string strArgs, IntPtr hWndSplashScreen)
public static int Launch(string strArgs, IntPtr hWndSplashScreen) => Launch(strArgs, hWndSplashScreen, null);
[STAThread]
public static int Launch(string strArgs, IntPtr hWndSplashScreen, Func<IDebuggerServer> debuggerFactory)
{
PerfTrace.PerfTrace.PERFTRACE_LAUNCHEVENT(PerfTrace.PerfTrace.LAUNCH_EVENT.IN_MANAGED_LAUNCH, 0U);
Application.ErrorReport += new ErrorReportHandler(ErrorReportHandler);
Hashtable hashtable = StandAlone.Startup(SplitCommandLineArguments(strArgs), DefaultCommandLineParameterSwitch);
Hashtable hashtable = StandAlone.Startup(SplitCommandLineArguments(strArgs), DefaultCommandLineParameterSwitch, debuggerFactory);
if (hashtable != null)
{
_unprocessedAppArgs = new List<Hashtable>();