Merge pull request #33 from MyvarHD/master

Added Unbox
This commit is contained in:
Matthijs ter Woord 2014-12-20 18:50:33 +01:00
commit fa1499a77e
5 changed files with 1707 additions and 1663 deletions

View file

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@ -14,7 +14,7 @@
<!-- Looks like this was a mispelled attribute. Replaced by DebugEnabled below. <!-- Looks like this was a mispelled attribute. Replaced by DebugEnabled below.
<DebugEnable>true</DebugEnable> <DebugEnable>true</DebugEnable>
--> -->
<DebugEnabled>true</DebugEnabled> <DebugEnabled>True</DebugEnabled>
<DebugMode>Source</DebugMode> <DebugMode>Source</DebugMode>
<TraceMode>User</TraceMode> <TraceMode>User</TraceMode>
<EnableGDB>False</EnableGDB> <EnableGDB>False</EnableGDB>
@ -26,6 +26,43 @@
<Deployment>ISO</Deployment> <Deployment>ISO</Deployment>
<Launch>VMware</Launch> <Launch>VMware</Launch>
<VisualStudioDebugPort>Pipe: Cosmos\Serial</VisualStudioDebugPort> <VisualStudioDebugPort>Pipe: Cosmos\Serial</VisualStudioDebugPort>
<StackCorruptionDetectionEnabled>True</StackCorruptionDetectionEnabled>
<VMware_Name>TestBedBoot</VMware_Name>
<VMware_Description>Use VMware Player or Workstation to deploy and debug.</VMware_Description>
<VMware_Deployment>ISO</VMware_Deployment>
<VMware_Launch>VMware</VMware_Launch>
<VMware_DebugEnabled>True</VMware_DebugEnabled>
<VMware_StackCorruptionDetectionEnabled>True</VMware_StackCorruptionDetectionEnabled>
<VMware_DebugMode>Source</VMware_DebugMode>
<VMware_VisualStudioDebugPort>Pipe: Cosmos\Serial</VMware_VisualStudioDebugPort>
<VMware_VMwareEdition>Player</VMware_VMwareEdition>
<VMware_OutputPath>bin\Debug\</VMware_OutputPath>
<VMware_EnableGDB>False</VMware_EnableGDB>
<VMware_StartCosmosGDB>false</VMware_StartCosmosGDB>
<PXE_Name>TestBedBoot</PXE_Name>
<PXE_Description>Creates a PXE setup and hosts a DCHP and TFTP server to deploy directly to physical hardware. Allows debugging with a serial cable.</PXE_Description>
<PXE_Deployment>PXE</PXE_Deployment>
<PXE_Launch>None</PXE_Launch>
<PXE_DebugEnabled>False</PXE_DebugEnabled>
<PXE_StackCorruptionDetectionEnabled>True</PXE_StackCorruptionDetectionEnabled>
<PXE_DebugMode>Source</PXE_DebugMode>
<PXE_VisualStudioDebugPort>Pipe: Cosmos\Serial</PXE_VisualStudioDebugPort>
<PXE_VMwareEdition>Player</PXE_VMwareEdition>
<PXE_OutputPath>bin\Debug\</PXE_OutputPath>
<PXE_EnableGDB>False</PXE_EnableGDB>
<PXE_StartCosmosGDB>false</PXE_StartCosmosGDB>
<ISO_Name>TestBedBoot</ISO_Name>
<ISO_Description>Creates a bootable ISO image which can be burned to a DVD. After running the selected project, an explorer window will open containing the ISO file. The ISO file can then be burned to a CD or DVD and used to boot a physical or virtual system.</ISO_Description>
<ISO_Deployment>ISO</ISO_Deployment>
<ISO_Launch>None</ISO_Launch>
<ISO_DebugEnabled>False</ISO_DebugEnabled>
<ISO_StackCorruptionDetectionEnabled>True</ISO_StackCorruptionDetectionEnabled>
<ISO_DebugMode>Source</ISO_DebugMode>
<ISO_VisualStudioDebugPort>Pipe: Cosmos\Serial</ISO_VisualStudioDebugPort>
<ISO_VMwareEdition>Player</ISO_VMwareEdition>
<ISO_OutputPath>bin\Debug\</ISO_OutputPath>
<ISO_EnableGDB>False</ISO_EnableGDB>
<ISO_StartCosmosGDB>false</ISO_StartCosmosGDB>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include=".\TestBed.csproj"> <ProjectReference Include=".\TestBed.csproj">

View file

@ -42,6 +42,8 @@ namespace Cosmos.IL2CPU.ILOpCodes {
return 0; return 0;
case Code.Unbox_Any: case Code.Unbox_Any:
return 1; return 1;
case Code.Unbox:
return 1;
default: default:
throw new NotImplementedException("OpCode '" + OpCode + "' not implemented! Encountered in method " + aMethod.ToString()); throw new NotImplementedException("OpCode '" + OpCode + "' not implemented! Encountered in method " + aMethod.ToString());
} }
@ -71,6 +73,8 @@ namespace Cosmos.IL2CPU.ILOpCodes {
return 0; return 0;
case Code.Unbox_Any: case Code.Unbox_Any:
return 1; return 1;
case Code.Unbox:
return 1;
default: default:
throw new NotImplementedException("OpCode '" + OpCode + "' not implemented!"); throw new NotImplementedException("OpCode '" + OpCode + "' not implemented!");
} }
@ -102,6 +106,9 @@ namespace Cosmos.IL2CPU.ILOpCodes {
case Code.Unbox_Any: case Code.Unbox_Any:
StackPushTypes[0] = Value; StackPushTypes[0] = Value;
return; return;
case Code.Unbox:
StackPushTypes[0] = Value;
return;
case Code.Newarr: case Code.Newarr:
StackPushTypes[0] = Value.MakeArrayType(); StackPushTypes[0] = Value.MakeArrayType();
return; return;

View file

@ -55,6 +55,7 @@
this.tabDebug = new System.Windows.Forms.TabPage(); this.tabDebug = new System.Windows.Forms.TabPage();
this.chckEnableDebugStub = new System.Windows.Forms.CheckBox(); this.chckEnableDebugStub = new System.Windows.Forms.CheckBox();
this.panlDebugSettings = new System.Windows.Forms.Panel(); this.panlDebugSettings = new System.Windows.Forms.Panel();
this.chkEnableStackCorruptionDetection = new System.Windows.Forms.CheckBox();
this.label4 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label();
this.cmboVisualStudioDebugPort = new System.Windows.Forms.ComboBox(); this.cmboVisualStudioDebugPort = new System.Windows.Forms.ComboBox();
this.comboTraceMode = new System.Windows.Forms.ComboBox(); this.comboTraceMode = new System.Windows.Forms.ComboBox();
@ -85,7 +86,6 @@
this.tabSlave = new System.Windows.Forms.TabPage(); this.tabSlave = new System.Windows.Forms.TabPage();
this.cmboSlavePort = new System.Windows.Forms.ComboBox(); this.cmboSlavePort = new System.Windows.Forms.ComboBox();
this.label6 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label();
this.chkEnableStackCorruptionDetection = new System.Windows.Forms.CheckBox();
this.panel1.SuspendLayout(); this.panel1.SuspendLayout();
this.TabControl1.SuspendLayout(); this.TabControl1.SuspendLayout();
this.tabProfile.SuspendLayout(); this.tabProfile.SuspendLayout();
@ -153,7 +153,7 @@
this.TabControl1.Name = "TabControl1"; this.TabControl1.Name = "TabControl1";
this.TabControl1.SelectedIndex = 0; this.TabControl1.SelectedIndex = 0;
this.TabControl1.Size = new System.Drawing.Size(635, 413); this.TabControl1.Size = new System.Drawing.Size(635, 413);
this.TabControl1.TabIndex = 4; this.TabControl1.TabIndex = 1;
// //
// tabProfile // tabProfile
// //
@ -198,7 +198,7 @@
this.lboxProfile.Name = "lboxProfile"; this.lboxProfile.Name = "lboxProfile";
this.lboxProfile.Size = new System.Drawing.Size(200, 356); this.lboxProfile.Size = new System.Drawing.Size(200, 356);
this.lboxProfile.Sorted = true; this.lboxProfile.Sorted = true;
this.lboxProfile.TabIndex = 4; this.lboxProfile.TabIndex = 3;
// //
// toolStrip1 // toolStrip1
// //
@ -209,7 +209,7 @@
this.toolStrip1.Location = new System.Drawing.Point(0, 0); this.toolStrip1.Location = new System.Drawing.Point(0, 0);
this.toolStrip1.Name = "toolStrip1"; this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.Size = new System.Drawing.Size(200, 25); this.toolStrip1.Size = new System.Drawing.Size(200, 25);
this.toolStrip1.TabIndex = 3; this.toolStrip1.TabIndex = 2;
this.toolStrip1.Text = "toolStrip1"; this.toolStrip1.Text = "toolStrip1";
// //
// butnProfileClone // butnProfileClone
@ -285,7 +285,7 @@
this.comboFramework.Location = new System.Drawing.Point(34, 87); this.comboFramework.Location = new System.Drawing.Point(34, 87);
this.comboFramework.Name = "comboFramework"; this.comboFramework.Name = "comboFramework";
this.comboFramework.Size = new System.Drawing.Size(228, 21); this.comboFramework.Size = new System.Drawing.Size(228, 21);
this.comboFramework.TabIndex = 22; this.comboFramework.TabIndex = 5;
// //
// buttonOutputBrowse // buttonOutputBrowse
// //
@ -318,7 +318,7 @@
this.textOutputPath.Location = new System.Drawing.Point(34, 38); this.textOutputPath.Location = new System.Drawing.Point(34, 38);
this.textOutputPath.Name = "textOutputPath"; this.textOutputPath.Name = "textOutputPath";
this.textOutputPath.Size = new System.Drawing.Size(390, 20); this.textOutputPath.Size = new System.Drawing.Size(390, 20);
this.textOutputPath.TabIndex = 18; this.textOutputPath.TabIndex = 4;
// //
// labelFramework // labelFramework
// //
@ -357,7 +357,7 @@
this.checkUseInternalAssembler.Margin = new System.Windows.Forms.Padding(22, 12, 3, 3); this.checkUseInternalAssembler.Margin = new System.Windows.Forms.Padding(22, 12, 3, 3);
this.checkUseInternalAssembler.Name = "checkUseInternalAssembler"; this.checkUseInternalAssembler.Name = "checkUseInternalAssembler";
this.checkUseInternalAssembler.Size = new System.Drawing.Size(146, 19); this.checkUseInternalAssembler.Size = new System.Drawing.Size(146, 19);
this.checkUseInternalAssembler.TabIndex = 21; this.checkUseInternalAssembler.TabIndex = 6;
this.checkUseInternalAssembler.Text = "Use Internal Assembler"; this.checkUseInternalAssembler.Text = "Use Internal Assembler";
this.checkUseInternalAssembler.UseVisualStyleBackColor = true; this.checkUseInternalAssembler.UseVisualStyleBackColor = true;
// //
@ -390,7 +390,7 @@
this.chckEnableDebugStub.Location = new System.Drawing.Point(14, 17); this.chckEnableDebugStub.Location = new System.Drawing.Point(14, 17);
this.chckEnableDebugStub.Name = "chckEnableDebugStub"; this.chckEnableDebugStub.Name = "chckEnableDebugStub";
this.chckEnableDebugStub.Size = new System.Drawing.Size(154, 17); this.chckEnableDebugStub.Size = new System.Drawing.Size(154, 17);
this.chckEnableDebugStub.TabIndex = 34; this.chckEnableDebugStub.TabIndex = 7;
this.chckEnableDebugStub.Text = "Enable Remote Debugging"; this.chckEnableDebugStub.Text = "Enable Remote Debugging";
this.chckEnableDebugStub.UseVisualStyleBackColor = true; this.chckEnableDebugStub.UseVisualStyleBackColor = true;
// //
@ -411,6 +411,17 @@
this.panlDebugSettings.Size = new System.Drawing.Size(280, 285); this.panlDebugSettings.Size = new System.Drawing.Size(280, 285);
this.panlDebugSettings.TabIndex = 33; this.panlDebugSettings.TabIndex = 33;
// //
// chkEnableStackCorruptionDetection
//
this.chkEnableStackCorruptionDetection.AutoSize = true;
this.chkEnableStackCorruptionDetection.Location = new System.Drawing.Point(8, 11);
this.chkEnableStackCorruptionDetection.Name = "chkEnableStackCorruptionDetection";
this.chkEnableStackCorruptionDetection.Size = new System.Drawing.Size(190, 17);
this.chkEnableStackCorruptionDetection.TabIndex = 8;
this.chkEnableStackCorruptionDetection.Text = "Enable Stack Corruption Detection";
this.chkEnableStackCorruptionDetection.UseVisualStyleBackColor = true;
this.chkEnableStackCorruptionDetection.CheckedChanged += new System.EventHandler(this.chkEnableStacckCorruptionDetection_CheckedChanged);
//
// label4 // label4
// //
this.label4.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label4.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
@ -436,7 +447,7 @@
this.cmboVisualStudioDebugPort.Name = "cmboVisualStudioDebugPort"; this.cmboVisualStudioDebugPort.Name = "cmboVisualStudioDebugPort";
this.cmboVisualStudioDebugPort.Size = new System.Drawing.Size(221, 21); this.cmboVisualStudioDebugPort.Size = new System.Drawing.Size(221, 21);
this.cmboVisualStudioDebugPort.Sorted = true; this.cmboVisualStudioDebugPort.Sorted = true;
this.cmboVisualStudioDebugPort.TabIndex = 32; this.cmboVisualStudioDebugPort.TabIndex = 13;
// //
// comboTraceMode // comboTraceMode
// //
@ -445,7 +456,7 @@
this.comboTraceMode.Location = new System.Drawing.Point(23, 109); this.comboTraceMode.Location = new System.Drawing.Point(23, 109);
this.comboTraceMode.Name = "comboTraceMode"; this.comboTraceMode.Name = "comboTraceMode";
this.comboTraceMode.Size = new System.Drawing.Size(221, 21); this.comboTraceMode.Size = new System.Drawing.Size(221, 21);
this.comboTraceMode.TabIndex = 25; this.comboTraceMode.TabIndex = 10;
// //
// cmboCosmosDebugPort // cmboCosmosDebugPort
// //
@ -461,7 +472,7 @@
this.cmboCosmosDebugPort.Name = "cmboCosmosDebugPort"; this.cmboCosmosDebugPort.Name = "cmboCosmosDebugPort";
this.cmboCosmosDebugPort.Size = new System.Drawing.Size(221, 21); this.cmboCosmosDebugPort.Size = new System.Drawing.Size(221, 21);
this.cmboCosmosDebugPort.Sorted = true; this.cmboCosmosDebugPort.Sorted = true;
this.cmboCosmosDebugPort.TabIndex = 31; this.cmboCosmosDebugPort.TabIndex = 12;
// //
// comboDebugMode // comboDebugMode
// //
@ -470,7 +481,7 @@
this.comboDebugMode.Location = new System.Drawing.Point(23, 61); this.comboDebugMode.Location = new System.Drawing.Point(23, 61);
this.comboDebugMode.Name = "comboDebugMode"; this.comboDebugMode.Name = "comboDebugMode";
this.comboDebugMode.Size = new System.Drawing.Size(221, 21); this.comboDebugMode.Size = new System.Drawing.Size(221, 21);
this.comboDebugMode.TabIndex = 27; this.comboDebugMode.TabIndex = 9;
// //
// label10 // label10
// //
@ -508,7 +519,7 @@
this.checkIgnoreDebugStubAttribute.Location = new System.Drawing.Point(8, 150); this.checkIgnoreDebugStubAttribute.Location = new System.Drawing.Point(8, 150);
this.checkIgnoreDebugStubAttribute.Name = "checkIgnoreDebugStubAttribute"; this.checkIgnoreDebugStubAttribute.Name = "checkIgnoreDebugStubAttribute";
this.checkIgnoreDebugStubAttribute.Size = new System.Drawing.Size(218, 20); this.checkIgnoreDebugStubAttribute.Size = new System.Drawing.Size(218, 20);
this.checkIgnoreDebugStubAttribute.TabIndex = 28; this.checkIgnoreDebugStubAttribute.TabIndex = 11;
this.checkIgnoreDebugStubAttribute.Text = "Ignore DebugStub Attribute Settings"; this.checkIgnoreDebugStubAttribute.Text = "Ignore DebugStub Attribute Settings";
this.checkIgnoreDebugStubAttribute.UseVisualStyleBackColor = true; this.checkIgnoreDebugStubAttribute.UseVisualStyleBackColor = true;
// //
@ -530,7 +541,7 @@
this.lboxDeployment.Name = "lboxDeployment"; this.lboxDeployment.Name = "lboxDeployment";
this.lboxDeployment.Size = new System.Drawing.Size(206, 387); this.lboxDeployment.Size = new System.Drawing.Size(206, 387);
this.lboxDeployment.Sorted = true; this.lboxDeployment.Sorted = true;
this.lboxDeployment.TabIndex = 3; this.lboxDeployment.TabIndex = 15;
// //
// tabLaunch // tabLaunch
// //
@ -550,7 +561,7 @@
this.lboxLaunch.Name = "lboxLaunch"; this.lboxLaunch.Name = "lboxLaunch";
this.lboxLaunch.Size = new System.Drawing.Size(206, 387); this.lboxLaunch.Size = new System.Drawing.Size(206, 387);
this.lboxLaunch.Sorted = true; this.lboxLaunch.Sorted = true;
this.lboxLaunch.TabIndex = 3; this.lboxLaunch.TabIndex = 16;
// //
// tabVMware // tabVMware
// //
@ -572,7 +583,7 @@
this.checkEnableGDB.Location = new System.Drawing.Point(9, 77); this.checkEnableGDB.Location = new System.Drawing.Point(9, 77);
this.checkEnableGDB.Name = "checkEnableGDB"; this.checkEnableGDB.Name = "checkEnableGDB";
this.checkEnableGDB.Size = new System.Drawing.Size(218, 20); this.checkEnableGDB.Size = new System.Drawing.Size(218, 20);
this.checkEnableGDB.TabIndex = 25; this.checkEnableGDB.TabIndex = 19;
this.checkEnableGDB.Text = "Enable GDB Debugger"; this.checkEnableGDB.Text = "Enable GDB Debugger";
this.checkEnableGDB.UseVisualStyleBackColor = true; this.checkEnableGDB.UseVisualStyleBackColor = true;
// //
@ -584,7 +595,7 @@
this.checkStartCosmosGDB.Margin = new System.Windows.Forms.Padding(25, 3, 3, 3); this.checkStartCosmosGDB.Margin = new System.Windows.Forms.Padding(25, 3, 3, 3);
this.checkStartCosmosGDB.Name = "checkStartCosmosGDB"; this.checkStartCosmosGDB.Name = "checkStartCosmosGDB";
this.checkStartCosmosGDB.Size = new System.Drawing.Size(140, 17); this.checkStartCosmosGDB.Size = new System.Drawing.Size(140, 17);
this.checkStartCosmosGDB.TabIndex = 26; this.checkStartCosmosGDB.TabIndex = 20;
this.checkStartCosmosGDB.Text = "Use Cosmos GDB Client"; this.checkStartCosmosGDB.Text = "Use Cosmos GDB Client";
this.checkStartCosmosGDB.UseVisualStyleBackColor = true; this.checkStartCosmosGDB.UseVisualStyleBackColor = true;
// //
@ -605,7 +616,7 @@
this.cmboVMwareEdition.Name = "cmboVMwareEdition"; this.cmboVMwareEdition.Name = "cmboVMwareEdition";
this.cmboVMwareEdition.Size = new System.Drawing.Size(143, 21); this.cmboVMwareEdition.Size = new System.Drawing.Size(143, 21);
this.cmboVMwareEdition.Sorted = true; this.cmboVMwareEdition.Sorted = true;
this.cmboVMwareEdition.TabIndex = 17; this.cmboVMwareEdition.TabIndex = 18;
// //
// tabBochs // tabBochs
// //
@ -624,7 +635,7 @@
this.checkEnableBochsDebug.Location = new System.Drawing.Point(9, 12); this.checkEnableBochsDebug.Location = new System.Drawing.Point(9, 12);
this.checkEnableBochsDebug.Name = "checkEnableBochsDebug"; this.checkEnableBochsDebug.Name = "checkEnableBochsDebug";
this.checkEnableBochsDebug.Size = new System.Drawing.Size(218, 20); this.checkEnableBochsDebug.Size = new System.Drawing.Size(218, 20);
this.checkEnableBochsDebug.TabIndex = 25; this.checkEnableBochsDebug.TabIndex = 21;
this.checkEnableBochsDebug.Text = "Enable Bochs Debugger"; this.checkEnableBochsDebug.Text = "Enable Bochs Debugger";
this.checkEnableBochsDebug.UseVisualStyleBackColor = true; this.checkEnableBochsDebug.UseVisualStyleBackColor = true;
// //
@ -645,7 +656,7 @@
this.textPxeInterface.Location = new System.Drawing.Point(28, 32); this.textPxeInterface.Location = new System.Drawing.Point(28, 32);
this.textPxeInterface.Name = "textPxeInterface"; this.textPxeInterface.Name = "textPxeInterface";
this.textPxeInterface.Size = new System.Drawing.Size(146, 20); this.textPxeInterface.Size = new System.Drawing.Size(146, 20);
this.textPxeInterface.TabIndex = 1; this.textPxeInterface.TabIndex = 22;
// //
// label1 // label1
// //
@ -721,7 +732,7 @@
this.cmboSlavePort.Name = "cmboSlavePort"; this.cmboSlavePort.Name = "cmboSlavePort";
this.cmboSlavePort.Size = new System.Drawing.Size(146, 21); this.cmboSlavePort.Size = new System.Drawing.Size(146, 21);
this.cmboSlavePort.Sorted = true; this.cmboSlavePort.Sorted = true;
this.cmboSlavePort.TabIndex = 35; this.cmboSlavePort.TabIndex = 23;
// //
// label6 // label6
// //
@ -732,17 +743,6 @@
this.label6.TabIndex = 34; this.label6.TabIndex = 34;
this.label6.Text = "Slave Port:"; this.label6.Text = "Slave Port:";
// //
// chkEnableStackCorruptionDetection
//
this.chkEnableStackCorruptionDetection.AutoSize = true;
this.chkEnableStackCorruptionDetection.Location = new System.Drawing.Point(8, 11);
this.chkEnableStackCorruptionDetection.Name = "chkEnableStackCorruptionDetection";
this.chkEnableStackCorruptionDetection.Size = new System.Drawing.Size(190, 17);
this.chkEnableStackCorruptionDetection.TabIndex = 35;
this.chkEnableStackCorruptionDetection.Text = "Enable Stack Corruption Detection";
this.chkEnableStackCorruptionDetection.UseVisualStyleBackColor = true;
this.chkEnableStackCorruptionDetection.CheckedChanged += new System.EventHandler(this.chkEnableStacckCorruptionDetection_CheckedChanged);
//
// CosmosPage // CosmosPage
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);