aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorted.mielczarek@gmail.com <ted.mielczarek@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e>2013-03-04 15:42:50 +0000
committerted.mielczarek@gmail.com <ted.mielczarek@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e>2013-03-04 15:42:50 +0000
commitc02002a58184d9281a92ff6cd2606d6ba1dfb483 (patch)
tree81b839d357f29a0886fed2c1733066ecfdbea1bf /src
parentRemove unnecessary #include unistd.h (diff)
downloadbreakpad-c02002a58184d9281a92ff6cd2606d6ba1dfb483.tar.xz
Work around Windows headers #defining ERROR by renaming enum values in StackFrameSymbolizer
Patch by Julian Seward <jseward@acm.org>, R=ted git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1120 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src')
-rw-r--r--src/google_breakpad/processor/stack_frame_symbolizer.h6
-rw-r--r--src/processor/stack_frame_symbolizer.cc24
-rw-r--r--src/processor/stackwalker.cc4
3 files changed, 17 insertions, 17 deletions
diff --git a/src/google_breakpad/processor/stack_frame_symbolizer.h b/src/google_breakpad/processor/stack_frame_symbolizer.h
index e862ff6f..6f89167e 100644
--- a/src/google_breakpad/processor/stack_frame_symbolizer.h
+++ b/src/google_breakpad/processor/stack_frame_symbolizer.h
@@ -56,13 +56,13 @@ class StackFrameSymbolizer {
enum SymbolizerResult {
// Symbol data was found and successfully loaded in resolver.
// This does NOT guarantee source line info is found within symbol file.
- NO_ERROR,
+ kNoError,
// This indicates non-critical error, such as, no code module found for
// frame's instruction, no symbol file, or resolver failed to load symbol.
- ERROR,
+ kError,
// This indicates error for which stack walk should be interrupted
// and retried in future.
- INTERRUPT
+ kInterrupt
};
StackFrameSymbolizer(SymbolSupplier* supplier,
diff --git a/src/processor/stack_frame_symbolizer.cc b/src/processor/stack_frame_symbolizer.cc
index 03e14504..8e020c98 100644
--- a/src/processor/stack_frame_symbolizer.cc
+++ b/src/processor/stack_frame_symbolizer.cc
@@ -59,27 +59,27 @@ StackFrameSymbolizer::SymbolizerResult StackFrameSymbolizer::FillSourceLineInfo(
StackFrame* frame) {
assert(frame);
- if (!modules) return ERROR;
+ if (!modules) return kError;
const CodeModule* module = modules->GetModuleForAddress(frame->instruction);
- if (!module) return ERROR;
+ if (!module) return kError;
frame->module = module;
- if (!resolver_) return ERROR; // no resolver.
+ if (!resolver_) return kError; // no resolver.
// If module is known to have missing symbol file, return.
if (no_symbol_modules_.find(module->code_file()) !=
no_symbol_modules_.end()) {
- return ERROR;
+ return kError;
}
// If module is already loaded, go ahead to fill source line info and return.
if (resolver_->HasModule(frame->module)) {
resolver_->FillSourceLineInfo(frame);
- return NO_ERROR;
+ return kNoError;
}
// Module needs to fetch symbol file. First check to see if supplier exists.
if (!supplier_) {
- return ERROR;
+ return kError;
}
// Start fetching symbol from supplier.
@@ -98,26 +98,26 @@ StackFrameSymbolizer::SymbolizerResult StackFrameSymbolizer::FillSourceLineInfo(
if (load_success) {
resolver_->FillSourceLineInfo(frame);
- return NO_ERROR;
+ return kNoError;
} else {
BPLOG(ERROR) << "Failed to load symbol file in resolver.";
no_symbol_modules_.insert(module->code_file());
- return ERROR;
+ return kError;
}
}
case SymbolSupplier::NOT_FOUND:
no_symbol_modules_.insert(module->code_file());
- return ERROR;
+ return kError;
case SymbolSupplier::INTERRUPT:
- return INTERRUPT;
+ return kInterrupt;
default:
BPLOG(ERROR) << "Unknown SymbolResult enum: " << symbol_result;
- return ERROR;
+ return kError;
}
- return ERROR;
+ return kError;
}
WindowsFrameInfo* StackFrameSymbolizer::FindWindowsFrameInfo(
diff --git a/src/processor/stackwalker.cc b/src/processor/stackwalker.cc
index 37664d41..58289425 100644
--- a/src/processor/stackwalker.cc
+++ b/src/processor/stackwalker.cc
@@ -90,7 +90,7 @@ bool Stackwalker::Walk(CallStack* stack) {
StackFrameSymbolizer::SymbolizerResult symbolizer_result =
frame_symbolizer_->FillSourceLineInfo(modules_, system_info_,
frame.get());
- if (symbolizer_result == StackFrameSymbolizer::INTERRUPT) {
+ if (symbolizer_result == StackFrameSymbolizer::kInterrupt) {
BPLOG(INFO) << "Stack walk is interrupted.";
return false;
}
@@ -185,7 +185,7 @@ bool Stackwalker::InstructionAddressSeemsValid(u_int64_t address) {
return true;
}
- if (symbolizer_result != StackFrameSymbolizer::NO_ERROR) {
+ if (symbolizer_result != StackFrameSymbolizer::kNoError) {
// Some error occurred during symbolization, but the address is within a
// known module
return true;