mirror of
https://git.suyu.dev/suyu/breakpad.git
synced 2025-12-27 17:55:29 +01:00
This change allows compiling the google-breakpad code using a global ::string class instead of std::string. For more details take a look at common/using_std_string.h
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@974 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
parent
93cebf538e
commit
6de969a304
103 changed files with 521 additions and 385 deletions
|
|
@ -126,7 +126,7 @@ pthread_mutex_t ExceptionHandler::handler_stack_mutex_ =
|
|||
PTHREAD_MUTEX_INITIALIZER;
|
||||
|
||||
// Runs before crashing: normal context.
|
||||
ExceptionHandler::ExceptionHandler(const std::string &dump_path,
|
||||
ExceptionHandler::ExceptionHandler(const string &dump_path,
|
||||
FilterCallback filter,
|
||||
MinidumpCallback callback,
|
||||
void *callback_context,
|
||||
|
|
@ -139,7 +139,7 @@ ExceptionHandler::ExceptionHandler(const std::string &dump_path,
|
|||
Init(dump_path, -1);
|
||||
}
|
||||
|
||||
ExceptionHandler::ExceptionHandler(const std::string &dump_path,
|
||||
ExceptionHandler::ExceptionHandler(const string &dump_path,
|
||||
FilterCallback filter,
|
||||
MinidumpCallback callback,
|
||||
void* callback_context,
|
||||
|
|
@ -158,7 +158,7 @@ ExceptionHandler::~ExceptionHandler() {
|
|||
UninstallHandlers();
|
||||
}
|
||||
|
||||
void ExceptionHandler::Init(const std::string &dump_path,
|
||||
void ExceptionHandler::Init(const string &dump_path,
|
||||
const int server_fd)
|
||||
{
|
||||
crash_handler_ = NULL;
|
||||
|
|
@ -469,7 +469,7 @@ bool ExceptionHandler::DoDump(pid_t crashing_process, const void* context,
|
|||
}
|
||||
|
||||
// static
|
||||
bool ExceptionHandler::WriteMinidump(const std::string &dump_path,
|
||||
bool ExceptionHandler::WriteMinidump(const string &dump_path,
|
||||
MinidumpCallback callback,
|
||||
void* callback_context) {
|
||||
ExceptionHandler eh(dump_path, NULL, callback, callback_context, false);
|
||||
|
|
@ -497,7 +497,7 @@ bool ExceptionHandler::WriteMinidump() {
|
|||
#endif // !defined(__ARM_EABI__)
|
||||
}
|
||||
|
||||
void ExceptionHandler::AddMappingInfo(const std::string& name,
|
||||
void ExceptionHandler::AddMappingInfo(const string& name,
|
||||
const u_int8_t identifier[sizeof(MDGUID)],
|
||||
uintptr_t start_address,
|
||||
size_t mapping_size,
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@
|
|||
#endif
|
||||
#include "client/linux/crash_generation/crash_generation_client.h"
|
||||
#include "client/linux/minidump_writer/minidump_writer.h"
|
||||
#include "common/using_std_string.h"
|
||||
#include "google_breakpad/common/minidump_format.h"
|
||||
#include "processor/scoped_ptr.h"
|
||||
|
||||
|
|
@ -127,7 +128,7 @@ class ExceptionHandler {
|
|||
// If install_handler is true, then a minidump will be written whenever
|
||||
// an unhandled exception occurs. If it is false, minidumps will only
|
||||
// be written when WriteMinidump is called.
|
||||
ExceptionHandler(const std::string &dump_path,
|
||||
ExceptionHandler(const string &dump_path,
|
||||
FilterCallback filter, MinidumpCallback callback,
|
||||
void *callback_context,
|
||||
bool install_handler);
|
||||
|
|
@ -137,7 +138,7 @@ class ExceptionHandler {
|
|||
// server_fd is invalid, in-process dump generation will be
|
||||
// used. See the above ctor for a description of the other
|
||||
// parameters.
|
||||
ExceptionHandler(const std::string& dump_path,
|
||||
ExceptionHandler(const string& dump_path,
|
||||
FilterCallback filter, MinidumpCallback callback,
|
||||
void* callback_context,
|
||||
bool install_handler,
|
||||
|
|
@ -146,8 +147,8 @@ class ExceptionHandler {
|
|||
~ExceptionHandler();
|
||||
|
||||
// Get and set the minidump path.
|
||||
std::string dump_path() const { return dump_path_; }
|
||||
void set_dump_path(const std::string &dump_path) {
|
||||
string dump_path() const { return dump_path_; }
|
||||
void set_dump_path(const string &dump_path) {
|
||||
dump_path_ = dump_path;
|
||||
dump_path_c_ = dump_path_.c_str();
|
||||
UpdateNextID();
|
||||
|
|
@ -163,7 +164,7 @@ class ExceptionHandler {
|
|||
|
||||
// Convenience form of WriteMinidump which does not require an
|
||||
// ExceptionHandler instance.
|
||||
static bool WriteMinidump(const std::string &dump_path,
|
||||
static bool WriteMinidump(const string &dump_path,
|
||||
MinidumpCallback callback,
|
||||
void *callback_context);
|
||||
|
||||
|
|
@ -187,14 +188,14 @@ class ExceptionHandler {
|
|||
// Add information about a memory mapping. This can be used if
|
||||
// a custom library loader is used that maps things in a way
|
||||
// that the linux dumper can't handle by reading the maps file.
|
||||
void AddMappingInfo(const std::string& name,
|
||||
void AddMappingInfo(const string& name,
|
||||
const u_int8_t identifier[sizeof(MDGUID)],
|
||||
uintptr_t start_address,
|
||||
size_t mapping_size,
|
||||
size_t file_offset);
|
||||
|
||||
private:
|
||||
void Init(const std::string &dump_path,
|
||||
void Init(const string &dump_path,
|
||||
const int server_fd);
|
||||
bool InstallHandlers();
|
||||
void UninstallHandlers();
|
||||
|
|
@ -216,9 +217,9 @@ class ExceptionHandler {
|
|||
|
||||
scoped_ptr<CrashGenerationClient> crash_generation_client_;
|
||||
|
||||
std::string dump_path_;
|
||||
std::string next_minidump_path_;
|
||||
std::string next_minidump_id_;
|
||||
string dump_path_;
|
||||
string next_minidump_path_;
|
||||
string next_minidump_id_;
|
||||
|
||||
// Pointers to C-string representations of the above. These are set
|
||||
// when the above are set so we can avoid calling c_str during
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@
|
|||
#include "common/linux/file_id.h"
|
||||
#include "common/linux/linux_libc_support.h"
|
||||
#include "common/tests/auto_tempdir.h"
|
||||
#include "common/using_std_string.h"
|
||||
#include "third_party/lss/linux_syscall_support.h"
|
||||
#include "google_breakpad/processor/minidump.h"
|
||||
|
||||
|
|
@ -130,7 +131,7 @@ TEST(ExceptionHandlerTest, ChildCrash) {
|
|||
filename[len] = 0;
|
||||
close(fds[0]);
|
||||
|
||||
const std::string minidump_filename = temp_dir.path() + "/" + filename +
|
||||
const string minidump_filename = temp_dir.path() + "/" + filename +
|
||||
".dmp";
|
||||
|
||||
struct stat st;
|
||||
|
|
@ -204,7 +205,7 @@ TEST(ExceptionHandlerTest, InstructionPointerMemory) {
|
|||
filename[len] = 0;
|
||||
close(fds[0]);
|
||||
|
||||
const std::string minidump_filename = temp_dir.path() + "/" + filename +
|
||||
const string minidump_filename = temp_dir.path() + "/" + filename +
|
||||
".dmp";
|
||||
|
||||
struct stat st;
|
||||
|
|
@ -329,7 +330,7 @@ TEST(ExceptionHandlerTest, InstructionPointerMemoryMinBound) {
|
|||
filename[len] = 0;
|
||||
close(fds[0]);
|
||||
|
||||
const std::string minidump_filename = temp_dir.path() + "/" + filename +
|
||||
const string minidump_filename = temp_dir.path() + "/" + filename +
|
||||
".dmp";
|
||||
|
||||
struct stat st;
|
||||
|
|
@ -454,7 +455,7 @@ TEST(ExceptionHandlerTest, InstructionPointerMemoryMaxBound) {
|
|||
filename[len] = 0;
|
||||
close(fds[0]);
|
||||
|
||||
const std::string minidump_filename = temp_dir.path() + "/" + filename +
|
||||
const string minidump_filename = temp_dir.path() + "/" + filename +
|
||||
".dmp";
|
||||
|
||||
struct stat st;
|
||||
|
|
@ -555,7 +556,7 @@ TEST(ExceptionHandlerTest, InstructionPointerMemoryNullPointer) {
|
|||
filename[len] = 0;
|
||||
close(fds[0]);
|
||||
|
||||
const std::string minidump_filename = temp_dir.path() + "/" + filename +
|
||||
const string minidump_filename = temp_dir.path() + "/" + filename +
|
||||
".dmp";
|
||||
|
||||
struct stat st;
|
||||
|
|
@ -767,7 +768,7 @@ TEST(ExceptionHandlerTest, ExternalDumper) {
|
|||
ASSERT_NE(signal_fd, -1);
|
||||
|
||||
AutoTempDir temp_dir;
|
||||
std::string templ = temp_dir.path() + "/exception-handler-unittest";
|
||||
string templ = temp_dir.path() + "/exception-handler-unittest";
|
||||
ASSERT_TRUE(WriteMinidump(templ.c_str(), crashing_pid, context,
|
||||
kCrashContextSize));
|
||||
static const char b = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue