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

Re: [PATCH] Issue 1628

From: SteveKing <steveking_at_gmx.ch>
Date: 2005-07-22 17:52:40 CEST

David James wrote:
> On 7/20/05, SteveKing <steveking@gmx.ch> wrote:
>
>>Just note: this patch wasn't intended to be applied directly. That's
>>also why I didn't provide a log message for it (maybe I shouldn't have
>>put the [PATCH] in the mail subject). It's simply a patch to show you
>>how it could be done.
>
> Thanks for your patch! Your patches and crash logs are very helpful.
>
> It's good to see "interim" or partially-completed patches, because it
> gives us a chance to offer feedback while you're still working on the
> patch. If you don't mind, please include a log message next time --
> it's helpful, even if the patch isn't ready for commit.

Ok, I'll provide a log message.

>>There's still many things to consider:
>>- the mail address the reports get sent to
>>- maybe some compiler define to exclude that code part if it's not an
>>official build - otherwise you'll get reports which you can't really use
>>because you miss the debug symbols
>
> OK -- hopefully we'll see more revisions of this patch? :)

Here goes:

Log Message:
Load a crash reporting dll on Windows when clients start up.
subversion/libsvn_subr/cmdline.c : load the crashrpt.dll dynamically

Stefan

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

Index: subversion/libsvn_subr/cmdline.c
===================================================================
--- subversion/libsvn_subr/cmdline.c (Revision 15391)
+++ subversion/libsvn_subr/cmdline.c (Arbeitskopie)
@@ -36,6 +36,7 @@
 #include "svn_pools.h"
 #include "svn_error.h"
 #include "utf_impl.h"
+#include "svn_version.h"
 
 #include "svn_private_config.h"
 
@@ -56,13 +57,50 @@
 /* The stdout encoding. If null, it's the same as the native encoding. */
 static const char *output_encoding = NULL;
 
+#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 crashDll = 0;
+LPVOID lpvState = 0;
+svn_cmdline_remove_crashrpt()
+{
+ UninstallEx pfnUninstallEx;
+ if ((crashDll)&&(lpvState))
+ {
+ pfnUninstallEx = (UninstallEx)GetProcAddress(crashDll, "UninstallEx");
+ (UninstallEx)(lpvState);
+ }
+ FreeLibrary(crashDll);
+}
+#endif
+
+
 int
 svn_cmdline_init (const char *progname, FILE *error_stream)
 {
   apr_status_t status;
   apr_pool_t *pool;
 
+ /* Load the crash reporting dll if it's available */
+#ifdef WIN32
+ InstallEx pfnInstallEx;
+ crashDll = LoadLibrary("CrashRpt");
+ if (crashDll)
+ {
+ pfnInstallEx = (InstallEx)GetProcAddress(crashDll, "InstallEx");
+ lpvState = (pfnInstallEx)(NULL, "crashreports@subversion.tigris.org", SVN_VER_NUM);
+ }
+ atexit(svn_cmdline_remove_crashrpt);
+#endif
+
 #ifndef WIN32
   {
     struct stat st;

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Jul 22 17:55:57 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.