From 484c085e3365fb4246b56b10b51a75dceea88e6f Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Sat, 14 Jan 2017 02:31:58 +0100 Subject: [PATCH] Provide natvis files as contrib for improved debugging Signed-off-by: Sven Strickroth --- build.txt | 3 + contrib/NatVis/TGitNatVis.dll | Bin 0 -> 17944 bytes contrib/NatVis/TortoiseGit.natvis | 33 +++++++ contrib/NatVis/src/TGitNatVis.sln | 22 +++++ contrib/NatVis/src/TGitNatVis/TGitNatVis.cpp | 55 +++++++++++ contrib/NatVis/src/TGitNatVis/TGitNatVis.h | 31 +++++++ contrib/NatVis/src/TGitNatVis/TGitNatVis.vcxproj | 101 +++++++++++++++++++++ .../src/TGitNatVis/TGitNatVis.vcxproj.filters | 39 ++++++++ contrib/NatVis/src/TGitNatVis/dllmain.cpp | 34 +++++++ contrib/NatVis/src/TGitNatVis/stdafx.cpp | 8 ++ contrib/NatVis/src/TGitNatVis/stdafx.h | 17 ++++ contrib/NatVis/src/TGitNatVis/targetver.h | 8 ++ src/Git/TGitPath.h | 2 +- 13 files changed, 352 insertions(+), 1 deletion(-) create mode 100644 contrib/NatVis/TGitNatVis.dll create mode 100644 contrib/NatVis/TortoiseGit.natvis create mode 100644 contrib/NatVis/src/TGitNatVis.sln create mode 100644 contrib/NatVis/src/TGitNatVis/TGitNatVis.cpp create mode 100644 contrib/NatVis/src/TGitNatVis/TGitNatVis.h create mode 100644 contrib/NatVis/src/TGitNatVis/TGitNatVis.vcxproj create mode 100644 contrib/NatVis/src/TGitNatVis/TGitNatVis.vcxproj.filters create mode 100644 contrib/NatVis/src/TGitNatVis/dllmain.cpp create mode 100644 contrib/NatVis/src/TGitNatVis/stdafx.cpp create mode 100644 contrib/NatVis/src/TGitNatVis/stdafx.h create mode 100644 contrib/NatVis/src/TGitNatVis/targetver.h diff --git a/build.txt b/build.txt index 18f09d192..7dd468abf 100644 --- a/build.txt +++ b/build.txt @@ -63,3 +63,6 @@ Open Developer Command Prompt for VS2013 If you want to build the installer package, make sure you build the Win32 configuration before the x64 one Also, build the docs before the installer packages (or copy existing TortoiseGit_en.chm and TortoiseMerge_en.chm files into the doc/output folder). + +For optimized debugging copy TGitNatVis.dll and TortoiseGit.natvis from contrib\NatVis to %USERPROFILE%\Documents\Visual Studio 2013\Visualizers. +Then CGitHash will provide a readable preview of the SHA-1 and CTGitPath is also optimized. diff --git a/contrib/NatVis/TGitNatVis.dll b/contrib/NatVis/TGitNatVis.dll new file mode 100644 index 0000000000000000000000000000000000000000..854ce42c21199af14956e67782266761dc91be89 GIT binary patch literal 17944 zcwX&$2~<*I1PBln6cjNk3W~tJ3G*Nz1fhbUOrmIvArKG#_4>}GwOwh=o~gAPsC-K8 zr&OL^yNb%wYBxgu>%KIqUqFkh-9(L9Qo9>+*O{|wKcn(#`f({#?m9D>$|q-trHKEV zONbRIRN3HjK*m`)(HR%UM+F3j#GPZcRe81}U(rdzuiB-`F}!SL5jM}{qC>Kc%4 zuwie}Rk_I(axtb~YpkBGYcurF1-r>5Su(M1?MMfdY$M;I8;AY(`IjDzKNzCMC@T!( z(5jDK4#qf|E3lWP9>bs{XJJ@!b-m$}iDhDwv^Lf_#wo2*_0!teQl*9FR)?!BFwCT= znqOr&B7tnys#uwrb`Dc(!vxytr*M5sT3ReDurPSUh0widcr z7%5=GY)KY|~R2ff^guxr}(UgJ7Vd5jG(%arT{U?!s zm0m40;a3TfYL95O+C?s>)$O$TkH;mJ%T3h3xBK5%6h_vxN!X=V^Zn&U>UM3uhr0b~ zzB?JiERW?(2J3Oiy3%t>hw^Z3neU9U5Egl=HiV5}pf-d89*Xx2{Tzn#M>0v;bnQ%L zw><15asjJbAolwN@Jhxt<{os{HoG(R%@!jG0db! z!B~;z8CW0G9?OR1mYL{B@?XMOBt!Xj3U#dxF&$#1tsrue<}%d7)o0l1PV4!9khNrV zYigMVB1#s{m`2{8UagZ?-OSaCS0?C4Bvr^7wuxjoOMAIIx@l5*v}RJK_2gJGoSg_Q z37YcgMvV>c?K1pk{5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TH&;I8-M-XXujn7CUgY@baY6WxPlQ?HB!kk+ zTSgAFoUt@#>WYezg*jU;jQsU`(bKRQ0&?f-AMKgEt=jE7w(ZWR-5UL?Rn#Y5H5q$S z78mUu@!~OFEgd}ImRa-$kAh^{XS3<0K6jnwY_pEXXRhK#4DW)!TF^-K8`s?bUqBbE z11?|O8~3c>R}f3w^}wZ6xS|_%J_TTuy{R$i9_s1ks#HL??#o_(3c`@wy;1DVD{8(0 zq|U}O@X-d4>d-SOx_-YoEADS_2R9H@0>V}NpM_Ho12}y=d*&toDeYr<^(VJ$ zzSKP27CUZHFF1WC-o67)x0TPBKKRMRtE*ne+;7ePqNPlbaEx{SOUJGK9nZxKIJKqq zHhshC@m0GTmX+n7TC(KX^~kl)|8`h^_%N~N+uXXN<2OtboXN@CV0)mA!>==+^de#T>!A)ID<+OzIlYKh zcieH|5~;O~wTGuN^6=8hqi(F7v8}TIwf#TNBTDE~@e+C>b!jC3ZE*PxAUC`2aQ!pWP3 zeFo(HhI<=ur@Ir>S9BZ(mRwJ~b!+-wVa2>dCL_PNnWHeDc6ijXX@`D|`BOEDKBfc7 z+>NH_y2y)4>hKtB`@rGU_Jrm8=?^*0TlZV;5#MTR9&xV~5UbQBQ4p)^2`m(UJon zI+(qx?fbLoy4F&bB4cxB|@yEFAO`L6ex@l&(V7;B}Xw})%{`qtMT=8PS&?{~MKZV;oHNn<2 ze!rn=Wc{Au&$iQlbiCp*^7{O5K1d!Lbn4EDs;q^kIeS{h&o;lk$=KFw>3I61XGxPb XXy%U0Q6*g&RXr*CddorG?}Gma^!a+u literal 0 HcwPel00001 diff --git a/contrib/NatVis/TortoiseGit.natvis b/contrib/NatVis/TortoiseGit.natvis new file mode 100644 index 000000000..03aaa0490 --- /dev/null +++ b/contrib/NatVis/TortoiseGit.natvis @@ -0,0 +1,33 @@ + + + + + + + + + + + + + empty + {m_sFwdslashPath.m_pszData,su} + {m_sBackslashPath.m_pszData,su} + + m_bIsDirectory + m_bExists + m_bHasAdminDir + m_fileSize + m_bIsWCRoot + m_bIsValidOnWindows + m_bIsReadOnly + m_lastWriteTime + m_Stage + m_ParentNo + (Actions)m_Action + m_StatAdd + m_StatDel + m_Checked + + + diff --git a/contrib/NatVis/src/TGitNatVis.sln b/contrib/NatVis/src/TGitNatVis.sln new file mode 100644 index 000000000..6a73a49b1 --- /dev/null +++ b/contrib/NatVis/src/TGitNatVis.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.40629.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TGitNatVis", "TGitNatVis\TGitNatVis.vcxproj", "{05FEA8E0-B5CC-4EF5-B4F8-15CAADB3DFAE}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {05FEA8E0-B5CC-4EF5-B4F8-15CAADB3DFAE}.Debug|Win32.ActiveCfg = Debug|Win32 + {05FEA8E0-B5CC-4EF5-B4F8-15CAADB3DFAE}.Debug|Win32.Build.0 = Debug|Win32 + {05FEA8E0-B5CC-4EF5-B4F8-15CAADB3DFAE}.Release|Win32.ActiveCfg = Release|Win32 + {05FEA8E0-B5CC-4EF5-B4F8-15CAADB3DFAE}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/contrib/NatVis/src/TGitNatVis/TGitNatVis.cpp b/contrib/NatVis/src/TGitNatVis/TGitNatVis.cpp new file mode 100644 index 000000000..e3387a315 --- /dev/null +++ b/contrib/NatVis/src/TGitNatVis/TGitNatVis.cpp @@ -0,0 +1,55 @@ +// TortoiseGit - a Windows shell extension for easy version control + +// Copyright (C) 2016-2017 - TortoiseGit + +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software Foundation, +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +// +#include "stdafx.h" +#include "TGitNatVis.h" + +#define GIT_HASH_SIZE 20 + +typedef struct tagDEBUGHELPER +{ + DWORD dwVersion; + HRESULT(WINAPI* ReadDebuggeeMemory)(struct tagDEBUGHELPER* pThis, DWORD dwAddr, DWORD nWant, VOID* pWhere, DWORD* nGot); + // from here only when dwVersion >= 0x20000 + DWORDLONG(WINAPI* GetRealAddress)(struct tagDEBUGHELPER* pThis); + HRESULT(WINAPI* ReadDebuggeeMemoryEx)(struct tagDEBUGHELPER* pThis, DWORDLONG qwAddr, DWORD nWant, VOID* pWhere, DWORD* nGot); + int (WINAPI* GetProcessorType)(struct tagDEBUGHELPER* pThis); +} DEBUGHELPER; + +typedef HRESULT(WINAPI *CUSTOMVIEWER)(DWORD dwAddress, DEBUGHELPER* pHelper, int nBase, BOOL bUniStrings, char* pResult, size_t max, DWORD reserved); + +static CStringA ToString(const unsigned char* hash) +{ + CStringA str; + for (int i = 0; i < GIT_HASH_SIZE; ++i) + str.AppendFormat("%02x", hash[i]); + return str; +} + +extern "C" TGITNATVIS_API HRESULT SHA1Formatter(DWORD dwAddress, DEBUGHELPER* pHelper, int nBase, BOOL bUniStrings, char* pResult, size_t max, DWORD reserved); + +TGITNATVIS_API HRESULT SHA1Formatter(DWORD dwAddress, DEBUGHELPER* pHelper, int nBase, BOOL bUniStrings, char* pResult, size_t max, DWORD reserved) +{ + unsigned char hash[GIT_HASH_SIZE]; + DWORD nGot; + auto realAddress = pHelper->GetRealAddress(pHelper); + pHelper->ReadDebuggeeMemoryEx(pHelper, realAddress, GIT_HASH_SIZE, &hash, &nGot); + //sprintf_s(pResult, max, "Dll MyClass: max=%d nGot=%d MyClass=%llx SHA1=%s", max, nGot, realAddress, (LPCSTR)ToString(hash)); + sprintf_s(pResult, max, "SHA1: %s", (LPCSTR)ToString(hash)); + return S_OK; +} diff --git a/contrib/NatVis/src/TGitNatVis/TGitNatVis.h b/contrib/NatVis/src/TGitNatVis/TGitNatVis.h new file mode 100644 index 000000000..904924175 --- /dev/null +++ b/contrib/NatVis/src/TGitNatVis/TGitNatVis.h @@ -0,0 +1,31 @@ +// TortoiseGit - a Windows shell extension for easy version control + +// Copyright (C) 2016 - TortoiseGit + +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software Foundation, +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +// + +// The following ifdef block is the standard way of creating macros which make exporting +// from a DLL simpler. All files within this DLL are compiled with the GITDLL_EXPORTS +// symbol defined on the command line. this symbol should not be defined on any project +// that uses this DLL. This way any other project whose source files include this file see +// GITDLL_API functions as being imported from a DLL, whereas this DLL sees symbols +// defined with this macro as being exported. +#ifdef TGITNATVIS_EXPORTS +#define TGITNATVIS_API __declspec(dllexport) +#else +#define TGITNATVIS_API __declspec(dllimport) +#endif + diff --git a/contrib/NatVis/src/TGitNatVis/TGitNatVis.vcxproj b/contrib/NatVis/src/TGitNatVis/TGitNatVis.vcxproj new file mode 100644 index 000000000..e1c03f787 --- /dev/null +++ b/contrib/NatVis/src/TGitNatVis/TGitNatVis.vcxproj @@ -0,0 +1,101 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {05FEA8E0-B5CC-4EF5-B4F8-15CAADB3DFAE} + Win32Proj + TGitNatVis + + + + DynamicLibrary + true + v120 + Unicode + + + DynamicLibrary + false + v120 + true + Unicode + + + + + + + + + + + + + true + + + false + + + + Use + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;TGITNATVIS_EXPORTS;%(PreprocessorDefinitions) + true + + + Windows + true + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;TGITNATVIS_EXPORTS;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + + + + + + + + + + false + + + false + + + + + Create + Create + + + + + + + \ No newline at end of file diff --git a/contrib/NatVis/src/TGitNatVis/TGitNatVis.vcxproj.filters b/contrib/NatVis/src/TGitNatVis/TGitNatVis.vcxproj.filters new file mode 100644 index 000000000..e878c5d98 --- /dev/null +++ b/contrib/NatVis/src/TGitNatVis/TGitNatVis.vcxproj.filters @@ -0,0 +1,39 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Headerdateien + + + Headerdateien + + + Headerdateien + + + + + Quelldateien + + + Quelldateien + + + Quelldateien + + + \ No newline at end of file diff --git a/contrib/NatVis/src/TGitNatVis/dllmain.cpp b/contrib/NatVis/src/TGitNatVis/dllmain.cpp new file mode 100644 index 000000000..151e3004b --- /dev/null +++ b/contrib/NatVis/src/TGitNatVis/dllmain.cpp @@ -0,0 +1,34 @@ +// TortoiseGit - a Windows shell extension for easy version control + +// Copyright (C) 2016-2017 - TortoiseGit + +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software Foundation, +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +// + +// dllmain.cpp : Defines the entry point for the DLL application. +#include "stdafx.h" + +BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) +{ + switch (ul_reason_for_call) + { + case DLL_PROCESS_ATTACH: + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} diff --git a/contrib/NatVis/src/TGitNatVis/stdafx.cpp b/contrib/NatVis/src/TGitNatVis/stdafx.cpp new file mode 100644 index 000000000..5c6db1da8 --- /dev/null +++ b/contrib/NatVis/src/TGitNatVis/stdafx.cpp @@ -0,0 +1,8 @@ +// stdafx.cpp : source file that includes just the standard includes +// gitdll.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + +// TODO: reference any additional headers you need in STDAFX.H +// and not in this file diff --git a/contrib/NatVis/src/TGitNatVis/stdafx.h b/contrib/NatVis/src/TGitNatVis/stdafx.h new file mode 100644 index 000000000..55bf5f134 --- /dev/null +++ b/contrib/NatVis/src/TGitNatVis/stdafx.h @@ -0,0 +1,17 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#include "targetver.h" + +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +// Windows Header Files: +#include + +#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit + +#include +#include diff --git a/contrib/NatVis/src/TGitNatVis/targetver.h b/contrib/NatVis/src/TGitNatVis/targetver.h new file mode 100644 index 000000000..90e767bfc --- /dev/null +++ b/contrib/NatVis/src/TGitNatVis/targetver.h @@ -0,0 +1,8 @@ +#pragma once + +// Including SDKDDKVer.h defines the highest available Windows platform. + +// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and +// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. + +#include diff --git a/src/Git/TGitPath.h b/src/Git/TGitPath.h index 7aff71a2d..bce663aa9 100644 --- a/src/Git/TGitPath.h +++ b/src/Git/TGitPath.h @@ -37,7 +37,7 @@ public: int m_Stage; int m_ParentNo; - enum : unsigned int + enum Actions : unsigned int { LOGACTIONS_ADDED = 0x00000001, LOGACTIONS_MODIFIED = 0x00000002, -- 2.11.4.GIT