diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
commit | 59203c63bb777a3bacec32fb8830fba33540e809 (patch) | |
tree | 58298e711c0ff0575818c30485b44a2f21bf28a0 /toolkit/crashreporter/breakpad-client | |
parent | Adding upstream version 126.0.1. (diff) | |
download | firefox-59203c63bb777a3bacec32fb8830fba33540e809.tar.xz firefox-59203c63bb777a3bacec32fb8830fba33540e809.zip |
Adding upstream version 127.0.upstream/127.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/crashreporter/breakpad-client')
3 files changed, 16 insertions, 13 deletions
diff --git a/toolkit/crashreporter/breakpad-client/linux/crash_generation/client_info.h b/toolkit/crashreporter/breakpad-client/linux/crash_generation/client_info.h index 3de2606b7b..80b70b045f 100644 --- a/toolkit/crashreporter/breakpad-client/linux/crash_generation/client_info.h +++ b/toolkit/crashreporter/breakpad-client/linux/crash_generation/client_info.h @@ -30,6 +30,8 @@ #ifndef CLIENT_LINUX_CRASH_GENERATION_CLIENT_INFO_H_ #define CLIENT_LINUX_CRASH_GENERATION_CLIENT_INFO_H_ +#include <sys/types.h> + namespace google_breakpad { class CrashGenerationServer; @@ -42,13 +44,13 @@ class ClientInfo { CrashGenerationServer* crash_server() const { return crash_server_; } pid_t pid() const { return pid_; } - void set_error_msg(nsCString &error_msg) { + void set_error_msg(char *error_msg) { had_error_ = true; error_msg_ = error_msg; } - const nsCString* error_msg() const { - return &error_msg_; + const char* error_msg() const { + return error_msg_; } bool had_error() const { @@ -59,8 +61,8 @@ class ClientInfo { CrashGenerationServer* crash_server_; pid_t pid_; bool had_error_ = false; - nsCString error_msg_; // Possible error message of the minidumper in - // case there was an error during dumping + char* error_msg_ = nullptr; // Possible error message of the minidumper in + // case there was an error during dumping }; } diff --git a/toolkit/crashreporter/breakpad-client/linux/crash_generation/crash_generation_server.cc b/toolkit/crashreporter/breakpad-client/linux/crash_generation/crash_generation_server.cc index 58baa31d10..35e3e0f80c 100644 --- a/toolkit/crashreporter/breakpad-client/linux/crash_generation/crash_generation_server.cc +++ b/toolkit/crashreporter/breakpad-client/linux/crash_generation/crash_generation_server.cc @@ -41,8 +41,6 @@ #include <vector> -#include "nsThreadUtils.h" - #include "linux/crash_generation/crash_generation_server.h" #include "linux/crash_generation/client_info.h" #include "linux/handler/exception_handler.h" @@ -54,7 +52,6 @@ #if defined(MOZ_OXIDIZED_BREAKPAD) # include "mozilla/toolkit/crashreporter/rust_minidump_writer_linux_ffi_generated.h" # include <sys/signalfd.h> -# include "nsString.h" #endif static const char kCommandQuit = 'x'; @@ -275,7 +272,7 @@ CrashGenerationServer::ClientEvent(short revents) #if defined(MOZ_OXIDIZED_BREAKPAD) ExceptionHandler::CrashContext* breakpad_cc = reinterpret_cast<ExceptionHandler::CrashContext*>(crash_context); - nsCString error_msg; + char* error_msg = nullptr; siginfo_t& si = breakpad_cc->siginfo; signalfd_siginfo signalfd_si = {}; signalfd_si.ssi_signo = si.si_signo; @@ -330,6 +327,11 @@ CrashGenerationServer::ClientEvent(short revents) exit_callback_(exit_context_, info); } + info.set_error_msg(nullptr); + if (error_msg) { + free_minidump_error_msg(error_msg); + } + return true; } @@ -375,7 +377,6 @@ CrashGenerationServer::MakeMinidumpFilename(string& outFilename) void* CrashGenerationServer::ThreadMain(void *arg) { - NS_SetCurrentThreadName("Breakpad Server"); reinterpret_cast<CrashGenerationServer*>(arg)->Run(); return NULL; } diff --git a/toolkit/crashreporter/breakpad-client/linux/handler/exception_handler.cc b/toolkit/crashreporter/breakpad-client/linux/handler/exception_handler.cc index 92a0443d79..efb97c00cb 100644 --- a/toolkit/crashreporter/breakpad-client/linux/handler/exception_handler.cc +++ b/toolkit/crashreporter/breakpad-client/linux/handler/exception_handler.cc @@ -97,7 +97,6 @@ #include "common/linux/eintr_wrapper.h" #include "third_party/lss/linux_syscall_support.h" #if defined(MOZ_OXIDIZED_BREAKPAD) -#include "nsString.h" #include "mozilla/toolkit/crashreporter/rust_minidump_writer_linux_ffi_generated.h" #endif @@ -854,9 +853,10 @@ bool ExceptionHandler::WriteMinidumpForChild(pid_t child, MinidumpDescriptor descriptor(dump_path); descriptor.UpdatePath(); #if defined(MOZ_OXIDIZED_BREAKPAD) - nsCString error_msg; - if (!write_minidump_linux(descriptor.path(), child, child_blamed_thread, &error_msg)) + char* error_msg; + if (!write_minidump_linux(descriptor.path(), child, child_blamed_thread, &error_msg)) { return false; + } #else if (!google_breakpad::WriteMinidump(descriptor.path(), child, |