first commit

This commit is contained in:
murdle
2026-03-01 02:38:58 +02:00
commit 19250b9db4
19111 changed files with 4358159 additions and 0 deletions

View File

@@ -0,0 +1,78 @@
// =================================================================================================================================
// This sample demonstrates how to use the Server API to send allocs, reallocs and frees directly to the client. It also shows
// how to configure multiple heaps.
// =================================================================================================================================
#include "../../Server/HeapInspectorServer.h"
#include <stdlib.h>
using namespace HeapInspectorServer;
void Wait(int a_MilliSeconds);
std::vector<HeapInfo> GetHeapInfo()
{
std::vector<HeapInfo> result;
HeapInfo heapInfo;
heapInfo.m_Description = "Heap1";
heapInfo.m_Range.m_Min = 0;
heapInfo.m_Range.m_Max = 0x80000000 - 1;
result.push_back(heapInfo);
heapInfo.m_Description = "Heap2";
heapInfo.m_Range.m_Min = 0;
heapInfo.m_Range.m_Max = 0x80000000 - 1;
result.push_back(heapInfo);
return result;
}
void* Alloc(uint32 a_Size, int a_Heap)
{
Mutation mutation = BeginAlloc();
void* mem = malloc(a_Size);
EndAlloc(mutation, a_Heap, mem, a_Size, a_Size);
return mem;
}
void Free(void* a_Block, int a_Heap)
{
Mutation mutation = BeginFree();
free(a_Block);
EndFree(mutation, a_Heap, a_Block);
}
void* ReAlloc(void* a_OldBlock, uint32 a_Size, int a_Heap)
{
Mutation mutation = BeginReAlloc();
void* mem = realloc(a_OldBlock, a_Size);
EndReAlloc(mutation, a_Heap, a_OldBlock, mem, a_Size, a_Size);
return mem;
}
void RunHeapInspectorServer()
{
Initialise(GetHeapInfo(), 3000, WaitForConnection_Enabled);
while (1)
{
void* mem1;
void* memB;
mem1 = Alloc(16, 0);
memB = Alloc(1024, 1);
Wait(100);
void* mem2 = ReAlloc(mem1, 32, 0);
Wait(100);
Free(mem2, 0);
Free(memB, 1);
Wait(100);
}
Shutdown();
}

View File

@@ -0,0 +1,7 @@
void RunHeapInspectorServer();
int main(int /*a_ArgC*/, const char* /*a_ArgV[]*/)
{
RunHeapInspectorServer();
}

View File

@@ -0,0 +1,183 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9,00"
Name="ManualSample"
ProjectGUID="{EE51F556-4CCE-4D4C-96C3-B271CC035C6E}"
RootNamespace="BasicServerSample"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="PS3 Debug|Win32"
OutputDirectory="Debug_VS2008"
IntermediateDirectory="Debug_VS2008"
ConfigurationType="1"
DeleteExtensionsOnClean="*.obj;*.d;*.map;*.lst;*.pch;$(TargetPath);$(TargetDir)$(TargetName).self"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="-g -Wall -fno-exceptions -fno-rtti"
AdditionalIncludeDirectories="&quot;$(SN_PS3_PATH)\ppu\include\sn&quot;;&quot;$(SCE_PS3_ROOT)\target\ppu\include&quot;;&quot;$(SCE_PS3_ROOT)\target\common\include&quot;"
PreprocessorDefinitions="SN_TARGET_PS3;_DEBUG;__GCC__;__CELL_ASSERT__;HEAPINSPECTOR_PS3=1"
ProgramDataBaseFileName=""
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="-fno-exceptions -fno-rtti"
AdditionalDependencies="&quot;$(SN_PS3_PATH)\ppu\lib\sn\libsn.a&quot; &quot;$(SCE_PS3_ROOT)\target\ppu\lib\libm.a&quot; &quot;$(SCE_PS3_ROOT)\target\ppu\lib\libio_stub.a&quot; &quot;..\..\..\Server\PS3\Debug\libHeapInspectorServer.a&quot; &quot;$(SCE_PS3_ROOT)\target\ppu\lib\libpthread.a&quot; &quot;$(SCE_PS3_ROOT)\target\ppu\lib\libnet_stub.a&quot; &quot;$(SCE_PS3_ROOT)\target\ppu\lib\libsysmodule_stub.a&quot;"
OutputFile="$(OutDir)/$(ProjectName).ppu.elf"
AdditionalLibraryDirectories=""
ProgramDatabaseFile=""
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="Fake Signing ELF &quot;$(TargetDir)$(TargetName).self&quot;"
CommandLine="$(SCE_PS3_ROOT)\host-win32\bin\make_fself &quot;$(TargetPath)&quot; &quot;$(TargetDir)$(TargetName).self&quot;"
/>
</Configuration>
<Configuration
Name="PS3 Release|Win32"
OutputDirectory="Release_VS2008"
IntermediateDirectory="Release_VS2008"
ConfigurationType="1"
DeleteExtensionsOnClean="*.obj;*.d;*.map;*.lst;*.pch;$(TargetPath);$(TargetDir)$(TargetName).self"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="-O2 -Wall -fno-exceptions -fno-rtti"
AdditionalIncludeDirectories="&quot;$(SN_PS3_PATH)\ppu\include\sn&quot;;&quot;$(SCE_PS3_ROOT)\target\ppu\include&quot;;&quot;$(SCE_PS3_ROOT)\target\common\include&quot;"
PreprocessorDefinitions="SN_TARGET_PS3;NDEBUG;__GCC__;HEAPINSPECTOR_PS3=1"
ProgramDataBaseFileName=""
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="-fno-exceptions -fno-rtti"
AdditionalDependencies="&quot;$(SN_PS3_PATH)\ppu\lib\sn\libsn.a&quot; &quot;$(SCE_PS3_ROOT)\target\ppu\lib\libm.a&quot; &quot;$(SCE_PS3_ROOT)\target\ppu\lib\libio_stub.a&quot; &quot;..\..\..\Server\PS3\Release\libHeapInspectorServer.a&quot; &quot;$(SCE_PS3_ROOT)\target\ppu\lib\libpthread.a&quot; &quot;$(SCE_PS3_ROOT)\target\ppu\lib\libnet_stub.a&quot; &quot;$(SCE_PS3_ROOT)\target\ppu\lib\libsysmodule_stub.a&quot;"
OutputFile="$(OutDir)/$(ProjectName).ppu.elf"
AdditionalLibraryDirectories=""
ProgramDatabaseFile=""
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="Fake Signing ELF &quot;$(TargetDir)$(TargetName).self&quot;"
CommandLine="$(SCE_PS3_ROOT)\host-win32\bin\make_fself &quot;$(TargetPath)&quot; &quot;$(TargetDir)$(TargetName).self&quot;"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="PS3"
>
<File
RelativePath=".\Main.cpp"
>
</File>
<File
RelativePath=".\Wait.cpp"
>
</File>
</Filter>
<File
RelativePath="..\ManualSample.cpp"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|PS3">
<Configuration>Debug</Configuration>
<Platform>PS3</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|PS3">
<Configuration>Release</Configuration>
<Platform>PS3</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\ManualSample.cpp" />
<ClCompile Include="Main.cpp" />
<ClCompile Include="Wait.cpp" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{B6B851C9-DC76-4A5B-9AFE-6CF944BFB502}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|PS3'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>GCC</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|PS3'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>GCC</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|PS3'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|PS3'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|PS3'">
<OutDir>$(ProjectDir)$(Platform)_$(Configuration)_VS2010\</OutDir>
<IntDir>$(Platform)_$(Configuration)_VS2010\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|PS3'">
<OutDir>$(ProjectDir)$(Platform)_$(Configuration)_VS2010\</OutDir>
<IntDir>$(Platform)_$(Configuration)_VS2010\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|PS3'">
<ClCompile>
<PreprocessorDefinitions>_DEBUG;__CELL_ASSERT__;%(PreprocessorDefinitions);;HEAPINSPECTOR_PS3=1</PreprocessorDefinitions>
<GenerateDebugInformation>true</GenerateDebugInformation>
</ClCompile>
<Link>
<AdditionalDependencies>"$(SCE_PS3_ROOT)\target\ppu\lib\libm.a";"$(SCE_PS3_ROOT)\target\ppu\lib\libio_stub.a";"..\..\..\Server\PS3\Debug\libHeapInspectorServer.a";"$(SCE_PS3_ROOT)\target\ppu\lib\libpthread.a";"$(SCE_PS3_ROOT)\target\ppu\lib\libnet_stub.a";"$(SCE_PS3_ROOT)\target\ppu\lib\libsysmodule_stub.a";%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|PS3'">
<ClCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions);;HEAPINSPECTOR_PS3=1</PreprocessorDefinitions>
<OptimizationLevel>Level2</OptimizationLevel>
</ClCompile>
<Link>
<AdditionalDependencies>"..\..\..\Server\PS3\Release\libHeapInspectorServer.a";"$(SCE_PS3_ROOT)\target\ppu\lib\libpthread.a";"$(SCE_PS3_ROOT)\target\ppu\lib\libnet_stub.a";"$(SCE_PS3_ROOT)\target\ppu\lib\libsysmodule_stub.a";%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<Import Condition="'$(ConfigurationType)' == 'Makefile' and Exists('$(VCTargetsPath)\Platforms\$(Platform)\SCE.Makefile.$(Platform).targets')" Project="$(VCTargetsPath)\Platforms\$(Platform)\SCE.Makefile.$(Platform).targets" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,6 @@
#include <sys/timer.h>
void Wait(int a_Milliseconds)
{
sys_timer_usleep(a_Milliseconds * 1000);
}