mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-10-04 11:19:27 +02:00
Add GDB Stub
This commit is contained in:
@@ -64,6 +64,10 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
private string _ldnPassphrase;
|
||||
private string _LdnServer;
|
||||
|
||||
private bool _enableGDBStub;
|
||||
private ushort _gdbStubPort;
|
||||
private bool _debuggerSuspendOnStart;
|
||||
|
||||
public int ResolutionScale
|
||||
{
|
||||
get => _resolutionScale;
|
||||
@@ -384,6 +388,36 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
public bool EnableGdbStub
|
||||
{
|
||||
get => _enableGDBStub;
|
||||
set
|
||||
{
|
||||
_enableGDBStub = value;
|
||||
ConfigurationState.Instance.Debug.EnableGdbStub.Value = _enableGDBStub;
|
||||
}
|
||||
}
|
||||
|
||||
public ushort GDBStubPort
|
||||
{
|
||||
get => _gdbStubPort;
|
||||
set
|
||||
{
|
||||
_gdbStubPort = value;
|
||||
ConfigurationState.Instance.Debug.GdbStubPort.Value = _gdbStubPort;
|
||||
}
|
||||
}
|
||||
|
||||
public bool DebuggerSuspendOnStart
|
||||
{
|
||||
get => _debuggerSuspendOnStart;
|
||||
set
|
||||
{
|
||||
_debuggerSuspendOnStart = value;
|
||||
ConfigurationState.Instance.Debug.DebuggerSuspendOnStart.Value = _debuggerSuspendOnStart;
|
||||
}
|
||||
}
|
||||
|
||||
public SettingsViewModel(VirtualFileSystem virtualFileSystem, ContentManager contentManager) : this()
|
||||
{
|
||||
_virtualFileSystem = virtualFileSystem;
|
||||
@@ -612,10 +646,16 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
FsGlobalAccessLogMode = config.System.FsGlobalAccessLogMode;
|
||||
OpenglDebugLevel = (int)config.Logger.GraphicsDebugLevel.Value;
|
||||
|
||||
// Multiplayer
|
||||
MultiplayerModeIndex = (int)config.Multiplayer.Mode.Value;
|
||||
DisableP2P = config.Multiplayer.DisableP2p.Value;
|
||||
LdnPassphrase = config.Multiplayer.LdnPassphrase.Value;
|
||||
LdnServer = config.Multiplayer.LdnServer.Value;
|
||||
|
||||
// Debug
|
||||
EnableGdbStub = config.Debug.EnableGdbStub.Value;
|
||||
GDBStubPort = config.Debug.GdbStubPort.Value;
|
||||
DebuggerSuspendOnStart = config.Debug.DebuggerSuspendOnStart.Value;
|
||||
}
|
||||
|
||||
public void SaveSettings()
|
||||
@@ -732,12 +772,18 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
config.System.FsGlobalAccessLogMode.Value = FsGlobalAccessLogMode;
|
||||
config.Logger.GraphicsDebugLevel.Value = (GraphicsDebugLevel)OpenglDebugLevel;
|
||||
|
||||
// Multiplayer
|
||||
config.Multiplayer.LanInterfaceId.Value = _networkInterfaces[NetworkInterfaceList[NetworkInterfaceIndex]];
|
||||
config.Multiplayer.Mode.Value = (MultiplayerMode)MultiplayerModeIndex;
|
||||
config.Multiplayer.DisableP2p.Value = DisableP2P;
|
||||
config.Multiplayer.LdnPassphrase.Value = LdnPassphrase;
|
||||
config.Multiplayer.LdnServer.Value = LdnServer;
|
||||
|
||||
// Debug
|
||||
config.Debug.EnableGdbStub.Value = EnableGdbStub;
|
||||
config.Debug.GdbStubPort.Value = GDBStubPort;
|
||||
config.Debug.DebuggerSuspendOnStart.Value = DebuggerSuspendOnStart;
|
||||
|
||||
config.ToFileFormat().SaveConfig(Program.ConfigurationPath);
|
||||
|
||||
MainWindow.UpdateGraphicsConfig();
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
<UserControl
|
||||
x:Class="Ryujinx.Ava.UI.Views.Settings.SettingsDebugView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
|
||||
xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels"
|
||||
xmlns:locale="clr-namespace:Ryujinx.Ava.Common.Locale"
|
||||
mc:Ignorable="d"
|
||||
x:DataType="viewModels:SettingsViewModel">
|
||||
<Design.DataContext>
|
||||
<viewModels:SettingsViewModel />
|
||||
</Design.DataContext>
|
||||
<ScrollViewer
|
||||
Name="DebugPage"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
HorizontalScrollBarVisibility="Disabled"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
<Border Classes="settings">
|
||||
<StackPanel
|
||||
Margin="10"
|
||||
HorizontalAlignment="Stretch"
|
||||
Orientation="Vertical"
|
||||
Spacing="10">
|
||||
<TextBlock Classes="h1" Text="{locale:Locale SettingsTabDebugTitle}" />
|
||||
<TextBlock Foreground="{DynamicResource SecondaryTextColor}" Text="{locale:Locale SettingsTabDebugNote}" />
|
||||
<StackPanel
|
||||
Margin="10,0,0,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
Orientation="Vertical">
|
||||
<CheckBox IsChecked="{Binding EnableGdbStub}">
|
||||
<TextBlock Text="{locale:Locale SettingsTabDebugEnableGDBStub}"
|
||||
ToolTip.Tip="{locale:Locale SettingsTabDebugGDBStubToggleTooltip}" />
|
||||
</CheckBox>
|
||||
</StackPanel>
|
||||
<StackPanel
|
||||
Margin="10,0,0,0"
|
||||
Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center"
|
||||
Text="{locale:Locale SettingsTabDebugGDBStubPort}"
|
||||
Width="250" />
|
||||
<ui:NumberBox Value="{Binding GDBStubPort}"
|
||||
Width="350"
|
||||
SmallChange="1"
|
||||
LargeChange="10"
|
||||
SimpleNumberFormat="F0"
|
||||
SpinButtonPlacementMode="Inline"
|
||||
Minimum="1024"
|
||||
Maximum="65535" />
|
||||
</StackPanel>
|
||||
<StackPanel
|
||||
Margin="10,0,0,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
Orientation="Vertical">
|
||||
<CheckBox IsChecked="{Binding DebuggerSuspendOnStart}">
|
||||
<TextBlock Text="{locale:Locale SettingsTabDebugSuspendOnStart}"
|
||||
ToolTip.Tip="{locale:Locale SettingsTabDebugSuspendOnStartTooltip}" />
|
||||
</CheckBox>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</ScrollViewer>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,13 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Ryujinx.Ava.UI.Views.Settings
|
||||
{
|
||||
public partial class SettingsDebugView : UserControl
|
||||
{
|
||||
public SettingsDebugView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
<settings:SettingsAudioView Name="AudioPage" />
|
||||
<settings:SettingsNetworkView Name="NetworkPage" />
|
||||
<settings:SettingsLoggingView Name="LoggingPage" />
|
||||
<settings:SettingsDebugView Name="DebugPage" />
|
||||
</Grid>
|
||||
<ui:NavigationView
|
||||
Grid.Row="1"
|
||||
@@ -92,6 +93,10 @@
|
||||
Content="{locale:Locale SettingsTabLogging}"
|
||||
Tag="LoggingPage"
|
||||
IconSource="Document" />
|
||||
<ui:NavigationViewItem
|
||||
Content="{locale:Locale SettingsTabDebug}"
|
||||
Tag="DebugPage"
|
||||
IconSource="Star" />
|
||||
</ui:NavigationView.MenuItems>
|
||||
<ui:NavigationView.Styles>
|
||||
<Style Selector="Grid#PlaceholderGrid">
|
||||
|
||||
@@ -86,6 +86,9 @@ namespace Ryujinx.Ava.UI.Windows
|
||||
case "LoggingPage":
|
||||
NavPanel.Content = LoggingPage;
|
||||
break;
|
||||
case "DebugPage":
|
||||
NavPanel.Content = DebugPage;
|
||||
break;
|
||||
default:
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user