diff options
Diffstat (limited to 'src/processor')
31 files changed, 95 insertions, 79 deletions
diff --git a/src/processor/basic_code_module.h b/src/processor/basic_code_module.h index e3955d29..635c09a2 100644 --- a/src/processor/basic_code_module.h +++ b/src/processor/basic_code_module.h @@ -43,12 +43,11 @@ #include <string> +#include "common/using_std_string.h" #include "google_breakpad/processor/code_module.h" namespace google_breakpad { -using std::string; - class BasicCodeModule : public CodeModule { public: // Creates a new BasicCodeModule given any existing CodeModule diff --git a/src/processor/basic_source_line_resolver_unittest.cc b/src/processor/basic_source_line_resolver_unittest.cc index 5fda6f5b..2a483e35 100644 --- a/src/processor/basic_source_line_resolver_unittest.cc +++ b/src/processor/basic_source_line_resolver_unittest.cc @@ -32,6 +32,7 @@ #include <string> #include "breakpad_googletest_includes.h" +#include "common/using_std_string.h" #include "google_breakpad/processor/basic_source_line_resolver.h" #include "google_breakpad/processor/code_module.h" #include "google_breakpad/processor/stack_frame.h" @@ -44,7 +45,6 @@ namespace { -using std::string; using google_breakpad::BasicSourceLineResolver; using google_breakpad::CFIFrameInfo; using google_breakpad::CodeModule; diff --git a/src/processor/binarystream.cc b/src/processor/binarystream.cc index c8ee2186..9ed3b702 100644 --- a/src/processor/binarystream.cc +++ b/src/processor/binarystream.cc @@ -30,15 +30,16 @@ #include <arpa/inet.h> #include <limits.h> +#include <string> #include <vector> +#include "common/using_std_string.h" #include "processor/binarystream.h" namespace google_breakpad { -using std::string; using std::vector; -binarystream &binarystream::operator>>(std::string &str) { +binarystream &binarystream::operator>>(string &str) { u_int16_t length; *this >> length; if (eof()) @@ -83,7 +84,7 @@ binarystream &binarystream::operator>>(u_int64_t &u64) { return *this; } -binarystream &binarystream::operator<<(const std::string &str) { +binarystream &binarystream::operator<<(const string &str) { if (str.length() > USHRT_MAX) { // truncate to 16-bit length *this << static_cast<u_int16_t>(USHRT_MAX); diff --git a/src/processor/binarystream.h b/src/processor/binarystream.h index 8769c250..04657150 100644 --- a/src/processor/binarystream.h +++ b/src/processor/binarystream.h @@ -28,8 +28,8 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // binarystream implements part of the std::iostream interface as a -// wrapper around std::stringstream to allow reading and writing -// std::string and integers of known size. +// wrapper around std::stringstream to allow reading and writing strings +// and integers of known size. #ifndef GOOGLE_BREAKPAD_PROCESSOR_BINARYSTREAM_H_ #define GOOGLE_BREAKPAD_PROCESSOR_BINARYSTREAM_H_ @@ -37,6 +37,7 @@ #include <sstream> #include <string> +#include "common/using_std_string.h" #include "google_breakpad/common/breakpad_types.h" namespace google_breakpad { @@ -47,21 +48,21 @@ class binarystream { public: explicit binarystream(ios_base::openmode which = ios_base::out|ios_base::in) : stream_(which) {} - explicit binarystream(const std::string &str, + explicit binarystream(const string &str, ios_base::openmode which = ios_base::out|ios_base::in) : stream_(str, which) {} explicit binarystream(const char *str, size_t size, ios_base::openmode which = ios_base::out|ios_base::in) - : stream_(std::string(str, size), which) {} + : stream_(string(str, size), which) {} - binarystream &operator>>(std::string &str); + binarystream &operator>>(string &str); binarystream &operator>>(u_int8_t &u8); binarystream &operator>>(u_int16_t &u16); binarystream &operator>>(u_int32_t &u32); binarystream &operator>>(u_int64_t &u64); // Note: strings are truncated at 65535 characters - binarystream &operator<<(const std::string &str); + binarystream &operator<<(const string &str); binarystream &operator<<(u_int8_t u8); binarystream &operator<<(u_int16_t u16); binarystream &operator<<(u_int32_t u32); @@ -70,8 +71,8 @@ class binarystream { // Forward a few methods directly from the stream object bool eof() const { return stream_.eof(); } void clear() { stream_.clear(); } - std::string str() const { return stream_.str(); } - void str(const std::string &s) { stream_.str(s); } + string str() const { return stream_.str(); } + void str(const string &s) { stream_.str(s); } // Seek both read and write pointers to the beginning of the stream. void rewind() { diff --git a/src/processor/binarystream_unittest.cc b/src/processor/binarystream_unittest.cc index 2ed76e28..2812319c 100644 --- a/src/processor/binarystream_unittest.cc +++ b/src/processor/binarystream_unittest.cc @@ -32,11 +32,11 @@ #include <vector> #include "breakpad_googletest_includes.h" +#include "common/using_std_string.h" #include "processor/binarystream.h" namespace { using std::ios_base; -using std::string; using std::vector; using google_breakpad::binarystream; diff --git a/src/processor/cfi_frame_info.h b/src/processor/cfi_frame_info.h index fe06fb4f..4bbbd1ef 100644 --- a/src/processor/cfi_frame_info.h +++ b/src/processor/cfi_frame_info.h @@ -41,12 +41,12 @@ #include <map> #include <string> +#include "common/using_std_string.h" #include "google_breakpad/common/breakpad_types.h" namespace google_breakpad { using std::map; -using std::string; class MemoryRegion; diff --git a/src/processor/cfi_frame_info_unittest.cc b/src/processor/cfi_frame_info_unittest.cc index 979d4a3b..cd48e16d 100644 --- a/src/processor/cfi_frame_info_unittest.cc +++ b/src/processor/cfi_frame_info_unittest.cc @@ -35,6 +35,7 @@ #include <string.h> #include "breakpad_googletest_includes.h" +#include "common/using_std_string.h" #include "processor/cfi_frame_info.h" #include "google_breakpad/processor/memory_region.h" @@ -43,7 +44,6 @@ using google_breakpad::CFIFrameInfoParseHandler; using google_breakpad::CFIRuleParser; using google_breakpad::MemoryRegion; using google_breakpad::SimpleCFIWalker; -using std::string; using testing::_; using testing::A; using testing::AtMost; diff --git a/src/processor/exploitability_unittest.cc b/src/processor/exploitability_unittest.cc index 4de6f1d6..ce7a6f72 100644 --- a/src/processor/exploitability_unittest.cc +++ b/src/processor/exploitability_unittest.cc @@ -43,6 +43,7 @@ #include <string> #include "breakpad_googletest_includes.h" +#include "common/using_std_string.h" #include "google_breakpad/processor/basic_source_line_resolver.h" #include "google_breakpad/processor/call_stack.h" #include "google_breakpad/processor/code_module.h" @@ -78,7 +79,6 @@ using google_breakpad::MockMinidump; using google_breakpad::ProcessState; using google_breakpad::SymbolSupplier; using google_breakpad::SystemInfo; -using std::string; class TestSymbolSupplier : public SymbolSupplier { public: diff --git a/src/processor/fast_source_line_resolver.cc b/src/processor/fast_source_line_resolver.cc index 9224ffa2..a7b99331 100644 --- a/src/processor/fast_source_line_resolver.cc +++ b/src/processor/fast_source_line_resolver.cc @@ -41,8 +41,10 @@ #include "processor/fast_source_line_resolver_types.h" #include <map> +#include <string> #include <utility> +#include "common/using_std_string.h" #include "processor/module_factory.h" #include "processor/scoped_ptr.h" @@ -125,7 +127,7 @@ WindowsFrameInfo FastSourceLineResolver::CopyWFI(const char *raw) { u_int32_t max_stack_size = para_uint32[5]; const char *boolean = reinterpret_cast<const char*>(para_uint32 + 6); bool allocates_base_pointer = (*boolean != 0); - std::string program_string = boolean + 1; + string program_string = boolean + 1; return WindowsFrameInfo(type, prolog_size, diff --git a/src/processor/fast_source_line_resolver_unittest.cc b/src/processor/fast_source_line_resolver_unittest.cc index d36d4ba6..d0323cea 100644 --- a/src/processor/fast_source_line_resolver_unittest.cc +++ b/src/processor/fast_source_line_resolver_unittest.cc @@ -43,6 +43,7 @@ #include <string> #include "breakpad_googletest_includes.h" +#include "common/using_std_string.h" #include "google_breakpad/processor/code_module.h" #include "google_breakpad/processor/stack_frame.h" #include "google_breakpad/processor/memory_region.h" @@ -52,7 +53,6 @@ namespace { -using std::string; using google_breakpad::SourceLineResolverBase; using google_breakpad::BasicSourceLineResolver; using google_breakpad::FastSourceLineResolver; diff --git a/src/processor/logging.cc b/src/processor/logging.cc index 70f6958e..a6e15cae 100644 --- a/src/processor/logging.cc +++ b/src/processor/logging.cc @@ -39,6 +39,9 @@ #include <string.h> #include <time.h> +#include <string> + +#include "common/using_std_string.h" #include "processor/logging.h" #include "processor/pathname_stripper.h" @@ -80,25 +83,25 @@ LogStream::~LogStream() { stream_ << std::endl; } -std::string HexString(u_int32_t number) { +string HexString(u_int32_t number) { char buffer[11]; snprintf(buffer, sizeof(buffer), "0x%x", number); - return std::string(buffer); + return string(buffer); } -std::string HexString(u_int64_t number) { +string HexString(u_int64_t number) { char buffer[19]; snprintf(buffer, sizeof(buffer), "0x%" PRIx64, number); - return std::string(buffer); + return string(buffer); } -std::string HexString(int number) { +string HexString(int number) { char buffer[19]; snprintf(buffer, sizeof(buffer), "0x%x", number); - return std::string(buffer); + return string(buffer); } -int ErrnoString(std::string *error_string) { +int ErrnoString(string *error_string) { assert(error_string); // strerror isn't necessarily thread-safe. strerror_r would be preferrable, diff --git a/src/processor/logging.h b/src/processor/logging.h index 642506d5..6a964f6e 100644 --- a/src/processor/logging.h +++ b/src/processor/logging.h @@ -60,6 +60,7 @@ #include <iostream> #include <string> +#include "common/using_std_string.h" #include "google_breakpad/common/breakpad_types.h" #ifdef BP_LOGGING_INCLUDE @@ -118,14 +119,14 @@ class LogMessageVoidify { }; // Returns number formatted as a hexadecimal string, such as "0x7b". -std::string HexString(u_int32_t number); -std::string HexString(u_int64_t number); -std::string HexString(int number); +string HexString(u_int32_t number); +string HexString(u_int64_t number); +string HexString(int number); // Returns the error code as set in the global errno variable, and sets // error_string, a required argument, to a string describing that error // code. -int ErrnoString(std::string *error_string); +int ErrnoString(string *error_string); } // namespace google_breakpad diff --git a/src/processor/minidump.cc b/src/processor/minidump.cc index 3ca52ff7..dd7358c0 100644 --- a/src/processor/minidump.cc +++ b/src/processor/minidump.cc @@ -3079,13 +3079,13 @@ bool MinidumpSystemInfo::Read(u_int32_t expected_size) { string MinidumpSystemInfo::GetOS() { + string os; + if (!valid_) { BPLOG(ERROR) << "Invalid MinidumpSystemInfo for GetOS"; - return NULL; + return os; } - string os; - switch (system_info_.platform_id) { case MD_OS_WIN32_NT: case MD_OS_WIN32_WINDOWS: diff --git a/src/processor/minidump_processor_unittest.cc b/src/processor/minidump_processor_unittest.cc index fcac48ff..a8e1208e 100644 --- a/src/processor/minidump_processor_unittest.cc +++ b/src/processor/minidump_processor_unittest.cc @@ -39,6 +39,7 @@ #include <utility> #include "breakpad_googletest_includes.h" +#include "common/using_std_string.h" #include "google_breakpad/processor/basic_source_line_resolver.h" #include "google_breakpad/processor/call_stack.h" #include "google_breakpad/processor/code_module.h" @@ -79,7 +80,6 @@ using google_breakpad::ProcessState; using google_breakpad::scoped_ptr; using google_breakpad::SymbolSupplier; using google_breakpad::SystemInfo; -using std::string; using ::testing::_; using ::testing::Mock; using ::testing::Ne; @@ -165,8 +165,8 @@ SymbolSupplier::SymbolResult TestSymbolSupplier::GetSymbolFile( symbol_file); if (s == FOUND) { std::ifstream in(symbol_file->c_str()); - std::getline(in, *symbol_data, std::string::traits_type::to_char_type( - std::string::traits_type::eof())); + std::getline(in, *symbol_data, string::traits_type::to_char_type( + string::traits_type::eof())); in.close(); } diff --git a/src/processor/minidump_stackwalk.cc b/src/processor/minidump_stackwalk.cc index 86f679e9..b37148f4 100644 --- a/src/processor/minidump_stackwalk.cc +++ b/src/processor/minidump_stackwalk.cc @@ -39,6 +39,7 @@ #include <string> #include <vector> +#include "common/using_std_string.h" #include "google_breakpad/processor/basic_source_line_resolver.h" #include "google_breakpad/processor/call_stack.h" #include "google_breakpad/processor/code_module.h" @@ -54,7 +55,6 @@ namespace { -using std::string; using std::vector; using google_breakpad::BasicSourceLineResolver; using google_breakpad::CallStack; @@ -575,7 +575,7 @@ int main(int argc, char **argv) { } // extra arguments are symbol paths - std::vector<std::string> symbol_paths; + std::vector<string> symbol_paths; if (argc > symbol_path_arg) { for (int argi = symbol_path_arg; argi < argc; ++argi) symbol_paths.push_back(argv[argi]); diff --git a/src/processor/minidump_unittest.cc b/src/processor/minidump_unittest.cc index d1c91a88..ce142300 100644 --- a/src/processor/minidump_unittest.cc +++ b/src/processor/minidump_unittest.cc @@ -36,7 +36,9 @@ #include <stdlib.h> #include <string> #include <vector> + #include "breakpad_googletest_includes.h" +#include "common/using_std_string.h" #include "google_breakpad/common/minidump_format.h" #include "google_breakpad/processor/minidump.h" #include "processor/logging.h" @@ -69,7 +71,6 @@ using google_breakpad::test_assembler::kBigEndian; using google_breakpad::test_assembler::kLittleEndian; using std::ifstream; using std::istringstream; -using std::string; using std::vector; using ::testing::Return; diff --git a/src/processor/pathname_stripper.h b/src/processor/pathname_stripper.h index 17db75d6..423ca0d0 100644 --- a/src/processor/pathname_stripper.h +++ b/src/processor/pathname_stripper.h @@ -36,9 +36,9 @@ #include <string> -namespace google_breakpad { +#include "common/using_std_string.h" -using std::string; +namespace google_breakpad { class PathnameStripper { public: diff --git a/src/processor/postfix_evaluator.h b/src/processor/postfix_evaluator.h index eb53b1eb..94b66190 100644 --- a/src/processor/postfix_evaluator.h +++ b/src/processor/postfix_evaluator.h @@ -74,10 +74,11 @@ #include <string> #include <vector> +#include "common/using_std_string.h" + namespace google_breakpad { using std::map; -using std::string; using std::vector; class MemoryRegion; diff --git a/src/processor/postfix_evaluator_unittest.cc b/src/processor/postfix_evaluator_unittest.cc index f6cbcf08..00c8fd83 100644 --- a/src/processor/postfix_evaluator_unittest.cc +++ b/src/processor/postfix_evaluator_unittest.cc @@ -38,6 +38,7 @@ #include "processor/postfix_evaluator-inl.h" +#include "common/using_std_string.h" #include "google_breakpad/common/breakpad_types.h" #include "google_breakpad/processor/memory_region.h" #include "processor/logging.h" @@ -47,7 +48,6 @@ namespace { using std::map; -using std::string; using google_breakpad::MemoryRegion; using google_breakpad::PostfixEvaluator; diff --git a/src/processor/simple_symbol_supplier.cc b/src/processor/simple_symbol_supplier.cc index 76820e12..4a3a1059 100644 --- a/src/processor/simple_symbol_supplier.cc +++ b/src/processor/simple_symbol_supplier.cc @@ -44,6 +44,7 @@ #include <iostream> #include <fstream> +#include "common/using_std_string.h" #include "google_breakpad/processor/code_module.h" #include "google_breakpad/processor/system_info.h" #include "processor/logging.h" @@ -87,8 +88,8 @@ SymbolSupplier::SymbolResult SimpleSymbolSupplier::GetSymbolFile( if (s == FOUND) { std::ifstream in(symbol_file->c_str()); - std::getline(in, *symbol_data, std::string::traits_type::to_char_type( - std::string::traits_type::eof())); + std::getline(in, *symbol_data, string::traits_type::to_char_type( + string::traits_type::eof())); in.close(); } return s; diff --git a/src/processor/simple_symbol_supplier.h b/src/processor/simple_symbol_supplier.h index e1c16195..e19b194c 100644 --- a/src/processor/simple_symbol_supplier.h +++ b/src/processor/simple_symbol_supplier.h @@ -80,12 +80,12 @@ #include <string> #include <vector> +#include "common/using_std_string.h" #include "google_breakpad/processor/symbol_supplier.h" namespace google_breakpad { using std::map; -using std::string; using std::vector; class CodeModule; diff --git a/src/processor/stackwalker_amd64_unittest.cc b/src/processor/stackwalker_amd64_unittest.cc index a107bee8..26c1a26f 100644 --- a/src/processor/stackwalker_amd64_unittest.cc +++ b/src/processor/stackwalker_amd64_unittest.cc @@ -37,6 +37,7 @@ #include "breakpad_googletest_includes.h" #include "common/test_assembler.h" +#include "common/using_std_string.h" #include "google_breakpad/common/minidump_format.h" #include "google_breakpad/processor/basic_source_line_resolver.h" #include "google_breakpad/processor/call_stack.h" @@ -54,7 +55,6 @@ using google_breakpad::SystemInfo; using google_breakpad::test_assembler::kLittleEndian; using google_breakpad::test_assembler::Label; using google_breakpad::test_assembler::Section; -using std::string; using std::vector; using testing::_; using testing::Return; diff --git a/src/processor/stackwalker_arm_unittest.cc b/src/processor/stackwalker_arm_unittest.cc index 6a623c27..3925dcd8 100644 --- a/src/processor/stackwalker_arm_unittest.cc +++ b/src/processor/stackwalker_arm_unittest.cc @@ -37,6 +37,7 @@ #include "breakpad_googletest_includes.h" #include "common/test_assembler.h" +#include "common/using_std_string.h" #include "google_breakpad/common/minidump_format.h" #include "google_breakpad/processor/basic_source_line_resolver.h" #include "google_breakpad/processor/call_stack.h" @@ -56,7 +57,6 @@ using google_breakpad::WindowsFrameInfo; using google_breakpad::test_assembler::kLittleEndian; using google_breakpad::test_assembler::Label; using google_breakpad::test_assembler::Section; -using std::string; using std::vector; using testing::_; using testing::Return; diff --git a/src/processor/stackwalker_unittest_utils.h b/src/processor/stackwalker_unittest_utils.h index d2e29f72..551d3191 100644 --- a/src/processor/stackwalker_unittest_utils.h +++ b/src/processor/stackwalker_unittest_utils.h @@ -40,6 +40,7 @@ #include <string> #include <vector> +#include "common/using_std_string.h" #include "google_breakpad/common/breakpad_types.h" #include "google_breakpad/processor/code_module.h" #include "google_breakpad/processor/code_modules.h" @@ -54,7 +55,7 @@ class MockMemoryRegion: public google_breakpad::MemoryRegion { // Set this region's address and contents. If we have placed an // instance of this class in a test fixture class, individual tests // can use this to provide the region's contents. - void Init(u_int64_t base_address, const std::string &contents) { + void Init(u_int64_t base_address, const string &contents) { base_address_ = base_address; contents_ = contents; } @@ -93,22 +94,22 @@ class MockMemoryRegion: public google_breakpad::MemoryRegion { } u_int64_t base_address_; - std::string contents_; + string contents_; }; class MockCodeModule: public google_breakpad::CodeModule { public: MockCodeModule(u_int64_t base_address, u_int64_t size, - const std::string &code_file, const std::string &version) + const string &code_file, const string &version) : base_address_(base_address), size_(size), code_file_(code_file) { } u_int64_t base_address() const { return base_address_; } u_int64_t size() const { return size_; } - std::string code_file() const { return code_file_; } - std::string code_identifier() const { return code_file_; } - std::string debug_file() const { return code_file_; } - std::string debug_identifier() const { return code_file_; } - std::string version() const { return version_; } + string code_file() const { return code_file_; } + string code_identifier() const { return code_file_; } + string debug_file() const { return code_file_; } + string debug_identifier() const { return code_file_; } + string version() const { return version_; } const google_breakpad::CodeModule *Copy() const { abort(); // Tests won't use this. } @@ -116,8 +117,8 @@ class MockCodeModule: public google_breakpad::CodeModule { private: u_int64_t base_address_; u_int64_t size_; - std::string code_file_; - std::string version_; + string code_file_; + string version_; }; class MockCodeModules: public google_breakpad::CodeModules { @@ -165,14 +166,14 @@ class MockSymbolSupplier: public google_breakpad::SymbolSupplier { typedef google_breakpad::SystemInfo SystemInfo; MOCK_METHOD3(GetSymbolFile, SymbolResult(const CodeModule *module, const SystemInfo *system_info, - std::string *symbol_file)); + string *symbol_file)); MOCK_METHOD4(GetSymbolFile, SymbolResult(const CodeModule *module, const SystemInfo *system_info, - std::string *symbol_file, - std::string *symbol_data)); + string *symbol_file, + string *symbol_data)); MOCK_METHOD4(GetCStringSymbolData, SymbolResult(const CodeModule *module, const SystemInfo *system_info, - std::string *symbol_file, + string *symbol_file, char **symbol_data)); MOCK_METHOD1(FreeSymbolData, void(const CodeModule *module)); }; diff --git a/src/processor/stackwalker_x86_unittest.cc b/src/processor/stackwalker_x86_unittest.cc index e57311e8..58dfb6be 100644 --- a/src/processor/stackwalker_x86_unittest.cc +++ b/src/processor/stackwalker_x86_unittest.cc @@ -36,6 +36,7 @@ #include "breakpad_googletest_includes.h" #include "common/test_assembler.h" +#include "common/using_std_string.h" #include "google_breakpad/common/minidump_format.h" #include "google_breakpad/processor/basic_source_line_resolver.h" #include "google_breakpad/processor/call_stack.h" @@ -55,7 +56,6 @@ using google_breakpad::WindowsFrameInfo; using google_breakpad::test_assembler::kLittleEndian; using google_breakpad::test_assembler::Label; using google_breakpad::test_assembler::Section; -using std::string; using std::vector; using testing::_; using testing::Return; diff --git a/src/processor/static_address_map_unittest.cc b/src/processor/static_address_map_unittest.cc index 5ef03455..12c735cf 100644 --- a/src/processor/static_address_map_unittest.cc +++ b/src/processor/static_address_map_unittest.cc @@ -39,13 +39,14 @@ #include <sstream> #include "breakpad_googletest_includes.h" +#include "common/using_std_string.h" #include "processor/address_map-inl.h" #include "processor/static_address_map-inl.h" #include "processor/simple_serializer-inl.h" #include "map_serializers-inl.h" typedef google_breakpad::StaticAddressMap<int, char> TestMap; -typedef google_breakpad::AddressMap<int, std::string> AddrMap; +typedef google_breakpad::AddressMap<int, string> AddrMap; class TestStaticAddressMap : public ::testing::Test { protected: @@ -92,8 +93,8 @@ class TestStaticAddressMap : public ::testing::Test { void CompareRetrieveResult(int testcase, int target) { int address; int address_test; - std::string entry; - std::string entry_test; + string entry; + string entry_test; const char *entry_cstring = NULL; bool found; bool found_test; @@ -147,7 +148,7 @@ class TestStaticAddressMap : public ::testing::Test { AddrMap addr_map[kNumberTestCases]; TestMap test_map[kNumberTestCases]; char *map_data[kNumberTestCases]; - google_breakpad::AddressMapSerializer<int, std::string> serializer; + google_breakpad::AddressMapSerializer<int, string> serializer; }; const int TestStaticAddressMap::testsize[] = {0, 1, 6, 1000}; diff --git a/src/processor/synth_minidump.h b/src/processor/synth_minidump.h index 245afe66..531603ad 100644 --- a/src/processor/synth_minidump.h +++ b/src/processor/synth_minidump.h @@ -114,6 +114,7 @@ #include <string> #include "common/test_assembler.h" +#include "common/using_std_string.h" #include "google_breakpad/common/breakpad_types.h" #include "google_breakpad/common/minidump_format.h" @@ -121,7 +122,6 @@ namespace google_breakpad { namespace SynthMinidump { -using std::string; using test_assembler::Endianness; using test_assembler::kBigEndian; using test_assembler::kLittleEndian; diff --git a/src/processor/synth_minidump_unittest.cc b/src/processor/synth_minidump_unittest.cc index 1ce34ddf..3b905f4b 100644 --- a/src/processor/synth_minidump_unittest.cc +++ b/src/processor/synth_minidump_unittest.cc @@ -36,6 +36,7 @@ #include <string> #include "breakpad_googletest_includes.h" +#include "common/using_std_string.h" #include "google_breakpad/common/minidump_format.h" #include "processor/synth_minidump.h" #include "processor/synth_minidump_unittest_data.h" @@ -54,7 +55,6 @@ using google_breakpad::SynthMinidump::Thread; using google_breakpad::test_assembler::kBigEndian; using google_breakpad::test_assembler::kLittleEndian; using google_breakpad::test_assembler::Label; -using std::string; TEST(Section, Simple) { Dump dump(0); diff --git a/src/processor/tokenize.cc b/src/processor/tokenize.cc index 85f77821..e398c528 100644 --- a/src/processor/tokenize.cc +++ b/src/processor/tokenize.cc @@ -32,9 +32,10 @@ #include <string> #include <vector> +#include "common/using_std_string.h" + namespace google_breakpad { -using std::string; using std::vector; bool Tokenize(char *line, diff --git a/src/processor/tokenize.h b/src/processor/tokenize.h index 1562b823..9ff571d5 100644 --- a/src/processor/tokenize.h +++ b/src/processor/tokenize.h @@ -35,6 +35,8 @@ #include <string> #include <vector> +#include "common/using_std_string.h" + namespace google_breakpad { // Splits line into at most max_tokens tokens, separated by any of the @@ -49,12 +51,12 @@ namespace google_breakpad { // exact, as opposed to maximum, number of tokens. bool Tokenize(char *line, - const char *separators, - int max_tokens, - std::vector<char*> *tokens); + const char *separators, + int max_tokens, + std::vector<char*> *tokens); // For convenience, since you need a char* to pass to Tokenize. -// You can call StringToVector on a std::string, and use &vec[0]. -void StringToVector(const std::string &str, std::vector<char> &vec); +// You can call StringToVector on a string, and use &vec[0]. +void StringToVector(const string &str, std::vector<char> &vec); } // namespace google_breakpad diff --git a/src/processor/windows_frame_info.h b/src/processor/windows_frame_info.h index 3aa7b3f6..8af4b3f3 100644 --- a/src/processor/windows_frame_info.h +++ b/src/processor/windows_frame_info.h @@ -44,6 +44,7 @@ #include <string> #include <vector> +#include "common/using_std_string.h" #include "google_breakpad/common/breakpad_types.h" #include "processor/logging.h" #include "processor/tokenize.h" @@ -91,7 +92,7 @@ struct WindowsFrameInfo { u_int32_t set_local_size, u_int32_t set_max_stack_size, int set_allocates_base_pointer, - const std::string set_program_string) + const string set_program_string) : type_(type), valid(VALID_ALL), prolog_size(set_prolog_size), @@ -107,7 +108,7 @@ struct WindowsFrameInfo { // a string. Returns NULL if parsing fails, or a new object // otherwise. type, rva and code_size are present in the STACK line, // but not the StackFrameInfo structure, so return them as outparams. - static WindowsFrameInfo *ParseFromString(const std::string string, + static WindowsFrameInfo *ParseFromString(const string string, int &type, u_int64_t &rva, u_int64_t &code_size) { @@ -195,7 +196,7 @@ struct WindowsFrameInfo { // Only one of allocates_base_pointer or program_string will be valid. // If program_string is empty, use allocates_base_pointer. bool allocates_base_pointer; - std::string program_string; + string program_string; }; } // namespace google_breakpad |