1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-23 01:10:14 +01:00

Crashreporting

This commit is contained in:
Vitaly Sverchinsky
2021-05-04 21:43:19 +03:00
parent 5c05f6b421
commit e8b186a9b4
24 changed files with 1363 additions and 19 deletions

View File

@@ -127,6 +127,10 @@ It handles initialization and termination by subclassing wxApp.
#include "import/Import.h"
#if defined(USE_BREAKPAD)
#include "BreakpadConfigurer.h"
#endif
#ifdef EXPERIMENTAL_SCOREALIGN
#include "effects/ScoreAlignDialog.h"
#endif
@@ -382,6 +386,29 @@ void PopulatePreferences()
gPrefs->Flush();
}
#if defined(USE_BREAKPAD)
void InitBreakpad()
{
wxFileName databasePath;
databasePath.SetPath(wxStandardPaths::Get().GetUserLocalDataDir());
databasePath.AppendDir("crashreports");
databasePath.Mkdir(wxS_DIR_DEFAULT, wxPATH_MKDIR_FULL);
if(databasePath.DirExists())
{
BreakpadConfigurer configurer;
configurer.SetDatabasePathUTF8(databasePath.GetPath().ToUTF8().data())
.SetSenderPathUTF8(wxFileName(wxStandardPaths::Get().GetExecutablePath()).GetPath().ToUTF8().data())
#if defined(CRASH_REPORT_URL)
.SetReportURL(CRASH_REPORT_URL)
#endif
.SetParameters({
{ "version", wxString(AUDACITY_VERSION_STRING).ToUTF8().data() }
})
.Start();
}
}
#endif
}
static bool gInited = false;
@@ -996,8 +1023,10 @@ bool AudacityApp::OnExceptionInMainLoop()
AudacityApp::AudacityApp()
{
#if defined(USE_BREAKPAD)
InitBreakpad();
// Do not capture crashes in debug builds
#if !defined(_DEBUG)
#elif !defined(_DEBUG)
#if defined(HAS_CRASH_REPORT)
#if defined(wxUSE_ON_FATAL_EXCEPTION) && wxUSE_ON_FATAL_EXCEPTION
wxHandleFatalExceptions();

View File

@@ -1073,6 +1073,7 @@ list( APPEND LIBRARIES
libsoxr
portaudio-v19
sqlite
$<$<BOOL:${${_OPT}has_crashreports}>:crashreports>
$<$<BOOL:${USE_FFMPEG}>:ffmpeg>
$<$<BOOL:${USE_LIBID3TAG}>:libid3tag::libid3tag>
$<$<BOOL:${USE_LIBFLAC}>:libflac>
@@ -1292,6 +1293,10 @@ else()
)
endif()
if(CRASH_REPORT_URL)
list(APPEND DEFINES PRIVATE -DCRASH_REPORT_URL="${CRASH_REPORT_URL}")
endif()
set_target_property_all( ${TARGET} RUNTIME_OUTPUT_NAME ${AUDACITY_NAME} )
organize_source( "${TARGET_ROOT}/.." "include" "${HEADERS}" )