Add logging to minidump processor (#82). Part 2: add messages to the rest of

the processor.  r=ted.mielczarek

http://groups.google.com/group/google-breakpad-dev/browse_thread/thread/cf56b767383a5d4b


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@172 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
mmentovai
2007-05-21 20:09:33 +00:00
parent 08c8c4ddcf
commit 65571f17ed
17 changed files with 265 additions and 60 deletions

View File

@@ -41,6 +41,7 @@
#include "processor/simple_symbol_supplier.h"
#include "google_breakpad/processor/code_module.h"
#include "google_breakpad/processor/system_info.h"
#include "processor/logging.h"
#include "processor/pathname_stripper.h"
namespace google_breakpad {
@@ -53,7 +54,11 @@ static bool file_exists(const string &file_name) {
SymbolSupplier::SymbolResult SimpleSymbolSupplier::GetSymbolFile(
const CodeModule *module, const SystemInfo *system_info,
string *symbol_file) {
BPLOG_IF(ERROR, !symbol_file) << "SimpleSymbolSupplier::GetSymbolFile "
"requires |symbol_file|";
assert(symbol_file);
symbol_file->clear();
for (unsigned int path_index = 0; path_index < paths_.size(); ++path_index) {
SymbolResult result;
if ((result = GetSymbolFileAtPath(module, system_info, paths_[path_index],
@@ -67,7 +72,11 @@ SymbolSupplier::SymbolResult SimpleSymbolSupplier::GetSymbolFile(
SymbolSupplier::SymbolResult SimpleSymbolSupplier::GetSymbolFileAtPath(
const CodeModule *module, const SystemInfo *system_info,
const string &root_path, string *symbol_file) {
BPLOG_IF(ERROR, !symbol_file) << "SimpleSymbolSupplier::GetSymbolFileAtPath "
"requires |symbol_file|";
assert(symbol_file);
symbol_file->clear();
if (!module)
return NOT_FOUND;
@@ -77,15 +86,24 @@ SymbolSupplier::SymbolResult SimpleSymbolSupplier::GetSymbolFileAtPath(
// Append the debug (pdb) file name as a directory name.
path.append("/");
string debug_file_name = PathnameStripper::File(module->debug_file());
if (debug_file_name.empty())
if (debug_file_name.empty()) {
BPLOG(ERROR) << "Can't construct symbol file path without debug_file "
"(code_file = " <<
PathnameStripper::File(module->code_file()) << ")";
return NOT_FOUND;
}
path.append(debug_file_name);
// Append the identifier as a directory name.
path.append("/");
string identifier = module->debug_identifier();
if (identifier.empty())
if (identifier.empty()) {
BPLOG(ERROR) << "Can't construct symbol file path without debug_identifier "
"(code_file = " <<
PathnameStripper::File(module->code_file()) <<
", debug_file = " << debug_file_name << ")";
return NOT_FOUND;
}
path.append(identifier);
// Transform the debug file name into one ending in .sym. If the existing
@@ -103,8 +121,10 @@ SymbolSupplier::SymbolResult SimpleSymbolSupplier::GetSymbolFileAtPath(
}
path.append(".sym");
if (!file_exists(path))
if (!file_exists(path)) {
BPLOG(INFO) << "No symbol file at " << path;
return NOT_FOUND;
}
*symbol_file = path;
return FOUND;