aboutsummaryrefslogtreecommitdiff
path: root/src/common/dwarf/dwarf2reader.cc
diff options
context:
space:
mode:
authormark@chromium.org <mark@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e>2011-10-11 17:59:03 +0000
committermark@chromium.org <mark@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e>2011-10-11 17:59:03 +0000
commitbc582f782b720245f1a4aed93fadbb80d0dd04db (patch)
treee3e219226ecce31a7fa1bb15ea94a5c367432202 /src/common/dwarf/dwarf2reader.cc
parentFix harmless warning in dwarf_cfi_to_module.cc. (diff)
downloadbreakpad-bc582f782b720245f1a4aed93fadbb80d0dd04db.tar.xz
Remove "using namespace std" from dwarf2reader.h. Using-directives are
forbidden by the style guide, and are bad practice in headers even under style rules that tolerate this construct. This fixes warnings such as: In file included from dwarf2reader.cc:34: dwarf2reader.h:53:17: warning: using namespace directive in global context in header [-Wheader-hygiene] Review URL: http://breakpad.appspot.com/312002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@862 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/common/dwarf/dwarf2reader.cc')
-rw-r--r--src/common/dwarf/dwarf2reader.cc29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/common/dwarf/dwarf2reader.cc b/src/common/dwarf/dwarf2reader.cc
index 63d1ffb7..b927b3fe 100644
--- a/src/common/dwarf/dwarf2reader.cc
+++ b/src/common/dwarf/dwarf2reader.cc
@@ -74,7 +74,7 @@ void CompilationUnit::ReadAbbrevs() {
iter = sections_.find("__debug_abbrev");
assert(iter != sections_.end());
- abbrevs_ = new vector<Abbrev>;
+ abbrevs_ = new std::vector<Abbrev>;
abbrevs_->resize(1);
// The only way to check whether we are reading over the end of the
@@ -121,7 +121,7 @@ void CompilationUnit::ReadAbbrevs() {
const enum DwarfAttribute name =
static_cast<enum DwarfAttribute>(nametemp);
const enum DwarfForm form = static_cast<enum DwarfForm>(formtemp);
- abbrev.attributes.push_back(make_pair(name, form));
+ abbrev.attributes.push_back(std::make_pair(name, form));
}
assert(abbrev.number == abbrevs_->size());
abbrevs_->push_back(abbrev);
@@ -493,7 +493,7 @@ void CompilationUnit::ProcessDIEs() {
else
lengthstart += 4;
- stack<uint64> die_stack;
+ std::stack<uint64> die_stack;
while (dieptr < (lengthstart + header_.length)) {
// We give the user the absolute offset from the beginning of
@@ -583,7 +583,7 @@ void LineInfo::ReadHeader() {
header_.opcode_base = reader_->ReadOneByte(lineptr);
lineptr += 1;
- header_.std_opcode_lengths = new vector<unsigned char>;
+ header_.std_opcode_lengths = new std::vector<unsigned char>;
header_.std_opcode_lengths->resize(header_.opcode_base + 1);
(*header_.std_opcode_lengths)[0] = 0;
for (int i = 1; i < header_.opcode_base; i++) {
@@ -1024,7 +1024,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 string &expression)
+ explicit ExpressionRule(const std::string &expression)
: expression_(expression) { }
~ExpressionRule() { }
bool Handle(Handler *handler, uint64 address, int reg) const {
@@ -1038,13 +1038,13 @@ class CallFrameInfo::ExpressionRule: public CallFrameInfo::Rule {
}
Rule *Copy() const { return new ExpressionRule(*this); }
private:
- string expression_;
+ std::string expression_;
};
// Rule: EXPRESSION evaluates to the address at which the register is saved.
class CallFrameInfo::ValExpressionRule: public CallFrameInfo::Rule {
public:
- explicit ValExpressionRule(const string &expression)
+ explicit ValExpressionRule(const std::string &expression)
: expression_(expression) { }
~ValExpressionRule() { }
bool Handle(Handler *handler, uint64 address, int reg) const {
@@ -1059,7 +1059,7 @@ class CallFrameInfo::ValExpressionRule: public CallFrameInfo::Rule {
}
Rule *Copy() const { return new ValExpressionRule(*this); }
private:
- string expression_;
+ std::string expression_;
};
// A map from register numbers to rules.
@@ -1096,7 +1096,7 @@ class CallFrameInfo::RuleMap {
private:
// A map from register numbers to Rules.
- typedef map<int, Rule *> RuleByNumber;
+ typedef std::map<int, Rule *> RuleByNumber;
// Remove all register rules and clear cfa_rule_.
void Clear();
@@ -1240,7 +1240,7 @@ class CallFrameInfo::State {
unsigned register_number; // A register number.
uint64 offset; // An offset or address.
long signed_offset; // A signed offset.
- string expression; // A DWARF expression.
+ std::string expression; // A DWARF expression.
};
// Parse CFI instruction operands from STATE's instruction stream as
@@ -1341,7 +1341,7 @@ class CallFrameInfo::State {
// A stack of saved states, for DW_CFA_remember_state and
// DW_CFA_restore_state.
- stack<RuleMap> saved_rules_;
+ std::stack<RuleMap> saved_rules_;
};
bool CallFrameInfo::State::InterpretCIE(const CIE &cie) {
@@ -1427,7 +1427,7 @@ bool CallFrameInfo::State::ParseOperands(const char *format,
if (len > bytes_left || expression_length > bytes_left - len)
return ReportIncomplete();
cursor_ += len;
- operands->expression = string(cursor_, expression_length);
+ operands->expression = std::string(cursor_, expression_length);
cursor_ += expression_length;
break;
}
@@ -1898,7 +1898,8 @@ bool CallFrameInfo::ReadCIEFields(CIE *cie) {
memchr(augmentation_start, '\0', cie->end - augmentation_start);
if (! augmentation_end) return ReportIncomplete(cie);
cursor = static_cast<const char *>(augmentation_end);
- cie->augmentation = string(augmentation_start, cursor - augmentation_start);
+ cie->augmentation = std::string(augmentation_start,
+ cursor - augmentation_start);
// Skip the terminating '\0'.
cursor++;
@@ -2285,7 +2286,7 @@ void CallFrameInfo::Reporter::UnrecognizedVersion(uint64 offset, int version) {
}
void CallFrameInfo::Reporter::UnrecognizedAugmentation(uint64 offset,
- const string &aug) {
+ const std::string &aug) {
fprintf(stderr,
"%s: CFI frame description entry at offset 0x%llx in '%s':"
" CIE specifies unrecognized augmentation: '%s'\n",