Provide a mechanism for SymbolSuppliers to interrupt processing (#93)

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@80 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
bryner 2006-12-08 04:13:51 +00:00
parent 283fd39248
commit f33b8d2d07
13 changed files with 174 additions and 96 deletions

View file

@ -33,16 +33,19 @@
//
// Author: Mark Mentovai
#include <cassert>
#include "processor/simple_symbol_supplier.h"
#include "google_airbag/processor/code_module.h"
#include "processor/pathname_stripper.h"
namespace google_airbag {
string SimpleSymbolSupplier::GetSymbolFileAtPath(const CodeModule *module,
const string &root_path) {
SymbolSupplier::SymbolResult SimpleSymbolSupplier::GetSymbolFileAtPath(
const CodeModule *module, const string &root_path, string *symbol_file) {
assert(symbol_file);
if (!module)
return "";
return NOT_FOUND;
// Start with the base path.
string path = root_path;
@ -51,14 +54,14 @@ string SimpleSymbolSupplier::GetSymbolFileAtPath(const CodeModule *module,
path.append("/");
string debug_file_name = PathnameStripper::File(module->debug_file());
if (debug_file_name.empty())
return "";
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())
return "";
return NOT_FOUND;
path.append(identifier);
// Transform the debug file name into one ending in .sym. If the existing
@ -76,7 +79,8 @@ string SimpleSymbolSupplier::GetSymbolFileAtPath(const CodeModule *module,
}
path.append(".sym");
return path;
*symbol_file = path;
return FOUND;
}
} // namespace google_airbag