uno/uno_exception_offset/compute_exception_offset.cpp |   42 ++++++++
 uno/uno_exception_offset/uno_exception_offset.sln     |   28 +++++
 uno/uno_exception_offset/uno_exception_offset.vcxproj |   92 ++++++++++++++++++
 3 files changed, 162 insertions(+)

New commits:
commit ecd66668c257a3660d3c90faa8a349fdbaea3d88
Author: David Ostrovsky <da...@ostrovsky.org>
Date:   Sun Nov 30 12:25:20 2014 +0100

    Add uno exception offset computation project
    
    Change-Id: I2f77ff88ddefba3ebcc8314ce2636451a99b46a8
    Reviewed-on: https://gerrit.libreoffice.org/13208
    Reviewed-by: David Ostrovsky <da...@ostrovsky.org>
    Tested-by: David Ostrovsky <da...@ostrovsky.org>

diff --git a/uno/uno_exception_offset/compute_exception_offset.cpp 
b/uno/uno_exception_offset/compute_exception_offset.cpp
new file mode 100755
index 0000000..2cfa33a
--- /dev/null
+++ b/uno/uno_exception_offset/compute_exception_offset.cpp
@@ -0,0 +1,42 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+* This file is part of the LibreOffice project.
+*
+* This Source Code Form is subject to the terms of the Mozilla Public
+* License, v. 2.0. If a copy of the MPL was not distributed with this
+* file, You can obtain one at http://mozilla.org/MPL/2.0/.
+*/
+
+#include <iostream>     /* cout */
+#include <stddef.h>     /* offsetof */
+#include <mtdll.h>      /* _tiddata */
+
+using namespace std;
+
+int main()
+{
+    int offset_curexception = (int)offsetof(struct _tiddata, _curexception);
+    int offset_tpxcptinfoptrs = (int)offsetof(struct _tiddata, 
_tpxcptinfoptrs);
+
+    cout << "Computing uno exception offset on platform: " <<
+#if defined (_M_X64)
+        "X86-64"
+#elif defined (_M_IX86)
+        "intel"
+#else
+        error: unknown prltform
+#endif
+        << endl;
+    cout << "offsetof(struct _tiddata,_curexception) is: 0x" << std::hex
+        << offset_curexception << endl;
+    cout << "offsetof(struct _tiddata,_tpxcptinfoptrs) is: 0x" << std::hex
+        <<  offset_tpxcptinfoptrs << endl;
+    cout << "offsetof(_curexception) - offsetof(_tpxcptinfoptrs): 0x" << 
std::hex
+        << offset_curexception - offset_tpxcptinfoptrs << endl;
+
+    cout << "Enter any key to continue...";
+    cin.get();
+    return 0;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/uno/uno_exception_offset/uno_exception_offset.sln 
b/uno/uno_exception_offset/uno_exception_offset.sln
new file mode 100755
index 0000000..66eb528
--- /dev/null
+++ b/uno/uno_exception_offset/uno_exception_offset.sln
@@ -0,0 +1,28 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2013
+VisualStudioVersion = 12.0.30501.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "uno_exception_offset", 
"uno_exception_offset.vcxproj", "{E7D4FBFD-732A-4FD7-99F4-053893A64E16}"
+EndProject
+Global
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution
+               Debug|Win32 = Debug|Win32
+               Debug|x64 = Debug|x64
+               Release|Win32 = Release|Win32
+               Release|x64 = Release|x64
+       EndGlobalSection
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution
+               {E7D4FBFD-732A-4FD7-99F4-053893A64E16}.Debug|Win32.ActiveCfg = 
Debug|Win32
+               {E7D4FBFD-732A-4FD7-99F4-053893A64E16}.Debug|Win32.Build.0 = 
Debug|Win32
+               {E7D4FBFD-732A-4FD7-99F4-053893A64E16}.Debug|x64.ActiveCfg = 
Debug|x64
+               {E7D4FBFD-732A-4FD7-99F4-053893A64E16}.Debug|x64.Build.0 = 
Debug|x64
+               {E7D4FBFD-732A-4FD7-99F4-053893A64E16}.Release|Win32.ActiveCfg 
= Release|Win32
+               {E7D4FBFD-732A-4FD7-99F4-053893A64E16}.Release|Win32.Build.0 = 
Release|Win32
+               {E7D4FBFD-732A-4FD7-99F4-053893A64E16}.Release|x64.ActiveCfg = 
Release|x64
+               {E7D4FBFD-732A-4FD7-99F4-053893A64E16}.Release|x64.Build.0 = 
Release|x64
+       EndGlobalSection
+       GlobalSection(SolutionProperties) = preSolution
+               HideSolutionNode = FALSE
+       EndGlobalSection
+EndGlobal
diff --git a/uno/uno_exception_offset/uno_exception_offset.vcxproj 
b/uno/uno_exception_offset/uno_exception_offset.vcxproj
new file mode 100755
index 0000000..350eba8
--- /dev/null
+++ b/uno/uno_exception_offset/uno_exception_offset.vcxproj
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="12.0" 
xmlns="http://schemas.microsoft.com/developer/msbuild/2003";>
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{E7D4FBFD-732A-4FD7-99F4-053893A64E16}</ProjectGuid>
+    <RootNamespace>Projekt1</RootNamespace>
+    <ProjectName>uno_exception_offset</ProjectName>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" 
Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v120</PlatformToolset>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" 
Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v120</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Label="Configuration" 
Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <PlatformToolset>v120</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Label="Configuration" 
Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <PlatformToolset>v120</PlatformToolset>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" 
Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <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|Win32'">
+    <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|x64'">
+    <IncludePath>$(VCInstallDir)/crt/src;$(IncludePath)</IncludePath>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <IncludePath>$(VCInstallDir)/crt/src;$(IncludePath)</IncludePath>
+  </PropertyGroup>
+  <ItemDefinitionGroup 
Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <SDLCheck>true</SDLCheck>
+    </ClCompile>
+    <Link>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup 
Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <SDLCheck>true</SDLCheck>
+    </ClCompile>
+    <Link>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClCompile Include="compute_exception_offset.cpp" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to