aboutsummaryrefslogtreecommitdiff
path: root/src/client/linux/handler
diff options
context:
space:
mode:
authorivan.penkov@gmail.com <ivan.penkov@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e>2012-06-28 22:46:01 +0000
committerivan.penkov@gmail.com <ivan.penkov@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e>2012-06-28 22:46:01 +0000
commit6de969a3040fa31ba60302c66613d1d2e6f5a730 (patch)
treeaad9de34e00834709440f01cb0f54e315989490e /src/client/linux/handler
parentFix Android build of client library (diff)
downloadbreakpad-6de969a3040fa31ba60302c66613d1d2e6f5a730.tar.xz
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
Diffstat (limited to 'src/client/linux/handler')
-rw-r--r--src/client/linux/handler/exception_handler.cc10
-rw-r--r--src/client/linux/handler/exception_handler.h21
-rw-r--r--src/client/linux/handler/exception_handler_unittest.cc13
3 files changed, 23 insertions, 21 deletions
diff --git a/src/client/linux/handler/exception_handler.cc b/src/client/linux/handler/exception_handler.cc
index 4b78424f..f505ff33 100644
--- a/src/client/linux/handler/exception_handler.cc
+++ b/src/client/linux/handler/exception_handler.cc
@@ -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,
diff --git a/src/client/linux/handler/exception_handler.h b/src/client/linux/handler/exception_handler.h
index 94766eba..4bc8ba72 100644
--- a/src/client/linux/handler/exception_handler.h
+++ b/src/client/linux/handler/exception_handler.h
@@ -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
diff --git a/src/client/linux/handler/exception_handler_unittest.cc b/src/client/linux/handler/exception_handler_unittest.cc
index 6fcf251b..f9314729 100644
--- a/src/client/linux/handler/exception_handler_unittest.cc
+++ b/src/client/linux/handler/exception_handler_unittest.cc
@@ -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;