mirror of
https://git.suyu.dev/suyu/breakpad.git
synced 2026-03-11 08:16:26 +00:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user