From 704f41ec901c419f8c321742114b415e6f5ceacc Mon Sep 17 00:00:00 2001 From: Ivan Penkov Date: Tue, 30 Aug 2016 14:00:56 -0700 Subject: 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 BUG= Change-Id: I11f1ce697be23e13f12ea8f0468bbe02fa63c967 Reviewed-on: https://chromium-review.googlesource.com/378159 Reviewed-by: Mark Mentovai --- src/processor/proc_maps_linux.cc | 7 ++++--- src/processor/proc_maps_linux_unittest.cc | 3 ++- src/processor/stackwalk_common.cc | 8 ++++---- src/processor/symbolic_constants_win.cc | 5 +++-- 4 files changed, 13 insertions(+), 10 deletions(-) (limited to 'src/processor') diff --git a/src/processor/proc_maps_linux.cc b/src/processor/proc_maps_linux.cc index 0cd3772e..3c0dea25 100644 --- a/src/processor/proc_maps_linux.cc +++ b/src/processor/proc_maps_linux.cc @@ -12,6 +12,7 @@ #include #include +#include "common/using_std_string.h" #include "processor/logging.h" #if defined(OS_ANDROID) && !defined(__LP64__) @@ -25,7 +26,7 @@ namespace google_breakpad { -bool ParseProcMaps(const std::string& input, +bool ParseProcMaps(const string& input, std::vector* regions_out) { std::vector regions; @@ -33,8 +34,8 @@ bool ParseProcMaps(const std::string& input, // this point in time. // Split the string by newlines. - std::vector lines; - std::string l = ""; + std::vector lines; + string l = ""; for (size_t i = 0; i < input.size(); i++) { if (input[i] != '\n' && input[i] != '\r') { l.push_back(input[i]); diff --git a/src/processor/proc_maps_linux_unittest.cc b/src/processor/proc_maps_linux_unittest.cc index 1ff4b031..466f2345 100644 --- a/src/processor/proc_maps_linux_unittest.cc +++ b/src/processor/proc_maps_linux_unittest.cc @@ -3,6 +3,7 @@ // found in the LICENSE file. #include "breakpad_googletest_includes.h" +#include "common/using_std_string.h" #include "google_breakpad/processor/proc_maps_linux.h" namespace { @@ -227,7 +228,7 @@ TEST(ProcMapsTest, ParseProcMapsEmptyString) { // - File name has whitespaces. TEST(ProcMapsTest, ParseProcMapsWeirdCorrectInput) { std::vector regions; - const std::string kContents = + const string kContents = "00400000-0040b000 r-xp 00000000 fc:00 2106562 " " /bin/cat\r\n" "7f53b7dad000-7f53b7f62000 r-xp 00000000 fc:00 263011 " diff --git a/src/processor/stackwalk_common.cc b/src/processor/stackwalk_common.cc index d8950fe2..704039f3 100644 --- a/src/processor/stackwalk_common.cc +++ b/src/processor/stackwalk_common.cc @@ -112,10 +112,10 @@ static string StripSeparator(const string &original) { } // PrintStackContents prints the stack contents of the current frame to stdout. -static void PrintStackContents(const std::string &indent, +static void PrintStackContents(const string &indent, const StackFrame *frame, const StackFrame *prev_frame, - const std::string &cpu, + const string &cpu, const MemoryRegion *memory, const CodeModules* modules, SourceLineResolverInterface *resolver) { @@ -181,7 +181,7 @@ static void PrintStackContents(const std::string &indent, // Print data in hex. const int kBytesPerRow = 16; - std::string data_as_string; + string data_as_string; for (int i = 0; i < kBytesPerRow; ++i, ++address) { uint8_t value = 0; if (address < stack_end && @@ -607,7 +607,7 @@ static void PrintStack(const CallStack *stack, // Print stack contents. if (output_stack_contents && frame_index + 1 < frame_count) { - const std::string indent(" "); + const string indent(" "); PrintStackContents(indent, frame, stack->frames()->at(frame_index + 1), cpu, memory, modules, resolver); } diff --git a/src/processor/symbolic_constants_win.cc b/src/processor/symbolic_constants_win.cc index 8f142a76..a6ee26a2 100644 --- a/src/processor/symbolic_constants_win.cc +++ b/src/processor/symbolic_constants_win.cc @@ -36,14 +36,15 @@ #include #include "common/stdio_wrapper.h" +#include "common/using_std_string.h" #include "google_breakpad/common/breakpad_types.h" #include "google_breakpad/common/minidump_exception_win32.h" #include "processor/symbolic_constants_win.h" namespace google_breakpad { -std::string NTStatusToString(uint32_t ntstatus) { - std::string reason; +string NTStatusToString(uint32_t ntstatus) { + string reason; // The content of this switch was created from ntstatus.h in the 8.1 SDK with // // egrep '#define [A-Z_0-9]+\s+\(\(NTSTATUS\)0xC[0-9A-F]+L\)' ntstatus.h -- cgit v1.2.1