mirror of
https://git.suyu.dev/suyu/breakpad.git
synced 2026-03-10 15:26:28 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user