mirror of
https://github.com/chromium/crashpad.git
synced 2025-03-09 14:06:33 +00:00
Remove DISALLOW_* macros in crashpad
This change was partially scripted and partially done manually with vim regex + manually placing the deleted constructors. The script change looked for destructors in the public: section of a class, if that existed the deleted constructors would go before the destructor. For manual placement I looked for any constructor in the public: section of the corresponding class. If there wasn't one, then it would ideally have gone as the first entry except below enums, classes and typedefs. This may not have been perfect, but is hopefully good enough. Fingers crossed. #include "base/macros.h" is removed from files that don't use ignore_result, which is the only other thing defined in base/macros.h. Bug: chromium:1010217 Change-Id: I099526255a40b1ac1264904b4ece2f3f503c9418 Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3171034 Reviewed-by: Mark Mentovai <mark@chromium.org> Commit-Queue: Peter Boström <pbos@chromium.org>
This commit is contained in:
parent
5e43f1ed0a
commit
1aa478d161
@ -23,7 +23,6 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include "base/check.h"
|
#include "base/check.h"
|
||||||
#include "base/macros.h"
|
|
||||||
#include "base/numerics/safe_conversions.h"
|
#include "base/numerics/safe_conversions.h"
|
||||||
#include "base/strings/string_piece.h"
|
#include "base/strings/string_piece.h"
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
@ -139,6 +138,9 @@ class Annotation {
|
|||||||
size_(0),
|
size_(0),
|
||||||
type_(type) {}
|
type_(type) {}
|
||||||
|
|
||||||
|
Annotation(const Annotation&) = delete;
|
||||||
|
Annotation& operator=(const Annotation&) = delete;
|
||||||
|
|
||||||
//! \brief Specifies the number of bytes in \a value_ptr_ to include when
|
//! \brief Specifies the number of bytes in \a value_ptr_ to include when
|
||||||
//! generating a crash report.
|
//! generating a crash report.
|
||||||
//!
|
//!
|
||||||
@ -189,8 +191,6 @@ class Annotation {
|
|||||||
void* const value_ptr_;
|
void* const value_ptr_;
|
||||||
ValueSizeType size_;
|
ValueSizeType size_;
|
||||||
const Type type_;
|
const Type type_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(Annotation);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//! \brief An \sa Annotation that stores a `NUL`-terminated C-string value.
|
//! \brief An \sa Annotation that stores a `NUL`-terminated C-string value.
|
||||||
@ -214,6 +214,9 @@ class StringAnnotation : public Annotation {
|
|||||||
constexpr explicit StringAnnotation(const char name[])
|
constexpr explicit StringAnnotation(const char name[])
|
||||||
: Annotation(Type::kString, name, value_), value_() {}
|
: Annotation(Type::kString, name, value_), value_() {}
|
||||||
|
|
||||||
|
StringAnnotation(const StringAnnotation&) = delete;
|
||||||
|
StringAnnotation& operator=(const StringAnnotation&) = delete;
|
||||||
|
|
||||||
//! \brief Constructs a new StringAnnotation with the given \a name.
|
//! \brief Constructs a new StringAnnotation with the given \a name.
|
||||||
//!
|
//!
|
||||||
//! This constructor takes the ArrayInitializerTag for use when
|
//! This constructor takes the ArrayInitializerTag for use when
|
||||||
@ -262,8 +265,6 @@ class StringAnnotation : public Annotation {
|
|||||||
// This value is not `NUL`-terminated, since the size is stored by the base
|
// This value is not `NUL`-terminated, since the size is stored by the base
|
||||||
// annotation.
|
// annotation.
|
||||||
char value_[MaxSize];
|
char value_[MaxSize];
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(StringAnnotation);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
#ifndef CRASHPAD_CLIENT_ANNOTATION_LIST_H_
|
#ifndef CRASHPAD_CLIENT_ANNOTATION_LIST_H_
|
||||||
#define CRASHPAD_CLIENT_ANNOTATION_LIST_H_
|
#define CRASHPAD_CLIENT_ANNOTATION_LIST_H_
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
#include "client/annotation.h"
|
#include "client/annotation.h"
|
||||||
|
|
||||||
@ -35,6 +34,10 @@ class InProcessIntermediateDumpHandler;
|
|||||||
class AnnotationList {
|
class AnnotationList {
|
||||||
public:
|
public:
|
||||||
AnnotationList();
|
AnnotationList();
|
||||||
|
|
||||||
|
AnnotationList(const AnnotationList&) = delete;
|
||||||
|
AnnotationList& operator=(const AnnotationList&) = delete;
|
||||||
|
|
||||||
~AnnotationList();
|
~AnnotationList();
|
||||||
|
|
||||||
//! \brief Returns the instance of the list that has been registered on the
|
//! \brief Returns the instance of the list that has been registered on the
|
||||||
@ -102,8 +105,6 @@ class AnnotationList {
|
|||||||
// Dummy linked-list head and tail elements of \a Annotation::Type::kInvalid.
|
// Dummy linked-list head and tail elements of \a Annotation::Type::kInvalid.
|
||||||
Annotation head_;
|
Annotation head_;
|
||||||
Annotation tail_;
|
Annotation tail_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(AnnotationList);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/files/file_path.h"
|
#include "base/files/file_path.h"
|
||||||
#include "base/macros.h"
|
|
||||||
#include "util/file/file_io.h"
|
#include "util/file/file_io.h"
|
||||||
#include "util/file/file_reader.h"
|
#include "util/file/file_reader.h"
|
||||||
#include "util/file/file_writer.h"
|
#include "util/file/file_writer.h"
|
||||||
@ -111,6 +110,10 @@ class CrashReportDatabase {
|
|||||||
class NewReport {
|
class NewReport {
|
||||||
public:
|
public:
|
||||||
NewReport();
|
NewReport();
|
||||||
|
|
||||||
|
NewReport(const NewReport&) = delete;
|
||||||
|
NewReport& operator=(const NewReport&) = delete;
|
||||||
|
|
||||||
~NewReport();
|
~NewReport();
|
||||||
|
|
||||||
//! \brief An open FileWriter with which to write the report.
|
//! \brief An open FileWriter with which to write the report.
|
||||||
@ -152,8 +155,6 @@ class CrashReportDatabase {
|
|||||||
std::vector<ScopedRemoveFile> attachment_removers_;
|
std::vector<ScopedRemoveFile> attachment_removers_;
|
||||||
UUID uuid_;
|
UUID uuid_;
|
||||||
CrashReportDatabase* database_;
|
CrashReportDatabase* database_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(NewReport);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//! \brief A crash report that is in the process of being uploaded.
|
//! \brief A crash report that is in the process of being uploaded.
|
||||||
@ -162,6 +163,10 @@ class CrashReportDatabase {
|
|||||||
class UploadReport : public Report {
|
class UploadReport : public Report {
|
||||||
public:
|
public:
|
||||||
UploadReport();
|
UploadReport();
|
||||||
|
|
||||||
|
UploadReport(const UploadReport&) = delete;
|
||||||
|
UploadReport& operator=(const UploadReport&) = delete;
|
||||||
|
|
||||||
virtual ~UploadReport();
|
virtual ~UploadReport();
|
||||||
|
|
||||||
//! \brief An open FileReader with which to read the report.
|
//! \brief An open FileReader with which to read the report.
|
||||||
@ -189,8 +194,6 @@ class CrashReportDatabase {
|
|||||||
std::vector<std::unique_ptr<FileReader>> attachment_readers_;
|
std::vector<std::unique_ptr<FileReader>> attachment_readers_;
|
||||||
std::map<std::string, FileReader*> attachment_map_;
|
std::map<std::string, FileReader*> attachment_map_;
|
||||||
bool report_metrics_;
|
bool report_metrics_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(UploadReport);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//! \brief The result code for operations performed on a database.
|
//! \brief The result code for operations performed on a database.
|
||||||
@ -233,6 +236,9 @@ class CrashReportDatabase {
|
|||||||
kCannotRequestUpload,
|
kCannotRequestUpload,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
CrashReportDatabase(const CrashReportDatabase&) = delete;
|
||||||
|
CrashReportDatabase& operator=(const CrashReportDatabase&) = delete;
|
||||||
|
|
||||||
virtual ~CrashReportDatabase() {}
|
virtual ~CrashReportDatabase() {}
|
||||||
|
|
||||||
//! \brief Opens a database of crash reports, possibly creating it.
|
//! \brief Opens a database of crash reports, possibly creating it.
|
||||||
@ -422,8 +428,6 @@ class CrashReportDatabase {
|
|||||||
virtual OperationStatus RecordUploadAttempt(UploadReport* report,
|
virtual OperationStatus RecordUploadAttempt(UploadReport* report,
|
||||||
bool successful,
|
bool successful,
|
||||||
const std::string& id) = 0;
|
const std::string& id) = 0;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(CrashReportDatabase);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
|
#include "base/macros.h"
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
#include "client/settings.h"
|
#include "client/settings.h"
|
||||||
#include "util/file/directory_reader.h"
|
#include "util/file/directory_reader.h"
|
||||||
@ -100,6 +101,10 @@ struct ReportMetadata {
|
|||||||
class ScopedLockFile {
|
class ScopedLockFile {
|
||||||
public:
|
public:
|
||||||
ScopedLockFile() = default;
|
ScopedLockFile() = default;
|
||||||
|
|
||||||
|
ScopedLockFile(const ScopedLockFile&) = delete;
|
||||||
|
ScopedLockFile& operator=(const ScopedLockFile&) = delete;
|
||||||
|
|
||||||
~ScopedLockFile() = default;
|
~ScopedLockFile() = default;
|
||||||
|
|
||||||
ScopedLockFile& operator=(ScopedLockFile&& other) {
|
ScopedLockFile& operator=(ScopedLockFile&& other) {
|
||||||
@ -158,8 +163,6 @@ class ScopedLockFile {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
ScopedRemoveFile lock_file_;
|
ScopedRemoveFile lock_file_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ScopedLockFile);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
off_t GetFileSize(const base::FilePath& filepath) {
|
off_t GetFileSize(const base::FilePath& filepath) {
|
||||||
@ -195,6 +198,11 @@ void AddAttachmentSize(const base::FilePath& attachments_dir, uint64_t* size) {
|
|||||||
class CrashReportDatabaseGeneric : public CrashReportDatabase {
|
class CrashReportDatabaseGeneric : public CrashReportDatabase {
|
||||||
public:
|
public:
|
||||||
CrashReportDatabaseGeneric();
|
CrashReportDatabaseGeneric();
|
||||||
|
|
||||||
|
CrashReportDatabaseGeneric(const CrashReportDatabaseGeneric&) = delete;
|
||||||
|
CrashReportDatabaseGeneric& operator=(const CrashReportDatabaseGeneric&) =
|
||||||
|
delete;
|
||||||
|
|
||||||
~CrashReportDatabaseGeneric() override;
|
~CrashReportDatabaseGeneric() override;
|
||||||
|
|
||||||
bool Initialize(const base::FilePath& path, bool may_create);
|
bool Initialize(const base::FilePath& path, bool may_create);
|
||||||
@ -297,8 +305,6 @@ class CrashReportDatabaseGeneric : public CrashReportDatabase {
|
|||||||
base::FilePath base_dir_;
|
base::FilePath base_dir_;
|
||||||
Settings settings_;
|
Settings settings_;
|
||||||
InitializationStateDcheck initialized_;
|
InitializationStateDcheck initialized_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(CrashReportDatabaseGeneric);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
FileWriter* CrashReportDatabase::NewReport::AddAttachment(
|
FileWriter* CrashReportDatabase::NewReport::AddAttachment(
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include "base/cxx17_backports.h"
|
#include "base/cxx17_backports.h"
|
||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
#include "base/mac/scoped_nsautorelease_pool.h"
|
#include "base/mac/scoped_nsautorelease_pool.h"
|
||||||
|
#include "base/macros.h"
|
||||||
#include "base/posix/eintr_wrapper.h"
|
#include "base/posix/eintr_wrapper.h"
|
||||||
#include "base/scoped_generic.h"
|
#include "base/scoped_generic.h"
|
||||||
#include "base/strings/string_piece.h"
|
#include "base/strings/string_piece.h"
|
||||||
@ -127,6 +128,10 @@ std::string XattrNameInternal(const base::StringPiece& name, bool new_name) {
|
|||||||
class CrashReportDatabaseMac : public CrashReportDatabase {
|
class CrashReportDatabaseMac : public CrashReportDatabase {
|
||||||
public:
|
public:
|
||||||
explicit CrashReportDatabaseMac(const base::FilePath& path);
|
explicit CrashReportDatabaseMac(const base::FilePath& path);
|
||||||
|
|
||||||
|
CrashReportDatabaseMac(const CrashReportDatabaseMac&) = delete;
|
||||||
|
CrashReportDatabaseMac& operator=(const CrashReportDatabaseMac&) = delete;
|
||||||
|
|
||||||
virtual ~CrashReportDatabaseMac();
|
virtual ~CrashReportDatabaseMac();
|
||||||
|
|
||||||
bool Initialize(bool may_create);
|
bool Initialize(bool may_create);
|
||||||
@ -243,8 +248,6 @@ class CrashReportDatabaseMac : public CrashReportDatabase {
|
|||||||
Settings settings_;
|
Settings settings_;
|
||||||
bool xattr_new_names_;
|
bool xattr_new_names_;
|
||||||
InitializationStateDcheck initialized_;
|
InitializationStateDcheck initialized_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(CrashReportDatabaseMac);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
FileWriter* CrashReportDatabase::NewReport::AddAttachment(
|
FileWriter* CrashReportDatabase::NewReport::AddAttachment(
|
||||||
|
@ -32,6 +32,9 @@ class CrashReportDatabaseTest : public testing::Test {
|
|||||||
public:
|
public:
|
||||||
CrashReportDatabaseTest() {}
|
CrashReportDatabaseTest() {}
|
||||||
|
|
||||||
|
CrashReportDatabaseTest(const CrashReportDatabaseTest&) = delete;
|
||||||
|
CrashReportDatabaseTest& operator=(const CrashReportDatabaseTest&) = delete;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// testing::Test:
|
// testing::Test:
|
||||||
void SetUp() override {
|
void SetUp() override {
|
||||||
@ -125,8 +128,6 @@ class CrashReportDatabaseTest : public testing::Test {
|
|||||||
private:
|
private:
|
||||||
ScopedTempDir temp_dir_;
|
ScopedTempDir temp_dir_;
|
||||||
std::unique_ptr<CrashReportDatabase> db_;
|
std::unique_ptr<CrashReportDatabase> db_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(CrashReportDatabaseTest);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
TEST_F(CrashReportDatabaseTest, Initialize) {
|
TEST_F(CrashReportDatabaseTest, Initialize) {
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
|
#include "base/macros.h"
|
||||||
#include "base/numerics/safe_math.h"
|
#include "base/numerics/safe_math.h"
|
||||||
#include "base/strings/utf_string_conversions.h"
|
#include "base/strings/utf_string_conversions.h"
|
||||||
#include "client/settings.h"
|
#include "client/settings.h"
|
||||||
@ -208,6 +209,9 @@ ReportDisk::ReportDisk(const UUID& uuid,
|
|||||||
//! to disk, and queries.
|
//! to disk, and queries.
|
||||||
class Metadata {
|
class Metadata {
|
||||||
public:
|
public:
|
||||||
|
Metadata(const Metadata&) = delete;
|
||||||
|
Metadata& operator=(const Metadata&) = delete;
|
||||||
|
|
||||||
//! \brief Writes any changes if necessary, unlocks and closes the file
|
//! \brief Writes any changes if necessary, unlocks and closes the file
|
||||||
//! handle.
|
//! handle.
|
||||||
~Metadata();
|
~Metadata();
|
||||||
@ -296,8 +300,6 @@ class Metadata {
|
|||||||
const base::FilePath report_dir_;
|
const base::FilePath report_dir_;
|
||||||
bool dirty_; //! \brief `true` when a Write() is required on destruction.
|
bool dirty_; //! \brief `true` when a Write() is required on destruction.
|
||||||
std::vector<ReportDisk> reports_;
|
std::vector<ReportDisk> reports_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(Metadata);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Metadata::~Metadata() {
|
Metadata::~Metadata() {
|
||||||
@ -615,6 +617,10 @@ bool CreateDirectoryIfNecessary(const base::FilePath& path) {
|
|||||||
class CrashReportDatabaseWin : public CrashReportDatabase {
|
class CrashReportDatabaseWin : public CrashReportDatabase {
|
||||||
public:
|
public:
|
||||||
explicit CrashReportDatabaseWin(const base::FilePath& path);
|
explicit CrashReportDatabaseWin(const base::FilePath& path);
|
||||||
|
|
||||||
|
CrashReportDatabaseWin(const CrashReportDatabaseWin&) = delete;
|
||||||
|
CrashReportDatabaseWin& operator=(const CrashReportDatabaseWin&) = delete;
|
||||||
|
|
||||||
~CrashReportDatabaseWin() override;
|
~CrashReportDatabaseWin() override;
|
||||||
|
|
||||||
bool Initialize(bool may_create);
|
bool Initialize(bool may_create);
|
||||||
@ -662,8 +668,6 @@ class CrashReportDatabaseWin : public CrashReportDatabase {
|
|||||||
base::FilePath base_dir_;
|
base::FilePath base_dir_;
|
||||||
Settings settings_;
|
Settings settings_;
|
||||||
InitializationStateDcheck initialized_;
|
InitializationStateDcheck initialized_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(CrashReportDatabaseWin);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
base::FilePath CrashReportDatabaseWin::AttachmentsRootPath() {
|
base::FilePath CrashReportDatabaseWin::AttachmentsRootPath() {
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "base/files/file_path.h"
|
#include "base/files/file_path.h"
|
||||||
#include "base/macros.h"
|
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
#include "build/chromeos_buildflags.h"
|
#include "build/chromeos_buildflags.h"
|
||||||
#include "util/file/file_io.h"
|
#include "util/file/file_io.h"
|
||||||
@ -46,6 +45,10 @@ namespace crashpad {
|
|||||||
class CrashpadClient {
|
class CrashpadClient {
|
||||||
public:
|
public:
|
||||||
CrashpadClient();
|
CrashpadClient();
|
||||||
|
|
||||||
|
CrashpadClient(const CrashpadClient&) = delete;
|
||||||
|
CrashpadClient& operator=(const CrashpadClient&) = delete;
|
||||||
|
|
||||||
~CrashpadClient();
|
~CrashpadClient();
|
||||||
|
|
||||||
//! \brief Starts a Crashpad handler process, performing any necessary
|
//! \brief Starts a Crashpad handler process, performing any necessary
|
||||||
@ -744,8 +747,6 @@ class CrashpadClient {
|
|||||||
#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
|
#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID)
|
||||||
std::set<int> unhandled_signals_;
|
std::set<int> unhandled_signals_;
|
||||||
#endif // OS_APPLE
|
#endif // OS_APPLE
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(CrashpadClient);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
@ -42,6 +42,9 @@ class CrashHandler : public Thread,
|
|||||||
public UniversalMachExcServer::Interface,
|
public UniversalMachExcServer::Interface,
|
||||||
public ObjcExceptionDelegate {
|
public ObjcExceptionDelegate {
|
||||||
public:
|
public:
|
||||||
|
CrashHandler(const CrashHandler&) = delete;
|
||||||
|
CrashHandler& operator=(const CrashHandler&) = delete;
|
||||||
|
|
||||||
static CrashHandler* Get() {
|
static CrashHandler* Get() {
|
||||||
static CrashHandler* instance = new CrashHandler();
|
static CrashHandler* instance = new CrashHandler();
|
||||||
return instance;
|
return instance;
|
||||||
@ -215,8 +218,6 @@ class CrashHandler : public Thread,
|
|||||||
struct sigaction old_action_ = {};
|
struct sigaction old_action_ = {};
|
||||||
internal::IOSSystemDataCollector system_data_;
|
internal::IOSSystemDataCollector system_data_;
|
||||||
InitializationStateDcheck initialized_;
|
InitializationStateDcheck initialized_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(CrashHandler);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -129,6 +129,9 @@ std::vector<std::string> BuildArgsToLaunchWithLinker(
|
|||||||
// A base class for Crashpad signal handler implementations.
|
// A base class for Crashpad signal handler implementations.
|
||||||
class SignalHandler {
|
class SignalHandler {
|
||||||
public:
|
public:
|
||||||
|
SignalHandler(const SignalHandler&) = delete;
|
||||||
|
SignalHandler& operator=(const SignalHandler&) = delete;
|
||||||
|
|
||||||
// Returns the currently installed signal hander. May be `nullptr` if no
|
// Returns the currently installed signal hander. May be `nullptr` if no
|
||||||
// handler has been installed.
|
// handler has been installed.
|
||||||
static SignalHandler* Get() { return handler_; }
|
static SignalHandler* Get() { return handler_; }
|
||||||
@ -208,8 +211,6 @@ class SignalHandler {
|
|||||||
static SignalHandler* handler_;
|
static SignalHandler* handler_;
|
||||||
|
|
||||||
static thread_local bool disabled_for_thread_;
|
static thread_local bool disabled_for_thread_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(SignalHandler);
|
|
||||||
};
|
};
|
||||||
SignalHandler* SignalHandler::handler_ = nullptr;
|
SignalHandler* SignalHandler::handler_ = nullptr;
|
||||||
thread_local bool SignalHandler::disabled_for_thread_ = false;
|
thread_local bool SignalHandler::disabled_for_thread_ = false;
|
||||||
@ -217,6 +218,9 @@ thread_local bool SignalHandler::disabled_for_thread_ = false;
|
|||||||
// Launches a single use handler to snapshot this process.
|
// Launches a single use handler to snapshot this process.
|
||||||
class LaunchAtCrashHandler : public SignalHandler {
|
class LaunchAtCrashHandler : public SignalHandler {
|
||||||
public:
|
public:
|
||||||
|
LaunchAtCrashHandler(const LaunchAtCrashHandler&) = delete;
|
||||||
|
LaunchAtCrashHandler& operator=(const LaunchAtCrashHandler&) = delete;
|
||||||
|
|
||||||
static LaunchAtCrashHandler* Get() {
|
static LaunchAtCrashHandler* Get() {
|
||||||
static LaunchAtCrashHandler* instance = new LaunchAtCrashHandler();
|
static LaunchAtCrashHandler* instance = new LaunchAtCrashHandler();
|
||||||
return instance;
|
return instance;
|
||||||
@ -272,12 +276,13 @@ class LaunchAtCrashHandler : public SignalHandler {
|
|||||||
std::vector<std::string> envp_strings_;
|
std::vector<std::string> envp_strings_;
|
||||||
std::vector<const char*> envp_;
|
std::vector<const char*> envp_;
|
||||||
bool set_envp_ = false;
|
bool set_envp_ = false;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(LaunchAtCrashHandler);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class RequestCrashDumpHandler : public SignalHandler {
|
class RequestCrashDumpHandler : public SignalHandler {
|
||||||
public:
|
public:
|
||||||
|
RequestCrashDumpHandler(const RequestCrashDumpHandler&) = delete;
|
||||||
|
RequestCrashDumpHandler& operator=(const RequestCrashDumpHandler&) = delete;
|
||||||
|
|
||||||
static RequestCrashDumpHandler* Get() {
|
static RequestCrashDumpHandler* Get() {
|
||||||
static RequestCrashDumpHandler* instance = new RequestCrashDumpHandler();
|
static RequestCrashDumpHandler* instance = new RequestCrashDumpHandler();
|
||||||
return instance;
|
return instance;
|
||||||
@ -365,8 +370,6 @@ class RequestCrashDumpHandler : public SignalHandler {
|
|||||||
// don't anything with it except pass it along).
|
// don't anything with it except pass it along).
|
||||||
uint64_t crash_loop_before_time_ = 0;
|
uint64_t crash_loop_before_time_ = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(RequestCrashDumpHandler);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -81,6 +81,10 @@ class StartHandlerForSelfTest
|
|||||||
std::tuple<bool, bool, bool, bool, CrashType>> {
|
std::tuple<bool, bool, bool, bool, CrashType>> {
|
||||||
public:
|
public:
|
||||||
StartHandlerForSelfTest() = default;
|
StartHandlerForSelfTest() = default;
|
||||||
|
|
||||||
|
StartHandlerForSelfTest(const StartHandlerForSelfTest&) = delete;
|
||||||
|
StartHandlerForSelfTest& operator=(const StartHandlerForSelfTest&) = delete;
|
||||||
|
|
||||||
~StartHandlerForSelfTest() = default;
|
~StartHandlerForSelfTest() = default;
|
||||||
|
|
||||||
void SetUp() override {
|
void SetUp() override {
|
||||||
@ -95,8 +99,6 @@ class StartHandlerForSelfTest
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
StartHandlerForSelfTestOptions options_;
|
StartHandlerForSelfTestOptions options_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(StartHandlerForSelfTest);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
bool HandleCrashSuccessfully(int, siginfo_t*, ucontext_t*) {
|
bool HandleCrashSuccessfully(int, siginfo_t*, ucontext_t*) {
|
||||||
@ -212,6 +214,9 @@ class ScopedAltSignalStack {
|
|||||||
public:
|
public:
|
||||||
ScopedAltSignalStack() = default;
|
ScopedAltSignalStack() = default;
|
||||||
|
|
||||||
|
ScopedAltSignalStack(const ScopedAltSignalStack&) = delete;
|
||||||
|
ScopedAltSignalStack& operator=(const ScopedAltSignalStack&) = delete;
|
||||||
|
|
||||||
~ScopedAltSignalStack() {
|
~ScopedAltSignalStack() {
|
||||||
if (stack_mem_.is_valid()) {
|
if (stack_mem_.is_valid()) {
|
||||||
stack_t stack;
|
stack_t stack;
|
||||||
@ -242,8 +247,6 @@ class ScopedAltSignalStack {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
ScopedMmap stack_mem_;
|
ScopedMmap stack_mem_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ScopedAltSignalStack);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class CrashThread : public Thread {
|
class CrashThread : public Thread {
|
||||||
@ -252,6 +255,9 @@ class CrashThread : public Thread {
|
|||||||
CrashpadClient* client)
|
CrashpadClient* client)
|
||||||
: client_signal_stack_(), options_(options), client_(client) {}
|
: client_signal_stack_(), options_(options), client_(client) {}
|
||||||
|
|
||||||
|
CrashThread(const CrashThread&) = delete;
|
||||||
|
CrashThread& operator=(const CrashThread&) = delete;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void ThreadMain() override {
|
void ThreadMain() override {
|
||||||
// It is only necessary to call InitializeSignalStackForThread() once, but
|
// It is only necessary to call InitializeSignalStackForThread() once, but
|
||||||
@ -269,8 +275,6 @@ class CrashThread : public Thread {
|
|||||||
ScopedAltSignalStack client_signal_stack_;
|
ScopedAltSignalStack client_signal_stack_;
|
||||||
const StartHandlerForSelfTestOptions& options_;
|
const StartHandlerForSelfTestOptions& options_;
|
||||||
CrashpadClient* client_;
|
CrashpadClient* client_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(CrashThread);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
CRASHPAD_CHILD_TEST_MAIN(StartHandlerForSelfTestChild) {
|
CRASHPAD_CHILD_TEST_MAIN(StartHandlerForSelfTestChild) {
|
||||||
@ -360,6 +364,11 @@ class StartHandlerForSelfInChildTest : public MultiprocessExec {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
StartHandlerForSelfInChildTest(const StartHandlerForSelfInChildTest&) =
|
||||||
|
delete;
|
||||||
|
StartHandlerForSelfInChildTest& operator=(
|
||||||
|
const StartHandlerForSelfInChildTest&) = delete;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void MultiprocessParent() override {
|
void MultiprocessParent() override {
|
||||||
ScopedTempDir temp_dir;
|
ScopedTempDir temp_dir;
|
||||||
@ -415,8 +424,6 @@ class StartHandlerForSelfInChildTest : public MultiprocessExec {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StartHandlerForSelfTestOptions options_;
|
StartHandlerForSelfTestOptions options_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(StartHandlerForSelfInChildTest);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
TEST_P(StartHandlerForSelfTest, StartHandlerInChild) {
|
TEST_P(StartHandlerForSelfTest, StartHandlerInChild) {
|
||||||
@ -450,6 +457,11 @@ INSTANTIATE_TEST_SUITE_P(
|
|||||||
class StartHandlerForClientTest {
|
class StartHandlerForClientTest {
|
||||||
public:
|
public:
|
||||||
StartHandlerForClientTest() = default;
|
StartHandlerForClientTest() = default;
|
||||||
|
|
||||||
|
StartHandlerForClientTest(const StartHandlerForClientTest&) = delete;
|
||||||
|
StartHandlerForClientTest& operator=(const StartHandlerForClientTest&) =
|
||||||
|
delete;
|
||||||
|
|
||||||
~StartHandlerForClientTest() = default;
|
~StartHandlerForClientTest() = default;
|
||||||
|
|
||||||
bool Initialize(bool sanitize) {
|
bool Initialize(bool sanitize) {
|
||||||
@ -513,6 +525,9 @@ class StartHandlerForClientTest {
|
|||||||
// more privileged, process.
|
// more privileged, process.
|
||||||
class SandboxedHandler {
|
class SandboxedHandler {
|
||||||
public:
|
public:
|
||||||
|
SandboxedHandler(const SandboxedHandler&) = delete;
|
||||||
|
SandboxedHandler& operator=(const SandboxedHandler&) = delete;
|
||||||
|
|
||||||
static SandboxedHandler* Get() {
|
static SandboxedHandler* Get() {
|
||||||
static SandboxedHandler* instance = new SandboxedHandler();
|
static SandboxedHandler* instance = new SandboxedHandler();
|
||||||
return instance;
|
return instance;
|
||||||
@ -565,22 +580,22 @@ class StartHandlerForClientTest {
|
|||||||
|
|
||||||
FileHandle client_sock_;
|
FileHandle client_sock_;
|
||||||
bool sanitize_;
|
bool sanitize_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(SandboxedHandler);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
ScopedTempDir temp_dir_;
|
ScopedTempDir temp_dir_;
|
||||||
ScopedFileHandle client_sock_;
|
ScopedFileHandle client_sock_;
|
||||||
ScopedFileHandle server_sock_;
|
ScopedFileHandle server_sock_;
|
||||||
bool sanitize_;
|
bool sanitize_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(StartHandlerForClientTest);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Tests starting the handler for a child process.
|
// Tests starting the handler for a child process.
|
||||||
class StartHandlerForChildTest : public Multiprocess {
|
class StartHandlerForChildTest : public Multiprocess {
|
||||||
public:
|
public:
|
||||||
StartHandlerForChildTest() = default;
|
StartHandlerForChildTest() = default;
|
||||||
|
|
||||||
|
StartHandlerForChildTest(const StartHandlerForChildTest&) = delete;
|
||||||
|
StartHandlerForChildTest& operator=(const StartHandlerForChildTest&) = delete;
|
||||||
|
|
||||||
~StartHandlerForChildTest() = default;
|
~StartHandlerForChildTest() = default;
|
||||||
|
|
||||||
bool Initialize(bool sanitize) {
|
bool Initialize(bool sanitize) {
|
||||||
@ -607,8 +622,6 @@ class StartHandlerForChildTest : public Multiprocess {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StartHandlerForClientTest test_state_;
|
StartHandlerForClientTest test_state_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(StartHandlerForChildTest);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
TEST(CrashpadClient, StartHandlerForChild) {
|
TEST(CrashpadClient, StartHandlerForChild) {
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
#include "base/mac/mach_logging.h"
|
#include "base/mac/mach_logging.h"
|
||||||
|
#include "base/macros.h"
|
||||||
#include "base/strings/stringprintf.h"
|
#include "base/strings/stringprintf.h"
|
||||||
#include "util/mac/mac_util.h"
|
#include "util/mac/mac_util.h"
|
||||||
#include "util/mach/bootstrap.h"
|
#include "util/mach/bootstrap.h"
|
||||||
@ -94,6 +95,9 @@ class ScopedPthreadAttrDestroy {
|
|||||||
: pthread_attr_(pthread_attr) {
|
: pthread_attr_(pthread_attr) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ScopedPthreadAttrDestroy(const ScopedPthreadAttrDestroy&) = delete;
|
||||||
|
ScopedPthreadAttrDestroy& operator=(const ScopedPthreadAttrDestroy&) = delete;
|
||||||
|
|
||||||
~ScopedPthreadAttrDestroy() {
|
~ScopedPthreadAttrDestroy() {
|
||||||
errno = pthread_attr_destroy(pthread_attr_);
|
errno = pthread_attr_destroy(pthread_attr_);
|
||||||
PLOG_IF(WARNING, errno != 0) << "pthread_attr_destroy";
|
PLOG_IF(WARNING, errno != 0) << "pthread_attr_destroy";
|
||||||
@ -101,13 +105,14 @@ class ScopedPthreadAttrDestroy {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
pthread_attr_t* pthread_attr_;
|
pthread_attr_t* pthread_attr_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ScopedPthreadAttrDestroy);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//! \brief Starts a Crashpad handler, possibly restarting it if it dies.
|
//! \brief Starts a Crashpad handler, possibly restarting it if it dies.
|
||||||
class HandlerStarter final : public NotifyServer::DefaultInterface {
|
class HandlerStarter final : public NotifyServer::DefaultInterface {
|
||||||
public:
|
public:
|
||||||
|
HandlerStarter(const HandlerStarter&) = delete;
|
||||||
|
HandlerStarter& operator=(const HandlerStarter&) = delete;
|
||||||
|
|
||||||
~HandlerStarter() {}
|
~HandlerStarter() {}
|
||||||
|
|
||||||
//! \brief Starts a Crashpad handler initially, as opposed to starting it for
|
//! \brief Starts a Crashpad handler initially, as opposed to starting it for
|
||||||
@ -427,8 +432,6 @@ class HandlerStarter final : public NotifyServer::DefaultInterface {
|
|||||||
std::vector<std::string> arguments_;
|
std::vector<std::string> arguments_;
|
||||||
base::mac::ScopedMachReceiveRight notify_port_;
|
base::mac::ScopedMachReceiveRight notify_port_;
|
||||||
uint64_t last_start_time_;
|
uint64_t last_start_time_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(HandlerStarter);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
|
|
||||||
#include "base/atomicops.h"
|
#include "base/atomicops.h"
|
||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
#include "base/macros.h"
|
|
||||||
#include "base/scoped_generic.h"
|
#include "base/scoped_generic.h"
|
||||||
#include "base/strings/stringprintf.h"
|
#include "base/strings/stringprintf.h"
|
||||||
#include "base/strings/utf_string_conversions.h"
|
#include "base/strings/utf_string_conversions.h"
|
||||||
@ -339,6 +338,11 @@ class ScopedCallSetHandlerStartupState {
|
|||||||
public:
|
public:
|
||||||
ScopedCallSetHandlerStartupState() : successful_(false) {}
|
ScopedCallSetHandlerStartupState() : successful_(false) {}
|
||||||
|
|
||||||
|
ScopedCallSetHandlerStartupState(const ScopedCallSetHandlerStartupState&) =
|
||||||
|
delete;
|
||||||
|
ScopedCallSetHandlerStartupState& operator=(
|
||||||
|
const ScopedCallSetHandlerStartupState&) = delete;
|
||||||
|
|
||||||
~ScopedCallSetHandlerStartupState() {
|
~ScopedCallSetHandlerStartupState() {
|
||||||
SetHandlerStartupState(successful_ ? StartupState::kSucceeded
|
SetHandlerStartupState(successful_ ? StartupState::kSucceeded
|
||||||
: StartupState::kFailed);
|
: StartupState::kFailed);
|
||||||
@ -348,8 +352,6 @@ class ScopedCallSetHandlerStartupState {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
bool successful_;
|
bool successful_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ScopedCallSetHandlerStartupState);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
bool StartHandlerProcess(
|
bool StartHandlerProcess(
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
#include "client/annotation_list.h"
|
#include "client/annotation_list.h"
|
||||||
#include "client/simple_address_range_bag.h"
|
#include "client/simple_address_range_bag.h"
|
||||||
@ -71,6 +70,9 @@ struct CrashpadInfo {
|
|||||||
|
|
||||||
CrashpadInfo();
|
CrashpadInfo();
|
||||||
|
|
||||||
|
CrashpadInfo(const CrashpadInfo&) = delete;
|
||||||
|
CrashpadInfo& operator=(const CrashpadInfo&) = delete;
|
||||||
|
|
||||||
//! \brief Sets the bag of extra memory ranges to be included in the snapshot.
|
//! \brief Sets the bag of extra memory ranges to be included in the snapshot.
|
||||||
//!
|
//!
|
||||||
//! Extra memory ranges may exist in \a address_range_bag at the time that
|
//! Extra memory ranges may exist in \a address_range_bag at the time that
|
||||||
@ -270,8 +272,6 @@ struct CrashpadInfo {
|
|||||||
#if defined(__clang__)
|
#if defined(__clang__)
|
||||||
#pragma clang diagnostic pop
|
#pragma clang diagnostic pop
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(CrashpadInfo);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
@ -64,6 +64,9 @@ class ScopedTaskThreads {
|
|||||||
mach_msg_type_number_t thread_count)
|
mach_msg_type_number_t thread_count)
|
||||||
: threads_(threads), thread_count_(thread_count) {}
|
: threads_(threads), thread_count_(thread_count) {}
|
||||||
|
|
||||||
|
ScopedTaskThreads(const ScopedTaskThreads&) = delete;
|
||||||
|
ScopedTaskThreads& operator=(const ScopedTaskThreads&) = delete;
|
||||||
|
|
||||||
~ScopedTaskThreads() {
|
~ScopedTaskThreads() {
|
||||||
for (uint32_t thread_index = 0; thread_index < thread_count_;
|
for (uint32_t thread_index = 0; thread_index < thread_count_;
|
||||||
++thread_index) {
|
++thread_index) {
|
||||||
@ -77,8 +80,6 @@ class ScopedTaskThreads {
|
|||||||
private:
|
private:
|
||||||
thread_act_array_t threads_;
|
thread_act_array_t threads_;
|
||||||
mach_msg_type_number_t thread_count_;
|
mach_msg_type_number_t thread_count_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ScopedTaskThreads);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//! \brief Log \a key as a string.
|
//! \brief Log \a key as a string.
|
||||||
|
@ -32,6 +32,12 @@ namespace internal {
|
|||||||
//! Note: All methods are `RUNS-DURING-CRASH`.
|
//! Note: All methods are `RUNS-DURING-CRASH`.
|
||||||
class InProcessIntermediateDumpHandler final {
|
class InProcessIntermediateDumpHandler final {
|
||||||
public:
|
public:
|
||||||
|
InProcessIntermediateDumpHandler() = delete;
|
||||||
|
InProcessIntermediateDumpHandler(const InProcessIntermediateDumpHandler&) =
|
||||||
|
delete;
|
||||||
|
InProcessIntermediateDumpHandler& operator=(
|
||||||
|
const InProcessIntermediateDumpHandler&) = delete;
|
||||||
|
|
||||||
//! \brief Set kVersion to 1.
|
//! \brief Set kVersion to 1.
|
||||||
//!
|
//!
|
||||||
//! \param[in] writer The dump writer
|
//! \param[in] writer The dump writer
|
||||||
@ -136,8 +142,6 @@ class InProcessIntermediateDumpHandler final {
|
|||||||
//! \brief Write Crashpad annotations list.
|
//! \brief Write Crashpad annotations list.
|
||||||
static void WriteCrashpadAnnotationsList(IOSIntermediateDumpWriter* writer,
|
static void WriteCrashpadAnnotationsList(IOSIntermediateDumpWriter* writer,
|
||||||
CrashpadInfo* crashpad_info);
|
CrashpadInfo* crashpad_info);
|
||||||
|
|
||||||
DISALLOW_IMPLICIT_CONSTRUCTORS(InProcessIntermediateDumpHandler);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "client/crash_report_database.h"
|
#include "client/crash_report_database.h"
|
||||||
|
|
||||||
namespace crashpad {
|
namespace crashpad {
|
||||||
@ -81,14 +80,16 @@ class AgePruneCondition final : public PruneCondition {
|
|||||||
//! \param[in] max_age_in_days Reports created more than this many days ago
|
//! \param[in] max_age_in_days Reports created more than this many days ago
|
||||||
//! will be deleted.
|
//! will be deleted.
|
||||||
explicit AgePruneCondition(int max_age_in_days);
|
explicit AgePruneCondition(int max_age_in_days);
|
||||||
|
|
||||||
|
AgePruneCondition(const AgePruneCondition&) = delete;
|
||||||
|
AgePruneCondition& operator=(const AgePruneCondition&) = delete;
|
||||||
|
|
||||||
~AgePruneCondition();
|
~AgePruneCondition();
|
||||||
|
|
||||||
bool ShouldPruneReport(const CrashReportDatabase::Report& report) override;
|
bool ShouldPruneReport(const CrashReportDatabase::Report& report) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const time_t oldest_report_time_;
|
const time_t oldest_report_time_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(AgePruneCondition);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//! \brief A PruneCondition that deletes older reports to keep the total
|
//! \brief A PruneCondition that deletes older reports to keep the total
|
||||||
@ -102,6 +103,11 @@ class DatabaseSizePruneCondition final : public PruneCondition {
|
|||||||
//! \param[in] max_size_in_kb The maximum number of kilobytes that all crash
|
//! \param[in] max_size_in_kb The maximum number of kilobytes that all crash
|
||||||
//! reports should consume.
|
//! reports should consume.
|
||||||
explicit DatabaseSizePruneCondition(size_t max_size_in_kb);
|
explicit DatabaseSizePruneCondition(size_t max_size_in_kb);
|
||||||
|
|
||||||
|
DatabaseSizePruneCondition(const DatabaseSizePruneCondition&) = delete;
|
||||||
|
DatabaseSizePruneCondition& operator=(const DatabaseSizePruneCondition&) =
|
||||||
|
delete;
|
||||||
|
|
||||||
~DatabaseSizePruneCondition();
|
~DatabaseSizePruneCondition();
|
||||||
|
|
||||||
bool ShouldPruneReport(const CrashReportDatabase::Report& report) override;
|
bool ShouldPruneReport(const CrashReportDatabase::Report& report) override;
|
||||||
@ -109,8 +115,6 @@ class DatabaseSizePruneCondition final : public PruneCondition {
|
|||||||
private:
|
private:
|
||||||
const size_t max_size_in_kb_;
|
const size_t max_size_in_kb_;
|
||||||
size_t measured_size_in_kb_;
|
size_t measured_size_in_kb_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(DatabaseSizePruneCondition);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//! \brief A PruneCondition that conjoins two other PruneConditions.
|
//! \brief A PruneCondition that conjoins two other PruneConditions.
|
||||||
@ -133,6 +137,10 @@ class BinaryPruneCondition final : public PruneCondition {
|
|||||||
//! \param[in] lhs The left-hand side of \a op. This class takes ownership.
|
//! \param[in] lhs The left-hand side of \a op. This class takes ownership.
|
||||||
//! \param[in] rhs The right-hand side of \a op. This class takes ownership.
|
//! \param[in] rhs The right-hand side of \a op. This class takes ownership.
|
||||||
BinaryPruneCondition(Operator op, PruneCondition* lhs, PruneCondition* rhs);
|
BinaryPruneCondition(Operator op, PruneCondition* lhs, PruneCondition* rhs);
|
||||||
|
|
||||||
|
BinaryPruneCondition(const BinaryPruneCondition&) = delete;
|
||||||
|
BinaryPruneCondition& operator=(const BinaryPruneCondition&) = delete;
|
||||||
|
|
||||||
~BinaryPruneCondition();
|
~BinaryPruneCondition();
|
||||||
|
|
||||||
bool ShouldPruneReport(const CrashReportDatabase::Report& report) override;
|
bool ShouldPruneReport(const CrashReportDatabase::Report& report) override;
|
||||||
@ -141,8 +149,6 @@ class BinaryPruneCondition final : public PruneCondition {
|
|||||||
const Operator op_;
|
const Operator op_;
|
||||||
std::unique_ptr<PruneCondition> lhs_;
|
std::unique_ptr<PruneCondition> lhs_;
|
||||||
std::unique_ptr<PruneCondition> rhs_;
|
std::unique_ptr<PruneCondition> rhs_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(BinaryPruneCondition);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
@ -149,6 +149,10 @@ TEST(PruneCrashReports, SizeCondition) {
|
|||||||
class StaticCondition final : public PruneCondition {
|
class StaticCondition final : public PruneCondition {
|
||||||
public:
|
public:
|
||||||
explicit StaticCondition(bool value) : value_(value), did_execute_(false) {}
|
explicit StaticCondition(bool value) : value_(value), did_execute_(false) {}
|
||||||
|
|
||||||
|
StaticCondition(const StaticCondition&) = delete;
|
||||||
|
StaticCondition& operator=(const StaticCondition&) = delete;
|
||||||
|
|
||||||
~StaticCondition() {}
|
~StaticCondition() {}
|
||||||
|
|
||||||
bool ShouldPruneReport(const CrashReportDatabase::Report& report) override {
|
bool ShouldPruneReport(const CrashReportDatabase::Report& report) override {
|
||||||
@ -161,8 +165,6 @@ class StaticCondition final : public PruneCondition {
|
|||||||
private:
|
private:
|
||||||
const bool value_;
|
const bool value_;
|
||||||
bool did_execute_;
|
bool did_execute_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(StaticCondition);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
TEST(PruneCrashReports, BinaryCondition) {
|
TEST(PruneCrashReports, BinaryCondition) {
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "base/files/file_path.h"
|
#include "base/files/file_path.h"
|
||||||
#include "base/macros.h"
|
|
||||||
#include "base/scoped_generic.h"
|
#include "base/scoped_generic.h"
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
#include "util/file/file_io.h"
|
#include "util/file/file_io.h"
|
||||||
@ -46,6 +45,10 @@ struct ScopedLockedFileHandleTraits {
|
|||||||
class Settings {
|
class Settings {
|
||||||
public:
|
public:
|
||||||
Settings();
|
Settings();
|
||||||
|
|
||||||
|
Settings(const Settings&) = delete;
|
||||||
|
Settings& operator=(const Settings&) = delete;
|
||||||
|
|
||||||
~Settings();
|
~Settings();
|
||||||
|
|
||||||
//! \brief Initializes the settings data store.
|
//! \brief Initializes the settings data store.
|
||||||
@ -130,6 +133,10 @@ class Settings {
|
|||||||
const base::FilePath& lockfile_path);
|
const base::FilePath& lockfile_path);
|
||||||
ScopedLockedFileHandle(ScopedLockedFileHandle&& other);
|
ScopedLockedFileHandle(ScopedLockedFileHandle&& other);
|
||||||
ScopedLockedFileHandle& operator=(ScopedLockedFileHandle&& other);
|
ScopedLockedFileHandle& operator=(ScopedLockedFileHandle&& other);
|
||||||
|
|
||||||
|
ScopedLockedFileHandle(const ScopedLockedFileHandle&) = delete;
|
||||||
|
ScopedLockedFileHandle& operator=(const ScopedLockedFileHandle&) = delete;
|
||||||
|
|
||||||
~ScopedLockedFileHandle();
|
~ScopedLockedFileHandle();
|
||||||
|
|
||||||
// These mirror the non-Fuchsia ScopedLockedFileHandle via ScopedGeneric so
|
// These mirror the non-Fuchsia ScopedLockedFileHandle via ScopedGeneric so
|
||||||
@ -147,8 +154,6 @@ class Settings {
|
|||||||
|
|
||||||
FileHandle handle_;
|
FileHandle handle_;
|
||||||
base::FilePath lockfile_path_;
|
base::FilePath lockfile_path_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ScopedLockedFileHandle);
|
|
||||||
};
|
};
|
||||||
#else // OS_FUCHSIA
|
#else // OS_FUCHSIA
|
||||||
using ScopedLockedFileHandle =
|
using ScopedLockedFileHandle =
|
||||||
@ -221,8 +226,6 @@ class Settings {
|
|||||||
base::FilePath file_path_;
|
base::FilePath file_path_;
|
||||||
|
|
||||||
InitializationState initialized_;
|
InitializationState initialized_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(Settings);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
@ -28,6 +28,9 @@ class SettingsTest : public testing::Test {
|
|||||||
public:
|
public:
|
||||||
SettingsTest() = default;
|
SettingsTest() = default;
|
||||||
|
|
||||||
|
SettingsTest(const SettingsTest&) = delete;
|
||||||
|
SettingsTest& operator=(const SettingsTest&) = delete;
|
||||||
|
|
||||||
base::FilePath settings_path() {
|
base::FilePath settings_path() {
|
||||||
return temp_dir_.path().Append(FILE_PATH_LITERAL("settings"));
|
return temp_dir_.path().Append(FILE_PATH_LITERAL("settings"));
|
||||||
}
|
}
|
||||||
@ -55,8 +58,6 @@ class SettingsTest : public testing::Test {
|
|||||||
private:
|
private:
|
||||||
ScopedTempDir temp_dir_;
|
ScopedTempDir temp_dir_;
|
||||||
Settings settings_;
|
Settings settings_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(SettingsTest);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
TEST_F(SettingsTest, ClientID) {
|
TEST_F(SettingsTest, ClientID) {
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
|
|
||||||
#include "base/check_op.h"
|
#include "base/check_op.h"
|
||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
#include "base/macros.h"
|
|
||||||
#include "base/numerics/safe_conversions.h"
|
#include "base/numerics/safe_conversions.h"
|
||||||
#include "util/misc/from_pointer_cast.h"
|
#include "util/misc/from_pointer_cast.h"
|
||||||
#include "util/numeric/checked_range.h"
|
#include "util/numeric/checked_range.h"
|
||||||
@ -66,6 +65,9 @@ class TSimpleAddressRangeBag {
|
|||||||
current_(0) {
|
current_(0) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Iterator(const Iterator&) = delete;
|
||||||
|
Iterator& operator=(const Iterator&) = delete;
|
||||||
|
|
||||||
//! \brief Returns the next entry in the bag, or `nullptr` if at the end of
|
//! \brief Returns the next entry in the bag, or `nullptr` if at the end of
|
||||||
//! the collection.
|
//! the collection.
|
||||||
const Entry* Next() {
|
const Entry* Next() {
|
||||||
@ -81,8 +83,6 @@ class TSimpleAddressRangeBag {
|
|||||||
private:
|
private:
|
||||||
const TSimpleAddressRangeBag& bag_;
|
const TSimpleAddressRangeBag& bag_;
|
||||||
size_t current_;
|
size_t current_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(Iterator);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
TSimpleAddressRangeBag()
|
TSimpleAddressRangeBag()
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
#include "base/check_op.h"
|
#include "base/check_op.h"
|
||||||
#include "base/macros.h"
|
|
||||||
#include "base/strings/string_piece.h"
|
#include "base/strings/string_piece.h"
|
||||||
#include "util/misc/implicit_cast.h"
|
#include "util/misc/implicit_cast.h"
|
||||||
|
|
||||||
@ -82,6 +81,9 @@ class TSimpleStringDictionary {
|
|||||||
current_(0) {
|
current_(0) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Iterator(const Iterator&) = delete;
|
||||||
|
Iterator& operator=(const Iterator&) = delete;
|
||||||
|
|
||||||
//! \brief Returns the next entry in the map, or `nullptr` if at the end of
|
//! \brief Returns the next entry in the map, or `nullptr` if at the end of
|
||||||
//! the collection.
|
//! the collection.
|
||||||
const Entry* Next() {
|
const Entry* Next() {
|
||||||
@ -97,8 +99,6 @@ class TSimpleStringDictionary {
|
|||||||
private:
|
private:
|
||||||
const TSimpleStringDictionary& map_;
|
const TSimpleStringDictionary& map_;
|
||||||
size_t current_;
|
size_t current_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(Iterator);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
TSimpleStringDictionary()
|
TSimpleStringDictionary()
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include "base/cxx17_backports.h"
|
#include "base/cxx17_backports.h"
|
||||||
#include "base/macros.h"
|
|
||||||
#include "base/strings/stringprintf.h"
|
#include "base/strings/stringprintf.h"
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
@ -80,6 +79,9 @@ class TestSimulateCrashMac final : public MachMultiprocess,
|
|||||||
succeed_(true) {
|
succeed_(true) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TestSimulateCrashMac(const TestSimulateCrashMac&) = delete;
|
||||||
|
TestSimulateCrashMac& operator=(const TestSimulateCrashMac&) = delete;
|
||||||
|
|
||||||
~TestSimulateCrashMac() {}
|
~TestSimulateCrashMac() {}
|
||||||
|
|
||||||
// UniversalMachExcServer::Interface:
|
// UniversalMachExcServer::Interface:
|
||||||
@ -325,8 +327,6 @@ class TestSimulateCrashMac final : public MachMultiprocess,
|
|||||||
exception_behavior_t behavior_;
|
exception_behavior_t behavior_;
|
||||||
thread_state_flavor_t flavor_;
|
thread_state_flavor_t flavor_;
|
||||||
bool succeed_;
|
bool succeed_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(TestSimulateCrashMac);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
TEST(SimulateCrash, SimulateCrash) {
|
TEST(SimulateCrash, SimulateCrash) {
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "client/crash_report_database.h"
|
#include "client/crash_report_database.h"
|
||||||
#include "util/misc/uuid.h"
|
#include "util/misc/uuid.h"
|
||||||
#include "util/stdlib/thread_safe_vector.h"
|
#include "util/stdlib/thread_safe_vector.h"
|
||||||
@ -70,6 +69,10 @@ class CrashReportUploadThread : public WorkerThread::Delegate,
|
|||||||
CrashReportUploadThread(CrashReportDatabase* database,
|
CrashReportUploadThread(CrashReportDatabase* database,
|
||||||
const std::string& url,
|
const std::string& url,
|
||||||
const Options& options);
|
const Options& options);
|
||||||
|
|
||||||
|
CrashReportUploadThread(const CrashReportUploadThread&) = delete;
|
||||||
|
CrashReportUploadThread& operator=(const CrashReportUploadThread&) = delete;
|
||||||
|
|
||||||
~CrashReportUploadThread();
|
~CrashReportUploadThread();
|
||||||
|
|
||||||
//! \brief Informs the upload thread that a new pending report has been added
|
//! \brief Informs the upload thread that a new pending report has been added
|
||||||
@ -172,8 +175,6 @@ class CrashReportUploadThread : public WorkerThread::Delegate,
|
|||||||
WorkerThread thread_;
|
WorkerThread thread_;
|
||||||
ThreadSafeVector<UUID> known_pending_report_uuids_;
|
ThreadSafeVector<UUID> known_pending_report_uuids_;
|
||||||
CrashReportDatabase* database_; // weak
|
CrashReportDatabase* database_; // weak
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(CrashReportUploadThread);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
#include "handler/handler_main.h"
|
#include "handler/handler_main.h"
|
||||||
#include "minidump/test/minidump_user_extension_stream_util.h"
|
#include "minidump/test/minidump_user_extension_stream_util.h"
|
||||||
@ -30,11 +29,11 @@ class TestUserStreamDataSource : public crashpad::UserStreamDataSource {
|
|||||||
public:
|
public:
|
||||||
TestUserStreamDataSource() {}
|
TestUserStreamDataSource() {}
|
||||||
|
|
||||||
|
TestUserStreamDataSource(const TestUserStreamDataSource&) = delete;
|
||||||
|
TestUserStreamDataSource& operator=(const TestUserStreamDataSource&) = delete;
|
||||||
|
|
||||||
std::unique_ptr<crashpad::MinidumpUserExtensionStreamDataSource>
|
std::unique_ptr<crashpad::MinidumpUserExtensionStreamDataSource>
|
||||||
ProduceStreamData(crashpad::ProcessSnapshot* process_snapshot) override;
|
ProduceStreamData(crashpad::ProcessSnapshot* process_snapshot) override;
|
||||||
|
|
||||||
private:
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(TestUserStreamDataSource);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
std::unique_ptr<crashpad::MinidumpUserExtensionStreamDataSource>
|
std::unique_ptr<crashpad::MinidumpUserExtensionStreamDataSource>
|
||||||
|
@ -270,12 +270,14 @@ int ExitFailure() {
|
|||||||
class CallMetricsRecordNormalExit {
|
class CallMetricsRecordNormalExit {
|
||||||
public:
|
public:
|
||||||
CallMetricsRecordNormalExit() {}
|
CallMetricsRecordNormalExit() {}
|
||||||
|
|
||||||
|
CallMetricsRecordNormalExit(const CallMetricsRecordNormalExit&) = delete;
|
||||||
|
CallMetricsRecordNormalExit& operator=(const CallMetricsRecordNormalExit&) =
|
||||||
|
delete;
|
||||||
|
|
||||||
~CallMetricsRecordNormalExit() {
|
~CallMetricsRecordNormalExit() {
|
||||||
MetricsRecordExit(Metrics::LifetimeMilestone::kExitedNormally);
|
MetricsRecordExit(Metrics::LifetimeMilestone::kExitedNormally);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(CallMetricsRecordNormalExit);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#if defined(OS_APPLE) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \
|
#if defined(OS_APPLE) || defined(OS_LINUX) || defined(OS_CHROMEOS) || \
|
||||||
@ -391,6 +393,10 @@ BOOL WINAPI ConsoleHandler(DWORD console_event) {
|
|||||||
class TerminateHandler final : public SessionEndWatcher {
|
class TerminateHandler final : public SessionEndWatcher {
|
||||||
public:
|
public:
|
||||||
TerminateHandler() : SessionEndWatcher() {}
|
TerminateHandler() : SessionEndWatcher() {}
|
||||||
|
|
||||||
|
TerminateHandler(const TerminateHandler&) = delete;
|
||||||
|
TerminateHandler& operator=(const TerminateHandler&) = delete;
|
||||||
|
|
||||||
~TerminateHandler() override {}
|
~TerminateHandler() override {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -398,8 +404,6 @@ class TerminateHandler final : public SessionEndWatcher {
|
|||||||
void SessionEnding() override {
|
void SessionEnding() override {
|
||||||
MetricsRecordExit(Metrics::LifetimeMilestone::kTerminated);
|
MetricsRecordExit(Metrics::LifetimeMilestone::kTerminated);
|
||||||
}
|
}
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(TerminateHandler);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void ReinstallCrashHandler() {
|
void ReinstallCrashHandler() {
|
||||||
@ -489,6 +493,9 @@ class ScopedStoppable {
|
|||||||
public:
|
public:
|
||||||
ScopedStoppable() = default;
|
ScopedStoppable() = default;
|
||||||
|
|
||||||
|
ScopedStoppable(const ScopedStoppable&) = delete;
|
||||||
|
ScopedStoppable& operator=(const ScopedStoppable&) = delete;
|
||||||
|
|
||||||
~ScopedStoppable() {
|
~ScopedStoppable() {
|
||||||
if (stoppable_) {
|
if (stoppable_) {
|
||||||
stoppable_->Stop();
|
stoppable_->Stop();
|
||||||
@ -501,8 +508,6 @@ class ScopedStoppable {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<Stoppable> stoppable_;
|
std::unique_ptr<Stoppable> stoppable_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ScopedStoppable);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void InitCrashpadLogging() {
|
void InitCrashpadLogging() {
|
||||||
|
@ -46,6 +46,10 @@ namespace {
|
|||||||
class Logger final : public LogOutputStream::Delegate {
|
class Logger final : public LogOutputStream::Delegate {
|
||||||
public:
|
public:
|
||||||
Logger() = default;
|
Logger() = default;
|
||||||
|
|
||||||
|
Logger(const Logger&) = delete;
|
||||||
|
Logger& operator=(const Logger&) = delete;
|
||||||
|
|
||||||
~Logger() override = default;
|
~Logger() override = default;
|
||||||
|
|
||||||
#if defined(OS_ANDROID)
|
#if defined(OS_ANDROID)
|
||||||
@ -72,9 +76,6 @@ class Logger final : public LogOutputStream::Delegate {
|
|||||||
size_t OutputCap() override { return 0; }
|
size_t OutputCap() override { return 0; }
|
||||||
size_t LineWidth() override { return 0; }
|
size_t LineWidth() override { return 0; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(Logger);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
bool WriteMinidumpLogFromFile(FileReaderInterface* file_reader) {
|
bool WriteMinidumpLogFromFile(FileReaderInterface* file_reader) {
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
#include <map>
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "client/crash_report_database.h"
|
#include "client/crash_report_database.h"
|
||||||
#include "handler/crash_report_upload_thread.h"
|
#include "handler/crash_report_upload_thread.h"
|
||||||
#include "handler/linux/exception_handler_server.h"
|
#include "handler/linux/exception_handler_server.h"
|
||||||
@ -72,6 +71,10 @@ class CrashReportExceptionHandler : public ExceptionHandlerServer::Delegate {
|
|||||||
bool write_minidump_to_log,
|
bool write_minidump_to_log,
|
||||||
const UserStreamDataSources* user_stream_data_sources);
|
const UserStreamDataSources* user_stream_data_sources);
|
||||||
|
|
||||||
|
CrashReportExceptionHandler(const CrashReportExceptionHandler&) = delete;
|
||||||
|
CrashReportExceptionHandler& operator=(const CrashReportExceptionHandler&) =
|
||||||
|
delete;
|
||||||
|
|
||||||
~CrashReportExceptionHandler() override;
|
~CrashReportExceptionHandler() override;
|
||||||
|
|
||||||
// ExceptionHandlerServer::Delegate:
|
// ExceptionHandlerServer::Delegate:
|
||||||
@ -113,8 +116,6 @@ class CrashReportExceptionHandler : public ExceptionHandlerServer::Delegate {
|
|||||||
bool write_minidump_to_database_;
|
bool write_minidump_to_database_;
|
||||||
bool write_minidump_to_log_;
|
bool write_minidump_to_log_;
|
||||||
const UserStreamDataSources* user_stream_data_sources_; // weak
|
const UserStreamDataSources* user_stream_data_sources_; // weak
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(CrashReportExceptionHandler);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
#include <map>
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "client/crash_report_database.h"
|
#include "client/crash_report_database.h"
|
||||||
#include "handler/linux/exception_handler_server.h"
|
#include "handler/linux/exception_handler_server.h"
|
||||||
#include "handler/user_stream_data_source.h"
|
#include "handler/user_stream_data_source.h"
|
||||||
@ -58,6 +57,11 @@ class CrosCrashReportExceptionHandler
|
|||||||
const std::map<std::string, std::string>* process_annotations,
|
const std::map<std::string, std::string>* process_annotations,
|
||||||
const UserStreamDataSources* user_stream_data_sources);
|
const UserStreamDataSources* user_stream_data_sources);
|
||||||
|
|
||||||
|
CrosCrashReportExceptionHandler(const CrosCrashReportExceptionHandler&) =
|
||||||
|
delete;
|
||||||
|
CrosCrashReportExceptionHandler& operator=(
|
||||||
|
const CrosCrashReportExceptionHandler&) = delete;
|
||||||
|
|
||||||
~CrosCrashReportExceptionHandler() override;
|
~CrosCrashReportExceptionHandler() override;
|
||||||
|
|
||||||
// ExceptionHandlerServer::Delegate:
|
// ExceptionHandlerServer::Delegate:
|
||||||
@ -92,8 +96,6 @@ class CrosCrashReportExceptionHandler
|
|||||||
const UserStreamDataSources* user_stream_data_sources_; // weak
|
const UserStreamDataSources* user_stream_data_sources_; // weak
|
||||||
base::FilePath dump_dir_;
|
base::FilePath dump_dir_;
|
||||||
bool always_allow_feedback_;
|
bool always_allow_feedback_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(CrosCrashReportExceptionHandler);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "util/file/file_io.h"
|
#include "util/file/file_io.h"
|
||||||
#include "util/linux/exception_handler_protocol.h"
|
#include "util/linux/exception_handler_protocol.h"
|
||||||
#include "util/misc/address_types.h"
|
#include "util/misc/address_types.h"
|
||||||
@ -116,6 +115,10 @@ class ExceptionHandlerServer {
|
|||||||
};
|
};
|
||||||
|
|
||||||
ExceptionHandlerServer();
|
ExceptionHandlerServer();
|
||||||
|
|
||||||
|
ExceptionHandlerServer(const ExceptionHandlerServer&) = delete;
|
||||||
|
ExceptionHandlerServer& operator=(const ExceptionHandlerServer&) = delete;
|
||||||
|
|
||||||
~ExceptionHandlerServer();
|
~ExceptionHandlerServer();
|
||||||
|
|
||||||
//! \brief Sets the handler's PtraceStrategyDecider.
|
//! \brief Sets the handler's PtraceStrategyDecider.
|
||||||
@ -187,8 +190,6 @@ class ExceptionHandlerServer {
|
|||||||
ScopedFileHandle pollfd_;
|
ScopedFileHandle pollfd_;
|
||||||
std::atomic<bool> keep_running_;
|
std::atomic<bool> keep_running_;
|
||||||
InitializationStateDcheck initialized_;
|
InitializationStateDcheck initialized_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ExceptionHandlerServer);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
@ -45,6 +45,9 @@ class RunServerThread : public Thread {
|
|||||||
ExceptionHandlerServer::Delegate* delegate)
|
ExceptionHandlerServer::Delegate* delegate)
|
||||||
: server_(server), delegate_(delegate), join_sem_(0) {}
|
: server_(server), delegate_(delegate), join_sem_(0) {}
|
||||||
|
|
||||||
|
RunServerThread(const RunServerThread&) = delete;
|
||||||
|
RunServerThread& operator=(const RunServerThread&) = delete;
|
||||||
|
|
||||||
~RunServerThread() override {}
|
~RunServerThread() override {}
|
||||||
|
|
||||||
bool JoinWithTimeout(double timeout) {
|
bool JoinWithTimeout(double timeout) {
|
||||||
@ -65,8 +68,6 @@ class RunServerThread : public Thread {
|
|||||||
ExceptionHandlerServer* server_;
|
ExceptionHandlerServer* server_;
|
||||||
ExceptionHandlerServer::Delegate* delegate_;
|
ExceptionHandlerServer::Delegate* delegate_;
|
||||||
Semaphore join_sem_;
|
Semaphore join_sem_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(RunServerThread);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class ScopedStopServerAndJoinThread {
|
class ScopedStopServerAndJoinThread {
|
||||||
@ -75,6 +76,10 @@ class ScopedStopServerAndJoinThread {
|
|||||||
RunServerThread* thread)
|
RunServerThread* thread)
|
||||||
: server_(server), thread_(thread) {}
|
: server_(server), thread_(thread) {}
|
||||||
|
|
||||||
|
ScopedStopServerAndJoinThread(const ScopedStopServerAndJoinThread&) = delete;
|
||||||
|
ScopedStopServerAndJoinThread& operator=(
|
||||||
|
const ScopedStopServerAndJoinThread&) = delete;
|
||||||
|
|
||||||
~ScopedStopServerAndJoinThread() {
|
~ScopedStopServerAndJoinThread() {
|
||||||
server_->Stop();
|
server_->Stop();
|
||||||
EXPECT_TRUE(thread_->JoinWithTimeout(5.0));
|
EXPECT_TRUE(thread_->JoinWithTimeout(5.0));
|
||||||
@ -83,8 +88,6 @@ class ScopedStopServerAndJoinThread {
|
|||||||
private:
|
private:
|
||||||
ExceptionHandlerServer* server_;
|
ExceptionHandlerServer* server_;
|
||||||
RunServerThread* thread_;
|
RunServerThread* thread_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ScopedStopServerAndJoinThread);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class TestDelegate : public ExceptionHandlerServer::Delegate {
|
class TestDelegate : public ExceptionHandlerServer::Delegate {
|
||||||
@ -92,6 +95,9 @@ class TestDelegate : public ExceptionHandlerServer::Delegate {
|
|||||||
TestDelegate()
|
TestDelegate()
|
||||||
: Delegate(), last_exception_address_(0), last_client_(-1), sem_(0) {}
|
: Delegate(), last_exception_address_(0), last_client_(-1), sem_(0) {}
|
||||||
|
|
||||||
|
TestDelegate(const TestDelegate&) = delete;
|
||||||
|
TestDelegate& operator=(const TestDelegate&) = delete;
|
||||||
|
|
||||||
~TestDelegate() {}
|
~TestDelegate() {}
|
||||||
|
|
||||||
bool WaitForException(double timeout_seconds,
|
bool WaitForException(double timeout_seconds,
|
||||||
@ -159,8 +165,6 @@ class TestDelegate : public ExceptionHandlerServer::Delegate {
|
|||||||
VMAddress last_exception_address_;
|
VMAddress last_exception_address_;
|
||||||
pid_t last_client_;
|
pid_t last_client_;
|
||||||
Semaphore sem_;
|
Semaphore sem_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(TestDelegate);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class MockPtraceStrategyDecider : public PtraceStrategyDecider {
|
class MockPtraceStrategyDecider : public PtraceStrategyDecider {
|
||||||
@ -168,6 +172,10 @@ class MockPtraceStrategyDecider : public PtraceStrategyDecider {
|
|||||||
MockPtraceStrategyDecider(PtraceStrategyDecider::Strategy strategy)
|
MockPtraceStrategyDecider(PtraceStrategyDecider::Strategy strategy)
|
||||||
: PtraceStrategyDecider(), strategy_(strategy) {}
|
: PtraceStrategyDecider(), strategy_(strategy) {}
|
||||||
|
|
||||||
|
MockPtraceStrategyDecider(const MockPtraceStrategyDecider&) = delete;
|
||||||
|
MockPtraceStrategyDecider& operator=(const MockPtraceStrategyDecider&) =
|
||||||
|
delete;
|
||||||
|
|
||||||
~MockPtraceStrategyDecider() {}
|
~MockPtraceStrategyDecider() {}
|
||||||
|
|
||||||
Strategy ChooseStrategy(int sock,
|
Strategy ChooseStrategy(int sock,
|
||||||
@ -198,8 +206,6 @@ class MockPtraceStrategyDecider : public PtraceStrategyDecider {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
Strategy strategy_;
|
Strategy strategy_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MockPtraceStrategyDecider);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class ExceptionHandlerServerTest : public testing::TestWithParam<bool> {
|
class ExceptionHandlerServerTest : public testing::TestWithParam<bool> {
|
||||||
@ -211,6 +217,10 @@ class ExceptionHandlerServerTest : public testing::TestWithParam<bool> {
|
|||||||
sock_to_handler_(),
|
sock_to_handler_(),
|
||||||
use_multi_client_socket_(GetParam()) {}
|
use_multi_client_socket_(GetParam()) {}
|
||||||
|
|
||||||
|
ExceptionHandlerServerTest(const ExceptionHandlerServerTest&) = delete;
|
||||||
|
ExceptionHandlerServerTest& operator=(const ExceptionHandlerServerTest&) =
|
||||||
|
delete;
|
||||||
|
|
||||||
~ExceptionHandlerServerTest() = default;
|
~ExceptionHandlerServerTest() = default;
|
||||||
|
|
||||||
int SockToHandler() { return sock_to_handler_.get(); }
|
int SockToHandler() { return sock_to_handler_.get(); }
|
||||||
@ -228,6 +238,9 @@ class ExceptionHandlerServerTest : public testing::TestWithParam<bool> {
|
|||||||
CrashDumpTest(ExceptionHandlerServerTest* server_test, bool succeeds)
|
CrashDumpTest(ExceptionHandlerServerTest* server_test, bool succeeds)
|
||||||
: Multiprocess(), server_test_(server_test), succeeds_(succeeds) {}
|
: Multiprocess(), server_test_(server_test), succeeds_(succeeds) {}
|
||||||
|
|
||||||
|
CrashDumpTest(const CrashDumpTest&) = delete;
|
||||||
|
CrashDumpTest& operator=(const CrashDumpTest&) = delete;
|
||||||
|
|
||||||
~CrashDumpTest() = default;
|
~CrashDumpTest() = default;
|
||||||
|
|
||||||
void MultiprocessParent() override {
|
void MultiprocessParent() override {
|
||||||
@ -267,8 +280,6 @@ class ExceptionHandlerServerTest : public testing::TestWithParam<bool> {
|
|||||||
private:
|
private:
|
||||||
ExceptionHandlerServerTest* server_test_;
|
ExceptionHandlerServerTest* server_test_;
|
||||||
bool succeeds_;
|
bool succeeds_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(CrashDumpTest);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void ExpectCrashDumpUsingStrategy(PtraceStrategyDecider::Strategy strategy,
|
void ExpectCrashDumpUsingStrategy(PtraceStrategyDecider::Strategy strategy,
|
||||||
@ -303,8 +314,6 @@ class ExceptionHandlerServerTest : public testing::TestWithParam<bool> {
|
|||||||
ScopedFileHandle sock_to_handler_;
|
ScopedFileHandle sock_to_handler_;
|
||||||
int sock_to_client_;
|
int sock_to_client_;
|
||||||
bool use_multi_client_socket_;
|
bool use_multi_client_socket_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ExceptionHandlerServerTest);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
TEST_P(ExceptionHandlerServerTest, ShutdownWithNoClients) {
|
TEST_P(ExceptionHandlerServerTest, ShutdownWithNoClients) {
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
#include <map>
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "client/crash_report_database.h"
|
#include "client/crash_report_database.h"
|
||||||
#include "handler/crash_report_upload_thread.h"
|
#include "handler/crash_report_upload_thread.h"
|
||||||
#include "handler/user_stream_data_source.h"
|
#include "handler/user_stream_data_source.h"
|
||||||
@ -59,6 +58,10 @@ class CrashReportExceptionHandler final
|
|||||||
const std::map<std::string, std::string>* process_annotations,
|
const std::map<std::string, std::string>* process_annotations,
|
||||||
const UserStreamDataSources* user_stream_data_sources);
|
const UserStreamDataSources* user_stream_data_sources);
|
||||||
|
|
||||||
|
CrashReportExceptionHandler(const CrashReportExceptionHandler&) = delete;
|
||||||
|
CrashReportExceptionHandler& operator=(const CrashReportExceptionHandler&) =
|
||||||
|
delete;
|
||||||
|
|
||||||
~CrashReportExceptionHandler();
|
~CrashReportExceptionHandler();
|
||||||
|
|
||||||
// UniversalMachExcServer::Interface:
|
// UniversalMachExcServer::Interface:
|
||||||
@ -86,8 +89,6 @@ class CrashReportExceptionHandler final
|
|||||||
CrashReportUploadThread* upload_thread_; // weak
|
CrashReportUploadThread* upload_thread_; // weak
|
||||||
const std::map<std::string, std::string>* process_annotations_; // weak
|
const std::map<std::string, std::string>* process_annotations_; // weak
|
||||||
const UserStreamDataSources* user_stream_data_sources_; // weak
|
const UserStreamDataSources* user_stream_data_sources_; // weak
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(CrashReportExceptionHandler);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
@ -50,6 +50,10 @@ class ExceptionHandlerServerRun : public UniversalMachExcServer::Interface,
|
|||||||
composite_mach_message_server_.AddHandler(¬ify_server_);
|
composite_mach_message_server_.AddHandler(¬ify_server_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ExceptionHandlerServerRun(const ExceptionHandlerServerRun&) = delete;
|
||||||
|
ExceptionHandlerServerRun& operator=(const ExceptionHandlerServerRun&) =
|
||||||
|
delete;
|
||||||
|
|
||||||
~ExceptionHandlerServerRun() {
|
~ExceptionHandlerServerRun() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -183,8 +187,6 @@ class ExceptionHandlerServerRun : public UniversalMachExcServer::Interface,
|
|||||||
mach_port_t notify_port_; // weak
|
mach_port_t notify_port_; // weak
|
||||||
bool running_;
|
bool running_;
|
||||||
bool launchd_;
|
bool launchd_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ExceptionHandlerServerRun);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
#include <mach/mach.h>
|
#include <mach/mach.h>
|
||||||
|
|
||||||
#include "base/mac/scoped_mach_port.h"
|
#include "base/mac/scoped_mach_port.h"
|
||||||
#include "base/macros.h"
|
|
||||||
#include "util/mach/exc_server_variants.h"
|
#include "util/mach/exc_server_variants.h"
|
||||||
|
|
||||||
namespace crashpad {
|
namespace crashpad {
|
||||||
@ -37,6 +36,10 @@ class ExceptionHandlerServer {
|
|||||||
//! signal.
|
//! signal.
|
||||||
ExceptionHandlerServer(base::mac::ScopedMachReceiveRight receive_port,
|
ExceptionHandlerServer(base::mac::ScopedMachReceiveRight receive_port,
|
||||||
bool launchd);
|
bool launchd);
|
||||||
|
|
||||||
|
ExceptionHandlerServer(const ExceptionHandlerServer&) = delete;
|
||||||
|
ExceptionHandlerServer& operator=(const ExceptionHandlerServer&) = delete;
|
||||||
|
|
||||||
~ExceptionHandlerServer();
|
~ExceptionHandlerServer();
|
||||||
|
|
||||||
//! \brief Runs the exception-handling server.
|
//! \brief Runs the exception-handling server.
|
||||||
@ -73,8 +76,6 @@ class ExceptionHandlerServer {
|
|||||||
base::mac::ScopedMachReceiveRight receive_port_;
|
base::mac::ScopedMachReceiveRight receive_port_;
|
||||||
base::mac::ScopedMachReceiveRight notify_port_;
|
base::mac::ScopedMachReceiveRight notify_port_;
|
||||||
bool launchd_;
|
bool launchd_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ExceptionHandlerServer);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "util/thread/stoppable.h"
|
#include "util/thread/stoppable.h"
|
||||||
#include "util/thread/worker_thread.h"
|
#include "util/thread/worker_thread.h"
|
||||||
|
|
||||||
@ -41,6 +40,10 @@ class PruneCrashReportThread : public WorkerThread::Delegate, public Stoppable {
|
|||||||
//! pruning.
|
//! pruning.
|
||||||
PruneCrashReportThread(CrashReportDatabase* database,
|
PruneCrashReportThread(CrashReportDatabase* database,
|
||||||
std::unique_ptr<PruneCondition> condition);
|
std::unique_ptr<PruneCondition> condition);
|
||||||
|
|
||||||
|
PruneCrashReportThread(const PruneCrashReportThread&) = delete;
|
||||||
|
PruneCrashReportThread& operator=(const PruneCrashReportThread&) = delete;
|
||||||
|
|
||||||
~PruneCrashReportThread();
|
~PruneCrashReportThread();
|
||||||
|
|
||||||
// Stoppable:
|
// Stoppable:
|
||||||
@ -70,8 +73,6 @@ class PruneCrashReportThread : public WorkerThread::Delegate, public Stoppable {
|
|||||||
WorkerThread thread_;
|
WorkerThread thread_;
|
||||||
std::unique_ptr<PruneCondition> condition_;
|
std::unique_ptr<PruneCondition> condition_;
|
||||||
CrashReportDatabase* database_; // weak
|
CrashReportDatabase* database_; // weak
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(PruneCrashReportThread);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
#include <map>
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "handler/user_stream_data_source.h"
|
#include "handler/user_stream_data_source.h"
|
||||||
#include "util/win/exception_handler_server.h"
|
#include "util/win/exception_handler_server.h"
|
||||||
|
|
||||||
@ -63,6 +62,10 @@ class CrashReportExceptionHandler final
|
|||||||
const std::vector<base::FilePath>* attachments,
|
const std::vector<base::FilePath>* attachments,
|
||||||
const UserStreamDataSources* user_stream_data_sources);
|
const UserStreamDataSources* user_stream_data_sources);
|
||||||
|
|
||||||
|
CrashReportExceptionHandler(const CrashReportExceptionHandler&) = delete;
|
||||||
|
CrashReportExceptionHandler& operator=(const CrashReportExceptionHandler&) =
|
||||||
|
delete;
|
||||||
|
|
||||||
~CrashReportExceptionHandler();
|
~CrashReportExceptionHandler();
|
||||||
|
|
||||||
// ExceptionHandlerServer::Delegate:
|
// ExceptionHandlerServer::Delegate:
|
||||||
@ -81,8 +84,6 @@ class CrashReportExceptionHandler final
|
|||||||
const std::map<std::string, std::string>* process_annotations_; // weak
|
const std::map<std::string, std::string>* process_annotations_; // weak
|
||||||
const std::vector<base::FilePath>* attachments_; // weak
|
const std::vector<base::FilePath>* attachments_; // weak
|
||||||
const UserStreamDataSources* user_stream_data_sources_; // weak
|
const UserStreamDataSources* user_stream_data_sources_; // weak
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(CrashReportExceptionHandler);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
@ -36,6 +36,10 @@ namespace crashpad {
|
|||||||
class MinidumpAnnotationWriter final : public internal::MinidumpWritable {
|
class MinidumpAnnotationWriter final : public internal::MinidumpWritable {
|
||||||
public:
|
public:
|
||||||
MinidumpAnnotationWriter();
|
MinidumpAnnotationWriter();
|
||||||
|
|
||||||
|
MinidumpAnnotationWriter(const MinidumpAnnotationWriter&) = delete;
|
||||||
|
MinidumpAnnotationWriter& operator=(const MinidumpAnnotationWriter&) = delete;
|
||||||
|
|
||||||
~MinidumpAnnotationWriter();
|
~MinidumpAnnotationWriter();
|
||||||
|
|
||||||
//! \brief Initializes the annotation writer with data from an
|
//! \brief Initializes the annotation writer with data from an
|
||||||
@ -62,8 +66,6 @@ class MinidumpAnnotationWriter final : public internal::MinidumpWritable {
|
|||||||
MinidumpAnnotation annotation_;
|
MinidumpAnnotation annotation_;
|
||||||
internal::MinidumpUTF8StringWriter name_;
|
internal::MinidumpUTF8StringWriter name_;
|
||||||
MinidumpByteArrayWriter value_;
|
MinidumpByteArrayWriter value_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MinidumpAnnotationWriter);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//! \brief The writer for a MinidumpAnnotationList object in a minidump file,
|
//! \brief The writer for a MinidumpAnnotationList object in a minidump file,
|
||||||
@ -71,6 +73,11 @@ class MinidumpAnnotationWriter final : public internal::MinidumpWritable {
|
|||||||
class MinidumpAnnotationListWriter final : public internal::MinidumpWritable {
|
class MinidumpAnnotationListWriter final : public internal::MinidumpWritable {
|
||||||
public:
|
public:
|
||||||
MinidumpAnnotationListWriter();
|
MinidumpAnnotationListWriter();
|
||||||
|
|
||||||
|
MinidumpAnnotationListWriter(const MinidumpAnnotationListWriter&) = delete;
|
||||||
|
MinidumpAnnotationListWriter& operator=(const MinidumpAnnotationListWriter&) =
|
||||||
|
delete;
|
||||||
|
|
||||||
~MinidumpAnnotationListWriter();
|
~MinidumpAnnotationListWriter();
|
||||||
|
|
||||||
//! \brief Initializes the annotation list writer with a list of
|
//! \brief Initializes the annotation list writer with a list of
|
||||||
@ -100,8 +107,6 @@ class MinidumpAnnotationListWriter final : public internal::MinidumpWritable {
|
|||||||
private:
|
private:
|
||||||
std::unique_ptr<MinidumpAnnotationList> minidump_list_;
|
std::unique_ptr<MinidumpAnnotationList> minidump_list_;
|
||||||
std::vector<std::unique_ptr<MinidumpAnnotationWriter>> objects_;
|
std::vector<std::unique_ptr<MinidumpAnnotationWriter>> objects_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MinidumpAnnotationListWriter);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "minidump/minidump_extensions.h"
|
#include "minidump/minidump_extensions.h"
|
||||||
#include "minidump/minidump_writable.h"
|
#include "minidump/minidump_writable.h"
|
||||||
|
|
||||||
@ -29,6 +28,10 @@ namespace crashpad {
|
|||||||
class MinidumpByteArrayWriter final : public internal::MinidumpWritable {
|
class MinidumpByteArrayWriter final : public internal::MinidumpWritable {
|
||||||
public:
|
public:
|
||||||
MinidumpByteArrayWriter();
|
MinidumpByteArrayWriter();
|
||||||
|
|
||||||
|
MinidumpByteArrayWriter(const MinidumpByteArrayWriter&) = delete;
|
||||||
|
MinidumpByteArrayWriter& operator=(const MinidumpByteArrayWriter&) = delete;
|
||||||
|
|
||||||
~MinidumpByteArrayWriter() override;
|
~MinidumpByteArrayWriter() override;
|
||||||
|
|
||||||
//! \brief Sets the data to be written.
|
//! \brief Sets the data to be written.
|
||||||
@ -56,8 +59,6 @@ class MinidumpByteArrayWriter final : public internal::MinidumpWritable {
|
|||||||
private:
|
private:
|
||||||
std::unique_ptr<MinidumpByteArray> minidump_array_;
|
std::unique_ptr<MinidumpByteArray> minidump_array_;
|
||||||
std::vector<uint8_t> data_;
|
std::vector<uint8_t> data_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MinidumpByteArrayWriter);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "minidump/minidump_context.h"
|
#include "minidump/minidump_context.h"
|
||||||
#include "minidump/minidump_writable.h"
|
#include "minidump/minidump_writable.h"
|
||||||
|
|
||||||
@ -33,6 +32,9 @@ struct CPUContextX86_64;
|
|||||||
//! files.
|
//! files.
|
||||||
class MinidumpContextWriter : public internal::MinidumpWritable {
|
class MinidumpContextWriter : public internal::MinidumpWritable {
|
||||||
public:
|
public:
|
||||||
|
MinidumpContextWriter(const MinidumpContextWriter&) = delete;
|
||||||
|
MinidumpContextWriter& operator=(const MinidumpContextWriter&) = delete;
|
||||||
|
|
||||||
~MinidumpContextWriter() override;
|
~MinidumpContextWriter() override;
|
||||||
|
|
||||||
//! \brief Creates a MinidumpContextWriter based on \a context_snapshot.
|
//! \brief Creates a MinidumpContextWriter based on \a context_snapshot.
|
||||||
@ -59,15 +61,16 @@ class MinidumpContextWriter : public internal::MinidumpWritable {
|
|||||||
|
|
||||||
// MinidumpWritable:
|
// MinidumpWritable:
|
||||||
size_t SizeOfObject() final;
|
size_t SizeOfObject() final;
|
||||||
|
|
||||||
private:
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MinidumpContextWriter);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//! \brief The writer for a MinidumpContextX86 structure in a minidump file.
|
//! \brief The writer for a MinidumpContextX86 structure in a minidump file.
|
||||||
class MinidumpContextX86Writer final : public MinidumpContextWriter {
|
class MinidumpContextX86Writer final : public MinidumpContextWriter {
|
||||||
public:
|
public:
|
||||||
MinidumpContextX86Writer();
|
MinidumpContextX86Writer();
|
||||||
|
|
||||||
|
MinidumpContextX86Writer(const MinidumpContextX86Writer&) = delete;
|
||||||
|
MinidumpContextX86Writer& operator=(const MinidumpContextX86Writer&) = delete;
|
||||||
|
|
||||||
~MinidumpContextX86Writer() override;
|
~MinidumpContextX86Writer() override;
|
||||||
|
|
||||||
//! \brief Initializes the MinidumpContextX86 based on \a context_snapshot.
|
//! \brief Initializes the MinidumpContextX86 based on \a context_snapshot.
|
||||||
@ -100,14 +103,17 @@ class MinidumpContextX86Writer final : public MinidumpContextWriter {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
MinidumpContextX86 context_;
|
MinidumpContextX86 context_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MinidumpContextX86Writer);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//! \brief The writer for a MinidumpContextAMD64 structure in a minidump file.
|
//! \brief The writer for a MinidumpContextAMD64 structure in a minidump file.
|
||||||
class MinidumpContextAMD64Writer final : public MinidumpContextWriter {
|
class MinidumpContextAMD64Writer final : public MinidumpContextWriter {
|
||||||
public:
|
public:
|
||||||
MinidumpContextAMD64Writer();
|
MinidumpContextAMD64Writer();
|
||||||
|
|
||||||
|
MinidumpContextAMD64Writer(const MinidumpContextAMD64Writer&) = delete;
|
||||||
|
MinidumpContextAMD64Writer& operator=(const MinidumpContextAMD64Writer&) =
|
||||||
|
delete;
|
||||||
|
|
||||||
~MinidumpContextAMD64Writer() override;
|
~MinidumpContextAMD64Writer() override;
|
||||||
|
|
||||||
// Ensure proper alignment of heap-allocated objects. This should not be
|
// Ensure proper alignment of heap-allocated objects. This should not be
|
||||||
@ -151,14 +157,16 @@ class MinidumpContextAMD64Writer final : public MinidumpContextWriter {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
MinidumpContextAMD64 context_;
|
MinidumpContextAMD64 context_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MinidumpContextAMD64Writer);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//! \brief The writer for a MinidumpContextARM structure in a minidump file.
|
//! \brief The writer for a MinidumpContextARM structure in a minidump file.
|
||||||
class MinidumpContextARMWriter final : public MinidumpContextWriter {
|
class MinidumpContextARMWriter final : public MinidumpContextWriter {
|
||||||
public:
|
public:
|
||||||
MinidumpContextARMWriter();
|
MinidumpContextARMWriter();
|
||||||
|
|
||||||
|
MinidumpContextARMWriter(const MinidumpContextARMWriter&) = delete;
|
||||||
|
MinidumpContextARMWriter& operator=(const MinidumpContextARMWriter&) = delete;
|
||||||
|
|
||||||
~MinidumpContextARMWriter() override;
|
~MinidumpContextARMWriter() override;
|
||||||
|
|
||||||
//! \brief Initializes the MinidumpContextARM based on \a context_snapshot.
|
//! \brief Initializes the MinidumpContextARM based on \a context_snapshot.
|
||||||
@ -191,14 +199,17 @@ class MinidumpContextARMWriter final : public MinidumpContextWriter {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
MinidumpContextARM context_;
|
MinidumpContextARM context_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MinidumpContextARMWriter);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//! \brief The writer for a MinidumpContextARM64 structure in a minidump file.
|
//! \brief The writer for a MinidumpContextARM64 structure in a minidump file.
|
||||||
class MinidumpContextARM64Writer final : public MinidumpContextWriter {
|
class MinidumpContextARM64Writer final : public MinidumpContextWriter {
|
||||||
public:
|
public:
|
||||||
MinidumpContextARM64Writer();
|
MinidumpContextARM64Writer();
|
||||||
|
|
||||||
|
MinidumpContextARM64Writer(const MinidumpContextARM64Writer&) = delete;
|
||||||
|
MinidumpContextARM64Writer& operator=(const MinidumpContextARM64Writer&) =
|
||||||
|
delete;
|
||||||
|
|
||||||
~MinidumpContextARM64Writer() override;
|
~MinidumpContextARM64Writer() override;
|
||||||
|
|
||||||
//! \brief Initializes the MinidumpContextARM64 based on \a context_snapshot.
|
//! \brief Initializes the MinidumpContextARM64 based on \a context_snapshot.
|
||||||
@ -231,14 +242,17 @@ class MinidumpContextARM64Writer final : public MinidumpContextWriter {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
MinidumpContextARM64 context_;
|
MinidumpContextARM64 context_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MinidumpContextARM64Writer);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//! \brief The writer for a MinidumpContextMIPS structure in a minidump file.
|
//! \brief The writer for a MinidumpContextMIPS structure in a minidump file.
|
||||||
class MinidumpContextMIPSWriter final : public MinidumpContextWriter {
|
class MinidumpContextMIPSWriter final : public MinidumpContextWriter {
|
||||||
public:
|
public:
|
||||||
MinidumpContextMIPSWriter();
|
MinidumpContextMIPSWriter();
|
||||||
|
|
||||||
|
MinidumpContextMIPSWriter(const MinidumpContextMIPSWriter&) = delete;
|
||||||
|
MinidumpContextMIPSWriter& operator=(const MinidumpContextMIPSWriter&) =
|
||||||
|
delete;
|
||||||
|
|
||||||
~MinidumpContextMIPSWriter() override;
|
~MinidumpContextMIPSWriter() override;
|
||||||
|
|
||||||
//! \brief Initializes the MinidumpContextMIPS based on \a context_snapshot.
|
//! \brief Initializes the MinidumpContextMIPS based on \a context_snapshot.
|
||||||
@ -271,14 +285,17 @@ class MinidumpContextMIPSWriter final : public MinidumpContextWriter {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
MinidumpContextMIPS context_;
|
MinidumpContextMIPS context_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MinidumpContextMIPSWriter);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//! \brief The writer for a MinidumpContextMIPS64 structure in a minidump file.
|
//! \brief The writer for a MinidumpContextMIPS64 structure in a minidump file.
|
||||||
class MinidumpContextMIPS64Writer final : public MinidumpContextWriter {
|
class MinidumpContextMIPS64Writer final : public MinidumpContextWriter {
|
||||||
public:
|
public:
|
||||||
MinidumpContextMIPS64Writer();
|
MinidumpContextMIPS64Writer();
|
||||||
|
|
||||||
|
MinidumpContextMIPS64Writer(const MinidumpContextMIPS64Writer&) = delete;
|
||||||
|
MinidumpContextMIPS64Writer& operator=(const MinidumpContextMIPS64Writer&) =
|
||||||
|
delete;
|
||||||
|
|
||||||
~MinidumpContextMIPS64Writer() override;
|
~MinidumpContextMIPS64Writer() override;
|
||||||
|
|
||||||
//! \brief Initializes the MinidumpContextMIPS based on \a context_snapshot.
|
//! \brief Initializes the MinidumpContextMIPS based on \a context_snapshot.
|
||||||
@ -311,8 +328,6 @@ class MinidumpContextMIPS64Writer final : public MinidumpContextWriter {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
MinidumpContextMIPS64 context_;
|
MinidumpContextMIPS64 context_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MinidumpContextMIPS64Writer);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "minidump/minidump_extensions.h"
|
#include "minidump/minidump_extensions.h"
|
||||||
#include "minidump/minidump_stream_writer.h"
|
#include "minidump/minidump_stream_writer.h"
|
||||||
#include "util/misc/uuid.h"
|
#include "util/misc/uuid.h"
|
||||||
@ -35,6 +34,11 @@ class ProcessSnapshot;
|
|||||||
class MinidumpCrashpadInfoWriter final : public internal::MinidumpStreamWriter {
|
class MinidumpCrashpadInfoWriter final : public internal::MinidumpStreamWriter {
|
||||||
public:
|
public:
|
||||||
MinidumpCrashpadInfoWriter();
|
MinidumpCrashpadInfoWriter();
|
||||||
|
|
||||||
|
MinidumpCrashpadInfoWriter(const MinidumpCrashpadInfoWriter&) = delete;
|
||||||
|
MinidumpCrashpadInfoWriter& operator=(const MinidumpCrashpadInfoWriter&) =
|
||||||
|
delete;
|
||||||
|
|
||||||
~MinidumpCrashpadInfoWriter() override;
|
~MinidumpCrashpadInfoWriter() override;
|
||||||
|
|
||||||
//! \brief Initializes MinidumpCrashpadInfo based on \a process_snapshot.
|
//! \brief Initializes MinidumpCrashpadInfo based on \a process_snapshot.
|
||||||
@ -105,8 +109,6 @@ class MinidumpCrashpadInfoWriter final : public internal::MinidumpStreamWriter {
|
|||||||
MinidumpCrashpadInfo crashpad_info_;
|
MinidumpCrashpadInfo crashpad_info_;
|
||||||
std::unique_ptr<MinidumpSimpleStringDictionaryWriter> simple_annotations_;
|
std::unique_ptr<MinidumpSimpleStringDictionaryWriter> simple_annotations_;
|
||||||
std::unique_ptr<MinidumpModuleCrashpadInfoListWriter> module_list_;
|
std::unique_ptr<MinidumpModuleCrashpadInfoListWriter> module_list_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MinidumpCrashpadInfoWriter);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "minidump/minidump_stream_writer.h"
|
#include "minidump/minidump_stream_writer.h"
|
||||||
#include "minidump/minidump_thread_id_map.h"
|
#include "minidump/minidump_thread_id_map.h"
|
||||||
|
|
||||||
@ -37,6 +36,10 @@ class MinidumpMemoryListWriter;
|
|||||||
class MinidumpExceptionWriter final : public internal::MinidumpStreamWriter {
|
class MinidumpExceptionWriter final : public internal::MinidumpStreamWriter {
|
||||||
public:
|
public:
|
||||||
MinidumpExceptionWriter();
|
MinidumpExceptionWriter();
|
||||||
|
|
||||||
|
MinidumpExceptionWriter(const MinidumpExceptionWriter&) = delete;
|
||||||
|
MinidumpExceptionWriter& operator=(const MinidumpExceptionWriter&) = delete;
|
||||||
|
|
||||||
~MinidumpExceptionWriter() override;
|
~MinidumpExceptionWriter() override;
|
||||||
|
|
||||||
//! \brief Initializes the MINIDUMP_EXCEPTION_STREAM based on \a
|
//! \brief Initializes the MINIDUMP_EXCEPTION_STREAM based on \a
|
||||||
@ -117,8 +120,6 @@ class MinidumpExceptionWriter final : public internal::MinidumpStreamWriter {
|
|||||||
private:
|
private:
|
||||||
MINIDUMP_EXCEPTION_STREAM exception_;
|
MINIDUMP_EXCEPTION_STREAM exception_;
|
||||||
std::unique_ptr<MinidumpContextWriter> context_;
|
std::unique_ptr<MinidumpContextWriter> context_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MinidumpExceptionWriter);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
#include <set>
|
#include <set>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "minidump/minidump_extensions.h"
|
#include "minidump/minidump_extensions.h"
|
||||||
#include "minidump/minidump_stream_writer.h"
|
#include "minidump/minidump_stream_writer.h"
|
||||||
#include "minidump/minidump_writable.h"
|
#include "minidump/minidump_writable.h"
|
||||||
@ -41,6 +40,10 @@ class MinidumpUserExtensionStreamDataSource;
|
|||||||
class MinidumpFileWriter final : public internal::MinidumpWritable {
|
class MinidumpFileWriter final : public internal::MinidumpWritable {
|
||||||
public:
|
public:
|
||||||
MinidumpFileWriter();
|
MinidumpFileWriter();
|
||||||
|
|
||||||
|
MinidumpFileWriter(const MinidumpFileWriter&) = delete;
|
||||||
|
MinidumpFileWriter& operator=(const MinidumpFileWriter&) = delete;
|
||||||
|
|
||||||
~MinidumpFileWriter() override;
|
~MinidumpFileWriter() override;
|
||||||
|
|
||||||
//! \brief Initializes the MinidumpFileWriter and populates it with
|
//! \brief Initializes the MinidumpFileWriter and populates it with
|
||||||
@ -163,8 +166,6 @@ class MinidumpFileWriter final : public internal::MinidumpWritable {
|
|||||||
|
|
||||||
// Protects against multiple streams with the same ID being added.
|
// Protects against multiple streams with the same ID being added.
|
||||||
std::set<MinidumpStreamType> stream_types_;
|
std::set<MinidumpStreamType> stream_types_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MinidumpFileWriter);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
@ -64,6 +64,9 @@ class TestStream final : public internal::MinidumpStreamWriter {
|
|||||||
uint8_t stream_value)
|
uint8_t stream_value)
|
||||||
: stream_data_(stream_size, stream_value), stream_type_(stream_type) {}
|
: stream_data_(stream_size, stream_value), stream_type_(stream_type) {}
|
||||||
|
|
||||||
|
TestStream(const TestStream&) = delete;
|
||||||
|
TestStream& operator=(const TestStream&) = delete;
|
||||||
|
|
||||||
~TestStream() override {}
|
~TestStream() override {}
|
||||||
|
|
||||||
// MinidumpStreamWriter:
|
// MinidumpStreamWriter:
|
||||||
@ -86,13 +89,15 @@ class TestStream final : public internal::MinidumpStreamWriter {
|
|||||||
private:
|
private:
|
||||||
std::string stream_data_;
|
std::string stream_data_;
|
||||||
MinidumpStreamType stream_type_;
|
MinidumpStreamType stream_type_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(TestStream);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class StringFileOutputStream : public OutputStreamInterface {
|
class StringFileOutputStream : public OutputStreamInterface {
|
||||||
public:
|
public:
|
||||||
StringFileOutputStream() = default;
|
StringFileOutputStream() = default;
|
||||||
|
|
||||||
|
StringFileOutputStream(const StringFileOutputStream&) = delete;
|
||||||
|
StringFileOutputStream& operator=(const StringFileOutputStream&) = delete;
|
||||||
|
|
||||||
~StringFileOutputStream() override = default;
|
~StringFileOutputStream() override = default;
|
||||||
bool Write(const uint8_t* data, size_t size) override {
|
bool Write(const uint8_t* data, size_t size) override {
|
||||||
return string_file_.Write(data, size);
|
return string_file_.Write(data, size);
|
||||||
@ -102,8 +107,6 @@ class StringFileOutputStream : public OutputStreamInterface {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
StringFile string_file_;
|
StringFile string_file_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(StringFileOutputStream);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
TEST(MinidumpFileWriter, OneStream) {
|
TEST(MinidumpFileWriter, OneStream) {
|
||||||
|
@ -43,6 +43,10 @@ namespace crashpad {
|
|||||||
class MinidumpHandleDataWriter final : public internal::MinidumpStreamWriter {
|
class MinidumpHandleDataWriter final : public internal::MinidumpStreamWriter {
|
||||||
public:
|
public:
|
||||||
MinidumpHandleDataWriter();
|
MinidumpHandleDataWriter();
|
||||||
|
|
||||||
|
MinidumpHandleDataWriter(const MinidumpHandleDataWriter&) = delete;
|
||||||
|
MinidumpHandleDataWriter& operator=(const MinidumpHandleDataWriter&) = delete;
|
||||||
|
|
||||||
~MinidumpHandleDataWriter() override;
|
~MinidumpHandleDataWriter() override;
|
||||||
|
|
||||||
//! \brief Adds a MINIDUMP_HANDLE_DESCRIPTOR for each handle in \a
|
//! \brief Adds a MINIDUMP_HANDLE_DESCRIPTOR for each handle in \a
|
||||||
@ -68,8 +72,6 @@ class MinidumpHandleDataWriter final : public internal::MinidumpStreamWriter {
|
|||||||
MINIDUMP_HANDLE_DATA_STREAM handle_data_stream_base_;
|
MINIDUMP_HANDLE_DATA_STREAM handle_data_stream_base_;
|
||||||
std::vector<MINIDUMP_HANDLE_DESCRIPTOR> handle_descriptors_;
|
std::vector<MINIDUMP_HANDLE_DESCRIPTOR> handle_descriptors_;
|
||||||
std::map<std::string, internal::MinidumpUTF16StringWriter*> strings_;
|
std::map<std::string, internal::MinidumpUTF16StringWriter*> strings_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MinidumpHandleDataWriter);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "minidump/minidump_stream_writer.h"
|
#include "minidump/minidump_stream_writer.h"
|
||||||
#include "minidump/minidump_writable.h"
|
#include "minidump/minidump_writable.h"
|
||||||
|
|
||||||
@ -39,6 +38,11 @@ class MinidumpMemoryInfoListWriter final
|
|||||||
: public internal::MinidumpStreamWriter {
|
: public internal::MinidumpStreamWriter {
|
||||||
public:
|
public:
|
||||||
MinidumpMemoryInfoListWriter();
|
MinidumpMemoryInfoListWriter();
|
||||||
|
|
||||||
|
MinidumpMemoryInfoListWriter(const MinidumpMemoryInfoListWriter&) = delete;
|
||||||
|
MinidumpMemoryInfoListWriter& operator=(const MinidumpMemoryInfoListWriter&) =
|
||||||
|
delete;
|
||||||
|
|
||||||
~MinidumpMemoryInfoListWriter() override;
|
~MinidumpMemoryInfoListWriter() override;
|
||||||
|
|
||||||
//! \brief Initializes a MINIDUMP_MEMORY_INFO_LIST based on \a memory_map.
|
//! \brief Initializes a MINIDUMP_MEMORY_INFO_LIST based on \a memory_map.
|
||||||
@ -63,8 +67,6 @@ class MinidumpMemoryInfoListWriter final
|
|||||||
private:
|
private:
|
||||||
MINIDUMP_MEMORY_INFO_LIST memory_info_list_base_;
|
MINIDUMP_MEMORY_INFO_LIST memory_info_list_base_;
|
||||||
std::vector<MINIDUMP_MEMORY_INFO> items_;
|
std::vector<MINIDUMP_MEMORY_INFO> items_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MinidumpMemoryInfoListWriter);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "minidump/minidump_stream_writer.h"
|
#include "minidump/minidump_stream_writer.h"
|
||||||
#include "minidump/minidump_writable.h"
|
#include "minidump/minidump_writable.h"
|
||||||
#include "snapshot/memory_snapshot.h"
|
#include "snapshot/memory_snapshot.h"
|
||||||
@ -37,6 +36,11 @@ class SnapshotMinidumpMemoryWriter : public internal::MinidumpWritable,
|
|||||||
public MemorySnapshot::Delegate {
|
public MemorySnapshot::Delegate {
|
||||||
public:
|
public:
|
||||||
explicit SnapshotMinidumpMemoryWriter(const MemorySnapshot* memory_snapshot);
|
explicit SnapshotMinidumpMemoryWriter(const MemorySnapshot* memory_snapshot);
|
||||||
|
|
||||||
|
SnapshotMinidumpMemoryWriter(const SnapshotMinidumpMemoryWriter&) = delete;
|
||||||
|
SnapshotMinidumpMemoryWriter& operator=(const SnapshotMinidumpMemoryWriter&) =
|
||||||
|
delete;
|
||||||
|
|
||||||
~SnapshotMinidumpMemoryWriter() override;
|
~SnapshotMinidumpMemoryWriter() override;
|
||||||
|
|
||||||
//! \brief Returns a MINIDUMP_MEMORY_DESCRIPTOR referencing the data that this
|
//! \brief Returns a MINIDUMP_MEMORY_DESCRIPTOR referencing the data that this
|
||||||
@ -111,8 +115,6 @@ class SnapshotMinidumpMemoryWriter : public internal::MinidumpWritable,
|
|||||||
std::vector<MINIDUMP_MEMORY_DESCRIPTOR*> registered_memory_descriptors_;
|
std::vector<MINIDUMP_MEMORY_DESCRIPTOR*> registered_memory_descriptors_;
|
||||||
const MemorySnapshot* memory_snapshot_;
|
const MemorySnapshot* memory_snapshot_;
|
||||||
FileWriterInterface* file_writer_;
|
FileWriterInterface* file_writer_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(SnapshotMinidumpMemoryWriter);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//! \brief The writer for a MINIDUMP_MEMORY_LIST stream in a minidump file,
|
//! \brief The writer for a MINIDUMP_MEMORY_LIST stream in a minidump file,
|
||||||
@ -120,6 +122,10 @@ class SnapshotMinidumpMemoryWriter : public internal::MinidumpWritable,
|
|||||||
class MinidumpMemoryListWriter final : public internal::MinidumpStreamWriter {
|
class MinidumpMemoryListWriter final : public internal::MinidumpStreamWriter {
|
||||||
public:
|
public:
|
||||||
MinidumpMemoryListWriter();
|
MinidumpMemoryListWriter();
|
||||||
|
|
||||||
|
MinidumpMemoryListWriter(const MinidumpMemoryListWriter&) = delete;
|
||||||
|
MinidumpMemoryListWriter& operator=(const MinidumpMemoryListWriter&) = delete;
|
||||||
|
|
||||||
~MinidumpMemoryListWriter() override;
|
~MinidumpMemoryListWriter() override;
|
||||||
|
|
||||||
//! \brief Adds a concrete initialized SnapshotMinidumpMemoryWriter for each
|
//! \brief Adds a concrete initialized SnapshotMinidumpMemoryWriter for each
|
||||||
@ -197,8 +203,6 @@ class MinidumpMemoryListWriter final : public internal::MinidumpStreamWriter {
|
|||||||
snapshots_created_during_merge_;
|
snapshots_created_during_merge_;
|
||||||
std::vector<SnapshotMinidumpMemoryWriter*> all_memory_writers_; // weak
|
std::vector<SnapshotMinidumpMemoryWriter*> all_memory_writers_; // weak
|
||||||
MINIDUMP_MEMORY_LIST memory_list_base_;
|
MINIDUMP_MEMORY_LIST memory_list_base_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MinidumpMemoryListWriter);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
@ -235,6 +235,9 @@ class TestMemoryStream final : public internal::MinidumpStreamWriter {
|
|||||||
TestMemoryStream(uint64_t base_address, size_t size, uint8_t value)
|
TestMemoryStream(uint64_t base_address, size_t size, uint8_t value)
|
||||||
: MinidumpStreamWriter(), memory_(base_address, size, value) {}
|
: MinidumpStreamWriter(), memory_(base_address, size, value) {}
|
||||||
|
|
||||||
|
TestMemoryStream(const TestMemoryStream&) = delete;
|
||||||
|
TestMemoryStream& operator=(const TestMemoryStream&) = delete;
|
||||||
|
|
||||||
~TestMemoryStream() override {}
|
~TestMemoryStream() override {}
|
||||||
|
|
||||||
TestMinidumpMemoryWriter* memory() {
|
TestMinidumpMemoryWriter* memory() {
|
||||||
@ -266,8 +269,6 @@ class TestMemoryStream final : public internal::MinidumpStreamWriter {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
TestMinidumpMemoryWriter memory_;
|
TestMinidumpMemoryWriter memory_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(TestMemoryStream);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
TEST(MinidumpMemoryWriter, ExtraMemory) {
|
TEST(MinidumpMemoryWriter, ExtraMemory) {
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
#include "minidump/minidump_stream_writer.h"
|
#include "minidump/minidump_stream_writer.h"
|
||||||
#include "minidump/minidump_writable.h"
|
#include "minidump/minidump_writable.h"
|
||||||
@ -60,6 +59,10 @@ std::string MinidumpMiscInfoDebugBuildString();
|
|||||||
class MinidumpMiscInfoWriter final : public internal::MinidumpStreamWriter {
|
class MinidumpMiscInfoWriter final : public internal::MinidumpStreamWriter {
|
||||||
public:
|
public:
|
||||||
MinidumpMiscInfoWriter();
|
MinidumpMiscInfoWriter();
|
||||||
|
|
||||||
|
MinidumpMiscInfoWriter(const MinidumpMiscInfoWriter&) = delete;
|
||||||
|
MinidumpMiscInfoWriter& operator=(const MinidumpMiscInfoWriter&) = delete;
|
||||||
|
|
||||||
~MinidumpMiscInfoWriter() override;
|
~MinidumpMiscInfoWriter() override;
|
||||||
|
|
||||||
//! \brief Initializes MINIDUMP_MISC_INFO_N based on \a process_snapshot.
|
//! \brief Initializes MINIDUMP_MISC_INFO_N based on \a process_snapshot.
|
||||||
@ -135,8 +138,6 @@ class MinidumpMiscInfoWriter final : public internal::MinidumpStreamWriter {
|
|||||||
|
|
||||||
MINIDUMP_MISC_INFO_N misc_info_;
|
MINIDUMP_MISC_INFO_N misc_info_;
|
||||||
bool has_xstate_data_;
|
bool has_xstate_data_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MinidumpMiscInfoWriter);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//! \brief Conversion functions from a native UTF16 C-string to a char16_t
|
//! \brief Conversion functions from a native UTF16 C-string to a char16_t
|
||||||
|
@ -21,7 +21,6 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "minidump/minidump_extensions.h"
|
#include "minidump/minidump_extensions.h"
|
||||||
#include "minidump/minidump_string_writer.h"
|
#include "minidump/minidump_string_writer.h"
|
||||||
#include "minidump/minidump_writable.h"
|
#include "minidump/minidump_writable.h"
|
||||||
@ -38,6 +37,12 @@ class MinidumpModuleCrashpadInfoWriter final
|
|||||||
: public internal::MinidumpWritable {
|
: public internal::MinidumpWritable {
|
||||||
public:
|
public:
|
||||||
MinidumpModuleCrashpadInfoWriter();
|
MinidumpModuleCrashpadInfoWriter();
|
||||||
|
|
||||||
|
MinidumpModuleCrashpadInfoWriter(const MinidumpModuleCrashpadInfoWriter&) =
|
||||||
|
delete;
|
||||||
|
MinidumpModuleCrashpadInfoWriter& operator=(
|
||||||
|
const MinidumpModuleCrashpadInfoWriter&) = delete;
|
||||||
|
|
||||||
~MinidumpModuleCrashpadInfoWriter() override;
|
~MinidumpModuleCrashpadInfoWriter() override;
|
||||||
|
|
||||||
//! \brief Initializes MinidumpModuleCrashpadInfo based on \a module_snapshot.
|
//! \brief Initializes MinidumpModuleCrashpadInfo based on \a module_snapshot.
|
||||||
@ -107,8 +112,6 @@ class MinidumpModuleCrashpadInfoWriter final
|
|||||||
std::unique_ptr<MinidumpUTF8StringListWriter> list_annotations_;
|
std::unique_ptr<MinidumpUTF8StringListWriter> list_annotations_;
|
||||||
std::unique_ptr<MinidumpSimpleStringDictionaryWriter> simple_annotations_;
|
std::unique_ptr<MinidumpSimpleStringDictionaryWriter> simple_annotations_;
|
||||||
std::unique_ptr<MinidumpAnnotationListWriter> annotation_objects_;
|
std::unique_ptr<MinidumpAnnotationListWriter> annotation_objects_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MinidumpModuleCrashpadInfoWriter);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//! \brief The writer for a MinidumpModuleCrashpadInfoList object in a minidump
|
//! \brief The writer for a MinidumpModuleCrashpadInfoList object in a minidump
|
||||||
@ -117,6 +120,12 @@ class MinidumpModuleCrashpadInfoListWriter final
|
|||||||
: public internal::MinidumpWritable {
|
: public internal::MinidumpWritable {
|
||||||
public:
|
public:
|
||||||
MinidumpModuleCrashpadInfoListWriter();
|
MinidumpModuleCrashpadInfoListWriter();
|
||||||
|
|
||||||
|
MinidumpModuleCrashpadInfoListWriter(
|
||||||
|
const MinidumpModuleCrashpadInfoListWriter&) = delete;
|
||||||
|
MinidumpModuleCrashpadInfoListWriter& operator=(
|
||||||
|
const MinidumpModuleCrashpadInfoListWriter&) = delete;
|
||||||
|
|
||||||
~MinidumpModuleCrashpadInfoListWriter() override;
|
~MinidumpModuleCrashpadInfoListWriter() override;
|
||||||
|
|
||||||
//! \brief Adds an initialized MinidumpModuleCrashpadInfo for modules in \a
|
//! \brief Adds an initialized MinidumpModuleCrashpadInfo for modules in \a
|
||||||
@ -171,8 +180,6 @@ class MinidumpModuleCrashpadInfoListWriter final
|
|||||||
module_crashpad_infos_;
|
module_crashpad_infos_;
|
||||||
std::vector<MinidumpModuleCrashpadInfoLink> module_crashpad_info_links_;
|
std::vector<MinidumpModuleCrashpadInfoLink> module_crashpad_info_links_;
|
||||||
MinidumpModuleCrashpadInfoList module_crashpad_info_list_base_;
|
MinidumpModuleCrashpadInfoList module_crashpad_info_list_base_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MinidumpModuleCrashpadInfoListWriter);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
@ -25,7 +25,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "minidump/minidump_extensions.h"
|
#include "minidump/minidump_extensions.h"
|
||||||
#include "minidump/minidump_stream_writer.h"
|
#include "minidump/minidump_stream_writer.h"
|
||||||
#include "minidump/minidump_writable.h"
|
#include "minidump/minidump_writable.h"
|
||||||
@ -42,13 +41,15 @@ class MinidumpUTF16StringWriter;
|
|||||||
//! MINIDUMP_MODULE::CvRecord in minidump files.
|
//! MINIDUMP_MODULE::CvRecord in minidump files.
|
||||||
class MinidumpModuleCodeViewRecordWriter : public internal::MinidumpWritable {
|
class MinidumpModuleCodeViewRecordWriter : public internal::MinidumpWritable {
|
||||||
public:
|
public:
|
||||||
|
MinidumpModuleCodeViewRecordWriter(
|
||||||
|
const MinidumpModuleCodeViewRecordWriter&) = delete;
|
||||||
|
MinidumpModuleCodeViewRecordWriter& operator=(
|
||||||
|
const MinidumpModuleCodeViewRecordWriter&) = delete;
|
||||||
|
|
||||||
~MinidumpModuleCodeViewRecordWriter() override;
|
~MinidumpModuleCodeViewRecordWriter() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
MinidumpModuleCodeViewRecordWriter() : MinidumpWritable() {}
|
MinidumpModuleCodeViewRecordWriter() : MinidumpWritable() {}
|
||||||
|
|
||||||
private:
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MinidumpModuleCodeViewRecordWriter);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace internal {
|
namespace internal {
|
||||||
@ -59,6 +60,11 @@ template <typename CodeViewRecordType>
|
|||||||
class MinidumpModuleCodeViewRecordPDBLinkWriter
|
class MinidumpModuleCodeViewRecordPDBLinkWriter
|
||||||
: public MinidumpModuleCodeViewRecordWriter {
|
: public MinidumpModuleCodeViewRecordWriter {
|
||||||
public:
|
public:
|
||||||
|
MinidumpModuleCodeViewRecordPDBLinkWriter(
|
||||||
|
const MinidumpModuleCodeViewRecordPDBLinkWriter&) = delete;
|
||||||
|
MinidumpModuleCodeViewRecordPDBLinkWriter& operator=(
|
||||||
|
const MinidumpModuleCodeViewRecordPDBLinkWriter&) = delete;
|
||||||
|
|
||||||
//! \brief Sets the name of the `.pdb` file being linked to.
|
//! \brief Sets the name of the `.pdb` file being linked to.
|
||||||
void SetPDBName(const std::string& pdb_name) { pdb_name_ = pdb_name; }
|
void SetPDBName(const std::string& pdb_name) { pdb_name_ = pdb_name; }
|
||||||
|
|
||||||
@ -79,8 +85,6 @@ class MinidumpModuleCodeViewRecordPDBLinkWriter
|
|||||||
private:
|
private:
|
||||||
CodeViewRecordType codeview_record_;
|
CodeViewRecordType codeview_record_;
|
||||||
std::string pdb_name_;
|
std::string pdb_name_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MinidumpModuleCodeViewRecordPDBLinkWriter);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
@ -97,13 +101,15 @@ class MinidumpModuleCodeViewRecordPDB20Writer final
|
|||||||
: internal::MinidumpModuleCodeViewRecordPDBLinkWriter<
|
: internal::MinidumpModuleCodeViewRecordPDBLinkWriter<
|
||||||
CodeViewRecordPDB20>() {}
|
CodeViewRecordPDB20>() {}
|
||||||
|
|
||||||
|
MinidumpModuleCodeViewRecordPDB20Writer(
|
||||||
|
const MinidumpModuleCodeViewRecordPDB20Writer&) = delete;
|
||||||
|
MinidumpModuleCodeViewRecordPDB20Writer& operator=(
|
||||||
|
const MinidumpModuleCodeViewRecordPDB20Writer&) = delete;
|
||||||
|
|
||||||
~MinidumpModuleCodeViewRecordPDB20Writer() override;
|
~MinidumpModuleCodeViewRecordPDB20Writer() override;
|
||||||
|
|
||||||
//! \brief Sets CodeViewRecordPDB20::timestamp and CodeViewRecordPDB20::age.
|
//! \brief Sets CodeViewRecordPDB20::timestamp and CodeViewRecordPDB20::age.
|
||||||
void SetTimestampAndAge(time_t timestamp, uint32_t age);
|
void SetTimestampAndAge(time_t timestamp, uint32_t age);
|
||||||
|
|
||||||
private:
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MinidumpModuleCodeViewRecordPDB20Writer);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//! \brief The writer for a CodeViewRecordPDB70 object in a minidump file.
|
//! \brief The writer for a CodeViewRecordPDB70 object in a minidump file.
|
||||||
@ -115,6 +121,11 @@ class MinidumpModuleCodeViewRecordPDB70Writer final
|
|||||||
: internal::MinidumpModuleCodeViewRecordPDBLinkWriter<
|
: internal::MinidumpModuleCodeViewRecordPDBLinkWriter<
|
||||||
CodeViewRecordPDB70>() {}
|
CodeViewRecordPDB70>() {}
|
||||||
|
|
||||||
|
MinidumpModuleCodeViewRecordPDB70Writer(
|
||||||
|
const MinidumpModuleCodeViewRecordPDB70Writer&) = delete;
|
||||||
|
MinidumpModuleCodeViewRecordPDB70Writer& operator=(
|
||||||
|
const MinidumpModuleCodeViewRecordPDB70Writer&) = delete;
|
||||||
|
|
||||||
~MinidumpModuleCodeViewRecordPDB70Writer() override;
|
~MinidumpModuleCodeViewRecordPDB70Writer() override;
|
||||||
|
|
||||||
//! \brief Initializes the CodeViewRecordPDB70 based on \a module_snapshot.
|
//! \brief Initializes the CodeViewRecordPDB70 based on \a module_snapshot.
|
||||||
@ -131,9 +142,6 @@ class MinidumpModuleCodeViewRecordPDB70Writer final
|
|||||||
codeview_record()->uuid = uuid;
|
codeview_record()->uuid = uuid;
|
||||||
codeview_record()->age = age;
|
codeview_record()->age = age;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MinidumpModuleCodeViewRecordPDB70Writer);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//! \brief The writer for a CodeViewRecordBuildID object in a minidump file.
|
//! \brief The writer for a CodeViewRecordBuildID object in a minidump file.
|
||||||
@ -141,6 +149,12 @@ class MinidumpModuleCodeViewRecordBuildIDWriter final
|
|||||||
: public MinidumpModuleCodeViewRecordWriter {
|
: public MinidumpModuleCodeViewRecordWriter {
|
||||||
public:
|
public:
|
||||||
MinidumpModuleCodeViewRecordBuildIDWriter();
|
MinidumpModuleCodeViewRecordBuildIDWriter();
|
||||||
|
|
||||||
|
MinidumpModuleCodeViewRecordBuildIDWriter(
|
||||||
|
const MinidumpModuleCodeViewRecordBuildIDWriter&) = delete;
|
||||||
|
MinidumpModuleCodeViewRecordBuildIDWriter& operator=(
|
||||||
|
const MinidumpModuleCodeViewRecordBuildIDWriter&) = delete;
|
||||||
|
|
||||||
~MinidumpModuleCodeViewRecordBuildIDWriter() override;
|
~MinidumpModuleCodeViewRecordBuildIDWriter() override;
|
||||||
|
|
||||||
//! \brief Sets the build ID used for symbol lookup.
|
//! \brief Sets the build ID used for symbol lookup.
|
||||||
@ -152,8 +166,6 @@ class MinidumpModuleCodeViewRecordBuildIDWriter final
|
|||||||
bool WriteObject(FileWriterInterface* file_writer) override;
|
bool WriteObject(FileWriterInterface* file_writer) override;
|
||||||
|
|
||||||
std::vector<uint8_t> build_id_;
|
std::vector<uint8_t> build_id_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MinidumpModuleCodeViewRecordBuildIDWriter);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//! \brief The writer for an IMAGE_DEBUG_MISC object in a minidump file.
|
//! \brief The writer for an IMAGE_DEBUG_MISC object in a minidump file.
|
||||||
@ -163,6 +175,12 @@ class MinidumpModuleMiscDebugRecordWriter final
|
|||||||
: public internal::MinidumpWritable {
|
: public internal::MinidumpWritable {
|
||||||
public:
|
public:
|
||||||
MinidumpModuleMiscDebugRecordWriter();
|
MinidumpModuleMiscDebugRecordWriter();
|
||||||
|
|
||||||
|
MinidumpModuleMiscDebugRecordWriter(
|
||||||
|
const MinidumpModuleMiscDebugRecordWriter&) = delete;
|
||||||
|
MinidumpModuleMiscDebugRecordWriter& operator=(
|
||||||
|
const MinidumpModuleMiscDebugRecordWriter&) = delete;
|
||||||
|
|
||||||
~MinidumpModuleMiscDebugRecordWriter() override;
|
~MinidumpModuleMiscDebugRecordWriter() override;
|
||||||
|
|
||||||
//! \brief Sets IMAGE_DEBUG_MISC::DataType.
|
//! \brief Sets IMAGE_DEBUG_MISC::DataType.
|
||||||
@ -189,8 +207,6 @@ class MinidumpModuleMiscDebugRecordWriter final
|
|||||||
IMAGE_DEBUG_MISC image_debug_misc_;
|
IMAGE_DEBUG_MISC image_debug_misc_;
|
||||||
std::string data_;
|
std::string data_;
|
||||||
std::u16string data_utf16_;
|
std::u16string data_utf16_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MinidumpModuleMiscDebugRecordWriter);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//! \brief The writer for a MINIDUMP_MODULE object in a minidump file.
|
//! \brief The writer for a MINIDUMP_MODULE object in a minidump file.
|
||||||
@ -202,6 +218,10 @@ class MinidumpModuleMiscDebugRecordWriter final
|
|||||||
class MinidumpModuleWriter final : public internal::MinidumpWritable {
|
class MinidumpModuleWriter final : public internal::MinidumpWritable {
|
||||||
public:
|
public:
|
||||||
MinidumpModuleWriter();
|
MinidumpModuleWriter();
|
||||||
|
|
||||||
|
MinidumpModuleWriter(const MinidumpModuleWriter&) = delete;
|
||||||
|
MinidumpModuleWriter& operator=(const MinidumpModuleWriter&) = delete;
|
||||||
|
|
||||||
~MinidumpModuleWriter() override;
|
~MinidumpModuleWriter() override;
|
||||||
|
|
||||||
//! \brief Initializes the MINIDUMP_MODULE based on \a module_snapshot.
|
//! \brief Initializes the MINIDUMP_MODULE based on \a module_snapshot.
|
||||||
@ -320,8 +340,6 @@ class MinidumpModuleWriter final : public internal::MinidumpWritable {
|
|||||||
std::unique_ptr<internal::MinidumpUTF16StringWriter> name_;
|
std::unique_ptr<internal::MinidumpUTF16StringWriter> name_;
|
||||||
std::unique_ptr<MinidumpModuleCodeViewRecordWriter> codeview_record_;
|
std::unique_ptr<MinidumpModuleCodeViewRecordWriter> codeview_record_;
|
||||||
std::unique_ptr<MinidumpModuleMiscDebugRecordWriter> misc_debug_record_;
|
std::unique_ptr<MinidumpModuleMiscDebugRecordWriter> misc_debug_record_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MinidumpModuleWriter);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//! \brief The writer for a MINIDUMP_MODULE_LIST stream in a minidump file,
|
//! \brief The writer for a MINIDUMP_MODULE_LIST stream in a minidump file,
|
||||||
@ -329,6 +347,10 @@ class MinidumpModuleWriter final : public internal::MinidumpWritable {
|
|||||||
class MinidumpModuleListWriter final : public internal::MinidumpStreamWriter {
|
class MinidumpModuleListWriter final : public internal::MinidumpStreamWriter {
|
||||||
public:
|
public:
|
||||||
MinidumpModuleListWriter();
|
MinidumpModuleListWriter();
|
||||||
|
|
||||||
|
MinidumpModuleListWriter(const MinidumpModuleListWriter&) = delete;
|
||||||
|
MinidumpModuleListWriter& operator=(const MinidumpModuleListWriter&) = delete;
|
||||||
|
|
||||||
~MinidumpModuleListWriter() override;
|
~MinidumpModuleListWriter() override;
|
||||||
|
|
||||||
//! \brief Adds an initialized MINIDUMP_MODULE for each module in \a
|
//! \brief Adds an initialized MINIDUMP_MODULE for each module in \a
|
||||||
@ -363,8 +385,6 @@ class MinidumpModuleListWriter final : public internal::MinidumpStreamWriter {
|
|||||||
private:
|
private:
|
||||||
std::vector<std::unique_ptr<MinidumpModuleWriter>> modules_;
|
std::vector<std::unique_ptr<MinidumpModuleWriter>> modules_;
|
||||||
MINIDUMP_MODULE_LIST module_list_base_;
|
MINIDUMP_MODULE_LIST module_list_base_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MinidumpModuleListWriter);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
@ -21,7 +21,6 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "minidump/minidump_extensions.h"
|
#include "minidump/minidump_extensions.h"
|
||||||
#include "minidump/minidump_writable.h"
|
#include "minidump/minidump_writable.h"
|
||||||
|
|
||||||
@ -33,6 +32,10 @@ namespace internal {
|
|||||||
class MinidumpRVAListWriter : public MinidumpWritable {
|
class MinidumpRVAListWriter : public MinidumpWritable {
|
||||||
protected:
|
protected:
|
||||||
MinidumpRVAListWriter();
|
MinidumpRVAListWriter();
|
||||||
|
|
||||||
|
MinidumpRVAListWriter(const MinidumpRVAListWriter&) = delete;
|
||||||
|
MinidumpRVAListWriter& operator=(const MinidumpRVAListWriter&) = delete;
|
||||||
|
|
||||||
~MinidumpRVAListWriter() override;
|
~MinidumpRVAListWriter() override;
|
||||||
|
|
||||||
//! \brief Adds an ::RVA referencing an MinidumpWritable to the
|
//! \brief Adds an ::RVA referencing an MinidumpWritable to the
|
||||||
@ -68,8 +71,6 @@ class MinidumpRVAListWriter : public MinidumpWritable {
|
|||||||
std::unique_ptr<MinidumpRVAList> rva_list_base_;
|
std::unique_ptr<MinidumpRVAList> rva_list_base_;
|
||||||
std::vector<std::unique_ptr<MinidumpWritable>> children_;
|
std::vector<std::unique_ptr<MinidumpWritable>> children_;
|
||||||
std::vector<RVA> child_rvas_;
|
std::vector<RVA> child_rvas_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MinidumpRVAListWriter);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
|
@ -31,15 +31,17 @@ namespace {
|
|||||||
class TestMinidumpRVAListWriter final : public internal::MinidumpRVAListWriter {
|
class TestMinidumpRVAListWriter final : public internal::MinidumpRVAListWriter {
|
||||||
public:
|
public:
|
||||||
TestMinidumpRVAListWriter() : MinidumpRVAListWriter() {}
|
TestMinidumpRVAListWriter() : MinidumpRVAListWriter() {}
|
||||||
|
|
||||||
|
TestMinidumpRVAListWriter(const TestMinidumpRVAListWriter&) = delete;
|
||||||
|
TestMinidumpRVAListWriter& operator=(const TestMinidumpRVAListWriter&) =
|
||||||
|
delete;
|
||||||
|
|
||||||
~TestMinidumpRVAListWriter() override {}
|
~TestMinidumpRVAListWriter() override {}
|
||||||
|
|
||||||
void AddChild(uint32_t value) {
|
void AddChild(uint32_t value) {
|
||||||
auto child = std::make_unique<TestUInt32MinidumpWritable>(value);
|
auto child = std::make_unique<TestUInt32MinidumpWritable>(value);
|
||||||
MinidumpRVAListWriter::AddChild(std::move(child));
|
MinidumpRVAListWriter::AddChild(std::move(child));
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(TestMinidumpRVAListWriter);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
TEST(MinidumpRVAListWriter, Empty) {
|
TEST(MinidumpRVAListWriter, Empty) {
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "minidump/minidump_extensions.h"
|
#include "minidump/minidump_extensions.h"
|
||||||
#include "minidump/minidump_string_writer.h"
|
#include "minidump/minidump_string_writer.h"
|
||||||
#include "minidump/minidump_writable.h"
|
#include "minidump/minidump_writable.h"
|
||||||
@ -41,6 +40,12 @@ class MinidumpSimpleStringDictionaryEntryWriter final
|
|||||||
: public internal::MinidumpWritable {
|
: public internal::MinidumpWritable {
|
||||||
public:
|
public:
|
||||||
MinidumpSimpleStringDictionaryEntryWriter();
|
MinidumpSimpleStringDictionaryEntryWriter();
|
||||||
|
|
||||||
|
MinidumpSimpleStringDictionaryEntryWriter(
|
||||||
|
const MinidumpSimpleStringDictionaryEntryWriter&) = delete;
|
||||||
|
MinidumpSimpleStringDictionaryEntryWriter& operator=(
|
||||||
|
const MinidumpSimpleStringDictionaryEntryWriter&) = delete;
|
||||||
|
|
||||||
~MinidumpSimpleStringDictionaryEntryWriter() override;
|
~MinidumpSimpleStringDictionaryEntryWriter() override;
|
||||||
|
|
||||||
//! \brief Returns a MinidumpSimpleStringDictionaryEntry referencing this
|
//! \brief Returns a MinidumpSimpleStringDictionaryEntry referencing this
|
||||||
@ -76,8 +81,6 @@ class MinidumpSimpleStringDictionaryEntryWriter final
|
|||||||
struct MinidumpSimpleStringDictionaryEntry entry_;
|
struct MinidumpSimpleStringDictionaryEntry entry_;
|
||||||
internal::MinidumpUTF8StringWriter key_;
|
internal::MinidumpUTF8StringWriter key_;
|
||||||
internal::MinidumpUTF8StringWriter value_;
|
internal::MinidumpUTF8StringWriter value_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MinidumpSimpleStringDictionaryEntryWriter);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//! \brief The writer for a MinidumpSimpleStringDictionary object in a minidump
|
//! \brief The writer for a MinidumpSimpleStringDictionary object in a minidump
|
||||||
@ -89,6 +92,12 @@ class MinidumpSimpleStringDictionaryWriter final
|
|||||||
: public internal::MinidumpWritable {
|
: public internal::MinidumpWritable {
|
||||||
public:
|
public:
|
||||||
MinidumpSimpleStringDictionaryWriter();
|
MinidumpSimpleStringDictionaryWriter();
|
||||||
|
|
||||||
|
MinidumpSimpleStringDictionaryWriter(
|
||||||
|
const MinidumpSimpleStringDictionaryWriter&) = delete;
|
||||||
|
MinidumpSimpleStringDictionaryWriter& operator=(
|
||||||
|
const MinidumpSimpleStringDictionaryWriter&) = delete;
|
||||||
|
|
||||||
~MinidumpSimpleStringDictionaryWriter() override;
|
~MinidumpSimpleStringDictionaryWriter() override;
|
||||||
|
|
||||||
//! \brief Adds an initialized MinidumpSimpleStringDictionaryEntryWriter for
|
//! \brief Adds an initialized MinidumpSimpleStringDictionaryEntryWriter for
|
||||||
@ -138,8 +147,6 @@ class MinidumpSimpleStringDictionaryWriter final
|
|||||||
|
|
||||||
std::unique_ptr<MinidumpSimpleStringDictionary>
|
std::unique_ptr<MinidumpSimpleStringDictionary>
|
||||||
simple_string_dictionary_base_;
|
simple_string_dictionary_base_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MinidumpSimpleStringDictionaryWriter);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <dbghelp.h>
|
#include <dbghelp.h>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "minidump/minidump_extensions.h"
|
#include "minidump/minidump_extensions.h"
|
||||||
#include "minidump/minidump_writable.h"
|
#include "minidump/minidump_writable.h"
|
||||||
|
|
||||||
@ -32,6 +31,9 @@ namespace internal {
|
|||||||
//! MinidumpFileWriter object.
|
//! MinidumpFileWriter object.
|
||||||
class MinidumpStreamWriter : public MinidumpWritable {
|
class MinidumpStreamWriter : public MinidumpWritable {
|
||||||
public:
|
public:
|
||||||
|
MinidumpStreamWriter(const MinidumpStreamWriter&) = delete;
|
||||||
|
MinidumpStreamWriter& operator=(const MinidumpStreamWriter&) = delete;
|
||||||
|
|
||||||
~MinidumpStreamWriter() override;
|
~MinidumpStreamWriter() override;
|
||||||
|
|
||||||
//! \brief Returns an object’s stream type.
|
//! \brief Returns an object’s stream type.
|
||||||
@ -56,8 +58,6 @@ class MinidumpStreamWriter : public MinidumpWritable {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
MINIDUMP_DIRECTORY directory_list_entry_;
|
MINIDUMP_DIRECTORY directory_list_entry_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MinidumpStreamWriter);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "minidump/minidump_extensions.h"
|
#include "minidump/minidump_extensions.h"
|
||||||
#include "minidump/minidump_rva_list_writer.h"
|
#include "minidump/minidump_rva_list_writer.h"
|
||||||
#include "minidump/minidump_writable.h"
|
#include "minidump/minidump_writable.h"
|
||||||
@ -55,6 +54,10 @@ template <typename Traits>
|
|||||||
class MinidumpStringWriter : public MinidumpWritable {
|
class MinidumpStringWriter : public MinidumpWritable {
|
||||||
public:
|
public:
|
||||||
MinidumpStringWriter();
|
MinidumpStringWriter();
|
||||||
|
|
||||||
|
MinidumpStringWriter(const MinidumpStringWriter&) = delete;
|
||||||
|
MinidumpStringWriter& operator=(const MinidumpStringWriter&) = delete;
|
||||||
|
|
||||||
~MinidumpStringWriter() override;
|
~MinidumpStringWriter() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -78,8 +81,6 @@ class MinidumpStringWriter : public MinidumpWritable {
|
|||||||
private:
|
private:
|
||||||
std::unique_ptr<MinidumpStringType> string_base_;
|
std::unique_ptr<MinidumpStringType> string_base_;
|
||||||
StringType string_;
|
StringType string_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MinidumpStringWriter);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//! \brief Writes a variable-length UTF-16-encoded MINIDUMP_STRING to a minidump
|
//! \brief Writes a variable-length UTF-16-encoded MINIDUMP_STRING to a minidump
|
||||||
@ -91,6 +92,11 @@ class MinidumpUTF16StringWriter final
|
|||||||
: public MinidumpStringWriter<MinidumpStringWriterUTF16Traits> {
|
: public MinidumpStringWriter<MinidumpStringWriterUTF16Traits> {
|
||||||
public:
|
public:
|
||||||
MinidumpUTF16StringWriter() : MinidumpStringWriter() {}
|
MinidumpUTF16StringWriter() : MinidumpStringWriter() {}
|
||||||
|
|
||||||
|
MinidumpUTF16StringWriter(const MinidumpUTF16StringWriter&) = delete;
|
||||||
|
MinidumpUTF16StringWriter& operator=(const MinidumpUTF16StringWriter&) =
|
||||||
|
delete;
|
||||||
|
|
||||||
~MinidumpUTF16StringWriter() override;
|
~MinidumpUTF16StringWriter() override;
|
||||||
|
|
||||||
//! \brief Converts a UTF-8 string to UTF-16 and sets it as the string to be
|
//! \brief Converts a UTF-8 string to UTF-16 and sets it as the string to be
|
||||||
@ -98,9 +104,6 @@ class MinidumpUTF16StringWriter final
|
|||||||
//!
|
//!
|
||||||
//! \note Valid in #kStateMutable.
|
//! \note Valid in #kStateMutable.
|
||||||
void SetUTF8(const std::string& string_utf8);
|
void SetUTF8(const std::string& string_utf8);
|
||||||
|
|
||||||
private:
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MinidumpUTF16StringWriter);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//! \brief Writes a variable-length UTF-8-encoded MinidumpUTF8String to a
|
//! \brief Writes a variable-length UTF-8-encoded MinidumpUTF8String to a
|
||||||
@ -112,6 +115,10 @@ class MinidumpUTF8StringWriter final
|
|||||||
: public MinidumpStringWriter<MinidumpStringWriterUTF8Traits> {
|
: public MinidumpStringWriter<MinidumpStringWriterUTF8Traits> {
|
||||||
public:
|
public:
|
||||||
MinidumpUTF8StringWriter() : MinidumpStringWriter() {}
|
MinidumpUTF8StringWriter() : MinidumpStringWriter() {}
|
||||||
|
|
||||||
|
MinidumpUTF8StringWriter(const MinidumpUTF8StringWriter&) = delete;
|
||||||
|
MinidumpUTF8StringWriter& operator=(const MinidumpUTF8StringWriter&) = delete;
|
||||||
|
|
||||||
~MinidumpUTF8StringWriter() override;
|
~MinidumpUTF8StringWriter() override;
|
||||||
|
|
||||||
//! \brief Sets the string to be written.
|
//! \brief Sets the string to be written.
|
||||||
@ -123,9 +130,6 @@ class MinidumpUTF8StringWriter final
|
|||||||
//!
|
//!
|
||||||
//! \note Valid in any state.
|
//! \note Valid in any state.
|
||||||
const std::string& UTF8() const { return string(); }
|
const std::string& UTF8() const { return string(); }
|
||||||
|
|
||||||
private:
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MinidumpUTF8StringWriter);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//! \brief The writer for a MinidumpRVAList object in a minidump file,
|
//! \brief The writer for a MinidumpRVAList object in a minidump file,
|
||||||
@ -134,6 +138,10 @@ template <typename MinidumpStringWriterType>
|
|||||||
class MinidumpStringListWriter final : public MinidumpRVAListWriter {
|
class MinidumpStringListWriter final : public MinidumpRVAListWriter {
|
||||||
public:
|
public:
|
||||||
MinidumpStringListWriter();
|
MinidumpStringListWriter();
|
||||||
|
|
||||||
|
MinidumpStringListWriter(const MinidumpStringListWriter&) = delete;
|
||||||
|
MinidumpStringListWriter& operator=(const MinidumpStringListWriter&) = delete;
|
||||||
|
|
||||||
~MinidumpStringListWriter() override;
|
~MinidumpStringListWriter() override;
|
||||||
|
|
||||||
//! \brief Adds a new \a Traits::MinidumpStringWriterType for each element in
|
//! \brief Adds a new \a Traits::MinidumpStringWriterType for each element in
|
||||||
@ -166,9 +174,6 @@ class MinidumpStringListWriter final : public MinidumpRVAListWriter {
|
|||||||
//!
|
//!
|
||||||
//! \return `true` if the object is useful, `false` otherwise.
|
//! \return `true` if the object is useful, `false` otherwise.
|
||||||
bool IsUseful() const;
|
bool IsUseful() const;
|
||||||
|
|
||||||
private:
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MinidumpStringListWriter);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "minidump/minidump_extensions.h"
|
#include "minidump/minidump_extensions.h"
|
||||||
#include "minidump/minidump_stream_writer.h"
|
#include "minidump/minidump_stream_writer.h"
|
||||||
#include "minidump/minidump_writable.h"
|
#include "minidump/minidump_writable.h"
|
||||||
@ -41,6 +40,10 @@ class MinidumpUTF16StringWriter;
|
|||||||
class MinidumpSystemInfoWriter final : public internal::MinidumpStreamWriter {
|
class MinidumpSystemInfoWriter final : public internal::MinidumpStreamWriter {
|
||||||
public:
|
public:
|
||||||
MinidumpSystemInfoWriter();
|
MinidumpSystemInfoWriter();
|
||||||
|
|
||||||
|
MinidumpSystemInfoWriter(const MinidumpSystemInfoWriter&) = delete;
|
||||||
|
MinidumpSystemInfoWriter& operator=(const MinidumpSystemInfoWriter&) = delete;
|
||||||
|
|
||||||
~MinidumpSystemInfoWriter() override;
|
~MinidumpSystemInfoWriter() override;
|
||||||
|
|
||||||
//! \brief Initializes MINIDUMP_SYSTEM_INFO based on \a system_snapshot.
|
//! \brief Initializes MINIDUMP_SYSTEM_INFO based on \a system_snapshot.
|
||||||
@ -188,8 +191,6 @@ class MinidumpSystemInfoWriter final : public internal::MinidumpStreamWriter {
|
|||||||
private:
|
private:
|
||||||
MINIDUMP_SYSTEM_INFO system_info_;
|
MINIDUMP_SYSTEM_INFO system_info_;
|
||||||
std::unique_ptr<internal::MinidumpUTF16StringWriter> csd_version_;
|
std::unique_ptr<internal::MinidumpUTF16StringWriter> csd_version_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MinidumpSystemInfoWriter);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/cxx17_backports.h"
|
#include "base/cxx17_backports.h"
|
||||||
#include "base/macros.h"
|
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
#include "snapshot/test/test_thread_snapshot.h"
|
#include "snapshot/test/test_thread_snapshot.h"
|
||||||
|
|
||||||
@ -35,6 +34,9 @@ class MinidumpThreadIDMapTest : public testing::Test {
|
|||||||
test_thread_snapshots_() {
|
test_thread_snapshots_() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MinidumpThreadIDMapTest(const MinidumpThreadIDMapTest&) = delete;
|
||||||
|
MinidumpThreadIDMapTest& operator=(const MinidumpThreadIDMapTest&) = delete;
|
||||||
|
|
||||||
~MinidumpThreadIDMapTest() override {}
|
~MinidumpThreadIDMapTest() override {}
|
||||||
|
|
||||||
// testing::Test:
|
// testing::Test:
|
||||||
@ -72,8 +74,6 @@ class MinidumpThreadIDMapTest : public testing::Test {
|
|||||||
private:
|
private:
|
||||||
std::vector<const ThreadSnapshot*> thread_snapshots_;
|
std::vector<const ThreadSnapshot*> thread_snapshots_;
|
||||||
TestThreadSnapshot test_thread_snapshots_[5];
|
TestThreadSnapshot test_thread_snapshots_[5];
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MinidumpThreadIDMapTest);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
TEST_F(MinidumpThreadIDMapTest, NoThreads) {
|
TEST_F(MinidumpThreadIDMapTest, NoThreads) {
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "minidump/minidump_stream_writer.h"
|
#include "minidump/minidump_stream_writer.h"
|
||||||
#include "minidump/minidump_thread_id_map.h"
|
#include "minidump/minidump_thread_id_map.h"
|
||||||
#include "minidump/minidump_writable.h"
|
#include "minidump/minidump_writable.h"
|
||||||
@ -44,6 +43,10 @@ class ThreadSnapshot;
|
|||||||
class MinidumpThreadWriter final : public internal::MinidumpWritable {
|
class MinidumpThreadWriter final : public internal::MinidumpWritable {
|
||||||
public:
|
public:
|
||||||
MinidumpThreadWriter();
|
MinidumpThreadWriter();
|
||||||
|
|
||||||
|
MinidumpThreadWriter(const MinidumpThreadWriter&) = delete;
|
||||||
|
MinidumpThreadWriter& operator=(const MinidumpThreadWriter&) = delete;
|
||||||
|
|
||||||
~MinidumpThreadWriter() override;
|
~MinidumpThreadWriter() override;
|
||||||
|
|
||||||
//! \brief Initializes the MINIDUMP_THREAD based on \a thread_snapshot.
|
//! \brief Initializes the MINIDUMP_THREAD based on \a thread_snapshot.
|
||||||
@ -131,8 +134,6 @@ class MinidumpThreadWriter final : public internal::MinidumpWritable {
|
|||||||
MINIDUMP_THREAD thread_;
|
MINIDUMP_THREAD thread_;
|
||||||
std::unique_ptr<SnapshotMinidumpMemoryWriter> stack_;
|
std::unique_ptr<SnapshotMinidumpMemoryWriter> stack_;
|
||||||
std::unique_ptr<MinidumpContextWriter> context_;
|
std::unique_ptr<MinidumpContextWriter> context_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MinidumpThreadWriter);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//! \brief The writer for a MINIDUMP_THREAD_LIST stream in a minidump file,
|
//! \brief The writer for a MINIDUMP_THREAD_LIST stream in a minidump file,
|
||||||
@ -140,6 +141,10 @@ class MinidumpThreadWriter final : public internal::MinidumpWritable {
|
|||||||
class MinidumpThreadListWriter final : public internal::MinidumpStreamWriter {
|
class MinidumpThreadListWriter final : public internal::MinidumpStreamWriter {
|
||||||
public:
|
public:
|
||||||
MinidumpThreadListWriter();
|
MinidumpThreadListWriter();
|
||||||
|
|
||||||
|
MinidumpThreadListWriter(const MinidumpThreadListWriter&) = delete;
|
||||||
|
MinidumpThreadListWriter& operator=(const MinidumpThreadListWriter&) = delete;
|
||||||
|
|
||||||
~MinidumpThreadListWriter() override;
|
~MinidumpThreadListWriter() override;
|
||||||
|
|
||||||
//! \brief Adds an initialized MINIDUMP_THREAD for each thread in \a
|
//! \brief Adds an initialized MINIDUMP_THREAD for each thread in \a
|
||||||
@ -205,8 +210,6 @@ class MinidumpThreadListWriter final : public internal::MinidumpStreamWriter {
|
|||||||
std::vector<std::unique_ptr<MinidumpThreadWriter>> threads_;
|
std::vector<std::unique_ptr<MinidumpThreadWriter>> threads_;
|
||||||
MinidumpMemoryListWriter* memory_list_writer_; // weak
|
MinidumpMemoryListWriter* memory_list_writer_; // weak
|
||||||
MINIDUMP_THREAD_LIST thread_list_base_;
|
MINIDUMP_THREAD_LIST thread_list_base_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MinidumpThreadListWriter);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "minidump/minidump_stream_writer.h"
|
#include "minidump/minidump_stream_writer.h"
|
||||||
#include "minidump/minidump_string_writer.h"
|
#include "minidump/minidump_string_writer.h"
|
||||||
#include "minidump/minidump_writable.h"
|
#include "minidump/minidump_writable.h"
|
||||||
@ -41,6 +40,11 @@ namespace crashpad {
|
|||||||
class MinidumpUnloadedModuleWriter final : public internal::MinidumpWritable {
|
class MinidumpUnloadedModuleWriter final : public internal::MinidumpWritable {
|
||||||
public:
|
public:
|
||||||
MinidumpUnloadedModuleWriter();
|
MinidumpUnloadedModuleWriter();
|
||||||
|
|
||||||
|
MinidumpUnloadedModuleWriter(const MinidumpUnloadedModuleWriter&) = delete;
|
||||||
|
MinidumpUnloadedModuleWriter& operator=(const MinidumpUnloadedModuleWriter&) =
|
||||||
|
delete;
|
||||||
|
|
||||||
~MinidumpUnloadedModuleWriter() override;
|
~MinidumpUnloadedModuleWriter() override;
|
||||||
|
|
||||||
//! \brief Initializes the MINIDUMP_UNLOADED_MODULE based on \a
|
//! \brief Initializes the MINIDUMP_UNLOADED_MODULE based on \a
|
||||||
@ -97,8 +101,6 @@ class MinidumpUnloadedModuleWriter final : public internal::MinidumpWritable {
|
|||||||
private:
|
private:
|
||||||
MINIDUMP_UNLOADED_MODULE unloaded_module_;
|
MINIDUMP_UNLOADED_MODULE unloaded_module_;
|
||||||
std::unique_ptr<internal::MinidumpUTF16StringWriter> name_;
|
std::unique_ptr<internal::MinidumpUTF16StringWriter> name_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MinidumpUnloadedModuleWriter);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//! \brief The writer for a MINIDUMP_UNLOADED_MODULE_LIST stream in a minidump
|
//! \brief The writer for a MINIDUMP_UNLOADED_MODULE_LIST stream in a minidump
|
||||||
@ -107,6 +109,12 @@ class MinidumpUnloadedModuleListWriter final
|
|||||||
: public internal::MinidumpStreamWriter {
|
: public internal::MinidumpStreamWriter {
|
||||||
public:
|
public:
|
||||||
MinidumpUnloadedModuleListWriter();
|
MinidumpUnloadedModuleListWriter();
|
||||||
|
|
||||||
|
MinidumpUnloadedModuleListWriter(const MinidumpUnloadedModuleListWriter&) =
|
||||||
|
delete;
|
||||||
|
MinidumpUnloadedModuleListWriter& operator=(
|
||||||
|
const MinidumpUnloadedModuleListWriter&) = delete;
|
||||||
|
|
||||||
~MinidumpUnloadedModuleListWriter() override;
|
~MinidumpUnloadedModuleListWriter() override;
|
||||||
|
|
||||||
//! \brief Adds an initialized MINIDUMP_UNLOADED_MODULE for each unloaded
|
//! \brief Adds an initialized MINIDUMP_UNLOADED_MODULE for each unloaded
|
||||||
@ -145,8 +153,6 @@ class MinidumpUnloadedModuleListWriter final
|
|||||||
private:
|
private:
|
||||||
std::vector<std::unique_ptr<MinidumpUnloadedModuleWriter>> unloaded_modules_;
|
std::vector<std::unique_ptr<MinidumpUnloadedModuleWriter>> unloaded_modules_;
|
||||||
MINIDUMP_UNLOADED_MODULE_LIST unloaded_module_list_base_;
|
MINIDUMP_UNLOADED_MODULE_LIST unloaded_module_list_base_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MinidumpUnloadedModuleListWriter);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
|
|
||||||
#include "minidump/minidump_extensions.h"
|
#include "minidump/minidump_extensions.h"
|
||||||
|
|
||||||
@ -54,6 +53,12 @@ class MinidumpUserExtensionStreamDataSource {
|
|||||||
//!
|
//!
|
||||||
//! \param[in] stream_type The type of the user extension stream.
|
//! \param[in] stream_type The type of the user extension stream.
|
||||||
explicit MinidumpUserExtensionStreamDataSource(uint32_t stream_type);
|
explicit MinidumpUserExtensionStreamDataSource(uint32_t stream_type);
|
||||||
|
|
||||||
|
MinidumpUserExtensionStreamDataSource(
|
||||||
|
const MinidumpUserExtensionStreamDataSource&) = delete;
|
||||||
|
MinidumpUserExtensionStreamDataSource& operator=(
|
||||||
|
const MinidumpUserExtensionStreamDataSource&) = delete;
|
||||||
|
|
||||||
virtual ~MinidumpUserExtensionStreamDataSource();
|
virtual ~MinidumpUserExtensionStreamDataSource();
|
||||||
|
|
||||||
MinidumpStreamType stream_type() const { return stream_type_; }
|
MinidumpStreamType stream_type() const { return stream_type_; }
|
||||||
@ -75,8 +80,6 @@ class MinidumpUserExtensionStreamDataSource {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
MinidumpStreamType stream_type_;
|
MinidumpStreamType stream_type_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MinidumpUserExtensionStreamDataSource);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
@ -33,6 +33,9 @@ class MinidumpUserStreamWriter::SnapshotContentsWriter final
|
|||||||
explicit SnapshotContentsWriter(const MemorySnapshot* snapshot)
|
explicit SnapshotContentsWriter(const MemorySnapshot* snapshot)
|
||||||
: snapshot_(snapshot), writer_(nullptr) {}
|
: snapshot_(snapshot), writer_(nullptr) {}
|
||||||
|
|
||||||
|
SnapshotContentsWriter(const SnapshotContentsWriter&) = delete;
|
||||||
|
SnapshotContentsWriter& operator=(const SnapshotContentsWriter&) = delete;
|
||||||
|
|
||||||
bool WriteContents(FileWriterInterface* writer) override {
|
bool WriteContents(FileWriterInterface* writer) override {
|
||||||
DCHECK(!writer_);
|
DCHECK(!writer_);
|
||||||
|
|
||||||
@ -52,8 +55,6 @@ class MinidumpUserStreamWriter::SnapshotContentsWriter final
|
|||||||
private:
|
private:
|
||||||
const MemorySnapshot* snapshot_;
|
const MemorySnapshot* snapshot_;
|
||||||
FileWriterInterface* writer_;
|
FileWriterInterface* writer_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(SnapshotContentsWriter);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class MinidumpUserStreamWriter::ExtensionStreamContentsWriter final
|
class MinidumpUserStreamWriter::ExtensionStreamContentsWriter final
|
||||||
@ -64,6 +65,10 @@ class MinidumpUserStreamWriter::ExtensionStreamContentsWriter final
|
|||||||
std::unique_ptr<MinidumpUserExtensionStreamDataSource> data_source)
|
std::unique_ptr<MinidumpUserExtensionStreamDataSource> data_source)
|
||||||
: data_source_(std::move(data_source)), writer_(nullptr) {}
|
: data_source_(std::move(data_source)), writer_(nullptr) {}
|
||||||
|
|
||||||
|
ExtensionStreamContentsWriter(const ExtensionStreamContentsWriter&) = delete;
|
||||||
|
ExtensionStreamContentsWriter& operator=(
|
||||||
|
const ExtensionStreamContentsWriter&) = delete;
|
||||||
|
|
||||||
bool WriteContents(FileWriterInterface* writer) override {
|
bool WriteContents(FileWriterInterface* writer) override {
|
||||||
DCHECK(!writer_);
|
DCHECK(!writer_);
|
||||||
|
|
||||||
@ -80,8 +85,6 @@ class MinidumpUserStreamWriter::ExtensionStreamContentsWriter final
|
|||||||
private:
|
private:
|
||||||
std::unique_ptr<MinidumpUserExtensionStreamDataSource> data_source_;
|
std::unique_ptr<MinidumpUserExtensionStreamDataSource> data_source_;
|
||||||
FileWriterInterface* writer_;
|
FileWriterInterface* writer_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ExtensionStreamContentsWriter);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
MinidumpUserStreamWriter::MinidumpUserStreamWriter() : stream_type_() {}
|
MinidumpUserStreamWriter::MinidumpUserStreamWriter() : stream_type_() {}
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "minidump/minidump_extensions.h"
|
#include "minidump/minidump_extensions.h"
|
||||||
#include "minidump/minidump_stream_writer.h"
|
#include "minidump/minidump_stream_writer.h"
|
||||||
#include "minidump/minidump_writable.h"
|
#include "minidump/minidump_writable.h"
|
||||||
@ -35,6 +34,10 @@ namespace crashpad {
|
|||||||
class MinidumpUserStreamWriter final : public internal::MinidumpStreamWriter {
|
class MinidumpUserStreamWriter final : public internal::MinidumpStreamWriter {
|
||||||
public:
|
public:
|
||||||
MinidumpUserStreamWriter();
|
MinidumpUserStreamWriter();
|
||||||
|
|
||||||
|
MinidumpUserStreamWriter(const MinidumpUserStreamWriter&) = delete;
|
||||||
|
MinidumpUserStreamWriter& operator=(const MinidumpUserStreamWriter&) = delete;
|
||||||
|
|
||||||
~MinidumpUserStreamWriter() override;
|
~MinidumpUserStreamWriter() override;
|
||||||
|
|
||||||
//! \brief Initializes a MINIDUMP_USER_STREAM based on \a stream.
|
//! \brief Initializes a MINIDUMP_USER_STREAM based on \a stream.
|
||||||
@ -70,8 +73,6 @@ class MinidumpUserStreamWriter final : public internal::MinidumpStreamWriter {
|
|||||||
std::unique_ptr<ContentsWriter> contents_writer_;
|
std::unique_ptr<ContentsWriter> contents_writer_;
|
||||||
|
|
||||||
MinidumpStreamType stream_type_;
|
MinidumpStreamType stream_type_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MinidumpUserStreamWriter);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
#include <limits>
|
#include <limits>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "util/file/file_io.h"
|
#include "util/file/file_io.h"
|
||||||
|
|
||||||
namespace crashpad {
|
namespace crashpad {
|
||||||
@ -35,6 +34,9 @@ namespace internal {
|
|||||||
//! file.
|
//! file.
|
||||||
class MinidumpWritable {
|
class MinidumpWritable {
|
||||||
public:
|
public:
|
||||||
|
MinidumpWritable(const MinidumpWritable&) = delete;
|
||||||
|
MinidumpWritable& operator=(const MinidumpWritable&) = delete;
|
||||||
|
|
||||||
virtual ~MinidumpWritable();
|
virtual ~MinidumpWritable();
|
||||||
|
|
||||||
//! \brief Writes an object and all of its children to a minidump file.
|
//! \brief Writes an object and all of its children to a minidump file.
|
||||||
@ -270,8 +272,6 @@ class MinidumpWritable {
|
|||||||
|
|
||||||
size_t leading_pad_bytes_;
|
size_t leading_pad_bytes_;
|
||||||
State state_;
|
State state_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MinidumpWritable);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
#include "util/file/string_file.h"
|
#include "util/file/string_file.h"
|
||||||
|
|
||||||
@ -37,6 +36,9 @@ class BaseTestMinidumpWritable : public crashpad::internal::MinidumpWritable {
|
|||||||
has_phase_(false),
|
has_phase_(false),
|
||||||
verified_(false) {}
|
verified_(false) {}
|
||||||
|
|
||||||
|
BaseTestMinidumpWritable(const BaseTestMinidumpWritable&) = delete;
|
||||||
|
BaseTestMinidumpWritable& operator=(const BaseTestMinidumpWritable&) = delete;
|
||||||
|
|
||||||
~BaseTestMinidumpWritable() { EXPECT_TRUE(verified_); }
|
~BaseTestMinidumpWritable() { EXPECT_TRUE(verified_); }
|
||||||
|
|
||||||
void SetAlignment(size_t alignment) {
|
void SetAlignment(size_t alignment) {
|
||||||
@ -113,14 +115,16 @@ class BaseTestMinidumpWritable : public crashpad::internal::MinidumpWritable {
|
|||||||
bool has_alignment_;
|
bool has_alignment_;
|
||||||
bool has_phase_;
|
bool has_phase_;
|
||||||
bool verified_;
|
bool verified_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(BaseTestMinidumpWritable);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class TestStringMinidumpWritable final : public BaseTestMinidumpWritable {
|
class TestStringMinidumpWritable final : public BaseTestMinidumpWritable {
|
||||||
public:
|
public:
|
||||||
TestStringMinidumpWritable() : BaseTestMinidumpWritable(), data_() {}
|
TestStringMinidumpWritable() : BaseTestMinidumpWritable(), data_() {}
|
||||||
|
|
||||||
|
TestStringMinidumpWritable(const TestStringMinidumpWritable&) = delete;
|
||||||
|
TestStringMinidumpWritable& operator=(const TestStringMinidumpWritable&) =
|
||||||
|
delete;
|
||||||
|
|
||||||
~TestStringMinidumpWritable() {}
|
~TestStringMinidumpWritable() {}
|
||||||
|
|
||||||
void SetData(const std::string& string) { data_ = string; }
|
void SetData(const std::string& string) { data_ = string; }
|
||||||
@ -140,8 +144,6 @@ class TestStringMinidumpWritable final : public BaseTestMinidumpWritable {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
std::string data_;
|
std::string data_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(TestStringMinidumpWritable);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
TEST(MinidumpWritable, MinidumpWritable) {
|
TEST(MinidumpWritable, MinidumpWritable) {
|
||||||
@ -487,6 +489,9 @@ class TestRVAMinidumpWritable final : public BaseTestMinidumpWritable {
|
|||||||
public:
|
public:
|
||||||
TestRVAMinidumpWritable() : BaseTestMinidumpWritable(), rva_() {}
|
TestRVAMinidumpWritable() : BaseTestMinidumpWritable(), rva_() {}
|
||||||
|
|
||||||
|
TestRVAMinidumpWritable(const TestRVAMinidumpWritable&) = delete;
|
||||||
|
TestRVAMinidumpWritable& operator=(const TestRVAMinidumpWritable&) = delete;
|
||||||
|
|
||||||
~TestRVAMinidumpWritable() {}
|
~TestRVAMinidumpWritable() {}
|
||||||
|
|
||||||
void SetRVA(MinidumpWritable* other) { other->RegisterRVA(&rva_); }
|
void SetRVA(MinidumpWritable* other) { other->RegisterRVA(&rva_); }
|
||||||
@ -505,8 +510,6 @@ class TestRVAMinidumpWritable final : public BaseTestMinidumpWritable {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
RVA rva_;
|
RVA rva_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(TestRVAMinidumpWritable);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
RVA RVAAtIndex(const std::string& string, size_t index) {
|
RVA RVAAtIndex(const std::string& string, size_t index) {
|
||||||
@ -620,6 +623,11 @@ class TestLocationDescriptorMinidumpWritable final
|
|||||||
TestLocationDescriptorMinidumpWritable()
|
TestLocationDescriptorMinidumpWritable()
|
||||||
: BaseTestMinidumpWritable(), location_descriptor_(), string_() {}
|
: BaseTestMinidumpWritable(), location_descriptor_(), string_() {}
|
||||||
|
|
||||||
|
TestLocationDescriptorMinidumpWritable(
|
||||||
|
const TestLocationDescriptorMinidumpWritable&) = delete;
|
||||||
|
TestLocationDescriptorMinidumpWritable& operator=(
|
||||||
|
const TestLocationDescriptorMinidumpWritable&) = delete;
|
||||||
|
|
||||||
~TestLocationDescriptorMinidumpWritable() {}
|
~TestLocationDescriptorMinidumpWritable() {}
|
||||||
|
|
||||||
void SetLocationDescriptor(MinidumpWritable* other) {
|
void SetLocationDescriptor(MinidumpWritable* other) {
|
||||||
@ -652,8 +660,6 @@ class TestLocationDescriptorMinidumpWritable final
|
|||||||
private:
|
private:
|
||||||
MINIDUMP_LOCATION_DESCRIPTOR location_descriptor_;
|
MINIDUMP_LOCATION_DESCRIPTOR location_descriptor_;
|
||||||
std::string string_;
|
std::string string_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(TestLocationDescriptorMinidumpWritable);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct LocationDescriptorAndData {
|
struct LocationDescriptorAndData {
|
||||||
|
@ -21,7 +21,6 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
|
|
||||||
namespace crashpad {
|
namespace crashpad {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
@ -30,6 +29,10 @@ namespace internal {
|
|||||||
//! of classes.
|
//! of classes.
|
||||||
class MinidumpWriterUtil final {
|
class MinidumpWriterUtil final {
|
||||||
public:
|
public:
|
||||||
|
MinidumpWriterUtil() = delete;
|
||||||
|
MinidumpWriterUtil(const MinidumpWriterUtil&) = delete;
|
||||||
|
MinidumpWriterUtil& operator=(const MinidumpWriterUtil&) = delete;
|
||||||
|
|
||||||
//! \brief Assigns a `time_t` value, logging a warning if the result overflows
|
//! \brief Assigns a `time_t` value, logging a warning if the result overflows
|
||||||
//! the destination buffer and will be truncated.
|
//! the destination buffer and will be truncated.
|
||||||
//!
|
//!
|
||||||
@ -78,9 +81,6 @@ class MinidumpWriterUtil final {
|
|||||||
static void AssignUTF8ToUTF16(char16_t* destination,
|
static void AssignUTF8ToUTF16(char16_t* destination,
|
||||||
size_t destination_size,
|
size_t destination_size,
|
||||||
const std::string& source);
|
const std::string& source);
|
||||||
|
|
||||||
private:
|
|
||||||
DISALLOW_IMPLICIT_CONSTRUCTORS(MinidumpWriterUtil);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "snapshot/test/test_memory_snapshot.h"
|
#include "snapshot/test/test_memory_snapshot.h"
|
||||||
#include "util/file/file_writer.h"
|
#include "util/file/file_writer.h"
|
||||||
|
|
||||||
@ -38,14 +37,16 @@ namespace test {
|
|||||||
class TestMinidumpMemoryWriter final : public SnapshotMinidumpMemoryWriter {
|
class TestMinidumpMemoryWriter final : public SnapshotMinidumpMemoryWriter {
|
||||||
public:
|
public:
|
||||||
TestMinidumpMemoryWriter(uint64_t base_address, size_t size, uint8_t value);
|
TestMinidumpMemoryWriter(uint64_t base_address, size_t size, uint8_t value);
|
||||||
|
|
||||||
|
TestMinidumpMemoryWriter(const TestMinidumpMemoryWriter&) = delete;
|
||||||
|
TestMinidumpMemoryWriter& operator=(const TestMinidumpMemoryWriter&) = delete;
|
||||||
|
|
||||||
~TestMinidumpMemoryWriter();
|
~TestMinidumpMemoryWriter();
|
||||||
|
|
||||||
void SetShouldFailRead(bool should_fail);
|
void SetShouldFailRead(bool should_fail);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TestMemorySnapshot test_snapshot_;
|
TestMemorySnapshot test_snapshot_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(TestMinidumpMemoryWriter);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//! \brief Verifies, via Google Test assertions, that a
|
//! \brief Verifies, via Google Test assertions, that a
|
||||||
|
@ -38,13 +38,16 @@ class BufferExtensionStreamDataSource final
|
|||||||
const void* data,
|
const void* data,
|
||||||
size_t data_size);
|
size_t data_size);
|
||||||
|
|
||||||
|
BufferExtensionStreamDataSource(const BufferExtensionStreamDataSource&) =
|
||||||
|
delete;
|
||||||
|
BufferExtensionStreamDataSource& operator=(
|
||||||
|
const BufferExtensionStreamDataSource&) = delete;
|
||||||
|
|
||||||
size_t StreamDataSize() override;
|
size_t StreamDataSize() override;
|
||||||
bool ReadStreamData(Delegate* delegate) override;
|
bool ReadStreamData(Delegate* delegate) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<uint8_t> data_;
|
std::vector<uint8_t> data_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(BufferExtensionStreamDataSource);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace test
|
} // namespace test
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
#include "minidump/minidump_extensions.h"
|
#include "minidump/minidump_extensions.h"
|
||||||
#include "minidump/minidump_writable.h"
|
#include "minidump/minidump_writable.h"
|
||||||
@ -277,6 +276,10 @@ class TestUInt32MinidumpWritable final : public internal::MinidumpWritable {
|
|||||||
//! \brief Constructs the object to write a `uint32_t` with value \a value.
|
//! \brief Constructs the object to write a `uint32_t` with value \a value.
|
||||||
explicit TestUInt32MinidumpWritable(uint32_t value);
|
explicit TestUInt32MinidumpWritable(uint32_t value);
|
||||||
|
|
||||||
|
TestUInt32MinidumpWritable(const TestUInt32MinidumpWritable&) = delete;
|
||||||
|
TestUInt32MinidumpWritable& operator=(const TestUInt32MinidumpWritable&) =
|
||||||
|
delete;
|
||||||
|
|
||||||
~TestUInt32MinidumpWritable() override;
|
~TestUInt32MinidumpWritable() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -286,8 +289,6 @@ class TestUInt32MinidumpWritable final : public internal::MinidumpWritable {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
uint32_t value_;
|
uint32_t value_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(TestUInt32MinidumpWritable);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace test
|
} // namespace test
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "snapshot/cpu_context.h"
|
#include "snapshot/cpu_context.h"
|
||||||
#include "util/numeric/checked_range.h"
|
#include "util/numeric/checked_range.h"
|
||||||
|
|
||||||
@ -65,6 +64,10 @@ class CaptureMemory {
|
|||||||
const CheckedRange<uint64_t, uint64_t>& range) = 0;
|
const CheckedRange<uint64_t, uint64_t>& range) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
CaptureMemory() = delete;
|
||||||
|
CaptureMemory(const CaptureMemory&) = delete;
|
||||||
|
CaptureMemory& operator=(const CaptureMemory&) = delete;
|
||||||
|
|
||||||
//! \brief For all registers that appear to be pointer-like in \a context,
|
//! \brief For all registers that appear to be pointer-like in \a context,
|
||||||
//! captures a small amount of memory near their pointed to location.
|
//! captures a small amount of memory near their pointed to location.
|
||||||
//!
|
//!
|
||||||
@ -88,9 +91,6 @@ class CaptureMemory {
|
|||||||
//! process and adding new ranges.
|
//! process and adding new ranges.
|
||||||
static void PointedToByMemoryRange(const MemorySnapshot& memory,
|
static void PointedToByMemoryRange(const MemorySnapshot& memory,
|
||||||
Delegate* delegate);
|
Delegate* delegate);
|
||||||
|
|
||||||
private:
|
|
||||||
DISALLOW_IMPLICIT_CONSTRUCTORS(CaptureMemory);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
#include "base/auto_reset.h"
|
#include "base/auto_reset.h"
|
||||||
#include "base/files/file_path.h"
|
#include "base/files/file_path.h"
|
||||||
#include "base/macros.h"
|
|
||||||
#include "base/strings/utf_string_conversions.h"
|
#include "base/strings/utf_string_conversions.h"
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
#include "client/crashpad_info.h"
|
#include "client/crashpad_info.h"
|
||||||
@ -63,6 +62,11 @@ class ScopedUnsetCrashpadInfoOptions {
|
|||||||
: crashpad_info_(crashpad_info) {
|
: crashpad_info_(crashpad_info) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ScopedUnsetCrashpadInfoOptions(const ScopedUnsetCrashpadInfoOptions&) =
|
||||||
|
delete;
|
||||||
|
ScopedUnsetCrashpadInfoOptions& operator=(
|
||||||
|
const ScopedUnsetCrashpadInfoOptions&) = delete;
|
||||||
|
|
||||||
~ScopedUnsetCrashpadInfoOptions() {
|
~ScopedUnsetCrashpadInfoOptions() {
|
||||||
crashpad_info_->set_crashpad_handler_behavior(TriState::kUnset);
|
crashpad_info_->set_crashpad_handler_behavior(TriState::kUnset);
|
||||||
crashpad_info_->set_system_crash_reporter_forwarding(TriState::kUnset);
|
crashpad_info_->set_system_crash_reporter_forwarding(TriState::kUnset);
|
||||||
@ -72,8 +76,6 @@ class ScopedUnsetCrashpadInfoOptions {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
CrashpadInfo* crashpad_info_;
|
CrashpadInfo* crashpad_info_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ScopedUnsetCrashpadInfoOptions);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
CrashpadInfoClientOptions SelfProcessSnapshotAndGetCrashpadOptions() {
|
CrashpadInfoClientOptions SelfProcessSnapshotAndGetCrashpadOptions() {
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "util/misc/address_types.h"
|
#include "util/misc/address_types.h"
|
||||||
#include "util/misc/initialization_state_dcheck.h"
|
#include "util/misc/initialization_state_dcheck.h"
|
||||||
#include "util/misc/tri_state.h"
|
#include "util/misc/tri_state.h"
|
||||||
@ -32,6 +31,10 @@ namespace crashpad {
|
|||||||
class CrashpadInfoReader {
|
class CrashpadInfoReader {
|
||||||
public:
|
public:
|
||||||
CrashpadInfoReader();
|
CrashpadInfoReader();
|
||||||
|
|
||||||
|
CrashpadInfoReader(const CrashpadInfoReader&) = delete;
|
||||||
|
CrashpadInfoReader& operator=(const CrashpadInfoReader&) = delete;
|
||||||
|
|
||||||
~CrashpadInfoReader();
|
~CrashpadInfoReader();
|
||||||
|
|
||||||
//! \brief Initializes this object.
|
//! \brief Initializes this object.
|
||||||
@ -66,8 +69,6 @@ class CrashpadInfoReader {
|
|||||||
std::unique_ptr<InfoContainer> container_;
|
std::unique_ptr<InfoContainer> container_;
|
||||||
bool is_64_bit_;
|
bool is_64_bit_;
|
||||||
InitializationStateDcheck initialized_;
|
InitializationStateDcheck initialized_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(CrashpadInfoReader);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
@ -49,6 +49,9 @@ class ScopedUnsetCrashpadInfo {
|
|||||||
explicit ScopedUnsetCrashpadInfo(CrashpadInfo* crashpad_info)
|
explicit ScopedUnsetCrashpadInfo(CrashpadInfo* crashpad_info)
|
||||||
: crashpad_info_(crashpad_info) {}
|
: crashpad_info_(crashpad_info) {}
|
||||||
|
|
||||||
|
ScopedUnsetCrashpadInfo(const ScopedUnsetCrashpadInfo&) = delete;
|
||||||
|
ScopedUnsetCrashpadInfo& operator=(const ScopedUnsetCrashpadInfo&) = delete;
|
||||||
|
|
||||||
~ScopedUnsetCrashpadInfo() {
|
~ScopedUnsetCrashpadInfo() {
|
||||||
crashpad_info_->set_crashpad_handler_behavior(TriState::kUnset);
|
crashpad_info_->set_crashpad_handler_behavior(TriState::kUnset);
|
||||||
crashpad_info_->set_system_crash_reporter_forwarding(TriState::kUnset);
|
crashpad_info_->set_system_crash_reporter_forwarding(TriState::kUnset);
|
||||||
@ -61,8 +64,6 @@ class ScopedUnsetCrashpadInfo {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
CrashpadInfo* crashpad_info_;
|
CrashpadInfo* crashpad_info_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ScopedUnsetCrashpadInfo);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class CrashpadInfoTestDataSetup {
|
class CrashpadInfoTestDataSetup {
|
||||||
@ -80,6 +81,10 @@ class CrashpadInfoTestDataSetup {
|
|||||||
kGatherIndirectlyReferencedMemory, kIndirectlyReferencedMemoryCap);
|
kGatherIndirectlyReferencedMemory, kIndirectlyReferencedMemoryCap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CrashpadInfoTestDataSetup(const CrashpadInfoTestDataSetup&) = delete;
|
||||||
|
CrashpadInfoTestDataSetup& operator=(const CrashpadInfoTestDataSetup&) =
|
||||||
|
delete;
|
||||||
|
|
||||||
void GetAddresses(VMAddress* info_address,
|
void GetAddresses(VMAddress* info_address,
|
||||||
VMAddress* extra_memory_address,
|
VMAddress* extra_memory_address,
|
||||||
VMAddress* simple_annotations_address,
|
VMAddress* simple_annotations_address,
|
||||||
@ -96,8 +101,6 @@ class CrashpadInfoTestDataSetup {
|
|||||||
SimpleAddressRangeBag extra_memory_;
|
SimpleAddressRangeBag extra_memory_;
|
||||||
SimpleStringDictionary simple_annotations_;
|
SimpleStringDictionary simple_annotations_;
|
||||||
AnnotationList annotation_list_;
|
AnnotationList annotation_list_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(CrashpadInfoTestDataSetup);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void ExpectCrashpadInfo(ProcessType process,
|
void ExpectCrashpadInfo(ProcessType process,
|
||||||
@ -184,6 +187,9 @@ class ReadFromChildTest : public MultiprocessExec {
|
|||||||
SetChildTestMainFunction("ReadFromChildTestMain");
|
SetChildTestMainFunction("ReadFromChildTestMain");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ReadFromChildTest(const ReadFromChildTest&) = delete;
|
||||||
|
ReadFromChildTest& operator=(const ReadFromChildTest&) = delete;
|
||||||
|
|
||||||
~ReadFromChildTest() = default;
|
~ReadFromChildTest() = default;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -215,8 +221,6 @@ class ReadFromChildTest : public MultiprocessExec {
|
|||||||
simple_annotations_address,
|
simple_annotations_address,
|
||||||
annotations_list_address);
|
annotations_list_address);
|
||||||
}
|
}
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ReadFromChildTest);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
TEST(CrashpadInfoReader, ReadFromChild) {
|
TEST(CrashpadInfoReader, ReadFromChild) {
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "snapshot/annotation_snapshot.h"
|
#include "snapshot/annotation_snapshot.h"
|
||||||
#include "util/misc/address_types.h"
|
#include "util/misc/address_types.h"
|
||||||
#include "util/process/process_memory_range.h"
|
#include "util/process/process_memory_range.h"
|
||||||
@ -37,6 +36,9 @@ class ImageAnnotationReader {
|
|||||||
//! \param[in] memory A memory reader for the remote process.
|
//! \param[in] memory A memory reader for the remote process.
|
||||||
explicit ImageAnnotationReader(const ProcessMemoryRange* memory);
|
explicit ImageAnnotationReader(const ProcessMemoryRange* memory);
|
||||||
|
|
||||||
|
ImageAnnotationReader(const ImageAnnotationReader&) = delete;
|
||||||
|
ImageAnnotationReader& operator=(const ImageAnnotationReader&) = delete;
|
||||||
|
|
||||||
~ImageAnnotationReader();
|
~ImageAnnotationReader();
|
||||||
|
|
||||||
//! \brief Reads annotations that are organized as key-value pairs, where all
|
//! \brief Reads annotations that are organized as key-value pairs, where all
|
||||||
@ -67,8 +69,6 @@ class ImageAnnotationReader {
|
|||||||
std::vector<AnnotationSnapshot>* annotations) const;
|
std::vector<AnnotationSnapshot>* annotations) const;
|
||||||
|
|
||||||
const ProcessMemoryRange* memory_; // weak
|
const ProcessMemoryRange* memory_; // weak
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ImageAnnotationReader);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
@ -163,6 +163,9 @@ class ReadFromChildTest : public MultiprocessExec {
|
|||||||
SetChildTestMainFunction("ReadAnnotationsFromChildTestMain");
|
SetChildTestMainFunction("ReadAnnotationsFromChildTestMain");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ReadFromChildTest(const ReadFromChildTest&) = delete;
|
||||||
|
ReadFromChildTest& operator=(const ReadFromChildTest&) = delete;
|
||||||
|
|
||||||
~ReadFromChildTest() = default;
|
~ReadFromChildTest() = default;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -182,8 +185,6 @@ class ReadFromChildTest : public MultiprocessExec {
|
|||||||
ExpectAnnotations(
|
ExpectAnnotations(
|
||||||
ChildProcess(), am_64_bit, simple_map_address, annotations_address);
|
ChildProcess(), am_64_bit, simple_map_address, annotations_address);
|
||||||
}
|
}
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ReadFromChildTest);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
TEST(ImageAnnotationReader, ReadFromChild) {
|
TEST(ImageAnnotationReader, ReadFromChild) {
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
#include "base/macros.h"
|
|
||||||
#include "util/misc/address_types.h"
|
#include "util/misc/address_types.h"
|
||||||
#include "util/misc/reinterpret_bytes.h"
|
#include "util/misc/reinterpret_bytes.h"
|
||||||
#include "util/process/process_memory_range.h"
|
#include "util/process/process_memory_range.h"
|
||||||
@ -31,6 +30,10 @@ namespace crashpad {
|
|||||||
class ElfDynamicArrayReader {
|
class ElfDynamicArrayReader {
|
||||||
public:
|
public:
|
||||||
ElfDynamicArrayReader();
|
ElfDynamicArrayReader();
|
||||||
|
|
||||||
|
ElfDynamicArrayReader(const ElfDynamicArrayReader&) = delete;
|
||||||
|
ElfDynamicArrayReader& operator=(const ElfDynamicArrayReader&) = delete;
|
||||||
|
|
||||||
~ElfDynamicArrayReader();
|
~ElfDynamicArrayReader();
|
||||||
|
|
||||||
//! \brief Initializes the reader.
|
//! \brief Initializes the reader.
|
||||||
@ -66,8 +69,6 @@ class ElfDynamicArrayReader {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
std::map<uint64_t, uint64_t> values_;
|
std::map<uint64_t, uint64_t> values_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ElfDynamicArrayReader);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
@ -57,6 +57,12 @@ class ElfImageReader::ProgramHeaderTableSpecific
|
|||||||
: public ElfImageReader::ProgramHeaderTable {
|
: public ElfImageReader::ProgramHeaderTable {
|
||||||
public:
|
public:
|
||||||
ProgramHeaderTableSpecific<PhdrType>() {}
|
ProgramHeaderTableSpecific<PhdrType>() {}
|
||||||
|
|
||||||
|
ProgramHeaderTableSpecific<PhdrType>(
|
||||||
|
const ProgramHeaderTableSpecific<PhdrType>&) = delete;
|
||||||
|
ProgramHeaderTableSpecific<PhdrType>& operator=(
|
||||||
|
const ProgramHeaderTableSpecific<PhdrType>&) = delete;
|
||||||
|
|
||||||
~ProgramHeaderTableSpecific<PhdrType>() {}
|
~ProgramHeaderTableSpecific<PhdrType>() {}
|
||||||
|
|
||||||
bool Initialize(const ProcessMemoryRange& memory,
|
bool Initialize(const ProcessMemoryRange& memory,
|
||||||
@ -183,8 +189,6 @@ class ElfImageReader::ProgramHeaderTableSpecific
|
|||||||
private:
|
private:
|
||||||
std::vector<PhdrType> table_;
|
std::vector<PhdrType> table_;
|
||||||
InitializationStateDcheck initialized_;
|
InitializationStateDcheck initialized_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ProgramHeaderTableSpecific<PhdrType>);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
ElfImageReader::NoteReader::~NoteReader() = default;
|
ElfImageReader::NoteReader::~NoteReader() = default;
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "snapshot/elf/elf_dynamic_array_reader.h"
|
#include "snapshot/elf/elf_dynamic_array_reader.h"
|
||||||
#include "snapshot/elf/elf_symbol_table_reader.h"
|
#include "snapshot/elf/elf_symbol_table_reader.h"
|
||||||
#include "util/misc/address_types.h"
|
#include "util/misc/address_types.h"
|
||||||
@ -46,6 +45,9 @@ class ElfImageReader {
|
|||||||
//! ElfImageReader::Notes() or ElfImageReader::NotesWithNameAndType().
|
//! ElfImageReader::Notes() or ElfImageReader::NotesWithNameAndType().
|
||||||
class NoteReader {
|
class NoteReader {
|
||||||
public:
|
public:
|
||||||
|
NoteReader(const NoteReader&) = delete;
|
||||||
|
NoteReader& operator=(const NoteReader&) = delete;
|
||||||
|
|
||||||
~NoteReader();
|
~NoteReader();
|
||||||
|
|
||||||
//! \brief The return value for NextNote().
|
//! \brief The return value for NextNote().
|
||||||
@ -111,11 +113,13 @@ class ElfImageReader {
|
|||||||
bool use_filter_;
|
bool use_filter_;
|
||||||
bool is_valid_;
|
bool is_valid_;
|
||||||
bool retry_;
|
bool retry_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(NoteReader);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
ElfImageReader();
|
ElfImageReader();
|
||||||
|
|
||||||
|
ElfImageReader(const ElfImageReader&) = delete;
|
||||||
|
ElfImageReader& operator=(const ElfImageReader&) = delete;
|
||||||
|
|
||||||
~ElfImageReader();
|
~ElfImageReader();
|
||||||
|
|
||||||
//! \brief Initializes the reader.
|
//! \brief Initializes the reader.
|
||||||
@ -285,8 +289,6 @@ class ElfImageReader {
|
|||||||
InitializationStateDcheck initialized_;
|
InitializationStateDcheck initialized_;
|
||||||
InitializationState dynamic_array_initialized_;
|
InitializationState dynamic_array_initialized_;
|
||||||
InitializationState symbol_table_initialized_;
|
InitializationState symbol_table_initialized_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ElfImageReader);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "util/misc/address_types.h"
|
#include "util/misc/address_types.h"
|
||||||
#include "util/process/process_memory_range.h"
|
#include "util/process/process_memory_range.h"
|
||||||
|
|
||||||
@ -63,6 +62,10 @@ class ElfSymbolTableReader {
|
|||||||
ElfImageReader* elf_reader,
|
ElfImageReader* elf_reader,
|
||||||
VMAddress address,
|
VMAddress address,
|
||||||
VMSize num_entries);
|
VMSize num_entries);
|
||||||
|
|
||||||
|
ElfSymbolTableReader(const ElfSymbolTableReader&) = delete;
|
||||||
|
ElfSymbolTableReader& operator=(const ElfSymbolTableReader&) = delete;
|
||||||
|
|
||||||
~ElfSymbolTableReader();
|
~ElfSymbolTableReader();
|
||||||
|
|
||||||
//! \brief Lookup information about a symbol.
|
//! \brief Lookup information about a symbol.
|
||||||
@ -80,8 +83,6 @@ class ElfSymbolTableReader {
|
|||||||
ElfImageReader* const elf_reader_; // weak
|
ElfImageReader* const elf_reader_; // weak
|
||||||
const VMAddress base_address_;
|
const VMAddress base_address_;
|
||||||
const VMSize num_entries_;
|
const VMSize num_entries_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ElfSymbolTableReader);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "client/crashpad_info.h"
|
#include "client/crashpad_info.h"
|
||||||
#include "snapshot/crashpad_info_client_options.h"
|
#include "snapshot/crashpad_info_client_options.h"
|
||||||
#include "snapshot/crashpad_types/crashpad_info_reader.h"
|
#include "snapshot/crashpad_types/crashpad_info_reader.h"
|
||||||
@ -50,6 +49,10 @@ class ModuleSnapshotElf final : public ModuleSnapshot {
|
|||||||
ModuleSnapshot::ModuleType type,
|
ModuleSnapshot::ModuleType type,
|
||||||
ProcessMemoryRange* process_memory_range,
|
ProcessMemoryRange* process_memory_range,
|
||||||
const ProcessMemory* process_memory);
|
const ProcessMemory* process_memory);
|
||||||
|
|
||||||
|
ModuleSnapshotElf(const ModuleSnapshotElf&) = delete;
|
||||||
|
ModuleSnapshotElf& operator=(const ModuleSnapshotElf&) = delete;
|
||||||
|
|
||||||
~ModuleSnapshotElf() override;
|
~ModuleSnapshotElf() override;
|
||||||
|
|
||||||
//! \brief Initializes the object.
|
//! \brief Initializes the object.
|
||||||
@ -98,8 +101,6 @@ class ModuleSnapshotElf final : public ModuleSnapshot {
|
|||||||
InitializationStateDcheck initialized_;
|
InitializationStateDcheck initialized_;
|
||||||
// Too const-y: https://crashpad.chromium.org/bug/9.
|
// Too const-y: https://crashpad.chromium.org/bug/9.
|
||||||
mutable std::vector<std::unique_ptr<const UserMinidumpStream>> streams_;
|
mutable std::vector<std::unique_ptr<const UserMinidumpStream>> streams_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ModuleSnapshotElf);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
|
@ -35,6 +35,10 @@ namespace internal {
|
|||||||
class ExceptionSnapshotFuchsia final : public ExceptionSnapshot {
|
class ExceptionSnapshotFuchsia final : public ExceptionSnapshot {
|
||||||
public:
|
public:
|
||||||
ExceptionSnapshotFuchsia();
|
ExceptionSnapshotFuchsia();
|
||||||
|
|
||||||
|
ExceptionSnapshotFuchsia(const ExceptionSnapshotFuchsia&) = delete;
|
||||||
|
ExceptionSnapshotFuchsia& operator=(const ExceptionSnapshotFuchsia&) = delete;
|
||||||
|
|
||||||
~ExceptionSnapshotFuchsia() override;
|
~ExceptionSnapshotFuchsia() override;
|
||||||
|
|
||||||
//! \brief Initializes the object.
|
//! \brief Initializes the object.
|
||||||
@ -73,8 +77,6 @@ class ExceptionSnapshotFuchsia final : public ExceptionSnapshot {
|
|||||||
uint32_t exception_;
|
uint32_t exception_;
|
||||||
uint32_t exception_info_;
|
uint32_t exception_info_;
|
||||||
InitializationStateDcheck initialized_;
|
InitializationStateDcheck initialized_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ExceptionSnapshotFuchsia);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
|
@ -28,6 +28,10 @@ namespace crashpad {
|
|||||||
class MemoryMapFuchsia {
|
class MemoryMapFuchsia {
|
||||||
public:
|
public:
|
||||||
MemoryMapFuchsia();
|
MemoryMapFuchsia();
|
||||||
|
|
||||||
|
MemoryMapFuchsia(const MemoryMapFuchsia&) = delete;
|
||||||
|
MemoryMapFuchsia& operator=(const MemoryMapFuchsia&) = delete;
|
||||||
|
|
||||||
~MemoryMapFuchsia();
|
~MemoryMapFuchsia();
|
||||||
|
|
||||||
//! \brief Initializes this object with information about the mapped memory
|
//! \brief Initializes this object with information about the mapped memory
|
||||||
@ -53,8 +57,6 @@ class MemoryMapFuchsia {
|
|||||||
private:
|
private:
|
||||||
std::vector<zx_info_maps_t> map_entries_;
|
std::vector<zx_info_maps_t> map_entries_;
|
||||||
InitializationStateDcheck initialized_;
|
InitializationStateDcheck initialized_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MemoryMapFuchsia);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
@ -21,7 +21,6 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
#include "snapshot/elf/elf_image_reader.h"
|
#include "snapshot/elf/elf_image_reader.h"
|
||||||
#include "snapshot/fuchsia/memory_map_fuchsia.h"
|
#include "snapshot/fuchsia/memory_map_fuchsia.h"
|
||||||
@ -88,6 +87,10 @@ class ProcessReaderFuchsia {
|
|||||||
};
|
};
|
||||||
|
|
||||||
ProcessReaderFuchsia();
|
ProcessReaderFuchsia();
|
||||||
|
|
||||||
|
ProcessReaderFuchsia(const ProcessReaderFuchsia&) = delete;
|
||||||
|
ProcessReaderFuchsia& operator=(const ProcessReaderFuchsia&) = delete;
|
||||||
|
|
||||||
~ProcessReaderFuchsia();
|
~ProcessReaderFuchsia();
|
||||||
|
|
||||||
//! \brief Initializes this object. This method must be called before any
|
//! \brief Initializes this object. This method must be called before any
|
||||||
@ -138,8 +141,6 @@ class ProcessReaderFuchsia {
|
|||||||
bool initialized_threads_ = false;
|
bool initialized_threads_ = false;
|
||||||
bool initialized_memory_map_ = false;
|
bool initialized_memory_map_ = false;
|
||||||
InitializationStateDcheck initialized_;
|
InitializationStateDcheck initialized_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ProcessReaderFuchsia);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
@ -92,6 +92,10 @@ class BasicChildTest : public MultiprocessExec {
|
|||||||
BasicChildTest() : MultiprocessExec() {
|
BasicChildTest() : MultiprocessExec() {
|
||||||
SetChildTestMainFunction("ProcessReaderBasicChildTestMain");
|
SetChildTestMainFunction("ProcessReaderBasicChildTestMain");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BasicChildTest(const BasicChildTest&) = delete;
|
||||||
|
BasicChildTest& operator=(const BasicChildTest&) = delete;
|
||||||
|
|
||||||
~BasicChildTest() {}
|
~BasicChildTest() {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -106,8 +110,6 @@ class BasicChildTest : public MultiprocessExec {
|
|||||||
ASSERT_TRUE(process_reader.Memory()->ReadCString(addr, &read_string));
|
ASSERT_TRUE(process_reader.Memory()->ReadCString(addr, &read_string));
|
||||||
EXPECT_EQ(read_string, kTestMemory);
|
EXPECT_EQ(read_string, kTestMemory);
|
||||||
}
|
}
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(BasicChildTest);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
TEST(ProcessReaderFuchsia, ChildBasic) {
|
TEST(ProcessReaderFuchsia, ChildBasic) {
|
||||||
@ -156,6 +158,10 @@ class ThreadsChildTest : public MultiprocessExec {
|
|||||||
ThreadsChildTest() : MultiprocessExec() {
|
ThreadsChildTest() : MultiprocessExec() {
|
||||||
SetChildTestMainFunction("ProcessReaderChildThreadsTestMain");
|
SetChildTestMainFunction("ProcessReaderChildThreadsTestMain");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ThreadsChildTest(const ThreadsChildTest&) = delete;
|
||||||
|
ThreadsChildTest& operator=(const ThreadsChildTest&) = delete;
|
||||||
|
|
||||||
~ThreadsChildTest() {}
|
~ThreadsChildTest() {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -178,8 +184,6 @@ class ThreadsChildTest : public MultiprocessExec {
|
|||||||
EXPECT_LE(threads[i].stack_regions[0].size(), i * 4096u);
|
EXPECT_LE(threads[i].stack_regions[0].size(), i * 4096u);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ThreadsChildTest);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO(scottmg): US-553. ScopedTaskSuspend fails sometimes, with a 50ms
|
// TODO(scottmg): US-553. ScopedTaskSuspend fails sometimes, with a 50ms
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "snapshot/crashpad_info_client_options.h"
|
#include "snapshot/crashpad_info_client_options.h"
|
||||||
#include "snapshot/elf/elf_image_reader.h"
|
#include "snapshot/elf/elf_image_reader.h"
|
||||||
#include "snapshot/elf/module_snapshot_elf.h"
|
#include "snapshot/elf/module_snapshot_elf.h"
|
||||||
@ -45,6 +44,10 @@ namespace crashpad {
|
|||||||
class ProcessSnapshotFuchsia : public ProcessSnapshot {
|
class ProcessSnapshotFuchsia : public ProcessSnapshot {
|
||||||
public:
|
public:
|
||||||
ProcessSnapshotFuchsia();
|
ProcessSnapshotFuchsia();
|
||||||
|
|
||||||
|
ProcessSnapshotFuchsia(const ProcessSnapshotFuchsia&) = delete;
|
||||||
|
ProcessSnapshotFuchsia& operator=(const ProcessSnapshotFuchsia&) = delete;
|
||||||
|
|
||||||
~ProcessSnapshotFuchsia() override;
|
~ProcessSnapshotFuchsia() override;
|
||||||
|
|
||||||
//! \brief Initializes the object.
|
//! \brief Initializes the object.
|
||||||
@ -145,8 +148,6 @@ class ProcessSnapshotFuchsia : public ProcessSnapshot {
|
|||||||
UUID client_id_;
|
UUID client_id_;
|
||||||
timeval snapshot_time_;
|
timeval snapshot_time_;
|
||||||
InitializationStateDcheck initialized_;
|
InitializationStateDcheck initialized_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ProcessSnapshotFuchsia);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
@ -103,6 +103,10 @@ class AddressSpaceTest : public MultiprocessExec {
|
|||||||
AddressSpaceTest() : MultiprocessExec() {
|
AddressSpaceTest() : MultiprocessExec() {
|
||||||
SetChildTestMainFunction("AddressSpaceChildTestMain");
|
SetChildTestMainFunction("AddressSpaceChildTestMain");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AddressSpaceTest(const AddressSpaceTest&) = delete;
|
||||||
|
AddressSpaceTest& operator=(const AddressSpaceTest&) = delete;
|
||||||
|
|
||||||
~AddressSpaceTest() {}
|
~AddressSpaceTest() {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -131,8 +135,6 @@ class AddressSpaceTest : public MultiprocessExec {
|
|||||||
t.minidump_perm);
|
t.minidump_perm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(AddressSpaceTest);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
TEST(ProcessSnapshotFuchsiaTest, AddressSpaceMapping) {
|
TEST(ProcessSnapshotFuchsiaTest, AddressSpaceMapping) {
|
||||||
@ -171,6 +173,10 @@ class InvalidStackPointerTest : public MultiprocessExec {
|
|||||||
SetExpectedChildTermination(kTerminationNormal,
|
SetExpectedChildTermination(kTerminationNormal,
|
||||||
ZX_TASK_RETCODE_SYSCALL_KILL);
|
ZX_TASK_RETCODE_SYSCALL_KILL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
InvalidStackPointerTest(const InvalidStackPointerTest&) = delete;
|
||||||
|
InvalidStackPointerTest& operator=(const InvalidStackPointerTest&) = delete;
|
||||||
|
|
||||||
~InvalidStackPointerTest() {}
|
~InvalidStackPointerTest() {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -215,8 +221,6 @@ class InvalidStackPointerTest : public MultiprocessExec {
|
|||||||
// As we've corrupted the child, don't let it run again.
|
// As we've corrupted the child, don't let it run again.
|
||||||
ASSERT_EQ(ChildProcess()->kill(), ZX_OK);
|
ASSERT_EQ(ChildProcess()->kill(), ZX_OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(InvalidStackPointerTest);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// This is a test for a specific failure detailed in
|
// This is a test for a specific failure detailed in
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
|
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
#include "snapshot/system_snapshot.h"
|
#include "snapshot/system_snapshot.h"
|
||||||
#include "util/misc/initialization_state_dcheck.h"
|
#include "util/misc/initialization_state_dcheck.h"
|
||||||
@ -33,6 +32,10 @@ namespace internal {
|
|||||||
class SystemSnapshotFuchsia final : public SystemSnapshot {
|
class SystemSnapshotFuchsia final : public SystemSnapshot {
|
||||||
public:
|
public:
|
||||||
SystemSnapshotFuchsia();
|
SystemSnapshotFuchsia();
|
||||||
|
|
||||||
|
SystemSnapshotFuchsia(const SystemSnapshotFuchsia&) = delete;
|
||||||
|
SystemSnapshotFuchsia& operator=(const SystemSnapshotFuchsia&) = delete;
|
||||||
|
|
||||||
~SystemSnapshotFuchsia() override;
|
~SystemSnapshotFuchsia() override;
|
||||||
|
|
||||||
//! \brief Initializes the object.
|
//! \brief Initializes the object.
|
||||||
@ -77,8 +80,6 @@ class SystemSnapshotFuchsia final : public SystemSnapshot {
|
|||||||
CpuidReader cpuid_;
|
CpuidReader cpuid_;
|
||||||
#endif // ARCH_CPU_X86_FAMILY
|
#endif // ARCH_CPU_X86_FAMILY
|
||||||
InitializationStateDcheck initialized_;
|
InitializationStateDcheck initialized_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(SystemSnapshotFuchsia);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <zircon/types.h>
|
#include <zircon/types.h>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
#include "snapshot/cpu_context.h"
|
#include "snapshot/cpu_context.h"
|
||||||
#include "snapshot/fuchsia/process_reader_fuchsia.h"
|
#include "snapshot/fuchsia/process_reader_fuchsia.h"
|
||||||
@ -34,6 +33,10 @@ namespace internal {
|
|||||||
class ThreadSnapshotFuchsia final : public ThreadSnapshot {
|
class ThreadSnapshotFuchsia final : public ThreadSnapshot {
|
||||||
public:
|
public:
|
||||||
ThreadSnapshotFuchsia();
|
ThreadSnapshotFuchsia();
|
||||||
|
|
||||||
|
ThreadSnapshotFuchsia(const ThreadSnapshotFuchsia&) = delete;
|
||||||
|
ThreadSnapshotFuchsia& operator=(const ThreadSnapshotFuchsia&) = delete;
|
||||||
|
|
||||||
~ThreadSnapshotFuchsia() override;
|
~ThreadSnapshotFuchsia() override;
|
||||||
|
|
||||||
//! \brief Initializes the object.
|
//! \brief Initializes the object.
|
||||||
@ -71,8 +74,6 @@ class ThreadSnapshotFuchsia final : public ThreadSnapshot {
|
|||||||
zx_koid_t thread_id_;
|
zx_koid_t thread_id_;
|
||||||
zx_vaddr_t thread_specific_data_address_;
|
zx_vaddr_t thread_specific_data_address_;
|
||||||
InitializationStateDcheck initialized_;
|
InitializationStateDcheck initialized_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ThreadSnapshotFuchsia);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
#include "snapshot/cpu_context.h"
|
#include "snapshot/cpu_context.h"
|
||||||
#include "snapshot/exception_snapshot.h"
|
#include "snapshot/exception_snapshot.h"
|
||||||
@ -37,6 +36,12 @@ namespace internal {
|
|||||||
class ExceptionSnapshotIOSIntermediateDump final : public ExceptionSnapshot {
|
class ExceptionSnapshotIOSIntermediateDump final : public ExceptionSnapshot {
|
||||||
public:
|
public:
|
||||||
ExceptionSnapshotIOSIntermediateDump();
|
ExceptionSnapshotIOSIntermediateDump();
|
||||||
|
|
||||||
|
ExceptionSnapshotIOSIntermediateDump(
|
||||||
|
const ExceptionSnapshotIOSIntermediateDump&) = delete;
|
||||||
|
ExceptionSnapshotIOSIntermediateDump& operator=(
|
||||||
|
const ExceptionSnapshotIOSIntermediateDump&) = delete;
|
||||||
|
|
||||||
~ExceptionSnapshotIOSIntermediateDump() override;
|
~ExceptionSnapshotIOSIntermediateDump() override;
|
||||||
|
|
||||||
//! \brief Initialize the snapshot as a signal exception.
|
//! \brief Initialize the snapshot as a signal exception.
|
||||||
@ -102,8 +107,6 @@ class ExceptionSnapshotIOSIntermediateDump final : public ExceptionSnapshot {
|
|||||||
uint32_t exception_;
|
uint32_t exception_;
|
||||||
uint32_t exception_info_;
|
uint32_t exception_info_;
|
||||||
InitializationStateDcheck initialized_;
|
InitializationStateDcheck initialized_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ExceptionSnapshotIOSIntermediateDump);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
#ifndef CRASHPAD_SNAPSHOT_IOS_INTERMEDIATE_DUMP_MEMORY_SNAPSHOT_IOS_INTERMEDIATEDUMP_H_
|
#ifndef CRASHPAD_SNAPSHOT_IOS_INTERMEDIATE_DUMP_MEMORY_SNAPSHOT_IOS_INTERMEDIATEDUMP_H_
|
||||||
#define CRASHPAD_SNAPSHOT_IOS_INTERMEDIATE_DUMP_MEMORY_SNAPSHOT_IOS_INTERMEDIATEDUMP_H_
|
#define CRASHPAD_SNAPSHOT_IOS_INTERMEDIATE_DUMP_MEMORY_SNAPSHOT_IOS_INTERMEDIATEDUMP_H_
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "snapshot/memory_snapshot.h"
|
#include "snapshot/memory_snapshot.h"
|
||||||
#include "util/misc/address_types.h"
|
#include "util/misc/address_types.h"
|
||||||
#include "util/misc/initialization_state_dcheck.h"
|
#include "util/misc/initialization_state_dcheck.h"
|
||||||
@ -27,6 +26,12 @@ namespace internal {
|
|||||||
class MemorySnapshotIOSIntermediateDump final : public MemorySnapshot {
|
class MemorySnapshotIOSIntermediateDump final : public MemorySnapshot {
|
||||||
public:
|
public:
|
||||||
MemorySnapshotIOSIntermediateDump() = default;
|
MemorySnapshotIOSIntermediateDump() = default;
|
||||||
|
|
||||||
|
MemorySnapshotIOSIntermediateDump(const MemorySnapshotIOSIntermediateDump&) =
|
||||||
|
delete;
|
||||||
|
MemorySnapshotIOSIntermediateDump& operator=(
|
||||||
|
const MemorySnapshotIOSIntermediateDump&) = delete;
|
||||||
|
|
||||||
~MemorySnapshotIOSIntermediateDump() = default;
|
~MemorySnapshotIOSIntermediateDump() = default;
|
||||||
|
|
||||||
//! \brief Initializes the object.
|
//! \brief Initializes the object.
|
||||||
@ -52,8 +57,6 @@ class MemorySnapshotIOSIntermediateDump final : public MemorySnapshot {
|
|||||||
vm_address_t data_;
|
vm_address_t data_;
|
||||||
vm_size_t size_;
|
vm_size_t size_;
|
||||||
InitializationStateDcheck initialized_;
|
InitializationStateDcheck initialized_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(MemorySnapshotIOSIntermediateDump);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "snapshot/crashpad_info_client_options.h"
|
#include "snapshot/crashpad_info_client_options.h"
|
||||||
#include "snapshot/module_snapshot.h"
|
#include "snapshot/module_snapshot.h"
|
||||||
#include "util/ios/ios_intermediate_dump_map.h"
|
#include "util/ios/ios_intermediate_dump_map.h"
|
||||||
@ -37,6 +36,12 @@ namespace internal {
|
|||||||
class ModuleSnapshotIOSIntermediateDump final : public ModuleSnapshot {
|
class ModuleSnapshotIOSIntermediateDump final : public ModuleSnapshot {
|
||||||
public:
|
public:
|
||||||
ModuleSnapshotIOSIntermediateDump();
|
ModuleSnapshotIOSIntermediateDump();
|
||||||
|
|
||||||
|
ModuleSnapshotIOSIntermediateDump(const ModuleSnapshotIOSIntermediateDump&) =
|
||||||
|
delete;
|
||||||
|
ModuleSnapshotIOSIntermediateDump& operator=(
|
||||||
|
const ModuleSnapshotIOSIntermediateDump&) = delete;
|
||||||
|
|
||||||
~ModuleSnapshotIOSIntermediateDump() override;
|
~ModuleSnapshotIOSIntermediateDump() override;
|
||||||
|
|
||||||
//! \brief Initialize the snapshot
|
//! \brief Initialize the snapshot
|
||||||
@ -84,8 +89,6 @@ class ModuleSnapshotIOSIntermediateDump final : public ModuleSnapshot {
|
|||||||
std::vector<AnnotationSnapshot> annotation_objects_;
|
std::vector<AnnotationSnapshot> annotation_objects_;
|
||||||
|
|
||||||
InitializationStateDcheck initialized_;
|
InitializationStateDcheck initialized_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ModuleSnapshotIOSIntermediateDump);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
|
@ -39,6 +39,11 @@ class ProcessSnapshotIOSIntermediateDump final : public ProcessSnapshot {
|
|||||||
public:
|
public:
|
||||||
ProcessSnapshotIOSIntermediateDump() = default;
|
ProcessSnapshotIOSIntermediateDump() = default;
|
||||||
|
|
||||||
|
ProcessSnapshotIOSIntermediateDump(
|
||||||
|
const ProcessSnapshotIOSIntermediateDump&) = delete;
|
||||||
|
ProcessSnapshotIOSIntermediateDump& operator=(
|
||||||
|
const ProcessSnapshotIOSIntermediateDump&) = delete;
|
||||||
|
|
||||||
//! \brief Initializes the object.
|
//! \brief Initializes the object.
|
||||||
//!
|
//!
|
||||||
//! \param[in] dump_path A class containing various system data points.
|
//! \param[in] dump_path A class containing various system data points.
|
||||||
@ -103,8 +108,6 @@ class ProcessSnapshotIOSIntermediateDump final : public ProcessSnapshot {
|
|||||||
std::map<std::string, std::string> annotations_simple_map_;
|
std::map<std::string, std::string> annotations_simple_map_;
|
||||||
timeval snapshot_time_;
|
timeval snapshot_time_;
|
||||||
InitializationStateDcheck initialized_;
|
InitializationStateDcheck initialized_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ProcessSnapshotIOSIntermediateDump);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "snapshot/system_snapshot.h"
|
#include "snapshot/system_snapshot.h"
|
||||||
#include "util/ios/ios_intermediate_dump_map.h"
|
#include "util/ios/ios_intermediate_dump_map.h"
|
||||||
#include "util/ios/ios_system_data_collector.h"
|
#include "util/ios/ios_system_data_collector.h"
|
||||||
@ -33,6 +32,12 @@ namespace internal {
|
|||||||
class SystemSnapshotIOSIntermediateDump final : public SystemSnapshot {
|
class SystemSnapshotIOSIntermediateDump final : public SystemSnapshot {
|
||||||
public:
|
public:
|
||||||
SystemSnapshotIOSIntermediateDump();
|
SystemSnapshotIOSIntermediateDump();
|
||||||
|
|
||||||
|
SystemSnapshotIOSIntermediateDump(const SystemSnapshotIOSIntermediateDump&) =
|
||||||
|
delete;
|
||||||
|
SystemSnapshotIOSIntermediateDump& operator=(
|
||||||
|
const SystemSnapshotIOSIntermediateDump&) = delete;
|
||||||
|
|
||||||
~SystemSnapshotIOSIntermediateDump() override;
|
~SystemSnapshotIOSIntermediateDump() override;
|
||||||
|
|
||||||
//! \brief Initializes the object.
|
//! \brief Initializes the object.
|
||||||
@ -87,8 +92,6 @@ class SystemSnapshotIOSIntermediateDump final : public SystemSnapshot {
|
|||||||
std::string standard_name_;
|
std::string standard_name_;
|
||||||
std::string daylight_name_;
|
std::string daylight_name_;
|
||||||
InitializationStateDcheck initialized_;
|
InitializationStateDcheck initialized_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(SystemSnapshotIOSIntermediateDump);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
#ifndef CRASHPAD_SNAPSHOT_IOS_INTERMEDIATE_DUMP_THREAD_SNAPSHOT_IOS_INTERMEDIATEDUMP_H_
|
#ifndef CRASHPAD_SNAPSHOT_IOS_INTERMEDIATE_DUMP_THREAD_SNAPSHOT_IOS_INTERMEDIATEDUMP_H_
|
||||||
#define CRASHPAD_SNAPSHOT_IOS_INTERMEDIATE_DUMP_THREAD_SNAPSHOT_IOS_INTERMEDIATEDUMP_H_
|
#define CRASHPAD_SNAPSHOT_IOS_INTERMEDIATE_DUMP_THREAD_SNAPSHOT_IOS_INTERMEDIATEDUMP_H_
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
#include "snapshot/cpu_context.h"
|
#include "snapshot/cpu_context.h"
|
||||||
#include "snapshot/ios/memory_snapshot_ios_intermediate_dump.h"
|
#include "snapshot/ios/memory_snapshot_ios_intermediate_dump.h"
|
||||||
@ -30,6 +29,12 @@ namespace internal {
|
|||||||
class ThreadSnapshotIOSIntermediateDump final : public ThreadSnapshot {
|
class ThreadSnapshotIOSIntermediateDump final : public ThreadSnapshot {
|
||||||
public:
|
public:
|
||||||
ThreadSnapshotIOSIntermediateDump();
|
ThreadSnapshotIOSIntermediateDump();
|
||||||
|
|
||||||
|
ThreadSnapshotIOSIntermediateDump(const ThreadSnapshotIOSIntermediateDump&) =
|
||||||
|
delete;
|
||||||
|
ThreadSnapshotIOSIntermediateDump& operator=(
|
||||||
|
const ThreadSnapshotIOSIntermediateDump&) = delete;
|
||||||
|
|
||||||
~ThreadSnapshotIOSIntermediateDump() override;
|
~ThreadSnapshotIOSIntermediateDump() override;
|
||||||
|
|
||||||
//! \brief Initializes the object.
|
//! \brief Initializes the object.
|
||||||
@ -67,8 +72,6 @@ class ThreadSnapshotIOSIntermediateDump final : public ThreadSnapshot {
|
|||||||
std::vector<std::unique_ptr<internal::MemorySnapshotIOSIntermediateDump>>
|
std::vector<std::unique_ptr<internal::MemorySnapshotIOSIntermediateDump>>
|
||||||
extra_memory_;
|
extra_memory_;
|
||||||
InitializationStateDcheck initialized_;
|
InitializationStateDcheck initialized_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ThreadSnapshotIOSIntermediateDump);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "util/linux/address_types.h"
|
#include "util/linux/address_types.h"
|
||||||
#include "util/misc/initialization_state_dcheck.h"
|
#include "util/misc/initialization_state_dcheck.h"
|
||||||
#include "util/process/process_memory_range.h"
|
#include "util/process/process_memory_range.h"
|
||||||
@ -48,6 +47,10 @@ class DebugRendezvous {
|
|||||||
};
|
};
|
||||||
|
|
||||||
DebugRendezvous();
|
DebugRendezvous();
|
||||||
|
|
||||||
|
DebugRendezvous(const DebugRendezvous&) = delete;
|
||||||
|
DebugRendezvous& operator=(const DebugRendezvous&) = delete;
|
||||||
|
|
||||||
~DebugRendezvous();
|
~DebugRendezvous();
|
||||||
|
|
||||||
//! \brief Initializes this object by reading an `r_debug` struct from a
|
//! \brief Initializes this object by reading an `r_debug` struct from a
|
||||||
@ -79,8 +82,6 @@ class DebugRendezvous {
|
|||||||
std::vector<LinkEntry> modules_;
|
std::vector<LinkEntry> modules_;
|
||||||
LinkEntry executable_;
|
LinkEntry executable_;
|
||||||
InitializationStateDcheck initialized_;
|
InitializationStateDcheck initialized_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(DebugRendezvous);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
@ -239,6 +239,10 @@ TEST(DebugRendezvous, Self) {
|
|||||||
class ChildTest : public Multiprocess {
|
class ChildTest : public Multiprocess {
|
||||||
public:
|
public:
|
||||||
ChildTest() {}
|
ChildTest() {}
|
||||||
|
|
||||||
|
ChildTest(const ChildTest&) = delete;
|
||||||
|
ChildTest& operator=(const ChildTest&) = delete;
|
||||||
|
|
||||||
~ChildTest() {}
|
~ChildTest() {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -250,8 +254,6 @@ class ChildTest : public Multiprocess {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MultiprocessChild() { CheckedReadFileAtEOF(ReadPipeHandle()); }
|
void MultiprocessChild() { CheckedReadFileAtEOF(ReadPipeHandle()); }
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ChildTest);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
TEST(DebugRendezvous, Child) {
|
TEST(DebugRendezvous, Child) {
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
#include "snapshot/cpu_context.h"
|
#include "snapshot/cpu_context.h"
|
||||||
#include "snapshot/exception_snapshot.h"
|
#include "snapshot/exception_snapshot.h"
|
||||||
@ -37,6 +36,10 @@ namespace internal {
|
|||||||
class ExceptionSnapshotLinux final : public ExceptionSnapshot {
|
class ExceptionSnapshotLinux final : public ExceptionSnapshot {
|
||||||
public:
|
public:
|
||||||
ExceptionSnapshotLinux();
|
ExceptionSnapshotLinux();
|
||||||
|
|
||||||
|
ExceptionSnapshotLinux(const ExceptionSnapshotLinux&) = delete;
|
||||||
|
ExceptionSnapshotLinux& operator=(const ExceptionSnapshotLinux&) = delete;
|
||||||
|
|
||||||
~ExceptionSnapshotLinux() override;
|
~ExceptionSnapshotLinux() override;
|
||||||
|
|
||||||
//! \brief Initializes the object.
|
//! \brief Initializes the object.
|
||||||
@ -93,8 +96,6 @@ class ExceptionSnapshotLinux final : public ExceptionSnapshot {
|
|||||||
uint32_t signal_number_;
|
uint32_t signal_number_;
|
||||||
uint32_t signal_code_;
|
uint32_t signal_code_;
|
||||||
InitializationStateDcheck initialized_;
|
InitializationStateDcheck initialized_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ExceptionSnapshotLinux);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
|
|
||||||
#include "base/bit_cast.h"
|
#include "base/bit_cast.h"
|
||||||
#include "base/cxx17_backports.h"
|
#include "base/cxx17_backports.h"
|
||||||
#include "base/macros.h"
|
|
||||||
#include "base/strings/stringprintf.h"
|
#include "base/strings/stringprintf.h"
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
#include "snapshot/cpu_architecture.h"
|
#include "snapshot/cpu_architecture.h"
|
||||||
@ -333,6 +332,9 @@ class ScopedSigactionRestore {
|
|||||||
public:
|
public:
|
||||||
ScopedSigactionRestore() : old_action_(), signo_(-1), valid_(false) {}
|
ScopedSigactionRestore() : old_action_(), signo_(-1), valid_(false) {}
|
||||||
|
|
||||||
|
ScopedSigactionRestore(const ScopedSigactionRestore&) = delete;
|
||||||
|
ScopedSigactionRestore& operator=(const ScopedSigactionRestore&) = delete;
|
||||||
|
|
||||||
~ScopedSigactionRestore() { Reset(); }
|
~ScopedSigactionRestore() { Reset(); }
|
||||||
|
|
||||||
bool Reset() {
|
bool Reset() {
|
||||||
@ -361,12 +363,14 @@ class ScopedSigactionRestore {
|
|||||||
struct sigaction old_action_;
|
struct sigaction old_action_;
|
||||||
int signo_;
|
int signo_;
|
||||||
bool valid_;
|
bool valid_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ScopedSigactionRestore);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class RaiseTest {
|
class RaiseTest {
|
||||||
public:
|
public:
|
||||||
|
RaiseTest() = delete;
|
||||||
|
RaiseTest(const RaiseTest&) = delete;
|
||||||
|
RaiseTest& operator=(const RaiseTest&) = delete;
|
||||||
|
|
||||||
static void Run() {
|
static void Run() {
|
||||||
test_complete_ = false;
|
test_complete_ = false;
|
||||||
|
|
||||||
@ -406,8 +410,6 @@ class RaiseTest {
|
|||||||
|
|
||||||
static constexpr uint32_t kSigno = SIGUSR1;
|
static constexpr uint32_t kSigno = SIGUSR1;
|
||||||
static bool test_complete_;
|
static bool test_complete_;
|
||||||
|
|
||||||
DISALLOW_IMPLICIT_CONSTRUCTORS(RaiseTest);
|
|
||||||
};
|
};
|
||||||
bool RaiseTest::test_complete_ = false;
|
bool RaiseTest::test_complete_ = false;
|
||||||
|
|
||||||
@ -418,6 +420,10 @@ TEST(ExceptionSnapshotLinux, Raise) {
|
|||||||
class TimerTest {
|
class TimerTest {
|
||||||
public:
|
public:
|
||||||
TimerTest() : event_(), timer_(-1), test_complete_(false) { test_ = this; }
|
TimerTest() : event_(), timer_(-1), test_complete_(false) { test_ = this; }
|
||||||
|
|
||||||
|
TimerTest(const TimerTest&) = delete;
|
||||||
|
TimerTest& operator=(const TimerTest&) = delete;
|
||||||
|
|
||||||
~TimerTest() { test_ = nullptr; }
|
~TimerTest() { test_ = nullptr; }
|
||||||
|
|
||||||
void Run() {
|
void Run() {
|
||||||
@ -479,8 +485,6 @@ class TimerTest {
|
|||||||
|
|
||||||
static constexpr uint32_t kSigno = SIGALRM;
|
static constexpr uint32_t kSigno = SIGALRM;
|
||||||
static TimerTest* test_;
|
static TimerTest* test_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(TimerTest);
|
|
||||||
};
|
};
|
||||||
TimerTest* TimerTest::test_;
|
TimerTest* TimerTest::test_;
|
||||||
|
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "snapshot/elf/elf_image_reader.h"
|
#include "snapshot/elf/elf_image_reader.h"
|
||||||
#include "snapshot/module_snapshot.h"
|
#include "snapshot/module_snapshot.h"
|
||||||
#include "util/linux/address_types.h"
|
#include "util/linux/address_types.h"
|
||||||
@ -99,6 +98,10 @@ class ProcessReaderLinux {
|
|||||||
};
|
};
|
||||||
|
|
||||||
ProcessReaderLinux();
|
ProcessReaderLinux();
|
||||||
|
|
||||||
|
ProcessReaderLinux(const ProcessReaderLinux&) = delete;
|
||||||
|
ProcessReaderLinux& operator=(const ProcessReaderLinux&) = delete;
|
||||||
|
|
||||||
~ProcessReaderLinux();
|
~ProcessReaderLinux();
|
||||||
|
|
||||||
//! \brief Initializes this object.
|
//! \brief Initializes this object.
|
||||||
@ -175,8 +178,6 @@ class ProcessReaderLinux {
|
|||||||
bool initialized_threads_;
|
bool initialized_threads_;
|
||||||
bool initialized_modules_;
|
bool initialized_modules_;
|
||||||
InitializationStateDcheck initialized_;
|
InitializationStateDcheck initialized_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ProcessReaderLinux);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
@ -103,6 +103,10 @@ constexpr char kTestMemory[] = "Read me from another process";
|
|||||||
class BasicChildTest : public Multiprocess {
|
class BasicChildTest : public Multiprocess {
|
||||||
public:
|
public:
|
||||||
BasicChildTest() : Multiprocess() {}
|
BasicChildTest() : Multiprocess() {}
|
||||||
|
|
||||||
|
BasicChildTest(const BasicChildTest&) = delete;
|
||||||
|
BasicChildTest& operator=(const BasicChildTest&) = delete;
|
||||||
|
|
||||||
~BasicChildTest() {}
|
~BasicChildTest() {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -129,8 +133,6 @@ class BasicChildTest : public Multiprocess {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MultiprocessChild() override { CheckedReadFileAtEOF(ReadPipeHandle()); }
|
void MultiprocessChild() override { CheckedReadFileAtEOF(ReadPipeHandle()); }
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(BasicChildTest);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
TEST(ProcessReaderLinux, ChildBasic) {
|
TEST(ProcessReaderLinux, ChildBasic) {
|
||||||
@ -151,6 +153,9 @@ class TestThreadPool {
|
|||||||
|
|
||||||
TestThreadPool() : threads_() {}
|
TestThreadPool() : threads_() {}
|
||||||
|
|
||||||
|
TestThreadPool(const TestThreadPool&) = delete;
|
||||||
|
TestThreadPool& operator=(const TestThreadPool&) = delete;
|
||||||
|
|
||||||
~TestThreadPool() {
|
~TestThreadPool() {
|
||||||
for (const auto& thread : threads_) {
|
for (const auto& thread : threads_) {
|
||||||
thread->exit_semaphore.Signal();
|
thread->exit_semaphore.Signal();
|
||||||
@ -252,8 +257,6 @@ class TestThreadPool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::unique_ptr<Thread>> threads_;
|
std::vector<std::unique_ptr<Thread>> threads_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(TestThreadPool);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
using ThreadMap = std::map<pid_t, TestThreadPool::ThreadExpectation>;
|
using ThreadMap = std::map<pid_t, TestThreadPool::ThreadExpectation>;
|
||||||
@ -307,6 +310,10 @@ class ChildThreadTest : public Multiprocess {
|
|||||||
public:
|
public:
|
||||||
ChildThreadTest(size_t stack_size = 0)
|
ChildThreadTest(size_t stack_size = 0)
|
||||||
: Multiprocess(), stack_size_(stack_size) {}
|
: Multiprocess(), stack_size_(stack_size) {}
|
||||||
|
|
||||||
|
ChildThreadTest(const ChildThreadTest&) = delete;
|
||||||
|
ChildThreadTest& operator=(const ChildThreadTest&) = delete;
|
||||||
|
|
||||||
~ChildThreadTest() {}
|
~ChildThreadTest() {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -375,8 +382,6 @@ class ChildThreadTest : public Multiprocess {
|
|||||||
|
|
||||||
static constexpr size_t kThreadCount = 3;
|
static constexpr size_t kThreadCount = 3;
|
||||||
const size_t stack_size_;
|
const size_t stack_size_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ChildThreadTest);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
TEST(ProcessReaderLinux, ChildWithThreads) {
|
TEST(ProcessReaderLinux, ChildWithThreads) {
|
||||||
@ -393,6 +398,10 @@ TEST(ProcessReaderLinux, ChildThreadsWithSmallUserStacks) {
|
|||||||
class ChildWithSplitStackTest : public Multiprocess {
|
class ChildWithSplitStackTest : public Multiprocess {
|
||||||
public:
|
public:
|
||||||
ChildWithSplitStackTest() : Multiprocess(), page_size_(getpagesize()) {}
|
ChildWithSplitStackTest() : Multiprocess(), page_size_(getpagesize()) {}
|
||||||
|
|
||||||
|
ChildWithSplitStackTest(const ChildWithSplitStackTest&) = delete;
|
||||||
|
ChildWithSplitStackTest& operator=(const ChildWithSplitStackTest&) = delete;
|
||||||
|
|
||||||
~ChildWithSplitStackTest() {}
|
~ChildWithSplitStackTest() {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -465,8 +474,6 @@ class ChildWithSplitStackTest : public Multiprocess {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const size_t page_size_;
|
const size_t page_size_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ChildWithSplitStackTest);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// AddressSanitizer with use-after-return detection causes stack variables to
|
// AddressSanitizer with use-after-return detection causes stack variables to
|
||||||
@ -587,6 +594,10 @@ TEST(ProcessReaderLinux, SelfModules) {
|
|||||||
class ChildModuleTest : public Multiprocess {
|
class ChildModuleTest : public Multiprocess {
|
||||||
public:
|
public:
|
||||||
ChildModuleTest() : Multiprocess(), module_soname_("test_module_soname") {}
|
ChildModuleTest() : Multiprocess(), module_soname_("test_module_soname") {}
|
||||||
|
|
||||||
|
ChildModuleTest(const ChildModuleTest&) = delete;
|
||||||
|
ChildModuleTest& operator=(const ChildModuleTest&) = delete;
|
||||||
|
|
||||||
~ChildModuleTest() = default;
|
~ChildModuleTest() = default;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -620,8 +631,6 @@ class ChildModuleTest : public Multiprocess {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const std::string module_soname_;
|
const std::string module_soname_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ChildModuleTest);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
TEST(ProcessReaderLinux, ChildModules) {
|
TEST(ProcessReaderLinux, ChildModules) {
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/macros.h"
|
|
||||||
#include "snapshot/crashpad_info_client_options.h"
|
#include "snapshot/crashpad_info_client_options.h"
|
||||||
#include "snapshot/elf/module_snapshot_elf.h"
|
#include "snapshot/elf/module_snapshot_elf.h"
|
||||||
#include "snapshot/linux/exception_snapshot_linux.h"
|
#include "snapshot/linux/exception_snapshot_linux.h"
|
||||||
@ -49,6 +48,10 @@ namespace crashpad {
|
|||||||
class ProcessSnapshotLinux final : public ProcessSnapshot {
|
class ProcessSnapshotLinux final : public ProcessSnapshot {
|
||||||
public:
|
public:
|
||||||
ProcessSnapshotLinux();
|
ProcessSnapshotLinux();
|
||||||
|
|
||||||
|
ProcessSnapshotLinux(const ProcessSnapshotLinux&) = delete;
|
||||||
|
ProcessSnapshotLinux& operator=(const ProcessSnapshotLinux&) = delete;
|
||||||
|
|
||||||
~ProcessSnapshotLinux() override;
|
~ProcessSnapshotLinux() override;
|
||||||
|
|
||||||
//! \brief Initializes the object.
|
//! \brief Initializes the object.
|
||||||
@ -147,8 +150,6 @@ class ProcessSnapshotLinux final : public ProcessSnapshot {
|
|||||||
ProcessReaderLinux process_reader_;
|
ProcessReaderLinux process_reader_;
|
||||||
ProcessMemoryRange memory_range_;
|
ProcessMemoryRange memory_range_;
|
||||||
InitializationStateDcheck initialized_;
|
InitializationStateDcheck initialized_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ProcessSnapshotLinux);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user