Refactor the logic of resolving source line info into helper class.

http://breakpad.appspot.com/459002/


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1068 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
SiyangXie@gmail.com 2012-10-10 21:41:52 +00:00
parent f72b9c6ff4
commit bab770045b
22 changed files with 813 additions and 926 deletions

View file

@ -40,6 +40,7 @@ namespace google_breakpad {
class Minidump;
class ProcessState;
class StackFrameSymbolizer;
class SourceLineResolverInterface;
class SymbolSupplier;
struct SystemInfo;
@ -92,37 +93,44 @@ class MinidumpProcessor {
public:
// Initializes this MinidumpProcessor. supplier should be an
// implementation of the SymbolSupplier abstract base class.
MinidumpProcessor(SymbolSupplier *supplier,
SourceLineResolverInterface *resolver);
MinidumpProcessor(SymbolSupplier* supplier,
SourceLineResolverInterface* resolver);
// Initializes the MinidumpProcessor with the option of
// enabling the exploitability framework to analyze dumps
// for probable security relevance.
MinidumpProcessor(SymbolSupplier *supplier,
SourceLineResolverInterface *resolver,
MinidumpProcessor(SymbolSupplier* supplier,
SourceLineResolverInterface* resolver,
bool enable_exploitability);
// Initializes the MinidumpProcessor with source line resolver helper, and
// the option of enabling the exploitability framework to analyze dumps
// for probable security relevance.
// Does not take ownership of resolver_helper, which must NOT be NULL.
MinidumpProcessor(StackFrameSymbolizer* stack_frame_symbolizer,
bool enable_exploitability);
~MinidumpProcessor();
// Processes the minidump file and fills process_state with the result.
ProcessResult Process(const string &minidump_file,
ProcessState *process_state);
ProcessState* process_state);
// Processes the minidump structure and fills process_state with the
// result.
ProcessResult Process(Minidump *minidump,
ProcessState *process_state);
ProcessResult Process(Minidump* minidump,
ProcessState* process_state);
// Populates the cpu_* fields of the |info| parameter with textual
// representations of the CPU type that the minidump in |dump| was
// produced on. Returns false if this information is not available in
// the minidump.
static bool GetCPUInfo(Minidump *dump, SystemInfo *info);
static bool GetCPUInfo(Minidump* dump, SystemInfo* info);
// Populates the os_* fields of the |info| parameter with textual
// representations of the operating system that the minidump in |dump|
// was produced on. Returns false if this information is not available in
// the minidump.
static bool GetOSInfo(Minidump *dump, SystemInfo *info);
static bool GetOSInfo(Minidump* dump, SystemInfo* info);
// Returns a textual representation of the reason that a crash occurred,
// if the minidump in dump was produced as a result of a crash. Returns
@ -132,7 +140,7 @@ class MinidumpProcessor {
// address when the crash was caused by problems such as illegal
// instructions or divisions by zero, or a data address when the crash
// was caused by a memory access violation.
static string GetCrashReason(Minidump *dump, u_int64_t *address);
static string GetCrashReason(Minidump* dump, u_int64_t* address);
// This function returns true if the passed-in error code is
// something unrecoverable(i.e. retry should not happen). For
@ -152,11 +160,12 @@ class MinidumpProcessor {
// Returns a textual representation of an assertion included
// in the minidump. Returns an empty string if this information
// does not exist or cannot be determined.
static string GetAssertion(Minidump *dump);
static string GetAssertion(Minidump* dump);
private:
SymbolSupplier *supplier_;
SourceLineResolverInterface *resolver_;
StackFrameSymbolizer* frame_symbolizer_;
// Indicate whether resolver_helper_ is owned by this instance.
bool own_frame_symbolizer_;
// This flag enables the exploitability scanner which attempts to
// guess how likely it is that the crash represents an exploitable