Linux; bring back breakpad. No upload to bugsplat implemented yet.

master
Nicky 2022-02-09 23:04:31 +01:00
parent 539b7d46b3
commit c7f39b5043
6 changed files with 122 additions and 6 deletions

View File

@ -3,6 +3,34 @@
<map>
<key>installables</key>
<map>
<key>breakpad</key>
<map>
<key>copyright</key>
<string>Copyright (C) google</string>
<key>license</key>
<string>BSD</string>
<key>license_file</key>
<string>LICENSES/google_breakpad.txt</string>
<key>name</key>
<string>breakpad</string>
<key>platforms</key>
<map>
<key>linux64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>482c2b25bbfd25edc058a02f82da39b2</string>
<key>url</key>
<string>http://3p.firestormviewer.org/breakpad-4708e6fb-linux64_bionic-220392253.tar.bz2</string>
</map>
<key>name</key>
<string>linux</string>
</map>
</map>
<key>version</key>
<string>2.48.0</string>
</map>
<key>glib</key>
<map>
<key>copyright</key>

View File

@ -12,17 +12,19 @@ endif (INSTALL_PROPRIETARY)
if (USE_BUGSPLAT)
if (NOT USESYSTEMLIBS)
include(Prebuilt)
use_prebuilt_binary(bugsplat)
if (WINDOWS)
use_prebuilt_binary(bugsplat)
set(BUGSPLAT_LIBRARIES
${ARCH_PREBUILT_DIRS_RELEASE}/bugsplat.lib
)
elseif (DARWIN)
use_prebuilt_binary(bugsplat)
find_library(BUGSPLAT_LIBRARIES BugsplatMac REQUIRED
NO_DEFAULT_PATH PATHS "${ARCH_PREBUILT_DIRS_RELEASE}")
message("Bugsplat for OSX not fully implemented, please adapt llappdelegate-objc.mm to honor options of sending user name and settings.xml.")
else (WINDOWS)
message(FATAL_ERROR "BugSplat is not supported; add -DUSE_BUGSPLAT=OFF")
use_prebuilt_binary(breakpad)
set(BUGSPLAT_LIBRARIES ${ARCH_PREBUILT_DIRS_RELEASE}/libbreakpad.a ${ARCH_PREBUILT_DIRS_RELEASE}/libbreakpad_client.a )
endif (WINDOWS)
else (NOT USESYSTEMLIBS)
set(BUGSPLAT_FIND_QUIETLY ON)
@ -32,7 +34,12 @@ if (USE_BUGSPLAT)
set(BUGSPLAT_DB "" CACHE STRING "BugSplat crash database name")
set(BUGSPLAT_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/bugsplat)
if( LINUX )
set(BUGSPLAT_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/breakpad)
add_compile_definitions(__STDC_FORMAT_MACROS)
else()
set(BUGSPLAT_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/bugsplat)
endif()
set(BUGSPLAT_DEFINE "LL_BUGSPLAT")
endif (USE_BUGSPLAT)

View File

@ -162,3 +162,63 @@ class FSViewerManifest:
if self.path( src,dst ) == 0:
self.missing.pop()
def fs_generate_breakpad_symbols_for_file( self, aFile ):
from os import makedirs, remove
from os.path import join, isfile
import subprocess
from shutil import move
dumpSym = join( self.args["build"], "..", "packages", "bin", "dump_syms" )
if not isfile( dumpSym ):
return
symbolFile = aFile +".sym"
with open( symbolFile, "w") as outfile:
subprocess.call( [dumpSym, aFile ], stdout=outfile )
firstline = open( symbolFile ).readline().strip()
if firstline != "":
module, os, bitness, hash, filename = firstline.split(" ")
symbolDir = join( "symbols", filename, hash )
try:
makedirs( symbolDir )
except:
pass
move( symbolFile, symbolDir )
if isfile( symbolFile ):
remove( symbolFile )
def fs_save_breakpad_symbols(self, osname):
from glob import glob
import sys
from os.path import isdir
from shutil import rmtree
import tarfile
#if isdir( "symbols" ):
# rmtree( "symbols" )
#files = glob( "%s/bin/*" % self.args['dest'] )
#for f in files:
# self.fs_generate_breakpad_symbols_for_file( f )
#files = glob( "%s/lib/*.so" % self.args['dest'] )
#for f in files:
# self.fs_generate_breakpad_symbols_for_file( f )
if isdir( "symbols" ):
for a in self.args:
print("%s: %s" % (a, self.args[a]))
symbolsName = "%s/Phoenix_%s_%s_%s_symbols-%s-%d.tar.bz2" % (self.args['configuration'].lower(),
self.fs_channel_legacy_oneword(),
'-'.join( self.args['version'] ),
self.args['viewer_flavor'],
osname,
self.address_size)
fTar = tarfile.open( symbolsName, "w:bz2")
fTar.add("symbols", arcname=".")

View File

@ -45,6 +45,12 @@
#include <gio/gio.h>
#if LL_SEND_CRASH_REPORTS
#include "breakpad/client/linux/handler/exception_handler.h"
#include "breakpad/common/linux/http_upload.h"
#include "lldir.h"
#endif
#define VIEWERAPI_SERVICE "com.secondlife.ViewerAppAPIService"
#define VIEWERAPI_PATH "/com/secondlife/ViewerAppAPI"
#define VIEWERAPI_INTERFACE "com.secondlife.ViewerAppAPI"
@ -131,6 +137,20 @@ LLAppViewerLinux::~LLAppViewerLinux()
{
}
static bool dumpCallback(const google_breakpad::MinidumpDescriptor& descriptor, void* context, bool succeeded)
{
std::map< std::string, std::string> parameters, files;
parameters["prod"] = "MyApp";
parameters["ver"] = "1.0";
parameters["email"] = "fred@bugsplat.com";
parameters["comments"] = "BugSplat rocks!";
files["upload_file_minidump"] = descriptor.path();
printf("Dump path: %s\n", descriptor.path() );
return succeeded;
}
bool LLAppViewerLinux::init()
{
// g_thread_init() must be called before *any* use of glib, *and*
@ -143,8 +163,8 @@ bool LLAppViewerLinux::init()
#if LL_SEND_CRASH_REPORTS
if (success)
{
LLAppViewer* pApp = LLAppViewer::instance();
pApp->initCrashReporting();
google_breakpad::MinidumpDescriptor *descriptor = new google_breakpad::MinidumpDescriptor(gDirUtilp->getExpandedFilename(LL_PATH_DUMP,""));
google_breakpad::ExceptionHandler *eh = new google_breakpad::ExceptionHandler(*descriptor, NULL, dumpCallback, NULL, true, -1);
}
#endif

View File

@ -2050,6 +2050,7 @@ class LinuxManifest(ViewerManifest):
installer_name = "_".join(installer_name_components)
#installer_name = self.installer_base_name()
self.fs_save_breakpad_symbols("linux")
self.fs_delete_linux_symbols() # <FS:ND/> Delete old syms
self.strip_binaries()
self.fs_save_linux_symbols() # <FS:ND/> Package symbols, add debug link

View File

@ -301,7 +301,7 @@ if [ ! -d `dirname "$LOG"` ] ; then
mkdir -p `dirname "$LOG"`
fi
if [ $TARGET_PLATFORM != "windows" ]
if [ $TARGET_PLATFORM == "darwin" ]
then
if [ $WANTS_CRASHREPORTING -eq $TRUE ]
then