[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] Issue 1628

From: SteveKing <steveking_at_gmx.ch>
Date: 2005-07-19 20:25:25 CEST

Hi,

TSVN uses its own crash handler, which in case of an exception saves the
crashdump and an xml file containing additional information to disk and
then lets the user send those files (zipped) to an email address.

Issue 1628
http://subversion.tigris.org/issues/show_bug.cgi?id=1628

is about having such a crash handler for the SVN client too.

The attached patch loads the same crash handler dll TSVN uses (if it's
available - if it can't be found, the client behaves as always. I.e. the
dll is not required.) and uses it.

So in case of a crash, a dialog pops up telling the user that the
program has crashed and if (s)he want's to send information about the
crash to the developers. If the "Send" button is clicked, the default
mail client is opened with a new mail where the 'to' address is already
filled in and also the zipfile already attached. All the user then has
to do is to (hopefully) write what (s)he was doing to make the app crash
and send the mail.

I've uploaded the compiled dll to
http://tortoisesvn.tigris.org/files/documents/406/24329/CrashRpt.dll

The sourcecode of the dll is available in the TSVN repository:
http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk/src/crashrpt/

The dll uses the wtl library (http://wtl.sourceforge.net/) and for OS
versions < XP a current dgbhelp.dll should be distributed too (the
dbghelp.dll is available from MS and redistributable).

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.tigris.org

Index: subversion/clients/cmdline/main.c
===================================================================
--- subversion/clients/cmdline/main.c (Revision 15362)
+++ subversion/clients/cmdline/main.c (Arbeitskopie)
@@ -795,7 +795,31 @@
     return SVN_NO_ERROR;
 }
 
+#ifdef WIN32
+// Client crash callback
+typedef BOOL (CALLBACK *LPGETLOGFILE) (LPVOID lpvState);
+// Stack trace callback
+typedef void (*TraceCallbackFunction)(DWORD address, const char *ImageName,
+ const char *FunctionName, DWORD functionDisp,
+ const char *Filename, DWORD LineNumber, DWORD lineDisp,
+ void *data);
 
+typedef LPVOID (*InstallEx)(LPGETLOGFILE pfn, LPCSTR lpcszTo, LPCSTR lpcszSubject);
+typedef void (*UninstallEx)(LPVOID lpState);
+HMODULE hDll = 0;
+LPVOID lpvState = 0;
+svn_remove_crashrpt()
+{
+ UninstallEx pfnUninstallEx;
+ if ((hDll)&&(lpvState))
+ {
+ pfnUninstallEx = (UninstallEx)GetProcAddress(hDll, "UninstallEx");
+ (UninstallEx)(lpvState);
+ }
+ FreeLibrary(hDll);
+}
+#endif
+
 
 /*** Main. ***/
 
@@ -818,6 +842,17 @@
   svn_cl__cmd_baton_t command_baton;
   svn_auth_baton_t *ab;
   svn_config_t *cfg;
+
+#ifdef WIN32
+ InstallEx pfnInstallEx;
+ hDll = LoadLibrary("CrashRpt");
+ if (hDll)
+ {
+ pfnInstallEx = (InstallEx)GetProcAddress(hDll, "InstallEx");
+ lpvState = (pfnInstallEx)(NULL, "crashreports@subversion.tigris.org", SVN_VER_NUM);
+ }
+ atexit(svn_remove_crashrpt);
+#endif
   
   /* Initialize the app. */
   if (svn_cmdline_init ("svn", stderr) != EXIT_SUCCESS)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Jul 19 20:26:34 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.