Skip to content

Commit

Permalink
Remove full debug mode from command options completely. Translate ful…
Browse files Browse the repository at this point in the history
…l/pdbonly/portable into portable within MSBuild task.
  • Loading branch information
wasabii committed Dec 19, 2024
1 parent 09e58a1 commit 71da61a
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 15 deletions.
3 changes: 1 addition & 2 deletions src/IKVM.MSBuild.Tasks/IkvmCompiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,7 @@ protected override async Task<bool> ExecuteAsync(IkvmToolTaskDiagnosticWriter wr
options.Debug = Debug?.ToLower() switch
{
"none" or "" or null => IkvmImporterDebugMode.None,
"portable" => IkvmImporterDebugMode.Portable,
"full" or "pdbonly" => IkvmImporterDebugMode.Full,
"full" or "pdbonly" or "portable" => IkvmImporterDebugMode.Portable,
"embedded" => IkvmImporterDebugMode.Embedded,
_ => throw new NotImplementedException($"Unknown Debug option '{Debug}'.")
};
Expand Down
2 changes: 2 additions & 0 deletions src/IKVM.MSBuild.Tests/ProjectTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ public static void ClassCleanup()
[DataRow(EnvironmentPreference.Core, "net8.0", "linux-musl-arm64", "{0}", "lib{0}.so")]
[DataRow(EnvironmentPreference.Core, "net8.0", "osx-x64", "{0}", "lib{0}.dylib")]
[DataRow(EnvironmentPreference.Core, "net8.0", "osx-arm64", "{0}", "lib{0}.dylib")]
[DataRow(EnvironmentPreference.Core, "net8.0", "android-arm64", "{0}", "lib{0}.so")]
[DataRow(EnvironmentPreference.Framework, "net472", "win-x86", "{0}.exe", "{0}.dll")]
[DataRow(EnvironmentPreference.Framework, "net472", "win-x64", "{0}.exe", "{0}.dll")]
[DataRow(EnvironmentPreference.Framework, "net472", "win-arm64", "{0}.exe", "{0}.dll")]
Expand Down Expand Up @@ -228,6 +229,7 @@ public static void ClassCleanup()
[DataRow(EnvironmentPreference.Framework, "net8.0", "linux-musl-arm64", "{0}", "lib{0}.so")]
[DataRow(EnvironmentPreference.Framework, "net8.0", "osx-x64", "{0}", "lib{0}.dylib")]
[DataRow(EnvironmentPreference.Framework, "net8.0", "osx-arm64", "{0}", "lib{0}.dylib")]
[DataRow(EnvironmentPreference.Framework, "net8.0", "android-arm64", "{0}", "lib{0}.so")]
public void CanBuildTestProject(EnvironmentPreference env, string tfm, string rid, string exe, string lib)
{
// skip framework tests for non-Windows platforms
Expand Down
2 changes: 2 additions & 0 deletions src/IKVM.NET.Sdk.Tests/ProjectTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ public static void ClassCleanup()
[DataRow(EnvironmentPreference.Core, "net8.0", "linux-musl-arm64", "{0}", "lib{0}.so")]
[DataRow(EnvironmentPreference.Core, "net8.0", "osx-x64", "{0}", "lib{0}.dylib")]
[DataRow(EnvironmentPreference.Core, "net8.0", "osx-arm64", "{0}", "lib{0}.dylib")]
[DataRow(EnvironmentPreference.Core, "net8.0", "android-arm64", "{0}", "lib{0}.so")]
[DataRow(EnvironmentPreference.Framework, "net472", "win-x86", "{0}.exe", "{0}.dll")]
[DataRow(EnvironmentPreference.Framework, "net472", "win-x64", "{0}.exe", "{0}.dll")]
[DataRow(EnvironmentPreference.Framework, "net48", "win-x86", "{0}.exe", "{0}.dll")]
Expand Down Expand Up @@ -226,6 +227,7 @@ public static void ClassCleanup()
[DataRow(EnvironmentPreference.Framework, "net8.0", "linux-musl-arm64", "{0}", "lib{0}.so")]
[DataRow(EnvironmentPreference.Framework, "net8.0", "osx-x64", "{0}", "lib{0}.dylib")]
[DataRow(EnvironmentPreference.Framework, "net8.0", "osx-arm64", "{0}", "lib{0}.dylib")]
[DataRow(EnvironmentPreference.Framework, "net8.0", "android-arm64", "{0}", "lib{0}.so")]
public async System.Threading.Tasks.Task CanBuildTestProject(EnvironmentPreference env, string tfm, string rid, string exe, string lib)
{
// skip framework tests for non-Windows platforms
Expand Down
5 changes: 0 additions & 5 deletions src/IKVM.Tools.Importer/DebugMode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ enum DebugMode
/// </summary>
None,

/// <summary>
/// Emit debugging information to .pdb file using default format for the current platform: Windows PDB on Windows, Portable PDB on other systems.
/// </summary>
Full,

/// <summary>
/// Emit debugging information to to .pdb file using cross-platform Portable PDB format
/// </summary>
Expand Down
5 changes: 2 additions & 3 deletions src/IKVM.Tools.Importer/ImportContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -521,9 +521,8 @@ void ContinueParseCommandLine(RuntimeContext context, StaticCompiler compiler, I

switch (options.Debug)
{
case ImportDebug.Full:
compilerOptions.codegenoptions |= CodeGenOptions.EmitSymbols;
compilerOptions.debugMode = DebugMode.Full;
case ImportDebug.None:
compilerOptions.debugMode = DebugMode.None;
break;
case ImportDebug.Portable:
compilerOptions.codegenoptions |= CodeGenOptions.EmitSymbols;
Expand Down
3 changes: 1 addition & 2 deletions src/IKVM.Tools.Importer/ImportDebug.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
enum ImportDebug
{

Unspecified,
Full,
None,
Portable,
Embedded,

Expand Down
2 changes: 1 addition & 1 deletion src/IKVM.Tools.Importer/ImportOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class ImportOptions : ICloneable
/// <summary>
/// How debug symbols should be produced along with the assembly.
/// </summary>
public ImportDebug Debug { get; set; } = ImportDebug.Unspecified;
public ImportDebug Debug { get; set; } = ImportDebug.None;

/// <summary>
/// Whether to disable auto generation of serialization capabilities.
Expand Down
2 changes: 1 addition & 1 deletion src/IKVM.Tools.Importer/ImportOptionsBinding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ protected override ImportOptions GetBoundValue(BindingContext context)
if (context.ParseResult.GetValueForOption(command.DelaySignOption) is true)
options.DelaySign = true;

if (GetParsedEnumValueForOption(context, command.DebugOption, ImportDebug.Unspecified) is ImportDebug _debug and not ImportDebug.Unspecified)
if (GetParsedEnumValueForOption(context, command.DebugOption, ImportDebug.None) is ImportDebug _debug and not ImportDebug.None)
options.Debug = _debug;

if (context.ParseResult.GetValueForOption(command.DeterministicOption) is false)
Expand Down
1 change: 0 additions & 1 deletion src/IKVM.Tools.Runner/Importer/IkvmImporterDebugMode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ public enum IkvmImporterDebugMode
{

None,
Full,
Portable,
Embedded,

Expand Down

0 comments on commit 71da61a

Please sign in to comment.