Debugger stuff, and changing to vcproj's/sln.

This commit is contained in:
Ben Vanik
2015-05-09 17:48:12 -07:00
parent 4411a4499d
commit 7a00b76a6e
97 changed files with 4039 additions and 1643 deletions

View File

@@ -1,4 +1,4 @@
namespace Xenia.Debugger {
namespace Xenia.Debug.UI {
partial class Form1 {
/// <summary>
/// Required designer variable.

View File

@@ -8,13 +8,10 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Xenia.Debugger
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
namespace Xenia.Debug.UI {
public partial class Form1 : Form {
public Form1() {
InitializeComponent();
}
}
}

View File

@@ -1,16 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Xenia.Debugger {
namespace Xenia.Debug.UI {
static class Program {
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main() {
[STAThread] static void Main() {
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());

View File

@@ -5,12 +5,12 @@ using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Xenia.Debugger")]
[assembly: AssemblyTitle("Xenia.Debug.UI")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Xenia.Debugger")]
[assembly: AssemblyCopyright("Copyright © Ben Vanik 2015")]
[assembly: AssemblyProduct("Xenia.Debug.UI")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -20,7 +20,7 @@ using System.Runtime.InteropServices;
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("f3714614-7970-4dd3-acb7-ca0c122dd073")]
[assembly: Guid("75a94ceb-442c-45b6-aeec-a5f16d4543f3")]
// Version information for an assembly consists of the following four values:
//

View File

@@ -8,7 +8,9 @@
// </auto-generated>
//------------------------------------------------------------------------------
namespace Xenia.Debugger.Properties {
namespace Xenia.Debug.UI.Properties {
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
@@ -36,7 +38,7 @@ namespace Xenia.Debugger.Properties {
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if ((resourceMan == null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Xenia.Debugger.Properties.Resources", typeof(Resources).Assembly);
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Xenia.Debug.UI.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;

View File

@@ -8,7 +8,9 @@
// </auto-generated>
//------------------------------------------------------------------------------
namespace Xenia.Debugger.Properties {
namespace Xenia.Debug.UI.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {

View File

@@ -4,17 +4,18 @@
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{F3714614-7970-4DD3-ACB7-CA0C122DD073}</ProjectGuid>
<ProjectGuid>{75A94CEB-442C-45B6-AEEC-A5F16D4543F3}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Xenia.Debugger</RootNamespace>
<AssemblyName>Xenia.Debugger</AssemblyName>
<RootNamespace>Xenia.Debug.UI</RootNamespace>
<AssemblyName>Xenia.Debug.UI</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\..\build\xenia\Debug\</OutputPath>
<OutputPath>..\..\build\bin\Debug\</OutputPath>
<IntermediateOutputPath>..\..\build\obj\Debug\</IntermediateOutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
@@ -23,7 +24,8 @@
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>..\..\build\xenia\Release\</OutputPath>
<OutputPath>..\..\build\bin\Release\</OutputPath>
<IntermediateOutputPath>..\..\build\obj\Release\</IntermediateOutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
@@ -33,7 +35,7 @@
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<StartupObject>Xenia.Debugger.Program</StartupObject>
<StartupObject>Xenia.Debug.UI.Program</StartupObject>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
@@ -84,6 +86,10 @@
<Project>{c75532c4-765b-418e-b09b-46d36b2abdb1}</Project>
<Name>WinFormsUI</Name>
</ProjectReference>
<ProjectReference Include="..\Xenia.Debug\Xenia.Debug.csproj">
<Project>{58348c66-1b0d-497c-b51a-28e99df1ef74}</Project>
<Name>Xenia.Debug</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Xenia.Debug")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Xenia.Debug")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("58348c66-1b0d-497c-b51a-28e99df1ef74")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{58348C66-1B0D-497C-B51A-28E99DF1EF74}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Xenia.Debug</RootNamespace>
<AssemblyName>Xenia.Debug</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\..\build\bin\Debug\</OutputPath>
<IntermediateOutputPath>..\..\build\obj\Debug\</IntermediateOutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>..\..\build\bin\Release\</OutputPath>
<IntermediateOutputPath>..\..\build\obj\Release\</IntermediateOutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -1,28 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.22823.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xenia.Debugger", "Xenia.Debugger.csproj", "{F3714614-7970-4DD3-ACB7-CA0C122DD073}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinFormsUI", "..\..\third_party\dockpanelsuite\WinFormsUI\WinFormsUI.csproj", "{C75532C4-765B-418E-B09B-46D36B2ABDB1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F3714614-7970-4DD3-ACB7-CA0C122DD073}.Debug|x64.ActiveCfg = Debug|x64
{F3714614-7970-4DD3-ACB7-CA0C122DD073}.Debug|x64.Build.0 = Debug|x64
{F3714614-7970-4DD3-ACB7-CA0C122DD073}.Release|x64.ActiveCfg = Release|x64
{F3714614-7970-4DD3-ACB7-CA0C122DD073}.Release|x64.Build.0 = Release|x64
{C75532C4-765B-418E-B09B-46D36B2ABDB1}.Debug|x64.ActiveCfg = Debug|Any CPU
{C75532C4-765B-418E-B09B-46D36B2ABDB1}.Debug|x64.Build.0 = Debug|Any CPU
{C75532C4-765B-418E-B09B-46D36B2ABDB1}.Release|x64.ActiveCfg = Release|Any CPU
{C75532C4-765B-418E-B09B-46D36B2ABDB1}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@@ -1,10 +0,0 @@
# Copyright 2013 Ben Vanik. All Rights Reserved.
{
'sources': [
'nop_apu-private.h',
'nop_apu.cc',
'nop_apu.h',
'nop_audio_system.cc',
'nop_audio_system.h',
],
}

View File

@@ -1,24 +0,0 @@
# Copyright 2013 Ben Vanik. All Rights Reserved.
{
'sources': [
'apu-private.h',
'apu.cc',
'apu.h',
'audio_driver.cc',
'audio_driver.h',
'audio_system.cc',
'audio_system.h',
],
'includes': [
'nop/sources.gypi',
],
'conditions': [
['OS == "win"', {
'includes': [
'xaudio2/sources.gypi',
],
}],
],
}

View File

@@ -1,12 +0,0 @@
# Copyright 2013 Ben Vanik. All Rights Reserved.
{
'sources': [
'xaudio2_apu-private.h',
'xaudio2_apu.cc',
'xaudio2_apu.h',
'xaudio2_audio_driver.cc',
'xaudio2_audio_driver.h',
'xaudio2_audio_system.cc',
'xaudio2_audio_system.h',
],
}

View File

@@ -1,64 +0,0 @@
# Copyright 2014 Ben Vanik. All Rights Reserved.
{
'sources': [
'arena.cc',
'arena.h',
'assert.h',
'atomic.h',
'byte_order.h',
'debugging.h',
'delegate.h',
'fs.h',
'fs.cc',
'logging.cc',
'logging.h',
'main.h',
'mapped_memory.h',
'math.cc',
'math.h',
'memory_generic.cc',
'memory.h',
'platform.h',
'reset_scope.h',
'string.cc',
'string.h',
'string_buffer.cc',
'string_buffer.h',
'threading.cc',
'threading.h',
'type_pool.h',
'vec128.h',
],
'conditions': [
['OS == "mac" or OS == "linux"', {
'sources': [
'main_posix.cc',
'mapped_memory_posix.cc',
],
}],
['OS == "linux"', {
'sources': [
'threading_posix.cc',
],
}],
['OS == "mac"', {
'sources': [
'debugging_mac.cc',
'threading_mac.cc',
],
}],
['OS == "win"', {
'sources': [
'debugging_win.cc',
'fs_win.cc',
'main_win.cc',
'mapped_memory_win.cc',
'threading_win.cc',
],
}],
],
'includes': [
],
}

View File

@@ -47,17 +47,19 @@ void StringBuffer::AppendVarargs(const char* format, va_list args) {
int length = vsnprintf(nullptr, 0, format, args);
auto offset = buffer_.size();
Grow(length + 1);
buffer_.resize(buffer_.size() + length);
buffer_.resize(buffer_.size() + length + 1);
vsnprintf(buffer_.data() + offset, buffer_.capacity(), format, args);
buffer_[buffer_.size()] = 0;
buffer_[buffer_.size() - 1] = 0;
buffer_.resize(buffer_.size() - 1);
}
void StringBuffer::AppendBytes(const uint8_t* buffer, size_t length) {
auto offset = buffer_.size();
Grow(length + 1);
buffer_.resize(buffer_.size() + length);
buffer_.resize(buffer_.size() + length + 1);
memcpy(buffer_.data() + offset, buffer, length);
buffer_[buffer_.size()] = 0;
buffer_[buffer_.size() - 1] = 0;
buffer_.resize(buffer_.size() - 1);
}
const char* StringBuffer::GetString() const { return buffer_.data(); }

View File

@@ -1,18 +0,0 @@
/**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2014 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
#include "xenia/base/threading.h"
namespace xe {
namespace threading {
//
} // namespace threading
} // namespace xe

View File

@@ -1,14 +0,0 @@
# Copyright 2013 Ben Vanik. All Rights Reserved.
{
'sources': [
'assembler.cc',
'assembler.h',
'backend.cc',
'backend.h',
'machine_info.h',
],
'includes': [
'x64/sources.gypi',
],
}

View File

@@ -1,34 +0,0 @@
# Copyright 2013 Ben Vanik. All Rights Reserved.
{
'sources': [
'x64_assembler.cc',
'x64_assembler.h',
'x64_backend.cc',
'x64_backend.h',
'x64_code_cache.h',
'x64_emitter.cc',
'x64_emitter.h',
'x64_function.cc',
'x64_function.h',
'x64_sequence.inl',
'x64_sequences.cc',
'x64_sequences.h',
'x64_thunk_emitter.cc',
'x64_thunk_emitter.h',
'x64_tracers.cc',
'x64_tracers.h',
],
'conditions': [
['OS == "mac" or OS == "linux"', {
'sources': [
'x64_code_cache_posix.cc',
],
}],
['OS == "win"', {
'sources': [
'x64_code_cache_win.cc',
],
}],
],
}

View File

@@ -13,6 +13,7 @@
#include "xenia/cpu/backend/x64/x64_backend.h"
#include "xenia/cpu/backend/x64/x64_emitter.h"
#include "xenia/cpu/backend/x64/x64_function.h"
#include "xenia/cpu/cpu-private.h"
#include "xenia/cpu/hir/hir_builder.h"
#include "xenia/cpu/hir/label.h"
#include "xenia/cpu/processor.h"
@@ -81,6 +82,14 @@ bool X64Assembler::Assemble(FunctionInfo* symbol_info, HIRBuilder* builder,
string_buffer_.Reset();
}
// Dump debug data.
//auto fn_data = backend_->processor()->debugger()->
if (FLAGS_disassemble_functions) {
if (debug_info_flags & DebugInfoFlags::kDebugInfoDisasmSource) {
//
}
}
{
X64Function* fn = new X64Function(symbol_info);
fn->set_debug_info(std::move(debug_info));

View File

@@ -15,7 +15,7 @@
#include "xenia/base/arena.h"
#include "xenia/cpu/hir/value.h"
#include "xenia/debug/trace_data.h"
#include "xenia/debug/function_trace_data.h"
namespace xe {
namespace cpu {

View File

@@ -210,8 +210,9 @@ void RegisterAllocationPass::AdvanceUses(Instr* instr) {
if (!usage_set) {
break;
}
std::vector<RegisterUsage> to_add;
auto& upcoming_uses = usage_set->upcoming_uses;
for (auto it = upcoming_uses.begin(); it != upcoming_uses.end();) {
for (auto& it = upcoming_uses.begin(); it != upcoming_uses.end();) {
if (!it->use) {
// No uses at all - we can remove right away.
// This comes up from instructions where the dest is never used,
@@ -243,9 +244,12 @@ void RegisterAllocationPass::AdvanceUses(Instr* instr) {
it = upcoming_uses.erase(it);
assert_true(next_use->instr->block == instr->block);
assert_true(value->def->block == instr->block);
upcoming_uses.emplace_back(value, next_use);
to_add.emplace_back(value, next_use);
}
}
for (auto& use : to_add) {
upcoming_uses.emplace_back(use);
}
}
DumpUsage("AdvanceUses");
}

View File

@@ -1,29 +0,0 @@
# Copyright 2013 Ben Vanik. All Rights Reserved.
{
'sources': [
'constant_propagation_pass.cc',
'constant_propagation_pass.h',
'context_promotion_pass.cc',
'context_promotion_pass.h',
'control_flow_analysis_pass.cc',
'control_flow_analysis_pass.h',
'control_flow_simplification_pass.cc',
'control_flow_simplification_pass.h',
'data_flow_analysis_pass.cc',
'data_flow_analysis_pass.h',
'dead_code_elimination_pass.cc',
'dead_code_elimination_pass.h',
'finalization_pass.cc',
'finalization_pass.h',
#'dead_store_elimination_pass.cc',
#'dead_store_elimination_pass.h',
'register_allocation_pass.cc',
'register_allocation_pass.h',
'simplification_pass.cc',
'simplification_pass.h',
'validation_pass.cc',
'validation_pass.h',
'value_reduction_pass.cc',
'value_reduction_pass.h',
],
}

View File

@@ -1,14 +0,0 @@
# Copyright 2013 Ben Vanik. All Rights Reserved.
{
'sources': [
'compiler.cc',
'compiler.h',
'compiler_pass.cc',
'compiler_pass.h',
'compiler_passes.h',
],
'includes': [
'passes/sources.gypi',
],
}

View File

@@ -21,6 +21,7 @@ DECLARE_bool(dump_module_map);
DECLARE_bool(debug);
DECLARE_bool(always_disasm);
DECLARE_bool(disassemble_functions);
DECLARE_bool(trace_functions);
DECLARE_bool(trace_function_coverage);

View File

@@ -35,6 +35,8 @@ DEFINE_bool(debug, DEFAULT_DEBUG_FLAG,
DEFINE_bool(
always_disasm, false,
"Always add debug info to functions, even when no debugger is attached.");
DEFINE_bool(disassemble_functions, false,
"Disassemble functions during generation.");
DEFINE_bool(trace_functions, false,
"Generate tracing for function statistics.");

View File

@@ -13,7 +13,8 @@
#include <cstddef>
#include <cstdint>
#include "xenia/debug/trace_data.h"
#include "xenia/debug/function_data.h"
#include "xenia/debug/function_trace_data.h"
namespace xe {
namespace cpu {

View File

@@ -134,11 +134,13 @@ bool PPCTranslator::Translate(FunctionInfo* symbol_info,
symbol_info->address(), symbol_info->end_address());
}
uint8_t* trace_data =
frontend_->processor()->debugger()->AllocateTraceFunctionData(
frontend_->processor()->debugger()->AllocateFunctionTraceData(
trace_data_size);
debug_info->trace_data().Reset(trace_data, trace_data_size,
symbol_info->address(),
symbol_info->end_address());
if (trace_data) {
debug_info->trace_data().Reset(trace_data, trace_data_size,
symbol_info->address(),
symbol_info->end_address());
}
}
// Stash source.

View File

@@ -1,32 +0,0 @@
# Copyright 2013 Ben Vanik. All Rights Reserved.
{
'sources': [
'context_info.cc',
'context_info.h',
'ppc_context.cc',
'ppc_context.h',
'ppc_disasm.cc',
'ppc_disasm.h',
'ppc_emit-private.h',
'ppc_emit.h',
'ppc_emit_altivec.cc',
'ppc_emit_alu.cc',
'ppc_emit_control.cc',
'ppc_emit_fpu.cc',
'ppc_emit_memory.cc',
'ppc_frontend.cc',
'ppc_frontend.h',
'ppc_hir_builder.cc',
'ppc_hir_builder.h',
'ppc_instr.cc',
'ppc_instr.h',
'ppc_instr_tables.h',
'ppc_scanner.cc',
'ppc_scanner.h',
'ppc_translator.cc',
'ppc_translator.h',
],
'includes': [
],
}

View File

@@ -1,27 +0,0 @@
# Copyright 2014 Ben Vanik. All Rights Reserved.
{
'targets': [
{
'target_name': 'xe-cpu-ppc-test',
'type': 'executable',
'msvs_settings': {
'VCLinkerTool': {
'SubSystem': '1',
},
},
'dependencies': [
'libxenia',
],
'include_dirs': [
'.',
],
'sources': [
'xe-cpu-ppc-test.cc',
],
},
],
}

View File

@@ -0,0 +1,217 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Checked|x64">
<Configuration>Checked</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{9B8AC22F-9147-490F-BE03-3B8BA31990A8}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>xecpuppctest</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Checked|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\..\build\Xenia.Cpp.x64.Common.props" />
<Import Project="..\..\..\..\..\build\Xenia.Cpp.x64.Debug.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Checked|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\..\build\Xenia.Cpp.x64.Common.props" />
<Import Project="..\..\..\..\..\build\Xenia.Cpp.x64.Debug.props" />
<Import Project="..\..\..\..\..\build\Xenia.Cpp.x64.Checked.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\..\build\Xenia.Cpp.x64.Common.props" />
<Import Project="..\..\..\..\..\build\Xenia.Cpp.x64.Release.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Checked|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>libxenia.lib;ntdll.lib;wsock32.lib;ws2_32.lib;xinput.lib;xaudio2.lib;glu32.lib;opengl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Checked|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>libxenia.lib;ntdll.lib;wsock32.lib;ws2_32.lib;xinput.lib;xaudio2.lib;glu32.lib;opengl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>libxenia.lib;ntdll.lib;wsock32.lib;ws2_32.lib;xinput.lib;xaudio2.lib;glu32.lib;opengl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\base\main_win.cc" />
<ClCompile Include="xe-cpu-ppc-test.cc" />
</ItemGroup>
<ItemGroup>
<None Include="instr_add.s" />
<None Include="instr_addc.s" />
<None Include="instr_adde.s" />
<None Include="instr_addic.s" />
<None Include="instr_addme.s" />
<None Include="instr_addze.s" />
<None Include="instr_cntlzd.s" />
<None Include="instr_cntlzw.s" />
<None Include="instr_divd.s" />
<None Include="instr_divdu.s" />
<None Include="instr_divw.s" />
<None Include="instr_divwu.s" />
<None Include="instr_eqv.s" />
<None Include="instr_fabs.s" />
<None Include="instr_fsel.s" />
<None Include="instr_lvexx.s" />
<None Include="instr_lvl.s" />
<None Include="instr_lvr.s" />
<None Include="instr_lvsl.s" />
<None Include="instr_lvsr.s" />
<None Include="instr_mulhd.s" />
<None Include="instr_mulhdu.s" />
<None Include="instr_mulhw.s" />
<None Include="instr_mulhwu.s" />
<None Include="instr_mulld.s" />
<None Include="instr_mulli.s" />
<None Include="instr_mullw.s" />
<None Include="instr_neg.s" />
<None Include="instr_nor.s" />
<None Include="instr_ori.s" />
<None Include="instr_rldicl.s" />
<None Include="instr_rldicr.s" />
<None Include="instr_rlwimi.s" />
<None Include="instr_rlwinm.s" />
<None Include="instr_rlwnm.s" />
<None Include="instr_sld.s" />
<None Include="instr_slw.s" />
<None Include="instr_srad.s" />
<None Include="instr_sradi.s" />
<None Include="instr_sraw.s" />
<None Include="instr_srawi.s" />
<None Include="instr_srd.s" />
<None Include="instr_srw.s" />
<None Include="instr_stvew.s" />
<None Include="instr_stvl.s" />
<None Include="instr_stvr.s" />
<None Include="instr_subf.s" />
<None Include="instr_subfc.s" />
<None Include="instr_subfe.s" />
<None Include="instr_subfic.s" />
<None Include="instr_subfme.s" />
<None Include="instr_subfze.s" />
<None Include="instr_vaddshs.s" />
<None Include="instr_vadduhm.s" />
<None Include="instr_vcfsx.s" />
<None Include="instr_vcmpxxfp.s" />
<None Include="instr_vctsxs.s" />
<None Include="instr_vmrghb.s" />
<None Include="instr_vmrghh.s" />
<None Include="instr_vmrghw.s" />
<None Include="instr_vmrglb.s" />
<None Include="instr_vmrglh.s" />
<None Include="instr_vmrglw.s" />
<None Include="instr_vperm.s" />
<None Include="instr_vpermwi128.s" />
<None Include="instr_vpkd3d128.s" />
<None Include="instr_vpkshss.s" />
<None Include="instr_vpkswss.s" />
<None Include="instr_vrfin.s" />
<None Include="instr_vrlimi128.s" />
<None Include="instr_vsel.s" />
<None Include="instr_vslb.s" />
<None Include="instr_vsldoi.s" />
<None Include="instr_vslh.s" />
<None Include="instr_vslw.s" />
<None Include="instr_vspltb.s" />
<None Include="instr_vsplth.s" />
<None Include="instr_vspltisb.s" />
<None Include="instr_vspltish.s" />
<None Include="instr_vspltisw.s" />
<None Include="instr_vspltw.s" />
<None Include="instr_vsubshs.s" />
<None Include="instr_vsubuhm.s" />
<None Include="instr_vupkd3d128.s" />
<None Include="instr_vupkhsh.s" />
<None Include="instr_vupklsh.s" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\base\main.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,113 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="xe-cpu-ppc-test.cc" />
<ClCompile Include="..\..\..\base\main_win.cc">
<Filter>src\xenia\base</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="instr_vupklsh.s" />
<None Include="instr_add.s" />
<None Include="instr_addc.s" />
<None Include="instr_adde.s" />
<None Include="instr_addic.s" />
<None Include="instr_addme.s" />
<None Include="instr_addze.s" />
<None Include="instr_cntlzd.s" />
<None Include="instr_cntlzw.s" />
<None Include="instr_divd.s" />
<None Include="instr_divdu.s" />
<None Include="instr_divw.s" />
<None Include="instr_divwu.s" />
<None Include="instr_eqv.s" />
<None Include="instr_fabs.s" />
<None Include="instr_fsel.s" />
<None Include="instr_lvexx.s" />
<None Include="instr_lvl.s" />
<None Include="instr_lvr.s" />
<None Include="instr_lvsl.s" />
<None Include="instr_lvsr.s" />
<None Include="instr_mulhd.s" />
<None Include="instr_mulhdu.s" />
<None Include="instr_mulhw.s" />
<None Include="instr_mulhwu.s" />
<None Include="instr_mulld.s" />
<None Include="instr_mulli.s" />
<None Include="instr_mullw.s" />
<None Include="instr_neg.s" />
<None Include="instr_nor.s" />
<None Include="instr_ori.s" />
<None Include="instr_rldicl.s" />
<None Include="instr_rldicr.s" />
<None Include="instr_rlwimi.s" />
<None Include="instr_rlwinm.s" />
<None Include="instr_rlwnm.s" />
<None Include="instr_sld.s" />
<None Include="instr_slw.s" />
<None Include="instr_srad.s" />
<None Include="instr_sradi.s" />
<None Include="instr_sraw.s" />
<None Include="instr_srawi.s" />
<None Include="instr_srd.s" />
<None Include="instr_srw.s" />
<None Include="instr_stvew.s" />
<None Include="instr_stvl.s" />
<None Include="instr_stvr.s" />
<None Include="instr_subf.s" />
<None Include="instr_subfc.s" />
<None Include="instr_subfe.s" />
<None Include="instr_subfic.s" />
<None Include="instr_subfme.s" />
<None Include="instr_subfze.s" />
<None Include="instr_vaddshs.s" />
<None Include="instr_vadduhm.s" />
<None Include="instr_vcfsx.s" />
<None Include="instr_vcmpxxfp.s" />
<None Include="instr_vctsxs.s" />
<None Include="instr_vmrghb.s" />
<None Include="instr_vmrghh.s" />
<None Include="instr_vmrghw.s" />
<None Include="instr_vmrglb.s" />
<None Include="instr_vmrglh.s" />
<None Include="instr_vmrglw.s" />
<None Include="instr_vperm.s" />
<None Include="instr_vpermwi128.s" />
<None Include="instr_vpkd3d128.s" />
<None Include="instr_vpkshss.s" />
<None Include="instr_vpkswss.s" />
<None Include="instr_vrfin.s" />
<None Include="instr_vrlimi128.s" />
<None Include="instr_vsel.s" />
<None Include="instr_vslb.s" />
<None Include="instr_vsldoi.s" />
<None Include="instr_vslh.s" />
<None Include="instr_vslw.s" />
<None Include="instr_vspltb.s" />
<None Include="instr_vsplth.s" />
<None Include="instr_vspltisb.s" />
<None Include="instr_vspltish.s" />
<None Include="instr_vspltisw.s" />
<None Include="instr_vspltw.s" />
<None Include="instr_vsubshs.s" />
<None Include="instr_vsubuhm.s" />
<None Include="instr_vupkd3d128.s" />
<None Include="instr_vupkhsh.s" />
</ItemGroup>
<ItemGroup>
<Filter Include="src">
<UniqueIdentifier>{3beca96a-ec9a-4570-8873-3de8c124862f}</UniqueIdentifier>
</Filter>
<Filter Include="src\xenia">
<UniqueIdentifier>{eeea8b16-cc79-4e53-80a4-6db3089e6db9}</UniqueIdentifier>
</Filter>
<Filter Include="src\xenia\base">
<UniqueIdentifier>{459f7c23-b556-4300-b16d-8f86063c8e1a}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\base\main.h">
<Filter>src\xenia\base</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@@ -1,17 +0,0 @@
# Copyright 2013 Ben Vanik. All Rights Reserved.
{
'sources': [
'block.cc',
'block.h',
'hir_builder.cc',
'hir_builder.h',
'instr.cc',
'instr.h',
'label.h',
'opcodes.cc',
'opcodes.h',
'opcodes.inl',
'value.cc',
'value.h',
],
}

View File

@@ -1,62 +0,0 @@
# Copyright 2013 Ben Vanik. All Rights Reserved.
{
'sources': [
'cpu-private.h',
'cpu.cc',
'cpu.h',
'debug_info.cc',
'debug_info.h',
'entry_table.cc',
'entry_table.h',
'export_resolver.cc',
'export_resolver.h',
'function.cc',
'function.h',
'instrument.cc',
'instrument.h',
'mmio_handler.cc',
'mmio_handler.h',
'module.cc',
'module.h',
'processor.cc',
'processor.h',
'raw_module.cc',
'raw_module.h',
'symbol_info.cc',
'symbol_info.h',
'test_module.cc',
'test_module.h',
'thread_state.cc',
'thread_state.h',
'xex_module.cc',
'xex_module.h',
],
'conditions': [
['OS == "mac" or OS == "linux"', {
'sources': [
],
}],
['OS == "linux"', {
'sources': [
],
}],
['OS == "mac"', {
'sources': [
'mmio_handler_mac.cc',
],
}],
['OS == "win"', {
'sources': [
'mmio_handler_win.cc',
],
}],
],
'includes': [
'backend/sources.gypi',
'compiler/sources.gypi',
'frontend/sources.gypi',
'hir/sources.gypi',
],
}

View File

@@ -1,117 +0,0 @@
# Copyright 2014 Ben Vanik. All Rights Reserved.
{
'targets': [
{
'target_name': 'xe-cpu-sandbox',
'type': 'executable',
'msvs_settings': {
'VCLinkerTool': {
'SubSystem': '1'
},
},
'dependencies': [
'libxenia',
],
'include_dirs': [
'.',
],
'sources': [
'xe-cpu-sandbox.cc',
],
},
],
'targets': [
{
'target_name': 'xe-cpu-hir-test',
'type': 'executable',
'msvs_settings': {
'VCLinkerTool': {
'SubSystem': '1'
},
},
'dependencies': [
'libxenia',
],
'include_dirs': [
'.',
],
'sources': [
'xe-cpu-hir-test.cc',
'util.h',
#'test_abs.cc',
'test_add.cc',
#'test_add_carry.cc',
#'test_and.cc',
#'test_assign.cc',
#'test_atomic_add.cc',
#'test_atomic_exchange.cc',
#'test_atomic_sub.cc',
#'test_branch.cc',
'test_byte_swap.cc',
#'test_cast.cc',
#'test_cntlz.cc',
#'test_compare.cc',
#'test_compare_exchange.cc',
#'test_convert.cc',
#'test_did_carry.cc',
#'test_div.cc',
#'test_dot_product_3.cc',
#'test_dot_product_4.cc',
'test_extract.cc',
'test_insert.cc',
#'test_is_true_false.cc',
#'test_load_clock.cc',
'test_load_vector_shl_shr.cc',
#'test_log2.cc',
#'test_max.cc',
#'test_min.cc',
#'test_mul.cc',
#'test_mul_add.cc',
#'test_mul_hi.cc',
#'test_mul_sub.cc',
#'test_neg.cc',
#'test_not.cc',
#'test_or.cc',
'test_pack.cc',
'test_permute.cc',
#'test_pow2.cc',
#'test_rotate_left.cc',
#'test_round.cc',
#'test_rsqrt.cc',
#'test_select.cc',
'test_sha.cc',
'test_shl.cc',
'test_shr.cc',
#'test_sign_extend.cc',
#'test_splat.cc',
#'test_sqrt.cc',
#'test_sub.cc',
'test_swizzle.cc',
#'test_truncate.cc',
'test_unpack.cc',
'test_vector_add.cc',
#'test_vector_compare.cc',
#'test_vector_convert.cc',
'test_vector_max.cc',
'test_vector_min.cc',
'test_vector_rotate_left.cc',
'test_vector_sha.cc',
'test_vector_shl.cc',
'test_vector_shr.cc',
#'test_vector_sub.cc',
#'test_xor.cc',
#'test_zero_extend.cc',
],
},
],
}

View File

@@ -0,0 +1,149 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Checked|x64">
<Configuration>Checked</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{6EC54AD0-4F5B-48D9-B820-43DF2F0DC83C}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>xecpuhirtest</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Checked|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\build\Xenia.Cpp.x64.Common.props" />
<Import Project="..\..\..\..\build\Xenia.Cpp.x64.Debug.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Checked|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\build\Xenia.Cpp.x64.Common.props" />
<Import Project="..\..\..\..\build\Xenia.Cpp.x64.Debug.props" />
<Import Project="..\..\..\..\build\Xenia.Cpp.x64.Checked.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\build\Xenia.Cpp.x64.Common.props" />
<Import Project="..\..\..\..\build\Xenia.Cpp.x64.Release.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Checked|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>libxenia.lib;ntdll.lib;wsock32.lib;ws2_32.lib;xinput.lib;xaudio2.lib;glu32.lib;opengl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Checked|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>libxenia.lib;ntdll.lib;wsock32.lib;ws2_32.lib;xinput.lib;xaudio2.lib;glu32.lib;opengl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>libxenia.lib;ntdll.lib;wsock32.lib;ws2_32.lib;xinput.lib;xaudio2.lib;glu32.lib;opengl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\base\main_win.cc" />
<ClCompile Include="test_add.cc" />
<ClCompile Include="test_byte_swap.cc" />
<ClCompile Include="test_extract.cc" />
<ClCompile Include="test_insert.cc" />
<ClCompile Include="test_load_vector_shl_shr.cc" />
<ClCompile Include="test_pack.cc" />
<ClCompile Include="test_permute.cc" />
<ClCompile Include="test_sha.cc" />
<ClCompile Include="test_shl.cc" />
<ClCompile Include="test_shr.cc" />
<ClCompile Include="test_swizzle.cc" />
<ClCompile Include="test_unpack.cc" />
<ClCompile Include="test_vector_add.cc" />
<ClCompile Include="test_vector_max.cc" />
<ClCompile Include="test_vector_min.cc" />
<ClCompile Include="test_vector_rotate_left.cc" />
<ClCompile Include="test_vector_sha.cc" />
<ClCompile Include="test_vector_shl.cc" />
<ClCompile Include="test_vector_shr.cc" />
<ClCompile Include="xe-cpu-hir-test.cc" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\base\main.h" />
<ClInclude Include="util.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="test_add.cc" />
<ClCompile Include="test_byte_swap.cc" />
<ClCompile Include="test_extract.cc" />
<ClCompile Include="test_insert.cc" />
<ClCompile Include="test_load_vector_shl_shr.cc" />
<ClCompile Include="test_pack.cc" />
<ClCompile Include="test_permute.cc" />
<ClCompile Include="test_sha.cc" />
<ClCompile Include="test_shl.cc" />
<ClCompile Include="test_shr.cc" />
<ClCompile Include="test_swizzle.cc" />
<ClCompile Include="test_unpack.cc" />
<ClCompile Include="test_vector_add.cc" />
<ClCompile Include="test_vector_max.cc" />
<ClCompile Include="test_vector_min.cc" />
<ClCompile Include="test_vector_rotate_left.cc" />
<ClCompile Include="test_vector_sha.cc" />
<ClCompile Include="test_vector_shl.cc" />
<ClCompile Include="test_vector_shr.cc" />
<ClCompile Include="xe-cpu-hir-test.cc" />
<ClCompile Include="..\..\base\main_win.cc">
<Filter>src\xenia\base</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="util.h" />
<ClInclude Include="..\..\base\main.h">
<Filter>src\xenia\base</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Filter Include="src">
<UniqueIdentifier>{cd58f445-4d2f-452b-a5a0-1dd29a620341}</UniqueIdentifier>
</Filter>
<Filter Include="src\xenia">
<UniqueIdentifier>{a43f8164-d83a-4ff6-83a4-1915664abbf9}</UniqueIdentifier>
</Filter>
<Filter Include="src\xenia\base">
<UniqueIdentifier>{1bdcf344-57a7-4b58-93d6-3e860f50ad1b}</UniqueIdentifier>
</Filter>
</ItemGroup>
</Project>

View File

@@ -36,29 +36,44 @@ Debugger::~Debugger() = default;
bool Debugger::StartSession() {
std::wstring session_path = xe::to_wstring(FLAGS_debug_session_path);
std::wstring trace_functions_path =
xe::join_paths(session_path, L"trace.functions");
trace_functions_ = ChunkedMappedMemoryWriter::Open(trace_functions_path,
32 * 1024 * 1024, true);
std::wstring functions_path = xe::join_paths(session_path, L"functions");
functions_file_ =
ChunkedMappedMemoryWriter::Open(functions_path, 32 * 1024 * 1024, false);
std::wstring functions_trace_path =
xe::join_paths(session_path, L"functions.trace");
functions_trace_file_ = ChunkedMappedMemoryWriter::Open(
functions_trace_path, 32 * 1024 * 1024, true);
return true;
}
void Debugger::StopSession() {
FlushSession();
trace_functions_.reset();
functions_file_.reset();
functions_trace_file_.reset();
}
void Debugger::FlushSession() {
if (trace_functions_) {
trace_functions_->Flush();
if (functions_file_) {
functions_file_->Flush();
}
if (functions_trace_file_) {
functions_trace_file_->Flush();
}
}
uint8_t* Debugger::AllocateTraceFunctionData(size_t size) {
if (!trace_functions_) {
uint8_t* Debugger::AllocateFunctionData(size_t size) {
if (!functions_file_) {
return nullptr;
}
return trace_functions_->Allocate(size);
return functions_file_->Allocate(size);
}
uint8_t* Debugger::AllocateFunctionTraceData(size_t size) {
if (!functions_trace_file_) {
return nullptr;
}
return functions_trace_file_->Allocate(size);
}
int Debugger::SuspendAllThreads(uint32_t timeout_ms) {

View File

@@ -71,7 +71,8 @@ class Debugger {
void StopSession();
void FlushSession();
uint8_t* AllocateTraceFunctionData(size_t size);
uint8_t* AllocateFunctionData(size_t size);
uint8_t* AllocateFunctionTraceData(size_t size);
int SuspendAllThreads(uint32_t timeout_ms = UINT_MAX);
int ResumeThread(uint32_t thread_id);
@@ -100,7 +101,8 @@ class Debugger {
private:
cpu::Processor* processor_;
std::unique_ptr<ChunkedMappedMemoryWriter> trace_functions_;
std::unique_ptr<ChunkedMappedMemoryWriter> functions_file_;
std::unique_ptr<ChunkedMappedMemoryWriter> functions_trace_file_;
std::mutex threads_lock_;
std::unordered_map<uint32_t, cpu::ThreadState*> threads_;

View File

@@ -0,0 +1,81 @@
/**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2015 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
#ifndef XENIA_DEBUG_FUNCTION_DATA_H_
#define XENIA_DEBUG_FUNCTION_DATA_H_
#include <cstdint>
#include "xenia/base/memory.h"
namespace xe {
namespace debug {
class FunctionData {
public:
struct Header {
// Format is used by tooling, changes must be made across all targets.
// + 0 4b (data size)
// + 4 4b start_address
// + 8 4b end_address
// +12 4b type (user, external, etc)
// +16 4b source_map_entry_count
//
// +20 4b source_disasm_length
// +20 4b raw_hir_disasm_length
// +20 4b hir_disasm_length
// +20 4b machine_code_disasm_length
// +20 12b* source_map_entries
uint32_t data_size;
uint32_t start_address;
uint32_t end_address;
uint32_t type;
/*
source_map_count
source_map[] : {ppc_address, hir_offset, code_offset}
raw_hir_disasm_ (len + chars)
hir_disasm_ (len + chars)
machine_code_ (len + bytes) (without tracing? regen?)
*/
};
FunctionData() : header_(nullptr) {}
void Reset(uint8_t* trace_data, size_t trace_data_size,
uint32_t start_address, uint32_t end_address) {
header_ = reinterpret_cast<Header*>(trace_data);
header_->data_size = uint32_t(trace_data_size);
header_->start_address = start_address;
header_->end_address = end_address;
header_->type = 0;
// Clear any remaining.
std::memset(trace_data + sizeof(Header), 0,
trace_data_size - sizeof(Header));
}
bool is_valid() const { return header_ != nullptr; }
uint32_t start_address() const { return header_->start_address; }
uint32_t end_address() const { return header_->end_address; }
uint32_t instruction_count() const {
return (header_->end_address - header_->start_address) / 4 + 1;
}
Header* header() const { return header_; }
static size_t SizeOfHeader() { return sizeof(Header); }
private:
Header* header_;
};
} // namespace debug
} // namespace xe
#endif // XENIA_DEBUG_FUNCTION_DATA_H_

View File

@@ -7,8 +7,8 @@
******************************************************************************
*/
#ifndef XENIA_DEBUG_TRACE_DATA_H_
#define XENIA_DEBUG_TRACE_DATA_H_
#ifndef XENIA_DEBUG_FUNCTION_TRACE_DATA_H_
#define XENIA_DEBUG_FUNCTION_TRACE_DATA_H_
#include <cstdint>
@@ -89,4 +89,4 @@ class FunctionTraceData {
} // namespace debug
} // namespace xe
#endif // XENIA_DEBUG_TRACE_DATA_H_
#endif // XENIA_DEBUG_FUNCTION_TRACE_DATA_H_

View File

@@ -1,10 +0,0 @@
# Copyright 2015 Ben Vanik. All Rights Reserved.
{
'sources': [
'debug_server.cc',
'debug_server.h',
'debugger.cc',
'debugger.h',
'trace_data.h',
],
}

View File

@@ -1,37 +0,0 @@
# Copyright 2014 Ben Vanik. All Rights Reserved.
{
'sources': [
'blitter.cc',
'blitter.h',
'circular_buffer.cc',
'circular_buffer.h',
'command_processor.cc',
'command_processor.h',
'draw_batcher.cc',
'draw_batcher.h',
'gl4_gpu-private.h',
'gl4_gpu.cc',
'gl4_gpu.h',
'gl4_graphics_system.cc',
'gl4_graphics_system.h',
'gl4_profiler_display.cc',
'gl4_profiler_display.h',
'gl4_shader.cc',
'gl4_shader.h',
'gl4_shader_translator.cc',
'gl4_shader_translator.h',
'gl_context.cc',
'gl_context.h',
'texture_cache.cc',
'texture_cache.h',
],
'conditions': [
['OS == "win"', {
'sources': [
'wgl_control.cc',
'wgl_control.h',
],
}],
],
}

View File

@@ -1,28 +0,0 @@
# Copyright 2013 Ben Vanik. All Rights Reserved.
{
'sources': [
'gpu-private.h',
'gpu.cc',
'gpu.h',
'graphics_system.cc',
'graphics_system.h',
'register_file.cc',
'register_file.h',
'register_table.inc',
'sampler_info.cc',
'sampler_info.h',
'shader.cc',
'shader.h',
'texture_info.cc',
'texture_info.h',
'tracing.h',
'ucode.h',
'ucode_disassembler.cc',
'ucode_disassembler.h',
'xenos.h',
],
'includes': [
'gl4/sources.gypi',
],
}

View File

@@ -1,10 +0,0 @@
# Copyright 2013 Ben Vanik. All Rights Reserved.
{
'sources': [
'nop_hid-private.h',
'nop_hid.cc',
'nop_hid.h',
'nop_input_driver.cc',
'nop_input_driver.h',
],
}

View File

@@ -1,25 +0,0 @@
# Copyright 2013 Ben Vanik. All Rights Reserved.
{
'sources': [
'hid-private.h',
'hid.cc',
'hid.h',
'input_driver.cc',
'input_driver.h',
'input_system.cc',
'input_system.h',
],
'includes': [
'nop/sources.gypi',
],
'conditions': [
['OS == "win"', {
'includes': [
'winkey/sources.gypi',
'xinput/sources.gypi',
],
}],
],
}

View File

@@ -1,10 +0,0 @@
# Copyright 2013 Ben Vanik. All Rights Reserved.
{
'sources': [
'winkey_hid-private.h',
'winkey_hid.cc',
'winkey_hid.h',
'winkey_input_driver.cc',
'winkey_input_driver.h',
],
}

View File

@@ -1,10 +0,0 @@
# Copyright 2013 Ben Vanik. All Rights Reserved.
{
'sources': [
'xinput_hid-private.h',
'xinput_hid.cc',
'xinput_hid.h',
'xinput_input_driver.cc',
'xinput_input_driver.h',
],
}

View File

@@ -1,13 +0,0 @@
# Copyright 2013 Ben Vanik. All Rights Reserved.
{
'sources': [
'apps.cc',
'apps.h',
'xgi_app.cc',
'xgi_app.h',
'xlivebase_app.cc',
'xlivebase_app.h',
'xmp_app.cc',
'xmp_app.h',
],
}

View File

@@ -1,23 +0,0 @@
# Copyright 2013 Ben Vanik. All Rights Reserved.
{
'sources': [
'disc_image_device.cc',
'disc_image_device.h',
'disc_image_entry.cc',
'disc_image_entry.h',
'disc_image_file.cc',
'disc_image_file.h',
'host_path_device.cc',
'host_path_device.h',
'host_path_entry.cc',
'host_path_entry.h',
'host_path_file.cc',
'host_path_file.h',
'stfs_container_device.cc',
'stfs_container_device.h',
'stfs_container_entry.cc',
'stfs_container_entry.h',
'stfs_container_file.cc',
'stfs_container_file.h',
],
}

View File

@@ -1,19 +0,0 @@
# Copyright 2013 Ben Vanik. All Rights Reserved.
{
'sources': [
'device.cc',
'device.h',
'entry.cc',
'entry.h',
'filesystem.cc',
'filesystem.h',
'gdfx.cc',
'gdfx.h',
'stfs.cc',
'stfs.h',
],
'includes': [
'devices/sources.gypi',
],
}

View File

@@ -1,27 +0,0 @@
# Copyright 2013 Ben Vanik. All Rights Reserved.
{
'sources': [
'xenumerator.cc',
'xenumerator.h',
'xevent.cc',
'xevent.h',
'xfile.cc',
'xfile.h',
'xkernel_module.cc',
'xkernel_module.h',
'xmodule.cc',
'xmodule.h',
'xmutant.cc',
'xmutant.h',
'xnotify_listener.cc',
'xnotify_listener.h',
'xsemaphore.cc',
'xsemaphore.h',
'xthread.cc',
'xthread.h',
'xtimer.cc',
'xtimer.h',
'xuser_module.cc',
'xuser_module.h',
],
}

View File

@@ -1,67 +0,0 @@
# Copyright 2013 Ben Vanik. All Rights Reserved.
{
'sources': [
'app.cc',
'app.h',
'async_request.cc',
'async_request.h',
'content_manager.cc',
'content_manager.h',
'dispatcher.cc',
'dispatcher.h',
'kernel.h',
'kernel_state.cc',
'kernel_state.h',
'modules.h',
'native_list.cc',
'native_list.h',
'object_table.cc',
'object_table.h',
'user_profile.cc',
'user_profile.h',
'xam_content.cc',
'xam_info.cc',
'xam_input.cc',
'xam_module.cc',
'xam_module.h',
'xam_msg.cc',
'xam_net.cc',
'xam_notify.cc',
'xam_ordinals.h',
'xam_private.h',
'xam_table.inc',
'xam_ui.cc',
'xam_user.cc',
'xam_video.cc',
'xam_voice.cc',
'xboxkrnl_audio.cc',
'xboxkrnl_audio_xma.cc',
'xboxkrnl_debug.cc',
'xboxkrnl_hal.cc',
'xboxkrnl_io.cc',
'xboxkrnl_memory.cc',
'xboxkrnl_misc.cc',
'xboxkrnl_module.cc',
'xboxkrnl_module.h',
'xboxkrnl_modules.cc',
'xboxkrnl_ob.cc',
'xboxkrnl_ordinals.h',
'xboxkrnl_private.h',
'xboxkrnl_rtl.cc',
'xboxkrnl_rtl.h',
'xboxkrnl_strings.cc',
'xboxkrnl_table.inc',
'xboxkrnl_threading.cc',
'xboxkrnl_usbcam.cc',
'xboxkrnl_video.cc',
'xobject.cc',
'xobject.h',
],
'includes': [
'apps/sources.gypi',
'fs/sources.gypi',
'objects/sources.gypi',
'util/sources.gypi',
],
}

View File

@@ -1,13 +0,0 @@
# Copyright 2013 Ben Vanik. All Rights Reserved.
{
'sources': [
'export_table_post.inc',
'export_table_pre.inc',
'ordinal_table_post.inc',
'ordinal_table_pre.inc',
'shim_utils.h',
'xex2.cc',
'xex2.h',
'xex2_info.h',
],
}

View File

@@ -16,7 +16,6 @@
#include "xenia/base/platform.h"
#include "xenia/cpu/mmio_handler.h"
#include "xenia/memory.h"
namespace xe {

View File

@@ -1,24 +0,0 @@
# Copyright 2013 Ben Vanik. All Rights Reserved.
{
'sources': [
'emulator.cc',
'emulator.h',
'memory.cc',
'memory.h',
'profiling.cc',
'profiling.h',
'xbox.h',
# xenia_main.cc is purposefully omitted as it's used in another target.
],
'includes': [
'apu/sources.gypi',
'base/sources.gypi',
'cpu/sources.gypi',
'debug/sources.gypi',
'gpu/sources.gypi',
'hid/sources.gypi',
'kernel/sources.gypi',
'ui/sources.gypi',
],
}

View File

@@ -1,8 +0,0 @@
# Copyright 2015 x1nixmzeng. All Rights Reserved.
{
'sources': [
'api_scanner_loader.cc',
'api_scanner_loader.h',
'api_scanner_main.cc'
]
}

View File

@@ -1,22 +0,0 @@
# Copyright 2014 Ben Vanik. All Rights Reserved.
{
'sources': [
'control.cc',
'control.h',
'loop.h',
'main_window.cc',
'main_window.h',
'menu_item.cc',
'menu_item.h',
'ui_event.h',
'window.h',
],
'conditions': [
['OS == "win"', {
'includes': [
'win32/sources.gypi',
],
}],
],
}

View File

@@ -1,13 +0,0 @@
# Copyright 2014 Ben Vanik. All Rights Reserved.
{
'sources': [
'win32_control.cc',
'win32_control.h',
'win32_loop.cc',
'win32_loop.h',
'win32_menu_item.cc',
'win32_menu_item.h',
'win32_window.cc',
'win32_window.h',
],
}