diff options
Diffstat (limited to 'src/common/linux/module.cc')
-rw-r--r-- | src/common/linux/module.cc | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/common/linux/module.cc b/src/common/linux/module.cc index a4cb3bfa..70b70ab5 100644 --- a/src/common/linux/module.cc +++ b/src/common/linux/module.cc @@ -29,6 +29,7 @@ #include <cerrno> #include <cstring> + #include "common/linux/module.h" namespace google_breakpad { @@ -62,6 +63,11 @@ void Module::AddFunctions(vector<Function *>::iterator begin, functions_.insert(functions_.end(), begin, end); } +void Module::GetFunctions(vector<Function *> *vec, + vector<Function *>::iterator i) { + vec->insert(i, functions_.begin(), functions_.end()); +} + Module::File *Module::FindFile(const string &name) { // A tricky bit here. The key of each map entry needs to be a // pointer to the entry's File's name string. This means that we @@ -90,6 +96,17 @@ Module::File *Module::FindFile(const char *name) { return FindFile(name_string); } +Module::File *Module::FindExistingFile(const string &name) { + FileByNameMap::iterator it = files_.find(&name); + return (it == files_.end()) ? NULL : it->second; +} + +void Module::GetFiles(vector<File *> *vec) { + vec->clear(); + for (FileByNameMap::iterator it = files_.begin(); it != files_.end(); it++) + vec->push_back(it->second); +} + void Module::AssignSourceIds() { // First, give every source file an id of -1. for (FileByNameMap::iterator file_it = files_.begin(); @@ -129,8 +146,9 @@ bool Module::Write(FILE *stream) { name_.c_str())) return ReportError(); - // Write out files. AssignSourceIds(); + + // Write out files. for (FileByNameMap::iterator file_it = files_.begin(); file_it != files_.end(); file_it++) { File *file = file_it->second; |