[Libreoffice-commits] .: vcl/aqua vcl/inc vcl/ios vcl/source vcl/unx vcl/win

Stephan Bergmann sbergmann at kemper.freedesktop.org
Wed Sep 28 06:24:58 PDT 2011


 vcl/aqua/source/app/salinst.cxx       |    7 +++++--
 vcl/inc/salinst.hxx                   |    2 +-
 vcl/ios/source/app/salinst.cxx        |    7 +++++--
 vcl/source/app/svapp.cxx              |   14 +++++++++++++-
 vcl/unx/generic/plugadapt/salplug.cxx |    7 +++++--
 vcl/win/source/app/salinst.cxx        |    2 +-
 6 files changed, 30 insertions(+), 9 deletions(-)

New commits:
commit 01e0b770a5ce58de44283465ba51b03a1ee0db0c
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Sep 28 15:08:45 2011 +0200

    Let SalAbort dump core on developer builds.

diff --git a/vcl/aqua/source/app/salinst.cxx b/vcl/aqua/source/app/salinst.cxx
index df0d95c..489b1dd 100644
--- a/vcl/aqua/source/app/salinst.cxx
+++ b/vcl/aqua/source/app/salinst.cxx
@@ -258,14 +258,17 @@ sal_Bool ImplSVMainHook( int * pnInit )
 
 // =======================================================================
 
-void SalAbort( const XubString& rErrorText )
+void SalAbort( const XubString& rErrorText, bool bDumpCore )
 {
     if( !rErrorText.Len() )
         fprintf( stderr, "Application Error " );
     else
         fprintf( stderr, "%s ",
             ByteString( rErrorText, gsl_getSystemTextEncoding() ).GetBuffer() );
-    abort();
+    if( bDumpCore )
+        abort();
+    else
+        _exit(1);
 }
 
 // -----------------------------------------------------------------------
diff --git a/vcl/inc/salinst.hxx b/vcl/inc/salinst.hxx
index d878dd7..194e61a 100644
--- a/vcl/inc/salinst.hxx
+++ b/vcl/inc/salinst.hxx
@@ -181,7 +181,7 @@ void DestroySalInstance( SalInstance* pInst );
 // - SalInstance-Functions -
 // -------------------------
 
-void SalAbort( const XubString& rErrorText );
+void SalAbort( const XubString& rErrorText, bool bDumpCore );
 
 VCL_PLUGIN_PUBLIC const ::rtl::OUString& SalGetDesktopEnvironment();
 
diff --git a/vcl/ios/source/app/salinst.cxx b/vcl/ios/source/app/salinst.cxx
index fb5bfb9..f7c9685 100644
--- a/vcl/ios/source/app/salinst.cxx
+++ b/vcl/ios/source/app/salinst.cxx
@@ -142,14 +142,17 @@ sal_Bool ImplSVMainHook( int * pnInit )
 
 // =======================================================================
 
-void SalAbort( const XubString& rErrorText )
+void SalAbort( const XubString& rErrorText, bool bDumpCore )
 {
     if( !rErrorText.Len() )
         fprintf( stderr, "Application Error " );
     else
         fprintf( stderr, "%s ",
             ByteString( rErrorText, gsl_getSystemTextEncoding() ).GetBuffer() );
-    abort();
+    if( bDumpCore )
+        abort();
+    else
+        _exit(1);
 }
 
 // -----------------------------------------------------------------------
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index f426c11..b41f926 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -393,7 +393,19 @@ sal_uInt16 Application::Exception( sal_uInt16 nError )
 
 void Application::Abort( const XubString& rErrorText )
 {
-    SalAbort( rErrorText );
+    //HACK: Dump core iff --norestore command line argument is given (assuming
+    // this process is run by developers who are interested in cores, vs. end
+    // users who are not):
+    bool dumpCore = false;
+    sal_uInt16 n = GetCommandLineParamCount();
+    for (sal_uInt16 i = 0; i != n; ++i) {
+        if (GetCommandLineParam(i).EqualsAscii("--norestore")) {
+            dumpCore = true;
+            break;
+        }
+    }
+
+    SalAbort( rErrorText, dumpCore );
 }
 
 // -----------------------------------------------------------------------
diff --git a/vcl/unx/generic/plugadapt/salplug.cxx b/vcl/unx/generic/plugadapt/salplug.cxx
index 51321b8..d707760 100644
--- a/vcl/unx/generic/plugadapt/salplug.cxx
+++ b/vcl/unx/generic/plugadapt/salplug.cxx
@@ -267,13 +267,16 @@ void DeInitSalMain()
 {
 }
 
-void SalAbort( const XubString& rErrorText )
+void SalAbort( const XubString& rErrorText, bool bDumpCore )
 {
     if( !rErrorText.Len() )
         std::fprintf( stderr, "Application Error\n" );
     else
         std::fprintf( stderr, "%s\n", rtl::OUStringToOString(rErrorText, osl_getThreadTextEncoding()).getStr() );
-    exit(-1);
+    if( bDumpCore )
+        abort();
+    else
+        _exit(1);
 }
 
 static const char * desktop_strings[] = { "none", "unknown", "GNOME", "KDE", "KDE4" };
diff --git a/vcl/win/source/app/salinst.cxx b/vcl/win/source/app/salinst.cxx
index 5e8930f..a0d41a6 100644
--- a/vcl/win/source/app/salinst.cxx
+++ b/vcl/win/source/app/salinst.cxx
@@ -84,7 +84,7 @@
 
 // =======================================================================
 
-void SalAbort( const XubString& rErrorText )
+void SalAbort( const XubString& rErrorText, bool )
 {
     ImplFreeSalGDI();
 


More information about the Libreoffice-commits mailing list