Refactor source line resolver, add interface in supplier and resolver.

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@711 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
SiyangXie@gmail.com
2010-10-07 20:31:36 +00:00
parent d35f113d02
commit 5b117cf53a
24 changed files with 1021 additions and 418 deletions

View File

@@ -36,6 +36,7 @@
#include "processor/simple_symbol_supplier.h"
#include <assert.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -93,6 +94,26 @@ SymbolSupplier::SymbolResult SimpleSymbolSupplier::GetSymbolFile(
return s;
}
SymbolSupplier::SymbolResult SimpleSymbolSupplier::GetCStringSymbolData(
const CodeModule *module,
const SystemInfo *system_info,
string *symbol_file,
char **symbol_data) {
assert(symbol_data);
string symbol_data_string;
SymbolSupplier::SymbolResult s =
GetSymbolFile(module, system_info, symbol_file, &symbol_data_string);
if (s == FOUND) {
unsigned int size = symbol_data_string.size() + 1;
*symbol_data = reinterpret_cast<char*>(operator new(size));
memcpy(*symbol_data, symbol_data_string.c_str(), size - 1);
(*symbol_data)[size - 1] = '\0';
}
return s;
}
SymbolSupplier::SymbolResult SimpleSymbolSupplier::GetSymbolFileAtPathFromRoot(
const CodeModule *module, const SystemInfo *system_info,
const string &root_path, string *symbol_file) {