mirror of
https://git.suyu.dev/suyu/breakpad.git
synced 2025-12-26 01:05:07 +01: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:
parent
d35f113d02
commit
5b117cf53a
24 changed files with 1021 additions and 418 deletions
|
|
@ -27,59 +27,56 @@
|
|||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
// BasicSourceLineResolver implements SourceLineResolverInterface, using
|
||||
// address map files produced by a compatible writer, e.g. PDBSourceLineWriter.
|
||||
// basic_source_line_resolver.h: BasicSourceLineResolver is derived from
|
||||
// SourceLineResolverBase, and is a concrete implementation of
|
||||
// SourceLineResolverInterface, using address map files produced by a
|
||||
// compatible writer, e.g. PDBSourceLineWriter.
|
||||
//
|
||||
// see "processor/source_line_resolver_base.h"
|
||||
// and "source_line_resolver_interface.h" for more documentation.
|
||||
|
||||
#ifndef GOOGLE_BREAKPAD_PROCESSOR_BASIC_SOURCE_LINE_RESOLVER_H__
|
||||
#define GOOGLE_BREAKPAD_PROCESSOR_BASIC_SOURCE_LINE_RESOLVER_H__
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "google_breakpad/processor/source_line_resolver_interface.h"
|
||||
#include "google_breakpad/processor/source_line_resolver_base.h"
|
||||
|
||||
namespace google_breakpad {
|
||||
|
||||
using std::string;
|
||||
using std::map;
|
||||
|
||||
class BasicSourceLineResolver : public SourceLineResolverInterface {
|
||||
class BasicSourceLineResolver : public SourceLineResolverBase {
|
||||
public:
|
||||
BasicSourceLineResolver();
|
||||
virtual ~BasicSourceLineResolver();
|
||||
virtual ~BasicSourceLineResolver() { }
|
||||
|
||||
// SourceLineResolverInterface methods, see source_line_resolver_interface.h
|
||||
// for more details.
|
||||
|
||||
// Adds a module to this resolver, returning true on success.
|
||||
// The given map_file is read into memory, and its symbols will be
|
||||
// retained until the BasicSourceLineResolver is destroyed.
|
||||
virtual bool LoadModule(const CodeModule *module, const string &map_file);
|
||||
|
||||
// Exactly the same as above, except the given map_buffer is used
|
||||
// for symbols.
|
||||
virtual bool LoadModuleUsingMapBuffer(const CodeModule *module,
|
||||
const string &map_buffer);
|
||||
|
||||
void UnloadModule(const CodeModule *module);
|
||||
virtual bool HasModule(const CodeModule *module);
|
||||
virtual void FillSourceLineInfo(StackFrame *frame);
|
||||
virtual WindowsFrameInfo *FindWindowsFrameInfo(const StackFrame *frame);
|
||||
virtual CFIFrameInfo *FindCFIFrameInfo(const StackFrame *frame);
|
||||
using SourceLineResolverBase::LoadModule;
|
||||
using SourceLineResolverBase::LoadModuleUsingMapBuffer;
|
||||
using SourceLineResolverBase::LoadModuleUsingMemoryBuffer;
|
||||
using SourceLineResolverBase::UnloadModule;
|
||||
using SourceLineResolverBase::HasModule;
|
||||
using SourceLineResolverBase::FillSourceLineInfo;
|
||||
using SourceLineResolverBase::FindWindowsFrameInfo;
|
||||
using SourceLineResolverBase::FindCFIFrameInfo;
|
||||
|
||||
private:
|
||||
template<class T> class MemAddrMap;
|
||||
struct Line;
|
||||
// friend declarations:
|
||||
friend class BasicModuleFactory;
|
||||
|
||||
// Function derives from SourceLineResolverBase::Function.
|
||||
struct Function;
|
||||
struct PublicSymbol;
|
||||
struct File;
|
||||
struct CompareString {
|
||||
bool operator()(const string &s1, const string &s2) const;
|
||||
};
|
||||
// Module implements SourceLineResolverBase::Module interface.
|
||||
class Module;
|
||||
|
||||
// All of the modules we've loaded
|
||||
typedef map<string, Module*, CompareString> ModuleMap;
|
||||
ModuleMap *modules_;
|
||||
// Helper method.
|
||||
virtual void DeleteDataAfterLoad(char *symbol_data);
|
||||
// No-op helper methods.
|
||||
virtual void DeleteDataUnload(const CodeModule *module) { }
|
||||
virtual void ClearLocalMemory() { }
|
||||
virtual void StoreDataBeforeLoad(const CodeModule *module,
|
||||
char *symbol_data) { }
|
||||
|
||||
// Disallow unwanted copy ctor and assignment operator
|
||||
BasicSourceLineResolver(const BasicSourceLineResolver&);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue