From 6de969a3040fa31ba60302c66613d1d2e6f5a730 Mon Sep 17 00:00:00 2001 From: "ivan.penkov@gmail.com" Date: Thu, 28 Jun 2012 22:46:01 +0000 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 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@974 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/common/dwarf/dwarf2reader.cc | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src/common/dwarf/dwarf2reader.cc') diff --git a/src/common/dwarf/dwarf2reader.cc b/src/common/dwarf/dwarf2reader.cc index 43566467..7c1a29dd 100644 --- a/src/common/dwarf/dwarf2reader.cc +++ b/src/common/dwarf/dwarf2reader.cc @@ -41,11 +41,13 @@ #include #include #include +#include #include #include "common/dwarf/bytereader-inl.h" #include "common/dwarf/bytereader.h" #include "common/dwarf/line_state_machine.h" +#include "common/using_std_string.h" namespace dwarf2reader { @@ -1004,7 +1006,7 @@ class CallFrameInfo::RegisterRule: public CallFrameInfo::Rule { // Rule: EXPRESSION evaluates to the address at which the register is saved. class CallFrameInfo::ExpressionRule: public CallFrameInfo::Rule { public: - explicit ExpressionRule(const std::string &expression) + explicit ExpressionRule(const string &expression) : expression_(expression) { } ~ExpressionRule() { } bool Handle(Handler *handler, uint64 address, int reg) const { @@ -1018,13 +1020,13 @@ class CallFrameInfo::ExpressionRule: public CallFrameInfo::Rule { } Rule *Copy() const { return new ExpressionRule(*this); } private: - std::string expression_; + string expression_; }; // Rule: EXPRESSION evaluates to the address at which the register is saved. class CallFrameInfo::ValExpressionRule: public CallFrameInfo::Rule { public: - explicit ValExpressionRule(const std::string &expression) + explicit ValExpressionRule(const string &expression) : expression_(expression) { } ~ValExpressionRule() { } bool Handle(Handler *handler, uint64 address, int reg) const { @@ -1039,7 +1041,7 @@ class CallFrameInfo::ValExpressionRule: public CallFrameInfo::Rule { } Rule *Copy() const { return new ValExpressionRule(*this); } private: - std::string expression_; + string expression_; }; // A map from register numbers to rules. @@ -1220,7 +1222,7 @@ class CallFrameInfo::State { unsigned register_number; // A register number. uint64 offset; // An offset or address. long signed_offset; // A signed offset. - std::string expression; // A DWARF expression. + string expression; // A DWARF expression. }; // Parse CFI instruction operands from STATE's instruction stream as @@ -1407,7 +1409,7 @@ bool CallFrameInfo::State::ParseOperands(const char *format, if (len > bytes_left || expression_length > bytes_left - len) return ReportIncomplete(); cursor_ += len; - operands->expression = std::string(cursor_, expression_length); + operands->expression = string(cursor_, expression_length); cursor_ += expression_length; break; } @@ -1872,7 +1874,7 @@ bool CallFrameInfo::ReadCIEFields(CIE *cie) { memchr(augmentation_start, '\0', cie->end - augmentation_start); if (! augmentation_end) return ReportIncomplete(cie); cursor = static_cast(augmentation_end); - cie->augmentation = std::string(augmentation_start, + cie->augmentation = string(augmentation_start, cursor - augmentation_start); // Skip the terminating '\0'. cursor++; @@ -2260,7 +2262,7 @@ void CallFrameInfo::Reporter::UnrecognizedVersion(uint64 offset, int version) { } void CallFrameInfo::Reporter::UnrecognizedAugmentation(uint64 offset, - const std::string &aug) { + const string &aug) { fprintf(stderr, "%s: CFI frame description entry at offset 0x%llx in '%s':" " CIE specifies unrecognized augmentation: '%s'\n", -- cgit v1.2.1